/* ── Variables ───────────────────────────────────────────────────────────── */
:root {
  --indigo:    #1D2544;
  --indigo-80: #2d3a63;
  --rouge:     #601A1E;
  --beige:     #F3EDDF;
  --beige-dark:#E8DFC8;
  --jaune:     #EEDE6C;
  --ciel:      #90B6E0;
  --azur:      #788CC8;

  --bg:        #FAF7F2;
  --surface:   #FFFFFF;
  --border:    #EAE4D8;
  --text:      #1D2544;
  --muted:     #8B8070;

  --good:      #2A6B47;
  --good-bg:   #E8F5EE;
  --good-border:#C4E0D1;
  --mid:       #8B6000;
  --mid-bg:    #FEF4DC;
  --mid-border:#F0D88A;
  --bad:       #7A1A1E;
  --bad-bg:    #FAEAEA;
  --bad-border:#E8B4B4;

  --shadow-sm: 0 1px 3px rgba(29,37,68,.06), 0 1px 2px rgba(29,37,68,.04);
  --shadow:    0 4px 16px rgba(29,37,68,.08), 0 1px 4px rgba(29,37,68,.05);
  --shadow-lg: 0 8px 32px rgba(29,37,68,.12), 0 2px 8px rgba(29,37,68,.06);

  --radius:    16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
}

html { scroll-behavior: smooth; }

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

body {
  background: var(--bg);
  font-family: 'Satoshi', system-ui, -apple-system, sans-serif;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Bricolage Grotesque', sans-serif;
  line-height: 1.2;
  font-weight: 700;
}

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Ticker ──────────────────────────────────────────────────────────────── */
.ticker-wrap {
  width: 100%;
  background: var(--indigo);
  overflow: hidden;
  padding: 10px 0;
  position: relative;
  z-index: 10;
}
.ticker-track {
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  animation: ticker-scroll 40s linear infinite;
  width: max-content;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-item {
  color: rgba(255,255,255,.85);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0 20px;
}
.ticker-sep {
  color: var(--rouge);
  font-size: 10px;
  flex-shrink: 0;
}
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Login page ──────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--login-bg, #42101a);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-wrap {
  text-align: center;
  width: 100%;
  max-width: 360px;
  padding: 40px 24px;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 36px;
}

.logo-wordmark img {
  height: 36px;
  width: auto;
  opacity: .85;
}

.login-tagline {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 5vw, 32px);
  color: #f3eddf;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 12px;
}

.login-tagline em {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.15em;
}

.login-welcome {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 24px;
  color: #f3eddf;
  margin-bottom: 40px;
  line-height: 1.4;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-alert {
  margin-bottom: 16px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,120,120,.3);
  color: rgba(255,210,210,.85);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
}

.input-dark {
  width: 100%;
  background: rgba(243,237,223,.92);
  border: none;
  color: #42101a;
  border-radius: 12px;
  padding: 14px 18px;
  font-family: 'Satoshi', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  outline: none;
  transition: background .2s, box-shadow .2s;
  text-align: center;
  -webkit-appearance: none;
}
.input-dark::placeholder { color: #42101a; letter-spacing: 0.04em; font-weight: 500; }
.input-dark:focus { background: #f3eddf; box-shadow: 0 0 0 2px rgba(243,237,223,.6); }

.btn-dark-primary {
  width: 100%;
  padding: 15px 24px;
  background: #f3eddf;
  color: #42101a;
  border: none;
  border-radius: 12px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
}
.btn-dark-primary:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
}

.login-miraya {
  display: block;
  margin-top: 32px;
  font-size: 12px;
  color: rgba(255,255,255,.2);
  letter-spacing: 0.04em;
  transition: color .2s;
}
.login-miraya:hover { color: rgba(255,255,255,.5); text-decoration: none; }

.input-code { letter-spacing: 0.08em; }

/* ── Tool header ─────────────────────────────────────────────────────────── */
.tool-header {
  background: var(--indigo);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.credits-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.85);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,.12);
}
.credits-badge.credits-mid {
  background: rgba(238,222,108,.15);
  border-color: rgba(238,222,108,.3);
  color: var(--jaune);
}
.credits-badge.credits-low {
  background: rgba(96,26,30,.3);
  border-color: rgba(96,26,30,.5);
  color: #F4AEAE;
}
.credits-icon { font-size: 8px; opacity: 0.5; }

.btn-logout {
  color: rgba(255,255,255,.4);
  font-size: 13px;
  cursor: pointer;
  transition: color .15s;
}
.btn-logout:hover { color: rgba(255,255,255,.8); text-decoration: none; }

/* ── Tool main ───────────────────────────────────────────────────────────── */
.tool-page { min-height: 100vh; }

.tool-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 100px;
}

