/* Layout: barre de commande compacte, grille planning pleine largeur (défilement horizontal interne), récapitulatif en dessous */
:root {
  /* Couleurs de la Clinique Drouot : bleu #334271 */
  --bg: #EEF1F7; --surface: #FFFFFF; --surface-2: #E2E7F1; --fg: #141A2C; --muted: #5A6480;
  --line: #CDD5E4; --accent: #334271; --accent-fg: #FFFFFF; --night: #2F6FD0;
  --off: #E8EBF2; --ferie: #F6E7CF; --warn: #B4540A; --danger: #B83A26; --ok: #2E7D4F;
  --today: #334271; --vacs: #EEE9FA;
  --f-display: "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0E1220; --surface: #151B2C; --surface-2: #1C2438; --fg: #E4E8F3; --muted: #97A2BD;
  --line: #2A3350; --accent: #9DB0EA; --accent-fg: #0B1430; --night: #7FB0FF;
  --off: #121828; --ferie: #2B2216; --warn: #F0A15E; --danger: #F07A64; --ok: #6FCB94;
  --today: #9DB0EA; --vacs: #262138; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0E1220; --surface: #151B2C; --surface-2: #1C2438; --fg: #E4E8F3; --muted: #97A2BD;
  --line: #2A3350; --accent: #9DB0EA; --accent-fg: #0B1430; --night: #7FB0FF;
  --off: #121828; --ferie: #2B2216; --warn: #F0A15E; --danger: #F07A64; --ok: #6FCB94;
  --today: #9DB0EA; --vacs: #262138; color-scheme: dark; }
html, body { margin: 0; }
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 14px; line-height: 1.4; }
.wrap { padding-block: 20px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 16px; max-width: 1800px; margin: 0 auto; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

header.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.brand { display: grid; gap: 2px; min-width: 0; }
.brand .eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.brand h1 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 30px; letter-spacing: .01em; line-height: 1; text-wrap: balance; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status[data-s="ok"] i { background: var(--ok); }
.status[data-s="ro"] i { background: var(--warn); }
.status[data-s="off"] i { background: var(--danger); }

.bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.nav { display: flex; align-items: center; gap: 6px; }
.btn { border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 6px; min-height: 34px; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
.btn.icon { width: 34px; padding: 0; display: inline-grid; place-items: center; font-size: 16px; }
.btn.danger { color: var(--danger); }
.period { font-family: var(--f-display); font-size: 22px; font-weight: 600; min-width: 0; padding: 0 6px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 6px 12px; min-height: 32px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); font-weight: 600; }
.spacer { flex: 1; }

.palette { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.palette .lbl { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-right: 4px; }
.chip { --c: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 4px; border: 1px solid transparent; background: color-mix(in srgb, var(--c) 16%, var(--surface)); border-left: 3px solid var(--c); font-size: 12px; }
.chip b { font-family: var(--f-mono); font-weight: 600; font-size: 12px; }
.chip[aria-pressed="true"] { outline: 2px solid var(--fg); outline-offset: 1px; }
.chip.plain { background: var(--surface-2); border-left-color: var(--line); }
.hint { font-size: 12px; color: var(--muted); }

.banner { padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }

/* Grille */
.grid-wrap { overflow: auto; max-height: 86vh; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
table.grid { border-collapse: separate; border-spacing: 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.grid th, .grid td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0; text-align: center; vertical-align: middle; white-space: nowrap; background: var(--surface); }
.grid thead { position: sticky; top: 0; z-index: 5; }
.grid thead th { position: static; background: var(--surface-2); font-weight: 600; }
.grid thead tr.r1 th { height: 42px; }
.grid thead tr.r2 th { height: 22px; font-size: 10px; color: var(--muted); letter-spacing: .06em; }
.grid .rowh { position: sticky; left: 0; z-index: 2; text-align: left; padding: 2px 10px; background: var(--surface); min-width: 170px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.grid thead th.rowh { z-index: 4; background: var(--surface-2); }
.mode-month .grid .rowh { min-width: 120px; max-width: 150px; }
.grid .rowh .nm { font-weight: 500; }
.grid .rowh .tri { font-family: var(--f-mono); font-size: 11px; color: var(--muted); margin-right: 6px; }
.dayh { line-height: 1.15; padding: 2px 4px !important; }
.dayh .dw { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.dayh .dn { font-family: var(--f-display); font-size: 18px; font-weight: 700; }
.dayh .hn { display: block; font-size: 9px; color: var(--warn); font-weight: 600; max-width: 90px; overflow: hidden; text-overflow: ellipsis; margin: 0 auto; }
.mode-month .dayh .hn { display: none; }
.dayh.today .dn { color: var(--accent-fg); background: var(--today); border-radius: 4px; padding: 0 5px; }
th.dayh.off, td.off { background: var(--off); }
th.dayh.ferie, td.ferie { background: var(--ferie); }
.grid thead th.dayh.off { background: color-mix(in srgb, var(--off) 70%, var(--surface-2)); }
.grid thead th.dayh.ferie { background: var(--ferie); }

.grid tr.group th { text-align: left; padding: 3px 10px; font-family: var(--f-display); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; background: var(--surface-2); position: sticky; left: 0; }
.grid tr.group td { background: var(--surface-2); }
.grid tr.oncall .rowh { color: var(--night); font-weight: 600; }
.grid td.oc { height: 26px; font-family: var(--f-mono); font-weight: 600; color: var(--night); background: color-mix(in srgb, var(--night) 7%, var(--surface)); }
.grid td.oc.empty { color: var(--muted); font-weight: 400; }
.grid td.oc.need { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--warn) 14%, var(--surface)) 0 6px, var(--surface) 6px 12px); color: var(--warn); }
.grid td.na { background: var(--off); }

td.cell { --c: transparent; height: 30px; min-width: 66px; position: relative; }
.mode-month td.cell { min-width: 36px; height: 24px; }
td.cell.has { background: color-mix(in srgb, var(--c) 18%, var(--surface)); box-shadow: inset 3px 0 0 var(--c); }
td.cell b { font-family: var(--f-mono); font-weight: 600; font-size: 12px; display: block; }
td.cell small { display: none; font-size: 10px; color: var(--muted); max-width: 84px; overflow: hidden; text-overflow: ellipsis; margin: 0 auto; }
.mode-month td.cell small { display: none; }
td.half-a { border-right-width: 2px !important; }
td.off { min-width: 34px; font-size: 10px; color: var(--muted); }
.mode-month td.off { min-width: 24px; }
td.off .aj { display: inline-block; font-family: var(--f-mono); font-weight: 600; color: var(--night); }
.edit td.cell, .edit td.oc { cursor: pointer; }
.edit td.cell:hover, .edit td.oc:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.nightmark::after { content: "A"; position: absolute; right: 2px; bottom: 1px; font-size: 9px; font-family: var(--f-mono); font-weight: 600; color: var(--surface); background: var(--night); border-radius: 2px; padding: 0 2px; line-height: 12px; }
td.off.nightmark { position: relative; }
td.cell.warn::before { content: ""; position: absolute; top: 0; left: 0; border-style: solid; border-width: 9px 9px 0 0; border-color: var(--warn) transparent transparent transparent; }
tr.foot td, tr.foot th { background: var(--surface-2); font-family: var(--f-mono); font-size: 11px; height: 24px; color: var(--muted); }
tr.foot td.zero { color: var(--danger); font-weight: 600; }
tr.foot .rowh { font-family: var(--f-body); background: var(--surface-2); }
.empty-row td { padding: 18px 12px !important; text-align: left !important; color: var(--muted); white-space: normal !important; position: sticky; left: 0; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--muted); align-items: center; }
.legend .k { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line); display: inline-block; position: relative; }

