/* Lending Genie Partner Portal — shared design system
   Tokens pulled from Figma file Jle39lI6giFZhsAGU1grwD (UAT - PQ Portal Design) */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

:root {
  /* Brand indigo — Bg-Button-Default / Icon-Strong / Link-Default / Nav-Selected */
  --indigo-50:   #EEF0FE;          /* approx 5% of brand on white */
  --indigo-100:  #E0E4FD;
  --indigo-200:  #C7CEFB;
  --indigo-300:  #A5AFF7;
  --indigo-500:  #6271EB;          /* brand */
  --indigo-600:  #6271EB;          /* brand */
  --indigo-700:  #4B59C9;          /* Bg-Hilight Card (deeper indigo, used in hero) */
  --indigo-900:  #2A2F66;
  --indigo-10a:  rgba(98, 113, 235, 0.10);  /* Nav-Bg-Selected */

  /* Neutral surfaces */
  --bg:          #F7F9FA;          /* Surface-Default */
  --bg-page:     #FDFDFD;          /* Bg-Default */
  --sidebar-bg:  #FFFFFF;
  --card-bg:     #FFFFFF;          /* Bg-Card */
  --card-disable:#F2F4F7;          /* Bg-Card-Disable / Bg-Tab-Default */

  /* Borders */
  --border:      #D0D5DD;          /* Stroke-Hard */
  --hairline:    #F3F3F3;          /* Divider-Soft */
  --stroke-soft: #F8F9FA;          /* Stroke-Soft */

  /* Text */
  --text:        #010101;          /* Text-Strong */
  --text-muted:  #93989A;          /* Text-Soft */
  --text-soft:   #B7BFCA;          /* Icon-Soft / tertiary text */

  /* Status */
  --green-bg:    #E6F7DC;          /* Bg-Success 200 */
  --green-text:  #4A9A22;          /* darker success for text legibility */
  --green-500:   #60BE2C;          /* Utility/Success 500 */
  --red-bg:      #FEE3E2;          /* Bg-Error 100 */
  --red-text:    #C53A38;          /* darker error for text legibility */
  --red-500:     #FA716F;          /* Utility/Error 500 / Notification-Red */
  --amber-bg:    #FFF7E9;          /* Bg-Warning 50 */
  --amber-text:  #B27510;          /* darker warning for text legibility */
  --amber-500:   #FFA923;          /* Utility/Warning 500 */
  --gray-bg:     #F7F9FA;          /* Bg-Icon (neutral icon container) */
  --gray-text:   #93989A;

  /* Shadows */
  --shadow-sm:   0 1px 2px rgba(16, 24, 40, 0.05);    /* Drop Shadow/Card XS */
  --shadow:      0 2px 4px -2px rgba(16, 24, 40, 0.06), 0 4px 8px -2px rgba(16, 24, 40, 0.10);  /* Drop Shadow/Card M */
  --shadow-md:   0 2px 4px -2px rgba(16, 24, 40, 0.06), 0 4px 8px -2px rgba(16, 24, 40, 0.10);
  --shadow-icon: 1px 1px 4px rgba(68, 76, 127, 0.35); /* Bg-Icon-DShadow */

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
}

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

html, body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ===== Layout ===== */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--hairline);
  padding: 24px 16px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 28px;
}
.brand-mark {
  width: 38px; height: 38px; flex-shrink: 0;
  background: linear-gradient(135deg, #16A34A 0%, #059669 100%);
  border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}
.brand-mark svg { color: white; width: 22px; height: 22px; }
.brand-name {
  font-size: 15px; font-weight: 700; color: var(--text);
  letter-spacing: -0.01em; line-height: 1;
}
.brand-poweredby {
  font-size: 10px; font-weight: 500;
  color: var(--text-soft); letter-spacing: 0.06em;
  margin-top: 4px;
}
.brand-poweredby b { color: var(--indigo-600); font-weight: 600; letter-spacing: 0.04em; }

.nav-label {
  font-size: 11px; font-weight: 700;
  color: var(--text); padding: 0 12px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px; font-weight: 500;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
  cursor: pointer;
}
.nav-item:hover { background: var(--hairline); color: var(--text); }
.nav-item.active {
  background: var(--indigo-50);
  color: var(--indigo-700);
  font-weight: 600;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  padding: 16px 8px 0;
  font-size: 11px; color: var(--text-soft);
  border-top: 1px solid var(--hairline);
  padding-top: 14px;
}
.sidebar-footer .label { color: var(--text-soft); margin-bottom: 4px; }
.sidebar-footer .partner-status {
  display: flex; align-items: center; gap: 6px;
  color: var(--text); font-weight: 600; font-size: 12px;
}
.sidebar-footer .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green-500);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

