/* groscot.css — design commun des apps *.groscot.fr (direction « Console »).
   Chargé par chaque app depuis https://home.groscot.fr/static/groscot.css.
   Clair uniquement. Polices : Geist (texte) et Geist Mono (chiffres). */

@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap");

:root {
  --g-bg: #fafafa;
  --g-surface: #ffffff;
  --g-subtle: #f5f5f5;
  --g-border: #e5e5e5;
  --g-border-soft: #f0f0f0;
  --g-text: #171717;
  --g-text-2: #525252;
  --g-muted: #737373;
  --g-faint: #a3a3a3;
  --g-accent: #4f46e5;
  --g-accent-bg: #eef2ff;
  --g-green: #16a34a;
  --g-green-ink: #15803d;
  --g-green-bg: #dcfce7;
  --g-red: #dc2626;
  --g-red-ink: #b91c1c;
  --g-amber: #f59e0b;
  --g-amber-bg: #fff7ed;
  --g-amber-border: #fed7aa;
  --g-amber-ink: #7c2d12;
  --g-radius: 12px;
  --g-font: Geist, system-ui, -apple-system, "Segoe UI", sans-serif;
  --g-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.g { margin: 0; background: var(--g-bg); color: var(--g-text); font-family: var(--g-font); line-height: 1.45; }
.g a { color: inherit; }
.g-mono { font-family: var(--g-mono); font-variant-numeric: tabular-nums; }
.g-muted { color: var(--g-muted); }
.g-faint { color: var(--g-faint); }
.g-small { font-size: 12px; }
.g-up { color: var(--g-green-ink); }
.g-down { color: var(--g-red-ink); }

/* ---------- En-tête commun (rendu par header.js) ---------- */
.g-header { background: var(--g-surface); border-bottom: 1px solid var(--g-border); }
.g-header-in { max-width: 1200px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 10px 24px; }
.g-logo { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; text-decoration: none; }
.g-nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.g-nav::-webkit-scrollbar { display: none; }
.g-nav a { text-decoration: none; padding: 6px 10px; border-radius: 8px; color: var(--g-text-2); font-size: 14px; white-space: nowrap; }
.g-nav a:hover { background: var(--g-subtle); }
.g-nav a.active { background: var(--g-subtle); color: var(--g-text); font-weight: 600; }
.g a.g-avatar, .g-avatar { color: #fff; }
.g-avatar { width: 32px; height: 32px; flex: none; border-radius: 8px; background: var(--g-text); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; text-decoration: none; }

/* ---------- Mise en page ---------- */
.g-page { max-width: 1200px; margin: 0 auto; padding: 28px 24px 64px; display: flex; flex-direction: column; gap: 16px; }
.g-cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.g-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.g-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.g-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.g-h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; flex: 1; }
.g-eyebrow { font-family: var(--g-mono); font-size: 12px; color: var(--g-muted); }

/* ---------- Cartes ---------- */
.g-card { background: var(--g-surface); border: 1px solid var(--g-border); border-radius: var(--g-radius); padding: 18px; }
.g-card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 600; margin-bottom: 12px; }
.g-card-title .g-muted { font-weight: 400; font-size: 13px; }

/* Rangée d'indicateurs : les filets sont faits par le gap sur fond gris. */
.g-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--g-border); border: 1px solid var(--g-border); border-radius: var(--g-radius); overflow: hidden; }
.g-kpi { background: var(--g-surface); padding: 16px 18px; min-width: 0; }
.g-kpi-label { font-size: 12px; color: var(--g-muted); }
.g-kpi-value { font-family: var(--g-mono); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.g-kpi-value.big { font-size: 40px; letter-spacing: -0.04em; line-height: 1.1; }
.g-kpi-value .unit { font-size: 0.45em; color: var(--g-muted); margin-left: 2px; }
.g-kpi-text { font-size: 17px; font-weight: 600; margin-top: 6px; }
.g-kpi-sub { font-family: var(--g-mono); font-size: 11px; color: var(--g-muted); margin-top: 2px; }

/* Tuiles d'apps (accueil) */
.g-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.g-tile { background: var(--g-surface); border: 1px solid var(--g-border); border-radius: var(--g-radius); padding: 18px; min-height: 160px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; text-decoration: none; }
.g-tile:hover { border-color: var(--g-faint); }
.g-tile-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.g-tile-value { font-family: var(--g-mono); font-size: 36px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.1; }
.g-tile-sub { font-family: var(--g-mono); font-size: 12px; color: var(--g-muted); }

/* ---------- Pastilles ---------- */
.g-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--g-faint); flex: none; }
.g-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--g-border); background: var(--g-surface); border-radius: 6px; padding: 4px 8px; font-family: var(--g-mono); font-size: 12px; white-space: nowrap; }
.g-chip .g-dot { width: 6px; height: 6px; }

