/* Solstice Cockpit — V2.5 fidèle à docs/design/dashboard-reference.png.
   Blue-primary premium PSA theme, multi-accent (blue/teal/green/red/purple).
   No external asset: system font stacks + inline SVG sprite + inline SVG viz. */

:root {
  --bg: #0a0e17;
  --surface: #111725;
  --surface-2: #161d2e;
  --surface-3: #1d2537;
  --border: #212a3d;
  --border-soft: #1a2233;
  --border-hover: #2e3a52;
  --text: #eef2f8;
  --text-muted: #8793a8;
  --text-dim: #5c6880;

  /* primary + semantic accents (match the mockup) */
  --accent: #3b82f6;
  --accent-strong: #5c9dff;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --accent-line: rgba(59, 130, 246, 0.42);

  --blue: #4f8cff;
  --teal: #2dd4bf;
  --green: #34d399;
  --red: #f0555f;
  --amber: #f5a623;
  --purple: #a78bfa;
  --priority_purple: #a78bfa;

  /* dimension → color mapping */
  --live: #34d399;      /* en prod  → green */
  --active: #4f8cff;    /* actif    → blue */
  --paused: #f5a623;    /* en pause → amber */
  --shipped: #8793a8;   /* livré    → neutral */
  --archived: #6b7688;

  --healthy: #34d399;
  --at_risk: #f5a623;
  --blocked: #f0555f;
  --idle: #8793a8;

  --high: #f0555f;
  --medium: #f5a623;
  --low: #8793a8;

  --fresh: #34d399;
  --recent: #4f8cff;
  --aging: #f5a623;
  --stale: #f0555f;
  --cold: #8793a8;

  --font-body: "Segoe UI Variable Text", "Segoe UI", -apple-system,
    BlinkMacSystemFont, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", -apple-system,
    BlinkMacSystemFont, sans-serif;
  --font-data: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;

  --r-sm: 9px;
  --r: 12px;
  --r-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.28);

  --sidebar-w: 232px;
  --content-max: 1680px;
  /* Projet | Domaine | Activité | Statut | Santé | Avancement | menu */
  --row-cols: minmax(168px, 2.2fr) minmax(76px, 0.85fr) minmax(94px, 1fr) 96px 92px minmax(108px, 1.35fr) 34px;
  --row-gap: 13px;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* --- icons ------------------------------------------------------------- */

.ico {
  width: 18px; height: 18px;
  stroke: currentColor; stroke-width: 1.75; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0; vertical-align: -3px;
}
.ico.lg { width: 22px; height: 22px; }
.ico.sm { width: 15px; height: 15px; stroke-width: 1.9; }

.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--accent); color: #fff; font-weight: 600;
  padding: 9px 16px; border-radius: var(--r-sm); z-index: 100;
}
.skip-link:focus { left: calc(var(--sidebar-w) + 16px); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- app shell : full labelled sidebar + fluid centered content --------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  padding: 22px 16px 16px;
  background: #0b0f19;
  border-right: 1px solid var(--border);
  z-index: 50;
}

.brand-row { display: flex; align-items: center; gap: 11px; padding: 0 8px 4px; margin-bottom: 20px; }
.brand {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex-shrink: 0;
  color: #fff; border-radius: 50%;
  background: conic-gradient(from 210deg, var(--accent), var(--teal), var(--accent));
}
.brand .ico { width: 20px; height: 20px; stroke-width: 1.7; }
.brand-name {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700; letter-spacing: -0.3px; color: #fff;
}

.nav-section { display: flex; flex-direction: column; gap: 3px; }
.nav-section + .nav-section { margin-top: 6px; }
.nav-link {
  display: flex; align-items: center; gap: 13px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--text-muted); text-decoration: none;
  font-size: 14.5px; font-weight: 500;
  transition: color 0.14s, background 0.14s;
}
.nav-link .ico { width: 19px; height: 19px; color: var(--text-dim); }
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link:hover .ico { color: var(--text-muted); }
.nav-link[aria-current="page"] {
  color: #fff; background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.nav-link[aria-current="page"] .ico { color: var(--accent-strong); }
.nav-link .nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  background: var(--accent); border-radius: 999px;
}
.nav-link.decorative { cursor: default; }

