/* ==========================================================================
   SLT HomeLoan Pro - Design System & Modern Fintech Stylesheet
   ========================================================================== */

:root {
  --bg-base: #070b14;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(22, 33, 58, 0.85);
  --bg-input: rgba(8, 14, 28, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #00f0ff;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --cyan: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.25);
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.25);
  --amber: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.25);
  --purple: #a855f7;
  --purple-glow: rgba(168, 85, 247, 0.25);
  --rose: #f43f5e;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  --shadow-glow: 0 0 25px var(--cyan-glow);
  
  --font-sans: 'Prompt', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Light Theme Variables */
body.light-theme {
  --bg-base: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #ffffff;
  --bg-input: #f8fafc;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: #0284c7;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  
  --cyan: #0284c7;
  --cyan-glow: rgba(2, 132, 199, 0.15);
  --emerald: #059669;
  --amber: #d97706;
  --purple: #9333ea;
  
  --shadow-card: 0 10px 25px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Radial Glow Background */
body::before {
  content: "";
  position: fixed;
  top: -10vw;
  left: 20%;
  width: 60vw;
  height: 40vw;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.07) 0%, rgba(168, 85, 247, 0.04) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(7, 11, 20, 0.85);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
}

body.light-theme .app-header {
  background: rgba(255, 255, 255, 0.85);
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 15px var(--cyan-glow);
}

.brand-text h1 {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.2;
}

.brand-text p {
  font-size: 12.5px;
  color: var(--text-muted);
}

.badge-domain {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  background: rgba(0, 240, 255, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   BUTTONS & CHIPS
   ========================================================================== */
.btn {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  user-select: none;
}

.btn-preset {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(168, 85, 247, 0.2));
  border: 1.5px solid var(--cyan);
  color: #fff;
  box-shadow: 0 0 15px var(--cyan-glow);
}

body.light-theme .btn-preset {
  color: var(--text-main);
}

.btn-preset:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.35), rgba(168, 85, 247, 0.35));
  box-shadow: 0 0 20px var(--cyan-glow);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--text-muted);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-sm {
  font-size: 12px;
  padding: 5px 12px;
}

.btn-subtle {
  background: rgba(0, 240, 255, 0.1);
  color: var(--cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.btn-subtle:hover {
  background: rgba(0, 240, 255, 0.2);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.3);
}

/* Quick Chips */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-color: var(--text-muted);
}

.chip.active-chip {
  background: rgba(0, 240, 255, 0.15);
  color: var(--cyan);
  border-color: var(--cyan);
  font-weight: 600;
}

/* ==========================================================================
   LAYOUT CONTAINERS
   ========================================================================== */
.main-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  z-index: 1;
}

/* KPI Banner */
.kpi-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
}

.kpi-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--cyan);
}

.kpi-card.highlight-payment::after { background: var(--emerald); }
.kpi-card.highlight-prepay::after { background: var(--amber); }
.kpi-card.highlight-balance::after { background: var(--purple); }

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.kpi-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.tag-green { background: rgba(16, 185, 129, 0.15); color: var(--emerald); }
.tag-amber { background: rgba(245, 158, 11, 0.15); color: var(--amber); }
.tag-cyan { background: rgba(0, 240, 255, 0.15); color: var(--cyan); }

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.kpi-value small {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Workspace 2-Column Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
  align-items: flex-start;
}

@media (max-width: 1080px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   CONFIG CARDS & FORMS (LEFT COLUMN)
   ========================================================================== */
.controls-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.config-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-main);
}

.title-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.label-badge {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  font-size: 14px;
  pointer-events: none;
}

.text-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.text-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 10px var(--cyan-glow);
}

/* Range Slider */
.range-slider {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  outline: none;
  margin-top: 10px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan-glow);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider-amber::-webkit-slider-thumb {
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber-glow);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hint-text {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Rate Tiers Rows */
.preset-package-row {
  margin-bottom: 14px;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.preset-label {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.rate-tiers-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.rate-tier-row {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr 40px;
  gap: 10px;
  align-items: center;
}

.tier-col label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.tier-col input {
  width: 100%;
  padding: 6px 10px;
  font-size: 13.5px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-weight: 600;
}

.tier-col input:focus {
  border-color: var(--cyan);
  outline: none;
}

.tier-del-btn {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 63, 94, 0.1);
  color: var(--rose);
  border: 1px solid rgba(244, 63, 94, 0.2);
  border-radius: 6px;
  cursor: pointer;
  margin-top: 14px;
  transition: all 0.2s ease;
}

.tier-del-btn:hover {
  background: rgba(244, 63, 94, 0.25);
}

/* Custom Checkbox */
.rounding-options {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border: 1px solid var(--border-color);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--text-muted);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.15s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--cyan);
  border-color: var(--cyan);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: "✔";
  color: #000;
  font-size: 12px;
  font-weight: 800;
}

.checkbox-text strong {
  display: block;
  font-size: 12.5px;
  color: var(--text-main);
}

.checkbox-text small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.2s;
  border-radius: var(--radius-full);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--amber);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.collapsed {
  display: none !important;
}

.section-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Prepay Mode Segmented Tabs */
.prepay-mode-tabs {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
}

.btn-mode-tab {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-mode-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-mode-tab.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(16, 185, 129, 0.18));
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.target-result-callout {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.08), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.target-callout-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.target-callout-item strong {
  font-family: var(--font-mono);
  font-weight: 700;
}

