/* ============================================================
   LoanPro Premium CSS v3 — White Light Theme
   Premium Finance UI | Mobile-First | Fully Responsive
   Fonts: Syne (headings) + Plus Jakarta Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:          #f8f9fc;
  --bg-card:     #ffffff;
  --bg-card2:    #f1f4f9;
  --bg-sidebar:  #0f172a;
  --bg-hover:    #f3f6ff;
  --bg-deep:     #0f172a;       /* compat alias */
  --bg-dark:     #1e293b;       /* compat alias */

  /* Brand */
  --primary:     #4f46e5;
  --primary-2:   #6366f1;
  --primary-light: #eef2ff;
  --gold:        #f59e0b;
  --gold2:       #d97706;
  --gold-light:  #fef3c7;

  /* Status */
  --green:       #10b981;
  --green-light: #d1fae5;
  --red:         #ef4444;
  --red-light:   #fee2e2;
  --blue:        #3b82f6;
  --blue-light:  #dbeafe;
  --purple:      #8b5cf6;
  --purple-light:#ede9fe;
  --teal:        #14b8a6;
  --teal-light:  #ccfbf1;
  --orange:      #f97316;
  --orange-light:#ffedd5;

  /* Text */
  --text:        #0f172a;
  --text-primary: #0f172a;
  --text-secondary:#64748b;
  --text-muted:  #94a3b8;

  /* Borders & Shadows */
  --border:      #e2e8f0;
  --border-focus:#4f46e5;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:      0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-md:   0 8px 30px rgba(0,0,0,.10), 0 4px 10px rgba(0,0,0,.05);
  --shadow-lg:   0 20px 60px rgba(0,0,0,.12), 0 8px 20px rgba(0,0,0,.06);
  --shadow-xl:   0 30px 80px rgba(79,70,229,.18);

  /* Layout */
  --sidebar-w:   268px;
  --topbar-h:    64px;
  --radius-sm:   8px;
  --radius:      12px;
  --radius-lg:   18px;
  --radius-xl:   24px;
  --transition:  0.22s cubic-bezier(.4,0,.2,1);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Plus Jakarta Sans', 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
h1,h2,h3,h4,h5 { font-family: 'Syne', sans-serif; line-height: 1.2; color: var(--text); }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  display: flex; flex-direction: column;
  z-index: 200;
  box-shadow: 4px 0 24px rgba(0,0,0,.12);
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.4rem 1.4rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.brand-logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: #fff; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79,70,229,.4);
}
.brand-name {
  font-family: 'Syne', sans-serif; font-size: 1.25rem; font-weight: 800;
  color: #fff; letter-spacing: -.01em;
}

