/* ==========================================================================
   SELACV – Gestion de site V1.0.0 : salle de contrôle.
   Couleurs et thèmes clair/sombre : variables de css/site-theme.css (lavande, violet, champagne).
   Sommaire : 1. Base  2. En-tête, campus, jour, onglets  3. Vues et panneaux  4. Tableau de bord
   5. Frise de la journée  6. Semaine  7. Équipes  8. Tickets  9. Listes  10. Fiche  11. Aide  12. Mobile
   ========================================================================== */

/* 1. Base ------------------------------------------------------------------ */
:root {
  --cathedrale: #d4a800; --citadelle: #d9484d; --saint-charles: #4385d3; --saint-leu: #3f9c6a; --teinturerie: #7c3aed;
  --lane-maintenance: #68518d; --lane-accueil: #a9813f; --lane-events: #2f7c86; --lane-security: #b5524e;
  --ok: #2f8a5b; --warn: #b7791f; --alert: #c2413c; --remote: #2f6fb0; --remote-soft: #e5effa; --radius: 14px;
  font-family: Arial, Helvetica, sans-serif;
}
:root[data-theme="dark"] {
  --lane-maintenance: #b6a3e0; --lane-accueil: #dcbd85; --lane-events: #78c4cc; --lane-security: #ec9a92;
  --ok: #7fd3a6; --warn: #f0c070; --alert: #ff948d; --remote: #8fc0f2; --remote-soft: #1d3550;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--accent); }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--field-border); border-radius: 9px; padding: 8px 13px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--soft); }
.btn.primary { background: #68518d; border-color: #68518d; color: #fff; }
.btn.primary:hover { background: #51416f; }
.muted { color: var(--muted); }
.warn-text { color: var(--alert); font-weight: 700; }

/* 2. En-tête ---------------------------------------------------------------- */
.app-header { position: sticky; top: 0; z-index: 20; color: #fff; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px clamp(14px, 2.6vw, 40px) 8px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px #ffffff55; background: #fff; }
.brand h1 { margin: 0; font-size: 19px; letter-spacing: .04em; color: #fff; }
.version { display: inline-block; margin-left: 6px; padding: 3px 8px; border-radius: 999px; font-size: 11px; vertical-align: middle; }
.subtitle { margin-top: 2px; font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.head-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; border: 1px solid #ffffff70; border-radius: 999px; padding: 6px 12px; background: #ffffff18; color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; }
.head-btn:hover { background: #ffffff2c; }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.sync { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: #fff; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #ffd26d; box-shadow: 0 0 10px #ffd26d; }
.sync.is-success .dot { background: #63e294; box-shadow: 0 0 10px #63e294; }
.sync.is-error .dot { background: #ff8b84; box-shadow: 0 0 10px #ff8b84; }

.campus-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 4px clamp(14px, 2.6vw, 40px) 12px; }
.campus-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.campus-btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #ffffff50; border-radius: 999px; padding: 6px 13px; background: transparent; color: #f3edfb; font-size: 13px; font-weight: 700; cursor: pointer; }
.campus-btn i, .welcome-btn i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.campus-btn:hover { background: #ffffff1c; }
.campus-btn[aria-checked="true"] { background: #fbf7ee; border-color: #fbf7ee; color: #3d2f52; box-shadow: 0 4px 14px #1b142633; }
.c-cathedrale { --c: var(--cathedrale); } .c-citadelle { --c: var(--citadelle); } .c-saint-charles { --c: var(--saint-charles); }
.c-saint-leu { --c: var(--saint-leu); } .c-teinturerie { --c: var(--teinturerie); } .c-all, .c-autre { --c: #9a8fab; }
.day-picker { display: flex; align-items: center; gap: 6px; }
.day-step { width: 34px; height: 34px; border: 1px solid #ffffff55; border-radius: 50%; background: transparent; color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.day-step:hover, .day-today:hover { background: #ffffff22; }
.day-label { position: relative; min-width: 210px; padding: 6px 12px; border-radius: 10px; background: #00000020; text-align: center; font-weight: 700; cursor: pointer; }
.day-label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.day-today { border: 1px solid #d8c29d; border-radius: 999px; padding: 6px 12px; background: transparent; color: #f2e3c4; font-size: 12px; font-weight: 700; cursor: pointer; }
.tabs { display: flex; overflow-x: auto; padding: 0 clamp(8px, 2vw, 34px); border-top: 1px solid #ffffff22; scrollbar-width: none; }
.tabs button { display: flex; align-items: center; gap: 7px; border: 0; border-bottom: 3px solid transparent; padding: 11px 13px; background: transparent; color: #eee6f8; font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.tabs button.active { color: #fff; }
.ico { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.is-locked .tabs, body.is-locked .campus-bar, body.is-locked main .view { display: none !important; }

/* 3. Vues et panneaux -------------------------------------------------------- */
main { width: 100%; margin: 20px 0 48px; padding: 0 clamp(12px, 2vw, 40px); }
.view { display: none; }
.view.active { display: block; }
.view-head, .dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.view-head h2, .dash-head h2 { margin: 0; color: var(--title); font-size: 25px; }
.view-head p, .dash-head p { margin: 4px 0 0; color: var(--muted); }
.panel { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--card-shadow); }
.panel h3 { margin: 0; color: var(--heading); font-size: 16px; }
.panel h4 { margin: 16px 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.link-btn { border: 0; background: none; color: var(--accent); font-size: 12px; font-weight: 700; cursor: pointer; padding: 4px; }
.link-btn:hover { text-decoration: underline; }
.empty-line { margin: 6px 0; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); text-align: center; }
.note { margin: 0 0 10px; padding: 10px 12px; border-left: 3px solid var(--accent-2); border-radius: 8px; background: var(--surface-alt); color: var(--muted); font-size: 13px; }
.more { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.toolbar label { display: grid; gap: 4px; color: var(--label); font-size: 12px; font-weight: 700; }
.toolbar label.grow { flex: 1 1 220px; }
.toolbar select, .toolbar input { min-height: 36px; border: 1px solid var(--field-border); border-radius: 9px; padding: 6px 9px; background: var(--surface); color: var(--ink); font-weight: 400; }
.count-line { margin: 0 0 8px; color: var(--muted); font-size: 13px; }

/* Écran d'accès */
.gate { display: grid; place-items: center; min-height: 55vh; }
.gate-card { max-width: 520px; padding: 34px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--card-shadow); text-align: center; }
.gate-ico { width: 46px; height: 46px; fill: none; stroke: var(--accent); stroke-width: 1.6; }
.gate-card h2 { margin: 10px 0 8px; color: var(--title); }
.gate-card p { margin: 0 0 18px; color: var(--muted); }

/* 4. Tableau de bord ---------------------------------------------------------- */
.fresh { font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 12px; background: var(--surface); text-align: left; cursor: pointer; box-shadow: var(--card-shadow); }
.kpi:hover { border-color: var(--accent); }
.kpi span { color: var(--muted); font-size: 12px; font-weight: 700; }
.kpi b { color: var(--accent); font-size: 28px; line-height: 1.1; }
.kpi small { color: var(--muted); font-size: 11.5px; }
.kpi.is-warn { border-top-color: var(--warn); } .kpi.is-warn b { color: var(--warn); }
.kpi.is-alert { border-top-color: var(--alert); } .kpi.is-alert b { color: var(--alert); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.dash-col { display: grid; gap: 14px; align-content: start; }
.welcome { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.welcome-btn { display: inline-flex; align-items: center; gap: 9px; padding: 14px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: var(--card-shadow); }
.welcome-btn:hover { border-color: var(--accent); background: var(--soft); }
.welcome-btn i { width: 12px; height: 12px; }
#dashboardView.is-welcome .timeline-panel, #dashboardView.is-welcome .dash-grid { display: none; }

/* Lignes d'éléments (chantiers, événements, tickets…) */
.item { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 10px; align-items: start; width: 100%; margin: 0; padding: 9px 6px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--soft); }
.item.is-static { cursor: default; } .item.is-static:hover { background: transparent; }
.item.is-compact { padding: 6px; }
.item-time { color: var(--accent); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.item-main { display: grid; gap: 2px; min-width: 0; }
.item-main b { overflow-wrap: anywhere; font-size: 14px; }
.item-main small { color: var(--muted); font-size: 12.5px; }
.item-end { display: grid; justify-items: end; gap: 3px; color: var(--muted); font-size: 12px; }
.agents { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.agent-chip { padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--accent); font-size: 12px; font-weight: 700; }
.campus-tag { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--muted); }
.campus-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; background: var(--surface-alt); color: var(--muted); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pill.s-doing, .pill.st-encours { background: #e9f6ee; color: #23744a; }
.pill.s-planned { background: var(--soft); color: var(--accent); }
.pill.s-todo, .pill.st-aprogrammer { background: #fbf1df; color: #8a5a12; }
.pill.st-clos, .pill.s-done { background: var(--surface-alt); color: var(--muted); }
.pill.pr-0 { background: #fde8e6; color: #a8312c; } .pill.pr-1 { background: #fbf1df; color: #8a5a12; }
:root[data-theme="dark"] .pill.s-doing, :root[data-theme="dark"] .pill.st-encours { background: #1f3a2c; color: #8fe0b2; }
:root[data-theme="dark"] .pill.s-todo, :root[data-theme="dark"] .pill.st-aprogrammer, :root[data-theme="dark"] .pill.pr-1 { background: #3d3020; color: #f0cd8c; }
:root[data-theme="dark"] .pill.pr-0 { background: #4a2523; color: #ffaaa3; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.tag { padding: 2px 8px; border-radius: 6px; background: var(--surface-alt); color: var(--muted); font-size: 11.5px; font-weight: 700; }
.tag-guard { background: #f3e9d6; color: #7a5520; } .tag-cancel { background: #fde8e6; color: #a8312c; }
:root[data-theme="dark"] .tag-guard { background: #3d3020; color: #f0cd8c; }

.slot { display: grid; grid-template-columns: 84px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.slot:last-child { border-bottom: 0; }
.slot-label { color: var(--muted); font-size: 12px; font-weight: 700; padding-top: 2px; }
.slot-items { display: grid; gap: 4px; }
.slot-item { font-size: 13px; }
.accueil-grid { display: grid; gap: 8px; }
.acc-site { display: grid; grid-template-columns: minmax(120px, .8fr) 1fr 1fr; gap: 8px; align-items: stretch; }
.acc-site > b { align-self: center; font-size: 13px; }
.acc-cell { padding: 6px 9px; border-radius: 9px; background: var(--surface-alt); }
.acc-cell span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.acc-cell.is-empty { border: 1px dashed var(--warn); background: transparent; }
.acc-cell em { color: var(--warn); font-size: 12px; font-weight: 700; font-style: normal; }
.acc-cell .agents { margin-top: 2px; }

.team-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(80px, 1.2fr) 64px; gap: 10px; align-items: center; padding: 7px 0 4px; }
.team-name { font-weight: 700; font-size: 13px; }
.team-bar { height: 8px; border-radius: 999px; background: var(--surface-alt); overflow: hidden; }
.team-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.team-count { text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.team-count b { color: var(--ink); font-size: 14px; }
.absents { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 0 8px; border-bottom: 1px solid var(--line); }
.absent-chip { padding: 2px 8px; border-radius: 6px; background: #fbf1df; color: #6f4a10; font-size: 12px; font-weight: 700; }
.absent-chip em { font-style: normal; font-weight: 400; }
:root[data-theme="dark"] .absent-chip { background: #3d3020; color: #f0cd8c; }
.loge-chip { padding: 4px 10px; border-radius: 999px; background: var(--surface-alt); color: var(--muted); font-size: 12px; }
.loge-chip b { color: var(--champagne); }

.bars { display: grid; gap: 4px; margin-bottom: 4px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 1fr) 1.3fr 34px; gap: 9px; align-items: center; padding: 3px 4px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font-size: 12.5px; text-align: left; cursor: pointer; }
.bar-row:hover { background: var(--soft); }
.bar-row i { height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--accent) var(--w), var(--surface-alt) var(--w)); }
.bar-row b { text-align: right; font-variant-numeric: tabular-nums; }

/* 5. Frise de la journée ------------------------------------------------------ */
.timeline-panel { padding-bottom: 12px; }
.timeline { --label: 108px; position: relative; overflow-x: auto; }
.tl-scale, .tl-lane, .tl-overlay { display: grid; grid-template-columns: var(--label) minmax(560px, 1fr); }
.tl-hours { position: relative; height: 18px; }
.tl-hours span { position: absolute; white-space: nowrap; transform: translateX(-50%); color: var(--muted); font-size: 11px; }
.tl-hours span:first-child { transform: none; } .tl-hours span:last-child { transform: translateX(-100%); }
.tl-lanes { position: relative; }
.tl-lane { border-top: 1px solid var(--line); }
.tl-label { padding: 8px 8px 8px 0; font-size: 12.5px; font-weight: 700; color: var(--lane); }
.tl-label small { display: block; color: var(--muted); font-weight: 400; }
.tl-maintenance-label, .tl-maintenance { --lane: var(--lane-maintenance); }
.tl-accueil-label, .tl-accueil { --lane: var(--lane-accueil); }
.tl-events-label, .tl-events { --lane: var(--lane-events); }
.tl-security-label, .tl-security { --lane: var(--lane-security); }
.tl-track { position: relative; padding: 4px 0; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / 13 - 1px), var(--line) calc(100% / 13 - 1px), var(--line) calc(100% / 13)); }
.tl-row { position: relative; height: 38px; margin: 2px 0; }
.tl-empty { display: flex; align-items: center; height: 30px; padding-left: 6px; color: var(--muted); font-size: 12px; }
.tl-bar { position: absolute; top: 0; height: 100%; display: grid; align-content: center; overflow: hidden; padding: 2px 8px; border: 0; border-left: 3px solid var(--lane); border-radius: 6px; background: color-mix(in srgb, var(--lane) 16%, var(--surface)); color: var(--ink); text-align: left; cursor: pointer; }
.tl-bar:hover { background: color-mix(in srgb, var(--lane) 28%, var(--surface)); }
.tl-bar b, .tl-bar small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tl-bar b { font-size: 12px; } .tl-bar small { color: var(--muted); font-size: 11px; }
.tl-overlay { position: absolute; inset: 0; pointer-events: none; }
.tl-overlay-track { position: relative; }
.tl-now { opacity: .8; position: absolute; top: -4px; bottom: 0; width: 2px; background: var(--accent-2); box-shadow: 0 0 0 1px #fff6; }
.tl-now::before { content: ""; position: absolute; top: -2px; left: 50%; width: 9px; height: 9px; transform: translateX(-50%); border-radius: 50%; background: var(--accent-2); }
.legend { display: flex; gap: 8px; flex-wrap: wrap; }

/* 6. Semaine ------------------------------------------------------------------- */
.week-nav { display: flex; gap: 8px; }
.week-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--card-shadow); }
.week-grid { display: grid; grid-template-columns: 112px repeat(5, minmax(150px, 1fr)) repeat(2, minmax(110px, .7fr)); min-width: 1080px; }
.wk-corner, .wk-day { position: sticky; top: 0; }
.wk-day { display: grid; gap: 1px; padding: 10px; border: 0; border-left: 1px solid var(--line); border-bottom: 2px solid var(--line); background: var(--surface-alt); color: var(--muted); text-align: left; text-transform: capitalize; font-size: 12px; cursor: pointer; }
.wk-day b { color: var(--ink); font-size: 15px; }
.wk-day:hover { background: var(--soft); }
.wk-day.is-today b { color: var(--accent); }
.wk-day.is-selected { border-bottom-color: var(--accent-2); }
.wk-day.is-weekend { background: transparent; }
.wk-corner { background: var(--surface-alt); border-bottom: 2px solid var(--line); }
.wk-label { padding: 10px; border-top: 1px solid var(--line); color: var(--heading); font-size: 12.5px; font-weight: 700; }
.wk-cell { display: grid; align-content: start; gap: 4px; padding: 6px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); min-height: 48px; }
.wk-none { color: var(--line); }
.wk-item { display: grid; gap: 1px; width: 100%; padding: 5px 7px; border: 0; border-left: 3px solid var(--lane, var(--accent)); border-radius: 6px; background: color-mix(in srgb, var(--lane, var(--accent)) 11%, var(--surface)); color: var(--ink); text-align: left; font-size: 12px; }
button.wk-item { cursor: pointer; } button.wk-item:hover { background: color-mix(in srgb, var(--lane, var(--accent)) 22%, var(--surface)); }
.wk-item small { color: var(--muted); font-size: 11.5px; }
.wk-maintenance, .wk-routine { --lane: var(--lane-maintenance); } .wk-accueil { --lane: var(--lane-accueil); }
.wk-events { --lane: var(--lane-events); } .wk-security { --lane: var(--lane-security); } .wk-absent { --lane: var(--warn); } .wk-loge { --lane: var(--champagne); }

/* 7. Équipes ------------------------------------------------------------------- */
.team-summary { display: flex; flex-wrap: wrap; gap: 18px; margin: 0 0 12px; font-size: 14px; }
.team-summary b { color: var(--accent); font-size: 18px; }
.team-group { margin-bottom: 18px; }
.team-group h3 { margin: 0 0 8px; color: var(--heading); font-size: 16px; }
.team-group h3 small { color: var(--muted); font-weight: 400; font-size: 13px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 8px; }
.person { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.person.is-absent { border-left: 3px solid var(--warn); }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--soft); color: var(--accent); font-weight: 700; font-size: 13px; }
.person-main { display: grid; gap: 2px; min-width: 0; }
.person-main small { color: var(--muted); font-size: 12px; }
.person-jobs { display: grid; gap: 2px; margin-top: 3px; }
.job { font-size: 12.5px; } .job em { color: var(--accent); font-style: normal; font-weight: 700; } .job small { color: var(--muted); }
.person-side { display: grid; justify-items: end; gap: 6px; }
.halves { display: flex; gap: 4px; }
.half { display: grid; min-width: 72px; padding: 3px 7px; border-radius: 7px; font-size: 10.5px; font-weight: 700; color: var(--muted); background: var(--surface-alt); }
.half em { font-style: normal; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 110px; }
.half.st-present { background: #e9f6ee; color: #23744a; } .half.st-absent { background: #fbf1df; color: #7a5520; } .half.st-away { background: var(--soft); color: var(--accent); }
:root[data-theme="dark"] .half.st-present { background: #1f3a2c; color: #8fe0b2; } :root[data-theme="dark"] .half.st-absent { background: #3d3020; color: #f0cd8c; }
.strip { display: flex; gap: 4px; }
.strip i { width: 11px; height: 11px; border-radius: 3px; background: var(--line); }
.strip i.dot-present { background: var(--ok); } .strip i.dot-absent { background: var(--warn); }
.strip i.is-day { outline: 2px solid var(--accent); outline-offset: 1px; }

/* 8. Tickets ------------------------------------------------------------------- */
.service-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.service-chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 13px; cursor: pointer; }
.service-chip b { margin-left: 4px; color: var(--accent); }
.service-chip.is-on { background: #68518d; border-color: #68518d; color: #fff; } .service-chip.is-on b { color: #f2e3c4; }
.tk-group { margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.tk-group h3 { margin: 0; padding: 10px 14px; background: var(--surface-alt); color: var(--heading); font-size: 14px; }
.tk-group h3 small { color: var(--muted); font-weight: 400; }
.tk-row { display: grid; grid-template-columns: 74px minmax(0, 2.4fr) minmax(110px, 1fr) 92px minmax(100px, .9fr) 150px; gap: 10px; align-items: center; width: 100%; padding: 9px 14px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer; font-size: 13px; }
.tk-row:hover { background: var(--soft); }
.tk-id { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.tk-main { display: grid; min-width: 0; } .tk-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .tk-main small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-state, .tk-tech { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-age { padding: 0; background: none !important; border: 0; color: var(--muted); font-size: 12px; text-align: right; } .tk-age.is-late { color: var(--alert); font-weight: 700; }

/* 9. Listes par date --------------------------------------------------------------- */
.date-group { margin-bottom: 12px; padding: 4px 16px 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.date-group h3 { margin: 10px 0 4px; color: var(--heading); font-size: 14px; }
.date-group h3 small { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--accent-2); color: #3d2f1a; font-size: 11px; }

/* 10. Fiche ---------------------------------------------------------------------- */
.sheet { width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px #1b14264d; }
.sheet::backdrop { background: #1b142680; }
.sheet-head { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; background: var(--header); color: #fff; }
.sheet-kind { margin: 0; color: #e8dcf6; font-size: 12px; font-weight: 700; }
.sheet-head h3 { margin: 3px 0 0; font-size: 19px; overflow-wrap: anywhere; }
.sheet-close { width: 34px; height: 34px; flex: none; border: 1px solid #ffffff60; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; }
.sheet-body { padding: 14px 20px; overflow: auto; max-height: calc(100vh - 220px); }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.facts { display: grid; grid-template-columns: 170px 1fr; gap: 0; margin: 0; }
.facts dt, .facts dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.facts dd { overflow-wrap: anywhere; }
.text { white-space: pre-line; margin: 0; color: var(--ink); }
.tk-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.tk-state-big { padding: 4px 11px; border-radius: 999px; background: var(--soft); color: var(--accent); font-weight: 700; }

/* 11. Aide ------------------------------------------------------------------------- */
.help-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; }
.help-grid .panel:last-child { grid-column: 1 / -1; }
.help-list { margin: 10px 0 0; padding-left: 18px; } .help-list li { margin-bottom: 6px; }
.sources { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 13px; }
.sources th, .sources td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.sources th { color: var(--muted); font-size: 12px; }
.version-entry { padding: 8px 0; border-bottom: 1px solid var(--line); } .version-entry p { margin: 3px 0 0; }
.version-entry.is-current b { color: var(--accent); }

:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }

/* 12. Mobile ----------------------------------------------------------------------- */
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1000px) {
  .dash-grid, .help-grid { grid-template-columns: 1fr; }
  .tk-row { grid-template-columns: 64px minmax(0, 1fr) 86px; }
  .tk-state, .tk-tech, .tk-age { display: none; }
}
@media (max-width: 700px) {
  .app-header { position: relative; }
  .theme-toggle span { display: none; }
  .top { flex-wrap: wrap; } .logo { width: 42px; height: 42px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day-label { min-width: 0; flex: 1; }
  .day-picker { width: 100%; }
  .acc-site { grid-template-columns: 1fr 1fr; } .acc-site > b { grid-column: 1 / -1; }
  .people { grid-template-columns: 1fr; }
  .person { grid-template-columns: 38px 1fr; } .person-side { grid-column: 1 / -1; justify-items: start; }
  .facts { grid-template-columns: 1fr; } .facts dt { border-bottom: 0; padding-bottom: 0; }
  .view-head { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Télétravail : ni présent sur place (vert), ni absent (jaune) — bleu. */
.kpi.is-remote { border-top-color: var(--remote); } .kpi.is-remote b { color: var(--remote); }
.remote-chip { padding: 2px 8px; border-radius: 6px; background: var(--remote-soft); color: var(--remote); font-size: 12px; font-weight: 700; }
.remote-chip em { font-style: normal; font-weight: 400; }
.half.st-away, :root[data-theme="dark"] .half.st-away { background: var(--remote-soft); color: var(--remote); }
.strip i.dot-away { background: var(--remote); }
.person.is-remote { border-left: 3px solid var(--remote); }
.wk-remote { --lane: var(--remote); }
.sum-present b { color: var(--ok); } .sum-remote b { color: var(--remote); } .sum-absent b { color: var(--warn); }
.kpis { grid-template-columns: repeat(8, minmax(0, 1fr)); }
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 700px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Nature des éléments du planning Maintenance */
.kind { display: inline-block; margin-right: 4px; padding: 1px 7px; border-radius: 5px; font-size: 11px; font-weight: 700; vertical-align: 1px; white-space: nowrap; }
.kind-chantier { background: var(--soft); color: var(--accent); }
.kind-ticket { background: #e8f1ff; color: #2b5ca8; }
.kind-verification { background: #e7f5ee; color: #23744a; }
.kind-intervention { background: #fbe9e7; color: #a33d37; }
:root[data-theme="dark"] .kind-ticket { background: #1d3550; color: #9cc6f0; }
:root[data-theme="dark"] .kind-verification { background: #1f3a2c; color: #8fe0b2; }
:root[data-theme="dark"] .kind-intervention { background: #4a2523; color: #ffaaa3; }
.wk-item .kind { justify-self: start; margin-bottom: 2px; }
.agent-chip.is-absent { background: #fbf1df; color: #7a5520; text-decoration: line-through; text-decoration-thickness: 1px; }
:root[data-theme="dark"] .agent-chip.is-absent { background: #3d3020; color: #f0cd8c; }

/* Tickets : vue globale */
/* V1.6.1 : la barre des campus reste visible dans tous les onglets */
.small { font-size: 12px; }
.tk-matrix-panel { margin-bottom: 14px; }
.tk-matrix-wrap { overflow-x: auto; }
.tk-matrix { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 13px; }
.tk-matrix th, .tk-matrix td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: center; }
.tk-matrix thead th { color: var(--muted); font-size: 12px; font-weight: 700; }
.tk-matrix tbody th { text-align: left; font-weight: 700; white-space: nowrap; }
.tk-matrix .campus-tag { margin: 0; }
.tk-matrix .tk-total th, .tk-matrix .tk-total td { border-top: 2px solid var(--line); border-bottom: 0; }
.tk-cell { position: relative; min-width: 46px; padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; background: color-mix(in srgb, var(--accent) calc(var(--a) * 34% + 6%), var(--surface)); color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; }
.tk-cell:hover, .tk-cell.is-on { border-color: var(--accent); }
.tk-cell b { font-size: 14px; }
.tk-cell i { position: absolute; top: -6px; right: -6px; min-width: 17px; padding: 0 4px; border-radius: 999px; background: var(--alert); color: #fff; font-size: 10px; font-style: normal; font-weight: 700; line-height: 17px; }
.tk-zero { color: var(--line); }
.tk-kpis { grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 1280px) { .tk-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 700px) { .tk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tk-main .campus-tag { margin-left: 8px; }

/* Pastilles GestSup : couleurs de Maintenance (états et priorités) */
.gs-pill { display: inline-flex; align-items: center; max-width: 100%; padding: 3px 9px; border-left: 3px solid #0003; border-radius: 5px; background: var(--bg); color: var(--fg); font-size: 11.5px; font-weight: 800; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-prio { border-left: 0; border-radius: 999px; }
.gs-big { padding: 4px 11px; font-size: 12.5px; }
.gs-none { color: var(--muted); }
.tk-row { border-left: 4px solid var(--state, transparent); }
.tk-row .tk-state { overflow: visible; }
.tk-row { grid-template-columns: 74px minmax(0, 2.2fr) minmax(150px, 1.1fr) 104px minmax(100px, .9fr) 150px; }
.item-end .gs-pill { max-width: 170px; }
@media (max-width: 1000px) { .tk-row { grid-template-columns: 64px minmax(0, 1fr) 96px; } .tk-prio { display: block; } }
.state-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.state-pill { display: inline-flex; align-items: center; gap: 8px; padding: 0 0 0 10px; border: 0; border-left: 3px solid #0003; border-radius: 6px; background: var(--bg); color: var(--fg); font-size: 12.5px; font-weight: 800; cursor: pointer; overflow: hidden; }
.state-pill b { padding: 5px 9px; background: #0000001f; }
.state-pill:hover { filter: brightness(1.06); }
.state-pill.is-on { outline: 3px solid var(--accent-2); outline-offset: 2px; }

/* Fiche agent */
.person[data-open] { cursor: pointer; }
.person[data-open]:hover { border-color: var(--accent); box-shadow: var(--card-shadow); }
.person-sheet { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.person-sheet > div { display: grid; } .person-sheet small { color: var(--muted); }
.avatar.big { width: 52px; height: 52px; font-size: 17px; }
.person-week { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.person-week li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.person-week li > b { display: inline-block; min-width: 92px; text-transform: capitalize; }
.facts .halves { display: inline-flex; }
.absent-chip[data-open], .remote-chip[data-open] { cursor: pointer; }
.absent-chip[data-open]:hover, .remote-chip[data-open]:hover { filter: brightness(.96); text-decoration: underline; }

/* Zoning d'entretien et coordonnées */
.zone-row { display: grid; grid-template-columns: minmax(120px, .8fr) 1.4fr; gap: 10px; align-items: start; padding: 7px 0; border-bottom: 1px solid var(--line); }
.zone-row:last-of-type { border-bottom: 0; }
.zone-name { display: grid; } .zone-name small { color: var(--muted); font-size: 12px; }
.zone-row .tag { margin-left: 4px; }
.zone-chip { display: inline-block; margin: 0 4px 4px 0; padding: 2px 8px; border-radius: 6px; background: var(--soft); color: var(--accent); font-size: 12.5px; font-weight: 700; }
.zone-chip small { color: var(--muted); font-weight: 400; }
.person-zone { margin-top: 2px; color: var(--accent); font-size: 12px; font-weight: 700; }
.person-phone { color: var(--muted); font-size: 12px; }

/* ==========================================================================
   V1.1.0 — Habillage plus chaleureux : carte du campus, « À surveiller », tuiles à pictogrammes,
   panneaux arrondis à en-tête coloré, onglets en pastilles.
   ========================================================================== */
:root { --radius: 18px; --shadow-soft: 0 1px 2px #51416f0f, 0 10px 28px #51416f12; --ok-soft: #e4f4ea; --warn-soft: #fbf0db; --alert-soft: #fde7e4; }
:root[data-theme="dark"] { --shadow-soft: 0 1px 2px #0004, 0 10px 28px #0005; --ok-soft: #1f3a2c; --warn-soft: #3d3020; --alert-soft: #4a2523; }
body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; }
main { margin-top: 18px; }

/* Onglets en pastilles */
.tabs { gap: 4px; padding-top: 6px; padding-bottom: 8px; border-top: 0; }
.tabs button { border: 0; border-radius: 999px; padding: 8px 15px; color: #eee6f8; }
.tabs button:hover { background: #ffffff1c; }
.tabs button.active { background: #fbf7ee; color: #3d2f52; border: 0; box-shadow: 0 4px 14px #1b142633; }
.tabs button.active .ico { stroke: #68518d; }

/* Carte du campus */
.hero { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; min-height: 178px; margin-bottom: 14px; padding: 26px 30px; border-radius: 24px; overflow: hidden; color: #fff;
  background: linear-gradient(120deg, color-mix(in srgb, var(--c, #68518d) 55%, #2c2140) 0%, #51416f 55%, #7c6a91 100%); box-shadow: var(--shadow-soft); }
.hero.has-photo { background: linear-gradient(90deg, #2a2038e6 0%, #3d3053b3 38%, #3d305300 75%), var(--photo) center 40% / cover no-repeat; }
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, #d8c29d55, transparent 70%); pointer-events: none; }
.hero-text { position: relative; z-index: 1; max-width: 760px; }
.hero-hello { margin: 0 0 4px; color: #f2e3c4; font-size: 14px; font-weight: 700; }
.hero h2 { margin: 0; color: #fff; font-size: clamp(22px, 2.4vw, 31px); line-height: 1.15; letter-spacing: -.01em; }
.hero-digest { margin: 10px 0 0; color: #f3eefa; font-size: 15px; line-height: 1.5; }
.hero-fresh { position: relative; z-index: 1; margin: 0; padding: 6px 12px; border-radius: 999px; background: #ffffff1f; color: #f3eefa; font-size: 12px; white-space: nowrap; backdrop-filter: blur(4px); }
#dashboardView.is-welcome .watch { display: none; }

/* À surveiller */
.watch { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.watch-item { display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px; border: 1px solid transparent; border-radius: 999px; font-size: 13.5px; font-weight: 700; cursor: pointer; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-soft); }
.watch-item[tabindex="-1"] { cursor: default; }
.watch-item i { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.watch-item.w-alert { background: var(--alert-soft); color: #a3302a; } .watch-item.w-alert i { background: #d9483f; box-shadow: 0 0 0 4px #d9483f22; }
.watch-item.w-warn { background: var(--warn-soft); color: #7a5520; } .watch-item.w-warn i { background: #e0a030; }
.watch-item.w-info { background: var(--soft); color: var(--accent); }
.watch-item.w-ok { background: var(--ok-soft); color: #23744a; } .watch-item.w-ok i { background: #3aa86b; }
:root[data-theme="dark"] .watch-item.w-alert { color: #ffaaa3; } :root[data-theme="dark"] .watch-item.w-warn { color: #f0cd8c; } :root[data-theme="dark"] .watch-item.w-ok { color: #8fe0b2; }
.watch-item:not([tabindex="-1"]):hover { filter: brightness(.97); transform: translateY(-1px); }

/* Tuiles */
.kpis { gap: 12px; }
.kpi { position: relative; gap: 4px; padding: 14px 16px 13px; border: 0; border-radius: var(--radius); box-shadow: var(--shadow-soft); --k: var(--accent); }
.kpi:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--k) 45%, transparent), var(--shadow-soft); }
.kpi-ico { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 4px; border-radius: 11px; background: color-mix(in srgb, var(--k) 14%, var(--surface)); }
.kpi-ico svg { width: 19px; height: 19px; fill: none; stroke: var(--k); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.kpi .kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.kpi b { color: var(--k); font-size: 30px; letter-spacing: -.02em; }
.kpi.k-ok { --k: var(--ok); } .kpi.k-maint { --k: var(--lane-maintenance); } .kpi.k-accueil { --k: var(--lane-accueil); } .kpi.k-events { --k: var(--lane-events); }
.kpi.k-security { --k: var(--lane-security); } .kpi.k-tickets { --k: #2b6cb0; } .kpi.is-warn { --k: var(--warn); } .kpi.is-alert { --k: var(--alert); } .kpi.is-remote { --k: var(--remote); }
.kpi.is-warn, .kpi.is-alert, .kpi.is-remote { border-top: 0; }
:root[data-theme="dark"] .kpi.k-tickets { --k: #9cc6f0; }

/* Panneaux */
.panel { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-soft); padding: 18px 20px; }
.panel-head h3 { display: flex; align-items: center; gap: 10px; font-size: 16.5px; }
.ph-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: color-mix(in srgb, var(--pc) 14%, var(--surface)); --pc: var(--accent); }
.ph-ico svg { width: 18px; height: 18px; fill: none; stroke: var(--pc); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ph-maint { --pc: var(--lane-maintenance); } .ph-accueil { --pc: var(--lane-accueil); } .ph-events { --pc: var(--lane-events); } .ph-security { --pc: var(--lane-security); }
.ph-people { --pc: var(--ok); } .ph-entretien { --pc: #2f8a8a; } .ph-tickets { --pc: #2b6cb0; } .ph-timeline { --pc: var(--champagne); }
.link-btn { padding: 5px 10px; border-radius: 999px; background: var(--soft); }
.link-btn:hover { text-decoration: none; filter: brightness(.97); }
.item { border-radius: 12px; border-bottom: 0; margin-bottom: 2px; padding: 10px 10px; }
.item:hover { background: var(--surface-alt); }
.empty-line { border: 0; border-radius: 14px; background: var(--surface-alt); padding: 16px; font-size: 13.5px; }
.empty-line::before { content: "✓"; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-weight: 800; font-size: 12px; }
.agent-chip { border-radius: 8px; padding: 3px 9px; }
.timeline-panel .tl-bar { border-radius: 9px; }
.acc-cell { border-radius: 12px; }
.team-bar { height: 10px; } .team-bar i { background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 70%, #9be3bb)); }
.toolbar { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.tk-group, .date-group, .week-scroll { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.person { border: 0; border-radius: 16px; box-shadow: var(--shadow-soft); }
.week-grid { min-width: 860px; }
@media (max-width: 700px) {
  .hero { flex-direction: column; align-items: flex-start; min-height: 0; padding: 20px; border-radius: 18px; }
  .hero-fresh { white-space: normal; }
}
@media (prefers-reduced-motion: no-preference) { .watch-item, .kpi { transition: transform .15s ease, box-shadow .15s ease, filter .15s ease; } }
.hero.c-citadelle.has-photo { background-position: 0 0, center 58%; }

/* V1.1.2 — ordre du tableau de bord : événements et entreprises d'abord, entretien en bas sur toute la largeur */
.dash-top { grid-template-columns: 1fr 1fr; align-items: start; }
.dash-top .panel { min-height: 100%; }
#dashSecurity { box-shadow: 0 0 0 2px color-mix(in srgb, var(--lane-security) 22%, transparent), var(--shadow-soft); }
#dashEvents { box-shadow: 0 0 0 2px color-mix(in srgb, var(--lane-events) 22%, transparent), var(--shadow-soft); }
.dash-wide { margin-top: 14px; }
.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 8px 14px; }
.zone-grid .zone-row { padding: 9px 12px; border: 0; border-radius: 12px; background: var(--surface-alt); }
.zone-summary { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 12px; font-size: 13.5px; color: var(--muted); }
.zone-summary b { color: var(--ink); font-size: 16px; }
.zone-summary .is-on b { color: var(--ok); } .zone-summary .is-off b { color: var(--alert); }
@media (max-width: 1000px) { .dash-top { grid-template-columns: 1fr; } }

/* V1.2.0 — Planning des événements (agenda du mois repris d'Audiovisuel, couleurs lavande) */
.ev-planning { padding: 16px 18px 18px; }
.calendar-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav h3 { min-width: 190px; margin: 0; text-align: center; color: var(--heading); font-size: 19px; }
.cal-filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.cal-filters label { display: grid; gap: 4px; color: var(--label); font-size: 12px; font-weight: 700; }
.cal-filters select, .cal-filters input { min-height: 36px; border: 1px solid var(--field-border); border-radius: 9px; padding: 6px 9px; background: var(--surface); color: var(--ink); font-weight: 400; }
.cal-filters .grow { min-width: 240px; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.calendar .weekday { padding: 9px 5px; background: var(--header); color: #fff; font-size: 11px; font-weight: 800; text-align: center; text-transform: uppercase; letter-spacing: .04em; }
.calendar .day { min-width: 0; min-height: 132px; padding: 7px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); }
.calendar .day:nth-child(7n+1) { border-left: 0; }
.calendar .day.weekend { background: var(--surface-alt); }
.calendar .day.outside { background: color-mix(in srgb, var(--surface-alt) 60%, transparent); }
.calendar .day.today { background: color-mix(in srgb, var(--accent-2) 16%, var(--surface)); box-shadow: inset 0 0 0 2px var(--accent-2); }
.calendar .day.selected .day-number { outline: 2px solid var(--accent); outline-offset: 1px; }
.calendar .day-number { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: var(--ink); font-size: 12px; font-weight: 800; }
.calendar .today .day-number { background: var(--accent); color: #fff; }
.calendar-item { --campus: var(--accent); display: block; width: 100%; margin-top: 4px; padding: 6px 7px 6px 9px; border: 1px solid var(--line); border-left: 5px solid var(--campus); border-radius: 7px; background: var(--surface); color: var(--ink); font-size: 10.5px; line-height: 1.25; text-align: left; cursor: pointer; box-shadow: 0 2px 6px #51416f14; }
.calendar-item:hover, .calendar-item:focus-visible { background: var(--soft); outline: 2px solid var(--accent-2); outline-offset: 1px; }
.calendar-item.campus-cathedrale { --campus: var(--cathedrale); } .calendar-item.campus-citadelle { --campus: var(--citadelle); } .calendar-item.campus-saint-charles { --campus: var(--saint-charles); }
.calendar-item.campus-saint-leu { --campus: var(--saint-leu); } .calendar-item.campus-teinturerie { --campus: var(--teinturerie); }
.agenda-line { display: block; padding: 1px 0; overflow-wrap: anywhere; }
.agenda-meta { color: var(--muted); font-size: 9.5px; font-weight: 700; }
.agenda-place { color: var(--accent); font-weight: 700; }
.agenda-subject { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-requester { color: var(--muted); }
.agenda-guard { color: #7a5520; font-weight: 800; }
.agenda-cancelled-tag { color: #b91c1c; font-weight: 900; text-transform: uppercase; }
.calendar-item.is-cancelled { border-style: dashed; border-left-style: solid; opacity: .75; }
.calendar-item.is-cancelled .agenda-subject { text-decoration: line-through; }
button.ev-ticket { border: 0; cursor: pointer; font: inherit; }
@media (max-width: 900px) { .calendar .day { min-height: 92px; padding: 4px; } .calendar-item { font-size: 9px; } .calendar .weekday { font-size: 9px; } }
.hero.c-saint-charles.has-photo { background-position: 0 0, center 62%; }

/* V1.3.0 — Bouton et fenêtre « Sur mon téléphone » (repris d'Audiovisuel) */
.phone-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.phone-dialog { width: min(460px, calc(100vw - 24px)); padding: 0; border: 0; border-radius: 20px; overflow: hidden; background: var(--surface); color: var(--ink); box-shadow: 0 34px 90px #1b142666; }
.phone-dialog::backdrop { background: #1b142699; backdrop-filter: blur(3px); }
.phone-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; background: var(--header); color: #fff; }
.phone-kind { margin: 0 0 3px; color: #e8dcf6; font-size: 13px; font-weight: 700; }
.phone-head h3 { margin: 0; color: #fff; font-size: 20px; line-height: 1.2; }
.phone-close { flex: none; width: 36px; height: 36px; border: 1px solid #ffffff60; border-radius: 50%; background: transparent !important; color: #fff !important; cursor: pointer; }
.phone-body { display: grid; justify-items: center; gap: 16px; padding: 22px 20px; }
.phone-body img { width: 240px; height: 240px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.phone-steps { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.55; }
.phone-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-alt); }
.phone-status { color: var(--ok); font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }

/* V1.3.0 — Téléphone : en-tête plus compact, planning du mois en liste de jours, carte du campus plus lisible */
.calendar .cal-day-label { display: none; }
@media (max-width: 700px) {
  .top { padding: 10px 12px 6px; }
  .phone-btn span, .theme-toggle span { display: none; }
  .phone-btn, .theme-toggle { width: 38px; padding: 0; justify-content: center; }
  .campus-picker { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; padding-bottom: 2px; }
  .campus-btn { flex: none; padding: 6px 11px; }
  .tabs { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .hero.has-photo { background: linear-gradient(180deg, #2a2038d9 0%, #3d3053cc 100%), var(--photo) center / cover no-repeat; }
  .hero h2 { font-size: 22px; }
  .hero-digest { font-size: 14px; }
  .watch-item { font-size: 12.5px; padding: 8px 12px; }
  /* Planning du mois → liste des jours qui ont des événements */
  .calendar { display: block; border: 0; background: transparent; }
  .calendar .weekday, .calendar .day.outside, .calendar .day:not(:has(.calendar-item)) { display: none; }
  .calendar .day { display: block; min-height: 0; margin-bottom: 10px; padding: 10px 12px; border: 0; border-radius: 14px; box-shadow: var(--shadow-soft); }
  .calendar .day-number { display: none; }
  .calendar .cal-day-label { display: block; margin-bottom: 4px; color: var(--heading); font-size: 14px; font-weight: 800; text-transform: capitalize; }
  .calendar-item { font-size: 12.5px; padding: 8px 10px 8px 12px; }
  .agenda-meta { font-size: 11.5px; }
  .cal-nav { width: 100%; flex-wrap: wrap; } .cal-nav h3 { min-width: 0; flex: 1; font-size: 17px; }
  .cal-filters, .cal-filters .grow { width: 100%; min-width: 0; } .cal-filters .grow { flex: 1; }
  .sheet, .event-dialog, .ticket-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
}

/* V1.4.0 — Main courante (couleurs des statuts reprises de Sécurité) */
.mc-toolbar { align-items: center; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-alt); }
.seg button { border: 0; border-radius: 999px; padding: 7px 14px; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.seg button.is-on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-soft); }
.mc-nav { display: flex; align-items: center; gap: 6px; } .mc-nav strong { min-width: 220px; text-align: center; color: var(--heading); }
.mc-nav.is-all button { display: none; }
.mc-summary { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.mc-summary b { color: var(--ink); font-size: 18px; } .mc-summary .mc-open b { color: #c27803; } .mc-summary .mc-progress b { color: #2878d4; }
.mc-row { display: grid; grid-template-columns: 54px 92px minmax(0, 1fr); gap: 12px; align-items: start; width: 100%; padding: 11px 10px; border: 0; border-left: 4px solid var(--st); border-radius: 12px; margin-bottom: 6px; background: var(--surface-alt); color: var(--ink); text-align: left; cursor: pointer; --st: #f59e0b; }
.mc-row:hover { filter: brightness(.98); box-shadow: var(--shadow-soft); }
.mc-row.mc-progress { --st: #2878d4; } .mc-row.mc-closed { --st: #16a34a; }
.mc-time { color: var(--accent); font-weight: 800; font-variant-numeric: tabular-nums; }
.mc-state { justify-self: start; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--st, #f59e0b) 16%, var(--surface)); color: var(--st, #b26b00); font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.mc-state.mc-open { --st: #c27803; } .mc-state.mc-progress { --st: #2878d4; } .mc-state.mc-closed { --st: #16a34a; }
.mc-row.mc-open .mc-state { --st: #c27803; }
.mc-main { display: grid; gap: 3px; min-width: 0; } .mc-main b { font-size: 14px; } .mc-main small { color: var(--muted); font-size: 12.5px; }
.mc-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.mc-prio.p-urgente { color: var(--alert); } .mc-prio.p-haute { color: #d97706; }
.mc-cr { color: var(--ink); font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mc-day { padding-bottom: 10px; } .mc-day h3 small { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--soft); color: var(--accent); font-size: 11px; }
@media (max-width: 700px) { .mc-row { grid-template-columns: 48px minmax(0, 1fr); } .mc-row .mc-state { grid-column: 2; grid-row: 1; justify-self: end; } .mc-main { grid-column: 1 / -1; } .mc-nav { width: 100%; flex-wrap: wrap; } .mc-nav strong { min-width: 0; flex: 1; } }

/* V1.4.1 — Tickets à surveiller en pleine largeur */
#dashboardView.is-welcome .dash-tickets { display: none; }
.tk-wide { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px 22px; align-items: start; }
.tk-col > h4:first-child { margin-top: 0; }
.tk-col .item-end .gs-pill { overflow: hidden; text-overflow: ellipsis; }

/* V1.5.0 — Logistique : tickets avec une date d'intervention prévue */
:root { --lane-logistique: #2f7a55; }
:root[data-theme="dark"] { --lane-logistique: #86d0a6; }
.ph-logistique { --pc: var(--lane-logistique); }
.wk-logistique { --lane: var(--lane-logistique); }
.lg-date { display: grid; justify-items: center; align-content: start; min-width: 44px; padding: 4px 6px; border-radius: 8px; background: color-mix(in srgb, var(--lane-logistique) 14%, transparent); color: var(--lane-logistique); font-size: 11px; line-height: 1.1; text-transform: lowercase; }
.lg-date b { font-size: 18px; }
.lg-ticket.is-late .lg-date { background: color-mix(in srgb, var(--alert) 14%, transparent); color: var(--alert); }
.due-tag { display: inline-block; width: fit-content; margin: 3px 0 2px; padding: 2px 9px; border-radius: 6px; background: color-mix(in srgb, var(--lane-logistique) 15%, transparent); color: var(--lane-logistique); font-size: 12px; font-weight: 800; }
.due-tag.is-today { background: var(--lane-logistique); color: #fff; }
.due-tag.is-late { background: color-mix(in srgb, var(--alert) 14%, transparent); color: var(--alert); }
:root[data-theme="dark"] .due-tag.is-today { color: #10241a; }
.tk-main .due-tag { display: block; }
/* V1.5.1 — Logistique en pleine largeur */
#dashboardView.is-welcome .dash-logistique { display: none; }
.lg-extra > h4:first-child { margin-top: 0; }

/* V1.6.1 — Campus et jour sur la ligne du logo, à gauche des boutons (écran large) ; sinon une ligne dessous */
.top { flex-wrap: wrap; row-gap: 8px; }
.top .campus-bar { order: 3; flex: 1 0 100%; min-width: 0; padding: 2px 0 2px; }
.campus-btn { padding: 5px 12px; }
@media (min-width: 1700px) {
  .top .campus-bar { order: 0; flex: 0 1 auto; flex-wrap: nowrap; margin-left: auto; padding: 0; gap: 12px; }
  .top .campus-picker { flex-wrap: nowrap; }
  .top .day-label { min-width: 180px; }
}
@media (min-width: 1700px) and (max-width: 2099px) {
  .top .phone-btn span, .top .theme-toggle span { display: none; }
  .top .phone-btn, .top .theme-toggle { width: 36px; padding: 0; justify-content: center; }
}

/* V1.8.0 — Visites d'entreprises et main courante en planning du mois (mêmes cases que les événements) */
.calendar-item.mc-cal .mc-state { display: inline-block; margin-right: 3px; padding: 0 6px; font-size: 9.5px; }
.calendar-item.mc-open { --st: #c27803; } .calendar-item.mc-progress { --st: #2878d4; } .calendar-item.mc-closed { --st: #16a34a; }
.calendar-item.mc-closed, .calendar-item.is-closed { opacity: .72; }
#mcView .mc-summary { margin: 0 0 10px; }
@media (max-width: 700px) { .calendar-item.mc-cal .mc-state { font-size: 11px; } }
@media (max-width: 700px) {
  .cal-filters label { flex: 1 1 140px; min-width: 0; }
  .cal-filters label.grow { flex: 1 1 100%; }
  .cal-filters select, .cal-filters input { width: 100%; min-width: 0; }
}

/* V1.8.1 — Semaine : liseré = campus, fond = type */
.wk-item { background: color-mix(in srgb, var(--lane, var(--accent)) 17%, var(--surface)); }
button.wk-item:hover { background: color-mix(in srgb, var(--lane, var(--accent)) 28%, var(--surface)); }
.wk-item.has-campus { border-left: 5px solid var(--c); }
.wk-item:not(.has-campus) { border-left: 5px solid color-mix(in srgb, var(--lane, var(--accent)) 45%, var(--line)); }
.week-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.week-legend .wl-title { font-weight: 800; color: var(--label); }
.week-legend .wl-campus { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); }
.week-legend .wl-campus::before { content: ""; width: 5px; height: 16px; border-radius: 2px; background: var(--c); }
.week-legend .wl-type { padding: 2px 9px; border-radius: 6px; background: color-mix(in srgb, var(--lane) 17%, var(--surface)); color: var(--ink); font-weight: 700; }
.week-legend .wl-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line); }

/* V1.8.2 — Frise de la journée : ligne Logistique */
.tl-logistique-label, .tl-logistique { --lane: var(--lane-logistique); }

/* V2.0.2 — Entretien : m² cochés par agent sous chaque zone */
.zone-agent-m2 { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.zone-agent-m2 b { color: var(--heading); font-weight: 800; }

/* V2.0.3 — créneaux fixes cliquables */
button.wk-item.wk-routine { width: 100%; text-align: left; cursor: pointer; }
.wk-item .wk-more { margin-top: 2px; color: var(--accent); font-weight: 800; }
.slot-label.slot-open { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }

/* V2.1.0 — horaires des agents (Équipes, fiche agent) */
.person-hours { margin-top: 3px; color: var(--heading); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hours-week { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 13px; }
.hours-week th, .hours-week td { padding: 6px 10px; text-align: left; }
.hours-week thead th { color: var(--label); font-size: 11.5px; font-weight: 800; }
.hours-week tbody th { color: var(--heading); font-weight: 800; text-transform: capitalize; white-space: nowrap; }
.hours-week tbody td { background: var(--soft); font-variant-numeric: tabular-nums; font-weight: 700; }
.hours-week tbody td:last-child { border-radius: 0 8px 8px 0; }
.hours-week tbody tr > :first-child { border-radius: 8px 0 0 8px; background: var(--soft); }
.hours-week tr.is-day > * { background: color-mix(in srgb, var(--champagne) 22%, var(--surface)) !important; }
.hours-week .hw-off { color: var(--muted); font-weight: 600; }
.hours-week em { display: block; font-size: 11px; font-style: normal; font-weight: 800; }
.hours-week .hw-abs { color: var(--alert); } .hours-week .hw-away { color: #2f6fb0; }

/* ==========================================================================
   V2.4.0 — Tableau de bord de la journée : trois parties rangées, cartes de même hauteur par rangée.
   ========================================================================== */
.dash-section { margin-top: 22px; }
.dash-section-title { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; color: var(--muted); font-size: 13px; font-weight: 800; letter-spacing: .02em; }
.dash-section-title::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }
.dash-row { display: grid; gap: 14px; align-items: stretch; }
.dash-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-card { display: flex; flex-direction: column; min-width: 0; margin: 0; }
.dash-card > .panel-body { flex: 1 1 auto; min-height: 0; }
/* Les listes longues défilent dans leur carte : les rangées restent alignées. */
.dash-row .dash-card > .panel-body { max-height: 430px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.dash-section > .dash-card { margin-top: 14px; }
.dash-card .panel-body h4 { margin: 14px 0 6px; }
.dash-card .panel-body h4:first-child { margin-top: 2px; }
.h4-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--soft); color: var(--ink); font-size: 11px; }
.ph-mc { --pc: #b5524e; }
#dashboardView.is-welcome .dash-section { display: none; }
/* Accueil dans une carte d'un tiers : site au-dessus, matin et après-midi côte à côte. */
.dash-card .acc-site { grid-template-columns: 1fr 1fr; }
.dash-card .acc-site > b { grid-column: 1 / -1; }
@media (max-width: 1280px) { .dash-row-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-row-3 > .dash-card:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (max-width: 900px) { .dash-row-3, .dash-row-2 { grid-template-columns: 1fr; } .dash-row-3 > .dash-card:last-child:nth-child(odd) { grid-column: auto; } .dash-row .dash-card > .panel-body { max-height: none; } }
/* Mêmes cartes partout : plus de liseré coloré réservé aux événements et aux entreprises. */
#dashEvents.dash-card, #dashSecurity.dash-card { box-shadow: var(--shadow-soft); }
.dash-row-2 .dash-card > .panel-body { max-height: 560px; }

/* V2.4.1 — Tickets : heure du dernier import GestSup et bouton « Nouveau ticket » */
.tk-head-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.tk-import { display: inline-block; line-height: 1.4; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12.5px; }
.tk-import b { color: var(--ink); font-weight: 800; }
.tk-import i { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--muted); vertical-align: 1px; }
.tk-import.is-ok i { background: var(--ok); }
.tk-import.is-late { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); color: var(--warn); }
.tk-import.is-late i { background: var(--warn); }
#tkNewTicket { text-decoration: none; }
@media (max-width: 760px) { .tk-head-actions { justify-content: flex-start; width: 100%; } .tk-import { border-radius: 12px; } }

/* V2.4.2 — « Tous » : bandeau panoramique des campus, cadré sur le milieu de l'image. */
.hero.c-all.has-photo { background-position: 0 0, center 45%; }

/* V2.5.0 — Plusieurs campus : bouton « ＋ Plusieurs » (les clics cumulent les campus) */
.campus-btn.campus-multi { border-style: dashed; font-weight: 700; }
.campus-btn.campus-multi.is-on { border-style: solid; background: #ffffff26; border-color: #fbf7ee; }

/* V2.7.0 — Âge des sources : indicateur cliquable en haut, tableau avec pastille d'état */
button.sync { border: 1px solid transparent; border-radius: 999px; padding: 5px 10px; background: transparent; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; color: #fff; }
button.sync:hover, button.sync:focus-visible { border-color: #ffffff60; background: #ffffff18; }
.sync.is-warn .dot { background: #f5b94a; box-shadow: 0 0 10px #f5b94a; }
.sync.is-warn span { color: #ffe1a8; }
.src-table td small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; }
.src-table td:first-child { white-space: nowrap; }
.src-dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: var(--ok); vertical-align: 1px; }
.src-late .src-dot { background: var(--warn); } .src-missing .src-dot { background: var(--alert); }
.src-late td:last-child b { color: var(--warn); } .src-missing td:last-child b { color: var(--alert); } .src-ok td:last-child b { color: var(--ok); }
@media (max-width: 760px) { .src-table td:first-child { white-space: normal; } .src-table th:nth-child(2), .src-table td:nth-child(2) { display: none; } }
@media (min-width: 761px) { .src-table td:nth-child(3) { white-space: nowrap; } }

/* V2.7.1 — Listes déroulantes lisibles : sous Windows, la liste ouverte prenait un fond sombre avec un texte sombre.
   Les choix ont maintenant les couleurs du thème (clair ou sombre), comme le champ. */
select { color-scheme: inherit; }
select option, select optgroup { background-color: var(--surface); color: var(--ink); }
select option:checked { background-color: var(--soft); color: var(--ink); }
select option:disabled { color: var(--muted); }

/* V2.8.0 — Sécurité ouvert ou fermé (à côté des boutons de saisie, Visites entreprises et Main courante) */
.saisie-head-actions { align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.secu-poll { display: inline-block; max-width: 460px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12.5px; font-weight: 700; line-height: 1.35; }
.secu-poll i { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--muted); vertical-align: 1px; }
.secu-poll.is-open { color: var(--ok); } .secu-poll.is-open i { background: var(--ok); }
.secu-poll.is-closed { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); color: var(--warn); } .secu-poll.is-closed i { background: var(--warn); }
.secu-poll.is-never i { background: var(--alert); }
@media (max-width: 760px) { .secu-poll { border-radius: 12px; max-width: none; } }
