/* ==========================================================================
   Planning — feuille de style
   Ardoise pour la structure, jaune signal pour l'action, barres d'horaires
   avec la pause repas hachurée. Conçu d'abord pour le téléphone.
   ========================================================================== */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url("fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 700; font-display: swap; src: url("fonts/barlow-semi-condensed-latin-700-normal.woff2") format("woff2"); }

:root {
  --slate: #1C1B1B;          /* structure : le noir du logo, adouci */
  --slate-2: #3A3636;
  --slate-soft: #ECE7E5;
  --ink: #1C1B1B;
  --ink-2: #5F5856;
  --ink-3: #9A9290;
  --paper: #F3F1F0;
  --surface: #FFFFFF;
  --field: #F6F4F3;
  --line: #DDD7D5;
  --line-2: #ECE8E6;
  --signal: #DA3B26;         /* rouge du logo : actions et repères */
  --signal-soft: #FCE6E2;
  --warn: #C7641A;
  --warn-soft: #FBE8D6;
  --block: #9B1B3A;          /* bloquant : bordeaux, distinct du rouge de la marque */
  --block-soft: #F6DDE3;
  --ok: #2F8A5B;
  --ok-soft: #DDEFE4;

  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --num: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;

  --name-w: 118px;
  --tab-h: 60px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-size-adjust: 100%;
}
body.has-sheet { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--slate-2); }
.num, .tick, .bar-time, .chip-t { font-family: var(--num); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.muted { color: var(--ink-3); }

/* ---------- Coque : contenu + barre d'onglets ---------- */
.shell {
  display: grid;
  /* minmax(0, 1fr) : le contenu large (frise, semaine) défile dans sa zone
     au lieu d'élargir toute la page */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  width: 100%;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}
.shell-bare { grid-template-rows: minmax(0, 1fr); }
.main { min-height: 0; min-width: 0; position: relative; display: flex; flex-direction: column; }
.page { display: flex; flex-direction: column; height: 100%; min-height: 0; min-width: 0; position: relative; }
.page-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px max(16px, calc((100% - 760px) / 2)) 32px;
  overscroll-behavior: contain;
}

.tabbar {
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
  z-index: 20;
}
.brand { display: none; }
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: var(--tab-h);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  position: relative;
}
.tab[aria-current="page"] { color: var(--slate); font-weight: 600; }
.tab[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  width: 30px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--signal);
}