.nav-foot { margin-top: auto; padding-top: 14px; }
.user-block {
  display: flex; align-items: center; gap: 11px;
  padding: 10px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border);
}
.avatar {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.user-meta b { font-size: 13.5px; font-weight: 650; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { font-size: 11.5px; color: var(--text-dim); }
.user-block .chev { color: var(--text-dim); }

/* sync badge sits just above the user block */
.sync-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 10px;
  border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border-soft);
  font-size: 11.5px; color: var(--text-muted);
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.pulse-dot.stale { background: var(--amber); animation: none; box-shadow: none; }
.sync-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main {
  flex: 1; min-width: 0;
  margin-left: var(--sidebar-w);
  padding: 24px clamp(20px, 2.2vw, 36px) 40px;
  width: calc(100% - var(--sidebar-w));
}
.main > * { max-width: var(--content-max); margin-left: auto; margin-right: auto; }

/* --- header -------------------------------------------------------------- */

.topbar { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.headings { margin-right: auto; }
h1 { font-family: var(--font-display); font-size: 29px; font-weight: 700; letter-spacing: -0.6px; line-height: 1.12; }
.tagline { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

.search {
  flex: 0 1 360px; min-width: 200px;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 11px 15px; color: var(--text-dim);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input {
  flex: 1; min-width: 0; background: transparent; border: none;
  color: var(--text); font-size: 14px; font-family: var(--font-body); outline: none;
}
.search input::placeholder { color: var(--text-dim); }
.search kbd {
  font-size: 11px; font-family: var(--font-body); color: var(--text-muted);
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 7px;
}

.topbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; transition: color 0.14s, border-color 0.14s, background 0.14s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-hover); background: var(--surface); }
.notif-dot {
  position: absolute; top: 7px; right: 8px;
  min-width: 16px; height: 16px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff;
  background: var(--red); border-radius: 999px; box-shadow: 0 0 0 2px var(--bg);
}
.btn-primary {
  display: inline-flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 20px; border: none; border-radius: var(--r);
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  color: #fff; font-family: var(--font-body); font-size: 14.5px; font-weight: 650;
  cursor: pointer; box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
  transition: filter 0.14s, transform 0.05s;
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary .ico { width: 18px; height: 18px; }
.btn-primary .chev { opacity: 0.85; margin-left: 2px; }

.meta-info { font-size: 12px; font-family: var(--font-data); color: var(--text-dim); width: 100%; order: 10; margin-top: -8px; }

/* --- KPI row (5 wide cards, icon tile + text + right mini-viz) ------------- */

.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; margin-bottom: 22px; }
.kpi {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.kpi-top { display: flex; align-items: center; gap: 13px; }
.kpi .tile {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--r);
  color: var(--kpi-c, var(--text-muted));
  background: color-mix(in srgb, var(--kpi-c, var(--text-dim)) 16%, transparent);
}
.kpi .tile .ico { width: 22px; height: 22px; }
.kpi .lbl { font-size: 11px; font-weight: 650; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted); }
.kpi-body { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.kpi-left { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi .num { font-family: var(--font-display); font-size: 34px; font-weight: 750; line-height: 1; letter-spacing: -1px; color: var(--text); }
.kpi .sub { font-size: 12.5px; color: var(--text-dim); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.kpi .sub .up { color: var(--green); font-weight: 650; display: inline-flex; align-items: center; gap: 3px; }
.kpi .sub .down { color: var(--red); font-weight: 650; display: inline-flex; align-items: center; gap: 3px; }
.kpi-viz { flex-shrink: 0; display: flex; align-items: center; justify-content: flex-end; }
.kpi-viz svg { display: block; overflow: visible; }

/* --- cockpit grid : dominant board + right rail --------------------------- */

.cockpit { display: grid; grid-template-columns: minmax(0, 1fr) 356px; gap: 20px; align-items: start; }

.board { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.board-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 18px 22px; }
.board-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); }
.result-count { font-size: 12px; font-family: var(--font-data); color: var(--text-dim); }
.board-tools { margin-left: auto; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

select, .btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text-muted);
  font-size: 13px; font-family: var(--font-body); padding: 9px 13px;
  cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.btn:hover, select:hover { border-color: var(--border-hover); color: var(--text); }
.btn[aria-pressed="true"] { border-color: var(--accent-line); color: var(--accent-strong); background: var(--accent-soft); }
.btn.icon-only { padding: 9px; width: 40px; height: 40px; justify-content: center; }
.control { display: inline-flex; align-items: center; }
.seg { display: inline-flex; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.seg .btn { border: none; border-radius: 0; }
.seg .btn + .btn { border-left: 1px solid var(--border); }

.summary { display: flex; flex-wrap: wrap; gap: 16px; padding: 0 22px 14px; }
.stat { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.stat b { font-weight: 650; font-family: var(--font-data); color: var(--text); }

.filterbox { border-top: 1px solid var(--border-soft); background: rgba(0, 0, 0, 0.14); }
.filterbox > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 10px 22px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--text-dim); user-select: none;
}
.filterbox > summary::-webkit-details-marker { display: none; }
.filterbox > summary::before { content: "▸"; color: var(--accent); font-size: 10px; }
.filterbox[open] > summary::before { content: "▾"; }
.filterbox > summary .fcount { color: var(--accent-strong); font-family: var(--font-data); text-transform: none; letter-spacing: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 2px 22px 14px; }
.filter-group { display: flex; align-items: center; gap: 9px; }
.filter-group > .legend { font-size: 10px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--text-dim); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  font-size: 12px; color: var(--text-muted); background: transparent;
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 11px;
  cursor: pointer; white-space: nowrap; transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.chip:hover { border-color: var(--border-hover); color: var(--text); }
.chip[aria-pressed="true"] { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--accent-line); }

/* table header + rows share --row-cols */
.table-head {
  display: none; grid-template-columns: var(--row-cols); gap: var(--row-gap);
  padding: 10px 22px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--text-dim); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.board:has(.grid.list) .table-head { display: grid; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; padding: 18px; }
.grid.list { grid-template-columns: 1fr; gap: 0; padding: 0; }

.card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); scroll-margin-top: 90px; transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s; }

