/* ============================================================================
   theme.css — Charte graphique officielle Thalazur
   Source : THALAZUR-DocumentNvlleIdentité2025
   Couleurs Pantone 2186 C (#004577) & 2985 C (#7CCAD5)
   Titres : Clone Rounded Latin Thin · Sous-titres : Contralto Small · Texte : Myriad Pro
   Polices Adobe Fonts (à charger via le kit Typekit Thalazur — cf. note bas de fichier)
   ============================================================================ */

:root {
  /* Couleurs officielles — vérifiées sur THALAZUR-nouvelle identité.pdf (p.5) */
  --marine:    #004577;   /* Pantone 2186 C · RVB 0/69/119 — couleur principale */
  --marine-d:  #00345c;   /* marine assombri (survol, dégradés) */
  --marine-l:  #1a5a8a;   /* marine éclairci */
  --azur:      #7CCAD5;   /* Pantone 2985 C · RVB 124/202/213 — secondaire (vagues, accents) */
  --azur-d:    #4E9BA8;   /* azur assombri pour le texte sur clair (contraste AA) */
  --azur-pale: #E8F5F7;   /* fond très clair dérivé de l'azur */

  /* Neutres */
  --ink:    #1c2b33;      /* texte principal (marine très sombre) */
  --muted:  #5c707a;      /* texte secondaire */
  --line:   #DCE6EA;      /* filets, bordures */
  --bg:     #F4F8F9;      /* fond d'application (azur lavé) */
  --white:  #ffffff;

  /* États */
  --ok:    #2E7D5B;  --okbg:   #E3F1EA;
  --warn:  #B5862A;  --warnbg: #F7EFD9;
  --err:   #A32D2D;  --errbg:  #F7E4E4;

  /* Typo */
  --font-title: "clone-rounded-latin", "Century Gothic", sans-serif;
  --font-sub:   "contralto-small", "Optima", "Segoe UI", sans-serif;
  --font-body:  "myriad-pro", "Segoe UI", -apple-system, Helvetica, Arial, sans-serif;

  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,69,119,.06), 0 4px 16px rgba(0,69,119,.05);
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-title); font-weight: 100; color: var(--marine); letter-spacing: .01em; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
.sub, .subtitle { font-family: var(--font-sub); color: var(--muted); }

a { color: var(--marine); text-decoration: none; }

/* ── Logo / picto « vague de bien-être » ───────────────────────────────────── */
.thz-logo { display: flex; align-items: center; gap: 11px; }
.thz-wave {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--marine); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.thz-wave svg { width: 22px; height: 22px; }
.thz-name { font-family: var(--font-title); font-weight: 100; font-size: 19px;
            color: var(--marine); letter-spacing: .14em; line-height: 1; }
.thz-tag  { font-family: var(--font-sub); font-size: 10px; color: var(--azur-d);
            letter-spacing: .05em; display: block; margin-top: 2px; }

/* ── Boutons ───────────────────────────────────────────────────────────────── */
button, .btn {
  font-family: var(--font-body); font-size: 13px; cursor: pointer;
  padding: 9px 15px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--white); color: var(--ink); transition: .14s;
  display: inline-flex; align-items: center; gap: 7px;
}
button:hover, .btn:hover { background: var(--azur-pale); border-color: var(--azur); }
.btn-primary { background: var(--marine); color: #fff; border-color: var(--marine); }
.btn-primary:hover { background: var(--marine-d); border-color: var(--marine-d); }
.btn-accent { background: var(--azur); color: var(--marine-d); border-color: var(--azur); font-weight: 600; }
.btn-accent:hover { background: var(--azur-d); color: #fff; }
button:disabled { opacity: .5; cursor: not-allowed; }
\n/* ── Icônes boutons — taille uniforme ───────────────────────────────────────── */
button svg, .btn svg { width: 14px; height: 14px; flex-shrink: 0; vertical-align: middle; }

/* ── Formulaires ───────────────────────────────────────────────────────────── */
label { font-family: var(--font-sub); font-size: 12.5px; color: var(--muted); display: block; margin-bottom: 5px; }
input, select, textarea {
  width: 100%; font-family: var(--font-body); font-size: 14px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--marine); box-shadow: 0 0 0 3px rgba(0,69,119,.08); }

/* ── Cartes / panneaux ─────────────────────────────────────────────────────── */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 18px; }

/* ── Tables ────────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-family: var(--font-sub); font-weight: 600; color: var(--muted);
     font-size: 12px; padding: 9px 8px; border-bottom: 2px solid var(--line); }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); }
tbody tr:hover { background: var(--azur-pale); }

/* ── Pastilles ─────────────────────────────────────────────────────────────── */
.pill { padding: 2px 10px; border-radius: 20px; font-size: 12px; background: var(--azur-pale); color: var(--marine); display: inline-block; }
.pill.ok { background: var(--okbg); color: var(--ok); }
.pill.warn { background: var(--warnbg); color: var(--warn); }

