/* ============================================================================
   BSN Merchant Bank Bhd - Core stylesheet (customer portal)
   One design system for every authenticated page, built off the Overview
   page's visual language. Mobile-first. Breakpoints: 480 / 768 / 900 / 1024 / 1280
   ============================================================================ */

:root {
    /* ---- base palette (single source of truth) ---- */
    --c-navy: #004E9B;
    --c-navy-dark: #003A75;
    --c-navy-light: #E6EFF9;
    --c-red: #CC0000;
    --c-red-dark: #A30000;
    --c-green: #1E7E34;
    --c-green-light: #E6F4EA;
    --c-amber: #A66300;
    --c-amber-light: #FCF1DC;
    --c-ink: #16202B;
    --c-ink-muted: #5C6773;
    --c-line: #E3E7ED;
    --c-paper: #F3F5F8;
    --c-surface: #FFFFFF;

    /* ---- short design-system names (Overview pattern) ---- */
    --navy: var(--c-navy);
    --navy-dark: var(--c-navy-dark);
    --navy-light: var(--c-navy-light);
    --accent: var(--c-red);
    --accent-dark: var(--c-red-dark);
    --good: var(--c-green);
    --good-light: var(--c-green-light);
    --bad: var(--c-red-dark);
    --bad-light: #FBE9E9;
    --warn: var(--c-amber);
    --warn-light: var(--c-amber-light);
    --ink: var(--c-ink);
    --ink-muted: var(--c-ink-muted);
    --line: var(--c-line);
    --paper: var(--c-paper);
    --surface: var(--c-surface);

    /* ---- legacy/descriptive aliases (kept for inline styles across pages) ---- */
    --color-primary: var(--c-navy);
    --color-primary-dark: var(--c-navy-dark);
    --color-primary-light: var(--c-navy-light);
    --color-accent: var(--c-red);
    --color-accent-dark: var(--c-red-dark);
    --color-accent-light: #FBE9E9;
    --color-success: var(--c-green);
    --color-success-light: var(--c-green-light);
    --color-warning: var(--c-amber);
    --color-warning-light: var(--c-amber-light);
    --color-text: var(--c-ink);
    --color-text-muted: var(--c-ink-muted);
    --color-border: var(--c-line);
    --color-bg: var(--c-paper);
    --color-surface: var(--c-surface);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 8px 24px rgba(16, 40, 80, 0.08);
    --shadow-lg: 0 20px 48px rgba(16, 40, 80, 0.16);

    --font: -apple-system, "Segoe UI", system-ui, Roboto, sans-serif;
    --font-sans: var(--font);
    --sidebar-width: 240px;
    --topbar-height: 100px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
    font-family: var(--font);
    background: var(--paper);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0 0 0.5em; font-weight: 700; line-height: 1.25; }
p { margin: 0 0 1em; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }
.num { font-variant-numeric: tabular-nums; }

/* ---- Layout shell ---------------------------------------------------- */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.body-row { display: flex; flex: 1; min-height: 0; }

/* ---- Full-width site header ---------------------------------------------------- */
.site-topbar {
    height: var(--topbar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 18px;
    padding: 0 32px;
    position: sticky; top: 0; z-index: 210;
}
.site-logo { display: flex; align-items: center; flex-shrink: 0; }
.site-logo img { height: 55px; width: auto; display: block; }
.dash-hamburger {
    display: none; width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--line);
    background: var(--paper); cursor: pointer; align-items: center; justify-content: center; flex-shrink: 0;
}
.dash-hamburger svg { width: 18px; height: 18px; color: var(--ink); }
.site-topbar-spacer { flex: 1; }
.site-topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper);
    display: flex; align-items: center; justify-content: center; position: relative; color: var(--ink-muted); cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .badge, .badge {
    position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 3px;
    border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.62rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface);
}
.profile-chip {
    display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 5px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--paper); cursor: pointer; font: inherit;
}
.profile-chip .avatar {
    width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 0.74rem; font-weight: 700; flex-shrink: 0;
}
.profile-chip .name { font-size: 0.86rem; font-weight: 600; }

