/* ============================================================
   TCZ Portal - Design System
   Zambian green anchor · refined ochre accent · Libre Franklin
   Mobile-first
   ============================================================ */

:root {
  /* Greens (primary) */
  --green-900: #06351c;
  --green-800: #084a28;
  --green-700: #0b6b3a;   /* primary */
  --green-600: #107a44;
  --green-500: #169151;
  --green-300: #6fbd92;
  --green-200: #aed9c1;
  --green-100: #d9ede2;
  --green-50:  #eef6f1;

  /* Ochre / refined gold (accent - sparing) */
  --gold-800: #7a560c;
  --gold-700: #976c0f;
  --gold-600: #b78514;
  --gold-500: #cf9a26;
  --gold-200: #f0dca6;
  --gold-100: #f8edcf;
  --gold-50:  #fcf7e9;

  /* Warm neutrals */
  --ink-900: #15211b;
  --ink-800: #243029;
  --ink-700: #3a473f;
  --ink-600: #515f57;
  --ink-500: #6b7a71;
  --ink-400: #93a097;
  --ink-300: #b9c3bc;
  --line:    #e2e8e3;
  --line-strong: #ccd5cd;
  --bg:      #f5f7f5;
  --bg-warm: #f7f8f4;
  --surface: #ffffff;
  --surface-2: #f9faf9;

  /* Semantic */
  --success: #128a4d;
  --success-bg: #e7f4ec;
  --warning: #b07d10;
  --warning-bg: #fbf1d6;
  --error:   #c0392b;
  --error-bg: #fbe9e7;
  --info:    #1f6fb2;
  --info-bg: #e8f1f9;

  /* Radii */
  --r-sm: 7px;
  --r-md: 11px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* Shadow */
  --sh-xs: 0 1px 2px rgba(18,40,28,.06);
  --sh-sm: 0 1px 3px rgba(18,40,28,.07), 0 1px 2px rgba(18,40,28,.05);
  --sh-md: 0 4px 14px rgba(18,40,28,.08), 0 2px 4px rgba(18,40,28,.05);
  --sh-lg: 0 16px 40px rgba(18,40,28,.14), 0 4px 12px rgba(18,40,28,.07);

  --sidebar-w: 264px;
  --topbar-h: 66px;

  --ff: "Libre Franklin", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fm: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ff);
  background: var(--bg);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.5;
}
#root { min-height: 100vh; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--green-200); }

h1,h2,h3,h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; line-height: 1.18; color: var(--ink-900); }
p { margin: 0; }

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-track { background: transparent; }

/* ===================== App shell ===================== */
.app { display: flex; min-height: 100vh; }

/* Sidebar (desktop) */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0; height: 100vh; z-index: 60;
}
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 18px 20px 14px; }
.sb-logo {
  width: 44px; height: 44px; border-radius: 11px; flex: 0 0 44px;
  background: #fff;
  display: grid; place-items: center;
  box-shadow: var(--sh-sm); overflow: hidden;
  border: 1px solid var(--line);
}
.sb-logo img { width: 38px; height: 38px; object-fit: contain; display: block; }
.sb-logo-sm { width: 36px !important; height: 36px !important; border-radius: 9px !important; }
.sb-logo-sm img { width: 28px; height: 28px; }
.sb-brand-txt { display: flex; flex-direction: column; line-height: 1.1; }
.sb-brand-txt b { font-size: 14px; font-weight: 800; letter-spacing: .01em; }
.sb-brand-txt small { font-size: 11px; color: var(--ink-500); font-weight: 500; }

.sb-profile {
  margin: 4px 14px 8px; padding: 12px; border-radius: var(--r-md);
  background: var(--green-50); border: 1px solid var(--green-100);
  display: flex; gap: 11px; align-items: center;
}
.sb-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: 0 0 42px;
  background: linear-gradient(140deg, var(--green-500), var(--green-800));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.sb-profile-txt { min-width: 0; }