/* app-icon tile inside the PROJET cell */
.app-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px;
  font-family: var(--font-display); font-weight: 750; font-size: 17px; color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--ic) 92%, #fff 8%), var(--ic));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.c-main { display: flex; align-items: center; gap: 13px; min-width: 0; }
.c-main-txt { display: flex; flex-direction: column; min-width: 0; }
.card-name { font-size: 14.5px; font-weight: 650; color: var(--text); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-id { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.c-domain { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-muted); }
.c-domain .dom-ic { color: var(--text-dim); }
.c-date { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.c-date .cal-ic { color: var(--text-dim); }

.pill-status {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 999px;
  color: var(--s-c, var(--text-muted));
  background: color-mix(in srgb, var(--s-c, var(--text-dim)) 15%, transparent);
}
.pill-status[data-s="live"] { --s-c: var(--live); }
.pill-status[data-s="active"] { --s-c: var(--active); }
.pill-status[data-s="paused"] { --s-c: var(--paused); }
.pill-status[data-s="shipped"] { --s-c: var(--shipped); }
.pill-status[data-s="archived"] { --s-c: var(--archived); }

.health-cell { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.b-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.progress { display: flex; align-items: center; gap: 12px; }
.bar { flex: 1; height: 7px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; }
.pct { font-size: 13px; font-weight: 650; font-family: var(--font-data); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; color: var(--text); }

.card-url { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; color: var(--text-dim); text-decoration: none; transition: color 0.12s, background 0.12s; }
.card-url:hover { color: var(--accent-strong); background: var(--surface-3); }
.card-url.disabled { opacity: 0.3; }
.card-url .txt { display: none; }

/* list view = table rows */
.grid.list .card {
  display: grid; grid-template-columns: var(--row-cols); gap: var(--row-gap);
  align-items: center; padding: 12px 22px;
  background: transparent; border: none; border-bottom: 1px solid var(--border-soft); border-radius: 0;
}
.grid.list .card:last-child { border-bottom: none; }
.grid.list .card:hover { background: var(--surface-2); }
.grid.list .card.selected { box-shadow: inset 3px 0 0 var(--accent); background: var(--surface-2); }
.grid.list .c-extra { display: none; }

/* cards view */
.grid:not(.list) .card { display: flex; flex-direction: column; gap: 13px; padding: 16px 17px; }
.grid:not(.list) .card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow); }
.card.selected { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line); }
.grid:not(.list) .c-domain,
.grid:not(.list) .c-date { font-size: 12.5px; }
.grid:not(.list) .c-link { align-self: flex-start; }
.grid:not(.list) .c-extra { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border-soft); padding-top: 13px; }
.c-extra-dims { display: flex; gap: 22px; }
.dim { font-size: 12px; color: var(--text-muted); display: flex; flex-direction: column; gap: 3px; }
.dim .k { font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-dim); }
.dim .v { color: var(--text); font-weight: 600; }
.card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.stack { display: flex; flex-wrap: wrap; gap: 5px; }
.pill { font-size: 11px; font-family: var(--font-data); color: var(--text-dim); background: var(--surface-3); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; }
.next { font-size: 12.5px; color: var(--text-muted); border-left: 2px solid var(--accent-line); padding-left: 11px; }
.blocker { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--red); background: color-mix(in srgb, var(--red) 11%, transparent); border-radius: var(--r-sm); padding: 7px 11px; }
details.roadmap summary { cursor: pointer; font-size: 12px; color: var(--text-dim); list-style: none; font-family: var(--font-data); }
details.roadmap summary::-webkit-details-marker { display: none; }
details.roadmap summary::before { content: "▸ "; color: var(--accent); }
details.roadmap[open] summary::before { content: "▾ "; }
.phase { display: flex; gap: 9px; font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
.phase .box { width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; }
.phase .box.done { background: color-mix(in srgb, var(--green) 20%, transparent); color: var(--green); }
.phase .box.todo { background: var(--surface-3); }
.phase.done .t { color: var(--text-dim); text-decoration: line-through; }

.board-foot { display: flex; justify-content: center; padding: 16px; border-top: 1px solid var(--border-soft); }
.export-btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 18px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 13.5px; font-weight: 550; cursor: pointer;
  transition: border-color 0.14s, color 0.14s;
}
.export-btn:hover { border-color: var(--border-hover); color: var(--text); }

