/* ============================================================
   LoanPro Management System — Premium CSS
   ============================================================ */

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

/* ── CSS Variables (Default: Light Mode — Premium Ivory & Gold) ── */
:root {
  --brand-blue:     #0052cc;
  --brand-blue-rgb: 0, 82, 204;
  --brand-red:      #d90429;
  --brand-red-rgb:  217, 4, 41;
  
  --gold:           var(--brand-blue);
  --gold-light:     #0747a6;
  --gold-dark:      #00388d;
  
  --navy:           #f8fafc;
  --navy-mid:       #f1f5f9;
  --navy-card:      #ffffff;
  --navy-border:    #e2e8f0;
  --navy-hover:     rgba(var(--brand-blue-rgb), .08);
  
  --text-primary:   #0f172a;
  --text-sec:       #334155;
  --text-muted:     #64748b;
  
  --sidebar-w:      260px;
  --header-h:       70px;
  --radius:         14px;
  --radius-sm:      8px;
  --shadow:         0 10px 40px rgba(0,0,0,.08);
  --shadow-sm:      0 2px 15px rgba(0,0,0,.05);
  --transition:     .25s ease;

  --c-success:      #16a34a;
  --c-warning:      #d97706;
  --c-danger:       #dc2626;
  --c-info:         #2563eb;
  --c-primary:      var(--brand-blue);
}

/* ── Dark Mode Preference (body.dark-mode) ─────────────────── */
body.dark-mode {
  background-color: #0a0f1e !important;
  color: #f0f4ff !important;
  --navy:         #0a0f1e;
  --navy-mid:     #111827;
  --navy-card:    #161d2e;
  --navy-border:  #1e2a40;
  --navy-hover:   #1c2640;
  --text-primary: #f0f4ff;
  --text-sec:     #8d9cc0;
  --text-muted:   #566080;
  --shadow:       0 8px 32px rgba(0,0,0,.45);
  --shadow-sm:    0 2px 12px rgba(0,0,0,.3);
}