/* ── Layout application (sidebar + main) ───────────────────────────────────── */
.app { display: flex; min-height: 100vh; }
.side { width: 248px; background: var(--marine); color: #cfe0e6; flex-shrink: 0; display: flex; flex-direction: column; padding: 18px 0; }
.side .thz-name { color: #fff; }
.side-sec { font-family: var(--font-sub); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #6f9fb3; padding: 16px 20px 6px; }
.nav { display: flex; align-items: center; gap: 11px; padding: 9px 20px; cursor: pointer; font-size: 13.5px; border-left: 3px solid transparent; transition: .12s; color: #cfe0e6; }
.nav:hover { background: rgba(255,255,255,.06); }
.nav.on { background: rgba(124,202,213,.16); border-left-color: var(--azur); color: #fff; }
.nav-ic { width: 18px; text-align: center; opacity: .85; flex-shrink: 0; }

/* ── Sidebar : bloc de marque + sections repliables ────────────────────────── */
.side-brand { padding: 0 20px 16px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 4px; }
.side-group .side-sec { cursor: pointer; display: flex; align-items: center; gap: 7px; user-select: none; }
.side-group .side-sec:hover { color: var(--azur); }
.side-caret { display: inline-block; transition: transform .16s; font-size: 9px; }
.side-group.open .side-caret { transform: rotate(90deg); }
/* Repliée par défaut ; dépliée quand .open est posée par thzToggleSec() */
.side-group .side-items { display: none; }
.side-group.open .side-items { display: block; }
.side-empty { font-size: 12px; color: #6f9fb3; padding: 6px 20px 10px; font-style: italic; }
/* Sous-menu d'une application (visible seulement quand on est dedans) */
.nav-sub { border-left: 1px solid rgba(255,255,255,.12); margin-left: 30px; }
.nav-sub .nav { padding: 7px 20px 7px 12px; font-size: 12.5px; opacity: .9; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 13px 26px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.content { padding: 24px 26px; overflow: auto; }

/* Bouton burger — visible en permanence : sur desktop il replie la sidebar,
   sur mobile il ouvre le tiroir coulissant. */
.thz-burger { display: inline-flex; align-items: center; background: none; border: 1px solid var(--line);
  border-radius: 8px; font-size: 20px; line-height: 1; padding: 6px 10px; cursor: pointer; color: var(--marine); }
.thz-burger:hover { background: var(--azur-pale); border-color: var(--azur); }
.thz-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,52,92,.45); z-index: 40; }

/* Desktop : .nav-open signifie « sidebar repliée » (l'inverse du mobile). */
@media (min-width: 901px) {
  .side { transition: width .18s ease, padding .18s ease; overflow: hidden; }
  .app.nav-open .side { width: 0; padding-left: 0; padding-right: 0; border: none; }
}

/* ── Responsive : tablette / mobile ───────────────────────────────────────── */
@media (max-width: 900px) {
  /* Sidebar devient un tiroir coulissant */
  .side {
    position: fixed; top: 0; left: 0; height: 100%; z-index: 50;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 2px 0 18px rgba(0,0,0,.25); overflow-y: auto;
  }
  .app.nav-open .side { transform: translateX(0); }
  .app.nav-open .thz-backdrop { display: block; }
  .topbar { padding: 11px 16px; gap: 10px; }
  .content { padding: 16px 14px; }
  /* La topbar peut s'enrouler si besoin */
  .topbar > div { flex-wrap: wrap; }
  /* Tableaux : défilement horizontal plutôt que débordement cassé */
  .content table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  /* Panneaux et barres d'outils s'empilent */
  .panel { padding: 14px 14px; }
  .toolbar { gap: 8px; }
  .toolbar select, .toolbar input { max-width: 100% !important; width: 100%; }
  .toolbar > div { flex: 1 1 140px; }
  /* Modales : pleine largeur confortable */
  .modal { width: 94vw !important; }
}
@media (max-width: 560px) {
  /* Cartes KPI : une seule colonne lisible */
  .kpis { grid-template-columns: 1fr 1fr !important; }
  h1 { font-size: 22px; }
  .topbar .thz-name { font-size: 14px; }
}

/* ── Picto vague réutilisable (inline SVG ci-dessous dans les pages) ────────── */

/* ----------------------------------------------------------------------------
   POLICES ADOBE FONTS
   La charte spécifie des polices Adobe (Typekit) :
     • Titres        : clone-rounded-latin (weight 100)
     • Sous-titres   : contralto-small (weight 400/600)
     • Texte courant : Myriad Pro
   En production, ajouter dans le <head> le kit Typekit Thalazur :
     <link rel="stylesheet" href="https://use.typekit.net/XXXXXXX.css">
   (récupérer l'ID du kit auprès du service communication / cabinet C&O).
   Les familles de secours (Century Gothic, Optima, Segoe UI) assurent un
   rendu cohérent tant que le kit n'est pas branché.
---------------------------------------------------------------------------- */

/* ── Impression ────────────────────────────────────────────────────────────
   Masque la navigation, les barres d'outils et les boutons ; ne conserve que
   le contenu (titres + tableaux). Les éléments à exclure portent .no-print ;
   un conteneur .print-area peut cibler la zone à imprimer. */
@media print {
  #sidebar, .side, #topbar, .topbar, .no-print,
  button, .btn, .btn-primary, .btn-accent { display: none !important; }
  .app, .main, .content { display: block !important; margin: 0 !important; padding: 0 !important; }
  .panel { box-shadow: none !important; border: none !important; padding: 0 !important; margin: 0 0 10px !important; }
  body { background: #fff !important; }
  table { width: 100% !important; border-collapse: collapse !important; font-size: 10px !important; }
  th, td { border: 1px solid #999 !important; padding: 2px 4px !important; }
  thead { background: #e8f0f4 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-only { display: block !important; }
  h1 { font-size: 16px !important; margin: 0 0 6px !important; }
  @page { size: landscape; margin: 10mm; }
}
.print-only { display: none; }
