/* === Serendib National Bank — Loan Origination System === */

:root {
  /* Brand — navy default */
  --brand-50: #eef4f9;
  --brand-100: #d6e4ef;
  --brand-200: #a9c1d6;
  --brand-300: #7396b6;
  --brand-400: #436f97;
  --brand-500: #1f4e7c;
  --brand-600: #133f68;
  --brand-700: #0d3052;
  --brand-800: #0a2540;
  --brand-900: #061a2e;

  --accent: #0f766e;
  --accent-soft: #d6efeb;
  --gold: #b8860b;

  /* Status */
  --green-50: #ecf6ef;
  --green-500: #2f7d3d;
  --green-700: #1d5e2a;
  --amber-50: #fbf2e0;
  --amber-500: #b97c0a;
  --amber-700: #8a5a05;
  --red-50: #fbeceb;
  --red-500: #b8332a;
  --red-700: #871e16;
  --blue-50: #e7f0fb;
  --blue-500: #1f4e7c;

  /* Neutrals — warm */
  --bg: #f6f4ef;
  --surface: #fdfcf9;
  --surface-2: #f1ede4;
  --line: #e4ddcc;
  --line-strong: #c9bfa8;
  --ink: #1a1a1a;
  --ink-2: #3d3a33;
  --ink-3: #6f6a5e;
  --ink-4: #9b9484;

  /* Effects */
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(10, 25, 47, 0.06);
  --shadow: 0 4px 12px rgba(10, 25, 47, 0.08);
  --shadow-lg: 0 14px 40px rgba(10, 25, 47, 0.14);

  /* Type */
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-serif: "IBM Plex Serif", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

[data-theme="dark"] {
  --bg: #0c1622;
  --surface: #122031;
  --surface-2: #16263b;
  --line: #22344c;
  --line-strong: #2e486a;
  --ink: #f1efe9;
  --ink-2: #d8d4ca;
  --ink-3: #9aa6b8;
  --ink-4: #6c788c;
  --brand-50: #18293f;
  --brand-100: #1f3551;
  --brand-200: #2a4d75;
  --accent-soft: #173b3a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

#root {
  min-height: 100vh;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.num,
.mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum", "zero";
  letter-spacing: -0.01em;
}

.serif {
  font-family: var(--font-serif);
}

/* === Top bar === */
.appbar {
  height: 56px;
  background: var(--brand-800);
  color: #f3eedb;
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .appbar {
  background: #050d18;
}
.appbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 16px;
  letter-spacing: 0.02em;
  font-weight: 500;
  white-space: nowrap;
}
.appbar .brand .crest {
  width: 30px;
  height: 30px;
  background: var(--gold);
  color: var(--brand-900);
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.appbar .module-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.65;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  padding-left: 24px;
  margin-left: -8px;
  white-space: nowrap;
}
.appbar .spacer {
  flex: 1;
}
.appbar .ab-search {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 6px 10px 6px 30px;
  color: #f3eedb;
  width: 280px;
  outline: none;
  font-size: 13px;
  position: relative;
}
.appbar .ab-search::placeholder {
  color: rgba(243, 238, 219, 0.5);
}
.appbar .ab-search-wrap {
  position: relative;
}
.appbar .ab-search-wrap svg {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.6;
}
.appbar .ab-btn {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  position: relative;
  color: rgba(243, 238, 219, 0.8);
}
.appbar .ab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f3eedb;
}
.appbar .ab-btn .dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
}
.appbar .ab-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}
.appbar .ab-user .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-500);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.appbar .ab-user .who {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.appbar .ab-user .who .name {
  font-size: 13px;
}
.appbar .ab-user .who .role {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.6;
}

/* === Layout === */
.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 56px);
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar .sec {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-4);
  padding: 14px 10px 6px;
}
.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 4px;
  color: var(--ink-2);
  font-size: 13px;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}
.sidebar .nav-item span:first-of-type {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.sidebar .nav-item:hover {
  background: var(--surface-2);
}
.sidebar .nav-item.active {
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 500;
}
[data-theme="dark"] .sidebar .nav-item.active {
  color: #cfe1f5;
}
.sidebar .nav-item .count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--ink-3);
}
.sidebar .nav-item.active .count {
  background: var(--brand-100);
  color: var(--brand-700);
}

.main {
  padding: 22px 28px 60px;
  overflow-x: hidden;
}

/* === Page header === */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head .crumb {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-4);
  margin-bottom: 4px;
}
.page-head h1 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.page-head .meta {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 4px;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  transition: background 0.12s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--surface-2);
}
.btn.primary {
  background: var(--brand-700);
  color: #fff;
  border-color: var(--brand-700);
}
.btn.primary:hover {
  background: var(--brand-800);
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
}
.btn.danger {
  color: var(--red-700);
  border-color: var(--red-500);
}
.btn.success {
  background: var(--green-500);
  color: #fff;
  border-color: var(--green-500);
}
.btn.success:hover {
  background: var(--green-700);
}
.btn.sm {
  padding: 4px 8px;
  font-size: 12px;
}

