/* MegaOnboard — feuille de style unique.
   Plat, sans degrade, sans ombre portee decorative.
   Les chiffres d'heures sont en chasse tabulaire partout : c'est le contenu
   principal de l'app et les colonnes doivent s'aligner. */

:root {
  --ink: #14161a;
  --ink-2: #3d4249;
  --muted: #6c7278;
  --line: #e1e4e8;
  --line-strong: #c9ced6;
  --paper: #f2f3f5;
  --surface: #ffffff;
  --brand: #d8262c;
  --brand-dark: #a81c21;
  --live: #0e8a57;
  --live-soft: #e6f4ee;
  --warn: #b06a00;
  --warn-soft: #fdf3e3;
  --danger: #c0261e;
  --danger-soft: #fceceb;

  --r: 4px;
  --gap: 20px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

h1, h2, h3 { margin: 0 0 12px; line-height: 1.2; letter-spacing: -0.015em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 12px; }

/* ------------------------------------------------------------- coquille */

.topbar {
  background: var(--ink);
  color: #fff;
  border-bottom: 3px solid var(--brand);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 56px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .dot {
  width: 9px; height: 9px;
  background: var(--brand);
  display: inline-block;
}

.nav {
  display: flex;
  gap: 2px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
  color: #b9bec6;
  padding: 8px 11px;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: var(--r);
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.nav a.on { color: #fff; background: rgba(255,255,255,.14); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 26px 20px 64px; }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 4px;
}

/* ---------------------------------------------------------------- cartes */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  margin-bottom: var(--gap);
}
.card.tight { padding: 0; }
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-body { padding: 18px; }

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; }
.stat .v { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; }
.stat .sub { font-size: 12.5px; color: var(--muted); }

/* --------------------------------------------------------------- boutons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  border-radius: var(--r);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--paper); text-decoration: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); }
.btn-danger { color: var(--danger); border-color: #e8bfbc; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-huge {
  width: 100%;
  padding: 26px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
  border-radius: var(--r);
}

/* ----------------------------------------------------------- formulaires */

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--ink-2); }
.field { margin-bottom: 15px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=datetime-local], input[type=time], input[type=url],
input[type=tel], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  font: inherit;
  font-size: 14.5px;
  background: #fff;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
textarea.code { font-family: var(--mono); font-size: 13.5px; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; }

.check { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; font-weight: 450; color: var(--ink); }
.check input { margin-top: 3px; width: auto; }
.check label { margin: 0; font-weight: 450; }

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { margin-bottom: 0; }

fieldset { border: 0; padding: 0; margin: 0 0 26px; }
legend { padding: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; color: var(--muted); }

/* --------------------------------------------------------------- tableaux */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-weight: 650;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

/* --------------------------------------------------------------- pastilles */

.tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 650;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  background: var(--paper);
  white-space: nowrap;
}
.tag-live { color: var(--live); background: var(--live-soft); border-color: #b9e0cd; }
.tag-warn { color: var(--warn); background: var(--warn-soft); border-color: #f0d7a8; }
.tag-danger { color: var(--danger); background: var(--danger-soft); border-color: #f0c4c1; }
.tag-brand { color: #fff; background: var(--brand); border-color: var(--brand); }

.dot-live {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--live); display: inline-block;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* ----------------------------------------------------------------- alertes */

.alert {
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--ink);
  border-radius: var(--r);
  margin-bottom: 16px;
  font-size: 14px;
  background: var(--surface);
}
.alert-success { border-left-color: var(--live); background: var(--live-soft); border-color: #b9e0cd; }
.alert-error { border-left-color: var(--danger); background: var(--danger-soft); border-color: #f0c4c1; }
.alert-warn { border-left-color: var(--warn); background: var(--warn-soft); border-color: #f0d7a8; }

.secret-box {
  border: 1px solid var(--warn);
  background: var(--warn-soft);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.secret-box .row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; align-items: center; }
.secret-box code {
  font-family: var(--mono);
  font-size: 15px;
  background: #fff;
  border: 1px solid var(--line-strong);
  padding: 3px 8px;
  border-radius: 3px;
  user-select: all;
}

/* ------------------------------------------------- signature : horloge */

.clock-card {
  background: var(--ink);
  color: #fff;
  border-radius: var(--r);
  padding: 30px 24px;
  text-align: center;
  margin-bottom: var(--gap);
  border: 1px solid var(--ink);
}
.clock-card.on-shift { border-color: var(--live); }
.clock-time {
  font-size: clamp(52px, 15vw, 84px);
  font-weight: 250;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.clock-time .sec { font-size: .42em; font-weight: 400; color: #7f858d; margin-left: 4px; letter-spacing: 0; }
.clock-date { color: #9aa0a8; font-size: 13px; margin-top: 10px; text-transform: capitalize; }
.clock-status {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.14);
  display: flex;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;
  font-size: 13px;
}
.clock-status .k { color: #8b9198; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.clock-status .v { font-size: 19px; font-weight: 600; margin-top: 2px; }

/* --------------------------------------- signature : ruban de la semaine */

.ribbon { display: flex; gap: 4px; align-items: flex-end; height: 96px; margin: 6px 0 12px; }
.ribbon-day { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; text-align: center; }
.ribbon-bar {
  background: var(--line);
  border-radius: 2px 2px 0 0;
  min-height: 3px;
  transition: none;
}
.ribbon-bar.has { background: var(--ink); }
.ribbon-bar.today { background: var(--brand); }
.ribbon-label { font-size: 10.5px; color: var(--muted); margin-top: 6px; text-transform: uppercase; letter-spacing: .05em; }
.ribbon-hours { font-size: 11px; font-weight: 650; color: var(--ink-2); margin-bottom: 4px; height: 14px; }

/* ------------------------------------------ signature : echelle d'etapes */

.ladder { list-style: none; margin: 0; padding: 0; }
.ladder li {
  position: relative;
  padding: 0 0 0 46px;
  border-bottom: 1px solid var(--line);
}
.ladder li:last-child { border-bottom: 0; }
.ladder li::before {
  content: attr(data-n);
  position: absolute;
  left: 14px;
  top: 18px;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.ladder li.done::before {
  content: "✓";
  background: var(--live);
  border-color: var(--live);
  color: #fff;
  font-size: 12px;
}
.ladder li.failed::before { background: var(--danger); border-color: var(--danger); color: #fff; }
.ladder li.skipped::before { opacity: .45; }
.ladder li::after {
  content: "";
  position: absolute;
  left: 24.5px;
  top: 40px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.ladder li:last-child::after { display: none; }

.step { padding: 16px 18px 16px 0; }
.step-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.step-title { font-weight: 600; font-size: 15px; }
.step.is-done .step-title { color: var(--muted); }
.step-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.step-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.step-result {
  margin-top: 10px;
  font-size: 13px;
  padding: 8px 11px;
  border-radius: 3px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.step-result.ok { background: var(--live-soft); border-color: #b9e0cd; }
.step-result.ko { background: var(--danger-soft); border-color: #f0c4c1; }

/* ------------------------------------------------------------- progression */

.bar { height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--ink); }
.bar.full > span { background: var(--live); }

/* ------------------------------------------------------------------ borne */

.kiosk {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  padding: 24px;
}
.kiosk-panel { width: 100%; max-width: 380px; color: #fff; text-align: center; }
.kiosk-panel h1 { font-size: 18px; font-weight: 550; color: #9aa0a8; margin-bottom: 22px; }
.pin-display {
  font-family: var(--mono);
  font-size: 40px;
  letter-spacing: .32em;
  height: 56px;
  margin-bottom: 20px;
  color: #fff;
}
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button {
  aspect-ratio: 1.5;
  font-size: 24px;
  font-weight: 400;
  background: #23262b;
  color: #fff;
  border: 1px solid #33373d;
  border-radius: var(--r);
  cursor: pointer;
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
}
.keypad button:active { background: #2e3238; }
.keypad button.go { background: var(--brand); border-color: var(--brand); font-size: 15px; font-weight: 650; }
.keypad button.clr { font-size: 15px; color: #9aa0a8; }

.kiosk-result { padding: 20px; border-radius: var(--r); margin-bottom: 22px; text-align: left; }
.kiosk-result.in { background: var(--live); color: #fff; }
.kiosk-result.out { background: #23262b; color: #fff; border: 1px solid #33373d; }
.kiosk-result.err { background: var(--brand); color: #fff; }
.kiosk-result .big { font-size: 21px; font-weight: 650; margin-bottom: 3px; }

.kiosk-roster { margin-top: 26px; font-size: 12.5px; color: #7f858d; text-align: left; }
.kiosk-roster div { padding: 4px 0; border-bottom: 1px solid #23262b; display: flex; justify-content: space-between; }

/* ------------------------------------------------------------------ divers */

.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
.right { text-align: right; }
.mt { margin-top: 16px; }
.mb0 { margin-bottom: 0; }
.nowrap { white-space: nowrap; }
.stack > * + * { margin-top: 12px; }

.empty {
  padding: 38px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 5px; }

.prose { max-width: 68ch; line-height: 1.65; }
.prose h2 { margin: 28px 0 10px; font-size: 18px; }
.prose h3 { margin: 22px 0 8px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 14px; }
.prose li { margin-bottom: 6px; }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--paper); padding: 1px 5px; border-radius: 3px; }
.prose > *:first-child { margin-top: 0; }

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--paper);
}
.login-card { width: 100%; max-width: 380px; }
.login-mark {
  font-size: 20px; font-weight: 700; letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 9px; margin-bottom: 22px;
}
.login-mark .dot { width: 11px; height: 11px; background: var(--brand); }

.footnote { margin-top: 40px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ---------------------------------------------------------------- mobile */

@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4, .grid-sidebar { grid-template-columns: minmax(0, 1fr); }
  .topbar-inner { padding: 8px 14px; gap: 10px; }
  .nav { margin-left: 0; width: 100%; padding-bottom: 4px; }
  .wrap { padding: 18px 14px 56px; }
  h1 { font-size: 22px; }
  .card { padding: 15px; }
  th, td { padding: 9px 10px; }
}

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

@media print {
  .topbar, .btn, .no-print { display: none !important; }
  body { background: #fff; }
  .card { border-color: #999; break-inside: avoid; }
}
