:root {
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --border: #e0e6ef;
  --text: #1a2332;
  --muted: #6b7c8f;
  --primary: #1668dc;
  --primary-dark: #1254b0;
  --accent: #1668dc;
  --danger: #b42318;
  --warning: #d68910;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 8px 24px rgba(16, 24, 40, 0.06);
  --shadow-card: 0 1px 2px rgba(16,24,40,.06), 0 1px 8px rgba(16,24,40,.04);
  --radius: 10px;
  --radius-lg: 12px;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.block { width: 100%; }
.center { text-align: center; }

/* ------------------------------------------------------------------ Login (ESS split) */
.login-wrap {
  min-height: 100vh;
  background: #fff;
  display: grid;
  place-items: stretch;
  padding: 0;
}
.login-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: 100vh;
}
.login-left {
  background: #1668dc;
  color: #fff;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-logo-mark {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,.9);
  color: #fff;
  margin-bottom: 18px;
}
.login-left h1 { font-size: 22px; font-weight: 800; margin: 0 0 10px; letter-spacing: -.02em; }
.login-left p { margin: 0; font-size: 13px; line-height: 1.6; color: rgba(255,255,255,.92); max-width: 300px; }
.login-copy { font-size: 11px; color: rgba(255,255,255,.65); }

.login-card {
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 0;
  padding: 36px 40px;
  box-shadow: none;
}
.login-card h2 { font-size: 22px; margin: 0 0 6px; font-weight: 800; letter-spacing: -.02em; }
.login-sub { margin: 0 0 18px; font-size: 12px; color: var(--muted); }
.login-card label {
  display: block;
  margin: 16px 0 6px;
  font-weight: 700;
  color: #344054;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.login-card input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d0d7e3;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 4px;
  background: #fff;
}
.login-card input::placeholder { color: #98a2b3; }
.login-card input:focus { outline: 2px solid rgba(22,104,220,.18); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,104,220,.12); }
.login-card .btn.primary {
  margin-top: 20px;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13px;
}
.hint { font-size: 12px; margin: 12px 0 0; min-height: 16px; }
#login-error:not(:empty) { color: var(--danger); }
@media (max-width: 760px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-left { min-height: 180px; padding: 28px 24px; }
  .login-card { padding: 28px 22px; max-width: none; }
}

/* -------------------------------------------------------------- App shell */
.app { display: grid; grid-template-columns: 220px 1fr; height: 100vh; overflow: hidden; }
.sidebar {
  background: #0f172a;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  padding: 18px 10px;
  gap: 16px;
  border-right: 1px solid #1e293b;
  overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 2px 6px; }
.sidebar-brand small { display: block; color: #94a3b8; font-size: 11px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a {
  color: #a8b3c3;
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 13px;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: var(--primary); color: #fff; box-shadow: 0 1px 6px rgba(22,104,220,.35); }
.nav-label { font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #64748b; padding: 12px 10px 3px; cursor: pointer; user-select: none; }
.nav-label:hover { color: #cbd5e1; }
.nav-label::after { content: "▾"; float: right; font-size: 10px; }
.nav-label.nav-sec-collapsed::after { content: "▸"; }
.sidebar nav a.sec-hidden { display: none !important; }
.sidebar .btn.ghost {
  border-color: rgba(255,255,255,.14);
  color: #e2e8f0;
  background: rgba(255,255,255,.04);
  font-size: 12px;
  padding: 8px 10px;
}
.sidebar .btn.ghost:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.22); color: #fff; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .04em;
}

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.topbar h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.topbar p { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar-actions select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  max-width: 260px;
  font-size: 12px;
  font-weight: 600;
}
.content { padding: 22px; overflow: auto; flex: 1 1 auto; min-height: 0; }

/* ---------------------------------------------------------------- Buttons */
.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background .15s, border .15s, box-shadow .15s;
}
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(22,104,220,.18); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: #b42318; color: #fff; }
.btn.small { padding: 5px 9px; font-size: 12px; border-radius: 7px; }
.chip {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 650;
  color: #475467;
  box-shadow: var(--shadow-card);
}

