/* Planning HCR — styles */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e3e6eb;
  --border-strong: #cfd4dc;
  --text: #1b2130;
  --muted: #6b7280;
  --primary: #1f5eff;
  --primary-hover: #1749cc;
  --primary-soft: #e8efff;
  --danger: #c62828;
  --danger-soft: #fdecec;
  --warn: #a15c07;
  --warn-soft: #fff4e0;
  --ok: #1a7f37;
  --ok-soft: #e6f6ea;
  --info: #0b6bcb;
  --info-soft: #e6f1fb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  /* Échelle typographique (voir README › Règles d'affichage) */
  --fs-2xs: 10px;   /* grille du planning, libellés de graphiques */
  --fs-xs: 11px;    /* badges, en-têtes de colonnes en capitales, mentions */
  --fs-sm: 12px;    /* aides, texte secondaire, petits boutons */
  --fs-md: 13px;    /* tableaux, libellés de champs, menus */
  --fs-base: 14px;  /* texte courant, champs, boutons */
  --fs-lg: 16px;    /* titres de rubrique (h2), cartes */
  --fs-xl: 18px;    /* titres de fenêtres et de sections de réglages */
  --fs-xxl: 20px;   /* icônes, avatars */
  --fs-title: 22px; /* titre de page (h1), chiffres clés */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--fs-base)/1.45 var(--font); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: var(--fs-title); margin: 0; letter-spacing: -.01em; }