body.dark-mode .sidebar               { background: #161d2e !important; border-right-color: #1e2a40 !important; }
body.dark-mode .top-header            { background: rgba(22,29,46,.8) !important; border-bottom-color: #1e2a40 !important; }
body.dark-mode .card,
body.dark-mode .stat-card             { background: #161d2e !important; border-color: #1e2a40 !important; }
body.dark-mode .page-content          { background: #0a0f1e; }
body.dark-mode .main-content          { background: #0a0f1e; }
body.dark-mode .header-search         { background: #111827 !important; border-color: #1e2a40 !important; }
body.dark-mode .header-search input   { color: #f0f4ff !important; }
body.dark-mode .header-icon-btn       { background: #111827 !important; border-color: #1e2a40 !important; color: #8d9cc0 !important; }
body.dark-mode .form-control          { background: #111827 !important; border-color: #1e2a40 !important; color: #f0f4ff !important; }
body.dark-mode select.form-control option { background: #161d2e; color: #f0f4ff; }
body.dark-mode tbody td               { color: #f0f4ff !important; border-bottom-color: rgba(30,42,64,.6) !important; }
body.dark-mode tbody tr:hover td      { background: #1c2640 !important; }
body.dark-mode thead th               { background: #111827 !important; border-bottom-color: #1e2a40 !important; color: #566080 !important; }
body.dark-mode .pagination a,
body.dark-mode .pagination span       { background: #111827 !important; border-color: #1e2a40 !important; color: #8d9cc0; }
body.dark-mode .btn-secondary         { background: #111827 !important; border-color: #1e2a40 !important; color: #8d9cc0 !important; }
body.dark-mode .nav-item a            { color: #8d9cc0; }
body.dark-mode .nav-item a:hover,
body.dark-mode .nav-item a.active     { background: rgba(0,82,204,.15) !important; color: var(--brand-blue) !important; }
body.dark-mode .sidebar-footer        { border-top-color: #1e2a40 !important; }
body.dark-mode .tabs                  { background: #111827 !important; }
body.dark-mode .tab-btn.active        { background: #161d2e !important; }
body.dark-mode .customer-hero         { background: linear-gradient(135deg,#161d2e,#1c2640) !important; border-color: #1e2a40 !important; }
body.dark-mode .nav-section-label     { color: #566080; }
body.dark-mode .sf-name              { color: #f0f4ff; }
body.dark-mode .sf-role              { color: #566080; }

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--navy);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color .35s ease, color .35s ease;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--navy-mid); }
::-webkit-scrollbar-thumb { background: var(--navy-border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-blue); }

/* ══════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════ */
.layout { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy-card);
  border-right: 1px solid var(--navy-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition);
}
.sidebar-brand {
  padding: 28px 24px 22px;
  border-bottom: 1px solid var(--navy-border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-brand .brand-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--brand-blue), var(--gold-dark));
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,82,204,.2);
}
.sidebar-brand .brand-text strong {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-brand .brand-text span {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: .5px;
}

.sidebar-nav { padding: 16px 0; flex: 1; }
.nav-section-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 24px 6px;
  font-weight: 600;
}
.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  color: var(--text-sec);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  position: relative;
  transition: all var(--transition);
}
.nav-item a .nav-icon {
  width: 20px; text-align: center; font-size: 16px; flex-shrink: 0;
}
.nav-item a:hover, .nav-item a.active {
  color: var(--gold-light);
  background: var(--navy-hover);
}
.nav-item a.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--gold);
  border-radius: 0 4px 4px 0;
}
.nav-item a .nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--navy-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-footer .sf-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--brand-blue), var(--gold-dark));
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
}
.sidebar-footer .sf-name { font-size: 12.5px; font-weight: 600; }
.sidebar-footer .sf-role { font-size: 11px; color: var(--text-muted); }
.sidebar-footer a.logout-btn {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 16px;
  transition: color var(--transition);
}
.sidebar-footer a.logout-btn:hover { color: var(--c-danger); }

/* ── Main Content ───────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top Header ─────────────────────────────────────────── */
.top-header {
  height: var(--header-h);
  background: #ffffff;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--navy-border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
  position: sticky;
  top: 0;
  z-index: 50;
}
.top-header .page-title {
  font-size: 18px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
}
.top-header .breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
}
.top-header .breadcrumb a:hover { color: var(--gold); }
.header-spacer { flex: 1; }
.header-search {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  gap: 8px;
  width: 220px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.02);
}
.header-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  width: 100%;
}
.header-search input::placeholder { color: var(--text-muted); }
.header-icon-btn {
  width: 38px; height: 38px;
  background: #ffffff;
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--text-sec);
  font-size: 16px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,.02);
}
.header-icon-btn:hover { border-color: var(--gold); color: var(--gold); }
.header-icon-btn .notif-dot {
  position: absolute;
  top: 6px; right: 7px;
  width: 7px; height: 7px;
  background: var(--c-danger);
  border-radius: 50%;
  border: 1.5px solid var(--navy-card);
}
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
}

/* ── Page Content ───────────────────────────────────────── */
.page-content { padding: 28px; flex: 1; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-header h3 {
  font-size: 15px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
}

/* ── Stat Cards ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
}
.stat-card.gold::before   { background: linear-gradient(90deg, var(--gold), var(--gold-dark)); }
.stat-card.green::before  { background: linear-gradient(90deg, var(--c-success), #16a34a); }
.stat-card.blue::before   { background: linear-gradient(90deg, var(--c-info), #1d4ed8); }
.stat-card.red::before    { background: linear-gradient(90deg, var(--c-danger), #b91c1c); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-card.gold  .stat-icon { background: rgba(201,168,76,.15); color: var(--gold); }
.stat-card.green .stat-icon { background: rgba(34,197,94,.12); color: var(--c-success); }
.stat-card.blue  .stat-icon { background: rgba(59,130,246,.12); color: var(--c-info); }
.stat-card.red   .stat-icon { background: rgba(239,68,68,.12); color: var(--c-danger); }
.stat-info .stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.stat-info .stat-value {
  font-size: 22px; font-weight: 800;
  font-family: 'Poppins', sans-serif;
  line-height: 1.1;
}
.stat-info .stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.stat-info .stat-sub .up   { color: var(--c-success); }
.stat-info .stat-sub .down { color: var(--c-danger); }

/* ── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left;
  font-size: 11px;
  letter-spacing: .8px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--navy-border);
  white-space: nowrap;
}
tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(30,42,64,.6);
  color: var(--text-primary);
  vertical-align: middle;
}
tbody tr:hover td { background: var(--navy-hover); }
tbody tr:last-child td { border-bottom: none; }
.td-muted { color: var(--text-muted); font-size: 12px; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  white-space: nowrap;
}
.badge-success   { background: rgba(34,197,94,.15);  color: var(--c-success); }
.badge-warning   { background: rgba(245,158,11,.15); color: var(--c-warning); }
.badge-danger    { background: rgba(239,68,68,.15);  color: var(--c-danger); }
.badge-info      { background: rgba(59,130,246,.15); color: var(--c-info); }
.badge-secondary { background: rgba(141,156,192,.12); color: var(--text-sec); }
.badge-primary   { background: rgba(201,168,76,.15); color: var(--gold); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand-blue), var(--gold-dark));
  color: var(--navy);
  box-shadow: 0 4px 14px rgba(0,82,204,.2);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(var(--brand-blue-rgb), .3);
}
.btn-secondary {
  background: var(--navy-mid);
  color: var(--text-sec);
  border: 1px solid var(--navy-border);
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }
.btn-success  { background: rgba(34,197,94,.15);  color: var(--c-success); border: 1px solid rgba(34,197,94,.3); }
.btn-danger   { background: rgba(239,68,68,.15);  color: var(--c-danger);  border: 1px solid rgba(239,68,68,.3); }
.btn-info     { background: rgba(59,130,246,.15); color: var(--c-info);    border: 1px solid rgba(59,130,246,.3); }
.btn-success:hover, .btn-danger:hover, .btn-info:hover { opacity: .85; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 13px 26px; font-size: 15px; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* ── Forms ──────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.form-control {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,.12);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
select.form-control option { background: var(--navy-card); color: var(--text-primary); }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: 11px; color: var(--text-muted); }
.form-divider {
  grid-column: 1 / -1;
  border: none;
  border-top: 1px solid var(--navy-border);
  margin: 4px 0;
}
.section-title {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--navy-border);
}
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--navy-border);
}

/* ── Flash messages ─────────────────────────────────────── */
.flash {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  animation: slideDown .3s ease;
}
@keyframes slideDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }
.flash-success { background: rgba(34,197,94,.12);  border: 1px solid rgba(34,197,94,.25);  color: #4ade80; }
.flash-error   { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.25);  color: #f87171; }
.flash-warning { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.25); color: #fbbf24; }
.flash-info    { background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.25); color: #60a5fa; }

/* ── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin-top: 20px;
}
.pagination a, .pagination span {
  min-width: 36px; height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  color: var(--text-sec);
  transition: all var(--transition);
}
.pagination a:hover { border-color: var(--gold); color: var(--gold); }
.pagination span.current { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ── Search & Filter bar ─────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-bar .form-control { min-width: 180px; }

/* ── Info Box (Loan Detail) ──────────────────────────────── */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.info-item .info-label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.info-item .info-value { font-size: 15px; font-weight: 600; }

/* ── Progress Bar ────────────────────────────────────────── */
.progress-wrap { background: var(--navy-border); border-radius: 99px; height: 8px; overflow: hidden; }
.progress-bar  { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--gold-dark)); transition: width .6s ease; }

/* ── Charts placeholder ──────────────────────────────────── */
.chart-box { width: 100%; height: 260px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }

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

/* ── Login Page ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(201,168,76,.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(59,130,246,.06) 0%, transparent 60%),
    var(--navy);
}
.login-container {
  width: 100%;
  max-width: 430px;
  padding: 20px;
}
.login-card {
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: 20px;
  padding: 42px 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo .logo-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--brand-blue), var(--gold-dark));
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 28px;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(201,168,76,.35);
}
.login-logo h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── Tabs ──────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; background: var(--navy-mid); padding: 4px; border-radius: var(--radius-sm); margin-bottom: 22px; width: fit-content; }
.tab-btn {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--text-muted);
  transition: all var(--transition);
}
.tab-btn.active { background: var(--navy-card); color: var(--gold); box-shadow: var(--shadow-sm); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Utilities ───────────────────────────────────────────── */
.text-gold    { color: var(--gold); }
.text-success { color: var(--c-success); }
.text-danger  { color: var(--c-danger); }
.text-muted   { color: var(--text-muted); }
.text-right   { text-align: right; }
.font-bold    { font-weight: 700; }
.font-mono    { font-family: 'Courier New', monospace; }
.mt-1 { margin-top: 6px; }   .mt-2 { margin-top: 14px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 14px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 8px; } .gap-3 { gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.w-full { width: 100%; }

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
.animate-in { animation: fadeIn .4s ease both; }
.animate-in:nth-child(1){ animation-delay:.05s; }
.animate-in:nth-child(2){ animation-delay:.1s; }
.animate-in:nth-child(3){ animation-delay:.15s; }
.animate-in:nth-child(4){ animation-delay:.2s; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
  .filter-bar .form-control { min-width: 100%; }
  .header-search { display: none; }
}

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

/* ── Avatar initials ─────────────────────────────────────── */
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-blue), var(--gold-dark));
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
}

/* ── Customer card (view) ────────────────────────────────── */
.customer-hero {
  background: linear-gradient(135deg, var(--navy-card) 0%, var(--navy-hover) 100%);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.customer-hero .c-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-blue), var(--gold-dark));
  display: grid; place-items: center;
  font-size: 28px; font-weight: 800;
  color: var(--navy);
  flex-shrink: 0;
}
.customer-hero h2 { font-size: 22px; font-weight: 800; font-family: 'Poppins', sans-serif; }
.customer-hero h2 span { font-size: 13px; color: var(--text-muted); font-weight: 400; display: block; }

/* ── Loan repayment schedule ─────────────────────────────── */
.schedule-table td:first-child { font-weight: 600; color: var(--gold); }

/* ── Branch Selector ────────────────────────────────────── */
.header-branch-selector { margin-right: 15px; }
.branch-select-input {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-sm);
  color: var(--gold-light);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: all var(--transition);
}
.branch-select-input:hover { border-color: var(--brand-blue); }
.branch-badge {
    background: rgba(0,82,204,.15);
    color: var(--brand-blue);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 15px;
}
body.light-mode .branch-select-input { background: #ffffff; border-color: #cbd5e1; color: #0f172a; }
body.light-mode .branch-badge { background: rgba(0,82,204,.1); color: var(--brand-blue); }

/* ── Brand Logo Styling ── */
.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 15px 24px;
}
.brand-logo img {
  max-width: 100%;
  max-height: 55px;
  object-fit: contain;
  transition: transform var(--transition);
}
.brand-logo img:hover {
  transform: scale(1.05);
}
