/* =====================================================================
   AML/TF Risk Hub — application styles
   ===================================================================== */

:root {
  --sidebar-bg: #0c1524;
  --sidebar-card: #101c31;
  --sidebar-line: rgba(255, 255, 255, 0.07);
  --sidebar-text: #8a94a6;
  --sidebar-text-dim: #5b667a;
  --sidebar-strong: #e7ecf3;

  --accent: #0ea394;
  --accent-strong: #0b8a7d;
  --accent-soft: #e3f6f3;

  --bg: #f2f5f9;
  --card: #ffffff;
  --line: #e5eaf1;
  --line-soft: #edf1f6;
  --ink: #101b2d;
  --muted: #64748b;
  --faint: #94a3b8;

  --ok: #067647;      --ok-bg: #e6f6ee;
  --warn: #b54708;    --warn-bg: #fef0e3;
  --danger: #b42318;  --danger-bg: #feecea;
  --info: #175cd3;    --info-bg: #e4efff;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ============================= shell ================================ */
.shell { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 22px 28px 10px; width: 100%; max-width: 1420px; margin: 0 auto; }
.pagefoot {
  max-width: 1420px; width: 100%; margin: 0 auto; padding: 14px 28px 22px;
  display: flex; justify-content: space-between; gap: 12px;
  color: var(--faint); font-size: 12px;
}

/* ============================ sidebar =============================== */
.sidebar {
  width: 256px; flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px 14px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #12b5a4, #0b8a7d);
  color: #fff; font-weight: 800; font-size: 17px;
  display: grid; place-items: center;
}
.brand-text strong { display: block; color: var(--sidebar-strong); font-size: 14.5px; letter-spacing: 0.01em; }
.brand-text span { display: block; font-size: 11px; color: var(--sidebar-text-dim); }

.nav { flex: 1; padding-bottom: 10px; }
.nav-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--sidebar-text-dim); padding: 16px 24px 6px;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  margin: 1px 10px; padding: 9px 12px; border-radius: 8px;
  color: var(--sidebar-text); font-size: 13.5px; font-weight: 500;
}
.nav a svg { flex-shrink: 0; opacity: 0.85; }
.nav a:hover { background: rgba(255, 255, 255, 0.05); color: #fff; text-decoration: none; }
.nav a.active {
  background: #17263f; color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.nav a.active svg { color: #2fc8b5; opacity: 1; }
.nav-count {
  margin-left: auto; background: rgba(14, 163, 148, 0.18); color: #6fdccf;
  font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px;
}

/* collapsible sub-menu group (Admin → Databases) */
.nav details.nav-group { margin: 1px 10px; }
.nav details summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--sidebar-text); font-size: 13.5px; font-weight: 600;
}
.nav details summary::-webkit-details-marker { display: none; }
.nav details summary svg { flex-shrink: 0; opacity: 0.85; }
.nav details summary:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.nav details summary .chev { margin-left: auto; opacity: 0.6; transition: transform 0.15s ease; }
.nav details[open] summary .chev { transform: rotate(90deg); }
.nav details:has(a.active) summary { color: #fff; }
.nav details:has(a.active) summary svg:first-child { color: #2fc8b5; opacity: 1; }
.nav .nav-sub { display: flex; flex-direction: column; margin-top: 1px; }
.nav .nav-sub a { margin: 1px 0 1px 14px; padding: 8px 12px 8px 20px; font-size: 13px; }

/* ========================= FATF list page =========================== */
.fatf-status-bar {
  display: flex; gap: 10px 22px; flex-wrap: wrap; align-items: center;
  font-size: 12.5px; color: var(--muted);
}
.fatf-status-bar strong { color: var(--ink); font-weight: 700; margin-right: 5px; }
.fatf-status-bar .badge { margin-left: 4px; }

.jpill-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 2px 0 6px; }
.jpill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-size: 13px; font-weight: 600; color: var(--ink);
}
.jpill .rank { font-size: 11px; color: var(--faint); font-weight: 800; min-width: 22px; }
.jpill .jname { color: var(--ink); }
.jpill .jname:hover { color: var(--accent-strong); }
.jpill .lvl {
  font-size: 10px; font-weight: 800; letter-spacing: 0.07em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 999px; color: #fff;
}
.jpill .linked {
  font-size: 10.5px; font-weight: 700; color: var(--muted);
  background: var(--line-soft); border-radius: 999px; padding: 2px 7px;
}
.jpill.black { border-color: #f1c5c0; background: #fff5f4; }
.jpill.black .lvl { background: #b42318; }
.jpill.grey { border-color: #f4d9b8; background: #fffaf3; }
.jpill.grey .lvl { background: #d97706; }

.fatf-flag {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid #f4d9b8; background: var(--warn-bg); color: var(--warn);
  border-radius: 10px; padding: 12px 14px; font-size: 13.5px; margin-bottom: 18px;
}
.fatf-flag.black { border-color: #f1c5c0; background: var(--danger-bg); color: var(--danger); }
.fatf-flag strong { font-weight: 800; }

/* ====================== Risk lists page: tabs ======================== */
.tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  border-bottom: 2px solid var(--line);
  margin-bottom: 18px;
}
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; margin-bottom: -2px;
  color: var(--muted); font-weight: 600; font-size: 13.5px;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active {
  color: var(--accent-strong); border-bottom-color: var(--accent);
}
.tab-count {
  background: var(--line-soft); color: var(--muted);
  font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px;
}
.tab.active .tab-count { background: var(--accent-soft); color: var(--accent-strong); }

.cpi-search { display: flex; gap: 8px; align-items: center; }
.cpi-search .input { width: 170px; }

/* CPI score bars, banded by rating colour */
.scorebar {
  flex: 1; height: 8px; border-radius: 99px; background: #eef2f7; overflow: hidden;
}
.scorebar span { display: block; height: 100%; border-radius: 99px; }
.sb-very-clean     { background: #15803d; }
.sb-clean          { background: #22c55e; }
.sb-pass           { background: #eab308; }
.sb-problem        { background: #f59e0b; }
.sb-serious        { background: #ea580c; }
.sb-severe         { background: #dc2626; }
.sb-acute          { background: #b91c1c; }
.sb-highly-corrupt { background: #7f1d1d; }
.sb-na             { background: #94a3b8; }

.side-card {
  margin: 8px 14px 12px; background: var(--sidebar-card);
  border: 1px solid var(--sidebar-line); border-radius: 10px; padding: 10px 12px;
}
.side-card-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--sidebar-text-dim); margin-bottom: 6px;
}
.side-card-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #c6cfdc; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-ok { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15); }

.side-footer {
  border-top: 1px solid var(--sidebar-line); padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
}
.side-footer .who strong { color: var(--sidebar-strong); }
.side-footer a { color: var(--sidebar-text); display: grid; place-items: center; padding: 6px; border-radius: 8px; }
.side-footer a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #f59e0b, #ef6c2a);
  color: #fff; font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
}
.who { min-width: 0; }
.who strong { display: block; font-size: 13px; color: var(--ink); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span { display: block; font-size: 11.5px; color: var(--sidebar-text-dim); }

.scrim { display: none; }

/* ============================ topbar ================================ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  height: 58px; padding: 0 20px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.sidebar-toggle { display: none; }
.crumbs { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.crumbs strong { color: var(--ink); font-weight: 700; }
.crumb-sep { margin: 0 8px; color: var(--faint); }
.topbar-search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 12px; min-width: 220px; color: var(--faint);
}
.topbar-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 163, 148, 0.15); }
.topbar-search input {
  border: 0; outline: 0; font: inherit; color: var(--ink);
  width: 100%; background: transparent;
}
.topbar-user { display: flex; align-items: center; gap: 10px; padding-left: 6px; }
.topbar-user .who strong { font-size: 12.5px; }
.topbar-user .who span { color: var(--muted); }

/* ============================ buttons =============================== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: 13.5px;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #f8fafc; text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-outline-accent { border-color: var(--accent); color: var(--accent-strong); background: #fff; }
.btn-outline-accent:hover { background: var(--accent-soft); }
.btn-danger { background: #fff; border-color: #f1c5c0; color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 8px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }

.row-actions { display: inline-flex; gap: 2px; }

/* ============================= cards ================================ */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 20px; overflow: hidden;
}
.card-head {
  display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap;
  padding: 18px 20px; border-bottom: 1px solid var(--line-soft);
}
.card-head h2 { font-size: 15.5px; }
.card-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-head .spacer { flex: 1; }
.card-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-body { padding: 18px 20px; }
.card-body.flush { padding: 0; }
.link-arrow { font-weight: 600; font-size: 13px; white-space: nowrap; }

/* ========================== page heading ============================ */
.eyebrow {
  color: var(--accent-strong); font-size: 11.5px; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 6px;
}
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin: 4px 0 22px; }
.page-head h1 { font-size: 24px; letter-spacing: -0.01em; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.page-head .spacer { flex: 1; }
.page-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* =========================== stat cards ============================= */
.stat-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
  margin-bottom: 20px;
}
.stat {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px 14px;
  display: block; color: inherit;
}
.stat:hover { text-decoration: none; border-color: #d6dee8; }
.stat::after {
  content: ""; position: absolute; right: -34px; bottom: -48px;
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(14, 163, 148, 0.14), rgba(14, 163, 148, 0.03));
}
.stat-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.stat-title { color: var(--muted); font-size: 13px; font-weight: 600; }
.icon-chip {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center;
}
.icon-chip.teal   { background: var(--accent-soft); color: var(--accent-strong); }
.icon-chip.amber  { background: var(--warn-bg); color: var(--warn); }
.icon-chip.red    { background: var(--danger-bg); color: var(--danger); }
.icon-chip.blue   { background: var(--info-bg); color: var(--info); }
.stat-num { font-size: 27px; font-weight: 800; letter-spacing: -0.02em; margin: 8px 0 2px; }
.stat-sub { font-size: 12px; color: var(--muted); }
.stat-sub .hot { color: var(--danger); font-weight: 700; }
.stat-sub .good { color: var(--ok); font-weight: 700; }

/* ========================== dashboard grid ========================== */
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.grid-2-wide { display: grid; grid-template-columns: 1.8fr 1fr; gap: 16px; align-items: start; }

/* workflow stepper */
.wf-steps { display: flex; align-items: flex-start; padding: 8px 4px 18px; }
.wf-step { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 118px; flex-shrink: 0; text-align: center; }
a.wf-step { color: inherit; text-decoration: none; border-radius: 10px; padding: 6px 4px; transition: background 0.12s ease; }
a.wf-step:hover { background: #f1f5f9; }
a.wf-step:hover .wf-meta strong { color: var(--accent-strong); }
.wf-dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700;
  background: #fff; border: 2px solid #d6dee8; color: var(--muted);
}
.wf-step.done .wf-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.wf-step.active .wf-dot { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 4px rgba(14, 163, 148, 0.18); }
.wf-meta strong { display: block; font-size: 12.5px; color: var(--ink); }
.wf-meta span { font-size: 11.5px; color: var(--faint); }
.wf-line { flex: 1; height: 2px; background: #e2e8f0; border-radius: 2px; margin-top: 15px; min-width: 18px; }
.wf-line.done { background: var(--accent); }

.progress { height: 7px; border-radius: 99px; background: #e8edf3; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #12b5a4, #0b8a7d); }
.wf-foot { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 9px; }
.wf-foot strong { color: var(--ink); }

/* due list */
.due-list { list-style: none; margin: 0; padding: 0; }
.due-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.due-list li:last-child { border-bottom: 0; }
.due-list .t { min-width: 0; }
.due-list .t strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.due-list .t span { font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.due-list .right { margin-left: auto; text-align: right; flex-shrink: 0; }
.due { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.due-overdue { color: var(--danger); }
.due-soon { color: var(--warn); }
.due-list-empty { color: var(--faint); text-align: center; padding: 26px 0; }

/* activity feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.feed li:last-child { border-bottom: 0; }
.feed .fdot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink: 0; }
.feed em { color: var(--muted); font-style: normal; }
.feed .when { display: block; color: var(--faint); font-size: 11.5px; margin-top: 2px; }

/* ============================ tables ================================ */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); font-weight: 700; padding: 11px 16px;
  border-bottom: 1px solid var(--line); background: #fafbfd; white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f8fafc; }
.table .cell-main { font-weight: 600; color: var(--ink); }
.table .cell-main a { color: var(--ink); }
.table .cell-main a:hover { color: var(--accent-strong); }
.table .cell-sub { font-size: 12px; color: var(--faint); margin-top: 1px; }
.table .num { font-variant-numeric: tabular-nums; }
.table .empty { text-align: center; color: var(--faint); padding: 42px 16px; }

/* ============================= badges =============================== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-solid-danger { background: var(--danger); color: #fff; }
.badge-solid-danger::before { background: #fff; }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--line-soft); color: var(--muted); }
.badge-solid-dark { background: #101b2d; color: #fff; }
.badge-solid-dark::before { background: #2fc8b5; }

/* ========================= filter toolbar =========================== */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 20px; border-bottom: 1px solid var(--line-soft); background: #fafbfd;
}
.filter-bar .input { width: auto; min-width: 150px; }
.filter-bar .search-grow { flex: 1; min-width: 180px; }

/* ============================ pagination ============================ */
.pager { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.pager .info { color: var(--muted); font-size: 12.5px; }
.pager .spacer { flex: 1; }

/* ============================= forms ================================ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.field .req { color: var(--danger); }
.field .hint { font-size: 11.5px; color: var(--faint); margin-top: 4px; }
.input {
  width: 100%; padding: 9px 12px; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid #d6dee8; border-radius: 8px; outline: 0;
}
textarea.input { resize: vertical; min-height: 88px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 163, 148, 0.15); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
fieldset.fs { border: 0; margin: 0; padding: 0; }
fieldset.fs legend {
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-strong); padding: 0; margin-bottom: 14px;
}
.error-banner {
  background: var(--danger-bg); border: 1px solid #f1c5c0; color: var(--danger);
  border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; font-size: 13.5px;
}
.error-banner ul { margin: 6px 0 0; padding-left: 18px; }

/* =========================== flash toast ============================ */
.flash {
  display: flex; align-items: center; gap: 12px;
  border-radius: 10px; padding: 11px 14px; margin-bottom: 16px;
  font-size: 13.5px; font-weight: 500; border: 1px solid transparent;
}
.flash-success { background: var(--ok-bg); color: var(--ok); border-color: #bfe8d2; }
.flash-error   { background: var(--danger-bg); color: var(--danger); border-color: #f1c5c0; }
.flash-warn    { background: var(--warn-bg); color: var(--warn); border-color: #f4d9b8; }
.flash-info    { background: var(--info-bg); color: var(--info); border-color: #c4dcf9; }
.flash-x {
  margin-left: auto; border: 0; background: transparent; color: inherit;
  font-size: 16px; cursor: pointer; line-height: 1; padding: 2px 4px; border-radius: 6px;
}
.flash-x:hover { background: rgba(0, 0, 0, 0.06); }

/* ============================ login page ============================ */
body.login-body {
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(14, 163, 148, 0.25), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(23, 92, 211, 0.18), transparent 60%),
    #0c1524;
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-wrap { width: 100%; max-width: 400px; }
.login-card { background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); padding: 30px 28px; }
.login-card .brand { padding: 0 0 18px; }
.login-card h1 { font-size: 19px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; justify-content: center; padding: 11px; font-size: 14px; margin-top: 6px; }
.demo-box {
  margin-top: 18px; background: #f7f9fc; border: 1px dashed #d6dee8; border-radius: 10px;
  padding: 10px 12px; font-size: 12px; color: var(--muted);
}
.demo-box code { background: #eef2f7; border-radius: 5px; padding: 1px 5px; color: var(--ink); font-size: 11.5px; }
.error-card { text-align: center; }
.error-card .btn { margin-top: 14px; }

/* ============================ detail page =========================== */
.detail-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.detail-head .badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.dl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 24px; }
.dl-grid dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); font-weight: 700; margin-bottom: 3px; }
.dl-grid dd { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); word-break: break-word; }
.notes-box { background: #f7f9fc; border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; white-space: pre-wrap; }

/* ============================ responsive ============================ */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-2-wide { grid-template-columns: 1fr; }
  .dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 60;
    transform: translateX(-100%); transition: transform 0.22s ease;
  }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .scrim {
    display: block; position: fixed; inset: 0; z-index: 50;
    background: rgba(12, 21, 36, 0.55);
  }
  .sidebar-toggle { display: inline-grid; }
  .topbar-search { min-width: 0; }
  .topbar-user .who { display: none; }
  .content { padding: 18px 16px 10px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .stat-grid { grid-template-columns: 1fr; }
  .dl-grid { grid-template-columns: 1fr; }
}

/* ====================== AML dashboards (AML1) ======================== */
.pie-wrap { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.pie-legend { flex: 1; min-width: 240px; }
.legend-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.legend-row:last-child { border-bottom: 0; }
.legend-dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.legend-label { font-weight: 600; }
.legend-val { margin-left: auto; color: var(--muted); }
.legend-pct { width: 52px; text-align: right; font-weight: 700; }
.legend-count { width: 44px; text-align: right; color: var(--faint); font-size: 11.5px; }

.bar-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.bar-label { width: 160px; font-size: 12.5px; color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.bar-track { flex: 1; height: 16px; background: #f1f5f9; border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 99px; }
.bar-value { width: 110px; text-align: right; font-size: 12.5px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

.subtotal-row td { background: #f7f9fc; font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); border-top: 2px solid var(--line); }
.subtotal-row.grand td { background: #101b2d; color: #fff; }
tr.group-start td { border-top: 2px solid var(--line); }

.kyc-pipe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kyc-box {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 1px solid var(--line); border-radius: 10px; padding: 16px 10px;
  background: #fafbfd; color: inherit; text-decoration: none;
}
.kyc-box:hover { border-color: var(--accent); background: var(--accent-soft); }
.kyc-num { font-size: 24px; font-weight: 800; color: var(--ink); }
.kyc-lbl { font-size: 12px; color: var(--muted); font-weight: 600; }

@media (max-width: 900px) {
  .kyc-pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar-label { width: 110px; }
  .bar-value { width: 90px; }
}

/* ====================== exchange rates (FX tab) ====================== */
.fx-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.fx-chip {
  border: 1px solid var(--line); border-radius: 10px; background: #fafbfd;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 2px;
}
.fx-code { font-size: 12px; font-weight: 800; letter-spacing: 0.04em; color: var(--accent-strong, #0b7a6e); }
.fx-sym { color: var(--faint); font-weight: 600; }
.fx-amt { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fx-nm { font-size: 11.5px; color: var(--muted); }
@media (max-width: 1000px) { .fx-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .fx-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.fx-section td {
  background: #f7f9fc; font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ============== stacked bars (AML2.2 country × risk) ============== */
.sbar-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.sbar-label { width: 150px; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.sbar-track { flex: 1; height: 20px; background: #f1f5f9; border-radius: 6px; overflow: hidden; display: flex; }
.sbar-seg { display: block; height: 100%; min-width: 2px; }
.sbar-value { width: 130px; text-align: right; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sbar-sub { display: block; font-size: 11px; color: var(--faint); font-weight: 600; }
@media (max-width: 900px) { .sbar-label { width: 100px; } .sbar-value { width: 100px; } }