h2 { font-size: var(--fs-lg); margin: 0 0 12px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-md); }
kbd { border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; font-size: var(--fs-sm); background: var(--surface); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.spacer { flex: 1; }
[hidden] { display: none !important; }

/* Barre du haut */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  height: 56px; padding: 0 20px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--primary); color: #fff; font-size: var(--fs-lg); }
.mainnav { display: flex; gap: 2px; overflow-x: auto; flex: 1; }
.mainnav a { padding: 7px 11px; border-radius: 8px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.mainnav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.mainnav a.active { background: var(--primary-soft); color: var(--primary); }
.userbox { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.userbox form { margin: 0; }

.container { max-width: 1180px; margin: 0 auto; padding: 24px 20px 48px; }
body.wide .container { max-width: none; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: 500 var(--fs-base) var(--font); cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(0, 0, 0, .05); }
.btn.danger.ghost { color: var(--danger); background: transparent; border-color: transparent; }
.btn.danger.ghost:hover { background: var(--danger-soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: var(--fs-sm); }
.btn.icon { width: 36px; padding: 0; font-size: var(--fs-xxl); }
.btn.block { width: 100%; }
.btn.lg { height: 52px; font-size: var(--fs-lg); }

/* Formulaires */
input, select, textarea {
  font: var(--fs-base) var(--font); color: var(--text);
  height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface);
  min-width: 0;
}
textarea { height: auto; padding: 8px 10px; width: 100%; resize: vertical; }
input[type="color"] { width: 44px; padding: 2px; }
input[type="checkbox"], input[type="radio"] { height: auto; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .55; font-size: var(--fs-md); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 500; font-size: var(--fs-md); }
label.inline { flex-direction: row; align-items: center; gap: 6px; }
label small { font-weight: 400; }
fieldset { border: 0; padding: 0; margin: 0 0 20px; }
legend { font-weight: 700; font-size: var(--fs-base); margin-bottom: 12px; padding: 0; }
.req { color: var(--danger); }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 16px; margin-bottom: 16px; }
.grid-form.two { grid-template-columns: 1fr 1fr; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 8px; }
.grid-form > .form-actions { align-self: end; margin-top: 0; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.inline-form.wrap { margin-top: 12px; }
.n1-label { flex-basis: 100%; }
.n1-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.n1-row select, .n1-row .btn { height: 40px; }
form.inline { display: inline; }
.stack { display: grid; gap: 14px; }
.w-xs { width: 72px; }
.w-sm { width: 140px; }
.input-with-btn { display: flex; gap: 6px; }
.input-with-btn input { flex: 1; }
.radios { display: grid; gap: 6px; margin: 10px 0; }
.radios label { flex-direction: row; align-items: center; font-weight: 400; gap: 8px; }
.copy-row { display: flex; gap: 8px; margin: 12px 0; }
.copy-row input { flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: var(--fs-sm); }
.error { color: var(--danger); background: var(--danger-soft); padding: 8px 10px; border-radius: 8px; margin: 8px 0; }
.hint { color: var(--muted); font-size: var(--fs-sm); margin: 10px 0; }

/* Cartes, en-têtes de page */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.head-actions { display: flex; gap: 8px; }
.back { display: inline-block; margin-bottom: 6px; font-size: var(--fs-md); color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters input[type="search"] { min-width: 240px; }
.empty, .empty-state { text-align: center; color: var(--muted); padding: 32px 16px !important; }
details > summary { cursor: pointer; }

/* Messages */
.flashes { display: grid; gap: 8px; margin-bottom: 16px; }
.flash { padding: 10px 14px; border-radius: 8px; border: 1px solid; }
.flash.success { background: var(--ok-soft); border-color: #b7e2c2; color: #14532d; }
.flash.error { background: var(--danger-soft); border-color: #f5c2c2; color: #7f1d1d; }
.flash.warning { background: var(--warn-soft); border-color: #f5d9a8; color: #713f12; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; padding: 12px 18px; border-radius: 10px; background: #1b2130; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.error { background: var(--danger); }

/* Tableaux */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table thead th { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table.hover tbody tr { cursor: pointer; }
.table.hover tbody tr:hover { background: var(--surface-2); }
.table tfoot td, .table tfoot th { font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--border); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.inactive { opacity: .55; }
tr.current td { background: #fbfdff; }
.pos { color: var(--warn); }
.neg { color: var(--info); }

/* Badges */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; background: #eef0f3; color: #374151; white-space: nowrap; }
.badge.t-CDI { background: var(--ok-soft); color: var(--ok); }
.badge.t-CDD { background: var(--info-soft); color: var(--info); }
.badge.t-Extra { background: #f3e8ff; color: #7e22ce; }
.badge.b-warn { background: var(--warn-soft); color: var(--warn); }
.badge.b-danger { background: var(--danger-soft); color: var(--danger); }
.badge.b-ok { background: var(--ok-soft); color: var(--ok); }
.badge.b-info { background: var(--info-soft); color: var(--info); }
.badge.b-admin { background: var(--primary-soft); color: var(--primary); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 1px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.kpi span { display: block; font-size: var(--fs-sm); color: var(--muted); }
.kpi strong { font-size: var(--fs-title); font-variant-numeric: tabular-nums; }
.kpi.warn strong { color: var(--warn); }

/* Planning */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.week-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.week-nav h1 { min-width: 220px; text-align: center; }
.week-nav form { margin: 0; }
.toolbar-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.grid-wrap { overflow-x: auto; }
/* La grille du planning défile dans son propre cadre : en-tête des jours et colonne employés restent visibles */
.grid-wrap.scroll { overflow: auto; max-height: calc(100vh - 250px); min-height: 320px; border-radius: var(--radius); border: 1px solid var(--border); }
.planning { width: 100%; min-width: 1100px; border-collapse: separate; border-spacing: 0; table-layout: fixed; background: var(--surface); }
.planning th, .planning td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.planning th:last-child, .planning td:last-child { border-right: 0; }
.planning thead th { position: sticky; top: 0; z-index: 5; background: var(--surface-2); font-size: var(--fs-sm); font-weight: 600; padding: 9px 6px; text-transform: capitalize; }
.planning .emp-col { position: sticky; left: 0; z-index: 3; }
.planning thead th.emp-col { z-index: 6; }
.planning tfoot th.emp-col { z-index: 6; }
.planning thead th.today { color: var(--primary); background: var(--primary-soft); }
.planning .emp-col { width: 210px; text-align: left; padding: 8px 12px; font-weight: 400; background: var(--surface); }
.planning .tot-col { width: 120px; text-align: right; padding: 8px 10px; font-variant-numeric: tabular-nums; }
.planning .tot-col small { color: var(--muted); }
.planning .tot-col.over strong { color: var(--warn); }
.planning .tot-col.under strong { color: var(--info); }
.planning .tot-col.ok strong { color: var(--ok); }
.planning .cost { font-size: var(--fs-xs); color: var(--muted); }
.planning .week-alert { font-size: var(--fs-xs); color: var(--danger); line-height: 1.2; margin-top: 2px; }
.planning tr.group th { text-align: left; background: var(--surface-2); padding: 7px 12px; font-size: var(--fs-md); font-weight: 700; }
.planning tr.group small { color: var(--muted); font-weight: 400; }
.emp-name { font-weight: 600; color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-meta { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.planning td.cell { position: relative; vertical-align: top; padding: 5px; height: 64px; cursor: pointer; }
.planning td.cell:hover { background: #fafbff; }
.planning td.cell.today { background: #fbfcff; }
.planning td.cell.alert { background: #fff8f6; box-shadow: inset 0 0 0 1px #f3c3b8; }
.planning td.cell.drop { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.alert-icon { position: absolute; top: 3px; right: 4px; width: 15px; height: 15px; border-radius: 50%; background: var(--danger); color: #fff; font-size: var(--fs-2xs); font-weight: 700; display: grid; place-items: center; }
.planning td.cell .add { display: none; width: 100%; height: 22px; border: 1px dashed var(--border-strong); border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: var(--fs-base); line-height: 1; }
.planning td.cell:hover .add { display: block; }
.planning td.cell .add:only-child { display: block; opacity: 0; height: 52px; }
.planning td.cell:hover .add:only-child { opacity: 1; }
.planning tfoot td, .planning tfoot th { background: var(--surface-2); padding: 8px 6px; text-align: center; font-variant-numeric: tabular-nums; border-bottom: 0; }
.planning tfoot .emp-col { background: var(--surface-2); }
.shift {
  position: relative; margin-bottom: 5px; padding: 6px 8px 6px 10px; border-radius: 7px;
  background: color-mix(in srgb, var(--c) 24%, white); border-left: 4px solid var(--c);
  color: color-mix(in srgb, var(--c) 35%, #111827);
  font-size: var(--fs-sm); line-height: 1.3; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-user-drag: element;
  transition: box-shadow .12s, background .12s;
}
.shift:hover { background: color-mix(in srgb, var(--c) 32%, white); box-shadow: 0 2px 6px rgba(16, 24, 40, .12); }
.shift .s-top, .absence .s-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.shift .s-top b { font-weight: 700; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; white-space: nowrap; color: #111827; }
.shift .s-top small, .absence .s-top small { font-size: var(--fs-2xs); font-weight: 600; opacity: .75; white-space: nowrap; font-variant-numeric: tabular-nums; }
.shift .s-bot, .absence .s-bot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 1px; }
.shift .s-bot > span:first-child, .absence .s-bot > span:first-child { font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.shift .s-icons { display: inline-flex; gap: 6px; flex: none; }
.shift .s-icons i { display: inline-flex; align-items: center; gap: 2px; font-style: normal; font-size: var(--fs-2xs); font-weight: 600; }
.shift .s-icons svg { width: 12px; height: 12px; }
.shift em { display: block; font-style: normal; font-size: var(--fs-xs); color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shift.other { opacity: .45; }
.shift.dragging { opacity: .4; }

/* Bascules de vue, récap, absences, vue mensuelle */
.toolbar-views { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions-row { display: flex; align-items: center; margin-bottom: 14px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 9px; padding: 2px; background: var(--surface); }
.seg a, .seg button { padding: 6px 12px; border-radius: 7px; color: var(--muted); font: 500 var(--fs-md) var(--font); border: 0; background: transparent; cursor: pointer; }
.seg a:hover, .seg button:hover { color: var(--text); text-decoration: none; }
.seg a.active, .seg button.active { background: var(--primary); color: #fff; }
.seg.tabs { margin-bottom: 14px; }
.planning .rc { width: 78px; text-align: right; padding: 6px 8px; font-variant-numeric: tabular-nums; font-size: var(--fs-sm); background: var(--surface-2); }
.planning thead th.rc { font-size: var(--fs-xs); text-transform: none; color: var(--muted); }
.planning th.rc.total, .planning td.rc.total, .planning thead th.rc { border-left: 2px solid var(--border); }
.planning .rc.delta { font-weight: 700; }
.planning .rc.delta.over { color: var(--warn); }
.planning .rc.delta.under { color: var(--info); }
.planning .rc.delta.ok { color: var(--ok); }
.planning th.weekend, .planning td.weekend { background-color: #fafafa; }
.planning td.cell.weekend { background: #fbfbfc; }
.planning tr.group td { background: var(--surface-2); }
.planning tfoot tr.sec-total th, .planning tfoot tr.sec-total td { background: #f3f5f8; font-size: var(--fs-sm); padding-top: 4px; padding-bottom: 4px; }
.planning tfoot tr.grand-total th, .planning tfoot tr.grand-total td { background: #e9edf3; border-top: 2px solid var(--border-strong); }
.planning tfoot .emp-col { text-align: left; font-weight: 700; }
.planning tfoot { position: sticky; bottom: 0; z-index: 4; }
.planning tfoot td, .planning tfoot th { position: static; }
.poste-name { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.absence {
  margin-bottom: 5px; padding: 6px 8px 6px 10px; border-radius: 7px; font-size: var(--fs-sm); line-height: 1.3;
  background: color-mix(in srgb, var(--c) 16%, #eef0f3); border-left: 4px solid color-mix(in srgb, var(--c) 70%, #9ca3af);
  color: #4b5563; cursor: pointer; transition: box-shadow .12s;
}
.absence:hover { box-shadow: 0 2px 6px rgba(16, 24, 40, .1); }
.absence .s-top b { font-weight: 700; color: #374151; }
.abs-code { display: inline-block; min-width: 34px; padding: 1px 6px; border-radius: 5px; background: var(--c); color: #fff; font: 700 var(--fs-xs) var(--font); text-align: center; letter-spacing: .02em; }
.planning.month td.cell { height: 46px; padding: 3px 2px; text-align: center; vertical-align: middle; }
.planning.month thead th { padding: 6px 2px; font-size: var(--fs-sm); }
.planning.month .dow { display: block; font-size: var(--fs-2xs); color: var(--muted); font-weight: 500; }
.planning.month tfoot td { font-size: var(--fs-xs); padding: 6px 2px; }
.m-hours { display: block; padding: 2px 0; border-radius: 4px; font-size: var(--fs-xs); font-weight: 600; background: color-mix(in srgb, var(--c) 16%, white); border-bottom: 2px solid var(--c); }
.m-abs { display: block; padding: 2px 0; margin-bottom: 2px; border-radius: 4px; font-size: var(--fs-2xs); font-weight: 700; color: #fff; background: var(--c); }
.m-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 11px; background: var(--c); color: #fff; font-size: var(--fs-xs); font-weight: 700; }
.planning.month .m-count + small { display: block; font-size: var(--fs-2xs); color: var(--muted); }
.duration-line { margin: 4px 0 0; color: var(--muted); }
.pauses-box { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; background: var(--surface-2); }
.pauses-head { display: flex; justify-content: space-between; align-items: center; }
.pauses-box .hint { margin: 6px 0 0; }
.pause-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.pause-row input[type="time"] { width: 112px; }
.pause-row input[type="number"] { width: 76px; }
.pause-row label { flex-direction: row; align-items: center; gap: 5px; font-weight: 400; margin: 0; }
.modal .pause-row label { margin: 0; }
.shift .tags { display: flex; gap: 6px; font-size: var(--fs-2xs); color: var(--muted); margin-top: 1px; }
.shift .tags i { font-style: normal; }
.shift .tags i.meal { color: #92400e; }
.duration-line output { color: var(--text); font-weight: 600; }

/* Exports */
.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.export-item { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: var(--surface-2); display: flex; flex-direction: column; }
.export-item p { flex: 1; margin: 6px 0 10px; }
.btn-row { display: flex; gap: 8px; }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: 40px; z-index: 30; min-width: 280px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 6px; }
.menu-list a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.menu-list a:hover { background: var(--surface-2); text-decoration: none; }

/* Organisation */
.anchors { display: flex; gap: 6px; }
.anchors a { padding: 6px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.add-row { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border-strong); }
.cat-title { font-size: var(--fs-md); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 4px; }
.table.compact th, .table.compact td { padding: 5px 8px; }
.w-lg { width: 280px; }
.impact-legend { display: grid; gap: 4px; margin: 0 0 8px; }
.impact-legend div { display: flex; gap: 8px; align-items: center; }
.impact-legend dt, .impact-legend dd { margin: 0; }
.badge.imp-repos { background: #eef0f3; }
.badge.imp-paye { background: var(--ok-soft); color: var(--ok); }
.badge.imp-neutralise { background: var(--info-soft); color: var(--info); }

/* Fenêtres modales */
.modal { border: 0; border-radius: 14px; padding: 22px; width: min(520px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal::backdrop { background: rgba(17, 24, 39, .45); }
.modal h2 { font-size: var(--fs-xl); margin-bottom: 14px; }
.modal label { margin-bottom: 10px; }
.modal .grid-form label { margin-bottom: 0; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.presets:empty { display: none; }
.chip-btn { border: 1px solid var(--border-strong); background: var(--surface-2); border-radius: 999px; padding: 5px 11px; font: 500 var(--fs-sm) var(--font); cursor: pointer; }
.chip-btn:hover { border-color: var(--primary); color: var(--primary); }
.chip-btn small { color: var(--muted); }
.duration { display: flex; align-items: center; height: 36px; font-weight: 600; }

/* Templates */
.template-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.template-head h2 { margin-bottom: 2px; }
.template-head p { margin: 0; }
.mini-planning { width: 100%; min-width: 760px; border-collapse: collapse; font-size: var(--fs-sm); }
.mini-planning th, .mini-planning td { border: 1px solid var(--border); padding: 5px 6px; vertical-align: top; }
.mini-planning thead th { background: var(--surface-2); }
.mini-planning thead th:first-child { text-align: left; }
.mini-planning tbody th { text-align: left; font-weight: 600; white-space: nowrap; width: 180px; }
.mini-shift { display: block; padding: 1px 5px; margin-bottom: 2px; border-radius: 4px; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 12%, white); white-space: nowrap; font-variant-numeric: tabular-nums; }
.template-edit { margin-top: 12px; }
.template-edit form { margin-top: 10px; }

/* Pointages */
.present-box h2 { margin-bottom: 10px; }
.present-list { display: flex; gap: 8px; flex-wrap: wrap; }
.present-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--ok-soft); color: #14532d; font-weight: 600; }
.present-chip small { font-weight: 400; color: var(--muted); }
.present-chip.stale { background: var(--danger-soft); color: var(--danger); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.punch-table td { vertical-align: top; }
.punch-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0 0 6px; }
.punch-row input[type="time"] { width: 108px; }
.punch-row.anomaly input { border-color: var(--danger); background: var(--danger-soft); }
.punch-tags { display: inline-flex; gap: 4px; }
.nss-reveal { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }

/* Connexion */
body.auth .container { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.auth-card { width: min(420px, 100%); padding: 28px; }
.auth-card h1 { margin: 12px 0 6px; }
.auth-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); }
.qr-code { width: 200px; margin: 8px auto; padding: 8px; background: #fff; border-radius: 8px; }  /* blanc aussi en mode sombre, sinon illisible */
.qr-code svg { display: block; width: 100%; height: auto; }

/* Pointeuse (tablette) */
body.kiosk { background: #0f172a; color: #e5e7eb; min-height: 100vh; user-select: none; -webkit-user-select: none; }
.kiosk-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 32px; border-bottom: 1px solid #1e293b; }
.kiosk-brand { font-size: var(--fs-xxl); font-weight: 700; }
.kiosk-date { color: #94a3b8; text-transform: capitalize; }
.kiosk-clock { font-size: 44px; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.kiosk-main { padding: 20px 32px 48px; }
.kiosk-help { color: #94a3b8; font-size: var(--fs-lg); }
.kiosk-main h2 { font-size: var(--fs-base); color: #cbd5e1; margin: 24px 0 12px; text-transform: uppercase; letter-spacing: .05em; }
.kiosk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kiosk-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px;
  border-radius: 16px; border: 2px solid #1e293b; background: #111c33; color: #f1f5f9; cursor: pointer;
  font: 500 var(--fs-base) var(--font); transition: transform .08s;
}
.kiosk-tile:active { transform: scale(.97); }
.kiosk-tile.present { border-color: #22c55e; background: #0f2a1d; }
.kiosk-tile:disabled { opacity: .4; cursor: not-allowed; }
.avatar { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--c); color: #fff; font-size: var(--fs-xxl); font-weight: 700; }
.tile-name { font-size: var(--fs-lg); font-weight: 600; }
.tile-status { font-size: var(--fs-sm); color: #94a3b8; text-align: center; }
.kiosk-tile.present .tile-status { color: #4ade80; }
.pinpad-overlay, .kiosk-result { position: fixed; inset: 0; background: rgba(2, 6, 23, .8); display: grid; place-items: center; z-index: 50; }
.pinpad { width: min(360px, calc(100vw - 32px)); background: #f8fafc; color: var(--text); border-radius: 20px; padding: 24px; text-align: center; }
.pinpad h2 { font-size: 24px; margin: 0; }
.pinpad p { margin: 4px 0; }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 18px 0 6px; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); }
.pin-dots span.on { background: var(--text); border-color: var(--text); }
.pin-error { color: var(--danger); min-height: 20px; font-weight: 500; }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 16px; }
.keys button { height: 62px; border-radius: 14px; border: 1px solid var(--border); background: #fff; font: 600 24px var(--font); color: var(--text); cursor: pointer; }
.keys button:active { background: var(--primary-soft); }
.keys .muted-key { font-size: var(--fs-base); color: var(--muted); }
.result-card { background: #f8fafc; color: var(--text); border-radius: 20px; padding: 36px 32px; text-align: center; width: min(460px, calc(100vw - 32px)); }
.result-card h2 { font-size: var(--fs-title); margin: 14px 0 8px; }
.result-card p { font-size: var(--fs-lg); margin: 0; color: #374151; }
.result-icon { width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 38px; color: #fff; background: var(--ok); }
.result-icon.out { background: var(--info); }
.camera-box video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; background: #0f172a; margin: 12px 0; transform: scaleX(-1); }
.kiosk-foot { margin-top: 40px; text-align: center; font-size: var(--fs-sm); }
.kiosk-foot a { color: #64748b; }
.kiosk-setup { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.kiosk-setup .pinpad h2 { margin-bottom: 6px; }
.kiosk-setup input { width: 100%; height: 64px; text-align: center; font: 600 32px var(--font); letter-spacing: .3em; text-transform: uppercase; margin: 14px 0 6px; }

/* Responsive */
@media (max-width: 900px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .mainnav { order: 3; flex-basis: 100%; }
  .userbox .muted { display: none; }
  .container { padding: 16px; }
  .grid-wrap.scroll { max-height: none; }
  .span-2 { grid-column: auto; }
  .grid-form.two { grid-template-columns: 1fr; }
  .kiosk-head, .kiosk-main { padding-left: 16px; padding-right: 16px; }
  .kiosk-clock { font-size: 32px; }
}

/* Impression du planning */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; font-size: var(--fs-xs); }
  .topbar, .toolbar-actions, .no-print, .kpis, .flashes, .week-nav .btn, #week-picker, .add, .alert-icon { display: none !important; }
  .container { padding: 0; }
  .planning { min-width: 0; }
  .planning thead th, .planning .emp-col, .planning tfoot, .planning tfoot td, .planning tfoot th { position: static; }
  .grid-wrap.scroll { max-height: none; overflow: visible; border: 0; }
  .planning td.cell { height: auto; }
  .shift { break-inside: avoid; }
}

/* Import des employés */
.import-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.import-steps .card { margin-bottom: 0; }
.import-steps + .card { margin-top: 16px; }
.step { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 6px; border-radius: 50%; background: var(--primary); color: #fff; font-size: var(--fs-md); }
.file-drop { display: block; padding: 18px; margin: 10px 0; border: 2px dashed var(--border-strong); border-radius: 10px; background: var(--surface-2); text-align: center; font-weight: 400; }
.file-drop input { height: auto; border: 0; background: transparent; margin-bottom: 6px; }
.file-drop span { display: block; font-size: var(--fs-sm); color: var(--muted); }
.import-table td { vertical-align: top; }
.import-table tr.row-error td { background: #fff7f7; }
.error-text { color: var(--danger); }
.pin-table .pin { font-size: var(--fs-xl); font-weight: 700; letter-spacing: .15em; }

/* Établissement & règles HCR */
.param-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px 22px; }
.param { gap: 4px; }
.param-label { font-weight: 600; }
.param-grid .param-label { min-height: 2.9em; display: flex; align-items: flex-end; }  /* champs alignés même si un libellé voisin tient sur deux lignes */
.param-input { display: flex; align-items: center; gap: 6px; }
.param-input input:not(.w-num) { flex: 1; }
.w-num { width: 96px; }
.w-md { width: 200px; }
.unit { color: var(--muted); font-size: var(--fs-sm); }
.changed { color: var(--warn); }
.sticky-save { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; margin: -4px 0 16px; z-index: 10; }
.sticky-save .btn { box-shadow: 0 6px 18px rgba(31, 94, 255, .3); }
.rule-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.rule-part { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.rules-table td { vertical-align: middle; }
.rule-line { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; font-size: var(--fs-sm); color: var(--muted); min-height: 30px; }
.seg-label { padding: 6px 4px 6px 10px; font-size: var(--fs-sm); color: var(--muted); }
.drag-mode { margin-left: 8px; }
.copy-days { border: 1px dashed var(--border-strong); border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; }
.day-checks { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.day-check { flex-direction: row; align-items: center; gap: 5px; padding: 4px 9px; border: 1px solid var(--border); border-radius: 999px; font-weight: 500; font-size: var(--fs-sm); margin: 0 !important; cursor: pointer; }
.day-check.current { opacity: .45; }
.day-check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

/* Employés : liste à gauche, fiche à droite */
body.flush .container { max-width: none; padding: 0; }
.emp-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.emp-side { position: sticky; top: 56px; height: calc(100vh - 56px); display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); }
.emp-side-top { padding: 14px 14px 0; display: grid; gap: 10px; }
.emp-side-top input[type="search"] { width: 100%; }
.emp-side-actions { display: flex; gap: 6px; }
.emp-side-actions .btn { flex: 1; }
.incomplete-banner { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: #f3e8ff; color: #5b21b6; font-size: var(--fs-md); font-weight: 500; }
.emp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.emp-tabs button, .emp-tabs-main button { border: 0; background: none; padding: 9px 12px; font: 500 var(--fs-base) var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.emp-tabs button.active, .emp-tabs-main button.active { color: var(--text); border-bottom-color: var(--primary); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: var(--fs-xs); font-weight: 700; }
.emp-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.emp-list a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: var(--text); }
.emp-list a:hover { background: var(--surface-2); text-decoration: none; }
.emp-list a.selected { background: var(--primary); color: #fff; }
.emp-list a.selected .emp-item-poste { color: rgba(255, 255, 255, .8); }
.emp-item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.emp-item-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-item-poste { font-size: var(--fs-sm); color: var(--c); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.missing-dot { width: 8px; height: 8px; border-radius: 50%; background: #8b5cf6; flex: none; }
.emp-list-empty { padding: 16px; color: var(--muted); text-align: center; }
.avatar.sm { width: 38px; height: 38px; font-size: var(--fs-base); flex: none; }
.avatar.lg { width: 60px; height: 60px; font-size: var(--fs-title); flex: none; }
.emp-panel { padding: 24px 32px 48px; min-width: 0; }
.emp-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.emp-head h1 { font-size: var(--fs-title); }
.emp-head-text { flex: 1; min-width: 200px; }
.emp-head-tags { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.btn.danger-outline { border-color: #f1a7a7; color: var(--danger); background: var(--surface); }
.btn.danger-outline:hover { background: var(--danger-soft); }
.emp-tabs-main { display: flex; gap: 8px; border-bottom: 1px solid var(--border); margin: 8px 0 22px; overflow-x: auto; }
.emp-pane h2 { margin-top: 8px; }
.profile-form fieldset, .contract-form { border-top: 1px solid var(--border); padding-top: 18px; }
.contract-form { margin-top: 24px; }
.emp-empty { margin-top: 12vh; }
.btn-row.center { justify-content: center; }
@media (max-width: 900px) {
  .emp-layout { grid-template-columns: 1fr; }
  .emp-side { position: static; height: auto; max-height: 45vh; border-right: 0; border-bottom: 1px solid var(--border); }
  .emp-panel { padding: 16px; }
}
.etab-checks { display: grid; gap: 6px; }
.etab-check { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.emp-scope { padding: 8px 14px; margin: 0; border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--muted); }

/* Multi-entité */
.etab-switch { display: flex; align-items: center; gap: 8px; margin: 0; }
.etab-switch select { font-weight: 700; border-color: transparent; background: var(--surface-2); max-width: 240px; }
.scope-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 16px; border-radius: 10px; background: var(--primary-soft); flex-wrap: wrap; }
.scope-bar select { font-weight: 600; }
.param.custom input { border-color: var(--warn); background: var(--warn-soft); }
.shift.foreign { background: repeating-linear-gradient(135deg, #f3f4f6 0 6px, #fafafa 6px 12px); border-left-color: #9ca3af; color: var(--muted); cursor: not-allowed; }
.nav-menu > summary { padding: 7px 11px; border-radius: 8px; color: var(--muted); font-weight: 500; cursor: pointer; list-style: none; white-space: nowrap; }
.nav-menu > summary.active { background: var(--primary-soft); color: var(--primary); }
.nav-menu .menu-list { left: 0; right: auto; top: 38px; }
.menu-list a small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.mainnav { overflow: visible; }

/* Glisser-déposer : moitié gauche = déplacer, moitié droite = copier */
.planning td.cell.drop { box-shadow: none; background: transparent; }
.planning td.cell.drop::before, .planning td.cell.drop::after {
  position: absolute; top: 2px; bottom: 2px; width: calc(50% - 3px); z-index: 2;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font: 700 var(--fs-xs) var(--font); pointer-events: none; text-align: center;
  border: 2px dashed var(--border-strong); background: rgba(255, 255, 255, .85); color: var(--muted);
}
.planning td.cell.drop::before { content: "Déplacer"; left: 2px; }
.planning td.cell.drop::after { content: "Copier"; right: 2px; }
.planning td.cell.zone-move::before { border: 2px solid var(--primary); background: color-mix(in srgb, var(--primary) 16%, white); color: var(--primary); }
.planning td.cell.zone-copy::after { border: 2px solid var(--ok); background: color-mix(in srgb, var(--ok) 16%, white); color: var(--ok); }

/* Accès aux établissements (fiche employé) */
.access-block { border-top: 1px solid var(--border); padding-top: 18px; margin: 8px 0 18px; }
.access-block h3 { font-size: var(--fs-lg); margin: 0 0 8px; }
.access-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); }
.access-row p { margin: 4px 0 0; font-size: var(--fs-md); }
.access-control { display: flex; flex-direction: column; gap: 4px; }
.access-control select { height: 44px; width: 100%; }
.multi-select { position: relative; }
.multi-select > summary { list-style: none; height: 44px; display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer; background: var(--surface); }
.multi-select > summary::after { content: "⌄"; margin-left: auto; color: var(--muted); }
.multi-options { position: absolute; z-index: 20; left: 0; right: 0; top: 48px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 8px; display: grid; gap: 4px; max-height: 280px; overflow-y: auto; }
.multi-options label { padding: 6px 8px; border-radius: 6px; font-weight: 500; }
.multi-options label:hover { background: var(--surface-2); }
.multi-options label.is-principal { opacity: .5; }
.access-table { margin-top: 10px; }
.access-table td { vertical-align: middle; padding: 12px; }
.access-table select { margin-top: 4px; min-width: 200px; }
.etab-icon { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, var(--c) 15%, white); color: var(--c); font-size: var(--fs-xl); margin-right: 10px; vertical-align: middle; }
.etab-icon .pin { position: absolute; right: -4px; bottom: -4px; font-size: var(--fs-sm); }
.etab-name { text-transform: uppercase; letter-spacing: .01em; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #d1d5db; transition: .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: .15s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(20px); }
@media (max-width: 900px) { .access-row { grid-template-columns: 1fr; } }
.access-table td:first-child { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.access-table .etab-icon { margin-right: 0; flex: none; }

/* Historique / compteurs */
.sub-tabs { margin-bottom: 18px; flex-wrap: wrap; }
.counter-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.counter-head .kpi { min-width: 260px; }
.counter-table { border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; min-width: 900px; width: 100%; }
.counter-table th, .counter-table td { padding: 10px 10px; border-bottom: 1px solid var(--border); text-align: center; font-size: var(--fs-md); white-space: nowrap; }
.counter-table tbody th { text-align: left; font-weight: 500; white-space: normal; min-width: 240px; }
.counter-table thead th.year { background: var(--primary-soft); color: var(--primary); border-top: 3px solid var(--primary); font-weight: 700; }
.counter-table thead th.month, .counter-table thead th.year-cell { color: var(--muted); font-weight: 500; }
.counter-table tr.strong th, .counter-table tr.strong td { font-weight: 700; }
.counter-table td.future { color: #c4c8cf; }
.counter-table thead th.month a { color: inherit; text-decoration: none; border-bottom: 1px dashed currentColor; }
.counter-table thead th.month a:hover { color: var(--primary); }
.counter-table thead th.month small { display: block; font-size: var(--fs-xs); font-weight: 400; }
.counter-month { min-width: 90px; text-align: center; }
.counter-table td.pos { color: var(--warn); }
.counter-table td.neg { color: var(--info); }
.sub-title { font-size: var(--fs-base); margin: 18px 0 6px; }
.history-table td { vertical-align: top; }

/* Documents */
.docs-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.docs-head h2 { margin: 0; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.folder { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; font: 500 var(--fs-md) var(--font); color: var(--text); text-align: center; }
.folder:hover { border-color: var(--primary); }
.folder.active { border-color: var(--primary); background: var(--primary-soft); }
.folder-icon { font-size: 34px; line-height: 1; }
.folder-count { position: absolute; top: 8px; left: 8px; min-width: 24px; height: 24px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-size: var(--fs-sm); font-weight: 700; display: grid; place-items: center; }
.docs-upload { margin-bottom: 16px; }
.counter-table th:first-child { position: sticky; left: 0; z-index: 2; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
.counter-table thead th:first-child { background: var(--bg); }

/* Modèles de documents */
.var-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 24px; }
.var-chip { font: 600 var(--fs-sm) ui-monospace, Menlo, monospace; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; white-space: nowrap; }
.var-chip:hover { border-color: var(--primary); color: var(--primary); }

/* Badgeuse */
.badge-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.week-range { padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); font-weight: 600; }
.badge-tabs { display: flex; gap: 6px; }
.badge-tabs a { padding: 8px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; }
.badge-tabs a:hover { text-decoration: none; color: var(--text); }
.badge-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.badge-actions { display: flex; gap: 8px; align-items: center; }
.badge-actions form { margin: 0; }
.badge-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
.day-list { display: flex; flex-direction: column; gap: 4px; }
.day-list a { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 10px; color: var(--text); font-weight: 500; }
.day-list a:hover { background: var(--surface); text-decoration: none; }
.day-list a.active { background: var(--primary-soft); color: var(--primary); }
.day-list .check { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--border-strong); color: #c4c8cf; font-size: var(--fs-md); }
.day-list .check.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.badge-main { min-width: 0; }
.info-banner { padding: 12px 16px; border-radius: 10px; background: var(--info-soft); border: 1px solid #bcd7f5; margin-bottom: 14px; }
.info-banner.ok { background: var(--ok-soft); border-color: #b7e2c2; }
.badge-table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: var(--fs-md); min-width: 1050px; }
.badge-table th { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.badge-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.badge-table .grp { border-left: 1px solid var(--border); }
.badge-table tr.validated td { background: #f6fbf7; }
.badge-table tr.loose td { background: #fffaf0; }
.badge-table tfoot th, .badge-table tfoot td { font-weight: 700; border-bottom: 0; }
.badge-table input[type="time"] { width: 92px; height: 32px; border-width: 0 0 2px; border-radius: 0; border-color: #14b8a6; background: #f9fafb; }
.badge-table input[type="time"] + * { margin-left: 2px; }
.badge-table td.paid input[data-field="end"] { border-color: #6366f1; }
.badge-table td.paid.from-plan input { color: var(--muted); font-style: italic; }
.badge-table input[type="number"] { height: 32px; border-width: 0 0 2px; border-radius: 0; border-color: #f59e0b; background: #f9fafb; }
.w-xxs { width: 52px; }
.emp-cell { line-height: 1.3; }
.time { display: inline-block; padding: 2px 6px; border-radius: 4px; }
.time.ok { background: #14b8a6; color: #fff; }
.time.late { background: #f59e0b; color: #fff; }
.pill.pause { display: inline-block; padding: 2px 8px; border-radius: 4px; background: #fbbf24; color: #fff; font-weight: 600; font-size: var(--fs-sm); }
.round-check { display: inline-grid; place-items: center; cursor: pointer; margin: 0; }
.round-check input { position: absolute; opacity: 0; }
.round-check span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--border-strong); color: #c4c8cf; font-size: var(--fs-md); }
.round-check input:checked + span { background: var(--ok); border-color: var(--ok); color: #fff; }
.duration { font-weight: 700; white-space: nowrap; }
@media (max-width: 900px) { .badge-layout { grid-template-columns: 1fr; } .day-list { flex-direction: row; overflow-x: auto; } }
.span-full { grid-column: 1 / -1; }
.subhead { font-weight: 700; font-size: var(--fs-md); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-top: 6px; border-top: 1px dashed var(--border); }
.legal-fields { margin-top: 8px; }
.legal-fields summary { cursor: pointer; font-size: var(--fs-md); color: var(--primary); }

/* Enregistrement unique en bas de page */
.save-bar { position: sticky; bottom: 0; z-index: 15; display: flex; align-items: center; gap: 10px; justify-content: flex-end;
  padding: 12px 16px; margin: 0 -4px; background: rgba(255, 255, 255, .96); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 -4px 16px rgba(16, 24, 40, .06); }
.save-bar [data-dirty-label] { margin-right: auto; color: var(--muted); font-size: var(--fs-md); }
.save-bar.dirty { border-color: var(--primary); }
.save-bar.dirty [data-dirty-label] { color: var(--primary); font-weight: 600; }
.new-row td { background: var(--surface-2); }
.societe-block { padding: 12px 0; border-bottom: 1px solid var(--border); }
.societe-block:last-of-type { border-bottom: 0; }

/* Tableau de bord SIRH */
.table-scroll { overflow-x: auto; }
.sirh-table { min-width: 980px; }
.sirh-table th:first-child { position: sticky; left: 0; background: var(--surface); text-align: left; font-weight: 500; white-space: nowrap; }
.sirh-table td.num, .sirh-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sirh-table .sirh-group th { background: var(--surface-2, var(--bg)); font-weight: 600; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding-top: 14px; }
.sirh-table tr.strong th, .sirh-table tr.strong td { font-weight: 600; }
.sirh-table td.annual { background: var(--primary-soft, rgba(15, 118, 110, .07)); font-weight: 600; }
/* Tableau annuel : rubriques repliables (ligne principale en en-tête), zéros estompés */
.sirh-table-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sirh-table thead th { position: sticky; top: 0; z-index: 3; background: var(--surface); font-size: var(--fs-xs); letter-spacing: .04em; }
.sirh-table thead th.annual { background: var(--primary-soft); color: var(--primary); }
.sirh-table td, .sirh-table th { border-bottom: 1px solid var(--border); padding-top: 9px; padding-bottom: 9px; }
.sirh-table td.zero { color: #c4c8cf; }
.sirh-table tr.sirh-group { cursor: pointer; }
.sirh-table tr.sirh-group th, .sirh-table tr.sirh-group td { background: var(--surface-2); font-weight: 600; font-size: var(--fs-md); color: var(--text);
  text-transform: none; letter-spacing: 0; padding-top: 11px; padding-bottom: 11px; border-top: 1px solid var(--border-strong); }
.sirh-table tr.sirh-group td.annual { background: var(--primary-soft); }
.sirh-table tr.sirh-group th small { margin-left: 8px; font-weight: 400; color: var(--muted); font-size: var(--fs-sm); }
.sirh-table tr.sirh-group:hover th, .sirh-table tr.sirh-group:hover td { background: var(--primary-soft); }
.sirh-table tr.sirh-group:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.sirh-chevron { display: inline-block; width: 16px; color: var(--muted); transition: transform .15s; transform: rotate(90deg); }
.sirh-section.collapsed .sirh-chevron { transform: none; }
.sirh-section.collapsed tr.sirh-detail { display: none; }
.sirh-section:not(.collapsed) tr.sirh-group td { color: transparent; }
.sirh-table tr.sirh-detail th { padding-left: 30px; }
.sirh-table tr.sirh-detail:hover th, .sirh-table tr.sirh-detail:hover td { background: var(--surface-2); }
select.missing { border-color: var(--warn, #d97706); }

/* Assistant */
.assistant-fab { position: fixed; right: 20px; bottom: 20px; z-index: 40; padding: 10px 16px; border-radius: 999px; border: 0;
  background: var(--primary); color: #fff; font: 600 var(--fs-base) var(--font); box-shadow: 0 6px 20px rgba(16, 24, 40, .2); cursor: pointer; }
.assistant-fab.raised { bottom: 84px; }
.assistant-panel { position: fixed; right: 20px; bottom: 72px; z-index: 41; width: min(400px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px));
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(16, 24, 40, .22); overflow: hidden; }
.assistant-panel.raised { bottom: 136px; height: min(520px, calc(100vh - 180px)); }
.assistant-panel[hidden] { display: none; }
.assistant-panel header { display: flex; align-items: center; gap: 4px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--border); }
.assistant-panel header div { margin-right: auto; }
.assistant-panel header small { display: block; color: var(--muted); font-size: var(--fs-sm); }
.assistant-log { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-base); }
.assistant-hint { color: var(--muted); font-size: var(--fs-md); }
.assistant-log .msg { max-width: 88%; padding: 8px 12px; border-radius: 12px; line-height: 1.45; }
.assistant-log .msg p { margin: 0 0 6px; } .assistant-log .msg p:last-child { margin: 0; }
.assistant-log .msg ul { margin: 0 0 6px; padding-left: 18px; }
.assistant-log .msg.user { align-self: flex-end; background: var(--primary); color: #fff; }
.assistant-log .msg.assistant { align-self: flex-start; background: var(--bg); border: 1px solid var(--border); }
.assistant-log .msg.pending { color: var(--muted); }
.assistant-log .msg.error { border-color: var(--danger); color: var(--danger); }
.assistant-panel form { display: flex; gap: 8px; padding: 10px 12px 4px; border-top: 1px solid var(--border); }
.assistant-panel textarea { flex: 1; resize: none; font: inherit; }
.assistant-note { margin: 0; padding: 0 12px 8px; font-size: var(--fs-xs); color: var(--muted); }
@media print { .assistant-fab, .assistant-panel { display: none !important; } }

/* Planning — présentation type Skello */
.planning th, .planning td { border-color: #eceef2; }
.planning td.cell { padding: 6px; height: 72px; }
.planning td.cell:hover { background: #f7f9ff; }
.planning thead th.day-head { text-transform: none; font-weight: 500; font-size: var(--fs-md); color: #6b7280; padding: 12px 6px; white-space: nowrap; }
.planning thead th.day-head .d-num { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 999px; font-size: var(--fs-base); font-weight: 600; color: #374151; }
.planning thead th.day-head.today { background: var(--surface-2); color: var(--primary); }
.planning thead th.day-head.today .d-num { background: var(--primary); color: #fff; }
.planning thead th.today { color: var(--primary); }
.planning td.cell.today { background: #f8faff; }
.planning .emp-cell { display: flex; align-items: center; gap: 10px; }
.planning .emp-cell .avatar { flex: none; width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 18%, white); color: color-mix(in srgb, var(--c) 75%, black); font: 700 var(--fs-sm) var(--font); }
.planning .emp-cell .emp-name { flex: 1; min-width: 0; color: var(--text); font-size: var(--fs-sm); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
.planning .emp-cell .emp-name strong { font-weight: 700; text-transform: uppercase; letter-spacing: .01em; }
.planning .emp-cell .emp-name:hover { color: var(--primary); text-decoration: none; }
.emp-hours { flex: none; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.emp-hours.t-Extra { color: #d97706; }
.emp-hours.t-CDD { color: #7c3aed; }
.emp-hours.t-CDI { color: var(--primary); }
.planning tr.group th { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .04em; color: #4b5563; padding: 8px 12px; }
.planning .rc { background: #fbfcfd; }
.planning td.rc strong { font-size: var(--fs-md); }
.planning .rc.delta .pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: var(--fs-xs); }
.planning .rc.delta.over .pill { background: var(--warn-soft); }
.planning .rc.delta.under .pill { background: var(--info-soft); }
.planning .rc.delta.ok .pill { background: var(--ok-soft); }
.planning tbody tr:hover > th.emp-col { background: #f7f9ff; }
.grid-wrap.scroll { box-shadow: var(--shadow); }
.shift.foreign b { display: block; font-weight: 600; }
.shift.foreign span { font-size: var(--fs-xs); }
.shift.foreign:hover { transform: none; box-shadow: none; }
.planning .rc.total { width: 130px; text-align: center; padding: 8px 8px; }
.planning thead th.rc { width: 130px; text-align: center; font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.planning .rc.total strong { font-size: var(--fs-base); font-variant-numeric: tabular-nums; }
.planning .rc.total small { display: block; font-size: var(--fs-xs); color: var(--muted); line-height: 1.3; }
.planning .rc.total .pill { display: inline-block; margin-left: 2px; padding: 1px 7px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; }
.planning .rc.total .pill.over { background: var(--warn-soft); color: var(--warn); }
.planning .rc.total .pill.under { background: var(--info-soft); color: var(--info); }
.planning .rc.total .pill.ok { background: var(--ok-soft); color: var(--ok); }
.planning .rc.total small.cpt { margin-top: 2px; font-weight: 600; }
.planning .rc.total small.cpt.over { color: var(--warn); }
.planning .rc.total small.cpt.under { color: var(--info); }
.planning tfoot .rc.total small { font-weight: 400; }
/* Indicateurs compacts au-dessus du planning */
.kpis.compact { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 8px 14px; margin-bottom: 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); }
.kpis.compact .kpi { display: flex; align-items: baseline; gap: 6px; padding: 0; border: 0; background: none; box-shadow: none; }
.kpis.compact .kpi span { display: inline; font-size: var(--fs-sm); }
.kpis.compact .kpi strong { font-size: var(--fs-base); }
.kpis.compact .kpi.warn strong { color: var(--warn); }
.planning tfoot .rc.total small { display: none; }
.planning tfoot .rc.total { padding: 5px 8px; }
.planning tfoot tr.sec-total th, .planning tfoot tr.sec-total td { padding-top: 5px; padding-bottom: 5px; line-height: 1.2; }
.planning tfoot tr.sec-total td strong { font-weight: 600; }
.planning tfoot tr.grand-total th, .planning tfoot tr.grand-total td { padding-top: 7px; padding-bottom: 7px; }
/* Bascule Employés / Postes dans le coin de la grille */
.planning thead th.corner { padding: 0 8px; vertical-align: bottom; }
.view-tabs { display: flex; gap: 4px; }
.view-tabs a { flex: 1; text-align: center; padding: 12px 4px 10px; color: var(--muted); font-size: var(--fs-md); font-weight: 500; border-bottom: 3px solid transparent; text-transform: none; }
.view-tabs a:hover { color: var(--text); text-decoration: none; }
.view-tabs a.active { color: var(--text); font-weight: 600; border-bottom-color: var(--primary); }
/* Vue Postes : nombre de personnes et heures en pied de case */
.planning td.cell.poste-cell { padding-bottom: 24px; }
.planning td.cell .cell-foot { position: absolute; left: 6px; right: 6px; bottom: 4px; display: flex; justify-content: space-between;
  font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none; }
.planning td.cell.poste-cell .add:only-child { height: 52px; }
/* Glisser-déposer : la carte entière est saisie (pas son texte), le texte des cases n'est pas sélectionnable */
.shift > *, .shift svg { pointer-events: none; }
.planning td.cell, .planning td.cell * { user-select: none; -webkit-user-select: none; }

/* Bandeau du haut — style Skello */
.topbar { gap: 20px; height: 60px; padding: 0 20px; }
.app-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: var(--fs-lg); letter-spacing: -.01em; color: var(--text); white-space: nowrap; }
.app-brand:hover { text-decoration: none; }
.app-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--primary); color: #fff; }
.app-mark svg { width: 18px; height: 18px; }
.etab-pill { position: relative; display: flex; align-items: center; gap: 8px; margin: 0; height: 40px; padding: 0 10px 0 6px;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); min-width: 200px; max-width: 280px; }
.etab-pill:hover { border-color: var(--primary); }
.etab-icon { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 16%, white); color: color-mix(in srgb, var(--c) 80%, black); }
.etab-icon svg { width: 16px; height: 16px; }
.etab-pill select { flex: 1; min-width: 0; appearance: none; -webkit-appearance: none; border: 0; background: transparent; padding: 0 22px 0 0;
  font: 700 var(--fs-base) var(--font); text-transform: uppercase; color: var(--text); cursor: pointer; box-shadow: none; height: 38px; }
.etab-pill select:focus { outline: none; }
.etab-pill:focus-within { box-shadow: 0 0 0 3px var(--primary-soft); border-color: var(--primary); }
.etab-pill .chevrons { position: absolute; right: 12px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.etab-pill .etab-name { font-weight: 700; font-size: var(--fs-base); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 6px; }
.mainnav { gap: 4px; }
.mainnav a { padding: 8px 12px; border-radius: 8px; color: var(--text); font-weight: 500; font-size: var(--fs-base); }
.mainnav a:hover { background: var(--surface-2); color: var(--primary); }
.mainnav a.active { background: none; color: var(--primary); font-weight: 600; box-shadow: inset 0 -2px 0 var(--primary); border-radius: 0; }
.top-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; color: #374151; cursor: pointer; list-style: none; }
.icon-btn:hover, .top-menu[open] > .icon-btn { background: var(--surface-2); color: var(--primary); text-decoration: none; }
.icon-btn.active { color: var(--primary); }
.icon-btn svg { width: 21px; height: 21px; }
.avatar-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; margin-left: 4px; border-radius: 999px; background: var(--primary-soft);
  color: var(--primary); font: 700 var(--fs-base) var(--font); cursor: pointer; list-style: none; }
.avatar-btn:hover, .top-menu[open] > .avatar-btn { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, white); }
.top-menu > summary::-webkit-details-marker { display: none; }
.top-menu .menu-list { right: 0; left: auto; top: 46px; }
.menu-title { margin: 4px 10px 6px; font-weight: 700; font-size: var(--fs-md); }
.menu-title small { display: block; font-weight: 400; color: var(--muted); }
.menu-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 6px; background: none; font: inherit; color: var(--danger); cursor: pointer; }
.menu-item:hover { background: var(--danger-soft); }
.top-menu form { margin: 0; }
@media (max-width: 1200px) {
  .topbar { gap: 12px; }
  .app-brand span:last-child { display: none; }
  .etab-pill { min-width: 150px; max-width: 200px; }
  .mainnav a { padding: 8px 8px; }
}

/* Espace Réglages : menu latéral + page */
.settings-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; align-items: start; }
.settings-nav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 16px; }
.settings-block { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.settings-block-title { margin: 2px 10px 6px; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.settings-block a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: var(--text); font-size: var(--fs-base); }
.settings-block a:hover { background: var(--surface); text-decoration: none; }
.settings-block a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.settings-block svg { width: 20px; height: 20px; flex: none; }
.settings-main { min-width: 0; max-width: 980px; }
.settings-head h1 { margin: 0 0 6px; font-size: var(--fs-title); }
.settings-head p { margin: 0 0 20px; font-size: var(--fs-base); line-height: 1.55; }
.settings-h2 { font-size: var(--fs-xl); margin: 28px 0 14px; }
.settings-main .card h3 { margin: 0 0 14px; font-size: var(--fs-lg); }
.info-box { display: flex; gap: 14px; padding: 16px 20px; margin-bottom: 22px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.settings-h2 + .info-box { background: var(--primary-soft); border-color: transparent; }
.info-box p { margin: 4px 0; color: #4b5563; }
.info-box ul { margin: 4px 0 8px; padding-left: 20px; color: #4b5563; }
.info-dot { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; background: var(--primary); color: #fff; font: italic 700 var(--fs-md) var(--font); }
.info-dot svg { width: 16px; height: 16px; }
.kiosk-strip { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.kiosk-strip .info-dot { background: var(--primary-soft); color: var(--primary); width: 40px; height: 40px; }
.kiosk-link { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); }
.kiosk-link svg { width: 20px; height: 20px; }
.field-block { display: block; max-width: 420px; margin-bottom: 4px; }
.field-block > span { display: block; font-size: var(--fs-md); margin-bottom: 6px; }
.field-block select { width: 100%; height: 44px; }
.field-block.inline-number { max-width: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.field-block.inline-number > span { display: inline; margin: 0; }
.example { margin: 6px 0 20px; color: var(--muted); font-size: var(--fs-base); }
.example b { color: var(--text); }
.custom > span:first-child, .alert-row.custom .alert-title { color: var(--primary); }
/* Interrupteurs */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #d1d5db; transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--primary-soft); }
.switch-row { display: flex; align-items: center; gap: 14px; font-size: var(--fs-base); cursor: pointer; }
/* Postes */
.postes-list { border-top: 1px solid var(--border); margin-bottom: 20px; }
.postes-row { display: grid; grid-template-columns: 70px minmax(180px, 1.4fr) minmax(140px, 1fr) 150px 70px 44px; gap: 14px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border); }
.postes-headrow { padding: 10px 0; font-size: var(--fs-sm); color: var(--muted); }
.color-dot input[type=color] { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 999px; background: none; cursor: pointer; }
.color-dot input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-dot input[type=color]::-webkit-color-swatch { border: 0; border-radius: 999px; }
.float-field { display: flex; flex-direction: column; background: #f3f4f6; border-radius: 6px; padding: 6px 10px 4px; margin: 0; }
.float-field small { font-size: var(--fs-xs); color: var(--muted); }
.float-field input, .float-field select { border: 0; background: transparent; padding: 0; height: 22px; font-size: var(--fs-base); box-shadow: none; }
.float-field:focus-within { box-shadow: 0 0 0 2px var(--primary); }
.minutes-field { display: flex; align-items: center; gap: 8px; background: #f3f4f6; border-radius: 6px; padding: 0 12px; height: 44px; margin: 0; }
.minutes-field input { width: 52px; border: 0; background: transparent; padding: 0; font-size: var(--fs-base); box-shadow: none; }
.minutes-field:focus-within { box-shadow: 0 0 0 2px var(--primary); }
.trash-btn { border: 0; background: none; cursor: pointer; color: #374151; padding: 6px; border-radius: 8px; }
.trash-btn:hover { background: var(--danger-soft); color: var(--danger); }
.trash-btn svg { width: 20px; height: 20px; display: block; }
.postes-row.new-row { background: transparent; }
/* Alertes */
.alerts-card h2 { font-size: var(--fs-xl); margin: 4px 0 12px; }
.alert-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) 90px; gap: 18px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); }
.alert-row:last-child { border-bottom: 0; }
.alert-head { padding: 8px 0; color: var(--muted); font-size: var(--fs-md); }
.alert-head span:last-child, .alert-block { text-align: right; }
.alert-block input { width: 22px; height: 22px; cursor: pointer; }
.alert-title { display: flex; align-items: center; gap: 8px; font-size: var(--fs-base); }
.alert-row p { margin: 4px 0 0; color: var(--muted); line-height: 1.5; }
.alert-ico svg { width: 18px; height: 18px; display: block; }
.ico-clock { color: #dc2626; } .ico-sun { color: #16a34a; } .ico-doc { color: #6b7280; } .ico-calendar { color: #dc2626; }
.ico-pause { color: #2563eb; } .ico-scissors { color: #db2777; } .ico-moon { color: #d97706; } .ico-flag { color: #7c3aed; } .ico-alert { color: #dc2626; }
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; }
  .postes-row { grid-template-columns: 50px 1fr 1fr; }
}
.toast.warning { background: #b45309; }
.kiosk-regen { margin: 0 0 8px; }
.welcome-box { padding: 14px 16px; margin-bottom: 14px; border-radius: var(--radius); background: var(--ok-soft); border: 1px solid #b7e1c2; display: grid; gap: 6px; }
.welcome-box p { margin: 0; }
.welcome-box code { overflow-wrap: anywhere; }
.pin-show { font: 700 var(--fs-xl) ui-monospace, Menlo, monospace; letter-spacing: .25em; }
.kiosk-steps { margin: 0 0 8px; padding-left: 20px; line-height: 1.9; }
.kiosk-code { font: 700 var(--fs-xl) ui-monospace, Menlo, monospace; letter-spacing: .2em; background: var(--primary-soft); color: var(--primary); padding: 2px 10px; border-radius: 8px; }
.photo-link { margin-left: 4px; text-decoration: none; }
.field-block.inline-number { flex-direction: row; justify-content: flex-start; text-align: left; }
.field-block.inline-number input { margin: 0; }
.kiosk-link { white-space: nowrap; }
.switch-row { flex-direction: row; }
.minutes-field { flex-direction: row; }
.postes-row { grid-template-columns: 46px minmax(140px, 1.5fr) minmax(110px, 1fr) 130px 56px 40px; gap: 12px; }

/* Barre d'outils du planning — compacte, type Skello */
.pl-toolbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: -4px 0 12px;
  padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.pl-nav { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pl-arrow { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--text); font-size: var(--fs-title); line-height: 1; }
.pl-arrow:hover { background: var(--surface-2); text-decoration: none; }
.pl-date { position: relative; display: inline-flex; flex-direction: row; align-items: center; gap: 10px; height: 38px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: 8px; font-size: var(--fs-base); font-weight: 500; cursor: pointer; white-space: nowrap; }
.pl-date svg { width: 16px; height: 16px; color: var(--muted); }
.pl-date input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.pl-date input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.pl-chip { padding: 5px 10px; border-radius: 6px; background: #e5e7eb; color: #4b5563; font-size: var(--fs-md); font-weight: 500; white-space: nowrap; }
.pl-today { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: var(--fs-md); white-space: nowrap; }
.pl-today:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.pl-tabs { display: flex; gap: 22px; }
.pl-tabs a { padding: 8px 4px; color: var(--muted); font-size: var(--fs-base); border-bottom: 3px solid transparent; }
.pl-tabs a:hover { color: var(--text); text-decoration: none; }
.pl-tabs a.active { color: var(--text); font-weight: 600; border-bottom-color: var(--primary); }
.pl-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.pl-actions select { height: 36px; margin-right: 6px; }
.pl-actions form { margin: 0 6px 0 0; }
.pl-icon { display: inline-flex; align-items: center; gap: 6px; height: 36px; min-width: 36px; padding: 0 8px; justify-content: center;
  border: 0; border-radius: 8px; background: none; color: #374151; cursor: pointer; font: 500 var(--fs-md) var(--font); list-style: none; }
.pl-icon:hover, .pl-menu[open] > .pl-icon { background: var(--surface-2); color: var(--primary); }
.pl-icon svg { width: 20px; height: 20px; }
.pl-icon.primary { background: var(--primary); color: #fff; padding: 0 12px; }
.pl-icon.primary:hover { background: var(--primary-hover); color: #fff; }
.pl-menu > summary::-webkit-details-marker { display: none; }
.pl-menu .menu-list { right: 0; left: auto; top: 42px; }
.menu-item.plain { color: var(--text); }
.menu-item.plain:hover { background: var(--surface-2); }
@media (max-width: 1100px) {
  .pl-toolbar { grid-template-columns: 1fr; }
  .pl-tabs { justify-content: center; }
  .pl-actions { justify-content: flex-start; flex-wrap: wrap; }
}
@media print { .pl-toolbar { display: none !important; } }
/* Choix de couleur par palette */
.swatch-picker { position: relative; display: inline-block; }
.swatch-picker > summary { display: inline-flex; align-items: center; gap: 4px; list-style: none; cursor: pointer; padding: 3px 4px; border-radius: 999px; }
.swatch-picker > summary::-webkit-details-marker { display: none; }
.swatch-picker > summary:hover { background: var(--surface-2); }
.swatch-picker > summary svg { width: 16px; height: 16px; color: #374151; }
.swatch-dot { display: inline-block; width: 26px; height: 26px; border-radius: 999px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.swatch-menu { position: absolute; z-index: 40; top: 38px; left: 0; display: grid; grid-template-columns: repeat(4, 32px); gap: 8px; padding: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.14); }
.swatch-menu label { display: block; margin: 0; cursor: pointer; }
.swatch-menu input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.swatch-menu label > span { display: block; width: 32px; height: 32px; border-radius: 999px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.swatch-menu input[type=radio]:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.swatch-menu label:hover > span { transform: scale(1.08); }
.swatch-other { grid-column: 1 / -1; display: flex !important; align-items: center; gap: 8px; font-size: var(--fs-md); color: var(--muted); position: relative; }
.swatch-other > span { width: 24px !important; height: 24px !important; background: conic-gradient(#fca5a5, #fde047, #86efac, #93c5fd, #c4b5fd, #fca5a5) !important; }
.swatch-other input[type=color] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
/* Cartes de shift aux couleurs pleines, type Skello */
.shift { background: color-mix(in srgb, var(--c) 78%, white); border-left: 3px solid color-mix(in srgb, var(--c) 70%, #111827); color: #1f2937; }
.shift:hover { background: color-mix(in srgb, var(--c) 92%, white); }
.shift .s-top small, .shift .s-bot > span:first-child { opacity: .85; }
.shift.dark { background: color-mix(in srgb, var(--c) 28%, white); border-left-color: var(--c); }
.shift.dark:hover { background: color-mix(in srgb, var(--c) 38%, white); }
.alert-corner { position: absolute; top: 0; right: 0; width: 0; height: 0; border-style: solid; border-width: 0 12px 12px 0;
  border-color: transparent #ef4444 transparent transparent; z-index: 1; }
.planning tfoot .foot-cell { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 0 4px; }
.planning tfoot .foot-cell small { color: var(--muted); font-weight: 400; font-size: var(--fs-xs); }
.planning tfoot tr.pilot-row th, .planning tfoot tr.pilot-row td { background: var(--surface); font-size: var(--fs-sm); padding-top: 4px; padding-bottom: 4px; text-align: center; }
.planning tfoot tr.pilot-row th { text-align: left; font-weight: 600; }
.planning tfoot tr.pilot-row th a { color: inherit; }
.planning tfoot .pilot-toggle { border: 0; background: none; padding: 0 4px 0 0; margin: 0; width: 16px; height: auto; color: var(--muted); font-size: var(--fs-xs); cursor: pointer; }
.planning tfoot tr.pilot-sub th { font-weight: 400; padding-left: 30px; color: var(--muted); }
.planning tfoot tr.pilot-sub td { color: var(--muted); }
.planning tfoot tr.pilot-row td.from-theo { font-style: italic; }
.planning tfoot tr.pilot-row.first th, .planning tfoot tr.pilot-row.first td { border-top: 1px solid var(--border-strong); }
.planning tfoot tr.grand-total th, .planning tfoot tr.grand-total td { background: #fff; border-top: 1px solid var(--border-strong); }
@media print { .alert-corner { display: none !important; } }
.planning .week-info { font-size: var(--fs-xs); color: var(--muted); line-height: 1.2; margin-top: 2px; }
.swatch-other { flex-direction: row; justify-content: flex-start; }

/* ===== Mode nuit (Night & Day) : bouton lune / soleil dans le bandeau ===== */
:root[data-theme="dark"] {
  --bg: #0e131b; --surface: #161c26; --surface-2: #1d2430; --border: #283141; --border-strong: #384356;
  --text: #e6e9ef; --muted: #98a2b3; --primary: #6b96ff; --primary-hover: #86a9ff; --primary-soft: #1c2948;
  --danger: #f87171; --danger-soft: #3b1d21; --warn: #fbbf24; --warn-soft: #3a2f13; --ok: #4ade80; --ok-soft: #143222;
  --info: #60a5fa; --info-soft: #132741; --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}
:root[data-theme="dark"] .badge, :root[data-theme="dark"] .badge.imp-repos, :root[data-theme="dark"] .pl-chip { background: #273042; color: #cbd5e1; }
:root[data-theme="dark"] .badge.t-Extra, :root[data-theme="dark"] .incomplete-banner { background: #2e2145; color: #d8b4fe; }
:root[data-theme="dark"] tr.current td, :root[data-theme="dark"] .planning td.cell.today,
:root[data-theme="dark"] .planning td.cell:hover, :root[data-theme="dark"] .planning tbody tr:hover > th.emp-col { background: #1a2333; }
:root[data-theme="dark"] .planning td.cell.alert { background: #2a1a1c; box-shadow: inset 0 0 0 1px #5b2a2a; }
:root[data-theme="dark"] .planning th.weekend, :root[data-theme="dark"] .planning td.weekend,
:root[data-theme="dark"] .planning td.cell.weekend, :root[data-theme="dark"] .planning .rc { background: #141a23; }
:root[data-theme="dark"] .planning th, :root[data-theme="dark"] .planning td { border-color: #242c3a; }
:root[data-theme="dark"] .planning tfoot tr.sec-total th, :root[data-theme="dark"] .planning tfoot tr.sec-total td { background: #1a212c; }
:root[data-theme="dark"] .planning tfoot tr.grand-total th, :root[data-theme="dark"] .planning tfoot tr.grand-total td { background: var(--surface); }
:root[data-theme="dark"] .planning tr.group th, :root[data-theme="dark"] .info-box p, :root[data-theme="dark"] .info-box ul { color: #b6c0ce; }
:root[data-theme="dark"] .planning thead th.day-head .d-num { color: var(--text); }
:root[data-theme="dark"] .absence { background: color-mix(in srgb, var(--c) 18%, #222a37); color: #c3cad6; }
:root[data-theme="dark"] .absence .s-top b { color: #e2e6ec; }
:root[data-theme="dark"] .shift.dark { background: color-mix(in srgb, var(--c) 40%, #161c26); color: #e6e9ef; }
:root[data-theme="dark"] .shift.dark .s-top b { color: #fff; }
:root[data-theme="dark"] .shift.foreign { background: repeating-linear-gradient(135deg, #1f2733 0 6px, #19202a 6px 12px); }
:root[data-theme="dark"] .float-field, :root[data-theme="dark"] .minutes-field,
:root[data-theme="dark"] .badge-table input[type="time"], :root[data-theme="dark"] .badge-table input[type="number"] { background: #222a37; }
:root[data-theme="dark"] .icon-btn, :root[data-theme="dark"] .pl-icon, :root[data-theme="dark"] .trash-btn,
:root[data-theme="dark"] .swatch-picker > summary svg { color: #c9d1dc; }
:root[data-theme="dark"] .btn.ghost:hover { background: rgba(255, 255, 255, .06); }
:root[data-theme="dark"] .import-table tr.row-error td { background: #2a1a1c; }
:root[data-theme="dark"] .badge-table tr.validated td { background: #13241a; }
:root[data-theme="dark"] .badge-table tr.loose td { background: #2a2414; }
:root[data-theme="dark"] .toast { background: #e6e9ef; color: #0e131b; }
:root[data-theme="dark"] .modal { background: var(--surface); color: var(--text); }
:root[data-theme="dark"] .modal::backdrop { background: rgba(0, 0, 0, .6); }
:root[data-theme="dark"] .switch i { background: #475163; }
:root[data-theme="dark"] .alert-ico.ico-doc { color: #98a2b3; }
:root[data-theme="dark"] .pinpad, :root[data-theme="dark"] .result-card { background: var(--surface-2); }
:root[data-theme="dark"] .result-card p { color: #c3cad6; }
:root[data-theme="dark"] .keys button { background: var(--surface); }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
@media print { :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --text: #000; } }

/* Pilotage : CA, heures, productivité, staff cost */
.pilot-card { padding: 12px; }
.pilot-table { min-width: 1250px; font-variant-numeric: tabular-nums; }
.pilot-table th, .pilot-table td { padding: 7px 8px; }
.pilot-table .num { text-align: right; white-space: nowrap; }
.pilot-table thead .pilot-groups th { text-align: center; border-left: 2px solid var(--border); }
.pilot-table thead tr:last-child th:nth-child(1), .pilot-table thead tr:last-child th:nth-child(4),
.pilot-table thead tr:last-child th:nth-child(7), .pilot-table thead tr:last-child th:nth-child(10),
.pilot-table tbody td:nth-child(2), .pilot-table tbody td:nth-child(5), .pilot-table tbody td:nth-child(8), .pilot-table tbody td:nth-child(11),
.pilot-table tfoot td:nth-child(2), .pilot-table tfoot td:nth-child(5), .pilot-table tfoot td:nth-child(8), .pilot-table tfoot td:nth-child(11) { border-left: 2px solid var(--border); }
.pilot-table td.strong { font-weight: 600; }
.pilot-table tr.today th:first-child { color: var(--primary); }
.pilot-table tr.weekend td, .pilot-table tr.weekend th { background: var(--surface-2); }
.ca-input { width: 100px; height: 32px; text-align: right; background: var(--primary-soft); border-color: transparent; font-weight: 600; }
.ca-input:focus { background: var(--surface); }
.ca-input[data-caisse] { font-style: italic; font-weight: 500; }
.ca-input.theo { background: var(--surface-2); font-weight: 500; color: var(--muted); }
.ca-input.theo:focus { color: var(--text); }
.pilot-table td.from-theo { font-style: italic; color: var(--muted); }
.caisse-table td, .caisse-table th { vertical-align: middle; }
.caisse-table td:nth-child(2) input { width: 90px; }
.caisse-table td:nth-child(4) input { width: 150px; }
.caisse-table .caisse-msg { display: block; margin-top: 4px; max-width: 260px; line-height: 1.35; }
.caisse-actions { white-space: nowrap; }
.caisse-actions label { display: inline-flex; margin-left: 10px; font-weight: 400; }
.ca-input:placeholder-shown { background: var(--surface-2); }
.pilot-table small.ratio { display: block; font-size: var(--fs-xs); color: var(--muted); }
.kpi strong small { font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }
:root[data-theme="dark"] .save-bar { background: rgba(22, 28, 38, .96); }
:root[data-theme="dark"] .pilot-table .ca-input { color: var(--text); }
:root[data-theme="dark"] .planning td.cell.drop::before, :root[data-theme="dark"] .planning td.cell.drop::after { background: rgba(22, 28, 38, .85); }
.mapping-card > summary { cursor: pointer; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.mapping-card[open] > summary { margin-bottom: 12px; }
.mapping-table select { min-width: 260px; }
.mapping-table td { vertical-align: middle; }
/* Repos et congés déplaçables / copiables comme les shifts */
.absence[draggable] { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-user-drag: element; }
.absence > *, .absence svg { pointer-events: none; }
.absence.dragging { opacity: .4; }

/* Note mise en forme et checklist des shifts */
.note-field { margin-bottom: 12px; }
.note-field .field-label { display: block; font-size: var(--fs-md); font-weight: 500; margin-bottom: 5px; }
.rte-toolbar { display: flex; gap: 2px; padding: 4px; border: 1px solid var(--border-strong); border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--surface-2); }
.rte-toolbar button { min-width: 30px; height: 28px; padding: 0 6px; border: 0; border-radius: 6px; background: none; color: var(--text); font: 600 var(--fs-md) var(--font); cursor: pointer; }
.rte-toolbar button:hover { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.rte-toolbar mark, .rte mark, .shift em mark { background: #fde047; color: inherit; padding: 0 2px; border-radius: 2px; }
.rte { min-height: 64px; max-height: 180px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 0 0 8px 8px;
  background: var(--surface); font-size: var(--fs-base); line-height: 1.45; outline: none; }
.rte:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.rte:empty::before { content: attr(data-placeholder); color: var(--muted); }
.rte ul, .rte ol { margin: 2px 0; padding-left: 20px; }
.checklist-box { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; }
.check-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.check-row input[type=checkbox] { width: 18px; height: 18px; flex: none; accent-color: var(--primary); }
.check-row input[data-c=text] { flex: 1; height: 32px; }
.check-row input[type=checkbox]:checked + input { text-decoration: line-through; color: var(--muted); }
.shift .s-check { display: inline-flex; align-items: center; gap: 3px; margin-top: 2px; font-size: var(--fs-2xs); font-weight: 700; opacity: .85; }
.shift .s-check svg { width: 12px; height: 12px; }
.shift .s-check.done { color: #15803d; }
:root[data-theme="dark"] .rte-toolbar mark, :root[data-theme="dark"] .rte mark { background: #a16207; color: #fff; }

/* Badgeuse : noms alignés, heures prévues cliquables */
.badge-table td.badge-emp { line-height: 1.25; min-width: 150px; }
.badge-emp .be-first { display: block; font-weight: 700; }
.badge-emp .be-last { display: block; font-size: var(--fs-sm); color: var(--muted); letter-spacing: .02em; }
.plan-time { border: 1px solid transparent; background: none; padding: 2px 4px; border-radius: 6px; font: inherit; color: inherit; cursor: pointer; }
.plan-time:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.plan-time.time.late { background: #f59e0b; color: #fff; }
.plan-pause { border: 0; cursor: pointer; font: inherit; }
.plan-pause:hover { filter: brightness(.95); box-shadow: 0 0 0 2px var(--primary-soft); }
.use-plan { margin-left: 4px; color: var(--primary); }
.badge-table tr.flash-row td { background: var(--primary-soft); transition: background .3s; }
.info-banner #fill-plan { margin-top: 8px; }
/* Badgeuse : colonnes de chiffres centrées (pauses, absence, repas, durée) */
.badge-table th.c, .badge-table td.c { text-align: center; }
.badge-table td.c input[type=number] { text-align: center; margin: 0 auto; display: block; }
.badge-table td.c input[type=checkbox] { margin: 0 auto; display: block; }
.badge-table td.c .round-check { margin: 0 auto; }
.table th.c, .table td.c { text-align: center; }
.badge-table td.c, .badge-table .pill.pause { white-space: nowrap; }
.badge-table td.c input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.badge-table td.c input[type=number]::-webkit-outer-spin-button, .badge-table td.c input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.day-list .day-full { font-size: var(--fs-md); } .day-list .day-full strong { font-weight: 600; }
.badge-layout { grid-template-columns: 250px minmax(0, 1fr); } .day-list .day-full { white-space: nowrap; }
/* Badgeuse : pastilles de pause et heures prévues de même hauteur, texte centré */
.badge-table .pill.pause { display: inline-flex; align-items: center; justify-content: center; min-width: 58px; height: 26px;
  padding: 0 8px; line-height: 1; vertical-align: middle; font-variant-numeric: tabular-nums; }
.badge-table .plan-time { display: inline-flex; align-items: center; justify-content: center; height: 26px; min-width: 50px;
  padding: 0 6px; line-height: 1; vertical-align: middle; font-variant-numeric: tabular-nums; }
.badge-table td.grp.nowrap { vertical-align: middle; }
.badge-table thead th { white-space: nowrap; }

/* ===== Planning épuré (densité type Skello) ===== */
.grid-wrap.scroll { max-height: calc(100vh - 150px); }
.planning { font-size: var(--fs-sm); }
.planning td.cell { padding: 4px 5px; height: 54px; }
.planning thead th.day-head { padding: 8px 4px; font-size: var(--fs-sm); }
.planning thead th.day-head .d-num { min-width: 24px; height: 24px; font-size: var(--fs-base); }
.planning .emp-col { width: 190px; padding: 6px 10px; }
.planning .emp-cell { gap: 8px; }
.planning .emp-cell .avatar { width: 30px; height: 30px; font-size: var(--fs-xs); }
.planning .emp-cell .emp-name { font-size: var(--fs-sm); line-height: 1.2; }
.emp-hours { font-size: var(--fs-xs); }
.emp-alert { flex: none; display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: #ef4444; color: #fff; font: 700 var(--fs-2xs) var(--font); cursor: help; }
.emp-alert.info { background: #cbd5e1; color: #334155; }
.shift, .absence { margin-bottom: 3px; padding: 4px 6px 4px 8px; border-radius: 5px; line-height: 1.25; }
.shift { border-left-width: 3px; }
.shift .s-top b { font-size: var(--fs-sm); font-weight: 700; }
.shift .s-top small, .absence .s-top small { font-size: var(--fs-2xs); font-weight: 500; }
.shift .s-bot > span:first-child, .absence .s-bot > span:first-child { font-size: var(--fs-2xs); }
.shift .s-icons { gap: 4px; }
.shift .s-icons i { font-size: var(--fs-2xs); }
.shift .s-icons svg { width: 11px; height: 11px; }
.shift em { font-size: var(--fs-2xs); margin-top: 1px; }
.shift .s-check { font-size: var(--fs-2xs); }
.absence .s-top b { font-size: var(--fs-sm); }
.shift:hover, .absence:hover { box-shadow: 0 1px 4px rgba(16, 24, 40, .15); }
.planning tr.group th { padding: 5px 10px; font-size: var(--fs-xs); }
.planning .rc.total { width: 110px; padding: 5px 6px; }
.planning thead th.rc { width: 110px; }
.planning .rc.total strong { font-size: var(--fs-md); }
.planning .rc.total small { font-size: var(--fs-2xs); }
.planning tfoot tr.sec-total th, .planning tfoot tr.sec-total td { padding-top: 3px; padding-bottom: 3px; font-size: var(--fs-xs); }
.planning tfoot tr.grand-total th, .planning tfoot tr.grand-total td { padding-top: 5px; padding-bottom: 5px; }
.planning td.cell .add:only-child { height: 44px; }
.pl-toolbar { margin-bottom: 8px; padding: 6px 10px; }
.pl-help { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; color: var(--muted); cursor: help; }
.pl-help svg { width: 18px; height: 18px; }
.pl-help:hover, .pl-help:focus { color: var(--primary); background: var(--surface-2); outline: none; }
.pl-icon.on { color: var(--primary); background: var(--primary-soft); }
.kpis.compact { margin-bottom: 8px; padding: 6px 12px; }
body.wide .container { padding: 12px 16px 16px; }

/* Planning : polices réduites d'un cran (≈ -1 px) */
.planning { font-size: var(--fs-xs); }
.planning td.cell { height: 50px; }
.planning thead th.day-head { font-size: var(--fs-xs); }
.planning thead th.day-head .d-num { min-width: 22px; height: 22px; font-size: var(--fs-md); }
.planning thead th.rc, .planning thead th.corner .view-tabs a { font-size: var(--fs-sm); }
.planning .emp-cell .emp-name { font-size: var(--fs-xs); }
.planning .emp-cell .avatar { width: 28px; height: 28px; font-size: var(--fs-2xs); }
.emp-hours { font-size: var(--fs-2xs); }
.shift .s-top b, .absence .s-top b { font-size: var(--fs-xs); }
.shift .s-top small, .absence .s-top small { font-size: var(--fs-2xs); }
.shift .s-bot > span:first-child, .absence .s-bot > span:first-child { font-size: var(--fs-2xs); }
.shift .s-icons i, .shift em, .shift .s-check { font-size: var(--fs-2xs); }
.shift .s-icons svg, .shift .s-check svg { width: 10px; height: 10px; }
.planning tr.group th { font-size: var(--fs-2xs); }
.planning .rc.total strong { font-size: var(--fs-sm); }
.planning .rc.total small, .planning .rc.total .pill { font-size: var(--fs-2xs); }
.planning tfoot td, .planning tfoot th { font-size: var(--fs-xs); }
.planning tfoot tr.sec-total th, .planning tfoot tr.sec-total td { font-size: var(--fs-2xs); }
.planning tfoot .foot-cell small, .planning .cost { font-size: var(--fs-2xs); }
.planning td.cell .cell-foot { font-size: var(--fs-2xs); }
/* Journal des modifications */
.journal-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 14px; align-items: end; }
.journal-filters .form-actions { grid-column: 1 / -1; display: flex; gap: 8px; margin: 0; }
.journal-table td { vertical-align: top; }
.journal-table .badge { margin-right: 4px; }
.jcat-planning { background: var(--primary-soft); color: var(--primary); }
.jcat-badgeuse { background: #ccfbf1; color: #0f766e; }
.jcat-employés, .jcat-documents { background: #f3e8ff; color: #7e22ce; }
.jcat-réglages, .jcat-accès, .jcat-organisation { background: #fef3c7; color: #92400e; }
.jcat-connexion { background: #e5e7eb; color: #4b5563; }
.pager { display: flex; align-items: center; gap: 12px; justify-content: center; margin: 12px 0; }

/* Demandes de congés */
.nav-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 3px; border-radius: 999px;
  background: #ef4444; color: #fff; font: 700 var(--fs-2xs) var(--font); vertical-align: 1px; }
.leave-card { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; padding: 14px 16px; }
.leave-name { font-weight: 700; font-size: var(--fs-base); color: var(--text); }
.leave-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.portal-box { margin-top: 24px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.portal-box h3 { margin: 0 0 12px; font-size: var(--fs-lg); }
.portal-status { display: flex; gap: 8px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.portal-link input { flex: 1; font-family: ui-monospace, monospace; font-size: var(--fs-sm); }
/* Espace salarié (téléphone d'abord) */
body.portal .container { max-width: 640px; padding: 12px 14px 40px; }
.portal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.portal-head .logo { margin-right: 6px; }
.portal-head form { margin: 0; }
.portal-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.portal-kpis .small-strong { font-size: var(--fs-base); }
.portal-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.portal-form label { margin-bottom: 10px; }
.portal-request { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.portal-request:last-child { border-bottom: 0; }
.portal-request-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.portal-request-side form { margin: 0; }
.portal-days { list-style: none; margin: 0; padding: 0; }
.portal-days li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-base); }
.portal-days li.today .pd-day { color: var(--primary); font-weight: 700; }
.portal-days li.off { color: var(--muted); }
.portal-days li.past { opacity: .6; }
.portal-days .pd-day { flex: 0 0 96px; }
.portal-days .pd-what { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.portal-days .pd-shift { display: block; padding: 6px 10px; border-radius: 8px; background: var(--primary-soft); color: var(--text); }
.portal-days .pd-shift small { display: block; color: var(--muted); font-size: var(--fs-sm); }
.portal-tabs { display: flex; gap: 4px; padding: 3px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; position: sticky; top: 0; z-index: 5; }
.portal-tabs a { flex: 1; text-align: center; padding: 10px 6px; border-radius: 9px; color: var(--muted); font-weight: 600; text-decoration: none; }
.portal-tabs a.active { background: var(--primary); color: #fff; }
.portal-week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; text-align: center; }
.portal-week-nav h2 { margin: 0; }
.portal-week-nav .btn { width: 40px; height: 40px; font-size: var(--fs-xl); }
.portal-back { text-align: center; margin: 12px 0 0; }
.portal-fiche { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 8px 12px; margin: 0 0 12px; }
.portal-fiche dt { color: var(--muted); font-size: var(--fs-md); }
.portal-fiche dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 420px) { .portal-fiche { grid-template-columns: 1fr; gap: 2px; } .portal-fiche dd { margin-bottom: 8px; } }
.pd-day { flex: none; width: 82px; font-weight: 600; }
.pd-what { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-shift { padding: 2px 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-weight: 600; font-variant-numeric: tabular-nums; }
.pd-shift small { font-weight: 400; color: var(--muted); }
/* Demande en attente sur le planning */
.request-chip { margin-bottom: 3px; padding: 3px 6px; border: 1.5px dashed var(--c, #16a34a); border-radius: 5px; font-size: var(--fs-2xs); color: var(--muted); cursor: pointer; }
.request-chip b { color: var(--text); }
.request-chip { display: block; text-decoration: none; } .request-chip:hover { text-decoration: none; background: var(--surface-2); }
/* Infobulle des alertes (coin rouge d'une case, pastille d'un salarié) */
.alert-corner { border-width: 0 14px 14px 0; cursor: help; }
.alert-corner::after { content: ""; position: absolute; top: -2px; right: -16px; width: 20px; height: 20px; }  /* zone de survol plus large */
.alert-tip { position: fixed; z-index: 60; max-width: 300px; padding: 7px 10px; border-radius: 8px; background: #b91c1c; color: #fff;
  font: 500 var(--fs-sm)/1.4 var(--font); box-shadow: 0 6px 18px rgba(0, 0, 0, .2); pointer-events: none; }
.alert-tip div + div { margin-top: 3px; padding-top: 3px; border-top: 1px solid rgba(255, 255, 255, .25); }
.alert-tip.info { background: #334155; }

/* SIRH — graphiques (palette de référence : 3 premières teintes catégorielles, clair / sombre) */
/* Teintes douces et homogènes (même clarté, saturation modérée) ; les valeurs sont écrites en clair sur les données */
.viz-root { --series-1: #7ba7d9; --series-2: #eea47f; --series-3: #85c4a3; --series-4: #e8c46e; --series-5: #b39ddb; --series-6: #e899b3;
  --viz-other: #c9c7c0; --viz-grid: #e1e0d9; --viz-base: #d6d4cc; --viz-muted: #898781; }
:root[data-theme="dark"] .viz-root { --series-1: #8fb5e3; --series-2: #f0ae8e; --series-3: #93cdb0; --series-4: #e9c97e; --series-5: #bfaae3; --series-6: #eba7bf;
  --viz-other: #6b6a65; --viz-grid: #2c2c2a; --viz-base: #3a3a37; }
.viz-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 12px; }
.viz-bar label { flex-direction: row; align-items: center; gap: 8px; }
.viz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.viz-card { padding: 14px 16px 10px; margin: 0; min-width: 0; }
.viz-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.viz-head h3 { margin: 0; font-size: var(--fs-base); }
.viz-seg button { padding: 4px 10px; font-size: var(--fs-sm); }
.viz-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; min-height: 18px; font-size: var(--fs-sm); color: var(--muted); }
.viz-legend i, .tip-row i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.viz-plot { width: 100%; min-height: 60px; }
.viz-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz-plot .grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-plot .base { stroke: var(--viz-base); stroke-width: 1; }
.viz-plot .cross { stroke: var(--viz-base); stroke-width: 1; stroke-dasharray: 3 3; }
.viz-plot .tick { fill: var(--viz-muted); font: var(--fs-2xs) var(--font); font-variant-numeric: tabular-nums; }
.viz-plot .lbl { fill: var(--muted); font: var(--fs-sm) var(--font); }
.viz-plot .val { fill: var(--text); font: 600 var(--fs-sm) var(--font); font-variant-numeric: tabular-nums; }
.viz-plot .dot { stroke: var(--surface); stroke-width: 2; }
.viz-plot .hit { fill: transparent; cursor: crosshair; }
.viz-empty { color: var(--muted); font-size: var(--fs-md); padding: 24px 0; text-align: center; margin: 0; }
.viz-tip { position: fixed; z-index: 60; min-width: 150px; padding: 8px 10px; border-radius: 8px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0, 0, 0, .14); font-size: var(--fs-sm); pointer-events: none; }
.tip-row { display: flex; align-items: center; gap: 4px; margin-top: 3px; }
.tip-row span { flex: 1; color: var(--muted); }
.tip-row b { font-variant-numeric: tabular-nums; }
.viz-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; padding: 12px 0; }
.viz-tile { padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.viz-tile span { display: block; font-size: var(--fs-sm); color: var(--muted); }
.viz-tile strong { font-size: var(--fs-title); }
.viz-tile small { display: block; font-size: var(--fs-xs); color: var(--muted); }
.viz-split { display: flex; gap: 2px; height: 26px; margin: 18px 0 10px; }
.viz-split div:first-child { border-radius: 4px 0 0 4px; } .viz-split div:last-child { border-radius: 0 4px 4px 0; }
.viz-split div:only-child { border-radius: 4px; }
.viz-split-legend { display: flex; gap: 24px; font-size: var(--fs-md); padding-bottom: 12px; }
@media (max-width: 900px) { .viz-grid { grid-template-columns: 1fr; } }
.viz-plot .dlabel { fill: var(--muted); font: 600 var(--fs-2xs) var(--font); font-variant-numeric: tabular-nums; }
.viz-plot .dlabel.strong { fill: var(--text); font-size: var(--fs-2xs); }
.viz-plot .dlabel.in { fill: #1f2937; font-weight: 600; }
.viz-plot .dlabel.end { fill: var(--text); font-size: var(--fs-xs); }
:root[data-theme="dark"] .viz-plot .dlabel.in { fill: #111827; }
/* Camemberts (anneau) */
.viz-pie { display: flex; align-items: center; gap: 22px; padding: 8px 0 6px; flex-wrap: wrap; }
.viz-pie-chart svg { display: block; }
.viz-pie .slice { stroke: var(--surface); stroke-width: 2; cursor: pointer; }
.viz-pie .slice:hover { opacity: .85; }
.viz-pie .pie-total { fill: var(--text); font: 700 var(--fs-title) var(--font); }
.viz-pie .pie-unit { fill: var(--muted); font: var(--fs-xs) var(--font); }
.viz-pie-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 190px; font-size: var(--fs-sm); }
.viz-pie-legend li { display: grid; grid-template-columns: 12px 1fr auto 44px; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--border); }
.viz-pie-legend li:last-child { border-bottom: 0; }
.viz-pie-legend i { width: 10px; height: 10px; border-radius: 3px; }
.viz-pie-legend b { font-variant-numeric: tabular-nums; }
.viz-pie-legend em { font-style: normal; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.report-filters .report-period { display: inline-flex; gap: 10px; flex-wrap: wrap; } .report-filters .report-period[hidden] { display: none; }

/* ===== Échelle typographique unique du site : 10 · 11 · 12 · 13 · 14 · 16 · 18 · 20 · 22 px ===== */
body { font-size: var(--fs-base); line-height: 1.45; }
h1, .settings-head h1 { font-size: var(--fs-title); font-weight: 700; }
h2 { font-size: var(--fs-lg); font-weight: 700; }
h3 { font-size: var(--fs-base); font-weight: 700; }
.small, small, .hint, .muted.small { font-size: var(--fs-sm); }
label { font-size: var(--fs-md); }
input, select, textarea, .btn { font-size: var(--fs-base); }
.btn.sm { font-size: var(--fs-sm); }
.table td { font-size: var(--fs-md); }
.table thead th { font-size: var(--fs-xs); }
.badge { font-size: var(--fs-xs); }
/* Rapport : absences par groupe, variables de paie */
.report .abs-col { white-space: nowrap; }
.pay-table td { vertical-align: middle; }
.money-input { width: 96px; text-align: right; font-variant-numeric: tabular-nums; }
.money-input.manual { border-color: var(--primary); background: var(--primary-soft); }
.money-input::placeholder { color: var(--muted); opacity: .9; }
.pay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.pay-grid fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px 12px; margin: 0; }
.pay-grid legend { font-weight: 700; font-size: var(--fs-md); padding: 0 4px; }
.pay-grid .radio { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px; margin: 6px 0; font-weight: 400; }
.pay-settings .form-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.journal-etabs { flex-wrap: wrap; }

/* Onboarding : formulaire du nouveau salarié (téléphone d'abord) */
body.onboarding-page .container { place-items: start center; }
.onb-card { width: min(680px, 100%); padding: 28px; }
.onb-card h1 { margin: 12px 0 6px; }
.onb-form fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 16px; margin: 0; }
.onb-form legend { padding: 0 6px; font-weight: 600; font-size: var(--fs-base); }
.onb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.onb-grid .span-2 { grid-column: 1 / -1; }
.onb-form label { display: grid; gap: 4px; font-size: var(--fs-md); }
.onb-form .radio-row { display: flex; flex-direction: row; align-items: flex-start; gap: 8px; margin: 6px 0; font-size: var(--fs-base); }
.onb-form .radio-row input { width: 18px; height: 18px; flex: none; margin-top: 1px; accent-color: var(--primary); }
.onb-form .muted.small { margin: 12px 0 2px; }
.onb-amount { margin-top: 8px; max-width: 260px; }
.onb-doc { padding: 10px 0; border-top: 1px solid var(--border); }
.onb-doc:first-of-type { border-top: 0; }
.onb-doc.onb-needed strong { color: var(--primary); }
.onb-req { color: var(--danger, #dc2626); }
.flash.error ul { margin: 6px 0 0 18px; padding: 0; }
@media (max-width: 560px) { .onb-card { padding: 18px 16px; } .onb-grid { grid-template-columns: 1fr; } }

/* Fiche : bloc Onboarding */
.onb-mail { display: grid; gap: 8px; margin: 12px 0; }
.onb-mail textarea { width: 100%; min-height: 240px; font: var(--fs-sm)/1.5 ui-monospace, Menlo, monospace; }
.onb-mail .copy-row { margin: 0; }
/* Alertes du journal */
.jcount { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--warn-soft);
  color: var(--warn); font: 600 var(--fs-xs)/18px var(--font); text-align: center; }
.jcount.crit { background: var(--danger); color: #fff; }
.seg a.active .jcount { box-shadow: 0 0 0 1px #fff; }
.journal-alerts { margin: 0 0 14px; font-size: var(--fs-md); }
.journal-alerts p { margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.jalert { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--warn-soft); color: var(--warn);
  font: 600 var(--fs-xs)/18px var(--font); white-space: nowrap; }
.jalert.crit { background: var(--danger-soft); color: var(--danger); }
a.jalert:hover { text-decoration: none; filter: brightness(.95); }
.journal-rules summary { cursor: pointer; color: var(--muted); font-size: var(--fs-sm); }
.journal-rules ul { margin: 8px 0 0; padding-left: 0; list-style: none; display: grid; gap: 5px; font-size: var(--fs-sm); }
.journal-rules .jalert { min-width: 62px; text-align: center; margin-right: 6px; }
.jalert-line { display: block; margin-top: 4px; color: var(--text); }
.journal-table tr.jrow-attention td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.journal-table tr.jrow-critique td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.journal-table tr.jrow-critique { background: color-mix(in srgb, var(--danger-soft) 45%, transparent); }
/* SIRH — vue d'ensemble */
.ov-filters { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 12px; }
.ov-filters label { flex-direction: row; align-items: center; gap: 8px; }
.ov-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ov-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.ov-kpi > span { display: block; font-size: var(--fs-sm); color: var(--muted); margin-bottom: 4px; }
.ov-kpi > strong { font-size: var(--fs-title); font-variant-numeric: tabular-nums; }
.ov-gender { grid-column: span 2; }
.ov-pill-row { display: grid; grid-template-columns: 60px 1fr 30px; gap: 8px; align-items: center; font-size: var(--fs-sm); margin-top: 4px; }
.ov-pill-row em { font-style: normal; color: var(--muted); }
.ov-pill-row i { display: block; height: 10px; min-width: 3px; border-radius: 0 5px 5px 0; }
.ov-pill-row b { font-variant-numeric: tabular-nums; }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.ov-card { margin: 0; padding: 14px 16px; min-width: 0; }
.ov-card h3 { margin: 0 0 10px; font-size: var(--fs-base); }
.ov-card .viz-head h3 { margin: 0; }
.ov-wide { grid-column: span 2; }
@media (max-width: 860px) { .ov-wide, .ov-gender { grid-column: auto; } .ov-grid { grid-template-columns: 1fr; } }
.ov-pie { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.ov-pie .viz-pie-legend { flex: 1; min-width: 160px; }
.ov-donut { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.ov-donut > div { width: 62%; height: 62%; border-radius: 50%; background: var(--surface); display: grid; place-content: center; text-align: center; }
.ov-donut strong { font-size: var(--fs-title); line-height: 1.1; }
.ov-donut span { font-size: var(--fs-xs); color: var(--muted); }
.ov-donut.sm { width: 96px; height: 96px; }
.ov-donut.sm strong { font-size: var(--fs-xl); }
.ov-hist { display: flex; align-items: flex-end; gap: 4px; height: 190px; padding-top: 6px; }
.ov-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.ov-col i { width: 100%; max-width: 34px; background: var(--series-6); border-radius: 4px 4px 0 0; min-height: 0; }
.ov-col b { font: 600 var(--fs-xs) var(--font); margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.ov-col span { font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; }
.ov-heat { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.ov-heat th { text-align: left; font-weight: 500; color: var(--muted); padding: 4px 6px; white-space: nowrap; }
.ov-heat thead th:not(:first-child), .ov-heat td { text-align: center; }
.ov-heat td { padding: 5px 6px; border-radius: 4px; background: color-mix(in srgb, var(--series-1) var(--a, 0%), var(--surface-2, transparent)); }
.ov-heat td.tot, .ov-heat tfoot td { font-weight: 600; background: transparent; }
.ov-heat tbody th { color: var(--text); }
.ov-bar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 32px; gap: 8px; align-items: center; font-size: var(--fs-sm); margin: 5px 0; }
.ov-bar span { text-align: right; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-bar i { display: block; height: 14px; min-width: 3px; border-radius: 0 4px 4px 0; background: var(--series-2); }
.ov-bar b { font-variant-numeric: tabular-nums; }
.ov-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; }
.ov-group { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.ov-group strong { font-size: var(--fs-md); margin-top: 6px; }
.ov-group small { font-size: var(--fs-xs); color: var(--muted); }
.ov-group small i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
/* Registre du personnel : grand tableau, colonnes de gauche figées */
.reg-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
.reg-filters input[type=search] { min-width: 260px; }
.reg-filters .count { font-size: var(--fs-xs); opacity: .75; margin-left: 2px; }
.reg-warn { font-size: var(--fs-sm); color: var(--danger); background: var(--danger-soft); padding: 4px 10px; border-radius: 8px; }
.reg-scroll { overflow: auto; max-height: calc(100vh - 230px); }
.reg-table { border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); white-space: nowrap; width: max-content; min-width: 100%; }
.reg-table th, .reg-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; background: var(--surface); }
.reg-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-weight: 600; color: var(--muted); font-size: var(--fs-xs); }
.reg-table thead tr:nth-child(2) th { top: 27px; border-bottom: 2px solid var(--border-strong); }
.reg-table .reg-groups th { text-transform: uppercase; letter-spacing: .04em; font-size: var(--fs-xs); border-left: 1px solid var(--border); }
.reg-table .sticky-a, .reg-table .sticky-b, .reg-table .sticky-c { position: sticky; z-index: 1; }
.reg-table thead .sticky-a, .reg-table thead .sticky-b, .reg-table thead .sticky-c { z-index: 3; }
.reg-table .sticky-a { left: 0; min-width: 44px; }
.reg-table .sticky-b { left: 44px; min-width: 86px; }
.reg-table .sticky-c { left: 130px; min-width: 200px; border-right: 2px solid var(--border-strong); }
.reg-table .num { font-variant-numeric: tabular-nums; }
.reg-table .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-xs); }
.reg-table tbody tr:hover td { background: var(--surface-2); }
.reg-table tr.reg-missing td { background: color-mix(in srgb, var(--danger-soft) 70%, var(--surface)); }
.reg-table tr.reg-left td { color: var(--muted); }
.reg-table tr.reg-left td a { color: var(--muted); }
.reg-flag span { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--danger); color: #fff; font: 700 var(--fs-xs) var(--font); }
.reg-expired { color: var(--danger); font-weight: 600; }
.reg-contract { display: inline-block; padding: 1px 7px; border-radius: 6px; font-weight: 600; font-size: var(--fs-xs); background: var(--surface-2); }
.reg-contract.c-cdi { color: #1f7a4d; background: #e3f5ea; }
.reg-contract.c-cdd { color: #a15c07; background: var(--warn-soft); }
.reg-contract.c-extra { color: #5b4bb7; background: #ece8fb; }
:root[data-theme="dark"] .reg-contract.c-cdi { color: #7fd6a6; background: #183326; }
:root[data-theme="dark"] .reg-contract.c-extra { color: #b8adf0; background: #29244a; }
.print-only { display: none; }
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  .topbar, .no-print, .flashes { display: none !important; }
  .print-only { display: block; font-size: var(--fs-base); margin: 0 0 6px; }
  .container { padding: 0; }
  .reg-scroll { overflow: visible; max-height: none; }
  .reg-table { font-size: 7.5px; width: 100%; white-space: normal; }
  .reg-table th, .reg-table td { padding: 2px 3px; position: static !important; background: none !important; }
  .reg-flag { display: none; }
}
/* Registre : colonnes d'onboarding */
.reg-table .reg-ob-group { background: color-mix(in srgb, var(--primary) 10%, var(--surface-2)); color: var(--primary); }
.reg-table th.reg-ob { text-align: center; max-width: 74px; white-space: normal; line-height: 1.2; }
.reg-table td.reg-ob { text-align: center; }
.reg-table td.reg-ob input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); }
.reg-table td.reg-ob input:disabled { cursor: default; opacity: .7; }
.reg-table .reg-ob-first { border-left: 2px solid var(--border-strong); min-width: 104px; }
.reg-progress { display: inline-block; width: 46px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; vertical-align: middle;
  box-shadow: inset 0 0 0 1px var(--border); }
.reg-progress i { display: block; height: 100%; background: var(--warn); }
.reg-progress.done i { background: #2e9e63; }
.reg-ob-first small { margin-left: 4px; font-variant-numeric: tabular-nums; }
.reg-ob-status { display: block; margin: 2px 0 0 !important; color: var(--muted); font-size: var(--fs-xs); }
.reg-ob-status.late { color: var(--danger); }
@media print { .reg-table .reg-ob, .reg-table .reg-ob-first, .reg-table .reg-ob-group { display: none; } }
/* Cooptation (fiche) */
.coop-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin: 0; }
.coop-form .coop-search { flex: 1 1 280px; max-width: 420px; }
.coop-form .coop-search input { width: 100%; }
.coop-form label:not(.coop-search) input { width: 110px; }
.coop-status { margin: 0 0 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.coop-status.coop-due, .coop-status.coop-prevue { background: color-mix(in srgb, #2e9e63 12%, var(--surface)); }
.coop-status.coop-non_due, .coop-status.coop-annulee { background: var(--warn-soft); }
.coop-made-title { margin: 12px 0 4px; font-size: var(--fs-md); }
.coop-made { margin: 0; padding-left: 18px; font-size: var(--fs-md); }
.coop-made li { margin: 2px 0; }
.coop-steps { margin: 6px 0 0; padding-left: 18px; }
.coop-steps li { margin: 2px 0; }
.coop-steps .coop-due b, .coop-steps .coop-prevue b { color: #1f7a4d; }
.coop-steps .coop-non_due, .coop-steps .coop-annulee { color: var(--muted); }
:root[data-theme="dark"] .coop-steps .coop-due b, :root[data-theme="dark"] .coop-steps .coop-prevue b { color: #7fd6a6; }
.coop-search input { min-width: 300px; }
.portal-decision { margin-top: 8px; } .portal-validate { border-left: 3px solid var(--warn); }
.portal-decision input[name=commentaire] { width: 100%; box-sizing: border-box; margin-bottom: 8px; }
.reg-filter-bar { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.reg-filter-bar label { display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-xs); color: var(--muted); }
.reg-filter-bar label.check { flex-direction: row; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text); padding-bottom: 7px; }
.reg-filter-bar select, .reg-filter-bar input[type=date] { font-size: var(--fs-sm); padding: 5px 8px; max-width: 190px; }
.reg-filter-bar label.on { color: var(--primary); font-weight: 600; }
.reg-filter-bar label.on select, .reg-filter-bar label.on input[type=date] { border-color: var(--primary); }
a.reg-warn:hover { text-decoration: none; filter: brightness(.96); }

/* Sociétés & établissements : le tableau tient dans la carte (champs fluides, colonnes étroites fixes) */
.etab-table { table-layout: fixed; min-width: 760px; }
.etab-table th, .etab-table td { padding: 8px 6px; }
.etab-table th:first-child, .etab-table td:first-child { padding-left: 12px; }
.etab-table input:not([type=checkbox]):not([type=color]), .etab-table select { width: 100%; min-width: 0; }
.etab-table .c-ordre { width: 58px; }
.etab-table .c-couleur { width: 68px; }
.etab-table .c-nom { width: 19%; }
.etab-table .c-societe { width: 18%; }
.etab-table .c-actif { width: 52px; }
.etab-table .c-nb { width: 76px; }
.etab-table .c-pointeuse { width: 84px; }
.etab-table input[type=number] { -moz-appearance: textfield; appearance: textfield; text-align: center; padding-left: 4px; padding-right: 4px; }
.etab-table input[type=number]::-webkit-inner-spin-button, .etab-table input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Grille salariale : calculateur net / brut / chargé et tableaux de taux */
.calc-grid { display: grid; grid-template-columns: minmax(120px, auto) repeat(3, minmax(0, 1fr)); gap: 8px 12px; align-items: center; max-width: 720px; margin: 10px 0 6px; }
.calc-grid input:not(.calc-hours) { width: 100%; min-width: 0; text-align: right; font-variant-numeric: tabular-nums; }
.calc-head { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; text-align: right; }
.calc-label { font-weight: 600; }
.calc-hours { width: 52px; padding: 2px 6px; font-size: var(--fs-sm); text-align: center; }
.grille-table td small { display: block; margin-top: 2px; }
.grille-table td .w-num { text-align: right; }
.contract-min { display: block; margin-top: 4px; }
@media (max-width: 600px) { .calc-grid { grid-template-columns: 1fr 1fr 1fr; } .calc-grid > span:first-child { display: none; } .calc-label { grid-column: 1 / -1; } }

/* ===== Téléphone et tablette ===== */
@media (max-width: 900px) {
  /* Menu principal : une ligne qui défile au doigt, sous le logo et le sélecteur d'établissement */
  .topbar .mainnav { order: 3; flex-basis: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .topbar .mainnav::-webkit-scrollbar { display: none; }
  .access-wrap { overflow-x: auto; max-width: 100%; }
  /* Tableaux hors zone défilante : ils défilent au doigt au lieu d'élargir la page */
  table.table:not(.table-scroll table):not(.grid-wrap table):not(.access-wrap table) { display: block; overflow-x: auto; max-width: 100%; }
  /* Onglets et barres d'outils : défilent ou passent à la ligne */
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg a, .seg button { white-space: nowrap; }
  .pl-nav { flex-wrap: wrap; }
  .btn { white-space: normal; height: auto; min-height: 36px; text-align: center; }
  .btn.sm { min-height: 30px; }
  .info-banner .btn { max-width: 100%; }
  .postes-list { overflow-x: auto; }
}
