/* RiLoShyft — système de design
   Outil de gestion du temps : dense, lisible, sobre.
   La couleur porte du sens (statut, alerte) ; elle ne décore jamais. */

/* ---------- Jetons ---------- */
:root {
  color-scheme: light;

  /* Gris de travail */
  --canvas:        #F6F7F9;
  --surface:       #FFFFFF;
  --surface-2:     #FBFBFC;
  --surface-sunken:#F2F3F5;
  --border:        #E3E6EA;
  --border-strong: #CFD4DA;

  --text:    #14181F;
  --text-2:  #4B5563;
  --text-3:  #6B7280;
  --text-4:  #7E8692;

  /* Accent unique */
  --accent:        #1F5FD0;
  --accent-hover:  #1A51B4;
  --accent-soft:   #EEF3FD;
  --accent-border: #C3D6F6;
  --on-accent:     #FFFFFF;

  /* Sémantique — versions sourdes, lisibles sur fond clair */
  --ok:        #17663D;
  --ok-bg:     #ECF7F0;
  --ok-border: #BFE3CE;
  --warn:        #8A5407;
  --warn-bg:     #FDF6E9;
  --warn-border: #F0DCB4;
  --danger:        #A32219;
  --danger-bg:     #FDF0EF;
  --danger-border: #F2CBC7;
  --neutral-bg:    #F0F1F3;

  /* Repères de secteur — désaturés, utilisables côte à côte */
  --c1: #3C6DB8; --c2: #4A7C59; --c3: #B07B32; --c4: #8A5A8F;
  --c5: #4E7F8C; --c6: #A45A4E; --c7: #6C6F86; --c8: #7A8B3C;

  --r-xs: 3px;
  --r-sm: 5px;
  --r:    7px;
  --r-lg: 9px;
  --r-xl: 12px;

  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-2: 0 4px 12px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-3: 0 16px 40px rgba(16, 24, 40, .16);

  --ease: cubic-bezier(.4, 0, .2, 1);

  --sidebar-w: 236px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  font-variant-numeric: tabular-nums;
}

img { display: block; max-width: 100%; }
svg { display: block; flex: none; }
/* Toute icône sans règle dédiée s'aligne sur la taille du texte. */
:where(.pill, .list-row, .stat, .k-line, td, th) > svg { width: 1em; height: 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 20px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }

::selection { background: var(--accent-soft); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-radius: var(--r-xs);
}

