:root {
  /* --orange = couleur d'accent principale (le nom est conserve pour compatibilite).
     Elle est surchargee par les themes ci-dessous via l'attribut data-theme.
     Valeur par defaut : bleu-nuit (coherent avec le theme par defaut de l'app). */
  --orange: #1e3a5f;
  --accent-soft: #eef2f7;
  --accent-ink: #1e3a5f;
  --ink: #1a1a1a;
  --muted: #6b7280;
  --line: #e2e8f0;
  --bg: #edf0f8;
  --surface: #ffffff;
  --header-bg: #0f1e3d;
  --header-ink: #ffffff;
  --shadow: 0 1px 3px rgba(15,30,60,.05), 0 6px 20px rgba(15,30,60,.08);
  --shadow-sm: 0 1px 3px rgba(15,30,60,.08);
  --ok: #0a7d2c;
  --err: #c0392b;
}

/* Themes de couleur (selectionnables depuis Admin > Parametres). */
:root[data-theme="bleu-nuit"] {
  --orange: #1e3a5f;
  --accent-soft: #eef2f7;
  --accent-ink: #1e3a5f;
}
:root[data-theme="bleu-clair"] {
  --orange: #2e86de;
  --accent-soft: #eaf4fd;
  --accent-ink: #1b5d96;
}
:root[data-theme="rouge"] {
  --orange: #d62828;
  --accent-soft: #fdeaea;
  --accent-ink: #8c1d1d;
}
/* Thème custom : --orange, --accent-soft, --accent-ink posés en inline style par JS */
:root[data-theme="custom"] { }

