/* ───────────────────────────────────────────────────────────────
   Sales Suivi · ZM mobile · Étape 1
   Design system: minimal système — Dieter Rams (handoff Claude Design)
   Hairline 1px · B&W · accent rouge réservé aux états critiques
   ─────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --black: #0a0a0a;
  --ink: #1a1a1a;
  --ink-2: #404040;
  --ink-3: #737373;
  --ink-4: #a3a3a3;
  --ink-5: #d4d4d4;
  --ink-6: #e8e8e6;
  --paper: #fafaf9;
  --paper-2: #f4f4f2;
  --line: #d4d4d4;
  --line-strong: #1a1a1a;
  --warn: #b91c1c;
  --good: #166534;

  --tab-h: 64px;
  --header-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overscroll-behavior: none; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 1;
  font-size: 14px;
  line-height: 1.4;
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ─────────────── Layout (mobile) ─────────────── */
.app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  max-width: 480px;
  margin: 0 auto;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.screen {
  flex: 1;
  /* min-height: 0 essentiel : sans ça, en flexbox le child overflow:auto ne scrolle pas correctement sur iOS */
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Padding bottom très généreux pour iOS Safari : barre d'URL dynamique +
     home indicator + barre d'onglets fixe. Mieux vaut trop que pas assez. */
  padding: calc(18px + var(--safe-top)) 22px calc(var(--tab-h) + 120px + var(--safe-bottom));
  display: none;
  flex-direction: column;
  gap: 14px;
}
.screen.active { display: flex; }

/* ─────────────── Tabs (bottom nav) ─────────────── */
.tabs {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--paper);
  border-top: 2px solid var(--ink-5);
  display: flex;
  align-items: stretch;
  z-index: 50;
  max-width: 480px;
  margin: 0 auto;
  border-left: 1px solid var(--ink-5);
  border-right: 1px solid var(--ink-5);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
}
.tab {
  flex: 1;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-4);
  letter-spacing: 0.04em;
  transition: color .12s;
  padding-top: 8px;
}
.tab .icon {
  width: 22px; height: 22px;
  display: grid; place-items: center;
}
.tab .icon svg { width: 22px; height: 22px; stroke-width: 1.5; }
.tab.active { color: var(--ink); }
.tab.active .icon svg { stroke-width: 1.75; }
.tab:disabled { opacity: 0.3; }
/* Make sure clicks on inner elements always reach the parent button.
   Aggressive: ALL descendants (icons, svg, spans, text wrappers, anything) ignore pointer
   events so the parent button receives the click no matter where the user taps. */
.tab *, .btn *, .tag *, .seg-btn button *, .famille-row *, .lines-add * { pointer-events: none; }

/* ─────────────── Page header pattern ─────────────── */
.head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-shrink: 0;
}
.head .greet {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.head .greet small {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 400;
  margin-top: 3px;
  letter-spacing: 0;
}

/* ─────────────── Primitives ─────────────── */
.label {
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

.num-display {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1;
}
.num-md { font-size: 24px; font-weight: 400; letter-spacing: -0.02em; line-height: 1; }
.num-sm { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; line-height: 1; }

.muted { color: var(--ink-3); }
.tiny { font-size: 11px; }
.sm { font-size: 13px; }
.bold { font-weight: 600; }
.mono { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.04em; }
.display-h {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

/* Cards */
.card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  padding: 14px;
}
.card.soft { background: var(--paper-2); }
.card.flush { padding: 0; overflow: hidden; }

/* Buttons */
.btn {
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 12px 16px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.01em;
  transition: background .12s, border-color .12s;
  min-height: 44px; /* iOS touch target */
  cursor: pointer;
  /* iOS Safari: 'manipulation' disables 300ms double-tap delay
     and zoom-on-double-tap so taps register as immediate clicks */
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}
.btn:hover { border-color: var(--ink); }
.btn:active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary:active { background: var(--black); }
.btn.ghost { border-color: transparent; background: transparent; }
/* FR/EN locale toggle (CM + GSM headers) */
.btn.ghost.lang-toggle { border: 1px solid var(--line); border-radius: 4px; color: var(--ink-3); background: transparent; }
.btn.ghost.lang-toggle.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.block { width: 100%; }
.btn.icon-only { padding: 12px; aspect-ratio: 1; }
.btn:disabled { opacity: 0.4; pointer-events: none; }

/* Inputs */
.input, textarea.input, select.input {
  font-size: 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 12px 14px;
  border-radius: 4px;
  width: 100%;
  color: var(--ink);
  display: block;
  min-height: 44px;
  transition: border-color .12s;
  -webkit-appearance: none;
  appearance: none;
}
.input:focus, textarea.input:focus, select.input:focus { outline: none; border-color: var(--ink); }
.input.empty { color: var(--ink-3); }
textarea.input { min-height: 80px; resize: none; line-height: 1.4; }

.field { display: flex; flex-direction: column; gap: 6px; }

/* Tags / pills */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  background: var(--paper);
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background .12s, border-color .12s, color .12s;
}
.tag:hover { border-color: var(--ink); }
.tag.solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tag.warn { color: var(--warn); border-color: var(--warn); }
.tag.good { color: var(--good); border-color: var(--good); }
.tag.tiny { font-size: 10px; padding: 2px 8px; }
.tag.dot::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chips.scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}
.chips.scroll::-webkit-scrollbar { display: none; }
.chips .tag { flex-shrink: 0; padding: 6px 12px; font-size: 12px; }

