:root {
  --navy: #0F172A;
  --slate: #64748B;
  --blue: #2563EB;
  --blue-dark: #1D4ED8;
  --bg: #F8FAFC;
  --border: #E2E8F0;
  --green-bg: #D1FAE5; --green-fg: #065F46;
  --orange-bg: #FEF3C7; --orange-fg: #92400E;
  --red-bg: #FEE2E2; --red-fg: #991B1B;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #1E293B;
  margin: 0;
  padding: 24px;
}

.container { max-width: 900px; margin: 0 auto; }

.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--slate);
}

.topbar select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

h1 {
  color: var(--navy);
  font-size: 22px;
  margin-bottom: 2px;
}

.subtitle {
  color: var(--slate);
  font-size: 13px;
  margin-bottom: 20px;
}

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.card-title {
  font-weight: bold;
  color: #1E293B;
  font-size: 14px;
  margin-bottom: 8px;
}

.card input[type="file"] {
  width: 100%;
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: #FAFBFC;
}

/* Bouton de fichier personnalisé et traduit : le bouton natif du navigateur
   ("Choisir un fichier"/"Browse"/...) est affiché dans la langue du
   NAVIGATEUR, pas celle choisie dans l'application. On masque donc l'input
   natif (tout en le gardant accessible au clavier) et on affiche à la
   place un bouton stylé dont le texte suit la langue sélectionnée. */
.file-input-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.file-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.file-btn {
  display: inline-block;
  background: #E2E8F0;
  color: #334155;
  font-size: 13px;
  font-weight: bold;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
}
.file-btn:hover { background: #CBD5E1; }

.file-input-visually-hidden:focus-visible ~ .file-input-row .file-btn {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.file-name {
  font-size: 13px;
  color: var(--slate);
  word-break: break-all;
}

.card input[type="text"] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  width: 160px;
}

label.field-label {
  font-weight: bold;
  font-size: 13px;
  color: #1E293B;
  display: block;
  margin-bottom: 6px;
}

.btn-primary {
  display: block;
  width: 100%;
  background: var(--blue);
  color: white;
  border: none;
  padding: 12px;
  font-size: 15px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 8px;
}
.btn-primary:hover { background: var(--blue-dark); }

.btn-secondary {
  display: inline-block;
  margin-top: 14px;
  color: var(--blue);
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
}

.error-box {
  background: #FEE2E2;
  border: 1px solid #EF4444;
  color: #991B1B;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}

.notice-box {
  background: #EFF6FF;
  border: 1px solid #93C5FD;
  color: #1E40AF;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 13px;
}

.summary {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.summary .pill {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
}
.pill.total { background: #E2E8F0; color: #334155; }
.pill.green { background: var(--green-bg); color: var(--green-fg); }
.pill.orange { background: var(--orange-bg); color: var(--orange-fg); }
.pill.red { background: var(--red-bg); color: var(--red-fg); }

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
}

th {
  background: var(--navy);
  color: white;
  text-align: left;
  padding: 10px 12px;
}

td {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}

tr.OK_GREEN td:nth-child(2) { color: var(--green-fg); font-weight: bold; }
tr.WARN_ORANGE td:nth-child(2) { color: var(--orange-fg); font-weight: bold; }
tr.MATCH_RED td:nth-child(2) { color: var(--red-fg); font-weight: bold; }

tr.OK_GREEN { background: #F0FDF9; }
tr.WARN_ORANGE { background: #FFFBEB; }
tr.MATCH_RED { background: #FEF2F2; }

/* ---------- Phase 2 : comptes, connexion, admin ---------- */

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--slate);
}
.navbar-links a {
  color: var(--blue);
  text-decoration: none;
  font-weight: bold;
  margin-left: 16px;
}

.auth-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  max-width: 420px;
  margin: 40px auto;
}
.auth-card.wide { max-width: 560px; }

.full-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
}

.code-input {
  letter-spacing: 6px;
  font-size: 22px;
  text-align: center;
  font-weight: bold;
}

.hint-text {
  color: var(--slate);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
}
.hint-text.small { font-size: 12px; margin: 4px 0 0 0; }

.secret-box {
  background: var(--navy);
  color: #D1FAE5;
  font-family: Consolas, monospace;
  font-size: 20px;
  letter-spacing: 2px;
  text-align: center;
  padding: 16px;
  border-radius: 8px;
  margin: 10px 0;
  word-break: break-all;
}

.notice-box.amber {
  background: #FFFBEB;
  border-color: #F59E0B;
  color: #92400E;
  word-break: break-all;
}

.badge-admin {
  background: var(--navy);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  vertical-align: middle;
}

.actions-cell { white-space: nowrap; }

.btn-mini {
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  margin-right: 6px;
  background: #E2E8F0;
  color: #334155;
}
.btn-mini.btn-amber { background: var(--orange-bg); color: var(--orange-fg); }
.btn-mini.btn-green { background: var(--green-bg); color: var(--green-fg); }
.btn-mini.btn-red { background: var(--red-bg); color: var(--red-fg); }

tr.status-suspended { opacity: 0.7; }
tr.status-invited td:first-child { font-style: italic; }
