/* ==========================================================================
   TOPSCORE.NL - VASTGOED RENDEMENT SPANJE CALCULATOR
   100% Pure Vanilla CSS - Geen externe frameworks of libraries.
   ========================================================================== */

:root {
  --primary: #0c233c;
  --primary-light: #163659;
  --primary-dark: #071524;
  --primary-rgb: 12, 35, 60;
  
  --accent: #d97706;
  --accent-hover: #b45309;
  --accent-light: #fef3c7;
  --accent-soft: #fffbeb;
  
  --emerald: #059669;
  --emerald-hover: #047857;
  --emerald-light: #ecfdf5;
  --emerald-border: #a7f3d0;
  
  --blue: #2563eb;
  --blue-light: #eff6ff;
  --blue-border: #bfdbfe;
  
  --indigo: #4f46e5;
  --indigo-light: #eef2ff;
  
  --amber: #d97706;
  --amber-light: #fef3c7;
  
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --border: #e2e8f0;
  --border-focus: #2563eb;
  
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.07), 0 1px 2px -1px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-main);
  background-color: var(--bg-page);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #ffffff;
  border-bottom: 3px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-badge {
  background: linear-gradient(135deg, var(--accent) 0%, #b45309 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.brand-titles h1 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.2;
}

.brand-titles p {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-action-ghost,
.btn-action-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  border: 1px solid transparent;
}

.btn-action-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-action-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.btn-action-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(217, 119, 6, 0.3);
}

.btn-action-primary:hover {
  background: var(--accent-hover);
}

/* ==========================================================================
   HERO STRIP
   ========================================================================== */
.hero-strip {
  background: linear-gradient(180deg, #ffffff 0%, var(--bg-page) 100%);
  border-bottom: 1px solid var(--border);
  padding: 2rem 1.5rem 1.75rem;
}

.hero-content {
  max-width: 1440px;
  margin: 0 auto;
}

.hero-badge-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.hero-badge {
  background-color: var(--blue-light);
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--blue-border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-badge-accent {
  background-color: var(--emerald-light);
  color: var(--emerald);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--emerald-border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-content h2 {
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.hero-content p {
  color: var(--text-muted);
  font-size: 0.98rem;
  max-width: 900px;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

/* Presets Bar */
.region-presets-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.preset-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.preset-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.preset-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.38rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-xs);
}

.preset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.preset-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   MAIN LAYOUT (2 Columns)
   ========================================================================== */
.main-layout {
  max-width: 1440px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 1.75rem;
  align-items: start;
  flex: 1;
}

@media (max-width: 1100px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   INPUTS COLUMN
   ========================================================================== */
.inputs-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card-section:hover {
  border-color: #cbd5e1;
}

.section-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.section-step-num {
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.section-title-wrap h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.15rem;
  line-height: 1.3;
}

.section-title-wrap p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

/* Form Controls */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.label-row label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.label-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 600;
}

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

.input-symbol {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  pointer-events: none;
}

.input-symbol-right {
  position: absolute;
  right: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  font-family: inherit;
}

.input-with-symbol .form-input {
  padding-left: 1.85rem;
}

.input-with-symbol.has-right-symbol .form-input {
  padding-right: 2rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

select.form-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  appearance: none;
}

/* Range Sliders */
.range-group {
  margin-top: 0.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-range {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  accent-color: var(--primary);
}

.range-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-light);
  font-family: var(--font-mono);
}

/* Sub-card helper / Accordion */
.details-toggle {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.4rem;
  transition: all 0.15s ease;
}

.details-toggle:hover {
  background: #e2e8f0;
}

.details-panel {
  display: none;
  margin-top: 0.6rem;
  padding: 0.75rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.8rem;
}

.details-panel.open {
  display: block;
}

.helper-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--emerald);
  background: var(--emerald-light);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

/* Switch / Toggle */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.switch-label-wrap {
  display: flex;
  flex-direction: column;
}

.switch-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--primary);
}

.switch-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

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

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

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.25s;
  border-radius: 34px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .slider-round {
  background-color: var(--emerald);
}

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

/* ==========================================================================
   RESULTS COLUMN
   ========================================================================== */
