/* ============================================================
   OPÉRATION DEVISE – Action Sociale des Armées
   Thème clair, professionnel, institutionnel
   Palette : Bleu marine #1d4ed8 · Rouge #dc2626 · Fond #f1f5f9
   ============================================================ */

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}

:root {
  --blue:       #1d4ed8;
  --blue-dark:  #1e3a8a;
  --blue-light: #3b82f6;
  --blue-bg:    #eff6ff;
  --red:        #dc2626;
  --red-light:  #fee2e2;
  --gold:       #b45309;
  --gold-light: #fef3c7;
  --green:      #16a34a;
  --green-bg:   #dcfce7;
  --orange:     #d97706;
  --bg:         #f1f5f9;
  --surface:    #ffffff;
  --surface2:   #f8fafc;
  --border:     #e2e8f0;
  --border2:    #cbd5e1;
  --text:       #0f172a;
  --text-md:    #334155;
  --text-muted: #64748b;
  --radius:     12px;
  --shadow:     0 2px 12px rgba(15,23,42,.08);
  --shadow-md:  0 4px 24px rgba(15,23,42,.12);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ============================================================
   SHARED COMPONENTS
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.btn-validate {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 11px 24px;
  border-radius: 8px;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.btn-validate:hover { background: var(--blue-dark); }
.btn-validate:disabled { opacity: .5; cursor: not-allowed; }
.btn-validate.btn-final {
  font-size: 1rem;
  padding: 14px 32px;
  background: #059669;
  width: 100%;
}
.btn-validate.btn-final:hover { background: #047857; }

.btn-skip {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border2);
  padding: 11px 18px;
  border-radius: 8px;
  font-size: .88rem;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn-skip:hover { border-color: var(--blue); color: var(--blue); }

.feedback {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
  min-height: 0;
}
.feedback:empty { display: none; }
.fb-ok  { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.fb-err { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

.hidden { display: none !important; }

/* ============================================================
   REGISTER PAGE
   ============================================================ */
.page-register {
  background: var(--bg);
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

.register-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Left: hero */
.register-hero {
  flex: 1;
  background: linear-gradient(160deg, var(--blue-dark) 0%, var(--blue) 60%, #1e40af 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
}

.register-hero-inner {
  max-width: 440px;
  text-align: center;
}

.event-badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.hero-logo { height: 64px; margin-bottom: 16px; }

.register-hero-inner h1 {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1.1;
  margin-bottom: 6px;
}
.register-hero-inner h1 span { color: var(--gold-light); }

.hero-sub { font-size: 1rem; opacity: .85; margin-bottom: 28px; line-height: 1.5; }

/* Scenario card */
.scenario-card {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius);
  padding: 20px;
  text-align: left;
  margin-bottom: 28px;
}
.scenario-icon { font-size: 1.8rem; margin-bottom: 8px; }
.scenario-card h3 { font-size: .8rem; letter-spacing: .14em; color: var(--gold-light); margin-bottom: 12px; }
.scenario-card p { font-size: .9rem; opacity: .9; margin-bottom: 8px; }
.scenario-card p:last-of-type { margin-bottom: 0; }
.scenario-card strong { color: #fff; font-weight: 600; }

.scenario-warning {
  margin-top: 12px;
  background: rgba(220,38,38,.2);
  border: 1px solid rgba(220,38,38,.4);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .82rem;
  color: #fca5a5;
}

.mission-stats {
  display: flex;
  gap: 24px;
  justify-content: center;
}
.mission-stats div { text-align: center; }
.mission-stats span { display: block; font-size: 2rem; font-weight: 700; color: var(--gold-light); }
.mission-stats small { font-size: .75rem; opacity: .75; letter-spacing: .08em; text-transform: uppercase; }

/* Right: form */
.register-form-panel {
  width: 420px;
  min-width: 380px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 36px;
}
.register-form-inner { width: 100%; }
.register-form-inner h2 { font-size: 1.3rem; letter-spacing: .1em; margin-bottom: 6px; }
.form-subtitle { font-size: .88rem; color: var(--text-muted); margin-bottom: 28px; }

.field-group { margin-bottom: 18px; }
.field-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-md); margin-bottom: 6px; letter-spacing: .04em; }
.field-group input, .field-group select {
  width: 100%;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 8px;
  font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
}
.field-group input:focus, .field-group select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}

.btn-mission {
  width: 100%;
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .08em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background .15s, transform .1s;
  margin-top: 8px;
}
.btn-mission:hover { background: var(--blue-dark); transform: translateY(-1px); }
.btn-mission:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-arrow { font-size: 1.1rem; }

.privacy-note { font-size: .75rem; color: var(--text-muted); text-align: center; margin-top: 12px; }

/* ============================================================
   GAME PAGE
   ============================================================ */
.page-game { padding-top: 0; }

/* Top bar */
.game-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 2px solid var(--blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  box-shadow: var(--shadow);
  gap: 16px;
}
.game-bar-left, .game-bar-right { display: flex; flex-direction: column; min-width: 90px; }
.game-bar-right { align-items: flex-end; }
.game-bar-center { flex: 1; display: flex; flex-direction: column; align-items: center; }
.gb-label { font-size: .68rem; letter-spacing: .14em; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.gb-val { font-size: 1rem; font-weight: 700; color: var(--text); }
.timer-val { font-family: 'Courier New', monospace; font-size: 1.2rem; color: var(--blue); }

/* Progress dots */
.progress-dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--border2);
  transition: all .2s;
}
.dot-active  { background: var(--blue); transform: scale(1.3); box-shadow: 0 0 0 2px rgba(29,78,216,.3); }
.dot-solved  { background: var(--green); }
.dot-skipped { background: var(--orange); }

/* Mission banner */
.mission-banner {
  position: fixed;
  top: 69px; left: 0; right: 0;
  z-index: 99;
  background: #fff7ed;
  border-bottom: 1px solid #fed7aa;
  padding: 7px 24px;
  font-size: .8rem;
  color: #92400e;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mission-banner-dot {
  width: 8px; height: 8px;
  background: #f97316;
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
}
@keyframes pulse-dot { 0%,100%{opacity:1;} 50%{opacity:.4;} }

/* Game main */
.game-main { padding-top: 110px; padding-bottom: 60px; }
.game-container { max-width: 760px; margin: 0 auto; padding: 24px 16px; }

/* Enigma sections */
.enigma { animation: slide-in .35s ease; }
.enigma.hidden { display: none; }
@keyframes slide-in { from{opacity:0;transform:translateY(16px);} to{opacity:1;transform:translateY(0);} }

.enigma-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.e-num { font-size: .72rem; font-weight: 700; letter-spacing: .15em; color: var(--blue); }
.e-cat {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  background: var(--blue-bg);
  color: var(--blue);
  padding: 3px 12px;
  border-radius: 20px;
}

.story-strip {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 10px 16px;
  font-size: .88rem;
  color: #78350f;
  margin-bottom: 14px;
}
.story-strip.urgent {
  background: #fff1f2;
  border-color: #fecdd3;
  border-left-color: var(--red);
  color: #9f1239;
  font-weight: 600;
}

.enigma .card h2 { font-size: 1.3rem; margin-bottom: 16px; color: var(--text); }

.enigma-body { margin-bottom: 20px; font-size: .93rem; color: var(--text-md); }
.enigma-body p { margin-bottom: 10px; }

.clue-box {
  background: var(--blue-bg);
  border: 1px solid #bfdbfe;
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  margin: 12px 0;
  font-size: .88rem;
}
.clue-title { font-weight: 700; font-size: .78rem; letter-spacing: .08em; color: var(--blue); margin-bottom: 6px; text-transform: uppercase; }
.clue-box p { margin-bottom: 6px; }
.clue-box p:last-child { margin-bottom: 0; }

.question-label { color: var(--text); font-weight: 600; margin-top: 14px; }

.answer-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.ans-input {
  flex: 1;
  min-width: 180px;
  border: 1.5px solid var(--border2);
  background: var(--surface2);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 8px;
  font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
}
.ans-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,78,216,.1); }

/* Checkbox / Radio grids */
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}