/* ---- Topbar dropdowns (notifications preview + profile menu) ------------------ */
.notif-wrap, .profile-wrap { position: relative; }
.dropdown {
    position: absolute; top: calc(100% + 10px); right: 0;
    width: min(340px, 90vw);
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    display: none; z-index: 300; overflow: hidden;
}
.dropdown.open { display: block; }
.dropdown-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 700;
}
.dropdown-header a { font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.dropdown-body { max-height: 360px; overflow-y: auto; }
.dropdown-empty { padding: 24px 16px; text-align: center; color: var(--ink-muted); margin: 0; }
.notif-item { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.notif-item:hover { background: var(--paper); }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--navy-light); }
.notif-item-title { font-weight: 600; font-size: 0.88rem; color: var(--ink); margin-bottom: 2px; }
.notif-item-body { font-size: 0.82rem; color: var(--ink-muted); margin-bottom: 4px; }
.notif-item-time { font-size: 0.75rem; color: var(--ink-muted); }

.dropdown-menu { min-width: 200px; padding: 8px; }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--ink); font-size: 0.9rem; min-height: 44px; }
.dropdown-item:hover { background: var(--paper); }
.dropdown-item-icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--ink-muted); }
.dropdown-item:hover .dropdown-item-icon { color: var(--ink); }
.dropdown-item-danger { color: var(--accent); }
.dropdown-item-danger .dropdown-item-icon { color: var(--accent); }
.dropdown-item-danger:hover { background: var(--bad-light); }
.dropdown-divider { height: 1px; background: var(--line); margin: 6px 4px; }

/* ---- Sidebar (sits below the site header) ---------------------------------------------------- */
.dash-sidebar {
    width: var(--sidebar-width); flex-shrink: 0;
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%);
    color: #fff;
    display: flex; flex-direction: column;
    position: sticky; top: var(--topbar-height); height: calc(100vh - var(--topbar-height)); z-index: 150;
}
.dash-sidebar-top { display: none; justify-content: flex-end; padding: 8px 8px 0; }
.dash-sidebar-close { background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; width: 36px; height: 36px; align-items: center; justify-content: center; display: flex; }

.dash-sidebar-nav { flex: 1; padding: 20px 14px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.dash-sidebar-nav a {
    display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.8); font-weight: 600; font-size: 0.89rem;
}
.dash-sidebar-nav a svg { width: 19px; height: 19px; flex-shrink: 0; }
.dash-sidebar-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.dash-sidebar-nav a.active { background: #fff; color: var(--navy); }

.dash-sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,0.16); }
.dash-sidebar-footer a {
    display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.8); font-weight: 600; font-size: 0.89rem;
}
.dash-sidebar-footer a svg { width: 19px; height: 19px; flex-shrink: 0; }
.dash-sidebar-footer a:hover { background: var(--accent); color: #fff; }

.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(9,16,28,0.5); z-index: 190; }
.mobile-overlay.visible { display: block; }

/* ---- Main content ---------------------------------------------------- */
.dash-content { flex: 1; min-width: 0; }
.dash-main { max-width: 1560px; margin: 0 auto; padding: 30px 40px 72px; }

/* ---- Page head ---------------------------------------------------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.page-head .eyebrow { font-size: 0.8rem; color: var(--ink-muted); font-weight: 600; }
.page-head h1 { font-size: 1.6rem; font-weight: 700; margin: 5px 0 0; letter-spacing: -0.01em; }
.page-head p.lead { color: var(--ink-muted); margin: 5px 0 0; font-size: 0.92rem; }
.page-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.page-head-back { display: inline-flex; align-items: center; gap: 6px; font-size: 0.84rem; font-weight: 600; color: var(--ink-muted); margin-bottom: 10px; }
.page-head-back:hover { color: var(--navy); }
.page-head-back svg { width: 15px; height: 15px; }

.hero-btn {
    font-size: 0.84rem; font-weight: 700; padding: 11px 18px; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; gap: 8px;
    box-shadow: var(--shadow-sm); cursor: pointer; font-family: inherit;
}
.hero-btn svg { width: 15px; height: 15px; }
.hero-btn:hover { border-color: var(--navy); color: var(--navy); }
.hero-btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.hero-btn.primary:hover { background: var(--navy-dark); border-color: var(--navy-dark); color: #fff; }

/* ---- Panels / cards ---------------------------------------------------- */
.panel, .card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 22px 24px; box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.panel:last-child, .card:last-child { margin-bottom: 0; }
.panel > h2:first-child, .panel > h3:first-child, .card > h2:first-child, .card > h3:first-child,
.card-header h2, .card-header h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 14px; color: var(--ink); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; }