/* === Cards === */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card .ch {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card .ch h3 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-2);
  font-weight: 600;
}
.card .cb {
  padding: 16px;
}
.card .cb.no-pad {
  padding: 0;
}

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}
.kpi .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.kpi .value {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.kpi .value .ccy {
  font-size: 14px;
  color: var(--ink-3);
  margin-right: 3px;
  font-family: var(--font-mono);
  font-weight: 400;
}
.kpi .sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi .delta-up {
  color: var(--green-700);
}
.kpi .delta-down {
  color: var(--red-700);
}
.kpi .accent-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}

/* === Badges === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid;
  white-space: nowrap;
}
.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge.green {
  color: var(--green-700);
  background: var(--green-50);
  border-color: #c8e0cd;
}
.badge.amber {
  color: var(--amber-700);
  background: var(--amber-50);
  border-color: #ead7a6;
}
.badge.red {
  color: var(--red-700);
  background: var(--red-50);
  border-color: #ebc3bf;
}
.badge.blue {
  color: var(--brand-700);
  background: var(--brand-50);
  border-color: #c5d6e8;
}
.badge.grey {
  color: var(--ink-3);
  background: var(--surface-2);
  border-color: var(--line);
}
[data-theme="dark"] .badge.green {
  background: #15321b;
  border-color: #1d4d28;
}
[data-theme="dark"] .badge.amber {
  background: #3a2a0c;
  border-color: #5a4012;
}
[data-theme="dark"] .badge.red {
  background: #3a1614;
  border-color: #5e201d;
}
[data-theme="dark"] .badge.blue {
  background: #0e2742;
  border-color: #1a3e63;
}

/* === Tables === */
table.t {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.t th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  position: sticky;
  top: 0;
}
table.t td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.t tr:last-child td {
  border-bottom: 0;
}
table.t tr.row {
  cursor: pointer;
}
table.t tr.row:hover {
  background: var(--surface-2);
}
table.t tr.row.selected {
  background: var(--brand-50);
}
table.t td.right,
table.t th.right {
  text-align: right;
}

/* customer cell */
.cust {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cust .av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-700);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 11px;
}
.cust .nm {
  font-weight: 500;
  color: var(--ink);
  font-size: 13px;
}
.cust .id {
  font-size: 11.5px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}

/* === Kanban === */
.kanban {
  display: grid;
  grid-template-columns: repeat(7, minmax(220px, 1fr));
  gap: 10px;
  overflow-x: auto;
}
.kcol {
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 400px;
  max-height: calc(100vh - 240px);
}
.kcol .kh {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}
.kcol .kh .ttl {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--ink-2);
}
.kcol .kh .cnt {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--ink-3);
}
.kcol .kb {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
}
.kcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.kcard:hover {
  border-color: var(--brand-300);
}
.kcard .knm {
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 2px;
}
.kcard .kid {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
  margin-bottom: 6px;
}
.kcard .kamt {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.kcard .krow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  gap: 8px;
}
.kcard .kmeta {
  font-size: 11px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 5px;
}
.kcard .ksla {
  display: flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
}

/* === Application detail layout === */
.appdetail {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  gap: 16px;
  align-items: start;
}

