:root {
  --bg: #F2F4EC;
  --bg-2: #EAEEDF;
  --panel: #FFFFFF;
  --ink: #0B0F09;
  --ink-2: #2A2F26;
  --ink-soft: #5B6555;
  --ink-mute: #8A9282;
  --line: #E5E7DC;
  --line-2: #D9DDCB;
  --brand: #C5F02C;       /* electric lime */
  --brand-ink: #1B240A;   /* on lime */
  --brand-deep: #8DBF12;
  --cobalt: #2C6BFF;
  --cobalt-soft: #E5EEFF;
  --orange: #FF5C28;
  --orange-soft: #FFE5DC;
  --magenta: #E5247B;
  --magenta-soft: #FFE0EE;
  --teal: #14B8A6;
  --teal-soft: #D5F5F0;
  --yellow: #FFCB1F;
  --yellow-soft: #FFF3C2;
  --success: #16A34A;
  --warn: #F59E0B;
  --danger: #E11D48;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 0 rgba(11,15,9,0.04), 0 1px 2px rgba(11,15,9,0.04);
  --shadow: 0 1px 0 rgba(11,15,9,0.04), 0 6px 16px -8px rgba(11,15,9,0.10);
  --shadow-lg: 0 8px 28px -12px rgba(11,15,9,0.20);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.font-display { font-family: "Archivo", system-ui, sans-serif; letter-spacing: -0.02em; }
.font-mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.font-num { font-family: "Archivo", system-ui, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- App shell ---------- */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px 1fr;
  background: var(--bg);
}
.app.collapsed { grid-template-columns: 72px 1fr; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  position: sticky; top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px;
}
.sb-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-family: "Archivo", sans-serif; font-weight: 900;
  font-size: 16px; letter-spacing: -0.04em;
  flex-shrink: 0;
}
.sb-name { font-family: "Archivo", sans-serif; font-weight: 800; font-size: 18px; letter-spacing: -0.03em; }
.sb-sub { font-size: 10px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; margin-top: 1px; }

.sb-collapse {
  position: absolute; top: 22px; right: 14px;
  width: 22px; height: 22px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
}
.sb-collapse:hover { background: var(--bg-2); color: var(--ink); }

.sb-nav { padding: 8px 10px; overflow-y: auto; flex: 1; }
.sb-section-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-mute); font-weight: 700;
  padding: 14px 10px 6px;
}
.sb-item {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 13.5px;
  margin: 1px 0;
  position: relative;
}
.sb-item:hover { background: var(--bg-2); color: var(--ink); }
.sb-item.active {
  background: var(--ink);
  color: #fff;
}
.sb-item.active .sb-badge { background: var(--brand); color: var(--brand-ink); }
.sb-item svg { flex-shrink: 0; }
.sb-item-label { flex: 1; white-space: nowrap; overflow: hidden; }
.sb-badge {
  background: var(--bg-2); color: var(--ink-2);
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.collapsed .sb-brand { padding: 18px 0 16px; justify-content: center; }
.collapsed .sb-name, .collapsed .sb-sub, .collapsed .sb-section-label, .collapsed .sb-item-label, .collapsed .sb-badge, .collapsed .sb-foot-meta { display: none; }
.collapsed .sb-item { justify-content: center; padding: 9px; }
.collapsed .sb-foot { justify-content: center; }
.collapsed .sb-collapse { display: none; }

.sb-foot {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  border-radius: 0;
  transition: background 120ms;
  position: relative;
}
.sb-foot:hover { background: var(--bg-2); }
.sb-foot-meta { flex: 1; min-width: 0; }
.sb-foot-meta .name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-foot-meta .role { font-size: 11px; color: var(--ink-mute); }

/* Sidebar search */
.sb-search {
  margin: 0 10px 6px;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px;
}
.sb-search input {
  background: none; border: none; outline: none;
  font-size: 12.5px; color: var(--ink); flex: 1;
  font-family: inherit;
}
.sb-search input::placeholder { color: var(--ink-mute); }

/* User menu popover (opens above sb-foot) */
.sb-user-menu {
  position: absolute;
  bottom: calc(100% + 6px); left: 10px; right: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 -8px 32px -8px rgba(11,15,9,0.18);
  overflow: hidden;
  z-index: 50;
  animation: slideUp 150ms ease-out;
}
.sb-user-menu-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.sb-menu-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  font-size: 13px; font-weight: 500; font-family: inherit;
  color: var(--ink-soft); text-align: left;
  background: none; border: none; cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background 100ms, color 100ms;
}
.sb-menu-item:last-child { border-bottom: none; }
.sb-menu-item:hover { background: var(--bg-2); color: var(--ink); }
.sb-menu-item.danger { color: var(--danger); }
.sb-menu-item.danger:hover { background: rgba(220,38,38,0.06); }
.sb-menu-divider { height: 1px; background: var(--line); margin: 0; }
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px;
  font-family: "Archivo", sans-serif;
  flex-shrink: 0;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.avatar.xl { width: 64px; height: 64px; font-size: 22px; }