/* ---------- Barre du haut ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: calc(var(--safe-t) + 6px) 12px 6px 16px;
  background: var(--slate);
  color: #fff;
  box-shadow: inset 0 -3px 0 var(--signal);
}
.topbar h1 { flex: 1; font-family: var(--num); font-weight: 700; font-size: 24px; letter-spacing: .01em; }
.topbar .icon-btn { color: #fff; }
.topbar .btn-primary { background: var(--signal); color: #fff; }
.team-title { display: flex; align-items: center; gap: 10px; }
.team-title::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--chip); box-shadow: 0 0 0 2px rgba(255,255,255,.7); }

.planning-top { flex-wrap: wrap; row-gap: 4px; padding-left: 4px; padding-right: 8px; }
.date-nav { display: flex; align-items: center; flex: 1 1 250px; min-width: 0; }
.date-title-wrap { position: relative; flex: 1; min-width: 0; }
.date-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 2px 4px;
  background: none;
  border: 0;
  color: #fff;
  text-align: left;
  border-radius: 8px;
}
.date-main { font-family: var(--num); font-weight: 700; font-size: 25px; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.date-sub { font-size: 13px; color: #B9B1AF; }
.date-native { position: absolute; inset: 0; opacity: 0; pointer-events: none; width: 100%; }
.top-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; padding-bottom: 2px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s, opacity .15s;
  touch-action: manipulation;
}
.btn-primary { background: var(--slate); color: #fff; }
.btn-primary:hover { background: var(--slate-2); }
.btn-signal { background: var(--signal); color: #fff; }
.btn-signal:hover { background: #C2321F; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--field); }
.btn-danger { background: var(--block); color: #fff; }
.btn-ghost-danger { background: var(--surface); border-color: color-mix(in srgb, var(--block) 35%, transparent); color: var(--block); }
.btn-icon { width: 46px; padding: 0; }
.btn-small { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.is-busy { opacity: .6; cursor: progress; }
.btn + .btn-block, .btn-block + .btn-block { margin-top: 10px; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  touch-action: manipulation;
}
.icon-btn:disabled { opacity: .35; }
.pill {
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.4);
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Contrôle segmenté ---------- */
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: #E1E6E2; }
.seg-btn {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.seg-btn[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20,16,15,.18); }
.seg-small .seg-btn { height: 32px; padding: 0 9px; font-size: 13px; }
.topbar .seg { background: rgba(255,255,255,.12); }
.topbar .seg-btn { color: #D6CFCD; height: 32px; padding: 0 11px; }
.topbar .seg-btn[aria-checked="true"] { background: #fff; color: var(--slate); }

/* ---------- Pastilles ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  touch-action: manipulation;
}
.chip-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--chip); }
.chip[aria-pressed="true"] { background: var(--chip, var(--slate)); border-color: transparent; color: #fff; }
.chip[aria-pressed="true"] .chip-dot { background: #fff; }
.chip.is-source { opacity: .5; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 8px 12px; flex: 1; min-width: 0; }
.chip-scroll::-webkit-scrollbar { display: none; }

.filters {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.filter-tools { display: flex; padding-right: 4px; border-left: 1px solid var(--line-2); color: var(--slate); }

.alerts-bar { background: var(--warn-soft); border-bottom: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.alerts-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 16px;
  border: 0;
  background: none;
  color: #7A3A0C;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}
.alerts-btn span { flex: 1; }
.alerts-btn.has-block { color: var(--block); }

/* ---------- Planning ---------- */
.page-planning .plan-body { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; position: relative; }

.fab {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 54px;
  padding: 0 22px 0 18px;
  border: 0;
  border-radius: 27px;
  background: var(--signal);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(20,16,15,.28), 0 1px 3px rgba(20,16,15,.2);
  touch-action: manipulation;
}
body.has-sheet .fab { visibility: hidden; }

/* Vue Jour : frise */
.day-scroll, .week-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-bottom: 90px;
  background: var(--surface);
}
.day-grid { position: relative; width: calc(var(--name-w) + var(--track-w)); min-height: 100%; }
.day-ruler {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 6;
  height: 30px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.ruler-track { position: relative; width: var(--track-w); flex: none; }
.tick {
  position: absolute;
  top: 7px;
  padding-left: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  border-left: 1px solid var(--line);
  line-height: 23px;
  top: 6px;
}
.lane-name {
  position: sticky;
  left: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  width: var(--name-w);
  flex: none;
  padding: 6px 8px 6px 10px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.lane-name.corner { z-index: 7; font-size: 12px; color: var(--ink-3); }
.lane-label { display: flex; flex-direction: column; min-width: 0; }
.lane-person { font-size: 14px; font-weight: 500; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-label small { font-family: var(--num); font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.lane-label small.is-over { color: var(--warn); font-weight: 600; }
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: var(--slate-soft);
  color: var(--slate);
  font-size: 12px;
  font-weight: 600;
}
.avatar-admin { background: var(--signal-soft); color: #A42C1C; }
.lane { display: flex; height: 58px; border-bottom: 1px solid var(--line-2); }
.lane-warn .lane-name { box-shadow: inset 3px 0 0 var(--warn); }
.lane-block .lane-name { box-shadow: inset 3px 0 0 var(--block); }
.lane-track {
  position: relative;
  width: var(--track-w);
  flex: none;
  background-image: repeating-linear-gradient(to right, var(--line-2) 0 1px, transparent 1px var(--hour-w));
}
.lane-absence {
  position: absolute;
  inset: 5px 0;
  display: flex;
  align-items: center;
  border-left: 4px solid var(--abs);
  background: color-mix(in srgb, var(--abs) 12%, transparent);
  color: var(--abs);
  font-size: 13px;
  font-weight: 600;
}
.lane-absence span { position: sticky; left: calc(var(--name-w) + 10px); padding-left: 10px; }

/* Barre d'horaire : l'élément signature */
.bar {
  position: absolute;
  top: 9px;
  height: 40px;
  display: flex;
  align-items: center;
  border-radius: 7px;
  background: var(--team);
  color: #fff;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.14);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: grab;
  transition: box-shadow .15s, opacity .15s;
}
.bar-time {
  position: relative;
  z-index: 1;
  padding: 0 12px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-shadow: 0 1px 1px rgba(0,0,0,.25);
  pointer-events: none;
}
.bar-break {
  position: absolute;
  top: 0;
  bottom: 0;
  background-color: rgba(255,255,255,.2);
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.6) 0 3px, transparent 3px 7px);
  border-left: 1px solid rgba(255,255,255,.7);
  border-right: 1px solid rgba(255,255,255,.7);
  pointer-events: none;
}
.bar-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18px;
  z-index: 2;
  cursor: ew-resize;
  touch-action: none;
}
.bar-handle-l { left: -4px; }
.bar-handle-r { right: -4px; }
.bar-handle::after {
  content: "";
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: rgba(255,255,255,.75);
}
.bar-other {
  background: repeating-linear-gradient(135deg, #CDD4CF 0 6px, #DCE1DD 6px 12px);
  color: var(--ink-2);
  box-shadow: none;
  cursor: default;
}
.bar-other .bar-time { text-shadow: none; }
.bar-warn { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--warn); }
.bar-block { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--block); }
.bar-flag {
  position: absolute;
  top: -7px;
  right: -6px;
  z-index: 3;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--warn);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.bar-block .bar-flag, .chip-block .bar-flag { background: var(--block); }
.bar.is-dragging, .bar.is-resizing {
  z-index: 20;
  cursor: grabbing;
  box-shadow: 0 10px 24px rgba(20,16,15,.35);
}
.bar.is-dragging { opacity: .95; }
.is-pending { opacity: .65; }
.drag-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 30;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-family: var(--num);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}
.now-line {
  position: absolute;
  top: 30px;
  bottom: 0;
  left: calc(var(--name-w) + var(--x));
  width: 2px;
  background: var(--block);
  z-index: 3;
  pointer-events: none;
}