/* ===== Topbar ===== */
.main { background: var(--bg); }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 40px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--hairline);
}
.topbar h1 {
  font-size: 26px; font-weight: 700; letter-spacing: -0.01em;
}
.topbar h1 b { font-weight: 800; }
.topbar .crumb {
  font-size: 13px; color: var(--text-muted); margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.topbar .crumb a { color: var(--indigo-600); font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--indigo-600); color: #fff;
  box-shadow: 0 1px 2px rgba(91, 95, 233, 0.2);
}
.btn-primary:hover { background: var(--indigo-700); }
.btn-outline {
  background: #fff; color: var(--indigo-600);
  border-color: var(--indigo-300);
}
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn svg { width: 14px; height: 14px; }

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo-300), var(--indigo-600));
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 13px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--indigo-100);
}
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }

/* ===== Content ===== */
.content { padding: 24px 40px 60px; }

/* ===== Cards ===== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: space-between;
}
.card-head h3 {
  font-size: 15px; font-weight: 700;
}
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.card-sub { font-size: 13px; color: var(--text-muted); }

/* ===== Section title ===== */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 22px 0 12px;
}
.section-head h2 {
  font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
}
.section-head h2 small {
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  margin-left: 8px;
}
.section-head .link {
  color: var(--indigo-600); font-size: 13px; font-weight: 600;
}

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge.green { background: var(--green-bg); color: var(--green-text); }
.badge.red   { background: var(--red-bg);   color: var(--red-text); }
.badge.amber { background: var(--amber-bg); color: var(--amber-text); }
.badge.gray  { background: var(--gray-bg);  color: var(--gray-text); }
.badge.indigo{ background: var(--indigo-50); color: var(--indigo-600); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ===== Impact pills (Solutions Center · Remarks) ===== */
.impact-pill {
  display: inline-flex; align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: 1px;
}
.impact-pill.high { background: var(--red-bg);   color: var(--red-500); }
.impact-pill.mid  { background: var(--amber-bg); color: var(--amber-500); }
.impact-pill.low  { background: var(--green-bg); color: var(--green-500); }

/* ===== KPI tiles ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--card-bg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.kpi-label {
  font-size: 12px; color: var(--text-muted);
  font-weight: 500; margin-bottom: 8px;
  display: flex; align-items: center; gap: 7px;
}
.kpi-icon {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--indigo-50);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--indigo-600);
}
.kpi-icon svg { width: 14px; height: 14px; }
.kpi-value {
  font-size: 28px; font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.kpi-delta {
  font-size: 12px; font-weight: 600;
  margin-top: 6px;
  display: inline-flex; align-items: center; gap: 4px;
}
.kpi-delta.up { color: var(--green-text); }
.kpi-delta.down { color: var(--red-text); }
.kpi-delta.neutral { color: var(--text-muted); }

/* ===== Hero card ===== */
.hero {
  background: var(--indigo-700);  /* Bg-Hilight Card #4B59C9 */
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  color: white;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40%; right: -10%;
  width: 60%; height: 180%;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.04) 50%, transparent 60%);
  transform: rotate(20deg);
  pointer-events: none;
}
.hero h2 {
  font-size: 22px; font-weight: 800;
  letter-spacing: -0.01em; margin-bottom: 8px;
  position: relative;
}
.hero p {
  color: rgba(255,255,255,0.75);
  font-size: 13px; line-height: 1.6;
  max-width: 520px;
  position: relative;
}

