/* styles.css — Méridien Conseil · cockpit financier
   Système : IBM Plex Sans (texte) + IBM Plex Mono (chiffres tabulaires).
   Accent vert finance. Dense, lisible, fintech pro. Densité pilotable via --d. */

:root {
  /* Accent teal Luxgap (oklch) */
  --accent:        oklch(0.64 0.10 216);
  --accent-strong: oklch(0.52 0.11 224);
  --accent-soft:   oklch(0.96 0.028 210);
  --accent-line:   oklch(0.85 0.055 210);

  /* Sémantique */
  --pos:   oklch(0.58 0.11 164);   /* marge / positif */
  --pos-soft: oklch(0.95 0.04 164);
  --neg:   oklch(0.55 0.17 25);    /* déficit / retard */
  --neg-soft: oklch(0.95 0.045 25);
  --warn:  oklch(0.66 0.13 70);    /* à renégocier / à valider */
  --warn-soft: oklch(0.95 0.05 75);
  --info:  oklch(0.56 0.10 240);
  --info-soft: oklch(0.95 0.035 240);

  /* Neutres (teinte froide bleutée, alignée navy) */
  --bg:      oklch(0.975 0.005 250);
  --surface: #ffffff;
  --surface-2: oklch(0.984 0.004 250);
  --ink:     oklch(0.26 0.02 258);
  --ink-2:   oklch(0.44 0.018 256);
  --muted:   oklch(0.58 0.014 256);
  --faint:   oklch(0.72 0.01 256);
  --border:  oklch(0.92 0.006 252);
  --border-2: oklch(0.88 0.008 252);

  /* Sidebar navy (couleur du logo) */
  --nav-bg:    oklch(0.255 0.055 263);
  --nav-bg-2:  oklch(0.32 0.06 261);
  --nav-ink:   oklch(0.95 0.012 245);
  --nav-muted: oklch(0.70 0.035 250);
  --nav-active: oklch(0.66 0.10 214);

  /* Densité (--d : 0 compact, 1 standard, 2 confortable) */
  --d: 1;
  --pad: calc(10px + var(--d) * 4px);
  --row: calc(30px + var(--d) * 6px);
  --gap: calc(10px + var(--d) * 4px);
  --card-pad: calc(14px + var(--d) * 5px);
  --fs: calc(13px + var(--d) * 0.5px);

  --radius: 9px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(20,30,25,0.04), 0 1px 3px rgba(20,30,25,0.06);
  --shadow-lg: 0 8px 28px -8px rgba(20,40,30,0.18);
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--fs);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#root { height: 100%; }

/* icônes — taille de base */
.ico { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: middle; }

/* numérique tabulaire */
.num { font-family: var(--mono); font-feature-settings: "tnum" 1; letter-spacing: -0.01em; }
.pos { color: var(--accent-strong); }
.neg { color: var(--neg); }
.warn { color: var(--warn); }

/* ============ LAYOUT ============ */
.app { display: grid; grid-template-columns: auto 1fr; flex: 1; min-height: 0; }

/* bandeau démo */
.demo-shell { display: flex; flex-direction: column; height: 100%; }
.demo-banner {
  display: flex; align-items: center; gap: 16px; padding: 9px 20px; flex: none;
  background: linear-gradient(100deg, var(--nav-bg), var(--nav-bg-2) 60%, var(--accent-strong));
  color: #fff; font-size: 12.5px; border-bottom: 1px solid rgba(0,0,0,0.2); position: relative; overflow: hidden;
}
.demo-banner .db-tag {
  display: inline-flex; align-items: center; gap: 6px; flex: none; font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em; background: rgba(255,255,255,0.14); padding: 4px 10px; border-radius: 20px;
}
.demo-banner .db-text { flex: 1; line-height: 1.45; color: rgba(255,255,255,0.92); }
.demo-banner .db-text b { color: #fff; font-weight: 600; }
.demo-banner .db-feats { display: flex; gap: 7px; flex: none; flex-wrap: wrap; }
.demo-banner .db-feat { display: inline-flex; align-items: center; gap: 5px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.16); padding: 4px 9px; border-radius: 7px; font-size: 11px; white-space: nowrap; }
.demo-banner .db-feat .ico { width: 13px; height: 13px; opacity: .85; }
.demo-banner .db-cta { flex: none; background: #fff; color: var(--nav-bg); border: none; border-radius: 8px; padding: 7px 13px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.demo-banner .db-cta:hover { filter: brightness(0.95); }
.demo-banner .db-x { flex: none; background: rgba(255,255,255,0.12); border: none; color: #fff; width: 26px; height: 26px; border-radius: 7px; cursor: pointer; }
.demo-banner .db-x:hover { background: rgba(255,255,255,0.22); }
@media (max-width: 1280px) { .demo-banner .db-feats { display: none; } }

/* ---- Sidebar ---- */
.nav {
  width: 248px; background: var(--nav-bg); color: var(--nav-ink);
  display: flex; flex-direction: column; height: 100%;
  border-right: 1px solid rgba(0,0,0,0.2);
}
.nav-brand { padding: 18px 18px 14px; display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}
.brand-name { font-weight: 600; font-size: 14.5px; letter-spacing: -0.01em; }
.brand-sub { font-size: 10.5px; color: var(--nav-muted); margin-top: 1px; }
.nav-scroll { flex: 1; overflow-y: auto; padding: 6px 10px 10px; }
.nav-group-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--nav-muted); padding: 14px 10px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: 8px; border: none; background: none;
  color: var(--nav-muted); font: inherit; font-size: 13px; cursor: pointer;
  text-align: left; transition: background .12s, color .12s; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--nav-ink); }
