/* ===== Thème clair ===== */
:root {
  --bg: #f4f6fb; --surface: #ffffff; --surface-2: #f8f9fc; --text: #18213a; --muted: #6b7489; --line: #e6e9f2; --line-strong: #cfd5e3;
  --accent: #4f46e5; --accent-soft: #eef0ff; --accent-ink: #ffffff; --danger: #d92d20; --danger-soft: #fef0ef;
  --warn-bg: #fff6e6; --warn: #a14f00; --ok: #12805c; --ok-soft: #e8f7f0;
  --side: #161b33; --side-2: #1f2545; --side-text: #c9cee3; --side-muted: #7d84a3;
  --s8: #e3edff; --s8-ink: #1d4fd7; --s10: #e2f6ec; --s10-ink: #11734d; --s12: #fff1d9; --s12-ink: #9a5b00;
  --foot: #efe8ff; --foot-ink: #6a35d4; --off: #f1f3f8; --off-ink: #6b7489; --we: #e7e9f1; --rtt: #ddf5f3; --rtt-ink: #0f6e69;
  --conge: #fde9f1; --conge-ink: #a8235b; --closed: #f6f7fa; --chef: #f1f3f8;
  --radius: 14px; --shadow: 0 1px 2px rgba(20, 28, 60, .04), 0 4px 16px rgba(20, 28, 60, .05);
  --logo-bg: #161b33;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, .btn, input, select { font: inherit; color: inherit; }
button, .btn {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 14px;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; transition: border-color .15s, background .15s;
}
button:hover, .btn:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.primary:hover { background: #4338ca; }
button.ghost { border-color: transparent; background: transparent; padding: 4px 8px; }
button.danger { color: var(--danger); border-color: #f4c7c3; }
button:disabled { opacity: .6; cursor: wait; }
input, select { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; }
input:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
h1, h2, h3, h4 { letter-spacing: -.01em; }

/* ===== Structure : barre latérale + contenu ===== */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: 0 0 248px; background: var(--side); color: var(--side-text); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; padding: 18px 14px; overflow-y: auto; z-index: 30; }
.side-brand { padding: 4px 8px 18px; border-bottom: 1px solid rgba(255, 255, 255, .07); margin-bottom: 12px; }
.side-brand .logo { height: 24px; display: block; }
.side-sub { display: block; font-size: 11px; color: var(--side-muted); margin-top: 8px; letter-spacing: .02em; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 16px 10px 6px; font-weight: 600; }
.nav { width: 100%; background: transparent; border: 0; color: var(--side-text); justify-content: flex-start; padding: 9px 10px; border-radius: 10px; gap: 10px; font-weight: 500; }
.nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 18px; }
.nav:hover { background: var(--side-2); color: #fff; }
.nav.on { background: #fff; color: var(--side); font-weight: 600; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .07); }
.side-foot .nav span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scrim { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 18px 28px; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.menu-btn { display: none; padding: 7px; border-radius: 10px; }
.menu-btn svg, .icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.page-title { flex: 1 1 320px; min-width: 0; }
.page-title h1 { margin: 0; font-size: 22px; font-weight: 700; }
.page-title p { margin: 3px 0 0; color: var(--muted); font-size: 13px; max-width: 760px; }
.monthnav { display: flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.monthnav h2 { margin: 0; font-size: 15px; min-width: 150px; text-align: center; text-transform: capitalize; font-weight: 600; }
.icon-btn { border: 0; background: transparent; padding: 4px 10px; font-size: 18px; border-radius: 8px; }
.icon-btn:hover { background: var(--surface); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* Mois et actions seulement sur les pages qui en ont besoin */
body:not([data-page="dashboard"]):not([data-page="planning"]):not([data-page="stats"]):not([data-page="salaires"]) .topbar .monthnav,
body:not([data-page="dashboard"]):not([data-page="planning"]):not([data-page="stats"]) .topbar .actions { display: none; }
body:not([data-page="planning"]) #print { display: none; }

.page { padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 18px; max-width: 1600px; width: 100%; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card.flat { padding: 0; }
.card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.card h4 { margin: 18px 0 6px; font-size: 13px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h3 { margin: 0; }
.form-card { max-width: 900px; }
.scroll-x { overflow-x: auto; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }
.muted { color: var(--muted); font-size: 13px; }
.muted.small { font-size: 12px; }
label { display: inline-flex; gap: 8px; align-items: center; }
label.check { margin: 10px 0; }

/* ===== Tableau de bord ===== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 16px 18px; border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); }
.kpi.bad::before { background: var(--danger); } .kpi.good::before { background: var(--ok); } .kpi.foot::before { background: var(--foot-ink); }
.kpi.open::before { background: var(--rtt-ink); } .kpi.abs::before { background: var(--conge-ink); } .kpi.stud::before { background: var(--s10-ink); }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.kpi.bad .kpi-value { color: var(--danger); }
.kpi-sub { font-size: 12px; color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.daycard.plain { border: 0; box-shadow: none; padding: 0; }
.daycard.plain.today { box-shadow: none; }
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.events li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.events small { display: block; color: var(--muted); font-size: 12px; }
.ev-date { font-weight: 700; font-size: 13px; min-width: 44px; }
.ev { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; font-size: 15px; }
.ev.foot { background: var(--foot); } .ev.open { background: var(--rtt); }
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.q { flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.q b { font-size: 13.5px; } .q span { font-size: 12px; color: var(--muted); font-weight: 400; }
.q:hover { background: var(--accent-soft); border-color: var(--accent); }
.warnings { margin: 0; padding: 0; list-style: none; max-height: 340px; overflow: auto; display: grid; gap: 6px; }
.warnings li { background: var(--warn-bg); color: var(--warn); padding: 8px 12px; border-radius: 10px; font-size: 13px; }
.warnings li.ok { background: var(--ok-soft); color: var(--ok); }

/* ===== Horaire ===== */
.planning-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.alert-chip { background: var(--warn-bg); color: var(--warn); border-color: #f5d9a8; font-size: 13px; font-weight: 600; }
.viewswitch { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.viewswitch button { border: 0; border-radius: 9px; background: transparent; padding: 7px 16px; font-size: 13px; }
.viewswitch button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.tablewrap { overflow-x: auto; }
#grid { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 100%; }
#grid th, #grid td { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 0; text-align: center; white-space: nowrap; }
#grid th.name, #grid td.name { position: sticky; left: 0; background: var(--surface); text-align: left; padding: 8px 12px; z-index: 1; min-width: 150px; border-left: 0; }
#grid thead th { background: var(--surface-2); padding: 8px 2px 6px; font-weight: 600; cursor: pointer; vertical-align: top; font-size: 13px; }
#grid thead th.name { background: var(--surface-2); color: var(--muted); font-size: 12px; }
#grid td.name small { color: var(--muted); display: block; font-size: 10.5px; font-weight: 400; }
#grid .namebox { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 600; }
#grid .edit-emp, #grid .edit-chef { font-size: 13px; padding: 2px 6px; color: var(--muted); opacity: .45; border: 0; }
#grid tr:hover .edit-emp, #grid tr:hover .edit-chef { opacity: 1; }
#grid .edit-emp:hover, #grid .edit-chef:hover { color: var(--accent); background: var(--accent-soft); }
#grid tr.addrow td { padding: 8px 12px; border-bottom: 1px solid var(--line); }
#grid .add-emp { font-size: 12px; padding: 5px 10px; color: var(--accent); border-style: dashed; border-color: #c9c6f5; white-space: nowrap; }
#grid thead th .d { font-size: 10.5px; color: var(--muted); font-weight: 500; text-transform: uppercase; }
#grid thead th .m { display: block; font-size: 10px; color: var(--foot-ink); background: var(--foot); border-radius: 6px; margin: 3px 2px 0; padding: 1px 2px; }
#grid thead th .m.tbc { outline: 1px dashed var(--foot-ink); }
#grid thead th .o { display: block; font-size: 10px; color: var(--rtt-ink); background: var(--rtt); border-radius: 6px; margin: 3px 2px 0; padding: 1px 2px; }
#grid .outside { opacity: .45; }
#grid thead th.outside { opacity: .6; }
#grid thead th .f { display: block; font-size: 10px; color: var(--danger); background: var(--danger-soft); border-radius: 6px; margin: 3px 2px 0; padding: 1px 2px; }
#grid .monday { border-left: 2px solid var(--line-strong); }
#grid .closed { background: var(--closed); }
#grid .sat { background: #fafbff; }
#grid td.cell { min-width: 50px; height: 36px; cursor: pointer; position: relative; }
#grid td.cell:hover { box-shadow: inset 0 0 0 2px var(--accent); }
#grid td.cell span { display: block; margin: 3px; padding: 6px 2px; border-radius: 7px; font-weight: 600; }
#grid td.cell.lock::after { content: "🔒"; position: absolute; top: 1px; right: 2px; font-size: 8px; }
#grid tr.chef td { background: #fbfbfe; }
#grid tr.student td.name { color: var(--muted); font-weight: 600; }
#grid tr.sum td { font-size: 11.5px; padding: 6px 2px; color: var(--muted); background: var(--surface-2); }
#grid tr.sum td.bad { color: var(--danger); font-weight: 700; background: var(--danger-soft); }
#grid tr.sep td { border-top: 2px solid var(--line-strong); }
.c-8-16 { background: var(--s8); color: var(--s8-ink); }
.c-10-18 { background: var(--s10); color: var(--s10-ink); }
.c-12-20 { background: var(--s12); color: var(--s12-ink); }
.c-FOOT { background: var(--foot); color: var(--foot-ink); }
.c-CHEF { background: var(--chef); color: var(--text); }
.c-11-19 { background: var(--rtt); color: var(--rtt-ink); }
.c-7-15 { background: var(--s8); color: var(--s8-ink); }
.c-STUDENT { background: var(--s10); color: var(--s10-ink); }
.c-STUDENT.auto { background: transparent; color: var(--s10-ink); outline: 1px dashed var(--s10-ink); outline-offset: -1px; }
.c-NONE { color: var(--muted); }
.c-REPOS { background: var(--off); color: var(--off-ink); }
.c-WE { background: var(--we); color: var(--off-ink); }
.c-RTT { background: var(--rtt); color: var(--rtt-ink); }
.c-RECUP { background: var(--off); color: var(--foot-ink); }
.c-CONGE, .c-MALADIE, .c-FORMATION { background: var(--conge); color: var(--conge-ink); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--muted); }
.legend span.sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; }

/* Jour par jour */
.dayview { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.daycard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); scroll-margin-top: 90px; }
.daycard.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.daycard.bad { border-left: 4px solid var(--danger); }
.daycard.quiet { padding: 10px 16px; opacity: .6; box-shadow: none; }
.daycard header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.daycard header b { font-size: 14px; margin-right: 2px; }
.daycard .count { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }
.daycard .count.bad { color: var(--danger); }
.daycard .line { display: grid; grid-template-columns: 80px 1fr; gap: 8px; align-items: start; margin-top: 8px; }
.daycard .lbl { font-size: 11px; font-weight: 700; padding: 5px 6px; border-radius: 7px; text-align: center; color: var(--muted); background: var(--off); }
.daycard .line > div { display: flex; flex-wrap: wrap; gap: 5px; font-size: 13px; }
.daycard .warn { margin: 10px 0 0; font-size: 12px; color: var(--danger); }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: var(--off); color: var(--muted); font-weight: 500; }
.badge.open { background: var(--rtt); color: var(--rtt-ink); }
.badge.holiday { background: var(--danger-soft); color: var(--danger); }
.badge.foot { background: var(--foot); color: var(--foot-ink); }
.chip { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 20px; border: 0; }
.chip.empty { background: transparent; border: 1px dashed var(--line-strong); color: var(--muted); font-weight: 500; }

/* ===== Listes, statistiques, formulaires ===== */
.stats { border-collapse: collapse; width: 100%; font-size: 13px; }
.stats th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.stats th, .stats td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: center; }
.stats th:first-child, .stats td:first-child { text-align: left; }
.stats td.hi { color: var(--danger); font-weight: 700; }
.stats td.footlist { text-align: left; }
.footlist span { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; background: var(--foot); color: var(--foot-ink); white-space: nowrap; }
.list { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.list th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.list td, .list th { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.list tr.ign td { opacity: .45; text-decoration: line-through; }
.list input[type=time] { padding: 4px 6px; }
.avail input { width: 56px; text-align: center; padding: 6px; }
.avail td, .avail th { text-align: center; }
.avail td:first-child, .avail th:first-child { text-align: left; white-space: nowrap; }
.availdates { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.team input[type=text] { width: 100%; min-width: 110px; }
.team tr.gone td { opacity: .55; }
.entries { margin: 12px 0 4px; display: grid; gap: 8px; }
.entries .row { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.changes { max-height: 300px; overflow: auto; margin-top: 10px; }
.ok-box { background: var(--ok-soft); color: var(--ok); border-radius: 10px; padding: 10px 12px; margin-top: 14px; font-size: 13px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: var(--off); color: var(--muted); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }

/* Menu d'une case */
.popover { position: absolute; z-index: 40; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(20, 28, 60, .16); padding: 8px; display: grid; grid-template-columns: repeat(3, auto); gap: 5px; }
.popover .ttl { grid-column: 1 / -1; font-size: 12px; color: var(--muted); padding: 2px 4px 6px; font-weight: 600; }
.popover button { padding: 7px 10px; font-size: 12px; font-weight: 600; border: 0; border-radius: 8px; }
.popover button.auto { grid-column: 1 / -1; background: transparent; border: 1px dashed var(--line-strong); font-weight: 500; }

/* Fenêtres */
dialog { border: 0; border-radius: 18px; background: var(--surface); color: var(--text); max-width: 760px; width: calc(100% - 32px); padding: 22px 26px 26px;
  box-shadow: 0 24px 64px rgba(20, 28, 60, .25); }
dialog::backdrop { background: rgba(22, 27, 51, .45); backdrop-filter: blur(2px); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; margin: 0 0 6px; }
.dlg-head h3 { margin: 0; font-size: 18px; }
.dlg-head .ghost { font-size: 18px; }
dialog h4 { margin: 18px 0 6px; }

/* Bandeaux, toast, connexion */
.updatebar { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 8px 20px; font-size: 13px; background: var(--accent-soft); }
.syncbar { background: var(--warn-bg); color: var(--warn); padding: 8px 20px; font-size: 13px; text-align: center; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1d2330; color: #fff; padding: 10px 18px; border-radius: 12px; z-index: 60; box-shadow: var(--shadow); }
.login { position: fixed; inset: 0; z-index: 70; background: radial-gradient(1200px 600px at 20% 0%, #e9e8ff, var(--bg)); display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: 0 20px 60px rgba(20, 28, 60, .12); }
.login-card .logo-wrap { display: inline-block; background: var(--logo-bg); border-radius: 12px; padding: 10px 14px; }
.login-card .logo { height: 24px; display: block; }
.login-card h2 { font-size: 20px; margin: 20px 0 18px; }
.login-card form { display: grid; gap: 12px; }
.login-card .field { display: grid; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 500; }
.login-card .field input { padding: 10px 12px; color: var(--text); }
.login-card button { justify-content: center; padding: 10px 12px; }
button.link { background: none; border: 0; color: var(--accent); padding: 2px 0; justify-self: start; }
button.link:hover { text-decoration: underline; }
.login-msg { min-height: 1.4em; margin: 12px 0 0; font-size: 13px; color: var(--danger); }
.login-msg.ok { color: var(--ok); }

/* ===== Tablette et téléphone ===== */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(22, 27, 51, .4); z-index: 25; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .page-title { flex: 1 1 0; }
  .page-title h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .page-title p { display: none; }
  .topbar .monthnav { order: 3; flex: 1 1 100%; justify-content: space-between; }
  .actions { order: 4; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .actions::-webkit-scrollbar { display: none; }
  .actions > * { flex: 0 0 auto; white-space: nowrap; }
  .page { padding: 16px 12px 40px; gap: 14px; }
  .card { padding: 14px; }
  .quick { grid-template-columns: 1fr; }
  .viewswitch { display: flex; width: 100%; }
  .viewswitch button { flex: 1; }
  #grid th.name, #grid td.name { min-width: 100px; padding: 6px 8px; }
  #grid td.cell { min-width: 44px; }
  .team { display: block; overflow-x: auto; }
  dialog { width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; border-radius: 0; padding: 16px; }
  dialog label, .card label { flex-wrap: wrap; }
  .popover { position: fixed; left: 0 !important; right: 0; top: auto !important; bottom: 0; border-radius: 18px 18px 0 0;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .popover button { padding: 12px 6px; font-size: 13px; }
  .toast { max-width: calc(100% - 32px); text-align: center; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 22px; }
  .dayview { grid-template-columns: 1fr; }
  .daycard .line { grid-template-columns: 70px 1fr; }
}

/* ===== Impression : seulement le tableau de l'horaire ===== */
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  body { background: #fff; color: #000; }
  .sidebar, .scrim, .topbar .actions, .monthnav button, .page-title p, .menu-btn, .planning-bar, .legend, .popover, .toast,
  #grid .edit-emp, #grid .edit-chef, #grid tr.addrow, .dayview { display: none !important; }
  .page:not([data-page="planning"]) { display: none !important; }
  .page[data-page="planning"], #tableView { display: block !important; }
  .topbar { position: static; border: 0; padding: 0 0 6px; }
  .page { padding: 0; }
  .card { box-shadow: none; border: 0; }
  #grid { font-size: 9px; }
  #grid td.cell { min-width: 0; height: auto; }
  #grid td.cell span { padding: 2px 0; margin: 1px; }
  #grid td.cell.lock::after { content: ""; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ===== RH : cartes de l'équipe et dossier d'une personne (les deux apparences) ===== */
.hrx-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 16px; }
.hrx-period { font-weight: 600; color: var(--text); }
.hrx-exports { margin-left: auto; display: inline-flex; gap: 6px; flex-wrap: wrap; }
.hrx-sum { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: baseline; padding: 4px 2px 14px; color: var(--muted); font-size: 13.5px; }
.hrx-sum b { color: var(--text); font-size: 20px; margin-right: 4px; }
.hrx-sum .pos b { color: var(--ok); } .hrx-sum .neg b { color: var(--danger); } .hrx-sum .late b { color: var(--warn); }

/* Avatar rond coloré (même couleur pour une personne partout) */
.hrx-av { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 14px; }
.hrx-av.xl { width: 64px; height: 64px; flex-basis: 64px; font-size: 22px; }
.hrx-av.c0 { background: #e0eaff; color: #3538cd; } .hrx-av.c1 { background: #dcfae6; color: #067647; } .hrx-av.c2 { background: #fdead7; color: #b93815; }
.hrx-av.c3 { background: #f4ebff; color: #6941c6; } .hrx-av.c4 { background: #fce7f6; color: #c11574; } .hrx-av.c5 { background: #cff9fe; color: #0e7090; }

/* Cartes de l'équipe */
.hrx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.hrx-card { display: flex; flex-direction: column; align-items: stretch; gap: 14px; text-align: left; padding: 18px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 400; color: var(--text); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; white-space: normal; }
.hrx-card:hover { border-color: var(--line-strong); box-shadow: 0 6px 20px rgba(16, 24, 40, .08); transform: translateY(-1px); background: var(--surface); }
.hrx-card-top { display: flex; align-items: center; gap: 12px; }
.hrx-card .who { flex: 1; min-width: 0; display: grid; }
.hrx-card .who b { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrx-card .who small { color: var(--muted); font-size: 12.5px; }
.hrx-bal { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; background: var(--off); color: var(--off-ink); white-space: nowrap; }
.hrx-bal.pos { background: var(--ok-soft); color: var(--ok); } .hrx-bal.neg { background: var(--danger-soft); color: var(--danger); }
.hrx-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.hrx-pills > span { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 8px; }
.hrx-pills .pos { background: var(--ok-soft); color: var(--ok); }
.hrx-pills .neg { background: var(--danger-soft); color: var(--danger); }
.hrx-pills .late { background: var(--warn-bg); color: var(--warn); }
.hrx-pills .zero { background: var(--surface-2); color: var(--muted); font-weight: 500; }
.hrx-last { display: grid; gap: 6px; min-height: 44px; }
.hrx-last > span { font-size: 13px; color: var(--text); padding-left: 10px; border-left: 3px solid var(--line-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrx-last .positive { border-left-color: var(--ok); } .hrx-last .negative { border-left-color: var(--danger); } .hrx-last .late { border-left-color: #f79009; }
.hrx-last .none { color: var(--muted); border-left-color: transparent; padding-left: 0; }
.hrx-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.hrx-foot .go { color: var(--accent); font-weight: 600; opacity: 0; transition: opacity .15s; }
.hrx-card:hover .go, .hrx-card:focus-visible .go { opacity: 1; }

/* Dossier d'une personne */
.hrx-sheet-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.hrx-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.hrx-head h2 { margin: 0; font-size: 24px; }
.hrx-head p { margin: 2px 0 0; color: var(--muted); }
.hrx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.hrx-stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; box-shadow: var(--shadow); }
.hrx-stats span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.hrx-stats b { font-size: 26px; line-height: 1.2; }
.hrx-stats small { font-size: 12px; color: var(--muted); }
.hrx-stats .pos b { color: var(--ok); } .hrx-stats .neg b { color: var(--danger); } .hrx-stats .late b { color: var(--warn); }
.hrx-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.hrx-main, .hrx-side { display: grid; gap: 18px; min-width: 0; }
.hrx-main .card, .hrx-side .card { margin: 0; }
.hrx-compose h3, .hrx-history h3, .hrx-side h3 { margin: 0; font-size: 15px; }
.hrx-modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.hrx-modes button { justify-content: center; padding: 10px 6px; font-weight: 600; background: var(--surface); }
.hrx-modes button.on.pos { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.hrx-modes button.on.neg { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.hrx-modes button.on.late { background: var(--warn-bg); border-color: #f79009; color: var(--warn); }
.hrx-modes button.on.hours { background: var(--s8); border-color: var(--s8-ink); color: var(--s8-ink); }
.hrx-fields { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin-bottom: 10px; }
.hrx-fields label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.hrx-fields .late-planned { flex-basis: 100%; margin: 0; }
#hrxText { width: 100%; box-sizing: border-box; min-height: 84px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px; font: inherit; resize: vertical; background: var(--surface); color: var(--text); }
#hrxText:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.hrx-send { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.hrx-ai { font-size: 12.5px; color: var(--muted); }
.hrx-tl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.hrx-filter { display: inline-flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.hrx-filter button { border: 0; background: transparent; padding: 5px 10px; font-size: 13px; border-radius: 7px; box-shadow: none; }
.hrx-filter button small { color: var(--muted); font-weight: 500; margin-left: 2px; }
.hrx-filter button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); font-weight: 600; }
.hrx-todo { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--accent-soft); color: var(--text); border-radius: 10px; padding: 8px 8px 8px 12px; margin: 8px 0; font-size: 13px; }
.hrx-month { margin: 18px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.hrx-tl { list-style: none; margin: 0; padding: 0; position: relative; }
.hrx-tl::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.hrx-item { position: relative; display: flex; gap: 14px; padding: 6px 0 14px; }
.hrx-item .dot { position: relative; z-index: 1; width: 16px; height: 16px; flex: 0 0 16px; border-radius: 50%; margin-top: 3px; background: var(--surface); border: 4px solid var(--line-strong); box-sizing: border-box; }
.hrx-item.positive .dot { border-color: var(--ok); } .hrx-item.negative .dot { border-color: var(--danger); }
.hrx-item.late .dot { border-color: #f79009; } .hrx-item.hours .dot { border-color: var(--s8-ink); }
.hrx-item .b { flex: 1; min-width: 0; }
.hrx-item .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hrx-item .tag { font-size: 12px; font-weight: 600; padding: 2px 9px; }
.hrx-item.positive .tag { background: var(--ok-soft); color: var(--ok); } .hrx-item.negative .tag { background: var(--danger-soft); color: var(--danger); }
.hrx-item.late .tag { background: var(--warn-bg); color: var(--warn); } .hrx-item.hours .tag { background: var(--s8); color: var(--s8-ink); }
.hrx-item .when { font-size: 12.5px; color: var(--muted); }
.hrx-item .eff { font-size: 12px; font-weight: 700; } .hrx-item .eff.pos { color: var(--ok); } .hrx-item .eff.neg { color: var(--danger); }
.hrx-item .ai { font-size: 12px; }
.hrx-item .acts { margin-left: auto; display: inline-flex; gap: 2px; opacity: .55; transition: opacity .15s; }
.hrx-item:hover .acts, .hrx-item .acts:focus-within { opacity: 1; }
.hrx-item .acts button { padding: 2px 8px; font-size: 12px; color: var(--muted); }
.hrx-edit { margin: 8px 0 4px; display: grid; gap: 8px; }
.hrx-edit textarea { width: 100%; box-sizing: border-box; min-height: 80px; border: 1px solid var(--accent); border-radius: 10px; padding: 10px; font: inherit; resize: vertical; background: var(--surface); color: var(--text); }
.hrx-edit-type { display: inline-flex; gap: 6px; }
.hrx-edit-type button { padding: 5px 12px; font-size: 13px; }
.hrx-edit-type button.on.pos { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.hrx-edit-type button.on.neg { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.hrx-edit-btns { display: flex; flex-wrap: wrap; gap: 6px; }
@media (hover: none) { .hrx-item .acts { opacity: 1; } }
.hrx-item .txt { margin: 6px 0 2px; line-height: 1.55; }
.hrx-orig { border: 0; background: none; padding: 0; font-size: 12px; color: var(--accent); font-weight: 600; box-shadow: none; }
.hrx-orig:hover { background: none; text-decoration: underline; }
.hrx-item .by { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.hrx-empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.hrx-empty span { font-size: 30px; } .hrx-empty p { margin: 6px 0 2px; color: var(--text); font-weight: 600; }

/* Bilan IA et solde d'heures */
.hrx-bilan { background: linear-gradient(180deg, var(--accent-soft), var(--surface) 120px); }
.hrx-bilan-head { display: grid; gap: 2px; margin-bottom: 8px; }
.hrx-bilan-head small { color: var(--muted); font-size: 12px; }
.hrx-bilan .resume { margin: 0 0 10px; line-height: 1.6; }
.hrx-bilan h4 { margin: 12px 0 4px; font-size: 13px; }
.hrx-bilan h4.ok { color: var(--ok); } .hrx-bilan h4.warn { color: var(--warn); }
.hrx-bilan ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
.hrx-bilan button { width: 100%; justify-content: center; margin-top: 12px; }
.hrx-side .hint { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
.hrx-balbig { display: grid; gap: 2px; margin: 10px 0; padding: 14px; border-radius: 10px; background: var(--surface-2); text-align: center; }
.hrx-balbig b { font-size: 28px; } .hrx-balbig span { color: var(--muted); font-size: 13px; }
.hrx-balbig.pos { background: var(--ok-soft); } .hrx-balbig.pos b { color: var(--ok); }
.hrx-balbig.neg { background: var(--danger-soft); } .hrx-balbig.neg b { color: var(--danger); }
.hrx-hours dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; margin: 0; font-size: 13.5px; }
.hrx-hours dt { color: var(--muted); } .hrx-hours dd { margin: 0; text-align: right; font-weight: 600; }
.hrx-hours dd small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }

@media (max-width: 1100px) { .hrx-cols { grid-template-columns: 1fr; } .hrx-side { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
@media (max-width: 700px) {
  .hrx-exports { margin-left: 0; }
  .hrx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hrx-stats b { font-size: 22px; }
  .hrx-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hrx-send { flex-direction: column; align-items: stretch; }
  .hrx-send button { justify-content: center; }
  .hrx-head h2 { font-size: 20px; }
  .hrx-av.xl { width: 52px; height: 52px; flex-basis: 52px; font-size: 18px; }
  .hrx-foot .go { opacity: 1; }
  .hrx-grid { grid-template-columns: 1fr; }
}


.tag.positive { background: var(--ok-soft); color: var(--ok); } .tag.negative { background: var(--danger-soft); color: var(--danger); }
.late-planned { margin: 6px 0 10px; font-size: 13px; padding: 8px 10px; border-radius: 10px; background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.late-planned.ok { color: var(--text); }
.late-planned.bad { background: var(--danger-soft); color: var(--danger); border-color: #f4c7c3; }
input.wide { width: 100%; }

/* ===== Droits, annuler ===== */
.undo-btn { background: var(--surface); border-color: var(--line-strong); font-weight: 600; }
.undo-btn:hover { background: var(--accent-soft); }
.robar { background: var(--accent-soft); color: var(--accent); padding: 8px 20px; font-size: 13px; text-align: center; font-weight: 500; }
/* Lecteur : pas de boutons de modification */
body.readonly #generate, body.readonly #undoBtn, body.readonly .nav[data-go="sick"], body.readonly .nav[data-go="formation"], body.readonly .nav[data-go="requests"],
body.readonly .quick, body.readonly #grid .edit-emp, body.readonly #grid .edit-chef, body.readonly #grid tr.addrow, body.readonly .card .row button.primary { display: none !important; }
body.readonly #grid td.cell { cursor: default; }
/* Pas administrateur : pas de RH, ni gestion des accès / sauvegardes */
body.not-admin .nav[data-go="hr"], body.not-admin .admin-only { display: none !important; }
.abs-wrap { overflow-x: auto; }
.abs-wrap .list td { white-space: nowrap; }
.abs-actions { text-align: right; }

/* Zones & dispatch */
.zones-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.zones-bar .monthnav h2 { min-width: 190px; }
.zones-bar input[type=date] { padding: 7px 10px; }
.z-Z1 { background: #dce8ff; color: #1d4ed8; }
.z-Z2 { background: #dff3e8; color: #11734d; }
.z-Z3 { background: #fff1d6; color: #9a5b00; }
.z-D { background: #ece4ff; color: #5b3cc4; }
.ztable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ztable th, .ztable td { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 6px; text-align: center; vertical-align: middle; }
.ztable th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.ztable th.name, .ztable td.name { text-align: left; border-left: 0; padding-left: 14px; white-space: nowrap; min-width: 150px; }
.ztable td.zcell { position: relative; min-width: 104px; height: 46px; cursor: pointer; }
.ztable td.zcell.off { background: var(--closed); cursor: default; }
.ztable td.zcell span, .zname { display: flex; flex-direction: column; align-items: center; border-radius: 8px; padding: 4px 6px; line-height: 1.2; }
.zname { align-items: flex-start; }
.ztable td.zcell span small, .zname small { font-size: 10px; font-weight: 500; opacity: .85; }
.ztable td.zcell.lock::after { content: "🔒"; position: absolute; top: 1px; right: 3px; font-size: 9px; }
.z-pause { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.ztable td.zlist { text-align: left; min-width: 110px; line-height: 1.6; }
.ztable .pad, #zBox .pad { padding: 18px 20px; margin: 0; }
#zLegend i, .zmenu i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; }
.zmenu { position: absolute; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; min-width: 220px; }
.zmenu button { border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.zmenu button:hover { background: var(--surface-2); }
.zmenu small { color: var(--muted); }
body.readonly #zReset { display: none; }
body.readonly .ztable td.zcell { cursor: default; }
.z-T { background: repeating-linear-gradient(135deg, #dce8ff 0 10px, #dff3e8 10px 20px, #fff1d6 20px 30px); color: #344054; }
.ztable td.zalone span { display: flex; flex-direction: column; align-items: center; text-align: center; border-radius: 8px; padding: 10px 8px; gap: 2px; }
#zTeamCard .card-head { margin-bottom: 4px; }
#zTeamSave.pulse { box-shadow: 0 0 0 3px rgba(79, 70, 229, .25); }
body.readonly #zTeamCard .row button, body.readonly #zTeamRows select, body.readonly #zTeamRows input { pointer-events: none; }
body.readonly #zTeamCard .row:last-child { display: none; }

/* Reporting */
.log-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.log-bar .monthnav h2 { min-width: 190px; }
.log-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.log-types button { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; text-align: left; font-weight: 600; font-size: 13px; min-height: 52px; }
.log-types button span { font-size: 20px; }
.log-types button.on { border-color: var(--accent); background: var(--surface-2); box-shadow: 0 0 0 2px var(--accent) inset; }
#logForm { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
#logForm h4 { margin: 0 0 10px; font-size: 14px; }
#logForm label.block { display: block; margin: 12px 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
#logForm textarea { display: block; width: 100%; margin-top: 6px; font: inherit; padding: 10px; border-radius: 10px; border: 1px solid var(--line); resize: vertical; }
.log-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.log-chips button { border-radius: 20px; padding: 7px 12px; font-size: 13px; }
.log-chips button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.log-item { border: 1px solid var(--line); border-left: 5px solid #11734d; border-radius: 12px; padding: 12px 14px; margin-top: 10px; background: var(--surface); }
.log-item.sev-moyenne { border-left-color: #9a5b00; }
.log-item.sev-grave { border-left-color: #b42318; }
.log-item p { margin: 8px 0 0; font-size: 14px; line-height: 1.45; }
.log-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.log-time { font-size: 15px; }
.log-sev { margin-left: auto; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.log-action { color: var(--muted); }
.log-follow { color: #9a5b00; font-weight: 700; }
.log-item .row { margin-top: 10px; }
@media (max-width: 700px) {
  .log-types { grid-template-columns: 1fr 1fr; }
  #logForm .row label { flex: 1 1 100%; }
}
body.readonly #logNew, body.readonly .log-item .row { display: none; }

/* ===== Téléphone : mise en page compacte ===== */
.zcards { display: grid; gap: 10px; padding: 0; }
.zcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.zcard-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.zcard-head b { font-size: 15px; }
.zslot { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); position: relative; cursor: pointer; }
.zslot.lock::after { content: "🔒"; position: absolute; right: 4px; top: 4px; font-size: 10px; }
.zs-time { font-size: 13px; font-weight: 600; color: var(--muted); }
.zs-code { display: flex; align-items: baseline; gap: 6px; border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.zs-code small { font-size: 11px; opacity: .85; }
.zs-code b { white-space: nowrap; }
.zline .zs-code { flex-wrap: wrap; row-gap: 0; }
.zline { display: grid; grid-template-columns: 1fr 1.1fr; gap: 10px; align-items: center; padding: 4px 0; font-size: 14px; }
#zTeamCard summary { cursor: pointer; list-style: none; margin: 0; }
#zTeamCard summary::-webkit-details-marker { display: none; }
#zTeamCard summary h3::before { content: "▸ "; color: var(--muted); }
#zTeamCard[open] summary h3::before { content: "▾ "; }
#zTeamCard[open] summary { margin-bottom: 8px; }
#zTeamCard h3 .muted { font-weight: 500; }

@media (max-width: 900px) {
  /* En-tête : une ligne titre, une ligne mois + actions ; le reste de l'écran pour le contenu. */
  .topbar { gap: 8px; padding: 10px 12px; }
  .page-title h1 { font-size: 17px; }
  .undo-btn { padding: 6px 10px; font-size: 13px; }
  .topbar .monthnav { flex: 1 1 auto; min-width: 0; padding: 2px; }
  .topbar .monthnav h2 { min-width: 0; font-size: 14px; }
  .actions { flex: 0 0 auto; gap: 6px; }
  .actions > * { padding: 8px 12px; }
  .long, #print { display: none; }
  /* Barres de page (zones, reporting) : le jour en entier, les boutons en dessous. */
  .zones-bar, .log-bar { gap: 8px; }
  .zones-bar .monthnav, .log-bar .monthnav { flex: 1 1 100%; justify-content: space-between; }
  .zones-bar .monthnav h2, .log-bar .monthnav h2 { min-width: 0; }
  .zones-bar > button, .zones-bar > input { flex: 1 1 auto; }
  .zones-bar .viewswitch { order: 5; }
  /* Tableaux larges : ils défilent dans leur carte, pas la page entière. */
  .card table.list, .card table.stats { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .avail input { width: 34px; padding: 6px 0; }
  .avail td, .avail th { padding: 5px 2px; }
  .avail td:first-child { font-size: 11.5px; white-space: normal; min-width: 0; width: 56px; }
}

@media (max-width: 700px) {
  body { -webkit-text-size-adjust: 100%; }
  .page { padding: 12px 10px 40px; gap: 12px; }
  .card { padding: 14px 12px; border-radius: 14px; }
  .card h3 { font-size: 15px; }
  /* Formulaires : le libellé au-dessus, le champ sur toute la largeur, des boutons faciles à toucher. */
  .card .row > label:not(.check), .entries .row > label, dialog .row > label:not(.check) {
    flex: 1 1 100%; display: flex; flex-direction: column; align-items: stretch; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
  .card .row > label:not(.check) > input, .card .row > label:not(.check) > select, .card .row > label:not(.check) > textarea,
  .entries .row > label > input, .entries .row > label > select,
  dialog .row > label:not(.check) > input, dialog .row > label:not(.check) > select { width: 100%; font-size: 16px; padding: 10px; color: var(--text); font-weight: 400; }
  input, select, textarea { font-size: 16px; } /* évite le zoom automatique de l'iPhone */
  .entries .row { position: relative; padding: 12px 40px 12px 12px; }
  .entries .row > button[data-rm] { position: absolute; top: 6px; right: 6px; }
  .row > button { min-height: 42px; }
  .card .row > button.primary { flex: 1 1 auto; }
  /* Horaire du mois : colonne des noms plus étroite pour voir plus de jours. */
  #grid { font-size: 11px; }
  #grid th.name, #grid td.name { min-width: 0; width: 86px; max-width: 86px; padding: 6px; white-space: normal; }
  #grid .namebox { font-size: 12px; line-height: 1.2; }
  #grid .edit-emp, #grid .edit-chef { display: none; }
  #grid td.cell { min-width: 40px; height: 34px; }
  #grid td.cell span { margin: 2px; padding: 5px 1px; }
  #grid thead th { font-size: 12px; padding: 6px 1px 4px; }
  .legend { font-size: 11px; gap: 6px 12px; }
  /* Zones : menu de choix en bas de l'écran. */
  .zmenu { position: fixed; left: 0 !important; right: 0; top: auto !important; bottom: 0; border-radius: 18px 18px 0 0; min-width: 0;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(20, 28, 60, .2); }
  .zmenu button { padding: 14px 12px; font-size: 15px; }
  #zBox.card.flat { background: transparent; border: 0; box-shadow: none; }
  /* Équipe : une carte par personne au lieu d'un tableau. */
  #teamList, #teamList tbody { display: block; }
  #teamList tr:first-child { display: none; }
  #teamList { width: 100%; overflow: visible; }
  #teamList tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 12px; margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
  #teamList td { padding: 0; border: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
  #teamList td:nth-child(1), #teamList td:nth-child(3) { grid-column: 1 / -1; }
  #teamList td:nth-child(1)::before { content: "Nom"; } #teamList td:nth-child(2)::before { content: "Note"; }
  #teamList td:nth-child(3)::before { content: "Week-end avec"; } #teamList td:nth-child(4)::before { content: "Arrivée"; }
  #teamList td:nth-child(5)::before { content: "Départ"; } #teamList td:nth-child(6):empty { display: none; }
  #teamList td { min-width: 0; }
  #teamList td input, #teamList td select { width: 100%; min-width: 0; box-sizing: border-box; color: var(--text); font-weight: 400; }
  /* Reporting et absences */
  .log-types button { min-height: 56px; }
  .abs-actions { white-space: nowrap; }
  .toast { bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* Reporting : champs avec dictée */
.log-field { margin-top: 12px; }
.log-field-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
#logForm .log-field textarea { margin-top: 0; }
.mic { padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.mic.on { background: var(--danger); border-color: var(--danger); color: #fff; animation: micpulse 1.2s ease-in-out infinite; }
@keyframes micpulse { 50% { box-shadow: 0 0 0 6px rgba(217, 45, 32, .18); } }
@media (max-width: 700px) { .mic { padding: 9px 14px; font-size: 14px; } }

/* Reporting : texte reformulé et texte d'origine */
.log-orig { margin-top: 8px; font-size: 13px; }
.log-orig summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 12.5px; list-style: none; }
.log-orig summary::-webkit-details-marker { display: none; }
.log-orig[open] { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.log-orig p { color: var(--muted); }

/* Échange de deux horaires par glisser-déposer (appui long) */
#grid td.cell, #zBox .zcell, #zBox .zp { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
body.dragging, body.dragging * { cursor: grabbing !important; }
.drag-src { opacity: .45; }
.drag-ok { outline: 2px dashed var(--accent, #4f46e5); outline-offset: -3px; }
.drag-over { outline: 3px solid var(--accent, #4f46e5); background: rgba(79, 70, 229, .12); }
.drag-ghost { position: fixed; z-index: 1000; pointer-events: none; transform: translate(-50%, -120%) scale(1.15);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25); border-radius: 6px; padding: 4px 8px; }

/* Équipe : erreur d'enregistrement et groupes trop remplis */
.team-err { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-weight: 600; }
#teamList tr.over select { border-color: var(--danger); background: var(--danger-soft); }
#zBox .zp { cursor: pointer; border-radius: 6px; padding: 1px 4px; margin: 0 -4px; }
#zBox .zp:hover { background: var(--accent-soft); }
#zBox .zp.lock span::after { content: " 🔒"; font-size: .75em; }

/* Horaire fixe */
.fixed-bar { flex-wrap: wrap; }
.fixed-bar #fxExport { margin-left: auto; }
#fxBox .fx-title { margin: 4px 4px 12px; font-size: 18px; }
#fxBox .zcell { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
#fxNote:empty { display: none; }
@media (max-width: 700px) { .fixed-bar #fxExport { margin-left: 0; width: 100%; } #fxTypes { overflow-x: auto; max-width: 100%; } }

/* Zones & dispatch : onglets et écran « Maintenant » */
.zpane[hidden] { display: none !important; }
.zday-bar { margin-top: 0; }
.znow-head { font-size: 16px; padding: 4px 2px 12px; }
.znow-head b.soon { color: var(--danger); }
.znow-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.znow-tools button { padding: 11px 16px; font-size: 15px; }
.znow-events { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.znow-chip { background: var(--danger-soft); color: var(--danger); border-radius: 999px; padding: 5px 10px; font-size: 13px; font-weight: 600; }
.znow-chip .link { border: 0; background: none; padding: 0 0 0 6px; color: inherit; text-decoration: underline; font-size: 12px; font-weight: 400; }
.znow-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.znow-grid.alone { grid-template-columns: 3fr 1fr; }
.znow-card { border-radius: 16px; padding: 14px; min-height: 140px; display: flex; flex-direction: column; gap: 10px; border: 2px solid transparent; }
.znow-card.z-T { background: repeating-linear-gradient(135deg, #dce8ff 0 14px, #dff3e8 14px 28px, #fff1d6 28px 42px); }
.znow-card.empty, .znow-card.pauseonly { background: var(--danger-soft) !important; color: var(--danger); border-color: var(--danger); animation: znowPulse 1.6s ease-in-out infinite; }
@keyframes znowPulse { 50% { border-color: #f4c7c3; } }
.znow-zone b { display: block; font-size: 18px; }
.znow-zone small { font-size: 12px; opacity: .85; }
.znow-people { display: flex; flex-direction: column; gap: 6px; }
.znow-person { text-align: left; font-size: 16px; font-weight: 700; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .85); color: #101828; border: 1px solid rgba(0, 0, 0, .06); }
.znow-person small { display: block; font-weight: 500; font-size: 12px; color: #9a5b00; }
.znow-person.pause { opacity: .7; border-style: dashed; }
.znow-warn { margin: auto 0 0; font-weight: 700; font-size: 13px; }
.znow-warn-inline { color: var(--danger); font-weight: 600; }
.znow-side { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.znow-side .card { margin: 0; }
.znow-side h3 { margin: 0 0 8px; font-size: 15px; }
.znow-next ul, .ze-diff { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.znow-pauses p { margin: 4px 0; }
/* Fenêtre remarque / imprévu */
.zsheet { max-width: 520px; }
.zs-field { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; font-weight: 600; font-size: 13px; }
.zs-field select, .zs-field input, .zs-field textarea { font-size: 16px; font-weight: 400; }
.zs-motifs { display: grid; gap: 8px; margin: 12px 0; }
.zs-motifs.two { grid-template-columns: 1fr 1fr; }
.zs-motifs button { text-align: left; padding: 12px 14px; font-size: 15px; border-radius: 12px; }
.zs-motifs button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.zs-recid { background: #fff1d6; color: #9a5b00; border-radius: 10px; padding: 8px 12px; margin: 8px 0; }
.zs-actions { margin-top: 14px; }
.zsheet label.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
@media (max-width: 900px) {
  .znow-grid, .znow-grid.alone { grid-template-columns: 1fr 1fr; }
  .znow-side { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .ztabs { width: 100%; } .ztabs button { flex: 1; }
  .znow-card { min-height: 110px; padding: 12px; }
  .znow-tools button { flex: 1; }
  .zsheet { width: 100%; max-width: none; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92vh; overflow: auto; }
  .zs-motifs.two { grid-template-columns: 1fr; }
}
.znow-card.short { background: #fff1d6 !important; color: #9a5b00; border-color: #f5c46b; }
.znow-plan { margin: -6px 2px 12px; font-size: 14px; }
.znow-role { font-style: normal; font-weight: 600; font-size: 11px; background: rgba(0, 0, 0, .07); border-radius: 6px; padding: 1px 6px; margin-left: 4px; white-space: nowrap; }

/* Horaire fixe : jour créé à la main */
.fx-counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin: 10px 0; }
.fx-counts label { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--bg, #f6f7fb); border-radius: 10px; padding: 8px 10px; font-weight: 600; font-size: 13px; }
.fx-counts input[type=number] { width: 64px; font-size: 16px; text-align: center; }
.fx-counts .fx-extra input:not([type=number]) { width: 80px; font-size: 15px; }
.fx-custom { margin: 0 0 10px; align-items: center; }
#fxForm label.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }

/* Dispatch encadré en gras dans les tableaux (horaire fixe, zones du jour) */
.ztable .zcell .z-D, .zslot .zs-code.z-D { outline: 3px solid #5b3cc4; outline-offset: -3px; }

/* Statistiques : roulement foot et dimanches */
.duty-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
#dutyFoot tr.next td, #dutySunday tr.next td { background: var(--accent-soft); font-weight: 600; }
.duty-move { white-space: nowrap; }
.duty-move button { padding: 2px 8px; }

/* Factures */
.inv-site .card-head { margin-bottom: 6px; }
.inv-store { border-top: 1px solid var(--line); padding: 12px 0; }
.inv-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inv-head b { font-size: 15px; min-width: 90px; }
.inv-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.inv-add { cursor: pointer; }
.inv-files { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.inv-files li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inv-files .link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; text-align: left; }
.inv-memo textarea { width: 100%; margin-top: 8px; font-size: 14px; }
.inv-memo-preview { margin: 6px 0 0; }
@media (max-width: 700px) { .inv-actions { margin-left: 0; width: 100%; } .inv-actions > * { flex: 1; text-align: center; } }

/* Chef de parc : CP du lundi au vendredi */
.c-CP { background: #e7ecf3; color: #344054; font-weight: 700; }

/* Agenda */
body.readonly .edit-only { display: none !important; }
.ag-form { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.ag-x { font-size: 16px; padding: 4px 10px; }
.ag-types { margin: 4px 0 18px; }
.ag-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; }
.ag-f { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 0; }
.ag-f > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.ag-f > span i { font-style: normal; font-weight: 400; }
.ag-f input, .ag-f textarea { width: 100%; font: inherit; color: var(--text); padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); }
.ag-f textarea { resize: vertical; min-height: 70px; }
.ag-f input:focus, .ag-f textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.ag-wide { grid-column: span 2; }
.ag-full { grid-column: 1 / -1; }
.ag-when { display: flex; width: 100%; }
.ag-when button { flex: 1; white-space: nowrap; }
.ag-foot { display: flex; align-items: center; gap: 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.ag-preview { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 3px; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 8px 12px; }
.ag-preview span { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ag-preview b { font-size: 14px; overflow-wrap: anywhere; }
.ag-btns { display: flex; gap: 8px; }
.ag-todo { border-left: 4px solid #f5a524; }
.ag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ag-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ag-item:hover { border-color: var(--line-strong); }
.ag-item.sent .ag-main b { color: var(--muted); }
.ag-ico { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: var(--surface-2); }
.ag-ico.t-planon { background: #e8eefc; } .ag-ico.t-materiel { background: #fff1d6; } .ag-ico.t-livraison { background: #e6f6ee; }
.ag-ico.t-evenement { background: #fde8f1; } .ag-ico.t-foot { background: #ede7fe; } .ag-ico.t-tache { background: #eef0f4; }
.ag-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.ag-main b { font-size: 13.5px; overflow-wrap: anywhere; }
.ag-date { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .03em; }
.ag-meta { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 12px; color: var(--muted); }
.ag-meta span + span::before { content: "·"; margin: 0 6px; }
.ag-status { flex: none; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; color: #9a5b00; background: #fff4e0; }
.ag-status.ok { color: #11734d; background: #e3f6ec; }
.ag-out { flex: none; white-space: nowrap; }
.ag-more { position: relative; flex: none; }
.ag-more summary { list-style: none; cursor: pointer; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); font-weight: 700; color: var(--muted); }
.ag-more summary::-webkit-details-marker { display: none; }
.ag-more[open] summary { background: var(--surface-2); }
.ag-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 220px; display: grid; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow), 0 12px 32px rgba(20, 28, 60, .14); }
.ag-menu button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.ag-menu button:hover { background: var(--surface-2); }
.ag-menu button.danger { color: var(--danger); }
.ag-day { margin: 16px 0 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ag-day:first-of-type { margin-top: 4px; }
.ag-day.today { color: var(--accent); }
.ag-empty { text-align: center; padding: 26px 10px; color: var(--muted); }
.ag-empty span { font-size: 30px; }
.ag-empty p { margin: 6px 0 14px; }
@media (max-width: 900px) { .ag-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .ag-fields { grid-template-columns: 1fr; } .ag-wide { grid-column: auto; }
  .ag-item { flex-wrap: wrap; } .ag-main { flex-basis: calc(100% - 50px); }
  .ag-status { margin-left: 50px; } .ag-out { flex: 1; }
  .ag-btns { width: 100%; } .ag-btns button { flex: 1; }
}

/* Éléments du nouveau thème, cachés dans le thème classique (voir theme-shyfter.css) */
.av, .hrs, #grid .namebox small.hrs, #grid td.cell span .dur { display: none; }

/* ===== Espace employé, cloche, publication (les deux apparences) ===== */
.me-nav { display: none !important; }
body.employee .me-nav { display: flex !important; }
body.employee .sidebar .nav:not(.me-nav):not(.emp-ok):not(#accountBtn), body.employee .sidebar .nav-label,
body.employee .topbar .monthnav, body.employee .topbar .actions, body.employee #undoBtn, body.employee #alertChip { display: none !important; }
.me-hero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 16px; }
.me-hello h2 { margin: 0 0 4px; font-size: 22px; }
.me-hello p { margin: 2px 0 0; }
.me-tabs { margin-bottom: 14px; }
.me-weeknav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.me-weeknav span { font-weight: 600; flex: 1; text-align: center; min-width: 160px; }
.me-week { padding: 6px 0; }
.me-day { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.me-day:last-child { border-bottom: 0; }
.me-day.today { box-shadow: inset 4px 0 0 var(--accent); }
.me-date { width: 76px; flex: 0 0 76px; display: grid; }
.me-date span { font-size: 12.5px; color: var(--muted); }
.me-date b { font-size: 20px; line-height: 1.2; }
.me-day.today .me-date b { color: var(--accent); }
.me-what { flex: 1; min-width: 0; display: grid; gap: 6px; }
.me-shift { display: inline-flex; flex-direction: column; padding: 8px 12px; border-radius: 10px; justify-self: start; min-width: 150px; }
.me-shift b { font-size: 15px; } .me-shift small { opacity: .8; font-size: 12px; }
.me-shift.c-OTHER { background: var(--s10); color: var(--s10-ink); }
.me-off { color: var(--muted); font-weight: 600; }
.me-np { color: var(--muted); font-style: italic; }
.me-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.me-total { color: var(--muted); margin: 10px 2px; }
.me-teamcard { overflow-x: auto; }
.me-team, .me-zt { border-collapse: collapse; width: 100%; font-size: 13px; }
.me-team th, .me-team td, .me-zt th, .me-zt td { padding: 6px 4px; text-align: center; border-bottom: 1px solid var(--line); }
.me-team tbody th, .me-zt tbody th { text-align: left; font-weight: 600; white-space: nowrap; padding-right: 10px; }
.me-team tbody th small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.me-team thead th { font-weight: 500; color: var(--muted); font-size: 12px; }
.me-team thead th b { color: var(--text); font-size: 14px; }
.me-team thead th.today b { color: var(--accent); }
.me-team td span, .me-zt td span { display: inline-block; padding: 3px 6px; border-radius: 6px; font-weight: 600; font-size: 12px; white-space: nowrap; }
.me-team td.off { color: var(--muted); } .me-team td.np { color: var(--line-strong); }
.me-team tr.mine th, .me-team tr.mine td { background: var(--accent-soft); }
.me-team tr.stud th { color: var(--muted); font-weight: 500; }
.c-STUDENT { background: var(--off); color: var(--text); }
.me-path { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.me-path li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.me-path li.now { background: var(--accent-soft); outline: 2px solid var(--accent); }
.me-path li.past { opacity: .5; }
.me-path .t { width: 92px; font-weight: 600; font-variant-numeric: tabular-nums; }
.me-path .zn { font-weight: 600; padding: 3px 10px; border-radius: 8px; }
.z1 { background: #e0eaff; color: #3538cd; } .z2 { background: #dcfae6; color: #067647; } .z3 { background: #fdead7; color: #b93815; }
.zD { background: #f4ebff; color: #6941c6; } .zT { background: #fef0c7; color: #93370d; }
.me-zt th.mine { color: var(--accent); }
.me-zt tr.now th, .me-zt tr.now td { background: var(--accent-soft); }
.me-kpis { margin-bottom: 16px; }
.me-hours td small { color: var(--muted); }
.me-hours tr.cur td { font-weight: 600; }
.me-diff { font-weight: 700; } .me-diff.pos { color: var(--ok); } .me-diff.neg { color: var(--danger); }
.me-hlist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.me-hlist li { display: grid; grid-template-columns: 60px 1fr auto; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.me-hlist .pos { color: var(--ok); } .me-hlist .neg { color: var(--danger); }
.card .hint, .hint { color: var(--muted); font-size: 12px; }

/* Cloche */
.bell-wrap { position: relative; }
.bell-btn { position: relative; width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 10px; }
.bell-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bell-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.bell-count[hidden] { display: none; }
.bell-panel { position: absolute; right: 0; top: 48px; width: min(360px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; z-index: 60;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(16, 24, 40, .16); }
.bell-head { padding: 12px 16px; font-weight: 700; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.bell-item { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.bell-item.new { background: var(--accent-soft); }
.bell-item p { margin: 2px 0; font-size: 13px; color: var(--text); }
.bell-item small { color: var(--muted); font-size: 11.5px; }
.bell-empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 24px; }
.bell-empty p { font-size: 13.5px; margin: 6px 0 0; }

/* Publication du mois (Horaire) */
.pub-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; border: 1px solid var(--line); background: var(--surface); }
.pub-bar > span:nth-child(2) { flex: 1; min-width: 220px; }
.pub-bar .ic { font-size: 18px; }
.pub-bar.draft { background: var(--warn-bg); border-color: #fedf89; }
.pub-bar.ok { background: var(--ok-soft); border-color: #abefc6; color: var(--ok); }
.pub-bar.changed { background: var(--accent-soft); border-color: var(--accent); }
.pub-bar.changed span[title] { text-decoration: underline dotted; cursor: help; }

/* Équipe : accès et lien d'invitation */
#teamAccess td.acts { white-space: nowrap; text-align: right; }
#teamAccess td.acts button { margin-left: 4px; }
.invite-dlg { max-width: 520px; width: calc(100vw - 32px); border: 0; border-radius: 14px; padding: 22px; }
.invite-dlg h3 { margin-top: 0; }
.invite-dlg input { width: 100%; box-sizing: border-box; margin: 6px 0 12px; font-size: 13px; }
.invite-dlg .row { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 700px) {
  .me-hero { padding: 14px; } .me-hello h2 { font-size: 19px; }
  .me-day { padding: 10px 12px; } .me-date { width: 64px; flex-basis: 64px; }
  .me-shift { min-width: 0; }
  .me-tabs button { padding-left: 6px; padding-right: 6px; font-size: 13px; }
}

/* ===== Groupes de week-end (Équipe) ===== */
.grp-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 12px 0; }
.grp-col { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; min-height: 120px; cursor: pointer; transition: border-color .15s, background .15s; }
.grp-col.drop { border-color: var(--accent); background: var(--accent-soft); }
.grp-col.over { border-color: var(--danger); background: var(--danger-soft); }
.grp-col.new { border-style: dashed; background: transparent; }
.grp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-bottom: 2px; }
.grp-head small { color: var(--muted); font-size: 11.5px; }
.grp-chip { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-weight: 500; cursor: grab; user-select: none; }
.grp-chip.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.grp-chip .hrx-av { width: 26px; height: 26px; flex-basis: 26px; font-size: 11px; }
.grp-empty { color: var(--muted); font-size: 12.5px; font-style: italic; }
.grp-warn { color: var(--danger); font-size: 12px; font-weight: 600; }
.grp-head { flex-direction: column; align-items: flex-start; gap: 0; } .grp-head b { white-space: nowrap; }

/* Groupes de week-end : une ligne par groupe, 2 listes pour choisir les prénoms */
.grp-board { display: grid; grid-template-columns: 1fr; gap: 8px; }
.grp-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.grp-name { display: grid; } .grp-name small { color: var(--muted); font-size: 11.5px; }
.grp-row select { width: 100%; }
.grp-del { color: var(--muted); }
#grpAdd { justify-self: start; }
@media (max-width: 700px) { .grp-row { grid-template-columns: 1fr auto; } .grp-row select { grid-column: 1 / -1; } .grp-name { grid-row: 1; } }

.grp-row { grid-template-columns: 130px minmax(0, 1fr) auto; }
.grp-people { display: flex; flex-wrap: wrap; gap: 8px; }
.grp-people select { flex: 1 1 200px; width: auto; }
.grp-people select.grp-add { color: var(--muted); border-style: dashed; }
@media (max-width: 700px) { .grp-row { grid-template-columns: 1fr auto; } .grp-people { grid-column: 1 / -1; } }

/* Semaine figée (horaire reçu) : impossible à modifier */
#grid th.frozen { box-shadow: inset 0 3px 0 #475467; }
#grid th.frozen .n::after { content: " 🔒"; font-size: 10px; }
#grid td.cell.frozen { cursor: not-allowed; background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(71, 84, 103, .05) 6px 12px); }
#grid td.cell.frozen.lock::after { content: ""; }

/* Compteur des maladies et certificats */
.sick-count tr[data-person] { cursor: pointer; }
.sick-count tr.alert td { background: var(--warn-bg); }
.sick-detail td { background: var(--surface-2); }
.sick-detail ul { list-style: none; margin: 0; padding: 4px 0; display: grid; gap: 8px; }
.sick-detail li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sick-detail .when { min-width: 190px; font-weight: 500; }
.cert { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 3px 8px; border-radius: 8px; }
.cert.ok { background: var(--ok-soft); color: var(--ok); } .cert.ok a { color: inherit; font-weight: 600; }
.cert.missing { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.cert-add { font-size: 12.5px; padding: 4px 10px; cursor: pointer; }
.cert-pick { display: grid; gap: 4px; font-size: 12.5px; }
.cert-pick input[type=file] { font-size: 12px; max-width: 230px; }
.cert-name { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }

/* Codes de la fiche salaires */
.c-SS, .c-ANC, .c-PC, .c-PATERNITE, .c-AT, .c-AJ, .c-CS, .c-FS, .c-MS, .c-T03 { background: var(--conge); color: var(--conge-ink); }
.c-RJ, .c-RS { background: var(--off); color: var(--off-ink); }

/* Équipe : une ligne par personne (prénom, nom, fonction, arrivée, départ, retirer) */
.emp-list { display: grid; gap: 8px; margin: 10px 0 12px; }
.emp-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) minmax(0, 1.2fr) 110px 150px 150px auto; gap: 10px; align-items: end;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.emp-row.gone { opacity: .6; background: var(--surface-2); }
.emp-row > .hrx-av { width: 36px; height: 36px; flex-basis: 36px; font-size: 13px; align-self: center; }
.emp-row label { display: grid; gap: 3px; font-size: 11.5px; color: var(--muted); font-weight: 500; min-width: 0; }
.emp-row input { width: 100%; box-sizing: border-box; min-width: 0; }
.emp-act { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.emp-rm { color: var(--danger); }
.emp-ask { grid-column: 1 / -1; display: grid; gap: 8px; padding: 12px; border-radius: 10px; background: var(--danger-soft); }
.emp-ask .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.emp-ask label { color: var(--text); }
@media (max-width: 900px) {
  .emp-row { grid-template-columns: 36px 1fr 1fr; }
  .emp-row > .hrx-av { grid-row: span 2; }
  .emp-row .emp-fn { grid-column: 2 / -1; }
  .emp-row label:nth-of-type(4), .emp-row label:nth-of-type(5) { grid-column: auto; }
  .emp-act { grid-column: 1 / -1; justify-content: space-between; }
}
@media (max-width: 520px) {
  .emp-row { grid-template-columns: 1fr 1fr; }
  .emp-row > .hrx-av { display: none; }
  .emp-row .emp-fn { grid-column: 1 / -1; }
}

/* Carte Employés : seulement prénom, nom et « Retirer » */
.emp-row { grid-template-columns: 36px minmax(0, 1fr) minmax(0, 1fr) auto; }
@media (max-width: 900px) { .emp-row { grid-template-columns: 36px 1fr 1fr; } .emp-act { grid-column: 1 / -1; } }
@media (max-width: 520px) { .emp-row { grid-template-columns: 1fr 1fr; } }

/* Espace employé : choix Semaine / Mois et séparateurs de semaines dans la vue du mois */
.me-scope { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--line); margin-bottom: 10px; }
.me-scope button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font-weight: 600; color: var(--muted); cursor: pointer; }
.me-scope button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.me-wsep { padding: 8px 18px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .03em; }
.me-team.month th, .me-team.month td { padding: 5px 2px; min-width: 34px; }
.me-team.month td span { padding: 2px 4px; font-size: 11px; }
.me-team.month tbody th { position: sticky; left: 0; background: var(--surface); z-index: 1; }

/* Espace employé : pages partagées (Statistiques, Zones en lecture ; Agenda, Reporting sans suppression ni PDF) */
body.employee .no-emp, body.employee .log-del, body.employee [data-ag-del] { display: none !important; }
body.employee .sidebar .nav.emp-ok { display: flex !important; }
.ag-by { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
body.readonly #znEvent, body.readonly #znMsg { display: none !important; }

/* Zones › Maintenant : choisir le créneau affiché */
.zslot-nav { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.zslot-nav .icon-btn { width: 30px; height: 30px; }
.zslot-nav b { min-width: 64px; text-align: center; }

/* Zones › Ma journée */
.zme-pick { margin-bottom: 10px; }
.zme-head { display: flex; align-items: center; gap: 12px; }
.zme-head h3 { margin: 0; }
.zme-head p { margin: 2px 0 0; }
.zme-sum { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.zme-sum .zn { font-weight: 600; font-size: 12px; padding: 3px 10px; border-radius: 8px; }
/* Zones : pas d'onglet « Équipe » pour un compte employé */
body.employee #ztTeam { display: none !important; }

/* Statistiques › Régularisation */
#gapStats td.gaps { text-align: left; }
.gap { display: inline-block; padding: 2px 8px; border-radius: 8px; font-weight: 600; font-size: 12px; margin: 1px 2px; }
.gap.plus { background: #fde8e8; color: #b42318; } .gap.minus { background: #dcfae6; color: #067647; }
.gap.even { background: var(--surface-2); color: var(--muted); }
#gapStats td.gaps { text-align: left; line-height: 1.9; }

/* Front office (compte employé) : textes réservés à l'un ou l'autre */
.emp-only { display: none; }
body.employee .emp-only { display: block; }

/* RH : pièces jointes */
.hrx-attach { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; padding: 8px; border: 1px dashed var(--line-strong); border-radius: 10px; }
.hrx-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.hrx-files.col { flex-direction: column; align-items: flex-start; }
.hrx-files:empty { display: none; }
.hrx-file { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; max-width: 100%; }
.hrx-file a { color: var(--text); text-decoration: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.hrx-file a:hover { text-decoration: underline; }
.hrx-file small { color: var(--muted); }
.hrx-file button { padding: 0 6px; min-height: 0; line-height: 1.4; }
.hrx-file.pending { background: var(--accent-soft); }
.hrx-addfile { display: inline-flex; align-items: center; font-size: 12px; color: var(--muted); cursor: pointer; padding: 3px 8px; border-radius: 8px; border: 1px dashed var(--line-strong); }
.hrx-addfile:hover { color: var(--text); border-color: var(--text); }
.hrx-docs .btn { margin-top: 8px; }
[data-drop].drop-on { outline: 2px dashed var(--accent); outline-offset: 2px; background: var(--accent-soft); }
.hrx-item.flash { animation: hrxFlash 2.4s ease; }
@keyframes hrxFlash { 0%, 60% { background: #fff3c4; } 100% { background: transparent; } }
.drop-msg { flex-basis: 100%; margin: 6px 0 0; font-size: 12.5px; color: var(--accent); font-weight: 600; }
.drop-msg.bad { color: #b42318; font-weight: 500; }

/* Parkings liés : sélecteur Westland | Bordet, et ce qui n'existe pas à Bordet */
.site-switch { display: flex; gap: 2px; padding: 3px; margin-top: 10px; border-radius: 10px; background: var(--line); }
.site-switch button { flex: 1; border: 0; background: transparent; padding: 6px 8px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.site-switch button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
body.site-bordet .nav[data-go="zones"], body.site-bordet .nav[data-go="fixed"], body.site-bordet .nav[data-go="calendar"], body.site-bordet .nav[data-go="students"],
body.site-bordet #pubBar, body.site-bordet #rotBar, body.site-bordet #teamAccessCard, body.site-bordet .no-bordet { display: none !important; }
body.site-bordet .card:has(> .no-bordet-card) { display: none !important; }

/* Bouton mode sombre (lune / soleil), à côté de la cloche */
.dark-btn { width: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }
.dark-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 900px) { .topbar .page-title { flex: 1 1 100px; } .dark-btn { width: 36px; height: 36px; } }

/* Alertes du mois : cliquables, et la case en cause clignote dans l'horaire */
#warnings li.alert-link { cursor: pointer; transition: transform .1s; }
#warnings li.alert-link:hover { text-decoration: underline; }
#warnings li.alert-link::after { content: " →"; font-weight: 700; opacity: .6; }
.alert-flash { animation: alertFlash 1.3s ease-in-out 3; position: relative; z-index: 2; }
@keyframes alertFlash { 0%, 100% { box-shadow: inset 0 0 0 0 rgba(247, 144, 9, 0); } 50% { box-shadow: inset 0 0 0 3px #f79009, 0 0 0 3px rgba(247, 144, 9, .35); } }

/* Fiche salaires : envois à la RH */
.pay-send { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.pay-send h4 { margin: 0 0 4px; }
.pay-send label.grow { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.pay-hist { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.pay-hist li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.pay-hist li .muted { flex: 1; }
.pay-send .row { align-items: flex-end; }
.pay-send label.grow input { width: 100%; max-width: 380px; }

/* Page Salaires */
.pay-page { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.pay-page .pay-now { grid-row: span 2; }
@media (max-width: 1000px) { .pay-page { grid-template-columns: 1fr; } .pay-page .pay-now { grid-row: auto; } }
.pay-steps { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 10px; }
.pay-steps li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); flex-wrap: wrap; }
.pay-steps li > div { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; }
.pay-steps li small { color: var(--muted); }
.pay-steps .n { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: var(--accent-soft); color: var(--ok); flex: 0 0 30px; }
.pay-steps li button { min-width: 200px; }
.pay-changes { margin: 6px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); }
.pay-changes h4 { margin: 0 0 6px; color: var(--warn); }
.pay-changes ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.pay-extra { margin-top: 10px; }
.pay-settings label.grow { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.pay-settings label.grow input { width: 100%; }
.pay-settings .row { align-items: flex-end; }
.pay-people { margin-top: 14px; }
.pay-people summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
#payStatus.sent { background: var(--ok-soft); color: var(--ok); }
#payStatus.todo { background: var(--warn-bg); color: var(--warn); }

/* Espace employé : message quand la carte n'est pas disponible (en local, ou pas administrateur) */
.access-off { display: none; }
#teamAccessCard[hidden] + .access-off { display: block; }
.pay-steps li button { min-width: 230px; flex: 0 0 auto; }
.pay-steps li > div { flex: 1 1 200px; min-width: 0; }
.pay-settings label.grow { text-align: left; align-items: stretch; }

/* Remarque terrain : libellés à gauche, grande zone de texte dans la police de l'outil */
.zs-field { align-items: stretch; text-align: left; }
.zs-field textarea.zs-text { width: 100%; box-sizing: border-box; min-height: 130px; font: inherit; font-size: 16px; font-weight: 400; line-height: 1.5;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); resize: vertical; }
.zs-ai { margin: -4px 0 10px; font-size: 12.5px; color: var(--muted); }

/* ----- Pointage (page du chef, Mon espace, écran de confirmation) ----- */
.punch-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.punch-top .row { display: flex; gap: 8px; flex-wrap: wrap; }
.pu-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-bottom: 14px; }
.pu-person { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; margin: 0; }
.pu-person small { display: block; color: var(--muted); font-size: 12px; }
.pu-kpis { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.pu-day { margin-bottom: 12px; }
.pu-day.today { border-color: var(--accent); }
.pu-table td, .pu-table th { vertical-align: middle; }
.pu-time { font: inherit; font-variant-numeric: tabular-nums; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; cursor: pointer; color: var(--text); }
.pu-time:hover { border-color: var(--accent); }
.pu-time.empty { font-weight: 400; color: var(--muted); border-style: dashed; background: transparent; }
.pu-time.fixed { background: #fff6d6; border-color: #f3d36b; }
.pu-time small { margin-left: 4px; font-size: 11px; }
.pu-a { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; margin: 1px 0; white-space: nowrap; background: var(--off); color: var(--muted); }
.pu-a.late, .pu-a.forgot { background: #fde3e1; color: #b42318; }
.pu-a.extra { background: #fff1c2; color: #7a4e00; }
.pu-a.early, .pu-a.unplanned { background: #eef0f4; color: #475467; }
.pu-a.ok { background: #e3f8ec; color: #0b6b3a; }
.pu-a.out { background: #eef0f4; color: #344054; }
.pu-line { display: flex; flex-wrap: wrap; gap: 6px; }
.pu-me .pu-line { margin: 6px 0 4px; }
.pu-me .pu-a { font-size: 14px; padding: 4px 12px; }
.me-hlist li:has(.pu-line) { grid-template-columns: 1fr auto; }
.punch-dlg label { display: block; margin: 10px 0; font-size: 13px; color: var(--muted); }
.punch-dlg label input { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; font-size: 15px; }
.punch-dlg .row { margin-top: 12px; align-items: center; }
.pu-kqr { display: grid; place-items: center; margin: 10px 0; }
.pu-kqr img { border-radius: 10px; background: #fff; }
.punch-done { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: rgba(15, 18, 16, .55); backdrop-filter: blur(6px); padding: 20px; }
.punch-done[hidden] { display: none; }
.punch-done .pd-box { background: var(--surface, #fff); color: var(--text); border-radius: 24px; padding: 34px 28px; max-width: 380px; width: 100%; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); animation: pdIn .35s cubic-bezier(.2, .9, .3, 1.2); }
.punch-done .pd-ico { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 44px; font-weight: 700; color: #fff; background: #12b76a; }
.punch-done.ko .pd-ico { background: #d92d20; }
.punch-done h2 { margin: 0 0 6px; font-size: 24px; }
.punch-done p { color: var(--muted); margin: 0 0 20px; font-size: 16px; }
.punch-done button { min-width: 140px; }
@keyframes pdIn { from { opacity: 0; transform: scale(.85); } }
@media (max-width: 700px) {
  .pu-table th:nth-child(5), .pu-table td:nth-child(5) { display: none; }
  .pu-table td, .pu-table th { padding: 6px 4px; font-size: 12.5px; }
  .pu-time { padding: 3px 6px; }
}
html body button.pu-time { white-space: nowrap; border-radius: 10px; padding: 5px 12px; min-height: 0; }
html body button.pu-time.empty { padding: 5px 10px; }
html body button.pu-time.fixed { background: #fff6d6; border-color: #f3d36b; }
.pu-table td:nth-child(2) { white-space: nowrap; }

/* ----- Back-office Lintel ----- */
body:not(.platform) .platform-only { display: none !important; }
#liTabs { margin-bottom: 14px; }
.li-kpis { margin-bottom: 14px; }
.li-scroll { overflow-x: auto; }
.li-table td small { display: block; font-size: 12px; }
.li-table td { vertical-align: top; }
.li-act { white-space: nowrap; text-align: right; }
.li-act button { padding: 4px 10px; font-size: 12.5px; }
.li-st { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--off); color: var(--muted); }
.li-st.active { background: #e3f8ec; color: #0b6b3a; } .li-st.trial { background: #e8f0ff; color: #1d4ed8; }
.li-st.suspended { background: #fde3e1; color: #b42318; }
.li-late { color: #b42318; font-weight: 600; }
.li-form { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.li-form label { display: block; margin: 6px 0; font-size: 13px; color: var(--muted); }
.li-form label input:not([type=checkbox]), .li-form label select, .li-form label textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; font: inherit; font-size: 14px; color: var(--text); }
.li-form .wide, .li-form .check { grid-column: 1 / -1; }
.li-form .check { display: flex; gap: 8px; align-items: center; }
.li-dlg { max-width: 640px; }
.li-dlg .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.li-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.li-lead { margin-bottom: 10px; }
.li-lead.won, .li-lead.lost { opacity: .75; }
.li-lead-grid { display: grid; grid-template-columns: 1fr 260px; gap: 18px; }
.li-lead-side label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.li-lead-side select, .li-lead-side textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; font: inherit; font-size: 13.5px; }
.li-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.li-msg { white-space: pre-wrap; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin: 8px 0 0; }
.li-text { border-top: 1px solid var(--line); padding: 12px 0; }
.li-text code { font-size: 12px; color: var(--muted); }
.li-text label { display: block; margin: 6px 0; font-size: 12px; color: var(--muted); }
.li-text textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 3px; font: inherit; font-size: 14px; }
.li-text .row { display: flex; align-items: center; gap: 8px; }
#liTextQ { min-width: 260px; }
@media (max-width: 700px) {
  .li-form, .li-lead-grid { grid-template-columns: 1fr; }
  #liTextQ { min-width: 0; width: 100%; }
}

/* ----- Espace Lintel (écran à part) ----- */
.side-nav .mod-off { display: none !important; }
.side-brand .brand-name { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--side-text, inherit); }
.support-bar { background: #fff1c2; color: #5c3d00; padding: 8px 16px; font-size: 13.5px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.support-bar button { margin-left: auto; }
body.in-lintel { overflow: hidden; }
.lintel-app { position: fixed; inset: 0; z-index: 900; background: var(--bg, #f4f1ea); overflow-y: auto; }
.lintel-app[hidden] { display: none; }
.li-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 18px; padding: 14px 28px; background: var(--bg, #f4f1ea); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.li-brand { display: flex; align-items: center; gap: 10px; font-size: 22px; letter-spacing: -.02em; }
.li-brand .li-logo { width: 30px; height: 30px; color: var(--text); }
.li-brand .tag { font-size: 11px; }
.li-top #liTabs { margin: 0 auto 0 0; }
.li-count { font-style: normal; display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #d92d20; color: #fff; font-size: 11px; font-weight: 700; margin-left: 4px; }
.li-main { max-width: 1240px; margin: 0 auto; padding: 24px 28px 60px; }
.li-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.li-card { --brand: var(--accent); text-align: left; display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; cursor: pointer; font: inherit; color: var(--text); position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s; }
html body button.li-card { border-radius: 20px; padding: 18px; background: var(--surface); text-align: left; align-items: stretch; justify-content: flex-start; font-weight: 400; color: var(--text); border-color: var(--line); }
html body button.li-card.li-add { align-items: center; justify-content: center; }
html body button.li-card:hover { background: var(--surface); }
.li-card::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--brand); }
.li-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .35); }
.li-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.li-card-top img { max-height: 36px; max-width: 140px; object-fit: contain; }
.li-ini { font-style: normal; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; }
.li-name { font-size: 18px; letter-spacing: -.01em; }
.li-sector { color: var(--muted); font-size: 13px; min-height: 18px; }
.li-card-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0 8px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.li-card-nums span { display: flex; flex-direction: column; } .li-card-nums b { font-size: 16px; } .li-card-nums small { color: var(--muted); font-size: 11.5px; }
.li-card-foot { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.li-card.suspended, .li-card.ended { opacity: .7; }
.li-add { align-items: center; justify-content: center; border-style: dashed; min-height: 220px; color: var(--muted); }
.li-add::before { display: none; }
.li-add span { font-size: 40px; line-height: 1; color: var(--text); }
.li-panel { width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 40px); border: 0; border-radius: 24px; padding: 0; background: var(--surface); color: var(--text); }
.li-panel::backdrop { background: rgba(15, 18, 16, .45); backdrop-filter: blur(4px); }
.li-p-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 26px 6px; }
.li-p-head h2 { margin: 6px 0 0; font-size: 24px; }
.li-ptabs { margin: 8px 26px 0; }
.li-sites { margin: 12px 26px 0; }
.li-p-body { padding: 16px 26px; }
.li-p-body h4 { margin: 16px 0 8px; }
.li-p-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 26px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 24px 24px; }
.li-pay { display: flex; align-items: center; gap: 8px; }
.li-invite { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--surface-2); border-radius: 14px; padding: 12px; }
.li-invite input { flex: 1; min-width: 200px; }
.li-linkbox { background: #e3f8ec; border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; color: #0b3b22; }
.li-linkbox h3 { margin: 0 0 6px; } .li-linkbox p { color: #2d5a40; }
.li-linkbox input { width: 100%; box-sizing: border-box; margin: 6px 0 10px; font-size: 12.5px; }
.li-linkbox .row { display: flex; gap: 8px; flex-wrap: wrap; }
.li-mods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.li-mod { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; cursor: pointer; }
.li-mod input { position: absolute; opacity: 0; pointer-events: none; }
.li-mod small { display: block; color: var(--muted); font-size: 12px; }
.li-sw { flex: 0 0 38px; height: 22px; border-radius: 11px; background: #d0d5dd; position: relative; transition: background .2s; }
.li-sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.li-mod input:checked + .li-sw { background: var(--accent); }
.li-mod input:checked + .li-sw::after { transform: translateX(16px); }
.li-p-body .row { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.li-preview { background: var(--surface-2); border-radius: 14px; padding: 12px; }
.li-prev-brand { width: 220px; background: var(--surface); border-radius: 12px; padding: 14px; margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.li-prev-brand img { max-width: 160px; max-height: 40px; object-fit: contain; align-self: flex-start; }
.li-prev-brand b { font-size: 18px; } .li-prev-brand small { color: var(--muted); }
.li-prev-nav { margin-top: 8px; border-radius: 999px; padding: 6px 12px; color: #141713; font-size: 13px; font-weight: 600; }
@media (max-width: 700px) {
  .li-top { padding: 10px 14px; gap: 10px; }
  .li-top #liTabs { order: 3; width: 100%; overflow-x: auto; }
  .li-main { padding: 16px; }
  .li-mods { grid-template-columns: 1fr; }
  .li-p-head, .li-p-body, .li-p-foot { padding-left: 16px; padding-right: 16px; }
  .li-ptabs, .li-sites { margin-left: 16px; margin-right: 16px; overflow-x: auto; }
}
.mod-off[data-module] { display: none !important; }

/* Page Lintel seule : le planning n'est jamais affiché */
html.lintel-only .app { display: none !important; }

/* Adresse d'un client (app.lintel.be/<client>) */
.li-url { font-family: 'Geist Mono', monospace; font-size: 11.5px; color: var(--muted); }
.li-slug { display: flex; align-items: center; gap: 0; margin-top: 4px; }
.li-slug > span { font-family: 'Geist Mono', monospace; font-size: 13px; color: var(--muted); padding: 0 6px 0 0; white-space: nowrap; }
.li-slug input { flex: 1; margin: 0 !important; }
.li-slug button { margin-left: 8px; }
.li-slugform { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
#login .logo-wrap.client { background: transparent !important; box-shadow: none; padding: 0; }
#login .client-logo { max-height: 56px; max-width: 220px; object-fit: contain; }
#login .client-name { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
