/* ═══════════════════════════════════════════════════════════════
   Import Cost Intelligence Dashboard — Design System
   Distefano Consultoria  ·  v1.0
   ═══════════════════════════════════════════════════════════════ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ═══════════════════════════════════════════════════════════════
   1. DESIGN TOKENS (Custom Properties)
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ── Typography ── */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* ── Sizing scale ── */
  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --text-4xl: 3rem;

  /* ── Spacing ── */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* ── Radius ── */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* ── Shadows ── */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.16);

  /* ── Transitions ── */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* ── Layout ── */
  --max-width: 1440px;
  --header-height: 72px;

  /* ── Accent Colors (constant across themes) ── */
  --gold: #c9a84c;
  --gold-soft: #d4b96a;
  --gold-dim: rgba(201, 168, 76, 0.15);
  --blue: #4a90d9;
  --blue-soft: #6ba3e0;
  --blue-dim: rgba(74, 144, 217, 0.12);
  --green: #3a9e6e;
  --green-soft: #5ab888;
  --green-dim: rgba(58, 158, 110, 0.12);
  --red: #d4564e;
  --red-soft: #e07872;
  --red-dim: rgba(212, 86, 78, 0.12);
  --purple: #8b6cc1;
  --purple-dim: rgba(139, 108, 193, 0.12);
}

/* ── Dark Theme (default) ── */
[data-theme="dark"] {
  --bg-primary: #080c18;
  --bg-secondary: #0d1225;
  --bg-card: #111830;
  --bg-card-hover: #161e3a;
  --bg-input: #0d1225;
  --bg-input-focus: #111830;
  --bg-header: rgba(8, 12, 24, 0.92);
  --bg-tooltip: #1e2746;

  --border-subtle: rgba(255,255,255,0.06);
  --border-default: rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.16);
  --border-focus: var(--gold);

  --text-primary: #e8eaf0;
  --text-secondary: #9ba3b8;
  --text-tertiary: #5c6580;
  --text-inverse: #080c18;

  --kpi-glow: rgba(201, 168, 76, 0.08);
  --chart-grid: rgba(255,255,255,0.05);

  --shadow-card: 0 1px 3px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-card-hover: 0 4px 16px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.08);
}

/* ── Light Theme ── */
[data-theme="light"] {
  --bg-primary: #f3f4f8;
  --bg-secondary: #ebedf2;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f9fc;
  --bg-input: #f3f4f8;
  --bg-input-focus: #ffffff;
  --bg-header: rgba(243, 244, 248, 0.92);
  --bg-tooltip: #2d3348;

  --border-subtle: rgba(0,0,0,0.06);
  --border-default: rgba(0,0,0,0.10);
  --border-strong: rgba(0,0,0,0.16);
  --border-focus: var(--gold);

  --text-primary: #111827;
  --text-secondary: #5a6274;
  --text-tertiary: #9ca3af;
  --text-inverse: #ffffff;

  --kpi-glow: rgba(201, 168, 76, 0.06);
  --chart-grid: rgba(0,0,0,0.06);

  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 4px 16px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.06);
}

/* ═══════════════════════════════════════════════════════════════
   2. RESET & BASE
   ═══════════════════════════════════════════════════════════════ */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.6;
  transition: background-color var(--transition-slow), color var(--transition-slow);
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════
   3. LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.main-content {
  padding-top: var(--space-8);
  padding-bottom: var(--space-12);
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

/* ═══════════════════════════════════════════════════════════════
   4. HEADER
   ═══════════════════════════════════════════════════════════════ */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  height: var(--header-height);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  height: 100%;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-soft) 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--text-lg);
  color: #080c18;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.logo-subtitle {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* ═══════════════════════════════════════════════════════════════
   5. BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 38px;
  padding: 0 var(--space-4);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  line-height: 1.5;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--gold);
  color: #080c18;
  border-color: var(--gold);
}

.btn-primary:hover {
  background: var(--gold-soft);
  border-color: var(--gold-soft);
  box-shadow: 0 2px 12px rgba(201, 168, 76, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-default);
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-card);
}

.btn-icon {
  padding: var(--space-2);
  width: 38px;
  height: 38px;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════
   6. THEME TOGGLE
   ═══════════════════════════════════════════════════════════════ */

.theme-toggle {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  font-size: 1.125rem;
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--bg-card);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: inline; }

/* ═══════════════════════════════════════════════════════════════
   7. PAGE HERO
   ═══════════════════════════════════════════════════════════════ */