/* Bande d'effectif */
.cov-row {
  display: flex;
  position: sticky;
  top: 30px;
  z-index: 6;
  height: 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.cov-name { font-size: 12px; color: var(--ink-2); }
.cov-track { position: relative; width: var(--track-w); flex: none; }
.cov-cell {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 2px;
  font-family: var(--num);
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
}
.cov-none { color: var(--ink-3); }
.cov-ok { background: var(--ok-soft); color: var(--ok); }
.cov-low { background: var(--block-soft); color: var(--block); font-weight: 700; }

/* Vue Semaine */
.week-grid {
  display: grid;
  grid-template-columns: var(--name-w) repeat(7, minmax(80px, 1fr));
  min-width: calc(var(--name-w) + 7 * 80px);
}
.wk-corner, .wk-head {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 50px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.wk-corner { left: 0; z-index: 5; display: flex; align-items: center; padding-left: 10px; font-size: 12px; color: var(--ink-3); border-right: 1px solid var(--line); }
.wk-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-left: 0;
  border-top: 0;
  border-right: 1px solid var(--line-2);
  color: var(--ink);
  padding: 0;
}
.wk-day { font-family: var(--num); font-size: 16px; font-weight: 700; }
.wk-head small { font-size: 11px; color: var(--ink-2); }
.wk-head.is-today .wk-day { color: var(--slate); box-shadow: inset 0 -3px 0 var(--signal); }
.wk-head.has-gap small { color: var(--block); font-weight: 600; }
.wk-name {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 70px;
  padding: 6px 8px 6px 10px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line-2);
}
.wk-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 70px;
  padding: 5px;
  border-right: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
}
.wk-cell.is-today { background: #FFF7F5; }
.wk-cell.is-drop { background: var(--signal-soft); outline: 2px dashed var(--slate); outline-offset: -3px; }
.wk-add {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-size: 22px;
  opacity: .28;
  pointer-events: none;
}
.wk-cell:hover .wk-add { opacity: .7; }
.wk-absence {
  padding: 3px 6px;
  border-left: 3px solid var(--abs);
  border-radius: 0 5px 5px 0;
  background: color-mix(in srgb, var(--abs) 13%, transparent);
  color: var(--abs);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}
.chip-shift {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 4px 7px 9px;
  border-radius: 7px;
  background: var(--team);
  color: #fff;
  line-height: 1.1;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: grab;
}
.chip-t { font-size: 15px; font-weight: 600; }
.chip-end { font-weight: 600; opacity: .82; }
.chip-mini {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 4px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,.6);
}
.chip-mini-break { position: absolute; top: -1px; bottom: -1px; background: rgba(0,0,0,.5); border-radius: 1px; }
.chip-shift.is-other { background: repeating-linear-gradient(135deg, #CDD4CF 0 6px, #DCE1DD 6px 12px); color: var(--ink-2); cursor: default; }
.chip-warn { box-shadow: 0 0 0 2px var(--warn); }
.chip-block { box-shadow: 0 0 0 2px var(--block); }
.chip-shift.is-dragging { opacity: .35; }
.chip-ghost {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  opacity: .95;
  transform: rotate(-2deg) scale(1.05);
  box-shadow: 0 12px 28px rgba(20,16,15,.35);
}

/* Vue Mois */
.month-scroll { flex: 1; min-height: 0; overflow: auto; padding: 8px 8px 90px; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; max-width: 980px; margin: 0 auto; }
.mo-dow { padding: 4px 0; text-align: center; font-size: 12px; color: var(--ink-2); }
.mo-day {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-height: 70px;
  padding: 5px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
  overflow: hidden;
}
.mo-day.is-out { opacity: .45; }
.mo-day.is-today { border: 2px solid var(--slate); }
.mo-warn { box-shadow: inset 0 -4px 0 var(--warn); }
.mo-block { box-shadow: inset 0 -4px 0 var(--block); }
.mo-num { font-family: var(--num); font-size: 14px; font-weight: 700; color: var(--ink-2); }
.mo-count { font-family: var(--num); font-size: 18px; font-weight: 700; color: var(--slate); line-height: 1; }
.mo-count small { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.mo-abs { font-size: 11px; color: var(--ink-2); }
.mo-shift, .mo-absence {
  width: 100%;
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--team, var(--abs));
  color: #fff;
  font-family: var(--num);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.1;
}
.mo-absence { background: var(--abs); font-family: var(--font); font-size: 11px; }

/* Agenda de l'employé */
.agenda-scroll { flex: 1; min-height: 0; overflow: auto; padding: 14px max(16px, calc((100% - 640px) / 2)) 40px; }
.ag-total { font-size: 15px; color: var(--ink-2); margin-bottom: 6px; }
.ag-total strong { font-family: var(--num); font-size: 20px; color: var(--ink); }
.agenda { list-style: none; margin: 0; padding: 0; }
.ag-day { padding: 14px 0; border-bottom: 1px solid var(--line); }
.ag-day h3 { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.ag-day h3::first-letter { text-transform: uppercase; }
.ag-day.is-today h3 { color: var(--slate); }
.ag-day.is-today h3::after { content: "Aujourd’hui"; margin-left: 8px; padding: 1px 8px; border-radius: 10px; background: var(--signal); color: #fff; font-size: 12px; }
.ag-shift { margin-top: 8px; padding: 8px 12px; border-left: 5px solid var(--team); border-radius: 0 10px 10px 0; background: var(--surface); }
.ag-time { font-family: var(--num); font-size: 30px; font-weight: 700; line-height: 1.1; }
.ag-dash { margin: 0 6px; color: var(--ink-3); }
.ag-meta { font-size: 14px; color: var(--ink-2); }
.ag-note { font-size: 14px; margin-top: 4px; }
.ag-free { margin-top: 4px; color: var(--ink-3); font-size: 14px; }
.ag-absence { margin-top: 8px; padding: 8px 12px; border-left: 5px solid var(--abs); background: color-mix(in srgb, var(--abs) 12%, var(--surface)); color: var(--abs); font-weight: 600; border-radius: 0 10px 10px 0; }

/* ---------- Panneaux du bas ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20,16,15,.45);
  opacity: 0;
  transition: opacity .22s;
}
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 101;
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  max-height: 92dvh;
  padding-bottom: var(--safe-b);
  border-radius: 18px 18px 0 0;
  background: var(--surface);
  transform: translateY(100%);
  transition: transform .26s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 -8px 30px rgba(20,16,15,.2);
}
.sheet.open { transform: translateY(0); }
.sheet-grip { width: 40px; height: 5px; margin: 8px auto 0; border-radius: 3px; background: var(--line); flex: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 20px; flex: none; touch-action: none; }
.sheet-head h2 { flex: 1; font-size: 20px; font-weight: 600; }
.sheet-body { flex: 1; min-height: 0; overflow: auto; padding: 4px 20px 20px; overscroll-behavior: contain; }
.sheet-foot {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-2);
  flex: none;
}
.sheet-foot .btn-primary, .sheet-foot .btn-danger { flex: 1; }
.sheet-text { font-size: 16px; color: var(--ink-2); padding: 4px 0 8px; }

/* ---------- Messages ---------- */
.toasts {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--tab-h) + var(--safe-b) + 12px);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 520px;
  padding: 12px 14px;
  border-radius: 12px;
  border-left: 5px solid var(--slate-2);
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .2s, transform .2s;
  box-shadow: 0 8px 24px rgba(20,16,15,.3);
}
.toast.show { opacity: 1; transform: none; }
.toast-text { flex: 1; }
.toast-text p + p { margin-top: 2px; font-size: 14px; color: #D2DDE3; }
.toast-ok { border-left-color: var(--ok); }
.toast-warn { border-left-color: var(--warn); }
.toast-error { border-left-color: #E4574C; }
.toast-action { border: 0; background: none; color: #FF8A73; font-weight: 600; padding: 8px 4px; white-space: nowrap; }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .stepper-label, .field-label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field-hint, .hint { font-size: 14px; color: var(--ink-2); }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select, .field input:not([type]) {
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 16px;
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
}
select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235F5856' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
input:focus, select:focus { outline: none; border-color: var(--slate-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--slate-2) 22%, transparent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.with-unit { display: flex; align-items: center; gap: 10px; }
.with-unit input { width: 110px; flex: none; }
.unit { font-size: 14px; color: var(--ink-2); }
.with-action { display: flex; gap: 8px; }
.with-action input { flex: 1; }
.inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.switch { display: flex; align-items: center; gap: 12px; padding: 4px 0; position: relative; cursor: pointer; }
.switch-text { flex: 1; display: flex; flex-direction: column; font-size: 16px; font-weight: 500; }
.switch-text small { font-size: 13px; font-weight: 400; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 50px; height: 30px; flex: none; border-radius: 15px; background: #C9D1CC; position: relative; transition: background .15s; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--slate); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--signal); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.check input { width: 20px; height: 20px; accent-color: var(--slate); }

/* Réglage d'heure −/+ */
.time-pair { display: flex; flex-direction: column; gap: 10px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stepper-ctrl { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.stepper-btn {
  width: 54px;
  height: 54px;
  border: 0;
  background: var(--field);
  color: var(--slate);
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.stepper-btn:active { background: var(--slate-soft); }
.stepper-value {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 0 6px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.stepper-time { font-family: var(--num); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper-day { margin-left: 3px; font-size: 12px; font-weight: 700; color: var(--warn); align-self: flex-start; margin-top: 10px; }
.stepper-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }
.num-stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; align-self: flex-start; }
.num-stepper .stepper-btn { width: 48px; height: 48px; }
.num-value { display: flex; align-items: center; justify-content: center; min-width: 58px; font-family: var(--num); font-size: 22px; font-weight: 700; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }

.tpl-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: -2px -20px; padding: 2px 20px; }
.tpl {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: none;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  text-align: left;
}
.tpl span { font-size: 14px; font-weight: 600; }
.tpl small { font-family: var(--num); font-size: 14px; color: var(--ink-2); }
.shift-summary { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--ink-2); padding: 2px 0; }
.shift-summary strong { font-family: var(--num); font-size: 17px; color: var(--ink); margin-left: 3px; }
.break-box { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line-2); }

.alert-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.alert-list li { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.alert-list .icon { margin-top: 1px; }
.alert-warn { background: var(--warn-soft); color: #74380D; }
.alert-block { background: var(--block-soft); color: #7C1F18; }
.alert-list-big li { padding: 0; }
.alert-list-big button { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 12px 14px; border: 0; background: none; color: inherit; text-align: left; font-size: 15px; }
.alert-date { font-weight: 600; font-size: 13px; }
.alert-list-big small { font-size: 12px; opacity: .8; }

.notice { padding: 12px 14px; border-radius: 10px; background: var(--signal-soft); font-size: 15px; }
.notice-warn { background: var(--warn-soft); color: #74380D; }
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--slate); background: #F7F3F2; }
.choice input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--slate); flex: none; }
.choice strong { display: block; font-size: 15px; }
.choice small { font-size: 14px; color: var(--ink-2); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; margin: 4px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.copy-week { display: flex; flex-direction: column; gap: 8px; }
.copy-week-title { font-size: 14px; font-weight: 600; color: var(--ink-2); }

/* ---------- Listes ---------- */
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; }
.rows > li + li { border-top: 1px solid var(--line-2); }
.rows + .btn, .section > .btn { margin-top: 10px; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 10px 12px 10px 14px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
}
.rows-compact .row { min-height: 52px; }
.row:active { background: var(--field); }
.row > .icon:last-child { color: var(--ink-3); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-title { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }
.row-end { display: flex; align-items: center; gap: 4px; font-family: var(--num); font-size: 15px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.row-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: var(--paper); color: var(--slate); flex: none; }
.tag { padding: 1px 8px; border-radius: 10px; background: color-mix(in srgb, var(--chip) 14%, transparent); color: var(--chip); font-size: 12px; font-weight: 600; }
.swatch { width: 14px; height: 14px; border-radius: 50%; background: var(--chip); flex: none; }
.swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.swatch-btn { width: 40px; height: 40px; border: 0; }
.swatch-btn[aria-checked="true"] { outline: 3px solid var(--ink); outline-offset: 3px; }
.toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--ink-3); }
.search input { border: 0; height: 46px; padding: 0; box-shadow: none !important; }
.section { margin-bottom: 30px; }
.section h2 { font-size: 19px; font-weight: 600; margin-bottom: 8px; }
.section > .hint { margin-bottom: 12px; }
.count { font-family: var(--num); color: var(--ink-3); }
.check-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; }
.check-list li + li { border-top: 1px solid var(--line-2); }
.check-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 54px; font-size: 16px; cursor: pointer; }
.check-row input { width: 22px; height: 22px; accent-color: var(--slate); flex: none; }
.cov-days { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; }
.cov-days li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 52px; }
.cov-days li + li { border-top: 1px solid var(--line-2); }
.cov-day-name { width: 84px; flex: none; font-weight: 500; }
.cov-day-name::first-letter { text-transform: uppercase; }
.cov-day-rows { display: flex; flex-wrap: wrap; gap: 6px; }
.cov-pill { display: inline-flex; gap: 8px; align-items: baseline; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); font-size: 14px; }
.cov-pill .num { font-size: 15px; }
.archived { margin-top: 16px; }
.archived summary { padding: 10px 2px; color: var(--ink-2); cursor: pointer; }
.version { margin-top: 18px; text-align: center; font-size: 13px; color: var(--ink-3); }
.whoami { font-size: 15px; color: var(--ink-2); margin: 2px 0 14px; }
.page-scroll > .btn-block { margin-top: 12px; }
.page-foot { padding: 16px 0 8px; }
.month-nav { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px; background: var(--surface); border-bottom: 1px solid var(--line); font-family: var(--num); font-size: 19px; font-weight: 700; }

/* Totaux */
.totals { display: flex; flex-direction: column; gap: 10px; }
.total-card { padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.total-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.total-card h3 { font-size: 16px; font-weight: 600; }
.total-diff { font-family: var(--num); font-size: 19px; font-weight: 700; color: var(--ink-2); }
.tone-over .total-diff { color: var(--warn); }
.tone-even .total-diff { color: var(--ok); }
.total-figures { margin: 4px 0 10px; font-size: 15px; color: var(--ink-2); }
.total-figures strong { font-family: var(--num); font-size: 30px; font-weight: 700; color: var(--ink); }
.meter { position: relative; height: 10px; border-radius: 5px; background: #E1E6E2; }
.meter-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--slate); }
.tone-over .meter-fill { background: var(--warn); }
.meter-target { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); }
.total-details { margin-top: 9px; font-size: 14px; color: var(--ink-2); }

/* Réglages */
.rule-mode { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 2px 0 14px; margin-bottom: 14px; border-bottom: 1px dashed var(--line); font-size: 14px; color: var(--ink-2); }
.section .field + .rule-mode { margin-top: 8px; }
.section > .field, .section > .time-pair, .section > .switch { margin-bottom: 14px; }
.break-rules { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.break-rule { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 15px; }
.break-rule input { width: 76px; height: 42px; }
.break-rules .btn { align-self: flex-start; }

/* Historique */
.audit-row { display: flex; gap: 12px; padding: 10px 14px; }
.audit-when { width: 90px; flex: none; font-family: var(--num); font-size: 14px; color: var(--ink-2); }
.audit-what { display: flex; flex-direction: column; font-size: 15px; }
.audit-what small { font-size: 13px; color: var(--ink-3); }

/* États vides et chargement */
.empty { padding: 44px 20px; text-align: center; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-title { font-size: 18px; font-weight: 600; color: var(--ink); }
.empty .btn { margin-top: 10px; }
.loading { height: 3px; overflow: hidden; position: relative; }
.loading-bar { position: absolute; top: 0; bottom: 0; width: 35%; background: var(--signal); animation: loading 1s ease-in-out infinite; }
@keyframes loading { from { left: -35%; } to { left: 100%; } }
.boot-error { padding: 40px 20px; text-align: center; display: flex; flex-direction: column; gap: 16px; align-items: center; }

/* ---------- Connexion ---------- */
.login-page { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 24px 16px; background: var(--slate); }
.login { width: 100%; max-width: 380px; padding: 28px 24px 24px; border-radius: 18px; background: var(--surface); }
.login h1 { font-family: var(--num); font-size: 34px; font-weight: 700; color: var(--slate); margin: 4px 0 20px; }
.login-mark { display: flex; flex-direction: column; gap: 6px; }
.login-mark span { display: block; height: 10px; border-radius: 4px; }
.login-mark span:nth-child(1) { width: 52%; background: var(--signal); }
.login-mark span:nth-child(2) { width: 70%; margin-left: 18%; background: linear-gradient(to right, var(--slate) 0 44%, transparent 44% 54%, var(--slate) 54%); }
.login-mark span:nth-child(3) { width: 48%; margin-left: 8%; background: #BDB5B3; }
.form-error { padding: 10px 12px; border-radius: 8px; background: var(--block-soft); color: #7C1F18; font-size: 15px; }
.login-help { margin-top: 16px; font-size: 14px; color: var(--ink-2); }


/* ---------- Autres pauses ---------- */
.bar-break-short { background-color: rgba(255,255,255,.12); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.55) 0 2px, transparent 2px 5px); }
.extras-box { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.extras-box > .btn { align-self: flex-start; }
.extra-row { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--field); }
.extra-dur { display: flex; align-items: center; gap: 6px; }
.extra-dur .seg { flex: 1; }

/* ---------- Arrivées ---------- */
.arrival { font-family: var(--num); font-weight: 600; }
.arrival-ok { color: var(--ok); }
.arrival-late { color: var(--warn); }
.arrival-missing { color: var(--block); }
.arrival-none { color: var(--ink-2); }
.arrival-mark {
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  z-index: 2;
  pointer-events: none;
  background: currentColor;
}
.arrival-mark::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}
.chip-arrival {
  position: absolute;
  top: 3px;
  right: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.ag-arrival { margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--ok); }
.arrivals-bar { background: var(--ok-soft); border-bottom: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.arrivals-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: #1E5C3C;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.arrivals-btn span:nth-child(2) { flex: 1; }
.arrivals-btn.has-missing { color: #7A3A0C; }
.arrivals-bar:has(.has-missing) { background: var(--warn-soft); }
.arrivals-count { font-family: var(--num); font-size: 17px; font-weight: 700; }
.arrivals-summary { font-size: 16px; color: var(--ink-2); margin-bottom: 12px; }
.arrivals-summary strong { font-family: var(--num); font-size: 22px; color: var(--ink); }
.arrival-status { font-family: var(--num); font-size: 15px; font-weight: 600; color: var(--ink-2); text-align: right; max-width: 45%; }
.arrival-status.arrival-ok { color: var(--ok); }
.arrival-status.arrival-late { color: var(--warn); }
.arrival-status.arrival-missing { color: var(--block); }
.page-intro { margin-bottom: 14px; }

/* ---------- QR code ---------- */
.qr-box { display: flex; justify-content: center; padding: 18px; margin-bottom: 8px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; }
.qr-svg { width: min(72vw, 300px); }
.qr-svg svg { display: block; width: 100%; height: auto; }
.qr-url { font-size: 13px; color: var(--ink-3); word-break: break-all; text-align: center; margin-bottom: 14px; }

/* ---------- Semaines types ---------- */
.tpl-list { display: flex; flex-direction: column; gap: 8px; }
.tpl-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
}
.tpl-item .row-end { color: var(--slate); font-family: var(--font); font-size: 14px; }
.tpl-detail { display: flex; flex-direction: column; gap: 12px; }
.tpl-detail h3 { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.tpl-detail h3::first-letter { text-transform: uppercase; }
.tpl-detail ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tpl-detail li { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.tpl-detail li span:nth-child(2) { flex: 1; }
.tpl-detail small { color: var(--ink-3); font-size: 12px; }

/* ---------- Page de pointage (employé) ---------- */
.checkin { text-align: left; }
.checkin h1 { margin-bottom: 2px; }
.checkin-date { color: var(--ink-2); margin-bottom: 18px; }
.checkin-shift { font-size: 17px; margin: 14px 0 18px; }
.checkin-shift strong { font-family: var(--num); font-size: 22px; }
.checkin-shift span { color: var(--ink-2); }
.checkin-btn { min-height: 64px; font-size: 22px; border-radius: 14px; margin-bottom: 12px; }
.checkin-done { padding: 18px 16px; border-radius: 14px; background: var(--ok-soft); color: #1E5C3C; text-align: center; }
.checkin-done strong { font-size: 19px; }
.checkin-done.is-new .checkin-tick { animation: pop .35s ease-out; }
.checkin-tick { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-bottom: 8px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 30px; }
.checkin-late { color: var(--warn); font-weight: 600; }
.checkin .notice, .checkin .form-error { margin: 12px 0; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }


/* ---------- Heure saisissable au clavier ---------- */
.stepper-input {
  width: 100%;
  min-width: 0;
  height: 54px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font-family: var(--num);
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stepper-input:focus { outline: none; background: var(--signal-soft); box-shadow: none; }
.stepper-value { cursor: text; }
.time-small { width: 76px !important; height: 42px !important; text-align: center; font-family: var(--num); font-size: 17px !important; }
.short-rule { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--field); }
.short-rule > input { height: 42px; }

/* ---------- Noms et absences cliquables dans le planning ---------- */
button.lane-name, button.wk-name {
  border-top: 0;
  border-left: 0;
  border-bottom: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
button.wk-name { border-bottom: 1px solid var(--line-2); }
button.lane-name:active, button.wk-name:active { background: var(--field); }
.lane-absence, .wk-absence { cursor: pointer; }
.person-head { display: flex; align-items: center; gap: 14px; }
.avatar-big { width: 52px; height: 52px; font-size: 18px; }
.person-week { margin-top: 4px; font-size: 15px; color: var(--ink-2); }
.person-week strong { font-family: var(--num); font-size: 19px; color: var(--ink); }
.row-danger .row-title, .row-danger .row-icon { color: var(--block); }
.chip-big { height: 42px; padding: 0 16px; font-size: 15px; }


/* ---------- Logo ---------- */
.splash { display: grid; place-items: center; height: 100vh; height: 100dvh; background: var(--surface); }
.splash img { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.94); opacity: .8; } }
.login-logo { display: block; width: 88px; height: 88px; margin: 0 0 6px -4px; }
.brand img { display: block; width: 48px; height: 48px; }
.more-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 22px; }
.more-brand img { opacity: .9; }
.more-brand .version { margin-top: 0; }
.empty-logo { width: 56px; height: 56px; opacity: .28; filter: grayscale(1); margin-bottom: 4px; }

.plan-body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.date-title { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }


/* ---------- Création / modification d'un horaire (appui long 2 s sur le titre) ---------- */
.hold-title { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; background-image: linear-gradient(var(--signal), var(--signal)); background-repeat: no-repeat; background-position: 0 100%; background-size: 0 3px; padding-bottom: 3px; }
.hold-title.is-holding { background-size: 100% 3px; transition: background-size 2s linear; }
.track-box { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: #FFF8EC; font-size: 14px; }
.track-box .btn { align-self: flex-start; margin-top: 4px; }
.history-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.history-list li { display: flex; gap: 10px; font-size: 14px; }
.history-when { width: 84px; flex: none; font-family: var(--num); color: var(--ink-2); }
.history-list small { display: block; color: var(--ink-3); font-size: 12px; }
.person-limit { margin-top: 8px; font-size: 13px; }


/* ---------- Installer l'application ---------- */
.install-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--signal) 35%, transparent);
  border-radius: 14px;
  background: var(--signal-soft);
  color: var(--ink);
  text-align: left;
}
.install-card img { border-radius: 11px; box-shadow: 0 1px 3px rgba(20,16,15,.2); }
.install-card .icon { color: var(--signal); }
.install-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.install-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; line-height: 1.4; }
.install-n { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--signal); color: #fff; font-weight: 700; }
.ios-share { display: inline-block; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; color: #0A84FF; }


/* ---------- Ligne de choix « Équipes › » et liste à cocher (style iOS) ---------- */
.picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 8px 12px 8px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}
.picker-label { font-size: 16px; font-weight: 600; }
.picker-value { flex: 1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 10px; font-size: 16px; color: var(--ink-2); }
.picker-team { display: inline-flex; align-items: center; gap: 6px; }
.picker-row > .icon { color: var(--ink-3); }
.check-picker { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: var(--surface); }
.check-picker li + li { border-top: 1px solid var(--line-2); }
.check-picker li:first-child { border-bottom: 1px solid var(--line); }
.check-picker-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 0 14px; border: 0; background: none; color: var(--ink); font-size: 17px; text-align: left; }
.check-picker-row:active { background: var(--field); }
.check-picker-label { flex: 1; }
.check-picker-mark { width: 24px; color: var(--signal); display: inline-flex; }
.remove-day { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line-2); }

