* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font-body, system-ui, sans-serif);
  color: var(--text, #16202e);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#root, .root { height: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
a { color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 26%, transparent); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.muted { color: var(--muted); }
.ta-r { text-align: right; }

/* ============ APP LAYOUT ============ */
.app-root {
  display: grid;
  grid-template-columns: 264px 1fr;
  height: 100%;
  background: var(--bg);
  color: var(--text);
}
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }

/* ============ SIDEBAR ============ */
.sidebar {
  background: var(--nav);
  display: flex; flex-direction: column;
  padding: 22px 16px;
  gap: 8px;
  border-right: 1px solid color-mix(in srgb, var(--nav) 80%, #000 8%);
}
.side-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 4px 8px 18px; }
.side-logo-img { height: 26px; width: auto; }
.side-context { font-size: 12px; font-weight: 600; color: var(--nav-text); opacity: .85; padding-left: 2px; }
.side-logo {
  width: 38px; height: 38px; border-radius: min(var(--r), 12px);
  display: grid; place-items: center;
  background: var(--accent); color: #fff; flex: none;
}
.side-brand-name {
  font-family: var(--font-head); font-weight: var(--head-weight);
  font-size: 16px; line-height: 1.15; letter-spacing: var(--head-spacing);
  color: var(--nav-text-active);
}
.side-nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.side-link {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 13px; border-radius: min(var(--r), 12px);
  color: var(--nav-text); font-size: 14.5px; font-weight: 600;
  text-align: left; transition: background .15s, color .15s;
}
.side-link:hover { color: var(--nav-text-active); background: var(--nav-active); }
.side-active { color: var(--nav-text-active); background: var(--nav-active); }
.side-active svg { color: var(--accent); }
[data-direction="trust"] .sidebar { background: linear-gradient(180deg, var(--nav), color-mix(in srgb, var(--nav) 64%, #000 30%)); }
[data-direction="trust"] .side-active { box-shadow: inset 3px 0 0 var(--accent); }
[data-direction="trust"] .side-active svg { color: #85B7EB; }
[data-direction="bold"] .side-link { text-transform: uppercase; letter-spacing: .04em; font-size: 12.5px; font-weight: 600; }
.side-foot { margin-top: auto; }
.side-help {
  display: flex; gap: 11px; align-items: center;
  padding: 13px; border-radius: min(var(--r), 14px);
  background: var(--nav-active);
}
.side-help-ic { color: var(--accent); display: grid; place-items: center; }
.side-help strong { display: block; font-size: 12.5px; color: var(--nav-text-active); }
.side-help span { display: block; font-size: 12.5px; color: var(--nav-text); }

/* ============ TOPBAR ============ */
.topbar-logo { display: none; width: 34px; height: 34px; flex: none; }
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: relative; z-index: 30;
}
.top-search {
  flex: 1; max-width: 460px;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 15px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--faint);
  border: 1px solid var(--border);
}
.top-search input { border: none; background: none; outline: none; width: 100%; font-size: 14px; color: var(--text); }
.top-right { display: flex; align-items: center; gap: 10px; margin-left: auto; position: relative; }
.top-ic { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.top-ic:hover { background: var(--surface-2); color: var(--text); }
.top-badge { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.top-divider { width: 1px; height: 26px; background: var(--border); }
.top-user { display: flex; align-items: center; gap: 9px; padding: 5px 9px 5px 5px; border-radius: var(--r-pill); color: var(--muted); }
.top-user:hover { background: var(--surface-2); }
.top-user-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.menu-scrim { position: fixed; inset: 0; z-index: 40; }
.user-menu {
  position: absolute; top: 52px; right: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow);
  padding: 6px; min-width: 210px; display: flex; flex-direction: column; gap: 2px;
}
.user-menu button { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500; color: var(--text); text-align: left; }
.user-menu button:hover { background: var(--surface-2); }
.user-menu .menu-danger { color: #d23f3f; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 2px; }

/* ============ AVATAR ============ */
.avatar {
  border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000 22%));
  color: #fff; font-weight: 700; font-family: var(--font-head); letter-spacing: .01em;
}

/* ============ PAGE ============ */
.page { padding: var(--page-pad); max-width: 1180px; margin: 0 auto; width: 100%; }
.page-narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); margin-bottom: 7px; }
.page-title { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 29px; letter-spacing: var(--head-spacing); line-height: 1.1; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.page-head > div { min-width: 0; }
.page-head { min-width: 0; }
[data-direction="bold"] .page-title { font-size: 34px; }
.unit-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted); padding: 8px 13px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill); }
.unit-chip svg { color: var(--accent); }