.page-hero {
  padding: var(--space-8) 0 var(--space-6);
}

.page-hero h1 {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: var(--space-2);
}

.page-hero h1 .accent {
  color: var(--gold);
}

.page-hero p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.65;
}

/* ═══════════════════════════════════════════════════════════════
   8. KPI CARDS
   ═══════════════════════════════════════════════════════════════ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--kpi-accent, var(--border-default));
  opacity: 0.7;
  transition: opacity var(--transition-base);
}

.kpi-card:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-card-hover);
  background: var(--bg-card-hover);
}

.kpi-card:hover::before {
  opacity: 1;
}

.kpi-card.highlight {
  background: var(--kpi-glow);
  border-color: rgba(201, 168, 76, 0.15);
}

.kpi-card.highlight::before {
  background: var(--gold);
}

.kpi-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}

.kpi-value {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.kpi-card.highlight .kpi-value {
  font-size: var(--text-2xl);
  color: var(--gold);
}

.kpi-currency {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-tertiary);
  margin-right: var(--space-1);
}

.kpi-sub {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   9. MODULES / CARDS
   ═══════════════════════════════════════════════════════════════ */

.module {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  transition: border-color var(--transition-base);
}

.module:hover {
  border-color: var(--border-default);
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.module-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.module-title .module-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.module-icon.icon-blue { background: var(--blue-dim); color: var(--blue); }
.module-icon.icon-gold { background: var(--gold-dim); color: var(--gold); }
.module-icon.icon-red { background: var(--red-dim); color: var(--red); }
.module-icon.icon-green { background: var(--green-dim); color: var(--green); }
.module-icon.icon-purple { background: var(--purple-dim); color: var(--purple); }

.module-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--bg-input);
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}

/* ═══════════════════════════════════════════════════════════════
   10. FORM FIELDS
   ═══════════════════════════════════════════════════════════════ */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4) var(--space-5);
}

.form-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

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

.form-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.form-input {
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  transition: all var(--transition-fast);
  width: 100%;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.form-input:hover {
  border-color: var(--border-default);
}

.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

.form-input[readonly] {
  opacity: 0.7;
  cursor: default;
  background: var(--bg-secondary);
}

.form-suffix {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: 500;
}

.form-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input-wrapper .form-input {
  padding-right: 2.5rem;
}

.form-input-wrapper .input-suffix {
  position: absolute;
  right: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  pointer-events: none;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ba3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 2rem;
  cursor: pointer;
}

/* ── Calculated Fields (read-only styled differently) ── */
.calc-display {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  min-height: 40px;
}

.calc-value {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.calc-value.accent-gold { color: var(--gold); }
.calc-value.accent-blue { color: var(--blue); }
.calc-value.accent-red { color: var(--red); }
.calc-value.accent-green { color: var(--green); }

.calc-prefix {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════════════════
   11. SUMMARY TABLE
   ═══════════════════════════════════════════════════════════════ */

.summary-table {
  width: 100%;
  border-collapse: collapse;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row.total-row {
  border-top: 2px solid var(--border-strong);
  border-bottom: none;
  padding-top: var(--space-4);
  margin-top: var(--space-2);
}

.summary-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.summary-label .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-gold { background: var(--gold); }
.dot-blue { background: var(--blue); }
.dot-red { background: var(--red); }
.dot-green { background: var(--green); }
.dot-purple { background: var(--purple); }

.summary-value {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.summary-pct {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  margin-left: var(--space-2);
  min-width: 48px;
  text-align: right;
}

.summary-row.total-row .summary-label {
  font-weight: 700;
  color: var(--text-primary);
  font-size: var(--text-base);
}

.summary-row.total-row .summary-value {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--gold);
}

.summary-row.per-ton-row .summary-value {
  color: var(--green);
  font-weight: 800;
}

/* ═══════════════════════════════════════════════════════════════
   12. TOOLTIPS
   ═══════════════════════════════════════════════════════════════ */

.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--border-default);
  color: var(--text-tertiary);
  font-size: 0.5625rem;
  font-weight: 700;
  cursor: help;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  line-height: 1;
}

.tooltip-trigger:hover {
  background: var(--gold-dim);
  color: var(--gold);
}

.tooltip-container {
  position: relative;
  display: inline-flex;
}

.tooltip-content {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  background: var(--bg-tooltip);
  color: #e8eaf0;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-fast);
  z-index: 50;
  box-shadow: var(--shadow-lg);
  max-width: 280px;
  white-space: normal;
  line-height: 1.5;
}

.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--bg-tooltip);
}