.cb-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: .87rem;
  transition: all .15s;
  line-height: 1.4;
}
.cb-item:hover { border-color: var(--blue); background: var(--blue-bg); }
.cb-item input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--blue);
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}
.cb-item:has(input:checked) { border-color: var(--blue); background: var(--blue-bg); }

.radio-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.radio-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: .9rem;
  transition: all .15s;
}
.radio-item:hover { border-color: var(--blue); background: var(--blue-bg); }
.radio-item input[type="radio"] {
  width: 16px; height: 16px;
  accent-color: var(--blue);
  margin-top: 2px;
  flex-shrink: 0;
}
.radio-item:has(input:checked) { border-color: var(--blue); background: var(--blue-bg); }

.select-hint { font-size: .8rem; color: var(--text-muted); font-style: italic; }

/* Antenne */
.antenne-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 12px 0; }
.antenne-group strong { display: block; font-size: .8rem; letter-spacing: .06em; color: var(--text-md); margin-bottom: 6px; }
.antenne-list { display: flex; flex-direction: column; gap: 4px; }
.antenne-btn {
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text-md);
  padding: 7px 12px;
  border-radius: 6px;
  text-align: left;
  font-size: .82rem;
  cursor: pointer;
  transition: all .15s;
}
.antenne-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-bg); }
.antenne-btn.selected { border-color: var(--blue); background: var(--blue-bg); color: var(--blue); font-weight: 600; }
.antenne-selected { font-size: .85rem; font-weight: 600; color: var(--text-muted); margin-top: 8px; }

