/* ============================================================
   LoanPro — Stylesheet v2.0
   Improved: Responsive, professional, mobile-first
   ============================================================ */

:root {
  --primary:       #1a56db;
  --primary-dark:  #1e40af;
  --primary-light: #eff6ff;
  --secondary:     #0e9f6e;
  --warning:       #f59e0b;
  --danger:        #e02424;
  --dark:          #0f172a;
  --gray-50:       #f8fafc;
  --gray-100:      #f1f5f9;
  --gray-200:      #e2e8f0;
  --gray-300:      #cbd5e1;
  --gray-400:      #94a3b8;
  --gray-500:      #64748b;
  --gray-600:      #475569;
  --gray-700:      #334155;
  --gray-800:      #1e293b;
  --gray-900:      #0f172a;
  --sidebar-w:     240px;
  --topbar-h:      56px;
  --radius:        8px;
  --radius-lg:     12px;
  --shadow:        0 1px 3px rgba(0,0,0,.06),0 1px 2px rgba(0,0,0,.04);
  --shadow-md:     0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.14);
  --transition:    all .18s cubic-bezier(.4,0,.2,1);
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
html{height:100%;scroll-behavior:smooth;}
body{font-family:'Segoe UI',system-ui,-apple-system,sans-serif;font-size:14px;color:var(--gray-700);background:var(--gray-100);line-height:1.5;height:100%;-webkit-font-smoothing:antialiased;}
a{color:var(--primary);text-decoration:none;}
a:hover{text-decoration:none;}

/* LAYOUT */
.app-wrapper{display:flex;min-height:100vh;}

/* SIDEBAR */
.sidebar{width:var(--sidebar-w);min-width:var(--sidebar-w);background:var(--dark);color:#e2e8f0;display:flex;flex-direction:column;flex-shrink:0;position:sticky;top:0;height:100vh;overflow-y:auto;overflow-x:hidden;z-index:100;align-self:flex-start;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.1) transparent;transition:transform .25s cubic-bezier(.4,0,.2,1);}
.sidebar::-webkit-scrollbar{width:4px;}
.sidebar::-webkit-scrollbar-thumb{background:rgba(255,255,255,.1);border-radius:4px;}
.sidebar-brand{display:flex;align-items:center;gap:10px;padding:18px 16px;border-bottom:1px solid rgba(255,255,255,.06);}
.brand-icon{width:34px;height:34px;background:var(--primary);border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:16px;color:white;flex-shrink:0;}
.brand-text{font-size:15px;font-weight:700;color:white;line-height:1.2;}
.brand-text span{display:block;font-size:10px;font-weight:400;color:var(--gray-500);}
.sidebar-section{padding:12px 0 4px;}
.sidebar-section-label{font-size:10px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--gray-500);padding:0 16px 6px;}
.sidebar-nav{list-style:none;}
.sidebar-nav li a{display:flex;align-items:center;gap:10px;padding:9px 16px;font-size:13px;color:#94a3b8;transition:var(--transition);position:relative;}
.sidebar-nav li a:hover{background:rgba(255,255,255,.06);color:white;}
.sidebar-nav li a.active{background:rgba(26,86,219,.22);color:white;}
.sidebar-nav li a.active::before{content:'';position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--primary);border-radius:0 2px 2px 0;}
.sidebar-nav li a i{width:16px;text-align:center;font-size:13px;flex-shrink:0;}
.sidebar-nav li a .badge{margin-left:auto;background:var(--danger);color:white;font-size:10px;padding:1px 6px;border-radius:10px;}
.sidebar-footer{margin-top:auto;padding:14px 16px;border-top:1px solid rgba(255,255,255,.06);}
.sidebar-user{display:flex;align-items:center;gap:10px;}
.avatar{width:32px;height:32px;border-radius:50%;background:var(--primary);color:white;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;flex-shrink:0;}
.user-info .user-name{font-size:13px;font-weight:600;color:white;}
.user-info .user-role{font-size:11px;color:var(--gray-500);}

/* MAIN CONTENT */
.main-content{flex:1;min-width:0;display:flex;flex-direction:column;min-height:100vh;overflow-x:hidden;}