.section-title { font-size: 1.08rem; font-weight: 700; margin: 0 0 14px; color: var(--ink); }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.btn-view-all {
    font-size: 0.8rem; font-weight: 700; color: var(--navy);
    border: 1px solid var(--line); background: var(--paper);
    padding: 8px 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px;
}
.btn-view-all svg { width: 14px; height: 14px; }
.btn-view-all:hover { background: var(--navy); border-color: var(--navy); color: #fff; }

.page-header { margin-bottom: 20px; }
.page-header p { color: var(--ink-muted); }

.grid { display: grid; gap: 16px; grid-template-columns: 1fr; margin-bottom: 20px; align-items: stretch; }
.grid > .panel, .grid > .card { margin-bottom: 0; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* ---- Page body split: wide content + narrow side column ------- */
.page-body { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1024px) { .page-body { grid-template-columns: minmax(0, 1fr) 360px; } }
.page-body-main { min-width: 0; }
.page-body-side { min-width: 0; display: flex; flex-direction: column; gap: 20px; }

.side-banner-image { display: block; width: 100%; height: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }

/* ---- Total balance card / stat blocks ---------------------------------------------------- */
.balance-card {
    display: flex; align-items: center; gap: 16px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 24px 26px; box-shadow: var(--shadow-sm); margin-bottom: 28px;
}
.balance-card .stat-icon, .stat-icon {
    width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--chip, var(--navy-light)); color: var(--ink-accent, var(--navy));
}
.balance-card .stat-icon svg, .stat-icon svg { width: 21px; height: 21px; }
.balance-card .stat-body { min-width: 0; }
.balance-card .stat-label { font-size: 0.8rem; font-weight: 600; color: var(--ink-muted); }
.balance-card .stat-value { font-size: 1.7rem; font-weight: 800; margin-top: 6px; letter-spacing: -0.01em; }
.balance-card .stat-sub { font-size: 0.78rem; color: var(--ink-muted); margin-top: 5px; }

/* ---- Accounts (wallet cards) ---------------------------------------------------- */
.accounts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 32px; }
.acct-card {
    background: var(--grad, linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%));
    border-radius: var(--radius-lg);
    padding: 24px 24px 22px; display: block; color: #fff;
    box-shadow: var(--shadow-md); position: relative; overflow: hidden;
}
.acct-card::after {
    content: ""; position: absolute; top: -60%; right: -30%; width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0) 70%); pointer-events: none;
}
.acct-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.acct-card .top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 30px; position: relative; }
.acct-card .type { font-size: 0.9rem; font-weight: 700; }
.acct-card .num { font-size: 0.78rem; color: rgba(255,255,255,0.72); margin-top: 4px; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; }
.acct-status { font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: rgba(255,255,255,0.2); color: #fff; }
.acct-card .balance { font-size: 1.55rem; font-weight: 800; position: relative; }
.acct-card .balance .cur { font-size: 0.85rem; font-weight: 700; color: rgba(255,255,255,0.75); margin-left: 4px; }
.acct-card .footer-link {
    margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.22); position: relative;
    font-size: 0.8rem; font-weight: 700; color: #fff; display: flex; align-items: center; justify-content: space-between;
}
.acct-card .footer-link svg { width: 14px; height: 14px; }
.acct-card.static { cursor: default; }

/* ---- Account summary row (selector + wallet card side by side) --------------- */
.acct-summary-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; margin-bottom: 20px; }
.acct-summary-row .panel { margin-bottom: 0; }
.acct-summary-row .acct-switcher-panel { display: flex; flex-direction: column; justify-content: center; }
.acct-summary-row .acct-card { margin-bottom: 0; }
@media (max-width: 768px) {
    .acct-summary-row { grid-template-columns: 1fr; }
}