.sb-profile-txt b { display: block; font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-profile-txt small { display: block; font-family: var(--fm); font-size: 10.5px; color: var(--ink-500); }

.sb-guest { margin: 4px 14px 10px; padding: 14px; border-radius: var(--r-md); background: var(--green-50); border: 1px solid var(--green-100); }
.sb-guest p { font-size: 12.5px; color: var(--ink-600); line-height: 1.45; margin: 0 0 12px; }

.sb-nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.sb-group-label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-400); padding: 14px 10px 6px; }
.sb-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 11px; border-radius: var(--r-sm); border: none; background: none;
  color: var(--ink-700); font-size: 14px; font-weight: 500; text-align: left;
  transition: background .12s, color .12s; position: relative;
}
.sb-item:hover { background: var(--green-50); color: var(--green-800); }
.sb-item.active { background: var(--green-700); color: #fff; font-weight: 600; box-shadow: var(--sh-sm); }
.sb-item.active .ic { color: #fff; }
.sb-item .ic { color: var(--ink-500); flex: 0 0 auto; }
.sb-item:hover .ic { color: var(--green-700); }
.sb-badge {
  margin-left: auto; background: var(--gold-500); color: #3a2a00;
  font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; min-width: 18px; text-align: center;
}
.sb-item.active .sb-badge { background: #fff; color: var(--green-800); }
.sb-foot { padding: 10px 14px 16px; border-top: 1px solid var(--line); }

/* Main column */
.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

/* Topbar */
.topbar {
  height: var(--topbar-h); position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 26px;
}
.tb-title { display: flex; flex-direction: column; min-width: 0; }
.tb-title b { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.tb-title small { font-size: 12px; color: var(--ink-500); }
.tb-search {
  margin-left: auto; display: flex; align-items: center; gap: 9px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 8px 15px; width: 290px; color: var(--ink-400); transition: border-color .15s, box-shadow .15s;
}
.tb-search:focus-within { border-color: var(--green-300); box-shadow: 0 0 0 3px var(--green-100); background: #fff; }
.tb-search input { border: none; background: none; outline: none; font-size: 13.5px; color: var(--ink-900); width: 100%; }
.tb-icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-600); display: grid; place-items: center; position: relative;
  transition: background .12s, border-color .12s;
}
.tb-icon-btn:hover { background: var(--green-50); border-color: var(--green-200); color: var(--green-700); }
.tb-dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--error); border: 2px solid #fff; }

/* Content */
.content { padding: 26px; max-width: 1320px; width: 100%; margin: 0 auto; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 25px; }
.page-head p { color: var(--ink-500); font-size: 14.5px; margin-top: 5px; }

/* ===================== Cards ===================== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-xs); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15.5px; }
.card-head .ic { color: var(--green-700); }
.card-head .head-action { margin-left: auto; }

.grid { display: grid; gap: 18px; }
.section { margin-bottom: 26px; }
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.section-title h2 { font-size: 16px; font-weight: 700; }
.section-title .ic { color: var(--green-700); }
.section-title .spacer { flex: 1; }

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r-md); border: 1px solid transparent;
  font-size: 14px; font-weight: 600; letter-spacing: -.005em; transition: all .14s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green-700); color: #fff; box-shadow: var(--sh-sm); }
.btn-primary:hover { background: var(--green-800); }
.btn-gold { background: var(--gold-500); color: #3a2a00; box-shadow: var(--sh-sm); }
.btn-gold:hover { background: var(--gold-600); color: #2a1f00; }
.btn-ghost { background: var(--surface); color: var(--ink-700); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--green-50); border-color: var(--green-300); color: var(--green-800); }
.btn-subtle { background: var(--green-50); color: var(--green-800); }
.btn-subtle:hover { background: var(--green-100); }
.btn-danger { background: var(--surface); color: var(--error); border-color: #eccfca; }
.btn-danger:hover { background: var(--error-bg); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ===================== Badges / status ===================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: var(--r-pill); font-size: 12px; font-weight: 600; line-height: 1.4;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-bg); color: #0c6b3c; }
.badge-warning { background: var(--warning-bg); color: #8a6209; }
.badge-error { background: var(--error-bg); color: #a32c20; }
.badge-info { background: var(--info-bg); color: #195a91; }
.badge-neutral { background: var(--surface-2); color: var(--ink-600); border: 1px solid var(--line); }
.badge-green { background: var(--green-100); color: var(--green-800); }

/* ===================== Stat cards ===================== */
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; box-shadow: var(--sh-xs); position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-ic { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; margin-bottom: 8px; }
.stat-label { font-size: 12.5px; color: var(--ink-500); font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--ink-900); }
.stat-sub { font-size: 12.5px; color: var(--ink-500); }

/* hero status card */
.hero {
  background: linear-gradient(135deg, var(--green-800), var(--green-700) 60%, var(--green-600));
  border-radius: var(--r-xl); color: #fff; padding: 24px; position: relative; overflow: hidden;
  box-shadow: var(--sh-md);
}
.hero::before { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.06); }
.hero::after { content: ""; position: absolute; right: 40px; bottom: -80px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.05); }
.hero-row { display: flex; align-items: flex-start; gap: 16px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero h2 { color: #fff; font-size: 22px; }
.hero .tcz-no { font-family: var(--fm); font-size: 13px; color: var(--green-100); letter-spacing: .02em; }
.hero-pill { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.22); border-radius: var(--r-md); padding: 10px 14px; backdrop-filter: blur(4px); }
.hero-pill small { display: block; font-size: 11px; color: var(--green-100); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.hero-pill b { font-size: 15px; font-weight: 700; }

/* ===================== Lists / rows ===================== */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 13px; padding: 13px 20px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; }
.row-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 38px; }
.row-main { min-width: 0; flex: 1; }
.row-main b { font-size: 14px; font-weight: 600; display: block; }
.row-main small { font-size: 12.5px; color: var(--ink-500); }
.row-meta { margin-left: auto; text-align: right; white-space: nowrap; }