/* List rows */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: none; }

/* Progress bar */
.bar {
  height: 2px;
  background: var(--ink-6);
  position: relative;
  overflow: hidden;
  border-radius: 1px;
}
.bar > i {
  display: block;
  height: 100%;
  background: var(--ink);
  font-style: normal;
  transition: width .3s ease-out;
}

.divider { height: 1px; background: var(--line); border: none; margin: 0; }

/* Checkbox */
.check {
  width: 18px; height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.check.on { background: var(--ink); border-color: var(--ink); }
.check.on::after {
  content: '';
  width: 9px; height: 5px;
  border: 1.5px solid var(--paper);
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* Brand mark in headers (simplified shield) */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand .shield {
  width: 16px; height: 20px;
  background: var(--ink);
  clip-path: polygon(50% 0, 100% 18%, 100% 70%, 50% 100%, 0 70%, 0 18%);
  flex-shrink: 0;
}
.brand .name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
}
.brand .name small {
  display: block;
  font-weight: 400;
  font-size: 8px;
  color: var(--ink-3);
  letter-spacing: 0.15em;
  margin-top: 2px;
}

/* ─────────────── Segmented button (Commande/Pipe, FR/EN) ─────────────── */
.seg-btn {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper);
  /* Empêche le collapse en flexbox sur iOS — la flex parent (.screen) ne doit jamais
     compresser ce composant à 0 de hauteur */
  flex-shrink: 0;
  min-height: 44px;
}
.seg-btn button {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background .12s, color .12s;
  min-height: 44px;
  border-right: 1px solid var(--line);
}
.seg-btn button:last-child { border-right: none; }
.seg-btn button.on {
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}
.seg-btn button:not(.on):active {
  background: var(--paper-2);
  color: var(--ink);
}

/* ─────────────── Quantity stepper ─────────────── */
.qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.qty .num {
  font-family: 'Inter', sans-serif;
  font-size: 38px;
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1;
  min-width: 60px;
  text-align: center;
}
.qty .btn { width: 44px; padding: 10px 0; }

/* ─────────────── Toast / feedback ─────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + 32px + var(--safe-bottom));
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  z-index: 100;
  opacity: 0;
  transition: transform .2s ease-out, opacity .2s;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(0,0,0,.05);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─────────────── Modal sheet ─────────────── */
.sheet-bg {
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,.4);
  z-index: 80;
  display: none;
  opacity: 0;
  transition: opacity .15s;
}
.sheet-bg.show { display: block; opacity: 1; }
.sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  padding: 18px 22px calc(22px + var(--safe-bottom));
  z-index: 90;
  transform: translateY(100%);
  transition: transform .2s ease-out;
}
.sheet.show { transform: translateY(0); }

.modal-card {
  display: flex;
  flex-direction: column;
}
.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 8px;
}
.modal-body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* Banner (home reminder) */
.banner-warn:active {
  background: var(--paper) !important;
}

/* ─────────────── Empty state ─────────────── */
.empty-state {
  text-align: center;
  padding: 28px 0;
  color: var(--ink-3);
  font-size: 13px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--paper-2);
}