/* Sidebar user card */
.sidebar-user {
  display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1.2rem;
  margin: .75rem .75rem .25rem;
  background: rgba(255,255,255,.06);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.08);
}
.user-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .95rem; overflow: hidden;
}
.user-info { min-width: 0; }
.user-name { font-size: .85rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kyc-badge { font-size: .68rem; font-weight: 600; padding: .15rem .5rem; border-radius: 100px; display: inline-flex; align-items: center; gap: .2rem; margin-top: .2rem; }
.kyc-badge.approved  { background: rgba(16,185,129,.2); color: #34d399; }
.kyc-badge.pending   { background: rgba(245,158,11,.2); color: #fbbf24; }
.kyc-badge.submitted { background: rgba(59,130,246,.2); color: #60a5fa; }
.kyc-badge.rejected  { background: rgba(239,68,68,.2);  color: #f87171; }

/* Nav links */
.sidebar-nav { padding: .5rem 0 1.5rem; flex: 1; }
.nav-section-label {
  font-size: .65rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(255,255,255,.3);
  padding: 1rem 1.4rem .4rem;
}
.nav-link {
  display: flex; align-items: center; gap: .7rem;
  padding: .62rem 1rem .62rem 1.2rem;
  margin: .1rem .75rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.55);
  font-size: .875rem; font-weight: 500;
  transition: all var(--transition);
  position: relative; text-decoration: none;
}
.nav-link i { font-size: 1.1rem; flex-shrink: 0; }
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link.active {
  background: linear-gradient(135deg, rgba(79,70,229,.25), rgba(99,102,241,.15));
  color: #fff;
  border-left: 2px solid var(--primary-2);
  font-weight: 600;
}
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px;
  background: var(--red); color: #fff;
  border-radius: 100px; font-size: .65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.nav-wallet-bal {
  margin-left: auto; font-size: .7rem; color: var(--gold);
  background: rgba(245,158,11,.15); border-radius: 6px; padding: .1rem .4rem;
  white-space: nowrap;
}

/* ── Sidebar Overlay ──────────────────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 199;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ── Main Wrapper ─────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h); z-index: 150;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem; padding: 0 1.5rem;
  box-shadow: var(--shadow-sm);
}
.sidebar-toggle {
  display: none; background: none; border: none;
  color: var(--text-secondary); font-size: 1.3rem; cursor: pointer;
  padding: .4rem; border-radius: var(--radius-sm);
  transition: all var(--transition); flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--bg); color: var(--primary); }
.topbar-search {
  display: flex; align-items: center; gap: .5rem; flex: 1; max-width: 320px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 50px; padding: .45rem 1rem;
  color: var(--text-secondary); font-size: .875rem;
  transition: border-color var(--transition);
}
.topbar-search:focus-within { border-color: var(--primary); }
.topbar-search input { background: none; border: none; outline: none; color: var(--text); font-family: inherit; font-size: .875rem; width: 100%; }
.topbar-actions { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.topbar-balance {
  display: flex; align-items: center; gap: .35rem;
  background: linear-gradient(135deg, var(--primary-light), #e0e7ff);
  border: 1.5px solid #c7d2fe;
  border-radius: 50px; padding: .4rem .9rem;
  color: var(--primary); font-weight: 700; font-size: .875rem;
}
.notif-btn-wrap { position: relative; }
.notif-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 1.1rem; cursor: pointer;
  transition: all var(--transition);
}
.notif-btn:hover { background: var(--primary-light); color: var(--primary); border-color: #c7d2fe; }
.notif-badge {
  position: absolute; top: -3px; right: -3px; width: 18px; height: 18px;
  background: var(--red); color: #fff; border-radius: 50%;
  font-size: .62rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.avatar-btn {
  width: 38px; height: 38px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  color: #fff; font-weight: 700; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: var(--shadow-sm);
  text-decoration: none; cursor: pointer; transition: all var(--transition);
  flex-shrink: 0;
}
.avatar-btn:hover { box-shadow: 0 0 0 3px rgba(79,70,229,.3); transform: scale(1.05); }

/* ── Notification Dropdown ────────────────────────────────── */
.notif-dropdown {
  display: none; position: absolute; top: calc(100% + .6rem); right: 0;
  width: 320px; background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 300; overflow: hidden;
}
.notif-dropdown.show { display: block; animation: dropIn .2s ease; }
@keyframes dropIn { from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)} }
.notif-dropdown-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.1rem; border-bottom: 1px solid var(--border);
  font-size: .9rem; font-weight: 600;
}
.notif-dropdown .notif-list { max-height: 340px; overflow-y: auto; }
.notif-dropdown .notif-item {
  display: flex; gap: .75rem; padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--border); text-decoration: none; color: inherit;
  transition: background var(--transition);
}
.notif-dropdown .notif-item:hover { background: var(--bg); }
.notif-dropdown .notif-item.unread { background: #fafbff; }
.notif-dropdown .notif-icon {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.notif-dropdown .notif-title { font-weight: 600; font-size: .84rem; color: var(--text); }
.notif-dropdown .notif-msg { font-size: .78rem; color: var(--text-secondary); margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-dropdown .notif-time { font-size: .7rem; color: var(--text-muted); margin-top: .2rem; }
.notif-empty { text-align: center; padding: 2rem; color: var(--text-muted); font-size: .88rem; }

/* ── Page Content ─────────────────────────────────────────── */
.page-content { padding: 1.75rem 1.75rem 3rem; }

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap;
}
.page-title { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.page-sub   { color: var(--text-secondary); font-size: .875rem; margin-top: .2rem; }

/* ── Flash ────────────────────────────────────────────────── */
@keyframes slideDown { from{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1} }
.flash-message {
  display: flex; align-items: center; gap: .65rem;
  padding: .85rem 1.25rem; font-size: .88rem;
  animation: slideDown .3s ease;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.4rem; border-bottom: 1.5px solid var(--border);
  flex-wrap: wrap; background: #fff;
}
.card-title {
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: .95rem;
  color: var(--text); display: flex; align-items: center; gap: .5rem;
}
.card-body  { padding: 1.4rem; }
.card-footer{ padding: .85rem 1.4rem; border-top: 1.5px solid var(--border); background: var(--bg); }

/* ── Stat Cards ───────────────────────────────────────────── */
.stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr));
  gap: 1.1rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.3rem 1.4rem; display: flex; align-items: center; gap: 1rem;
  box-shadow: var(--shadow-sm); transition: all var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0;
}
.si-gold   { background: var(--gold-light);   color: var(--gold2); }
.si-blue   { background: var(--blue-light);   color: var(--blue); }
.si-green  { background: var(--green-light);  color: var(--green); }
.si-red    { background: var(--red-light);    color: var(--red); }
.si-purple { background: var(--purple-light); color: var(--purple); }
.si-teal   { background: var(--teal-light);   color: var(--teal); }
.si-primary{ background: var(--primary-light);color: var(--primary); }
.stat-val { font-family: 'Syne', sans-serif; font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--text); }
.stat-lbl { font-size: .75rem; color: var(--text-muted); margin-top: .2rem; font-weight: 500; }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; min-width: 500px; }
.data-table th {
  padding: .75rem 1.1rem; text-align: left; font-size: .72rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted);
  background: var(--bg); border-bottom: 1.5px solid var(--border); white-space: nowrap;
}
.data-table td { padding: .85rem 1.1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--bg); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .22rem .65rem; border-radius: 100px; font-size: .72rem; font-weight: 700;
}
.badge-success,.badge-approved,.badge-active,.badge-disbursed { background: var(--green-light);  color: #059669; }
.badge-danger,.badge-rejected,.badge-blocked,.badge-overdue   { background: var(--red-light);    color: #dc2626; }
.badge-warning,.badge-pending,.badge-submitted                 { background: var(--gold-light);   color: #b45309; }
.badge-info    { background: var(--blue-light);  color: #2563eb; }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-closed  { background: #f1f5f9; color: #64748b; }
.badge-lg { padding: .35rem .85rem; font-size: .8rem; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1.15rem;
  border-radius: 50px; font-size: .875rem; font-weight: 600; cursor: pointer;
  border: none; text-decoration: none; transition: all var(--transition); white-space: nowrap;
  font-family: inherit;
}
.btn-gold    { background: linear-gradient(135deg,var(--gold),var(--gold2)); color: #fff; box-shadow: 0 4px 14px rgba(245,158,11,.35); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(245,158,11,.45); }
.btn-primary { background: linear-gradient(135deg,var(--primary),var(--primary-2)); color: #fff; box-shadow: 0 4px 14px rgba(79,70,229,.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(79,70,229,.4); }
.btn-blue    { background: var(--blue-light); color: var(--blue); border: 1.5px solid #bfdbfe; }
.btn-blue:hover { background: var(--blue); color: #fff; }
.btn-green   { background: var(--green-light); color: var(--green); border: 1.5px solid #a7f3d0; }
.btn-green:hover { background: var(--green); color: #fff; }
.btn-red     { background: var(--red-light); color: var(--red); border: 1.5px solid #fecaca; }
.btn-red:hover { background: var(--red); color: #fff; }
.btn-outline-sm {
  background: #fff; border: 1.5px solid var(--border); color: var(--text-secondary);
  padding: .4rem .9rem; font-size: .82rem; border-radius: 50px;
}
.btn-outline-sm:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-sm  { padding: .32rem .7rem; font-size: .78rem; }
.btn-lg  { padding: .75rem 1.8rem; font-size: .95rem; }
.w-full  { width: 100%; justify-content: center; }
.flex-1  { flex: 1; justify-content: center; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-secondary); margin-bottom: .4rem; }
.form-input {
  width: 100%; padding: .65rem 1rem;
  background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-family: inherit; font-size: .9rem; transition: all var(--transition); outline: none;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.08); }
.form-input::placeholder { color: var(--text-muted); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748b' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .85rem center; padding-right: 2.2rem; }
.form-hint { font-size: .76rem; color: var(--text-muted); margin-top: .3rem; }
textarea.form-input { resize: vertical; min-height: 80px; }
.input-icon-wrap { position: relative; }
.input-icon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1rem; pointer-events: none; }
.has-icon { padding-left: 2.6rem !important; }

/* ── Auth Layout ──────────────────────────────────────────── */
.auth-logo { font-family: 'Syne',sans-serif; font-size: 1.5rem; font-weight: 800; text-align: center; margin-bottom: 1.5rem; color: var(--primary); display: flex; align-items: center; justify-content: center; gap: .4rem; }
.auth-title { font-family: 'Syne',sans-serif; font-size: 1.6rem; font-weight: 800; text-align: center; margin-bottom: .3rem; color: var(--text); }
.auth-sub { color: var(--text-secondary); font-size: .88rem; text-align: center; margin-bottom: 1.75rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .88rem; color: var(--text-secondary); }
.btn-submit {
  width: 100%; padding: .78rem; border-radius: 50px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; border: none; font-family: inherit; font-weight: 700; font-size: .95rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .5rem;
  transition: all var(--transition); box-shadow: 0 4px 16px rgba(79,70,229,.3);
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(79,70,229,.4); }
.link-gold { color: var(--primary); font-weight: 600; text-decoration: none; }
.link-gold:hover { text-decoration: underline; }

/* ── Detail List ──────────────────────────────────────────── */
.detail-list { display: flex; flex-direction: column; }
.detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .7rem 0; border-bottom: 1px solid var(--border); font-size: .88rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-row span { color: var(--text-secondary); font-weight: 500; }
.detail-row strong { color: var(--text); }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3.5rem 1.5rem; }
.empty-state i  { font-size: 2.8rem; margin-bottom: .85rem; display: block; color: #cbd5e1; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .4rem; color: var(--text); }
.empty-state p  { font-size: .875rem; color: var(--text-secondary); }

/* ── Pagination ───────────────────────────────────────────── */
.pagination-wrap { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.page-btn {
  padding: .4rem .75rem; border-radius: 50px; font-size: .82rem; font-weight: 600;
  border: 1.5px solid var(--border); color: var(--text-secondary); text-decoration: none; transition: all var(--transition); background: #fff;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 4px 12px rgba(79,70,229,.3); }

/* ── Alert ────────────────────────────────────────────────── */
.alert { display: flex; align-items: flex-start; gap: .65rem; padding: .9rem 1.1rem; border-radius: var(--radius); font-size: .88rem; margin-bottom: 1rem; line-height: 1.5; }
.alert-success { background: var(--green-light);  border: 1.5px solid #a7f3d0; color: #065f46; }
.alert-error   { background: var(--red-light);    border: 1.5px solid #fca5a5; color: #991b1b; }
.alert-warning { background: var(--gold-light);   border: 1.5px solid #fde68a; color: #92400e; }
.alert-info    { background: var(--blue-light);   border: 1.5px solid #bfdbfe; color: #1e40af; }
.alert i { flex-shrink: 0; margin-top: .1rem; }

/* ── Toast ────────────────────────────────────────────────── */
@keyframes slideInRight { from{transform:translateX(120%);opacity:0}to{transform:translateX(0);opacity:1} }
.toast {
  display: flex; align-items: center; gap: .65rem; padding: .85rem 1.1rem;
  border-radius: var(--radius); font-size: .875rem; background: #fff;
  box-shadow: var(--shadow-lg); animation: slideInRight .3s ease; min-width: 260px;
  border-left: 4px solid var(--primary);
}
.toast-success { border-left-color: var(--green); }
.toast-error   { border-left-color: var(--red); }
.toast-warning { border-left-color: var(--gold); }

/* ── KYC Progress ─────────────────────────────────────────── */
.kyc-step-circle {
  width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 1.1rem; border: 2px solid var(--border);
  background: #fff; color: var(--text-muted); transition: all .3s;
}
.kyc-step.done .kyc-step-circle { background: var(--green); border-color: var(--green); color: #fff; }
.kyc-step.active .kyc-step-circle { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.kyc-step-label { font-size: .72rem; color: var(--text-muted); }
.kyc-step.done .kyc-step-label { color: var(--green); font-weight: 600; }
.kyc-step.active .kyc-step-label { color: var(--primary); font-weight: 600; }
.kyc-step-line { flex: 1; height: 2px; background: var(--border); margin: 0 .5rem 1.2rem; transition: background .3s; }
.kyc-step.done ~ .kyc-step-line { background: var(--green); }

/* ── Upload Area ──────────────────────────────────────────── */
.upload-area, label[style*="dashed"] {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 1.25rem;
  text-align: center; cursor: pointer; transition: all var(--transition); position: relative; overflow: hidden;
}
.upload-area:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-area.has-file { border-color: var(--green); border-style: solid; background: var(--green-light); }
.upload-area input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-placeholder { display: flex; flex-direction: column; align-items: center; gap: .4rem; color: var(--text-muted); font-size: .85rem; }
.upload-placeholder i { font-size: 1.6rem; color: var(--primary); }
.upload-area.has-file .upload-placeholder { display: none; }

/* ── Calc Slider ──────────────────────────────────────────── */
input[type=range] { -webkit-appearance: none; width: 100%; height: 5px; border-radius: 3px; background: var(--border); outline: none; cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--primary); cursor: pointer; box-shadow: 0 2px 8px rgba(79,70,229,.4); border: 2px solid #fff; }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--primary); cursor: pointer; border: 2px solid #fff; }

/* ── Toggle Switch ────────────────────────────────────────── */
.toggle-switch { position: relative; display: inline-block; width: 46px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; border-radius: 24px; background: #e2e8f0; cursor: pointer; transition: .3s; }
.toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; border-radius: 50%; background: #fff; transition: .3s; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.toggle-switch input:checked + .toggle-slider { background: var(--green); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--text-muted); margin-bottom: 1rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-secondary); transition: color var(--transition); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text); font-weight: 600; }

/* ── Utility ──────────────────────────────────────────────── */
.mono       { font-family: 'Courier New', monospace; font-size: .85rem; }
.fw-600     { font-weight: 600; }
.text-gold  { color: var(--gold2); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-blue  { color: var(--blue); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.mt-2       { margin-top: 1.5rem; }
.mb-2       { margin-bottom: 1.5rem; }
.mb-3       { margin-bottom: 2rem; }
.row-highlight { background: #fafbff !important; }
.text-primary { color: var(--text); }

/* ── Plan Selector (Apply page) ───────────────────────────── */
.plan-option {
  border: 2px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.1rem .9rem; text-align: center; cursor: pointer; transition: all var(--transition);
  background: #fff;
}
.plan-option:hover { border-color: var(--primary); background: var(--primary-light); }
.plan-option.selected { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }

/* ── EMI Preview ──────────────────────────────────────────── */
.emi-preview { background: var(--primary-light); border: 1.5px solid #c7d2fe; border-radius: var(--radius); padding: 1rem; margin-top: 1rem; }
.emi-preview-row { display: flex; justify-content: space-between; padding: .3rem 0; font-size: .875rem; }

/* ── Loan detail extras ───────────────────────────────────── */
.next-emi-card { background: linear-gradient(135deg,#fffbeb,#fef3c7); border: 1.5px solid #fde68a; border-radius: var(--radius); padding: 1rem; }
.progress-bar-wrap { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg,var(--primary),var(--green)); border-radius: 4px; transition: width .6s ease; }

/* ── Notification rows ────────────────────────────────────── */
.notif-row { display: flex; align-items: flex-start; gap: 1rem; padding: 1rem 1.4rem; border-bottom: 1px solid var(--border); transition: background var(--transition); }
.notif-row:hover { background: var(--bg); }
.notif-row.unread { background: #fafbff; }
.notif-row-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.notif-row-icon.loan    { background: var(--blue-light);   color: var(--blue); }
.notif-row-icon.payment { background: var(--green-light);  color: var(--green); }
.notif-row-icon.kyc     { background: var(--gold-light);   color: var(--gold2); }
.notif-row-icon.wallet  { background: var(--purple-light); color: var(--purple); }
.notif-row-icon.alert   { background: var(--red-light);    color: var(--red); }
.notif-row-icon.info    { background: var(--teal-light);   color: var(--teal); }
.notif-row-content { flex: 1; }
.notif-row-title { font-weight: 600; font-size: .9rem; color: var(--text); }
.notif-row-msg   { color: var(--text-secondary); font-size: .84rem; margin-top: .15rem; }
.notif-row-time  { color: var(--text-muted); font-size: .74rem; margin-top: .3rem; display: flex; align-items: center; gap: .25rem; }
.notif-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: .5rem; }

/* ── Avatar ───────────────────────────────────────────────── */
.avatar-xl {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  color: #fff; font-family: 'Syne', sans-serif; font-size: 1.8rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; margin: 0 auto; overflow: hidden;
}

/* ── Wallet Card ──────────────────────────────────────────── */
.wallet-hero-card {
  background: linear-gradient(135deg, #4f46e5, #7c3aed, #2563eb);
  border-radius: var(--radius-xl); padding: 2rem 2.25rem; position: relative; overflow: hidden;
  margin-bottom: 1.75rem; color: #fff;
  box-shadow: 0 20px 60px rgba(79,70,229,.3);
}
.wallet-bg-glow { position: absolute; top: -60px; right: -60px; width: 250px; height: 250px; border-radius: 50%; background: rgba(255,255,255,.08); pointer-events: none; }

/* ── TX Type ──────────────────────────────────────────────── */
.tx-type { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; font-weight: 600; }
.tx-type.credit { color: var(--green); }
.tx-type.debit  { color: var(--red); }

/* ── Recording Dot ────────────────────────────────────────── */
@keyframes pulse { 0%,100%{opacity:1;}50%{opacity:.4;} }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1s infinite; }

/* ── Deposit Page ─────────────────────────────────────────── */
.dep-amount-card { background: linear-gradient(135deg,#fffbeb,#fef3c7); border: 2px solid #fde68a; border-radius: var(--radius-lg); }

/* ───────────────────────────────────────────────────────────
   RESPONSIVE — Mobile First
   ─────────────────────────────────────────────────────────── */

/* Tablet ≤ 1024px */
@media (max-width: 1024px) {
  :root { --sidebar-w: 240px; }
}

/* Mobile ≤ 900px — sidebar slides in */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 300;
    width: 280px;
  }
  .sidebar.active { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .topbar { left: 0; }
  .sidebar-toggle { display: flex !important; }
  .topbar-search { display: none; }
}

/* Small tablet ≤ 768px */
@media (max-width: 768px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 1.25rem 1rem 2.5rem; }
  .page-title { font-size: 1.25rem; }
  .topbar { padding: 0 1rem; gap: .5rem; }
  .card-body { padding: 1rem; }
  .card-header { padding: .85rem 1rem; }
  /* Stack all 2-col grids */
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns:280px"],
  div[style*="grid-template-columns: 280px"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns:1.2fr"],
  div[style*="grid-template-columns: 1.2fr"] { grid-template-columns: 1fr !important; }
}

/* Phone ≤ 480px */
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .page-content { padding: 1rem .75rem 2rem; }
  .data-table { font-size: .8rem; }
  .data-table th, .data-table td { padding: .65rem .75rem; }
  .btn-lg { padding: .65rem 1.25rem; font-size: .88rem; }
  .topbar-balance { display: none; }
  div[style*="repeat(4,1fr)"] { grid-template-columns: 1fr 1fr !important; }
  /* Fix quick actions */
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .sidebar-overlay { display: none; }
  .main-wrapper { margin: 0; }
}

/* ══════════════════════════════════════════════════════════
   MOBILE OVERFLOW FIXES  — prevent horizontal scroll
   ══════════════════════════════════════════════════════════ */

/* Kill ALL horizontal overflow */
html, body { overflow-x: hidden !important; max-width: 100vw; }
* { max-width: 100%; }

/* Tables scroll inside their container, not the page */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; }
.data-table  { min-width: 0; width: 100%; }

/* Remove min-width that breaks mobile */
@media (max-width: 768px) {
  .data-table { font-size: .78rem; min-width: 480px; }
  .table-wrap { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

  /* Stack ALL two-column grids */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1.2fr 1fr"],
  [style*="grid-template-columns: 1.2fr 1fr"],
  [style*="grid-template-columns:280px"],
  [style*="grid-template-columns: 280px"],
  [style*="grid-template-columns:260px"],
  [style*="grid-template-columns: 260px"] {
    grid-template-columns: 1fr !important;
  }

  /* Quick actions 2-col on mobile */
  [style*="repeat(4,1fr)"] { grid-template-columns: 1fr 1fr !important; }

  /* Page header stack */
  .page-header { flex-direction: column; align-items: flex-start; gap: .75rem; }

  /* Card body tighter */
  .card-body { padding: 1rem; }
  .card-header { padding: .85rem 1rem; }

  /* Detail rows wrap */
  .detail-row { flex-wrap: wrap; gap: .25rem; }

  /* Sidebar full-width on mobile */
  .sidebar { width: 280px !important; }

  /* Hide topbar search */
  .topbar-search { display: none !important; }

  /* Topbar tighter */
  .topbar { padding: 0 .85rem; gap: .5rem; }
  .topbar-balance { display: none; }
}

@media (max-width: 480px) {
  :root { --topbar-h: 56px; }
  .page-content { padding: .9rem .75rem 2rem; }
  .page-title { font-size: 1.15rem; }
  .stats-row  { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .stat-card  { padding: 1rem; }
  .stat-val   { font-size: 1.3rem; }
  .card-footer.pagination-wrap { gap: .3rem; }
  .page-btn   { padding: .35rem .6rem; font-size: .78rem; }
  .btn        { font-size: .82rem; padding: .5rem .9rem; }
  .btn-lg     { padding: .65rem 1.25rem; }
  /* Login/register form wider */
  .auth-panel-right { padding: 1.5rem 1.25rem !important; }
  .btn-submit { padding: .72rem; font-size: .9rem; }
}

/* ── Deposit page mobile fix ─────────────────── */
@media (max-width: 768px) {
  /* UPI card stacks */
  [style*="grid-template-columns:1fr 1fr"][id],
  div[style*="max-width:900px"] > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── Auth layout mobile ──────────────────────── */
@media (max-width: 900px) {
  body { min-height: 100vh; display: block; }
  .auth-panel-left { display: none !important; }
  .auth-panel-right {
    width: 100% !important;
    min-height: 100vh;
    background: #f8f9fc !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