/* ---------- Structure ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  padding: 0 0 12px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 40;
  transition: transform .2s var(--ease);
  overflow-y: auto;
}

.brand {
  display: flex; align-items: center; gap: 9px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  font-weight: 700; font-size: 13px;
  flex: none;
}
.brand-name { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.brand-sub  { font-size: 11px; color: var(--text-3); }

nav { padding: 0 8px; }

.nav-group-label {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-3);
  padding: 14px 8px 5px;
}

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 13.5px; font-weight: 500;
  transition: background .12s var(--ease), color .12s var(--ease);
  position: relative;
}
.nav-item:hover { background: var(--surface-sunken); color: var(--text); text-decoration: none; }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.nav-item.active::before {
  content: ''; position: absolute; left: -8px; top: 6px; bottom: 6px;
  width: 2px; border-radius: 0 2px 2px 0; background: var(--accent);
}
.nav-icon { width: 16px; height: 16px; flex: none; opacity: .75; }
.nav-item.active .nav-icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-xs);
  background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 600;
  display: grid; place-items: center;
}

.sidebar-footer {
  margin-top: auto; padding: 12px 8px 0;
  border-top: 1px solid var(--border);
}

.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: var(--r-sm);
  transition: background .12s var(--ease);
  width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left;
}
.user-chip:hover { background: var(--surface-sunken); text-decoration: none; }

.avatar {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; color: #fff;
  background: var(--text-3); flex: none;
}
.avatar.lg { width: 40px; height: 40px; font-size: 14px; border-radius: var(--r); }
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; border-radius: var(--r-xs); }
.avatar svg { width: 13px; height: 13px; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  min-height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 16px; font-weight: 600; }
.topbar-sub { font-size: 12.5px; color: var(--text-3); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; }

.content { padding: 20px 24px 56px; max-width: 1400px; width: 100%; }

.menu-toggle { display: none; }

/* ---------- Cartes ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.card-pad { padding: 16px; }
.card-head {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.card-head svg { width: 15px; height: 15px; color: var(--text-3); flex: none; }
.card-head h3 { font-size: 13px; font-weight: 600; color: var(--text); }
.card-head .spacer { margin-left: auto; }

.grid { display: grid; gap: 12px; }
.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,2fr) minmax(300px,1fr); }

.section-title {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .07em;
  margin: 22px 0 9px;
}

/* ---------- Indicateurs ---------- */
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 13px 15px;
}
.stat-label {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .05em;
}
.stat-value {
  font-size: 25px; font-weight: 600; letter-spacing: -0.02em;
  margin-top: 5px; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat-meta { font-size: 12px; color: var(--text-3); margin-top: 3px; }
/* L'icône décorative est retirée : elle n'apportait pas d'information. */
.stat-icon { display: none; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  transition: background .12s var(--ease), border-color .12s var(--ease);
  white-space: nowrap;
  text-decoration: none;
  box-shadow: var(--shadow-1);
}
.btn:hover { background: var(--surface-sunken); text-decoration: none; }
.btn:active { background: var(--border); }
.btn svg { width: 15px; height: 15px; flex: none; }

.btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:active { background: var(--accent-hover); }

.btn-danger  { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover  { filter: brightness(.93); background: var(--danger); }
.btn-success { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn-success:hover { filter: brightness(.93); background: var(--ok); }

.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-sunken); }
.btn-outline { background: transparent; }
.btn-outline:hover { background: var(--surface-sunken); }

.btn-lg { padding: 8px 16px; font-size: 14px; }
.btn-sm { padding: 4px 9px; font-size: 12.5px; }
.btn-icon { padding: 6px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint, .hint { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.card > .hint, .card-pad > .hint { display: block; margin-top: 2px; }

.input, .select, .textarea {
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  transition: border-color .12s var(--ease), box-shadow .12s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath fill='none' stroke='%236B7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 5 5.5l4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  width: 38px; height: 22px; border-radius: 11px;
  background: var(--border-strong);
  position: relative;
  transition: background .16s var(--ease);
  flex: none;
}
.switch-track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-1);
  transition: transform .16s var(--ease);
}
.switch input:checked + .switch-track { background: var(--ok); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }

.segmented {
  display: inline-flex; padding: 2px; gap: 2px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.segmented a, .segmented button {
  padding: 4px 11px; border-radius: var(--r-xs); border: 0; background: transparent;
  font-size: 12.5px; font-weight: 500; color: var(--text-2); cursor: pointer;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.segmented a:hover, .segmented button:hover { color: var(--text); text-decoration: none; }
.segmented .on {
  background: var(--surface); color: var(--text); font-weight: 600;
  box-shadow: var(--shadow-1);
}

/* ---------- Tableaux et listes ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-3);
  padding: 9px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { font-variant-numeric: tabular-nums; text-align: right; }
.table-wrap { overflow-x: auto; }

.list-row {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .12s var(--ease);
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); text-decoration: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.list-sub { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }

/* ---------- Étiquettes de statut ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 7px; border-radius: var(--r-xs);
  font-size: 11.5px; font-weight: 600;
  background: var(--neutral-bg); color: var(--text-2);
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill svg { width: 12px; height: 12px; }
.pill-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.pill-green  { background: var(--ok-bg);     color: var(--ok);     border-color: var(--ok-border); }
.pill-orange { background: var(--warn-bg);   color: var(--warn);   border-color: var(--warn-border); }
.pill-red    { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.pill-blue   { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
.pill-purple { background: var(--neutral-bg); color: var(--text-2); }

/* ---------- État vide ---------- */
.empty { padding: 40px 22px; text-align: center; }
.empty-icon {
  width: 34px; height: 34px; margin: 0 auto 10px;
  display: grid; place-items: center;
  color: var(--text-4);
}
.empty-icon svg { width: 22px; height: 22px; }
.empty h4 { font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.empty p { font-size: 12.5px; color: var(--text-3); max-width: 330px; margin: 0 auto; }

/* ---------- Pointeuse ---------- */
.punch-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 20px;
  position: relative;
}
/* Un liseré vertical indique l'état : neutre à l'arrêt, vert en service. */
.punch-hero::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--border-strong);
  border-radius: var(--r) 0 0 var(--r);
}
.punch-hero.running::before { background: var(--ok); }

.punch-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .05em;
}
.punch-hero.running .punch-status { color: var(--ok); }
.punch-timer {
  font-size: 40px; font-weight: 600; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; margin: 6px 0 2px;
  line-height: 1.1; color: var(--text);
}
.punch-meta { font-size: 13px; color: var(--text-3); }
.punch-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.punch-hero .input, .punch-hero .select { max-width: 200px; }

.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok); display: inline-block; flex: none;
  animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .3 } }

/* ---------- Barre de progression ---------- */
.bar { height: 5px; border-radius: 3px; background: var(--surface-sunken); overflow: hidden; border: 1px solid var(--border); }
.bar > i { display: block; height: 100%; background: var(--accent); transition: width .3s var(--ease); }

