/* MannieOps — interface. Mise en page façon Combo (grille semaine, cartes de créneaux),
   identité Mannie : vert forêt, bleu sauge, titres grotesques larges et épais. */
:root {
  --green: #193D26; --green-2: #24573A; --sage: #9DBCBE; --sage-soft: #E3ECEC;
  --ink: #1A0303; --muted: #5E6B66; --faint: #8C9894;
  --bg: #F4F7F6; --surface: #FFFFFF; --surface-2: #F8FAF9; --line: #E1E7E5; --line-2: #EDF1EF;
  --on-green: #FFFFFF; --today: #193D26; --on-today: #FFFFFF;
  --ok: #2E7D4F; --ok-bg: #DDF1E4; --warn: #9A5B00; --warn-bg: #FCEBD2; --bad: #B3261E; --bad-bg: #FBE3E1;
  --shadow: 0 1px 2px rgba(25, 61, 38, .06), 0 4px 16px rgba(25, 61, 38, .06);
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --r: 10px; --r-sm: 6px; --col: 168px; --name: 220px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --green: #9DBCBE; --green-2: #B7D0D1; --sage: #5E8F93; --sage-soft: #1E2C27;
  --ink: #EEF2EF; --muted: #A9B7B1; --faint: #7C8A84;
  --bg: #0E1511; --surface: #151F19; --surface-2: #1A251F; --line: #27352D; --line-2: #1F2B24;
  --on-green: #0E1511; --today: #9DBCBE; --on-today: #0E1511;
  --ok: #7FD3A0; --ok-bg: #173123; --warn: #F2C27A; --warn-bg: #3A2A12; --bad: #F4A29B; --bad-bg: #3B1A18;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35); color-scheme: dark; } }
:root[data-theme="dark"] {
  --green: #9DBCBE; --green-2: #B7D0D1; --sage: #5E8F93; --sage-soft: #1E2C27;
  --ink: #EEF2EF; --muted: #A9B7B1; --faint: #7C8A84;
  --bg: #0E1511; --surface: #151F19; --surface-2: #1A251F; --line: #27352D; --line-2: #1F2B24;
  --on-green: #0E1511; --today: #9DBCBE; --on-today: #0E1511;
  --ok: #7FD3A0; --ok-bg: #173123; --warn: #F2C27A; --warn-bg: #3A2A12; --bad: #F4A29B; --bad-bg: #3B1A18;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green); }
:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
h1, h2, h3, .display { font-family: var(--display); font-stretch: 118%; font-weight: 800; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 15px; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: 13px; }

/* ---------- Barre du haut ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; display: flex; align-items: center; gap: 22px;
  background: var(--surface); border-bottom: 1px solid var(--line); height: 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 31; background: var(--surface); }
.logo { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 20px; color: var(--green); letter-spacing: -.02em; display: flex; align-items: baseline; gap: 3px; white-space: nowrap; }
.logo small { font-family: var(--body); font-stretch: 100%; font-weight: 600; font-size: 12px; color: var(--ink); background: var(--sage); color: #1A0303; border-radius: 4px; padding: 1px 5px; letter-spacing: .02em; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; padding: 7px 11px; border-radius: 8px; position: relative; display: flex; align-items: center; gap: 6px; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a.on { color: var(--ink); background: var(--sage-soft); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; position: relative; color: var(--ink); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .badge { position: absolute; top: 0; right: -2px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--sage-soft); color: var(--green); flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.tabbar { display: none; }
main { padding-block: 18px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.page { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.page.wide { max-width: none; }

/* ---------- Boutons, champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--green); border-color: var(--green); color: var(--on-green); }
.btn.primary:hover { background: var(--green-2); }
.btn.sage { background: var(--sage); border-color: var(--sage); color: #1A0303; }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label, .lbl { font-size: 13px; font-weight: 600; }
.input, select.input, textarea.input { height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 0 11px; width: 100%; min-width: 0; }
textarea.input { height: auto; min-height: 70px; padding: 9px 11px; resize: vertical; }
.input:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 35%, transparent); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 140px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 600; }
.chip.on { background: var(--green); border-color: var(--green); color: var(--on-green); }
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.green { background: var(--green); color: var(--on-green); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.card.pad { padding: 18px; }
.section-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.empty { padding: 26px; text-align: center; color: var(--muted); }

/* ---------- Barre d'outils du planning ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: 3px; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 999px; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--sage-soft); color: var(--ink); }
.weeknav { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: 2px; }
.weeknav button { border: 0; background: transparent; height: 32px; min-width: 32px; border-radius: 999px; display: grid; place-items: center; }
.weeknav button:hover { background: var(--surface-2); }
.weeknav .label { padding: 0 10px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.search { position: relative; }
.search input { height: 38px; border-radius: 999px; padding-left: 34px; width: 210px; }
.search svg { position: absolute; left: 11px; top: 9px; width: 18px; height: 18px; color: var(--faint); }
.pubstate { display: flex; align-items: center; gap: 8px; }

/* ---------- Grille semaine ---------- */
.board { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: auto; max-height: calc(100vh - 190px); position: relative; }
.gridtable { display: grid; grid-template-columns: var(--name) repeat(7, minmax(var(--col), 1fr)); min-width: calc(var(--name) + 7 * var(--col)); }
.gh { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); height: 58px; display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; }
.gh.corner { left: 0; z-index: 7; justify-content: flex-start; padding: 0 14px; border-right: 1px solid var(--line); }
.gh .dd { display: flex; align-items: baseline; gap: 6px; }
.gh .d { font-size: 13px; color: var(--muted); } .gh .n { font-size: 15px; }
.gh.today .dd { background: var(--today); color: var(--on-today); border-radius: 999px; padding: 4px 12px; }
.gh.today .d { color: inherit; }
.gh.closed { color: var(--faint); }
.rh { position: sticky; left: 0; z-index: 4; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line-2); padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.rh .who { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rh .nm { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh .ct { display: flex; gap: 4px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.rh.band { background: var(--surface-2); font-size: 13px; color: var(--muted); font-weight: 600; align-items: center; min-height: 40px; padding-block: 8px; }
.cell { border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); padding: 4px; min-height: 64px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.cell.band { background: var(--surface-2); min-height: 40px; }
.cell.today { background: color-mix(in srgb, var(--sage) 9%, var(--surface)); }
.cell.band.today { background: color-mix(in srgb, var(--sage) 12%, var(--surface-2)); }
.cell.drop { outline: 2px dashed var(--sage); outline-offset: -3px; }
.cell .add { opacity: 0; border: 1px dashed var(--line); background: transparent; border-radius: var(--r-sm); height: 26px; color: var(--muted); font-size: 18px; line-height: 1; margin-top: auto; }
.cell:hover .add, .cell .add:focus { opacity: 1; }
.editable .cell:not(.band) { cursor: copy; }
.shift { --c: var(--sage); position: relative; text-align: left; border: 0; border-left: 4px solid var(--c); border-radius: var(--r-sm); padding: 5px 7px 6px; width: 100%;
  background: color-mix(in srgb, var(--c) 22%, var(--surface)); color: var(--ink); display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; cursor: pointer; }
.shift:hover { background: color-mix(in srgb, var(--c) 32%, var(--surface)); }
.shift .pos { font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .05em; }
.shift .tm { align-self: flex-start; background: var(--surface); border-radius: 5px; padding: 1px 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.shift .meta { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 11.5px; }
.shift .flag { position: absolute; top: 4px; right: 5px; display: flex; gap: 3px; }
.shift .flag span { width: 8px; height: 8px; border-radius: 50%; }
.shift .flag .w { background: var(--warn); } .shift .flag .m { background: var(--sage); box-shadow: 0 0 0 2px var(--surface); }
.shift.alert { box-shadow: inset 0 0 0 1.5px var(--warn); }
.shift.open { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 16%, var(--surface)) 0 8px, color-mix(in srgb, var(--c) 26%, var(--surface)) 8px 16px); }
.shift[draggable="true"] { cursor: grab; }
.leave { border-radius: var(--r-sm); padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--muted);
  background: repeating-linear-gradient(135deg, var(--line-2) 0 6px, var(--surface-2) 6px 12px); border: 1px solid var(--line); }
.leave.pending { border-style: dashed; }
.note { background: color-mix(in srgb, var(--sage) 30%, var(--surface)); border-radius: 5px; padding: 3px 7px; font-size: 12px; display: flex; gap: 6px; justify-content: space-between; align-items: center; }
.note button { border: 0; background: none; color: var(--muted); padding: 0; }
.foot { position: sticky; bottom: 0; z-index: 3; }
.foot.rh, .foot.cell { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 0; min-height: 0; padding-block: 6px; }
.foot.rh { z-index: 6; }
.foot.cell { font-size: 12px; color: var(--muted); justify-content: center; align-items: center; text-align: center; }
.foot b { color: var(--ink); font-weight: 600; }
.foot input { width: 86px; height: 26px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); text-align: right; padding: 0 6px; font-size: 12px; }

/* Panneau alertes */
.alerts { display: flex; flex-direction: column; gap: 6px; }
.alerts .a { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.alerts .a b { font-weight: 600; }

/* ---------- Vue jour (mobile) ---------- */
.daytabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.daytabs button { flex: 1 0 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 6px 0; display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--muted); }
.daytabs button b { font-size: 16px; color: var(--ink); }
.daytabs button.on { background: var(--green); border-color: var(--green); color: var(--on-green); }
.daytabs button.on b { color: var(--on-green); }
.daytabs button.today:not(.on) { border-color: var(--green); }
.daylist { display: flex; flex-direction: column; }
.dayrow { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); align-items: start; }
.dayrow:last-child { border-bottom: 0; }
.dayrow .stack { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.timeline { position: relative; height: 26px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.timeline span { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; }

/* ---------- Mon planning ---------- */
.hero { background: var(--green); color: var(--on-green); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.hero .eyebrow { color: color-mix(in srgb, var(--on-green) 75%, transparent); }
.hero .big { font-family: var(--display); font-stretch: 122%; font-weight: 900; font-size: 34px; line-height: 1; letter-spacing: -.02em; }
.hero .stats { display: flex; gap: 22px; flex-wrap: wrap; }
.hero .stats div { display: flex; flex-direction: column; }
.hero .stats b { font-size: 20px; font-family: var(--display); font-stretch: 115%; }
.hero .btn { background: transparent; color: var(--on-green); border-color: color-mix(in srgb, var(--on-green) 40%, transparent); }
.list { display: flex; flex-direction: column; }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.datebox { width: 48px; flex: none; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); text-align: center; padding: 4px 0; }
.datebox .d { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.datebox .n { font-family: var(--display); font-weight: 800; font-size: 19px; line-height: 1.1; }
.datebox.today { background: var(--green); border-color: var(--green); color: var(--on-green); }
.datebox.today .d { color: inherit; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.weekhead { padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---------- Tableaux ---------- */
.tablewrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--surface-2); }

/* ---------- Modale / feuille ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(14, 21, 17, .42); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s ease; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 520px; max-height: calc(100% - 20px); overflow: auto; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.modal header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 6px; }
.modal .body { padding: 10px 18px; display: flex; flex-direction: column; gap: 14px; }
.modal footer { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px 18px; flex-wrap: wrap; }
.modal footer .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
.pop { position: absolute; z-index: 40; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 240px; padding: 6px; }
.pop button.mi { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 8px; font-size: 14px; }
.pop button.mi:hover { background: var(--surface-2); }
.notifs { width: min(360px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; }
.notif { padding: 10px; border-radius: 8px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.notif.unread { background: color-mix(in srgb, var(--sage) 15%, var(--surface)); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); animation: fade .2s ease; max-width: calc(100vw - 32px); }
.copybox { display: flex; gap: 6px; } .copybox input { flex: 1; font-size: 13px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.swatches button.on { box-shadow: 0 0 0 2px var(--ink); }

/* ---------- Connexion ---------- */
.auth { min-height: 100%; display: grid; grid-template-columns: 1fr 1fr; }
.auth .side { background: var(--sage); color: #1A0303; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; }
.auth .side .slogan { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: clamp(36px, 5vw, 64px); line-height: .95; letter-spacing: -.03em; color: #193D26; }
.auth .side .logo { color: #193D26; }
.auth .form { display: flex; align-items: center; justify-content: center; padding: 40px 16px; background: var(--surface); }
.auth form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.err { color: var(--bad); font-size: 14px; }
.demobar { background: var(--sage); color: #1A0303; font-size: 13px; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; padding-block: 7px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.demobar select { border: 1px solid rgba(26,3,3,.25); background: #fff; color: #1A0303; border-radius: 999px; padding: 3px 8px; font-size: 13px; }

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .nav { display: none; }
  .topbar { gap: 10px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 4px 0; position: relative; }
  .tabbar a.on { color: var(--green); }
  .tabbar a .badge { position: absolute; top: 0; left: calc(50% + 6px); }
  main { padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .search input { width: 100%; }
  .search { flex: 1 1 100%; order: 9; }
  .board { max-height: none; }
  .auth { grid-template-columns: 1fr; }
  .auth .side { padding: 28px 20px; }
  .grid2 { grid-template-columns: 1fr; }
  .overlay { align-items: flex-end; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-width: none; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .dayrow { grid-template-columns: 1fr; gap: 6px; }
  h1 { font-size: 22px; }
  .hide-m { display: none !important; }
}
@media (min-width: 821px) { .hide-d { display: none !important; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print {
  .topbar, .tabbar, .toolbar, .demobar, .noprint { display: none !important; }
  main { padding: 0; } .board { max-height: none; overflow: visible; border: 0; }
  .gridtable { min-width: 0; grid-template-columns: 150px repeat(7, 1fr); }
  .cell .add { display: none; } body { background: #fff; }
}

/* ---------- Badgeuse (iPad) ---------- */
.kiosk { min-height: 100%; display: flex; flex-direction: column; background: var(--bg); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.k-head { background: var(--green); color: var(--on-green); display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 22px;
  padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); }
.k-logo { color: var(--on-green); font-size: 26px; }
.k-loc { font-size: 15px; opacity: .85; margin-top: 2px; }
.k-clock { text-align: right; }
.k-time { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 56px; line-height: 1; letter-spacing: -.02em; }
.k-date { font-size: 16px; opacity: .85; margin-top: 4px; }
.k-date::first-letter { text-transform: uppercase; }
.k-banner { background: var(--warn-bg); color: var(--warn); text-align: center; padding: 10px; font-weight: 600; }
.k-main { flex: 1; display: flex; flex-direction: column; gap: 18px; padding-block: 24px;
  padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); }
.k-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.k-title h2 { font-size: 26px; }
.k-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.k-tile { border: 1px solid var(--line); background: var(--surface); border-radius: 18px; padding: 18px 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; min-height: 168px; box-shadow: var(--shadow); }
.k-tile:active { transform: scale(.98); }
.k-av { width: 54px; height: 54px; font-size: 19px; margin-bottom: 4px; }
.k-name { font-weight: 700; font-size: 19px; }
.k-plan { font-size: 14px; color: var(--muted); }
.k-st { margin-top: auto; display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--muted); }
.k-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.k-tile.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); } .k-tile.ok .k-st { color: var(--ok); } .k-tile.ok .k-dot { background: var(--ok); }
.k-tile.warn .k-st { color: var(--warn); } .k-tile.warn .k-dot { background: var(--warn); }
.k-tile.gone { opacity: .6; }
.k-more { align-self: center; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 12px 22px; font-weight: 600; font-size: 15px; }
.k-foot { display: flex; justify-content: space-between; align-items: center; padding-block: 14px calc(14px + env(safe-area-inset-bottom, 0px)); color: var(--faint); font-size: 13px;
  padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); }
.k-link { border: 0; background: none; color: var(--muted); font-size: 14px; text-decoration: underline; padding: 8px; }
.k-empty { margin: auto; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; padding: 40px 20px; color: var(--muted); }
.k-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(14, 21, 17, .5); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s ease; }
.k-sheet { background: var(--surface); border-radius: 26px; width: 100%; max-width: 440px; padding: 28px; display: flex; flex-direction: column; align-items: center; gap: 16px; box-shadow: var(--shadow); }
.k-who { display: flex; align-items: center; gap: 12px; align-self: stretch; justify-content: center; }
.k-sub { margin: 0; color: var(--muted); text-align: center; font-size: 15px; }
.k-dots { display: flex; gap: 18px; padding: 6px 0; }
.k-dots span { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--green); }
.k-dots span.on { background: var(--green); }
.k-dots.shake { animation: shake .35s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.k-err { min-height: 20px; color: var(--bad); font-weight: 600; text-align: center; font-size: 15px; }
.k-pad { display: grid; grid-template-columns: repeat(3, 84px); gap: 14px; }
.k-pad button { height: 84px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); font-family: var(--display); font-weight: 700; font-size: 30px; color: var(--ink); }
.k-pad button:active { background: var(--sage-soft); }
.k-pad .k-soft { border: 0; background: transparent; font-family: var(--body); font-size: 16px; font-weight: 600; color: var(--muted); }
.k-actions { display: flex; flex-direction: column; gap: 12px; align-self: stretch; }
.k-act { height: 76px; border-radius: 18px; border: 0; font-family: var(--display); font-stretch: 115%; font-weight: 800; font-size: 24px; }
.k-act.go { background: var(--green); color: var(--on-green); }
.k-act.pause { background: var(--sage); color: #1A0303; }
.k-act.out { background: var(--ink); color: var(--bg); }
.k-act:disabled { opacity: .5; }
.k-done { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.k-check { width: 72px; height: 72px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; font-size: 38px; font-weight: 800; }
.k-bye { font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 24px; }
.k-big { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 64px; line-height: 1; }
@media (max-width: 600px) { .k-time { font-size: 38px; } .k-grid { grid-template-columns: 1fr 1fr; } .k-tile { min-height: 140px; } .k-pad { grid-template-columns: repeat(3, 72px); } .k-pad button { height: 72px; } }

/* Badgeuse : QR code */
.k-main.k-split { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 24px; align-items: start; }
.k-people { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.k-qrcard { position: sticky; top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 12px; align-items: center; box-shadow: var(--shadow); }
.k-qrcard h2 { font-size: 24px; text-align: center; }
.k-qr { width: 100%; max-width: 300px; aspect-ratio: 1; background: #fff; border-radius: 14px; padding: 8px; display: grid; place-items: center; }
.k-qr svg { width: 100%; height: 100%; display: block; }
.k-qr svg rect[fill="#ffffff"], .k-qr svg path { shape-rendering: crispEdges; }
.k-qrwait { color: #193D26; font-size: 40px; }
.k-qrbar { width: 100%; max-width: 300px; height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.k-qrbar span { display: block; height: 100%; width: 100%; background: var(--green); transition: width .25s linear; }
.k-steps { margin: 4px 0 0; padding-left: 22px; font-size: 15px; display: flex; flex-direction: column; gap: 4px; align-self: stretch; }
.k-note { margin: 0; font-size: 13px; color: var(--muted); }
.k-flash { display: flex; flex-direction: column; gap: 6px; align-self: stretch; min-height: 0; }
.k-fl { background: var(--ok-bg); color: var(--ok); border-radius: 10px; padding: 9px 12px; font-size: 15px; animation: fade .2s ease; }
.k-mode { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.k-tile { position: relative; }
@media (max-width: 900px) { .k-main.k-split { grid-template-columns: 1fr; } .k-qrcard { position: static; } }

/* Téléphone : écran de pointage */
.punch { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.punch .k-act { width: 100%; }
