/* Forum Régie theme: one light palette (warm neutrals, one gold accent) for the desktop (Inter)
   and the technician app (IBM Plex, see pwa/pwa.css). There is no dark mode. */

/* Fonts, self-hosted (latin subset, covers French incl. œ). Source: npm packages @fontsource/inter 5,
   @fontsource/ibm-plex-sans 5 and @fontsource/ibm-plex-mono 5 via cdn.jsdelivr.net.
   All SIL Open Font License 1.1; licence texts sit next to the files (OFL-*.txt). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-700.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2"); }

:root {
  --body: "Inter", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 8px;
  --radius-lg: 12px;
}

/* Palette */
:root {
  --bg: #F7F7F5;
  --panel: #FFFFFF;
  --hover: #F1F0EC;
  --line: #E6E4DF;
  --line-strong: #DAD7CF;
  --ink: #18181B;
  --muted: #55555B;            /* 7.0:1 on panel, 6.4:1 on bg */
  --accent: #B8955A;           /* decoration only: dots, bars, never body text */
  --accent-text: #7E6A43;
  --accent-soft: #F3ECDC;
  --accent-soft-ink: #5E4E2E;
  --primary: #18181B;
  --primary-ink: #FFFFFF;
  --ok: #1F6B43;   --ok-soft: #E4F3EA;   --ok-line: #E4F3EA;
  --warn: #7A4F00; --warn-soft: #FCEFD6; --warn-line: #FCEFD6;
  --info: #1D4F8F; --info-soft: #E6EEF9; --info-line: #E6EEF9;
  --bad: #A12A1E;  --bad-soft: #FBE4E1;  --bad-line: #FBE4E1;
  color-scheme: light;
}


* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--body);
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
a { color: var(--accent-text); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
code { font-family: var(--mono); font-size: .9em; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: .05em .35em; }
.muted { color: var(--muted); }
.note { font-size: 13px; color: var(--muted); }
.mono { font-family: var(--mono); }

/* Top band: always black; the gold marks the active section */
.topbar {
  --band-ink: #EDEDED;
  --band-gold: #B8955A;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 20px;
  padding: 0 max(2vw, 16px);
  min-height: 72px;
  background: #0E0E10;
  color: var(--band-ink);
}
.band-logo { display: block; flex: none; line-height: 0; }
.band-logo img { height: 84px; width: auto; margin: -6px -14px -6px -18px; }
.nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.nav a, .topbar .toplink {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 0; background: none;
  color: var(--band-ink); font: inherit; font-weight: 500; line-height: 20px;
  text-decoration: none; white-space: nowrap; cursor: pointer;
}
.nav a:hover, .topbar .toplink:hover { color: #E6CFA0; }
.nav a.on { background: var(--band-gold); color: #111; }
.topbar .toplink[aria-current="page"] { color: #E6CFA0; }
.nav-count { display: inline-block; min-width: 20px; font-size: 12px; font-weight: 600; line-height: 20px; border-radius: 10px; padding: 0 6px; text-align: center; background: var(--primary); color: var(--primary-ink); }
.nav-count.gold { background: var(--band-gold); color: #111; }
.nav a.on .nav-count.gold { background: #111; color: #E6CFA0; }
.top-actions { display: flex; align-items: center; gap: 6px; flex: none; margin-left: auto; font-size: 14px; }
.top-actions form { margin: 0; }
.user-chip { display: flex; align-items: center; gap: 10px; color: var(--band-ink); text-decoration: none; border-radius: 8px; padding: 2px 8px 2px 2px; font-weight: 600; }
.user-chip:hover, .user-chip[aria-current="page"] { color: #E6CFA0; }
.user-chip .avatar { width: 30px; height: 30px; border-radius: 15px; background: #26262A; color: var(--band-ink); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; }
@media (max-width: 1099px) { .user-chip .uname { display: none; } }
@media (max-width: 899px) {
  .topbar { padding-bottom: 8px; }
  .band-logo img { height: 64px; margin: -4px -12px -4px -14px; }
  .nav { order: 3; flex: 0 0 100%; overflow-x: auto; scrollbar-width: none; }
  .nav a { padding: 8px 12px; }
}

/* Section cards: the sub-menu of Équipe and Offres, on top of each sub-page */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin: 0 0 20px; }
.card {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 20px; color: var(--ink); text-decoration: none;
  transition: border-color .15s, background .15s;
}
.card:hover { border-color: var(--muted); }
.card.on { background: var(--accent-soft); border-color: transparent; }
.card-label { color: var(--muted); font-size: 14px; font-weight: 500; }
.card.on .card-label { color: var(--accent-soft-ink); }
.card-figure { font-size: 28px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.card.on .card-figure { color: var(--accent-soft-ink); }
.card-line { color: var(--muted); font-size: 13px; }
@media (max-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .card { padding: 10px 14px; } .card-figure { font-size: 22px; } }
.iconbtn {
  width: 34px; height: 34px; flex: none;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--panel); color: var(--muted);
  cursor: pointer; font-size: 16px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.iconbtn:hover { color: var(--ink); border-color: var(--muted); }

.content { max-width: 1400px; margin: 0 auto; padding: 28px 32px 56px; }

/* Panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}
.panel > :last-child { margin-bottom: 0; }
.panel > h2:first-child { padding-bottom: .75em; border-bottom: 1px solid var(--line); }
.panel h2:not(:first-child) { margin-top: 1.25em; }

/* Toolbar, segmented links */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 14px; }
.toolbar h1 { margin: 0 auto 0 0; font-size: 1.9rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; background: var(--panel); max-width: 100%; }
.seg a, .seg button { border: 0; background: none; padding: 7px 14px; cursor: pointer; color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap; }
.seg a:hover, .seg button:hover { color: var(--ink); background: var(--hover); }
.seg a[aria-current="page"], .seg [aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); }
.subnav { margin-bottom: 16px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  transition: border-color .15s, background .15s, filter .15s;
}
.btn:hover { border-color: var(--muted); background: var(--hover); }
.btn.primary { background: var(--primary); border-color: transparent; color: var(--primary-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.15); background: var(--primary); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.bad { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.bad:hover { background: var(--bad-soft); }
.btn.bad.solid { background: var(--bad); color: var(--panel); }
.btn.mini { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Forms */
label { display: block; font-weight: 500; margin-bottom: 4px; font-size: 14px; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="search"],
input[type="date"], input[type="time"], input[type="number"], input[type="file"], select, textarea {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 38px;
  transition: border-color .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--accent-text); }
input[type="file"] { padding: 6px; }
select {
  -webkit-appearance: none; appearance: none; padding-right: 32px;
  background-image: url("../img/chevron.svg");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 12px 8px;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent-text); width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
textarea { min-height: 76px; resize: vertical; }
.field { margin-bottom: 16px; }
.field-help { color: var(--muted); font-size: 13px; margin-top: 4px; }
.field-error { color: var(--bad); font-size: 13px; margin-top: 4px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; align-items: center; }
.toolbar .form-actions { margin-top: 0; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.form .end { display: flex; align-items: flex-end; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { width: auto; flex: 1 1 180px; }
.inline-form { display: inline; margin: 0; }
.actions { white-space: nowrap; }

.form-posts { margin: 14px 0 0; font-size: 14px; }
.actions > * + * { margin-left: 4px; }

/* Tables */
.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font: 600 12px/1.3 var(--body); letter-spacing: .02em; color: var(--muted); background: var(--bg); white-space: nowrap; }
td { font-variant-numeric: tabular-nums; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--hover); }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 700; border-top: 1px solid var(--ink); border-bottom: 0; }
tr.inactive td { opacity: .55; }
td.num, th.num { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
td.empty { text-align: center; padding: 28px 12px; font-style: normal; font-size: 14px; }
td input, td select { border-color: transparent; background-color: transparent; padding: 4px 6px; min-height: 0; }
td select { padding-right: 26px; background-position: right 7px center; }
td input:hover, td select:hover, td input:focus, td select:focus { border-color: var(--line); background-color: var(--panel); }
td input[type="checkbox"] { width: 16px; }

/* Pills, chips: tinted fill. */
.pill { display: inline-block; font: 500 12px/1.5 var(--body); padding: 2px 8px; border-radius: 6px; white-space: nowrap; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.pill.p-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.pill.p-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.pill.p-info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.pill.p-bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.pill.p-mute { background: var(--bg); color: var(--muted); border-color: var(--line); }
.pill.p-gold { background: var(--accent-soft); color: var(--accent-soft-ink); border-color: var(--accent-soft); }
.pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.minis { display: flex; flex-wrap: wrap; gap: 4px; }
.mini { font-size: 12px; padding: 2px 7px; border-radius: 5px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }

/* Flash messages and issues */
.flash { padding: 10px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); margin-bottom: 16px; overflow-wrap: anywhere; }
.flash-error, .flash-danger { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.flash-success { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.flash-warning, .flash-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.flash-info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.issues { display: flex; flex-direction: column; gap: 6px; }
.issue { font-size: 14px; padding: 8px 12px; border-radius: 6px; background: var(--bad-soft); color: var(--bad); }
.issue.w { background: var(--warn-soft); color: var(--warn); }
.empty { font-size: 13px; color: var(--muted); font-style: italic; }
.list > .empty, .panel > .empty { text-align: center; padding: 28px 12px; border: 1px dashed var(--line); border-radius: var(--radius); font-size: 14px; font-style: normal; }

/* Planning cards */
.list { display: flex; flex-direction: column; gap: 8px; }
.section-title { font: 600 13px/1 var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 4px 0; }
.cal-chip.s-ok { border-left-color: var(--ok); }
.cal-chip.s-warn { border-left-color: var(--warn); }
.cal-chip.s-bad { border-left-color: var(--bad); }

/* Meter: <meter class="meter" value= max=> */
meter.meter { display: block; width: 100%; height: 6px; margin-top: 6px; border: 0; border-radius: 3px; background: var(--line); appearance: none; -webkit-appearance: none; }
meter.meter::-webkit-meter-bar { height: 6px; border: 0; border-radius: 3px; background: var(--line); }
meter.meter::-webkit-meter-optimum-value, meter.meter::-webkit-meter-suboptimum-value, meter.meter::-webkit-meter-even-less-good-value { border-radius: 3px; background: var(--accent); }
meter.meter::-moz-meter-bar { border-radius: 3px; background: var(--accent); }
meter.meter.ok::-webkit-meter-optimum-value, meter.meter.ok::-webkit-meter-suboptimum-value, meter.meter.ok::-webkit-meter-even-less-good-value { background: var(--ok); }
meter.meter.ok::-moz-meter-bar { background: var(--ok); }

/* Calendar */
.cal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 104px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.out { background: var(--bg); }
.cal-cell.out .cd { opacity: .45; }
.cal-cell.today .cd { background: var(--primary); color: var(--primary-ink); border-radius: 50%; }
.cal-top { display: flex; justify-content: space-between; align-items: center; }
.cal-add { color: var(--muted); text-decoration: none; font-weight: 600; padding: 0 6px; border-radius: 4px; opacity: 0; }
.cal-cell:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-add:hover { color: var(--ink); background: var(--hover); }
@media (hover: none) { .cal-add { opacity: .6; } }
.cd { font: 600 14px/1 var(--body); width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.cal-chip { display: flex; flex-direction: column; gap: 1px; text-align: left; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 5px; padding: 4px 6px; background: var(--panel); color: var(--ink); cursor: pointer; min-width: 0; font-size: 12px; text-decoration: none; }
.cal-chip:hover { border-color: var(--muted); }
.cal-chip[aria-pressed="true"] { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text); }
.cal-chip .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip .ct { color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.monthnav { display: inline-flex; align-items: center; gap: 6px; }
.monthnav b { font: 600 18px/1 var(--body); min-width: 150px; text-align: center; text-transform: capitalize; }

/* Detail sheet, facts, departments, stepper */
.detail { display: flex; flex-direction: column; gap: 20px; }
.dhead { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-start; justify-content: space-between; }
.dhead h1 { font-size: 1.9rem; margin: 0; }
.dhead .sub { color: var(--muted); margin-top: 6px; }
.dactions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.fact { background: var(--panel); padding: 14px 18px; min-width: 0; }
.fact span { display: block; font-size: 12px; color: var(--muted); }
.fact b { display: block; margin-top: 4px; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fact a { color: var(--ink); font-weight: 600; }
.sheet-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.sheet-main { grid-column: 1 / 4; }
.sheet-side { grid-column: 4; }
.sheet-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.sheet-main > .panel { margin: 0; }
.sheet-side { display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; }
.card-title { font-size: 12px; color: var(--muted); }
.card-big { font-size: 26px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.card-note { font-size: 13px; color: var(--muted); }
.card meter.meter { margin-top: 12px; }
.card-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.card-list a[aria-current="page"] { color: var(--ink); font-weight: 600; text-decoration: none; }
.doc-list li { display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.doc-meta { font-size: 12px; color: var(--muted); }
.doc-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.doc-upload input[type="file"] { flex: 1 1 100%; min-width: 0; }
.doc-upload .card-note { flex: 1 1 100%; margin: 0; }
.edit-info > summary { cursor: pointer; font-weight: 600; font-size: 1.1rem; }
.edit-info[open] > summary { padding-bottom: .75em; margin-bottom: 1em; border-bottom: 1px solid var(--line); }
.team h2 { display: flex; align-items: center; gap: 10px; }
.team-row { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.team-row:last-child { border-bottom: 0; }
.team-post { width: 190px; flex: none; font-weight: 600; }
.team-people { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.team-person { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Team editor: one row per post (name, filled n / m, people) */
/* Team editor. Three columns: post (name + "Ajouter" under it) | people | need stepper and n / m. The count column has
   the same width as the "Bookés n / m" total of the panel heading, so every figure lines up on the right edge. */
.team-total { margin-left: auto; display: inline-flex; align-items: baseline; gap: 8px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; font-weight: 400; color: var(--muted); }
.team-total b { font: 600 13px/1.4 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.count { display: inline-block; min-width: 64px; text-align: right; font: 500 14px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.depts { display: flex; flex-direction: column; }
.dept { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; column-gap: 24px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.dept:last-child { border-bottom: 0; }
.dept.none { opacity: .7; }
.dside { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dside h3 { margin: 0; font-size: 14px; line-height: 32px; }
.dside .sub { margin-top: -8px; font-size: 12px; color: var(--muted); }
/* The add field sits under the names, in the names' column (same grid as a person's row). */
.dept .picker { display: grid; grid-template-columns: minmax(0, 1fr) 84px 118px 24px; gap: 10px; align-items: center; margin-top: 4px; }
.dept .picker select, .dept .picker input[type="text"] { grid-column: 1 / 3; width: 100%; min-width: 0; min-height: 32px; padding: 5px 10px; font-size: 13px; }
.dept .picker .btn, .dept .picker noscript { grid-column: 3; justify-self: start; }   /* under the state pills */
.chips:has(.chip) .picker { margin-top: 6px; }
.dneed { display: flex; align-items: center; justify-content: flex-end; width: 100px; height: 32px; }  /* fixed: every post has the same names column */
.stepper { display: inline-flex; align-items: center; height: 32px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.stepper form { display: contents; }
.stepper button { width: 32px; height: 30px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
.stepper button:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper output { min-width: 22px; text-align: center; font: 600 14px/1 var(--mono); font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chip { display: grid; grid-template-columns: minmax(0, 1fr) 84px 118px 24px; align-items: center; gap: 10px; min-height: 32px; font-size: 14px; }
.chip.gone .who b { color: var(--muted); text-decoration: line-through; }
.chip .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .who b { font-weight: 400; }
.chip .who small { margin-left: 6px; font-size: 12px; color: var(--accent-text); }
.chip .rate { display: block; text-align: right; color: var(--muted); font: 13px var(--mono); font-variant-numeric: tabular-nums; }
.chip .state, .chip .state-menu { justify-self: start; }
.chip .x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 4px; }
.chip .x:hover { color: var(--bad); }
/* Small pop-up menus (state, rate) built on <details>: no script needed to open them. */
.pop { position: relative; }
.pop > summary { list-style: none; cursor: pointer; }
.pop > summary::-webkit-details-marker { display: none; }
.state-menu > summary .pill::after { content: "▾"; margin-left: 6px; font-size: 10px; opacity: .7; }
.state-menu > summary:hover .pill { filter: brightness(.96); }
.rate-edit > summary.rate { border-radius: 6px; padding: 2px 4px; margin: -2px -4px; }
.rate-edit > summary.rate:hover { background: var(--hover); color: var(--ink); }
.pop .menu { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; display: flex; flex-direction: column; gap: 2px; min-width: 150px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.rate-edit .menu { left: auto; right: 0; flex-direction: row; align-items: flex-end; gap: 6px; }
.rate-form label { font-size: 12px; color: var(--muted); }
.rate-form input { width: 90px; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 13px; text-align: left; cursor: pointer; color: var(--ink); }
.menu-item:hover { background: var(--hover); }
.menu-item::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.menu-item.s-requested::before { background: var(--info); }
.menu-item.s-confirmed::before { background: var(--ok); }
.menu-item.s-cancelled::before { background: var(--bad); }
.dept.full .count { color: var(--ok); }
.dept.short .count { color: var(--bad); }
.dept.over .count { color: var(--warn); }

.issues { margin: 4px 0; }

/* Error page */
.error-block { text-align: center; padding: 48px 16px; }
.error-code {
  font: 700 7rem/1 var(--body);
  letter-spacing: -.04em;
  color: var(--accent-text);
  margin-bottom: 12px;
}

/* Page-specific bits */
.code-display { font: 500 3.5rem/1 var(--mono); letter-spacing: .3em; text-align: center; color: var(--accent-text); margin: 1rem 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.recovery-key { font-family: var(--mono); font-size: 1.15rem; letter-spacing: .08em; word-break: break-all; margin: .75rem 0 0; }
.auth-panel { max-width: 440px; margin: 24px auto; }

/* Phone */
@media (max-width: 640px) {
  .topbar { padding-left: 16px; padding-right: 16px; gap: 4px 8px; }
  .content { padding: 16px 16px 40px; }
  .panel { padding: 16px; }
  h1 { font-size: 1.7rem; }
  .toolbar h1 { font-size: 1.7rem; width: 100%; }
  .detail { gap: 14px; }
  .dhead h1 { font-size: 1.8rem; }
  .dactions { width: 100%; }
  .dactions .btn { flex: 1 1 auto; }
  .facts { grid-template-columns: 1fr 1fr; }
  .sheet-grid { grid-template-columns: 1fr; }
  .sheet-main, .sheet-side { grid-column: 1; }
  .dept { grid-template-columns: minmax(0, 1fr) auto; row-gap: 10px; }
  .dside { grid-column: 1; grid-row: 1; }
  .dneed { grid-column: 2; grid-row: 1; }
  .chips { grid-column: 1 / -1; }
  .chip { grid-template-columns: minmax(0, 1fr) auto auto 24px; }
  .team-row { flex-direction: column; gap: 6px; }
  .team-post { width: auto; }
  .cal-cell { min-height: 58px; padding: 3px; gap: 2px; }
  .cal-head div { padding: 6px 2px; text-align: center; font-size: 11px; }
  .cal-chip { padding: 0; height: 8px; border-width: 0; border-radius: 4px; background: var(--line); }
  .cal-chip.s-ok { background: var(--ok); }
  .cal-chip.s-warn { background: var(--warn); }
  .cal-chip.s-bad { background: var(--bad); }
  .cal-chip[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); }
  .cal-chip .nm, .cal-chip .ct { display: none; }
  .cd { font-size: 14px; width: 22px; height: 22px; }
  .code-display { font-size: 2.6rem; letter-spacing: .2em; }
  .error-code { font-size: 5rem; }
  .form-actions .btn { flex: 1 1 auto; }
  .actions { white-space: normal; }
}

/* Envoyer */
.send-dates { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 10px 14px 12px; margin: 0 0 12px; display: grid; gap: 8px; }
.send-dates legend { font: 600 12px/1.3 var(--body); color: var(--muted); padding: 0 6px; }
.send-table { margin-top: 18px; }
.send-table td[rowspan] { border-right: 1px solid var(--line); background: var(--bg); }
.send-action { display: inline-flex; align-items: center; gap: 8px; margin-left: 8px; vertical-align: middle; }

/* Messages to the people booked on a date */
.recipients { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 8px 14px 12px; margin: 0 0 16px; display: grid; gap: 2px; }
.recipients legend { font: 600 12px/1.3 var(--body); color: var(--muted); padding: 0 6px; }
.recipient { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; }
.recipient-name { font-weight: 500; }
.msg-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.msg-item:last-child { border-bottom: 0; padding-bottom: 0; }
.msg-meta { font-size: 12px; color: var(--muted); }
.msg-body { margin: 6px 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-recipients { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }

/* Technical offer */
.offer-page .sub { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.offer-page .facts { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.offer-section { margin: 0; }
.offer-section > h2 { margin-bottom: .8em; padding-bottom: 0; border-bottom: 0; }
.offer-section > .tablewrap { border-radius: var(--radius); }
table.offer { table-layout: fixed; min-width: 720px; }
table.offer td, table.offer th { padding: 9px 12px; }
table.offer .c-qty { width: 64px; }
table.offer .c-price { width: 120px; }
table.offer .c-disc { width: 168px; }
table.offer .c-total { width: 116px; }
table.offer .c-act { width: 112px; }
table.offer td.num { font-family: var(--mono); font-size: 13px; }
table.offer td.strong, table.offer tfoot td { font-weight: 600; color: var(--ink); }
table.offer tfoot th { text-align: right; background: var(--bg); color: var(--muted); font-weight: 600; }
table.offer tfoot td, table.offer tfoot th { background: var(--bg); border-top: 1px solid var(--line-strong); }
table.offer td.disc { white-space: nowrap; font-size: 13px; }
table.offer td.act, table.offer th.act { text-align: right; white-space: normal; }
table.offer tr.edited td.desc { box-shadow: inset 3px 0 0 var(--accent); }
table.offer tr.by-regie td { background: var(--info-soft); }
table.offer tr.by-regie td.desc { box-shadow: inset 3px 0 0 var(--info); }
.regie-tag { margin-left: 6px; vertical-align: 1px; }
/* The régisseur's changes, at the top of the DT's offer (Marius 2026-12-04) */
.regie-review { margin: 0 0 20px; padding: 16px 20px; border: 1px solid var(--info); border-left-width: 4px; border-radius: 12px; background: var(--info-soft); color: var(--info); }
.regie-review h2 { margin: 0 0 6px; font-size: 17px; color: var(--info); }
.regie-review-ask { margin: 0 0 8px; font-weight: 600; }
.regie-review-list { margin: 0; padding-left: 18px; color: var(--ink); }
.regie-review-list li { margin: 3px 0; }
.regie-review-list .mono { color: var(--info); font-size: 13px; margin-right: 4px; }
.regie-review-list small { color: var(--muted); }
.regie-review-note { margin: 8px 0 0; font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.owned { color: var(--accent-text); font-weight: 700; margin-right: 4px; }
.neg { color: var(--bad); font-family: var(--mono); font-size: 13px; }
.line-hint { font-size: 12px; color: var(--warn); margin-top: 2px; }
.inline-edit { padding: 2px 4px; margin: -2px -4px; border-radius: 4px; color: inherit; text-decoration: none; cursor: text; }
.inline-edit:hover { background: var(--hover); box-shadow: 0 0 0 1px var(--line-strong); }
td .inline-input, .inline-input { width: 100%; min-width: 70px; min-height: 0; padding: 3px 6px; border: 1px solid var(--accent-text); background: var(--panel); border-radius: 6px; }
td.num .inline-input { max-width: 110px; text-align: right; font-family: var(--mono); }
.adder { margin-top: 14px; }
.adder > summary { cursor: pointer; color: var(--accent-text); font-weight: 600; padding: 4px 0; }
.line-form { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin: 12px 0 0; }
.line-form label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 12px; color: var(--muted); }
/* every field, select and button of a line form has one height, so their bottoms line up */
.line-form input:not([type="checkbox"]):not([type="hidden"]), .line-form select, .line-form .btn { height: 40px; min-height: 40px; }
.line-form label.check { flex-direction: row; font-size: 13px; color: var(--ink); min-height: 40px; align-items: center; }
.line-form .grow { flex: 1 1 260px; }
.line-form .narrow { flex: 0 0 110px; }
.line-form.stacked { flex-direction: column; align-items: stretch; max-width: 420px; }
.panel > .line-form + .line-form { margin-top: 18px; }
.card .line-form.stacked { max-width: none; margin-top: 10px; }
.card .line-form.stacked .btn { align-self: flex-start; }
.edit-info > summary { cursor: pointer; font-weight: 600; }
.offer-total .card-big { font-size: 30px; }
.offer-total dl { margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
.offer-total dl > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.offer-total dt { color: var(--muted); }
.offer-total dd { margin: 0; text-align: right; font-size: 13px; }
.offer-total dl > div.sep { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.card-action { margin-top: 12px; text-align: center; justify-content: center; }
@media (max-width: 640px) {
  .offer-page .facts { grid-template-columns: 1fr; }
  .line-form .narrow { flex: 1 1 90px; }
}

/* Offer list and status actions */
.search { display: flex; gap: 8px; align-items: center; margin: 0; }
.search input[type="search"] { width: 240px; max-width: 100%; }
.offers-list td a { text-decoration: none; }
.offers-list td a:hover { text-decoration: underline; }
.issue.changed ul { margin: 6px 0; padding-left: 20px; }
.issue.changed form { display: inline; margin-left: 6px; }
@media (max-width: 640px) { .search { width: 100%; } .search input[type="search"] { flex: 1 1 auto; width: auto; } }

/* Régisseur equipment view and proposals */
table.offer.equip { min-width: 0; table-layout: auto; }
table.offer.equip td.desc { width: auto; }
.equip .line-name { margin-right: 6px; overflow-wrap: anywhere; }
.propose { margin-top: 6px; }
.propose > summary { cursor: pointer; font-size: 13px; color: var(--accent-text); font-weight: 600; }
.propose .line-form { margin-top: 8px; }
.prop { padding: 10px 0; border-top: 1px solid var(--line); }
.prop:first-of-type { border-top: 0; padding-top: 2px; }
.prop-head { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.prop-note { margin-top: 4px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.prop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.prop-actions form { display: flex; gap: 8px; align-items: center; margin: 0; }
.prop-actions input[type="text"] { min-height: 0; padding: 4px 8px; width: 200px; max-width: 100%; }
.proposals-box > h2 { display: flex; align-items: center; gap: 8px; }
.proposals-box { border-left: 3px solid var(--accent); }
@media (max-width: 600px) {
  .offer-cards.tablewrap { background: transparent; border: 0; overflow: visible; }
  table.offer.equip, table.offer.equip tbody, table.offer.equip tfoot, table.offer.equip tr, table.offer.equip td, table.offer.equip th { display: block; }
  table.offer.equip thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.offer.equip tbody tr { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
  table.offer.equip td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; text-align: right; }
  table.offer.equip td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex: 0 0 auto; padding-top: 2px; }
  table.offer.equip td.desc { display: block; text-align: left; padding-bottom: 6px; font-weight: 600; }
  table.offer.equip td.desc::before { content: none; }
  table.offer.equip td.disc:empty { display: none; }
  table.offer.equip tfoot tr { background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 10px 12px; }
  table.offer.equip tfoot th { display: block; text-align: left; border: 0; background: transparent; padding: 0 0 4px; }
  table.offer.equip tfoot td { background: transparent; border: 0; }
  table.offer.equip tfoot td::before { content: none; }
  table.offer.equip td.empty { display: block; text-align: center; }
  table.offer.equip td.empty::before { content: none; }
  .propose .line-form { flex-direction: column; align-items: stretch; }
}

/* Monthly recap */
.recap-month { align-items: center; }
.recap-month a { padding: 7px 12px; }
.recap-month-name { padding: 7px 16px; font-weight: 600; min-width: 11ch; text-align: center; }
/* The summary panel: the month total on the left, the month and its state in the middle, the exports on the right */
.recap-summary { display: grid; grid-template-columns: minmax(260px, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "total period exports"; align-items: center; gap: 16px 24px; }
.recap-period { grid-area: period; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.recap-exports { grid-area: exports; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.recap-exports .btn { min-width: 190px; justify-content: center; }
.recap-summary > .recap-total, .recap-summary > .empty { grid-area: total; }
@media (max-width: 860px) {
  .recap-summary { grid-template-columns: 1fr; grid-template-areas: "period" "total" "exports"; }
  .recap-exports { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; }
}
.recap-flags { margin: 0; }
.recap-flags:empty { display: none; }
.recap-total { max-width: 360px; width: 100%; }
.recap-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 12px; }
.recap-head h2 { margin: 0; padding: 0; border: 0; }
.recap-sub { margin-left: auto; font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--accent-text); }
.recap-info .recap-head { margin-bottom: 12px; }
.recap-info td[rowspan] { border-right: 1px solid var(--line); background: var(--bg); }
.card-badge { margin-left: 8px; }
.card.on .card-badge { background: var(--accent-text); color: #fff; }

/* Planning page: shared header, KPI cards, tabs, month bar, list */
.pagehead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 4px; }
.pagehead h1 { flex: 1 1 auto; margin: 0; font-size: 2.4rem; line-height: 1.1; letter-spacing: -.02em; }
.pagehead .seg { padding: 3px; border-radius: 10px; }
.pagehead .seg a { border-radius: 8px; padding: 7px 16px; }
.pagehead .seg a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.pagehead .btn { border-radius: 10px; padding: 9px 16px; }
.syncline { flex: 0 0 100%; margin: 0; font-size: 13px; color: var(--muted); }
.syncerr { color: var(--bad); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin: 20px 0 24px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 22px; }
.kpi > span { display: block; color: var(--muted); font-size: 14px; }
.kpi b { display: block; font-size: 30px; font-weight: 600; letter-spacing: -.01em; margin: 2px 0; line-height: 1.2; }
.kpi small { color: var(--muted); font-size: 13px; }
.kpi.gold { background: var(--accent-soft); border-color: transparent; }
.kpi.gold b { color: var(--accent-soft-ink); }
.kpi.bad b { color: var(--bad); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 500; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.tab-count { color: var(--accent-text); margin-left: 2px; font-weight: 600; }
.monthbar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin-bottom: 14px; }
.pagehead + .monthbar { margin-top: 18px; }
.planning[data-view="mois"] .monthbar { margin-top: 20px; }   /* same top as the list view cards */
.monthbar .btn { border-radius: 10px; }
.monthbar .btn.icon { width: 40px; height: 40px; padding: 0; }
.monthname { font-size: 20px; font-weight: 600; min-width: 170px; text-align: center; text-transform: capitalize; }
.searchform { flex: 1 1 220px; max-width: 380px; margin-left: auto; }
input.plansearch { width: 100%; border-radius: 10px; padding: 10px 14px; background: var(--panel); }
.planlist { border-radius: 14px; }
.planlist th { background: var(--accent-soft); color: var(--accent-soft-ink); padding: 12px 16px; }
.planlist td { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.planlist tbody tr:hover { background: var(--hover); }
.planlist tr.row { position: relative; cursor: pointer; }
.planlist tr.todo td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.planlist tr.faded td, .planlist tr.past td { opacity: .6; }
.planlist tr.row { scroll-margin-top: 90px; }
.planlist .r { text-align: right; white-space: nowrap; }
.planlist .d, .planlist td.mono { white-space: nowrap; }
.planlist .d small { display: block; color: var(--muted); font-size: 12px; }
.planlist .t b { display: block; font-weight: 600; overflow-wrap: break-word; }
.planlist .t small { color: var(--muted); }
.planlist .states { min-width: 180px; }
.planlist .states .pill { margin: 2px 4px 2px 0; }
.rowlink { color: var(--ink); text-decoration: none; font-weight: 500; }
.rowlink::after { content: ""; position: absolute; inset: 0; }
.rowlink:focus-visible { outline: none; }
.rowlink:focus-visible::after { outline: 2px solid var(--accent-text); outline-offset: -2px; border-radius: 4px; }
.crew { display: flex; align-items: center; gap: 10px; min-width: 130px; }
.crew meter.meter { flex: 1; margin-top: 0; }
.planning .cal { margin-top: 0; }
@media (max-width: 640px) {
  .pagehead h1 { font-size: 1.9rem; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0 18px; }
  .kpi { padding: 10px 14px; }
  .kpi b { font-size: 22px; }
  .tabs a { padding: 8px 10px; }
  .monthname { min-width: 0; flex: 1; font-size: 17px; }
  .searchform { flex-basis: 100%; max-width: none; }
  .hide-s { display: none; }
  .planlist th, .planlist td { padding: 10px; }
  .planlist .states { min-width: 0; }
  .crew { min-width: 0; }
  .crew meter.meter { display: none; }
  .planlist .pill { white-space: normal; }
  .planlist .t { min-width: 110px; }
  .planlist .d small { display: none; }
}

/* "Nouvelle journée" dialog */
dialog.modal { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--panel); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); overflow: hidden; }
dialog.modal[open] { display: flex; flex-direction: column; }
#new-day-target, #new-day-target > form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
dialog.modal::backdrop { background: rgba(15, 15, 18, .55); }
.modal-head { display: flex; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.25rem; flex: 1; }
.modal .x { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--hover); color: var(--muted); text-decoration: none; cursor: pointer; transition: background .15s, color .15s; }
.modal .x:hover { color: var(--ink); background: var(--line); }
.modal-body { padding: 20px 24px; display: grid; gap: 14px; overflow-y: auto; flex: 1 1 auto; align-content: start; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--bg); }
.modal .form { grid-template-columns: 1fr 1fr; }
.form-error { border: 1px solid var(--bad-line); background: var(--bad-soft); color: var(--bad); border-radius: 8px; padding: 8px 12px; font-size: .9rem; }
.form-error ul { margin: 0; padding-left: 1.1em; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: min(420px, calc(100% - 32px)); background: #141414; color: #F3E3BF; border-radius: 10px; padding: 12px 16px; font-size: .95rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.toast[hidden] { display: none; }
.toast-error { background: var(--bad); color: #fff; }
@media (max-width: 600px) { .modal .form { grid-template-columns: 1fr; } .modal-body, .modal-head { padding-left: 16px; padding-right: 16px; } .modal-foot { padding: 12px 16px; } .toast { left: 16px; right: 16px; bottom: 16px; } }

/* One page shape everywhere (Planning, Équipe, Offres, Réglages): title row, card row, then content */
.cards { margin: 20px 0 24px; }
.cards .card { padding: 16px 22px; border-radius: 14px; }
.cards .card-figure { font-size: 30px; margin: 2px 0; }
.pagenote { flex: 0 0 100%; margin: 0; font-size: 13px; color: var(--muted); }
.pagehead .form-actions { margin-top: 0; }
.kpi-empty b { color: var(--line); }
@media (max-width: 640px) { .cards .card { padding: 10px 14px; } .cards .card-figure { font-size: 22px; } }
/* Same height for every page title row (Planning has a sync line under its title), so the cards never move */
.pagehead { min-height: 74px; align-content: flex-start; }  /* the tallest head (title + note); every page's cards then start at the same height */

/* Planning list by season: a heading row per month, the "+ Nouvelle journée" card, the ignored dates line */
.planlist tr.monthrow th { background: var(--bg); color: var(--ink); font-size: 14px; font-weight: 600; text-align: left; padding: 14px 16px 8px; border-top: 1px solid var(--line); }
.planlist tbody tr.monthrow:first-child th { border-top: 0; }
.kpi-action { display: block; color: var(--ink); text-decoration: none; border-style: dashed; transition: border-color .15s, background .15s; }
.kpi-action b { color: var(--accent-text); }
.kpi-action:hover { border-color: var(--accent); background: var(--accent-soft); }
.ignoredline { margin: 14px 0 0; font-size: 13px; color: var(--muted); }

/* Turbo's loading bar (its own <style> is refused by the CSP, so it is styled here) */
.turbo-progress-bar { position: fixed; display: block; top: 0; left: 0; height: 3px; background: var(--accent); z-index: 2147483647; transition: width 300ms ease-out, opacity 150ms 150ms ease-in; transform: translate3d(0, 0, 0); }

/* Date sheet cards (same row as the planning KPIs) */
a.kpi-link { display: block; color: var(--ink); text-decoration: none; transition: border-color .15s; }
a.kpi-link:hover { border-color: var(--muted); }
.kpi b.kpi-text { font-size: 22px; line-height: 1.6; }
form.kpi-action { display: flex; flex-direction: column; align-items: flex-start; margin: 0; }
.kpi-button { border: 0; background: none; padding: 0; margin: 2px 0; cursor: pointer; font: inherit; font-size: 22px; font-weight: 600; line-height: 1.6; color: var(--accent-text); }
.kpi-button:hover { text-decoration: underline; }
.pagenote .inline-form { display: inline; }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-text); text-decoration: underline; cursor: pointer; }

/* Date sheet: same rhythm as the planning (cards right under the title), notes across the four cards. */
.detail > .kpis { margin: 0; }
.detail > .pagehead { margin-bottom: 0; }  /* cards at the same height as on the planning (flex gap 20px) */
.notes { margin: 0; padding: 16px 20px; }
.notes-label { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.notes textarea { grid-column: 1; width: 100%; min-height: 64px; resize: vertical; }
.notes-actions { grid-column: 2; }
.kpi-infos small { display: block; }
.kpi-infos small + small { margin-top: 2px; }
a.card-link { display: block; color: var(--ink); text-decoration: none; transition: border-color .15s; }
a.card-link:hover { border-color: var(--muted); }
.card-name { margin: 4px 0 2px; font-size: 18px; font-weight: 600; }
.from-google { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.pick-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.pick-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.pick-card:hover { border-color: var(--muted); background: var(--hover); }
.pick-card.on { border-color: var(--accent); background: var(--accent-soft, var(--hover)); }
.pick-card b { display: block; font-weight: 600; }
.pick-card small { display: block; font-size: 12px; color: var(--muted); }
.pick-card .avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 600; }
#regie-dialog { width: min(720px, calc(100% - 24px)); }

/* Page changes (Turbo): a short cross-fade instead of a cut; the black band does not move. */
.topbar { view-transition-name: topbar; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 140ms; }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }
.pick-card > span:last-child { min-width: 0; overflow-wrap: anywhere; }

/* The need stepper replaces the n / m count: its number turns red while the post is short, amber when over. */
.dept.short .stepper output { color: var(--bad); }
.dept.over .stepper output { color: var(--warn); }
.dept.full .stepper output { color: var(--ok); }
/* "Envoyer" sits next to the "À envoyer" pill: same height. */
.btn.chip-btn { min-height: 0; padding: 2px 10px; border-radius: 6px; font: 600 12px/1.5 var(--body); }
.team h2 .pill { font-size: 12px; }
/* Notes save as you type. */
.notes form { display: block; }
.notes-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.notes-head label { font-size: 13px; color: var(--muted); }
.notes-state { font-size: 12px; color: var(--muted); }
.notes-state.bad { color: var(--bad); }
.notes textarea { display: block; width: 100%; }
/* "Fiche technique" card: the whole card is the switch. */
.kpi-toggle { padding: 0; }
.kpi-toggle button { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; width: 100%; height: 100%; padding: 16px 22px; border: 0; border-radius: inherit; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.kpi-toggle:hover { border-color: var(--muted); }
.kpi-toggle button > span { display: block; color: var(--muted); font-size: 14px; }
.kpi-toggle .kpi-text.ok { color: var(--ok); }
/* Messages dialog of the date sheet */
dialog.modal.modal-wide { width: min(760px, calc(100% - 24px)); }
.msg-form { display: grid; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.msg-label { font-weight: 600; }
.msg-form textarea { width: 100%; min-height: 96px; resize: vertical; }
.msg-form .recipients { margin: 0; }
.msg-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.msg-history-title { margin: 4px 0 0; font-size: 1rem; }
.msg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.msg-meta .pill { font-size: 11px; }
/* History of the Messages dialog: one line per event and person. */
.msg-log { width: 100%; border-collapse: collapse; font-size: 13px; }
.msg-log th { padding: 6px 10px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); }
.msg-log td { padding: 9px 10px; vertical-align: top; border-bottom: 1px solid var(--line); }
.msg-log tr:last-child td { border-bottom: 0; }
.msg-log td.when { width: 92px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.msg-log td:nth-child(2) { width: 140px; }
.msg-log td:nth-child(3) { width: 170px; font-weight: 500; }
.msg-log small { display: block; margin-top: 2px; font-weight: 400; color: var(--muted); font-size: 12px; }
.msg-log .msg-body { margin: 0; }
.msg-log td small + .msg-body, .msg-log td .msg-body + small { margin-top: 4px; }
/* With JavaScript a confirmation is shown as the toast, never as a banner in the page. */
.js .flash[data-toast] { display: none; }
dialog.modal:focus { outline: none; }   /* opening focuses the box itself (autofocus): no ring around it */
/* Envois: jobs to tick and send together */
.jobs th.pick, .jobs td.pick { width: 36px; text-align: center; }
.jobs td { vertical-align: top; }
.jobs label { cursor: pointer; }
.job-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.jobs-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 14px; }
.nowrap { white-space: nowrap; }

/* New and edit forms (posts, catalogue, productions), in the dialog or on their fallback page: two columns */
.form.form-2 { grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form .full { grid-column: 1 / -1; }
.form small.hint { text-transform: none; letter-spacing: 0; font-size: 12px; line-height: 1.35; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); text-transform: none; letter-spacing: 0; }
.form label.check.end { align-self: end; min-height: 40px; }
.page-form { max-width: 640px; }
@media (max-width: 600px) { .form.form-2 { grid-template-columns: 1fr; } }

/* Offer page: the four cards of the planning shape, the sections full width, the discount last */
.offer-page .kpi-action small { display: block; overflow-wrap: anywhere; }
.offer-discount .discount-grid { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.offer-discount .line-form { flex: 1 1 420px; grid-template-columns: 1fr 1fr auto; max-width: 560px; }
.discount-sum { margin: 0; min-width: 280px; display: flex; flex-direction: column; gap: 6px; }
.discount-sum > div { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.discount-sum dt { color: var(--muted); }
.discount-sum dd { margin: 0; text-align: right; }
.discount-sum > div.sep { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; font-weight: 600; font-size: 16px; }
.discount-sum > div.sep dt { color: var(--ink); }
.pagenote .pill { padding-top: 0; padding-bottom: 0; line-height: 18px; }   /* a pill in the note keeps the head at its height */
.kpi-split { margin: 8px 0 0; padding-top: 6px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.kpi-split > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.kpi-split dd { margin: 0; color: var(--ink); }
.kpi-empty b.kpi-text { color: var(--muted); }
.kpi-send { padding: 0; display: flex; flex-direction: column; }
.kpi-send-main { display: flex; flex-direction: column; align-items: stretch; flex: 1; width: 100%; padding: 16px 22px; border: 0; border-radius: inherit; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.kpi-send-main > span { display: block; color: var(--muted); font-size: 14px; }
.kpi-send-main b.kpi-text { color: var(--accent-text); }
.kpi-send-main small { overflow-wrap: anywhere; }
.kpi-send-open:hover { border-color: var(--muted); }
a.kpi-send-main { text-decoration: none; }
form.kpi-send { margin: 0; }
.send-attachment { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
div.kpi-send-main { cursor: default; }
div.kpi-send-main b.kpi-text { color: inherit; }
div.kpi-send-main b.kpi-text.ok { color: var(--ok); }
.kpi-send form.kpi-validate { display: block; }
.kpi-send .kpi-validate { margin: 0 22px 16px; align-self: flex-start; }

.offer-downloads { white-space: nowrap; text-align: right; }
.offer-downloads .btn + .btn { margin-left: 6px; }

.form-sub { margin: 18px 0 8px; font-size: 14px; }
