:root {
  --font: "Segoe UI", "PT Sans", system-ui, sans-serif;
  --bg: #f4f6f9;
  --bg2: #e8ecf2;
  --ink: #1b2430;
  --muted: #667085;
  --line: #dbe1ea;
  --card: #ffffff;
  --accent: #2f6fed;
  --accent-soft: #e8f0fe;
  --accent2: #e07a2f;
  --ok: #14804a;
  --warn: #b54708;
  --err: #d92d20;
  --nav-bg: #15202b;
  --nav-ink: #d5dee7;
  --input-bg: #f4f6f9;
  --table-head: #f2f4f8;
  --zebra: #fafbfc;
  --radius: 10px;
  --radius-sm: 6px;
  --nav-w: 236px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100vh; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; }
h1, h2 { margin: 0; font-weight: 650; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
}

.nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--nav-bg);
  color: var(--nav-ink);
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.1rem 0.85rem;
}
.brand {
  font-weight: 750;
  color: inherit;
  font-size: 1rem;
  padding: 0.35rem 0.65rem 1rem;
  border-bottom: 1px solid #2a3846;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
}
.brand span {
  display: block;
  font-weight: 500;
  font-size: 11px;
  opacity: 0.65;
  letter-spacing: 0;
}
.nav-links { display: flex; flex-direction: column; gap: 0.15rem; }
.nav-links a {
  color: inherit;
  opacity: 0.78;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
}
.nav-links a:hover, .nav-links a.active {
  opacity: 1;
  background: #2f6fed;
  color: #fff;
}
.nav-user {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  padding-top: 0.75rem;
  border-top: 1px solid #2a3846;
}
.nav-user form { margin: 0; }
.role-pill {
  font-size: 11px;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  width: fit-content;
}

.workspace { padding: 1.25rem 1.5rem 3rem; min-width: 0; }
.workspace.page-cabinets,
.workspace.page-dashboard,
.workspace.page-reports {
  height: 100vh;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.workspace.page-cabinets .grid-2,
.workspace.page-dashboard .pivot-wrap {
  flex: 1;
  min-height: 0;
}
.workspace.page-reports .table-wrap {
  flex: 1;
  min-height: 8rem;
}
.workspace.page-dashboard .page-head,
.workspace.page-dashboard .attn,
.workspace.page-dashboard > .card,
.workspace.page-reports .page-head,
.workspace.page-reports .kind-tabs,
.workspace.page-reports .attn,
.workspace.page-reports .hint,
.workspace.page-reports .program-chart-card,
.workspace.page-reports > .card {
  flex-shrink: 0;
}
.workspace.page-dashboard .pivot-wrap {
  overflow: auto;
}
.workspace.page-reports .table-wrap {
  overflow-x: hidden;
  overflow-y: auto;
}
.workspace.page-reports .table-wrap.courses-wrap {
  overflow-x: auto;
}
.workspace.page-cabinets .grid-2 {
  flex: 1;
  min-height: 0;
  align-items: stretch;
  margin-bottom: 0;
}
.workspace.page-cabinets .grid-2 > .card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  margin-bottom: 0;
  overflow: hidden;
}
.workspace.page-cabinets .grid-2 > .card:last-child {
  overflow: auto;
}
.workspace.page-cabinets .table-wrap.scroll {
  flex: 1;
  max-height: none;
  min-height: 0;
}
.workspace.page-cabinets .table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.page-head h1 { font-size: 1.55rem; }