/* Insigne options */
.insigne-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 14px 0;
}
.insigne-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  background: var(--surface2);
}
.insigne-card:hover { border-color: var(--blue); background: var(--blue-bg); }
.insigne-card.selected { border-color: var(--blue); background: var(--blue-bg); box-shadow: 0 0 0 3px rgba(29,78,216,.15); }
.insigne-art { width: 80px; height: 80px; margin: 0 auto 8px; }
.insigne-art svg { width: 100%; height: 100%; }
.insigne-card p { font-weight: 700; font-size: .85rem; color: var(--text); margin-bottom: 2px; }
.insigne-card small { font-size: .72rem; color: var(--text-muted); }

/* Final enigma terminal */
.terminal-display {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #334155;
  margin-bottom: 16px;
  font-family: 'Courier New', monospace;
}
.terminal-header {
  background: #1e293b;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.terminal-dot { width: 12px; height: 12px; border-radius: 50%; }
.terminal-dot.red    { background: #ef4444; }
.terminal-dot.orange { background: #f97316; }
.terminal-dot.green  { background: #22c55e; }
.terminal-title { color: #94a3b8; font-size: .8rem; margin-left: 4px; }

.terminal-body {
  background: #0f172a;
  padding: 16px;
}
.terminal-line { font-size: .85rem; color: #94a3b8; margin-bottom: 6px; }
.terminal-line strong { color: #fbbf24; }
.terminal-line.waiting { color: #22c55e; animation: blink .8s infinite; }
@keyframes blink { 50%{opacity:.5;} }

.terminal-code-display { margin: 14px 0; display: flex; flex-direction: column; gap: 10px; }
.code-word { display: flex; gap: 4px; flex-wrap: wrap; }
.code-letter {
  width: 28px; height: 32px;
  background: #1e3a8a;
  border: 1px solid #3b82f6;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  font-weight: 700;
  color: #93c5fd;
}
.code-letter.masked { background: #1e293b; border-color: #334155; color: #475569; }

.final-inputs { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.final-ans { border-radius: 8px; }

/* Success overlay (inter-enigma) */
.overlay-success {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.overlay-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.overlay-icon { font-size: 3rem; margin-bottom: 12px; }
.overlay-content h3 { font-size: 1.4rem; margin-bottom: 8px; }
.overlay-content p { color: var(--text-muted); margin-bottom: 20px; line-height: 1.65; font-size: .93rem; }
.overlay-content p strong { color: var(--text); }
.btn-continue {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 13px 28px;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-continue:hover { background: var(--blue-dark); }

/* ============================================================
   SUCCESS PAGE
   ============================================================ */
.page-success { background: var(--bg); padding: 40px 16px; }

.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.confetti-piece { position: absolute; top: -10px; animation: confetti-fall linear forwards; }
@keyframes confetti-fall { 0%{transform:translateY(0) rotate(0);opacity:1;} 100%{transform:translateY(100vh) rotate(720deg);opacity:0;} }

.success-wrapper { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }

.success-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.success-header {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: #fff;
  padding: 48px 32px;
  text-align: center;
}
.success-badge { font-size: 4rem; margin-bottom: 12px; }
.success-header h1 { font-size: 2.2rem; font-weight: 900; letter-spacing: .08em; margin-bottom: 6px; }
.success-sub { font-size: 1.1rem; opacity: .9; margin-bottom: 6px; }
.success-desc { font-size: .9rem; opacity: .8; max-width: 480px; margin: 0 auto; }

.score-row {
  display: flex;
  justify-content: center;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.score-item {
  flex: 1;
  text-align: center;
  padding: 20px 16px;
  border-right: 1px solid var(--border);
}
.score-item:last-child { border-right: none; }
.score-num { display: block; font-size: 1.8rem; font-weight: 700; color: var(--blue); }
.score-lbl { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; }

.devises-block { padding: 32px; border-bottom: 1px solid var(--border); }
.devises-block h2 { font-size: 1.1rem; text-align: center; margin-bottom: 24px; color: var(--text-muted); letter-spacing: .05em; }

.devises-row { display: flex; gap: 16px; flex-wrap: wrap; }
.devise {
  flex: 1; min-width: 200px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}
.devise-num {
  width: 32px; height: 32px;
  background: var(--blue);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
  margin-bottom: 10px;
}
.devise h3 { color: var(--blue); font-size: .95rem; letter-spacing: .08em; margin-bottom: 8px; }
.devise p { font-size: .82rem; color: var(--text-muted); line-height: 1.5; }

.info-block { padding: 32px; border-bottom: 1px solid var(--border); }
.info-block h2 { font-size: 1rem; margin-bottom: 16px; color: var(--text); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.info-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .82rem;
  color: var(--text-md);
}
.info-icon { font-size: 1.1rem; flex-shrink: 0; }
.contact-block {
  background: var(--blue-bg);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: .85rem;
  line-height: 1.6;
}

.success-footer { padding: 24px 32px; text-align: center; }
.success-footer p { color: var(--text-muted); font-size: .9rem; margin-bottom: 16px; }
.btn-replay {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text-md);
  padding: 10px 24px;
  border-radius: 8px;
  font-size: .9rem;
  cursor: pointer;
  transition: all .15s;
}
.btn-replay:hover { border-color: var(--blue); color: var(--blue); }

/* ============================================================
   DASHBOARD
   ============================================================ */
.page-dashboard {
  background: var(--bg);
  overflow: hidden;
}

/* Login overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.7);
  backdrop-filter: blur(6px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.login-logo { font-size: 2.5rem; margin-bottom: 12px; }
.login-card h2 { font-size: 1.2rem; letter-spacing: .08em; margin-bottom: 4px; }
.login-card > p { font-size: .85rem; color: var(--text-muted); margin-bottom: 24px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
#adminPwd {
  border: 1.5px solid var(--border2);
  background: var(--surface2);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: .95rem;
  text-align: center;
  transition: border-color .15s;
}
#adminPwd:focus { outline: none; border-color: var(--blue); }
.btn-login {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .06em;
  cursor: pointer;
  transition: background .15s;
}
.btn-login:hover { background: var(--blue-dark); }
.login-err { color: var(--red); font-size: .85rem; margin-top: 8px; }

/* Dash layout */
.dash-layout {
  height: 100vh;
  overflow: hidden;
  display: flex;
}

.dash-sidebar {
  width: 230px;
  min-width: 230px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo { font-size: 1.8rem; }
.sidebar-title { font-size: .85rem; font-weight: 700; letter-spacing: .05em; color: var(--blue); }
.sidebar-sub { font-size: .72rem; color: var(--text-muted); }
.dash-sidebar nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: .88rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}
.nav-link:hover, .nav-link.active { background: var(--blue-bg); color: var(--blue); font-weight: 600; }

.sidebar-bottom { padding: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.refresh-info { display: flex; align-items: center; gap: 8px; }
.btn-refresh {
  background: var(--blue-bg);
  border: 1px solid #bfdbfe;
  color: var(--blue);
  padding: 7px 12px;
  border-radius: 6px;
  font-size: .8rem;
  cursor: pointer;
  transition: background .15s;
}
.btn-refresh:hover { background: #dbeafe; }
#last-update { font-size: .72rem; color: var(--text-muted); }
.btn-logout {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text-muted);
  padding: 7px;
  border-radius: 6px;
  font-size: .78rem;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

.dash-content { flex: 1; overflow-y: auto; padding: 28px 32px; }
.tab-panel { max-width: 1100px; }
.dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.dash-header h1 { font-size: 1.5rem; display: flex; align-items: center; gap: 14px; }
.badge-date { font-size: .72rem; background: var(--red); color: #fff; padding: 4px 12px; border-radius: 20px; font-weight: 600; letter-spacing: .08em; }
.header-actions { display: flex; gap: 10px; }
#search-input {
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: .88rem;
  width: 240px;
}
#search-input:focus { outline: none; border-color: var(--blue); }
.btn-export {
  background: var(--green-bg);
  border: 1px solid #86efac;
  color: var(--green);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-export:hover { background: #bbf7d0; }

/* KPIs */
.kpi-row { display: flex; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.kpi {
  flex: 1; min-width: 120px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow);
}
.kpi-green { border-color: #86efac; background: var(--green-bg); }
.kpi-icon { font-size: 1.4rem; margin-bottom: 6px; }
.kpi-num { font-size: 1.8rem; font-weight: 700; color: var(--blue); }
.kpi-green .kpi-num { color: var(--green); }
.kpi-lbl { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

/* Charts */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.chart-box.full { grid-column: 1 / -1; }
.chart-box h3 { font-size: .85rem; color: var(--text-muted); margin-bottom: 16px; letter-spacing: .05em; }

/* Table */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .84rem; }
thead th { background: var(--surface2); padding: 11px 12px; text-align: left; font-size: .74rem; letter-spacing: .07em; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; font-weight: 600; }
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover { background: var(--surface2); }
.row-done { background: #f0fdf4; }
.row-progress { background: #eff6ff; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .72rem; font-weight: 600; }
.badge.green  { background: var(--green-bg); color: var(--green); }
.badge.orange { background: #fff7ed; color: #c2410c; }
.badge.blue   { background: var(--blue-bg); color: var(--blue); }
.badge.gray   { background: #f1f5f9; color: var(--text-muted); }

/* Enigma analysis cards */
.enigma-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.e-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; box-shadow: var(--shadow); }
.e-card-num { font-size: .7rem; letter-spacing: .14em; color: var(--blue); font-weight: 700; margin-bottom: 2px; }
.e-card-name { font-size: .78rem; font-weight: 600; color: var(--text); margin-bottom: 10px; min-height: 34px; line-height: 1.3; }
.e-card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.e-card-stats div { text-align: center; }
.e-card-stats strong { display: block; font-size: 1.1rem; font-weight: 700; }
.e-card-stats small { font-size: .68rem; color: var(--text-muted); }
.e-bar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.e-bar div { height: 100%; border-radius: 3px; transition: width .5s ease; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .register-hero { display: none; }
  .register-form-panel { width: 100%; max-width: 100%; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .insigne-options { grid-template-columns: repeat(2, 1fr); }
  .antenne-grid { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .devises-row { flex-direction: column; }
  .enigma-cards { grid-template-columns: repeat(2, 1fr); }
  .kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); }
  .info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .game-bar { padding: 8px 12px; }
  .progress-dots { gap: 3px; }
  .dot { width: 9px; height: 9px; }
  .game-container { padding: 16px 10px; }
  .card { padding: 18px; }
  .insigne-options { grid-template-columns: repeat(2, 1fr); }
  .insigne-art { width: 60px; height: 60px; }
  .score-row { flex-direction: column; }
  .score-item { border-right: none; border-bottom: 1px solid var(--border); }
  .kpi-row { grid-template-columns: repeat(2,1fr); }
  .enigma-cards { grid-template-columns: 1fr 1fr; }
  .dash-sidebar { width: 48px; min-width: 48px; }
  .sidebar-top > div, .sidebar-title, .sidebar-sub, .nav-link span, #last-update, .btn-logout { display: none; }
  .nav-link { padding: 10px; text-align: center; }
  .dash-content { padding: 16px; }
}
