/* ═══════════════════════════════════════════════════════════════════
   Feuille de style principale — TTS Studio
   Intégrée le 16/10/2026.

   Chaque bloc porte un repère indiquant la fiabilité de ses valeurs :
     [S1] [S2] [S3]  valeurs d'origine, fiables
     [R]             valeurs reconstruites, à ajuster si besoin
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1. VARIABLES [S1] ──────────────────────────────────────────── */
:root {
  --paris-blue: #003189;
  --paris-blue-dark: #001f5c;
  --paris-blue-light: #e8edf8;
  --accent: #c8102e;          /* rouge mairie */
  --green: #1a7a4a;
  --orange: #c97000;
  --red: #c8102e;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #d1d5db;
  --bg: #f5f6fa;
  --white: #ffffff;
  --nav-h: 60px;
  --radius: 8px;
  --shadow: 0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.04);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── 2. NAVBAR [S1] ─────────────────────────────────────────────── */
.navbar {
  height: var(--nav-h);
  background: var(--paris-blue);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.nav-brand { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.nav-logo { font-size: 22px; }
.nav-title { color: white; font-weight: 700; font-size: 15px; letter-spacing: .3px; }
.nav-sub { color: rgba(255,255,255,.5); font-size: 11px; margin-top: 1px; display: none; }

.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-link {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
}
.nav-link:hover { background: rgba(255,255,255,.12); color: white; }
.nav-link.active { background: rgba(255,255,255,.2); color: white; }

/* Lien sortant vers la vitrine : séparé des onglets de l'application et
   légèrement estompé, pour qu'on ne le confonde pas avec une page interne. */
.nav-link-externe {
  margin-left: auto;
  opacity: .65;
  font-size: 12px;
}
.nav-link-externe:hover { opacity: 1; }

.nav-user { display: flex; align-items: center; gap: 10px; }
.user-name { color: rgba(255,255,255,.85); font-size: 13px; }
.user-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .5px;
}
.user-badge.admin { background: var(--accent); color: white; }
.user-badge.lecteur { background: rgba(255,255,255,.2); color: white; }

.btn-logout {
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.2);
  padding: 5px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 12px;
  transition: all .15s;
}
.btn-logout:hover { background: rgba(255,255,255,.2); color: white; }

/* ── 3. LAYOUTS ─────────────────────────────────────────────────── */
main { flex: 1; }

/* [S1+S2] dégradé bleu = page de LOGIN uniquement (ligne 102 en prod) */
.auth-layout {
  min-height: calc(100vh - 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--paris-blue-dark) 0%, var(--paris-blue) 60%, #1a4480 100%);
}

/* [S2] valeurs prod du 31/07 (juin : padding 32px / max-width 1200px) */
.app-layout { padding: 24px 32px; max-width: 1800px; margin: 0 auto; width: 100%; }