/* ============ CARD ============ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: var(--card-pad) var(--card-pad) 0; }
.card[style*="padding: 0"] > .section-head + .list, .card[style*="padding: 0"] > .section-head + .table, .card[style*="padding: 0"] > .section-head + .quick-grid { margin-top: 14px; }
.section-title { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 16.5px; letter-spacing: var(--head-spacing); white-space: nowrap; }
.section-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ============ BUTTONS ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; border-radius: min(var(--r), 13px); transition: background .15s, color .15s, box-shadow .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(.5px); }
.btn-sm { padding: 8px 13px; font-size: 13px; }
.btn-md { padding: 10px 16px; font-size: 14px; }
.btn-lg { padding: 13px 20px; font-size: 15px; }
.btn-full { width: 100%; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost-accent { color: var(--accent); }
.btn-ghost-accent:hover { background: var(--accent-soft); }
.btn-onaccent { background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(4px); }
.btn-onaccent:hover { background: rgba(255,255,255,.26); }
.icon-btn { width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--accent); }

/* ============ PILL ============ */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: var(--r-pill); white-space: nowrap; }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; }

/* ============ GRIDS / DASH ============ */
.grid-3 { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: var(--gap); margin-bottom: var(--gap); }
.dash-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--gap); }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: var(--gap); }

.balance-hero { background: linear-gradient(150deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #000 18%)); border: none; color: #fff; display: flex; flex-direction: column; }
.bh-row { display: flex; align-items: center; justify-content: space-between; }
.balance-hero .bh-label { color: rgba(255,255,255,.8); }
.balance-hero .pill { background: rgba(255,255,255,.2) !important; color: #fff !important; }
.balance-hero .pill-dot { background: #fff !important; }
.bh-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.bh-amount { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 40px; letter-spacing: -.02em; margin: 12px 0 4px; font-variant-numeric: tabular-nums; }
.bh-due { font-size: 13px; color: rgba(255,255,255,.85); }
.balance-hero .bh-actions { display: flex; gap: 9px; margin-top: auto; padding-top: 20px; }

.stat { display: flex; flex-direction: column; }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.stat-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat-ic { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--muted); background: var(--surface-2); }
.stat-value { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 30px; letter-spacing: -.01em; line-height: 1; }
.stat-sub { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 var(--card-pad) var(--card-pad); }
.quick-tile { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface-2); text-align: left; transition: border-color .15s, background .15s; }
.quick-tile:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.quick-ic { width: 38px; height: 38px; flex: none; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.quick-tile:hover .quick-ic { background: var(--accent); color: #fff; }
.quick-label { font-size: 13.5px; font-weight: 600; flex: 1; }
.quick-arrow { color: var(--faint); }

/* lists */
.list { display: flex; flex-direction: column; }
.list > * { border-top: 1px solid var(--border); }
.list > *:first-child { border-top: none; }
.empty-row { padding: 26px var(--card-pad); text-align: center; color: var(--muted); font-size: 13.5px; }

.req-row { display: flex; align-items: center; gap: 13px; padding: var(--row-pad); text-align: left; transition: background .12s; }
.req-row:hover { background: var(--surface-2); }
.req-ic { width: 38px; height: 38px; flex: none; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.req-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.req-title { font-size: 14px; font-weight: 600; }
.req-meta { font-size: 12.5px; color: var(--muted); }

.doc-row { display: flex; align-items: center; gap: 13px; padding: var(--row-pad); cursor: pointer; transition: background .12s; }
.doc-row:hover { background: var(--surface-2); }
.doc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.doc-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: 12px; color: var(--muted); }

.ann-row { display: flex; flex-direction: column; gap: 4px; padding: var(--row-pad); }
.ann-tag { align-self: flex-start; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); background: var(--accent-soft); padding: 3px 8px; border-radius: var(--r-pill); }
.ann-title { font-size: 13.5px; font-weight: 600; margin-top: 2px; }
.ann-body { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.ann-date { font-size: 11.5px; color: var(--faint); }

/* ============ DOC THUMB / PLACEHOLDER ============ */
.docthumb { flex: none; border-radius: var(--r-sm); position: relative; overflow: hidden; background-color: var(--surface-2); background-image: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--muted) 12%, transparent) 7px 8px); border: 1px solid var(--border); display: grid; place-items: center; }
.docthumb-tag { font-family: var(--font-mono); font-size: 9px; font-weight: 600; letter-spacing: .08em; color: var(--muted); background: var(--surface); padding: 2px 5px; border-radius: 3px; }
.ph-tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; color: var(--faint); }

