/* Feuille de style unique de l'outil.
 *
 * Interface reprise des outils internes (projet spendesk-furious-sync) : menu latéral sombre à sections,
 * barre haute avec fil d'Ariane, en-tête de page surtitre + titre + description, cartes, indicateurs,
 * pastilles d'état et tableaux zébrés.
 *
 * Couleurs, logo et typographie : charte « Le Nord, terre de bad » 2025-2029 du Comité Nord Badminton.
 * Le bleu vif #009dd1 n'atteint que 3,1:1 sur blanc : il sert aux grands titres, aux aplats et aux éléments
 * graphiques. Les liens et boutons utilisent #0074a6 (5,2:1), les textes le bleu foncé #262e60.
 */

:root {
  /* Charte : les quatre bleus du logo (CMJN/RVB du guide de communication). */
  --cnb-cyan: #009dd1;     /* titres, accents, aplats */
  --cnb-blue: #0074a6;     /* liens, boutons, menu actif (texte blanc 5,2:1) */
  --cnb-deep: #004f7d;     /* survols, textes de couleur forts */
  --cnb-navy: #262e60;     /* textes courants, menu latéral */

  --cyan-50: #e6f6fc;
  --cyan-100: #c9ecf8;
  --cyan-200: #9ddcf2;
  --cyan-300: #5cc6ea;     /* titres de section du menu (6,5:1 sur le marine) */

  --brand: var(--cnb-blue);
  --brand-strong: var(--cnb-deep);
  --brand-text: var(--cnb-blue);
  --accent: var(--cnb-cyan);

  --bg: #f3f6fa;
  --surface: #ffffff;
  --text: var(--cnb-navy);
  --muted: #5f6782;
  --border: #e1e6ee;
  --row-alt: #f6f8fb;
  --row-hover: var(--cyan-50);

  --ok: #1e7a4f;     --ok-bg: #e8f5ee;
  --warn: #8a5a00;   --warn-bg: #fff4dc;
  --danger: #b42318; --danger-bg: #fdecea;
  --info: var(--cnb-blue); --info-bg: var(--cyan-50);

  /* Menu latéral */
  --side-bg: var(--cnb-navy);
  --side-text: #d5d9ee;
  --side-muted: #a9b0d4;
  --side-hover: #333c78;
  --side-border: #3a4380;
  --side-active: var(--cnb-blue);

  --radius: 13px;
  --sidebar-width: 256px;
  --font: "Myriad Pro", "Myriad Variable Concept", "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
a { color: var(--brand-text); }
a:hover { color: var(--cnb-deep); }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; margin: 1.25rem 0 .5rem; color: var(--cnb-navy); }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
code { font-size: .9em; background: #eef1f6; padding: .1em .35em; border-radius: 4px; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.icon { flex: none; vertical-align: middle; }
html:not(.js) .js-only { display: none !important; }
:focus-visible { outline: 3px solid rgba(0, 157, 209, .55); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 12px; background: #fff; border-radius: 6px; box-shadow: 0 4px 12px #0002; }
.skip-link:focus { top: 10px; }

/* --------------------------------------------------------------------------
 * Coquille : menu latéral sombre fixe + espace de travail
 * -------------------------------------------------------------------------- */

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar-width);
  display: flex; flex-direction: column; background: var(--side-bg); color: var(--side-text);
  transition: width .15s ease, transform .2s ease;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 16px 14px; }
