:root {
  --navy-900: #0b1f3f;
  --navy-800: #102a54;
  --navy-700: #16346a;
  --gold-500: #c9a227;
  --gold-400: #d9b84a;
  --ink: #1c2536;
  --muted: #6b7488;
  --border: #e4e7ee;
  --bg: #f5f6f9;
  --white: #ffffff;
  --green: #1e8a4c;
  --red: #c62f3c;
  --radius: 14px;
  --shadow: 0 12px 32px rgba(11, 31, 63, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Login page ---------- */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(1200px 800px at 20% -10%, var(--navy-700), var(--navy-900) 60%);
  padding: 32px 16px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px 28px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  text-align: center;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--navy-700), var(--navy-900));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-400);
  font-size: 24px;
  font-weight: 700;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: 0.2px;
}

.brand-tagline {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.login-heading {
  font-size: 22px;
  font-weight: 700;
  margin: 4px 0 4px;
  text-align: center;
}

.login-sub {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin: 0 0 22px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap input {
  width: 100%;
  padding: 11px 40px 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

.input-wrap input:focus {
  border-color: var(--navy-700);
}

.toggle-visibility {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 6px;
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  font-size: 13px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.forgot-link {
  color: var(--navy-700);
  font-weight: 600;
}

.btn-primary {
  width: 100%;
  padding: 12px 16px;
  background: var(--navy-900);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: background 0.15s ease;
}

.btn-primary:hover { background: var(--navy-700); }

.login-footer-links {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 18px;
}

.login-footer-links a {
  color: var(--navy-700);
  font-weight: 600;
}

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.contact-modal.open { display: flex; }
.contact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 25, 0.55);
}
.contact-modal-card {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.contact-modal-card h2 {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--ink);
}
.contact-modal-sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}
.contact-modal-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.contact-modal-row:last-child { border-bottom: none; }
.contact-modal-row > span:first-child { color: var(--muted); }
.contact-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.security-note {
  max-width: 420px;
  width: 100%;
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  padding: 14px 18px;
  color: #dfe6f4;
  font-size: 12.5px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.security-note strong {
  display: block;
  color: var(--white);
  font-size: 13px;
  margin-bottom: 2px;
}

.demo-banner {
  max-width: 420px;
  width: 100%;
  margin-bottom: 18px;
  background: #3a2a06;
  border: 1px solid var(--gold-500);
  color: var(--gold-400);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  text-align: center;
}

.form-error {
  background: #fdecee;
  color: var(--red);
  border: 1px solid #f3c4c9;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
  display: none;
}

.form-error.visible { display: block; }

.form-notice {
  background: #eaf6ee;
  color: var(--green);
  border: 1px solid #bfe6cb;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
  display: none;
}

.form-notice.visible { display: block; }

.status-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 8px;
  vertical-align: middle;
}

.status-badge.status-completed { background: #1e8a4c; color: var(--white); }
.status-badge.status-pending { background: var(--gold-500); color: var(--navy-900); }

/* ---------- Dashboard shell ---------- */

.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--navy-900);
  color: #cfd8ea;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
}

.sidebar .brand {
  flex-direction: row;
  justify-content: flex-start;
  margin-bottom: 26px;
  color: var(--white);
}

.sidebar .brand-mark { width: 36px; height: 36px; font-size: 16px; }
.sidebar .brand-name { color: var(--white); font-size: 15px; }

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: #cfd8ea;
}

.nav-list a:hover { background: rgba(255,255,255,0.06); }

.nav-list a.active {
  background: var(--gold-500);
  color: var(--navy-900);
  font-weight: 700;
}

.nav-list .badge {
  margin-left: auto;
  background: var(--red);
  color: var(--white);
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
}

.nav-list a.active .badge { background: var(--navy-900); color: var(--white); }

.logout-link {
  color: #ff9797;
  font-size: 13.5px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.main-area { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 26px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.topbar .greeting {
  margin-right: auto;
  font-size: 15px;
  font-weight: 700;
}

.icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--muted);
}

.icon-btn .dot {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--red);
  color: var(--white);
  font-size: 9.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 5px;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(160deg, var(--gold-400), var(--gold-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--navy-900);
}

.profile-chip .name-block { line-height: 1.2; }
.profile-chip .role { color: var(--muted); font-size: 11.5px; }

