/* LoanOfficer Pro - Premium Banking App */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --navy: #1e3a5f;
  --navy-dark: #152a45;
  --navy-light: #2a4d7a;
  --gold: #d4a853;
  --gold-light: #e8c882;
  --white: #ffffff;
  --gray-50: #f8f9fa;
  --gray-100: #f0f2f5;
  --gray-200: #e2e6ea;
  --gray-300: #ced4da;
  --gray-500: #6c757d;
  --gray-700: #495057;
  --green: #28a745;
  --red: #dc3545;
  --orange: #fd7e14;
  --blue: #007bff;
  --sidebar-w: 260px;
  --header-h: 64px;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--gray-100); color: var(--gray-700); min-height: 100vh; display: flex; }

/* Sidebar */
.sidebar { width: var(--sidebar-w); background: linear-gradient(180deg, var(--navy-dark), var(--navy)); color: var(--white); position: fixed; top: 0; left: 0; height: 100vh; z-index: 100; display: flex; flex-direction: column; transition: transform .3s; }
.sidebar-brand { padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; gap: 12px; }
.sidebar-brand .logo { width: 40px; height: 40px; background: var(--gold); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; color: var(--navy-dark); }
.sidebar-brand h1 { font-size: 1.1rem; font-weight: 700; letter-spacing: -.5px; }
.sidebar-brand small { font-size: .7rem; color: var(--gold-light); display: block; font-weight: 400; }
.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 16px; color: rgba(255,255,255,.65); text-decoration: none; border-radius: 8px; font-size: .9rem; font-weight: 500; transition: all .2s; margin-bottom: 2px; }
.sidebar-nav a:hover { background: rgba(255,255,255,.08); color: var(--white); }
.sidebar-nav a.active { background: rgba(212,168,83,.15); color: var(--gold); }
.sidebar-nav a i { width: 20px; text-align: center; font-size: 1rem; }
.sidebar-nav .nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.3); padding: 16px 16px 6px; font-weight: 600; }
.sidebar-user { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; gap: 12px; }
.sidebar-user .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gold); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--navy-dark); font-size: .85rem; }
.sidebar-user .user-info { font-size: .8rem; }
.sidebar-user .user-name { font-weight: 600; color: var(--white); }
.sidebar-user .user-role { color: rgba(255,255,255,.5); font-size: .7rem; }

/* Main Content */
.main { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; }
.topbar { height: var(--header-h); background: var(--white); border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; position: sticky; top: 0; z-index: 50; }
.topbar h2 { font-size: 1.2rem; font-weight: 700; color: var(--navy); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-right .btn-icon { width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--gray-100); color: var(--gray-500); cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.topbar-right .btn-icon:hover { background: var(--navy); color: var(--white); }
.menu-toggle { display: none; background: none; border: none; color: var(--navy); font-size: 1.3rem; cursor: pointer; }
.content { padding: 28px 32px; }

/* Cards */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-header h3 { font-size: 1rem; font-weight: 700; color: var(--navy); }

/* Stats Row */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 28px; }
.stat-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.stat-icon.blue { background: rgba(0,123,255,.1); color: var(--blue); }
.stat-icon.green { background: rgba(40,167,69,.1); color: var(--green); }
.stat-icon.gold { background: rgba(212,168,83,.15); color: var(--gold); }
.stat-icon.navy { background: rgba(30,58,95,.1); color: var(--navy); }
.stat-info h4 { font-size: .75rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.stat-info .stat-value { font-size: 1.6rem; font-weight: 700; color: var(--navy); }
.stat-info .stat-change { font-size: .75rem; margin-top: 2px; }
.stat-change.up { color: var(--green); }
.stat-change.down { color: var(--red); }

/* Pipeline */
.pipeline { display: flex; gap: 16px; margin-bottom: 28px; overflow-x: auto; padding-bottom: 8px; }
.pipeline-stage { flex: 1; min-width: 180px; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.pipeline-stage-header { padding: 14px 16px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; display: flex; align-items: center; justify-content: space-between; }
.pipeline-stage-header .count { background: rgba(255,255,255,.3); padding: 2px 10px; border-radius: 20px; font-size: .75rem; }
.stage-lead { background: var(--gray-50); }
.stage-lead .pipeline-stage-header { background: var(--gray-300); color: var(--gray-700); }
.stage-applied { }
.stage-applied .pipeline-stage-header { background: var(--blue); color: var(--white); }
.stage-processing { }
.stage-processing .pipeline-stage-header { background: var(--orange); color: var(--white); }
.stage-approved { }
.stage-approved .pipeline-stage-header { background: var(--green); color: var(--white); }
.stage-closed { }
.stage-closed .pipeline-stage-header { background: var(--navy); color: var(--white); }
.pipeline-card { padding: 12px 16px; margin: 8px; background: var(--white); border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.06); border-left: 3px solid var(--gray-300); }
.stage-applied .pipeline-card { border-left-color: var(--blue); }
.stage-processing .pipeline-card { border-left-color: var(--orange); }
.stage-approved .pipeline-card { border-left-color: var(--green); }
.stage-closed .pipeline-card { border-left-color: var(--navy); }
.pipeline-card .name { font-weight: 600; font-size: .85rem; color: var(--navy); }
.pipeline-card .amount { font-size: .75rem; color: var(--gray-500); margin-top: 2px; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 12px 16px; font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-500); font-weight: 600; border-bottom: 2px solid var(--gray-200); }
td { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); font-size: .88rem; }
tr:hover td { background: var(--gray-50); }
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: .72rem; font-weight: 600; }
.badge-green { background: rgba(40,167,69,.1); color: var(--green); }
.badge-blue { background: rgba(0,123,255,.1); color: var(--blue); }
.badge-orange { background: rgba(253,126,20,.1); color: var(--orange); }
.badge-gray { background: var(--gray-100); color: var(--gray-500); }
.badge-navy { background: rgba(30,58,95,.1); color: var(--navy); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 8px; border: none; font-family: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; transition: all .2s; text-decoration: none; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-light); }
.btn-gold { background: var(--gold); color: var(--navy-dark); }
.btn-gold:hover { background: var(--gold-light); }
.btn-outline { background: transparent; border: 2px solid var(--gray-200); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }
.btn-sm { padding: 6px 14px; font-size: .8rem; }

