/* Démonstrateur Dentalsoft — feuille de style de la coquille : jetons de design, éléments communs (boutons,
   champs, pilules, barre latérale, cartes, connexion). Ce qui est propre à un onglet est dans son dossier :
   app/transcription/static/transcription.css, app/bi/static/bi.css. */
:root {
  color-scheme: light;
  --bg: #f3f5f7; --surface: #ffffff; --surface-2: #f8fafb; --sunken: #eef1f4;
  --ink: #101828; --ink-2: #475467; --muted: #667085; --hairline: #e4e7ec; --border: #d0d5dd;
  --accent: #0e7490; --accent-ink: #0b5c73; --accent-soft: #e0f2f7; --accent-soft-2: #c7e7ef; --on-accent: #ffffff;
  --ok: #067647; --ok-soft: #e6f4ee; --warn: #b54708; --warn-soft: #fdf1e2; --critical: #b42318; --critical-soft: #fdecec;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-2: 0 4px 12px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .06);
  --radius: 12px; --radius-s: 8px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* graphiques : palette catégorielle validée (8 crans, ordre fixe) */
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #4a3aa7; --series-8: #e34948;
  --grid: #e4e7ec; --baseline: #c9cfd8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f141a; --surface: #171d24; --surface-2: #1c232c; --sunken: #11171d;
    --ink: #eaeef3; --ink-2: #b6bfca; --muted: #8590a0; --hairline: #262f3a; --border: #34404d;
    --accent: #22a7c6; --accent-ink: #5fc6de; --accent-soft: #123a47; --accent-soft-2: #174c5c; --on-accent: #071a20;
    --ok: #3fbf7f; --ok-soft: #122b21; --warn: #e8a34a; --warn-soft: #33250f; --critical: #f0716b; --critical-soft: #3a1b1a;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 4px 14px rgba(0, 0, 0, .45);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
    --grid: #262f3a; --baseline: #3d4956;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent-ink); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--radius-s); border: 1px solid var(--border); background: var(--surface); color: var(--ink); font-weight: 500; font-size: 13.5px; transition: background .12s, border-color .12s, transform .05s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--sunken); color: var(--ink); }
.btn.danger { color: var(--critical); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn .ico { width: 16px; height: 16px; flex: none; }

/* ---------- champs ---------- */
.field-ctl, select, input[type="text"], input[type="password"], textarea { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 8px 11px; color: var(--ink); transition: border-color .12s, box-shadow .12s; }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; }
textarea { resize: vertical; line-height: 1.55; }
label.lbl { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; letter-spacing: .01em; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- pilules & badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--sunken); color: var(--ink-2); border: 1px solid var(--hairline); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; } .pill.ok::before { background: var(--ok); }
.pill.busy { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; } .pill.busy::before { background: var(--accent); animation: pulse 1.2s infinite; }
.pill.err { background: var(--critical-soft); color: var(--critical); border-color: transparent; } .pill.err::before { background: var(--critical); }
.pill.none::before { display: none; }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12.5px; font-weight: 500; }

/* ---------- coque : barre latérale + contenu ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--hairline); display: flex; flex-direction: column; padding: 18px 14px; gap: 6px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), #1fa8a0); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; letter-spacing: -.02em; box-shadow: var(--shadow-1); }
.brand .name { font-weight: 650; font-size: 14px; line-height: 1.2; }
.brand .sub { font-size: 11.5px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .tab { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; border: none; background: transparent; color: var(--ink-2); font-weight: 500; text-align: left; }
.nav .tab:hover { background: var(--sunken); color: var(--ink); }
.nav .tab.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav .tab .ico { width: 18px; height: 18px; flex: none; }
.side-section { margin-top: 18px; padding: 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.side-status { padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.side-status .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); } .dot.err { background: var(--critical); } .dot.busy { background: var(--accent); animation: pulse 1.2s infinite; }
.side-foot { margin-top: auto; padding: 10px 6px 0; border-top: 1px solid var(--hairline); display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
main.content { min-width: 0; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.topbar { height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 28px; border-bottom: 1px solid var(--hairline); background: var(--surface); }
.topbar h1 { font-size: 16px; }
.topbar .desc { color: var(--muted); font-size: 13px; }
.topbar .spacer { flex: 1; }
.topbar .ctl { display: flex; align-items: center; gap: 8px; }
.topbar .ctl select { width: 300px; height: 36px; padding: 6px 32px 6px 11px; }
/* Chaque onglet occupe la hauteur restante sous la barre ; seule sa zone .panel défile. */
.panel-root { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.panel { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

/* ---------- cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card > .head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--hairline); }
.card > .head h2 { font-size: 14px; display: flex; align-items: center; gap: 10px; }
.card > .head .spacer { flex: 1; }
.card > .body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.step { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.help { color: var(--muted); font-size: 12.5px; line-height: 1.5; }

/* ---------- messages (communs aux deux onglets) ---------- */
.alert { padding: 10px 12px; border-radius: var(--radius-s); font-size: 13px; }
.alert.err { background: var(--critical-soft); color: var(--critical); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.mobile-only { display: none; }

/* ---------- connexion ---------- */
body.login { display: grid; place-items: center; background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 60%), var(--bg); }
.login-card { width: min(420px, calc(100vw - 32px)); padding: 30px 30px 26px; display: flex; flex-direction: column; gap: 16px; }
.login-card .brand { padding: 0 0 4px; }
.login-card h1 { font-size: 20px; }
.login-card .lead { color: var(--ink-2); }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card .btn { height: 40px; justify-content: center; }
.login-card .foot { font-size: 12px; color: var(--muted); text-align: center; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100vh; }
  .sidebar { flex-direction: row; align-items: center; padding: 10px 14px; border-right: none; border-bottom: 1px solid var(--hairline); }
  .sidebar .brand { padding: 0; } .sidebar .side-section, .sidebar .side-status { display: none; } .side-foot { margin: 0 0 0 auto; border: none; padding: 0; }
  .nav { flex-direction: row; margin-left: 10px; }
  .sidebar { position: relative; }
  .mobile-only { display: inline-flex; }
  main.content { height: auto; overflow: visible; }
  .panel-root, .panel { overflow: visible; min-height: auto; }
  .topbar { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 10px; } .topbar .ctl select { width: 100%; }
}