/* TOPBAR */
.topbar{height:var(--topbar-h);background:white;border-bottom:1px solid var(--gray-200);display:flex;align-items:center;gap:12px;padding:0 20px;position:sticky;top:0;z-index:50;width:100%;}
.topbar-title{font-size:16px;font-weight:700;color:var(--gray-900);flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.topbar-actions{display:flex;align-items:center;gap:8px;flex-shrink:0;}
.btn-icon{width:36px;height:36px;border:none;background:transparent;cursor:pointer;border-radius:var(--radius);display:flex;align-items:center;justify-content:center;color:var(--gray-600);font-size:15px;position:relative;transition:var(--transition);}
.btn-icon:hover{background:var(--gray-100);color:var(--gray-900);}
.notif-badge{position:absolute;top:4px;right:4px;background:var(--danger);color:white;font-size:9px;font-weight:700;width:14px;height:14px;border-radius:50%;display:flex;align-items:center;justify-content:center;}

/* PAGE CONTENT */
.page-content{padding:20px;flex:1;overflow-x:hidden;width:100%;}

/* CARDS */
.card{background:white;border-radius:var(--radius-lg);box-shadow:var(--shadow);margin-bottom:20px;border:1px solid var(--gray-200);}
.card-header{padding:14px 20px;border-bottom:1px solid var(--gray-200);display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;}
.card-title{font-size:14px;font-weight:700;color:var(--gray-900);}
.card-body{padding:20px;}

/* KPI */
.kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px;margin-bottom:20px;}
.kpi-card{background:white;border-radius:var(--radius-lg);box-shadow:var(--shadow);border:1px solid var(--gray-200);padding:18px 20px;display:flex;align-items:center;gap:14px;transition:var(--transition);}
.kpi-card:hover{box-shadow:var(--shadow-md);transform:translateY(-1px);}
.kpi-icon{width:46px;height:46px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0;}
.kpi-icon.blue{background:#eff6ff;color:var(--primary);}
.kpi-icon.green{background:#f0fdf4;color:var(--secondary);}
.kpi-icon.orange{background:#fff7ed;color:var(--warning);}
.kpi-icon.red{background:#fef2f2;color:var(--danger);}
.kpi-icon.teal{background:#f0fdfa;color:#0694a2;}
.kpi-icon.purple{background:#faf5ff;color:#7c3aed;}
.kpi-label{font-size:12px;color:var(--gray-500);margin-bottom:2px;font-weight:500;}
.kpi-value{font-size:22px;font-weight:800;color:var(--gray-900);line-height:1.1;}
.kpi-sub{font-size:11px;color:var(--gray-500);margin-top:2px;}

/* DASHBOARD GRIDS */
.dash-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:16px;}
.dash-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px;}
.dash-grid-3{display:grid;grid-template-columns:2fr 1fr;gap:16px;margin-bottom:16px;}
.due-payments-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;}

/* TABLES */
.table-wrapper{overflow-x:auto;-webkit-overflow-scrolling:touch;}
.data-table{width:100%;border-collapse:collapse;font-size:13px;}
.data-table thead tr{background:var(--gray-50);}
.data-table th{padding:11px 16px;text-align:left;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--gray-500);border-bottom:1px solid var(--gray-200);white-space:nowrap;}
.data-table td{padding:11px 16px;border-bottom:1px solid var(--gray-100);color:var(--gray-700);vertical-align:middle;}
.data-table tbody tr{transition:background .1s;}
.data-table tbody tr:hover{background:var(--gray-50);}
.data-table tbody tr:last-child td{border-bottom:none;}
.mono{font-family:'Courier New',monospace;font-size:12px;}
.text-bold{font-weight:700;}
.text-center{text-align:center;}
.text-right{text-align:right;}
.text-muted{color:var(--gray-500);}

/* FORMS */
.form-group{margin-bottom:18px;}
.form-label{display:block;font-size:13px;font-weight:600;color:var(--gray-700);margin-bottom:6px;}
.form-control{width:100%;padding:9px 12px;border:1.5px solid var(--gray-300);border-radius:var(--radius);font-size:13px;color:var(--gray-800);background:white;transition:var(--transition);outline:none;appearance:none;-webkit-appearance:none;}
.form-control:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(26,86,219,.1);}
.form-control:disabled{background:var(--gray-50);color:var(--gray-500);cursor:not-allowed;}
textarea.form-control{resize:vertical;min-height:80px;}
select.form-control{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;padding-right:30px;}
.form-hint{font-size:11px;color:var(--gray-500);margin-top:4px;}

/* BUTTONS */
.btn{display:inline-flex;align-items:center;gap:6px;padding:9px 18px;border-radius:var(--radius);font-size:13px;font-weight:600;cursor:pointer;border:1.5px solid transparent;transition:var(--transition);text-decoration:none;white-space:nowrap;line-height:1;}
.btn:hover{text-decoration:none;}
.btn:active{transform:scale(.98);}
.btn-primary{background:var(--primary);color:white;border-color:var(--primary);}
.btn-primary:hover{background:var(--primary-dark);border-color:var(--primary-dark);}
.btn-success{background:var(--secondary);color:white;border-color:var(--secondary);}
.btn-success:hover{background:#059669;}
.btn-danger{background:var(--danger);color:white;border-color:var(--danger);}
.btn-danger:hover{background:#c81e1e;}
.btn-outline{background:transparent;color:var(--gray-700);border-color:var(--gray-300);}
.btn-outline:hover{background:var(--gray-100);border-color:var(--gray-400);}
.btn-sm{padding:5px 12px;font-size:12px;}
.btn-lg{padding:12px 24px;font-size:15px;}
.btn-full{width:100%;justify-content:center;}

/* BADGES */
.badge{display:inline-flex;align-items:center;padding:2px 9px;border-radius:20px;font-size:11px;font-weight:600;white-space:nowrap;}
.badge-primary{background:#eff6ff;color:var(--primary);}
.badge-success{background:#f0fdf4;color:#15803d;}
.badge-warning{background:#fff7ed;color:#c2410c;}
.badge-danger{background:#fef2f2;color:var(--danger);}
.badge-info{background:#f0f9ff;color:#0369a1;}
.badge-secondary{background:var(--gray-100);color:var(--gray-600);}
.badge-dark{background:var(--gray-900);color:white;}

/* ALERTS */
.alert{padding:11px 15px;border-radius:var(--radius);font-size:13px;margin-bottom:16px;display:flex;align-items:center;gap:8px;}
.alert-success{background:#f0fdf4;color:#15803d;border:1px solid #bbf7d0;}
.alert-danger{background:#fef2f2;color:#b91c1c;border:1px solid #fecaca;}
.alert-warning{background:#fff7ed;color:#c2410c;border:1px solid #fed7aa;}
.alert-info{background:#f0f9ff;color:#0369a1;border:1px solid #bae6fd;}

/* SEARCH BARS */
.search-bar{display:flex;align-items:center;gap:8px;background:white;border:1.5px solid var(--gray-300);border-radius:var(--radius);padding:7px 13px;color:var(--gray-500);transition:var(--transition);}
.search-bar:focus-within{border-color:var(--primary);box-shadow:0 0 0 3px rgba(26,86,219,.1);color:var(--gray-700);}
.search-bar i{font-size:13px;flex-shrink:0;}
.search-bar input{border:none;outline:none;font-size:13px;color:var(--gray-800);background:transparent;width:320px;min-width:0;}
.search-bar input::placeholder{color:var(--gray-400);}

/* EMPTY STATE */
.empty-state{text-align:center;padding:48px 20px;color:var(--gray-500);}
.empty-state i{font-size:40px;margin-bottom:12px;display:block;opacity:.3;}
.empty-state p{font-size:14px;}

/* UTILITIES */
.d-flex{display:flex;}
.align-center{align-items:center;}
.justify-between{justify-content:space-between;}
.justify-center{justify-content:center;}
.flex-wrap{flex-wrap:wrap;}
.flex-col{flex-direction:column;}
.gap-4{gap:4px;}
.gap-8{gap:8px;}
.gap-12{gap:12px;}
.gap-16{gap:16px;}
.mb-8{margin-bottom:8px;}
.mb-16{margin-bottom:16px;}
.mb-24{margin-bottom:24px;}
.mt-8{margin-top:8px;}
.mt-16{margin-top:16px;}
.fw-bold{font-weight:700;}
.w-100{width:100%;}

/* MODAL */
.modal-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:200;align-items:center;justify-content:center;padding:16px;}
.modal-overlay.active{display:flex;}
.modal{background:white;border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);width:100%;max-width:520px;max-height:90vh;overflow-y:auto;animation:modalIn .2s ease;}
@keyframes modalIn{from{transform:scale(.96) translateY(8px);opacity:0;}to{transform:none;opacity:1;}}
.modal-header{padding:16px 20px;border-bottom:1px solid var(--gray-200);display:flex;align-items:center;justify-content:space-between;}
.modal-title{font-size:15px;font-weight:700;}
.modal-body{padding:20px;}
.modal-footer{padding:14px 20px;border-top:1px solid var(--gray-200);display:flex;justify-content:flex-end;gap:8px;}

/* SIDEBAR OVERLAY */
.sidebar-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:99;}
.sidebar-overlay.active{display:block;}

/* ═══════════════════════════════════════════════════
   BORROWER PORTAL — Professional Design
   ═══════════════════════════════════════════════════ */
.portal-tag{background:rgba(26,86,219,.2);color:#93c5fd;border:1px solid rgba(26,86,219,.25);border-radius:20px;font-size:10px;font-weight:600;padding:2px 8px;margin-left:6px;letter-spacing:.04em;}

.bp-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:14px;margin-bottom:24px;}
.bp-stat{background:white;border-radius:var(--radius-lg);border:1px solid var(--gray-200);padding:18px;box-shadow:var(--shadow);transition:var(--transition);text-align:center;}
.bp-stat:hover{box-shadow:var(--shadow-md);transform:translateY(-1px);}
.bp-stat-icon{width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:18px;margin:0 auto 10px;}
.bp-stat-label{font-size:11px;color:var(--gray-500);font-weight:600;text-transform:uppercase;letter-spacing:.05em;}
.bp-stat-value{font-size:20px;font-weight:800;color:var(--gray-900);margin-top:4px;line-height:1.1;}
.bp-stat-sub{font-size:11px;color:var(--gray-500);margin-top:2px;}

.loan-card-bp{background:white;border:1.5px solid var(--gray-200);border-radius:var(--radius-lg);padding:20px;margin-bottom:14px;box-shadow:var(--shadow);transition:var(--transition);}
.loan-card-bp:hover{box-shadow:var(--shadow-md);border-color:var(--primary);}
.loan-card-bp .lc-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;flex-wrap:wrap;gap:8px;}
.loan-card-bp .lc-code{font-family:monospace;font-size:13px;color:var(--gray-500);font-weight:600;}
.loan-card-bp .lc-amount{font-size:22px;font-weight:800;color:var(--gray-900);}
.loan-card-bp .lc-progress{height:7px;background:var(--gray-200);border-radius:3px;overflow:hidden;margin:10px 0;}
.loan-card-bp .lc-bar{height:100%;background:var(--primary);border-radius:3px;transition:width .5s ease;}
.loan-card-bp .lc-meta{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:12px;}
.loan-card-bp .lc-meta-item{text-align:center;}
.loan-card-bp .lc-meta-label{font-size:10px;color:var(--gray-500);text-transform:uppercase;letter-spacing:.04em;}
.loan-card-bp .lc-meta-val{font-size:13px;font-weight:700;color:var(--gray-800);margin-top:2px;}

.pay-btn{display:inline-flex;align-items:center;gap:8px;background:linear-gradient(135deg,#1a56db 0%,#1e40af 100%);color:white;border:none;border-radius:var(--radius);padding:10px 20px;font-size:13px;font-weight:700;cursor:pointer;transition:var(--transition);box-shadow:0 2px 8px rgba(26,86,219,.3);}
.pay-btn:hover{transform:translateY(-1px);box-shadow:0 4px 14px rgba(26,86,219,.4);}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width:1200px){
  .dash-grid{grid-template-columns:repeat(2,1fr);}
}
@media (max-width:1024px){
  .dash-grid{grid-template-columns:repeat(2,1fr);}
  .dash-grid-2{grid-template-columns:1fr;}
  .dash-grid-3{grid-template-columns:1fr;}
  .search-bar input{width:160px;}
}
@media (max-width:768px){
  .sidebar{position:fixed;top:0;left:0;height:100vh;transform:translateX(-100%);z-index:200;}
  .sidebar.open{transform:translateX(0);box-shadow:var(--shadow-lg);}
  .main-content{margin-left:0;width:100%;}
  #sidebarToggle{display:flex !important;}
  .dash-grid{grid-template-columns:1fr 1fr;}
  .dash-grid-2,.dash-grid-3{grid-template-columns:1fr;}
  .due-payments-grid{grid-template-columns:1fr;}
  .kpi-grid,.bp-summary{grid-template-columns:1fr 1fr;}
  .page-content{padding:12px;}
  .topbar{padding:0 12px;}
  .card-body{padding:14px;}
  .topbar-title{font-size:14px;}
  .modal{max-width:100%;margin:0;border-radius:var(--radius-lg) var(--radius-lg) 0 0;}
  .modal-overlay{align-items:flex-end;padding:0;}
  .data-table th,.data-table td{padding:9px 10px;font-size:12px;}
  .hide-mobile{display:none !important;}
  .search-bar{flex:1;}
  .search-bar input{width:100%;}
  .loan-card-bp .lc-meta{grid-template-columns:1fr 1fr;}
}
@media (max-width:480px){
  .dash-grid,.kpi-grid{grid-template-columns:1fr;}
  .bp-summary{grid-template-columns:1fr 1fr;}
  .page-content{padding:10px;}
  .topbar{padding:0 10px;height:50px;}
  .card-body{padding:12px;}
  .data-table th,.data-table td{padding:8px 8px;font-size:11px;}
  .kpi-value{font-size:18px;}
  .kpi-card{padding:14px;}
  .btn-sm{font-size:11px;padding:4px 8px;}
}
@media print{
  .sidebar,.topbar,.btn,.no-print{display:none !important;}
  .main-content{margin:0;}
  .page-content{padding:0;}
  .card{box-shadow:none;border:1px solid #ccc;}
  body{background:white;}
}

/* ============================================================
   DATATABLES — from includes/footer.php
   ============================================================ */
.dataTables_wrapper { font-size:13px; }
.dataTables_filter input { border:1.5px solid var(--gray-200); border-radius:8px; padding:6px 12px; outline:none; font-size:13px; margin-left:6px; }
.dataTables_filter input:focus { border-color:var(--primary); }
.dataTables_length select { border:1.5px solid var(--gray-200); border-radius:8px; padding:4px 8px; font-size:13px; }
.dataTables_info { font-size:12px; color:var(--gray-500); }
.dataTables_paginate .paginate_button { padding:4px 10px !important; border-radius:6px !important; font-size:12px !important; border:1px solid var(--gray-200) !important; margin:0 2px; cursor:pointer; }
.dataTables_paginate .paginate_button.current { background:var(--primary) !important; color:white !important; border-color:var(--primary) !important; }
.dataTables_paginate .paginate_button:hover:not(.current) { background:var(--gray-100) !important; }
table.dataTable thead th { background:var(--gray-50); font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:var(--gray-500); font-weight:700; padding:10px 14px; border-bottom:2px solid var(--gray-200) !important; }
table.dataTable tbody td { padding:10px 14px; border-bottom:1px solid var(--gray-100); vertical-align:middle; }
table.dataTable tbody tr:hover td { background:#f8faff; }
table.dataTable { border-collapse:collapse !important; }
.dt-top-bar { display:flex; justify-content:space-between; align-items:center; padding:12px 16px; border-bottom:1px solid var(--gray-100); flex-wrap:wrap; gap:10px; }

/* ============================================================
   BORROWER SIDEBAR OVERRIDES — from includes/borrower_header.php
   ============================================================ */
.sidebar.borrower { background: linear-gradient(180deg,#1e293b 0%,#0f172a 100%); }
.sidebar.borrower .brand-icon { background: var(--secondary); }
.sidebar.borrower .sidebar-nav li a.active { background: rgba(26,86,219,.25); }
.sidebar.borrower .sidebar-nav li a.active::before { background: var(--secondary); }

/* ============================================================
   USER DROPDOWN — from includes/header.php & borrower_header.php
   ============================================================ */
.user-dropdown { position:relative; }
.user-dropdown-trigger { display:flex;align-items:center;gap:8px; background:none;border:1px solid var(--gray-200); border-radius:8px;padding:4px 10px 4px 4px; cursor:pointer;transition:all .15s; }
.user-dropdown-trigger:hover { background:var(--gray-100);border-color:var(--gray-300); }
.user-dropdown-menu { position:absolute;right:0;top:calc(100% + 6px); background:white;border:1px solid var(--gray-200); border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.12); min-width:180px;z-index:9999;overflow:hidden; }
.dropdown-item { display:flex;align-items:center;gap:10px; padding:10px 16px;font-size:13px;font-weight:500; color:var(--gray-700);text-decoration:none;transition:background .12s; }
.dropdown-item:hover { background:var(--gray-100); }
.dropdown-item i { width:14px;text-align:center; }

/* ============================================================
   DASHBOARD METRICS — from app/views/dashboard.php
   ============================================================ */
.metric-card { background:white; border-radius:14px; padding:16px 18px; border:1px solid var(--gray-200); display:flex; align-items:center; gap:14px; transition:box-shadow .2s; position:relative; overflow:hidden; }
.metric-card:hover { box-shadow:0 4px 16px rgba(0,0,0,.08); }
.metric-card::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; }
.metric-card.blue::before   { background:var(--primary); }
.metric-card.green::before  { background:var(--secondary); }
.metric-card.orange::before { background:var(--warning); }
.metric-card.red::before    { background:var(--danger); }
.metric-card.teal::before   { background:#0891b2; }
.metric-card.purple::before { background:#7c3aed; }
.metric-card.gold::before   { background:#d97706; }
.metric-card.gray::before   { background:var(--gray-400); }
.metric-icon { width:46px; height:46px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:19px; flex-shrink:0; }
.metric-icon.blue   { background:#eff6ff; color:var(--primary); }
.metric-icon.green  { background:#f0fdf4; color:var(--secondary); }
.metric-icon.orange { background:#fff7ed; color:var(--warning); }
.metric-icon.red    { background:#fef2f2; color:var(--danger); }
.metric-icon.teal   { background:#ecfeff; color:#0891b2; }
.metric-icon.purple { background:#f5f3ff; color:#7c3aed; }
.metric-icon.gold   { background:#fffbeb; color:#d97706; }
.metric-icon.gray   { background:#f9fafb; color:var(--gray-500); }
.metric-body   { flex:1; min-width:0; }
.metric-label  { font-size:11px; color:var(--gray-500); text-transform:uppercase; letter-spacing:.05em; margin-bottom:2px; }
.metric-value  { font-size:22px; font-weight:800; color:var(--gray-800); line-height:1.1; }
.metric-sub    { font-size:11px; color:var(--gray-400); margin-top:2px; }
.metric-badge  { position:absolute; top:10px; right:10px; }
.activity-item { display:flex; align-items:center; gap:12px; padding:9px 0; border-bottom:1px solid var(--gray-100); }
.activity-item:last-child { border-bottom:none; }
.activity-avatar { width:34px; height:34px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; flex-shrink:0; }
.activity-info { flex:1; min-width:0; }
.activity-name { font-size:13px; font-weight:600; color:var(--gray-800); }
.activity-sub  { font-size:11px; color:var(--gray-500); margin-top:1px; }
.activity-right { text-align:right; flex-shrink:0; }
.due-item { display:flex; align-items:center; gap:10px; padding:8px 12px; border-radius:8px; margin-bottom:6px; background:var(--gray-50); }
.due-item.overdue  { background:#fff5f5; border-left:3px solid var(--danger); }
.due-item.today    { background:#fffbeb; border-left:3px solid var(--warning); }
.due-item.upcoming { border-left:3px solid var(--secondary); }
.progress-bar-wrap { background:var(--gray-100); border-radius:30px; height:6px; overflow:hidden; margin-top:6px; }
.progress-bar-fill { height:100%; border-radius:30px; transition:width .8s ease; }
.stat-row { display:flex; justify-content:space-between; align-items:center; padding:7px 0; border-bottom:1px solid var(--gray-100); }
.stat-row:last-child { border-bottom:none; }

/* ============================================================
   AUTH PAGES — login, forgot password, reset, reactivate, otp
   ============================================================ */
/* Shared auth layout */
.auth-body { background:linear-gradient(135deg,#0f172a 0%,#1a3a5c 100%); display:flex; align-items:center; justify-content:center; min-height:100vh; padding:20px; }
.auth-wrap { width:100%; max-width:460px; }
.auth-logo { text-align:center; margin-bottom:24px; }
.auth-logo .icon { width:60px; height:60px; background:var(--primary); border-radius:16px; display:inline-flex; align-items:center; justify-content:center; font-size:26px; color:white; margin-bottom:10px; }
.auth-logo h1 { color:white; font-size:24px; font-weight:800; }
.auth-logo p { color:#94a3b8; font-size:13px; margin-top:2px; }
.auth-card { background:white; border-radius:18px; padding:28px 32px; box-shadow:0 32px 64px rgba(0,0,0,.4); }

/* Login page specific */
.login-wrap { width:100%; max-width:460px; }
.login-logo { text-align:center; margin-bottom:24px; }
.login-logo .icon { width:60px; height:60px; background:var(--primary); border-radius:16px; display:inline-flex; align-items:center; justify-content:center; font-size:26px; color:white; margin-bottom:10px; }
.login-logo h1 { color:white; font-size:24px; font-weight:800; }
.login-logo p { color:#94a3b8; font-size:13px; margin-top:2px; }
.login-card { background:white; border-radius:18px; padding:28px 32px; box-shadow:0 32px 64px rgba(0,0,0,.4); }
.tab-nav { display:flex; gap:0; margin-bottom:24px; background:var(--gray-100); border-radius:10px; padding:4px; }
.tab-nav button { flex:1; padding:9px; font-size:13px; font-weight:600; border:none; border-radius:8px; cursor:pointer; background:transparent; color:var(--gray-500); transition:all .2s; }
.tab-nav button.active { background:white; color:var(--primary); box-shadow:0 1px 4px rgba(0,0,0,.1); }
.tab-panel { display:none; }
.tab-panel.active { display:block; }
.input-icon { position:relative; }
.input-icon i { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--gray-500); font-size:13px; }
.input-icon input { padding-left:36px; }
.btn-submit { width:100%; justify-content:center; padding:11px; font-size:14px; margin-top:4px; }
.pw-req { font-size:11px; color:#9ca3af; display:flex; align-items:center; gap:5px; padding:2px 0; transition:color .2s; }
.pw-req .req-icon { font-size:8px; }
.pw-req.met { color:#0e9f6e; }
.steps-box { background:#f0fdf4; border:1px solid #bbf7d0; border-radius:10px; padding:14px 16px; margin-bottom:18px; }
.steps-box .step { display:flex; align-items:center; gap:10px; font-size:13px; color:#065f46; padding:4px 0; }
.steps-box .step-num { width:22px; height:22px; background:#0e9f6e; color:white; border-radius:50%; font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; }

/* Terms & Conditions modal */
.tc-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.6); z-index:9999; align-items:center; justify-content:center; padding:16px; }
.tc-overlay.open { display:flex; }
.tc-modal { background:white; border-radius:16px; width:100%; max-width:520px; max-height:80vh; display:flex; flex-direction:column; box-shadow:0 24px 64px rgba(0,0,0,.45); }
.tc-modal-head { padding:18px 22px 14px; border-bottom:1px solid #e5e7eb; flex-shrink:0; }
.tc-modal-head h3 { font-size:16px; font-weight:800; color:#0f172a; margin:0 0 2px; }
.tc-modal-head p { font-size:11px; color:#64748b; margin:0; }
.tc-modal-body { padding:18px 22px; overflow-y:auto; flex:1; font-size:13px; line-height:1.7; color:#334155; }
.tc-modal-body h4 { font-size:13px; font-weight:700; color:#0f172a; margin:16px 0 4px; }
.tc-modal-body p { margin:0 0 10px; }
.tc-modal-foot { padding:14px 22px; border-top:1px solid #e5e7eb; display:flex; justify-content:flex-end; flex-shrink:0; }
.tc-checkbox-wrap { display:flex; align-items:flex-start; gap:10px; background:#f0fdf4; border:1px solid #bbf7d0; border-radius:10px; padding:12px 14px; margin-top:4px; }
.tc-checkbox-wrap input[type=checkbox] { width:17px; height:17px; accent-color:#0e9f6e; flex-shrink:0; margin-top:2px; cursor:pointer; }
.tc-checkbox-wrap label { font-size:12px; color:#065f46; line-height:1.5; cursor:pointer; }
.tc-checkbox-wrap a { color:#0e9f6e; font-weight:700; text-decoration:underline; }

/* Forgot/Reset/Reactivate shared */
.auth-card-icon { width:64px; height:64px; border-radius:50%; display:flex; align-items:center; justify-content:center; margin:0 auto 16px; font-size:28px; }
.auth-card-icon.blue  { background:#eff6ff; color:#1a56db; border:3px solid #bfdbfe; }
.auth-card-icon.green { background:#f0fdf4; color:#0e9f6e; border:3px solid #bbf7d0; }
.email-badge { background:#eff6ff; border:1px solid #bfdbfe; border-radius:20px; padding:6px 16px; font-size:13px; font-weight:600; color:#1a56db; display:inline-block; margin-bottom:20px; }

/* OTP inputs */
.otp-inputs { display:flex; gap:8px; justify-content:center; margin-bottom:20px; }
.otp-inputs input { width:48px; height:58px; border:2px solid #e5e7eb; border-radius:10px; font-size:24px; font-weight:800; text-align:center; color:#1a1a1a; outline:none; transition:all .2s; background:#f9fafb; }
.otp-inputs input:focus { border-color:#1a56db; background:#eff6ff; box-shadow:0 0 0 3px rgba(26,86,219,.1); }
.otp-inputs input.filled { border-color:#1a56db; background:#eff6ff; }
.otp-inputs.green input:focus { border-color:#0e9f6e; background:#f0fdf4; }
.otp-inputs.green input.filled { border-color:#0e9f6e; background:#f0fdf4; }

/* Password strength bar */
.strength-bar { height:4px; border-radius:4px; background:#e5e7eb; margin-top:6px; overflow:hidden; }
.strength-fill { height:100%; border-radius:4px; transition:all .3s; width:0%; }
.strength-text { font-size:11px; margin-top:4px; font-weight:600; }

/* Resend / back links */
.resend-section { text-align:center; margin-top:16px; font-size:13px; color:#6b7280; }
.resend-section button { color:#0e9f6e; font-weight:600; cursor:pointer; background:none; border:none; font-size:13px; text-decoration:underline; }
.resend-section button:disabled { color:#9ca3af; cursor:not-allowed; text-decoration:none; }
.back-link { display:block; text-align:center; margin-top:18px; font-size:12px; color:#9ca3af; text-decoration:none; }
.back-link:hover { color:#6b7280; }
.step-dots { display:flex; justify-content:center; gap:6px; margin-bottom:24px; }
.step-dot { width:32px; height:8px; border-radius:4px; background:#e5e7eb; transition:background .3s; }
.step-dot.active { background:#1a56db; }
.step-dot.done   { background:#0e9f6e; }

/* OTP verify page */
.otp-icon-wrap { width:72px; height:72px; background:#f0fdf4; border-radius:50%; display:flex; align-items:center; justify-content:center; margin:0 auto 20px; font-size:32px; color:#0e9f6e; border:3px solid #bbf7d0; }
.smtp-box { background:#1e293b; border-radius:12px; padding:18px 20px; margin-bottom:20px; }
.smtp-box h4 { color:#f8fafc; font-size:14px; font-weight:700; margin-bottom:8px; }
.smtp-box p  { color:#94a3b8; font-size:12px; line-height:1.7; }
.smtp-box a  { color:#60a5fa; }
.smtp-box .step { display:flex; gap:8px; margin-bottom:6px; align-items:flex-start; }
.smtp-box .step-num { background:#3b82f6; color:white; border-radius:50%; width:18px; height:18px; font-size:10px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-top:1px; }
.timer { font-size:12px; color:#9ca3af; margin-top:6px; }

/* ============================================================
   BORROWER PORTAL PAGES
   ============================================================ */
/* Borrower login */
.borrower-portal-badge { display:inline-block; background:rgba(14,159,110,.2); color:#6ee7b7; border:1px solid rgba(14,159,110,.3); border-radius:20px; font-size:11px; font-weight:600; padding:3px 12px; margin-top:8px; letter-spacing:.04em; }
.tab-nav.borrower button.active { color:var(--secondary); }

/* Borrower dashboard cards */
.b-grid-4 { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:18px; }
.b-card { background:white; border-radius:14px; padding:18px 20px; border:1px solid var(--gray-200); transition:box-shadow .2s; }
.b-card:hover { box-shadow:0 4px 16px rgba(0,0,0,.07); }
.b-icon { width:46px; height:46px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:19px; margin-bottom:12px; }
.b-icon.green  { background:#f0fdf4; color:var(--secondary); }
.b-icon.blue   { background:#eff6ff; color:var(--primary); }
.b-icon.orange { background:#fff7ed; color:var(--warning); }
.b-icon.red    { background:#fef2f2; color:var(--danger); }
.b-label { font-size:11px; color:var(--gray-500); text-transform:uppercase; letter-spacing:.05em; margin-bottom:4px; }
.b-value { font-size:22px; font-weight:800; color:var(--gray-800); }
.b-sub   { font-size:11px; color:var(--gray-400); margin-top:3px; }
.step-badge { display:inline-flex; align-items:center; gap:6px; background:rgba(255,255,255,.2); border-radius:20px; padding:4px 12px; font-size:12px; font-weight:600; }

/* Avatar / profile */
.avatar-ring { position:relative; width:96px; height:96px; margin:0 auto 12px; }
.avatar-ring .av-img { width:96px;height:96px;border-radius:50%;object-fit:cover;border:3px solid var(--secondary); }
.avatar-ring .av-initials { width:96px;height:96px;border-radius:50%;background:var(--secondary);color:white;font-size:32px;font-weight:800;display:flex;align-items:center;justify-content:center;border:3px solid var(--secondary); }
.avatar-ring .av-edit-btn { position:absolute;bottom:2px;right:2px;width:28px;height:28px;border-radius:50%;background:var(--primary);border:2px solid white;color:white;font-size:12px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:.15s; }
.avatar-ring .av-edit-btn:hover { background:var(--primary-dark,#1e40af); transform:scale(1.1); }
.av-upload-area { border:2px dashed var(--gray-300);border-radius:12px;padding:20px;text-align:center;cursor:pointer;transition:.2s; }
.av-upload-area:hover { border-color:var(--primary);background:#eff6ff; }
.av-preview { display:none;width:96px;height:96px;border-radius:50%;object-fit:cover;margin:10px auto 0;border:3px solid var(--secondary); }

/* Payment gateway overlay */
.gw-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.65); z-index:9999; align-items:center; justify-content:center; padding:16px; }
.gw-overlay.open { display:flex; }
.gw-box { background:white; border-radius:20px; width:100%; box-shadow:0 25px 60px rgba(0,0,0,.35); overflow:hidden; animation:gw-in .2s ease; }
@keyframes gw-in { from { transform:scale(.93); opacity:0 } to { transform:scale(1); opacity:1 } }
.gw-hdr { padding:16px 20px; display:flex; align-items:center; justify-content:space-between; color:white; }
.gw-x { background:rgba(255,255,255,.25); border:none; color:white; border-radius:50%; width:32px; height:32px; font-size:20px; cursor:pointer; line-height:1; flex-shrink:0; }
.gw-x:hover { background:rgba(255,255,255,.4); }
.gw-bd { padding:20px; }
.gw-amt { border-radius:12px; padding:16px; text-align:center; margin-bottom:18px; font-size:11px; }
.gw-amt-val   { font-size:30px; font-weight:900; display:block; }
.gw-amt-label { opacity:.7; text-transform:uppercase; letter-spacing:.05em; font-weight:600; }
.gw-amt-sub   { opacity:.55; display:block; margin-top:2px; }
.gw-btn { width:100%; color:white; border:none; border-radius:10px; padding:13px; font-size:15px; font-weight:700; cursor:pointer; margin-bottom:6px; transition:filter .15s; }
.gw-btn:hover { filter:brightness(.88); }
.gw-cancel { width:100%; background:transparent; color:#6b7280; border:none; padding:10px; font-size:13px; cursor:pointer; }
.pdot { width:16px; height:16px; border-radius:50%; border:2.5px solid #0057cc; background:transparent; transition:background .1s; }
.prog-bar  { height:6px; background:#e5e7eb; border-radius:6px; overflow:hidden; max-width:280px; margin:0 auto; }
.prog-fill { height:100%; width:0; border-radius:6px; transition:width .06s linear; }

/* ============================================================
   ADMIN PAGES
   ============================================================ */
.export-grid { display:grid; grid-template-columns:1fr 1fr; gap:24px; max-width:900px; }
.table-check-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:8px; }
.check-item { display:flex; align-items:center; gap:8px; padding:10px 12px; border:1px solid #e5e7eb; border-radius:8px; cursor:pointer; transition:all .15s; }
.check-item:hover { border-color:#3b82f6; background:#eff6ff; }
.check-item input[type=checkbox]:checked + span { font-weight:600; color:#1d4ed8; }
.check-item:has(input:checked) { border-color:#3b82f6; background:#eff6ff; }
.pw-wrap { position:relative; }
.pw-wrap input { padding-right:40px; width:100%; }
.pw-toggle { position:absolute; right:10px; top:50%; transform:translateY(-50%); background:none; border:none; cursor:pointer; color:#6b7280; padding:0; }
.decrypt-box { background:#f8fafc; border:1px solid #e2e8f0; border-radius:12px; padding:20px; }
.decrypt-step { display:flex; gap:12px; align-items:flex-start; margin-bottom:12px; }

/* ============================================================
   ERROR PAGES — 403, 404, 500
   ============================================================ */
.error-page-body { font-family:'Segoe UI',sans-serif; background:#f1f5f9; display:flex; align-items:center; justify-content:center; min-height:100vh; }
.error-box { text-align:center; padding:60px 40px; background:white; border-radius:16px; box-shadow:0 8px 32px rgba(0,0,0,.1); max-width:480px; }
.error-code { font-size:80px; font-weight:800; line-height:1; }
.error-code.blue   { color:#1a56db; }
.error-code.red    { color:#e02424; }
.error-code.orange { color:#ff8800; }
.error-box h1 { font-size:22px; margin:12px 0 8px; color:#111827; }
.error-box p { color:#6b7280; font-size:14px; margin-bottom:24px; }
.error-detail { background:#fef2f2; border:1px solid #fecaca; border-radius:8px; padding:12px 16px; font-size:13px; color:#b91c1c; text-align:left; margin-bottom:24px; word-break:break-word; }

/* ============================================================
   LOAN CONTRACT — print layout
   ============================================================ */
.contract-page { width:215.9mm; min-height:279.4mm; margin:0 auto; padding:20mm 22mm 20mm 25mm; background:white; font-family:'Times New Roman',Times,serif; font-size:12pt; color:#000; }
.contract-header { text-align:center; border-bottom:2px solid #000; padding-bottom:12px; margin-bottom:20px; }
.contract-company-name { font-size:18pt; font-weight:bold; letter-spacing:.03em; text-transform:uppercase; }
.contract-company-info { font-size:9pt; color:#333; margin-top:4px; }
.contract-title { font-size:14pt; font-weight:bold; text-transform:uppercase; letter-spacing:.08em; margin-top:10px; }
.contract-no { font-size:10pt; color:#555; margin-top:4px; }
.contract-section { margin-bottom:16px; }
.contract-section-title { font-size:11pt; font-weight:bold; text-transform:uppercase; border-bottom:1px solid #000; padding-bottom:3px; margin-bottom:10px; letter-spacing:.04em; }
.info-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px 24px; font-size:11pt; }
.info-item { display:flex; gap:6px; }
.info-label { font-weight:bold; white-space:nowrap; min-width:120px; }
.info-value { border-bottom:1px dotted #999; flex:1; min-width:80px; }
.terms-table { width:100%; border-collapse:collapse; font-size:11pt; margin-top:8px; }
.terms-table th,.terms-table td { border:1px solid #000; padding:6px 10px; }
.terms-table th { background:#f0f0f0; font-weight:bold; text-align:left; }
.sched-table { width:100%; border-collapse:collapse; font-size:9.5pt; margin-top:8px; }
.sched-table th { background:#1a1a1a; color:white; padding:5px 8px; text-align:center; font-weight:bold; font-size:9pt; }
.sched-table td { border:1px solid #ccc; padding:4px 8px; text-align:right; }
.sched-table td:first-child { text-align:center; }
.sched-table td:nth-child(2) { text-align:left; }
.sched-table tr:nth-child(even) { background:#f9f9f9; }
.sched-table tfoot td { border-top:2px solid #000; font-weight:bold; background:#f0f0f0; }
.contract-terms-list { font-size:10pt; line-height:1.6; padding-left:18px; }
.contract-terms-list li { margin-bottom:6px; }
.sig-grid { display:grid; grid-template-columns:1fr 1fr; gap:40px; margin-top:20px; }
.sig-box { text-align:center; }
.sig-line { border-top:1px solid #000; margin-top:40px; padding-top:4px; font-size:10pt; }
.sig-label { font-weight:bold; font-size:11pt; }
.sig-sub { font-size:9pt; color:#555; }
.contract-footer { text-align:center; font-size:8pt; color:#666; border-top:1px solid #ccc; padding-top:8px; margin-top:20px; }
.print-bar { position:fixed; top:0; left:0; right:0; background:#1a3d2b; color:white; padding:10px 24px; display:flex; align-items:center; justify-content:space-between; z-index:100; box-shadow:0 2px 8px rgba(0,0,0,.3); }
.print-bar h4 { font-size:14px; font-family:Arial,sans-serif; }
.print-bar-btns { display:flex; gap:10px; }
.btn-print { padding:7px 18px; border-radius:6px; font-size:13px; font-family:Arial,sans-serif; font-weight:600; cursor:pointer; border:none; background:#0e9f6e; color:white; }
.btn-print:hover { background:#0c8a5e; }
.contract-page-wrap { margin-top:50px; }
@media print {
  .print-bar { display:none; }
  .contract-page-wrap { margin-top:0; }
  .contract-page { margin:0; padding:15mm 20mm; }
  .sidebar,.topbar,.btn,.no-print { display:none !important; }
  .main-content { margin:0; }
  .page-content { padding:0; }
  .card { box-shadow:none; border:1px solid #ccc; }
  body { background:white; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
}

/* ============================================================
   FAQ PAGE
   ============================================================ */
.faq-header { background:rgba(255,255,255,.05); border-bottom:1px solid rgba(255,255,255,.08); padding:18px 24px; display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.faq-brand { display:flex; align-items:center; gap:12px; text-decoration:none; }
.faq-brand .icon { width:40px; height:40px; background:var(--primary); border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:18px; color:white; }
.faq-brand h1 { font-size:18px; font-weight:800; color:white; letter-spacing:-.01em; }
.faq-brand span { font-size:12px; color:#94a3b8; display:block; margin-top:1px; }
.header-links { display:flex; gap:8px; }
.header-links a { font-size:13px; font-weight:600; color:#94a3b8; text-decoration:none; padding:7px 14px; border:1px solid rgba(255,255,255,.12); border-radius:8px; transition:all .2s; }
.header-links a:hover { color:white; border-color:rgba(255,255,255,.3); background:rgba(255,255,255,.07); }
.header-links a.primary { background:var(--primary); border-color:var(--primary); color:white; }
.header-links a.primary:hover { background:#1447c0; }
.faq-hero { text-align:center; padding:56px 24px 40px; max-width:600px; margin:0 auto; }
.faq-hero .hero-icon { width:72px; height:72px; background:rgba(255,255,255,.1); border:2px solid rgba(255,255,255,.15); border-radius:20px; display:inline-flex; align-items:center; justify-content:center; font-size:30px; color:white; margin-bottom:20px; }
.faq-hero h2 { font-size:30px; font-weight:800; color:white; letter-spacing:-.02em; margin-bottom:10px; }
.faq-hero p { font-size:15px; color:#94a3b8; line-height:1.6; margin-bottom:28px; }
.faq-search-wrap { position:relative; max-width:480px; margin:0 auto; }
.faq-search-wrap i { position:absolute; left:16px; top:50%; transform:translateY(-50%); color:#94a3b8; font-size:15px; pointer-events:none; }
.faq-search-wrap input { width:100%; padding:13px 16px 13px 46px; border:1.5px solid rgba(255,255,255,.15); border-radius:12px; background:rgba(255,255,255,.1); color:white; font-size:14px; outline:none; transition:all .2s; backdrop-filter:blur(8px); }
.faq-search-wrap input::placeholder { color:#64748b; }
.faq-search-wrap input:focus { border-color:rgba(255,255,255,.35); background:rgba(255,255,255,.15); }
.faq-body { max-width:780px; margin:0 auto; padding:0 20px; }
.cat-pills { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:28px; }
.cat-pill { padding:7px 16px; font-size:12px; font-weight:600; border:1px solid rgba(255,255,255,.15); border-radius:999px; background:rgba(255,255,255,.07); color:#94a3b8; cursor:pointer; transition:all .2s; white-space:nowrap; }
.cat-pill:hover { border-color:rgba(255,255,255,.3); color:white; }
.cat-pill.active { background:#0e9f6e; border-color:#0e9f6e; color:white; }
.faq-section-label { font-size:10px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:#475569; margin-bottom:10px; padding-left:2px; }
.faq-item { background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.08); border-radius:12px; margin-bottom:8px; overflow:hidden; transition:border-color .2s; }
.faq-item:hover { border-color:rgba(255,255,255,.16); }
.faq-item.open { background:rgba(255,255,255,.09); border-color:rgba(14,159,110,.4); }
.faq-q { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:16px 18px; cursor:pointer; user-select:none; }
.faq-q-left { display:flex; align-items:center; gap:12px; }
.faq-q-icon { width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:13px; flex-shrink:0; }
.faq-q-text { font-size:14px; font-weight:600; color:#e2e8f0; line-height:1.4; }
.faq-chevron { flex-shrink:0; color:#475569; transition:transform .25s; font-size:12px; }
.faq-item.open .faq-chevron { transform:rotate(180deg); color:#0e9f6e; }
.faq-a { display:none; padding:14px 18px 16px 62px; font-size:13px; color:#94a3b8; line-height:1.75; border-top:1px solid rgba(255,255,255,.06); }
.faq-item.open .faq-a { display:block; }
.faq-a a { color:#0e9f6e; text-decoration:underline; }
.no-results { text-align:center; padding:48px 20px; color:#475569; font-size:14px; display:none; }
.no-results i { font-size:36px; opacity:.3; display:block; margin-bottom:12px; }
.faq-section-group { margin-bottom:28px; }
.still-help { background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.1); border-radius:16px; padding:32px; text-align:center; margin-top:40px; }
.still-help h3 { font-size:18px; font-weight:700; color:white; margin-bottom:8px; }
.still-help p { font-size:13px; color:#94a3b8; margin-bottom:20px; }
.still-help .actions { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
.help-btn { display:inline-flex; align-items:center; gap:8px; padding:10px 22px; font-size:13px; font-weight:600; border-radius:10px; text-decoration:none; transition:all .2s; }
.help-btn.primary { background:#0e9f6e; color:white; }
.help-btn.primary:hover { background:#0c8a5e; }
.help-btn.outline { background:transparent; color:#94a3b8; border:1px solid rgba(255,255,255,.15); }
.help-btn.outline:hover { color:white; border-color:rgba(255,255,255,.3); }
mark.hl { background:#fef08a; color:#1a1a1a; border-radius:2px; padding:0 1px; }
.faq-foot { text-align:center; margin-top:48px; font-size:12px; color:#334155; }

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing-body { font-family:'DM Sans',sans-serif; background:#f8fafc; color:#0f172a; overflow-x:hidden; }
nav.landing-nav { position:fixed; top:0; left:0; right:0; z-index:100; display:flex; align-items:center; justify-content:space-between; padding:18px 60px; background:rgba(15,23,42,.96); backdrop-filter:blur(12px); border-bottom:1px solid rgba(26,86,219,.1); }
.nav-logo { display:flex; align-items:center; gap:10px; font-size:22px; font-weight:900; color:white; text-decoration:none; }
.nav-logo span { color:#6ee7b7; }
.nav-logo-icon { width:36px; height:36px; background:#0e9f6e; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:16px; color:white; }
.nav-links { display:flex; align-items:center; gap:32px; }
.nav-links a { color:rgba(255,255,255,.75); text-decoration:none; font-size:14px; font-weight:500; transition:color .2s; }
.nav-links a:hover { color:#6ee7b7; }
.nav-cta { display:flex; gap:12px; align-items:center; }
.btn-nav-login { padding:9px 20px; border:1px solid rgba(110,231,183,.4); border-radius:8px; color:#6ee7b7; background:transparent; font-size:14px; font-weight:600; text-decoration:none; transition:all .2s; }
.btn-nav-login:hover { background:rgba(26,86,219,.1); border-color:#6ee7b7; }
.btn-nav-register { padding:9px 20px; background:#f4b942; border:none; border-radius:8px; color:#0f172a; font-size:14px; font-weight:700; text-decoration:none; transition:all .2s; }
.btn-nav-register:hover { background:#fde68a; transform:translateY(-1px); }
.landing-hero { min-height:100vh; background:linear-gradient(135deg,#0f172a 0%,#1e293b 60%,#0d6e45 100%); display:flex; align-items:center; position:relative; overflow:hidden; padding:120px 60px 80px; }
.landing-hero::before { content:''; position:absolute; top:-200px; right:-200px; width:600px; height:600px; background:radial-gradient(circle,rgba(26,86,219,.25) 0%,transparent 70%); border-radius:50%; }
.landing-hero::after { content:''; position:absolute; bottom:-150px; left:-100px; width:400px; height:400px; background:radial-gradient(circle,rgba(26,86,219,.15) 0%,transparent 70%); border-radius:50%; }
.hero-grid { display:grid; grid-template-columns:1fr 1fr; gap:60px; align-items:center; max-width:1200px; margin:0 auto; width:100%; position:relative; z-index:1; }
.hero-badge { display:inline-flex; align-items:center; gap:8px; background:rgba(26,86,219,.1); border:1px solid rgba(26,86,219,.25); border-radius:30px; padding:6px 16px; font-size:12px; font-weight:600; color:#6ee7b7; letter-spacing:.06em; text-transform:uppercase; margin-bottom:24px; }
.hero-title { font-size:clamp(38px,5vw,62px); font-weight:900; line-height:1.1; color:white; margin-bottom:20px; }
.hero-title span { color:#f4b942; }
.hero-subtitle { font-size:17px; font-weight:300; line-height:1.7; color:rgba(255,255,255,.75); margin-bottom:36px; max-width:460px; }
.hero-actions { display:flex; gap:14px; flex-wrap:wrap; margin-bottom:48px; }
.btn-hero-primary { padding:14px 28px; background:#f4b942; border-radius:10px; color:#0f172a; font-weight:700; font-size:15px; text-decoration:none; display:inline-flex; align-items:center; gap:8px; transition:all .25s; border:none; cursor:pointer; }
.btn-hero-primary:hover { background:#fde68a; transform:translateY(-2px); box-shadow:0 8px 24px rgba(26,86,219,.3); }
.btn-hero-secondary { padding:14px 28px; background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.25); border-radius:10px; color:white; font-weight:600; font-size:15px; text-decoration:none; display:inline-flex; align-items:center; gap:8px; transition:all .25s; }
.btn-hero-secondary:hover { background:rgba(255,255,255,.18); border-color:rgba(255,255,255,.4); }
.hero-stats { display:flex; gap:32px; flex-wrap:wrap; }
.stat-number { font-size:28px; font-weight:900; color:white; }
.stat-number span { color:#f4b942; }
.stat-label { font-size:12px; color:rgba(255,255,255,.5); margin-top:2px; letter-spacing:.04em; }
.hero-card-wrap { position:relative; }
.hero-card { background:white; border-radius:20px; padding:32px; box-shadow:0 32px 80px rgba(0,0,0,.35); position:relative; z-index:1; animation:floatCard 6s ease-in-out infinite; }
@keyframes floatCard { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-12px); } }
.card-label { font-size:11px; font-weight:600; color:#6b7280; text-transform:uppercase; letter-spacing:.08em; margin-bottom:6px; }
.card-amount { font-size:38px; font-weight:900; color:#0f172a; margin-bottom:20px; }
.card-info { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:24px; }
.card-info-item { background:#f8fafc; border-radius:10px; padding:12px 14px; }
.card-info-item .label { font-size:11px; color:#6b7280; margin-bottom:4px; }
.card-info-item .value { font-size:15px; font-weight:700; color:#0f172a; }
.card-btn { width:100%; padding:14px; background:#0e9f6e; border:none; border-radius:10px; color:white; font-size:15px; font-weight:700; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:8px; transition:background .2s; }
.card-btn:hover { background:#1e293b; }
.card-tag { position:absolute; top:-16px; right:24px; background:#f4b942; color:#0f172a; border-radius:20px; padding:6px 14px; font-size:12px; font-weight:700; }
.card-tag-2 { position:absolute; bottom:-20px; left:24px; background:#0f172a; color:white; border-radius:20px; padding:8px 16px; font-size:12px; font-weight:600; display:flex; align-items:center; gap:6px; box-shadow:0 8px 24px rgba(0,0,0,.2); }
.landing-section { padding:100px 60px; max-width:1200px; margin:0 auto; }
.section-tag { display:inline-block; background:rgba(26,86,219,.12); color:#0e9f6e; border-radius:30px; padding:6px 16px; font-size:12px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; margin-bottom:16px; }
.section-title { font-size:clamp(28px,4vw,44px); font-weight:900; color:#0f172a; margin-bottom:16px; line-height:1.2; }
.section-subtitle { font-size:16px; color:#6b7280; max-width:520px; margin:0 auto 60px; line-height:1.7; }
.landing-steps { display:grid; grid-template-columns:repeat(3,1fr); gap:32px; position:relative; }
.landing-steps::before { content:''; position:absolute; top:36px; left:15%; right:15%; height:2px; background:linear-gradient(90deg,#0e9f6e,#f4b942); z-index:0; }
.landing-step { text-align:center; position:relative; z-index:1; background:white; border-radius:16px; padding:32px 24px; box-shadow:0 4px 20px rgba(0,0,0,.06); transition:transform .25s,box-shadow .25s; }
.landing-step:hover { transform:translateY(-6px); box-shadow:0 12px 40px rgba(0,0,0,.1); }
.landing-step-number { width:64px; height:64px; border-radius:50%; background:linear-gradient(135deg,#0e9f6e,#0f172a); color:white; font-size:22px; font-weight:900; display:flex; align-items:center; justify-content:center; margin:0 auto 20px; }
.landing-step-title { font-size:17px; font-weight:700; margin-bottom:10px; color:#0f172a; }
.landing-step-desc { font-size:14px; color:#6b7280; line-height:1.6; }
.loans-bg { background:#0f172a; padding:100px 60px; }
.loans-inner { max-width:1200px; margin:0 auto; }
.loans-title { font-size:clamp(28px,4vw,44px); font-weight:900; color:white; text-align:center; margin-bottom:12px; }
.loans-subtitle { text-align:center; color:rgba(255,255,255,.6); margin-bottom:56px; font-size:16px; }
.loan-cards { display:grid; grid-template-columns:repeat(4,1fr); gap:20px; }
.loan-card { background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.1); border-radius:16px; padding:28px 22px; transition:all .25s; cursor:pointer; text-decoration:none; }
.loan-card:hover { background:rgba(255,255,255,.12); border-color:#6ee7b7; transform:translateY(-4px); }
.loan-icon { width:48px; height:48px; border-radius:12px; background:rgba(26,86,219,.25); display:flex; align-items:center; justify-content:center; font-size:20px; color:#6ee7b7; margin-bottom:16px; }
.loan-name { font-size:16px; font-weight:700; color:white; margin-bottom:8px; }
.loan-desc { font-size:13px; color:rgba(255,255,255,.55); line-height:1.6; margin-bottom:16px; }
.loan-range { font-size:13px; font-weight:700; color:#f4b942; display:flex; align-items:center; gap:6px; }
.features-grid { display:grid; grid-template-columns:1fr 1fr; gap:60px; align-items:center; }
.feature-list { list-style:none; display:flex; flex-direction:column; gap:20px; margin-top:32px; }
.feature-item { display:flex; gap:16px; align-items:flex-start; }
.feature-icon { width:44px; height:44px; min-width:44px; border-radius:10px; background:rgba(26,86,219,.12); display:flex; align-items:center; justify-content:center; font-size:18px; color:#0e9f6e; }
.feature-text h4 { font-size:15px; font-weight:700; margin-bottom:4px; }
.feature-text p { font-size:13px; color:#6b7280; line-height:1.6; }
.features-visual { background:linear-gradient(135deg,#0f172a,#1e293b); border-radius:24px; padding:40px; position:relative; overflow:hidden; }
.features-visual::before { content:''; position:absolute; top:-60px; right:-60px; width:200px; height:200px; background:radial-gradient(circle,rgba(110,231,183,.2),transparent 70%); border-radius:50%; }
.approval-card { background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.15); border-radius:14px; padding:20px; margin-bottom:16px; color:white; }
.approval-title { font-size:13px; color:rgba(255,255,255,.6); margin-bottom:10px; }
.approval-bar-wrap { background:rgba(255,255,255,.1); border-radius:30px; height:8px; overflow:hidden; }
.approval-bar { height:100%; border-radius:30px; background:linear-gradient(90deg,#6ee7b7,#f4b942); width:0; animation:fillBar 2s .5s ease forwards; }
@keyframes fillBar { to { width:87%; } }
.approval-pct { font-size:28px; font-weight:900; color:#f4b942; margin-top:8px; }
.metrics-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:16px; }
.metric-item { background:rgba(255,255,255,.08); border-radius:10px; padding:16px; color:white; text-align:center; }
.metric-val { font-size:22px; font-weight:900; color:#6ee7b7; }
.metric-lbl { font-size:11px; color:rgba(255,255,255,.5); margin-top:2px; }
.cta-section { background:linear-gradient(135deg,#f4b942 0%,#f59e0b 100%); padding:80px 60px; text-align:center; }
.cta-title { font-size:clamp(28px,4vw,48px); font-weight:900; color:#0f172a; margin-bottom:16px; }
.cta-subtitle { font-size:16px; color:rgba(17,24,39,.7); margin-bottom:36px; }
.cta-buttons { display:flex; gap:14px; justify-content:center; flex-wrap:wrap; }
.btn-cta-dark { padding:16px 36px; background:#0f172a; color:white; border-radius:10px; font-size:16px; font-weight:700; text-decoration:none; display:inline-flex; align-items:center; gap:8px; transition:all .25s; }
.btn-cta-outline { padding:16px 36px; background:transparent; color:#0f172a; border:2px solid #0f172a; border-radius:10px; font-size:16px; font-weight:700; text-decoration:none; display:inline-flex; align-items:center; gap:8px; transition:all .25s; }
.btn-cta-outline:hover { background:rgba(0,0,0,.06); }
.landing-footer { background:#0f172a; color:rgba(255,255,255,.6); padding:40px 60px; text-align:center; font-size:13px; }
.landing-footer a { color:#6ee7b7; text-decoration:none; }
.fade-up { opacity:0; transform:translateY(30px); transition:opacity .7s ease,transform .7s ease; }
.fade-up.visible { opacity:1; transform:translateY(0); }
.faq-pill { padding:7px 16px; border-radius:99px; border:1.5px solid #cbd5e1; background:white; color:#475569; font-size:13px; font-weight:600; cursor:pointer; transition:all .2s; display:inline-flex; align-items:center; gap:6px; }
.faq-pill:hover,.faq-pill.active { background:var(--primary); color:white; border-color:var(--primary); }
.landing-faq-item { background:white; border-radius:12px; margin-bottom:10px; border:1.5px solid #e2e8f0; overflow:hidden; transition:box-shadow .2s; }
.landing-faq-item:hover { box-shadow:0 4px 16px rgba(0,0,0,.08); }
.landing-faq-q { display:flex; align-items:center; justify-content:space-between; padding:16px 20px; cursor:pointer; gap:12px; }
.landing-faq-q-text { font-size:14px; font-weight:600; color:#1e293b; line-height:1.4; }
.landing-faq-chevron { color:#94a3b8; transition:transform .25s; flex-shrink:0; }
.landing-faq-item.open .landing-faq-chevron { transform:rotate(180deg); }
.landing-faq-a { display:none; padding:0 20px 16px; font-size:13px; color:#475569; line-height:1.75; border-top:1px solid #f1f5f9; padding-top:14px; }
.landing-faq-item.open .landing-faq-a { display:block; }
@media (max-width:768px) {
  nav.landing-nav { padding:16px 24px; }
  .nav-links { display:none; }
  .landing-hero { padding:100px 24px 60px; }
  .hero-grid { grid-template-columns:1fr; }
  .hero-card-wrap { display:none; }
  .landing-section { padding:60px 24px; }
  .landing-steps { grid-template-columns:1fr; }
  .landing-steps::before { display:none; }
  .loan-cards { grid-template-columns:1fr 1fr; }
  .loans-bg { padding:60px 24px; }
  .features-grid { grid-template-columns:1fr; }
  .cta-section { padding:60px 24px; }
  .landing-footer { padding:32px 24px; }
  .faq-hero h2 { font-size:22px; }
  .faq-hero { padding:36px 20px 28px; }
  .header-links a span { display:none; }
}
@media (max-width:700px) {
  .export-grid { grid-template-columns:1fr; }
  .table-check-grid { grid-template-columns:1fr 1fr; }
}

/* ============================================================
   RESPONSIVE — Mobile First
   Breakpoints:
     480px  — small phones
     768px  — tablets / large phones
     1024px — small laptops
     1200px — desktops
   ============================================================ */

/* ── SIDEBAR HAMBURGER (always hidden on desktop) ── */
#sidebarToggle { display:none !important; }

/* ── 1200px — wide tablets / small desktops ── */
@media (max-width:1200px) {
  .dash-grid       { grid-template-columns:repeat(2,1fr); }
  .b-grid-4        { grid-template-columns:repeat(2,1fr); }
  .loan-cards      { grid-template-columns:repeat(2,1fr); }
  .hero-title      { font-size:clamp(30px,4vw,52px); }
}

/* ── 1024px — tablets landscape ── */
@media (max-width:1024px) {
  .dash-grid       { grid-template-columns:repeat(2,1fr); }
  .dash-grid-2     { grid-template-columns:1fr; }
  .dash-grid-3     { grid-template-columns:1fr; }
  .b-grid-4        { grid-template-columns:repeat(2,1fr); }
  .kpi-grid        { grid-template-columns:repeat(2,1fr); }
  .search-bar input{ width:180px; }
  .export-grid     { grid-template-columns:1fr; }
  .features-grid   { grid-template-columns:1fr; }
  nav.landing-nav  { padding:16px 32px; }
  .landing-hero    { padding:100px 32px 60px; }
  .landing-section { padding:80px 32px; }
  .loans-bg        { padding:80px 32px; }
  .cta-section     { padding:60px 32px; }
}

/* ── 768px — tablets portrait / large phones ── */
@media (max-width:768px) {

  /* SIDEBAR — slide in/out */
  .sidebar {
    position:fixed;
    top:0; left:0;
    height:100vh;
    transform:translateX(-100%);
    z-index:200;
    transition:transform .25s cubic-bezier(.4,0,.2,1);
    box-shadow:none;
  }
  .sidebar.open {
    transform:translateX(0);
    box-shadow:4px 0 24px rgba(0,0,0,.25);
  }
  .main-content { margin-left:0; width:100%; }

  /* Show hamburger button */
  #sidebarToggle { display:flex !important; }

  /* TOPBAR */
  .topbar        { padding:0 12px; }
  .topbar-title  { font-size:14px; }

  /* PAGE CONTENT */
  .page-content  { padding:12px; }

  /* CARDS */
  .card-body     { padding:14px; }
  .card-header   { padding:12px 14px; }

  /* GRIDS */
  .dash-grid            { grid-template-columns:1fr 1fr; }
  .dash-grid-2          { grid-template-columns:1fr; }
  .dash-grid-3          { grid-template-columns:1fr; }
  .due-payments-grid    { grid-template-columns:1fr; }
  .kpi-grid             { grid-template-columns:1fr 1fr; }
  .bp-summary           { grid-template-columns:1fr 1fr; }
  .b-grid-4             { grid-template-columns:1fr 1fr; }
  .loan-card-bp .lc-meta{ grid-template-columns:1fr 1fr; }

  /* TABLES */
  .table-wrapper        { overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .data-table th,
  .data-table td        { padding:9px 10px; font-size:12px; }
  .hide-mobile          { display:none !important; }

  /* SEARCH */
  .search-bar           { flex:1; }
  .search-bar input     { width:100%; }

  /* MODALS — slide up from bottom */
  .modal                { max-width:100%; margin:0; border-radius:var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-overlay        { align-items:flex-end; padding:0; }

  /* FORMS */
  .form-row-2           { grid-template-columns:1fr !important; }
  .form-row-3           { grid-template-columns:1fr !important; }

  /* BUTTONS */
  .btn-group-mobile     { flex-direction:column; width:100%; }
  .btn-group-mobile .btn{ width:100%; justify-content:center; }

  /* AUTH PAGES */
  .auth-wrap, .login-wrap { max-width:100%; padding:16px; }
  .auth-card, .login-card { padding:22px 20px; }

  /* BORROWER PORTAL */
  .b-grid-4             { grid-template-columns:1fr 1fr; }

  /* LANDING PAGE */
  nav.landing-nav       { padding:14px 20px; }
  .nav-links            { display:none; }
  .nav-cta .btn-nav-login { display:none; }
  .landing-hero         { padding:90px 20px 50px; }
  .hero-grid            { grid-template-columns:1fr; gap:32px; }
  .hero-card-wrap       { display:none; }
  .hero-title           { font-size:clamp(28px,8vw,42px); }
  .hero-subtitle        { font-size:15px; }
  .hero-actions         { flex-direction:column; }
  .btn-hero-primary,
  .btn-hero-secondary   { width:100%; justify-content:center; }
  .landing-section      { padding:60px 20px; }
  .landing-steps        { grid-template-columns:1fr; gap:16px; }
  .landing-steps::before{ display:none; }
  .loan-cards           { grid-template-columns:1fr 1fr; gap:14px; }
  .loans-bg             { padding:60px 20px; }
  .features-grid        { grid-template-columns:1fr; gap:32px; }
  .features-visual      { display:none; }
  .cta-section          { padding:50px 20px; }
  .cta-buttons          { flex-direction:column; align-items:center; }
  .btn-cta-dark,
  .btn-cta-outline      { width:100%; max-width:320px; justify-content:center; }
  .landing-footer       { padding:28px 20px; }
  .section-subtitle     { margin-bottom:36px; font-size:14px; }

  /* FAQ */
  .faq-header           { padding:14px 16px; }
  .header-links a span  { display:none; }
  .faq-hero             { padding:40px 16px 28px; }
  .faq-hero h2          { font-size:22px; }
  .faq-body             { padding:0 12px; }
  .faq-q                { padding:14px; }
  .faq-a                { padding-left:14px; padding-right:14px; }
  .faq-q-icon           { display:none; }

  /* DATATABLES mobile */
  .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_length { float:none; text-align:left; margin-bottom:8px; }
  .dataTables_wrapper .dataTables_filter input { width:100%; margin-left:0; margin-top:4px; }
  .dt-top-bar           { flex-direction:column; align-items:flex-start; }
}

/* ── 480px — small phones ── */
@media (max-width:480px) {

  /* LAYOUT */
  .page-content         { padding:10px; }
  .topbar               { padding:0 10px; height:50px; }
  .card-body            { padding:12px; }

  /* GRIDS */
  .dash-grid            { grid-template-columns:1fr; }
  .kpi-grid             { grid-template-columns:1fr; }
  .b-grid-4             { grid-template-columns:1fr; }
  .bp-summary           { grid-template-columns:1fr 1fr; }
  .table-check-grid     { grid-template-columns:1fr 1fr; }

  /* TYPOGRAPHY */
  .kpi-value            { font-size:18px; }
  .metric-value         { font-size:18px; }
  .b-value              { font-size:18px; }

  /* CARDS */
  .kpi-card             { padding:14px; }
  .metric-card          { padding:14px 16px; }

  /* BUTTONS */
  .btn-sm               { font-size:11px; padding:4px 8px; }
  .topbar-title         { font-size:13px; }

  /* LANDING */
  .loan-cards           { grid-template-columns:1fr; }
  .hero-stats           { gap:20px; }
  .stat-number          { font-size:22px; }
  .landing-step         { padding:24px 16px; }
  nav.landing-nav       { padding:12px 16px; }
  .btn-nav-register     { padding:7px 14px; font-size:13px; }

  /* AUTH */
  .login-card, .auth-card { padding:18px 16px; }
  .otp-inputs input     { width:40px; height:50px; font-size:20px; }
  .tab-nav button       { font-size:12px; padding:8px 6px; }

  /* MODAL */
  .modal-header,
  .modal-body,
  .modal-footer         { padding:14px; }

  /* TABLES */
  .data-table th,
  .data-table td        { padding:8px; font-size:11px; }

  /* USER DROPDOWN */
  .user-dropdown-trigger span { display:none; }
  .user-dropdown-trigger { padding:4px 8px 4px 4px; }

  /* BORROWER LOAN CARD */
  .loan-card-bp .lc-meta { grid-template-columns:1fr 1fr; }
  .loan-card-bp          { padding:14px; }
}

/* ── PRINT ── */
@media print {
  .sidebar, .topbar, .btn, .no-print,
  #sidebarToggle, .sidebar-overlay    { display:none !important; }
  .main-content  { margin:0; }
  .page-content  { padding:0; }
  .card          { box-shadow:none; border:1px solid #ccc; }
  body           { background:white; }
}

/* ============================================================
   MOBILE NAV HAMBURGER ANIMATION
   ============================================================ */
#sidebarToggle i { transition:transform .2s; }
.sidebar.open ~ .main-content #sidebarToggle i { transform:rotate(90deg); }

/* ============================================================
   TOUCH IMPROVEMENTS
   ============================================================ */
@media (hover:none) and (pointer:coarse) {
  /* Bigger tap targets on touch devices */
  .sidebar-nav li a   { padding:12px 16px; }
  .btn                { min-height:40px; }
  .form-control       { min-height:42px; font-size:16px; } /* prevents iOS zoom */
  .dropdown-item      { padding:13px 16px; }
  .dataTables_paginate .paginate_button { padding:8px 12px !important; }
}

/* ============================================================
   UTILITY — hide/show per screen
   ============================================================ */
.hide-mobile  { }
.show-mobile  { display:none; }
@media (max-width:768px) {
  .hide-mobile { display:none !important; }
  .show-mobile { display:block !important; }
  .show-mobile-flex { display:flex !important; }
}
.hide-desktop { display:none; }
@media (min-width:769px) {
  .hide-desktop { display:none !important; }
}

/* ============================================================
   MOBILE TABLE RESPONSIVE — comprehensive fixes
   ============================================================ */

/* --- Base: always scrollable wrapper for ALL tables --- */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  display: block;
}

/* Inline/detail tables that lack a wrapper get overflow on parent */
.card-body > table,
.card-body > div > table {
  max-width: 100%;
  overflow-x: auto;
  display: block;
}

/* DataTables Responsive — style child rows (expanded details) */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::before {
  background-color: var(--primary, #16a34a);
  border-color: var(--primary, #16a34a);
  border-radius: 50%;
  box-shadow: none;
}
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th.dtr-control::before {
  background-color: #e11d48;
  border-color: #e11d48;
}
table.dataTable > tbody > tr.child ul.dtr-details {
  width: 100%;
  padding: 0;
}
table.dataTable > tbody > tr.child ul.dtr-details li {
  padding: 7px 0;
  border-bottom: 1px solid var(--gray-100, #f1f5f9);
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
table.dataTable > tbody > tr.child ul.dtr-details li:last-child { border-bottom: none; }
table.dataTable > tbody > tr.child ul.dtr-details span.dtr-title {
  font-weight: 600;
  color: var(--gray-500, #64748b);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  min-width: 110px;
  flex-shrink: 0;
}
table.dataTable > tbody > tr.child { background: #f8faff; }
table.dataTable > tbody > tr.child td { padding: 10px 14px; }

/* DataTables filter full-width on mobile */
@media (max-width: 768px) {
  .dataTables_wrapper .dataTables_filter { width: 100%; }
  .dataTables_wrapper .dataTables_filter input { width: 100%; margin-left: 0; box-sizing: border-box; }
  .dataTables_wrapper .dataTables_length { width: 100%; }
  .dataTables_wrapper .dataTables_info  { font-size: 11px; }
  .dt-top-bar { padding: 10px 12px; gap: 8px; }

  /* Non-DataTables tables: force scroll */
  .table-wrapper { border-radius: 8px; }
  table.data-table,
  table[style*="border-collapse"] {
    min-width: 480px; /* prevents squish; enables scroll */
  }

  /* Make inline style tables scrollable by wrapping */
  .card-body table:not(.data-table):not(.dt-table) {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  /* receipt / contract / run_backup inline tables */
  .card table,
  .modal table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Pagination stacking */
  .dataTables_wrapper .dataTables_paginate {
    float: none;
    text-align: center;
    margin-top: 8px;
  }
  .dataTables_paginate .paginate_button {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  /* DataTables info centering */
  .dataTables_wrapper .dataTables_info {
    float: none;
    text-align: center;
    margin-top: 6px;
  }

  /* Borrower-portal schedule / history specific */
  .table-wrapper[style*="display:block"],
  .table-wrapper[style*="display: block"] {
    display: block !important;
  }
}

@media (max-width: 480px) {
  table.data-table,
  table.dt-table,
  table[style*="border-collapse"] {
    min-width: 380px;
  }

  /* Compact padding for very small phones */
  .data-table th,
  .data-table td { padding: 7px 8px; font-size: 11px; }

  table.dataTable thead th { padding: 8px 10px; font-size: 10px; }
  table.dataTable tbody td { padding: 8px 10px; font-size: 11px; }

  /* Stack DT top bar fully */
  .dt-top-bar { flex-direction: column; align-items: stretch; }
  .dataTables_filter,
  .dataTables_length { width: 100% !important; text-align: left !important; }
  .dataTables_filter label,
  .dataTables_length label { width: 100%; }

  /* Paginate buttons smaller */
  .dataTables_paginate .paginate_button { padding: 5px 8px !important; font-size: 11px !important; margin: 1px; }
}

/* Scrollbar style for table-wrapper on touch */
.table-wrapper::-webkit-scrollbar { height: 4px; }
.table-wrapper::-webkit-scrollbar-track { background: var(--gray-100, #f1f5f9); border-radius: 4px; }
.table-wrapper::-webkit-scrollbar-thumb { background: var(--gray-300, #cbd5e1); border-radius: 4px; }

