/* Polices hébergées localement (aucun appel à un service tiers). */
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/public-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/public-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/public-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/public-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/schibsted-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/schibsted-grotesk-latin-700-normal.woff2") format("woff2"); }
[hidden]:not([hidden=until-found i]){display:none!important}
html{scroll-padding-top:env(safe-area-inset-top,0px)}

/* Concept : un tableau de semaine (demandes en lignes, 10 demi-journées en colonnes),
   les remplaçants en bandeau au-dessus, à glisser vers les créneaux. */
:root {
  --bg: #EDF0F5;
  --surface: #FFFFFF;
  --surface-2: #F5F7FB;
  --line: #D7DDE7;
  --line-strong: #B4BECE;
  --ink: #18202E;
  --ink-2: #485469;
  --ink-3: #6E7B90;
  --accent: #2F4FD0;
  --accent-ink: #FFFFFF;
  --accent-soft: #E4E9FB;
  --conge: #3E7194;
  --conge-soft: #E1EEF5;
  --decharge: #2F7F6E;
  --decharge-soft: #DFF1EC;
  --stage: #7A58B3;
  --stage-soft: #ECE5F7;
  --warn: #8A5300;
  --warn-soft: #FBEFD3;
  --warn-line: #D9A441;
  --bad: #B3261E;
  --bad-soft: #FBE3E0;
  --hatch: #DCE2EB;
  --av-l: 40%;
  --av-ink: #FFFFFF;
  --shadow: 0 6px 24px rgba(24, 32, 46, .16);
  --font-ui: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Schibsted Grotesk", "Public Sans", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11161E;
    --surface: #1A212C;
    --surface-2: #202836;
    --line: #2C3646;
    --line-strong: #435064;
    --ink: #E8ECF3;
    --ink-2: #AAB5C6;
    --ink-3: #8390A5;
    --accent: #8EA5FF;
    --accent-ink: #0E1522;
    --accent-soft: #1F2748;
    --conge: #7FB4D6;
    --conge-soft: #1C2C37;
    --decharge: #6CC4AE;
    --decharge-soft: #1A3029;
    --stage: #B79BE6;
    --stage-soft: #2A2240;
    --warn: #E7B45A;
    --warn-soft: #3A2C11;
    --warn-line: #8C6A25;
    --bad: #F28B82;
    --bad-soft: #41201D;
    --hatch: #283243;
    --av-l: 62%;
    --av-ink: #0E1522;
    --shadow: 0 6px 24px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11161E;
  --surface: #1A212C;
  --surface-2: #202836;
  --line: #2C3646;
  --line-strong: #435064;
  --ink: #E8ECF3;
  --ink-2: #AAB5C6;
  --ink-3: #8390A5;
  --accent: #8EA5FF;
  --accent-ink: #0E1522;
  --accent-soft: #1F2748;
  --conge: #7FB4D6;
  --conge-soft: #1C2C37;
  --decharge: #6CC4AE;
  --decharge-soft: #1A3029;
  --stage: #B79BE6;
  --stage-soft: #2A2240;
  --warn: #E7B45A;
  --warn-soft: #3A2C11;
  --warn-line: #8C6A25;
  --bad: #F28B82;
  --bad-soft: #41201D;
  --hatch: #283243;
  --av-l: 62%;
  --av-ink: #0E1522;
  --shadow: 0 6px 24px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 12.5px;
  line-height: 1.35;
  padding-inline: 16px;
  padding-block: 20px 40px;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app { max-width: 1280px; margin-inline: auto; display: flex; flex-direction: column; gap: 12px; }

/* En-tête */
.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
h1 { font-family: var(--font-display); font-size: 22px; line-height: 1.1; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
.sub { margin: 4px 0 0; color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.status { font-size: 11px; color: var(--ink-3); padding-right: 4px; }
.btn { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; padding: 5px 10px; font-weight: 600; font-size: 12px; }
.btn:hover:not(:disabled) { border-color: var(--ink-3); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.link { background: none; border: none; padding: 2px 4px; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Bandeau des remplaçants */
.tray { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.tray.drop-over { outline: 3px solid var(--accent); outline-offset: 0; }
.tray-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: baseline; }
.tray-head h2 { font-family: var(--font-display); font-size: 13px; margin: 0; }
.hint { margin: 0; font-size: 11.5px; color: var(--ink-2); min-width: 0; }
.hint.armed { color: var(--accent); font-weight: 600; }
.reps { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 6px; }
.rep { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); cursor: grab; user-select: none; min-width: 0; }
.rep:hover { border-color: var(--line-strong); }
.rep.armed { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.rep-txt { display: flex; flex-direction: column; min-width: 0; }
.rep-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-meta { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 9.5px; font-weight: 700; letter-spacing: .02em; background: hsl(var(--h) 52% var(--av-l)); color: var(--av-ink); }
.av.sm { width: 16px; height: 16px; font-size: 8px; }

/* Barre de semaine */
.weekbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.weeknav { display: flex; align-items: center; gap: 8px; }
.weeknav .label { font-family: var(--font-display); font-weight: 700; font-size: 15px; min-width: 0; }
.iconbtn { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 16px; line-height: 1; }
.tabs { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.tab { border: none; background: none; padding: 5px 11px; font-weight: 600; font-size: 12px; color: var(--ink-2); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--bg); }

/* Synthèse */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; display: flex; align-items: baseline; gap: 6px; }
.stat b { font-family: var(--font-display); font-size: 17px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--ink-2); }
.stat.s-bad { background: var(--bad-soft); border-color: var(--bad); }
.stat.s-bad b, .stat.s-bad span { color: var(--bad); }
.stat.s-warn { background: var(--warn-soft); border-color: var(--warn-line); }
.stat.s-warn b, .stat.s-warn span { color: var(--warn); }
.stat.zero { background: var(--surface); border-color: var(--line); }
.stat.zero b, .stat.zero span { color: var(--ink-3); }

/* Tableau */
.board { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.grid { display: grid; grid-template-columns: 172px repeat(8, minmax(70px, 1fr)); min-width: 720px; }
.grid.avail { grid-template-columns: 150px repeat(8, minmax(70px, 1fr)); min-width: 700px; }
.corner, .dayh, .halfh, .needhead, .rephead { background: var(--surface); }
.corner { grid-row: 1 / span 2; position: sticky; left: 0; z-index: 3; padding: 6px 8px; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: flex-end; border-bottom: 1px solid var(--line-strong); }
.dayh { grid-column: span 2; padding: 5px 7px 2px; font-size: 11.5px; font-weight: 700; text-transform: capitalize; border-left: 2px solid var(--line-strong); background: var(--surface-2); font-variant-numeric: tabular-nums; }
.halfh { padding: 1px 7px 4px; font-size: 10px; color: var(--ink-3); border-left: 1px solid var(--line); border-bottom: 1px solid var(--line-strong); background: var(--surface-2); }
.halfh.am { border-left: 2px solid var(--line-strong); }
.needhead, .rephead { position: sticky; left: 0; z-index: 2; border-top: 1px solid var(--line); padding: 6px 8px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.needhead.armed-target { cursor: copy; }
.needhead.armed-target:hover, .needhead.drop-over { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: -2px; }
.nh-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tag { font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 5px; border-radius: 4px; }
.t-conge { background: var(--conge-soft); color: var(--conge); }
.t-decharge { background: var(--decharge-soft); color: var(--decharge); }
.t-stage { background: var(--stage-soft); color: var(--stage); }
.cov { font-size: 10.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.nh-school { font-weight: 600; font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
.nh-meta { font-size: 10.5px; color: var(--ink-2); }
.nh-teacher { font-size: 11px; color: var(--ink-2); overflow-wrap: anywhere; }
.nh-teacher b { color: var(--ink); font-weight: 600; }
.nh-teacher i { color: var(--ink-3); }
.nh-del { align-self: flex-start; border: none; background: none; padding: 0; font-size: 10.5px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 2px; }
.nh-del.confirm { color: var(--bad); font-weight: 700; }

.slot { min-height: 42px; min-width: 0; padding: 3px 5px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; justify-content: space-between; gap: 1px; cursor: pointer; position: relative; }
.slot.am { border-left: 2px solid var(--line-strong); }
.slot:hover { background: var(--surface-2); }
.slot.off { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--hatch) 6px 7px); cursor: default; }
.slot.off:hover { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--hatch) 6px 7px); }
.slot .free { font-size: 10px; color: var(--ink-3); border: 1px dashed var(--line-strong); border-radius: 4px; padding: 2px 4px; text-align: center; margin-block: auto; }
.chip { display: flex; align-items: center; gap: 4px; min-width: 0; cursor: grab; }
.chip-name { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-foot { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 14px; }
.st { font-size: 9.5px; font-weight: 700; }
.st.ok { color: var(--ink-3); font-weight: 500; }
.st.warn { color: var(--warn); }
.st.bad { color: var(--bad); }
.x { border: none; background: none; width: 16px; height: 16px; border-radius: 4px; line-height: 1; color: var(--ink-3); font-size: 13px; padding: 0; margin-left: auto; }
.x:hover { background: var(--line); color: var(--ink); }
.slot.warn { background: var(--warn-soft); box-shadow: inset 0 0 0 1px var(--warn-line); }
.slot.bad { background: var(--bad-soft); box-shadow: inset 0 0 0 1px var(--bad); }
.slot.warn:hover { background: var(--warn-soft); }
.slot.bad:hover { background: var(--bad-soft); }

/* États pendant un glisser ou une sélection */
.slot.hl-ok { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.slot.hl-warn { outline: 2px dashed var(--warn); outline-offset: -2px; background: var(--warn-soft); }
.slot.hl-block { opacity: .38; cursor: not-allowed; }
.slot.drop-over { outline: 3px solid var(--accent); outline-offset: -3px; }

/* Disponibilités */
.rephead { flex-direction: row; align-items: center; gap: 10px; }
.rephead .rep-txt { flex: 1; }
.avcell { min-height: 30px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); padding: 3px 5px; text-align: left; border-radius: 0; font-size: 10px; color: var(--ink-3); display: flex; align-items: center; min-width: 0; overflow: hidden; }
.avcell.am { border-left: 2px solid var(--line-strong); }
.avcell:hover { background: var(--surface-2); }
.avcell.busy { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.avcell.off { background: repeating-linear-gradient(135deg, var(--bad-soft) 0 6px, transparent 6px 7px); color: var(--bad); font-weight: 700; }
.avcell.clash { background: var(--bad-soft); color: var(--bad); font-weight: 700; box-shadow: inset 0 0 0 1px var(--bad); }
.avcell span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nh-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.fchip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ngrid { display: grid; grid-template-columns: 78px minmax(110px, 1fr) minmax(140px, 1.2fr) minmax(210px, 1.6fr) 70px 90px 170px; min-width: 900px; }
.rgrid { display: grid; grid-template-columns: minmax(190px, 1.4fr) minmax(130px, 1fr) minmax(140px, 1fr) minmax(170px, 1.1fr) 90px 190px; min-width: 900px; }
.repcell { display: flex; align-items: center; gap: 6px; min-width: 0; }
.repcell .rep-txt { display: flex; flex-direction: column; min-width: 0; }
.field input[type="tel"], .field input[type="password"], .field input[type="email"], .field textarea { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; padding: 7px 9px; min-width: 0; width: 100%; font: inherit; color: inherit; resize: vertical; }
.nh0 { padding: 6px 8px; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); background: var(--surface-2); border-bottom: 1px solid var(--line-strong); }
.nc { padding: 6px 8px; border-top: 1px solid var(--line); min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; overflow-wrap: anywhere; }
.nc.act { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.nc small { color: var(--ink-3); font-size: 10.5px; }
.nc b { font-weight: 600; }
.nc i { color: var(--ink-3); }
.nc .cv { font-variant-numeric: tabular-nums; font-weight: 700; }
.nh-del { cursor: pointer; }
.rep-un { margin-left: auto; flex: none; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 5px; font-size: 10px; font-weight: 600; padding: 2px 6px; color: var(--ink-2); }
.rep-un:hover { border-color: var(--bad); color: var(--bad); }
.rep-meta .un { color: var(--bad); font-weight: 600; }
.rep-load { display: flex; flex-wrap: wrap; gap: 3px 4px; margin-top: 3px; }
.pill { font-size: 11px; font-weight: 700; line-height: 1.2; padding: 2px 7px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill-take { background: var(--accent-soft); color: var(--accent); }
.pill-take.zero { background: var(--surface); color: var(--ink-3); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.pill-off { background: var(--bad-soft); color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.rep { align-items: flex-start; }
.rep .av { margin-top: 1px; }
.rep-un { align-self: center; }
.cmt { width: 100%; min-width: 0; margin-top: 2px; font-size: 10px; line-height: 1.2; padding: 2px 4px; border: 1px dashed var(--line-strong); border-radius: 4px; background: transparent; color: var(--ink); text-overflow: ellipsis; cursor: text; }
.cmt::placeholder { color: var(--ink-3); opacity: .8; }
.cmt:hover { border-style: solid; background: var(--surface); }
.cmt:focus { border-style: solid; border-color: var(--accent); background: var(--surface); outline: none; box-shadow: 0 0 0 2px var(--accent-soft); }
.cmt.has { border-style: solid; border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.slot .cmt { flex: none; }
button.stat { cursor: pointer; text-align: left; font: inherit; color: inherit; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.tag.t-abs { background: var(--bad-soft); color: var(--bad); }
.abslist { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.abs-h { font-family: var(--font-display); font-size: 13px; margin: 0 0 4px; }
.absrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 5px 0; border-top: 1px solid var(--line); }
.abs-when { color: var(--ink-2); flex: 1 1 200px; min-width: 0; }
.imp { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.imp-txt { display: flex; flex-direction: column; min-width: 0; }
.imp-txt small { color: var(--ink-3); font-size: 11px; }
.focusbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 12px; margin-bottom: 8px; border: 1px solid var(--line-strong); border-left: 4px solid var(--ink); border-radius: 8px; background: var(--surface-2); font-size: 12px; }
.focusbar span { min-width: 0; overflow-wrap: anywhere; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; color: var(--ink-2); align-items: center; }
.legend .k { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 11px; height: 11px; border-radius: 3px; border: 1px solid var(--line-strong); display: inline-block; }
.sw.w { background: var(--warn-soft); border-color: var(--warn-line); }
.sw.b { background: var(--bad-soft); border-color: var(--bad); }
.sw.f { border-style: dashed; }
.sw.o { background: repeating-linear-gradient(135deg, transparent 0 3px, var(--hatch) 3px 4px); }
.foot { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--ink-3); align-items: center; }
.empty-state { padding: 36px 20px; text-align: center; color: var(--ink-2); }
.empty-state strong { display: block; font-family: var(--font-display); font-size: 17px; color: var(--ink); margin-bottom: 4px; }

/* Fenêtres et messages */
.overlay { position: fixed; inset: 0; background: rgba(10, 14, 22, .5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.dlg { background: var(--surface); color: var(--ink); width: min(520px, 100%); max-height: calc(100% - 8px); overflow-y: auto; border-radius: 12px; box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--line); }
.dlg h3 { font-family: var(--font-display); font-size: 18px; margin: 0; }
.dlg .sub2 { margin: 0; color: var(--ink-2); font-size: 13px; }
.sug-list { display: flex; flex-direction: column; gap: 6px; }
.sug-title { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 6px 0 0; }
.sug { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.sug:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.sug:disabled { opacity: .6; cursor: default; }
.sug .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sug small { color: var(--ink-3); font-size: 12px; }
.sug small.w { color: var(--warn); font-weight: 600; }
.sug small.b { color: var(--bad); font-weight: 600; }
.dlg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.form .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field > .lbl { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field input[type="text"], .field input[type="date"], .field select { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; padding: 7px 9px; min-width: 0; width: 100%; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.err { color: var(--bad); font-size: 12.5px; font-weight: 600; margin: 0; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 60; width: min(640px, calc(100% - 32px)); background: var(--ink); color: var(--bg); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; }
#toast .msg { flex: 1 1 220px; min-width: 0; }
#toast.warn { background: var(--warn); color: #fff; }
#toast.bad { background: var(--bad); color: #fff; }
:root[data-theme="dark"] #toast.warn, :root[data-theme="dark"] #toast.bad { color: #11161E; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #toast.warn, :root:not([data-theme="light"]) #toast.bad { color: #11161E; } }
#toast button { background: transparent; border: 1px solid currentColor; color: inherit; border-radius: 6px; padding: 4px 10px; font-size: 12.5px; font-weight: 600; }
[hidden] { display: none !important; }
@media (max-width: 560px) {
  h1 { font-size: 22px; }
  .form { grid-template-columns: 1fr; }
  .reps { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .rep, .slot, .btn { transition: background-color .12s, border-color .12s; }
}

.authwrap { position: fixed; inset: 0; z-index: 100; background: var(--bg, #f4f5f7); display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.authwrap[hidden] { display: none; }
.auth-card { background: var(--surface); color: var(--ink); width: min(400px, 100%); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.auth-card h2 { font-family: var(--font-display); font-size: 20px; margin: 0; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-card .sub2 { margin: 0; color: var(--ink-2); font-size: 13px; }
.err { color: #b3261e; font-size: 13px; margin: 0; min-height: 1em; }
.whobar { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); margin-right: 8px; }
.whobar[hidden] { display: none; }
.usertable { width: 100%; border-collapse: collapse; font-size: 13px; }
.usertable th, .usertable td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.empty-state { padding: 40px 16px; text-align: center; color: var(--ink-2); }

.adminonly #tray, .adminonly .weekbar, .adminonly #stats, .adminonly #legend, .adminonly .foot,
.adminonly #undoBtn, .adminonly #pdfBtn, .adminonly #exportBtn, .adminonly #reloadBtn, .adminonly [data-act="new-need"] { display: none !important; }
.adminpage { max-width: 900px; margin: 16px auto; display: flex; flex-direction: column; gap: 12px; }
.adminpage h2 { font-family: var(--font-display); margin: 0; }
.adminpage h3 { margin: 12px 0 0; }
.adminpage .note { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; margin: 0; font-weight: 600; }
.useredit { display: flex; flex-direction: column; gap: 10px; max-width: 460px; }
.uacts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.btn.danger { color: #b3261e; }

.zonelist { display: flex; flex-direction: column; gap: 6px; }
.zonerow { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.zonerow input { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; padding: 7px 9px; min-width: 0; width: 100%; font: inherit; color: inherit; }
