/* ─── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:       #1a3c8f;
  --brand-light: #2350b5;
  --brand-dark:  #112870;
  --accent:      #0ea5e9;
  --success:     #16a34a;
  --danger:      #dc2626;
  --warn:        #f59e0b;
  --text:        #0f172a;
  --text-muted:  #64748b;
  --border:      #e2e8f0;
  --bg:          #f1f5f9;
  --white:       #ffffff;
  --card-shadow: 0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --radius:      12px;
  --radius-sm:   8px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Screens ──────────────────────────────────────────────────────── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }

/* ─── LOGIN ────────────────────────────────────────────────────────── */
#screen-login { display: none; }
#screen-login.active { display: flex; min-height: 100vh; }

.login-bg {
  display: grid;
  grid-template-columns: 480px 1fr;
  min-height: 100vh;
  width: 100%;
}

.login-card {
  background: var(--white);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.brand-icon {
  width: 44px; height: 44px;
  background: var(--brand);
  color: #fff;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px;
  flex-shrink: 0;
}

.brand-icon.small { width: 32px; height: 32px; font-size: 15px; border-radius: 7px; }
.brand-name { font-size: 20px; font-weight: 700; color: var(--brand); }
.brand-tagline { font-size: 11px; color: var(--text-muted); }

.login-title { font-size: 26px; font-weight: 700; }
.login-sub   { color: var(--text-muted); margin-top: -12px; }

.login-info {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 50%, #1e6bb8 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 60px 48px;
}

.info-content { max-width: 480px; }
.info-content h1 { font-size: 42px; font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 16px; }
.info-content p  { color: rgba(255,255,255,.8); font-size: 16px; margin-bottom: 40px; }

.info-stats { display: flex; gap: 40px; }
.stat-val { font-size: 24px; font-weight: 700; color: #fff; }
.stat-lbl { font-size: 12px; color: rgba(255,255,255,.7); margin-top: 2px; }

.login-footer { font-size: 12px; color: var(--text-muted); }

/* ─── Fields ────────────────────────────────────────────────────────── */
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 500; color: var(--text); }
.field-hint  { font-size: 12px; text-align: right; margin-top: 2px; }
.req { color: var(--danger); }

.field-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color .15s;
}
.field-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26,60,143,.1); }
.field-input::placeholder { color: #94a3b8; }

select.field-input { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-error { background: #fef2f2; border: 1px solid #fca5a5; border-radius: 8px; padding: 10px 12px; color: var(--danger); font-size: 13px; }
.hidden { display: none !important; }

/* ─── Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm); font: inherit; font-weight: 500;
  cursor: pointer; transition: all .15s; border: 1.5px solid transparent;
}
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-light); border-color: var(--brand-light); }
.btn-outline { background: var(--white); color: var(--brand); border-color: var(--brand); }
.btn-outline:hover { background: #eef2ff; }
.btn-ghost   { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-full    { width: 100%; }

.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.form-actions.center { justify-content: center; }

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }

/* ─── Dashboard Layout ──────────────────────────────────────────────── */
#screen-dashboard { display: none; }
#screen-dashboard.active { display: block; }

.topbar {
  position: sticky; top: 0; z-index: 400;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px;
  height: 56px;
}

.topbar-left { display: flex; align-items: center; gap: 8px; min-width: 180px; }

.topnav { display: flex; gap: 4px; flex: 1; }
.topnav-link {
  padding: 6px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 500;
  color: var(--text-muted); transition: all .15s;
}
.topnav-link:hover { color: var(--text); background: var(--bg); text-decoration: none; }
.topnav-link.active { color: var(--brand); background: #eef2ff; }

.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer; color: var(--text-muted);
  position: relative;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn.voice-connecting {
  background: #eef2ff;
  color: var(--brand);
}
.icon-btn.voice-live {
  background: var(--brand);
  color: #fff;
}

.notif-dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); border: 1.5px solid #fff;
}

.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}

.layout { display: flex; height: calc(100vh - 56px); overflow: hidden; }

/* ─── Sidebar ───────────────────────────────────────────────────────── */
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 16px 0;
  overflow-y: auto;
}

.sidenav { list-style: none; padding: 0 10px; flex: 1; }
.sidenav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; transition: all .15s; user-select: none;
}
.sidenav-item:hover  { background: var(--bg); color: var(--text); }
.sidenav-item.active { background: #eef2ff; color: var(--brand); }
.sidenav-item.active .nav-icon { stroke: var(--brand); }

.nav-icon { width: 16px; height: 16px; stroke: currentColor; flex-shrink: 0; }

.sidebar-footer { padding: 10px 10px 0; border-top: 1px solid var(--border); margin: 8px 10px 0; }
.sidebar-logout {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 12px; border-radius: 8px;
  background: transparent; border: none; font: inherit; font-size: 13.5px;
  color: var(--danger); cursor: pointer;
}
.sidebar-logout:hover { background: #fef2f2; }

/* ─── Main Content ──────────────────────────────────────────────────── */
.main-content { flex: 1; overflow-y: auto; padding: 28px 28px 40px; background: var(--bg); }

.view { display: none; }
.view.active { display: block; }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px;
}
.page-title { font-size: 22px; font-weight: 700; }
.page-sub   { color: var(--text-muted); margin-top: 2px; }

.badge-date {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 12px; font-size: 12px; color: var(--text-muted);
}

.section-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }

/* ─── Account Cards ─────────────────────────────────────────────────── */
.account-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 24px; }

.account-card {
  border-radius: var(--radius); padding: 20px; color: #fff;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--card-shadow);
}
.account-card.primary  { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%); }
.account-card.secondary{ background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%); }

.ac-label   { font-size: 12px; opacity: .8; }
.ac-num     { font-size: 13px; letter-spacing: 1px; opacity: .9; }
.ac-balance { font-size: 26px; font-weight: 700; }
.ac-footer  { display: flex; align-items: center; justify-content: space-between; font-size: 11px; opacity: .8; }
.ac-badge   { background: rgba(255,255,255,.2); border-radius: 20px; padding: 2px 8px; font-size: 10px; }

.quick-actions-card {
  background: var(--white); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--card-shadow); border: 1px solid var(--border);
}
.qa-title { font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.qa-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qa-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 8px; border-radius: 10px; background: var(--bg);
  border: 1px solid var(--border); cursor: pointer; font: inherit;
  font-size: 11px; font-weight: 500; color: var(--text);
  transition: all .15s;
}
.qa-btn:hover { background: #eef2ff; border-color: var(--brand); color: var(--brand); }
.qa-btn svg { width: 20px; height: 20px; stroke: var(--brand); }

/* ─── Two Col ───────────────────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ─── Transaction List ──────────────────────────────────────────────── */
.txn-list { display: flex; flex-direction: column; gap: 2px; }

.txn-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--white); border-radius: 8px;
  border: 1px solid var(--border); transition: background .1s;
}
.txn-row:hover { background: #f8fafc; }
.txn-icon  { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.txn-icon.cr { background: #dcfce7; }
.txn-icon.dr { background: #fee2e2; }
.txn-info  { flex: 1; }
.txn-name  { font-size: 13px; font-weight: 500; }
.txn-date  { font-size: 11px; color: var(--text-muted); }
.txn-amt   { font-size: 14px; font-weight: 600; }
.txn-amt.cr { color: var(--success); }
.txn-amt.dr { color: var(--danger); }

/* ─── Payee List (small) ────────────────────────────────────────────── */
.payee-list-sm { display: flex; flex-direction: column; gap: 6px; }
.payee-row-sm {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--white); border: 1px solid var(--border);
  border-radius: 8px;
}
.payee-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.payee-name   { font-size: 13px; font-weight: 500; }
.payee-acc    { font-size: 11px; color: var(--text-muted); }

/* ─── Form Card ─────────────────────────────────────────────────────── */
.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--card-shadow);
}

/* ─── Step Progress ─────────────────────────────────────────────────── */
.form-steps {
  display: flex; align-items: center; margin-bottom: 28px; gap: 0;
}
.step {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--text-muted); flex-shrink: 0;
}
.step span {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--border); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; transition: all .2s;
}
.step.active span { background: var(--brand); color: #fff; }
.step.active       { color: var(--brand); }
.step.done  span  { background: var(--success); color: #fff; }
.step-line { flex: 1; height: 2px; background: var(--border); min-width: 24px; }

/* ─── OTP ───────────────────────────────────────────────────────────── */
.otp-section { text-align: center; padding: 12px 0; }
.otp-icon    { font-size: 48px; margin-bottom: 12px; }
.otp-section h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.otp-section p  { color: var(--text-muted); margin-bottom: 24px; }
.otp-inputs { display: flex; gap: 10px; justify-content: center; margin-bottom: 16px; }
.otp-box {
  width: 44px; height: 52px; text-align: center;
  font-size: 20px; font-weight: 700;
  border: 2px solid var(--border); border-radius: 8px;
  outline: none; transition: border-color .15s;
}
.otp-box:focus { border-color: var(--brand); }
.resend-text { font-size: 13px; color: var(--text-muted); }

/* ─── Success ───────────────────────────────────────────────────────── */
.success-section { text-align: center; padding: 24px 0; }
.success-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: #dcfce7; color: var(--success);
  font-size: 30px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.success-section h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.success-section p  { color: var(--text-muted); margin-bottom: 16px; }
.success-detail {
  background: var(--bg); border-radius: 8px; padding: 12px 16px;
  font-size: 13px; text-align: left; display: inline-block;
  min-width: 260px; margin-bottom: 16px; border: 1px solid var(--border);
}
.success-detail div { display: flex; justify-content: space-between; padding: 3px 0; }
.success-detail .lbl { color: var(--text-muted); }

/* ─── Transfer Layout ───────────────────────────────────────────────── */
.transfer-layout { display: grid; grid-template-columns: 1fr 280px; gap: 20px; }

.transfer-tabs { display: flex; gap: 4px; margin-bottom: 20px; }
.ttab {
  padding: 6px 18px; border-radius: 6px;
  background: var(--bg); border: 1px solid var(--border);
  font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; color: var(--text-muted); transition: all .15s;
}
.ttab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.ttab:hover:not(.active) { background: #eef2ff; color: var(--brand); }

.transfer-info { display: flex; flex-direction: column; }

.limit-table { width: 100%; border-collapse: collapse; }
.limit-table td { padding: 7px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.limit-table td:first-child { font-weight: 500; color: var(--text-muted); }

/* ─── Transaction Table ─────────────────────────────────────────────── */
.txn-table { width: 100%; border-collapse: collapse; }
.txn-table th { font-size: 12px; font-weight: 600; color: var(--text-muted); text-align: left; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--border); }
.txn-table td { padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
.txn-table tr:hover td { background: #f8fafc; }

/* ─── Statements ────────────────────────────────────────────────────── */
.stmt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.stmt-item {
  border: 1px solid var(--border); border-radius: 10px; padding: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.stmt-period { font-weight: 600; font-size: 14px; }

/* ─── Modal ─────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.modal-card {
  background: var(--white); border-radius: var(--radius);
  padding: 40px 32px; text-align: center; max-width: 400px; width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
}
.modal-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.modal-card p  { color: var(--text-muted); margin-bottom: 8px; }
.modal-ref { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; }

/* ─── AI Widget ─────────────────────────────────────────────────────── */
.ai-widget {
  position: fixed; bottom: 80px; right: 20px; z-index: 300;
  width: 320px; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.15); overflow: hidden;
}

.ai-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--brand); cursor: pointer;
}
.ai-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.2); color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ai-name   { font-size: 13px; font-weight: 600; color: #fff; }
.ai-status { font-size: 11px; color: rgba(255,255,255,.75); }
.ai-close  { background: transparent; border: none; color: rgba(255,255,255,.8); cursor: pointer; font-size: 16px; margin-left: auto; padding: 2px; }

.ai-body { padding: 14px; }
.ai-msg  { font-size: 13px; color: var(--text); line-height: 1.5; white-space: pre-wrap; }

.ai-fab {
  position: fixed; bottom: 20px; right: 20px; z-index: 300;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--brand); color: #fff; border: none;
  cursor: pointer; box-shadow: 0 4px 16px rgba(26,60,143,.4);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, box-shadow .15s;
}
.ai-fab:hover { transform: scale(1.08); box-shadow: 0 6px 22px rgba(26,60,143,.5); }

/* ─── Live assist side panel (voice + workflow hints) ───────────────── */
.assist-panel {
  position: fixed;
  top: 56px;
  right: 0;
  width: min(380px, 100vw);
  height: calc(100vh - 56px);
  background: var(--white);
  border-left: 1px solid var(--border);
  box-shadow: -6px 0 28px rgba(0, 0, 0, 0.08);
  z-index: 260;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  visibility: hidden;
  pointer-events: none;
}
.assist-panel.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}
.assist-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.assist-panel-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.assist-panel-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.assist-panel-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.assist-panel-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
  margin-top: 2px;
  word-break: break-all;
}
.assist-panel-icon-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  flex-shrink: 0;
}
.assist-panel-icon-close:hover {
  background: var(--bg);
  color: var(--text);
}
.assist-panel-status-row {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.assist-panel-status {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
}
.assist-panel-status.is-connecting {
  background: #eef2ff;
  color: var(--brand);
}
.assist-panel-status.is-live {
  background: #ecfdf5;
  color: #047857;
}
.assist-panel-status.is-ended {
  background: #fef3c7;
  color: #b45309;
}
.assist-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.assist-guidance {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 14px;
  white-space: pre-wrap;
}
.assist-panel-hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.assist-panel-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
}

body.assist-panel-open #screen-dashboard .main-content {
  margin-right: min(380px, 100vw);
  transition: margin-right 0.28s ease;
}

@media (max-width: 720px) {
  .assist-panel {
    width: 100%;
    top: 56px;
  }
  body.assist-panel-open #screen-dashboard .main-content {
    margin-right: 0;
  }
}

/* ─── Utilities ─────────────────────────────────────────────────────── */
.link { color: var(--brand); cursor: pointer; }

/* ─── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .login-bg { grid-template-columns: 1fr; }
  .login-info { display: none; }
  .account-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .topnav { display: none; }
  .sidebar { width: 60px; }
  .sidenav-item span, .sidenav-item:not(.active) { font-size: 0; gap: 0; }
  .account-cards { grid-template-columns: 1fr; }
  .two-col, .form-row, .transfer-layout { grid-template-columns: 1fr; }
}
