:root {
  --nav: #1a2f6b;
  --nav-light: hsl(223,71%,28%);
  --ora: #e8720c;
  --lime: #6bb33a;
  --red: #ef4444;
  --bg: #f5f7fb;
  --card-border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --sidebar-w: 230px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); }

/* ── Auth ── */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--nav) 0%, hsl(223,71%,32%) 100%); padding: 20px; }
.auth-container { width: 100%; max-width: 420px; }
.auth-card { background: white; border-radius: 16px; padding: 40px 36px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.auth-logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 28px; font-size: 16px; font-weight: 700; color: var(--nav); }
.auth-title { font-size: 24px; font-weight: 800; color: var(--nav); text-align: center; margin-bottom: 4px; }
.auth-subtitle { font-size: 14px; color: var(--muted); text-align: center; margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-link { text-align: center; font-size: 13px; color: var(--muted); margin-top: 20px; }
.auth-link a { color: var(--ora); text-decoration: none; font-weight: 600; }
.auth-demo { text-align: center; font-size: 12px; color: var(--muted); margin-top: 10px; background: #f9fafc; border-radius: 8px; padding: 8px; }

/* ── App Layout ── */
.app-body { background: var(--bg); min-height: 100vh; }
.app-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar { width: var(--sidebar-w); background: var(--nav); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 24px 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.brand-icon { width: 36px; height: 36px; background: var(--ora); border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand-name { font-size: 15px; font-weight: 700; color: white; }
.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: rgba(255,255,255,0.65); text-decoration: none; font-size: 14px; font-weight: 500; transition: background .15s, color .15s; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,0.1); color: white; }
.nav-item.active { background: rgba(255,255,255,0.12); color: white; font-weight: 600; }
.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; gap: 10px; }
.user-info { flex: 1; display: flex; align-items: center; gap: 10px; overflow: hidden; }
.user-avatar { width: 34px; height: 34px; background: var(--ora); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: white; font-size: 14px; flex-shrink: 0; }
.user-name { font-size: 13px; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 11px; color: rgba(255,255,255,0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn { color: rgba(255,255,255,0.5); display: flex; align-items: center; padding: 6px; border-radius: 6px; transition: color .15s; text-decoration: none; }
.logout-btn:hover { color: white; }

/* ── Main content ── */
.main-content { margin-left: var(--sidebar-w); flex: 1; padding: 32px; min-height: 100vh; }

/* ── Page header ── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 24px; font-weight: 800; color: var(--nav); margin-bottom: 2px; }
.page-subtitle { font-size: 14px; color: var(--muted); }
.back-link { font-size: 13px; color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 6px; }
.back-link:hover { color: var(--nav); }

/* ── Stats ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: white; border-radius: 12px; border: 1.5px solid var(--card-border); padding: 20px; }
.stat-card--primary { background: var(--nav); border-color: var(--nav); }
.stat-card--primary .stat-label { color: rgba(255,255,255,0.7); }
.stat-card--primary .stat-value { color: white; }
.stat-card--primary .stat-sub { color: rgba(255,255,255,0.5); }
.stat-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--nav); line-height: 1; margin-bottom: 4px; }
.stat-value--green { color: var(--lime); }
.stat-value--red { color: var(--red); }
.stat-sub { font-size: 12px; color: var(--muted); }

/* ── Cards ── */
.card { background: white; border-radius: 12px; border: 1.5px solid var(--card-border); overflow: hidden; margin-bottom: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--card-border); }
.card-title { font-size: 15px; font-weight: 700; color: var(--nav); }
.card-link { font-size: 13px; color: var(--ora); text-decoration: none; font-weight: 600; }
.card-body { padding: 20px 24px; }
.card-body.no-pad { padding: 0; }
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

/* ── Table ── */
.table { width: 100%; border-collapse: collapse; }
.table th { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; padding: 10px 20px; background: #f9fafc; border-bottom: 1px solid var(--card-border); text-align: left; }
.table td { padding: 12px 20px; border-bottom: 1px solid #f3f4f6; font-size: 14px; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table-input { border: 1px solid var(--card-border); border-radius: 6px; padding: 6px 8px; font-size: 13px; font-family: inherit; }
.table-input:focus { outline: none; border-color: var(--ora); }

/* ── Transaction badges ── */
.tx-desc { font-size: 14px; font-weight: 500; color: var(--text); }
.tx-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; display: inline-block; margin-top: 2px; }
.tx-badge--deposit { background: #dcfce7; color: #15803d; }
.tx-badge--withdrawal { background: #fee2e2; color: #b91c1c; }
.tx-badge--transfer { background: #dbeafe; color: #1d4ed8; }
.tx-badge--send { background: #fef3c7; color: #92400e; }

/* ── Accounts ── */
.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.account-card { background: linear-gradient(135deg, var(--nav-light) 0%, var(--nav) 100%); border-radius: 14px; padding: 24px; text-decoration: none; color: white; display: block; transition: transform .15s, box-shadow .15s; }
.account-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(26,47,107,0.22); }
.account-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.account-card-type { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.account-card-name { font-size: 16px; font-weight: 700; }
.account-card-icon { width: 42px; height: 42px; background: rgba(255,255,255,0.12); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.account-card-balance { font-size: 28px; font-weight: 900; margin-bottom: 10px; }
.account-card-number { font-size: 12px; font-family: monospace; color: rgba(255,255,255,0.6); letter-spacing: 1px; }

/* ── Account hero ── */
.account-hero-card { background: linear-gradient(135deg, var(--nav-light), var(--nav)); border-radius: 14px; padding: 32px; color: white; margin-bottom: 24px; }
.account-hero-label { font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 8px; }
.account-hero-balance { font-size: 40px; font-weight: 900; margin-bottom: 20px; }
.account-hero-actions { display: flex; gap: 12px; }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; background: white; border: 1.5px solid var(--card-border); border-radius: 10px; padding: 5px; margin-bottom: 16px; }
.tab-btn { flex: 1; padding: 9px; border: none; background: none; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.tab-btn.active { background: var(--nav); color: white; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 13px; font-weight: 600; color: #374151; }
.form-group input, .form-group select, .form-group textarea {
  padding: 10px 12px; border: 1.5px solid var(--card-border); border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--text); background: white; transition: border-color .15s;
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--ora); }
.auth-form .form-group { gap: 4px; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; border: none; transition: opacity .15s, transform .1s; }
.btn:hover { opacity: 0.9; }
.btn-primary { background: var(--ora); color: white; }
.btn-danger { background: var(--red); color: white; }
.btn-outline-white { border: 1.5px solid rgba(255,255,255,0.5); color: white; background: transparent; }
.btn-orange { background: var(--ora); color: white; }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: white; border-radius: 14px; width: 100%; max-width: 440px; overflow: hidden; }
.modal-header { background: var(--nav); padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { color: white; font-size: 16px; margin: 0; }
.modal-close { background: none; border: none; color: rgba(255,255,255,0.7); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); font-size: 14px; }

/* ── Helpers ── */
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.text-green { color: var(--lime); font-weight: 600; }
.text-red { color: var(--red); font-weight: 600; }

/* ── Mobile nav ── */
.mobile-nav { display: none; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 20px 16px 90px; }
  .charts-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .mobile-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: white; border-top: 1px solid var(--card-border); padding: 8px 0 12px; z-index: 200; justify-content: space-around; }
  .mobile-nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 4px 10px; }
  .mobile-nav-item.active { color: var(--nav); }
  .tabs { overflow-x: auto; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
}