/* ---------- Écrans larges ---------- */
@media (min-width: 560px) {
  .time-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .time-pair .stepper { flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media (min-width: 720px) {
  .sheet {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    width: min(560px, calc(100vw - 48px));
    max-height: 86vh;
    border-radius: 16px;
    padding-bottom: 0;
    transform: translate(-50%, -46%);
    opacity: 0;
    transition: transform .2s, opacity .2s;
  }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; }
  .sheet-grip { display: none; }
  .sheet-head { padding-top: 12px; }
  .sheet-foot .btn-primary, .sheet-foot .btn-danger { flex: none; }
  .sheet-foot { justify-content: flex-end; }
  .toasts { bottom: 20px; }
}

@media (min-width: 900px) {
  :root { --name-w: 190px; }
  .shell { grid-template-columns: 92px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .tabbar {
    grid-column: 1;
    grid-row: 1;
    flex-direction: column;
    gap: 4px;
    padding: 14px 0;
    border-top: 0;
    border-right: 1px solid var(--line);
  }
  .main { grid-column: 2; grid-row: 1; }
  .brand { display: flex; justify-content: center; padding: 4px 0 16px; }
  .tab { flex: none; height: 70px; }
  .tab[aria-current="page"]::before { top: 50%; left: 0; width: 3px; height: 30px; margin-top: -15px; border-radius: 0 3px 3px 0; }
  .topbar { padding-left: 24px; padding-right: 20px; }
  .planning-top { padding-left: 14px; }
  .week-grid { grid-template-columns: var(--name-w) repeat(7, minmax(110px, 1fr)); }
  .mo-day { min-height: 104px; }
  .fab { right: 28px; bottom: 28px; }
}

@media (hover: hover) {
  .bar:hover { filter: brightness(1.06); }
  .chip-shift:hover { filter: brightness(1.06); }
  .row:hover { background: var(--field); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