/* === Generic === */
.fld {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.fld label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 500;
}
.fld input,
.fld select,
.fld textarea {
  padding: 7px 10px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  outline: none;
}
.fld input:focus,
.fld select:focus,
.fld textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-100);
}
.fld .v {
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 500;
  padding: 2px 0;
}
.fld .v.mono {
  font-family: var(--font-mono);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.kv {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 6px 12px;
  font-size: 13px;
}
.kv .k {
  color: var(--ink-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kv .v {
  font-weight: 500;
  color: var(--ink);
}

/* === AI score gauge === */
.gauge {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1.1;
}
.gauge svg {
  width: 100%;
  height: 100%;
  display: block;
}
.gauge .gv {
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.gauge .gl {
  position: absolute;
  bottom: -10px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

/* progress bar (factors) */
.factor {
  margin-bottom: 12px;
}
.factor .top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}
.factor .top .nm {
  font-weight: 500;
  color: var(--ink-2);
}
.factor .top .vl {
  font-family: var(--font-mono);
  color: var(--ink-3);
}
.factor .bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.factor .bar .fl {
  height: 100%;
  border-radius: 3px;
  background: var(--brand-500);
}
.factor .bar.pos .fl {
  background: var(--green-500);
}
.factor .bar.neg .fl {
  background: var(--red-500);
}
.factor .bar.neut .fl {
  background: var(--amber-500);
}

/* === Workflow visualizer === */
.wfsteps {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.wfstep {
  flex: 1;
  background: var(--surface-2);
  padding: 10px 14px 10px 24px;
  position: relative;
  font-size: 12px;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-right: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wfstep:first-child {
  padding-left: 14px;
  border-radius: 4px 0 0 4px;
}
.wfstep:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 4px 4px 0;
}
.wfstep::after {
  content: "";
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 18px;
  height: 18px;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  border-top: 1px solid var(--line);
  z-index: 1;
}
.wfstep:last-child::after {
  display: none;
}
.wfstep .lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-4);
}
.wfstep .who {
  font-weight: 500;
  color: var(--ink-2);
}
.wfstep.done {
  background: var(--green-50);
  border-color: #c8e0cd;
  color: var(--green-700);
}
.wfstep.done::after {
  background: var(--green-50);
  border-color: #c8e0cd;
}
.wfstep.active {
  background: var(--brand-700);
  border-color: var(--brand-700);
  color: #fff;
}
.wfstep.active::after {
  background: var(--brand-700);
  border-color: var(--brand-700);
}
.wfstep.active .lbl,
.wfstep.active .who {
  color: #fff;
}
[data-theme="dark"] .wfstep.done {
  background: #15321b;
  border-color: #1d4d28;
  color: #9dcca5;
}
[data-theme="dark"] .wfstep.done::after {
  background: #15321b;
  border-color: #1d4d28;
}

/* === Stepper (intake form) === */
.stepper {
  display: flex;
  gap: 0;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.stepper .stp {
  padding: 10px 14px 12px;
  font-size: 12.5px;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.stepper .stp .n {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--ink-3);
  border: 1px solid var(--line-strong);
}
.stepper .stp.done .n {
  background: var(--green-500);
  color: #fff;
  border-color: var(--green-500);
}
.stepper .stp.active {
  color: var(--ink);
  border-bottom-color: var(--brand-700);
  font-weight: 500;
}
.stepper .stp.active .n {
  background: var(--brand-700);
  color: #fff;
  border-color: var(--brand-700);
}

/* === File/doc cards === */
.doc {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  align-items: center;
}
.doc .ico {
  width: 36px;
  height: 44px;
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: 3px;
  display: grid;
  place-items: center;
  color: var(--brand-700);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}
.doc .meta {
  flex: 1;
  min-width: 0;
}
.doc .meta .nm {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc .meta .sub {
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}

/* === Timeline === */
.tl {
  border-left: 2px solid var(--line);
  margin-left: 6px;
  padding-left: 16px;
}
.tl .item {
  position: relative;
  padding: 8px 0 14px;
}
.tl .item::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--brand-500);
}
.tl .item.warn::before {
  border-color: var(--amber-500);
}
.tl .item.ok::before {
  border-color: var(--green-500);
}
.tl .item .when {
  font-size: 11px;
  color: var(--ink-4);
  font-family: var(--font-mono);
}
.tl .item .what {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.tl .item .who {
  font-size: 11.5px;
  color: var(--ink-3);
}

/* === Tabs === */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.tabs .tab {
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}
.tabs .tab.active {
  color: var(--ink);
  border-bottom-color: var(--brand-700);
  font-weight: 500;
}
.tabs .tab:hover:not(.active) {
  color: var(--ink-2);
}

/* === Modal === */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(6, 18, 35, 0.5);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 24px;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
}
.modal .mh {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal .mh h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
}
.modal .mb {
  padding: 18px 20px;
}
.modal .mf {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--surface-2);
}

/* === Misc === */
.divider {
  height: 1px;
  background: var(--line);
  margin: 14px 0;
}

.nic-preview {
  background: linear-gradient(135deg, #1d3b5a 0%, #2a567f 50%, #1d3b5a 100%);
  color: #f3eedb;
  border-radius: 6px;
  padding: 12px;
  position: relative;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  aspect-ratio: 1.6;
  overflow: hidden;
}
.nic-preview .stripe {
  position: absolute;
  top: 26%;
  left: 0;
  right: 0;
  height: 16%;
  background: rgba(255, 255, 255, 0.08);
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
}
.nic-preview .crest-sl {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid rgba(0, 0, 0, 0.2);
}
.nic-preview .lbl {
  opacity: 0.6;
  font-size: 8px;
}

.image-ph {
  background: repeating-linear-gradient(
    45deg,
    var(--surface-2),
    var(--surface-2) 8px,
    var(--surface) 8px,
    var(--surface) 16px
  );
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
  padding: 8px;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 100px;
  padding: 8px 0;
}
.bar-chart .b {
  flex: 1;
  background: var(--brand-200);
  border-radius: 2px 2px 0 0;
  position: relative;
  min-height: 4px;
}
.bar-chart .b.hl {
  background: var(--brand-700);
}

.sparkline {
  width: 100%;
  height: 36px;
}

/* utility */
.row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.muted {
  color: var(--ink-3);
}
.right {
  text-align: right;
}
.center {
  text-align: center;
}
.flex1 {
  flex: 1;
}
.mb-0 {
  margin-bottom: 0;
}
.mt-12 {
  margin-top: 12px;
}
.mt-16 {
  margin-top: 16px;
}
.mt-20 {
  margin-top: 20px;
}
.gap-12 {
  gap: 12px;
}
.gap-16 {
  gap: 16px;
}