/* ---------- Planning ---------- */
.planner { overflow-x: auto; }
.planner-grid {
  display: grid;
  grid-template-columns: 180px repeat(7, minmax(124px, 1fr));
  min-width: 940px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.planner-cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; min-height: 84px; }
.planner-grid > *:nth-child(8n) { border-right: 0; }
.planner-head {
  position: sticky; top: 0;
  background: var(--surface-2);
  padding: 8px 11px; min-height: 0;
  font-size: 11px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .05em;
  z-index: 2;
}
.planner-head .d { font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; text-transform: none; }
.planner-head.today { background: var(--accent-soft); }
.planner-head.today .d { color: var(--accent); }
.planner-name {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 11px; min-height: 84px;
  background: var(--surface-2);
}
.planner-name .n { font-size: 13px; font-weight: 600; }
.planner-name .s { font-size: 11.5px; color: var(--text-3); }

.shift-chip {
  display: block; width: 100%;
  border-radius: var(--r-xs); padding: 5px 7px; margin-bottom: 4px;
  font-size: 11.5px; text-align: left;
  border: 1px solid var(--border); border-left-width: 3px;
  cursor: pointer;
  background: var(--surface-2); color: var(--text);
  transition: background .12s var(--ease);
}
.shift-chip:hover { background: var(--surface-sunken); }
.shift-chip .t { font-weight: 600; font-variant-numeric: tabular-nums; }
.shift-chip .s { color: var(--text-3); font-size: 11px; margin-top: 1px; }
.shift-chip.open {
  border-style: dashed; border-color: var(--warn-border); border-left-color: var(--warn);
  background: var(--warn-bg);
}
.cell-add {
  width: 100%; border: 1px dashed var(--border-strong); background: transparent;
  border-radius: var(--r-xs); color: var(--text-4); font-size: 14px; padding: 2px;
  cursor: pointer; opacity: 0; transition: opacity .12s var(--ease), color .12s var(--ease);
}
.planner-cell:hover .cell-add { opacity: 1; }
.cell-add:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Fenêtre modale ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(16, 24, 40, .45);
  display: grid; place-items: center;
  padding: 20px;
  animation: fade .12s var(--ease);
}
.modal {
  width: 100%; max-width: 460px;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  border: 1px solid var(--border);
  max-height: 88vh; overflow-y: auto;
}
.modal-head { padding: 18px 20px 6px; }
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-head p { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.modal-body { padding: 12px 20px 4px; }
.modal-foot {
  padding: 14px 20px; display: flex; gap: 8px; justify-content: flex-end;
  border-top: 1px solid var(--border); margin-top: 12px; background: var(--surface-2);
}
@keyframes fade { from { opacity: 0 } }

/* ---------- Notification passagère ---------- */
.toasts {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  padding: 9px 14px; border-radius: var(--r-sm);
  background: var(--text); color: var(--canvas);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-2);
  display: flex; align-items: center; gap: 8px;
  max-width: 380px;
  animation: toast-in .16s var(--ease);
  border-left: 3px solid transparent;
}
.toast.err { background: var(--danger); color: #fff; border-left-color: rgba(255,255,255,.5); }
.toast.ok  { border-left-color: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px) } }

/* ---------- Connexion ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: var(--canvas);
}
.auth-card {
  width: 100%; max-width: 372px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  padding: 26px 26px 22px;
}
.auth-card .brand { border-bottom: 0; padding: 0 0 18px; margin-bottom: 0; }
.auth-card h1 { font-size: 19px; margin-bottom: 4px; }
.auth-card .lead { font-size: 13px; color: var(--text-3); margin-bottom: 20px; }

.alert {
  padding: 9px 12px; border-radius: var(--r-sm); font-size: 13px;
  margin-bottom: 14px; border: 1px solid transparent;
}
.alert-err { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.alert-ok  { background: var(--ok-bg);     border-color: var(--ok-border);     color: var(--ok); }
.alert-info{ background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }

.demo-creds {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-3); line-height: 1.7;
}
.demo-creds b { color: var(--text-2); font-weight: 600; }

/* ---------- Utilitaires ---------- */
.muted { color: var(--text-2); }
.dim   { color: var(--text-3); }
.small { font-size: 12.5px; }
.tnum  { font-variant-numeric: tabular-nums; }
.mono  { font-family: var(--mono); font-size: 12.5px; }
.strong{ font-weight: 600; }
.flex  { display: flex; align-items: center; gap: 9px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 11px; }
.wrap  { flex-wrap: wrap; }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:12px}.mt-3{margin-top:20px}
.mb-1{margin-bottom:8px}.mb-2{margin-bottom:12px}.mb-3{margin-bottom:20px}
.ml-auto{margin-left:auto}
.hide { display: none !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Adaptatif ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-3); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 14px; }
  .content { padding: 16px 14px 56px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .punch-timer { font-size: 34px; }
}