.sidebar-brand { display: flex; align-items: center; min-width: 0; text-decoration: none; }
.brand-logo { display: block; width: 168px; height: auto; }
.brand-mark { display: none; width: 32px; height: auto; }
.sidebar-toggle {
  display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; padding: 0;
  background: transparent; border: 1px solid var(--side-border); border-radius: 8px; color: var(--side-muted); cursor: pointer;
}
.sidebar-toggle:hover { background: var(--side-hover); color: #fff; }

/* Bandeau d'espace : rappelle en permanence dans quel outil on se trouve. */
.workspace-label {
  margin: 0 16px 16px; padding: 10px 12px; border: 1px solid var(--side-border); border-radius: 9px;
  display: flex; align-items: center; gap: 10px; color: #e3e6f5; font-size: 12.5px; font-weight: 600;
}
.workspace-label .icon { color: var(--cyan-300); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 11px 16px; scrollbar-width: thin; scrollbar-color: #4a5390 transparent; }
.sidebar-item + .sidebar-item { border-top: 1px solid var(--side-border); padding-top: 8px; margin-top: 8px; }
.sidebar-row {
  display: flex; align-items: center; gap: 11px; width: 100%; min-height: 42px; padding: 0 12px;
  background: transparent; border: 0; border-radius: 8px; color: var(--side-text);
  font-size: 14px; text-align: left; text-decoration: none; cursor: pointer;
}
.sidebar-row:hover { background: var(--side-hover); color: #fff; }
/* Titre de section : petites majuscules en bleu clair de la charte ; il replie aussi la section. */
.sidebar-row.nav-caption-row {
  min-height: 34px; font-size: 11.5px; font-weight: 800; letter-spacing: .9px; text-transform: uppercase; color: var(--cyan-300);
}
.sidebar-row.nav-caption-row:hover { background: transparent; color: #fff; }
.sidebar-chevron { display: grid; place-items: center; margin-left: auto; opacity: .75; transition: transform .15s ease; }
.nav-caption-row[aria-expanded="false"] .sidebar-chevron { transform: rotate(-90deg); }
.sidebar-children { display: flex; flex-direction: column; gap: 2px; }
.sidebar-children-closed { display: none; }
.sidebar-link {
  position: relative; display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 0 12px;
  border-radius: 8px; color: var(--side-text); font-size: 14px; text-decoration: none;
}
.sidebar-link:hover { background: var(--side-hover); color: #fff; }
.sidebar-link.is-active { background: var(--side-active); color: #fff; font-weight: 600; box-shadow: 0 4px 12px #0003; }
.sidebar-link.is-active::before { content: ""; position: absolute; left: -11px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--cnb-cyan); }
.sidebar-icon { display: grid; place-items: center; flex: 0 0 18px; }
.sidebar-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-footer { border-top: 1px solid var(--side-border); padding: 12px 11px; }
.sidebar-footer form { margin: 0; }
.sidebar-account { display: flex; align-items: center; gap: 10px; padding: 6px; margin-bottom: 4px; border-radius: 9px; color: inherit; text-decoration: none; min-width: 0; }
.sidebar-account:hover, .sidebar-account.is-active { background: var(--side-hover); }
.avatar { display: grid; place-items: center; flex: 0 0 34px; height: 34px; background: var(--cnb-cyan); color: #fff; border-radius: 10px; font-size: 12px; font-weight: 700; }
.account-name { min-width: 0; color: #fff; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.account-name small { display: block; color: var(--side-muted); font-size: 11px; margin-top: 2px; }

/* Menu réduit : colonne d'icônes seules (préférence mémorisée). */
.sidebar-collapsed { --sidebar-width: 68px; }
.sidebar-collapsed .sidebar-label, .sidebar-collapsed .sidebar-chevron, .sidebar-collapsed .workspace-label,
.sidebar-collapsed .account-name, .sidebar-collapsed .brand-logo, .sidebar-collapsed .nav-caption-row { display: none !important; }
.sidebar-collapsed .brand-mark { display: block; }
.sidebar-collapsed .sidebar-top { flex-direction: column; gap: 12px; }
.sidebar-collapsed .sidebar-children-closed { display: flex; }
.sidebar-collapsed .sidebar-link, .sidebar-collapsed .sidebar-row, .sidebar-collapsed .sidebar-account { justify-content: center; padding: 0; }
.sidebar-collapsed .sidebar-link.is-active::before { display: none; }

/* --------------------------------------------------------------------------
 * Espace de travail : barre haute, contenu, pied
 * -------------------------------------------------------------------------- */

.app-workspace { margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .15s ease; }
.app-topbar {
  position: sticky; top: 0; z-index: 20; height: 64px; padding: 0 32px;
  display: flex; align-items: center; gap: 16px; background: #fff; border-bottom: 1px solid var(--border);
}
.topbar-menu { display: none; background: none; border: 0; color: var(--cnb-navy); padding: 6px; border-radius: 8px; cursor: pointer; }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: #767c95; font-size: 13px; min-width: 0; flex: 1; }
.breadcrumb a { color: inherit; text-decoration: none; white-space: nowrap; border-radius: 4px; padding: 2px 3px; }
.breadcrumb a:hover { color: var(--cnb-blue); text-decoration: underline; }
.breadcrumb strong { color: var(--cnb-navy); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-role {
  display: flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 12px; color: var(--muted);
  padding: 6px 11px; border: 1px solid var(--border); border-radius: 7px;
}
.topbar-role .icon { color: var(--cnb-cyan); }

.app-main { position: relative; z-index: 1; flex: 1; width: 100%; min-width: 0; padding: 28px 32px 32px; }
/* Filigrane : l'emblème du Comité, fixe en bas à droite, très transparent et derrière le contenu. */
.app-workspace::after {
  content: ""; position: fixed; right: 28px; bottom: 28px; z-index: 0; width: 380px; height: 400px; pointer-events: none;
  background: var(--watermark, none) no-repeat center / contain; opacity: .05;
}
.app-footer { padding: 14px 32px 22px; color: #868ca3; font-size: 12px; }
.app-footer > span { color: var(--cnb-navy); font-weight: 700; margin-right: 12px; }
.app-footer a { color: inherit; }

/* En-tête de page : surtitre (section du menu) + titre + phrase d'explication. */
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.6px; color: var(--cnb-blue); margin: 0 0 6px; }
.page-heading h1 { font-size: clamp(24px, 2.1vw, 32px); line-height: 1.2; font-weight: 700; letter-spacing: -.4px; color: var(--cnb-navy); margin: 0; }
.page-description { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 6px 0 0; max-width: 75ch; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }

/* --------------------------------------------------------------------------
 * Surfaces, indicateurs, pastilles
 * -------------------------------------------------------------------------- */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 3px 8px rgba(38, 46, 96, .04); padding: 1.15rem 1.35rem; margin-bottom: 1rem; }
.card h2:first-child { margin-top: 0; }
.narrow { max-width: 680px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }

/* Indicateurs : pastille d'icône + valeur + libellé. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 1.25rem; }
.stat {
  display: flex; align-items: flex-start; gap: 14px; padding: 18px; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 3px 8px rgba(38, 46, 96, .04);
}
a.stat:hover { border-color: var(--cyan-200); box-shadow: 0 6px 16px rgba(0, 116, 166, .1); }
.stat-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 11px; background: var(--cyan-50); color: var(--cnb-blue); }
.stat-warn .stat-icon { background: var(--warn-bg); color: var(--warn); }
.stat-danger .stat-icon { background: var(--danger-bg); color: var(--danger); }
.stat-ok .stat-icon { background: var(--ok-bg); color: var(--ok); }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-value { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.5px; line-height: 1.15; color: var(--cnb-navy); font-variant-numeric: tabular-nums; }
.stat-label { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; }
.stat-warn .stat-value { color: var(--warn); }
.stat-danger .stat-value { color: var(--danger); }

/* Pastilles d'état : forme carrée arrondie et point de couleur. */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 6px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: #eef1f6; color: #5a617a;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }

.alert { border-radius: 9px; padding: .75rem 1rem; margin-bottom: 1rem; border: 1px solid transparent; }
.alert ul { margin: 0; padding-left: 1.2rem; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: #bfe3ce; }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: #f5dc9f; }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: #f5c2bd; }

.dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.dl-wide { grid-template-columns: minmax(180px, 30%) 1fr; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .25rem 1rem; max-height: 260px; overflow-y: auto; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline > li { padding: .5rem 0 .5rem .9rem; border-left: 2px solid var(--cyan-100); }
.timeline > li ul { margin: .25rem 0 0; padding-left: 1.1rem; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; list-style: none; padding: 0; font-size: 1.05rem; }
.action-list { list-style: none; padding: 0; margin: 0; }
.action-list li { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.action-list li:last-child { border-bottom: 0; }
.pre { white-space: pre-wrap; }
.text-warn { color: var(--warn); }
.toc { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .9rem; }
section[id] { scroll-margin-top: 80px; }

/* --------------------------------------------------------------------------
 * Boutons et formulaires
 * -------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 42px; padding: .55rem 1rem;
  font: inherit; font-size: 14px; font-weight: 600; border-radius: 8px; border: 1px solid #d9dfe8; background: #fff; color: var(--cnb-navy);
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { border-color: var(--cyan-200); background: var(--cyan-50); color: var(--cnb-navy); }
.btn-primary { background: var(--cnb-blue); border-color: var(--cnb-blue); color: #fff; box-shadow: 0 2px 4px rgba(0, 116, 166, .18); }
.btn-primary:hover { background: var(--cnb-deep); border-color: var(--cnb-deep); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1c13; border-color: #8f1c13; color: #fff; }
.btn-block { width: 100%; }
.btn-small { padding: .3rem .7rem; min-height: 34px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.as-link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-text); text-decoration: underline; cursor: pointer; }
form.inline { display: inline; }

.form { display: flex; flex-direction: column; gap: .85rem; }
.form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: 14px; color: #3f4766; }
.form label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], input[type=time], select, textarea {
  font: inherit; font-size: 14px; color: var(--cnb-navy); padding: .55rem .75rem; border: 1px solid #d9dfe8; border-radius: 8px;
  background: #fff; width: 100%; min-height: 42px; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--cnb-cyan); box-shadow: 0 0 0 3px rgba(0, 157, 209, .18); }
input[type=color] { width: 44px; height: 42px; padding: 2px; border: 1px solid #d9dfe8; border-radius: 8px; background: #fff; }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: .5rem 1rem 1rem; }
fieldset[disabled] { opacity: .75; }
fieldset.bare { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 700; padding: 0 .3rem; color: var(--cnb-navy); }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.inline-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.inline-form input[type=text] { max-width: 320px; }
.inline-form .check { display: flex; align-items: center; gap: .4rem; }
.inline-form .slot-rules { flex-basis: 100%; display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; }
.inline-form .slot-rules textarea { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; max-width: 440px; }
.input-narrow { max-width: 6rem; }
.choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.form label.choice {
  flex-direction: row; align-items: center; gap: .45rem; font-weight: 500; border: 1px solid #d9dfe8; border-radius: 8px;
  padding: .45rem .8rem; min-height: 42px; cursor: pointer; background: #fff;
}
.form label.choice:has(input:checked) { border-color: var(--cnb-cyan); background: var(--cyan-50); color: var(--cnb-deep); }
.choice.is-disabled { opacity: .55; }
.qr { display: flex; justify-content: center; margin: .5rem 0; }

/* --------------------------------------------------------------------------
 * Tableaux et filtres
 * -------------------------------------------------------------------------- */

.toolbar, .filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin-bottom: 1rem; }
.toolbar .table-search { max-width: 300px; }
.filters label { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; color: #3f4766; gap: .2rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 3px 8px rgba(38, 46, 96, .04); }
.table { border-collapse: collapse; width: 100%; font-size: 14px; }
.table th, .table td { padding: .65rem .85rem; border-bottom: 1px solid #edf0f5; text-align: left; vertical-align: top; }
.table th { background: #f8fafc; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: #6a7190; border-bottom-color: var(--border); }
.table tbody tr { background: #fff; }
.table tbody tr:nth-child(even) { background: var(--row-alt); }
.table tbody tr:hover { background: var(--row-hover); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { white-space: nowrap; display: flex; gap: .75rem; }
td.num, th.num { text-align: right; }
.pagination { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1rem 0; color: var(--muted); }
.type-dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .2); margin-right: .4rem; vertical-align: -1px; }

/* --------------------------------------------------------------------------
 * Rapport GEO : assistant en 5 étapes, contrôle
 * -------------------------------------------------------------------------- */

.wizard { display: flex; flex-direction: column; }
.wizard fieldset.item { display: flex; flex-direction: column; gap: .5rem; margin: 0 0 .75rem; }
.stepper { order: -1; display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }
.stepper .step {
  font: inherit; font-size: 13px; border: 1px solid #d9dfe8; background: #fff; border-radius: 999px; padding: .35rem .85rem;
  cursor: pointer; color: var(--cnb-navy); min-height: 36px;
}
.stepper .step span { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--cyan-50); color: var(--cnb-blue); font-weight: 700; margin-right: .25rem; }
.stepper .step.current { border-color: var(--cnb-blue); background: var(--cnb-blue); color: #fff; }
.stepper .step.current span { background: rgba(255, 255, 255, .25); color: #fff; }
.step-nav { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.report-table td.c, .report-table th.c { text-align: center; width: 3.5rem; }
.control-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }

/* Parcours « Saisir un rapport » */
.journey-steps { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding: 0; margin: 0 0 1.25rem; }
.journey-steps li { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.journey-steps li span { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--cnb-cyan); color: #fff; font-size: .9rem; }
.journey-steps small { font-weight: 400; color: var(--muted); }
.journey-card { margin-bottom: .75rem; }
.journey-card h3 { margin: 0 0 .2rem; }
.journey-card p { margin: 0; }
.journey-card-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.journey-status { text-align: right; }
.journey-progress { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.journey-bar { flex: 0 1 220px; height: 8px; border-radius: 4px; background: #e6ebf2; overflow: hidden; }
.journey-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--cnb-blue), var(--cnb-cyan)); }

/* --------------------------------------------------------------------------
 * Calendrier : vues mois et semaine
 * -------------------------------------------------------------------------- */

.view-switch { display: inline-flex; margin-left: auto; border: 1px solid #d9dfe8; border-radius: 8px; overflow: hidden; }
.view-switch a { padding: .55rem .9rem; text-decoration: none; color: var(--cnb-navy); font-weight: 600; font-size: 14px; background: #fff; }
.view-switch a + a { border-left: 1px solid #d9dfe8; }
.view-switch a.active { background: var(--cnb-blue); color: #fff; }
.cal-nav { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; flex-wrap: wrap; }
.cal-nav h2 { margin: 0 0 0 .5rem; font-size: 1.2rem; }
.cal-chip {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .4rem; text-decoration: none; color: var(--cnb-navy);
  background: #f3f4f6; background: color-mix(in srgb, var(--c) 28%, #fff); border-left: 4px solid var(--c);
  border-radius: 6px; padding: .2rem .4rem; margin-bottom: .25rem; font-size: .78rem; line-height: 1.3; overflow: hidden;
}
.cal-chip:hover { filter: brightness(.95); color: var(--cnb-navy); }
.cal-chip.is-cancelled { opacity: .55; text-decoration: line-through; }
.cal-chip.is-open { background: #fff; border: 1px dashed var(--c); border-left: 4px dashed var(--c); }
.cal-time { font-weight: 700; }
.cal-name { font-weight: 500; }
.cal-place { color: var(--muted); width: 100%; }
.cal-flag { background: var(--warn-bg); color: var(--warn); border-radius: 999px; padding: 0 .35rem; font-size: .68rem; font-weight: 700; }
.cal-month, .cal-week { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: .5rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #6a7190; background: #f8fafc; }
.cal-day { min-height: 118px; padding: .35rem; border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal-row .cal-day:first-child { border-left: 0; }
.cal-day.is-out { background: #fafbfc; }
.cal-day.is-out .cal-date { color: #b0b7c6; }
.cal-day.is-today { background: var(--cyan-50); }
.cal-date { font-size: .78rem; font-weight: 600; margin-bottom: .3rem; color: var(--muted); }
.cal-weekday { display: none; }
.cal-week-head, .cal-week-allday, .cal-week-body { display: grid; grid-template-columns: 68px repeat(7, minmax(0, 1fr)); }
.cal-week-head > div { padding: .5rem .35rem; text-align: center; font-size: .8rem; color: var(--muted); background: #f8fafc; border-left: 1px solid var(--border); }
.cal-week-head > div:first-child { border-left: 0; }
.cal-week-head .is-today { background: var(--cyan-50); color: var(--cnb-blue); }
.cal-week-allday > div { border-top: 1px solid var(--border); border-left: 1px solid var(--border); padding: .25rem; min-height: 32px; }
.cal-week-allday > div:first-child { border-left: 0; }
.cal-week-body { position: relative; border-top: 1px solid var(--border); }
.cal-hour { font-size: .7rem; color: var(--muted); text-align: right; padding-right: .35rem; border-top: 1px solid #eef1f5; box-sizing: border-box; }
.cal-week-col { position: relative; border-left: 1px solid var(--border);
  background-image: repeating-linear-gradient(to bottom, #eef1f5 0, #eef1f5 1px, transparent 1px, transparent var(--hour-px)); }
.cal-week-col.is-today { background-color: #f5fbfe; }
.cal-slot { position: absolute; padding: 1px 2px; }
.cal-slot .cal-chip { height: 100%; margin: 0; align-content: flex-start; }
.cal-agenda { display: none; }
.cal-agenda h3 { margin: 1rem 0 .4rem; }

/* --------------------------------------------------------------------------
 * Pages sans connexion : visuel de la charte à gauche, formulaire à droite
 * -------------------------------------------------------------------------- */

.no-nav { min-height: 100vh; background: #fff; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-story {
  position: relative; overflow: hidden; padding: 28px 44px; display: flex; flex-direction: column; color: var(--cnb-navy);
  /* Illustration « Le Nord, terre de bad » de la charte, en bas à gauche ; un voile blanc garde le texte lisible. */
  background:
    linear-gradient(180deg, #fff 0, #fff 42%, rgba(255, 255, 255, .55) 64%, rgba(255, 255, 255, 0) 82%),
    var(--illustration) left bottom / min(92%, 760px) auto no-repeat,
    #fff;
}
.login-logo { width: 220px; height: auto; }
.login-message { position: relative; margin: 34px 0 auto; max-width: 600px; }
.login-message > .slogan { max-width: none; margin: 0 0 14px; font-size: clamp(34px, 3.8vw, 58px); line-height: 1.02; font-weight: 800; letter-spacing: -1.2px; color: var(--cnb-navy); }
.slogan em { font-style: italic; color: var(--cnb-cyan); }
.login-message h1 { font-size: clamp(19px, 1.5vw, 23px); line-height: 1.3; font-weight: 700; margin: 0 0 8px; color: var(--cnb-blue); }
.login-message > p { color: #4c5474; font-size: 15px; line-height: 1.6; max-width: 520px; margin: 0; }
.features { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 600px; }
.features li {
  display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; border-radius: 11px;
  background: rgba(255, 255, 255, .88); border: 1px solid var(--border); box-shadow: 0 4px 14px rgba(38, 46, 96, .06);
}
.features .icon { flex: none; width: 34px; height: 34px; padding: 7px; border-radius: 9px; color: var(--cnb-blue); background: var(--cyan-50); }
.features strong { display: block; font-size: 14px; color: var(--cnb-navy); margin-bottom: 2px; }
.features span { display: block; font-size: 12.5px; line-height: 1.45; color: #5a6280; }
.login-story-footer { position: relative; font-size: 12px; color: var(--cnb-navy); margin: 16px 0 0; align-self: flex-end;
  background: rgba(255, 255, 255, .85); padding: 4px 10px; border-radius: 6px; }

.login-form-area { display: grid; place-items: center; padding: 48px 32px; background: var(--bg); border-left: 1px solid var(--border); }
.login-form { width: 100%; max-width: 410px; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 32px 30px 22px; box-shadow: 0 18px 40px rgba(38, 46, 96, .08); }
.login-mark { display: grid; place-items: center; width: 52px; height: 52px; background: var(--cyan-50); color: var(--cnb-blue); border-radius: 14px; margin-bottom: 20px; }
.login-logo-small { display: none; }
.login-form h1 { font-size: 28px; font-weight: 700; letter-spacing: -.5px; color: var(--cnb-navy); margin: 0 0 .3rem; }
.login-form h2 { font-size: 1rem; }
.login-form > p, .login-intro { color: var(--muted); font-size: 14px; line-height: 1.6; }
.login-intro { margin: 0 0 1.4rem; }
.login-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; color: #8a90a6; font-size: 12px; padding-top: 1.25rem; margin: 0; }
.login-note a { color: inherit; }

/* --------------------------------------------------------------------------
 * Petits écrans (les GEO saisissent souvent sur place, depuis un téléphone)
 * -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .app-main { padding: 24px 22px; }
  .app-topbar { padding: 0 22px; }
  .features { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  /* Menu en tiroir, ouvert par le bouton de la barre haute. */
  .sidebar { transform: translateX(-100%); }
  .sidebar-open .sidebar { transform: none; box-shadow: 0 0 40px #0005; }
  .sidebar-collapsed { --sidebar-width: 256px; }
  .app-workspace { margin-left: 0; min-width: 0; overflow-x: clip; }
  .topbar-menu { display: grid; place-items: center; }
  .sidebar-toggle { display: none; }
  .login-story { padding: 22px 26px; }
}
@media (max-width: 800px) {
  .dl, .dl-wide { grid-template-columns: 1fr; }
  .dl dd { margin-bottom: .5rem; }
  .view-switch { margin-left: 0; }
  .cal-head { display: none; }
  .cal-row { display: block; }
  .cal-day { min-height: 0; border-left: 0; }
  .cal-day.is-empty, .cal-day.is-out { display: none; }
  .cal-weekday { display: inline; }
  .cal-week { display: none; }
  .cal-agenda { display: block; }
}
@media (max-width: 700px) {
  .app-topbar { height: 56px; padding: 0 14px; }
  .topbar-role { display: none; }
  .app-main { padding: 20px 14px; }
  .btn { white-space: normal; text-align: center; }
  .app-workspace::after { display: none; }
  .page-heading { flex-direction: column; gap: 12px; margin-bottom: 18px; }
  .page-heading h1 { font-size: 23px; }
  .app-footer { padding: 12px 14px 20px; }
  .login-page { display: block; }
  .login-story { display: none; }
  .login-form-area { min-height: 100vh; padding: 24px 14px; align-items: start; border-left: 0; }
  .login-form { padding: 24px 20px 18px; }
  .login-logo-small { display: block; width: 190px; height: auto; margin-bottom: 18px; }
  .login-mark { display: none; }
}

@media print {
  .sidebar, .app-topbar, .app-footer, .btn, .page-actions { display: none !important; }
  .app-workspace { margin-left: 0; }
  .app-workspace::after { display: none; }
  .app-main { padding: 0; }
  body { background: #fff; }
  .card, .table-wrap { box-shadow: none; }
}