.tooltip-container:hover .tooltip-content {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}

/* ═══════════════════════════════════════════════════════════════
   13. CHARTS
   ═══════════════════════════════════════════════════════════════ */

.chart-wrapper {
  padding: var(--space-4) 0;
}

.chart-canvas-wrapper {
  position: relative;
  max-height: 280px;
  display: flex;
  justify-content: center;
}

.chart-canvas-wrapper canvas {
  max-height: 280px;
}

.chart-legend {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.chart-legend p {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   14. TAX LINE ITEMS
   ═══════════════════════════════════════════════════════════════ */

.tax-line {
  display: grid;
  grid-template-columns: 1fr 110px 1fr;
  gap: var(--space-3);
  align-items: end;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.tax-line:last-child {
  border-bottom: none;
}

.tax-line .form-group {
  gap: 2px;
}

.tax-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) 0 var(--space-2);
  margin-top: var(--space-3);
  border-top: 2px solid var(--border-strong);
}

.tax-subtotal .label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tax-subtotal .value {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════
   15. OPERATIONAL COSTS TABLE
   ═══════════════════════════════════════════════════════════════ */

.ops-line {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: var(--space-4);
  align-items: end;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.ops-line:last-child {
  border-bottom: none;
}

.ops-note {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   16. FOOTER
   ═══════════════════════════════════════════════════════════════ */

.footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  padding: var(--space-8) 0 var(--space-6);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-6);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-social a:hover {
  color: var(--gold);
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-contact h4 {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-contact p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.footer-contact a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-contact a:hover {
  color: var(--gold);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-6);
  text-align: center;
}

.footer-bottom p {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: 500;
}

.footer-bottom a {
  color: var(--gold);
  text-decoration: none;
}

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

/* Header Nav Styles */
.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-left: var(--space-6);
}

.header-nav a {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.header-nav a:hover {
  color: var(--gold);
}

@media (max-width: 1200px) {
  .header-nav {
    gap: var(--space-2);
    margin-left: var(--space-4);
  }
  .header-nav a {
    font-size: var(--text-xs);
  }
}

@media (max-width: 1024px) {
  .header-nav {
    display: none;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

/* ═══════════════════════════════════════════════════════════════
   17. ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.animate-in {
  animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  opacity: 0;
}

.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.10s; }
.kpi-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-card:nth-child(4) { animation-delay: 0.20s; }
.kpi-card:nth-child(5) { animation-delay: 0.25s; }
.kpi-card:nth-child(6) { animation-delay: 0.30s; }

.value-flash {
  animation: pulse 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════════
   18. UTILITY
   ═══════════════════════════════════════════════════════════════ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-4) 0;
}

.text-gold { color: var(--gold); }
.text-blue { color: var(--blue); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-muted { color: var(--text-tertiary); }

.font-mono { font-family: var(--font-mono); }
.font-tabular { font-variant-numeric: tabular-nums; }

/* ═══════════════════════════════════════════════════════════════
   19. RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

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

@media (max-width: 1024px) {
  .grid-2col {
    grid-template-columns: 1fr;
  }
  .header-right .btn span.btn-label {
    display: none;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  .container {
    padding: 0 var(--space-4);
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  .kpi-card {
    padding: var(--space-4);
  }

  .kpi-value {
    font-size: var(--text-lg);
  }

  .kpi-card.highlight .kpi-value {
    font-size: var(--text-xl);
  }

  .form-grid,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }

  .tax-line {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .ops-line {
    grid-template-columns: 1fr;
  }

  .module {
    padding: var(--space-4);
  }

  .page-hero h1 {
    font-size: var(--text-xl);
  }

  .header-left .logo-text {
    display: none;
  }

  .grid-3col {
    grid-template-columns: 1fr;
  }
}

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

/* ═══════════════════════════════════════════════════════════════
   20. SCROLLBAR
   ═══════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* ═══════════════════════════════════════════════════════════════
   21. NOTIFICATION TOAST
   ═══════════════════════════════════════════════════════════════ */

.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-xl);
  z-index: 200;
  transform: translateY(120%);
  opacity: 0;
  transition: all var(--transition-base);
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast .toast-icon {
  margin-right: var(--space-2);
}
