/* RevenueIQ design system - Lexend Deca */
@font-face {
  font-family: "Lexend Deca";
  src: url("/static/fonts/lexend-deca.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f3f4fa;
  --panel: #ffffff;
  --panel-2: #f8f9fd;
  --line: #e7e9f2;
  --line-2: #eff1f7;
  --text: #121433;
  --text-2: #4a4e6d;
  --muted: #8d91ab;
  --primary: #5b4cf0;
  --primary-d: #4636d8;
  --primary-soft: #efedff;
  --primary-grad: linear-gradient(135deg, #7c6cff 0%, #5b4cf0 45%, #3f2fd1 100%);
  --high: #e5484d;
  --high-soft: #fff0f0;
  --med: #e5900b;
  --med-soft: #fff6e6;
  --low: #12a571;
  --low-soft: #e8f8f1;
  --blue: #1b8fd8;
  --blue-soft: #e8f4fc;
  --pink: #e0498f;
  --side: #0d0f26;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(18, 20, 51, .04), 0 6px 20px -10px rgba(18, 20, 51, .10);
  --shadow-md: 0 2px 4px rgba(18, 20, 51, .05), 0 14px 30px -12px rgba(18, 20, 51, .18);
  --shadow-lg: 0 24px 60px -12px rgba(18, 20, 51, .30);
  font-family: "Lexend Deca", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; letter-spacing: -.005em;
  background: radial-gradient(1200px 500px at 70% -200px, #e6e3ff 0%, transparent 60%), var(--bg);
  background-attachment: fixed;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-d); }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; }
.num, .tnum { font-variant-numeric: tabular-nums; }
::selection { background: #d9d4ff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d3d6e4; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #b9bdd1; background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

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

/* ================================================================ sidebar */
.sidebar {
  width: 252px; flex-shrink: 0; background: linear-gradient(180deg, #11143a 0%, #0b0d22 100%);
  color: #b9bddb; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  padding: 22px 14px 18px; z-index: 40;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 2px 10px 26px; color: #fff; }
.brand:hover { color: #fff; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--primary-grad); display: grid; place-items: center;
  box-shadow: 0 8px 20px -6px rgba(124, 108, 255, .7), inset 0 1px 0 rgba(255, 255, 255, .25); flex-shrink: 0; }
.brand-mark svg { width: 24px; height: 24px; }
.brand b { display: block; font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
.brand small { display: block; font-size: 11.5px; color: #7f84a8; font-weight: 400; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #5e6389; padding: 6px 12px 8px; font-weight: 500; }
.sidebar nav { display: flex; flex-direction: column; gap: 3px; }
.sidebar nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; color: #a9aed0; font-weight: 450; font-size: 14px; transition: background .15s, color .15s; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.sidebar nav a.active { background: linear-gradient(90deg, rgba(124, 108, 255, .22), rgba(124, 108, 255, .06)); color: #fff; }
.sidebar nav a.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: #8b7dff; }
.sidebar nav a.active i { color: #a99fff; }
.sidebar nav i { width: 19px; height: 19px; display: inline-flex; flex-shrink: 0; }
.nav-count { margin-left: auto; background: #6d5ef5; color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.nav-count:empty { display: none; }
.sidebar-foot { margin-top: auto; padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); font-size: 12px; color: #7f84a8; }
.sidebar-foot .sf-t { display: flex; align-items: center; gap: 8px; color: #e4e6f7; font-weight: 550; font-size: 13px; margin-bottom: 4px; }
.sidebar-foot .pulse { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .18); }

/* ================================================================ topbar */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { min-height: 76px; display: flex; align-items: center; gap: 16px; padding: 14px 36px; position: sticky; top: 0; z-index: 30;
  background: rgba(243, 244, 250, .82); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid rgba(231, 233, 242, .8); }
.topbar .titles { min-width: 0; }
.topbar h1 { font-size: 22px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .subtitle { font-size: 13px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.date-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); background: var(--panel); border: 1px solid var(--line); padding: 8px 13px; border-radius: 30px; }
.date-pill i { width: 15px; height: 15px; display: inline-flex; color: var(--muted); }
.user-pill { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); padding: 5px 8px 5px 5px; border-radius: 40px; }
.user-pill select { border: 0; background: transparent; padding: 4px 22px 4px 2px; font-weight: 500; box-shadow: none !important; cursor: pointer; }
.user-pill .who small { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.1; padding-left: 2px; }
.menu-btn { display: none; }
.content { padding: 28px 36px 60px; width: 100%; max-width: 1520px; margin: 0 auto; }

/* ================================================================ layout */
.grid { display: grid; gap: 20px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); }
.kpis-3 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-main { grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); }
.cols-side { grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.mt { margin-top: 20px; }
.mt-s { margin-top: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sticky { position: sticky; top: 96px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.panel-h { display: flex; align-items: center; gap: 12px; padding: 18px 22px 0; flex-wrap: wrap; }
.panel-h h3 { font-size: 15.5px; font-weight: 600; }
.panel-h .sub { font-size: 12.5px; color: var(--muted); width: 100%; margin-top: -8px; }
.panel-h .h-txt { min-width: 0; flex: 1; }
.panel-h .h-txt .sub { width: auto; margin-top: 2px; display: block; }
.panel-b { padding: 18px 22px 22px; }
.panel-b.flush { padding: 10px 0 6px; }
.section-gap { height: 4px; }

/* ================================================================ hero */
.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 28px 32px; color: #fff; background: var(--primary-grad);
  box-shadow: 0 20px 40px -18px rgba(79, 62, 230, .65); display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .08); pointer-events: none; }
.hero::before { width: 360px; height: 360px; right: -90px; top: -160px; }
.hero::after { width: 220px; height: 220px; right: 180px; bottom: -150px; background: rgba(255, 255, 255, .06); }
.hero .h-main { position: relative; flex: 1; min-width: 280px; }
.hero .eyebrow { font-size: 12.5px; opacity: .8; font-weight: 450; letter-spacing: .02em; }
.hero h2 { font-size: 26px; font-weight: 600; margin-top: 4px; letter-spacing: -.025em; }
.hero p { margin: 8px 0 0; font-size: 14.5px; opacity: .9; max-width: 640px; font-weight: 300; }
.hero p b { font-weight: 600; opacity: 1; }
.hero .h-actions { position: relative; display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn { border: 0; }
.hero .btn.light { background: #fff; color: var(--primary-d); }
.hero .btn.light:hover { background: #f1efff; }
.hero .btn.glass { background: rgba(255, 255, 255, .16); color: #fff; backdrop-filter: blur(4px); }
.hero .btn.glass:hover { background: rgba(255, 255, 255, .26); }

/* ================================================================ KPI */
.kpi { padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.kpi .k-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.kpi .k-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.kpi .k-ico i { width: 21px; height: 21px; display: inline-flex; }
.kpi .label { font-size: 13px; color: var(--text-2); font-weight: 450; display: flex; align-items: center; gap: 6px; min-width: 0; }
.kpi .value { font-size: 28px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .foot { font-size: 12.5px; color: var(--muted); }
.tone-primary .k-ico { background: var(--primary-soft); color: var(--primary); }
.tone-high .k-ico { background: var(--high-soft); color: var(--high); }
.tone-high .value { color: var(--high); }
.tone-low .k-ico { background: var(--low-soft); color: var(--low); }
.tone-low .value { color: var(--low); }
.tone-med .k-ico { background: var(--med-soft); color: var(--med); }
.tone-blue .k-ico { background: var(--blue-soft); color: var(--blue); }
.info-i { width: 14px; height: 14px; display: inline-flex; opacity: .5; cursor: help; flex-shrink: 0; }

/* ================================================================ buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--panel); font-weight: 500; font-size: 13.5px; cursor: pointer; white-space: nowrap; color: var(--text); transition: all .15s; line-height: 1.2; }
.btn:hover { background: var(--panel-2); border-color: #d6d9e7; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--primary-grad); border-color: transparent; color: #fff; box-shadow: 0 6px 14px -6px rgba(91, 76, 240, .7); }
.btn.primary:hover { filter: brightness(1.06); color: #fff; }
.btn.success { background: linear-gradient(135deg, #22c38e, #0f9a68); border-color: transparent; color: #fff; box-shadow: 0 6px 14px -6px rgba(18, 165, 113, .7); }
.btn.success:hover { filter: brightness(1.05); color: #fff; }
.btn.danger { color: var(--high); }
.btn.danger:hover { background: var(--high-soft); border-color: #ffd0d1; color: var(--high); }
.btn.danger-solid { background: var(--high); border-color: var(--high); color: #fff; }
.btn.sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; gap: 6px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: rgba(18, 20, 51, .05); }
.btn i { width: 16px; height: 16px; display: inline-flex; }
.btn.sm i { width: 14px; height: 14px; }
.icon-btn { border: 0; background: transparent; width: 36px; height: 36px; border-radius: 10px; cursor: pointer; display: inline-grid; place-items: center; color: var(--text-2); flex-shrink: 0; }
.icon-btn:hover { background: rgba(18, 20, 51, .06); }
.icon-btn i { width: 19px; height: 19px; display: inline-flex; }

input[type=text], input[type=search], input[type=date], input[type=number], select, textarea {
  border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; background: var(--panel); outline: none; min-width: 0; font-size: 13.5px; transition: border-color .15s, box-shadow .15s; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d91ab' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 15px; }
input:focus, select:focus, textarea:focus { border-color: #a79dff; box-shadow: 0 0 0 4px rgba(91, 76, 240, .12); }
input:disabled, select:disabled { background-color: var(--panel-2); color: var(--muted); cursor: not-allowed; }
textarea { width: 100%; resize: vertical; min-height: 84px; line-height: 1.5; }
.search { position: relative; display: flex; align-items: center; }
.search i { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--muted); display: inline-flex; pointer-events: none; }
.search input { padding-left: 38px; width: 250px; }
label.field { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--text-2); min-width: 0; }

/* ================================================================ badges, chips, avatars */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 30px; font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 1.5; }
.badge .dot { width: 6px; height: 6px; }
.badge.High, .badge.Urgent, .badge.Churned { background: var(--high-soft); color: var(--high); }
.badge.Medium, .badge.Downgraded { background: var(--med-soft); color: #c27500; }
.badge.Low, .badge.Saved { background: var(--low-soft); color: var(--low); }
.badge.neutral, .badge.No { background: #f0f1f6; color: var(--text-2); }
.badge.info { background: var(--blue-soft); color: var(--blue); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: currentColor; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: #f2f3f8; color: var(--text-2); font-size: 12px; font-weight: 450; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 11.5px; font-weight: 600; display: inline-grid; place-items: center; flex-shrink: 0; box-shadow: 0 0 0 2px #fff; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.logo { width: 38px; height: 38px; border-radius: 11px; display: inline-grid; place-items: center; color: #fff; font-weight: 600; font-size: 13.5px; flex-shrink: 0; letter-spacing: 0; }
.logo.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 11.5px; }
.logo.lg { width: 72px; height: 72px; border-radius: 20px; font-size: 25px; box-shadow: 0 0 0 5px #fff, var(--shadow-md); }

/* ================================================================ tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 14px 13px; text-align: left; vertical-align: middle; }
td { border-top: 1px solid var(--line-2); }
th { font-size: 11.5px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; padding-top: 10px; padding-bottom: 10px; }
th:first-child, td:first-child { padding-left: 22px; }
th:last-child, td:last-child { padding-right: 22px; }
table.compact th, table.compact td { padding-left: 10px; padding-right: 10px; }
table.compact th:first-child, table.compact td:first-child { padding-left: 22px; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th.sorted { color: var(--primary); }
tbody tr { transition: background .12s; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #f9f8ff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.acc-cell { display: flex; align-items: center; gap: 12px; min-width: 170px; }
.acc-name { font-weight: 550; color: var(--text); font-size: 14px; }
.acc-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.riskbar { display: flex; align-items: center; gap: 8px; min-width: 96px; }
.riskbar .track { flex: 1; height: 7px; border-radius: 6px; background: #eef0f6; overflow: hidden; min-width: 36px; }
.riskbar .fill { height: 100%; border-radius: 6px; }
.riskbar span { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; font-size: 13px; }
.strong-num { font-weight: 600; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 18px 22px; }
.toolbar select { min-width: 138px; }
.pager { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); flex-wrap: wrap; }

/* ================================================================ tabs */
.tabs { display: flex; gap: 4px; padding: 6px; background: #f1f2f8; border-radius: 13px; overflow-x: auto; }
.tab { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 500; font-size: 13px; color: var(--text-2); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tab:hover { color: var(--text); }
.tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(18, 20, 51, .1); }
.tab .cnt { font-size: 11px; background: #e6e8f1; color: var(--text-2); padding: 0 7px; border-radius: 10px; }
.tab.active .cnt { background: var(--primary-soft); color: var(--primary); }

/* ================================================================ lists */
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 22px; border-top: 1px solid var(--line-2); min-width: 0; }
.list-item:first-child { border-top: 0; }
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover { background: #f9f8ff; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .li-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ================================================================ charts */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-size: 11px; fill: var(--muted); font-family: inherit; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-top: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.donut-wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.donut-wrap svg { width: 168px; flex-shrink: 0; }
.donut-legend { display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 200px; }
.donut-legend .item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; background: var(--panel-2); }
.donut-legend .item .t { flex: 1; min-width: 0; }
.donut-legend .item .t b { display: block; font-weight: 550; font-size: 13.5px; }
.donut-legend .item .t span { font-size: 12px; color: var(--muted); }
.donut-legend .item .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.donut-legend .sw { width: 10px; height: 34px; border-radius: 4px; flex-shrink: 0; }
.hbars { display: flex; flex-direction: column; gap: 15px; }
.hbar .top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; margin-bottom: 7px; gap: 12px; }
.hbar .top .l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .top b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar .track { height: 9px; background: #eef0f6; border-radius: 6px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 6px; background: var(--primary); transition: width .5s ease; }
.tip { position: fixed; pointer-events: none; background: #121433; color: #fff; padding: 7px 11px; border-radius: 9px; font-size: 12px; z-index: 300; box-shadow: var(--shadow-lg); white-space: nowrap; }

/* ================================================================ kanban */
.status-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stab { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--panel);
  cursor: pointer; text-align: left; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s, background .15s, transform .15s; min-width: 0; }
.stab:hover { border-color: #d3d6e6; transform: translateY(-1px); }
.stab.active { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(91, 76, 240, .10), var(--shadow-md); }
.stab-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, white); }
.stab-ico i { width: 18px; height: 18px; display: inline-flex; }
.stab-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.stab-l { font-weight: 600; font-size: 13.8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stab-s { font-size: 11.8px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stab-s .late { color: var(--high); font-weight: 500; }
.stab-n { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.stab.active .stab-n { color: var(--primary); }
body.is-dragging .stab { border-style: dashed; border-color: #b4aaff; }
.stab.drag-over { background: var(--primary-soft); border-color: var(--primary); border-style: solid; transform: scale(1.02); }

.board-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; }
.board-bar .search input { width: 240px; }
.bstats { display: flex; align-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.bstats .bs { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.bstats .bs + .bs { border-left: 1px solid var(--line-2); }
.bstats .bs b { color: var(--text); font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.bstats .dot { width: 7px; height: 7px; }

.grid-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.grid-head .sdot { width: 10px; height: 10px; border-radius: 50%; }
.grid-head h3 { font-size: 16px; }
.count-pill { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 0 9px; font-size: 12px; font-weight: 600; color: var(--text-2); line-height: 22px; }
.grid-head .bstats { margin-left: auto; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: stretch; }

.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow); cursor: grab;
  transition: box-shadow .15s, border-color .15s, transform .15s; display: flex; flex-direction: column; min-width: 0; position: relative; overflow: hidden; }
.kcard:hover { box-shadow: var(--shadow-md); border-color: #d9dcec; transform: translateY(-2px); }
.kcard.dragging { opacity: .4; transform: scale(.98); }
.kcard.hot-Urgent::before, .kcard.hot-High::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.kcard.hot-Urgent::before { background: var(--high); }
.kcard.hot-High::before { background: #f0a020; }
.kcard.done { cursor: pointer; }
.k-head { display: flex; align-items: center; gap: 11px; min-width: 0; }
.k-who { flex: 1; min-width: 0; }
.k-acc { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-prio { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.k-prio.Urgent { background: var(--high-soft); color: var(--high); }
.k-prio.High { background: var(--med-soft); color: #c27500; }
.k-prio.Medium { background: var(--primary-soft); color: var(--primary); }
.k-prio.Low { background: #f0f1f6; color: var(--muted); }
.k-more { margin-right: -6px; color: var(--muted); }
.k-title { font-size: 14px; color: var(--text); font-weight: 450; margin-top: 14px; line-height: 1.45; flex: 1; }
.k-meta { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 12.5px; color: var(--muted); min-width: 0; flex-wrap: wrap; }
.k-risk { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.k-risk .dot { width: 7px; height: 7px; }
.k-reason { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 8px; background: #f3f4f9; color: var(--text-2); }
.k-meta .badge { font-size: 11.5px; }
.k-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line-2); min-width: 0; }
.k-owner { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.k-foot .btn.sm { padding: 6px 12px; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 9px; }
.icon-btn.sm i { width: 16px; height: 16px; }
.due { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; padding: 3px 9px; border-radius: 8px; background: #f2f3f8; color: var(--text-2); font-size: 12px; }
.due i { width: 12px; height: 12px; display: inline-flex; }
.due.overdue { background: var(--high-soft); color: var(--high); font-weight: 500; }
.due.today { background: var(--med-soft); color: #c27500; }

.menu { position: fixed; z-index: 250; width: 210px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; animation: pop .14s; }
.menu-t { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px 6px; font-weight: 600; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 9px 10px; border-radius: 9px; font-size: 13px; cursor: pointer; text-align: left; color: var(--text); }
.menu-item:hover { background: var(--panel-2); }
.menu-item.danger { color: var(--high); }
.menu-item .dot { width: 8px; height: 8px; }
.menu-sep { height: 1px; background: var(--line-2); margin: 5px 4px; }
select.sm { padding: 7px 30px 7px 11px; font-size: 12.5px; border-radius: 9px; background-position: right 9px center; }

/* ================================================================ modal + drawer */
.overlay { position: fixed; inset: 0; background: rgba(13, 15, 38, .42); backdrop-filter: blur(3px); z-index: 100; animation: fade .15s; }
.modal-wrap { display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 20px; width: 100%; max-width: 520px; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
.modal-h { display: flex; align-items: flex-start; gap: 12px; padding: 22px 24px 4px; }
.modal-h h2 { font-size: 18px; }
.modal-b { padding: 16px 24px 8px; }
.modal-f { padding: 18px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--panel); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .22s cubic-bezier(.2, .8, .2, 1); z-index: 101; }
.drawer-h { padding: 22px 26px 18px; border-bottom: 1px solid var(--line-2); }
.drawer-h h2 { font-size: 20px; line-height: 1.3; margin-top: 10px; }
.drawer-b { padding: 6px 26px 26px; overflow-y: auto; flex: 1; }
.drawer-f { padding: 16px 26px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--panel-2); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.section-t { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; margin: 26px 0 12px; display: flex; align-items: center; gap: 10px; }
.section-t::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.acc-strip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; background: var(--panel-2); border: 1px solid var(--line-2); margin-top: 14px; }
.acc-strip .as-stats { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.acc-strip .as-stats div { text-align: right; }
.acc-strip .as-stats b { display: block; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.acc-strip .as-stats span { font-size: 11px; color: var(--muted); }
.reason { display: flex; gap: 14px; padding: 13px 15px; border: 1px solid var(--line-2); border-radius: 13px; margin-bottom: 9px; background: #fff; align-items: flex-start; }
.reason .w { flex-shrink: 0; width: 46px; text-align: center; }
.reason .w b { display: block; font-size: 15px; font-weight: 600; color: var(--high); }
.reason .w .mini { height: 4px; border-radius: 4px; background: #f3e2e3; overflow: hidden; margin-top: 4px; }
.reason .w .mini div { height: 100%; background: var(--high); border-radius: 4px; }
.reason .r-t b { display: block; font-size: 13.5px; font-weight: 550; }
.reason .r-t span { font-size: 12.8px; color: var(--text-2); line-height: 1.45; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 12px; padding: 8px 0; font-size: 13.5px; align-items: flex-start; color: var(--text-2); }
.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 600; display: grid; place-items: center; flex-shrink: 0; margin-top: -1px; }
.timeline { display: flex; flex-direction: column; gap: 16px; position: relative; }
.tl-item { display: flex; gap: 12px; font-size: 13px; position: relative; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 12px; top: 28px; bottom: -14px; width: 1.5px; background: var(--line); }
.tl-item .tl-text { flex: 1; min-width: 0; padding-top: 2px; color: var(--text-2); }
.tl-item .tl-text b { color: var(--text); font-weight: 550; }
.tl-item .tl-when { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.tl-item.comment .body { background: var(--panel-2); border: 1px solid var(--line-2); padding: 10px 13px; border-radius: 4px 13px 13px 13px; margin-top: 6px; color: var(--text); }
.bot { width: 24px; height: 24px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 0 0 2px #fff; }
.bot i { width: 14px; height: 14px; display: inline-flex; }
.comment-box { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.comment-box textarea { border: 0; border-radius: 0; min-height: 70px; box-shadow: none !important; }
.comment-box .cb-f { display: flex; justify-content: flex-end; padding: 8px 10px; background: var(--panel-2); border-top: 1px solid var(--line-2); }
.outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.outcome-opt { border: 1.5px solid var(--line); border-radius: 14px; padding: 13px 14px; cursor: pointer; display: flex; gap: 11px; align-items: flex-start; transition: all .15s; }
.outcome-opt:hover { border-color: #cdd0e2; background: var(--panel-2); }
.outcome-opt.sel { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(91, 76, 240, .1); }
.outcome-opt input { margin-top: 3px; accent-color: var(--primary); }
.outcome-opt b { display: block; font-size: 13.5px; font-weight: 550; }
.outcome-opt span { font-size: 12px; color: var(--muted); line-height: 1.35; display: block; margin-top: 2px; }

/* ================================================================ account detail */
.acc-hero { overflow: hidden; }
.acc-hero .band { height: 96px; position: relative; }
.acc-hero .band::after { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 160px at 85% 0%, rgba(255, 255, 255, .35), transparent 70%); }
.acc-hero .ah-body { display: flex; gap: 20px; padding: 0 26px 22px; align-items: flex-end; flex-wrap: wrap; margin-top: -36px; position: relative; }
.acc-hero .ah-main { flex: 1; min-width: 260px; padding-top: 44px; }
.acc-hero h2 { font-size: 24px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.meta { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); background: var(--panel-2); border: 1px solid var(--line-2); padding: 5px 11px; border-radius: 9px; }
.meta b { color: var(--text); font-weight: 550; }
.meta i { width: 14px; height: 14px; display: inline-flex; color: var(--muted); }
.risk-card { text-align: center; padding: 22px; }
.gauge svg { width: 180px; display: block; margin: 0 auto; }
.rec-box { border-radius: 16px; padding: 20px; background: linear-gradient(160deg, #f4f2ff 0%, #ffffff 70%); border: 1px solid #e0dcff; }
.rec-box h4 { font-size: 17px; margin: 12px 0 6px; }
.rec-box .desc { font-size: 13px; color: var(--text-2); margin-bottom: 12px; line-height: 1.5; }
.callout { padding: 13px 15px; border-radius: 13px; background: var(--blue-soft); color: #0d5e93; font-size: 13px; display: flex; gap: 11px; line-height: 1.5; }
.callout.warn { background: var(--med-soft); color: #8a5300; }
.callout.ok { background: var(--low-soft); color: #0a7550; }
.callout i { width: 18px; height: 18px; flex-shrink: 0; display: inline-flex; margin-top: 1px; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 18px; }
.mini-stat { padding: 13px 15px; border-radius: 13px; background: var(--panel-2); border: 1px solid var(--line-2); }
.mini-stat .l { font-size: 12px; color: var(--muted); }
.mini-stat .v { font-weight: 600; font-size: 17px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.nps-row { display: flex; gap: 12px; flex-wrap: wrap; padding: 18px 22px; }
.nps { width: 82px; text-align: center; padding: 12px 8px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel-2); }
.nps b { display: block; font-size: 24px; font-weight: 600; }

/* ================================================================ impact / model */
.exp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.exp > div { padding: 24px 26px; min-width: 0; }
.exp > div + div { border-left: 1px solid var(--line-2); }
.exp .big { font-size: 38px; font-weight: 600; letter-spacing: -.035em; line-height: 1.1; margin: 6px 0 4px; }
.exp .lbl { font-size: 13px; color: var(--text-2); font-weight: 450; display: flex; align-items: center; gap: 8px; }
.compare { padding: 0 26px 24px; }
.compare .cbar { display: flex; align-items: center; gap: 14px; margin-top: 12px; font-size: 13px; }
.compare .cbar .cl { width: 150px; color: var(--text-2); flex-shrink: 0; }
.compare .cbar .ct { flex: 1; height: 14px; background: #eef0f6; border-radius: 8px; overflow: hidden; }
.compare .cbar .cf { height: 100%; border-radius: 8px; }
.compare .cbar b { width: 56px; text-align: right; font-variant-numeric: tabular-nums; }
.metric-help { font-size: 12.5px; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.model-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 22px 24px; }
.model-head .mh-ico { width: 52px; height: 52px; border-radius: 15px; background: var(--primary-grad); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 20px -8px rgba(91, 76, 240, .7); flex-shrink: 0; }
.model-head .mh-ico i { width: 26px; height: 26px; display: inline-flex; }
.howto { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.howto .step { padding: 18px; border-radius: 15px; background: var(--panel-2); border: 1px solid var(--line-2); }
.howto .n { width: 30px; height: 30px; border-radius: 10px; background: var(--primary-grad); color: #fff; font-size: 13px; font-weight: 600; display: grid; place-items: center; margin-bottom: 12px; }
.howto b { display: block; font-size: 14px; font-weight: 550; margin-bottom: 5px; }
.howto p { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.55; }
.pb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 20px; }
.pb-card { display: flex; flex-direction: column; }
.pb-card .pb-top { display: flex; align-items: flex-start; gap: 14px; padding: 20px 22px 0; }
.pb-card .pb-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.pb-card .pb-ico i { width: 21px; height: 21px; display: inline-flex; }
.pb-card h3 { font-size: 15.5px; }
.pb-card .pb-body { padding: 14px 22px 20px; flex: 1; display: flex; flex-direction: column; }
.pb-card .pb-desc { font-size: 13px; color: var(--text-2); line-height: 1.5; margin: 0 0 10px; }
.pb-card .pb-foot { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.pb-card.disabled { opacity: .62; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.switch input { display: none; }
.switch .sl { width: 40px; height: 23px; background: #d4d7e6; border-radius: 20px; position: relative; transition: background .2s; flex-shrink: 0; }
.switch .sl::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + .sl { background: var(--primary); }
.switch input:checked + .sl::after { left: 20px; }
.joblog { background: #0d0f26; color: #c5c9ff; font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; padding: 14px 16px; border-radius: 13px; max-height: 280px; overflow-y: auto; white-space: pre-wrap; line-height: 1.6; }
.spinner { width: 20px; height: 20px; border: 2.5px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 90px; display: flex; justify-content: center; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.5; }
.empty i { width: 34px; height: 34px; display: block; margin: 0 auto 10px; color: #c5c8db; }

/* ================================================================ insights pages */
.sidebar { overflow-y: auto; }
.nav-count.hot { background: #e5484d; }
.kpis-5 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.badge.Expanded { background: var(--low-soft); color: var(--low); }
.badge.Not { background: #f0f1f6; color: var(--text-2); }
a.acc-cell.link { color: inherit; }
a.acc-cell.link:hover .acc-name { color: var(--primary); }
.switch.small { font-size: 12.5px; }

.fchips { display: flex; gap: 8px; flex-wrap: wrap; }
.fchip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
  font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text-2); box-shadow: var(--shadow); transition: all .15s; white-space: nowrap; }
.fchip:hover { border-color: #d3d6e6; color: var(--text); }
.fchip.active { background: var(--text); border-color: var(--text); color: #fff; }
.fchip.active .fc-ico { color: #fff !important; }
.fc-ico { display: inline-flex; }
.fc-n { font-size: 11.5px; font-weight: 600; background: #f0f1f6; color: var(--text-2); padding: 0 7px; border-radius: 20px; line-height: 19px; }
.fchip.active .fc-n { background: rgba(255, 255, 255, .18); color: #fff; }

.sig { display: flex; gap: 14px; padding: 16px 22px; border-top: 1px solid var(--line-2); position: relative; align-items: flex-start; }
.sig:first-child { border-top: 0; }
.sig::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sev); }
.sig.reviewed { opacity: .55; }
.sig-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.sig-ico i { width: 19px; height: 19px; display: inline-flex; }
.sig-main { flex: 1; min-width: 0; }
.sig-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sig-top b { font-weight: 600; font-size: 14px; }
.sig-type { font-size: 11.5px; color: var(--text-2); background: #f2f3f8; padding: 2px 8px; border-radius: 7px; }
.sig-date { font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.sig-detail { font-size: 13px; color: var(--text-2); margin-top: 4px; line-height: 1.5; }
.sig-acc { margin-top: 10px; }
.sig-acc a { display: inline-flex; align-items: center; gap: 9px; color: var(--text-2); font-size: 12.5px; max-width: 100%; }
.sig-acc a b { color: var(--text); font-weight: 550; }
.sig-acc a:hover b { color: var(--primary); }
.sig-acc .logo.sm { width: 24px; height: 24px; font-size: 9.5px; border-radius: 7px; }
.sig-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; flex-shrink: 0; min-width: 132px; }
.delta { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta.up { background: var(--high-soft); color: var(--high); }
.delta.down { background: var(--low-soft); color: var(--low); }

.days-pill { display: inline-block; font-size: 11.5px; color: var(--muted); background: #f2f3f8; padding: 1px 8px; border-radius: 7px; margin-top: 3px; }
.days-pill.soon { background: var(--med-soft); color: #c27500; font-weight: 500; }

.xcard { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; transition: box-shadow .15s, transform .15s; }
.xcard:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.ring { width: 46px; height: 46px; flex-shrink: 0; }
.x-play { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.x-pot { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.x-pot b { font-size: 17px; color: var(--low); font-weight: 600; }
.x-detail { font-weight: 550; font-size: 14px; margin-top: 10px; }
.x-why { font-size: 12.8px; color: var(--text-2); margin-top: 3px; line-height: 1.45; flex: 1; }
.x-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.x-stats div { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 7px 8px; text-align: center; min-width: 0; }
.x-stats span { display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x-stats b { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

.mv-totals { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; font-weight: 550; font-variant-numeric: tabular-nums; }
.mv-totals span { display: inline-flex; align-items: center; gap: 6px; }
.mv-totals i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
table.heatmap { border-collapse: separate; border-spacing: 3px; }
table.heatmap th { padding: 6px 4px; text-align: center; font-size: 11px; }
table.heatmap th:first-child { text-align: left; padding-left: 4px; }
table.heatmap { width: 100%; }
table.heatmap td { border: 0; padding: 0; height: 36px; min-width: 44px; text-align: center; font-size: 11.5px; font-weight: 500; border-radius: 7px; font-variant-numeric: tabular-nums; }
table.heatmap td.hm-label { text-align: left; font-weight: 550; color: var(--text); padding: 0 10px 0 4px; white-space: nowrap; font-size: 12.5px; }
table.heatmap td.num { padding: 0 8px; font-size: 12px; }
table.heatmap td.hm-empty { background: #f6f7fb; }
@media (max-width: 900px) { .sig { flex-wrap: wrap; } .sig-actions { flex-direction: row; min-width: 0; width: 100%; } }

/* ================================================================ toast */
#toast-root { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 400; }
.toast { background: #121433; color: #fff; padding: 13px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; gap: 12px; align-items: center; max-width: 440px; animation: pop .18s; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #8b7dff; flex-shrink: 0; }
.toast.error::before { background: #ff6b6f; }
.toast.success::before { background: #34d399; }
.toast button { background: rgba(255, 255, 255, .14); border: 0; color: #fff; padding: 6px 11px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.toast button:hover { background: rgba(255, 255, 255, .24); }

/* ================================================================ responsive */
@media (max-width: 1400px) {
  .hide-md { display: none; }
  .cols-main { grid-template-columns: minmax(0, 1fr) minmax(270px, 340px); }
}
@media (max-width: 1320px) {
  .cols-side { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 1160px) {
  .status-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols-2, .cols-main, .cols-side, .exp { grid-template-columns: minmax(0, 1fr); }
  .exp > div + div { border-left: 0; border-top: 1px solid var(--line-2); }
  .sticky { position: static; }
  .date-pill { display: none; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: -270px; transition: left .25s; box-shadow: none; }
  .sidebar.open { left: 0; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px; min-height: 64px; }
  .topbar .subtitle, .user-pill .who small { display: none; }
  .content { padding: 18px 16px 48px; }
  .hero { padding: 22px; }
  .hero h2 { font-size: 21px; }
  .search input { width: 100%; }
  .search { flex: 1 1 220px; }
  .pb-grid { grid-template-columns: 1fr; }
  .board-bar .search input { width: 100%; }
  .bstats { order: 10; }
  .status-tabs { grid-template-columns: repeat(5, 210px); overflow-x: auto; padding-bottom: 6px; }
  .field-grid, .outcomes { grid-template-columns: 1fr; }
  .compare .cbar .cl { width: 110px; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { padding: 16px; }
  .kpi .value { font-size: 22px; }
  .kpi .k-ico { width: 36px; height: 36px; }
  .user-pill select { max-width: 92px; font-size: 12.5px; }
  .topbar h1 { font-size: 18px; }
  .topbar { gap: 10px; }
  .user-pill #user-avatar { display: none; }
  .user-pill { padding-left: 10px; }
}

/* ================================================================ first-run setup */
body.setup-mode .sidebar, body.setup-mode .topbar { display: none; }
.setup { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.setup-card { width: min(560px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 34px; text-align: center; }
.brand-mark.big { width: 58px; height: 58px; border-radius: 17px; margin: 0 auto 16px; display: grid; }
.brand-mark.big svg { width: 32px; height: 32px; }
.setup-card h2 { font-size: 22px; }
.setup-card p { margin: 8px 0 22px; }
.setup-steps { text-align: left; display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.ss { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.ss-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; position: relative; }
.ss.now { color: var(--text); font-weight: 500; }
.ss.now .ss-dot { border-color: var(--primary); border-top-color: transparent; animation: spin .8s linear infinite; }
.ss.done { color: var(--text-2); }
.ss.done .ss-dot { background: var(--low); border-color: var(--low); }
.ss.done .ss-dot::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.setup-card .joblog { text-align: left; max-height: 150px; font-size: 11.5px; }