.empty, .error { text-align: center; padding: 60px 20px; color: var(--text-muted); grid-column: 1 / -1; font-size: 14px; }
.error { color: var(--red); }

/* --- right rail ----------------------------------------------------------- */

.rail { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.panel h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; color: var(--text); display: flex; align-items: center; gap: 9px; }
.panel h2 .ico { color: var(--accent-strong); width: 17px; height: 17px; }
.panel > h2 { margin-bottom: 15px; }
.panel h2 .muted { color: var(--text-dim); font-weight: 500; }
.panel-head .count { font-family: var(--font-data); font-size: 12px; color: var(--text-dim); }
.see-all { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; color: var(--accent-strong); text-decoration: none; }
.see-all:hover { text-decoration: underline; }

.feed { display: flex; flex-direction: column; gap: 4px; }
.feed-item { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-radius: 10px; text-decoration: none; }
.feed-item:hover { background: var(--surface-2); }
.feed-ic { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; color: var(--kpi-c, var(--text-muted)); background: color-mix(in srgb, var(--kpi-c, var(--text-dim)) 15%, transparent); }
.feed-ic .ico { width: 16px; height: 16px; }
.feed-body { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }
.feed-body .top { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-body .subj { font-size: 13px; font-weight: 650; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item .when { font-family: var(--font-data); font-size: 11.5px; color: var(--text-dim); white-space: nowrap; align-self: flex-start; }

.cap-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.cap-fig { display: flex; flex-direction: column; gap: 3px; }
.cap-fig .big { font-family: var(--font-display); font-size: 26px; font-weight: 750; letter-spacing: -0.5px; display: flex; align-items: center; gap: 8px; }
.cap-fig .big .ico { width: 20px; height: 20px; color: var(--text-dim); }
.cap-fig .lbl { font-size: 12.5px; color: var(--text-dim); }
.cap-ring { flex-shrink: 0; position: relative; }
.cap-ring .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cap-ring .center b { font-family: var(--font-display); font-size: 16px; font-weight: 750; color: var(--text); }
.cap-ring .center small { font-size: 9px; color: var(--text-dim); }
.cap-bars { display: flex; align-items: flex-end; gap: 8px; height: 56px; }
.cap-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cap-bar .stem { width: 100%; border-radius: 5px 5px 3px 3px; background: var(--surface-3); min-height: 4px; }
.cap-bar .stem.hot { background: var(--red); }
.cap-bar .stem.warm { background: var(--accent); }
.cap-bar small { font-size: 10px; color: var(--text-dim); }

.alerts-list { display: flex; flex-direction: column; gap: 4px; }
.alert-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 10px; }
.alert-row + .alert-row { border-top: 1px solid var(--border-soft); }
.alert-ic { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 9px; color: var(--a-c, var(--text-muted)); background: color-mix(in srgb, var(--a-c, var(--text-dim)) 15%, transparent); }
.alert-ic .ico { width: 16px; height: 16px; }
.alert-body { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }
.alert-body .name { font-size: 13.5px; font-weight: 650; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-body .why { font-size: 12px; color: var(--text-dim); }
.sev { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 7px; white-space: nowrap; }
.sev.crit { color: var(--red); background: color-mix(in srgb, var(--red) 15%, transparent); }
.sev.moy { color: var(--amber); background: color-mix(in srgb, var(--amber) 15%, transparent); }
.all-clear { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--green); padding: 6px; }

/* --- bottom row ----------------------------------------------------------- */

.bottom { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 20px; margin-top: 20px; }

/* roadmap as progress timeline rows */
.road-rows { display: flex; flex-direction: column; gap: 13px; }
.road-row { display: grid; grid-template-columns: 150px 1fr 42px; gap: 12px; align-items: center; font-size: 13px; }
.road-row .rname { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.road-track { height: 8px; background: var(--surface-3); border-radius: 5px; overflow: hidden; position: relative; }
.road-track > i { display: block; height: 100%; border-radius: 5px; }
.road-row .rv { font-family: var(--font-data); font-size: 12px; color: var(--text-dim); text-align: right; }

.load-rows { display: flex; flex-direction: column; gap: 16px; }
.load-row { display: flex; align-items: center; gap: 12px; }
.load-row .lname { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-muted); width: 132px; flex-shrink: 0; }
.load-row .lname .ico { width: 16px; height: 16px; color: var(--text-dim); }
.load-row .frac { font-family: var(--font-data); font-size: 12px; color: var(--text-dim); width: 52px; flex-shrink: 0; text-align: right; }
.load-row .ltrack { flex: 1; height: 8px; background: var(--surface-3); border-radius: 5px; overflow: hidden; }
.load-row .ltrack > i { display: block; height: 100%; border-radius: 5px; }
.load-row .lpct { font-family: var(--font-data); font-size: 13px; font-weight: 650; color: var(--text); width: 42px; flex-shrink: 0; text-align: right; }

.gauge-wrap { position: relative; display: flex; justify-content: center; margin: 8px 0 18px; }
.gauge-svg { line-height: 0; }
.gauge-center { position: absolute; left: 0; right: 0; top: 46%; text-align: center; }
.gauge-center .big { font-family: var(--font-display); font-size: 30px; font-weight: 750; letter-spacing: -0.5px; }
.gauge-center .lbl { font-size: 12.5px; color: var(--text-dim); }
.gauge-legend { display: flex; flex-direction: column; gap: 10px; }
.gauge-legend .lg-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-muted); }
.gauge-legend .lg-row .dot { width: 9px; height: 9px; }
.gauge-legend .lg-row b { margin-left: auto; font-family: var(--font-data); color: var(--text); font-weight: 650; }