/* Calculator */
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.calc-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.calc-card-header { padding: 20px 24px; background: var(--navy); color: var(--white); }
.calc-card-header h3 { font-size: 1rem; font-weight: 700; }
.calc-card-header p { font-size: .78rem; color: rgba(255,255,255,.7); margin-top: 4px; }
.calc-card-body { padding: 24px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: .8rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.form-group input, .form-group select { width: 100%; padding: 10px 14px; border: 2px solid var(--gray-200); border-radius: 8px; font-family: inherit; font-size: .9rem; transition: border-color .2s; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--gold); }
.calc-result { margin-top: 20px; padding: 20px; background: linear-gradient(135deg, var(--navy), var(--navy-light)); border-radius: 10px; color: var(--white); text-align: center; }
.calc-result .result-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: rgba(255,255,255,.7); }
.calc-result .result-value { font-size: 2rem; font-weight: 700; margin-top: 4px; }
.calc-result .result-detail { font-size: .78rem; color: rgba(255,255,255,.6); margin-top: 6px; }
.calc-breakdown { margin-top: 16px; }
.calc-breakdown .row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--gray-100); font-size: .85rem; }
.calc-breakdown .row:last-child { border-bottom: none; }
.calc-breakdown .row .label { color: var(--gray-500); }
.calc-breakdown .row .value { font-weight: 600; color: var(--navy); }

/* Pre-qual Form */
.prequal-form { max-width: 700px; margin: 0 auto; }
.form-section { margin-bottom: 28px; }
.form-section h3 { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--gold); display: inline-block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.prequal-result { text-align: center; padding: 40px; }
.prequal-result .checkmark { width: 64px; height: 64px; background: rgba(40,167,69,.1); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.8rem; color: var(--green); margin-bottom: 16px; }
.prequal-result h3 { font-size: 1.3rem; color: var(--navy); margin-bottom: 8px; }
.prequal-result .amount { font-size: 2.5rem; font-weight: 700; color: var(--gold); margin: 12px 0; }

/* Clients */
.client-row { display: flex; align-items: center; gap: 12px; }
.client-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: var(--white); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: .8rem; }
.client-info .client-name { font-weight: 600; color: var(--navy); }
.client-info .client-email { font-size: .78rem; color: var(--gray-500); }
.search-box { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 2px solid var(--gray-200); border-radius: 8px; background: var(--white); }
.search-box input { border: none; outline: none; font-family: inherit; font-size: .88rem; flex: 1; }
.search-box i { color: var(--gray-500); }

/* Activity */
.activity-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--gray-100); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.activity-dot.green { background: var(--green); }
.activity-dot.blue { background: var(--blue); }
.activity-dot.orange { background: var(--orange); }
.activity-dot.gold { background: var(--gold); }
.activity-text { font-size: .85rem; color: var(--gray-700); }
.activity-time { font-size: .75rem; color: var(--gray-500); margin-top: 2px; }

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }

/* Mobile overlay */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; }
.sidebar-overlay.show { display: block; }

/* Responsive */
@media (max-width: 1024px) {
  .grid-2 { grid-template-columns: 1fr; }
  .pipeline { flex-direction: column; }
  .pipeline-stage { min-width: auto; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .content { padding: 20px 16px; }
  .topbar { padding: 0 16px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .calc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
}