.nav-item.active { background: var(--nav-bg-2); color: #fff; font-weight: 500; }
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px;
  background: var(--nav-active); border-radius: 0 3px 3px 0;
}
.nav-item .ico { width: 17px; height: 17px; flex: none; opacity: .9; }
.nav-item .nav-badge {
  margin-left: auto; font-family: var(--mono); font-size: 10.5px;
  background: var(--neg); color: #fff; padding: 1px 6px; border-radius: 10px; font-weight: 500;
}
.nav-item .nav-badge.amber { background: var(--warn); }

/* logo mark */
.brand-logo { width: 36px; height: 36px; flex: none; object-fit: contain; }
.brand-name-row { display: flex; align-items: baseline; gap: 6px; }
.brand-tag { font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--nav-active); font-weight: 600; margin-top: 2px; }

/* menus dépliables */
.nav-parent { }
.nav-item .chev { margin-left: auto; transition: transform .16s; opacity: .7; width: 15px; height: 15px; }
.nav-item.open .chev { transform: rotate(90deg); }
.nav-children { overflow: hidden; display: flex; flex-direction: column; padding-left: 8px; margin: 2px 0 4px; }
.nav-child {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 7px 10px 7px 18px; border: none; background: none; font: inherit; font-size: 12.5px;
  color: var(--nav-muted); cursor: pointer; border-radius: 7px; border-left: 1.5px solid rgba(255,255,255,0.1); margin-left: 8px;
}
.nav-child:hover { color: var(--nav-ink); background: rgba(255,255,255,0.04); }
.nav-child.active { color: #fff; font-weight: 500; border-left-color: var(--nav-active); }
.nav-child .cdot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; opacity: .55; }
.nav-child.active .cdot { opacity: 1; background: var(--nav-active); }
.nav-child .nav-badge { margin-left: auto; }

/* sélecteur d'exercice */
.year-select { position: relative; }
.year-btn {
  display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 11px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--ink); font-weight: 500;
}
.year-btn:hover { border-color: var(--faint); }
.year-btn .yr { font-family: var(--mono); }
.year-menu {
  position: absolute; top: calc(100% + 6px); right: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 230px; z-index: 50;
}
.year-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: none; background: none; font: inherit; cursor: pointer; border-radius: 7px; text-align: left; color: var(--ink); }
.year-opt:hover { background: var(--surface-2); }
.year-opt.on { background: var(--accent-soft); }
.year-opt .yv { font-family: var(--mono); font-weight: 600; font-size: 14px; width: 42px; }
.year-opt .yc { font-size: 10.5px; color: var(--muted); }
.year-opt .ycur { margin-left: auto; font-size: 9.5px; color: var(--accent-strong); font-weight: 600; }

/* bandeau lecture seule (exercice archivé) */
.ribbon {
  display: flex; align-items: center; gap: 10px; padding: 9px 16px; margin-bottom: var(--gap);
  background: oklch(0.96 0.04 75); border: 1px solid oklch(0.86 0.07 75); border-radius: var(--radius); font-size: 12.5px; color: oklch(0.42 0.09 60);
}
.ribbon b { color: oklch(0.34 0.1 55); }

