/* ═══════════════════════════════════════════════════════════════
   VIGGO · COCKPIT — bold full-shell rework
   Brand DNA kept (navy + red) but pushed: inky immersive chrome,
   editorial display type, expressive KPI heroes, refined data-viz.
   Light content canvas. All classes namespaced `ck-`.
   Also re-declares the var names the shared widgets.jsx expects.
   ═══════════════════════════════════════════════════════════════ */

:root{
  /* Brand — deepened */
  --ink-navy:#0b1530;        /* immersive chrome */
  --ink-navy-2:#0e1c3e;
  --navy:#13284f;            /* primary brand (also used by widgets) */
  --navy-600:#1d3a6e;
  --red:#e6332a;
  --red-2:#c4271f;

  /* Neutrals — cooler, crisper than the old #f4f6fb */
  --canvas:#eceef4;
  --surface:#ffffff;
  --surface-2:#f6f7fb;
  --surface-3:#eef1f7;
  --border:#e3e6ef;
  --border-2:#edeff5;
  --hair:#f0f2f7;

  /* Text */
  --ink:#101b34;
  --ink-2:#4a5772;
  --ink-3:#8b94a8;

  /* Chrome text (on dark) */
  --c-txt:rgba(255,255,255,.66);
  --c-txt-dim:rgba(255,255,255,.40);
  --c-txt-hi:#ffffff;
  --c-line:rgba(255,255,255,.10);

  /* Semantic */
  --pos:#0a8f57; --pos-bg:#e6f6ee;
  --neg:#d83a30; --neg-bg:#fdebe9;
  --warn:#b27a16; --warn-bg:#fbf2dd;
  --info:#2563c9; --info-bg:#e9f0fc;

  /* Data-viz ramp */
  --dv-1:#13284f; --dv-2:#27508f; --dv-3:#4f7ec4; --dv-4:#8fb0dd; --dv-5:#c9d8ee;
  --dv-accent:#e6332a;

  /* Radius / shadow / motion */
  --r-sm:9px; --r-md:13px; --r-lg:18px; --r-xl:24px;
  --sh-1:0 1px 2px rgba(11,21,48,.05);
  --sh-2:0 2px 4px rgba(11,21,48,.04), 0 8px 22px rgba(11,21,48,.07);
  --sh-3:0 18px 50px rgba(11,21,48,.20);
  --ease:cubic-bezier(.2,.7,.3,1);

  /* Type — bold editorial */
  --font:'Inter',system-ui,sans-serif;
  --display:'Inter',system-ui,sans-serif;
  --mono:'Inter',system-ui,sans-serif;

  /* widget aliases */
  --ink-3:#8b94a8;
}
/* fix typo fallback */
:root{ --navy-600:#1d3a6e; }

*{box-sizing:border-box}

.ck-app{
  font-family:var(--font);
  color:var(--ink);
  background:var(--canvas);
  height:100vh; display:flex; flex-direction:column; overflow:hidden;
  font-size:13.5px;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
.ck-app *{box-sizing:border-box}
.ck-num{font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1}
.ck-mono{font-family:var(--mono)}
.ck-disp{font-family:var(--display); letter-spacing:-.02em}

/* ═══════════ GLOBAL TOP CHROME (dark, immersive) ═══════════ */
.ck-top{
  flex-shrink:0; height:58px;
  background:linear-gradient(90deg,var(--ink-navy) 0%,var(--ink-navy-2) 100%);
  display:flex; align-items:center; gap:14px; padding:0 16px;
  position:relative; z-index:30;
}
.ck-brand{display:flex; align-items:center; gap:11px; flex-shrink:0}
.ck-logo{
  width:34px; height:34px; border-radius:10px; background:var(--red);
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 4px 14px rgba(230,51,42,.4);
}
.ck-logo svg{width:17px; height:17px; fill:#fff}
.ck-brand-name{color:#fff; font-family:var(--display); font-weight:700; font-size:17px; letter-spacing:-.01em; line-height:1}
.ck-brand-sub{color:var(--c-txt-dim); font-size:9.5px; font-family:var(--mono); letter-spacing:.14em; margin-top:3px; text-transform:uppercase}

/* workspace switcher (pill tabs in the chrome) */
.ck-ws{display:flex; gap:3px; background:rgba(255,255,255,.06); padding:3px; border-radius:11px; margin-left:6px}
.ck-ws-btn{
  display:inline-flex; align-items:center; gap:7px; padding:7px 14px; border-radius:8px;
  font-size:12.5px; font-weight:600; font-family:inherit; color:var(--c-txt);
  background:none; border:none; cursor:pointer; transition:background .15s var(--ease), color .15s;
}
.ck-ws-btn svg{width:15px; height:15px}
.ck-ws-btn:hover{color:#fff}
.ck-ws-btn.active{background:#fff; color:var(--ink-navy)}

/* command palette */
.ck-cmd{
  flex:1; max-width:440px; margin:0 auto;
  display:flex; align-items:center; gap:10px;
  height:38px; padding:0 12px; border-radius:11px;
  background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.09);
  cursor:text; transition:background .15s, border-color .15s;
}
.ck-cmd:hover{background:rgba(255,255,255,.1); border-color:rgba(255,255,255,.16)}
.ck-cmd svg{width:15px; height:15px; color:var(--c-txt-dim); flex-shrink:0}
.ck-cmd .ph{flex:1; font-size:13px; color:var(--c-txt-dim); text-align:left;}
.ck-cmd .kbd{font-family:var(--mono); font-size:10.5px; color:var(--c-txt-dim); border:1px solid rgba(255,255,255,.16); border-radius:5px; padding:2px 6px}

/* global search dropdown */
.gs{position:relative; flex:1; max-width:440px; margin:0 auto; display:flex}
.gs .ck-cmd{width:100%; border:0; font-family:inherit}
.gs-panel{
  position:absolute; top:calc(100% + 6px); left:0; right:0; z-index:60;
  background:#fff; border:1px solid #0f1f4b22; border-radius:12px;
  box-shadow:0 12px 32px rgba(15,31,75,.18); overflow:hidden;
}
.gs-input{
  width:100%; box-sizing:border-box; height:42px; padding:0 14px;
  border:0; border-bottom:1px solid #0f1f4b14; font-size:14px; color:#0f1f4b;
  outline:none; font-family:inherit;
}
.gs-results{max-height:60vh; overflow-y:auto; padding:6px 0}
.gs-group{padding:4px 0}
.gs-group-label{padding:6px 14px 4px; font-size:10.5px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:#94a0bd}
.gs-item{
  display:flex; align-items:center; gap:10px; padding:8px 14px;
  text-decoration:none; color:#0f1f4b; cursor:pointer;
}
.gs-item:hover, .gs-item.active{background:#0f1f4b0d}
.gs-item-label{flex:1; font-size:13.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.gs-item-id{font-family:var(--mono); font-size:11px; color:#94a0bd; flex-shrink:0}
.gs-empty{padding:16px 14px; font-size:13px; color:#94a0bd; text-align:center}

.ck-top-right{display:flex; align-items:center; gap:10px; flex-shrink:0}

/* global period scope chip */
.ck-scope{
  display:inline-flex; align-items:center; gap:8px; height:36px; padding:0 12px; white-space:nowrap;
  border-radius:10px; background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.1);
  color:var(--c-txt-hi); font-size:12.5px; font-weight:600; cursor:pointer; font-family:inherit;
  transition:background .15s;
}
.ck-scope:hover{background:rgba(255,255,255,.12)}
.ck-scope svg{width:14px; height:14px; color:var(--c-txt-dim)}
.ck-scope .lbl{font-size:9px; font-family:var(--mono); color:var(--c-txt-dim); text-transform:uppercase; letter-spacing:.1em; margin-right:-2px}

.ck-fresh{
  display:inline-flex; align-items:center; gap:7px; height:36px; padding:0 12px; white-space:nowrap;
  border-radius:10px; background:rgba(10,143,87,.16); color:#5fe3a6;
  font-size:11.5px; font-weight:600; font-family:var(--mono);
}
.ck-fresh::before{content:""; width:6px; height:6px; border-radius:50%; background:#4ade80; box-shadow:0 0 0 0 rgba(74,222,128,.5); animation:ckpulse 2s infinite}
@keyframes ckpulse{0%{box-shadow:0 0 0 0 rgba(74,222,128,.5)}70%{box-shadow:0 0 0 6px rgba(74,222,128,0)}100%{box-shadow:0 0 0 0 rgba(74,222,128,0)}}

.ck-ibtn{
  width:36px; height:36px; border-radius:10px; border:1px solid rgba(255,255,255,.1);
  background:rgba(255,255,255,.05); color:var(--c-txt); cursor:pointer;
  display:flex; align-items:center; justify-content:center; transition:background .15s, color .15s;
}
.ck-ibtn:hover{background:rgba(255,255,255,.12); color:#fff}
.ck-ibtn svg{width:17px; height:17px}
.ck-ibtn.on{background:rgba(255,255,255,.14); color:#fff}

.ck-avatar{
  width:34px; height:34px; border-radius:10px; flex-shrink:0;
  background:linear-gradient(135deg,var(--red),var(--red-2)); color:#fff;
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; cursor:pointer;
}

/* ═══════════ BODY (rail optional + content) ═══════════ */
.ck-body{flex:1; display:flex; min-height:0; overflow:hidden}

/* contextual LEFT rail (light) — primary nav for the active workspace */
.ck-rail{
  width:212px; flex-shrink:0; background:var(--surface); border-right:1px solid var(--border);
  display:flex; flex-direction:column; overflow-y:auto;
}
.ck-rail-sec{font-size:9.5px; font-weight:700; letter-spacing:.13em; text-transform:uppercase; color:var(--ink-3); padding:18px 18px 7px; font-family:var(--mono)}
.ck-rail-item{
  position:relative; display:flex; align-items:center; gap:11px; margin:1px 10px; padding:9px 12px;
  border-radius:10px; font-size:13.5px; font-weight:550; color:var(--ink-2); text-decoration:none;
  cursor:pointer; border:none; background:none; width:calc(100% - 20px); text-align:left; font-family:inherit;
  transition:background .14s var(--ease), color .14s;
}
.ck-rail-item .ico{width:17px; height:17px; flex-shrink:0; opacity:.8}
.ck-rail-item:hover{background:var(--surface-2); color:var(--ink)}
.ck-rail-item.active{background:var(--ink-navy); color:#fff; box-shadow:var(--sh-1)}
.ck-rail-item.active .ico{opacity:1}
.ck-rail-item .tag{margin-left:auto; font-family:var(--mono); font-size:10px; font-weight:600; color:var(--ink-3); background:var(--surface-3); border-radius:20px; padding:1px 7px}
.ck-rail-item.active .tag{background:rgba(255,255,255,.16); color:rgba(255,255,255,.85)}
.ck-rail-spacer{flex:1}

/* content column */
.ck-content{flex:1; display:flex; flex-direction:column; min-width:0; overflow:hidden}

/* contextual sub-nav (horizontal pills) — used in top-chrome variant */
.ck-subnav{
  flex-shrink:0; height:50px; background:var(--surface); border-bottom:1px solid var(--border);
  display:flex; align-items:center; gap:3px; padding:0 22px; overflow-x:auto;
}
.ck-subnav::-webkit-scrollbar{height:0}
.ck-subnav-group{display:flex; align-items:center; gap:3px; padding-right:10px; margin-right:7px; border-right:1px solid var(--border-2)}
.ck-subnav-group:last-child{border-right:none}
.ck-subnav-lbl{font-size:9px; font-family:var(--mono); text-transform:uppercase; letter-spacing:.1em; color:var(--ink-3); margin-right:4px; white-space:nowrap}
.ck-tab{
  display:inline-flex; align-items:center; gap:7px; padding:7px 13px; border-radius:9px;
  font-size:12.5px; font-weight:600; color:var(--ink-2); text-decoration:none; cursor:pointer; white-space:nowrap;
  border:none; background:none; font-family:inherit; transition:background .14s, color .14s;
}
.ck-tab svg{width:15px; height:15px; opacity:.8}
.ck-tab:hover{background:var(--surface-2); color:var(--ink)}
.ck-tab.active{background:var(--ink-navy); color:#fff}
.ck-tab.active svg{opacity:1}

/* scroll region */
.ck-scroll{flex:1; overflow:auto; padding:22px 24px}
.ck-scroll::-webkit-scrollbar{width:10px; height:10px}
.ck-scroll::-webkit-scrollbar-thumb{background:#d3d8e4; border-radius:10px; border:3px solid var(--canvas)}

/* page header */
.ck-head{display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:18px; flex-wrap:wrap}
.ck-eyebrow{font-family:var(--mono); font-size:10px; font-weight:600; letter-spacing:.12em; text-transform:uppercase; color:var(--ink-3); margin-bottom:7px; display:flex; align-items:center; gap:8px; white-space:nowrap}
.ck-eyebrow .dot{width:4px; height:4px; border-radius:50%; background:var(--red)}
.ck-title{font-family:var(--display); font-size:27px; font-weight:600; letter-spacing:-.02em; color:var(--ink); margin:0; line-height:1}
.ck-head-actions{display:flex; gap:9px; align-items:center}

/* ═══════════ BUTTONS ═══════════ */
.ck-btn{
  font-family:inherit; font-size:13px; font-weight:600; padding:9px 15px; border-radius:11px;
  border:1px solid transparent; cursor:pointer; text-decoration:none; white-space:nowrap;
  display:inline-flex; align-items:center; gap:8px; transition:background .14s, border-color .14s, color .14s;
}
.ck-btn svg{width:15px; height:15px}
.ck-btn-primary{background:var(--ink-navy); color:#fff}
.ck-btn-primary:hover{background:var(--ink-navy-2)}
.ck-btn-red{background:var(--red); color:#fff}
.ck-btn-red:hover{background:var(--red-2)}
.ck-btn-ghost{background:var(--surface); color:var(--ink-2); border-color:var(--border)}
.ck-btn-ghost:hover{border-color:#c7cee0; color:var(--ink)}
.ck-btn-sm{padding:7px 11px; font-size:12px; border-radius:9px}

/* segmented */
.ck-seg{display:inline-flex; padding:3px; background:var(--surface-3); border-radius:11px; gap:2px}
.ck-seg-btn{
  padding:7px 14px; font-size:12.5px; font-weight:600; font-family:inherit; border-radius:8px;
  border:none; background:transparent; color:var(--ink-2); cursor:pointer; display:inline-flex; align-items:center; gap:7px; transition:all .14s;
}
.ck-seg-btn svg{width:14px; height:14px}
.ck-seg-btn.active{background:var(--surface); color:var(--ink-navy); box-shadow:var(--sh-1)}

/* ═══════════ KPI HERO BAND ═══════════ */
.ck-hero{
  background:linear-gradient(135deg,var(--ink-navy) 0%,var(--ink-navy-2) 60%,#162a55 100%);
  border-radius:var(--r-xl); padding:4px; margin-bottom:16px; box-shadow:var(--sh-2);
  position:relative; overflow:hidden;
}
.ck-hero-inner{display:grid; grid-template-columns:1.5fr 1fr 1fr 1fr; gap:1px}
.ck-hero-cell{padding:20px 22px; position:relative; min-width:0}
.ck-hero-cell + .ck-hero-cell::before{content:""; position:absolute; left:0; top:18px; bottom:18px; width:1px; background:rgba(255,255,255,.09)}
.ck-hero-lbl{font-size:10.5px; font-weight:600; font-family:var(--mono); letter-spacing:.08em; text-transform:uppercase; color:var(--c-txt-dim); display:flex; align-items:center; gap:8px; margin-bottom:12px; white-space:nowrap}
.ck-hero-val{font-family:var(--display); font-size:34px; font-weight:600; letter-spacing:-.03em; color:#fff; line-height:.95; font-variant-numeric:tabular-nums}
.ck-hero-val .u{font-size:17px; font-weight:500; color:var(--c-txt); margin-left:4px; letter-spacing:0}
.ck-hero-big .ck-hero-val{font-size:42px}
.ck-hero-foot{display:flex; align-items:center; gap:9px; margin-top:13px}
.ck-hero-spark{height:34px; margin-top:14px; opacity:.95}

.ck-delta{display:inline-flex; align-items:center; gap:3px; font-size:11.5px; font-weight:700; font-variant-numeric:tabular-nums; padding:3px 8px; border-radius:20px}
.ck-delta svg{width:12px; height:12px}
.ck-delta.up{background:rgba(74,222,128,.16); color:#67e8a0}
.ck-delta.down{background:rgba(248,113,93,.18); color:#fca596}
.ck-delta.flat{background:rgba(255,255,255,.1); color:var(--c-txt)}
.ck-delta-note{font-size:11px; color:var(--c-txt-dim)}
/* light delta (on white cards) */
.ck-delta.l-up{background:var(--pos-bg); color:var(--pos)}
.ck-delta.l-down{background:var(--neg-bg); color:var(--neg)}
.ck-delta.l-flat{background:var(--surface-3); color:var(--ink-3)}

/* ═══════════ CARDS ═══════════ */
.ck-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); box-shadow:var(--sh-1)}
.ck-card-head{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 20px; border-bottom:1px solid var(--border-2)}
.ck-card-title{font-family:var(--display); font-size:15px; font-weight:600; letter-spacing:-.01em; color:var(--ink)}
.ck-card-sub{font-size:11.5px; color:var(--ink-3); margin-top:2px}
.ck-grid-2{display:grid; grid-template-columns:1.6fr 1fr; gap:16px}

/* mini KPI tiles (light) */
.ck-tiles{display:grid; grid-template-columns:repeat(5,1fr); gap:12px; margin-bottom:16px}
.ck-tile{background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md); padding:14px 16px; box-shadow:var(--sh-1)}
.ck-tile-lbl{font-size:10.5px; font-weight:600; color:var(--ink-3); font-family:var(--mono); text-transform:uppercase; letter-spacing:.05em; margin-bottom:9px}
.ck-tile-val{font-family:var(--display); font-size:21px; font-weight:600; letter-spacing:-.02em; color:var(--ink); line-height:1; font-variant-numeric:tabular-nums}
.ck-tile-val .u{font-size:12px; color:var(--ink-3); font-weight:500; margin-left:2px}
.ck-tile-foot{margin-top:9px; font-size:11px}

/* ═══════════ FILTER BAR (refined) ═══════════ */
.ck-filter{
  display:flex; align-items:center; gap:9px; flex-wrap:wrap;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--r-md);
  padding:9px 12px; margin-bottom:16px; box-shadow:var(--sh-1);
}
.ck-filter-div{width:1px; align-self:stretch; background:var(--border-2); margin:2px 3px}
.ck-filter-lbl{font-size:9.5px; font-family:var(--mono); text-transform:uppercase; letter-spacing:.08em; color:var(--ink-3); font-weight:600}
.ck-select{
  appearance:none; font-family:inherit; font-size:12.5px; font-weight:550; color:var(--ink);
  background:var(--surface-2); border:1px solid var(--border); border-radius:9px; padding:8px 28px 8px 11px; cursor:pointer; outline:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238b94a8' stroke-width='2.2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 9px center; transition:border-color .14s, box-shadow .14s;
}
.ck-select:focus{border-color:var(--navy); box-shadow:0 0 0 3px rgba(19,40,79,.1)}
.ck-sep{color:var(--ink-3); font-size:13px}
.ck-filtres{
  display:inline-flex; align-items:center; gap:7px; padding:8px 12px; border-radius:9px;
  background:var(--surface-2); border:1px solid var(--border); font-size:12.5px; font-weight:600; color:var(--ink-2);
  cursor:pointer; font-family:inherit; transition:border-color .14s, color .14s; position:relative;
}
.ck-filtres:hover{border-color:#c7cee0; color:var(--ink)}
.ck-filtres svg{width:14px; height:14px}
.ck-count{font-family:var(--mono); font-size:10px; font-weight:700; background:var(--red); color:#fff; border-radius:20px; padding:1px 6px; min-width:17px; text-align:center}
.ck-filter-right{margin-left:auto; display:flex; align-items:center; gap:8px}

/* search input */
.ck-search{
  display:flex; align-items:center; gap:9px; min-width:230px;
  background:var(--surface-2); border:1px solid var(--border); border-radius:9px; padding:8px 12px;
}
.ck-search svg{width:15px; height:15px; color:var(--ink-3)}
.ck-search .ph{flex:1; font-size:12.5px; color:var(--ink-3)}
.ck-search .kbd{font-family:var(--mono); font-size:10px; color:var(--ink-3); border:1px solid var(--border); background:var(--surface); border-radius:5px; padding:1px 6px}

/* filter chips */
.ck-chip{display:inline-flex; align-items:center; gap:7px; padding:6px 9px 6px 12px; background:var(--surface-2); border:1px solid var(--border); border-radius:20px; font-size:12px; font-weight:550; color:var(--ink)}
.ck-chip .k{color:var(--ink-3)}
.ck-chip .x{width:16px; height:16px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:var(--ink-3); cursor:pointer}
.ck-chip .x:hover{background:var(--border); color:var(--ink)}
.ck-chip-add{display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border:1px dashed #c7cee0; border-radius:20px; background:transparent; font-size:12px; font-weight:600; color:var(--ink-2); cursor:pointer; font-family:inherit}
.ck-chip-add:hover{border-color:var(--navy); color:var(--navy)}
.ck-chip-add svg{width:13px; height:13px}

/* ═══════════ TABLE ═══════════ */
.ck-tbl-wrap{background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); overflow:hidden; box-shadow:var(--sh-1)}
.ck-tbl-scroll{overflow-x:auto}
.ck-tbl{width:100%; border-collapse:separate; border-spacing:0; font-size:13px}
.ck-tbl thead th{
  padding:11px 14px; text-align:left; background:var(--surface-2); font-size:10px; font-weight:700;
  letter-spacing:.06em; text-transform:uppercase; color:var(--ink-3); white-space:nowrap;
  border-bottom:1px solid var(--border); font-family:var(--mono); position:sticky; top:0; z-index:0;
}
.ck-tbl thead th.num, .ck-tbl tbody td.num{text-align:right; font-variant-numeric:tabular-nums}
.ck-tbl tbody td{padding:10px 14px; border-bottom:1px solid var(--hair); white-space:nowrap; color:var(--ink)}
.ck-tbl tbody td.num{font-family:var(--mono); font-size:12.5px}
.ck-tbl tbody tr:last-child td{border-bottom:none}
.ck-tbl tbody tr:hover td{background:var(--surface-2)}
.ck-tbl .sticky-l{position:sticky; left:0; background:var(--surface); z-index:1; font-weight:600}
.ck-tbl tbody tr:hover .sticky-l{background:var(--surface-2)}
.ck-tbl .total td{background:var(--surface-3); font-weight:700; color:var(--ink-navy)}
.ck-tbl .total .sticky-l{background:var(--surface-3)}
/* group tints */
.ck-tbl .g-cumul{background:rgba(79,126,196,.07)}
.ck-tbl .g-mens{background:rgba(230,51,42,.055)}
.ck-tbl thead th.g-cumul{color:var(--dv-2); border-bottom-color:var(--dv-3)}
.ck-tbl thead th.g-mens{color:var(--red); border-bottom-color:var(--red)}
.ck-tbl .grp-head{cursor:pointer; user-select:none}
.ck-tbl .grp-head .chev{display:inline-flex; width:15px; height:15px; border-radius:5px; background:currentColor; color:#fff; align-items:center; justify-content:center; margin-left:5px; vertical-align:middle}
.ck-tbl.compact tbody td{padding:6px 14px}
.ck-tbl.compact thead th{padding:7px 14px}
.ck-tbl tbody td .pm{display:inline-block; background:var(--surface-3); color:var(--ink-navy); font-size:10.5px; font-weight:600; padding:1px 7px; border-radius:6px; margin-left:6px}

/* shared data-list reskin (row eye, footer, density wiring) */
.ck-eye{color:var(--ink-3); display:inline-flex}
.ck-eye:hover{color:var(--navy)}
.ck-tbl-foot{display:flex; align-items:center; justify-content:space-between; padding:12px 18px; border-top:1px solid var(--border)}
/* density controller sets data-density on .tbl-wrap (localStorage-driven) */
.tbl-wrap[data-density="compact"] .ck-tbl tbody td{padding:6px 14px}
.tbl-wrap[data-density="compact"] .ck-tbl thead th{padding:7px 14px}
.tbl-wrap[data-density="comfort"] .ck-tbl tbody td{padding:12px 14px}

/* badges */
.ck-bdg{display:inline-flex; align-items:center; gap:5px; padding:3px 9px; border-radius:7px; font-size:11px; font-weight:600; font-family:var(--mono); white-space:nowrap}
.ck-bdg::before{content:""; width:5px; height:5px; border-radius:50%; background:currentColor}
.ck-bdg.plain::before{display:none}
.ck-bdg-pos{background:var(--pos-bg); color:var(--pos)}
.ck-bdg-neg{background:var(--neg-bg); color:var(--neg)}
.ck-bdg-info{background:var(--info-bg); color:var(--info)}
.ck-bdg-warn{background:var(--warn-bg); color:var(--warn)}
.ck-bdg-grey{background:var(--surface-3); color:var(--ink-2)}

/* client bars (home top clients) */
.ck-cli{display:flex; align-items:center; gap:12px}
.ck-cli .nm{width:120px; font-size:12.5px; font-weight:550; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; flex-shrink:0}
.ck-cli .track{flex:1; height:9px; background:var(--surface-3); border-radius:6px; overflow:hidden}
.ck-cli .fill{height:100%; border-radius:6px}
.ck-cli .val{width:64px; text-align:right; font-family:var(--mono); font-size:12px; font-weight:600; flex-shrink:0}

/* alert rows */
.ck-alert{display:flex; align-items:center; gap:11px; padding:9px 0; cursor:pointer; text-decoration:none; color:inherit}
.ck-alert + .ck-alert{border-top:1px solid var(--hair)}
.ck-alert .ico{width:30px; height:30px; border-radius:9px; display:flex; align-items:center; justify-content:center; flex-shrink:0}
.ck-alert .ico svg{width:15px; height:15px}

/* legend */
.ck-legend{display:flex; flex-wrap:wrap; gap:14px; margin-top:14px}
.ck-leg{display:inline-flex; align-items:center; gap:7px; font-size:11.5px; color:var(--ink-2)}
.ck-leg .sw{width:11px; height:11px; border-radius:3px}

/* ═══ KPI STRIP — 3 real cards (CA / Commercial / Qualité) restyled ═══ */
.ck-k3{display:grid; grid-template-columns:1.35fr 1fr 1fr; gap:16px; margin-bottom:16px; align-items:stretch}
.ck-k3-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); box-shadow:var(--sh-1); padding:18px 20px; display:flex; flex-direction:column}
.ck-k3-lbl{font-size:10px; font-weight:600; font-family:var(--mono); letter-spacing:.08em; text-transform:uppercase; color:var(--ink-3); white-space:nowrap}
.ck-k3-val{font-family:var(--display); font-size:26px; font-weight:600; letter-spacing:-.02em; color:var(--ink); line-height:1; font-variant-numeric:tabular-nums; margin-top:7px}
.ck-k3-val .u{font-size:13px; color:var(--ink-3); font-weight:500; margin-left:2px}
.ck-k3-duo{display:flex; gap:26px}
.ck-k3-sub{display:flex; align-items:center; gap:7px; margin-top:8px; font-size:11px; color:var(--ink-3); white-space:nowrap}

/* tiny trend chip */
.ck-tchip{display:inline-flex; align-items:center; gap:2px; font-family:var(--mono); font-size:10.5px; font-weight:700; padding:1px 6px; border-radius:20px; line-height:1.5; font-variant-numeric:tabular-nums}
.ck-tchip.up{background:var(--pos-bg); color:var(--pos)}
.ck-tchip.down{background:var(--neg-bg); color:var(--neg)}
.ck-tchip.flat{background:var(--surface-3); color:var(--ink-3)}

/* breakdown table */
.ck-bd{margin-top:16px; padding-top:13px; border-top:1px solid var(--border-2)}
.ck-bd-row{display:grid; grid-template-columns:1fr auto 46px 58px; align-items:center; gap:10px; padding:5px 0}
.ck-bd-row + .ck-bd-row{border-top:1px solid var(--hair)}
.ck-bd-head{padding-bottom:6px}
.ck-bd-head span{font-size:9px; font-family:var(--mono); text-transform:uppercase; letter-spacing:.06em; color:var(--ink-3); text-align:right}
.ck-bd-lbl{font-size:12.5px; font-weight:550; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.ck-bd-val{font-family:var(--mono); font-size:12.5px; font-weight:600; color:var(--ink); text-align:right; white-space:nowrap}
.ck-bd-pct{font-family:var(--mono); font-size:12px; color:var(--ink-2); text-align:right}
.ck-bd-tr{display:flex; justify-content:flex-end}

/* commercial rows */
.ck-crow{display:flex; align-items:center; gap:9px; padding:7px 0; font-size:13px}
.ck-crow + .ck-crow{border-top:1px solid var(--hair)}
.ck-crow .nm{flex:1; color:var(--ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.ck-crow .v{font-family:var(--display); font-size:17px; font-weight:600; color:var(--ink); font-variant-numeric:tabular-nums; line-height:1}
.ck-crow .vs{font-size:10px; color:var(--ink-3); white-space:nowrap}
.ck-devis{margin-top:12px; padding-top:12px; border-top:1px solid var(--border-2)}
.ck-devis-head{display:flex; align-items:center; gap:9px}
.ck-devis-head .nm{flex:1; font-size:13px; font-weight:650; color:var(--ink)}
.ck-devis-head .v{font-family:var(--display); font-size:17px; font-weight:600; font-variant-numeric:tabular-nums}
.ck-devis-pipe{display:flex; gap:16px; margin-top:9px; font-size:12px; flex-wrap:wrap}
.ck-devis-pipe span{white-space:nowrap; color:var(--ink-3)}
.ck-devis-pipe b{font-family:var(--mono); font-weight:700}

/* qualité rows */
.ck-q-badge{font-family:var(--mono); font-size:11px; font-weight:700; color:#fff; background:var(--red); border-radius:20px; padding:2px 9px; white-space:nowrap; flex:none}
.ck-q-row{display:flex; align-items:center; gap:10px; padding:8px 0; font-size:13px; text-decoration:none; color:var(--ink); cursor:pointer}
.ck-q-row + .ck-q-row{border-top:1px solid var(--hair)}
.ck-q-row .dot{width:8px; height:8px; border-radius:50%; flex:none}
.ck-q-row .c{font-family:var(--mono); font-weight:700; color:var(--ink)}
.ck-q-row .nm{flex:1; color:var(--ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.ck-q-row .go{color:var(--ink-3); opacity:0; transition:opacity .12s}
.ck-q-row:hover{background:var(--surface-2); border-radius:8px; margin:0 -8px; padding-left:8px; padding-right:8px}
.ck-q-row:hover .go{opacity:1}

@media (max-width:1180px){ .ck-k3{grid-template-columns:1fr} }

/* section domain cards (home) */
.ck-sec-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-bottom:16px}
.ck-sec-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); box-shadow:var(--sh-1); padding:18px 20px 12px; display:flex; flex-direction:column}
.ck-sec-top{display:flex; align-items:center; gap:12px; margin-bottom:16px}
.ck-sec-mark{width:38px; height:38px; border-radius:11px; display:flex; align-items:center; justify-content:center; flex-shrink:0}
.ck-sec-mark svg{width:19px; height:19px}
.ck-sec-title{font-family:var(--display); font-size:16px; font-weight:600; letter-spacing:-.01em; color:var(--ink); line-height:1.05}
.ck-sec-sub{font-size:9.5px; font-family:var(--mono); text-transform:uppercase; letter-spacing:.09em; color:var(--ink-3); margin-top:3px; white-space:nowrap}
.ck-sec-cta{margin-left:auto; color:var(--ink-3); display:flex}
.ck-stat-lbl{font-size:9.5px; font-family:var(--mono); text-transform:uppercase; letter-spacing:.07em; color:var(--ink-3); margin-bottom:5px; white-space:nowrap}
.ck-sec-hero .v{font-family:var(--display); font-size:27px; font-weight:600; letter-spacing:-.02em; color:var(--ink); line-height:1; font-variant-numeric:tabular-nums}
.ck-sec-hero .v .u{font-size:14px; color:var(--ink-3); font-weight:500; margin-left:2px}
.ck-sec-hero .foot{display:flex; align-items:center; gap:8px; margin-top:8px}
.ck-sec-stats{display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:14px; padding-top:13px; border-top:1px solid var(--border-2)}
.ck-sec-stat .v{font-family:var(--display); font-size:18px; font-weight:600; color:var(--ink); letter-spacing:-.01em; font-variant-numeric:tabular-nums; line-height:1}
.ck-sec-stat .v .u{font-size:11px; color:var(--ink-3); font-weight:500; margin-left:1px}
.ck-sec-stat .foot{margin-top:6px; display:flex; align-items:center; gap:6px}
.ck-pipe{display:flex; gap:14px; flex-wrap:wrap; margin-top:13px; padding-top:12px; border-top:1px solid var(--border-2); font-size:11.5px}
.ck-pipe span{white-space:nowrap}
.ck-pipe b{font-family:var(--mono); font-weight:700}
.ck-sec-hero .foot span, .ck-sec-stat .foot span{white-space:nowrap}
.ck-sec-links{margin-top:auto; padding-top:12px; border-top:1px solid var(--border-2)}
.ck-sec-link{display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:9px; text-decoration:none; color:var(--ink); cursor:pointer; transition:background .12s var(--ease)}
.ck-sec-link:hover{background:var(--surface-2)}
.ck-sec-link .nm{flex:1; font-size:13px; font-weight:550}
.ck-sec-link .go{color:var(--ink-3); opacity:0; transform:translateX(-4px); transition:opacity .12s, transform .12s}
.ck-sec-link:hover .go{opacity:1; transform:translateX(0)}

/* data-quality mini */
.ck-dq{display:flex; flex-direction:column; gap:9px}
.ck-dq-row{display:flex; align-items:center; gap:10px; font-size:12.5px}
.ck-dq-bar{flex:1; height:7px; border-radius:5px; background:var(--surface-3); overflow:hidden}
.ck-dq-bar .f{height:100%; border-radius:5px}

/* global density tweak */
.ck-app[data-density="Compact"] .ck-scroll{padding:16px 20px}
.ck-app[data-density="Compact"] .ck-hero-cell{padding:14px 18px}
.ck-app[data-density="Compact"] .ck-hero-spark{display:none}
.ck-app[data-density="Compact"] .ck-tbl td{padding:6px 14px}
.ck-app[data-density="Compact"] .ck-tile{padding:11px 13px}
.ck-app[data-density="Compact"] .ck-card-head{padding:12px 18px}

/* responsive guard */
@media (max-width:1180px){
  .ck-hero-inner{grid-template-columns:1fr 1fr}
  .ck-tiles{grid-template-columns:repeat(3,1fr)}
  .ck-grid-2{grid-template-columns:1fr}
}

/* ═══════════ APP SHELL: mode toggle + rail collapse ═══════════ */
/* mode-driven rail visibility (both lists rendered server-side) */
.ck-app[data-mode="tableaux"] [data-nav-mode="donnees"],
.ck-app[data-mode="donnees"]  [data-nav-mode="tableaux"]{ display:none; }

/* rail collapse */
.ck-rail{ transition:width .2s var(--ease); }
.ck-rail-collapse{ margin:6px 0 14px 14px; width:28px; height:28px; border-radius:8px;
  border:1px solid var(--border); background:var(--surface); color:var(--ink-3);
  display:flex; align-items:center; justify-content:center; cursor:pointer;
  transition:transform .2s var(--ease); }
.ck-app[data-rail="collapsed"] .ck-rail{ width:64px; }
.ck-app[data-rail="collapsed"] .ck-rail-item{ justify-content:center; }
.ck-app[data-rail="collapsed"] .ck-rail-item span:not(.ico),
.ck-app[data-rail="collapsed"] .ck-rail-item .tag,
.ck-app[data-rail="collapsed"] .ck-rail-sec{ display:none; }
.ck-app[data-rail="collapsed"] .ck-rail-collapse{ transform:rotate(180deg); }

/* ═══════════ FILTRES POPOVER (native <details>) ═══════════ */
.ck-pop{ position:relative; display:inline-block; }
.ck-pop > summary{ list-style:none; cursor:pointer; }
.ck-pop > summary::-webkit-details-marker{ display:none; }
.ck-pop[open] > summary .ck-filtres,
.ck-pop > summary:hover .ck-filtres{ border-color:var(--navy); }
.ck-pop-menu{ position:absolute; top:calc(100% + 6px); left:0; z-index:20;
  background:var(--surface); border:1px solid var(--border); border-radius:12px;
  box-shadow:var(--sh-3); padding:14px; width:236px; }
.ck-check{ display:flex; gap:9px; align-items:center; font-size:13px; padding:6px 0; color:var(--ink-2); cursor:pointer; }

/* ── Row hierarchy (maps the htable ht-l1/l2/l3 system onto .ck-tbl) ─────── */
.ck-tbl tr.ht-l1 > td{ background:var(--surface-2); }
.ck-tbl tr.ht-l1:hover > td{ background:var(--surface-3); }
.ck-tbl tr.ht-l1 > .sticky-l{ padding-left:14px; font-weight:700; color:var(--ink-navy); background:var(--surface-2); }
.ck-tbl tr.ht-l1:hover > .sticky-l{ background:var(--surface-3); }

.ck-tbl tr.ht-l2 > .sticky-l{ padding-left:34px; font-weight:600; }
.ck-tbl tr.ht-l3 > .sticky-l{ padding-left:54px; font-weight:400; color:var(--ink-2); }
.ck-tbl tr.ht-l3 > td{ color:var(--ink-2); }

/* collapsed parent — JS toggles .is-collapsed on the parent row + .hidden on descendants */
.ck-tbl tr.is-collapsed > .sticky-l .ck-row-toggle{ transform:rotate(-90deg); }

/* expand/collapse affordance placed at the start of a parent row's first cell */
.ck-row-toggle{ display:inline-flex; width:16px; height:16px; margin-right:8px;
  border:1px solid var(--border); border-radius:5px; background:var(--surface);
  color:var(--ink-3); align-items:center; justify-content:center; cursor:pointer;
  vertical-align:middle; transition:transform .15s var(--ease); }
.ck-row-toggle svg{ width:11px; height:11px; }

/* status-coloured numbers (e.g. TJM Réel vs Cible) */
.ck-txt-pos{ color:var(--pos); font-weight:600; }
.ck-txt-neg{ color:var(--neg); font-weight:600; }
.ck-txt-info{ color:var(--info); font-weight:600; }

/* vertical group separator (e.g. Projets devis|projet split) */
.ck-tbl .ck-col-sep{ border-left:2px solid var(--navy); }
.ck-tbl tbody td.ck-txt-pos { color: var(--pos);  font-weight: 600; }
.ck-tbl tbody td.ck-txt-neg { color: var(--neg);  font-weight: 600; }
.ck-tbl tbody td.ck-txt-info{ color: var(--info); font-weight: 600; }