/* Dark mode — tokens structurels. L'accent --orange est adapté par theme dans les blocs suivants. */
@media (prefers-color-scheme: dark) {
  :root:not([data-dark="off"]) {
    --bg: #09111f; --surface: #131c2e;
    --header-bg: #060b18; --header-ink: #dce5fa;
    --ink: #dce5fa; --muted: #8898b8; --line: #1c2b42;
    --accent-soft: #1a2d50; --accent-ink: #93c5fd;
    --shadow: 0 1px 3px rgba(0,0,0,.2), 0 6px 20px rgba(0,0,0,.3);
    --shadow-sm: 0 1px 4px rgba(0,0,0,.25);
    --ok: #22c55e; --err: #f87171;
    color-scheme: dark;
  }
  :root:not([data-dark="off"])[data-theme="bleu-nuit"],
  :root:not([data-dark="off"]):not([data-theme]) { --orange: #4f94e0; }
  :root:not([data-dark="off"])[data-theme="bleu-clair"] { --orange: #60b4f8; --accent-ink: #bfdbfe; }
  :root:not([data-dark="off"])[data-theme="rouge"] { --orange: #f87171; --accent-soft: #2d1515; --accent-ink: #fca5a5; }
  :root:not([data-dark="off"])[data-theme="orange"] { --orange: #fbbf24; --accent-soft: #2d1a00; --accent-ink: #fde68a; }
}
:root[data-dark="true"] {
  --bg: #09111f; --surface: #131c2e;
  --header-bg: #060b18; --header-ink: #dce5fa;
  --ink: #dce5fa; --muted: #8898b8; --line: #1c2b42;
  --accent-soft: #1a2d50; --accent-ink: #93c5fd;
  --shadow: 0 1px 3px rgba(0,0,0,.2), 0 6px 20px rgba(0,0,0,.3);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.25);
  --ok: #22c55e; --err: #f87171;
  color-scheme: dark;
}
:root[data-dark="true"][data-theme="bleu-nuit"],
:root[data-dark="true"]:not([data-theme]) { --orange: #4f94e0; }
:root[data-dark="true"][data-theme="bleu-clair"] { --orange: #60b4f8; --accent-ink: #bfdbfe; }
:root[data-dark="true"][data-theme="rouge"] { --orange: #f87171; --accent-soft: #2d1515; --accent-ink: #fca5a5; }
:root[data-dark="true"][data-theme="orange"] { --orange: #fbbf24; --accent-soft: #2d1a00; --accent-ink: #fde68a; }

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(14px, 0.9vw + 11px, 16px);
  color: var(--ink);
  background: var(--bg);
}
h2 { font-family: 'DM Sans', system-ui, sans-serif; font-size: clamp(1rem, .4vw + .9rem, 1.1rem); margin: 24px 0 12px; font-weight: 700; letter-spacing: -.01em; }
/* Layout coquille — même pattern que logavia */
#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
header { flex-shrink: 0; }
.app-body { display: flex; align-items: stretch; flex: 1; min-height: 0; }

header {
  background: var(--header-bg);
  border-bottom: none;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
header h1 { margin: 0; font-size: clamp(1rem, 1vw + .8rem, 1.3rem); font-family: 'DM Sans', system-ui, sans-serif; font-weight: 800; letter-spacing: -.02em; color: var(--header-ink); }
.header-left { display: flex; align-items: center; gap: 8px; }
.header-brand { display: flex; align-items: center; gap: 10px; }
.company { color: rgba(255,255,255,.5); font-size: 12px; text-align: right; }
header .icon-btn { color: var(--header-ink); border-color: rgba(255,255,255,.22); background: transparent; }
header .icon-btn:hover { background: rgba(255,255,255,.12); }
.drawer-toggle { display: inline-flex; }
/* Sidebar */
:root { --sidebar-width: 220px; --sidebar-width-collapsed: 60px; --bottom-nav-height: 60px; }

.sidebar { display: none; }
main {
  flex: 1; min-width: 0; overflow-y: auto;
  padding: 20px; padding-bottom: calc(20px + var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  max-width: 1000px; width: 100%;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
/* h2 défini dans la section body avec clamp() */
h3 { font-size: 13px; margin: 16px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.card { background: var(--surface); border: none; border-radius: 14px; padding: 16px; box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
label { display: flex; flex-direction: column; font-size: 13px; font-weight: 500; color: var(--ink); gap: 6px; }
label .hint { font-size: 11px; font-weight: 400; color: var(--muted); }
input, select, textarea {
  font-size: 14px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); background: var(--surface); font-family: inherit;
  min-height: 40px; transition: border-color .15s, box-shadow .15s;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 15%, transparent);
}
button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
input.error, select.error, textarea.error { border-color: var(--err); }
input.error:focus-visible, select.error:focus-visible, textarea.error:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--err) 15%, transparent);
}
.field-error { font-size: 12px; color: var(--err); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.field-error::before { content: "⚠"; font-size: 10px; }
input.valid, select.valid, textarea.valid { border-color: var(--ok); }
/* Champ date/heure avec mini-fleches haut/bas (pas de 30 min). */
.dt-field { display: flex; align-items: stretch; }
.dt-field input[type="datetime-local"] {
  flex: 1 1 auto; border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0;
}
.dt-steps { display: flex; flex-direction: column; }
.dt-step {
  background: var(--surface); color: var(--muted); border: 1px solid var(--line); border-left: none;
  padding: 0 8px; font-size: 9px; line-height: 1; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; min-width: 26px;
}
.dt-step:first-child { border-top-right-radius: 6px; }
.dt-step:last-child { border-bottom-right-radius: 6px; border-top: none; }
.dt-step:hover { background: var(--accent-soft); color: var(--accent-ink); filter: none; }
button {
  background: var(--orange); color: #fff; border: none; border-radius: 10px;
  padding: 10px 16px; font-size: 14px; cursor: pointer; font-weight: 600; min-height: 44px;
}
button:hover { filter: brightness(.95); }
button.ghost { background: transparent; color: var(--orange); border: 1px solid var(--orange); margin-top: 8px; }
button.ghost.danger { color: var(--err); border-color: var(--err); }
button.del { background: var(--surface); color: var(--err); border: 1px solid var(--line); padding: 6px 10px; font-weight: 400; min-height: unset; }
.actions { margin-top: 16px; display: flex; gap: 8px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.item .meta { font-size: 12px; color: var(--muted); }
.item .amount { font-weight: 600; }
.item a { color: var(--orange); text-decoration: none; font-size: 13px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge.ok { background: #e6f4ea; color: var(--ok); }
.badge.warn { background: #fdeaea; color: var(--err); }
.badge.muted { background: #eef0f2; color: var(--muted); }
.badge.soon { background: #fff4e5; color: #9a5b00; }
.toasts-container {
  position: fixed; top: 24px; right: 24px; z-index: 1000;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none;
}
@media (max-width: 640px) {
  .toasts-container { top: auto; bottom: 76px; right: 12px; left: 12px; align-items: stretch; }
}
.toast-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 10px; min-width: 220px; max-width: 360px;
  font-size: 14px; color: #fff; pointer-events: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  animation: toastIn .22s cubic-bezier(.4,0,.2,1) both;
  transition: opacity .2s, transform .2s;
}
.toast-item.removing { opacity: 0; transform: translateX(16px); }
@keyframes toastIn { from { opacity:0; transform:translateX(16px); } to { opacity:1; transform:none; } }
.toast-item.info    { background: #2c3e50; }
.toast-item.success { background: var(--ok, #2a9460); }
.toast-item.error   { background: var(--err, #c0392b); }
.toast-item.warning { background: #c07000; }
.toast-icon  { font-size: 15px; flex-shrink: 0; }
.toast-msg   { flex: 1; line-height: 1.4; }
.toast-close { flex-shrink: 0; background: none; border: none; color: rgba(255,255,255,.75); font-size: 16px; line-height: 1; padding: 0 2px; cursor: pointer; border-radius: 3px; }
.toast-close:hover { color: #fff; }
.fec-meta { font-size: 13px; margin: 12px 0; color: var(--muted); }
/* Tab buttons dans sidebar et drawer */
.sidebar .tab-btn, .drawer .tab-btn {
  background: none; color: var(--ink); border: none; border-radius: 10px;
  font-weight: 600; display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 10px; cursor: pointer; width: 100%; font-size: 14px;
}
.sidebar .tab-btn:hover, .drawer .tab-btn:hover { background: var(--accent-soft); filter: none; }
.sidebar .tab-btn.active, .drawer .tab-btn.active { background: var(--orange); color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Sous-nav — 2e niveau — barre horizontale en haut de chaque panel */
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 12px 0;
  border-bottom: 1px solid var(--line);
}
.subnav button {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 8px 14px; font-size: 13px;
  cursor: pointer; color: var(--muted); font-weight: 500;
  white-space: nowrap; margin-bottom: -1px;
}
.subnav button:hover { color: var(--ink); }
.subnav button.active { color: var(--orange); font-weight: 600; border-bottom-color: var(--orange); }

/* 3e niveau (Admin) — toujours visible dans son panel */
.subnav3 {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 12px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  border-radius: 4px 4px 0 0;
}
.subnav3 button {
  background: none; border: none; padding: 7px 14px; font-size: 12px;
  cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent;
  font-weight: 500; white-space: nowrap;
}
.subnav3 button.active { color: var(--ink); border-bottom-color: var(--orange); font-weight: 600; }
.subnav3-panel { display: none; }
.subnav3-panel.active { display: block; }

/* Ancienne classe .subtabs (conservée si utilisée ailleurs) */
.subtabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.subtabs button {
  background: none; border: none; padding: 10px 14px; font-size: 13px;
  cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; font-weight: 500;
}
.subtabs button.active { color: var(--ink); border-bottom-color: var(--orange); font-weight: 600; }
.subtab-panel { display: none; }
.subtab-panel.active { display: block; }
.item .row-actions { display: flex; gap: 6px; }
.bulk-bar { display: flex; align-items: center; gap: 12px; padding: 8px 4px; margin-bottom: 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.item button.mini { padding: 6px 10px; font-size: 12px; font-weight: 500; }
.logo-box { display: flex; align-items: center; gap: 16px; min-height: 60px; }
#logo-preview { max-height: 80px; max-width: 240px; display: none; border: 1px solid var(--line); border-radius: 6px; padding: 4px; background: #fff; }
.file-label { display: inline-block; cursor: pointer; }

/* Medias des avions : photos + documents */
#avion-media h4 { font-size: 13px; margin: 18px 0 8px; color: var(--ink); }
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-grid .empty { font-size: 13px; color: var(--muted); }
.photo-grid .photo {
  position: relative; width: 130px; height: 98px; border: 1px solid var(--line);
  border-radius: 6px; overflow: hidden; background: #fafafa;
}
.photo-grid .photo img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; display: block; }
.photo-grid .photo button.del {
  position: absolute; top: 3px; right: 3px; padding: 2px 7px; font-size: 11px;
  background: rgba(255,255,255,.9); border: 1px solid var(--line);
}
.doc-cat { font-size: 11px; }

/* Ecran de connexion */
.login-screen {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center; z-index: 2000; padding: 16px;
}
.login-card {
  background: var(--surface); border: none; border-top: 4px solid var(--orange);
  border-radius: 18px; padding: 28px; width: min(380px, 94vw);
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px;
}
.login-card h1 { margin: 0; font-size: 22px; }
.login-card label { font-size: 13px; }
.login-card .actions { margin-top: 4px; }
.login-card button:not(.btn-eye) { width: 100%; }
.login-card .field-wrap { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.login-card .field-wrap label { font-weight: 500; }
.password-wrap { display: flex; }
.password-wrap input { flex: 1; border-radius: 6px 0 0 6px; margin: 0; }
.btn-eye { flex: 0 0 36px; width: 36px !important; background: #f8f9fa; border: 1px solid var(--line); border-left: none; border-radius: 0 6px 6px 0; cursor: pointer; color: #94a3b8; display: flex; align-items: center; justify-content: center; padding: 0; font-weight: normal; font-size: 14px; }
.btn-eye:hover { background: #f0f1f3; color: var(--orange); }
.balance.err { color: var(--err); font-size: 13px; }

/* En-tete : infos club + utilisateur connecte */
.header-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.user-box { display: flex; align-items: center; gap: 10px; }
/* Bouton deconnexion dans le header : toujours visible quelle que soit la couleur du theme */
.header-right button.ghost { color: var(--header-ink); border-color: rgba(255,255,255,.45); background: transparent; margin-top: 0; }
.header-right button.ghost:hover { background: rgba(255,255,255,.12); border-color: var(--header-ink); }
.user-info { font-size: 12px; color: var(--header-ink); text-align: right; line-height: 1.3; }
.user-info .role { color: rgba(255,255,255,.55); }

/* Notifications : cloche + panneau deroulant. */
.notif-box { position: relative; display: inline-flex; }
.notif-bell { position: relative; background: none; border: none; cursor: pointer; font-size: 18px; line-height: 1; padding: 4px; color: var(--header-ink); min-height: unset; }
.notif-bell:hover { opacity: 0.8; }
.notif-count {
  position: absolute; top: -2px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px;
  background: #d62828; color: #fff; border-radius: 8px; font-size: 10px; line-height: 16px;
  text-align: center; font-weight: 700; box-sizing: border-box;
}
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; width: 320px; max-width: 86vw;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); overflow: hidden;
}
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-empty { padding: 16px 12px; color: var(--muted); font-size: 13px; margin: 0; text-align: center; }
.notif-item { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.35; }
.notif-item:last-child { border-bottom: none; }
.notif-item.lu { opacity: 0.55; }
.notif-dot { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--accent, #2a7); }
.notif-warn .notif-dot { background: #d62828; }
.notif-info .notif-dot { background: #2a72d6; }
.notif-msg { flex: 1 1 auto; }

/* Bibliotheque de documents. */
.biblio-group { margin-bottom: 14px; }
.biblio-group h4 { margin: 8px 0 4px; font-size: 14px; }
.biblio-actions { display: inline-flex; gap: 6px; align-items: center; }

/* Progression eleve. */
.prog-bar { height: 12px; background: var(--border, #e5e7eb); border-radius: 6px; overflow: hidden; margin: 4px 0 10px; }
.prog-bar-fill { height: 100%; background: var(--accent, #2a7); transition: width 0.3s; }
.prog-module { margin-bottom: 14px; }
.prog-module h4 { margin: 8px 0 4px; font-size: 14px; }
.prog-actions { display: inline-flex; gap: 4px; align-items: center; }
/* --- Progression : barre de vues (grille / livret / seance) --- */
.prog-view-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.prog-view-tabs button.active { background: var(--orange); color: #fff; border-color: var(--orange); }
/* --- Grille eleves x exercices --- */
.prog-grid .pg-name-col { min-width: 130px; text-align: left; position: sticky; left: 0; background: var(--bg); z-index: 1; white-space: nowrap; }
.prog-grid .pg-module-header { background: var(--surface, var(--bg)); font-size: .72rem; text-align: center; }
.prog-grid .pg-item-header { width: 28px; min-width: 28px; max-width: 36px; font-size: .72rem; text-align: center; font-weight: normal; color: var(--muted); }
.prog-grid .pg-cell { width: 28px; min-width: 28px; text-align: center; font-size: .9rem; padding: 3px 2px; }
.prog-grid .pg-cell[data-eleve-id] { cursor: pointer; }
.prog-grid .pg-cell[data-eleve-id]:hover, .prog-grid .pg-cell[data-eleve-id]:focus { opacity: .7; outline: 2px solid var(--orange); }
.prog-grid .pg-acquis { background: rgba(34, 139, 60, .18); }
.prog-grid .pg-vu { background: rgba(200, 110, 0, .15); }
.prog-grid .pg-non-aborde { color: var(--muted); }
.pg-dot { opacity: .35; }
/* --- Formulaire de seance --- */
.prog-seance-module { margin-bottom: 1.1rem; }
.prog-seance-module h4 { font-size: .85rem; font-weight: 600; color: var(--muted); margin: 0 0 .4rem; text-transform: uppercase; letter-spacing: .04em; }
.prog-seance-items { display: flex; flex-direction: column; gap: .35rem; }
.seance-item-row { display: flex; align-items: center; gap: .6rem; padding: .25rem .4rem; border-radius: 6px; }
.seance-item-row:hover { background: rgba(0,0,0,.04); }
.seance-item-row span { flex: 1; font-size: .9rem; }
.seance-item-row select { width: auto; min-width: 80px; font-size: .85rem; }
.seance-note-sel { min-width: 50px !important; }
.seance-section { margin-bottom: .75rem; }
.seance-section label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.prog-note { font-size: .85rem; color: var(--orange); letter-spacing: -.05em; }
/* Modal de validation de progression */
.prog-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.prog-modal { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 1.2rem 1.4rem; min-width: 300px; max-width: 440px; width: 90%; display: flex; flex-direction: column; gap: .75rem; }
.prog-modal h4 { margin: 0; font-size: 1rem; }
.prog-modal label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.prog-modal select, .prog-modal textarea { width: 100%; font-size: .9rem; }
.prog-modal textarea { resize: vertical; }
.prog-modal-actions { display: flex; gap: .5rem; justify-content: flex-end; }
.mnt-na { opacity: 0.5; }
.mnt-na .amount { text-decoration: line-through; }
.badge.danger { background: #d62828; color: #fff; }
.mpe-bloquant { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.prog-edit-module { margin-bottom: 10px; }
.pe-items { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.pe-item { display: flex; flex-direction: column; gap: 2px; }
.pe-item-header { display: flex; gap: 6px; align-items: center; }
.pe-item-header input.mpe-item-lib { flex: 1 1 auto; }
/* Sous-opérations dans l'éditeur */
.pe-sous-items { display: flex; flex-direction: column; gap: 2px; padding-left: 1.5rem; margin-top: 2px; }
.pe-sous-item { display: flex; gap: 6px; align-items: center; }
.pe-sous-item-bullet { color: var(--muted); font-size: 13px; }
.pe-sous-item input.mpe-sous-item-lib { flex: 1 1 auto; font-size: 12px; }

/* Affichage des sous-opérations dans le suivi */
.mnt-sous-items { margin: 6px 0 0 0; border-left: 2px solid var(--border); padding-left: .75rem; }
.mnt-sous-header { display: flex; align-items: center; gap: .5rem; cursor: pointer; user-select: none; font-size: 12px; color: var(--muted); padding: 2px 0; }
.mnt-sous-header:hover { color: var(--accent); }
.mnt-sous-toggle { font-size: 10px; }
.mnt-sous-progress { font-weight: 600; color: var(--text); }
.mnt-sous-list { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.mnt-sous-list.collapsed { display: none; }
.mnt-sous-item { display: flex; align-items: center; gap: .4rem; font-size: 12px; padding: 1px 0; }
.mnt-sous-item.done { color: var(--muted); }
.mnt-sous-check { font-size: 13px; min-width: 14px; }
.mnt-sous-item.done .mnt-sous-check { color: var(--accent); }

/* Sous-items dans le modal */
.mnt-sous-items-modal { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: .5rem .75rem; }
.mnt-sous-item-check { display: flex; align-items: flex-start; gap: .5rem; cursor: pointer; font-size: 13px; padding: 2px 0; }
.mnt-sous-item-check input { margin-top: 2px; flex-shrink: 0; }

/* Membres & cotisations. */
.membres-table { width: 100%; }
.membres-table th { white-space: nowrap; }
.membres-table td { vertical-align: middle; }
.membres-table .tbl-input { padding: 4px 6px; font-size: 12px; margin: 0; }
.membres-table .tbl-actions { white-space: nowrap; }
.membres-table .btn-sm { padding: 4px 8px; font-size: 11px; margin: 1px 0; }

/* Masquage selon le role.
   - [data-admin-only] : visible uniquement pour l'administrateur.
   - [data-manage-fleet] : visible pour les roles qui gerent la flotte (admin, bureau). */
body:not(.role-admin) [data-admin-only] { display: none !important; }
/* [data-admin-area] : onglet Admin, visible pour l'admin ET l'instructeur (lache machine). */
body:not(.can-admin-area) [data-admin-area] { display: none !important; }
/* [data-lache-machine] : sous-onglet lache machine, visible pour admin et instructeur. */
body:not(.can-lache-machine) [data-lache-machine] { display: none !important; }
body:not(.can-manage-fleet) [data-manage-fleet] { display: none !important; }
/* [data-grant-lacher] : visible pour les roles qui accordent un lacher (admin, bureau, instructeur). */
body:not(.can-grant-lacher) [data-grant-lacher] { display: none !important; }
/* [data-maintain] : visible pour les roles qui gerent la maintenance (admin, bureau, mecanicien). */
body:not(.can-maintain) [data-maintain] { display: none !important; }
/* [data-see-maintenance] : onglet Maintenance, visible pour mecanicien et admin uniquement. */
body:not(.can-see-maintenance) [data-see-maintenance] { display: none !important; }
/* [data-see-dispo] : onglet Disponibilites, visible pour instructeur et admin uniquement. */
body:not(.can-see-dispo) [data-see-dispo] { display: none !important; }
/* [data-saisir-vol] : onglet Saisie de vols, masqué pour les membres sans activité de vol. */
body:not(.can-saisir-vol) [data-saisir-vol] { display: none !important; }
/* [data-manage-membres] : gestion des membres/cotisations (admin, bureau, compta). */
body:not(.can-manage-membres) [data-manage-membres] { display: none !important; }
/* Modules additionnels : [data-mod-*] masque si le module n'est pas active. */
body:not(.mod-cotisations) [data-mod-cotisations] { display: none !important; }
body:not(.mod-entretien) [data-mod-entretien] { display: none !important; }
body:not(.mod-progression) [data-mod-progression] { display: none !important; }
body:not(.mod-documents) [data-mod-documents] { display: none !important; }
body:not(.mod-evenements) [data-mod-evenements] { display: none !important; }
body:not(.mod-ag) [data-mod-ag] { display: none !important; }
body:not(.mod-demandes-vol) [data-mod-demandes-vol] { display: none !important; }
body:not(.mod-bons-travaux) [data-mod-bons-travaux] { display: none !important; }
body:not(.mod-mi) [data-mod-mi] { display: none !important; }
body:not(.mod-stock) [data-mod-stock] { display: none !important; }
body:not(.mod-outillage) [data-mod-outillage] { display: none !important; }
body:not(.mod-navigabilite) [data-mod-navigabilite] { display: none !important; }
body:not(.can-manage-mi) [data-manage-mi] { display: none !important; }

/* AG */
.ag-card { border:1px solid var(--color-border);border-radius:6px;padding:14px 16px;margin-bottom:10px; }
.ag-card h4 { margin:0 0 4px; }
.ag-statut { display:inline-block;font-size:11px;font-weight:600;padding:2px 8px;border-radius:12px;margin-left:8px;vertical-align:middle; }
.ag-statut.planifiee { background:#e8f4fd;color:#1a6fa0; }
.ag-statut.ouverte   { background:#e6f9ee;color:#1a7a3c; }
.ag-statut.cloturee  { background:#f0f0f0;color:#666; }
.ag-resolution { border:1px solid var(--color-border);border-radius:6px;padding:12px 14px;margin-bottom:8px; }
.ag-resolution h5 { margin:0 0 4px; }
.vote-bar { display:flex;gap:8px;margin:8px 0;flex-wrap:wrap;align-items:center; }
.vote-btn { padding:5px 14px;border-radius:16px;border:2px solid transparent;cursor:pointer;font-size:13px;background:var(--color-bg);transition:all .15s; }
.vote-btn.pour      { border-color:#2a9d5c;color:#2a9d5c; }
.vote-btn.contre    { border-color:#d94f4f;color:#d94f4f; }
.vote-btn.abstention{ border-color:#aaa;color:#888; }
.vote-btn.selected.pour      { background:#2a9d5c;color:#fff; }
.vote-btn.selected.contre    { background:#d94f4f;color:#fff; }
.vote-btn.selected.abstention{ background:#aaa;color:#fff; }
.vote-resultats { font-size:13px;color:var(--color-muted);margin-top:4px; }
/* [data-see-progression] : onglet Progression (eleve + encadrants). */
body:not(.can-see-progression) [data-see-progression] { display: none !important; }
/* [data-manage-progression] : selection d'eleve + validation (instructeur, bureau, admin). */
body:not(.can-manage-progression) [data-manage-progression] { display: none !important; }
/* [data-edit-programme] : modification du programme de formation (chef_pilote, admin). */
body:not(.can-edit-programme) [data-edit-programme] { display: none !important; }
/* Sous-nav interne Config. entretien */
.entretien-config-nav { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.2rem; border-bottom: 1px solid var(--line); padding-bottom: .75rem; }
.entretien-config-nav button { background: none; border: 1px solid var(--line); border-radius: 6px; padding: .35rem .9rem; font-size: .9rem; cursor: pointer; color: var(--text); }
.entretien-config-nav button.active { background: var(--orange); color: #fff; border-color: var(--orange); }

/* Onglet Lachers : en-tete de groupe (par avion). */
.qual-group { margin: 16px 0 6px; font-size: 15px; }
.qual-group:first-child { margin-top: 0; }

/* Bascule Liste / Tableau */
.view-toggle { display: flex; gap: 0; margin-bottom: 12px; }
.view-toggle .seg {
  background: #fff; color: var(--muted); border: 1px solid var(--line);
  padding: 6px 14px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.view-toggle .seg:first-child { border-radius: 6px 0 0 6px; }
.view-toggle .seg:last-child { border-radius: 0 6px 6px 0; border-left: none; }
.view-toggle .seg.active { background: var(--orange); color: #fff; border-color: var(--orange); }

/* Tableau de donnees triable */
table.data-table { width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 13px; }
table.data-table th {
  text-align: left; padding: 10px 12px; background: var(--bg); color: var(--muted);
  font-size: 12px; text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data-table th.sortable { cursor: pointer; user-select: none; }
table.data-table th.sortable:hover { color: var(--ink); }
table.data-table th.sortable::after { content: " \2195"; opacity: .35; }
table.data-table th.sortable.asc::after { content: " \2191"; opacity: 1; color: var(--orange); }
table.data-table th.sortable.desc::after { content: " \2193"; opacity: 1; color: var(--orange); }
table.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: var(--accent-soft); }
table.data-table .amount { font-weight: 600; }

/* Vue Tableau (listView) — fenêtre scrollable 480px, en-tête fixe */
.lv-content:has(table.data-table) { max-height: 480px; overflow-y: auto; border: 1px solid var(--line); border-radius: .5rem; }
.lv-content table.data-table thead th { position: sticky; top: 0; background: var(--bg); z-index: 1; }

/* Planning des reservations */
.planning-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.planning-nav input[type="date"] { padding: 6px 8px; }
.planning-day { font-weight: 600; text-transform: capitalize; }
.planning-mine { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); margin-left: auto; }
.planning-mine input { width: auto; }
.planning-modes { margin-bottom: 8px; }
.planning-modes .view-toggle { margin: 0; }
#planning-mode-hint { margin: 0; }
.planning-empty-fleet { font-size: 13px; color: var(--muted); padding: 12px 0; }

/* Calendrier ressources : lignes = avions/instructeurs, colonnes = heures (Jour)
   ou jours (Semaine/Mois). Defilement horizontal, colonne libelle collee a gauche. */
.rc { border: 1px solid var(--line); border-radius: 10px; overflow: auto; background: var(--surface); max-height: 72vh; }
.rc-head { display: flex; position: sticky; top: 0; z-index: 4; background: var(--bg); width: max-content; }
.rc-bodywrap { min-width: max-content; }
.rc-corner {
  flex: 0 0 auto; box-sizing: border-box; position: sticky; left: 0; z-index: 2;
  background: var(--bg); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.rc-headtrack { display: flex; flex: 0 0 auto; }
.rc-hh {
  box-sizing: border-box; flex: 0 0 auto; font-size: 11px; font-weight: 600; color: var(--muted);
  padding: 8px 6px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
  text-align: center;
}
.rc-dh {
  box-sizing: border-box; flex: 0 0 auto; font-size: 11px; color: var(--muted);
  padding: 6px 4px; border-left: 1px solid var(--line); border-bottom: 2px solid var(--line);
  text-align: center; text-transform: capitalize; line-height: 1.3;
}
.rc-dh span { display: block; font-size: 15px; font-weight: 700; color: var(--ink); }
.rc-dh.today { background: var(--accent-soft); color: var(--accent-ink); border-bottom-color: var(--orange); }
.rc-dh.today span { color: var(--orange); }

.rc-group {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--line);
}
.rc-group span { position: sticky; left: 0; display: inline-block; padding: 4px 10px; }
.rc-emptyrow { padding: 8px 12px; font-size: 13px; color: var(--muted); }
.rc-row { display: flex; border-bottom: 1px solid var(--line); }
.rc-row:hover > .rc-label { background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface)); }

.rc-label {
  flex: 0 0 auto; box-sizing: border-box; position: sticky; left: 0; z-index: 1;
  background: var(--surface); border-right: 1px solid var(--line); padding: 6px 10px;
  display: flex; flex-direction: column; justify-content: center; line-height: 1.15;
  transition: background .15s;
}
.rc-label .rc-name { font-size: 13px; font-weight: 600; }
.rc-label .rc-sub { font-size: 11px; color: var(--muted); }
.rc-label.indispo .rc-name { color: var(--muted); }

/* Vue Jour : piste horaire horizontale + blocs absolus. */
.rc-track {
  position: relative; flex: 0 0 auto; cursor: copy;
  background-image: repeating-linear-gradient(
    to right, transparent 0, transparent calc(var(--day-hour-w) - 1px),
    var(--line) calc(var(--day-hour-w) - 1px), var(--line) var(--day-hour-w)
  );
}
.rc-track.indispo { cursor: not-allowed; background-color: color-mix(in srgb, var(--muted) 8%, var(--surface)); }
.rc-block {
  position: absolute; box-sizing: border-box; cursor: pointer; white-space: nowrap;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--orange) 60%, transparent);
  border-left: 3px solid var(--orange);
  border-radius: 6px; font-size: 11px; color: var(--accent-ink);
  display: flex; align-items: center; overflow: visible;
  transition: box-shadow .15s, transform .1s;
}
.rc-block > span, .rc-block > .b-time { overflow: hidden; text-overflow: ellipsis; min-width: 0; padding: 1px 2px 1px 0; }
.rc-block { z-index: 2; }
.rc-block:hover { box-shadow: 0 2px 8px rgba(0,0,0,.18); transform: scaleY(1.02); z-index: 3; }
.rc-block .b-time { font-weight: 700; flex-shrink: 0; }
.rc-block.mine { background: color-mix(in srgb, var(--orange) 12%, var(--surface)); border-left-color: var(--orange); }
.rc-resize-l, .rc-resize-r {
  flex: 0 0 8px; width: 8px; align-self: stretch; cursor: ew-resize;
  background: rgba(0,0,0,.2); border-radius: 2px;
  user-select: none; touch-action: none;
}
.rc-resize-l { margin-right: 3px; }
.rc-resize-r { margin-left: 3px; }
.rc-del {
  flex: 0 0 auto; margin-left: auto; margin-right: 2px;
  background: none; border: none; padding: 0 2px; cursor: pointer;
  font-size: 13px; line-height: 1; color: var(--accent-ink); opacity: 0;
  transition: opacity .15s; border-radius: 3px;
}
.rc-block:hover .rc-del { opacity: .6; }
.rc-del:hover { opacity: 1 !important; background: rgba(0,0,0,.12); }
.rc-places-badge {
  display: inline-block; margin-left: 3px; padding: 0 4px; border-radius: 8px;
  background: var(--orange); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; flex-shrink: 0;
}
.dl-grid { display: grid; grid-template-columns: auto 1fr; gap: .15rem .75rem; }
.dl-grid dt { font-weight: 600; color: var(--muted); }
.dl-grid dd { margin: 0; }
/* Bande d'indisponibilite (maintenance) sur la piste Jour : grise hachuree, sous les blocs. */
.rc-indispo {
  position: absolute; top: 2px; bottom: 2px; box-sizing: border-box; z-index: 1;
  background: repeating-linear-gradient(45deg, #e6e8eb, #e6e8eb 6px, #f3f4f6 6px, #f3f4f6 12px);
  border: 1px solid #c7ccd3; border-radius: 4px; cursor: pointer; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #5b6470; padding: 0 4px;
}
.rc-indispo:hover { box-shadow: 0 1px 4px rgba(0,0,0,.15); }

/* Bande de disponibilite (instructeur) sur la piste Jour : verte, en fond.
   Les blocs de reservation par-dessus traduisent les creneaux « occupes ». */
.rc-dispo {
  position: absolute; top: 2px; bottom: 2px; box-sizing: border-box; z-index: 0;
  background: #e6f5ea; border: 1px dashed #57a773; border-radius: 4px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #2f6b46; padding: 0 4px; pointer-events: none;
}

/* Vues Semaine / Mois : cellules-jour avec puces. */
.rc-cells { display: flex; flex: 0 0 auto; }
.rc-cell {
  box-sizing: border-box; flex: 0 0 auto; min-height: 64px; padding: 3px;
  border-left: 1px solid var(--line); cursor: copy; display: flex; flex-direction: column; gap: 2px;
}
.rc-cell.indispo { cursor: not-allowed; background: #fafafa; }
.rc-cell.today { background: #fffaf3; }
.rc-chip {
  background: var(--accent-soft); border-left: 3px solid var(--orange); border-radius: 3px;
  padding: 1px 4px; font-size: 11px; color: var(--accent-ink); cursor: pointer;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.rc-chip:hover { filter: brightness(.97); }
.rc-chip .c-time { font-weight: 700; }
.rc-chip.mine { background: #fff4e5; }
/* Puce d'indisponibilite (maintenance) dans les vues Semaine / Mois. */
.rc-ichip {
  background: repeating-linear-gradient(45deg, #e6e8eb, #e6e8eb 5px, #f3f4f6 5px, #f3f4f6 10px);
  border: 1px solid #c7ccd3; color: #4b5563; border-radius: 3px;
  font-size: 11px; padding: 1px 5px; cursor: pointer;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.rc-ichip:hover { filter: brightness(.97); }
.rc-cell.has-indispo { background: #f8f9fa; }
/* Puce de disponibilite (instructeur) dans les vues Semaine / Mois. */
.rc-dchip {
  background: #e6f5ea; border: 1px solid #57a773; color: #2f6b46; border-radius: 3px;
  font-size: 11px; padding: 1px 5px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.rc-cell.has-dispo { background: #f4fbf6; }

/* Événements dans le planning */
.rc-track-evt { background: transparent; }
.rc-evt-band {
  position: absolute; top: 4px; height: calc(100% - 8px);
  background: var(--orange); opacity: .82; border-radius: 4px;
  color: #fff; font-size: 11px; font-weight: 600;
  padding: 0 6px; display: flex; align-items: center;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  cursor: default; pointer-events: auto;
}
.rc-evt-band:hover { opacity: 1; }
.rc-echip {
  background: var(--orange); color: #fff; border-radius: 3px;
  font-size: 11px; font-weight: 600; padding: 1px 5px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  cursor: default;
}

/* Restrictions par role pour le module Disponibilites. */
body:not(.can-manage-dispo) [data-manage-dispo] { display: none !important; }
body:not(.can-pick-instructeur) [data-dispo-pick-instructeur] { display: none !important; }

/* Releve facturable + export CSV : reserves a compta / bureau / admin. */
body:not(.can-view-finance) [data-view-finance] { display: none !important; }

/* Case a cocher inline (ex: avion equipe d'un compteur horaire). */
.check-label {
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-weight: normal;
}
.check-label input[type="checkbox"] { width: auto; margin: 0; }

/* Solde negatif (compte pilote a decouvert). */
.amount.neg { color: #d62828; }

/* Tableau de bord — bannière hero. */
.dash-hero {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 16px; padding: 22px 24px; border-radius: 18px; margin-bottom: 20px;
  background: var(--orange);
  background-image: radial-gradient(ellipse 80% 60% at right center, rgba(255,255,255,.12) 0%, transparent 70%);
  color: #fff; box-shadow: 0 4px 20px rgba(0,0,0,.12);
}
.dash-hero-greeting { font-size: 13px; opacity: .75; margin-bottom: 2px; }
.dash-hero-kpi {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: clamp(2.2rem, 4vw + .8rem, 3.8rem);
  font-weight: 800; letter-spacing: -.04em; line-height: 1;
}
.dash-hero-sub { font-size: 12px; opacity: .65; margin-top: 4px; }
.dash-hero-right { display: flex; gap: 20px; flex-wrap: wrap; }
.dash-hero-stat { text-align: right; }
.dash-hero-label { font-size: 11px; opacity: .6; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.dash-hero-val { font-size: 14px; font-weight: 700; }

/* Tableau de bord — grille et cards. */
.dash-grid { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 18px; }
.dash-card {
  flex: 1 1 160px; min-width: 150px;
  border: none; border-radius: 14px; padding: 14px 16px; background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.dash-card .dash-kpi { font-size: 26px; font-weight: 700; line-height: 1.1; }
.dash-card .dash-label { color: #6b7280; font-size: 13px; margin-top: 4px; }
.dash-card .dash-sub { color: #6b7280; font-size: 12px; margin-top: 6px; }

/* Bottom navigation mobile */
.bottom-nav { display: none; }
.dash-section { margin-bottom: 18px; }
.dash-section h3 { margin: 0 0 8px; }
.dash-cols { display: flex; flex-wrap: wrap; gap: 18px; }
.dash-cols > div { flex: 1 1 320px; min-width: 280px; }

/* Widgets d'information personnels */
.dashboard-widgets-wrap { margin-bottom: 1.25rem; }
.widget-grid { display: flex; flex-wrap: wrap; gap: .75rem; }
.widget-card {
  position: relative; display: flex; flex-direction: column; align-items: center;
  gap: .25rem; padding: 1rem .9rem .75rem;
  min-width: 110px; max-width: 150px; flex: 1 1 110px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); overflow: hidden;
  cursor: default;
}
.widget-band {
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
}
.widget-remove {
  position: absolute; top: .3rem; left: .35rem;
  background: none; border: none; color: var(--muted); font-size: .8rem;
  cursor: pointer; line-height: 1; padding: 2px; opacity: .5;
}
.widget-remove:hover { color: var(--err, #dc2626); opacity: 1; }
.widget-icon { font-size: 1.65rem; line-height: 1; margin-top: .2rem; width: 2.2rem; height: 2.2rem; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.widget-ring-svg { width: 52px; height: 52px; margin: .1rem 0; }
.widget-val { font-size: 1.1rem; font-weight: 700; text-align: center; line-height: 1.2; color: var(--text); }
.widget-sub { font-size: .72rem; color: var(--muted); text-align: center; line-height: 1.3; min-height: 1em; }
.widget-label { font-size: .68rem; color: var(--muted); text-align: center; margin-top: .15rem; text-transform: uppercase; letter-spacing: .03em; }
.widget-meteo-spinner { font-size: 1.1rem; color: var(--muted); animation: spin 1.2s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Raccourcis personnalisés du tableau de bord */
.dashboard-shortcuts { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem; }
.shortcut-tile {
  position: relative; display: flex; flex-direction: column; align-items: center;
  gap: .25rem; padding: 1rem .9rem .75rem;
  min-width: 110px; max-width: 150px; flex: 1 1 110px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.shortcut-tile:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); border-color: var(--orange); }
.tile-icon { font-size: 1.65rem; line-height: 1; margin-top: .2rem; width: 2.2rem; height: 2.2rem; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tile-label { font-size: .68rem; color: var(--muted); text-align: center; margin-top: .15rem; text-transform: uppercase; letter-spacing: .03em; word-break: break-word; }
.tile-badge {
  position: absolute; top: .25rem; right: .3rem;
  background: var(--orange); color: #fff; border-radius: 999px;
  font-size: .65rem; font-weight: 700; padding: 1px 5px; min-width: 16px; text-align: center;
}
.tile-remove {
  position: absolute; top: .15rem; left: .3rem;
  background: none; border: none; color: var(--muted); font-size: .8rem;
  cursor: pointer; line-height: 1; padding: 2px; opacity: .6;
}
.tile-remove:hover { color: var(--err, #dc2626); opacity: 1; }
/* En-tête de la section raccourcis */
.dashboard-shortcuts-wrap { margin-bottom: 1.25rem; }
.dashboard-shortcuts-header { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.dashboard-shortcuts-title { font-size: .82rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.shortcut-add-btn-inline {
  padding: .2rem .65rem; border: 1px solid var(--line); border-radius: 6px;
  background: none; color: var(--muted); cursor: pointer; font-size: .8rem;
  transition: border-color .12s, color .12s;
}
.shortcut-add-btn-inline:hover { border-color: var(--orange); color: var(--orange); }
/* Modal catalogue de raccourcis */
.raccourci-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.raccourci-modal {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 1.2rem 1.4rem; min-width: 300px; max-width: 480px; width: 92%;
  display: flex; flex-direction: column; gap: .75rem; max-height: 80vh;
}
.raccourci-modal h4 { margin: 0; font-size: 1rem; }
.raccourci-catalogue { display: flex; flex-wrap: wrap; gap: .5rem; overflow-y: auto; flex: 1; }
.raccourci-catalogue-item {
  display: flex; align-items: center; gap: .5rem; padding: .5rem .8rem;
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: .88rem;
  background: var(--bg); transition: border-color .12s, background .12s;
}
.raccourci-catalogue-item:hover { border-color: var(--orange); background: var(--accent-soft, rgba(0,0,0,.04)); }
.raccourci-catalogue-item .cat-icon { font-size: 1.15rem; }
.raccourci-modal-close { align-self: flex-end; background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--muted); line-height: 1; padding: 0; }

/* Liste de cases a cocher des roles (blocage reservation sur solde). */
.role-check-list { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 6px 0 12px; }
.role-check-list label {
  display: flex; flex-direction: row; align-items: center; gap: 6px;
  font-weight: normal; white-space: nowrap;
}
.role-check-list input[type="checkbox"] { width: auto; margin: 0; }

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  table.data-table { font-size: 12px; }
  table.data-table th, table.data-table td { padding: 8px 6px; }
  .planning-mine { margin-left: 0; }

  header { padding: 10px 16px; }
  header h1 { font-size: 16px; }
  .ghost.mini { font-size: 12px; padding: 6px 10px; }
  /* Panel notifications : fixed sur mobile */
  .notif-panel { position: fixed; top: auto; right: 8px; left: auto; width: calc(100vw - 16px); max-width: 360px; }
  main { padding: 12px; padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
  .analyse-kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-hero { padding: 18px 16px; border-radius: 14px; overflow: hidden; }
  .dash-hero-left, .dash-hero-right { min-width: 0; }
  .dash-hero-right { gap: 12px; }
  .dash-hero-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dash-customize-btn { position: static !important; align-self: flex-end; margin-top: 4px; }

  /* Planning : scrollable horizontalement sans déborder sur le document */
  #planning { overflow-x: auto; }
  .dash-cols > div { min-width: 0; }

  /* Tables → cartes sur mobile */
  .lv-content:has(table.data-table) { max-height: unset; border: none; border-radius: 0; }
  table.data-table { border: none; border-radius: 0; background: transparent; overflow: visible; }
  table.data-table thead { display: none; }
  table.data-table, table.data-table tbody { display: block; }
  table.data-table tr {
    display: block; background: var(--surface); border: 1px solid var(--line);
    border-radius: 12px; margin-bottom: 8px; padding: 10px 12px; box-shadow: var(--shadow-sm);
  }
  table.data-table td {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 3px 0; border: none; font-size: 13px;
  }
  table.data-table td:first-child {
    font-weight: 600; font-size: 14px;
    padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 2px;
  }
  table.data-table td:empty { display: none; }
  table.data-table tbody tr:last-child td { border-bottom: none; }
  table.data-table tbody tr:hover { background: var(--surface); }
}

/* ===== Bottom nav (mobile) ===== */
.bottom-nav { display: none; }
@media (max-width: 767px) {
  .drawer-toggle { display: inline-flex; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
    background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -2px 12px rgba(0,0,0,.08);
  }
  .bottom-nav button {
    background: none; border: none; border-radius: 0; min-height: unset;
    padding: 8px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 10px; color: var(--muted); font-weight: 500; cursor: pointer; line-height: 1.2;
  }
  .bottom-nav button:hover { color: var(--ink); }
  .bottom-nav button.active { color: var(--orange); }
  .bottom-nav .bnav-icon { font-size: 20px; }
}

/* ===== Drawer mobile ===== */
.drawer-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 46; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 47; width: min(280px, 80vw);
  background: var(--surface); box-shadow: 4px 0 20px rgba(0,0,0,.2);
  padding: 16px 12px 16px 12px;
  display: flex; flex-direction: column; gap: 4px;
  transform: translateX(-100%); transition: transform .2s ease;
}
.drawer:not(.hidden) { transform: translateX(0); }
.drawer.hidden { display: flex; visibility: hidden; pointer-events: none; }
.drawer .tab-btn { justify-content: flex-start; }

/* ===== Sidebar desktop (≥768px) ===== */
.sidebar-toggle { display: none; }
@media (min-width: 768px) {
  .drawer-toggle, .drawer, .mobile-drawer, .drawer-overlay, .bottom-nav { display: none !important; }
  .sidebar {
    display: flex; flex-direction: column; gap: 2px;
    width: var(--sidebar-width-collapsed); flex-shrink: 0;
    background: var(--surface); box-shadow: 1px 0 0 var(--line);
    padding: 10px 8px calc(10px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto; transition: width .18s ease;
  }
  .sidebar.is-open { width: var(--sidebar-width); padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .sidebar .tab-btn { justify-content: center; min-height: 44px; max-height: 60px; }
  .sidebar .tab-btn span { display: none; }
  .sidebar.is-open .tab-btn { justify-content: flex-start; }
  .sidebar.is-open .tab-btn span { display: inline; }
  .sidebar-toggle {
    display: inline-flex !important; align-items: center; justify-content: center;
    align-self: flex-end; flex: 0 0 auto; width: 32px; height: 32px; min-height: 0; padding: 0; margin-bottom: 6px;
    border-radius: 50%; background: var(--accent-soft); color: var(--ink); border: none; font-size: 18px; cursor: pointer;
  }
  .sidebar-toggle:hover { filter: brightness(.95); }
  .sidebar:not(.is-open) .sidebar-toggle { align-self: center; }
  main { overflow-y: auto; padding: 20px; padding-bottom: 20px; }
}

/* ===== Onglet Analyse ===== */
.analyse-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 4px;
}
.kpi-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 12px;
  text-align: center;
}
.kpi-val {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}
.kpi-lbl {
  font-size: .78rem;
  color: #94a3b8;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.metric-tab {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--line);
  background: none;
  font-size: .82rem;
  cursor: pointer;
  color: #64748b;
}
.metric-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
#analyse-chart .bar { transition: opacity .15s; }
.chart-type-btn {
  padding: 5px 9px;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  background: none;
  cursor: pointer;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
}
.chart-type-btn.active { background: #f1f5f9; border-color: #94a3b8; color: var(--ink); }
#analyse-metric-tabs { align-items: center; }
#analyse-chart .bar:hover { opacity: .75; }
.analyse-sort { cursor: pointer; user-select: none; }
.analyse-sort:hover { color: var(--accent); }

/* Boutons SSO OAuth (page de connexion) */
.sso-sep {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: .8rem 0 .6rem;
  color: var(--muted);
  font-size: .82rem;
}
.sso-sep::before, .sso-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.btn-sso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .55rem 1rem;
  margin-bottom: .45rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-sso:hover {
  background: var(--surface, #f8fafc);
  border-color: #94a3b8;
}

/* ── Passkey login button ───────────────────────────────────────────────────── */
.btn-passkey {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: .95rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-passkey:hover { background: var(--bg); border-color: #94a3b8; }
.btn-passkey:disabled { opacity: .5; cursor: default; }

/* ── Fiches MI ──────────────────────────────────────────────────────────────── */
.mi-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.mi-svg-wrap {
  flex: 0 0 auto;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  padding: .5rem;
  position: relative;
}
.mi-svg-wrap svg {
  display: block;
  width: 400px;
  max-width: 100%;
}
.mi-point-panel {
  flex: 1 1 260px;
  min-width: 200px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  background: var(--bg);
}
.mi-editor-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.mi-editor-header h3 { margin: 0; }
.mi-item-results {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 4px;
}
.mi-item-results button {
  display: block;
  width: 100%;
  text-align: left;
  padding: .35rem .6rem;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: .82rem;
  color: var(--text);
}
.mi-item-results button:last-child { border-bottom: none; }
.mi-item-results button:hover { background: var(--accent-soft); }
.mi-point-items-list { list-style: none; padding: 0; margin: 0; }
.mi-point-items-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .3rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .85rem;
}
.mi-point-items-list li:last-child { border-bottom: none; }
.mi-exec-check {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--line);
}
.mi-exec-check:last-child { border-bottom: none; }
.mi-exec-check input[type=checkbox] { margin-top: 3px; flex-shrink: 0; }
.mi-exec-check label { font-size: .88rem; cursor: pointer; flex: 1; }
.mi-exec-check label.done { text-decoration: line-through; color: var(--muted); }
.mi-card {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: .75rem;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.mi-card h4 { margin: 0 0 .25rem; }

/* Modal CGU — bloquant, plein ecran */
.terms-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.terms-modal {
  background: var(--bg);
  color: var(--text);
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
  max-width: 480px;
  width: 100%;
  padding: 2rem;
}
.terms-modal h2 {
  font-size: 1.2rem;
  color: var(--orange);
  margin-bottom: .75rem;
}
.terms-modal p {
  font-size: .92rem;
  margin-bottom: 1rem;
}
.terms-links {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: 1.25rem;
}
.terms-links a {
  font-size: .9rem;
  color: var(--orange);
  text-decoration: underline;
}
.terms-check {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .9rem;
  cursor: pointer;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.terms-btn {
  width: 100%;
  padding: .65rem 1rem;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
}
.terms-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}


/* Menu contextuel planning */
#planning-ctx-menu {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  padding: 4px 0;
  min-width: 210px;
}
#planning-ctx-menu button {
  display: block;
  width: 100%;
  padding: 9px 16px;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}
#planning-ctx-menu button:hover {
  background: var(--orange);
  color: #fff;
}

/* ===== Empty states ===== */
.empty-ph {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 56px 24px; color: var(--muted); text-align: center;
}
.empty-ph-icon { font-size: 36px; }
.empty-ph-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.empty-ph-sub { font-size: 13px; max-width: 260px; }
.list:empty { display: flex; justify-content: center; padding: 48px 24px; color: var(--muted); font-size: 13px; font-style: italic; }
.list:empty::before { content: "Aucun élément"; }

/* ===== Micro-interactions ===== */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tab-panel.active { animation: fadeSlideUp .2s ease both; }

@keyframes skeletonSweep {
  from { background-position: -200% 0; }
  to   { background-position:  200% 0; }
}
.skeleton {
  display: block;
  background: linear-gradient(90deg, var(--line) 0%, var(--bg) 50%, var(--line) 100%);
  background-size: 200% 100%;
  animation: skeletonSweep 1.6s ease infinite;
  border-radius: 6px;
}
.skeleton-row   { height: 44px; border-radius: 10px; margin-bottom: 8px; }
.skeleton-title { height: 18px; width: 55%; margin-bottom: 6px; }
.skeleton-text  { height: 12px; width: 80%; }

.card     { transition: box-shadow .2s, transform .15s; }
.dash-card { transition: box-shadow .2s, transform .15s; }
.card:hover      { box-shadow: 0 4px 24px rgba(15,30,60,.14); transform: translateY(-2px); }
.dash-card:hover { box-shadow: 0 4px 24px rgba(15,30,60,.14); transform: translateY(-2px); }

/* ===== Drawer mobile ===== */
.drawer-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 199; opacity: 0; transition: opacity .28s;
  pointer-events: none;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.mobile-drawer {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 200; max-height: 75vh; overflow-y: auto;
  box-shadow: 0 -4px 24px rgba(0,0,0,.14);
  transform: translateY(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.mobile-drawer.open { transform: translateY(0); pointer-events: auto; }
.drawer-handle { width: 36px; height: 4px; background: var(--line); border-radius: 2px; margin: 0 auto 16px; }
.drawer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.drawer-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 12px 6px; border-radius: 12px; background: var(--bg);
  font-size: 11px; color: var(--muted); font-weight: 500; line-height: 1.3;
  border: none; cursor: pointer; min-height: unset; text-align: center;
}
.drawer-btn.active { color: var(--orange); background: var(--accent-soft); font-weight: 600; }
.drawer-btn-icon { font-size: 22px; }
@media (max-width: 767px) {
  .drawer-overlay, .mobile-drawer { display: block; }
}

/* Profil — header avatar */
.profil-header {
  display: flex; align-items: center; gap: 20px;
  padding: 20px 24px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 16px;
}
.profil-avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--accent-soft); color: var(--orange);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; flex-shrink: 0; border: 2px solid var(--orange);
  font-family: inherit;
}
.profil-header-info { flex: 1; min-width: 0; }
.profil-header-name { font-size: 17px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profil-header-sub  { margin-top: 5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Dashboard — bouton personnaliser */
.dash-customize-btn {
  margin-left: auto; padding: 5px 10px; font-size: 12px; border-radius: 6px;
  background: rgba(0,0,0,.18); border: 1px solid rgba(255,255,255,.35); color: rgba(255,255,255,.85); cursor: pointer;
  display: flex; align-items: center; gap: 5px; transition: background .15s, border-color .15s;
}
.dash-customize-btn:hover { background: rgba(0,0,0,.28); border-color: rgba(255,255,255,.6); }
.dash-customize-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 16px; animation: fadeSlideUp .2s ease both;
}
.dash-customize-panel h4 { font-size: 13px; font-weight: 600; margin: 0 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dash-customize-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.dash-customize-grid label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 400; color: var(--ink); cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.dash-customize-grid label:hover { background: var(--accent-soft); }
.dash-customize-grid input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--orange); flex-shrink: 0; }

/* Radio boutons inline (PF/PM vol) */
.inline-radio { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 400; color: var(--ink); cursor: pointer; }
.inline-radio input[type=radio] { accent-color: var(--orange); width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; }

/* Accordeon parametres club */
.acc-toggle {
  all: unset; box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; cursor: pointer;
  padding: 10px 0 8px;
  font-size: 1rem; font-weight: 600; color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.acc-toggle::after { content: "▸"; transition: transform .2s; font-size: 11px; color: var(--muted); flex-shrink: 0; }
.acc-toggle[aria-expanded="true"]::after { transform: rotate(90deg); }
.acc-panel { overflow: hidden; max-height: 0; transition: max-height .28s ease; }
.acc-panel.acc-open { max-height: 4000px; }

/* Calendrier des activites recurrentes */
.evt-cal-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.evt-cal-nav strong { flex: 1; text-align: center; font-size: 1rem; }
.evt-cal-wrap { overflow-x: auto; }
.evt-cal { width: 100%; border-collapse: collapse; min-width: 480px; }
.evt-cal th { text-align: center; padding: 6px 2px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.evt-cal td { vertical-align: top; padding: 4px; border: 1px solid var(--line); width: 14.28%; min-height: 60px; }
.evt-cal td.other-month { background: var(--bg); }
.evt-cal td.other-month .evt-cal-dn { opacity: .35; }
.evt-cal td.today-cell { background: color-mix(in srgb, var(--orange) 7%, transparent); }
.evt-cal-dn { font-size: 12px; font-weight: 600; line-height: 1.6; color: var(--text); }
.evt-cal-pill { display: block; background: var(--orange); color: #fff; border-radius: 4px; padding: 2px 5px; font-size: 11px; cursor: pointer; margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: none; text-align: left; width: 100%; }
.evt-cal-pill:hover { opacity: .85; }
.evt-cal-pill.inscrit { background: #16a34a; }
/* Panel d'inscription */
.evt-inscr-panel { padding: 16px; border: 1px solid var(--line); border-radius: 8px; margin-top: 12px; background: var(--bg); }
.evt-inscr-panel h3 { margin: 0 0 4px; font-size: 1rem; }
.evt-inscr-panel .meta { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.evt-inscr-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.evt-inscr-row:last-child { border-bottom: none; }
.evt-inscr-total { font-weight: 600; padding-top: 8px; font-size: 14px; }
.evt-inscr-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.evt-inscr-form label { font-size: 13px; display: flex; align-items: center; gap: 6px; }
.evt-inscr-form input[type=number] { width: 70px; }
/* Liste gestion activites recurrentes (admin) */
.evt-rec-manage { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
.evt-rec-manage h3 { font-size: .95rem; color: var(--muted); margin: 0 0 10px; }
/* Onglets evenements/activites */
.evt-tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 2px solid var(--line); }
.evt-tab-btn { background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; padding: 8px 16px; font-size: .95rem; font-weight: 500; cursor: pointer; color: var(--muted); transition: color .15s, border-color .15s; }
.evt-tab-btn.active { color: var(--orange); border-bottom-color: var(--orange); }

/* ===== Formulaire de saisie de vol — design inspiré logavia ===== */
.vf-form {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  gap: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  max-width: 760px;
}

/* En-tête héro */
.vf-head {
  background: linear-gradient(135deg, var(--orange) 0%, color-mix(in srgb, var(--orange) 55%, #000) 100%);
  padding: 18px 22px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.vf-head-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff !important;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
}
.vf-head-avion { flex: 1; min-width: 0; }
.vf-head-avion-input {
  background: rgba(255,255,255,.18) !important;
  border: 1px solid rgba(255,255,255,.3) !important;
  border-radius: 8px;
  color: #fff !important;
  font-size: 15px;
  font-weight: 600;
  padding: 5px 10px;
  width: 100%;
  text-align: right;
}
.vf-head-avion-input::placeholder { color: rgba(255,255,255,.45); font-weight: 400; }
.vf-head-avion-input:disabled { opacity: 1; }

/* Sections */
.vf-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: none;
  padding: 16px 22px;
}
.vf-section:last-child { border-radius: 0 0 14px 14px; }

.vf-stitle {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--orange);
  margin: 0 0 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

/* Zone indicateur jour/nuit */
.vf-pf-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  margin-top: 6px;
}

/* Compteur atterrissages */
.vf-counter-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}
.vf-counter-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  min-width: 110px;
}
.vf-counter {
  display: flex;
  align-items: center;
  gap: 6px;
}
.vf-cnt-btn {
  width: 30px;
  height: 30px;
  min-height: unset;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--orange);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.vf-cnt-btn:hover { background: var(--accent-soft); border-color: var(--orange); }
.vf-cnt-input {
  width: 54px !important;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  padding: 5px 6px;
}
.vf-carbu-grid { margin-top: 14px; }

/* Section actions */
.vf-section-actions { background: var(--bg); }
.vf-section-actions .actions { margin: 0; }
.cb-label { display: flex; align-items: center; gap: 7px; font-size: 14px; cursor: pointer; margin-top: 6px; }

/* ===== Flotte : tableau general ===== */
.ft-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }
.ft-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ft-card h4 { margin: 6px 0 0; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--orange); }
.ft-immat { font-size: 18px; font-weight: 700; }
.ft-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ft-kpi { background: var(--bg); border-radius: 10px; padding: 10px 8px; text-align: center; min-width: 0; }
.ft-kpi-val { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ft-kpi-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ft-table-wrap { overflow-x: auto; }
.ft-organes td, .ft-organes th { white-space: nowrap; }
.ft-actions { text-align: right; }
.ft-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.ft-organe-form { border-top: 1px solid var(--line); padding-top: 10px; }
@media (max-width: 520px) { .ft-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===== Defauts et anomalies ===== */
.def-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.def-card { display: flex; flex-direction: column; gap: 6px; }
.def-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.def-desc { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.def-action-form { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.def-connus { display: flex; flex-direction: column; gap: 4px; font-size: 13px; margin-bottom: 12px; }
#def-form[hidden], .def-action-form[hidden], #vol-anomalie-section[hidden], .ft-organe-form[hidden] { display: none; }

/* ===== KARDEX + intervalles du programme d'entretien ===== */
.kdx-resume { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.mpe-intervalles { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.mpe-intervalles label { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.mpe-intervalles input { width: 84px; padding: 4px 6px; font-size: 13px; }

/* ===== Bons de travaux : cartes, check-lists, ordre ===== */
#carte-form[hidden], #bt-composition[hidden] { display: none; }
.bt-composition { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.bt-composition summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.bt-choix { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; padding: 8px 0; }
.bt-choix label, .bt-check { display: flex; flex-direction: row; align-items: flex-start; gap: 8px; font-size: 13px; font-weight: 400; }
.bt-check input, .bt-choix input[type="checkbox"] { margin-top: 2px; flex: none; }
.bt-choix-groupe { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.bt-ajouts { display: grid; gap: 10px; margin-bottom: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.bt-ajout-ligne { display: flex; gap: 6px; align-items: center; }
.bt-ajout-ligne select { flex: 1; min-width: 0; }
.bt-ligne { align-items: flex-start; gap: 8px; }
.bt-ligne-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.bt-checklist { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; padding-left: 4px; }
.bt-num { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ===== Pieces, outillage, APRS ===== */
#piece-form[hidden], #stock-form[hidden], #outil-form[hidden], #bt-aprs-form[hidden], #carte-outils-wrap[hidden] { display: none; }
.piece-article { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.piece-article > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.bt-outils { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.bt-pieces { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.bt-piece { font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bt-piece-form { display: flex; gap: 6px; align-items: center; }
.bt-piece-form select { flex: 1; min-width: 0; }
.bt-piece-qte { width: 64px; }
.bt-verrouille .bt-ligne-actions, .bt-verrouille .bt-piece-form, .bt-verrouille .bt-piece-del { display: none; }
.bt-verrouille .bt-check input { pointer-events: none; }
.bt-aprs h4 { margin: 0 0 6px; }

/* ===== CN / BS, examen de navigabilite ===== */
#cn-form[hidden] { display: none; }
.exa-controle { padding: 8px 0; border-top: 1px solid var(--line); }
.exa-controle:first-of-type { border-top: none; }

/* ===== Maintenance : navigation par groupes + apercu (design logavia) ===== */
.mnt-nav { flex-direction: column; flex-wrap: nowrap; gap: 10px; border-bottom: none; margin-bottom: 16px; }
.mnt-groups { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.subnav .mnt-group {
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 9px 18px; margin: 0;
  font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; flex: none;
}
.subnav .mnt-group:hover { color: var(--ink); }
.subnav .mnt-group.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.mnt-subs { display: none; flex-wrap: wrap; gap: 6px; }
.mnt-subs.active { display: flex; }
.mnt-subs[data-single="1"] { display: none !important; }
.subnav .mnt-subs button {
  border: none; border-radius: 10px; padding: 7px 13px; margin: 0; font-size: 13px; font-weight: 500;
  background: transparent; color: var(--muted);
}
.subnav .mnt-subs button:hover { background: var(--accent-soft); color: var(--ink); }
.subnav .mnt-subs button.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }

.mnt-apercu-bar { margin-bottom: 12px; }
.mnt-apercu-bar select { min-width: 180px; }
.mnt-hero {
  background: linear-gradient(135deg, var(--orange) 0%, color-mix(in srgb, var(--orange) 55%, #000) 100%);
  color: #fff; border-radius: 18px; padding: 20px 22px; display: flex; flex-direction: column; gap: 16px;
}
.mnt-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.mnt-hero-immat { font-size: 28px; font-weight: 800; letter-spacing: .02em; line-height: 1.1; }
.mnt-hero-sub { opacity: .8; font-size: 13px; margin-top: 4px; }
.mnt-hero-vide { margin: 0; opacity: .85; }
.mnt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.mnt-kpi { background: rgba(255,255,255,.13); border-radius: 12px; padding: 10px 6px; text-align: center; min-width: 0; }
.mnt-kpi-val { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mnt-kpi-label { overflow-wrap: anywhere; font-size: 10.5px; opacity: .75; text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.mnt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mnt-chip { background: rgba(255,255,255,.15); border-radius: 999px; padding: 5px 13px; font-size: 12px; font-weight: 600; display: inline-flex; gap: 7px; align-items: center; }
.mnt-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
.mnt-chip.warn::before { background: #fbbf24; }
.mnt-chip.bad::before { background: #f87171; }
.mnt-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.mnt-quick button { border-radius: 999px; padding: 8px 16px; font-size: 13px; margin: 0; }
.mnt-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.mnt-block h3 { margin: 0 0 6px; }
.mnt-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 4px; border-top: 1px solid var(--line); cursor: pointer; border-radius: 8px; }
.mnt-row:first-of-type { border-top: none; }
.mnt-row:hover { background: var(--accent-soft); }
.mnt-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; }
.mnt-row-txt { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.mnt-more { padding: 8px 4px; font-size: 13px; color: var(--orange); font-weight: 600; cursor: pointer; }
.mnt-ok { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
@media (max-width: 520px) { .mnt-hero-immat { font-size: 24px; } }

.bt-checklist { margin-top: 8px; }
.bt-checklist summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--orange); padding: 4px 0; }
.bt-checklist .bt-check { padding: 3px 0 3px 4px; }
.bt-prog { background: var(--accent-soft); color: var(--accent-ink); border-radius: 999px; padding: 1px 8px; font-size: 11px; margin-left: 4px; }

/* Lignes et cartes de bons de travaux */
.bt-carte, .bt-ligne {
  display: flex; flex-direction: row; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow);
}
.bt-carte:hover { border-color: var(--orange); }
.bt-ligne-actions button { margin: 0; }
.bt-check input, .bt-choix input[type="checkbox"], .mnt-block input[type="checkbox"] { width: auto; min-height: 0; padding: 0; margin: 2px 0 0; flex: none; }
.bt-check { align-items: flex-start; }
.bt-manuel > summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--orange); }
.bt-manuel[open] > summary { margin-bottom: 12px; }

/* Libelles de fichier (Form 1, preuves) presentes comme des boutons secondaires */
label.file-label.ghost.mini {
  display: inline-flex; flex-direction: row; align-items: center; width: auto; margin: 0; padding: 6px 12px; font-size: 12px; font-weight: 600;
  color: var(--orange); border: 1px solid var(--orange); border-radius: 10px; background: transparent; min-height: 34px;
}
label.file-label.ghost.mini:hover { background: var(--accent-soft); }
.row-actions button, .row-actions label { margin: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ===== Avertissements : meteo et maintenance ===== */
.meteo-disclaimer {
  margin: 6px 0 12px; padding: 8px 12px; font-size: 12px; line-height: 1.45; color: #7a4a00;
  background: #fff7e6; border-left: 4px solid #f59e0b; border-radius: 8px;
}
.meteo-disclaimer a { color: inherit; font-weight: 700; text-decoration: underline; }
.meteo-disclaimer-court { margin: 6px 0 0; padding: 4px 6px; font-size: 10px; text-align: center; border-radius: 6px; }
.mnt-disclaimer {
  margin: 0 0 14px; padding: 10px 14px; font-size: 12.5px; line-height: 1.5; color: var(--ink);
  background: var(--accent-soft); border-left: 4px solid var(--orange); border-radius: 10px;
}
.mnt-note { margin: 8px 0; padding: 7px 11px; font-size: 12px; line-height: 1.45; color: var(--muted); border-left: 3px solid var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-dark="off"]) .meteo-disclaimer { color: #fcd34d; background: #2d2200; } }
:root[data-dark="true"] .meteo-disclaimer { color: #fcd34d; background: #2d2200; }

/* ===== Logo Resavia (traits arrondis, pastille ORIGINE) ===== */
.logo { display: block; flex: none; height: 44px; width: 130px; max-width: 100%; --logo-a: #1c3680; --logo-b: #2b9bd6; } /* « res » / « avia » : deux couleurs, les memes pour toutes les applications devavia */
h1.logo-h1 { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; }
.login-card h1.logo-h1 { justify-content: center; margin: 4px 0 0; }
.login-card .logo { height: 72px; width: 213px; }
.login-club { margin: 0; text-align: center; font-size: 15px; font-weight: 600; color: var(--muted); }
.login-club:empty { display: none; }
header .logo { height: 34px; width: 101px; --logo-a: #ffffff; --logo-b: #6cc4f4; }
@media (max-width: 480px) { header .logo { height: 28px; width: 83px; } }
@media (max-height: 760px) { .login-card .logo { height: 56px; width: 166px; } }
@media (prefers-color-scheme: dark) { :root:not([data-dark="off"]) .login-card .logo { --logo-a: #dbe6ff; --logo-b: #6cc4f4; } }
:root[data-dark="true"] .login-card .logo { --logo-a: #dbe6ff; --logo-b: #6cc4f4; }

/* ===== Mobile : pas de zoom automatique d'iOS sur les champs, pas de defilement lateral ===== */
@media (max-width: 767px) {
  input, select, textarea { font-size: 16px; }
}
/* Aucun defilement lateral de la page ni de la zone principale sur telephone (portrait et paysage) : */
html, body { max-width: 100%; overflow-x: hidden; }
#app { max-width: 100%; overflow-x: hidden; }
@media (max-width: 1024px) {
  main { overflow-x: hidden; }
  #prog-grille, #planning { overflow-x: auto; }
}