/* ─────────────── Modal sheet (early-send) ──────────────
/* ─────────────── Famille list (sale screen) ─────────────── */
.famille-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper);
}
.famille-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--paper);
  border: none;
  border-bottom: 1px solid var(--line);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  width: 100%;
  min-height: 48px;
  transition: background .12s;
}
.famille-row > * { pointer-events: none; }
.famille-row:last-child { border-bottom: none; }
.famille-row:active { background: var(--paper-2); }
.famille-row.on { background: var(--paper-2); font-weight: 600; }
.famille-radio {
  width: 18px; height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  background: var(--paper);
}
.famille-row.on .famille-radio {
  border-color: var(--ink);
  background: var(--ink);
}
.famille-row.on .famille-radio::after {
  content: '';
  position: absolute;
  top: 4px; left: 4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--paper);
}
.famille-name { flex: 1; }

/* ─────────────── Multi-line sale table ─────────────── */
.lines-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper);
}
.lines-header,
.lines-row {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 1.1fr 32px;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid var(--line);
}
.lines-header {
  background: var(--paper-2);
  padding: 8px 0;
}
.lines-header > div {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  font-weight: 600;
  padding: 2px 10px;
}
.lines-row .input,
.lines-row select.input {
  border: none;
  border-radius: 0;
  border-right: 1px solid var(--line);
  min-height: 44px;
  font-size: 13px;
  padding: 10px 10px;
  background: var(--paper);
}
.lines-row select.input { padding-right: 22px; }
.lines-row .input:last-of-type { border-right: none; }
.lines-row .input:focus { background: var(--paper-2); }
.lines-row .lines-remove {
  border: none;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 16px;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}
.lines-row .lines-remove:active { background: var(--paper-2); color: var(--warn); }
.lines-row:last-child { border-bottom: none; }
.lines-add {
  width: 100%;
  border: none;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink-2);
  padding: 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 0;
  min-height: 44px;
}
.lines-add:active { background: var(--ink-6); color: var(--ink); }

/* ─────────────── Plan action card (richer form) ─────────────── */
.action-form {
  background: var(--paper-2);
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.action-form .label {
  margin-bottom: 0;
}

/* Toggle row (escalate checkbox) */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  padding: 8px 0;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  text-align: left;
  width: 100%;
}
.toggle-row .check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Action meta (deadline chips + escalation badge below action title) */
.action-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  align-items: center;
}
.action-meta .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  letter-spacing: 0.06em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink-3);
}
.action-meta .badge.escalate { color: var(--warn); }

/* ─────────────── Splash + Login ─────────────── */
.splash {
  position: fixed;
  inset: 0;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 200;
}
.splash-shield {
  width: 32px; height: 40px;
  background: var(--ink);
  clip-path: polygon(50% 0, 100% 18%, 100% 70%, 50% 100%, 0 70%, 0 18%);
}
.splash-logo {
  width: 180px;
  height: auto;
  display: block;
  border-radius: 4px;
}
.splash-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.2;
  color: var(--ink-3);
}
.splash-name small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.22em;
  margin-top: 0;
}

.login-screen {
  position: fixed;
  inset: 0;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 28px;
  max-width: 480px;
  margin: 0 auto;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  z-index: 100;
  overflow-y: auto;
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.login-brand .shield {
  width: 28px; height: 36px;
  background: var(--ink);
  clip-path: polygon(50% 0, 100% 18%, 100% 70%, 50% 100%, 0 70%, 0 18%);
}
.login-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.login-sub {
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 24px;
}
.login-error {
  background: #fef2f2;
  border: 1px solid var(--warn);
  color: var(--warn);
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.4;
}
.login-hint {
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
  margin-top: 16px;
  line-height: 1.5;
}

/* CM screen (placeholder before étape 2.3) */
.cm-screen {
  position: fixed;
  inset: 0;
  background: var(--paper);
  padding: 28px;
  max-width: 480px;
  margin: 0 auto;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  z-index: 80;
  overflow-y: auto;
}

/* ─────────────── CM dashboard — charts + bars ─────────────── */
.progress-track {
  position: relative;
  height: 10px;
  background: var(--ink-6);
  border-radius: 1px;
  overflow: hidden;
}
.progress-track > .fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: var(--ink);
  transition: width .3s ease-out;
}
.progress-track.tall { height: 18px; }
.progress-track .fill.warn { background: var(--warn); }
.progress-track .fill.good { background: var(--good); }

