/* Gaz Toulois — styles repris de maquette/index.html (barre latérale marine, barre haute, zone de travail claire). */
:root {
  --navy: #0E2347; --navy-2: #16305E; --flame: #1D7FE0; --sky: #35B6F0; --orange: #F2661C; --orange-soft: #FDE7DA;
  --bg: #F3F6FB; --surface: #FFFFFF; --surface-2: #F8FAFD; --line: #E0E6F0; --ink: #13213B; --muted: #5D6A82; --faint: #97A3B8;
  --ok: #1E9A61; --ok-soft: #DDF4E9; --warn: #C98A0B; --warn-soft: #FCF0D2; --bad: #D23A3A; --bad-soft: #FBE1E1;
  --side-bg: #0E2347; --side-fg: #C9D5EA; --gt-accent: var(--flame);
  --c-entretien: #1D7FE0; --c-depannage: #F2661C; --c-chantier: #7B4FD6; --c-devis: #1E9A61; --c-absence: #8D97A8;
  --f-display: "Montserrat", system-ui, sans-serif; --f-body: "Manrope", system-ui, sans-serif; --f-mono: "JetBrains Mono", ui-monospace, monospace;
  --r: 10px; --shadow: 0 1px 2px rgba(14,35,71,.06), 0 4px 14px rgba(14,35,71,.06);
  --side-w: 236px; --top-h: 57px;
}
/* Variables des écrans Réglages (Django admin), alignées sur la charte.
   « html[data-theme] » car Django les définit aussi sous html[data-theme="light"]. */
:root, html[data-theme] {
  --primary: var(--navy-2); --secondary: var(--navy); --header-bg: var(--navy);
  --breadcrumbs-bg: transparent; --breadcrumbs-fg: var(--muted); --breadcrumbs-link-fg: var(--flame);
  --link-fg: var(--flame); --link-hover-color: var(--orange); --link-selected-fg: var(--orange);
  --button-bg: var(--navy-2); --button-hover-bg: var(--navy); --default-button-bg: var(--flame); --default-button-hover-bg: #1769bd;
  --selected-row: var(--surface-2); --object-tools-bg: var(--flame); --object-tools-hover-bg: var(--navy-2);
  --font-family-primary: var(--f-body);
  --body-bg: var(--surface); --body-fg: var(--ink); --body-quiet-color: var(--muted); --body-loud-color: var(--ink);
  --border-color: var(--line); --hairline-color: var(--line); --darkened-bg: var(--surface-2); --selected-bg: var(--surface-2);
  --close-button-bg: var(--muted); --header-color: #fff; --header-link-color: #fff; --header-branding-color: #fff;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0A1325; --surface: #111E37; --surface-2: #0E1A31; --line: #22324F; --ink: #E7EDF8; --muted: #97A5BE; --faint: #6B7A95;
  --orange-soft: #3A2214; --ok-soft: #123326; --warn-soft: #352A0E; --bad-soft: #3A1717; --side-bg: #06101F; --navy-2: #16284A; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0A1325; --surface: #111E37; --surface-2: #0E1A31; --line: #22324F; --ink: #E7EDF8; --muted: #97A5BE; --faint: #6B7A95;
  --orange-soft: #3A2214; --ok-soft: #123326; --warn-soft: #352A0E; --bad-soft: #3A1717; --side-bg: #06101F; --navy-2: #16284A; color-scheme: dark; }
* { box-sizing: border-box; }
body.gt { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--f-body); }
.gt button, .gt input, .gt select, .gt textarea { font: inherit; color: inherit; }
.gt h1, .gt h2, .gt h3 { font-family: var(--f-display); margin: 0; letter-spacing: -.01em; }
.gt a { color: var(--flame); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); font-size: 12px; }
.ic { width: 17px; height: 17px; flex: none; }

/* Barre latérale */
.side { position: fixed; z-index: 35; inset: 0 auto 0 0; width: var(--side-w); background: var(--side-bg); color: var(--side-fg);
  display: flex; flex-direction: column; font-family: var(--f-body); }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; text-decoration: none !important; }