/* ---- Two-column dashboard body ---------------------------------------------------- */
.dash-columns { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.dash-main-col { min-width: 0; }
.dash-side { display: flex; flex-direction: column; gap: 20px; }

/* ---- Buttons ---------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
    font-weight: 700; font-size: 0.88rem; cursor: pointer; min-height: 44px;
    transition: filter 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    text-decoration: none; font-family: inherit;
}
.btn:hover { filter: brightness(0.96); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); filter: none; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-success { background: var(--good); color: #fff; }
.btn-outline { background: var(--surface); color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy-light); filter: none; }
.btn-outline-danger { background: var(--surface); color: var(--accent); border-color: var(--accent); }
.btn-outline-danger:hover { background: var(--bad-light); filter: none; }
.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: #eaedf1; filter: none; }
.btn-sm { padding: 8px 14px; min-height: 36px; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.quick-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 0; }

/* ---- Forms ---------------------------------------------------- */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-row.cols-2 { grid-template-columns: 1fr 1fr; } .form-row.cols-3 { grid-template-columns: repeat(3, 1fr); } }
label { display: block; font-weight: 600; font-size: 0.86rem; margin-bottom: 6px; color: var(--ink); }
.form-hint { font-size: 0.8rem; color: var(--ink-muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date],
input[type=number], input[type=search], select, textarea {
    width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    font-size: 0.94rem; font-family: inherit; background: #fff; color: var(--ink);
    min-height: 44px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-light);
}
input:disabled { background: var(--paper); color: var(--ink-muted); }
input.field-error, select.field-error, textarea.field-error { border-color: var(--accent); }
.error-text { color: var(--accent-dark); font-size: 0.8rem; margin-top: 4px; }