.tool-intro {
  margin-bottom: 36px;
}
.tool-intro h1 {
  font-family: 'DM Serif Display', serif;
  font-size: 36px;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.tool-intro p {
  color: var(--muted);
  font-size: 16px;
}

/* ── Form cards ──────────────────────────────────────────────────────────── */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.form-card:focus-within {
  box-shadow: var(--shadow);
}
.form-card-optional {
  background: var(--beige);
  border-color: var(--beige-dark);
  box-shadow: none;
}

.card-title {
  font-size: 18px;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.slide-count-label {
  font-size: 13px;
  color: var(--muted);
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.card-hint {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
  margin-top: -8px;
}

.form-row { margin-bottom: 18px; }
.form-row:last-child { margin-bottom: 0; }
.form-row.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.required { color: var(--rouge); }

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  resize: vertical;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--azur);
  box-shadow: 0 0 0 3px rgba(120,140,200,.15);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .6; }
select { appearance: none; cursor: pointer; }

/* ── Slides ──────────────────────────────────────────────────────────────── */
#slides-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.slide-item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  transition: border-color .15s;
}
.slide-item:focus-within {
  border-color: var(--azur);
}

.slide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg);
  border-bottom: 1.5px solid var(--border);
}

.slide-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.slide-item textarea {
  border: none;
  border-radius: 0;
  padding: 14px;
  font-size: 14px;
  min-height: 85px;
  box-shadow: none;
}
.slide-item textarea:focus { border-color: transparent; box-shadow: none; }

.btn-remove-slide {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 4px;
  transition: all .15s;
  opacity: 0.6;
}
.btn-remove-slide:hover { background: var(--bad-bg); color: var(--bad); opacity: 1; }

.btn-add-slide {
  background: none;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  width: 100%;
  transition: all .15s;
}
.btn-add-slide:hover {
  border-color: var(--azur);
  color: var(--indigo);
  background: rgba(120,140,200,.05);
}

.badge-optional {
  font-size: 11px;
  font-weight: 600;
  background: rgba(0,0,0,.07);
  color: var(--muted);
  padding: 2px 9px;
  border-radius: 10px;
  vertical-align: middle;
  margin-left: 8px;
  letter-spacing: 0.03em;
}

.form-submit-row {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

/* ── Loading ──────────────────────────────────────────────────────────────── */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 100px 20px;
  gap: 20px;
}
.loading-spinner {
  width: 52px;
  height: 52px;
  border: 3px solid var(--border);
  border-top-color: var(--indigo);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-weight: 700; font-size: 17px; font-family: 'Bricolage Grotesque', sans-serif; }
.loading-subtext { color: var(--muted); font-size: 14px; }

/* ── Results ──────────────────────────────────────────────────────────────── */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.results-header h2 { font-size: 26px; letter-spacing: -0.02em; }

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  animation: fadeUp .35s ease both;
  box-shadow: var(--shadow-sm);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.result-card-label {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
  border: 1px solid;
}
.status-good { background: var(--good-bg); color: var(--good); border-color: var(--good-border); }
.status-mid  { background: var(--mid-bg);  color: var(--mid);  border-color: var(--mid-border); }
.status-bad  { background: var(--bad-bg);  color: var(--bad);  border-color: var(--bad-border); }

.result-obs {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}
.result-detail {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.65;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.synthese-card {
  background: var(--indigo);
  background-image: radial-gradient(ellipse at 100% 0%, rgba(120,140,200,.2) 0%, transparent 60%);
  color: white;
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 4px;
  animation: fadeUp .35s ease both;
  animation-delay: 0.5s;
}
.synthese-card h3 {
  font-size: 20px;
  margin-bottom: 24px;
  color: white;
  letter-spacing: -0.02em;
}
.synthese-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.synthese-col h4 {
  font-size: 11px;
  font-weight: 700;
  opacity: .5;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.synthese-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.synthese-col li {
  font-size: 14px;
  padding-left: 18px;
  position: relative;
  opacity: .9;
  line-height: 1.5;
}
.synthese-col li::before {
  content: '→';
  position: absolute;
  left: 0;
  opacity: .4;
}
.message-global {
  font-size: 15px;
  line-height: 1.7;
  opacity: .8;
  font-style: italic;
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 20px;
}

/* Visual checklist */
.visual-checklist {
  background: var(--beige);
  border: 1px solid var(--beige-dark);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 4px;
  animation: fadeUp .35s ease both;
  animation-delay: 0.6s;
}
.visual-checklist h3 {
  font-size: 17px;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
}
.check-box {
  width: 22px;
  height: 22px;
  border: 2px solid var(--beige-dark);
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: white;
}
.check-box.checked {
  background: var(--good);
  border-color: var(--good);
  color: white;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--indigo);
  color: white;
  box-shadow: 0 4px 12px rgba(29,37,68,.25);
}
.btn-primary:hover { background: var(--indigo-80); box-shadow: 0 6px 20px rgba(29,37,68,.3); }

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-danger {
  background: var(--bad-bg);
  color: var(--bad);
  border: 1.5px solid var(--bad-border);
}
.btn-danger:hover { background: #F5D5D5; }

.btn-large {
  padding: 16px 48px;
  font-size: 17px;
  border-radius: var(--radius);
}
.btn-full { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: var(--radius-xs); }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid;
}
.alert-error   { background: var(--bad-bg);  color: var(--bad);  border-color: var(--bad-border); }
.alert-success { background: var(--good-bg); color: var(--good); border-color: var(--good-border); }
.alert-warning { background: var(--mid-bg);  color: var(--mid);  border-color: var(--mid-border); }

/* ── Admin layout ────────────────────────────────────────────────────────── */
.admin-page { min-height: 100vh; }

.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 230px;
  background: var(--indigo);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  background-image: radial-gradient(ellipse at 50% 100%, rgba(120,140,200,.12) 0%, transparent 60%);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: white;
}
.logo-sub {
  font-size: 11px;
  opacity: .35;
  margin-top: 1px;
  letter-spacing: 0.04em;
}