/* Saisie rapide (menu) */
.quick { position: relative; }
.quick-menu {
  position: absolute; top: calc(100% + 8px); right: 0; width: 320px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 60;
}
.quick-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; padding: 8px 10px 4px; }
.quick-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: none; background: none; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; border-radius: 8px; text-align: left; }
.quick-item:hover { background: var(--surface-2); }
.quick-item .qi { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
.quick-item .qi.amber { background: var(--warn-soft); color: oklch(0.5 0.12 65); }
.quick-item .qsub { font-size: 10.5px; color: var(--muted); }
.dropzone {
  margin: 6px; padding: 16px; border: 1.5px dashed var(--border-2); border-radius: 10px; text-align: center;
  color: var(--muted); cursor: pointer; transition: all .14s; background: var(--surface-2);
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }

/* danger button */
.btn.danger { background: var(--neg); border-color: var(--neg); color: #fff; }
.btn.danger:hover { background: oklch(0.5 0.17 25); border-color: oklch(0.5 0.17 25); }

/* ====== TOASTS ====== */
.toast-stack { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 9px; z-index: 9000; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 11px; min-width: 320px; max-width: 460px;
  background: var(--ink); color: #fff; border-radius: 11px; padding: 11px 13px; box-shadow: var(--shadow-lg);
  animation: toastIn .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.toast .ti { width: 26px; height: 26px; border-radius: 7px; flex: none; display: grid; place-items: center; background: rgba(255,255,255,0.12); }
.toast.success .ti { background: var(--accent); }
.toast.warn .ti { background: var(--warn); }
.toast.error .ti { background: var(--neg); }
.toast .tt { font-size: 12.8px; font-weight: 500; }
.toast .td { font-size: 11px; color: rgba(255,255,255,0.7); margin-top: 1px; }
.toast-x { background: none; border: none; color: rgba(255,255,255,0.5); cursor: pointer; font-size: 12px; padding: 2px 4px; }
.toast-x:hover { color: #fff; }

/* ====== MODALS ====== */
.modal-overlay { position: fixed; inset: 0; background: oklch(0.2 0.02 258 / 0.42); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 8000; animation: fadeIn .15s; padding: 24px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 560px; max-width: 100%; max-height: 88vh; display: flex; flex-direction: column; animation: modalIn .2s cubic-bezier(.2,.8,.2,1); }
.modal.sm { width: 420px; }
.modal.lg { width: 720px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.modal-head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.modal-x { margin-left: auto; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 6px; }
.modal-x:hover { background: var(--surface-2); color: var(--ink); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 14px 14px; }
textarea.input { resize: vertical; font-family: inherit; }

/* ====== LUXGAP AI ====== */
.ai-trigger {
  display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 12.5px; font-weight: 500;
  padding: 8px 13px; border-radius: 8px; cursor: pointer; color: #fff; white-space: nowrap;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong)); border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(20,40,40,0.12);
}
.ai-trigger:hover { filter: brightness(1.06); }
.ai-trigger .spark-ico { width: 15px; height: 15px; }

.ai-overlay { position: fixed; inset: 0; background: oklch(0.2 0.02 258 / 0.25); z-index: 7000; animation: fadeIn .15s; }
.ai-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 92vw; background: var(--surface);
  border-left: 1px solid var(--border); box-shadow: -12px 0 40px -12px rgba(20,40,40,0.22); z-index: 7001;
  display: flex; flex-direction: column; animation: drawerIn .26s cubic-bezier(.2,.8,.2,1);
}
@keyframes drawerIn { from { transform: translateX(30px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.ai-head { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 11px; background: linear-gradient(120deg, var(--nav-bg), var(--nav-bg-2)); color: #fff; }
.ai-head .ai-logo { width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center; background: linear-gradient(120deg, var(--accent), var(--accent-strong)); }
.ai-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.ai-head .sub { font-size: 10.5px; color: rgba(255,255,255,0.65); margin-top: 1px; }
.ai-head .ai-x { margin-left: auto; background: rgba(255,255,255,0.12); border: none; color: #fff; width: 28px; height: 28px; border-radius: 7px; cursor: pointer; }
.ai-head .ai-x:hover { background: rgba(255,255,255,0.22); }
.ai-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ai-section-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; }
.ai-insight {
  border: 1px solid var(--border); border-radius: 11px; padding: 13px; background: var(--surface); cursor: pointer; transition: all .12s; text-align: left; width: 100%; font: inherit; display: block;
}
.ai-insight:hover { border-color: var(--accent-line); box-shadow: var(--shadow); }
.ai-insight .ih { display: flex; align-items: center; gap: 8px; }
.ai-insight .ibadge { width: 24px; height: 24px; border-radius: 7px; flex: none; display: grid; place-items: center; }
.ai-insight .it { font-size: 12.8px; font-weight: 600; color: var(--ink); }
.ai-insight .idesc { font-size: 11.8px; color: var(--ink-2); margin-top: 7px; line-height: 1.5; }
.ai-insight .imeta { font-size: 10.5px; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 6px; }

.ai-msg { display: flex; gap: 9px; }
.ai-msg.user { flex-direction: row-reverse; }
.ai-msg .am-ava { width: 26px; height: 26px; border-radius: 7px; flex: none; display: grid; place-items: center; font-size: 10px; font-weight: 600; }
.ai-msg.ai .am-ava { background: linear-gradient(120deg, var(--accent), var(--accent-strong)); color: #fff; }
.ai-msg.user .am-ava { background: var(--surface-2); color: var(--ink-2); }
.ai-bubble { font-size: 12.8px; line-height: 1.55; padding: 10px 13px; border-radius: 12px; max-width: 86%; white-space: pre-wrap; }
.ai-msg.ai .ai-bubble { background: var(--surface-2); color: var(--ink); border-top-left-radius: 4px; }
.ai-msg.user .ai-bubble { background: var(--accent-strong); color: #fff; border-top-right-radius: 4px; }
.ai-bubble strong { font-weight: 600; }
.ai-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.ai-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: blink 1.2s infinite both; }
.ai-typing span:nth-child(2) { animation-delay: .2s; }
.ai-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.ai-suggests { display: flex; flex-direction: column; gap: 7px; }
.ai-suggest { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 9px; padding: 9px 12px; font: inherit; font-size: 12px; color: var(--ink-2); cursor: pointer; display: flex; align-items: center; gap: 8px; }
.ai-suggest:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.ai-foot { padding: 12px; border-top: 1px solid var(--border); }
.ai-input-wrap { display: flex; align-items: flex-end; gap: 8px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 11px; padding: 8px 8px 8px 12px; }
.ai-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ai-input-wrap textarea { flex: 1; border: none; background: none; outline: none; font: inherit; font-size: 12.8px; resize: none; max-height: 90px; color: var(--ink); }
.ai-send { width: 32px; height: 32px; border-radius: 8px; border: none; background: var(--accent-strong); color: #fff; cursor: pointer; flex: none; display: grid; place-items: center; }
.ai-send:disabled { background: var(--border-2); cursor: default; }
.ai-disclaimer { font-size: 9.5px; color: var(--faint); text-align: center; margin-top: 7px; }
.nav-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,0.08); }
.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-user .avatar { background: var(--nav-bg-2); color: var(--nav-ink); }
.odoo-pill {
  display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--nav-muted);
  padding: 7px 10px; margin-bottom: 8px; background: rgba(255,255,255,0.04); border-radius: 7px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 3px rgba(120,200,160,0.18); }

/* ---- Main ---- */
.main { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 12px 22px;
  background: var(--surface); border-bottom: 1px solid var(--border); flex: none;
}
.topbar h1 { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.topbar .crumb { font-size: 11.5px; color: var(--muted); margin-bottom: 1px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 11px; width: 230px; color: var(--muted);
}
.search input { border: none; background: none; outline: none; font: inherit; font-size: 12.5px; color: var(--ink); width: 100%; }
.content { flex: 1; overflow-y: auto; padding: 22px; }
.content-inner { max-width: 1500px; margin: 0 auto; }

/* ---- Period selector ---- */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.seg button {
  border: none; background: none; font: inherit; font-size: 12px; padding: 5px 11px;
  border-radius: 6px; color: var(--muted); cursor: pointer; transition: all .12s;
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 500; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 12.5px;
  padding: 8px 13px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface);
  color: var(--ink); cursor: pointer; font-weight: 500; transition: all .12s; white-space: nowrap;
}
.btn:hover { border-color: var(--faint); background: var(--surface-2); }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn .ico { width: 15px; height: 15px; }

/* ============ CARDS / GRID ============ */
.grid { display: grid; gap: var(--gap); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: var(--card-pad); }
.card-head {
  display: flex; align-items: center; gap: 10px; padding: var(--card-pad);
  padding-bottom: calc(var(--card-pad) - 4px); border-bottom: 1px solid var(--border);
}
.card-head h3 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.card-head .sub { font-size: 11px; color: var(--muted); }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.section-title { font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; margin: 4px 0 2px; }

/* ---- KPI ---- */
.kpi { padding: var(--card-pad); position: relative; overflow: hidden; }
.kpi .label { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .value { font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: -0.03em; margin-top: 7px; color: var(--ink); white-space: nowrap; }
.kpi .value.sm { font-size: 19px; }
.kpi .meta { margin-top: 7px; display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.kpi .accent-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.kpi.is-neg .accent-bar { background: var(--neg); }
.kpi.is-warn .accent-bar { background: var(--warn); }

.delta { display: inline-flex; align-items: center; gap: 3px; font-family: var(--mono); font-size: 11.5px; font-weight: 500; padding: 1px 6px; border-radius: 6px; }
.delta.up { color: var(--accent-strong); background: var(--pos-soft); }
.delta.down { color: var(--neg); background: var(--neg-soft); }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500;
  padding: 2.5px 8px; border-radius: 20px; border: 1px solid transparent; white-space: nowrap;
}
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; }
.badge.green { background: var(--pos-soft); color: var(--accent-strong); }
.badge.green .bdot { background: var(--accent); }
.badge.red { background: var(--neg-soft); color: var(--neg); }
.badge.red .bdot { background: var(--neg); }
.badge.amber { background: var(--warn-soft); color: oklch(0.5 0.12 65); }
.badge.amber .bdot { background: var(--warn); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.badge.blue .bdot { background: var(--info); }
.badge.grey { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.badge.grey .bdot { background: var(--faint); }

/* ---- Tables ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl thead th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); font-weight: 600; padding: 9px var(--pad); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.tbl tbody td { padding: 0 var(--pad); height: var(--row); border-bottom: 1px solid var(--border); color: var(--ink-2); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .r { text-align: right; }
.tbl .strong { color: var(--ink); font-weight: 500; }
.tbl tr.clickable { cursor: pointer; }
.tbl-wrap { overflow: auto; }

th.r, td.r { text-align: right; }

/* avatar + client cell */
.avatar {
  width: 28px; height: 28px; border-radius: 7px; flex: none; display: grid; place-items: center;
  font-size: 11px; font-weight: 600; background: var(--accent-soft); color: var(--accent-strong);
}
.avatar.lg { width: 44px; height: 44px; border-radius: 11px; font-size: 16px; }
.cli-cell { display: flex; align-items: center; gap: 10px; }
.cli-cell .nm { font-weight: 500; color: var(--ink); }
.cli-cell .sub { font-size: 10.5px; color: var(--muted); }

/* progress / meters */
.meter { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; position: relative; }
.meter > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--accent); }
.meter.over > span { background: var(--neg); }
.meter-track { display: flex; align-items: center; gap: 9px; }
.meter-track .meter { flex: 1; }
.meter-track .lab { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }

/* mini bar chart */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.bars .bcol { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; position: relative; }
.bars .bseg { border-radius: 3px 3px 0 0; width: 100%; transition: opacity .12s; }
.bars .blabel { font-size: 9.5px; color: var(--muted); text-align: center; margin-top: 5px; }
.bars .bcol:hover .bseg { opacity: 0.78; }

/* legend */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.legend .li { display: flex; align-items: center; gap: 6px; }
.legend .sw { width: 9px; height: 9px; border-radius: 3px; }

/* alerts */
.alert-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px var(--card-pad); border-bottom: 1px solid var(--border); }
.alert-row:last-child { border-bottom: none; }
.alert-row .ai { width: 26px; height: 26px; border-radius: 7px; flex: none; display: grid; place-items: center; }
.alert-row .at { font-size: 12.5px; color: var(--ink); font-weight: 500; }
.alert-row .ad { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.alert-row .axn { margin-left: auto; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); }
.tabs button { border: none; background: none; font: inherit; font-size: 12.5px; padding: 9px 13px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--accent-strong); border-bottom-color: var(--accent); font-weight: 500; }
.tabs button:hover { color: var(--ink); }

/* inputs */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11px; color: var(--muted); font-weight: 500; }
.input, select.input {
  font: inherit; font-size: 12.5px; padding: 7px 10px; border: 1px solid var(--border-2);
  border-radius: 7px; background: var(--surface); color: var(--ink); outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* misc */
.muted { color: var(--muted); }
.flex { display: flex; align-items: center; gap: var(--gap); }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border); margin: 2px 0; }
hr.sep { border: none; border-top: 1px solid var(--border); margin: 0; }
.tag-key { font-size: 11px; color: var(--muted); }
.big-num { font-family: var(--mono); font-weight: 600; letter-spacing: -0.02em; }

.callout {
  display: flex; gap: 12px; padding: 13px 15px; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.callout.warn { background: var(--warn-soft); border-color: oklch(0.86 0.07 75); }
.callout .ci { flex: none; }
.callout .ct { font-size: 12.5px; color: var(--ink-2); }
.callout .ct b { color: var(--ink); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

@media (max-width: 1100px) {
  .nav { width: 64px; }
  .brand-name, .brand-sub, .nav-group-label, .nav-item span:not(.ico):not(.nav-badge), .odoo-pill span, .nav-user div { display: none; }
}