/* Récap */
section.recap { display: grid; gap: 10px; }
section.recap h2 { margin: 0; font-family: var(--f-display); font-size: 20px; font-weight: 700; letter-spacing: .02em; }
.recap-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
table.rc { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 13px; }
table.rc th, table.rc td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.rc th:first-child, table.rc td:first-child { text-align: left; }
table.rc thead th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: var(--surface-2); }
table.rc td.n { color: var(--night); font-weight: 600; }
table.rc .role { font-size: 11px; color: var(--muted); margin-left: 6px; font-family: var(--f-mono); }

/* Popover & dialogues */
#pop { position: fixed; z-index: 50; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 10px; width: 280px; max-height: 70vh; overflow: auto; display: grid; gap: 8px; }
#pop h3 { margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
#pop .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#pop .opts.one { grid-template-columns: 1fr; }
#pop .chip { justify-content: flex-start; cursor: pointer; width: 100%; text-align: left; padding: 6px 9px; }
#pop .chip .cnt { margin-left: auto; font-family: var(--f-mono); color: var(--muted); font-size: 11px; }
@media (max-width: 600px) { #pop { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; border-radius: 12px 12px 0 0; padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); } }

.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(5,15,14,.45); display: grid; place-items: center; padding: 16px; }
.dialog { background: var(--surface); border-radius: 10px; border: 1px solid var(--line); width: min(680px, 100%); max-height: 88vh; overflow: auto; display: grid; gap: 14px; padding: 18px; }
.dialog h2 { margin: 0; font-family: var(--f-display); font-size: 22px; }
.dialog .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rows { display: grid; gap: 6px; }
.row { display: grid; gap: 6px; align-items: center; }
.team .row { grid-template-columns: minmax(0,1fr) 64px 150px auto; }
.row input[type=number] { border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 5px; padding: 6px 6px; min-width: 0; width: 100%; }
.team .row.rx { grid-template-columns: minmax(0, 1fr); margin: -2px 0 6px 10px; padding-left: 10px; border-left: 2px solid var(--line); }
.row.rx label { display: grid; gap: 2px; font-size: 11px; color: var(--muted); min-width: 0; }
.row input[type=date] { border: 1px solid var(--line); background: var(--bg); border-radius: 5px; padding: 5px 6px; min-width: 0; width: 100%; color: var(--fg); }
.grid .rowh .sub { display: block; font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.dialog:has(.tpl) { width: min(1120px, 100%); }
.tpl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table.tpl { border-collapse: collapse; font-size: 12px; }
table.tpl th, table.tpl td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 3px; text-align: center; white-space: nowrap; }
table.tpl thead th { background: var(--surface-2); font-size: 11px; color: var(--muted); font-weight: 600; }
table.tpl tbody th { text-align: left; padding: 3px 10px; font-weight: 500; position: sticky; left: 0; background: var(--surface); }
table.tpl .tri { font-family: var(--f-mono); font-size: 11px; color: var(--muted); margin-right: 6px; }
table.tpl td.has { background: color-mix(in srgb, var(--c) 18%, var(--surface)); box-shadow: inset 3px 0 0 var(--c); }
table.tpl td.half-a { border-right-width: 2px; }
table.tpl select { font-family: var(--f-mono); font-size: 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); padding: 3px 2px; width: 62px; }
.tpl-apply { display: grid; gap: 6px; justify-items: start; }
table.tpl select.wide { width: 86px; }
.tabs { flex-wrap: wrap; justify-self: start; }
.surg-l .row { grid-template-columns: minmax(0,1fr) 64px minmax(0,1fr) auto; }
.rooms-l .row { grid-template-columns: 80px minmax(0,1fr) auto; }
.sabs-list .row { grid-template-columns: minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr) auto; }
.sabs-list .row.add { grid-template-columns: minmax(0,1.2fr) 140px 140px minmax(0,1fr) auto; }
.ratios { display: flex; flex-wrap: wrap; gap: 16px; }
.ratios label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.ratios input { width: 90px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 5px; padding: 6px 8px; }
.grid td.sv { height: 26px; font-family: var(--f-mono); font-size: 11px; font-weight: 600; }
.grid td.sopen { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.grid td.sabs { color: var(--danger); text-decoration: line-through; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--danger) 12%, var(--surface)) 0 5px, var(--surface) 5px 10px); }
tr.foot td.ok { color: var(--ok); font-weight: 600; }
tr.foot td.over { color: var(--warn); }
td.cell.out:not(.has) { background: repeating-linear-gradient(45deg, var(--off) 0 4px, var(--surface) 4px 8px); }
.acts .row { grid-template-columns: 70px minmax(0,1fr) 130px 44px auto; }
.row input[type=text], .row select { border: 1px solid var(--line); background: var(--bg); border-radius: 5px; padding: 6px 8px; min-width: 0; width: 100%; }
.row input[type=color] { width: 44px; height: 32px; border: 1px solid var(--line); border-radius: 5px; padding: 2px; background: var(--bg); }
.row .ops { display: flex; gap: 4px; }
.row .ops .btn { min-height: 30px; padding: 4px 8px; }
.row.add { padding-top: 10px; border-top: 1px dashed var(--line); }
.cols-h { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
@media (max-width: 560px) {
  .team .row { grid-template-columns: 1fr 64px; }
  .acts .row { grid-template-columns: 64px 1fr; }
  .team .row.rx { grid-template-columns: 1fr 1fr; }
  .surg-l .row, .sabs-list .row, .sabs-list .row.add { grid-template-columns: 1fr 1fr; }
  .rooms-l .row { grid-template-columns: 70px 1fr; }
  .row .ops { grid-column: 1 / -1; justify-content: flex-end; }
  .cols-h { display: none !important; }
}
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 70; background: var(--fg); color: var(--bg); padding: 9px 14px; border-radius: 6px; font-size: 13px; max-width: calc(100% - 32px); }
@media (prefers-reduced-motion: no-preference) { td.cell, td.oc { transition: background-color .15s; } }

