/* ============================================================
   Orchestrator v7.4 — global stylesheet (Airbnb-like polish)
   ============================================================ */
*{ box-sizing: border-box; }
html, body{ margin:0; padding:0; }
body{
  background: var(--bg-paper);
  color: var(--ink-primary);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
input, button, select, textarea{ font: inherit; color: inherit; }
button{ cursor: pointer; }

/* ---- A11Y · focus ring système -------------------------- */
*:focus{ outline: none; }
*:focus-visible{
  outline: 2px solid var(--ink-primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---- Type ----------------------------------------------- */
.serif{ font-family: var(--display); font-weight: 700; }
.mono { font-family: var(--mono); }
.h0   { font-family: var(--display); font-weight: 700; font-size: 48px; letter-spacing: -0.025em; line-height: 1.04; margin:0; }
.h1   { font-family: var(--display); font-weight: 700; font-size: 36px; letter-spacing: -0.02em;  line-height: 1.1;  margin:0; }
.h2   { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -0.015em; line-height: 1.2;  margin:0; }
.h3   { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -0.01em;  margin:0; }
.label{
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-mute);
}
.muted{ color: var(--ink-secondary); }
.dim  { color: var(--ink-mute); }

/* ---- Layout shell --------------------------------------- */
.app{
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  grid-template-rows: 72px 1fr;
  grid-template-areas:
    "side topbar"
    "side content";
}
.topbar{
  grid-area: topbar;
  background: rgba(19,18,16,0.78);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.sidebar{
  grid-area: side;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.content{
  grid-area: content;
  padding: 36px 44px 96px;
  background: var(--bg-paper);
  min-width: 0;
  overflow-x: hidden;
}
@media (max-width: 1279px){
  .app{ grid-template-columns: 240px minmax(0, 1fr); }
  .content{ padding: 28px 28px 96px; }
}
@media (max-width: 1023px){
  .app{
    grid-template-columns: 1fr;
    grid-template-areas: "topbar" "content";
    grid-template-rows: 64px 1fr;
  }
  .sidebar{
    position: fixed; top: 0; left: 0; z-index: 50;
    width: 300px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open{ transform: translateX(0); }
  .scrim{
    position: fixed; inset: 0; z-index: 40;
    background: rgba(20,20,20,0.36);
    backdrop-filter: blur(2px);
  }
}
@media (max-width: 767px){
  .content{ padding: 20px 16px 110px; }
  .app{ grid-template-rows: 56px 1fr; }
}

/* ---- Top bar -------------------------------------------- */
.topbar-inner{
  height: 100%;
  display:flex; align-items:center; gap:20px;
  padding: 0 32px;
  /* HOTFIX overlap — pills scroll horizontalement si overflow, user-menu reste à droite */
  min-width: 0;
}
.topbar-inner .pills{
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  white-space: nowrap;
}
.topbar-inner .pills::-webkit-scrollbar{ height: 4px; }
.topbar-inner .pills::-webkit-scrollbar-thumb{ background: var(--border); border-radius: 2px; }
.topbar-inner .top-actions{ flex: 0 0 auto; }
.topbar-inner > div:last-child{ flex: 0 0 auto; position: relative; z-index: 50; }
.brand{ display:flex; align-items:baseline; gap:10px; }
.brand .mark{ font-family: var(--display); font-weight:700; font-size:22px; letter-spacing:-0.025em; }
.brand .ver{
  font-family: var(--mono); font-size:10px;
  color: var(--ink-secondary); background: var(--bg-subtle);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 6px; line-height: 1;
}
.pills{
  display:flex; align-items:center; gap:2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.pills::-webkit-scrollbar{ display: none; }
.pill{
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-secondary);
  padding: 9px 16px;
  border-radius: var(--r-full);
  white-space: nowrap;
  border: 1px solid transparent;
  background: transparent;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s ease, color .15s ease;
}
.pill:hover{ background: var(--bg-subtle); color: var(--ink-primary); }
.pill.active{ background: var(--ink-primary); color: var(--bg-paper); }
.pill .pill-count{
  font-family: var(--mono); font-size: 10px;
  color: var(--accent);
  font-weight: 700;
}
.pill.active .pill-count{ color: rgba(19,18,16,0.55); }

.top-actions{
  display:flex; align-items:center; gap:4px;
  border-left: 1px solid var(--border);
  padding-left: 14px;
  margin-left: 4px;
}
.icon-btn{
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-secondary);
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover{ background: var(--bg-subtle); color: var(--ink-primary); }
.icon-btn.on{ background: var(--bg-subtle); border-color: var(--border); color: var(--ink-primary); }

.user-menu{
  display:flex; align-items:center; gap:10px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--r-full);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: box-shadow .15s ease;
}
.user-menu:hover{ box-shadow: var(--shadow-sm); }
.avatar{
  width:32px; height:32px; border-radius:50%;
  background: var(--ink-primary); color: var(--bg-paper);
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 600; font-size: 14px;
}
.avatar.sm{ width:28px; height:28px; font-size:12px; }
.user-who{ font-size:13px; font-weight:500; }
.user-who .role{ color: var(--ink-secondary); font-weight:400; margin-left:4px; }

/* ---- Sidebar -------------------------------------------- */
.side-inner{
  padding: 22px 18px 18px;
  display:flex; flex-direction:column; gap: 22px;
  min-height: 100%;
}
.side-section{ display:flex; flex-direction:column; gap:2px; }
.side-section .label{
  padding: 0 6px 8px;
  display: flex; align-items: baseline; justify-content: space-between;
}
.side-section .label .total{
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0; text-transform: none;
  color: var(--ink-mute); font-weight: 500;
}
.side-item{
  display:flex; align-items:center; justify-content:space-between;
  gap:8px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--ink-primary);
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  transition: background .12s ease;
}
.side-item:hover{ background: var(--bg-subtle); }
.side-item.active{ background: var(--bg-subtle); font-weight: 500; }
.side-item .left{ display:flex; align-items:center; gap:10px; min-width:0; }
.side-item .name{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.side-item .count{ font-family: var(--mono); font-size: 11.5px; color: var(--ink-secondary); flex-shrink: 0; }
.side-item .dot{
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-mute); flex-shrink: 0;
}
.side-item.active .dot{ background: var(--ink-primary); }
.side-item .swatch{ width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.sw-green{ background: var(--success); }
.sw-amber{ background: var(--warning); }
.sw-red  { background: var(--danger); }
.sw-gray { background: var(--ink-mute); }
.sw-blue { background: var(--info); }

.search{
  display:flex; align-items:center; gap:10px;
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 9px 14px;
  color: var(--ink-mute);
  cursor: text;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.search:hover{ box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
.search input{
  border: 0; outline: 0; background: transparent;
  flex: 1; min-width: 0;
  font: 400 13.5px/1.4 var(--sans);
  color: var(--ink-primary);
}
.search input::placeholder{ color: var(--ink-mute); }
.search .kbd{
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-secondary);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  background: var(--bg-elevated);
}

.seg{
  display:flex;
  padding: 4px;
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  gap: 2px;
}
.seg button{
  flex: 1;
  border: 0; background: transparent;
  padding: 7px 14px;
  border-radius: var(--r-full);
  font: 500 12.5px/1 var(--sans);
  color: var(--ink-secondary);
}
.seg button.active{ background: var(--ink-primary); color: var(--bg-paper); }

.filter-chip{
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 5px 10px 5px 10px;
  font-size: 12px;
  color: var(--ink-primary);
  margin-top: 6px;
}
.filter-chip .pin{ width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.filter-chip .x{ color: var(--ink-mute); line-height: 1; padding: 0 2px; cursor: pointer; }

.side-foot{
  margin-top: auto;
  display:flex; align-items:center; gap:10px;
  padding: 14px 10px 4px;
  border-top: 1px solid var(--border);
}
.side-foot .meta{ display:flex; flex-direction:column; line-height: 1.25; min-width:0; flex:1; }
.side-foot .name{ font-size: 13.5px; font-weight: 500; }
.side-foot .role{ font-size: 11.5px; color: var(--ink-secondary); }
.side-foot .more{ color: var(--ink-mute); padding: 6px; border-radius: 8px; }
.side-foot .more:hover{ background: var(--bg-subtle); color: var(--ink-primary); }

/* ---- Buttons -------------------------------------------- */
.btn{
  display:inline-flex; align-items:center; gap:8px;
  font: 500 13.5px/1 var(--sans);
  border-radius: var(--r);
  padding: 11px 18px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-primary);
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:active{ transform: translateY(1px); }
.btn.primary  { background: var(--ink-primary); color: var(--bg-paper); }
.btn.primary:hover{ background: #FFFFFF; }
.btn.secondary{ background: transparent; color: var(--ink-primary); border-color: var(--ink-primary); }
.btn.secondary:hover{ background: var(--ink-primary); color: var(--bg-paper); }
.btn.ghost    { background: var(--bg-surface); color: var(--ink-primary); border-color: var(--border); }
.btn.ghost:hover{ background: var(--bg-subtle); }
.btn.accent   { background: var(--accent); color: var(--bg-paper); }
.btn.accent:hover{ background: var(--accent-2); }
.btn.danger   { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.btn.pill     { border-radius: var(--r-full); padding: 8px 14px; font-size: 12.5px; }
.btn.sm       { padding: 7px 11px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Chips ---------------------------------------------- */
.chip{
  display:inline-flex; align-items:center; gap:5px;
  font: 500 11.5px/1 var(--sans);
  padding: 5px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--ink-primary);
  white-space: nowrap;
}
.chip.mono{ font-family: var(--mono); font-size: 11px; }
.chip.up     { color: var(--success); border-color: #D2DCC4; background: var(--success-bg); }
.chip.down   { color: var(--danger);  border-color: #E7C9B9; background: var(--danger-bg); }
.chip.success{ color: var(--success); border-color: #D2DCC4; background: var(--success-bg); }
.chip.warn   { color: var(--warning); border-color: #E6D2A8; background: var(--warning-bg); }
.chip.danger { color: var(--danger);  border-color: #E7C9B9; background: var(--danger-bg); }
.chip.info   { color: var(--info);    border-color: #CFD4DC; background: var(--info-bg); }
.chip.accent { color: var(--accent);  border-color: #E8C9A8; background: var(--accent-bg); }
.chip.mute   { color: var(--ink-secondary); background: var(--bg-subtle); border-color: var(--border); }
.chip.dark   { background: var(--ink-primary); color: var(--bg-paper); border-color: var(--ink-primary); }

.status-dot{
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(19,18,16,0.65);
  flex-shrink: 0;
}
.status-dot.amber{ background: var(--warning); }
.status-dot.red  { background: var(--danger); }
.status-dot.gray { background: var(--ink-mute); }
.status-dot.sm   { width: 8px; height: 8px; box-shadow: 0 0 0 2px rgba(19,18,16,0.65); }
.status-dot.solid{ box-shadow: none; }

/* ---- Cards ---------------------------------------------- */
.card{
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.card.lg{ border-radius: var(--r-lg); }

.panel{
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px 24px;
}
.panel.lg{ padding: 26px 28px; }
.panel.xl{ padding: 32px 36px; }

/* ---- Section heads -------------------------------------- */
.section-head{
  display:flex; align-items:flex-end; justify-content:space-between;
  gap:16px;
  margin: 0 0 18px;
  flex-wrap: wrap;
}
.section-head .meta{ font-size: 13px; color: var(--ink-secondary); margin-top: 4px; }
.section-head .right{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

/* ---- Page head ------------------------------------------ */
.page-head{
  display:flex; align-items:flex-end; justify-content:space-between;
  gap:24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.page-head .sub{ color: var(--ink-secondary); font-size: 14.5px; margin-top: 8px; line-height: 1.5; }
.page-head .sub b{
  color: var(--ink-primary);
  font-family: var(--mono); font-weight: 600; font-size: 13.5px;
  margin: 0 2px;
}

/* ---- Tables --------------------------------------------- */
table.tbl{
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.tbl thead th{
  text-align: left;
  font-family: var(--sans); font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  position: sticky; top: 0;
}
table.tbl tbody td{
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-2);
  vertical-align: middle;
}
table.tbl tbody tr:hover td{ background: var(--bg-subtle); }
table.tbl tbody tr:last-child td{ border-bottom: 0; }
table.tbl td.ts, table.tbl td.dur, table.tbl td.num{ font-family: var(--mono); font-size: 12.5px; }
table.tbl td.ts{ color: var(--ink-secondary); white-space: nowrap; }
table.tbl td.proj{ font-weight: 500; }

/* ---- Skill chip ----------------------------------------- */
.skill-chip{
  font: 500 11.5px/1 var(--sans);
  padding: 5px 10px;
  border-radius: var(--r-full);
  background: var(--bg-paper);
  border: 1px solid var(--border);
  color: var(--ink-primary);
  white-space: nowrap;
}
.skill-chip.banned{
  background: var(--danger-bg);
  border-color: #E7C9B9;
  color: var(--danger);
  text-decoration: line-through;
  text-decoration-color: rgba(176,82,59,0.45);
  text-decoration-thickness: 1px;
}

/* ---- Skeleton + shimmer --------------------------------- */
.skel{
  display: inline-block;
  background: linear-gradient(90deg, var(--bg-subtle) 0%, var(--bg-elevated) 50%, var(--bg-subtle) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes shimmer{
  0%{ background-position: 200% 0; }
  100%{ background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce){
  .skel{
    animation: pulse 2s linear infinite;
    background: var(--bg-subtle);
  }
  @keyframes pulse{ 0%,100%{ opacity:0.6 } 50%{ opacity:1 } }
}

/* ---- Empty state ---------------------------------------- */
.empty{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding: 64px 24px;
  text-align: center;
  color: var(--ink-secondary);
}
.empty .ill{ width: 108px; height: 108px; margin-bottom: 18px; color: var(--border-strong); }
.empty .title{
  font-family: var(--display);
  color: var(--ink-primary);
  font-size: 20px; font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}
.empty .sub{ font-size: 13.5px; max-width: 400px; margin-bottom: 18px; line-height: 1.55; }

/* ---- Bottom nav (mobile) -------------------------------- */
.bottom-nav{
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 68px;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  display: none;
  z-index: 40;
  box-shadow: 0 -8px 24px -16px rgba(20,20,20,0.16);
}
.bottom-nav .inner{ display: grid; grid-template-columns: repeat(4, 1fr); height: 100%; }
.bottom-nav button{
  background: transparent; border: 0;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap: 4px; padding: 10px 4px;
  color: var(--ink-secondary);
  font-size: 11px; font-weight: 500;
  position: relative;
}
.bottom-nav button.active{ color: var(--ink-primary); }
.bottom-nav button.active::before{
  content:""; position: absolute; top: 0; height: 2px; width: 32px;
  background: var(--ink-primary); border-radius: 0 0 2px 2px;
}
@media (max-width: 767px){ .bottom-nav{ display: block; } }

/* ---- Layout helpers ------------------------------------- */
.row{ display: flex; align-items: center; gap: 8px; }
.col{ display: flex; flex-direction: column; gap: 8px; }
.grow{ flex: 1; min-width: 0; }
.gap-2{ gap: 8px; } .gap-3{ gap: 12px; } .gap-4{ gap: 16px; } .gap-5{ gap: 20px; } .gap-6{ gap: 24px; }
.mt-2{ margin-top: 8px; } .mt-4{ margin-top: 16px; } .mt-6{ margin-top: 24px; } .mt-8{ margin-top: 32px; }
.mb-2{ margin-bottom: 8px; } .mb-4{ margin-bottom: 16px; } .mb-6{ margin-bottom: 24px; } .mb-8{ margin-bottom: 32px; }
.show-mobile{ display: none; }
@media (max-width: 767px){
  .hide-mobile{ display: none !important; }
  .show-mobile{ display: initial; }
  .show-mobile.row{ display: flex; }
}
@media (max-width: 1023px){ .hide-tablet{ display: none !important; } }

/* ---- Command palette ------------------------------------ */
.cp-scrim{
  position: fixed; inset: 0; z-index: 90;
  background: rgba(20,20,20,0.35);
  backdrop-filter: blur(6px);
  display:flex; align-items:flex-start; justify-content:center;
  padding-top: 14vh;
}
.cp{
  width: min(680px, 92vw);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.cp-search{
  display:flex; align-items:center; gap:12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.cp-search input{
  border:0; outline:0; background: transparent; flex:1;
  font: 400 17px/1.4 var(--sans);
}
.cp-section{
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-2);
}
.cp-section:last-child{ border-bottom: 0; }
.cp-section .h{
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-mute);
  padding: 10px 12px 6px;
}
.cp-row{
  display:flex; align-items:center; gap:12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}
.cp-row .icon{
  width: 24px; height: 24px; border-radius: 7px;
  background: var(--bg-subtle);
  display:grid; place-items:center;
  color: var(--ink-secondary);
  flex-shrink:0;
}
.cp-row .name{ flex: 1; min-width: 0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cp-row .hint{ font-family: var(--mono); font-size: 11px; color: var(--ink-mute); }
.cp-row.active{ background: var(--bg-subtle); }
.cp-footer{
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-paper);
  font-size: 11.5px; color: var(--ink-secondary);
}
.cp-footer .keys{ display:flex; gap:14px; }
.cp-footer .kbd{
  font-family: var(--mono); font-size: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  background: var(--bg-subtle);
}

/* ---- Project card --------------------------------------- */
.proj-card{
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  cursor: pointer;
  position: relative;
  text-align: left;
  width: 100%;
}
.proj-card:hover{
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.proj-card.blocked{ box-shadow: inset 4px 0 0 var(--danger); }
.proj-card.stale  { box-shadow: inset 4px 0 0 var(--warning); }
.proj-card .hero{
  height: 160px;
  position: relative;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.proj-card .hero svg{ display:block; width:100%; height:100%; }
.proj-card .hero .corner{
  position: absolute; top: 14px; right: 14px;
  display:flex; align-items:center; gap:6px;
}
.cat-pill{
  font: 600 11px/1 var(--sans);
  padding: 6px 10px;
  border-radius: var(--r-full);
  background: rgba(19,18,16,0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink-primary);
  border: 1px solid rgba(244,239,229,0.16);
}
.proj-card .body{ padding: 18px 22px 20px; }
.proj-card .body h3{
  font-family: var(--display); font-weight: 700; font-size: 19px;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.proj-card .body .last{
  display:flex; gap:6px; align-items:center;
  font-size: 12.5px; color: var(--ink-secondary);
  margin-bottom: 14px;
}
.proj-card .body .ts{ font-family: var(--mono); font-size: 12px; color: var(--ink-primary); }
.proj-card .body .foot{
  display:flex; align-items:center; justify-content:space-between;
  border-top: 1px solid var(--border-2);
  padding-top: 12px;
  font-size: 12px;
  color: var(--ink-secondary);
}
.proj-card .body .foot b{
  font-family: var(--mono); font-weight: 600;
  color: var(--ink-primary); font-size: 12.5px;
}
.momentum{ display:inline-flex; gap:3px; align-items:center; }
.momentum i{
  width:6px; height:6px; border-radius:50%;
  background: var(--bg-subtle); display:inline-block;
  border: 1px solid var(--border);
}
.momentum i.on    { background: var(--ink-primary); border-color: var(--ink-primary); }
.momentum i.warn  { background: var(--warning);    border-color: var(--warning); }
.momentum i.danger{ background: var(--danger);     border-color: var(--danger); }

/* ---- KPI card (refonte) --------------------------------- */
.kpi{
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px 24px 20px;
  display:flex; flex-direction: column; gap: 6px;
  position: relative;
  transition: box-shadow .2s ease;
}
.kpi:hover{ box-shadow: var(--shadow-sm); }
.kpi .label{ font-size: 12.5px; color: var(--ink-secondary); font-weight: 500; }
.kpi .value{
  font-family: var(--display); font-weight: 700;
  font-size: 40px; line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink-primary);
}
.kpi .row{ display:flex; align-items:center; justify-content:space-between; margin-top: 2px; gap:8px; }
.kpi .hint{ font-size: 12px; color: var(--ink-secondary); }
.kpi svg.sparkline{ width: 100%; height: 36px; margin-top: 8px; display: block; }
.kpi.primary{ padding: 26px 28px 22px; }
.kpi.primary .value{ font-size: 52px; letter-spacing: -0.035em; }
.kpi.primary .label{ font-size: 13.5px; }

/* ---- Decisions row -------------------------------------- */
.decision{
  display:flex; gap:16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-2);
  align-items:flex-start;
}
.decision:last-child{ border-bottom: 0; padding-bottom: 4px; }
.decision .bar{ width: 4px; align-self: stretch; border-radius: 2px; background: var(--ink-mute); flex-shrink: 0; }
.decision.urgent .bar{ background: var(--danger); }
.decision.med    .bar{ background: var(--warning); }
.decision.low    .bar{ background: var(--success); }
.decision.info   .bar{ background: var(--info); }
.decision .body{ flex: 1; min-width: 0; }
.decision h4{
  font-family: var(--display); font-weight: 600; font-size: 16px;
  letter-spacing: -0.015em;
  margin: 0 0 5px;
}
.decision .meta{
  font-size: 12.5px; color: var(--ink-secondary);
  display:flex; gap:8px; align-items:center; flex-wrap:wrap;
}
.decision .meta .proj{ color: var(--ink-primary); font-weight: 500; font-family: var(--mono); font-size:12px; }
.decision .meta .min { font-family: var(--mono); font-size: 11.5px; }
.decision .meta .pri { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--danger); }
.decision .meta .pri.med  { color: var(--warning); }
.decision .meta .pri.info { color: var(--info); }
.decision .meta .pri.low  { color: var(--success); }
.decision .act{ display:flex; align-items:center; gap:8px; }

/* ---- ML insight row ------------------------------------- */
.insight{
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-2);
}
.insight:last-child{ border-bottom: 0; padding-bottom: 4px; }
.insight .icn{
  width: 40px; height: 40px; border-radius: 12px;
  display:grid; place-items:center;
  flex-shrink:0;
}
.insight .icn.suc{ background: var(--success-bg); color: var(--success); }
.insight .icn.warn{ background: var(--warning-bg); color: var(--warning); }
.insight .icn.dng{ background: var(--danger-bg); color: var(--danger); }
.insight .icn.info{ background: var(--info-bg); color: var(--info); }
.insight h4{ font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: -0.015em; margin: 0 0 5px; }
.insight p{ margin: 0; font-size: 13px; color: var(--ink-secondary); line-height: 1.6; }
.insight p b{ color: var(--ink-primary); font-family: var(--mono); font-size: 12px; font-weight: 600; }
.insight p i{ font-style: normal; font-family: var(--mono); color: var(--ink-primary); }

/* ---- Stacked bars chart --------------------------------- */
.stacked-chart{
  position: relative;
  user-select: none;
}
.stacked-chart .bars-wrap{
  position: relative;
  height: 230px;
}
.stacked-chart .bars{
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 100%;
  border-bottom: 1px solid var(--border-2);
  position: relative;
}
.stacked-chart .bar-col{
  flex: 1;
  min-width: 6px;
  height: 100%;
  position: relative;
  cursor: crosshair;
}
.stacked-chart .bar-col:hover .bar-seg{ filter: brightness(1.06); }
.stacked-chart .bar-col.active::before{
  content:""; position:absolute; left:-2px; right:-2px; top:-4px; bottom:0;
  background: rgba(244,239,229,0.05);
  border-radius: 4px 4px 0 0;
}
.stacked-chart .bar-stack{
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column-reverse;
  gap: 1px;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
}
.stacked-chart .bar-seg{ width: 100%; transition: filter .15s ease; }
.stacked-chart .axis-x{
  display: flex; gap: 4px;
  margin-top: 8px;
}
.stacked-chart .axis-x .lbl{
  flex: 1;
  text-align: center;
  font: 500 10.5px/1.1 var(--mono);
  color: var(--ink-mute);
  white-space: nowrap;
  overflow: hidden;
}
.stacked-chart .tip{
  position: absolute;
  pointer-events: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 12px 14px;
  min-width: 200px;
  z-index: 5;
  font-size: 12px;
}
.stacked-chart .tip .tip-date{
  font-family: var(--display); font-weight: 700; font-size: 14px;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-2);
}
.stacked-chart .tip .tip-row{
  display: flex; align-items: center; gap: 8px;
  padding: 3px 0;
  font-size: 11.5px;
}
.stacked-chart .tip .tip-row .tip-dot{
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.stacked-chart .tip .tip-row .tip-name{
  flex: 1;
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-primary);
  font-weight: 500;
}
.stacked-chart .tip .tip-row .tip-val{
  font-family: var(--mono); font-weight: 600;
  color: var(--ink-primary);
}
.stacked-chart .tip .tip-total{
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-2);
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
}
.stacked-chart .legend{
  display: flex; flex-wrap: wrap; gap: 12px 18px;
  padding-top: 18px;
  font-size: 11.5px;
  color: var(--ink-secondary);
}
.stacked-chart .legend .swatch{
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}
.stacked-chart .legend .lg-item{
  display:flex; align-items:center; cursor:pointer;
  font-family: var(--mono);
}
.stacked-chart .legend .lg-item.off{ opacity: 0.35; }
.stacked-chart .legend .lg-item.off .swatch{ filter: grayscale(1); }

/* ---- Print ---------------------------------------------- */
@media print{
  body{ background: var(--bg-paper) !important; }
  .topbar, .sidebar, .bottom-nav, .cp-scrim{ display: none !important; }
  .app{ display: block; }
  .content{ padding: 32px 40px; }
  .print-page{ break-after: page; }
  .proj-card, .panel, .kpi{ break-inside: avoid; }
  table.tbl tr{ break-inside: avoid; }
}