.results-column {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

/* Top KPI Bar */
.kpi-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

@media (max-width: 820px) {
  .kpi-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .kpi-summary-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
}

.kpi-card.kpi-primary::before { background: var(--primary); }
.kpi-card.kpi-emerald::before { background: var(--emerald); }
.kpi-card.kpi-blue::before { background: var(--blue); }
.kpi-card.kpi-accent::before { background: var(--accent); }

.kpi-card .kpi-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.kpi-card .kpi-value {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.2;
  font-family: var(--font-sans);
}

.kpi-card .kpi-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.kpi-card.kpi-emerald .kpi-value {
  color: var(--emerald);
}

/* ==========================================================================
   SIDE-BY-SIDE COMPARISON (WITHOUT VS WITH FINANCING)
   ========================================================================== */
.comparison-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.comparison-header {
  background: linear-gradient(135deg, var(--primary) 0%, #1e3a5f 100%);
  color: #ffffff;
  padding: 1.15rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.comparison-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comparison-badge {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  color: #ffffff;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

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

.scenario-col {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.scenario-col.scenario-without {
  background: #ffffff;
  border-right: 1px solid var(--border);
}

@media (max-width: 768px) {
  .scenario-col.scenario-without {
    border-right: none;
    border-bottom: 2px dashed var(--border);
  }
}

.scenario-col.scenario-with {
  background: #fafcff;
}

.scenario-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}

.scenario-col.scenario-with .scenario-col-header {
  border-bottom-color: var(--blue);
}

.scenario-col.scenario-without .scenario-col-header {
  border-bottom-color: var(--primary);
}

.scenario-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.scenario-tag {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tag-cash {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.tag-leverage {
  background: var(--blue-light);
  color: var(--blue);
  border: 1px solid var(--blue-border);
}

/* Metric Rows in Comparison */
.metric-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.metric-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.scenario-col.scenario-with .metric-item {
  background: #f1f6fd;
}

.metric-item.metric-highlight {
  background: var(--emerald-light);
  border-color: var(--emerald-border);
}

.metric-item.metric-highlight-blue {
  background: var(--blue-light);
  border-color: var(--blue-border);
}

.metric-name {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.metric-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-sans);
}

.metric-val.val-emerald {
  color: var(--emerald);
}

.metric-val.val-blue {
  color: var(--blue);
}

.metric-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
  text-align: right;
  font-weight: 500;
}

/* Highlight Box at bottom of scenario */
.scenario-summary-box {
  border-radius: var(--radius-md);
  padding: 1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.scenario-col.scenario-with .scenario-summary-box {
  background: #ebf3ff;
  border-color: #cbdcfc;
}

.summary-box-title {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.summary-box-hero {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.summary-box-val {
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
}

.summary-box-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Leverage Banner */
.leverage-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border-top: 1px solid var(--emerald-border);
  padding: 0.85rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  flex-wrap: wrap;
}

.leverage-banner-text {
  color: #065f46;
  font-weight: 600;
}

.leverage-badge {
  background: var(--emerald);
  color: #ffffff;
  font-weight: 800;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

/* ==========================================================================
   CHART SECTION (HTML5 CANVAS)
   ========================================================================== */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-sm);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.chart-titles h4 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.2rem;
}

.chart-titles p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.chart-mode-buttons {
  display: flex;
  gap: 0.35rem;
  background: var(--bg-subtle);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.chart-tab-btn {
  background: transparent;
  border: none;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chart-tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.canvas-container {
  position: relative;
  width: 100%;
  height: 280px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #ffffff;
}

#projection-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* ==========================================================================
   MULTI-YEAR TABLE SECTION
   ========================================================================== */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-sm);
}

.table-header-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.table-titles h4 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
}

.table-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-table-action {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-table-action:hover {
  background: #e2e8f0;
}

.table-scroller {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.projection-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.8rem;
}

.projection-table th,
.projection-table td {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.projection-table th {
  background: var(--bg-subtle);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.projection-table th:first-child,
.projection-table td:first-child {
  text-align: left;
}

.projection-table tbody tr:hover {
  background-color: #f8fafc;
}

.projection-table tbody tr:last-child td {
  border-bottom: none;
  font-weight: 800;
  background-color: #f1f5f9;
}

.td-emerald {
  color: var(--emerald);
  font-weight: 700;
}

.td-blue {
  color: var(--blue);
  font-weight: 700;
}

/* ==========================================================================
   SPANISH TAX & SPANISH REAL ESTATE KNOWLEDGE BOX
   ========================================================================== */
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-sm);
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.info-card-header h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
}

.info-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .info-card-grid {
    grid-template-columns: 1fr;
  }
}

.info-item {
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  border: 1px solid var(--border);
}

.info-item h5 {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.info-item p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: var(--primary-dark);
  color: #94a3b8;
  margin-top: 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2.5rem 1.5rem 1.5rem;
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 2fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

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

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

.footer-col h5 {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 0.85rem;
}

.footer-desc {
  font-size: 0.82rem;
  line-height: 1.55;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-disclaimer-text {
  font-size: 0.78rem;
  line-height: 1.5;
  color: #64748b;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #64748b;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--primary);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ==========================================================================
   PRINT & PDF STYLES
   ========================================================================== */
.print-header {
  display: none;
}

@media print {
  .site-header,
  .hero-strip,
  .inputs-column,
  .chart-mode-buttons,
  .table-actions,
  .site-footer,
  .toast {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .main-layout {
    display: block !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .print-header {
    display: block;
    border-bottom: 2px solid #0c233c;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
  }

  .print-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
  }

  .print-header h1 {
    font-size: 1.5rem;
    color: #0c233c;
  }

  .comparison-container,
  .card-section,
  .kpi-card,
  .chart-card,
  .table-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    page-break-inside: avoid;
  }

  .comparison-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}