/* Connexion et comptes */
.account { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.who { font-size: 13px; color: var(--muted); }
.who b { color: var(--fg); font-weight: 600; }
.badge { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: var(--surface-2); color: var(--muted); margin-left: 6px; }
.badge.admin { background: var(--accent); color: var(--accent-fg); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left, 0px)); }
.login-card { width: min(380px, 100%); display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 28px 24px; }
.login-card .eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.login-card h1 { margin: 0 0 12px; font-family: var(--f-display); font-size: 28px; font-weight: 700; }
.login-card label { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 6px; }
.login-card input { border: 1px solid var(--line); background: var(--bg); border-radius: 6px; padding: 10px 12px; font-size: 16px; }
.login-card .btn { margin-top: 12px; min-height: 42px; }
.login-err { margin: 4px 0 0; color: var(--danger); font-size: 13px; }
.users .row { grid-template-columns: 110px minmax(0,1fr) 120px minmax(0,1.1fr) minmax(0,1fr) auto; }
.users .row .login-id { font-family: var(--f-mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.row input[type=password] { border: 1px solid var(--line); background: var(--bg); border-radius: 5px; padding: 6px 8px; min-width: 0; width: 100%; color: var(--fg); }
.pwform { display: grid; gap: 8px; max-width: 360px; }
.pwform label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.pwform input { border: 1px solid var(--line); background: var(--bg); border-radius: 5px; padding: 8px 10px; color: var(--fg); }
table.audit { border-collapse: collapse; width: 100%; font-size: 12px; }
table.audit td, table.audit th { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.audit th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
table.audit td:first-child { font-family: var(--f-mono); white-space: nowrap; color: var(--muted); }
.par-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 560px) { .users .row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) {
  .grid .rowh, .mode-month .grid .rowh { min-width: 104px; max-width: 120px; padding: 4px 6px; }
  .grid .rowh .tri { display: block; margin: 0; }
  .brand h1 { font-size: 24px; }
}

/* Absences */
.absform { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.absform label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; min-width: 0; }
.absform input, .absform select { border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 5px; padding: 7px 8px; font-weight: 400; min-width: 0; width: 100%; }
.abs-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.abs-dates { display: grid; grid-template-columns: 1fr 130px 1fr 130px; gap: 10px; }
#abPreview { margin: 0; color: var(--fg); }
#abPreview.bad { color: var(--danger); }
.abs-h { margin: 0; font-size: 14px; }
.abs-list { display: grid; gap: 6px; }
.abs-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.abs-main { min-width: 0; }
@media (max-width: 600px) { .abs-2, .abs-dates { grid-template-columns: 1fr 1fr; } }

/* Équité des astreintes */
table.rc td.gap { font-weight: 600; }
table.rc td.gap.under { color: var(--danger); }
table.rc td.gap.over { color: var(--warn); }
table.rc td.gap.even { color: var(--ok); }

/* Chirurgiens présents */
.grid td.sv { height: auto; min-height: 30px; padding: 3px 2px !important; white-space: normal; vertical-align: top; }
.grid td.sv b { display: block; font-size: 13px; }
.grid td.sv .snames { display: block; font-size: 9px; font-weight: 500; line-height: 1.25; color: var(--muted); max-width: 70px; margin: 0 auto; word-break: break-word; }
.grid td.sv s { color: var(--danger); }
.grid td.sabs { text-decoration: none; }
table.tpl-check input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
table.tpl-check td { min-width: 38px; }
tr.tpl-total th, tr.tpl-total td { background: var(--surface-2); font-family: var(--f-mono); font-size: 12px; font-weight: 600; }

.vacbtn { width: 100%; min-width: 44px; min-height: 30px; border: 1px dashed var(--line); background: transparent; border-radius: 4px; font-size: 11px; font-weight: 700; color: var(--accent); padding: 0 2px; }
.vacbtn:hover { border-color: var(--accent); }
table.tpl td.two { background: color-mix(in srgb, var(--c) 34%, var(--surface)); }

/* Bulle chirurgiens présents */
.grid td.sv[data-k] { cursor: help; }
#stip { position: fixed; z-index: 55; background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 10px 12px; width: max-content; max-width: min(340px, calc(100vw - 16px)); font-size: 13px; pointer-events: none; }
#stip .st-h { font-weight: 600; }
#stip .st-n { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
#stip ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
#stip li { display: grid; grid-template-columns: 52px 1fr auto; gap: 6px; align-items: baseline; }
#stip .tri { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
#stip .st-2 { font-size: 11px; font-weight: 700; color: var(--accent); }
#stip .st-abs { margin-top: 6px; font-size: 12px; color: var(--danger); }

.absform .emb { margin: 0; padding: 8px 10px; border-radius: 6px; background: color-mix(in srgb, var(--warn) 12%, var(--surface)); color: var(--fg); }

table.tpl-rooms select.wide { width: 92px; }
table.tpl-rooms tbody th { white-space: nowrap; }
#stip li.off span:nth-child(2) { text-decoration: line-through; color: var(--muted); }
#stip .st-off { font-size: 11px; font-weight: 700; color: var(--danger); }

table.rc th.grp { text-align: center; border-left: 1px solid var(--line); }
table.rc tr.eq-tot td { font-weight: 600; background: var(--surface-2); }

.mailbox { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 6px; }
.mailbox h3 { margin: 0; font-size: 14px; }
.mailbox p { margin: 0; }
.mailtest { display: flex; flex-wrap: wrap; gap: 8px; }
.mailtest input { flex: 1 1 220px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 5px; padding: 6px 8px; }
.row input[type=email] { border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 5px; padding: 6px 8px; min-width: 0; width: 100%; }

.row input.codein { font-family: var(--f-mono); font-weight: 600; text-transform: uppercase; border-left: 3px solid var(--c); }

/* Impression / PDF de la période affichée */
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  :root { --bg: #fff; --surface: #fff; --surface-2: #eef2f1; --fg: #000; --muted: #444; --line: #bbb; color-scheme: light; }
  body { font-size: 10px; }
  .wrap { padding: 0 !important; gap: 6px; max-width: none; }
  .account, .nav, .seg, .bar .btn, #palette, #banner, section.recap, #equity, #toast, #pop, #stip, .overlay { display: none !important; }
  .bar { display: block; }
  .period { font-size: 16px; }
  .grid-wrap { max-height: none; overflow: visible; border: 0; }
  .grid th, .grid td { position: static !important; }
  .grid thead th { position: static !important; }
  td.cell { min-width: 0; height: 18px; }
  .legend { font-size: 9px; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Vacances scolaires : teinte légère */
.grid thead th.dayh.vacs { background: var(--vacs); box-shadow: inset 0 -3px 0 color-mix(in srgb, #7a5cc8 55%, var(--vacs)); }
.grid td.cell.vacs:not(.has) { background: var(--vacs); }
.school { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 6px; }
.school h3 { margin: 0; font-size: 14px; }
.school p { margin: 0; }
.row.sch { grid-template-columns: minmax(0,1.3fr) minmax(0,1fr) auto !important; }
form.row.sch { grid-template-columns: minmax(0,1.3fr) 130px 130px auto !important; }
@media (max-width: 560px) { form.row.sch { grid-template-columns: 1fr 1fr !important; } }

.sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
table.rc.vac td.z { color: var(--muted); }
table.rc.vac th, table.rc.vac td { padding: 6px 8px; }
@media print { #vacSynth { display: none !important; } }

/* Identité : logo de la clinique */
.brand-row { display: flex; align-items: center; gap: 16px; min-width: 0; }
.logo { height: 56px; width: auto; border-radius: 6px; background: #fff; padding: 2px 4px; display: block; }
.login-card .logo { height: 72px; margin: 0 auto 8px; }
.login-card h1 { text-align: center; font-size: 24px; }
.login-card .eyebrow { text-align: center; }
@media (max-width: 600px) { .logo { height: 40px; } .brand-row { gap: 10px; } }
@media print { .logo { height: 36px; } }
tr.foot.check th, tr.foot.check td { border-top: 2px solid var(--accent); font-weight: 600; }


/* Lignes de contrôle dans l'en-tête fixe */
.grid thead tr.prog th.rowh { background: var(--surface); }
.grid thead tr.group th { font-weight: 700; }
.grid thead tr.foot.check th, .grid thead tr.foot.check td { box-shadow: inset 0 -2px 0 var(--accent); border-top: 0; }

/* Bilan des vacations */
.dialog:has(table.vac) { width: min(1280px, 100%); }
table.rc.vac td.kind { text-align: left; white-space: nowrap; font-weight: 600; }
table.rc.vac tr.drow td { border-bottom: 2px solid var(--line); }
table.rc.vac td.dol { color: #7a5cc8; }
table.rc.vac tr.vrow > td:first-child { vertical-align: top; border-bottom: 2px solid var(--line); }
.vy { font-size: 18px; padding: 0 6px; font-variant-numeric: tabular-nums; }