/* ===== Tables ===== */
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px; font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--hairline);
  background: #FBFCFD;
}
.tbl tbody td {
  padding: 14px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: #FBFCFD; }
.tbl .name { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.tbl .num { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ===== Tabs (pill row) ===== */
.tabs {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 4px;
  box-shadow: var(--shadow-sm);
}
.tab {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}
.tab.active { background: var(--indigo-600); color: white; }

/* ===== Filter / search ===== */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.search {
  display: flex; align-items: center; gap: 8px;
  background: white;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  flex: 1; max-width: 360px;
  box-shadow: var(--shadow-sm);
}
.search svg { width: 15px; height: 15px; color: var(--text-soft); }
.search input {
  border: none; outline: none; flex: 1;
  font-family: inherit; font-size: 13px; background: transparent;
}
.filter-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  background: white; border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.filter-btn svg { width: 14px; height: 14px; color: var(--text-muted); }

/* ===== Service rows / approval rows ===== */
.svc-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
}
.svc-row:last-child { border-bottom: none; }
.svc-row .left { display: flex; align-items: center; gap: 12px; }
.svc-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--indigo-50);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--indigo-600);
  flex-shrink: 0;
}
.svc-icon svg { width: 18px; height: 18px; }
.svc-icon.green { background: var(--green-bg); color: var(--green-text); }
.svc-icon.red { background: var(--red-bg); color: var(--red-text); }
.svc-icon.amber { background: var(--amber-bg); color: var(--amber-text); }
.svc-meta { font-size: 13px; }
.svc-meta .name { font-weight: 700; color: var(--text); }
.svc-meta .sub { color: var(--text-muted); font-size: 12px; margin-top: 1px; }
.svc-row .right { text-align: right; font-size: 13px; }
.svc-row .right .amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.svc-row .right .meta { color: var(--text-muted); font-size: 12px; }

/* ===== Redaction styling ===== */
.redacted {
  display: inline-block;
  background: repeating-linear-gradient(
    -45deg, var(--gray-bg), var(--gray-bg) 4px,
    #E2E8F0 4px, #E2E8F0 8px);
  color: var(--text-soft);
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 1px dashed #CBD5E1;
}
.mask {
  font-family: ui-monospace, SFMono-Regular, monospace;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* ===== Misc ===== */
.divider {
  height: 1px; background: var(--hairline); margin: 14px 0;
}
.col-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.col-2-eq { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.col-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ===== Funnel viz ===== */
.funnel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.funnel-step {
  background: white;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 14px 14px;
  position: relative;
}
.funnel-step .label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.funnel-step .v { font-size: 22px; font-weight: 800; margin: 4px 0 2px; }
.funnel-step .pct { font-size: 12px; color: var(--green-text); font-weight: 600; }
.funnel-step .bar { height: 4px; background: var(--indigo-100); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.funnel-step .bar-fill { height: 100%; background: var(--indigo-600); border-radius: 2px; }

/* ===== Bar chart ===== */
.bars {
  display: flex; gap: 12px;
  height: 200px;
  padding: 16px 4px 0;
}
.bar-col {
  flex: 1; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  justify-content: flex-end;
}
.bar-rect {
  width: 100%; max-width: 32px;
  background: linear-gradient(180deg, var(--indigo-500) 0%, var(--indigo-700) 100%);
  border-radius: 6px 6px 0 0;
  position: relative;
  min-height: 4px;
}
.bar-col.muted .bar-rect { background: var(--gray-bg); }
.bar-col .bar-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.bar-col .bar-val { font-size: 11px; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ===== Gauge meter ===== */
.gauge { position: relative; width: 220px; margin: 0 auto; }
.gauge-num {
  position: absolute; top: 56%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.gauge-num .v { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; }
.gauge-num .l { font-size: 12px; color: var(--green-text); font-weight: 700; }

/* ===== Code box / link ===== */
.linkbox {
  display: flex; align-items: center; gap: 8px;
  background: var(--gray-bg); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px; color: var(--text);
}
.linkbox .url { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: white; border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 10px;
  font-size: 11px; font-weight: 600; cursor: pointer;
  font-family: inherit;
  color: var(--indigo-600);
}

/* ===== Index gallery ===== */
.gallery {
  max-width: 980px; margin: 60px auto;
  padding: 0 20px;
}
.gallery h1 {
  font-size: 32px; font-weight: 800; letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.gallery > p { color: var(--text-muted); margin-bottom: 32px; }
.screen-list {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.screen-card {
  background: white; border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
  transition: box-shadow .15s, transform .15s;
}
.screen-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.screen-card .num {
  font-size: 12px; color: var(--indigo-600); font-weight: 700;
  letter-spacing: 0.1em;
}
.screen-card h3 { font-size: 18px; font-weight: 700; }
.screen-card p { font-size: 13px; color: var(--text-muted); }