.hint {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0.35rem 0 0.75rem;
  line-height: 1.35;
}
.cat-floors .field { min-width: 8.5rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.card h2 { font-size: 1.05rem; margin-bottom: 0.75rem; }

.btn {
  appearance: none;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  padding: 0.48rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}
.btn:disabled.btn-wait {
  opacity: 0.7;
  cursor: wait;
  white-space: normal;
  text-align: left;
  max-width: 36rem;
  line-height: 1.35;
}
.upload-wait {
  margin: 0.6rem 0 0;
}
.btn-secondary {
  background: #2a3846;
  color: #e8eef6;
  border-color: #2a3846;
}
.workspace .btn-secondary {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}
.btn-danger { background: var(--err); }
.btn-small { padding: 0.28rem 0.6rem; font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 13px; color: var(--muted); }
.field input, .field select, .inline-form input, .inline-form select {
  background: var(--input-bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem;
}
.field input[readonly] {
  background: var(--bg);
  color: var(--ink);
  cursor: default;
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}
.inline-form.tight { margin: 0; }
.inline-form .field { margin: 0; }

.flash {
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.85rem;
}
.flash.err { background: #fce9e8; color: var(--err); }
.flash.ok { background: #e7f6ee; color: var(--ok); }

.attn {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.2rem, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.chip {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  min-width: 0;
}
.chip b { font-size: 1.45rem; }
.chip.fall { border-left: 4px solid var(--err); }
.chip.quiet { border-left: 4px solid var(--warn); }
.chip.drowse { border-left: 4px solid var(--warn); }
.chip.squeeze { border-left: 4px solid #c2410c; }
.chip.alarm { border-left: 4px solid #9f1239; }
.chip.churn { border-left: 4px solid #7a5af8; }
.chip.skip { border-left: 4px solid var(--accent2); }
.chip.blink { border-left: 4px solid var(--warn); }
.chip.grow { border-left: 4px solid var(--ok); }
a.chip { color: inherit; }
a.chip:hover, a.chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: top;
}
.table th {
  background: var(--table-head);
  font-size: 12px;
  font-weight: 650;
}

.check-list { margin: 0; padding-left: 1.2rem; }
.check-list li { margin: 0.35rem 0; }

.login-body { background: var(--nav-bg); }
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem 1.35rem;
}
.login-card h1 { margin-bottom: 0.35rem; }
.login-form { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.login-form .btn { width: 100%; }
.login-cmd {
  background: var(--input-bg);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.8rem;
  overflow: auto;
  font-size: 12.5px;
}

.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .sticky-l {
  position: sticky;
  left: 0;
  background: var(--card);
  z-index: 2;
  box-shadow: 1px 0 0 var(--line);
}
.table thead .sticky-l {
  z-index: 5;
  background: var(--table-head);
}
.table.pivot {
  table-layout: fixed;
  width: max-content;
  white-space: nowrap;
  border-collapse: separate;
  border-spacing: 0;
}
.table.pivot th,
.table.pivot td {
  overflow: hidden;
  text-overflow: ellipsis;
}
.table.pivot thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}
.table.pivot thead .sticky-l { z-index: 6; }
.table.pivot th a { color: inherit; display: block; overflow: hidden; text-overflow: ellipsis; }
.table.pivot .year-start {
  box-shadow: inset 3px 0 0 rgba(21, 32, 43, 0.18);
}
.table.pivot thead th.col-y0 { background: #e7eef8; }
.table.pivot td.col-y0 { background: #f3f7fc; }
.table.pivot thead th.col-y1 { background: #e5f2ea; }
.table.pivot td.col-y1 { background: #f2f8f4; }
.table.pivot thead th.col-y2 { background: #f3ebe3; }
.table.pivot td.col-y2 { background: #f8f3ee; }
.table.pivot .col-year-total { font-weight: 700; }
.table.pivot thead th.col-y0.col-year-total { background: #cfdcf0; }
.table.pivot td.col-y0.col-year-total { background: #d9e4f4; }
.table.pivot thead th.col-y1.col-year-total { background: #c5e3d0; }
.table.pivot td.col-y1.col-year-total { background: #d4eadc; }
.table.pivot thead th.col-y2.col-year-total { background: #e4d3c4; }
.table.pivot td.col-y2.col-year-total { background: #ead9c8; }
.table.pivot thead th.col-result { background: #dce8fb; }
.table.pivot td.col-result { background: #eef4fe; }
.table.pivot .col-grand { font-weight: 700; }
.table.pivot thead th.col-grand { background: #c5d7f7; }
.table.pivot td.col-grand { background: #d9e6fb; }
.table.pivot thead th.col-attn { background: #eceff3; }
.table.pivot td.col-attn { background: #f6f7f9; }
.table.pivot tbody tr:hover td { background: inherit; box-shadow: inset 0 0 0 999px rgba(21, 32, 43, 0.035); }
.table.pivot tbody tr:hover .sticky-l {
  background: var(--card);
  box-shadow: 1px 0 0 var(--line), inset 0 0 0 999px rgba(21, 32, 43, 0.035);
}
.col-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  z-index: 8;
  user-select: none;
}
.col-resizer::after {
  content: "";
  position: absolute;
  top: 22%;
  right: 4px;
  width: 2px;
  height: 56%;
  border-radius: 2px;
  background: #c5ccd6;
}
.col-resizer:hover,
body.is-col-resizing .col-resizer:hover {
  background: transparent;
}
.col-resizer:hover::after,
body.is-col-resizing .col-resizer:hover::after {
  background: var(--accent);
}
body.is-col-resizing,
body.is-col-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}
.table tbody tr:hover td { background: #f7f9fc; }
.table tbody tr:hover .sticky-l { background: #f7f9fc; }
.badge {
  display: inline-block;
  font-size: 12px;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-weight: 650;
  white-space: nowrap;
}
.badge-grow { background: #e7f6ee; color: var(--ok); }
.badge-fall { background: #fce9e8; color: var(--err); }
.badge-norm { background: #eef1f6; color: var(--muted); }
.badge-churn { background: #efe9ff; color: #6941c6; }
.badge-skip { background: #e8f1fb; color: var(--accent); }
.empty-cell { color: #c5ccd6; }
.pivot-wrap { margin-bottom: 0; }
.count-link { font-weight: 650; }

.kind-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.kind-tab {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
}
.kind-tab b { font-variant-numeric: tabular-nums; }
.kind-tab.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.tag {
  display: inline-block;
  font-size: 12px;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-weight: 650;
}
.tag.ok { background: #e7f6ee; color: var(--ok); }
.tag.warn { background: #fef4e6; color: var(--warn); }
.tag.err { background: #fce9e8; color: var(--err); }
.pager {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 0.85rem 0 0;
}

.dropzone {
  display: block;
  position: relative;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}
.dropzone-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.dropzone-body { pointer-events: none; }
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}
.dropzone.is-busy { pointer-events: none; opacity: 0.7; }
.dropzone strong { color: var(--ink); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}
.filters .field { min-width: 12rem; }
.grid-2 {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
  align-items: start;
}
.table tr.selected td { background: var(--accent-soft); }
.table tr.is-hidden td { opacity: 0.6; }
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.85rem;
}
.page-head .row-actions { margin-top: 0; }
.row-actions form { margin: 0; }
a.btn { display: inline-block; text-decoration: none; }
.stack-form .field { margin-top: 0.7rem; }
.stack-form .field:first-child { margin-top: 0; }
.card h3 { font-size: 0.95rem; margin: 1.1rem 0 0.45rem; }
.radio-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}
.list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.list-head h2 { margin: 0; }
.merge-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.merge-count {
  font-size: 13px;
  color: var(--ink);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}
.btn-icon {
  width: 1.85rem;
  height: 1.85rem;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--muted);
}
.btn-icon:hover { color: var(--err); border-color: var(--err); }
.table tr.is-picked td { background: #eef4ff; }
.discount-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
}
.discount-row input[type="number"] {
  width: 5.2rem;
  flex: 0 0 5.2rem;
  min-height: 36px;
  box-sizing: border-box;
}
.discount-row input[type="date"] {
  width: 9.4rem;
  flex: 1 1 9.4rem;
  min-width: 0;
  min-height: 36px;
  box-sizing: border-box;
}
.discount-row .btn {
  min-height: 36px;
  height: 36px;
  flex: 0 0 auto;
  padding: 0 0.7rem;
}
.discount-add {
  align-items: flex-end;
}
.discount-add .btn {
  min-height: 36px;
  height: 36px;
  padding: 0 0.9rem;
}
.discount-add input {
  min-height: 36px;
  box-sizing: border-box;
}

.table.pivot tbody tr.pivot-row td { cursor: default; }
.table.pivot tbody tr.pivot-row td.partner-name {
  cursor: pointer;
  color: var(--accent);
}
.table.pivot tbody tr.pivot-row td.partner-name:hover { text-decoration: underline; }
.yoy {
  display: inline-block;
  min-width: 0.9rem;
  margin-right: 0.35rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1;
}
.yoy-fall { color: var(--err); }
.yoy-grow { color: var(--ok); }
.table.pivot tbody tr.pivot-row td.partner-name:hover .yoy { text-decoration: none; }
.table.pivot tbody tr.pivot-row.is-focused td,
.table.pivot tbody tr.pivot-row.is-focused td.col-y0,
.table.pivot tbody tr.pivot-row.is-focused td.col-y1,
.table.pivot tbody tr.pivot-row.is-focused td.col-y2,
.table.pivot tbody tr.pivot-row.is-focused td.col-year-total,
.table.pivot tbody tr.pivot-row.is-focused td.col-result,
.table.pivot tbody tr.pivot-row.is-focused td.col-grand,
.table.pivot tbody tr.pivot-row.is-focused td.col-attn,
.table.pivot tbody tr.pivot-row.is-focused td.col-req,
.table.pivot tbody tr.pivot-row.is-focused td.sticky-l {
  background: #fff3c4;
}
.table.pivot tbody tr.pivot-row.is-focused .sticky-l {
  box-shadow: 1px 0 0 var(--line);
}
.table.pivot tbody tr.pivot-row.is-focused:hover td { box-shadow: none; }
.table.pivot tbody tr.pivot-row.is-focused:hover .sticky-l {
  background: #fff3c4;
  box-shadow: 1px 0 0 var(--line);
}
.drawer-back {
  position: fixed;
  inset: 0;
  background: rgba(21, 32, 43, 0.35);
  z-index: 40;
}
.drawer-back.open { display: block; }
.drawer-back[hidden] { display: none; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(960px, 92vw);
  background: var(--card);
  border-left: 1px solid var(--line);
  z-index: 50;
  overflow: auto;
  padding: 1.15rem 1.35rem 2rem;
  box-shadow: -8px 0 24px rgba(21, 32, 43, 0.12);
}
.drawer[hidden] { display: none; }
.drawer .table { width: 100%; table-layout: fixed; }
.drawer .table th:nth-child(1),
.drawer .table td:nth-child(1) { width: auto; overflow: hidden; text-overflow: ellipsis; }
.drawer .table th.num,
.drawer .table td.num {
  width: 9.5rem;
  white-space: nowrap;
}
.drawer-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0;
}
.drawer-filters .field { min-width: 10rem; }

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(21, 32, 43, 0.35);
  z-index: 60;
}
.modal-back.open { display: block; }
.modal-back[hidden] { display: none; }
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 92vw);
  max-height: min(88vh, 900px);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  z-index: 70;
  padding: 1.15rem 1.35rem 1.6rem;
  box-shadow: 0 12px 40px rgba(21, 32, 43, 0.18);
}
.modal[hidden] { display: none; }
.modal h3 { margin: 1.15rem 0 0.45rem; font-size: 1.05rem; }
.modal h3:first-of-type { margin-top: 0.35rem; }
.modal .table-wrap { margin-bottom: 0.35rem; }
.ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
}
.ribbon-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  border: 1px solid var(--line);
  background: var(--input-bg);
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  min-width: 7.2rem;
  cursor: pointer;
  text-align: left;
}
.ribbon-item:hover,
.ribbon-item.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.ribbon-month { font-size: 12px; color: var(--muted); }
.ribbon-sum { font-weight: 650; font-variant-numeric: tabular-nums; }

.table.program {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
.table.program th,
.table.program td {
  padding: 0.32rem 0.32rem;
}
.table.program thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}
.table.program thead .sticky-l { z-index: 6; }
.table.program .sticky-l {
  width: 9.6rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table.program th.num,
.table.program td.metric-cell {
  white-space: nowrap;
}
.table.program th.col-alt,
.table.program td.col-alt { background: #eef2f7; }
.table.program th.col-plain,
.table.program td.col-plain { background: #fff; }
.table.program thead th.col-alt { background: #e4ebf4; }
.table.program thead th.col-plain { background: #f2f4f8; }
.table.program thead th.col-year-total,
.table.program td.col-year-total { background: #e7eef8; font-weight: 650; }
.table.program tr.year-row td.col-alt { background: #e2eaf3; }
.table.program tr.year-row td.col-plain { background: #f4f7fb; }
.table.program tr.year-row td.col-year-total { background: #d7e3f2; }
.table.program tr.year-row td.sticky-l { background: #e8eef6; font-weight: 650; }
.table.program th.is-report,
.table.program td.is-report { background: #fde7c7; }
.table.program thead th.is-report { background: #f5d7a6; }
.table.program tr.year-row td.is-report { background: #f3d09a; }
.table.program tbody tr.supplier-row:hover td.col-plain { background: #f7f9fc; }
.table.program tbody tr.supplier-row:hover td.col-alt { background: #e6edf5; }
.table.program tbody tr.supplier-row:hover td.is-report { background: #fde0b5; }
.table.program tbody tr:hover .sticky-l { background: #f7f9fc; }
.table.program tbody tr.year-row:hover td.sticky-l { background: #e8eef6; }
.table.program tr.supplier-row.is-collapsed { display: none; }
.table.program tr.year-row .metric-main { font-weight: 650; }
.tree-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.tree-toggle:hover .tree-label { color: var(--accent); }
.tree-icon { display: inline-block; width: 1rem; color: var(--muted); }
.tree-leaf {
  padding-left: 1.5rem;
  font-weight: 500;
  color: var(--ink);
}
.metric-main { display: block; font-variant-numeric: tabular-nums; }
.metric-main.is-empty { color: #c5ccd6; font-weight: 500; }
.metric-sub {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 0.35rem;
  margin-top: 0.06rem;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.15;
}
.metric-cabs { font-size: inherit; font-weight: inherit; color: inherit; margin-left: 0; }
.table.program .yoy { margin-left: 0; margin-right: 0; }
.yoy-mute { color: var(--muted); font-weight: 600; }

.program-chart-card {
  margin: 0 0 0.75rem;
  padding-bottom: 0.7rem;
}
.program-chart-card .list-head { margin-bottom: 0.35rem; }
.program-chart-card h2 { font-size: 0.95rem; }
.program-chart {
  position: relative;
  height: 220px;
  width: 100%;
}
.program-chart svg { width: 100%; height: 100%; display: block; }
.chart-tip {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  background: var(--nav-bg);
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 8px));
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  margin: 0.15rem 0 0.35rem;
  font-size: 12.5px;
  color: var(--muted);
}
.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.chart-swatch {
  width: 1.1rem;
  height: 0.28rem;
  border-radius: 99px;
  display: inline-block;
}
.chart-swatch.current { height: 0.55rem; opacity: 0.85; }

.table.courses {
  table-layout: fixed;
  width: max-content;
  border-collapse: separate;
  border-spacing: 0;
}
.table.courses th,
.table.courses td {
  padding: 0.22rem 0.5rem;
  vertical-align: middle;
  overflow: hidden;
}
.table.courses thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  white-space: nowrap;
}
.table.courses th a { color: inherit; }
.table.courses th a:hover { color: var(--accent); }
.table.courses td.col-product {
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table.courses tfoot th,
.table.courses tfoot td {
  background: var(--table-head);
  font-weight: 650;
  position: sticky;
  bottom: 0;
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .nav { height: auto; position: sticky; }
  .nav-user { margin-top: 0.75rem; }
  .attn { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .workspace.page-cabinets,
  .workspace.page-dashboard,
  .workspace.page-reports {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  .workspace.page-cabinets .grid-2 > .card {
    height: auto;
    max-height: 70vh;
  }
}