/* ── 4. CARTE D'AUTHENTIFICATION [S1] ───────────────────────────── */
.auth-card {
  background: white; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.3);
  padding: 40px; width: 100%; max-width: 420px;
}
.auth-card--wide { max-width: 520px; }
.auth-header { text-align: center; margin-bottom: 32px; }
.paris-emblem { font-size: 40px; margin-bottom: 12px; }
.auth-header h1 { font-size: 22px; font-weight: 700; color: var(--paris-blue); }
.auth-subtitle { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-footer { text-align: center; margin-top: 20px; color: var(--text-muted); font-size: 13px; }
.auth-footer a { color: var(--paris-blue); text-decoration: none; font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* ── 5. FORMULAIRES [S1] ────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-weight: 600; font-size: 13px; color: var(--text); }
.form-group input {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus { border-color: var(--paris-blue); box-shadow: 0 0 0 3px rgba(0,49,137,.1); }
.form-hint { font-size: 12px; color: var(--text-muted); }
.required { color: var(--accent); }
.form-notice {
  background: var(--paris-blue-light); border-left: 3px solid var(--paris-blue);
  border-radius: 6px; padding: 10px 14px; font-size: 13px; color: var(--paris-blue-dark);
}

/* ── 6. BOUTONS ─────────────────────────────────────────────────── */
/* [S1] */
.btn-primary {
  background: var(--paris-blue); color: white; border: none;
  border-radius: var(--radius); padding: 12px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background .15s, transform .1s; width: 100%;
}
.btn-primary:hover { background: var(--paris-blue-dark); }
.btn-primary:active { transform: scale(.98); }

.btn-sm {
  padding: 4px 10px; border-radius: 5px; border: none; cursor: pointer;
  font-size: 12px; font-weight: 600; transition: opacity .15s;
}
.btn-sm:hover { opacity: .85; }
.btn-green  { background: #d1fae5; color: var(--green); }
.btn-blue   { background: var(--paris-blue-light); color: var(--paris-blue); }
.btn-orange { background: #fef3c7; color: var(--orange); }
.btn-red    { background: #fee2e2; color: var(--red); }
.btn-danger { background: #fee2e2; color: var(--red); }

/* [R] décrits §14.5 (« largeur auto », « gris », « contour bleu ») */
.btn-inline { width: auto; padding: 8px 18px; font-size: 13px; }
.btn-reset {
  display: inline-block; background: #e5e7eb; color: var(--text); border: none;
  border-radius: var(--radius); padding: 8px 18px; font-size: 13px; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn-reset:hover { background: #d1d5db; }
.btn-secondary {
  display: inline-block; background: white; color: var(--paris-blue);
  border: 1.5px solid var(--paris-blue); border-radius: var(--radius);
  padding: 7px 16px; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn-secondary:hover { background: var(--paris-blue-light); }
.btn-action--green { background: var(--green); color: white; }
.btn-action--red   { background: var(--red);   color: white; }

/* ── 7. ALERTES [S1] ────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.alert-success { background: #d1fae5; color: #065f46; border-left: 3px solid var(--green); }
.alert-error   { background: #fee2e2; color: #991b1b; border-left: 3px solid var(--accent); }
.error-list { padding-left: 16px; }
.error-list li { margin-bottom: 4px; }

/* ── 8. EN-TÊTE DE PAGE ─────────────────────────────────────────── */
/* [S1] — ⚠️ le claude.md §14.2-C dit « stylés clairs » : couleur du h2
   en prod NON vérifiée. Valeur ci-dessous = source de juin. */
.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 22px; font-weight: 700; color: var(--paris-blue); }
.page-sub { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

/* [R] */
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--paris-blue); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }

/* [R] §7.2 : « fond bleu clair, border-left bleu Paris » */
.info-banner {
  display: block; background: var(--paris-blue-light);
  border-left: 3px solid var(--paris-blue); border-radius: 6px;
  padding: 8px 14px; font-size: 13px; color: var(--paris-blue-dark);
}

/* [S3] bloc ajouté en session (juin) — copie exacte */
.data-freshness { margin: 4px 0 0 0; font-size: 12px; color: var(--text-muted); font-weight: 400; }
.data-freshness strong { color: var(--text); font-weight: 600; }
/* [R] fraîcheur colorée (session 15/09, règles exactes non relues) */
.freshness-ok    { color: var(--green); font-weight: 600; }
.freshness-stale { color: var(--red);   font-weight: 600; }
.freshness-na    { color: var(--text-muted); }

/* ── 9. STATS / KPI ─────────────────────────────────────────────── */
/* [S1] */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stats-grid--small .stat-card { padding: 16px; }
.stat-card {
  background: white; border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); border-top: 3px solid var(--paris-blue);
}
.stat-card--green  { border-top-color: var(--green); }
.stat-card--orange { border-top-color: var(--orange); }
.stat-card--red    { border-top-color: var(--red); }
.stat-card--blue   { border-top-color: #2563eb; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }

/* [R] base .kpi-* (le principe border-left coloré est confirmé par [S3]) */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 16px 0; }
.kpi-card {
  background: white; border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); border-left: 4px solid var(--paris-blue);
}
.kpi-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.kpi-value { font-size: 26px; font-weight: 800; color: var(--text); margin-top: 4px; }
.kpi-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.kpi-card--live   { border-left-color: var(--green); }
.kpi-card--blue   { border-left-color: #2563eb; }
.kpi-card--green  { border-left-color: var(--green); }
.kpi-card--orange { border-left-color: var(--orange); }
.kpi-card--purple { border-left-color: #7c3aed; }
/* [S3] copie exacte du bloc ajouté en session */
.kpi-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin: 16px 0; }
.kpi-card--red  { border-left-color: var(--red); }
.kpi-card--cyan { border-left-color: #0891b2; }
.kpi-card--gray { border-left-color: #6b7280; }
@media (max-width: 1300px) { .kpi-grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px)  { .kpi-grid-5 { grid-template-columns: repeat(2, 1fr); } }

/* ── 10. CARTES [S1] ────────────────────────────────────────────── */
.section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card { background: white; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 15px; font-weight: 700; color: var(--text); }
.card-link { color: var(--paris-blue); text-decoration: none; font-size: 13px; font-weight: 600; }
.card-body { padding: 16px 20px; }
.card-body--flush { padding: 0; }
/* [R] cartes empilées hors grille : espacement vertical */
.app-layout > .card + .card { margin-top: 20px; }   /* pas dans .section-grid */

/* ── 11. CARTES DE HUB [R] (structure §14.5, valeur [S3] pour -number) ── */
.anomalies-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.anomaly-card {
  display: flex; align-items: center; gap: 18px; padding: 18px 22px;
  background: white; border-radius: var(--radius); box-shadow: var(--shadow);
  border-left: 4px solid var(--paris-blue); text-decoration: none; color: var(--text);
  transition: transform .1s, box-shadow .15s;
}
.anomaly-card:hover { transform: translateY(-1px); box-shadow: 0 4px 18px rgba(0,49,137,.15); }
.anomaly-card--orange { border-left-color: var(--orange); }
.anomaly-card--red    { border-left-color: var(--red); }
.anomaly-card-icon  { font-size: 30px; flex: 0 0 auto; }           /* flex [S3 §21.3] */
.anomaly-card-body  { flex: 1; }
.anomaly-card-title { font-size: 16px; font-weight: 700; color: var(--paris-blue); }
.anomaly-card-sub   { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.anomaly-card-count { text-align: right; }
.anomaly-card-number { font-size: 24px; font-weight: 800; white-space: nowrap; letter-spacing: -0.5px; } /* [S3 §5.5] */
.anomaly-card-label  { font-size: 12px; color: var(--text-muted); }                                    /* 12px [S3 §16.5] */
.anomaly-card-arrow  { font-size: 20px; color: var(--paris-blue); }

/* ── 12. TABLEAUX ───────────────────────────────────────────────── */
/* [R] §14.3 : « le sélecteur table seul donne background:white + bordures » */
table { background: white; border-collapse: collapse; }
/* [S1] */
.table { width: 100%; border-collapse: collapse; }
.table--full { font-size: 13px; }
.table thead th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-muted); padding: 10px 16px;
  border-bottom: 1px solid var(--border); background: #fafafa;
}
.table tbody td { padding: 10px 16px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f9fafb; }
/* [R] lignes 492-509 en prod, contenu non relu (« dense, nowrap ») */
.table-scroll { width: 100%; overflow-x: auto; }
.table--full { width: 100%; }
.table--compact thead th { padding: 7px 10px; white-space: nowrap; }
.table--compact tbody td { padding: 6px 10px; white-space: nowrap; }

.row-blocked { background: #fff1f2 !important; }
.row-pending { background: #fffbeb !important; }
/* [R] */
.row-alerte   { background: #fffbeb !important; }
.row-critique { background: #fff1f2 !important; }
.row-total    { font-weight: 700; background: var(--paris-blue-light) !important; }
.actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
/* [R] tri cliquable */
.sort-link { color: inherit; text-decoration: none; }
.sort-active { color: var(--paris-blue); }

/* ── 13. FILTRES [R] (structure §14.5 / §5.13) ──────────────────── */
.filter-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-form--inline { flex-wrap: nowrap; }
.filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.filter-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.filter-group input, .filter-group select {
  border: 1.5px solid var(--border); border-radius: 6px; padding: 7px 10px;
  font-size: 13px; background: white; outline: none;
}
.filter-group input:focus, .filter-group select:focus { border-color: var(--paris-blue); }
.filter-group--wide    { flex: 1; min-width: 240px; }
.filter-group--compact { min-width: 90px; }
.filter-group--actions { flex-direction: row; gap: 8px; }

/* ── 14. BADGES [S1] ────────────────────────────────────────────── */
.action-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px;
  font-weight: 700; background: var(--paris-blue-light); color: var(--paris-blue);
  font-family: 'Courier New', monospace;
}
.role-badge { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.role-admin   { background: #fee2e2; color: var(--red); }
.role-lecteur { background: var(--paris-blue-light); color: var(--paris-blue); }
.status-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.status-active  { background: #d1fae5; color: var(--green); }
.status-pending { background: #fef3c7; color: var(--orange); }
.status-blocked { background: #fee2e2; color: var(--red); }
/* [R] */
.dispo-ok       { color: var(--green);  font-weight: 700; }
.dispo-alerte   { color: var(--orange); font-weight: 700; }
.dispo-critique { color: var(--red);    font-weight: 700; }
.badge-count {
  display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 10px;
  background: var(--orange); color: white; font-size: 11px; font-weight: 700; text-align: center;
}
.badge-link { color: var(--paris-blue); text-decoration: none; font-weight: 600; }

/* ── 15. LIENS RAPIDES [S1] ─────────────────────────────────────── */
.quick-links { display: flex; flex-direction: column; gap: 8px; }
.quick-link {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  border-radius: var(--radius); text-decoration: none; background: var(--bg);
  border: 1px solid var(--border); transition: all .15s; color: var(--text);
}
.quick-link:hover { background: var(--paris-blue-light); border-color: var(--paris-blue); }
.quick-link--disabled { opacity: .5; cursor: default; pointer-events: none; }
.ql-icon { font-size: 20px; }
.ql-text { display: flex; flex-direction: column; }
.ql-text strong { font-size: 13px; font-weight: 700; }
.ql-text small { font-size: 11px; color: var(--text-muted); }

/* ── 16. PAGINATION [S1] ────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; }
.page-btn {
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 16px; text-decoration: none; color: var(--paris-blue); font-weight: 600; font-size: 13px;
}
.page-btn:hover { background: var(--paris-blue-light); }
.page-info, .pagination-info { color: var(--text-muted); font-size: 13px; }

/* ── 17. VISIONNEUSE CODE/XML [S3 §7.2 — couleurs exactes] ──────── */
.xml-viewer {
  background: #1e2761; color: #e8eaf6; font-family: Consolas, 'Courier New', monospace;
  font-size: 12px; line-height: 1.15; padding: 12px 0; border-radius: var(--radius); overflow-x: auto;
}
.xml-line { display: block; white-space: pre; padding: 0 14px; }
.xml-lineno { display: inline-block; width: 4em; color: #7986cb; text-align: right; margin-right: 14px; user-select: none; }

/* ── 18. UTILITAIRES [S1] (+ [R] ok/ko/warning) ─────────────────── */
.mono  { font-family: 'Courier New', monospace; }
.small { font-size: 12px; }
.muted { color: var(--text-muted); }
.empty-state { text-align: center; color: var(--text-muted); padding: 32px; }
.ok      { color: var(--green);  font-weight: 600; }
.ko      { color: var(--red);    font-weight: 600; }
.warning { color: var(--orange); font-weight: 600; }

/* ── 19. PIED DE PAGE [S1] ──────────────────────────────────────── */
.footer {
  background: var(--paris-blue-dark); color: rgba(255,255,255,.4); font-size: 11px;
  padding: 12px 24px; text-align: center; display: flex; gap: 12px; justify-content: center;
}
.footer-sep { opacity: .3; }

/* ── 20. RESPONSIVE [S1] + [R] points 900/1000 ──────────────────── */
@media (max-width: 1000px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .section-grid { grid-template-columns: 1fr; }
  .filter-form { flex-direction: column; align-items: stretch; }
}
@media (max-width: 600px) {
  .app-layout { padding: 16px; }
  .nav-sub { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