/* ============ TOOLBAR / CHIPS / SEARCH ============ */
.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: var(--gap); flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 10px; padding: 10px 15px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--border); color: var(--faint); min-width: 240px; flex: 1; max-width: 340px; }
.search input { border: none; background: none; outline: none; width: 100%; font-size: 14px; color: var(--text); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 14px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--border); transition: all .12s; }
.chip:hover { border-color: var(--accent-line); color: var(--text); }
.chip-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ============ DOC GRID ============ */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: var(--gap); }
.doc-card { display: flex; flex-direction: column; gap: 15px; position: relative; }
.doc-flag { position: absolute; top: 14px; right: 14px; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 4px 9px; border-radius: var(--r-pill); }
.doc-card .docthumb { width: 52px; height: 64px; }
.doc-card-body { flex: 1; }
.doc-card-name { font-family: var(--font-head); font-weight: 600; font-size: 16px; letter-spacing: var(--head-spacing); }
.doc-card-meta { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.doc-card-actions { display: flex; gap: 9px; }
.doc-card-actions .btn { flex: 1; }

/* ============ BALANCE ============ */
.bal-cols { display: grid; grid-template-columns: 360px 1fr; gap: var(--gap); align-items: start; }
.bal-summary { display: flex; flex-direction: column; }
.bal-summary .bh-amount { color: var(--text); }
.bal-break { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; display: flex; flex-direction: column; gap: 11px; }
.bal-break-row { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); }
.bal-break-row span:last-child { font-family: var(--font-mono); color: var(--text); }
.bal-total { font-weight: 700; color: var(--text); padding-top: 11px; border-top: 1px solid var(--border); }
.bal-total span { color: var(--text) !important; }

/* ============ LEASE SUMMARY (Documents screen) ============ */
.lease-summary-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.lease-ic { width: 44px; height: 44px; flex: none; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.lease-body { flex: 1; min-width: 0; }
.lease-property { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 18px; letter-spacing: var(--head-spacing); }
.lease-addr { font-size: 13px; color: var(--muted); margin-top: 3px; }
.lease-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; padding-top: 16px; border-top: 1px solid var(--border); }
.lease-kv { display: flex; flex-direction: column; gap: 4px; }
.lease-kv span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.lease-kv strong { font-family: var(--font-mono); font-size: 14.5px; font-weight: 600; }

/* ============ DEPOSIT CARD (Balance screen) ============ */
.deposit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 18px; padding: 18px var(--card-pad) 4px; }
.deposit-kv { display: flex; flex-direction: column; gap: 5px; }
.deposit-kv span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.deposit-kv strong { font-size: 18px; }

/* ============ MOVEMENTS TABLE (Balance screen) ============ */
/* 6-col grid: date · ref · description · debit · credit · running balance */
.mov-table .tr { grid-template-columns: 110px 130px 1fr 110px 110px 130px; }
.mov-table .link { color: var(--accent); text-decoration: none; }
.mov-table .link:hover { text-decoration: underline; }
@media (max-width: 860px) { .mov-table .tr { grid-template-columns: 1fr auto auto; } }

/* ============ UTILITIES CHARTS ============ */
.util-card { display: flex; flex-direction: column; }
.util-legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--muted); margin: 8px 0 12px; }
.util-legend span { display: inline-flex; align-items: center; gap: 7px; }
.util-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.util-dot-curr { background: var(--accent); }
.util-dot-prev { background: var(--accent-line); }
.util-chart-wrap { border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); padding: 6px 8px; }
.util-totals { display: flex; gap: 22px; margin-top: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.util-totals strong { color: var(--text); font-family: var(--font-mono); }

/* Side-by-side Units + Amount charts (Monthly + YoY) */
.util-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.util-axis-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-bottom: 8px; }
@media (max-width: 860px) { .util-pair { grid-template-columns: 1fr; gap: 18px; } }

/* Monthly history table grid: 3 cols (month, units, amount). Reuses .tr from
   .table — needs a column-template override since the default is 6 cols. */
.util-card .mov-table .tr { grid-template-columns: 1fr 140px 160px; }
@media (max-width: 860px) { .util-card .mov-table .tr { grid-template-columns: 1fr auto auto; } }