.sidebar-nav { flex: 1; padding: 10px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,.5);
  font-size: 14px;
  font-weight: 500;
  transition: all .15s;
  cursor: pointer;
  border-radius: 0;
  margin: 1px 8px;
  border-radius: var(--radius-xs);
}
.nav-item:hover { color: white; background: rgba(255,255,255,.08); text-decoration: none; }
.nav-item.active { color: white; background: rgba(255,255,255,.12); }
.nav-icon { font-size: 10px; opacity: .5; }

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.nav-logout { color: rgba(255,255,255,.25); }
.nav-logout:hover { color: rgba(255,255,255,.6); }

.admin-content {
  margin-left: 230px;
  flex: 1;
  padding: 36px;
  max-width: calc(100% - 230px);
}

.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-page-header h1 { font-size: 28px; letter-spacing: -0.025em; }
.count-label {
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.back-link {
  font-size: 13px;
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.admin-card h2 {
  font-size: 18px;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.stat-value {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
  color: var(--indigo);
  letter-spacing: -0.03em;
}
.stat-label { font-size: 14px; font-weight: 600; }
.stat-sub   { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Activity chart */
.activity-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 100px;
  padding-bottom: 24px;
  position: relative;
}
.activity-bar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.activity-bar {
  width: 100%;
  background: var(--azur);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  opacity: .7;
}
.activity-label { font-size: 10px; color: var(--muted); }

/* Table */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
  text-align: left;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1.5px solid var(--border);
}
.admin-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--bg);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg); }
.td-muted { color: var(--muted); }
.row-inactive { opacity: .4; }

code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: 0.06em;
  border: 1px solid var(--border);
}

.link-action { font-size: 13px; font-weight: 600; color: var(--azur); }
.link-more { display: block; margin-top: 16px; font-size: 13px; color: var(--azur); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.badge-pillar   { background: rgba(29,37,68,.07); color: var(--indigo); }
.badge-obj      { background: rgba(96,26,30,.07); color: var(--rouge); }
.badge-name     { background: var(--mid-bg); color: var(--mid); border: 1px solid var(--mid-border); }
.badge-active   { background: var(--good-bg); color: var(--good); border: 1px solid var(--good-border); }
.badge-inactive { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }

/* Code generation */
.generate-form {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.generated-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
}
.generated-list { display: flex; flex-wrap: wrap; gap: 8px; }
.code-chip {
  font-family: 'SF Mono', monospace;
  font-size: 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.05em;
}

/* Detail view */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.slides-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 72vh;
  overflow-y: auto;
}
.slide-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.slide-preview-num {
  padding: 7px 14px;
  background: var(--bg);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}
.slide-preview-text {
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.result-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--bg);
}
.result-item:last-child { border-bottom: none; }
.result-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.result-label { font-weight: 700; font-size: 14px; }
.result-obs { font-size: 14px; }
.result-detail { font-size: 13px; color: var(--muted); margin-top: 6px; }
.missing-elements { font-size: 12px; color: var(--bad); margin-top: 6px; font-weight: 600; }

.synthese-block {
  margin-top: 20px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 18px;
  border: 1px solid var(--border);
}
.synthese-block h3 { font-size: 16px; margin-bottom: 14px; }
.synthese-section { margin-bottom: 12px; }
.synthese-section strong { font-size: 12px; display: block; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.synthese-section ul { padding-left: 16px; font-size: 13px; }
.synthese-section li { margin-bottom: 4px; }
.message-global { font-size: 14px; color: var(--muted); font-style: italic; margin-top: 10px; }

.criteria-actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

.empty-state {
  padding: 48px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-left { padding: 40px 32px; min-height: 50vh; }
  .login-left::after { display: none; }
  .login-right { padding: 40px 32px; border-left: none; border-top: 1px solid var(--border); }
}

@media (max-width: 768px) {
  .form-row.two-cols   { grid-template-columns: 1fr; }
  .results-grid        { grid-template-columns: 1fr; }
  .synthese-cols       { grid-template-columns: 1fr; }
  .detail-grid         { grid-template-columns: 1fr; }
  .stats-grid          { grid-template-columns: 1fr; }
  .admin-sidebar       { display: none; }
  .admin-content       { margin-left: 0; max-width: 100%; padding: 20px; }
  .tool-main           { padding: 24px 16px 80px; }
  .header-inner        { padding: 12px 16px; }
  .login-card          { padding: 28px 20px; }
}