/* action tiles (quick actions) */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile {
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  padding: 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface);
  text-align: left; transition: all .14s;
}
.tile:hover { border-color: var(--green-300); box-shadow: var(--sh-md); transform: translateY(-2px); }
.tile-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; }
.tile b { font-size: 13.5px; font-weight: 600; }
.tile small { font-size: 11.5px; color: var(--ink-500); }

/* progress */
.pbar { height: 9px; background: var(--green-50); border-radius: 99px; overflow: hidden; border: 1px solid var(--green-100); }
.pbar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--green-600), var(--green-500)); border-radius: 99px; }
.pbar.gold > i { background: linear-gradient(90deg, var(--gold-600), var(--gold-500)); }

.ring-wrap { position: relative; width: 132px; height: 132px; }
.ring-wrap .ring-txt { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring-txt b { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.ring-txt small { font-size: 11px; color: var(--ink-500); }

/* ===================== Forms ===================== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-700); }
.field label .req { color: var(--error); }
.field .hint { font-size: 12px; color: var(--ink-400); }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 14px; color: var(--ink-900);
  transition: border-color .14s, box-shadow .14s;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-400); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px var(--green-100); }
.textarea { resize: vertical; min-height: 92px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23515f57' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }

/* dropzone */
.dropzone {
  border: 2px dashed var(--green-200); border-radius: var(--r-lg); background: var(--green-50);
  padding: 34px 20px; text-align: center; transition: all .15s; cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--green-500); background: var(--green-100); }
.dropzone .dz-ic { width: 56px; height: 56px; border-radius: 50%; background: #fff; color: var(--green-700); display: grid; place-items: center; margin: 0 auto 12px; box-shadow: var(--sh-sm); }
.dropzone b { font-size: 15px; }
.dropzone small { display: block; color: var(--ink-500); margin-top: 4px; font-size: 12.5px; }

/* ===================== Tables ===================== */
.tbl-wrap { width: 100%; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-500); padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tbl tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--green-50); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--fm); font-size: 12.5px; }
.txn-card-list { display: none; }

