/* ==========================================================================
   Design conforme à la charte graphique SNSM
   - Bleu SNSM #003361 (Pantone 289) : couleur principale
   - Jaune SNSM #FFD259 (Pantone 122) : accent
   - Palette secondaire : #EA4708, #5D8DA5, #C6C6C6, #2675BB, #36A9E1, #82CDE4
   - Typographie : Lato (Google Font), Arial en famille système
   ========================================================================== */

@font-face {
  font-family: "Lato";
  src: url("/static/fonts/lato-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lato";
  src: url("/static/fonts/lato-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lato";
  src: url("/static/fonts/lato-black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bleu: #003361;        /* Bleu SNSM — principal */
  --jaune: #FFD259;       /* Jaune SNSM — accent */
  --orange: #EA4708;      /* Orange SNSM — alertes */
  --bleu-2: #2675BB;
  --bleu-3: #36A9E1;
  --bleu-4: #82CDE4;
  --bleu-gris: #5D8DA5;
  --gris: #C6C6C6;
  --bg: #f2f5f8;
  --card: #ffffff;
  --text: #1d2733;
  --muted: #66788c;
  --border: #dde4ec;
  --ok: #2675BB;          /* succès en bleu (pas de vert dans la charte) */
  --warn: #EA4708;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Lato", Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}

/* ---- barre supérieure ---- */
header.topbar {
  background: var(--bleu);
  color: #fff;
  padding: 8px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(0, 51, 97, .35);
}
header.topbar .logo-snsm {
  height: 52px;              /* charte : logo >= 50 px sur support digital */
  width: auto;
  display: block;
  background: #fff;
  border-radius: 6px;
  padding: 3px;              /* zone de protection autour du logotype */
}
header.topbar .branding { display: flex; flex-direction: column; line-height: 1.15; }
header.topbar .branding b {
  font-weight: 900; letter-spacing: 2px; font-size: 20px;
}
header.topbar .branding span {
  font-size: 11px; letter-spacing: 2.5px; color: var(--jaune); font-weight: 700;
}
header.topbar h1 { font-size: 15px; margin: 0; font-weight: 400; opacity: .9; }
nav.mainnav { margin-left: auto; display: flex; gap: 2px; }
nav.mainnav a {
  color: #fff; text-decoration: none; padding: 14px 16px; font-size: 14px;
  font-weight: 700; letter-spacing: .3px; opacity: .85;
}
nav.mainnav a.active { background: var(--jaune); color: var(--bleu); opacity: 1; }
nav.mainnav a:not(.active):hover { background: rgba(255, 210, 89, .18); opacity: 1; }
nav.mainnav .nav-disabled {
  color: rgba(255, 255, 255, .38); padding: 14px 16px; font-size: 14px;
  font-weight: 700; letter-spacing: .3px; cursor: not-allowed;
}

main { max-width: 1180px; margin: 0 auto; padding: 22px; }
h1, h2, h3 { font-weight: 900; }
h2 { font-size: 19px; margin: 0 0 4px; color: var(--bleu); }
h2 .muted, h2 span.muted { color: var(--muted); font-weight: 400; }
h3 { font-size: 15px; margin: 0 0 10px; color: var(--bleu); }
.sub { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; line-height: 1.45; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px; margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0, 51, 97, .06);
}
.card > h2 { border-bottom: 3px solid var(--jaune); padding-bottom: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=email],
input[type=password], input[type=url], select, input[type=file] {
  width: 100%; padding: 8px 10px; border: 1px solid var(--gris); border-radius: 6px;
  font-size: 14px; background: #fff; font-family: inherit; color: var(--text);
}
input:focus, select:focus { outline: 2px solid var(--bleu-4); border-color: var(--bleu-2); }
input[readonly] { background: #eef2f6; }

button, .btn {
  background: var(--bleu); color: #fff; border: 0; border-radius: 6px;
  padding: 9px 16px; font-size: 14px; cursor: pointer; text-decoration: none;
  display: inline-block; font-family: inherit; font-weight: 700;
}
button:hover, .btn:hover { background: var(--bleu-2); }
button.secondary, .btn.secondary { background: var(--bleu-gris); }
button.secondary:hover, .btn.secondary:hover { background: #4a7590; }
button.small, .btn.small { padding: 5px 10px; font-size: 12px; }
button:disabled { background: var(--gris); cursor: not-allowed; }
#vol-save.pending { background: var(--warn); }
#vol-save.pending:hover { background: #c93d06; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; border-bottom: 2px solid var(--bleu); padding: 7px 8px;
  color: var(--bleu); font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
}
td { border-bottom: 1px solid var(--border); padding: 6px 8px; vertical-align: middle; }
tbody tr:hover td, tr:hover td { background: #f0f5fa; }
td input, td select { padding: 5px 7px; font-size: 13px; }
td input[type=number] { width: 90px; }
td input[type=date] { width: 140px; }
td input.dirty, td select.dirty { border-color: var(--warn); background: #fff4ec; }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 11px; font-size: 11px;
  font-weight: 700; letter-spacing: .3px;
}
.tag.sorties { background: #d9e8f6; color: var(--bleu); }
.tag.interventions { background: #fde3d6; color: var(--orange); }
.tag.autres { background: #fdf3d9; color: #8a6d00; }

.import-result { font-size: 13px; margin-top: 8px; }
.import-result .ok { color: var(--ok); font-weight: 700; }
.import-result .warn { color: var(--warn); font-weight: 700; }

.summary-total { font-size: 27px; font-weight: 900; color: var(--bleu); }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 10px; }
.kpi { background: #f0f5fa; border: 1px solid var(--border); border-left: 4px solid var(--bleu-2); border-radius: 8px; padding: 12px; }
.kpi .v { font-size: 20px; font-weight: 900; color: var(--bleu); }
.kpi .l { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.banner { padding: 10px 14px; border-radius: 6px; font-size: 13.5px; margin-bottom: 14px; display: none; }
.banner.error { background: #fde3d6; color: var(--orange); display: block; border-left: 4px solid var(--orange); }
.banner.info { background: #d9e8f6; color: var(--bleu); display: block; border-left: 4px solid var(--bleu-2); }

.slot { border: 1px dashed var(--bleu-gris); border-radius: 8px; padding: 14px; background: #f8fafc; }
.slot h4 { margin: 0 0 8px; font-size: 13px; }
.slot .req { color: var(--orange); }

/* ---- guide d'extraction INO (tuto intégré) ---- */
.ino-guide {
  border: 1px solid var(--border); border-left: 5px solid var(--bleu-2);
  border-radius: 8px; background: #f8fafc;
  padding: 10px 14px; margin: 0 0 14px;
}
.ino-guide summary {
  cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--bleu);
  padding: 2px 0; user-select: none;
}
.ino-guide summary::marker { color: var(--bleu-2); }
.ino-guide[open] summary { margin-bottom: 8px; }
.ino-guide-body ol { margin: 6px 0 10px; padding-left: 22px; }
.ino-guide-body li { font-size: 13px; line-height: 1.55; margin-bottom: 4px; }
.ino-guide-shots { display: flex; gap: 14px; flex-wrap: wrap; }
.ino-guide-shots figure { margin: 0; max-width: 100%; }
.ino-guide-shots img {
  max-width: 100%; height: auto; display: block;
  border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 51, 97, .15);
}
.ino-guide-shots figcaption { font-size: 11px; color: var(--muted); margin-top: 4px; font-style: italic; }
.chart-wrap { position: relative; height: 380px; }
.chart-wrap.small { height: 300px; }
.hidden { display: none; }

/* ---- menu utilisateur (haut droite) ---- */
.user-menu { position: relative; margin-left: auto; }
.user-menu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center;
  gap: 5px; user-select: none; white-space: nowrap;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-caret { color: var(--bleu-2); font-size: 10px; }
.user-menu[open] .user-caret { transform: rotate(180deg); }
.user-menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 51, 97, .18); padding: 6px;
  display: flex; flex-direction: column; gap: 2px; min-width: 180px; z-index: 60;
}
/* spécificité supérieure à #user-box a (blanc sur bleu) : liens lisibles
   sur le panneau clair du menu déroulant */
#user-box .user-menu-panel a {
  text-decoration: none; color: var(--bleu); font-size: 13px; font-weight: 700;
  padding: 7px 12px; border-radius: 6px; border: 0; opacity: 1;
}
#user-box .user-menu-panel a:hover { background: #eaf3fb; opacity: 1; }
#user-box .user-menu-panel button {
  width: 100%; text-align: left; margin: 0; color: var(--text);
  background: transparent; border: 0; font-size: 13px; font-weight: 700;
  padding: 7px 12px; border-radius: 6px;
}
#user-box .user-menu-panel button:hover { background: #fde3d6; }
.right { text-align: right; }
.muted { color: var(--muted); }
.money { font-variant-numeric: tabular-nums; }
footer { text-align: center; color: var(--muted); font-size: 11.5px; padding: 22px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.help { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
#saved-hint {
  font-size: 11px; color: var(--ok); font-weight: 700; opacity: 0;
  transition: opacity .4s; margin-left: 8px;
}

/* ---- carte profil ---- */
.profile-header {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, #eef3f8, #ffffff 60%);
  border: 1px solid var(--border); border-left: 5px solid var(--jaune);
  border-radius: 10px; padding: 16px;
}
.profile-header.empty { background: #fafbfc; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  background: var(--bleu); color: var(--jaune); font-weight: 900; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 51, 97, .35);
}
.profile-header.empty .avatar { background: var(--gris); color: #fff; box-shadow: none; }
.profile-id { flex: 1; min-width: 0; }
.profile-name { font-size: 19px; font-weight: 900; color: var(--bleu); }
.profile-chips { margin-top: 7px; display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 3px 10px; border-radius: 12px;
  background: #fff; border: 1px solid var(--border); font-weight: 700;
}
.chip.ok { border-color: var(--bleu-4); background: #eaf3fb; color: var(--bleu-2); }
.chip.missing { border-color: var(--jaune); background: #fdf6e0; color: #8a6d00; }
.chip.muted-chip { color: var(--muted); font-weight: 400; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.profile-status { text-align: right; flex: none; }
.completeness { font-size: 11px; color: var(--muted); margin-bottom: 4px; white-space: nowrap; }
.progressbar { width: 130px; height: 7px; border-radius: 4px; background: var(--gris); overflow: hidden; }
.progressbar > div { height: 100%; background: var(--bleu-2); transition: width .4s; }
.progressbar.warn > div { background: var(--jaune); }

/* ---- cadre modalités de calcul ---- */
.rules-box {
  border: 1px solid var(--bleu-4); border-left: 4px solid var(--bleu-2);
  background: #f4f9fd; border-radius: 8px; padding: 14px 16px; margin-bottom: 16px;
}
.rules-box h3 { margin-bottom: 10px; }
.rules-box td { font-size: 12px; }
.rules-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.rules-list li { margin-bottom: 7px; }

/* ---- km auto / manuel ---- */
td input.km-auto { background: #eaf3fb; border-color: var(--bleu-4); }
td input.km-auto:focus { background: #fff; }

/* ---- carte grise ---- */
.cg-box {
  margin-top: 14px; border: 1px dashed var(--bleu-gris); border-radius: 8px;
  padding: 12px 14px; background: #f8fafc;
}

/* ---- page station : emblème ---- */
.station-head { display: flex; align-items: center; gap: 14px; }
.station-head img { height: 56px; width: auto; }

/* ---- verrouillage des téléchargements ---- */
.btn.locked, a.locked {
  background: var(--gris); color: #fff; cursor: not-allowed;
  border: 1px dashed #9aa7b4;
}
#validate-btn { background: var(--orange); font-size: 15px; padding: 11px 18px; }
#validate-btn:hover { background: #c93c07; }

/* ---- identification ---- */
#user-box { display: flex; align-items: center; gap: 12px; margin-left: 10px; }
#user-box .who { font-size: 13px; font-weight: 700; color: var(--jaune); }
#user-box a { color: #fff; font-size: 12.5px; opacity: .85; text-decoration: none; border: 1px solid rgba(255,255,255,.4); border-radius: 5px; padding: 4px 10px; }
#user-box a:hover { background: rgba(255, 210, 89, .2); opacity: 1; }
#user-box .logout-btn { background: transparent; border: 1px solid rgba(255,255,255,.4); padding: 4px 10px; font-size: 12.5px; }
#user-box .logout-btn:hover { background: rgba(255, 210, 89, .2); }

/* ---- page de connexion ---- */
.login-body { background: linear-gradient(160deg, #e8eef5, #f2f5f8 45%); min-height: 100vh; }
.login-main { max-width: 420px; margin: 8vh auto; padding: 0 16px; }
.login-card { border-top: 5px solid var(--jaune); }
.login-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.login-tabs .tab {
  flex: 1; background: #e4eaf1; color: var(--muted); border-radius: 6px;
  padding: 9px 0; font-size: 14px; font-weight: 700;
}
.login-tabs .tab.active { background: var(--bleu); color: #fff; }

/* ===================== smartphones (≤ 600 px) ===================== */
@media (max-width: 600px) {
  header.topbar { padding: 8px 12px; gap: 8px 12px; }
  header.topbar .logo-snsm { height: 40px; }
  header.topbar .branding span { display: none; }
  header.topbar h1 { font-size: 13px; }
  nav.mainnav {
    order: 9; width: 100%; margin-left: 0; margin-right: 0;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    border-top: 1px solid rgba(255, 255, 255, .18);
  }
  nav.mainnav a, nav.mainnav .nav-disabled {
    padding: 11px 12px; font-size: 13px; white-space: nowrap;
  }
  #user-box { margin-left: 0; }

  main { padding: 12px; }
  .card { padding: 14px; margin-bottom: 14px; }
  h2 { font-size: 17px; }

  .summary-grid { grid-template-columns: 1fr 1fr; }
  .chart-wrap { height: 280px; }
  .chart-wrap.small { height: 220px; }

  .inline > input, .inline > select, .inline > button, .inline > .btn {
    width: 100% !important;
  }
  input[type=text], input[type=number], input[type=date], input[type=email],
  input[type=password], select, input[type=file] {
    font-size: 16px; min-height: 42px;
  }
  button, .btn { min-height: 42px; }
  button.small, .btn.small { min-height: 34px; }
  .actions { align-items: stretch; }
  .actions > button, .actions > .btn { flex: 1 1 100%; text-align: center; }

  .profile-header { align-items: flex-start; }
  .station-head { flex-wrap: wrap; }
  .ino-guide-shots figure { width: 100%; }
  .ino-guide-shots img { width: 100%; height: auto; }

  /* tableaux larges : défilement horizontal au lieu de déborder */
  table {
    display: block; max-width: 100%; overflow-x: auto;
    white-space: nowrap; -webkit-overflow-scrolling: touch;
  }
  td input[type=number] { width: 76px; }
  td input[type=date] { width: 128px; }
}

/* ---- case à cocher (convention employeur) ---- */
.check-line {
  display: flex; align-items: center; gap: 9px; margin-top: 14px;
  font-size: 13.5px; color: var(--text); font-weight: 600;
  letter-spacing: 0; text-transform: none; cursor: pointer;
}
.check-line input[type=checkbox] {
  width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--bleu);
}

/* ---- convention employeur ---- */
.progressbar.wide { width: 100%; height: 14px; border-radius: 7px; }
.conv-alert {
  margin-top: 12px; padding: 9px 13px; border-radius: 6px; font-size: 13px;
  background: #fdf3d9; color: #7a5b00; border-left: 4px solid var(--jaune);
}
.conv-alert a { color: var(--bleu); }

/* ---- convention : sélection manuelle des journées ---- */
.conv-validated { margin-top: 12px; font-size: 13.5px; }
.conv-table td, .conv-table th { white-space: nowrap; }
.conv-table td:nth-child(3) { white-space: normal; min-width: 160px; }
.conv-table .conv-check-cell { text-align: center; }
.conv-check { width: 20px; height: 20px; accent-color: var(--bleu); cursor: pointer; }
.conv-table tr.is-checked td { background: #eaf3fb; }

/* ---- tutoriel : report sur le formulaire officiel ---- */
.tuto-cta, .tuto-dl {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px;
}
.btn.disabled { opacity: .5; pointer-events: none; }
.recap { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.recap-row {
  display: grid; grid-template-columns: minmax(180px, 34%) 1fr auto;
  gap: 10px; align-items: center; padding: 9px 12px; border-top: 1px solid var(--border);
}
.recap-row:first-child { border-top: 0; }
.recap-label { font-weight: 700; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.recap-label .help { margin: 0; font-weight: 400; }
.recap-value { font-variant-numeric: tabular-nums; word-break: break-word; }
.chip.missing {
  background: #fff3df; color: var(--warn); border: 1px solid #f0d3a0;
  border-radius: 10px; padding: 1px 8px; font-size: 11.5px; font-weight: 700;
}
.tuto-table { width: 100%; border-collapse: collapse; }
.tuto-table th, .tuto-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px;
}
.tuto-table th { background: var(--bleu); color: #fff; }
.tuto-table tr.recap-subtotal td { background: #f2f5f8; }
.tuto-table tr.recap-total td { background: #eaf3fb; font-size: 14px; }
.tuto-table-wrap { overflow-x: auto; margin-top: 8px; }
.tuto-step { border-left: 3px solid var(--bleu); padding: 2px 0 2px 14px; margin: 20px 0; }
.tuto-step h3 { margin: 0 0 6px; }
.tuto-shots { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; align-items: flex-start; }
.tuto-shots figure, .tuto-figure { margin: 0; }
.tuto-shots img, .tuto-figure img {
  max-width: 100%; height: auto; display: block;
  border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 51, 97, .15);
}
.tuto-shots figure { max-width: 320px; }
.tuto-shots figure.tuto-icon { max-width: 150px; }
.tuto-shots figcaption, .tuto-figure figcaption {
  font-size: 11px; color: var(--muted); margin-top: 4px; font-style: italic;
}
.tuto-figure { margin-top: 12px; max-width: 420px; }
.tuto-warn li { margin-bottom: 7px; line-height: 1.45; }

@media (max-width: 600px) {
  .recap-row { grid-template-columns: 1fr; gap: 6px; }
  .tuto-shots figure, .tuto-shots figure.tuto-icon { max-width: 100%; }
  .tuto-figure { max-width: 100%; }
}

/* ---- tableau de bord d'accueil ---- */
.dash-hero {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  background: linear-gradient(135deg, var(--bleu) 0%, #0a4f8f 55%, var(--bleu-2) 100%);
  color: #fff; border-radius: 14px; padding: 26px 28px; margin-bottom: 16px;
  box-shadow: 0 6px 18px rgba(0, 51, 97, .25);
  position: relative; overflow: hidden;
}
.dash-hero::after {
  content: ""; position: absolute; right: -40px; top: -40px;
  width: 220px; height: 220px; border-radius: 50%;
  border: 26px solid rgba(255, 210, 89, .16); pointer-events: none;
}
.dash-hero h2 { color: #fff; font-size: 28px; margin: 2px 0 6px; }
.dash-hero .sub { color: rgba(255, 255, 255, .82); margin: 0; }
.dash-kicker {
  margin: 0; color: var(--jaune); font-size: 12px; font-weight: 900;
  letter-spacing: 2px; text-transform: uppercase;
}
.dash-hero-badge {
  text-align: center; flex: none; border-left: 1px solid rgba(255, 255, 255, .25);
  padding-left: 22px; display: flex; flex-direction: column; line-height: 1.1;
}
.dash-hero-badge b { font-size: 26px; letter-spacing: 3px; }
.dash-hero-badge span {
  font-size: 10px; letter-spacing: 2px; color: var(--jaune);
  font-weight: 700; text-transform: uppercase;
}
.dash-hero-logo {
  display: block; height: 104px; width: auto; max-width: 170px;
  object-fit: contain; background: #fff; border-radius: 14px; padding: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}

.dash-status { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.chip.chip-warn { border-color: #f0c0a8; background: #fff4ec; color: var(--orange); }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.dash-card {
  display: flex; align-items: flex-start; gap: 14px; padding: 16px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  text-decoration: none; color: var(--text); position: relative;
  box-shadow: 0 1px 3px rgba(0, 51, 97, .06);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.dash-card:hover {
  transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 51, 97, .14);
  border-color: var(--bleu-4);
}
.dash-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  border-radius: 12px 0 0 12px; background: var(--bleu-2);
}
.dash-card:hover::before { background: var(--jaune); }
.dash-icon {
  flex: none; width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bleu), var(--bleu-2)); color: #fff;
}
.dash-icon svg {
  width: 26px; height: 26px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.dash-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.dash-body b { font-size: 15px; color: var(--bleu); }
.dash-body > span { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.dash-body .dash-meta { font-size: 11.5px; font-weight: 700; color: var(--bleu-2); margin-top: 2px; }
.dash-arrow { flex: none; color: var(--bleu-2); font-weight: 900; align-self: center; }
.dash-foot { text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 20px; }

/* ---- bandeau photos médiathèque (accueil intranet) ---- */
.gallery-spotlight { margin: 0 0 12px; }
.spotlight-link {
  display: flex; align-items: center; gap: 16px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px;
  text-decoration: none; transition: border-color .15s, box-shadow .15s;
}
.spotlight-link:hover {
  border-color: var(--bleu-4); box-shadow: 0 4px 14px rgba(0, 51, 97, .12);
}
.spotlight-label {
  flex: none; font-size: 11px; font-weight: 900; letter-spacing: 2px;
  text-transform: uppercase; color: var(--bleu-2);
}
.spotlight-thumbs { display: flex; gap: 8px; flex: 1; justify-content: center; min-width: 0; }
.spotlight-thumbs img {
  height: 62px; width: 93px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--border); display: block;
}
.spotlight-more { flex: none; font-size: 12px; font-weight: 700; color: var(--bleu-2); }
@media (max-width: 600px) {
  .spotlight-link { flex-wrap: wrap; justify-content: center; gap: 8px; }
  .spotlight-label { display: none; }
}

/* ---- agenda de la station (accueil intranet) ---- */
.agenda-card { margin-bottom: 16px; }
.agenda-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.agenda-head h2 { margin: 0; }
.agenda-nav { display: flex; align-items: center; gap: 10px; }
.agenda-nav b { font-size: 14px; color: var(--bleu); text-transform: capitalize; min-width: 120px; text-align: center; }
.ag-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.ag-dow {
  font-size: 10px; font-weight: 900; text-transform: uppercase;
  color: var(--muted); text-align: center; padding: 2px 0;
}
.ag-day {
  position: relative; text-align: center; font-size: 13px; padding: 7px 0;
  border-radius: 7px; background: #f4f7fa; color: var(--text);
}
.ag-day.other { background: transparent; }
.ag-day.today {
  background: var(--jaune); font-weight: 900; color: var(--bleu);
}
.ag-day.event { background: #eaf3fb; font-weight: 800; color: var(--bleu); }
.ag-day.today.event { background: var(--jaune); }
.ag-dot {
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--bleu-2);
}
.ag-day.today .ag-dot { background: var(--bleu); }
.ag-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 9px 10px;
  border: 1px solid var(--border); border-left: 4px solid var(--bleu-2);
  border-radius: 8px; margin-bottom: 8px; background: #fff;
}
.ag-date {
  flex: none; font-size: 11px; font-weight: 900; color: var(--bleu);
  background: #eaf3fb; border-radius: 6px; padding: 5px 8px; white-space: nowrap;
}
.ag-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; font-size: 13.5px; }
.ag-body .muted { font-size: 12px; }

/* ---- bandeau dernière actualité (accueil intranet) ---- */
.news-flash {
  border: 1px solid var(--bleu-4); border-left: 5px solid var(--jaune);
  border-radius: 10px; background: #fffdf6; margin: 0 0 16px; padding: 0;
  overflow: hidden;
}
.news-flash-link {
  display: flex; flex-direction: column; gap: 3px; padding: 14px 18px;
  text-decoration: none; color: var(--text);
}
.news-flash-link:hover { background: #fff9e8; }
.news-flash-kicker {
  font-size: 11px; font-weight: 900; letter-spacing: 2px;
  text-transform: uppercase; color: var(--bleu-2);
}
.news-flash-title { font-size: 16px; font-weight: 800; color: var(--bleu); }
.news-flash-excerpt { font-size: 13px; color: var(--muted); line-height: 1.45; }
.news-flash-more { font-size: 12px; font-weight: 700; color: var(--bleu-2); margin-top: 2px; }

/* ---- page liens utiles ---- */
.back-home { margin-bottom: 14px; text-decoration: none; display: inline-block; }

/* ---- section frais kilométriques repliable (déclaration) ---- */
.sec-ik {
  border: 1px solid var(--border); border-radius: 10px; background: #f8fafc;
  padding: 0; margin: 0;
}
.sec-ik > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; padding: 12px 16px;
  user-select: none; flex-wrap: wrap;
}
.sec-ik > summary::-webkit-details-marker { display: none; }
.sec-ik[open] > summary { border-bottom: 1px dashed var(--border); }
.sec-ik .ik-bar { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.sec-ik .ik-toggle-hint {
  flex: none; font-size: 12px; font-weight: 700; color: var(--bleu-2);
  white-space: nowrap;
}
.sec-ik .ik-body { padding: 14px 16px; }

/* ---- vie de station ---- */
.news-item {
  border: 1px solid var(--border); border-left: 5px solid var(--bleu-2);
  border-radius: 10px; padding: 16px; margin-bottom: 14px; background: #fff;
}
.news-item.pinned { border-left-color: var(--jaune); background: #fffdf6; }
.news-head {
  display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline;
  justify-content: space-between; margin-bottom: 8px;
}
.news-head h3 { margin: 0; font-size: 17px; }
.news-meta {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  font-size: 12px; color: var(--muted);
}
.chip.pinned { border-color: var(--jaune); background: var(--jaune); color: var(--bleu); }
/* carte ciblée par un lien d'ancrage (ex. « Importer des photos » -> /admin#google-card) */
section.card:target {
  border: 2px solid var(--bleu-4);
  box-shadow: 0 0 0 6px rgba(0, 51, 97, .12);
}

/* ---------------- page déclaration : sous-navigation collante + accordéon */
nav.dec-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bleu-2);
  display: flex;
  gap: 4px;
  padding: 8px 22px;
  overflow-x: auto;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 51, 97, .25);
}
nav.dec-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  opacity: .9;
}
nav.dec-nav a:hover { background: rgba(255, 255, 255, .15); opacity: 1; }
.dn-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #cfd8e3; display: inline-block; flex: none;
}
.dn-dot.done { background: #7ed957; }
.dn-dot.opt { background: #9db8d4; }
.dn-dot.todo { background: #ffd66b; }
.dn-dot.warn { background: var(--orange); }

/* section repliable : titre + statut + caret */
details.sec-fold > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 2px;
  border-radius: 6px;
}
details.sec-fold > summary::-webkit-details-marker { display: none; }
details.sec-fold > summary:hover { background: rgba(0, 51, 97, .04); }
details.sec-fold > summary .sf-title { font-size: 17px; font-weight: 800; color: var(--bleu); }
details.sec-fold > summary .sf-status {
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  border: 1px solid #d8e0ea; border-radius: 12px; padding: 3px 10px;
  background: #f4f7fa;
}
details.sec-fold > summary .sf-status.done { color: #2e7d32; border-color: #bfe3c0; background: #eef7ee; }
details.sec-fold > summary .sf-status.warn { color: var(--orange); border-color: #f0c0a8; background: #fff4ec; }
details.sec-fold > summary .sf-caret { margin-left: auto; color: var(--bleu); font-size: 14px; transition: transform .18s; }
details.sec-fold[open] > summary .sf-caret { transform: rotate(180deg); }
details.sec-fold .sf-body { margin-top: 10px; }

/* groupes d'événements (section 3) */
details.ev-group { margin: 12px 0; border: 1px solid #d8e0ea; border-radius: 8px; overflow: hidden; }
details.ev-group > summary {
  cursor: pointer; list-style: none; padding: 9px 14px;
  background: #f4f7fa; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
details.ev-group > summary::-webkit-details-marker { display: none; }
details.ev-group > summary::after { content: "▾"; margin-left: auto; color: var(--bleu); }
details.ev-group[open] > summary::after { content: "▴"; }
details.ev-group table { margin: 0; }

/* bloc modalités de calcul repliable */
details.rules-box-fold { margin: 10px 0; }
details.rules-box-fold > summary {
  cursor: pointer; list-style: none; padding: 8px 12px;
  background: #f4f7fa; border-radius: 8px; font-size: 14.5px;
}
details.rules-box-fold > summary::-webkit-details-marker { display: none; }
details.rules-box-fold > summary::after { content: " ▾"; color: var(--bleu); }
details.rules-box-fold[open] > summary::after { content: " ▴"; }
details.rules-box-fold .rules-box { margin-top: 10px; }

/* bouton principal « procéder à ma déclaration en ligne » */
.btn.primary-lg {
  background: var(--orange);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  padding: 12px 26px;
  border-radius: 10px;
  border: none;
}
.btn.primary-lg:hover { filter: brightness(1.08); }
/* même bouton, grisé tant que le lien du formulaire officiel n'est pas publié */
.btn.primary-lg.locked {
  background: var(--gris);
  color: #fff;
  cursor: not-allowed;
  border: 1px dashed #9aa7b4;
}
.btn.primary-lg.locked:hover { filter: none; }

/* icône « ajouter à mon calendrier » sur les événements de l'agenda accueil */
.ag-item .ag-ical {
  text-decoration: none;
  font-size: 15px;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 6px;
  border: 1px solid #d8e0ea;
  background: #fff;
  flex: none;
}
.ag-item .ag-ical:hover { background: #eaf3fb; border-color: var(--bleu-4); }

/* planning 30 jours : blocs semaine déroulables */
details.ag-week {
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fff;
  overflow: hidden;
}
details.ag-week > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: #f4f7fa;
  font-size: 13.5px;
  min-height: 44px;          /* zone tactile confortable sur smartphone */
  box-sizing: border-box;
}
details.ag-week > summary::-webkit-details-marker { display: none; }
details.ag-week > summary::after { content: "▾"; margin-left: auto; color: var(--bleu); font-size: 13px; }
details.ag-week[open] > summary::after { content: "▴"; }
details.ag-week .ag-week-body { padding: 6px 8px; }
details.ag-week .ag-item {
  border: 0;
  border-left: 4px solid var(--bleu-2);
  border-radius: 0;
  margin: 0 0 6px;
}
.news-body { font-size: 14px; line-height: 1.6; }
.news-body p { margin: 0 0 10px; }
.news-body ul { margin: 0 0 10px; padding-left: 22px; }
.news-body a { color: var(--bleu-2); }
.news-thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.news-thumb {
  display: block; width: 140px; height: 105px; border-radius: 8px;
  overflow: hidden; border: 1px solid var(--border); background: #eef2f6;
}
.news-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-files { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.file-chip { text-decoration: none; color: var(--bleu); cursor: pointer; }
.news-admin-item {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.news-admin-item:last-child { border-bottom: 0; }
.news-admin-main { min-width: 0; }
.news-admin-main h3 { margin: 6px 0; }
.news-excerpt { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.news-admin-actions {
  display: flex; gap: 6px; flex-wrap: wrap; align-content: flex-start; flex: none;
}
button.tiny { padding: 1px 6px; font-size: 11px; border-radius: 5px; background: var(--orange); }
button.tiny:hover { background: #c93d06; }

/* ---- aides pliables (déclaration) ---- */
.sec-help {
  border: 1px dashed var(--border); border-radius: 8px; background: #f8fafc;
  padding: 8px 12px; margin: 0 0 12px;
}
.sec-help summary {
  cursor: pointer; font-size: 12px; font-weight: 700; color: var(--bleu-2);
  user-select: none;
}
.sec-help summary::marker { color: var(--jaune); }
.sec-help .sub { margin: 8px 0 0; }
.sec-help[open] summary { margin-bottom: 2px; }
.help-toggle-all { margin: 0 0 14px; }

@media (max-width: 600px) {
  .dash-hero { flex-direction: column; align-items: flex-start; padding: 20px; }
  .dash-hero-badge {
    border-left: 0; border-top: 1px solid rgba(255, 255, 255, .25);
    padding: 12px 0 0; flex-direction: row; gap: 8px; align-items: baseline;
  }
  .dash-grid { grid-template-columns: 1fr; }
  .news-admin-item { flex-direction: column; }
}

/* ---- médiathèque (galerie Google Photos) ---- */
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px; margin-top: 12px;
}
.gallery-thumb {
  position: relative; margin: 0; border-radius: 8px; overflow: hidden;
  background: #eef2f6; aspect-ratio: 1; cursor: zoom-in;
  border: 1px solid var(--border);
}
.gallery-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .15s ease;
}
.gallery-thumb:hover img { transform: scale(1.04); }
.gallery-del {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  background: rgba(190, 60, 20, .9); color: #fff; border: 0;
  border-radius: 6px; padding: 2px 8px; font-size: 13px; cursor: pointer;
  opacity: 0; transition: opacity .15s ease;
}
.gallery-thumb:hover .gallery-del, .gallery-del:focus-visible { opacity: 1; }
.lightbox {
  position: fixed; inset: 0; z-index: 1000; display: flex;
  align-items: center; justify-content: center;
  background: rgba(10, 20, 30, .92);
}
.lightbox.hidden { display: none; }
.lightbox img {
  max-width: 92vw; max-height: 86vh; border-radius: 6px;
  object-fit: contain; box-shadow: 0 8px 40px rgba(0, 0, 0, .5);
}
.lightbox-close, .lightbox-nav {
  position: absolute; background: rgba(255, 255, 255, .12); color: #fff;
  border: 0; border-radius: 50%; width: 44px; height: 44px;
  font-size: 22px; cursor: pointer; line-height: 1;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, .25); }
.lightbox-close { top: 16px; right: 16px; }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-caption {
  position: absolute; bottom: 14px; left: 0; right: 0; text-align: center;
  color: #dfe8f0; font-size: 13px; padding: 0 70px;
}
@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .gallery-del { opacity: 1; }
}
