/* CalcHub - Professional Finance Calculator Theme */
/* Primary: #0f766e | Secondary: #0369a1 | Background: #ffffff / #f8fafc */

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

:root {
  --primary: #0f766e;
  --primary-dark: #0d6660;
  --primary-light: #14b8a6;
  --secondary: #0369a1;
  --secondary-dark: #025585;
  --accent: #f59e0b;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ── DARK MODE ────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-alt: #1e293b;
  --bg-card: #1e293b;
  --border: #334155;
  --border-light: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -1px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.2);
}

[data-theme="dark"] .result-item { background: #0f172a; }
[data-theme="dark"] .invoice-preview { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .toggle-btn.active { background: #334155; }
[data-theme="dark"] .affiliate-section-wrap { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .aff-card { background: #0f172a; border-color: #334155; }
[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

/* ── DARK MODE TOGGLE BUTTON ─────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  font-size: 1.125rem;
  line-height: 1;
}

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

/* ── RESULT ANIMATIONS ──────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-panel:not(.hidden) {
  animation: fadeSlideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.result-item {
  animation: fadeSlideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.result-item:nth-child(1) { animation-delay: 0.05s; }
.result-item:nth-child(2) { animation-delay: 0.10s; }
.result-item:nth-child(3) { animation-delay: 0.15s; }
.result-item:nth-child(4) { animation-delay: 0.20s; }

/* ── COPY / SHARE BUTTONS ────────────────────────────────── */
.result-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.btn-copy, .btn-share {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-copy:hover, .btn-share:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-copy.copied {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.btn-copy svg, .btn-share svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── INPUT VALIDATION ───────────────────────────────────── */
input.input-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

.field-error {
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 0.25rem;
  display: none;
}

.field-error.visible { display: block; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* NAVIGATION */
.site-nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.nav-brand span { color: var(--text); }

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.nav-links a:hover { background: var(--bg-alt); color: var(--text); }
.nav-links a.active { background: var(--bg-alt); color: var(--primary); font-weight: 600; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.2s;
}

/* HERO */
.page-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 3rem 1.5rem 3.5rem;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.page-hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  opacity: 0.9;
  max-width: 560px;
  margin: 0 auto;
}

/* AD PLACEHOLDER */
.ad-banner {
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  text-align: center;
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-light);
  font-size: 0.8rem;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-wrap { max-width: 1200px; margin: 1.5rem auto; padding: 0 1.5rem; }

/* MAIN CONTENT */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* CALCULATOR LAYOUT */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.calc-layout.single { grid-template-columns: 1fr; max-width: 640px; margin: 0 auto; }
.calc-layout.wide { grid-template-columns: 1fr; max-width: 900px; margin: 0 auto; }

/* CARDS */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-header h2 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
}

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  background: var(--primary);
  color: white;
  flex-shrink: 0;
}

.card-body { padding: 1.5rem; }

/* FORM ELEMENTS */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.input-wrap {
  position: relative;
}

.input-prefix, .input-suffix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9375rem;
  color: var(--text-muted);
  font-weight: 500;
  pointer-events: none;
}

.input-prefix { left: 12px; }
.input-suffix { right: 12px; }

.has-prefix input { padding-left: 28px; }
.has-suffix input { padding-right: 32px; }

input[type="number"],
input[type="text"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.6875rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 4px rgba(15, 118, 110, 0.3);
}

.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 8px rgba(15, 118, 110, 0.35); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-alt);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover { background: var(--border-light); }

.btn-full { width: 100%; }
.btn-lg { padding: 0.875rem 2rem; font-size: 1rem; }

.btn-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* RESULTS */
.result-panel {
  background: linear-gradient(135deg, rgba(15,118,110,0.04) 0%, rgba(3,105,161,0.04) 100%);
  border: 1.5px solid rgba(15,118,110,0.15);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1rem;
}

.result-panel.hidden { display: none; }

.result-headline {
  text-align: center;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(15,118,110,0.15);
}

.result-headline .label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.result-headline .amount {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.result-headline .sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.result-item {
  text-align: center;
  padding: 1rem;
  background: white;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.result-item .r-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.result-item .r-value {
  font-size: 1.3125rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.result-item .r-value.primary { color: var(--primary); }
.result-item .r-value.secondary { color: var(--secondary); }
.result-item .r-value.danger { color: var(--danger); }
.result-item .r-value.success { color: var(--success); }
.result-item .r-value.warning { color: var(--warning); }

/* AMORTIZATION TABLE */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-top: 1.25rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: var(--primary);
  color: white;
}

thead th {
  padding: 0.75rem 1rem;
  text-align: right;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

thead th:first-child { text-align: left; }

tbody tr { border-bottom: 1px solid var(--border-light); transition: background 0.1s; }
tbody tr:hover { background: var(--bg-alt); }
tbody tr:last-child { border-bottom: none; }
tbody tr.year-end { background: rgba(15,118,110,0.04); font-weight: 600; }

tbody td {
  padding: 0.625rem 1rem;
  text-align: right;
  color: var(--text);
  white-space: nowrap;
}

tbody td:first-child { text-align: left; color: var(--text-muted); }

tfoot td {
  padding: 0.75rem 1rem;
  text-align: right;
  font-weight: 700;
  background: var(--bg-alt);
  border-top: 2px solid var(--border);
}

tfoot td:first-child { text-align: left; }

/* BAR CHARTS (CSS-only) */
.bar-chart {
  margin-top: 1.5rem;
}

.bar-chart-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.625rem;
}

.bar-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  width: 80px;
  flex-shrink: 0;
  text-align: right;
  font-weight: 500;
}

.bar-track {
  flex: 1;
  height: 22px;
  background: var(--bg-alt);
  border-radius: 11px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 11px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 2px;
}

.bar-fill.primary { background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%); }
.bar-fill.secondary { background: linear-gradient(90deg, var(--secondary) 0%, #38bdf8 100%); }
.bar-fill.accent { background: linear-gradient(90deg, var(--accent) 0%, #fbbf24 100%); }
.bar-fill.success { background: linear-gradient(90deg, var(--success) 0%, #34d399 100%); }
.bar-fill.danger { background: linear-gradient(90deg, var(--danger) 0%, #f87171 100%); }
.bar-fill.stacked-a { background: var(--primary); }
.bar-fill.stacked-b { background: var(--secondary); }

.bar-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  width: 90px;
  flex-shrink: 0;
}

/* Stacked bars */
.bar-track.stacked {
  display: flex;
  gap: 1px;
}

/* PIE / DONUT (CSS-only) */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1rem 0;
}

.donut-chart {
  position: relative;
  width: 130px;
  height: 130px;
  flex-shrink: 0;
}

.donut-chart svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.donut-center .dc-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.donut-center .dc-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.donut-legend { flex: 1; }

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-item .l-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  flex: 1;
}

.legend-item .l-value {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
}

/* PROGRESS BAR */
.progress-wrap {
  margin: 0.75rem 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.progress-track {
  height: 10px;
  background: var(--bg-alt);
  border-radius: 5px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.5s ease;
}

/* INFO BOXES */
.info-box {
  background: rgba(3, 105, 161, 0.06);
  border-left: 3px solid var(--secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.875rem 1rem;
  margin: 1rem 0;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.55;
}

.info-box.warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: var(--warning);
}

.info-box.success {
  background: rgba(16, 185, 129, 0.08);
  border-color: var(--success);
}

.info-box.danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--danger);
}

.info-box strong { font-weight: 700; }

/* TABS */
.tab-nav {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
  gap: 0.25rem;
}

.tab-btn {
  padding: 0.625rem 1.125rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.15s;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab-btn:hover { color: var(--text); background: var(--bg-alt); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: rgba(15,118,110,0.04); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* CATEGORIES GRID (homepage) */
.category-section { margin-bottom: 3rem; }

.section-title {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.calc-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.375rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}

.calc-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.calc-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.calc-card-content h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.calc-card-content p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* BREADCRUMB */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--text-light); }

/* SEO CONTENT */
.seo-content {
  max-width: 800px;
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.seo-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

.seo-content h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  margin-top: 1.25rem;
}

.seo-content p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0.875rem;
}

.seo-content ul, .seo-content ol {
  margin: 0.5rem 0 1rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* FOOTER */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 2.5rem 1.5rem;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
}

.footer-brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
  margin-bottom: 0.625rem;
}

.footer-tagline {
  font-size: 0.875rem;
  line-height: 1.55;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.footer-col h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #cbd5e1;
  margin-bottom: 0.75rem;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.4rem; }
.footer-col a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s;
}
.footer-col a:hover { color: white; }

.footer-bottom {
  max-width: 1200px;
  margin: 1.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-legal a { color: #64748b; text-decoration: none; margin-left: 1.25rem; }
.footer-legal a:hover { color: #94a3b8; }

/* SLIDER */
.range-group {
  margin-bottom: 1.25rem;
}

.range-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.range-label-row label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.range-val {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(15,118,110,0.1);
  padding: 0.125rem 0.625rem;
  border-radius: 20px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  padding: 0;
  border: none;
  box-shadow: none;
}

input[type="range"]:focus { box-shadow: none; }

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 2.5px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: box-shadow 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 6px rgba(15,118,110,0.15);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 2.5px solid white;
}

/* TOGGLE */
.toggle-group {
  display: flex;
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 1.25rem;
}

.toggle-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.toggle-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* UTILITY */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 1.25rem 0;
}

/* INVOICE SPECIFIC */
.invoice-preview {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.invoice-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.03em;
}

.invoice-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.invoice-table th {
  background: #0f172a;
  color: white;
  padding: 0.625rem 0.875rem;
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.invoice-table td {
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.875rem;
}
.invoice-table td:last-child { text-align: right; }
.invoice-table th:last-child { text-align: right; }
.invoice-totals { float: right; width: 280px; }
.invoice-totals table { width: 100%; }
.invoice-totals td { padding: 0.375rem 0.5rem; }
.invoice-totals td:last-child { text-align: right; font-weight: 600; }
.invoice-grand-total td { font-size: 1.125rem; font-weight: 800; color: var(--primary); border-top: 2px solid var(--primary); padding-top: 0.625rem; }

/* Clearfix */
.clearfix::after { content: ''; display: table; clear: both; }

/* Print */
@media print {
  .site-nav, .ad-banner, .ad-wrap, .btn, .breadcrumb, .seo-content, .site-footer { display: none !important; }
  .invoice-preview { border: none; padding: 0; }
  body { font-size: 12px; }
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .calc-layout { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-links { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); padding: 1rem; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); z-index: 99; }
  .nav-hamburger { display: flex; }
  .form-row { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .donut-wrap { flex-direction: column; }
  .page-hero { padding: 2rem 1rem 2.5rem; }
  .main-content { padding: 1.5rem 1rem 3rem; }
  .footer-links { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .table-wrap { font-size: 0.8125rem; }
}

/* ===== AFFILIATE SECTION ===== */
.affiliate-section-wrap {
  background: #f0fdf9;
  border-top: 2px solid #ccfbf1;
  padding: 40px 1.5rem;
  margin-top: 40px;
}
.affiliate-inner {
  max-width: 900px;
  margin: 0 auto;
}
.affiliate-heading {
  font-size: 1rem;
  font-weight: 700;
  color: #0f766e;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 20px;
}
.affiliate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.aff-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.aff-card:hover {
  box-shadow: 0 8px 24px rgba(15,118,110,0.1);
  transform: translateY(-2px);
  border-color: #0f766e;
}
.aff-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}
.aff-card-desc {
  font-size: 0.83rem;
  color: #64748b;
  line-height: 1.45;
  flex: 1;
}
.aff-card-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 14px;
  background: #0f766e;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  align-self: flex-start;
  transition: background 0.2s;
}
.aff-card:hover .aff-card-btn { background: #0d6660; }
/* ===== /AFFILIATE SECTION ===== */
