/*
 * CT App — conçu par DF Consult.
 * Habillage « atelier » : fond béton, cartes nettes, barre à la couleur du garage,
 * titres et chiffres en Barlow (la police des panneaux et des plaques), texte en Inter.
 * Pensé d'abord pour le GSM ; barre latérale sur ordinateur.
 * Polices hébergées chez nous (licences dans /fonts/LICENCES.txt).
 */
@font-face { font-family: Inter; font-weight: 300 400; font-display: swap; src: url(/fonts/inter-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-weight: 500 800; font-display: swap; src: url(/fonts/inter-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-weight: 300 400; font-display: swap; src: url(/fonts/inter-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Inter; font-weight: 500 800; font-display: swap; src: url(/fonts/inter-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Barlow; font-weight: 300 500; font-display: swap; src: url(/fonts/barlow-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Barlow; font-weight: 600 900; font-display: swap; src: url(/fonts/barlow-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Couleurs. Sans réglage du garage : barre noire et or (CT Custom). Le garage remplace --top et l'accent dans Garage > Apparence. */
:root {
  --bg: #eceef0; --card: #ffffff; --field: #ffffff; --ink: #14171a; --muted: #5b6470; --line: #d5d9de;
  --gold: #8a6a12; --gold-ink: #6b520c; --gold-soft: #f8edc4; --accent: #f5d252;
  --top: #101214; --top-ink: #f2f3f4;
  --ok: #1f6b3a; --ok-soft: #dff1e5; --err: #a32d2d; --err-soft: #f9e3e0;
  --r: 14px; --r-ctl: 10px; --chart: #aa8800;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: Barlow, Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --side: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1113; --card: #181b1e; --field: #101214; --ink: #e9ecef; --muted: #98a1ab; --line: #2b3036;
    --gold: #f5d252; --gold-ink: #f5d252; --gold-soft: #2e2810;
    --ok: #8fd6a5; --ok-soft: #14271b; --err: #f09a9a; --err-soft: #3a1d1d; --chart: #b18f00;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); min-height: 100vh; min-height: 100dvh; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; letter-spacing: .005em; }
h1 { font-size: 1.75rem; margin: 0 0 .4rem; }
h2 { font-size: 1.2rem; margin: 1.25rem 0 .5rem; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.muted { color: var(--muted); margin-top: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
svg { flex: none; }
.side svg, .top svg, .bottomnav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Ossature ---------- */
.side { display: none; }
.page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 20px 16px 108px; flex: 1; display: flex; flex-direction: column; }
.wrap > * { min-width: 0; max-width: 100%; }   /* une grille large ne pousse jamais la page hors de l'écran */
.wrap > .foot { margin-top: auto; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; min-width: 0; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { flex: none; border-radius: 9px; display: block; }
.logo.glogo { object-fit: contain; background: transparent; border-radius: 0; }

/* GSM : barre du haut (reste colorée sous l'heure et la batterie) et menu du bas */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .75rem;
  background: var(--top); color: var(--top-ink); padding: calc(env(safe-area-inset-top) + .55rem) 16px .55rem;
}
.logout { margin-left: auto; }
.logout button, .side-foot button { background: none; border: 0; color: inherit; opacity: .7; padding: .45rem; cursor: pointer; border-radius: 8px; display: grid; }
.logout button:hover, .side-foot button:hover { opacity: 1; background: color-mix(in srgb, currentColor 14%, transparent); }
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex;
  background: var(--card); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0;
  padding: .4rem 0 .3rem; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 500; border-radius: 12px;
}
.bottomnav a.on { color: var(--ink); background: var(--gold-soft); font-weight: 700; }
.foot { text-align: center; color: var(--muted); font-size: .75rem; padding: 28px 0 0; }
.credit { font-size: .72rem; opacity: .6; margin: 0; }

/* Ordinateur : barre latérale à la couleur du garage */
@media (min-width: 900px) {
  .is-app .side {
    position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 20; display: flex; flex-direction: column; gap: 1.25rem;
    background: var(--top); color: var(--top-ink); padding: 22px 14px 16px; overflow-y: auto;
  }
  .is-app .page { margin-left: var(--side); }
  .is-app .top, .is-app .bottomnav { display: none; }
  .is-app .wrap { padding: 32px 32px 28px; }
  .side .brand { padding: 0 8px; font-size: 1.15rem; }
  .sidenav { display: grid; gap: 2px; }
  .sidenav a {
    display: flex; align-items: center; gap: .75rem; padding: .62rem .75rem; border-radius: 10px; text-decoration: none;
    color: inherit; opacity: .72; font-weight: 500;
  }
  .sidenav a:hover { opacity: 1; background: color-mix(in srgb, currentColor 10%, transparent); }
  .sidenav a.on { opacity: 1; background: var(--accent); color: var(--on-accent, #14171a); font-weight: 700; }
  .side-foot { margin-top: auto; display: flex; align-items: center; gap: .25rem; border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent); padding-top: 12px; }
  .side-foot .me { flex: 1; min-width: 0; display: flex; align-items: center; gap: .6rem; text-decoration: none; padding: .3rem; border-radius: 10px; }
  .side-foot .me:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
  .side-foot .me span:last-child { display: grid; min-width: 0; line-height: 1.25; }
  .side-foot .me b, .side-foot .me small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-foot .me small { opacity: .7; }
  .side-foot .ini { width: 34px; height: 34px; background: color-mix(in srgb, currentColor 16%, transparent); color: inherit; }
  .side .credit { padding: 0 8px; }
  .is-app .foot { display: none; }
}

/* ---------- Pas connecté : présentation à gauche, formulaire à droite ---------- */
.intro { background: var(--top); color: var(--top-ink); padding: calc(env(safe-area-inset-top) + 22px) 20px 18px; }
.intro img { border-radius: 14px; display: block; width: 48px; height: 48px; }
.intro-in { display: grid; grid-template-columns: auto 1fr; gap: 0 .9rem; align-items: center; }
.intro-name { font: 700 1.5rem/1.1 var(--font-head); margin: 0; }
.intro-what, .intro ul, .intro .credit { display: none; }
.is-guest .wrap { padding-bottom: 28px; max-width: 520px; }
.is-guest .narrow { margin-top: 1.25rem; }
@media (min-width: 900px) {
  .is-guest .page { display: grid; grid-template-columns: minmax(340px, 5fr) 7fr; }
  .intro { padding: 56px 48px 32px; display: flex; flex-direction: column; min-height: 100vh; }
  .intro-in { display: block; margin: auto 0; max-width: 420px; }
  .intro img { width: 64px; height: 64px; }
  .intro-name { font-size: 3rem; margin: 1.25rem 0 .5rem; }
  .intro-what { display: block; font-size: 1.2rem; line-height: 1.45; margin: 0 0 1.75rem; opacity: .9; }
  .intro ul { display: grid; gap: .7rem; list-style: none; margin: 0; padding: 0; }
  .intro li { padding-left: 1.1rem; border-left: 3px solid var(--accent); opacity: .85; }
  .intro .credit { display: block; }
  .is-guest .wrap { justify-content: center; padding: 40px; }
  .is-guest .wrap > .foot { margin-top: 0; }
  .is-guest .narrow { margin: 0 auto; width: 100%; }
}

/* ---------- Cartes, formulaires, boutons ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.narrow { max-width: 460px; margin: 4vh auto 0; }
.form { display: grid; gap: .9rem; margin-top: 1rem; }
.form label { display: grid; gap: .3rem; font-weight: 600; font-size: .92rem; }
.opt { font-weight: 400; color: var(--muted); font-size: .82rem; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--field);
  border: 1px solid var(--line); border-radius: var(--r-ctl); padding: .7rem .85rem; min-height: 48px;
  transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent); }
input[type=file] { min-height: auto; padding: .6rem; }
input[type=checkbox], input[type=radio] { min-height: 0; padding: 0; box-shadow: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: var(--r-ctl); padding: .7rem 1.1rem; min-height: 48px; transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--top); color: var(--top-ink); border-color: var(--top); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #14171a); }
@media (prefers-color-scheme: dark) { .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #14171a); } }
.btn.small { min-height: 36px; padding: .35rem .75rem; font-size: .85rem; }

.flash { border-radius: var(--r-ctl); padding: .75rem 1rem; margin-bottom: 1rem; background: var(--ok-soft); color: var(--ok); font-weight: 500; border-left: 4px solid currentColor; }
.flash.err { background: var(--err-soft); color: var(--err); }

/* ---------- Accueil (techniciens, magasiniers) ---------- */
.hello { margin-bottom: 1.25rem; }
.tiles { display: grid; gap: 12px; grid-template-columns: 1fr; }
.tile { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.tile h2 { margin: 0 0 .25rem; }
.tile p { margin: 0; color: var(--muted); font-size: .92rem; }
.tile.soon { background: transparent; border-style: dashed; }
a.tile.go { display: block; text-decoration: none; color: inherit; border-left: 5px solid var(--accent); transition: border-color .12s; }
a.tile.go:hover, a.tile.go:focus-visible { border-color: var(--ink); border-left-color: var(--accent); }
.tile .arrow { display: none; }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; background: var(--gold-soft); color: var(--gold-ink); white-space: nowrap; }
.tile .badge { position: absolute; top: 16px; right: 16px; }

/* ---------- Équipe, profil ---------- */
.cols { display: grid; gap: 16px; }
.people { list-style: none; margin: 1rem 0 0; padding: 0; }
.people li { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.people li.off { opacity: .5; }
.ini { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-ink); font-weight: 700; flex: none; font-family: var(--font-head); }
.who { flex: 1; min-width: 140px; display: grid; }
.who small { color: var(--muted); overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 1rem 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
@media (min-width: 760px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .cols { grid-template-columns: 3fr 2fr; align-items: start; }
}
@media (min-width: 1280px) { .tiles { grid-template-columns: repeat(4, 1fr); } }

.small { font-size: .88rem; margin: 1rem 0 0; }
.small a, .card a:not(.btn) { color: var(--gold-ink); }
.qr { display: grid; place-items: center; background: #fff; padding: 12px; border-radius: 12px; width: max-content; margin: 1rem auto; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; overflow-wrap: anywhere; background: var(--bg); padding: .5rem .7rem; border-radius: 8px; }
.okline { color: var(--ok); font-weight: 600; }
.steps { padding-left: 1.2rem; margin: .5rem 0; }
.steps li { margin: .3rem 0; }
.devices { list-style: none; padding: 0; margin: .5rem 0 1rem; }
.devices li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-top: 1px solid var(--line); }
.devices small { color: var(--muted); }
.logo-prev { background: var(--top); border-radius: 12px; padding: 16px; display: grid; place-items: center; margin: .5rem 0 1rem; }
.logo-prev img { max-width: 220px; max-height: 120px; }
.testbar { background: #b3261e; color: #fff; text-align: center; font-size: .8rem; font-weight: 600; padding: .35rem 16px; letter-spacing: .02em; position: relative; z-index: 30; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Mon garage > Apparence : modèles, couleurs et aperçu en direct */
#apparence, #textes { margin-top: 1rem; }
.lbl { display: block; font-weight: 600; margin-bottom: .35rem; }
.theme-grid { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .theme-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.presets { display: flex; flex-wrap: wrap; gap: .5rem; }
.preset { display: flex; width: 52px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; background: none; }
.preset span { flex: 1; }
.preset span:last-child { flex: .6; }
.preset:focus-visible, .preset:hover { outline: 2px solid var(--gold); outline-offset: 2px; }
.colors { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.cpick { display: flex; align-items: center; gap: .6rem; margin-top: .25rem; }
.cpick input[type=color] { width: 64px; height: 44px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; flex: none; }
.cpick code { font-size: .9rem; color: var(--muted); }
.tprev { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #f4f5f7; color: #1b2430; }
.tp-bar { display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem; background: linear-gradient(135deg, var(--p), var(--p2)); color: var(--onp); }
.tp-bar img { width: 34px; height: 34px; object-fit: contain; }
.tp-bar b { flex: 1; font-size: 1.05rem; }
.tp-bar small { opacity: .8; }
.tp-body { padding: .9rem; display: grid; gap: .7rem; }
.tp-card { background: #fff; border: 1px solid #d5dae1; border-radius: 10px; padding: .75rem; display: grid; gap: .5rem; }
.tp-h { background: var(--p); color: var(--onp); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .35rem .6rem; border-radius: 6px; }
.tp-field { background: var(--afield); border: 1px solid #d5dae1; border-radius: 8px; padding: .55rem .65rem; }
.tp-chips { display: flex; gap: .4rem; }
.tp-chip { border: 1px solid #d5dae1; background: #fff; border-radius: 8px; padding: .35rem .7rem; font-size: .9rem; }
.tp-chip.on { background: var(--asoft); border-color: var(--a); font-weight: 700; }
.tp-total { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(135deg, var(--p), var(--p2)); color: var(--onp); border-radius: 10px; padding: .7rem .9rem; }
.tp-total b { font-size: 1.2rem; }
.tp-btns { display: flex; gap: .5rem; }
.tp-btn { flex: 1; text-align: center; padding: .7rem; border-radius: 10px; background: #3a4658; color: #fff; }
.tp-btn.pri { background: var(--a); color: var(--ona); font-weight: 700; }
.tprev > .small { margin: 0; padding: 0 .9rem .8rem; }

/* Tableau de bord du patron */
.dash { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.dash h3 { font-size: 1rem; margin: 0 0 .5rem; }
.dash h4 { font-size: .9rem; margin: 1rem 0 .35rem; color: var(--muted); }
.dash-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.dash-head h2 { margin: 0; font-size: 1.35rem; }
.mnav { display: flex; align-items: center; gap: .4rem; }
.mnav b { min-width: 8.5em; text-align: center; }
.btn.off { opacity: .35; pointer-events: none; }
.kpis { display: grid; gap: .6rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: .8rem .9rem; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.kpi.main { grid-column: 1 / -1; background: var(--top); color: var(--top-ink); border-color: var(--top); }
@media (min-width: 760px) { .kpi.main { grid-column: auto; } }
.kpi.main .k-sub, .kpi.main .k-lab, .kpi.main .dl, .kpi.main .vs { color: inherit; opacity: .85; }
.k-lab { font-size: .8rem; color: var(--muted); font-weight: 600; }
.k-val { font: 700 clamp(1.45rem, 6.2vw, 2rem)/1.1 var(--font-head); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; margin: .1rem 0; }
.kpi.main .k-val { font-size: 2.75rem; }
.kpi.main { border-left: 6px solid var(--accent); }
.k-sub { font-size: .78rem; color: var(--muted); }
.dl { font-size: .8rem; color: var(--muted); margin-top: .2rem; }
.dl.up b { color: var(--ok); } .dl.down b { color: var(--err); }
.kpi.main .dl b { color: inherit; }
.vs { color: var(--muted); }
.todo { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.todo-i { display: flex; align-items: center; gap: .7rem; background: var(--gold-soft); border: 1px solid var(--line); border-radius: 12px; padding: .65rem .8rem; text-decoration: none; }
.todo-i:hover, .todo-i:focus-visible { border-color: var(--gold); }
.todo-i small { display: block; color: var(--muted); }
.todo-i .arrow { margin-left: auto; color: var(--gold); font-weight: 700; }
.todo-i .dot { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--top); color: var(--top-ink); font-weight: 800; font-size: .85rem; }
.todo-ok { margin: 0; padding: .65rem .8rem; border-radius: 12px; background: var(--ok-soft); color: var(--ok); }
.charts { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .charts { grid-template-columns: 1fr 1fr; } }
.chart-card .small { margin-bottom: .4rem; }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart .grid.base { stroke: var(--muted); stroke-opacity: .5; }
svg.chart .tick, svg.chart .mlab { fill: var(--muted); font-size: 13px; }
svg.chart .mlab.on { fill: var(--ink); font-weight: 700; }
svg.chart .val { fill: var(--ink); font-size: 13px; font-weight: 700; }
svg.chart .mark { fill: var(--chart); transition: opacity .15s; }
svg.chart .bar.on .mark { stroke: var(--ink); stroke-width: 2; }
svg.chart .bar:hover .mark, svg.chart .bar:focus .mark { opacity: .8; }
svg.chart .hit { fill: transparent; }
@media (max-width: 600px) {   /* sur GSM le graphique est réduit de moitié : textes agrandis, un mois sur deux */
  svg.chart .tick, svg.chart .mlab { font-size: 21px; }
  svg.chart .val { font-size: 23px; }
  svg.chart .mlab.alt:not(.on) { display: none; }
}
@media (prefers-color-scheme: dark) { .kpi.main { border-color: var(--line); border-left-color: var(--accent); background: var(--card); color: var(--ink); } }
.numbers summary { cursor: pointer; font-weight: 600; }
.tscroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-size: .78rem; color: var(--muted); font-weight: 600; padding: .35rem .4rem; border-bottom: 1px solid var(--line); }
.tbl td { padding: .45rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; white-space: nowrap; }
.tbl tr.on td { background: var(--gold-soft); font-weight: 600; }
.dgrid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .dgrid { grid-template-columns: 1fr 1fr; } }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .6rem; align-items: center; }
.hb-l { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-v { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hb-t { grid-column: 1 / -1; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.hb-f { display: block; height: 100%; background: var(--chart); border-radius: 4px; }
.minis { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.minis > div { border: 1px solid var(--line); border-radius: 12px; padding: .55rem .7rem; display: flex; flex-direction: column; }
.minis span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.minis b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.minis small { font-size: .75rem; color: var(--muted); }
.tag { display: inline-block; font-size: .78rem; font-weight: 700; padding: .1rem .45rem; border-radius: 6px; }
.tag.bad { background: var(--err-soft); color: var(--err); }
.tag.warn { background: var(--gold-soft); color: var(--gold-ink); }
.quick { display: flex; flex-wrap: wrap; gap: .5rem; }
.inv-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .75rem; }
.inv-form select { width: auto; min-width: 6.5rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.inv-ways { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); margin-top: .75rem; }
@media (min-width: 760px) { .inv-ways { grid-template-columns: 1fr 1fr; } }
.inv-ways .inv-form { margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: .75rem; align-content: start; }
.inv-ways .lbl { width: 100%; }
.inv-ways input[type=file] { max-width: 100%; }
.inv-filter { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.inv-filter label { display: grid; gap: .25rem; font-weight: 600; font-size: .9rem; }
.inv-filter input[type=search] { min-width: 14rem; }
@media (min-width: 760px) { .inv-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.inv-tbl td { vertical-align: middle; }
.inv-tbl .nw { white-space: nowrap; }
.inv-tbl tr.linked { opacity: .55; }
.inv-tbl tr.refund td { background: color-mix(in srgb, var(--err-soft) 45%, transparent); }
.chk { display: flex; align-items: center; gap: .4rem; }
.chk input { width: 22px; height: 22px; accent-color: var(--gold); }
.tag.auto { background: var(--line); color: var(--muted); }
.tag.hand { background: var(--gold-soft); color: var(--gold-ink); }
.gaps { border-color: var(--gold); background: var(--gold-soft); }
.gaps p { margin: .35rem 0 0; }

/* Mise en route d'un nouveau garage */
.setup { margin-bottom: 1rem; border-left: 6px solid var(--accent); }
.setup-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.setup-head h2 { margin: 0; }
.setup-count { font: 700 1.1rem var(--font-head); color: var(--muted); white-space: nowrap; }
.setup-bar { height: 8px; border-radius: 4px; background: var(--line); margin: .75rem 0 .5rem; overflow: hidden; }
.setup-bar span { display: block; height: 100%; background: var(--accent); }
.setup-list { list-style: none; margin: 0; padding: 0; display: grid; }
.setup-list li { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.setup-list li:first-child { border-top: 0; }
.setup-list .mark { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.setup-list li.done .mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.setup-list li.done .txt b { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.setup-list .txt { flex: 1; min-width: 0; }
.setup-list .txt small { display: block; color: var(--muted); font-size: .85rem; }
@media (prefers-color-scheme: dark) { .setup-list li.done .mark { color: #0f1113; } }

/* ---------- Planning ---------- */
.plan { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.plan-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; }
.plan-head h1 { margin: 0; }
.plan-head .muted { margin: .1rem 0 0; }
.plan-nav { display: flex; flex-wrap: wrap; gap: .4rem; }
.seg-links { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 3px; width: max-content; }
.seg-links a { text-decoration: none; padding: .45rem .9rem; border-radius: 9px; font-weight: 600; color: var(--muted); }
.seg-links a.on { background: var(--top); color: var(--top-ink); }
@media (min-width: 760px) { .plan-kpis { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.plan-kpis .kpi.main { grid-column: 1 / -1; }
@media (min-width: 760px) { .plan-kpis .kpi.main { grid-column: auto; } }
.loadbar, .cell-load { display: block; height: 6px; border-radius: 3px; background: color-mix(in srgb, currentColor 18%, transparent); overflow: hidden; margin-top: .5rem; }
.loadbar span, .cell-load span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.cell-load { color: var(--muted); margin: 0 0 .4rem; height: 4px; }
.cell-load.over span { background: var(--err); }

/* Cartes de travail : bord gauche = statut */
.job { position: relative; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 10px; margin-bottom: .45rem; font-size: .86rem; line-height: 1.3; }
.job-link { display: grid; gap: 1px; padding: .45rem .55rem; text-decoration: none; color: inherit; }
.job-link:hover b { text-decoration: underline; }
.job b { font-weight: 700; overflow-wrap: anywhere; }
.job-time { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.job-time em { font-style: normal; font-weight: 700; font-size: .7rem; padding: 0 .35rem; border-radius: 4px; background: var(--gold-soft); color: var(--gold-ink); }
.job-meta { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.job-real { font-size: .78rem; font-weight: 600; color: var(--ok); }
.job-real.over { color: var(--err); }
.job-fiche { justify-self: start; font-size: .72rem; font-weight: 700; padding: 0 .35rem; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); margin-top: 2px; }
.job-go { padding: 0 .55rem .5rem; }
.job-go .btn { width: 100%; min-height: 34px; }
.job.st-encours { border-left-color: var(--accent); }
.job.st-fait { border-left-color: var(--ok); }
.job.st-fait .job-time em { background: var(--ok-soft); color: var(--ok); }
.job.st-annule { opacity: .55; border-left-style: dashed; }
.job.st-annule b { text-decoration: line-through; }
.job[draggable] { cursor: grab; }
.job.dragging { opacity: .4; }

/* Ordinateur : grille semaine */
.pgrid { display: none; }
@media (min-width: 900px) {
  .pgrid { display: grid; grid-template-columns: minmax(150px, 190px) repeat(var(--days), minmax(0, 1fr)); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
  .pg-row { display: contents; }
  .pg-lane, .pg-day, .pg-cell { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
  .pg-headrow > * { border-top: 0; }
  .pg-row > :first-child { border-left: 0; }
  .pg-day { padding: .6rem .6rem; font: 700 .95rem var(--font-head); background: var(--bg); text-transform: capitalize; }
  .pg-day.today { background: var(--accent); color: var(--on-accent, #14171a); }
  .pg-headrow .pg-lane { background: var(--bg); }
  .pg-lane { padding: .65rem .75rem; display: grid; align-content: start; gap: 2px; }
  .pg-lane b { font-family: var(--font-head); font-size: 1rem; }
  .pg-lane small { color: var(--muted); font-size: .78rem; }
  .pg-free .pg-lane, .pg-free .pg-cell { background: color-mix(in srgb, var(--bg) 60%, var(--card)); }
  .pg-cell { padding: .5rem; min-height: 96px; display: flex; flex-direction: column; }
  .pg-cell.today { background: color-mix(in srgb, var(--accent) 7%, var(--card)); }
  .pg-cell.drop { outline: 2px dashed var(--ink); outline-offset: -4px; }
  .cell-add { margin-top: auto; align-self: stretch; text-align: center; text-decoration: none; color: var(--muted); border: 1px dashed transparent; border-radius: 8px; font-size: 1.1rem; line-height: 1.6; opacity: 0; }
  .pg-cell:hover .cell-add, .cell-add:focus-visible { opacity: 1; border-color: var(--line); }
  .pday { display: none; }
}

/* GSM : un jour à la fois */
.pday-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.pday-tabs a { flex: 1 0 46px; display: grid; justify-items: center; gap: 0; padding: .45rem .2rem; border-radius: 12px; background: var(--card); border: 1px solid var(--line); text-decoration: none; position: relative; }
.pday-tabs a span { font-size: .72rem; color: var(--muted); text-transform: capitalize; }
.pday-tabs a b { font: 700 1.2rem/1.1 var(--font-head); }
.pday-tabs a small { position: absolute; top: 3px; right: 5px; font-size: .65rem; font-weight: 700; color: var(--gold-ink); }
.pday-tabs a.today { border-color: var(--ink); }
.pday-tabs a.on { background: var(--top); color: var(--top-ink); border-color: var(--top); }
.pday-tabs a.on span, .pday-tabs a.on small { color: inherit; }
.pday-title { margin: .9rem 0 .4rem; }
.pday-lane { margin-bottom: .9rem; }
.pday-who { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .35rem; }
.pday-who b { font-family: var(--font-head); font-size: 1.02rem; }
.pday-who small { color: var(--muted); font-variant-numeric: tabular-nums; }
.pday-who small.over { color: var(--err); font-weight: 700; }
.pday .job { font-size: .95rem; }
.pday-empty { margin: 0 0 .5rem; }
.pday-add { width: 100%; }

.plan-set summary { cursor: pointer; font-weight: 600; }
.plan-set-form { max-width: 420px; }
.chkline { display: flex !important; align-items: center; gap: .6rem; font-weight: 500 !important; }
.chkline input { width: 22px; height: 22px; min-height: 0; accent-color: var(--top); }

/* Formulaire d'un travail */
.plan-form-wrap { max-width: 760px; margin: 0 auto; width: 100%; }
.plan-form h1 { margin-bottom: 0; }
.plan-form fieldset { border: 0; padding: 0; margin: .25rem 0 0; display: grid; gap: .8rem; }
.plan-form legend { font: 700 1.05rem var(--font-head); padding: 0; margin-bottom: .6rem; }
.grid2, .grid3 { display: grid; gap: .8rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 620px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: 1fr 1fr 1fr; } }
.quick-hours { display: flex; flex-wrap: wrap; gap: .4rem; }
.plan-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.plan-del { margin-top: .75rem; text-align: right; }
.btn.danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, var(--line)); }
.btn.danger:hover { background: var(--err-soft); border-color: var(--err); }
.plan-notes { background: var(--bg); border-radius: 10px; padding: .75rem .9rem; margin: .5rem 0 1rem; }

/* 1.1.1 — identifiants de l'équipe (profil du patron, équipe) */
.team-card { margin-top: 16px; }
.team-card h3 { font-size: 1rem; margin: .4rem 0 .3rem; }
.people.compact li { padding: .5rem 0; }
.row-btns { margin: -.35rem 0 .1rem; }
.created { border-left: 4px solid var(--accent, #f5d252); margin-bottom: 16px; }
.created code { font-size: 1.05rem; font-weight: 600; user-select: all; }
.pw-reset { flex-basis: 100%; }
.pw-reset > summary { list-style: none; display: inline-block; cursor: pointer; }
.pw-reset > summary::-webkit-details-marker { display: none; }
.pw-reset[open] > summary { margin-bottom: .5rem; }
.pw-reset .form { max-width: 420px; }

/* 1.2 — envoi des e-mails (Admin) */
.mail-card { margin-top: 16px; }
.mail-now { padding: .6rem .8rem; background: var(--bg, #eceef0); border-radius: 8px; }
.mail-form fieldset.mode { border: 0; padding: 0; margin: 0 0 .6rem; }
.mail-form .radio { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin: .35rem 0; }
.mail-form .radio input { width: auto; margin-top: .25rem; }
.mail-test { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.mail-help { margin-top: 1rem; }
.mail-help summary { cursor: pointer; font-weight: 600; }
.mail-log { font-size: .85rem; color: var(--muted, #666); padding-left: 1.1rem; }

/* 1.2 — agenda (Outlook, Apple, Google) */
.plan-ics > summary { cursor: pointer; font-weight: 600; }
.plan-ics { margin-bottom: 16px; }
.plan-ics h3 { font-size: .95rem; margin: .8rem 0 .3rem; }
.ics-btns { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.ics-copy { display: flex; gap: .4rem; }
.ics-copy input { flex: 1; min-width: 0; font-size: .8rem; }
.ics-notes { padding-left: 1.1rem; margin: .8rem 0; }