.avatar.cobalt { background: var(--cobalt); color: #fff; }
.avatar.orange { background: var(--orange); color: #fff; }
.avatar.magenta { background: var(--magenta); color: #fff; }
.avatar.teal { background: var(--teal); color: #fff; }
.avatar.ink { background: var(--ink); color: var(--brand); }

/* ---------- Topbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.crumbs .crumb-sep { color: var(--ink-mute); }
.crumbs .crumb-now { color: var(--ink); font-weight: 600; }

.tb-search {
  flex: 1; max-width: 420px;
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 12px;
  color: var(--ink-soft);
  font-size: 13px;
  transition: border-color 120ms;
}
.tb-search:focus-within { border-color: var(--ink); }
.tb-search input { flex: 1; background: none; border: none; outline: none; color: var(--ink); font-size: 13px; }
.tb-kbd { font-family: "JetBrains Mono", monospace; font-size: 10px; padding: 2px 6px; border-radius: 5px; background: var(--bg-2); color: var(--ink-soft); border: 1px solid var(--line); }

.tb-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2);
  position: relative;
}
.tb-icon:hover { background: var(--bg-2); }
.tb-icon .dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); border: 2px solid var(--bg); }

.tb-user {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.tb-user:hover { background: var(--bg-2); }

/* ---------- Page ---------- */
.page { padding: 24px 28px 48px; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.page-title {
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-size: 30px;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.page-sub { color: var(--ink-soft); font-size: 14px; margin-top: 6px; }
.page-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  white-space: nowrap;
  transition: transform 80ms, background 120ms, border-color 120ms;
}
.btn:hover { background: var(--bg-2); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.btn.primary:hover { background: #000; }
.btn.brand {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.btn.brand:hover { background: #b8e120; }
.btn.ghost {
  background: transparent; border-color: transparent;
}
.btn.ghost:hover { background: var(--bg-2); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.lg { padding: 11px 18px; font-size: 14px; }
.btn.icon-only { padding: 8px; }

/* ---------- Cards ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card.hoverable { transition: transform 120ms, box-shadow 120ms; }
.card.hoverable:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title { font-family: "Archivo", sans-serif; font-weight: 700; font-size: 15px; letter-spacing: -0.02em; }
.card-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- KPI cards ---------- */
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.kpi .kpi-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-soft); font-weight: 700;
}
.kpi .kpi-value {
  font-family: "Archivo", sans-serif; font-weight: 800;
  font-size: 32px; letter-spacing: -0.035em; line-height: 1;
  margin: 12px 0 8px;
}
.kpi .kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.kpi .trend { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.kpi .trend.up { color: var(--success); }
.kpi .trend.down { color: var(--danger); }
.kpi .kpi-spark { position: absolute; right: 16px; top: 14px; opacity: 0.85; }
.kpi.hero {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.kpi.hero .kpi-label { color: rgba(255,255,255,0.65); }
.kpi.hero .kpi-foot { color: rgba(255,255,255,0.7); }
.kpi.brand {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.kpi.brand .kpi-label { color: rgba(27,36,10,0.7); }
.kpi.brand .kpi-foot { color: rgba(27,36,10,0.7); }

/* ---------- Grid helpers ---------- */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-12 { grid-template-columns: repeat(12, 1fr); }
.col-8 { grid-column: span 8; }
.col-7 { grid-column: span 7; }
.col-6 { grid-column: span 6; }
.col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .col-8, .col-7, .col-6, .col-5, .col-4, .col-3 { grid-column: span 12; }
}
@media (max-width: 720px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
  background: var(--bg-2);
  color: var(--ink-2);
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ink { background: var(--ink); color: #fff; }
.badge.brand { background: var(--brand); color: var(--brand-ink); }
.badge.cobalt { background: var(--cobalt-soft); color: var(--cobalt); }
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.magenta { background: var(--magenta-soft); color: var(--magenta); }
.badge.teal { background: var(--teal-soft); color: #0d8a7c; }
.badge.yellow { background: var(--yellow-soft); color: #946800; }
.badge.green { background: #DCFBA9; color: #3F5B0F; }
.badge.gray { background: var(--bg-2); color: var(--ink-soft); }
.badge.outline { background: transparent; border-color: var(--line-2); color: var(--ink-soft); }
.badge.success { background: #DCFCE7; color: #166534; }
.badge.danger { background: #FEE2E2; color: var(--danger); }

/* ---------- Table ---------- */
.table { width: 100%; border-collapse: collapse; }
.table thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  font-weight: 700;
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg); }
.table .cell-num { font-family: "Archivo", sans-serif; font-variant-numeric: tabular-nums; font-weight: 600; }

.tableholder {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.t-search {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px 10px;
  flex: 1;
  max-width: 280px;
}
.t-search input { background: none; border: none; outline: none; width: 100%; font-size: 13px; }
.tab-row { display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); }
.tab {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.tab .tab-count { background: var(--bg-2); color: var(--ink-soft); padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.tab.active .tab-count { background: var(--ink); color: var(--brand); }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
  width: 100%;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); }
.input.error { border-color: var(--danger); }
.field-hint { font-size: 11px; color: var(--ink-mute); }
.field-err { font-size: 11px; color: var(--danger); }
.switch {
  width: 32px; height: 18px;
  border-radius: 999px; background: var(--line-2);
  position: relative; transition: background 120ms;
  flex-shrink: 0;
}
.switch::after {
  content: ""; position: absolute;
  width: 14px; height: 14px;
  background: #fff; border-radius: 50%;
  top: 2px; left: 2px;
  transition: left 120ms;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.switch.on { background: var(--ink); }
.switch.on::after { left: 16px; }
.switch.on.brand { background: var(--brand-deep); }

.checkbox {
  width: 16px; height: 16px;
  border: 1.5px solid var(--line-2);
  border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel);
  flex-shrink: 0;
}
.checkbox.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Chart helpers ---------- */
.chart-wrap { position: relative; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-soft); }
.chart-legend .swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }

.seg { display: inline-flex; padding: 3px; background: var(--bg-2); border-radius: 10px; }
.seg button {
  padding: 5px 12px;
  font-size: 12px; font-weight: 600;
  color: var(--ink-soft);
  border-radius: 7px;
}
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 14px; }
.kanban .col {
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 200px;
}
.kanban .col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; }
.kanban .col-head .col-name { font-family: "Archivo", sans-serif; font-weight: 700; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.kanban .col-head .col-count { background: var(--panel); padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--ink); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.kanban .col-tag { width: 8px; height: 8px; border-radius: 50%; }
.kcard {
  background: var(--panel);
  border-radius: 11px;
  border: 1px solid var(--line);
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform 100ms, box-shadow 120ms;
  cursor: pointer;
}
.kcard:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.kcard .kc-top { display: flex; align-items: center; justify-content: space-between; }
.kcard .kc-title { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.kcard .kc-meta { font-size: 11.5px; color: var(--ink-soft); display: flex; align-items: center; gap: 10px; }
.kcard .kc-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 6px; border-top: 1px dashed var(--line-2); }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--line); }
.muted { color: var(--ink-soft); }
.mono { font-family: "JetBrains Mono", monospace; }

.placeholder-img {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(11,15,9,0.04) 0 8px,
      rgba(11,15,9,0.07) 8px 16px
    ),
    var(--bg-2);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-mute);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  border: 1px solid var(--line);
}

/* ---------- Modal / Drawer ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(11,15,9,0.36);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn 140ms ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideRight { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.modal {
  background: var(--panel);
  border-radius: 18px;
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  animation: slideUp 220ms cubic-bezier(0.2,0.8,0.2,1);
  box-shadow: var(--shadow-lg);
}
.modal.lg { max-width: 820px; }
.modal-head, .modal-foot {
  padding: 18px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.modal-head { border-bottom: 1px solid var(--line); }
.modal-foot { border-top: 1px solid var(--line); }
.modal-body { padding: 22px; }
.modal-title { font-family: "Archivo", sans-serif; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(560px, 100vw);
  background: var(--panel);
  z-index: 51;
  display: flex; flex-direction: column;
  animation: slideRight 220ms cubic-bezier(0.2,0.8,0.2,1);
  box-shadow: var(--shadow-lg);
}

/* ---------- Pipeline ---------- */
.pipeline { display: flex; gap: 4px; }
.pipeline .step {
  flex: 1;
  padding: 9px 12px;
  background: var(--bg-2);
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  position: relative;
}
.pipeline .step:first-child { border-top-left-radius: 9px; border-bottom-left-radius: 9px; }
.pipeline .step:last-child { border-top-right-radius: 9px; border-bottom-right-radius: 9px; }
.pipeline .step.done { background: var(--ink); color: var(--brand); }
.pipeline .step.now { background: var(--brand); color: var(--brand-ink); }

/* ---------- Activity timeline ---------- */
.feed { display: flex; flex-direction: column; }
.feed-item {
  display: flex; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
  cursor: pointer;
}
.feed-item:last-child { border-bottom: none; }
.feed-item:hover { background: var(--bg); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 8px; }
.feed-ico {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.feed-body { flex: 1; min-width: 0; }
.feed-title { font-size: 13.5px; font-weight: 600; }
.feed-meta { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item::before {
  content: ""; position: absolute;
  left: -22px; top: 5px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--panel);
  border: 3px solid var(--ink);
}
.tl-item.brand::before { border-color: var(--brand-deep); }
.tl-item.cobalt::before { border-color: var(--cobalt); }
.tl-item.orange::before { border-color: var(--orange); }
.tl-time { font-size: 11px; color: var(--ink-mute); }
.tl-title { font-weight: 600; font-size: 13.5px; margin-top: 2px; }
.tl-body { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; }

/* skeletons */
.skel {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* toast */
.toast-stack { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast {
  background: var(--ink); color: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: slideUp 200ms ease-out;
  min-width: 240px;
}
.toast.brand { background: var(--brand); color: var(--brand-ink); }
.toast .toast-ico { color: var(--brand); }

/* scroll */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-mute); }

/* utility */
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 22px; }
.text-3xl { font-size: 28px; }
.text-4xl { font-size: 36px; }
.fw-7 { font-weight: 700; }
.fw-6 { font-weight: 600; }
.fw-5 { font-weight: 500; }
.text-mute { color: var(--ink-soft); }
.text-mute-2 { color: var(--ink-mute); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.w-full { width: 100%; }
.center { display: flex; align-items: center; justify-content: center; }

/* progress bar */
.bar { background: var(--bg-2); border-radius: 999px; overflow: hidden; height: 6px; }
.bar > span { display: block; height: 100%; background: var(--ink); border-radius: inherit; }

/* Empty state */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-soft);
}
.empty .e-ico {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  margin-bottom: 14px;
}
.empty .e-title { font-family: "Archivo", sans-serif; font-weight: 700; font-size: 16px; color: var(--ink); }
.empty .e-body { font-size: 13px; margin-top: 4px; max-width: 320px; }

/* dropdown notif */
.dd {
  position: absolute; top: 46px; right: 0;
  width: 360px; max-height: 480px; overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 30;
  animation: slideUp 180ms ease-out;
}
.dd-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.dd-item { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; }
.dd-item:last-child { border-bottom: none; }
.dd-item:hover { background: var(--bg); }
.dd-item.unread { background: linear-gradient(90deg, rgba(197,240,44,0.08), transparent 60%); }

/* permission matrix */
.matrix { width: 100%; border-collapse: separate; border-spacing: 0; }
.matrix th, .matrix td { padding: 10px 12px; font-size: 13px; }
.matrix thead th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-mute); font-weight: 700; text-align: center; background: var(--bg); }
.matrix thead th:first-child { text-align: left; }
.matrix tbody td { border-top: 1px solid var(--line); text-align: center; vertical-align: middle; }
.matrix tbody td:first-child { text-align: left; font-weight: 600; }

/* invoice */
.invoice-paper {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 36px 40px;
  font-size: 13px;
  box-shadow: var(--shadow);
}