/* YoY comparison table: 7 cols (month + 3 unit + 3 amount) */
.yoy-table .tr { grid-template-columns: 80px 110px 110px 80px 110px 110px 80px; align-items: center; gap: 10px; padding: var(--row-pad); font-size: 13px; border-top: 1px solid var(--border); }
.yoy-table .tr.th { border-top: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); }
.yoy-table .diff-up   { color: #d23f3f; }
.yoy-table .diff-down { color: #1f8a5b; }
@media (max-width: 860px) { .yoy-table { overflow-x: auto; } .yoy-table .tr { min-width: 680px; } }

/* ============ MAINTENANCE CHAT ============ */
.chat-card { display: flex; flex-direction: column; }
.chat-thread { display: flex; flex-direction: column; gap: 12px; padding: 14px var(--card-pad); max-height: 480px; overflow-y: auto; }
.chat-msg { display: flex; }
.chat-msg.chat-tenant   { justify-content: flex-end; }
.chat-msg.chat-landlord { justify-content: flex-start; }
.chat-msg.chat-system   { justify-content: center; }
.chat-bubble { max-width: 78%; padding: 10px 14px; border-radius: var(--r); font-size: 13.5px; line-height: 1.5; }
.chat-tenant   .chat-bubble { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.chat-landlord .chat-bubble { background: var(--surface-2); color: var(--text); border-bottom-left-radius: 4px; }
.chat-system   .chat-bubble { background: transparent; color: var(--muted); font-size: 12.5px; font-style: italic; max-width: 90%; text-align: center; padding: 6px 12px; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 11.5px; margin-bottom: 4px; opacity: .9; }
.chat-tenant .chat-head { color: rgba(255,255,255,.85); }
.chat-landlord .chat-head { color: var(--muted); }
.chat-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.chat-date { font-weight: 400; }
.chat-form { display: flex; gap: 10px; padding: 14px var(--card-pad); border-top: 1px solid var(--border); align-items: flex-end; }
.chat-form textarea { flex: 1; min-height: 44px; resize: vertical; }
.chat-closed-note { padding: 14px var(--card-pad); border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); text-align: center; }

/* Chat form: textarea + send button on one row, photo thumbs on a second row. */
.chat-form { flex-direction: column; gap: 8px; align-items: stretch; }
.chat-form-row { display: flex; gap: 10px; align-items: flex-end; }
.chat-form-row textarea { flex: 1; min-height: 44px; resize: vertical; }
.chat-photo-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Attachment thumbnails (in chat bubbles). */
.chat-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chat-photo { display: block; border-radius: 6px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--text) 20%, transparent); flex: none; }
.chat-photo img { display: block; width: 84px; height: 84px; object-fit: cover; }
.chat-tenant .chat-photo { border-color: rgba(255,255,255,.3); }

/* Upload thumbs for the picker (and reply composer). */
.upload-thumb-img { padding: 0; overflow: hidden; position: relative; }
.upload-thumb-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.upload-thumb-sm { width: 56px; height: 56px; }
.upload-add-sm { width: 56px; height: 56px; padding: 0; }
.upload-rm {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; font-size: 15px; line-height: 18px;
  border: 0; cursor: pointer; padding: 0;
}

/* ============ NOTIFICATIONS BELL ============ */
/* Override the prototype's static-dot badge for the counting variant. */
.top-badge-count {
  width: auto; height: auto; padding: 1px 5px; min-width: 16px;
  border-radius: 8px; top: 4px; right: 4px;
  font-size: 10.5px; font-weight: 700; color: #fff;
  background: #d23f3f; box-shadow: 0 0 0 2px var(--surface);
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.notif-menu {
  position: absolute; top: 52px; right: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow);
  padding: 8px; min-width: 280px; max-width: 340px;
  display: flex; flex-direction: column; gap: 2px;
}
.notif-head { padding: 6px 10px 8px; font-family: var(--font-head); font-weight: var(--head-weight); font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.notif-empty { padding: 18px 12px; text-align: center; font-size: 13px; color: var(--muted); }
.notif-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border-radius: var(--r-sm);
  text-align: left; color: var(--text); transition: background .12s;
}
.notif-row:hover { background: var(--surface-2); }
.notif-ic { width: 34px; height: 34px; flex: none; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.notif-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.notif-body strong { font-size: 13.5px; font-weight: 600; }
.notif-body span { font-size: 12px; color: var(--muted); margin-top: 2px; }
.notif-foot { margin-top: 4px; padding: 8px 10px; border-top: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--accent); text-align: center; }
.notif-foot:hover { background: var(--accent-soft); }