.content {
  padding: 24px 26px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.content h1 { margin: 0 0 4px; font-size: 22px; }
.content .subtitle { margin: 0; color: var(--muted); font-size: 13.5px; }

.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.account-card {
  background: linear-gradient(160deg, var(--navy-800), var(--navy-900));
  color: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.account-card .label { font-size: 12.5px; color: #b9c3dc; }
.account-card .acct-num { font-size: 12px; color: #8b97b8; margin-bottom: 10px; }
.account-card .balance { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.account-card .balance-label { font-size: 11.5px; color: #9fabc9; }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.quick-actions button,
.quick-actions a {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.quick-actions button:hover,
.quick-actions a:hover { border-color: var(--navy-700); }

.panels-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}

.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-header h2 { margin: 0; font-size: 15px; }
.panel-header a { font-size: 12.5px; color: var(--navy-700); font-weight: 600; }

.tx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

.tx-row:last-child { border-bottom: none; }
.tx-name { font-weight: 600; }
.tx-date { color: var(--muted); font-size: 12px; }
.tx-amt.neg { color: var(--red); font-weight: 700; }
.tx-amt.pos { color: var(--green); font-weight: 700; }

.msg-row { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.msg-row:last-child { border-bottom: none; }
.msg-title { font-weight: 600; margin-bottom: 2px; }
.msg-meta { color: var(--muted); font-size: 11.5px; }

/* ---------- Portal page content (forms, tables, cards) ---------- */

.input-wrap select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  background: var(--white);
  color: var(--ink);
}

.input-wrap select:focus { border-color: var(--navy-700); }

.btn-secondary {
  padding: 10px 16px;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
}

.btn-secondary:hover { border-color: var(--navy-700); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 10px 6px; border-bottom: 1px solid var(--border); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tfoot th {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13.5px;
  color: var(--ink);
  border-bottom: none;
  border-top: 2px solid var(--border);
  padding-top: 10px;
}

.visa-card {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1.586 / 1;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-900));
  color: var(--white);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.visa-card .card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.visa-card .card-number { font-size: 18px; letter-spacing: 2px; }
.visa-card .card-bottom { display: flex; justify-content: space-between; font-size: 11.5px; color: #b9c3dc; }
.visa-card .card-status {
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
}
.visa-card .card-status.frozen { background: rgba(198,47,60,0.35); }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #cdd4e2; border-radius: 999px; transition: 0.15s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 16px; width: 16px; left: 3px; top: 3px;
  background: var(--white); border-radius: 50%; transition: 0.15s;
}
.switch input:checked + .slider { background: var(--navy-700); }
.switch input:checked + .slider::before { transform: translateX(18px); }

.unread-dot {
  width: 8px; height: 8px; border-radius: 999px; background: var(--gold-500);
  display: inline-block; margin-right: 6px;
}

.stat-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.stat-row:last-child { border-bottom: none; }
.stat-row .stat-label { color: var(--muted); }
.stat-row .stat-value { font-weight: 600; }

.tab-row { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab-btn {
  padding: 10px 16px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 999px;
  display: inline-block;
}
.tab-btn.active { background: var(--navy-900); color: var(--white); border-color: var(--navy-900); }
.tab-btn:not(.active):hover { border-color: var(--navy-700); color: var(--ink); }

.pending-badge { background: var(--gold-500); color: var(--navy-900); }
.approved-badge { background: #1e8a4c; color: var(--white); }
.declined-badge { background: var(--red); color: var(--white); }

.hamburger-btn { display: none; }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 31, 63, 0.45);
  z-index: 99;
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .panels-grid { grid-template-columns: 1fr; }

  .hamburger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--white);
    font-size: 16px;
    flex-shrink: 0;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 24px rgba(0, 0, 0, 0.25); }

  .sidebar-backdrop.open { display: block; }
}

/* ---------- Statements ---------- */

.stmt-actions { display: flex; gap: 10px; margin-bottom: 16px; }
.stmt-doc { max-width: 720px; }
.stmt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding-bottom: 14px; border-bottom: 2px solid var(--navy-900, #0b1f3f); margin-bottom: 16px; }
.stmt-bank { font-size: 17px; font-weight: 700; color: var(--navy-900, #0b1f3f); }
.stmt-title { color: var(--muted); font-size: 13px; }
.stmt-meta { text-align: right; font-size: 13px; }
.stmt-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.stmt-summary div { background: var(--bg, #f5f6f9); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.stmt-summary span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .3px; }
.stmt-summary strong { font-size: 15px; }
.stmt-table th.num, .stmt-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.stmt-table td.neg { color: var(--red); }
.stmt-table tr.stmt-open td, .stmt-table tr.stmt-close td { font-weight: 700; background: var(--bg, #f5f6f9); }
.stmt-foot { color: var(--muted); font-size: 12px; margin-top: 14px; }
@media (max-width: 640px) { .stmt-summary { grid-template-columns: 1fr 1fr; } }

@media print {
  .sidebar, .sidebar-backdrop, .topbar, .no-print, .stmt-actions { display: none !important; }
  .main-area, .portal-shell, body { background: #fff !important; margin: 0 !important; }
  .content { padding: 0 !important; }
  .panel { box-shadow: none !important; border: none !important; padding: 0 !important; }
  .stmt-doc { max-width: none; }
  .stmt-summary div { break-inside: avoid; }
}

.link-button { background: none; border: 0; color: var(--navy-700, #16346a); text-decoration: underline;
  font: inherit; cursor: pointer; padding: 0; }

/* ---------- accessibility ---------- */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 9999;
  background: var(--navy-900, #0b1f3f); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--navy-700, #16346a); outline-offset: 2px; border-radius: 3px; }
.btn-primary:focus-visible, .btn-secondary:focus-visible { outline-offset: 3px; }