/* --- factory view --------------------------------------------------------- */

.factory-note { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--r); padding: 12px 16px; margin-bottom: 22px; }
.factory-note .ico { color: var(--accent-strong); }
.factory-note code { font-family: var(--font-data); font-size: 12px; color: var(--accent-strong); }
.factory-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.factory-grid .panel { margin: 0; }
.factory-grid .panel.wide { grid-column: 1 / -1; }
.meters { display: flex; flex-direction: column; gap: 14px; }
.meter .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.meter .top b { font-family: var(--font-data); color: var(--text); }
.meter .track { height: 7px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.meter .track > i { display: block; height: 100%; border-radius: 4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border-soft); }
.tbl td { color: var(--text-muted); }
.tbl td:first-child { color: var(--text); font-weight: 600; }
.tbl th { color: var(--text-dim); font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.7px; }
.tbl tr:last-child td { border-bottom: none; }

footer.foot { margin-top: 26px; font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }

/* --- V2.6 interactivity : cursors, hover/focus feedback, drawer ------------ */

/* KPI is a <button>: reset native styling, keep the card look, add feedback */
.kpi {
  font: inherit; color: inherit; text-align: left; width: 100%;
  cursor: pointer; appearance: none;
  transition: border-color 0.14s, transform 0.1s, box-shadow 0.14s;
}
.kpi:hover { border-color: var(--accent-line); transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi:active { transform: translateY(0); }

/* clickable rows: pointer + hover + focus ring */
.grid.list .card { cursor: pointer; }
.feed-item { cursor: pointer; }
.alert-row.clickable, .road-row.clickable, .load-row.clickable, .lg-row.clickable { cursor: pointer; border-radius: 8px; transition: background 0.12s; }
.alert-row.clickable:hover, .lg-row.clickable:hover { background: var(--surface-2); }
.road-row.clickable:hover .rname, .load-row.clickable:hover .lname { color: var(--text); }
.road-row.clickable:hover .road-track, .load-row.clickable:hover .ltrack { outline: 1px solid var(--border-hover); }
.kpi:focus-visible, .feed-item:focus-visible, .alert-row.clickable:focus-visible,
.road-row.clickable:focus-visible, .load-row.clickable:focus-visible, .lg-row.clickable:focus-visible,
.grid.list .card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.see-all { cursor: pointer; }

/* sidebar entries with no real destination: clearly non-interactive */
.nav-link.unavailable { cursor: default; opacity: 0.45; }
.nav-link.unavailable:hover { background: transparent; color: var(--text-muted); }
.nav-link.unavailable:hover .ico { color: var(--text-dim); }
.nav-link .lock { margin-left: auto; width: 13px; height: 13px; color: var(--text-dim); }

/* alerts panel flash when revealed via the bell / Notifications */
.panel.flash { animation: flashring 1.2s ease-out; }
@keyframes flashring {
  0%, 100% { box-shadow: var(--shadow-sm); }
  20% { box-shadow: 0 0 0 2px var(--accent-line), 0 0 22px rgba(59, 130, 246, 0.35); }
}

/* slide-over detail / info drawer (overlay — does not alter base layout) */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; justify-content: flex-end;
  background: rgba(4, 7, 12, 0.6);
  opacity: 0; transition: opacity 0.2s;
}
.drawer-overlay[data-open] { opacity: 1; }
.drawer-overlay[hidden] { display: none; }
.drawer {
  position: relative;
  width: 460px; max-width: 92vw; height: 100%;
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.4);
  overflow-y: auto; padding: 24px 26px 40px;
  transform: translateX(24px); transition: transform 0.22s ease;
}
.drawer-overlay[data-open] .drawer { transform: none; }
.drawer-close {
  position: absolute; top: 16px; right: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; transition: color 0.14s, border-color 0.14s;
}
.drawer-close:hover { color: var(--text); border-color: var(--border-hover); }