.bar-row {
  display: grid;
  grid-template-columns: 60px 1fr 80px;
  gap: 10px;
  align-items: center;
  font-size: 11px;
  margin-bottom: 4px;
}
.bar-row .lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--ink-3);
}
.bar-row .val {
  font-size: 11px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.zm-mini-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.status-pills {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.status-pill {
  font-size: 10px;
  letter-spacing: 0.06em;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.status-pill.ok { color: var(--good); border-color: var(--good); background: #f0f9f4; }
.status-pill.ko { color: var(--warn); border-color: var(--warn); background: #fef2f2; }

.overdue-card {
  border-left: 3px solid var(--warn);
  background: #fef9f2;
  padding: 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
}
.overdue-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  font-family: inherit;
  width: 100%;
}
.overdue-row:last-child { border-bottom: none; }
.overdue-row > * { pointer-events: none; }
.overdue-row .ovd-meta {
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--warn);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 2px;
}

/* ─────────────── CM screen — typographie agrandie ─────────────── */
.cm-screen { padding: 22px; }
.cm-screen .display-h { font-size: 24px !important; }
.cm-screen .label { font-size: 11px; letter-spacing: 0.14em; }
.cm-screen .tiny { font-size: 12px; }
.cm-screen .sm { font-size: 14px; }
.cm-screen .num-sm { font-size: 18px; }
.cm-screen .num-md { font-size: 28px; }
.cm-screen .num-display { font-weight: 400; }
.cm-screen .bar-row { grid-template-columns: 70px 1fr 110px; }
.cm-screen .bar-row .lbl { font-size: 11px; letter-spacing: 0.14em; }
.cm-screen .bar-row .val { font-size: 13px; font-weight: 500; }
.cm-screen .status-pill { font-size: 11px; padding: 4px 10px; letter-spacing: 0.06em; }
.cm-screen .progress-track { height: 12px; }
.cm-screen .progress-track.tall { height: 22px; }
.cm-screen .tag.tiny { font-size: 11px; padding: 3px 9px; }

/* Pace indicator (on track / behind / ahead) */
.pace-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-top: 8px;
}
.pace-row .pace-meta { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pace-row .pace-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid;
}
.pace-row .pace-tag.ahead { color: var(--good); border-color: var(--good); background: #f0f9f4; }
.pace-row .pace-tag.behind { color: var(--warn); border-color: var(--warn); background: #fef2f2; }
.pace-row .pace-tag.ontrack { color: var(--ink-3); border-color: var(--line); background: var(--paper-2); }

/* Marker on month progress bar showing expected % */
.month-track {
  position: relative;
  height: 14px;
  background: var(--ink-6);
  border-radius: 1px;
  overflow: hidden;
}
.month-track > .fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: var(--ink);
}
.month-track > .marker {
  position: absolute;
  top: -4px; bottom: -4px;
  width: 2px;
  background: var(--warn);
}
.month-track > .marker::after {
  content: 'attendu';
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warn);
  white-space: nowrap;
}

/* ─────────────── GSM budget table ─────────────── */
.budget-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.budget-table thead {
  background: var(--paper-2);
}
.budget-table th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.budget-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.budget-table tr:last-child td { border-bottom: none; }
.budget-table tr.totals { background: var(--paper-2); }
.budget-input {
  width: 100%;
  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  background: var(--paper);
  -webkit-appearance: none;
  appearance: none;
  min-height: 36px;
  touch-action: manipulation;
}
.budget-input:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--paper-2);
}


/* GSM tabs spacing — bottom padding so the last cards aren't hidden by the tab bar */
#s-gsm { padding-bottom: 84px; }

/* GSM tabs — force visible when body has gsm-active class (set by JS) */
body.gsm-active #tabs-gsm { display: flex !important; }
body:not(.gsm-active) #tabs-gsm { display: none !important; }


/* ── GSM single-page section dividers ── */
.section-divider {
  margin: 32px -16px 18px;
  padding: 14px 16px 8px;
  border-top: 2px solid var(--ink-5);
  background: linear-gradient(180deg, rgba(0,0,0,0.04) 0%, transparent 100%);
}
.section-divider .section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-divider .section-num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0;
}
#s-gsm { padding-bottom: 32px; }


/* GSM hub tiles — nice hover and shadow */
.hub-tile { transition: transform 0.12s, box-shadow 0.12s; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.hub-tile:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

/* Logo Peugeot Motocycles officiel */
.brand-logo {
  height: 28px;
  width: auto;
  display: block;
  border-radius: 3px;
}
.login-logo {
  width: 200px;
  height: auto;
  display: block;
  margin: 0 auto 8px;
  border-radius: 4px;
}