/* ------------------------------------------------------------------ Cards */
.card-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-card);
}
.stat .label { color: #667085; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.stat .value { font-size: 24px; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; }
.stat.opex { border-left: 4px solid var(--primary); }
.stat.capex { border-left: 4px solid #f79009; }
.stat.total { border-left: 4px solid var(--primary); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-top: 14px;
}
.panel h3 { margin: 0 0 14px; font-size: 14px; font-weight: 800; letter-spacing: -.01em; }
.split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ Tables */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-card); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid #eef2f7; white-space: nowrap; }
th { background: #f8fafc; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #667085; font-weight: 800; position: sticky; top: 0; }
tbody tr:hover { background: #f8fafc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.group td { background: #f8fafc; font-weight: 800; }
input.cell {
  width: 110px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
input.cell:focus { outline: 2px solid rgba(22,104,220,.14); border-color: var(--primary); }

/* ------------------------------------------------------------------ Charts */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.bar {
  width: 100%;
  background: linear-gradient(180deg, #3b82f6, #1668dc);
  border-radius: 6px 6px 0 0;
  min-height: 3px;
  transition: height 0.3s;
}
.bar-label { font-size: 11px; color: var(--muted); margin-top: 6px; }
.bar-value { font-size: 10px; color: var(--muted); }

.cat-row { display: grid; grid-template-columns: 1fr 2fr; align-items: center; gap: 10px; margin-bottom: 8px; }
.cat-name { font-size: 12px; }
.cat-track { display: flex; height: 22px; background: #f2f4f7; border-radius: 8px; overflow: hidden; }
.cat-seg { height: 100%; }
.cat-seg.opex { background: var(--primary); }
.cat-seg.capex { background: #f79009; }

.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.legend .opex::before { background: var(--primary); }
.legend .capex::before { background: #f79009; }

/* ------------------------------------------------------------------ Toast */
.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: #0f172a;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  z-index: 50;
  max-width: 360px;
  font-size: 13px;
}
.toast.error { background: #7a0b0b; }
.toast.success { background: #0f5132; }

/* ------------------------------------------------------------------ Modal */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.52); display: grid; place-items: center; z-index: 60; padding: 20px; backdrop-filter: blur(2px); }
.modal-card { background: var(--surface); border-radius: 14px; padding: 22px; width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; box-shadow: 0 20px 40px rgba(0,0,0,.2); }
.modal-card h3 { margin-top: 0; font-weight: 800; letter-spacing: -.01em; }
.modal-card label { display: block; margin: 12px 0 4px; font-size: 11px; font-weight: 750; color: #344054; letter-spacing: .02em; }
.modal-card input, .modal-card select {
  width: 100%; padding: 9px 10px; border: 1px solid #d0d7e3; border-radius: 8px; font-size: 13px; background: #fff;
}
.modal-card input:focus, .modal-card select:focus { outline: 2px solid rgba(22,104,220,.14); border-color: var(--primary); }
/* Checkboxes / radios must not inherit the full-width text-input styling */
.modal-card input[type="checkbox"], .modal-card input[type="radio"] {
  width: 16px; height: 16px; flex: 0 0 16px; padding: 0; margin: 0;
  border-radius: 4px; accent-color: var(--primary); cursor: pointer;
}
.modal-card label.inline {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 14px 0 2px; font-size: 12.5px; font-weight: 650;
  color: var(--text); letter-spacing: normal; cursor: pointer;
}
.modal-card .modal-note { margin: 0 0 2px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.modal-card .modal-hint { margin: 2px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.badge { padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.badge.opex { background: #eef4ff; color: var(--primary); border: 1px solid #d5e2ff; }
.badge.capex { background: #fef6e7; color: #b54708; border: 1px solid #fde9c2; }
.badge.current { background: #e6f5ee; color: #0f5132; border: 1px solid #bfe3d2; }

/* ---------------------------------------------------- asset register tools */
.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; flex-wrap: nowrap; gap: 6px; flex: 1 1 auto; min-width: 0; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.tabs::-webkit-scrollbar { height: 6px; }
.tabs::-webkit-scrollbar-track { background: transparent; }
.tabs::-webkit-scrollbar-thumb { background: #d0d7e3; border-radius: 3px; }
.tabs .btn { flex: 0 0 auto; white-space: nowrap; }
.tab-count { opacity: .7; font-weight: 600; }
.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.asset-sections { display: flex; flex-direction: column; gap: 18px; }
.asset-sections.hide-empty .asset-section[data-empty="1"] { display: none; }
.asset-empty-hint { margin: 4px 2px 0; font-size: 12px; }
.asset-section { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-card); }
.asset-sec-head { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; background: #f1f5f9; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 11px; }
.asset-section:not(.collapsed) .asset-sec-head { border-radius: 11px 11px 0 0; }
.asset-sec-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.asset-sec-name { font-size: 14px; font-weight: 800; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 6px; }
.asset-sec-name::before { content: "▼"; font-size: 10px; color: #64748b; }
.asset-section.collapsed .asset-sec-name::before { content: "▶"; }
.asset-cat-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 10px; font-weight: 750; letter-spacing: .02em; background: #eef4ff; color: #1e40af; border: 1px solid #d5e2ff; }
.asset-del-chip { font-size: 11px; color: #b42318; font-weight: 700; }
.asset-sec-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: default; }
.asset-section > .table-wrap { border: 0; border-radius: 0 0 11px 11px; box-shadow: none; max-height: max(240px, calc(100vh - 220px)); }
.asset-section.collapsed > .table-wrap { display: none; }
.asset-section.collapsed .asset-sec-extra { display: none; }
.asset-section.collapsed .asset-sec-head { border-bottom: 0; }
.asset-section tbody tr:nth-child(even) { background: #f8fafc; }
.asset-section tbody tr:hover { background: #eef4ff; }
.asset-section td.wide, .asset-section th.wide { max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
input[type="search"], .toolbar-actions input[type="search"] {
  padding: 8px 10px; border: 1px solid #d0d7e3; border-radius: 8px; font-size: 13px; min-width: 200px; background: #fff;
}
input[type="search"]:focus { outline: 2px solid rgba(22,104,220,.14); border-color: var(--primary); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 8px; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
.modal-card .form-grid label { margin: 0; }
.modal-card .form-grid label select, .modal-card .form-grid label input { margin-top: 5px; }
.col-row {
  display: grid; grid-template-columns: 1.5fr 1fr auto auto; gap: 8px; align-items: center;
  margin-bottom: 8px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc;
}
.col-row input, .col-row select { width: 100%; }
.col-row.locked { background: #eef2f7; border-color: #dbe3ec; }
.col-row.locked .col-fixed {
  display: flex; align-items: center; min-height: 36px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.col-row.locked .col-fixed.soft {
  border-color: transparent; background: transparent; color: var(--muted); font-weight: 500;
}
.auto-field { background: #f1f5f9; color: var(--muted); cursor: not-allowed; }
.col-row .col-remove { color: var(--danger); padding: 4px 8px; }
.bu-check-list { display: flex; flex-direction: column; gap: 1px; border: 1px solid var(--border); border-radius: 10px; padding: 6px; max-height: 180px; overflow: auto; background: #f8fafc; }
.bu-check-list label { display: flex; align-items: flex-start; gap: 8px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); margin: 0; background: var(--surface); border: 1px solid transparent; }
.bu-check-list label:hover { border-color: var(--border); background: #fff; }
.bu-check-list input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 2px; accent-color: var(--primary); }

/* ------------------------------------------------------------ summary page */
.summary-cards { margin-bottom: 16px; }
.stat .value.small { font-size: 19px; line-height: 1.25; }
.summary-filterbar {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-card); padding: 12px 16px; margin-bottom: 14px;
}
.summary-filter-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.summary-bu-badge {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: #eef4ff; border: 1px solid #d5e2ff; color: #183a6a;
  font-weight: 800; font-size: 11px; white-space: nowrap;
}
.summary-filter-controls { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.bu-field { display: flex; flex-direction: column; gap: 4px; }
.bu-field span { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: #667085; }
.bu-field select, .summary-toolbar select {
  padding: 9px 32px 9px 12px; border: 1px solid #d0d7e3; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--text); background: #fff;
  min-width: 220px; max-width: 280px; cursor: pointer;
}
.bu-field select:focus, .summary-toolbar select:focus {
  outline: 2px solid rgba(22,104,220,.14); border-color: var(--primary);
}
.summary-filterbar input[type="search"] {
  padding: 9px 12px; border: 1px solid #d0d7e3; border-radius: 8px;
  font-size: 13px; min-width: 200px; background: #fff; align-self: flex-end;
  margin-bottom: 0;
}
@media (max-width: 700px) {
  .summary-filterbar { flex-direction: column; align-items: stretch; }
  .summary-filter-controls { flex-direction: column; align-items: stretch; }
  .bu-field select, .summary-filterbar input[type="search"] { width: 100%; max-width: none; }
}
.summary-toolbar input[type="search"] {
  padding: 8px 10px; border: 1px solid #d0d7e3; border-radius: 8px;
  font-size: 13px; min-width: 220px; background: #fff;
}
.summary-toolbar select {
  padding: 8px 10px; border: 1px solid #d0d7e3; border-radius: 8px;
  font-size: 13px; background: #fff; max-width: 280px;
}
/* Price List reuses the Summary filter bar */
.prices-filterbar .summary-filter-controls { align-items: flex-end; }
.prices-filterbar .summary-filter-controls .btn { height: 38px; padding: 0 16px; }
.summary-table th.sr, .summary-table td.sr { width: 70px; color: #667085; }
.summary-link { color: #1a56db; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.summary-link:hover { color: #0f3aa6; }
.type-code {
  display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px;
  background: #f2f4f7; border: 1px solid var(--border);
  font-size: 10px; font-weight: 750; letter-spacing: 0.04em; color: #667085;
  vertical-align: 1px;
}
.count-pill {
  display: inline-block; min-width: 44px; text-align: center;
  padding: 3px 10px; border-radius: 999px; font-weight: 800; font-size: 12px;
  background: #eef4ff; color: #183a6a; border: 1px solid #d5e2ff;
}
.count-pill.zero { background: #f2f4f7; color: #667085; border-color: var(--border); font-weight: 700; }
.count-pill.interactive { cursor: pointer; transition: background .12s, box-shadow .12s; }
.count-pill.interactive:hover { background: #dbe6ff; box-shadow: 0 0 0 3px rgba(22,104,220,.14); }
.count-pill.interactive:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Active-assets picker (Replace/Renew) */
.modal-card.wide { max-width: 900px; }
.pick-wrap { max-height: 52vh; }
.pick-table { width: 100%; font-size: 12px; }
.pick-table th, .pick-table td { padding: 6px 8px; white-space: nowrap; }
.pick-table tbody tr:nth-child(even) { background: #f8fafc; }
.pick-table tbody tr:hover { background: #eef4ff; }
.pick-table input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.share-cell { min-width: 180px; }
.share-track {
  display: inline-block; vertical-align: middle;
  width: min(160px, 30vw); height: 8px; border-radius: 999px;
  background: #eef2f7; overflow: hidden; margin-right: 8px;
}
.share-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3b82f6, #1668dc); }
.zero-row .share-fill { background: #d0d7e3; }
.zero-row td { color: #667085; }
.zero-row .summary-link { color: #5a6b9e; }
.share-pct { font-size: 11px; color: #667085; font-variant-numeric: tabular-nums; font-weight: 700; }
.summary-hint { margin: 12px 2px 0; font-size: 12px; }

/* ------------------------------------------------------------ budget planning */
.budget-filterbar { display:flex; justify-content:space-between; align-items:flex-end; gap:14px; flex-wrap:wrap; background:var(--surface); border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow-card); padding:12px 16px; margin-bottom:14px; }
.budget-kpi-row { display:grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap:12px; margin-bottom:14px; }
.budget-kpi { background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:14px; box-shadow:var(--shadow-card); }
.budget-kpi span { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; color:#667085; }
.budget-kpi strong { display:block; font-size:20px; font-weight:800; margin:6px 0 2px; letter-spacing:-.02em; }
.budget-kpi small { font-size:11px; color:var(--muted); }
.badge-draft { background:#e7f0ff; color:#1668dc; border:1px solid #b6d0ff; }
.badge-locked { background:#d4edda; color:#155724; border:1px solid #a3d9b1; }
.budget-table .inp { width:82px; padding:6px 8px; border:1px solid #d1d5db; border-radius:7px; text-align:center; font-variant-numeric:tabular-nums; }
.budget-table .inp:disabled { background:#f1f5f9; color:#667085; }
.budget-table .inp.ro { background:#f8fafc; color:#0f172a; cursor:default; }
.budget-table .inp.ro:focus { outline:none; border-color:#d1d5db; }
.budget-table .inp.ro:disabled { background:#f1f5f9; color:#667085; }
.budget-table .muted-price { color:#dc2626; font-size:11px; }
.pill-capex { background:#fee2e2; color:#991b1b; padding:2px 7px; border-radius:6px; font-size:11px; font-weight:700; }
.pill-opex { background:#dbeafe; color:#1e40af; padding:2px 7px; border-radius:6px; font-size:11px; font-weight:700; }
.cat-header { background:#f1f5f9; cursor:pointer; user-select:none; }
.cat-header:hover { background:#e2e8f0; }
.cat-header td { font-weight:800; border-bottom:2px solid #cbd5e1; white-space:nowrap; }
.cat-toggle { display:inline-flex; align-items:center; gap:6px; }
.cat-toggle::before { content:"▼"; font-size:10px; transition:transform .15s; }
.cat-header.collapsed .cat-toggle::before { transform:rotate(-90deg); }
.cat-subtotal { font-size:11px; color:#475569; font-weight:700; }
.cat-body.hidden-cat { display:none; }
/* Per-category column headers (inside each collapsible section — no global thead on the planning table) */
.cat-colhead td { font-weight:700; font-size:11px; text-transform:uppercase; letter-spacing:.02em; color:#64748b; background:#f8fafc; border-bottom:1px solid #e2e8f0; white-space:nowrap; }
.price-sec-header { display:flex; align-items:center; gap:8px; padding:10px 12px; border:1px solid #e2e8f0; border-radius:8px; margin:0 0 8px 0; font-weight:800; }
.price-sec-header .type-code { font-size:11px; color:#64748b; font-weight:600; }
.price-sec-header .sec-action { margin-left:auto; }
.budget-table { min-width: 920px; }
.budget-table .inp { width:72px; }
.budget-table input[data-field='remarks'].inp { width: 130px; max-width: 100%; }
.budget-table.projects-table { min-width: 720px; }

/* ------------------------------------------------------------ dashboard */
.dash-page { display: flex; flex-direction: column; gap: 14px; }
.dash-hero {
  position: relative; overflow: hidden; border-radius: 16px; padding: 20px 22px; color: #e2e8f0;
  background: linear-gradient(120deg, #0f172a 0%, #12324f 55%, #1668dc 145%);
  box-shadow: var(--shadow-card); display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap;
}
.dash-hero-eyebrow { font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #8fb6ff; }
.dash-hero h2 { margin: 6px 0 10px; font-size: 24px; letter-spacing: -.02em; color: #fff; }
.dash-hero-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dash-hero-controls { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.dash-hero-controls .bu-field span { color: #9db4d6; }
.dash-hero-controls .bu-field select { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.25); }
.dash-hero-controls .bu-field select option { color: #0f172a; }
.dash-hero-controls .btn.ghost { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3); color: #fff; }
.dash-hero-controls .btn.ghost:hover { background: rgba(255,255,255,.2); }
.dash-chip { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); color: #e6eefc; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.dash-chip.opx { background: rgba(30,64,175,.45); color: #dbeafe; border-color: rgba(59,130,246,.5); }
.dash-chip.capx { background: rgba(127,29,29,.4); color: #fee2e2; border-color: rgba(239,68,68,.5); }
.dash-tabs { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px; box-shadow: var(--shadow-card); }
.dash-tab { flex: 1; border: 0; background: transparent; padding: 11px 16px; border-radius: 9px; font-weight: 800; font-size: 13px; color: #475569; cursor: pointer; }
.dash-tab:hover { background: #f1f5f9; }
.dash-tab.active { background: linear-gradient(120deg, #1668dc, #0f4bb3); color: #fff; box-shadow: 0 2px 8px rgba(22,104,220,.35); }
.dash-panel { display: flex; flex-direction: column; gap: 14px; }
.dash-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-card); overflow: hidden; }
.dash-card-title { padding: 11px 14px; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #334155; border-bottom: 1px solid var(--border); background: #f8fafc; }
.dash-card .table-wrap { border: 0; border-radius: 0; box-shadow: none; }