.brand img { display: block; width: 40px; height: auto; flex: none; }
.brand-txt b { display: block; font-family: var(--f-display); font-weight: 800; color: #fff; letter-spacing: .02em; font-size: 15px; }
.brand-txt b span { background: linear-gradient(90deg, #FF8C33, #EE2A31); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-txt small { display: block; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: #8EA3C7; }
.modebadge { margin: 0 14px 10px; padding: 7px 10px; border-radius: 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700;
  background: rgba(53,182,240,.12); color: #8FD4F7; }
.nav { overflow: auto; padding: 4px 10px 14px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav .grp { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: #6F86AE; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-fg) !important;
  text-decoration: none; font-weight: 600; font-size: 13.5px; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff !important; }
.nav a.on { background: var(--navy-2); color: #fff !important; box-shadow: inset 3px 0 0 var(--gt-accent); }
.nav .ic { opacity: .9; }
.nav a .cnt { margin-left: auto; background: var(--orange); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; line-height: 18px; }
.side-foot { padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid rgba(255,255,255,.07); font-size: 12px; display: flex; gap: 10px; align-items: center; }
.side-foot .grow { flex: 1; min-width: 0; }
.side-foot form { margin: 0; }
.side-nom { color: #fff; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-role { color: #8EA3C7; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--orange), #F2A31C); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12px; flex: none; }
.side-out { background: none; border: 0; color: #8EA3C7; cursor: pointer; padding: 6px; border-radius: 8px; display: grid; }
.side-out:hover { color: #fff; background: rgba(255,255,255,.08); }

/* Barre haute */
.top { position: sticky; z-index: 30; top: 0; margin-left: var(--side-w); min-height: var(--top-h); display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line); font-family: var(--f-body); }
.burger { display: none; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 520px; display: flex; align-items: center; gap: 8px; margin: 0;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 7px 11px; color: var(--muted); }
.search:focus-within { border-color: var(--flame); box-shadow: 0 0 0 3px rgba(29,127,224,.15); }
.search input { border: 0 !important; background: transparent !important; outline: 0; flex: 1; min-width: 0; padding: 0 !important; box-shadow: none !important; height: auto !important; }
.switch { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.switch a { border: 0; background: transparent; padding: 6px 14px; border-radius: 7px; font-weight: 700; font-size: 13px; color: var(--muted) !important; display: flex; gap: 6px; align-items: center; text-decoration: none !important; }
.switch a.on[data-m="terrain"] { background: var(--flame); color: #fff !important; }
.switch svg { width: 15px; height: 15px; }
.iconbtn { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; position: relative; color: var(--ink) !important; flex: none; }
.iconbtn svg { width: 17px; height: 17px; }
.suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: 0 12px 32px rgba(14,35,71,.16); overflow: hidden; }
.suggest a { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1.4fr) auto; gap: 10px; padding: 9px 12px; color: var(--ink) !important; border-top: 1px solid var(--line); font-size: 13px; }
.suggest a:first-child { border-top: 0; }
.suggest a:hover, .suggest a.on { background: var(--surface-2); }
.suggest span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest span:last-child { font-family: var(--f-mono); font-size: 12px; }
.suggest p { margin: 0; padding: 12px; color: var(--muted); }

/* Zone de travail */
.zone { padding: 20px 20px 28px calc(var(--side-w) + 20px); }
.pagehead { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pagehead h1 { font-size: 22px; font-weight: 800; }
.pagehead p { margin: 2px 0 0; color: var(--muted); }
.pagehead .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* Briques */
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 7px 12px; font-weight: 700; font-size: 13px; cursor: pointer;
  display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; color: var(--ink) !important; text-decoration: none !important; }
.btn:hover { border-color: var(--faint); }
.btn.pri { background: var(--gt-accent); border-color: var(--gt-accent); color: #fff !important; }
.btn.pri:hover { background: #1769bd; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted) !important; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn .ic { width: 15px; height: 15px; }
.btn[aria-disabled] { opacity: .45; cursor: default; }
select.btn { padding-right: 28px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); color: var(--ink) !important; }
.card > .hd { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.card > .hd h3 { font-size: 14px; font-weight: 700; }
.card > .hd .r { margin-left: auto; display: flex; gap: 6px; }
.card > .bd { padding: 14px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.split { display: grid; grid-template-columns: minmax(300px,380px) minmax(0,1fr); gap: 14px; align-items: start; }
.kpi { padding: 14px; text-decoration: none !important; }
a.kpi:hover { border-color: var(--flame); }
.kpi small { color: var(--muted); font-weight: 600; font-size: 12px; }
.kpi .trend { font-size: 12px; font-weight: 700; }
.up { color: var(--ok); } .down { color: var(--bad); }
.kpi b { display: block; font-family: var(--f-display); font-size: 24px; font-weight: 800; margin-top: 2px; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 1px 9px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.p-warn { background: var(--warn-soft); color: var(--warn); } .p-org { background: var(--orange-soft); color: var(--orange); }
.p-ok { background: var(--ok-soft); color: var(--ok); } .p-bad { background: var(--bad-soft); color: var(--bad); }
.p-info { background: color-mix(in srgb, var(--flame) 14%, transparent); color: var(--flame); }
.p-grey { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.tbl { overflow-x: auto; }
.gt table { width: 100%; border-collapse: collapse; }
.gt th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-align: left; font-weight: 700; padding: 9px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.gt td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--surface-2); }
td .nom { font-weight: 700; color: var(--ink) !important; }
.gt td.mono { white-space: nowrap; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; text-align: left; }
.field label { font-size: 12px; font-weight: 700; color: var(--muted); }
.field input { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 9px 10px; min-width: 0; }
.field input:focus { outline: 0; border-color: var(--flame); box-shadow: 0 0 0 3px rgba(29,127,224,.15); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 9px 13px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--gt-accent); }
.tab { display: none; } .tab.on { display: block; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filtres { margin-bottom: 12px; }
.filtres .search { max-width: 380px; }
.pied { padding: 10px 14px; justify-content: space-between; }
.list { display: flex; flex-direction: column; }
.li { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .grow { flex: 1; min-width: 0; }
.empty { padding: 22px; text-align: center; color: var(--muted); }
.empty h2 { color: var(--ink); margin-bottom: 6px; }
.kv { display: grid; grid-template-columns: 130px minmax(0,1fr); gap: 6px 10px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; }
.kv dd a { color: inherit !important; }
.sect { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; color: var(--muted); margin: 18px 0 8px; }
.texte { margin: 0; }
.map { height: 200px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); z-index: 0; }
.scrim { position: fixed; inset: 0; background: rgba(6,16,31,.4); z-index: 32; display: none; }
.scrim.on { display: block; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }

/* Agenda (repris de la maquette) */
.agbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.agbar form { margin: 0; }
.agbar .date { font-family: var(--f-display); font-weight: 800; font-size: 18px; min-width: 230px; text-align: center; }
.halfday { margin-bottom: 16px; }
.halfhead { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.halfhead h3 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; color: var(--muted); }
.halfhead .line { flex: 1; height: 1px; background: var(--line); }
.cols { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.tcol { flex: 0 0 250px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.tcol.addcol { background: transparent; border: 2px dashed var(--line); box-shadow: none; align-items: center; justify-content: center; min-height: 120px; margin: 0; }
.tcol.addcol button { border: 0; background: none; color: var(--muted); font-weight: 700; cursor: pointer; width: 100%; height: 100%; }
.thead { padding: 8px 9px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.thead form { margin: 0; }
.thead select { border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px; font-weight: 700; background: var(--surface-2); width: 100%; color: var(--ink); }
.fill { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; }
.fill .bar { flex: 1; height: 6px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.fill .bar i { display: block; height: 100%; background: var(--ok); }
.fill.full .bar i { background: var(--bad); } .fill.mid .bar i { background: var(--warn); }
.slots { position: relative; padding: 6px 7px; display: flex; flex-direction: column; gap: 3px; min-height: 150px; }
.slots.survol { background: color-mix(in srgb, var(--flame) 6%, transparent); outline: 2px dashed var(--flame); outline-offset: -4px; border-radius: 8px; }
.rdv { display: block; border-radius: 7px; padding: 5px 7px 5px 9px; background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--c);
  cursor: pointer; font-size: 12px; line-height: 1.3; color: var(--ink) !important; text-decoration: none !important; }
.rdv:hover { border-color: var(--c); }
.rdv[draggable="true"] { cursor: grab; }
.rdv.glisse { opacity: .4; }
.rdv b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rdv .t { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.rdv .pr { color: var(--c); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.rdv > .ic { float: right; display: flex; gap: 3px; color: var(--faint); width: auto; height: auto; }
.rdv > .ic .ic { width: 12px; height: 12px; }
.rdv.abs { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--bg) 6px 12px); --c: var(--c-absence); cursor: default; }
.rdv.wait { border-style: dashed; border-left-style: solid; }
.rdv.fait { opacity: .6; }
.repere { height: 3px; border-radius: 3px; background: var(--flame); margin: -1px 0; }
.travel { font-size: 10.5px; color: var(--faint); text-align: center; font-weight: 600; }
.colfoot { margin-top: auto; padding: 6px 8px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.colfoot a { color: var(--flame) !important; font-weight: 700; cursor: pointer; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; gap: 5px; align-items: center; }
.dotc { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.week td { padding: 6px; vertical-align: top; min-width: 120px; }
.week th a { color: inherit !important; }
.wk { display: flex; gap: 4px; }
.wk div { flex: 1; border-radius: 6px; padding: 4px 6px; font-size: 11px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); }
.wk div.abs { background: repeating-linear-gradient(135deg, var(--surface-2) 0 5px, var(--bg) 5px 10px); }
dialog.card { padding: 0; width: min(460px, 94vw); color: var(--ink); }
dialog::backdrop { background: rgba(6,16,31,.45); }
dialog form { margin: 0; }
dialog.card .hd { display: flex; align-items: baseline; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
dialog.card .hd h3 { font-size: 15px; }
dialog.card .bd { padding: 14px 16px; }
dialog.card .pied { padding: 10px 16px 14px; }
.form-dlg { display: flex; flex-direction: column; gap: 10px; }
.form-dlg select, .form-dlg textarea { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 9px; color: var(--ink); }
.form-dlg .search { padding: 0 11px; }
.form-dlg .search input { padding: 8px 0 !important; }

/* Agenda : vue jour — colonnes empilées, 9 plannings tiennent sur 1600 px sans défilement */
.cols-g { display: grid; grid-template-columns: repeat(var(--n), minmax(130px, 1fr)); gap: 6px; align-items: start;
  overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.cols-g > .gcol { scroll-snap-align: start; }
.gcol { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.bandeau { display: flex; justify-content: space-between; padding: 4px 8px; border-radius: 7px 7px 0 0; color: #fff;
  font: 700 12px var(--f-body); font-variant-numeric: tabular-nums; background: var(--ok); }
/* règle unique de la jauge x/17 : gris = vide, vert < 12, orange 12–16, rouge = 17 */
.bandeau.vide { background: #9aa3b2; } .bandeau.mid { background: #E08A12; } .bandeau.plein { background: var(--bad); }
.fill.vide .bar i { background: #9aa3b2; } .fill.ok .bar i { background: var(--ok); } .fill.mid .bar i { background: #E08A12; }
.fill.plein .bar i { background: var(--bad); }
.fill.vide .num { color: var(--faint); }
.j-vide .num { color: var(--faint); } .j-ok .num { color: var(--ok); } .j-mid .num { color: #E08A12; } .j-plein .num { color: var(--bad); }
.wk a { flex: 1; border-radius: 6px; padding: 4px 6px; font-size: 11px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink) !important; text-decoration: none !important; }
.wk a:hover { border-color: var(--flame); background: color-mix(in srgb, var(--flame) 7%, var(--surface)); }
.wk a.abs { background: repeating-linear-gradient(135deg, var(--surface-2) 0 5px, var(--bg) 5px 10px); }
.wk a.abs .num { color: var(--muted); }
.gcol.focus { outline: 2px solid var(--flame); outline-offset: 2px; }
.gcol.cible { box-shadow: 0 0 0 6px color-mix(in srgb, var(--flame) 18%, transparent); }
.bandeau.ferme { background: #9aa3b2; }
.gtech { display: flex; align-items: center; gap: 3px; padding: 5px 4px; border-bottom: 1px solid var(--line); }
.gtech .ic { width: 15px; height: 15px; color: var(--muted); flex: none; }
.gtech form { margin: 0; flex: 1; min-width: 0; }
.gtech select { appearance: none; -webkit-appearance: none; width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px; font: 700 11px var(--f-body); letter-spacing: -.01em; cursor: pointer;
  background: var(--surface-2); color: var(--ink); text-overflow: ellipsis; }
.gliste { padding: 4px 5px; display: flex; flex-direction: column; gap: 0; min-height: 40px; }
.gliste.survol { background: color-mix(in srgb, var(--flame) 7%, transparent); outline: 2px dashed var(--flame); outline-offset: -2px; border-radius: 6px; }
.gtrajet { font: 600 10.5px var(--f-body); color: var(--faint); text-align: center; padding: 3px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcarte { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 3px; padding: 4px 4px 5px 6px; border: 1px solid var(--line); border-left: 4px solid var(--c);
  border-radius: 6px; background: var(--surface-2); font-size: 11.5px; line-height: 1.3; cursor: pointer; min-width: 0; }
.gcarte:hover { border-color: var(--c); }
.gcarte[draggable="true"] { cursor: grab; }
.gcarte > b, .gcarte > i, .gcarte > .gville { grid-column: 1; }
.gcarte b { font-weight: 800; font-size: 11.5px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcarte i { color: var(--c); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcarte .gville { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcarte .demo { font-size: 9px; font-weight: 800; color: var(--orange); border: 1px solid var(--orange); border-radius: 4px; padding: 0 3px; vertical-align: 1px; }
.gicones { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column; gap: 3px; color: var(--faint); padding-top: 1px; }
.gicones .ic { width: 12px; height: 12px; }
.gicones .poignee { cursor: grab; }
.gcarte.wait { border-style: dashed; border-left-style: solid; }
.gcarte.fait { opacity: .6; }
.gcarte.abs { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--bg) 6px 12px); --c: var(--c-absence); cursor: default; min-height: 120px; }
.gcarte.glisse { opacity: .4; }
.gcarte.sel { outline: 2px solid var(--flame); outline-offset: 1px; z-index: 3; }
.gcarte .actions { display: none; grid-column: 1 / -1; gap: 3px; margin-top: 5px; padding-top: 5px; border-top: 1px dashed var(--line); }
.gcarte.sel .actions { display: flex; }
.gcarte .actions a, .gcarte .actions button { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink) !important; cursor: pointer; padding: 0; }
.gcarte .actions button { color: var(--bad) !important; }
.gcarte .actions button:hover { background: var(--bad-soft); border-color: var(--bad); }
.gcarte .actions .ic { width: 14px; height: 14px; }
.gcarte .actions button[data-monter], .gcarte .actions button[data-descendre] { color: var(--ink) !important; font-weight: 800; font-size: 13px; }
.gcarte .actions button[data-vers] { color: var(--flame) !important; }
.gcarte .actions { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
#deplacer-vers { width: 100%; margin: 4px 0; padding: 6px; border: 2px solid var(--flame); border-radius: 7px; font: 700 12px var(--f-body);
  background: var(--surface); color: var(--ink); }
/* Écrans tactiles (iPad) : cibles plus grandes, pas d'action cachée derrière un survol */
@media (pointer: coarse) {
  .btn.sm { min-height: 34px; padding: 6px 11px; }
  .gtech select { min-height: 30px; }
  .gajout { padding: 10px 6px; }
  .gcarte .actions a, .gcarte .actions button { width: 32px; height: 32px; }
  .wk a { padding: 7px 6px; }
}
.repere { height: 3px; border-radius: 3px; background: var(--flame); margin: 2px 0; }
.plus-rdv { padding: 7px 12px; }
.gdepasse { margin: 0 5px 4px; padding: 4px 6px; border-radius: 6px; background: var(--bad-soft); color: var(--bad); font: 700 10.5px var(--f-body); text-align: center; }
.dlg-planning { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.gajout { display: block; padding: 6px; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--flame) !important; border-top: 1px solid var(--line); }
.gajout:hover { background: var(--surface-2); }
.gcol.ferme { background: var(--surface-2); box-shadow: none; }
.ferme-corps { display: grid; place-items: center; min-height: 90px; padding: 8px; }
.ferme-corps form { margin: 0; }

/* Prendre un RDV (maquette : .prop, .form, .chk) */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 12px; }
.form .field select, .form .field textarea, .form .field input { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 9px; min-width: 0; color: var(--ink); }
.form .search { padding: 0 11px; }
.form .search input { border: 0; padding: 7px 0 !important; }
.chk { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.prop { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.prop .km { font-family: var(--f-display); font-weight: 800; font-size: 16px; color: var(--flame); min-width: 72px; }
.message { margin-bottom: 14px; padding: 10px 14px; border-radius: 9px; font-weight: 600; background: var(--ok-soft); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.message.error { background: var(--bad-soft); color: var(--bad); }
#carte-rdv { height: 260px; }
.date-rdv { padding: 8px 2px; border-bottom: 1px solid var(--line); }
.date-rdv > b { font-family: var(--f-display); font-size: 13.5px; }
.demi-rdv { margin-top: 6px; gap: 8px; flex-wrap: nowrap; }
.rdv-fiche { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; margin-top: 12px; }
.rdv-fiche h4 { margin: 0 0 8px; padding: 6px 10px; border-radius: 7px; background: var(--navy-2); color: #fff; font: 800 12px var(--f-display); letter-spacing: .08em; text-align: center; }
.rdv-fiche .prop .km { min-width: 58px; font-size: 14px; }
@media (max-width: 1300px) { .rdv-fiche { grid-template-columns: minmax(0,1fr); } }

/* Connexion */
body.login { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(circle at 20% 10%, var(--navy-2), var(--navy) 60%); }
.login form { width: min(360px, 92vw); display: flex; flex-direction: column; gap: 12px; padding: 28px; text-align: center; align-items: stretch; }
.login .brand { align-items: center; padding: 4px 0 10px; }
.login .brand img { width: 240px; }
.login .brand small { color: var(--muted); }
.login .btn { justify-content: center; padding: 10px; font-size: 14px; margin-top: 4px; }

/* Écrans Réglages (Django admin) placés dans le même cadre */
body:has(.side) { background: var(--bg); font-family: var(--f-body); }
body:has(.side) #container { min-width: 0; }
body:has(.side) #main, body:has(.side) div.breadcrumbs, body:has(.side) .messagelist { margin-left: var(--side-w); }
body:has(.side) div.breadcrumbs { padding: 14px 20px 0; }
body:has(.side) #content { padding: 14px 20px 28px; }
body:has(.side) #content h1 { font-family: var(--f-display); font-weight: 800; color: var(--ink); }
body:has(.side) .module, body:has(.side) #changelist, body:has(.side) fieldset.module { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
body:has(.side) .module h2, body:has(.side) .module caption, body:has(.side) .inline-group h2 { background: var(--navy-2); font-family: var(--f-body); }
body:has(.side) input[type=text], body:has(.side) input[type=email], body:has(.side) input[type=number], body:has(.side) input[type=password],
body:has(.side) select, body:has(.side) textarea { border-radius: 8px; border-color: var(--line); }
body:has(.side) .button, body:has(.side) input[type=submit], body:has(.side) .submit-row a.deletelink, body:has(.side) .object-tools a { border-radius: 9px; }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .split { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 900px) {
  :root { --side-w: 0px; }
  .side { width: 260px; transform: translateX(-100%); transition: transform .25s; }
  .side.open { transform: none; }
  .burger { display: block; }
  .g2 { grid-template-columns: minmax(0,1fr); }
  .zone { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 560px) { .g4 { grid-template-columns: minmax(0,1fr); } .search { order: 5; max-width: none !important; flex-basis: 100%; } .kv { grid-template-columns: 110px minmax(0,1fr); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Panneau latéral du RDV (maquette : écran Tournées, carte « RDV · NOM ») */
.panneau { position: fixed; top: calc(var(--top-h) + 8px); right: 14px; bottom: 14px; width: min(420px, calc(100vw - 28px)); z-index: 40; overflow-y: auto; box-shadow: 0 12px 40px rgba(6,16,31,.22); }
.panneau > .hd { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.panneau > .hd h3 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panneau .ptab { display: none; } .panneau .ptab.on { display: block; }
.panneau .pform { margin-top: 12px; gap: 6px; flex-wrap: wrap; align-items: center; }
.panneau .pform input { border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; background: var(--surface); color: var(--ink); font: inherit; }
.pdetails { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.pdetails summary { cursor: pointer; font-weight: 700; font-size: 13px; }
.pdetails form { margin-top: 10px; display: grid; gap: 8px; }
.btn.danger { background: var(--bad); border-color: transparent; color: #fff; }
.gcarte.verrou { outline: 1.5px solid var(--muted); outline-offset: -3px; }
@media (min-width: 1300px) { body.avec-panneau .zone { padding-right: 460px; } }
@media (max-width: 820px) { .panneau { top: auto; right: 0; left: 0; bottom: 0; width: auto; max-height: 78vh; border-radius: 14px 14px 0 0; } }

/* Écran « À confirmer » */
.attente .mono, .nowrap { white-space: nowrap; }
.attente .acts-ligne { justify-content: flex-end; flex-wrap: nowrap; gap: 6px; }
@media (max-width: 1100px) { .attente .acts-ligne { flex-direction: column; align-items: stretch; } .attente .acts-ligne .btn { justify-content: center; } }

/* Mon compte */
.side-moi { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit !important; text-decoration: none !important; border-radius: 8px; }
.side-moi:hover .side-nom { text-decoration: underline; }
.err-champ { color: var(--bad); font-size: 12px; font-weight: 600; }
.compte .form-dlg input { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 10px; color: var(--ink); font: inherit; }
.message.warning { background: var(--warn-soft); color: var(--warn); }

/* Appli technicien (téléphone) — maquette : écran « Appli technicien » (.phone, .ph-top, .ph-nav, .steps) */
body.tech { min-height: 100vh; background: var(--bg); padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.t-top { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 14px 12px; }
.t-ligne { display: flex; align-items: center; gap: 10px; }
.t-ligne b { font-family: var(--f-display); font-size: 17px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-ligne .grow { flex: 1; min-width: 0; }
.t-sur { font-size: 12px; opacity: .75; }
.t-retour { color: #fff !important; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.08); }
.t-top .steps { margin-top: 10px; }
.steps { display: flex; gap: 4px; } .steps i { flex: 1; height: 4px; border-radius: 4px; background: rgba(255,255,255,.18); } .steps i.on { background: var(--flame); }
.t-jours { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 13px; font-weight: 700; }
.t-jours a { color: #fff !important; display: inline-flex; align-items: center; min-height: 36px; padding: 0 10px; border-radius: 8px; background: rgba(255,255,255,.08); text-decoration: none !important; }
.t-apercu { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; font-size: 12px; background: rgba(255,255,255,.08); border-radius: 8px; padding: 6px 8px; }
.t-apercu select { border-radius: 6px; border: 0; padding: 4px 6px; font: inherit; }
.t-apercu a { color: var(--sky) !important; margin-left: auto; }
.t-attente { margin-top: 10px; background: var(--warn); color: #fff; font-size: 12.5px; font-weight: 700; border-radius: 8px; padding: 7px 10px; }
.t-bd { padding: 12px; display: flex; flex-direction: column; gap: 10px; max-width: 640px; margin: 0 auto; }
.t-bd .pagehead { margin: 0; } .t-bd .grid { gap: 10px; } .t-bd .g2 { grid-template-columns: minmax(0,1fr); }
.t-demi { font: 800 11px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.t-sect { font-weight: 800; font-size: 13px; color: var(--muted); margin-top: 6px; }
.t-carte { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.t-carte.list { padding: 0; gap: 0; } .t-carte.list .li:last-child { border-bottom: 0; }
.t-carte.list a.li { color: var(--ink) !important; text-decoration: none !important; min-height: 52px; }
.t-rdv { padding: 12px; border-left: 4px solid var(--c, var(--flame)); }
.t-rdv.fait { opacity: .7; }
.t-lien { display: flex; flex-direction: column; gap: 3px; color: var(--ink) !important; text-decoration: none !important; }
.t-heure { font-size: 14px; font-weight: 700; }
.t-nom { font-size: 16px; }
.t-info { display: flex; gap: 6px; align-items: flex-start; background: var(--warn-soft); color: var(--ink); border-radius: 8px; padding: 6px 8px; font-size: 13px; margin-top: 4px; }
.t-info .ic { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--warn); }
.t-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.t-actions form { display: contents; }
.tech .btn { min-height: 44px; justify-content: center; }
.tech .btn.sm { min-height: 40px; padding: 6px 12px; font-size: 13px; }
.t-boutons { display: flex; flex-direction: column; gap: 8px; }
.t-nav-etapes { flex-direction: row; } .t-nav-etapes .btn { flex: 1; }
.t-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
.t-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--muted) !important; text-decoration: none !important; min-width: 64px; padding: 4px 0; }
.t-nav a.on { color: var(--flame) !important; }
.t-nav .ic { width: 22px; height: 22px; }
.tech .field input, .tech .field textarea, .tech .field select, .t-piece input, .t-cherche input { font-size: 16px; }  /* 16 px : pas de zoom automatique sur iPhone */
.tech fieldset { border: 1px solid var(--line); margin: 0; min-width: 0; }
.t-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.t-choix { display: flex; flex-direction: column; gap: 6px; }
.t-choix label { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-weight: 700; background: var(--surface); }
.t-choix label:has(input:checked) { border-color: var(--flame); background: color-mix(in srgb, var(--flame) 8%, var(--surface)); }
.t-choix input { width: 20px; height: 20px; accent-color: var(--flame); }
.t-pieces { display: flex; flex-direction: column; gap: 6px; }
.t-piece { display: grid; grid-template-columns: minmax(0,1fr) 64px auto; gap: 6px; }
.t-piece input, .t-cherche input { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 9px 10px; color: var(--ink); min-width: 0; }
.t-photos { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; }
.t-vignette { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.t-vignette img { width: 100%; height: 100%; object-fit: cover; }
.t-vignette button { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; }
.t-photo-btn { cursor: pointer; }
canvas.sign { width: 100%; height: 190px; border: 2px dashed var(--line); border-radius: 10px; background: #fff; touch-action: none; }
.t-cherche { display: flex; gap: 6px; } .t-cherche input { flex: 1; }
.t-app summary { list-style: none; cursor: pointer; position: relative; padding-right: 80px; }
.t-app summary::-webkit-details-marker { display: none; }
.t-modif { position: absolute; right: 0; top: 0; display: inline-flex; gap: 4px; align-items: center; color: var(--flame); font-weight: 700; }
.t-modif .ic { width: 14px; height: 14px; }
.t-app[open] form { margin-top: 10px; }

/* « hidden » gagne toujours, même sur un élément qui a son propre display (pastilles, boutons) */
[hidden] { display: none !important; }

/* Tâches terrain (bureau) */
.taches td.detail { max-width: 360px; }
.taches .vignette { display: inline-block; margin-top: 6px; }
.taches .vignette img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.sel { border: 1px solid var(--line); border-radius: 7px; padding: 5px 7px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; max-width: 100%; }
.sel.statut-a_faire { border-color: var(--warn); } .sel.statut-en_cours { border-color: var(--flame); } .sel.statut-fait { border-color: var(--ok); }
.filtres-taches { flex-wrap: wrap; gap: 6px; }

/* Réglages (maquette : liste des rubriques à gauche) */
.reglages { display: grid; grid-template-columns: 230px minmax(0,1fr); gap: 14px; align-items: start; }
.reg-nav a.li { color: var(--ink) !important; text-decoration: none !important; justify-content: space-between; font-weight: 600; font-size: 13.5px; }
.reg-nav a.li.on { background: color-mix(in srgb, var(--flame) 10%, transparent); color: var(--flame) !important; box-shadow: inset 3px 0 0 var(--flame); }
.reg-nav a.li:last-child { border-bottom: 0; }
.comptes tr.inactif td { opacity: .55; }
.comptes .acts-ligne, .acts-ligne { justify-content: flex-end; flex-wrap: nowrap; gap: 6px; }
.comptes .acts-ligne form { margin: 0; }
.perm td, .perm th { white-space: nowrap; } .perm td:first-child { white-space: normal; min-width: 180px; }
.compte-form input:not([type=checkbox]) { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 9px 10px; color: var(--ink); font: inherit; min-width: 0; }
.compte-form select { padding: 9px; }
@media (max-width: 1400px) { .reglages { grid-template-columns: minmax(0,1fr); } .reg-nav { flex-direction: row; overflow-x: auto; } .reg-nav a.li { white-space: nowrap; border-bottom: 0; } .reg-nav a.li .small { display: none; }
  .comptes .acts-ligne { flex-direction: column; align-items: stretch; } }

/* Bandeau d'installation (appli technicien) */
.t-installer { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; background: rgba(255,255,255,.1); border-radius: 12px; padding: 10px; font-size: 13.5px; }
.t-installer img { border-radius: 10px; flex: none; }
.t-installer ol { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.t-installer .btn { margin-top: 8px; }
.t-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: rgba(255,255,255,.16); vertical-align: middle; }
.t-ico svg { width: 15px; height: 15px; }
.t-fermer { border: 0; background: transparent; color: #fff; font-size: 16px; width: 36px; height: 36px; border-radius: 8px; flex: none; }
/* Appli installée sur iPhone / iPad (barre d'état transparente) : la barre du haut passe sous l'heure et la batterie */
.top { padding-top: max(10px, env(safe-area-inset-top, 0px)); }
@media (max-width: 900px) { .comptes th, .comptes td { white-space: normal; } .comptes .btn.sm { padding: 6px 8px; } }