.btn-accent {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(0, 240, 255, 0.25));
  border: 1.5px solid var(--emerald);
  color: #fff;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
}

body.light-theme .btn-accent {
  color: var(--text-main);
}

.btn-accent:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.4), rgba(0, 240, 255, 0.4));
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   RESULTS COLUMN & TABS (RIGHT COLUMN)
   ========================================================================== */
.results-column {
  display: flex;
  flex-direction: column;
}

.results-nav-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  overflow-x: auto;
}

.nav-tab {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.nav-tab.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 15px var(--cyan-glow);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-header-box {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(22, 33, 58, 0.8));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 18px;
}

.tab-header-box h3 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.tab-header-box p {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Step-up Summary Cards */
.step-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.step-card.tier-active {
  border-color: rgba(0, 240, 255, 0.4);
}

.step-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.15);
  color: var(--cyan);
  margin-bottom: 8px;
}

.step-rate-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.step-pmt-val {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--emerald);
  margin: 6px 0;
}

.step-pmt-val small {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.step-details-list {
  font-size: 12px;
  color: var(--text-muted);
  list-style: none;
  margin-top: 8px;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
}

.step-details-list li {
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.step-details-list strong {
  font-family: var(--font-mono);
  color: var(--text-main);
}

/* Comparison Hero Matrix (Page 2) */
.comparison-hero-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.compare-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  box-shadow: var(--shadow-card);
}

.compare-hero-card.highlight-winner {
  border: 1.5px solid var(--amber);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(15, 23, 42, 0.9));
  box-shadow: 0 0 25px var(--amber-glow);
}

.compare-hero-header {
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.compare-hero-stat {
  margin-bottom: 14px;
}

.compare-hero-stat .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}

.compare-hero-stat .stat-num {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-mono);
}

/* ==========================================================================
   DATA TABLES
   ========================================================================== */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.table-card-header {
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
}

.table-card-header h4 {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.data-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-family: var(--font-sans);
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.data-table .col-num {
  font-family: var(--font-mono);
  font-weight: 600;
}

.comparison-table td:nth-child(2) { color: var(--text-muted); }
.comparison-table td:nth-child(3) { color: var(--amber); font-weight: 700; }
.comparison-table td:nth-child(4) { color: var(--emerald); font-weight: 800; }

/* ==========================================================================
   CHARTS
   ========================================================================== */
.charts-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.charts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.charts-header h4 {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-legend-custom {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-normal { background: #38bdf8; }
.dot-prepay { background: #f59e0b; }

.chart-wrapper {
  position: relative;
  width: 100%;
  min-height: 280px;
}

.dual-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 840px) {
  .dual-charts-row {
    grid-template-columns: 1fr;
  }
}

.chart-sub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.chart-sub-card h5 {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   WISDOM CARD (FROM PDF PAGES 2 & 3)
   ========================================================================== */
.wisdom-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(24, 20, 48, 0.95));
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px var(--amber-glow);
}

.wisdom-header h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--amber);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.wisdom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.wisdom-item {
  display: flex;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.wisdom-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.wisdom-content strong {
  display: block;
  font-size: 13px;
  color: #fff;
  margin-bottom: 4px;
}

.wisdom-content p {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.5;
}

/* ==========================================================================
   AMORTIZATION SCHEDULE SECTION
   ========================================================================== */
.schedule-section {
  margin-bottom: 40px;
}

.schedule-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.schedule-title-group h3 {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.schedule-title-group p {
  font-size: 12px;
  color: var(--text-muted);
}

.schedule-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.view-mode-group {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.btn-view-mode {
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}

.btn-view-mode.active {
  background: rgba(0, 240, 255, 0.2);
  color: var(--cyan);
  font-weight: 700;
}

.schedule-actions {
  display: flex;
  gap: 8px;
}

.select-input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 6px 12px;
  font-size: 12.5px;
  font-family: var(--font-sans);
  outline: none;
}

.schedule-table-wrapper {
  max-height: 600px;
}

.schedule-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0d1527;
}

body.light-theme .schedule-table th {
  background: #e2e8f0;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.app-footer {
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
  background: rgba(7, 11, 20, 0.95);
  margin-top: 40px;
}

body.light-theme .app-footer {
  background: rgba(255, 255, 255, 0.95);
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-dim);
}

.footer-links a {
  color: var(--cyan);
  text-decoration: none;
  margin-left: 6px;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   PRINT STYLESHEET (PROFESSIONAL REPORT FOR USER & BANK)
   ========================================================================== */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  
  .app-header, .controls-column, .results-nav-tabs, .schedule-controls, .app-footer, .header-actions {
    display: none !important;
  }
  
  .workspace-grid {
    display: block !important;
  }
  
  .kpi-banner {
    grid-template-columns: repeat(4, 1fr) !important;
    page-break-inside: avoid;
  }
  
  .kpi-card, .table-card, .charts-card, .wisdom-card {
    background: #fff !important;
    border: 1px solid #ccc !important;
    color: #000 !important;
    box-shadow: none !important;
  }
  
  .tab-content {
    display: block !important;
  }
  
  .schedule-table-wrapper {
    max-height: none !important;
  }
}

/* Utility Helpers */
.text-cyan { color: var(--cyan); }
.text-emerald { color: var(--emerald); }
.text-amber { color: var(--amber); }
.text-purple { color: var(--purple); }
.text-rose { color: var(--rose); }

.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 36px; }