.scrim { position: fixed; inset: 0; background: rgba(16,24,40,.4); z-index: 35; }

/* ---------- Impression ---------- */
@media print {
  .sidebar, .topbar, .no-print, .toasts { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; font-size: 10.5px; color: #000; }
  .card, .planner-grid { box-shadow: none; border-color: #999; break-inside: avoid; }
  .planner-grid { min-width: 0; }
  .shift-chip { border: 1px solid #999; background: #fff; }
  .card-head, .table th, .planner-head, .planner-name { background: #f2f2f2 !important; }
  @page { size: A4 landscape; margin: 11mm; }
}

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

/* ---------- Documentation développeur ---------- */
.doc { max-width: 860px; }
.doc h2 { font-size: 17px; margin: 30px 0 8px; scroll-margin-top: 72px; }
.doc h3 { font-size: 14px; margin: 20px 0 6px; }
.doc p, .doc li { font-size: 13.5px; line-height: 1.65; color: var(--text-2); }
.doc p { margin-bottom: 10px; }
.doc ul { padding-left: 18px; margin-bottom: 10px; }
.doc code {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--surface-sunken); border: 1px solid var(--border);
  padding: 1px 5px; border-radius: var(--r-xs); color: var(--text);
}
.doc .table { margin-bottom: 14px; }
.doc .table td:first-child code { white-space: nowrap; }

.code-wrap { position: relative; margin: 0 0 14px; }
.code-wrap pre.code { margin: 0; padding-right: 76px; }
pre.code {
  background: #14181F; color: #E3E7EE;
  border-radius: var(--r); padding: 14px 16px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
  overflow-x: auto; margin: 0 0 14px;
}
pre.code .c { color: #7E8692; }     /* commentaire */
pre.code .s { color: #9BCB8A; }     /* chaîne */
pre.code .k { color: #8FB4F0; }     /* clé JSON / mot-clé */
.code-copy {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,.08); color: #C7CDD6;
  border: 1px solid rgba(255,255,255,.14); border-radius: var(--r-xs);
  font: 500 11px/1 var(--font); padding: 5px 8px; cursor: pointer;
}
.code-copy:hover { background: rgba(255,255,255,.16); color: #fff; }
@media (max-width: 640px) {
  .code-wrap pre.code { padding-right: 16px; padding-top: 40px; }
}

.endpoint {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13px;
  padding: 10px 12px; margin: 6px 0 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm);
  overflow-x: auto; white-space: nowrap;
}
.verb {
  font: 700 10.5px/1 var(--font); letter-spacing: .04em;
  padding: 4px 6px; border-radius: var(--r-xs);
  background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-border);
}
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.toc a {
  font-size: 12.5px; padding: 4px 9px; border-radius: var(--r-xs);
  border: 1px solid var(--border); color: var(--text-2); background: var(--surface);
}
.toc a:hover { color: var(--text); background: var(--surface-sunken); text-decoration: none; }

.secret-box {
  font-family: var(--mono); font-size: 13px; word-break: break-all;
  background: var(--surface-sunken); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); padding: 12px 14px; margin: 10px 0;
  user-select: all;
}

/* ---------- Données mensuelles ---------- */
.alert-warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn); }
.alert .issues { margin: 6px 0 0; padding-left: 18px; }
.alert .issues li { margin: 2px 0; line-height: 1.5; }
.alert .issues a { color: inherit; text-decoration: underline; margin-left: 4px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-sunken); }
.table tfoot td { border-top: 1px solid var(--border-strong); background: var(--surface-sunken); font-variant-numeric: tabular-nums; }
.payroll-table td, .payroll-table th { white-space: nowrap; }
.file-list { display: flex; flex-direction: column; gap: 6px; }
.file-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text);
}
.file-row > div { flex: 1; min-width: 0; }
.file-row:hover { background: var(--surface-sunken); text-decoration: none; }
.file-row svg { width: 18px; height: 18px; flex: none; color: var(--text-3); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.steps p { margin-top: 4px; line-height: 1.55; }
.step-n {
  display: inline-grid; place-items: center; width: 24px; height: 24px; margin-bottom: 8px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 700; border: 1px solid var(--accent-border);
}
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; gap: 16px; } }
.crumb { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.crumb svg { width: 14px; height: 14px; }
@media (max-width: 640px) { .topbar-actions .hide-sm { display: none; } }
.file-row .file-formats { display: flex; gap: 4px; flex: none; }
.file-row .file-formats .btn { min-width: 50px; }
.file-all { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 4px; padding: 4px 2px; }
.file-all svg { width: 15px; height: 15px; }
@media (max-width: 640px) {
  .file-row { flex-wrap: wrap; }
  .file-row .file-formats { width: 100%; padding-left: 30px; }
}