/* definition rows (profile) */
.def { display: grid; grid-template-columns: 180px 1fr; gap: 4px 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.def:last-child { border-bottom: none; }
.def dt { font-size: 13px; color: var(--ink-500); font-weight: 500; }
.def dd { font-size: 14px; color: var(--ink-900); font-weight: 600; margin: 0; }
.def dd.empty { color: var(--ink-400); font-weight: 500; font-style: italic; }

/* alert / callout */
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid; font-size: 13.5px; align-items: flex-start; }
.callout .ic { flex: 0 0 auto; margin-top: 1px; }
.callout b { display: block; font-weight: 700; margin-bottom: 2px; }
.callout-warning { background: var(--warning-bg); border-color: #ecd9a3; color: #7a5708; }
.callout-warning .ic { color: var(--warning); }
.callout-info { background: var(--info-bg); border-color: #c5ddf0; color: #1a5687; }
.callout-info .ic { color: var(--info); }
.callout-success { background: var(--success-bg); border-color: #bfe2cd; color: #0c6b3c; }
.callout-success .ic { color: var(--success); }
.callout-error { background: var(--error-bg); border-color: #eecfca; color: #9c2b1f; }
.callout-error .ic { color: var(--error); }

/* stepper */
.stepper { display: flex; align-items: center; gap: 0; }
.step { display: flex; align-items: center; gap: 9px; }
.step-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; border: 2px solid var(--line-strong); color: var(--ink-400); background: #fff; flex: 0 0 28px; }
.step.done .step-num { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.step.active .step-num { border-color: var(--green-700); color: var(--green-700); }
.step-lbl { font-size: 13px; font-weight: 600; color: var(--ink-400); white-space: nowrap; }
.step.done .step-lbl, .step.active .step-lbl { color: var(--ink-900); }
.step-line { flex: 1; height: 2px; background: var(--line-strong); margin: 0 12px; min-width: 18px; }
.step-line.done { background: var(--green-500); }

/* avatar in topbar */
.tb-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(140deg, var(--green-500), var(--green-800)); color:#fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex:0 0 40px; }

/* mobile chrome (hidden on desktop) */
.mobile-topbar, .bottom-nav, .drawer-scrim, .drawer { display: none; }

/* doc status chip on upload */
.doc-row { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.doc-ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 42px; background: var(--green-50); color: var(--green-700); }

/* inbox */
.msg-item { display: flex; gap: 13px; padding: 15px 18px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.msg-item:hover { background: var(--surface-2); }
.msg-item.unread { background: var(--green-50); }
.msg-item.unread:hover { background: var(--green-100); }
.msg-item.sel { background: var(--green-100); box-shadow: inset 3px 0 0 var(--green-700); }
.msg-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green-600); flex: 0 0 9px; margin-top: 6px; }
.msg-dot.read { background: transparent; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--ink-500); border-bottom: 2px solid transparent; white-space: nowrap; background:none; border-top:none; border-left:none; border-right:none; }
.tab:hover { color: var(--green-800); }
.tab.active { color: var(--green-800); border-bottom-color: var(--green-700); }

/* toast */
.toast-wrap { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 11px; background: var(--ink-900); color: #fff; padding: 13px 17px; border-radius: var(--r-md); box-shadow: var(--sh-lg); font-size: 14px; font-weight: 500; animation: toastIn .28s cubic-bezier(.2,.8,.3,1); max-width: 340px; }
.toast .ic { color: var(--green-300); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

/* fade for screen change - animate transform only (never opacity:0,
   so content stays visible even if the tab is backgrounded and the
   animation is paused at its first frame) */
.fade-in { animation: fadeIn .3s cubic-bezier(.2,.8,.3,1); }
@keyframes fadeIn { from { transform: translateY(9px); } to { transform: translateY(0); } }

.muted { color: var(--ink-500); }
.mono { font-family: var(--fm); }
.flex { display: flex; }
.between { display:flex; align-items:center; justify-content: space-between; }
.gap8 { gap: 8px; } .gap10 { gap: 10px; } .gap12 { gap: 12px; } .gap16{ gap:16px; }
.aic { align-items: center; }
.wrap { flex-wrap: wrap; }
.mt4{margin-top:4px;} .mt8{margin-top:8px;} .mt12{margin-top:12px;} .mt16{margin-top:16px;} .mt20{margin-top:20px;}
.mb0{margin-bottom:0;}

/* ===================== Responsive ===================== */

/* Tablet */
@media (max-width: 1100px) {
  .tb-search { width: 200px; }
}

/* Mobile + small tablet: drawer + bottom nav */
@media (max-width: 860px) {
  :root { --topbar-h: 58px; }
  .sidebar { transform: translateX(-100%); transition: transform .26s cubic-bezier(.3,.8,.3,1); box-shadow: var(--sh-lg); }
  .drawer-open .sidebar { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar { display: none; }

  .mobile-topbar {
    display: flex; align-items: center; gap: 12px; height: var(--topbar-h);
    position: sticky; top: 0; z-index: 45; padding: 0 14px;
    background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  }
  .mt-title { font-size: 16px; font-weight: 700; }
  .mt-spacer { flex: 1; }

  .drawer-scrim { display: block; position: fixed; inset: 0; background: rgba(8,30,18,.4); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .26s; }
  .drawer-open .drawer-scrim { opacity: 1; pointer-events: auto; }

  .content { padding: 16px 14px 92px; }
  .page-head h1 { font-size: 21px; }

  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: rgba(255,255,255,.95); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around;
  }
  .bn-item { display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: none; color: var(--ink-500); font-size: 10.5px; font-weight: 600; padding: 5px 8px; border-radius: 10px; flex: 1; min-width: 0; }
  .bn-item.active { color: var(--green-700); }
  .bn-item.active .ic { color: var(--green-700); }

  .drawer-close { display: grid !important; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .tb-search { display: none; }

  /* tables -> cards */
  table.tbl { display: none; }
  .txn-card-list { display: flex; flex-direction: column; gap: 10px; }
  .txn-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 15px; background: var(--surface); }
  .txn-card .between { margin-bottom: 8px; }
  .txn-kv { display: flex; justify-content: space-between; font-size: 12.5px; padding: 3px 0; }
  .txn-kv span:first-child { color: var(--ink-500); }
  .txn-kv span:last-child { font-family: var(--fm); font-weight: 600; }

  .def { grid-template-columns: 1fr; gap: 2px; }
  .hero { padding: 20px; border-radius: var(--r-lg); }
  .hero h2 { font-size: 19px; }

  .stepper { overflow-x: auto; padding-bottom: 4px; }
  .step-lbl { display: none; }
  .step.active .step-lbl { display: block; }
}

@media (max-width: 420px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .bn-item span { font-size: 10px; }
}

.inbox-grid { grid-template-columns: minmax(0,360px) 1fr; gap: 18px; }
@media (max-width: 860px) { .inbox-grid { grid-template-columns: 1fr; } }

/* desktop grids */
.cols-2 { grid-template-columns: 2fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .cols-2 { grid-template-columns: 1fr; } .cols-4 { grid-template-columns: repeat(2,1fr); } .cols-3 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .cols-4 { grid-template-columns: 1fr 1fr; } }


/* keyboard focus */
*:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }
button:focus-visible { outline: 2px solid var(--green-500); outline-offset: 2px; }

/* phase preview pill */
.badge-phase { background: var(--gold-50); color: var(--gold-800); border: 1px solid var(--gold-200); font-size: 11px; padding: 3px 9px; letter-spacing: .02em; display: inline-flex; align-items: center; gap: 5px; }

/* payment method tiles */
.method-tile { cursor: pointer; transition: border-color .14s, box-shadow .14s, background .14s; text-align: left; width: 100%; font: inherit; color: inherit; }
.method-tile:hover { border-color: var(--green-300); }
.method-tile.selected { border-color: var(--green-600); background: var(--green-50); box-shadow: 0 0 0 3px var(--green-100); }

/* processing spinner */
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--green-100); border-top-color: var(--green-600); animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* loan calculator slider */
input[type="range"].slider { width: 100%; accent-color: var(--green-700); }

/* login role selector */
.role-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.role-opt { display: flex; align-items: center; gap: 7px; padding: 10px 11px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-700); text-align: left; transition: border-color .14s, background .14s, box-shadow .14s; }
.role-opt:hover { border-color: var(--green-300); }
.role-opt.selected { border-color: var(--green-600); background: var(--green-50); box-shadow: 0 0 0 3px var(--green-100); color: var(--green-800); }
.role-opt .ic { flex: 0 0 auto; }
.role-opt span:first-of-type { flex: 1; min-width: 0; }
.role-soon { flex: 0 0 auto; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--gold-800); background: var(--gold-50); border: 1px solid var(--gold-200); border-radius: var(--r-pill); padding: 1px 6px; }
@media (max-width: 560px) { .role-seg { grid-template-columns: 1fr; } }

/* passive bot-check widget (Turnstile-style) */
.turnstile { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); transition: border-color .25s, background .25s; }
.turnstile.ok { border-color: var(--green-300); background: var(--green-50); }
.ts-spin { width: 16px; height: 16px; flex: 0 0 16px; border-radius: 50%; border: 2.5px solid var(--green-100); border-top-color: var(--green-600); animation: spin .8s linear infinite; }
.ts-tick { flex: 0 0 18px; }
.ts-ring { stroke-dasharray: 63; stroke-dashoffset: 63; transform-origin: 12px 12px; animation: ts-ring .45s ease-out forwards; }
.ts-check { stroke-dasharray: 18; stroke-dashoffset: 18; animation: ts-check .3s .32s ease-out forwards; }
@keyframes ts-ring { to { stroke-dashoffset: 0; } }
@keyframes ts-check { to { stroke-dashoffset: 0; } }
.ts-txt { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--ink-700); animation: ts-fade .3s ease-out; }
@keyframes ts-fade { from { opacity: 0; } to { opacity: 1; } }
.ts-brand { flex: 0 0 auto; color: var(--ink-400); }