/* ---------- Boutons ---------- */
.g-btn { appearance: none; border: 1px solid var(--g-border); background: var(--g-surface); color: var(--g-text); border-radius: 10px; padding: 11px 14px; font: 500 14px var(--g-font); cursor: pointer; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
.g-btn:hover { border-color: var(--g-faint); }
.g-btn:disabled { opacity: 0.5; cursor: default; }
.g-btn-primary { background: var(--g-text); border-color: var(--g-text); color: #fff; font-weight: 600; }
.g-btn-primary:hover { background: #262626; }
.g-btn-danger { background: var(--g-red); border-color: var(--g-red); color: #fff; font-weight: 600; }
.g-btn-block { width: 100%; }
.g-btn-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }

/* Choix segmenté */
.g-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--g-subtle); border-radius: 9px; padding: 3px; gap: 2px; }
.g-seg button { appearance: none; border: 0; border-radius: 7px; padding: 8px 10px; background: transparent; font: 500 13px var(--g-font); color: var(--g-text-2); cursor: pointer; min-height: 36px; }
.g-seg button.active { background: var(--g-surface); color: var(--g-text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
.g-seg.mono button { font-family: var(--g-mono); font-size: 12px; }

/* ---------- Formulaires ---------- */
.g-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.g-input { border: 1px solid var(--g-border); border-radius: 9px; padding: 11px 12px; font: 15px var(--g-font); color: var(--g-text); background: var(--g-surface); min-height: 44px; }
.g-input:focus, .g-btn:focus-visible, .g-seg button:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 1px; }
.g-input.mono { font-family: var(--g-mono); }
.g-check { display: flex; align-items: center; gap: 10px; font-size: 14px; min-height: 36px; }
.g-check input { width: 18px; height: 18px; accent-color: var(--g-text); }

/* ---------- Frise / légende ---------- */
.g-strip { position: relative; height: 28px; border-radius: 6px; background: var(--g-subtle); overflow: hidden; }
.g-strip > span { position: absolute; top: 0; bottom: 0; }
.g-axis { display: flex; justify-content: space-between; font-family: var(--g-mono); font-size: 10px; color: var(--g-faint); margin-top: 4px; }
.g-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; color: var(--g-text-2); margin-top: 10px; }
.g-legend span { display: inline-flex; align-items: center; gap: 6px; }
.g-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; }

/* ---------- Listes ---------- */
.g-rows { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 16px; row-gap: 9px; font-family: var(--g-mono); font-size: 13px; }
.g-rows > :nth-child(odd) { color: var(--g-muted); }
.g-kv { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 14px; row-gap: 8px; font-size: 13px; }
.g-kv .g-mono { text-align: right; }
.g-table-wrap { overflow-x: auto; }
.g-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.g-table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--g-muted); padding: 10px 12px; border-bottom: 1px solid var(--g-border); white-space: nowrap; }
.g-table td { padding: 12px; border-bottom: 1px solid var(--g-border-soft); vertical-align: middle; }
.g-table tr:last-child td { border-bottom: 0; }
.g-table .num { text-align: right; font-family: var(--g-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Bandeaux ---------- */
.g-note { border-radius: 10px; padding: 10px 14px; font-size: 14px; border: 1px solid transparent; }
.g-note.warn { background: var(--g-amber-bg); border-color: var(--g-amber-border); color: var(--g-amber-ink); }
.g-note.info { background: var(--g-accent-bg); color: #312e81; }
.g-note.error { background: #fef2f2; border-color: #fecaca; color: var(--g-red-ink); }

/* ---------- Téléphone ---------- */
@media (max-width: 640px) {
  .g-header-in { padding: 10px 14px; gap: 8px 12px; }
  .g-logo { font-size: 16px; }
  .g-nav a { padding: 6px 8px; font-size: 13px; }
  .g-page { padding: 16px 14px 48px; gap: 12px; }
  .g-cols { gap: 12px; }
  .g-main, .g-side { gap: 12px; }
  .g-h1 { font-size: 22px; }
  .g-card { padding: 14px; }
  .g-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-kpi { padding: 12px 14px; }
  .g-kpi-value.big { font-size: 34px; }
  .g-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .g-tile { min-height: 124px; padding: 14px; }
  .g-tile-value { font-size: 28px; }
}
