/* ============================================================
   AEROTOOLS — habillage commun, clair et net
   Un seul fichier pour les quatre sites. Bureau, téléphone, écran mural.
   ============================================================ */
:root {
    --navy: #1a2e4a; --navy-2: #24405f; --ink: #17212e; --ink-2: #475569; --muted: #6b7a8d;
    --line: #dfe5ec; --line-2: #eef2f6; --bg: #f3f6f9; --card: #ffffff; --accent: #2a78d6;
    /* États (réservés : jamais utilisés comme couleur de série) */
    --good: #17713a; --good-bg: #e3f5ea; --warn: #8a6100; --warn-bg: #fdf1cf; --bad: #b42318; --bad-bg: #fde4e1;
    /* Séries de graphiques, dans un ordre fixe */
    --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
    --radius: 12px; --shadow: 0 1px 2px rgba(23,33,46,.05), 0 4px 16px rgba(23,33,46,.04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--accent); }
h1, h2 { margin: 0; text-wrap: balance; }
.num, .kpi-v, td.num { font-variant-numeric: tabular-nums; }

/* ── Barre du haut ───────────────────────────────────────── */
.at-top { background: var(--navy); color: #fff; display: flex; align-items: stretch; gap: 8px; padding: 0 20px; min-height: 58px; position: sticky; top: 0; z-index: 20; }
.at-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .14em; font-size: .88rem; padding-right: 18px; }
.at-apps { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.at-apps::-webkit-scrollbar { display: none; }
.at-apps a { display: flex; flex-direction: column; justify-content: center; padding: 0 16px; color: rgba(255,255,255,.72); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.at-apps a b { font-size: .92rem; font-weight: 600; }
.at-apps a small { font-size: .7rem; opacity: .75; }
.at-apps a:hover { color: #fff; background: rgba(255,255,255,.06); }
.at-apps a.on { color: #fff; border-bottom-color: #7fc4ff; background: rgba(255,255,255,.08); }
.at-user { display: flex; align-items: center; gap: 10px; }
.at-lang { color: #fff; text-decoration: none; font-size: .74rem; font-weight: 700; border: 1px solid rgba(255,255,255,.35); border-radius: 6px; padding: 4px 8px; }
.at-lang:hover { background: rgba(255,255,255,.12); }
.at-menu { position: relative; }
.at-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 8px; }
.at-menu summary::-webkit-details-marker { display: none; }
.at-menu summary:hover { background: rgba(255,255,255,.1); }
.at-avatar { width: 30px; height: 30px; border-radius: 50%; background: #7fc4ff; color: var(--navy); font-weight: 700; display: grid; place-items: center; font-size: .85rem; }
.at-uname { font-size: .82rem; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-menu-pop { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(23,33,46,.18); min-width: 240px; padding: 6px; }
.at-menu-pop a { display: block; padding: 9px 12px; border-radius: 6px; text-decoration: none; color: var(--ink); font-size: .88rem; }
.at-menu-pop a:hover { background: var(--bg); }
.at-menu-id { padding: 10px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; display: flex; flex-direction: column; font-size: .82rem; }
.at-menu-id span { color: var(--muted); }

.at-tabs { background: #fff; border-bottom: 1px solid var(--line); padding: 0 20px; display: flex; gap: 4px; overflow-x: auto; }
.at-tabs a { padding: 12px 14px; color: var(--ink-2); text-decoration: none; font-size: .9rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.at-tabs a:hover { color: var(--ink); }
.at-tabs a.on { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }

.at-wrap { max-width: 1320px; margin: 0 auto; padding: 22px 20px 48px; }
.at-foot { text-align: center; color: var(--muted); font-size: .76rem; padding: 0 20px 28px; }

/* ── Titres, filtres ─────────────────────────────────────── */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title { font-size: 1.55rem; font-weight: 700; color: var(--navy); letter-spacing: -.01em; }
.page-sub { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.period { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pill-btn { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); text-decoration: none; font-size: .82rem; white-space: nowrap; }
.pill-btn:hover { border-color: var(--navy); color: var(--navy); }
.pill-btn.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.period-custom { display: flex; gap: 6px; align-items: center; margin-left: 6px; }
input[type=date], input[type=email], input[type=text], select { height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; font-size: .88rem; background: #fff; color: var(--ink); max-width: 100%; }
input:focus, select:focus, .btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.filters { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; }
.filters > label { display: flex; flex-direction: column; gap: 4px; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.chips { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1; min-width: 220px; }
.chips legend { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 0; margin-bottom: 4px; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; font-size: .82rem; cursor: pointer; background: #fff; color: var(--ink-2); }
.chip input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Boutons ─────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--navy); background: #fff; color: var(--navy); font: inherit; font-size: .88rem; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--bg); }
.btn-main { background: var(--navy); color: #fff; }
.btn-main:hover { background: var(--navy-2); }
.btn-sm { height: 32px; padding: 0 12px; font-size: .8rem; }
.btn-ghost { border-color: var(--line); color: var(--ink-2); font-weight: 500; }

/* ── Cartes ──────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; min-width: 0; }
.card.narrow { max-width: 520px; margin: 60px auto; }
.card h2 { font-size: 1rem; font-weight: 650; color: var(--navy); }
.card .sub { margin: 2px 0 14px; color: var(--muted); font-size: .82rem; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.count { display: inline-block; background: var(--line-2); color: var(--ink-2); border-radius: 99px; font-size: .74rem; padding: 1px 9px; font-weight: 600; vertical-align: 2px; margin-left: 4px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid2 > .card { margin-bottom: 0; }
.grid2 { margin-bottom: 18px; }
.empty { color: var(--muted); font-size: .9rem; margin: 18px 0 6px; }
.method { color: var(--muted); font-size: .78rem; margin: 12px 0 0; }
.muted { color: var(--muted); }
.scroll { overflow-x: auto; }
.chart { position: relative; width: 100%; }

/* ── À retenir ───────────────────────────────────────────── */
.notes { border-left: 4px solid var(--navy); }
.notes ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.notes li { padding-left: 16px; position: relative; font-size: .95rem; }
.notes li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--navy); }

/* ── Chiffres clés ───────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; min-width: 0; }
.kpi-l { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi-v { font-size: 1.65rem; font-weight: 700; color: var(--navy); line-height: 1.25; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-d { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.kpi-delta { font-weight: 700; }
.kpi-delta.good { color: var(--good); } .kpi-delta.bad { color: var(--bad); } .kpi-delta.flat { color: var(--muted); }

/* ── Prévision 7 jours ───────────────────────────────────── */
.fc-row { display: grid; grid-template-columns: repeat(7, minmax(128px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.fc { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; border-top: 4px solid var(--muted); min-width: 128px; }
.fc.good { border-top-color: var(--good); } .fc.mid { border-top-color: #c98a00; } .fc.bad { border-top-color: var(--bad); }
.fc-day { font-size: .8rem; color: var(--ink-2); text-transform: capitalize; }
.fc-p { font-size: 1.7rem; font-weight: 700; color: var(--navy); line-height: 1.2; font-variant-numeric: tabular-nums; }
.fc-bar { height: 5px; background: var(--line-2); border-radius: 3px; overflow: hidden; margin: 4px 0 8px; }
.fc-bar i { display: block; height: 100%; border-radius: 3px; background: var(--muted); }
.fc.good .fc-bar i { background: var(--good); } .fc.mid .fc-bar i { background: #c98a00; } .fc.bad .fc-bar i { background: var(--bad); }
.fc-status { font-size: .76rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.fc-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.fc.good .fc-status { color: var(--good); } .fc.good .dot { background: var(--good); }
.fc.mid .fc-status { color: var(--warn); } .fc.mid .dot { background: #c98a00; }
.fc.bad .fc-status { color: var(--bad); } .fc.bad .dot { background: var(--bad); }
.fc dl { margin: 10px 0 0; display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; font-size: .78rem; border-top: 1px solid var(--line-2); padding-top: 8px; }
.fc dt { color: var(--muted); min-width: 0; } .fc dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Tableaux ────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tbl th, .tbl td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line-2); white-space: nowrap; vertical-align: middle; }
.tbl th { font-size: .7rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: #f8fafc; }
.tbl th:first-child, .tbl td:first-child, .tbl .left { text-align: left; }
.tbl td.wrap { white-space: normal; min-width: 260px; color: var(--ink-2); font-size: .82rem; }
.tbl tr:hover td { background: #fafcfe; }
.tbl tr.off td { opacity: .5; }
.tbl select { height: 32px; }
.scope-sep { display: block; height: 6px; }
.apps-cell label, td label { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; font-size: .82rem; }
.share { display: inline-block; width: 70px; height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.share i { display: block; height: 100%; background: var(--s1); border-radius: 3px; }
.pill { border-radius: 99px; padding: 1px 10px; font-size: .74rem; font-weight: 700; background: var(--line-2); color: var(--navy); text-decoration: none; }
.pill.good { background: var(--good-bg); color: var(--good); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.pager { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 14px; font-size: .84rem; color: var(--muted); }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.inline-form input[type=email] { min-width: 280px; }

/* ── Réglage des sites ───────────────────────────────────── */
.site-card { padding: 0; }
.site-card > summary { list-style: none; cursor: pointer; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.site-card > summary::-webkit-details-marker { display: none; }
.site-card > summary:hover { background: #fafcfe; border-radius: var(--radius); }
.site-name { font-weight: 650; color: var(--navy); font-size: 1rem; }
.site-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .78rem; }
.pill.off { background: var(--line-2); color: var(--muted); }
.site-form { padding: 4px 20px 20px; border-top: 1px solid var(--line-2); }
.site-form h3 { font-size: .9rem; color: var(--navy); margin: 18px 0 2px; }
.fgrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 14px; margin-top: 14px; }
.fgrid label, .hours-grid label { display: flex; flex-direction: column; gap: 4px; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; min-width: 0; }
.fgrid .w2 { grid-column: span 2; } .fgrid .w3 { grid-column: span 3; }
.fgrid input, .fgrid select, .fgrid textarea, .hours-grid input { width: 100%; text-transform: none; letter-spacing: 0; }
.fgrid select[multiple] { height: auto; padding: 4px; }
.fgrid small { text-transform: none; letter-spacing: 0; font-size: .74rem; color: var(--muted); }
.fgrid input[readonly] { background: var(--bg); color: var(--muted); }
textarea { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: .86rem; }
.hours-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
/* ── Matrice de prévision (Flotte) ───────────────────────── */
.matrix td.cellp { text-align: center; min-width: 92px; border-left: 3px solid transparent; }
.matrix td.cellp b { display: block; font-size: 1.05rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.matrix td.cellp span { font-size: .7rem; font-weight: 600; }
.matrix td.cellp.good { background: var(--good-bg); } .matrix td.cellp.good span { color: var(--good); }
.matrix td.cellp.mid { background: var(--warn-bg); } .matrix td.cellp.mid span { color: var(--warn); }
.matrix td.cellp.bad { background: var(--bad-bg); } .matrix td.cellp.bad span { color: var(--bad); }
.matrix td.cellp.na { color: var(--muted); }
.matrix th { text-align: center; }
a.daylink { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
a.daylink:hover { color: var(--accent); text-decoration-color: var(--accent); }
.tbl td a { color: var(--navy); text-decoration: none; } .tbl td a:hover { text-decoration: underline; }

/* ── Messages ────────────────────────────────────────────── */
.flash { border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: .9rem; border: 1px solid; }
.flash.ok { background: var(--good-bg); border-color: #a9dfbd; color: #14532d; }
.flash.err { background: var(--bad-bg); border-color: #f3b4ad; color: #7a1a12; }
.flash.warn { background: var(--warn-bg); border-color: #f0d68a; color: #6b4a05; }

/* ── Réglages : case à cocher sur une ligne ──────────────── */
.chk-line { justify-content: flex-end; }
.chk-line > span { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: .88rem; color: var(--ink); text-transform: none; letter-spacing: 0; }
.chk-line input { width: 18px; height: 18px; accent-color: var(--navy); }

/* ── Feuille quotidienne ─────────────────────────────────── */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet-card { padding-bottom: 14px; }
.sheet-toggles { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet-toggles .btn.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.sheet-wrap { overflow: auto; max-height: calc(100vh - 150px); border: 1px solid var(--line); border-radius: 10px; margin-top: 4px; }
.sheet { border-collapse: separate; border-spacing: 0; font-size: .82rem; font-variant-numeric: tabular-nums; width: max-content; min-width: 100%; }
.sheet th, .sheet td { padding: 6px 9px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); }
.sheet thead th { position: sticky; z-index: 2; background: #f8fafc; color: var(--ink-2); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.sheet thead tr:first-child th { top: 0; height: 30px; }
.sheet thead tr:nth-child(2) th { top: 30px; border-bottom: 1px solid var(--line); }
.sheet tr.grp th { text-align: center; color: var(--navy); font-size: .68rem; letter-spacing: .08em; border-bottom: 2px solid var(--line); }
.sheet tr.grp th.g-ops { border-bottom-color: var(--s1); } .sheet tr.grp th.g-tix { border-bottom-color: var(--s4); }
.sheet tr.grp th.g-rev { border-bottom-color: var(--s3); } .sheet tr.grp th.g-enc { border-bottom-color: var(--s7); } .sheet tr.grp th.g-fam { border-bottom-color: var(--s2); }
.sheet .stick { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; min-width: 112px; border-right: 1px solid var(--line); }
.sheet thead .stick { z-index: 3; top: 0; background: #f8fafc; vertical-align: bottom; }
.sheet td.stick .dow { color: var(--muted); font-size: .74rem; margin-left: 2px; }
.sheet tbody tr:hover td { background: #f4f8fd; }
.sheet tr.we td { background: #fbfcfd; } .sheet tr.we td.stick { background: #fbfcfd; }
.sheet tr.bw td { background: #eef3f9; font-weight: 650; color: var(--navy); border-bottom: 1px solid #d5dfeb; }
.sheet tr.tot td { background: var(--navy); color: #fff; font-weight: 700; border-bottom: 0; position: sticky; bottom: 0; z-index: 1; }
.sheet tr.tot td.stick { z-index: 2; } .sheet tr.tot td small { color: rgba(255,255,255,.75); }
.sheet td small { color: var(--muted); font-size: .72rem; }
.sheet td.warn { background: var(--warn-bg) !important; color: var(--warn); font-weight: 650; }
.sheet tr.bw td.warn { background: #eef3f9 !important; }
.sheet tr.tot td.warn { background: var(--navy) !important; color: #ffd98a; }
.sheet tr.bw .jbtn, .sheet tr.tot .jbtn { display: none; }
.sheet td.ok { color: var(--good); }
.sheet td.zero { color: var(--muted); }
.sheet td.jcell { position: relative; padding-right: 26px; }
.jbtn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--navy); font-size: 12px; line-height: 1; cursor: pointer; opacity: 0; padding: 0; }
.sheet tr:hover .jbtn, .jbtn:focus-visible { opacity: 1; }
.sheet td.warn .jbtn { opacity: 1; border-color: #e3c46b; }
.jbtn:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.sheet .x-enc, .sheet .x-fam, .sheet .x-p { display: none; }
.sheet.show-x-enc .x-enc, .sheet.show-x-fam .x-fam { display: table-cell; }
.sheet.show-x-fam .x-p.open { display: table-cell; }
.sheet .prod-h, .sheet td.x-p { background: #fffaf5; }
.sheet thead .prod-h { background: #fdf3ea; text-transform: none; font-weight: 500; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.fam-btn { border: 0; background: none; font: inherit; color: var(--navy); cursor: pointer; text-transform: none; font-weight: 650; padding: 0; }
.fam-btn:hover { text-decoration: underline; }

/* Fenêtres de saisie */
.dlg { border: 0; border-radius: 14px; padding: 22px 24px 18px; width: min(520px, calc(100vw - 24px)); box-shadow: 0 24px 60px rgba(23,33,46,.28); color: var(--ink); }
.dlg::backdrop { background: rgba(23,33,46,.42); }
.dlg h3 { margin: 0 0 2px; color: var(--navy); font-size: 1.08rem; padding-right: 28px; }
.dlg .sub { color: var(--muted); font-size: .84rem; margin: 2px 0 12px; }
.dlg-close { position: absolute; right: 12px; top: 10px; margin: 0; }
.dlg-close button { border: 0; background: none; font-size: 18px; color: var(--muted); cursor: pointer; width: 32px; height: 32px; border-radius: 8px; }
.dlg-close button:hover { background: var(--bg); color: var(--ink); }
.jlist { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--line); border-radius: 10px; max-height: 220px; overflow: auto; }
.jlist li { display: flex; gap: 12px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line-2); font-size: .86rem; }
.jlist li:last-child { border-bottom: 0; }
.jlist li b { min-width: 34px; text-align: right; color: var(--navy); font-variant-numeric: tabular-nums; }
.jlist li span { flex: 1; color: var(--ink-2); }
.jlist li.empty { color: var(--muted); justify-content: center; margin: 0; }
.btn.danger { color: var(--bad); }
.jform { display: flex; flex-direction: column; gap: 12px; }
.jform > label { display: flex; flex-direction: column; gap: 4px; font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.jform input[type=number] { height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; width: 140px; }
.jform fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.jform .chip { position: relative; }
.jform .btn { align-self: flex-start; }
.jmsg { margin: 0; font-size: .86rem; min-height: 1.2em; } .jmsg.ok { color: var(--good); } .jmsg.err { color: var(--bad); }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; cursor: pointer; text-transform: none !important; letter-spacing: 0 !important; font-size: .9rem !important; color: var(--ink-2) !important; }
.drop:hover { border-color: var(--navy); background: #fafcfe; }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }

/* ── Sous-navigation, tableaux de données ────────────────── */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 18px; }
.subnav a { padding: 7px 14px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-size: .86rem; font-weight: 500; border: 1px solid transparent; }
.subnav a:hover { background: #fff; border-color: var(--line); }
.subnav a.on { background: #fff; border-color: var(--line); color: var(--navy); font-weight: 650; box-shadow: var(--shadow); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid3 > .card { margin-bottom: 0; } .grid3 { margin-bottom: 18px; }
.tbl-wrap { overflow-x: auto; }
.tbl tr.tot td { font-weight: 700; color: var(--navy); border-top: 2px solid var(--line); background: #f8fafc; }
.tbl td.sharecell { width: 90px; }
.grid3 .tbl th, .grid3 .tbl td { padding: 8px 6px; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-search input[type=search] { height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; font-size: .84rem; width: 240px; max-width: 100%; }

/* ── Analyse des vols ────────────────────────────────────── */
.site-pick select { height: 38px; font-weight: 600; color: var(--navy); min-width: 220px; }
.period-row { margin: -6px 0 16px; }
.subnav a.ext { margin-left: auto; color: var(--accent); }
.heat { border-collapse: separate; border-spacing: 3px; font-size: .78rem; font-variant-numeric: tabular-nums; width: 100%; }
.heat th { font-weight: 600; color: var(--muted); font-size: .7rem; padding: 2px 4px; text-align: center; white-space: nowrap; }
.heat tbody th { text-align: left; color: var(--ink-2); font-size: .8rem; padding-right: 8px; }
.heat td { text-align: center; border-radius: 4px; height: 30px; min-width: 30px; }
.heat td.rt { background: none !important; color: var(--navy) !important; font-weight: 650; text-align: right; padding-left: 8px; }

/* ── Statut publié, API ──────────────────────────────────── */
.lamp { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.lamp.green { background: #2e9e5b; } .lamp.orange { background: #e8a33a; } .lamp.red { background: #d5493f; }
.status-tbl select, .status-tbl input[type=text] { height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: inherit; font-size: .84rem; }
.status-tbl input[type=text] { width: 100%; min-width: 220px; }
.keybox { border-color: #e3c46b; background: #fffbea; }
code.key { display: inline-block; font-size: .95rem; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; margin-right: 8px; user-select: all; word-break: break-all; }
pre.code { background: #0f1b2b; color: #dbe7f5; border-radius: 10px; padding: 14px 16px; font-size: .78rem; overflow-x: auto; line-height: 1.5; }
.apps-cell .lbl { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }

/* ── Bandeau d'alertes (sous la barre du haut) ── */
.at-alerts { background: #fff; border-bottom: 1px solid #dfe5ec; padding: 6px 20px; display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 9989; font: 14px/1.4 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; }
.at-alert { display: flex; align-items: center; gap: 8px; color: #17212e; padding: 4px 10px; border-radius: 8px; background: #fff7e6; }
.at-alert.bad { background: #fdecea; }
.at-alert-ic { color: #b7791f; font-size: 13px; } .at-alert.bad .at-alert-ic { color: #c0392b; }
.at-alert a { color: #1a2e4a; font-weight: 600; text-decoration: none; } .at-alert a:hover { text-decoration: underline; }
.at-alert-x { margin-left: auto; color: #6b7a8d !important; font-weight: 400 !important; padding: 0 4px; }
.at-alert-t { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.at-alert-more { font-weight: 500 !important; color: #475569 !important; white-space: nowrap; }
@media print { .at-alerts { display: none !important; } }
.al-list { list-style: none; margin: 0; padding: 0; }
.al-list li { padding: 8px 12px; border-radius: 8px; background: #fff7e6; margin-bottom: 6px; } .al-list li.bad { background: #fdecea; }
.al-list a { font-weight: 600; color: var(--navy); }
.alert-cfg .site-form { margin-bottom: 8px; } .alert-cfg .apps-cell { margin: 6px 0; }
.alert-cfg textarea, .wide-input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: .86rem; }
.alert-cfg label.wide { display: block; margin-top: 6px; } .switch { font-weight: 600; color: var(--navy); }

.form-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 6px 0 10px; }
.form-row label { display: flex; flex-direction: column; gap: 4px; }
.form-row label > span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.form-row input { height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; min-width: 140px; }
.form-row input[type=text] { min-width: 300px; }
.scope-cell .lbl { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
td.apps-cell { white-space: normal; }

/* ── Connexion ───────────────────────────────────────────── */
.login { min-height: calc(100vh - 220px); display: grid; place-items: center; padding: 30px 0; }
.login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 40px rgba(23,33,46,.08); padding: 34px 32px 28px; }
.login-mark { text-align: center; margin-bottom: 6px; }
.login-card h1 { text-align: center; font-size: 1.4rem; color: var(--navy); }
.login-sub { text-align: center; color: var(--muted); font-size: .86rem; margin: 6px 0 22px; }
.login-card label { display: block; font-size: .8rem; color: var(--ink-2); margin-bottom: 6px; }
.login-card input[type=email], .login-card input.code { width: 100%; height: 46px; font-size: 1rem; margin-bottom: 12px; }
.login-card input.code { text-align: center; letter-spacing: .4em; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.login-card .btn { width: 100%; height: 46px; font-size: .95rem; }
.btn-ms { border-color: var(--line); color: var(--ink); font-weight: 600; }
.login-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .78rem; margin: 16px 0; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-note { text-align: center; color: var(--muted); font-size: .78rem; margin: 14px 0 0; }

/* ── Bandeau posé au-dessus des anciens tableaux ─────────── */
.at-legacy { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 14px; padding: 8px 18px; font: 13px/1.4 "Segoe UI", system-ui, sans-serif; flex-wrap: wrap; }
.at-legacy a { color: #fff; text-decoration: none; padding: 5px 12px; border-radius: 6px; border: 1px solid rgba(255,255,255,.3); white-space: nowrap; }
.at-legacy a:hover, .at-legacy a.on { background: rgba(255,255,255,.14); }
.at-legacy b { letter-spacing: .12em; margin-right: 6px; }
.at-legacy span { margin-left: auto; opacity: .8; }

/* ── Téléphone ───────────────────────────────────────────── */
@media (max-width: 980px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fgrid .w3 { grid-column: span 2; }
    .hours-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .at-top { padding: 0 10px; }
    .at-brand span, .at-uname { display: none; }
    .at-brand { padding-right: 4px; }
    .at-apps a { padding: 0 11px; }
    .at-apps a small { display: none; }
    .at-wrap { padding: 16px 12px 36px; }
    .page-title { font-size: 1.3rem; }
    .kpi-v { font-size: 1.3rem; }
    .kpi { padding: 12px; }
    .card { padding: 14px; }
    .period { width: 100%; }
    .period-custom { margin-left: 0; width: 100%; flex-wrap: wrap; }
    .period-custom input { flex: 1 1 130px; min-width: 0; }
    .page-head { align-items: stretch; }
    .at-apps { min-width: 0; }
    .at-top { flex-wrap: nowrap; }
    .filters > label, .filters select { max-width: 100%; }
    .fc-row { grid-template-columns: repeat(7, 132px); }
    .login-card { padding: 26px 20px; border-radius: 12px; }
    .sheet-card .card-head { flex-direction: column; }
    .subnav { flex-wrap: nowrap; overflow-x: auto; margin-right: -12px; padding-bottom: 4px; }
    .subnav a { white-space: nowrap; }
    .sheet .stick { min-width: 70px; }
    .sheet th, .sheet td { padding: 5px 7px; }
}

/* ── Écran mural (?tv=1) ─────────────────────────────────── */
body.tv { font-size: 19px; background: #eef2f6; }
body.tv .at-wrap { max-width: none; padding: 26px 34px; }
body.tv .page-title { font-size: 2.3rem; }
body.tv .kpi-v { font-size: 2.5rem; }
body.tv .kpi-l { font-size: .8rem; }
body.tv .fc-p { font-size: 2.4rem; }
body.tv .fc dl { font-size: .86rem; }
body.tv .card h2 { font-size: 1.2rem; }
.tv-exit { position: fixed; right: 14px; bottom: 10px; font-size: 12px; color: var(--muted); text-decoration: none; opacity: .5; }
.tv-exit:hover { opacity: 1; }

@media print {
    @page { size: A4 landscape; margin: 8mm; }
    .at-top, .at-tabs, .period, .filters, .btn, .at-foot, .no-print, .at-legacy { display: none !important; }
    .sheet-wrap { overflow: visible; max-height: none; border: 0; }
    .sheet { font-size: 7.5px; }
    .sheet th, .sheet td { padding: 2px 4px; }
    .sheet thead th, .sheet .stick, .sheet tr.tot td { position: static; }
    .sheet tr.tot td { background: #1a2e4a !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .sheet tr.bw td, .sheet td.warn { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .at-wrap { padding: 0 !important; max-width: none !important; }
    body { background: #fff; }
    .card, .kpi { box-shadow: none; break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Billets comptés comme passagers (feuille quotidienne) */
.tk-tbl select { padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; }
.tk-tbl tr.tk-on td { background: #f3f8fd; }
.tk-tbl tr.tk-suggest td { background: #fff8e6; }
.tk-tbl tr.tk-suggest small { color: #8a5a00; font-weight: 600; }
.sheet td.has-multi { text-decoration: underline dotted #7a8ba3; text-underline-offset: 3px; cursor: help; }
/* Aéronaud : choix tu / vous */
.an-tone { margin: 6px 0 14px; }
.an-tone label { display: flex; align-items: center; gap: 10px; flex-direction: row; font-weight: 600; }
.an-tone select { margin-left: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }

/* Conseils de réglage */
.adv-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lamp.grey { background: #b8c2cf; }
.adv-card { margin-top: 16px; }
.adv-list { list-style: none; margin: 8px 0 0; padding: 0; }
.adv-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; border-top: 1px solid var(--line); }
.adv-list li:first-child { border-top: 0; }
.adv-list .lamp { margin-top: 5px; flex: none; }
.adv-body { flex: 1; min-width: 0; }
.adv-t { font-weight: 600; color: var(--ink, #1a2e4a); }
.adv-d { color: var(--muted, #5b6b80); font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.adv-how { margin-top: 8px; font-size: 14px; }
.adv-how summary { cursor: pointer; color: #1f6fd1; font-weight: 600; }
.adv-how p { margin: 8px 0 4px; }
.adv-code { background: #0f1f35; color: #e6eefb; padding: 10px 12px; border-radius: 8px; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 8px; }
@media (max-width: 700px) { .adv-kpis { grid-template-columns: repeat(3, 1fr); } }

/* Rapport mensuel */
.rp-kicker { margin: 0 0 4px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: #7a8ba3; }
.rp-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rp-pick select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; }
.rp-kpis .kpi-d + .kpi-d { margin-top: 2px; }
.rp-share { width: 34%; }
.rp-share i { display: inline-block; height: 8px; border-radius: 4px; background: #3b7dd8; vertical-align: middle; margin-right: 8px; max-width: 70%; }
.rp-share span { font-size: 13px; color: #5b6b80; }
.rp-foot { color: #7a8ba3; font-size: 13px; margin: 6px 0 22px; }
.rp-h3 { margin: 18px 0 6px; font-size: 15px; }
.rp-lbl { display: block; margin: 12px 0 4px; font-weight: 600; font-size: 14px; }
.rp-chks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.rp-cfg textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.rp-cfg .chk { display: inline-flex; gap: 6px; align-items: center; margin: 6px 0; }
.rp-cfg .btn { margin-top: 10px; }
@media print {
  .no-print, .at-top, .subnav, .an-root, .at-foot, .at-alerts { display: none !important; }
  body { background: #fff !important; }
  .card, .kpi { box-shadow: none !important; break-inside: avoid; border: 1px solid #dfe6ef; }
  .page { padding-top: 0 !important; }
}

/* Objectifs et budget */
.tg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 6px; }
.tg-l { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #7a8ba3; font-weight: 600; }
.tg-v { font-size: 15px; color: #5b6b80; margin: 4px 0 8px; } .tg-v b { font-size: 24px; color: var(--navy); }
.tg-bar { position: relative; height: 12px; border-radius: 6px; background: #e8edf4; overflow: visible; }
.tg-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: #3b7dd8; }
.tg-good .tg-bar i { background: #2e9e5b; } .tg-mid .tg-bar i { background: #e8a33a; } .tg-bad .tg-bar i { background: #d5493f; }
.tg-bar s { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; background: var(--navy); border-radius: 2px; }
.tg-bar u { position: absolute; top: 14px; width: 0; height: 0; margin-left: -5px; border: 5px solid transparent; border-bottom-color: #7a8ba3; }
.tg-d { font-size: 13px; color: #5b6b80; margin-top: 12px; } .tg-n { font-size: 13px; color: #8a5a00; margin-top: 4px; }
.tg-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; font-size: 14px; }
.tg-tools input { width: 70px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.tg-tbl input.tg-in { width: 110px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; text-align: right; }
.tg-s.good { color: #2e9e5b; font-weight: 700; } .tg-s.mid { color: #b07b12; font-weight: 700; } .tg-s.bad { color: #d5493f; font-weight: 700; }
.tg-tbl .tg-ly { color: #7a8ba3; font-size: 13px; }
.tg-tbl tfoot td { border-top: 2px solid var(--line); }
.kpi-tg { position: relative; margin-top: 8px; height: 18px; border-radius: 9px; background: #eef2f7; overflow: hidden; font-size: 11.5px; }
.kpi-tg i { position: absolute; left: 0; top: 0; bottom: 0; background: #cfe0f6; }
.kpi-tg.good i { background: #cdebd8; } .kpi-tg.mid i { background: #f6e3bf; } .kpi-tg.bad i { background: #f5d0cc; }
.kpi-tg span { position: relative; padding-left: 8px; line-height: 18px; color: #1a2e4a; }

/* Prévisions 7 jours */
.pv-tbl td.pv-c { padding: 0; vertical-align: top; min-width: 112px; }
.pv-tbl td.pv-c a { display: block; padding: 8px 10px; color: inherit; text-decoration: none; border-radius: 8px; margin: 3px; }
.pv-tbl td.pv-good a { background: #e6f5ec; } .pv-tbl td.pv-mid a { background: #fdf3e1; } .pv-tbl td.pv-bad a { background: #fbe7e5; }
.pv-tbl td.pv-c a:hover { outline: 2px solid #3b7dd8; }
.pv-p { display: block; font-size: 18px; font-weight: 700; color: var(--navy); }
.pv-x { display: block; font-size: 12.5px; color: #44556b; white-space: nowrap; }
.pv-s { display: block; font-size: 11.5px; color: #7a8ba3; }
.pv-none { color: #b8c2cf; text-align: center; }
.pv-w { font-size: 13px; font-weight: 600; white-space: nowrap; }

/* Application et notifications */
.ap-icon { display: flex; gap: 14px; align-items: center; margin: 10px 0 14px; }
.ap-icon img { border-radius: 16px; box-shadow: 0 4px 14px rgba(20,36,59,.25); }
.ap-icon b { display: block; font-size: 18px; color: var(--navy); } .ap-icon span { color: #5b6b80; font-size: 14px; }
.ap-how p { margin: 10px 0 0; font-size: 14px; color: #44556b; }
.ap-state { font-weight: 600; color: var(--navy); min-height: 1.4em; }
[hidden] { display: none !important; }
.ap-devs { list-style: none; margin: 6px 0 0; padding: 0; }
.ap-devs li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.ap-devs li:first-child { border-top: 0; }
.ap-devs b { display: block; color: var(--navy); } .ap-devs small { color: #5b6b80; }
.ap-card .form-row { flex-wrap: wrap; gap: 8px; }
@media (max-width: 700px) {
  .rp-mix .rp-share { width: auto; } .rp-share i { max-width: 40px; }
  .rp-mix td.left { white-space: normal; }
  .card .btn { white-space: normal; }
  .rp-pick select { max-width: 100%; }
}
.rp-sent td { white-space: normal; }

/* Connexion aux vols (Sites et horaires) */
.conn-card { margin-bottom: 16px; }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.conn-item, .conn-line { display: flex; gap: 10px; align-items: flex-start; }
.conn-item .lamp, .conn-line .lamp { margin-top: 5px; flex: none; }
.conn-item b, .conn-line b { display: block; color: var(--navy); } .conn-item small, .conn-line small { display: block; color: #5b6b80; font-weight: 400; }
.conn-site { margin-top: 10px; display: grid; gap: 10px; padding: 10px 12px; background: #f6f8fb; border-radius: 10px; }
.conn-warn { color: #8a5a00 !important; }

/* ── Intelligence artificielle (branchement Claude) ── */
.ai-card .ai-in { display: block; width: 100%; max-width: 440px; box-sizing: border-box; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; background: var(--card); color: var(--ink); }
.ai-card small.sub { display: block; margin-top: 4px; font-size: .8rem; color: var(--muted); }
.ai-card .chk { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.ai-card input[type=checkbox] { flex: none; margin: 2px 0 0; width: 18px; height: 18px; accent-color: var(--navy); }
.ai-f { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; }
.ai-f:has(input:checked) { border-color: var(--navy); }
.ai-f b { display: block; font-weight: 600; }
.ai-f small { display: block; margin-top: 3px; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.rp-ai { border-left: 4px solid var(--s7); }
.rp-ai h2 { display: flex; align-items: center; gap: 8px; }
.rp-ai-mark { color: var(--s7); font-size: 1.1em; }
.rp-ai p { margin: 8px 0 0; line-height: 1.6; }
.rp-ai form { margin-top: 10px; }
@media print { .rp-ai { break-inside: avoid; } }