/* ============ TABLE ============ */
.table { display: flex; flex-direction: column; }
.tr { display: grid; grid-template-columns: 110px 1fr 1.3fr 100px 90px; align-items: center; gap: 14px; padding: var(--row-pad); border-top: 1px solid var(--border); font-size: 13.5px; }
.tr.th { border-top: none; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); padding-top: 14px; padding-bottom: 14px; }
.bal-history .tr:not(.th):hover { background: var(--surface-2); }
.inv-table .tr { grid-template-columns: 1fr 140px 120px 150px; }
.inv-period { display: flex; align-items: center; gap: 13px; }
.inv-ic { width: 38px; height: 38px; flex: none; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.inv-period strong { display: block; font-size: 14px; font-weight: 600; }
.inv-period em { display: block; font-style: normal; font-size: 11.5px; color: var(--faint); font-family: var(--font-mono); margin-top: 2px; }
.inv-acts { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.inv-period em { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
/* customer tables */
.cust-inv-table .tr { grid-template-columns: 1fr 120px 120px 96px; }
.cust-full-table .tr { grid-template-columns: 1fr 104px 104px 120px 116px 84px; }
.stmt-table .tr { grid-template-columns: 1fr 130px 150px 132px; }
.act-table .tr { grid-template-columns: 104px 110px 1fr 120px 120px 128px; }
.act-table { min-width: 640px; }
.table-scroll { overflow-x: auto; }
.act-ref { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; padding: 2px 7px; border-radius: 5px; }
.act-debit { color: var(--accent); background: var(--accent-soft); }
.act-credit { color: #1f8a5b; background: rgba(31,138,91,.12); }
/* customer misc */
.mgr-card { display: flex; flex-direction: column; }
.mgr-row { display: flex; align-items: center; gap: 13px; }
.mgr-body strong { display: block; font-size: 14px; }
.mgr-body span { display: block; font-size: 12.5px; color: var(--muted); }
.stmt-gen { margin-bottom: var(--gap); }
.stmt-gen-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.stmt-fields { display: flex; align-items: flex-end; gap: 12px; }
.stmt-fields .field { gap: 6px; }
.stmt-fields .input { width: 160px; }

/* ============ TABS ============ */
.tabs { display: flex; gap: 4px; margin-bottom: var(--gap); border-bottom: 1px solid var(--border); }
.tab { display: flex; align-items: center; gap: 7px; padding: 11px 15px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab-on { color: var(--accent); border-bottom-color: var(--accent); }
.tab-n { font-size: 11.5px; background: var(--surface-2); color: var(--muted); padding: 1px 7px; border-radius: var(--r-pill); }
.tab-on .tab-n { background: var(--accent-soft); color: var(--accent); }

/* ============ REQUEST CARDS ============ */
.req-cards { display: flex; flex-direction: column; gap: 13px; }
.req-card { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.req-card:hover { border-color: var(--accent-line); }
.req-card-top { display: flex; align-items: center; gap: 13px; }
.req-card-head { flex: 1; min-width: 0; }
.req-card-title { font-family: var(--font-head); font-weight: 600; font-size: 16px; letter-spacing: var(--head-spacing); min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.req-card-head { min-width: 0; }
.req-card-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.req-card-desc { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin: 13px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.req-card-foot { display: flex; align-items: center; gap: 16px; font-size: 12.5px; flex-wrap: wrap; }
.req-card-date { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.prio { font-weight: 600; }
.prio-low { color: var(--faint); }
.prio-normal { color: var(--muted); }
.prio-urgent { color: #d23f3f; }
.req-card-link { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; }

/* ============ DETAIL / TIMELINE ============ */
.back { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--muted); margin-bottom: 18px; }
.back:hover { color: var(--accent); }
.detail-cols { display: grid; grid-template-columns: 1fr 320px; gap: var(--gap); align-items: start; }
.detail-block { display: flex; flex-direction: column; }
.block-h { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 15px; margin-bottom: 13px; }
.detail-desc { font-size: 14px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; word-break: break-word; }
.detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.dm-k { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-bottom: 4px; }
.dm-v { font-size: 13.5px; font-weight: 600; }
.timeline { display: flex; flex-direction: column; }
.tl-step { display: flex; gap: 13px; padding-bottom: 18px; position: relative; }
.tl-step:not(:last-child)::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--border); }
.tl-dot { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; z-index: 1; }
.tl-done .tl-dot { background: var(--accent); }
.tl-pending .tl-dot { background: var(--surface); border: 2px solid var(--border); }
.tl-label { display: block; font-size: 13.5px; font-weight: 600; }
.tl-pending .tl-label { color: var(--muted); }
.tl-date { display: block; font-size: 12px; color: var(--faint); margin-top: 2px; }

/* ============ FORM ============ */
.form-card { margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.span-2 { grid-column: 1 / -1; }
.field-label { font-size: 13px; font-weight: 600; }
.field-label em { color: var(--accent); font-style: normal; }
.muted-inline { color: var(--faint); font-weight: 500; }
.input { padding: 11px 14px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s; width: 100%; }
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-err { border-color: #d23f3f; }
.textarea { resize: vertical; line-height: 1.5; }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; cursor: pointer; }
.select-chev { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.seg { display: flex; gap: 7px; }
.seg-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--muted); transition: all .12s; }
.seg-btn:hover { border-color: var(--accent-line); }
.seg-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.hint { font-size: 12.5px; line-height: 1.5; margin-top: 2px; }
.hint-warn { color: #9a6a00; background: rgba(184,134,11,.1); padding: 10px 12px; border-radius: var(--r-sm); }
.radio, .check { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text); cursor: pointer; padding: 4px 0; }
.radio input, .check input { width: 17px; height: 17px; accent-color: var(--accent); }
.upload { display: flex; gap: 12px; flex-wrap: wrap; }
.upload-thumb, .upload-add { width: 92px; height: 92px; border-radius: var(--r-sm); display: grid; place-items: center; }
.upload-thumb { background-color: var(--surface-2); background-image: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--muted) 12%, transparent) 7px 8px); border: 1px solid var(--border); }
.upload-add { border: 1.5px dashed var(--border); color: var(--muted); flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; transition: all .15s; }
.upload-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.form-actions { display: flex; justify-content: flex-end; gap: 11px; }
.form-err { display: flex; align-items: center; gap: 8px; color: #d23f3f; font-size: 13px; font-weight: 600; margin-bottom: 14px; }

/* ============ PROFILE ============ */
/* `flex-wrap: wrap` lets the right-hand button slide onto its own line when
   the avatar + name + button can't all fit. `min-width: 0` on the text
   block stops long names from pushing the button off-screen. */
.profile-hero { display: flex; align-items: center; gap: 18px; margin-bottom: var(--gap); flex-wrap: wrap; }
.profile-id { flex: 1; min-width: 0; }
.profile-id h2 { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 21px; letter-spacing: var(--head-spacing); overflow-wrap: anywhere; word-break: break-word; }
.profile-id p { font-size: 13.5px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.profile-grid .span-2 { grid-column: 1 / -1; }
.kv-list { display: flex; flex-direction: column; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: var(--row-pad); border-top: 1px solid var(--border); font-size: 13.5px; }
.kv:first-child { border-top: none; }
.kv-k { color: var(--muted); }
.kv-v { font-weight: 600; text-align: right; }
.toggle-list { display: flex; flex-direction: column; }
.toggle-row { display: flex; align-items: center; gap: 16px; padding: var(--row-pad); border-top: 1px solid var(--border); text-align: left; }
.toggle-row:first-child { border-top: none; }
.toggle-body { flex: 1; }
.toggle-label { display: block; font-size: 14px; font-weight: 600; }
.toggle-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.switch { width: 42px; height: 24px; border-radius: var(--r-pill); background: var(--border); position: relative; transition: background .18s; flex: none; }
.switch-on { background: var(--accent); }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch-on .switch-knob { left: 21px; }
.security-card .sec-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sec-ic { width: 42px; height: 42px; flex: none; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.sec-body { flex: 1; min-width: 0; }
.sec-body strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.sec-body span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }

/* ============ LINKS / FIELDS (login) ============ */
.link { color: var(--accent); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ============ LOGIN ============ */
.login { display: grid; grid-template-columns: 1.05fr 1fr; height: 100%; background: var(--bg); }
.login-brand { background: radial-gradient(120% 120% at 0% 0%, #243349, #0e1521 70%); color: #fff; display: flex; align-items: center; padding: 48px; position: relative; overflow: hidden; }
.login-brand::after { content: ""; position: absolute; width: 420px; height: 420px; right: -120px; bottom: -140px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent), transparent 68%); }
.login-brand-inner { max-width: 440px; margin: 0 auto; width: 100%; position: relative; z-index: 1; }
.login-brand-logo { height: 30px; width: auto; margin-bottom: 38px; }
.login-logo-img { height: 30px; width: auto; }
.login-mark-sm { display: none; align-items: center; gap: 10px; margin-bottom: 8px; }
.login-products { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.lp-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.82); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); padding: 6px 11px; border-radius: 999px; }
.lp-dot { width: 8px; height: 8px; border-radius: 50%; }
.login-photo { width: 100%; aspect-ratio: 16/10; border-radius: var(--r-lg); margin-bottom: 30px; display: grid; place-items: center; background-color: rgba(255,255,255,.08); background-image: repeating-linear-gradient(135deg, transparent 0 11px, rgba(255,255,255,.07) 11px 12px); border: 1px solid rgba(255,255,255,.16); }
.login-photo .ph-tag { color: rgba(255,255,255,.7); }
/* on-brand login art (statement card) */
.login-art { position: relative; height: 250px; margin: 8px 0 34px; }
.art-card { position: absolute; border-radius: 18px; background: #fff; }
.art-card-back { inset: 0 16% 40px 4%; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.12); transform: rotate(-4deg); }
.art-card-main { inset: 20px 4% 14px 12%; padding: 22px 22px 20px; display: flex; flex-direction: column; transform: rotate(2.2deg); box-shadow: 0 30px 60px rgba(0,0,0,.4); }
.art-head { display: flex; align-items: center; gap: 12px; }
.art-logo { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.art-head-text { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.art-title { font-size: 14px; font-weight: 700; color: #1e293b; }
.art-sub { font-size: 11.5px; color: #94a3b8; }
.art-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; color: #0F6E56; background: #e7f5ef; padding: 4px 9px; border-radius: 999px; }
.art-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: #0F6E56; }
.art-rows { display: flex; flex-direction: column; gap: 13px; margin: 20px 0; flex: 1; }
.art-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.art-bar { height: 9px; border-radius: 5px; background: #e7ebf1; }
.art-amt { font-family: var(--font-mono); font-size: 12px; color: #475569; font-variant-numeric: tabular-nums; }
.art-total { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid #eef2f6; font-size: 13px; font-weight: 700; color: #1e293b; }
.art-total-amt { font-family: var(--font-mono); color: #185FA5; }
.art-badge { position: absolute; right: -5%; bottom: -20px; width: 44px; height: 44px; border-radius: 50%; background: #0F6E56; color: #fff; display: grid; place-items: center; box-shadow: 0 12px 26px rgba(15,110,86,.45); border: 3px solid #0e1521; }
.login-tagline { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 31px; line-height: 1.14; letter-spacing: var(--head-spacing); margin-bottom: 14px; }
.login-blurb { font-size: 14.5px; line-height: 1.6; color: rgba(255,255,255,.85); }
.login-formside { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 16px; }
.login-h { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 26px; letter-spacing: var(--head-spacing); }
.login-p { font-size: 14px; color: var(--muted); margin-top: -8px; margin-bottom: 4px; }
.login-row { display: flex; align-items: center; justify-content: space-between; margin: -2px 0 4px; }
.login-foot { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.role-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.role-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 13px 6px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 12.5px; font-weight: 600; transition: all .14s; }
.role-btn:hover { border-color: var(--accent-line); color: var(--text); }
.role-on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.role-hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; min-height: 34px; }
.demo-accounts { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); }
.demo-label { display: block; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-bottom: 9px; }
.demo-rows { display: flex; flex-direction: column; gap: 7px; }
.demo-row { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); text-align: left; transition: all .13s; }
.demo-row:hover { border-color: var(--accent-line); background: var(--surface-2); }
.demo-on { border-color: var(--accent); background: var(--accent-soft); }
.demo-ic { width: 28px; height: 28px; flex: none; border-radius: 7px; display: grid; place-items: center; }
.demo-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.demo-text b { font-size: 13px; font-weight: 600; color: var(--text); }
.demo-text em { font-style: normal; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-check { color: var(--accent); flex: none; }

/* ============ LOADING SCREEN ============ */
.loadscreen { height: 100%; display: grid; place-items: center; background: var(--bg); position: relative; overflow: hidden; }
.load-blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none; }
.load-blob-a { width: 460px; height: 460px; top: -140px; left: -120px; background: color-mix(in srgb, var(--pc) 45%, transparent); animation: blob 9s ease-in-out infinite; }
.load-blob-b { width: 400px; height: 400px; bottom: -150px; right: -110px; background: color-mix(in srgb, var(--pc) 32%, transparent); animation: blob 11s ease-in-out infinite reverse; }
@keyframes blob { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(30px,20px) scale(1.08); } }
.load-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; animation: load-rise .5s cubic-bezier(.2,.7,.3,1); }
@keyframes load-rise { from { transform: translateY(16px); } to { transform: translateY(0); } }
.load-lockup { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.load-mark-img { width: 58px; height: 58px; border-radius: 16px; box-shadow: 0 10px 30px color-mix(in srgb, var(--pc) 40%, transparent); animation: mark-pulse 1.8s ease-in-out infinite; }
@keyframes mark-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.load-names { text-align: left; }
.load-name { display: block; font-family: var(--font-head); font-weight: var(--head-weight); font-size: 23px; letter-spacing: var(--head-spacing); color: var(--text); }
.load-sub { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.load-track { width: 240px; height: 5px; border-radius: 999px; background: color-mix(in srgb, var(--pc) 16%, var(--surface-2)); overflow: hidden; }
.load-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--pc); animation: load-fill 2.5s cubic-bezier(.5,.05,.2,1) forwards; }
@keyframes load-fill { 0% { width: 4%; } 35% { width: 48%; } 70% { width: 78%; } 100% { width: 100%; } }
.load-status { display: flex; align-items: center; gap: 9px; margin-top: 18px; height: 20px; }
.load-spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--pc) 25%, transparent); border-top-color: var(--pc); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.load-msg { font-size: 13.5px; font-weight: 600; color: var(--muted); animation: msg-in .35s ease; }
@keyframes msg-in { from { transform: translateY(5px); } to { transform: translateY(0); } }
.load-foot { position: absolute; bottom: 30px; display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--faint); }

/* ============ LANDING STUB ============ */
.landing { height: 100%; display: flex; flex-direction: column; background: var(--bg); }
.landing-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; border-bottom: 1px solid var(--border); background: var(--surface); }
.landing-brand { display: flex; align-items: center; gap: 12px; }
.landing-logo { height: 28px; width: auto; }
.landing-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; }
.landing-bigmark { width: 78px; height: 78px; border-radius: 22px; display: grid; place-items: center; color: var(--pc); background: color-mix(in srgb, var(--pc) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--pc) 24%, var(--border)); margin-bottom: 22px; }
.landing-h { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 28px; letter-spacing: var(--head-spacing); }
.landing-p { font-size: 15px; color: var(--muted); margin-top: 10px; max-width: 420px; line-height: 1.5; }
.landing-note { display: flex; gap: 10px; text-align: left; max-width: 460px; margin: 24px 0; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--muted); line-height: 1.5; }
.landing-note svg { color: var(--pc); flex: none; margin-top: 1px; }
.landing-actions { display: flex; gap: 11px; flex-wrap: wrap; justify-content: center; }

/* ============ BOTTOM NAV (mobile) ============ */
.bottom-nav { display: none; }

/* ============ TOAST ============ */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.22); animation: toast-in .25s cubic-bezier(.2,.7,.3,1); }
.toast-ic { display: grid; place-items: center; color: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ============ RESPONSIVE ============ */
@media (max-width: 1080px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 .balance-hero { grid-column: 1 / -1; }
  .dash-cols { grid-template-columns: 1fr; }
  .bal-cols { grid-template-columns: 1fr; }
  .detail-cols { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app-root { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .scroll { padding-bottom: 76px; }
  .top-search { display: none; }
  .top-user-name { display: none; }
  .topbar { padding: 12px 18px; }
  .topbar-logo { display: block; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: var(--surface); border-top: 1px solid var(--border); padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); }
  .bn-link { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px; color: var(--muted); font-size: 10.5px; font-weight: 600; }
  .bn-active { color: var(--accent); }
  .page { padding: 22px 18px; }
  .page-title { font-size: 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; }
  .tr { grid-template-columns: 1fr auto auto; }
  .inv-table .tr { grid-template-columns: 1fr auto auto; }
  .cust-inv-table .tr { grid-template-columns: 1fr auto auto; }
  .cust-full-table .tr { grid-template-columns: 1fr auto auto auto; }
  .stmt-table .tr { grid-template-columns: 1fr auto auto; }
  .stmt-fields { flex-wrap: wrap; }
  .stmt-fields .input { width: 140px; }
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-mark-sm { display: flex; }
  .doc-grid { grid-template-columns: 1fr 1fr; }

  /* Profile + security cards: on phones, drop the right-hand button to
     its own full-width row so it never squishes the heading text. */
  .profile-hero { gap: 12px; }
  .profile-hero .btn { width: 100%; justify-content: center; }
  .security-card .sec-row { gap: 12px; }
  .security-card .sec-row .btn { width: 100%; justify-content: center; }
}
@media (max-width: 520px) {
  .doc-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .tr { font-size: 12.5px; }
}

/* ── Two-factor panel ───────────────────────────────────────── */
.tfa-card { font-size: 14px; color: #0f172a; }
.tfa-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tfa-title { font-weight: 600; font-size: 14px; }
.tfa-pill { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px; letter-spacing: 0.5px; }
.tfa-pill.on  { background: #dcfce7; color: #166534; }
.tfa-pill.off { background: #f1f5f9; color: #475569; }
.tfa-meta { color: #475569; margin: 0 0 14px; font-size: 13.5px; }
.tfa-alert { padding: 10px 12px; border-radius: 6px; margin-bottom: 12px; font-size: 13px; line-height: 1.4; }
.tfa-alert-err  { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.tfa-alert-ok   { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; }
.tfa-alert-warn { background: #fef3c7; border: 1px solid #fde68a; color: #92400e; }
.tfa-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 10px; }
.tfa-codes code { background: #fff; padding: 6px 10px; border-radius: 4px; border: 1px solid #fcd34d;
                  font-family: ui-monospace, monospace; font-size: 13px; letter-spacing: 1px; }
.tfa-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tfa-input { padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 14px;
             font-family: inherit; min-width: 180px; }
.tfa-input-code { letter-spacing: 2px; font-size: 16px; text-align: center; }
.tfa-label { display: block; font-size: 12px; font-weight: 600; color: #64748b; margin: 6px 0 4px; }
.tfa-hint { color: #94a3b8; font-weight: 400; font-size: 12px; }
.tfa-warn { color: #b91c1c; }
.tfa-secret { display: block; padding: 8px 10px; background: #f1f5f9; border-radius: 4px;
              font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all;
              letter-spacing: 1px; margin-bottom: 12px; }
.tfa-btn { padding: 8px 14px; border: 1px solid #cbd5e1; background: #fff; border-radius: 6px;
           font-size: 13.5px; font-weight: 500; cursor: pointer; }
.tfa-btn:hover { background: #f8fafc; }
.tfa-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.tfa-btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.tfa-btn-primary:hover { background: #1d4ed8; }
.tfa-btn-danger  { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.tfa-btn-danger:hover { background: #fee2e2; }
.tfa-btn-link { background: none; border: 0; color: #64748b; font-size: 13px; cursor: pointer; padding: 8px 4px; }
.tfa-enroll-grid { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.tfa-qr { width: 200px; height: 200px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; }
.tfa-enroll-form { flex: 1; min-width: 240px; }