.drawer-hd { display: flex; align-items: center; gap: 14px; margin: 4px 44px 18px 0; }
.drawer-hd.info { margin-right: 44px; }
.drawer-hd .app-ic { width: 48px; height: 48px; font-size: 20px; border-radius: 13px; }
.drawer-name { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.2; }
.drawer-sub { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.drawer-badges { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.drawer-prog { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.drawer-prog .progress { gap: 12px; }
.drawer-prog-lbl { font-size: 12px; color: var(--text-dim); font-family: var(--font-data); }
.drawer-desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; margin-bottom: 18px; }
.drawer-block { margin-bottom: 18px; }
.drawer-block h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--text-dim); margin-bottom: 10px; }
.drawer-block p { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; }
.drawer-dl { display: flex; flex-direction: column; gap: 10px; }
.drawer-dl > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.drawer-dl dt { color: var(--text-dim); }
.drawer-dl dd { color: var(--text); font-weight: 600; font-family: var(--font-data); }
.drawer-info .drawer-ul { margin: 4px 0 0 2px; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; }
.drawer-info li { font-size: 13.5px; color: var(--text-muted); line-height: 1.5; }
.drawer-info kbd { font-family: var(--font-data); font-size: 11px; background: var(--surface-3); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }
.drawer-foot { margin-top: 8px; }
.drawer-open {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px;
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  color: #fff; font-size: 14px; font-weight: 650; text-decoration: none;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}
.drawer-open:hover { filter: brightness(1.07); }

@media (max-width: 720px) { .drawer { width: 100%; max-width: 100%; } }

@media (prefers-reduced-motion: no-preference) {
  .kpis, .cockpit, .bottom, .factory-grid { animation: rise 0.4s ease-out both; }
  .cockpit { animation-delay: 0.06s; }
  .bottom { animation-delay: 0.12s; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* --- responsive ----------------------------------------------------------- */

@media (min-width: 1600px) { .cockpit { grid-template-columns: minmax(0, 1fr) 380px; } }

@media (max-width: 1400px) {
  .cockpit { grid-template-columns: minmax(0, 1fr) 320px; }
  .kpi .num { font-size: 29px; }
  .kpi { padding: 16px; }
}

@media (max-width: 1120px) {
  .cockpit { grid-template-columns: 1fr; }
  .rail { flex-direction: row; flex-wrap: wrap; }
  .rail .panel { flex: 1 1 280px; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .bottom { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    position: fixed; inset: auto 0 0 0; width: 100%; height: 56px;
    flex-direction: row; align-items: center; gap: 6px; padding: 0 10px;
    border-right: none; border-top: 1px solid var(--border);
    background: rgba(11, 15, 25, 0.94); backdrop-filter: blur(10px);
  }
  .brand-row { margin: 0 6px 0 0; padding: 0; }
  .brand { width: 30px; height: 30px; }
  .brand-name, .nav-label, .nav-foot { display: none; }
  .nav-section { flex-direction: row; margin: 0; gap: 2px; }
  .nav-section + .nav-section { display: none; }
  .nav-link { padding: 9px; }
  .nav-link span:not(.nav-badge) { display: none; }
  .nav-link .ico { width: 21px; height: 21px; }
  .main { margin-left: 0; width: 100%; padding: 14px 14px 78px; }
  .main > * { max-width: none; }
  .topbar { gap: 12px; margin-bottom: 16px; }
  h1 { font-size: 22px; }
  .search { flex: 1 1 100%; order: 5; }
  .headings { margin-right: 0; flex: 1; }
  .btn-primary span:not(.chev) { display: none; }
  .btn-primary { height: 42px; padding: 0 14px; }
  .meta-info { order: 10; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 14px; gap: 10px; }
  .kpi .num { font-size: 24px; }
  .kpi-viz { display: none; }
  .grid { grid-template-columns: 1fr; padding: 8px; }
  /* mobile row: project | status | avancement (3 cells = 3 tracks) */
  .grid.list .card { grid-template-columns: minmax(0, 1fr) 84px 96px; padding: 12px 14px; }
  .grid.list .c-domain, .grid.list .c-date, .grid.list .c-health, .grid.list .c-link { display: none; }
  .board-tools .control, .board-tools .seg { display: none; }
  .table-head { display: none !important; }
  .bottom { grid-template-columns: 1fr; }
  .road-row { grid-template-columns: 110px 1fr 38px; }
}