.password-field { position: relative; }
.password-field input.has-toggle { padding-right: 44px; }
.password-toggle {
    position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
    width: 34px; height: 34px; border-radius: 50%; border: none; background: none;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    color: var(--ink-muted);
}
.password-toggle:hover { background: var(--paper); color: var(--ink); }
.password-toggle:focus-visible { outline: 2px solid var(--navy); outline-offset: 1px; }
.password-toggle svg { width: 18px; height: 18px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-row input { width: auto; min-height: auto; margin-top: 3px; }
.checkbox-row label { margin: 0; font-weight: 500; }

fieldset { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px; margin: 0 0 18px; }
legend { font-weight: 700; padding: 0 8px; }

/* ---- Tabs ---------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab-btn {
    background: none; border: none; padding: 12px 18px; font-weight: 700; font-size: 0.9rem;
    color: var(--ink-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
    white-space: nowrap; min-height: 44px; font-family: inherit;
}
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- Tables -> stacked cards on mobile ---------------------------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.data-table, .tx-table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
table.data-table th, .tx-table th {
    text-align: left; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted);
    font-weight: 700; padding: 12px 14px; background: var(--paper); border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data-table th.r, .tx-table th.r { text-align: right; }
table.data-table td, .tx-table td { padding: 15px 14px; vertical-align: middle; border-bottom: 1px solid var(--line); }
table.data-table tbody tr:last-child td, .tx-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover, .tx-table tbody tr:hover { background: var(--paper); }

.tx-date { color: var(--ink-muted); white-space: nowrap; }
.tx-desc { font-weight: 400; color: var(--ink); }
.tx-meta { font-size: 0.8rem; color: var(--ink-muted); white-space: nowrap; }
.tx-type-chip {
    display: inline-block; font-size: 0.72rem; font-weight: 600; color: var(--ink-muted);
    background: var(--paper); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.tx-amt { text-align: right; font-weight: 700; white-space: nowrap; }
.tx-amt.pos, .amount-positive { color: var(--good); }
.tx-amt.neg, .amount-negative { color: var(--accent); }
.tx-empty, .empty-hint { color: var(--ink-muted); font-size: 0.88rem; padding: 8px 0; }

.status-pill, .tx-status {
    display: inline-block; font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
    padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.status-completed, .status-active, .status-success, .tx-status.completed { background: var(--good-light); color: var(--good); }
.status-pending, .tx-status.pending { background: var(--warn-light); color: var(--warn); }
.status-awaiting_pin { background: var(--navy-light); color: var(--navy-dark); }
.status-failed, .status-frozen, .status-suspended, .status-closed, .tx-status.failed { background: var(--bad-light); color: var(--bad); }
.status-reversed { background: var(--paper); color: var(--ink-muted); }

@media (max-width: 767px) {
    table.data-table thead { display: none; }
    table.data-table, table.data-table tbody, table.data-table tr, table.data-table td { display: block; width: 100%; }
    table.data-table tr { border: 1px solid var(--line); border-radius: var(--radius-md); margin-bottom: 12px; padding: 8px 4px; }
    table.data-table td { border-bottom: none; padding: 8px 12px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
    table.data-table td::before { content: attr(data-label); font-weight: 700; color: var(--ink-muted); text-align: left; font-size: 0.78rem; text-transform: uppercase; }
    .tx-table thead { display: none; }
    .tx-table tr { display: block; padding: 10px 0; }
    .tx-table td { display: flex; justify-content: space-between; padding: 3px 12px; }
}

/* ---- Pagination ---------------------------------------------------- */
.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
.pagination-info { font-size: 0.84rem; color: var(--ink-muted); }
.pagination-info strong { color: var(--ink); font-weight: 700; }
.pagination-controls { display: flex; align-items: center; gap: 6px; }
.page-btn {
    min-width: 36px; height: 36px; padding: 0 4px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface);
    display: flex; align-items: center; justify-content: center; color: var(--ink); flex-shrink: 0;
    font-size: 0.86rem; font-weight: 700;
}
.page-btn svg { width: 15px; height: 15px; }
.page-btn:hover { border-color: var(--navy); color: var(--navy); }
.page-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.page-btn.active:hover { color: #fff; }
.page-btn.disabled { background: var(--paper); color: var(--ink-muted); border-color: var(--line); opacity: 0.7; pointer-events: none; }
.page-ellipsis { width: 24px; text-align: center; color: var(--ink-muted); font-size: 0.86rem; }
@media (max-width: 480px) {
    .pagination-bar { justify-content: center; text-align: center; }
}

/* ---- Empty state ---------------------------------------------------- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--ink-muted); }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.5; }

/* ---- Alerts / flash messages ------------------------------------------------ */
.alert {
    padding: 14px 16px; border-radius: var(--radius-md); margin-bottom: 18px;
    font-size: 0.92rem; border: 1px solid transparent;
}
.alert-success { background: var(--good-light); color: var(--good); border-color: #b9e3c3; }
.alert-error, .alert-danger { background: var(--bad-light); color: var(--accent-dark); border-color: #f3bcbc; }
.alert-warning { background: var(--warn-light); color: var(--warn); border-color: #f0dba6; }
.alert-info { background: var(--navy-light); color: var(--navy-dark); border-color: #bcd6f0; }

/* ---- Messages / threads ---------------------------------------------------- */
.thread-list-item { display: flex; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.thread-list-item:hover { background: var(--paper); }
.thread-list-item:last-child { border-bottom: none; }
.thread-list-item.unread .thread-subject { font-weight: 800; }
.thread-list-item.unread::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 6px; }
.thread-list-item:not(.unread)::before { content: ''; width: 8px; flex-shrink: 0; }
.thread-subject { color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.thread-snippet { font-size: 0.85rem; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-meta { font-size: 0.78rem; color: var(--ink-muted); flex-shrink: 0; white-space: nowrap; }
.thread-row-link { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; }

.row-action-btn {
    width: 32px; height: 32px; border-radius: 50%; border: 1px solid transparent; background: transparent;
    display: flex; align-items: center; justify-content: center; color: var(--ink-muted); flex-shrink: 0; cursor: pointer;
    margin-top: 2px;
}
.row-action-btn svg { width: 15px; height: 15px; }
.row-action-btn:hover { background: var(--bad-light); color: var(--accent); }

.bubble { max-width: 80%; padding: 12px 16px; border-radius: var(--radius-lg); margin-bottom: 14px; }
.bubble-customer { background: var(--navy); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.bubble-admin { background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble-meta { font-size: 0.72rem; opacity: 0.75; margin-bottom: 4px; }

/* ---- Contact panel (Online Banking Department, etc.) ------------------------- */
.contact-panel { background: var(--navy-light); border: 1px solid #c7dcf2; }
.contact-panel .section-title { color: var(--navy-dark); }
.contact-list { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.contact-row { display: flex; align-items: flex-start; gap: 12px; }
.contact-row .contact-icon {
    width: 36px; height: 36px; border-radius: 10px; background: #fff; color: var(--navy); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm);
}
.contact-row .contact-icon svg { width: 17px; height: 17px; }
.contact-row .contact-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--navy-dark); opacity: 0.85; }
.contact-row .contact-value { font-size: 0.94rem; font-weight: 700; color: var(--ink); margin-top: 2px; }
.contact-row a.contact-value:hover { color: var(--navy); text-decoration: underline; }

/* ---- Safety tips panel ---------------------------------------------------- */
.tips-panel h2 { font-size: 0.98rem; font-weight: 700; margin: 0 0 4px; color: var(--ink); }
.tips-panel .sub { font-size: 0.78rem; color: var(--ink-muted); margin: 0 0 16px; }
.tips-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.tips-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.83rem; color: var(--ink); line-height: 1.5; }
.tips-list .tick {
    width: 22px; height: 22px; border-radius: 50%; background: var(--navy-light); color: var(--navy);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px;
}
.tips-list .tick svg { width: 12px; height: 12px; }

/* ---- Thank-you banner ---------------------------------------------------- */
.thanks-panel { padding: 0; overflow: hidden; }
.thanks-panel img { display: block; width: 100%; height: auto; }

/* ---- Need help CTA ---------------------------------------------------- */
.help-card {
    display: flex; align-items: center; gap: 16px;
    background: var(--accent);
    color: #fff; padding: 24px; border-radius: var(--radius-lg);
    border: 1px solid var(--accent-dark);
    transition: transform 0.15s ease, background 0.15s ease;
}
.help-card:hover { transform: translateY(-2px); background: var(--accent-dark); }
.help-icon {
    width: 52px; height: 52px; border-radius: 50%; background: #fff; color: var(--accent); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}
.help-icon svg { width: 24px; height: 24px; }
.help-body { flex: 1; min-width: 0; }
.help-title { font-weight: 800; font-size: 1.12rem; letter-spacing: -0.01em; }
.help-sub { font-size: 0.86rem; color: rgba(255,255,255,0.95); margin-top: 4px; line-height: 1.4; font-weight: 600; }
.help-chevron {
    width: 34px; height: 34px; flex-shrink: 0; padding: 8px; box-sizing: border-box;
    background: rgba(255,255,255,0.22); border-radius: 50%;
}

/* ---- Result / receipt states ---------------------------------------------------- */
.result-icon {
    width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px;
    display: flex; align-items: center; justify-content: center;
}
.result-icon svg { width: 26px; height: 26px; }
.result-icon.good { background: var(--good-light); color: var(--good); }
.result-icon.pending { background: var(--navy-light); color: var(--navy); }

/* ---- Utility ---------------------------------------------------- */
.text-muted { color: var(--ink-muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.hide-mobile { display: none; }
.masked-toggle { background: none; border: none; color: var(--navy); cursor: pointer; font-size: 0.8rem; font-weight: 600; padding: 4px; font-family: inherit; }

/* ---- Responsive ---------------------------------------------------- */
@media (max-width: 1280px) {
    .dash-main { padding: 28px 28px 64px; }
}
@media (max-width: 1024px) {
    .dash-columns { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .dash-sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; height: 100vh;
        transform: translateX(-100%); transition: transform 0.22s ease;
    }
    .dash-sidebar.open { transform: translateX(0); }
    .dash-sidebar-top { display: flex; }
    .dash-hamburger { display: flex; }
}
@media (max-width: 768px) {
    .dash-main { padding: 24px 18px 56px; }
    .page-head { flex-direction: column; align-items: flex-start; }
    .accounts-grid { grid-template-columns: 1fr; }
    table.data-table thead { display: none; }
}
@media (min-width: 768px) {
    .hide-mobile { display: initial; }
}
@media (max-width: 480px) {
    .site-topbar { padding: 0 16px; gap: 12px; }
    .profile-chip .name { display: none; }
}

/* ---- Transfer progress overlay + PIN modal --------------------- */
.tx-progress-overlay, .tx-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 500;
    background: rgba(9,16,28,0.55); align-items: center; justify-content: center; padding: 20px;
}
.tx-progress-overlay.visible, .tx-modal-overlay.visible { display: flex; }
.tx-progress-box {
    background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 36px 32px; width: 100%; max-width: 340px; text-align: center;
}
.tx-progress-box p { margin: 16px 0 0; font-weight: 600; color: var(--ink); }
.tx-progress-track {
    width: 100%; height: 8px; border-radius: 999px; background: var(--paper);
    border: 1px solid var(--line); overflow: hidden;
}
.tx-progress-fill {
    height: 100%; width: 0%; border-radius: 999px; background: var(--navy);
}

.tx-modal {
    background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 28px 26px; width: 100%; max-width: 380px;
}
.tx-modal h3 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.tx-modal .quick-actions { margin-top: 6px; }

