/* ================================================================
   PREMIUM DESIGN SYSTEM
   Inspired by: Apple · Samsung · Stripe · Linear · Vercel ·
                Figma · Google Material 3 · Airbnb · Microsoft · Notion
   ================================================================ */

/* ── 1. FONT ─────────────────────────────────────────────────── */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard-dynamic-subset.css');

/* ── 2. DESIGN TOKENS ────────────────────────────────────────── */
:root {
  /* Brand */
  --brand-1: #6366F1;
  --brand-2: #818CF8;
  --brand-3: #0EA5E9;
  --brand-4: #8B5CF6;

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #0EA5E9 100%);
  --gradient-hero: linear-gradient(-45deg, #1e1b4b, #312e81, #1e3a8a, #0369a1, #0891b2);
  --gradient-sidebar: linear-gradient(180deg, #0b0f19 0%, #111827 100%);
  --gradient-card-accent: linear-gradient(135deg, #6366F1, #0EA5E9);
  --gradient-green: linear-gradient(135deg, #059669, #10B981);
  --gradient-orange: linear-gradient(135deg, #D97706, #F59E0B);
  --gradient-purple: linear-gradient(135deg, #7C3AED, #A855F7);

  /* Semantic */
  --primary: #6366F1;
  --primary-hover: #4F46E5;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #0EA5E9;

  /* Surface */
  --bg: #F1F5F9;
  --surface: #FFFFFF;
  --surface-raised: #FAFAFA;
  --glass: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.9);

  /* Border */
  --border: #E2E8F0;
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-brand: rgba(99, 102, 241, 0.2);

  /* Text */
  --text: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-on-dark: rgba(255,255,255,0.85);
  --text-on-dark-muted: rgba(255,255,255,0.5);

  /* Sidebar */
  --sidebar-bg: #0b0f19;
  --sidebar-width: 260px;
  --sidebar-nav-hover: rgba(255,255,255,0.07);
  --sidebar-nav-active: rgba(99,102,241,0.2);
  --sidebar-active-border: #818CF8;

  /* Shadows – Multi-layer like Stripe */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:     0 4px 16px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-md:  0 10px 30px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-lg:  0 20px 50px rgba(0,0,0,0.10), 0 8px 16px rgba(0,0,0,0.05);
  --shadow-brand: 0 8px 24px rgba(99, 102, 241, 0.28);
  --shadow-hover: 0 16px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);

  /* Radius */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Transitions — Spring curve (iOS feel) */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.0, 0, 0.2, 1);
  --t-fast: 150ms;
  --t: 250ms;
  --t-slow: 400ms;
}

/* ── 3. RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; background: none; }
input, select { font-family: inherit; outline: none; }
img { max-width: 100%; display: block; }

/* ── 4. LAYOUT ────────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

/* ── 5. SIDEBAR ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--gradient-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--t-slow) var(--ease-spring);
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid rgba(255,255,255,0.04);
}
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(99,102,241,0.4) 40%, rgba(14,165,233,0.3) 70%, transparent);
  pointer-events: none;
}

/* Sidebar Logo */
.sidebar-logo {
  padding: 28px 22px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
}
.logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 12px;
  box-shadow: var(--shadow-brand);
  flex-shrink: 0;
}
.sidebar-logo h1 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.sidebar-logo p {
  font-size: 0.72rem;
  color: var(--text-on-dark-muted);
  margin-top: 3px;
  letter-spacing: 0.01em;
}

/* Nav */
.sidebar-nav { padding: 14px 10px; flex: 1; }
.sidebar-nav li { margin-bottom: 2px; }
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-on-dark);
  border-radius: var(--radius-sm);
  transition: all var(--t) var(--ease-spring);
  position: relative;
  letter-spacing: -0.01em;
}
.sidebar-nav li a:hover {
  background: var(--sidebar-nav-hover);
  color: #fff;
}
.sidebar-nav li a.active {
  background: var(--sidebar-nav-active);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(129,140,248,0.3);
}
.sidebar-nav li a.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--gradient-brand);
}
.nav-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.07);
  flex-shrink: 0;
  transition: background var(--t);
}
.sidebar-nav li a:hover .nav-icon,
.sidebar-nav li a.active .nav-icon {
  background: rgba(99,102,241,0.25);
  color: #a5b4fc;
}

/* Nav section label */
.nav-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
  padding: 16px 14px 6px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 22px 20px;
  font-size: 0.7rem;
  color: var(--text-on-dark-muted);
  border-top: 1px solid rgba(255,255,255,0.06);
  line-height: 1.6;
}

/* Mobile Hamburger */
.hamburger {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 200;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--text);
  color: #fff;
  font-size: 1rem;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

/* ── 6. MAIN CONTENT ──────────────────────────────────────────── */
.content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Page Header */
.page-header {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 18px 36px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-xs);
}
.page-header-left h2 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-header-left p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 1px;
}
.page-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.main-inner { padding: 32px 36px; flex: 1; }

/* ── 7. TAB CONTENT ───────────────────────────────────────────── */
.tab-content { display: none; }
.tab-content.active {
  display: block;
  animation: tabFadeIn var(--t-slow) var(--ease-spring);
}
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 8. SECTION TITLE ────────────────────────────────────────── */
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}
.section-title .title-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

/* ── 9. CARDS ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: box-shadow var(--t) var(--ease-spring),
              transform var(--t) var(--ease-spring),
              border-color var(--t);
  position: relative;
  overflow: hidden;
}
.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: var(--border-brand);
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,0.03) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--t);
  pointer-events: none;
}
.card:hover::before { opacity: 1; }

/* Glass Card */
.card-glass {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
}

/* Gradient accent card */
.card-accent-top {
  border-top: 3px solid transparent;
  border-image: var(--gradient-brand) 1;
}

/* Card Header */
.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.card-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}
.card-icon.indigo  { background: linear-gradient(135deg, #EEF2FF, #E0E7FF); color: #6366F1; }
.card-icon.blue    { background: linear-gradient(135deg, #EFF6FF, #DBEAFE); color: #2563EB; }
.card-icon.sky     { background: linear-gradient(135deg, #F0F9FF, #E0F2FE); color: #0284C7; }
.card-icon.green   { background: linear-gradient(135deg, #ECFDF5, #D1FAE5); color: #059669; }
.card-icon.purple  { background: linear-gradient(135deg, #FAF5FF, #F3E8FF); color: #7C3AED; }
.card-icon.orange  { background: linear-gradient(135deg, #FFFBEB, #FEF3C7); color: #D97706; }
.card-icon.teal    { background: linear-gradient(135deg, #F0FDFA, #CCFBF1); color: #0D9488; }
.card-icon.rose    { background: linear-gradient(135deg, #FFF1F2, #FFE4E6); color: #E11D48; }

/* Card gradient icon (brand gradient bg) */
.card-icon.brand {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}

.card-title    { font-size: 0.95rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.card-subtitle { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* Stat Value */
.stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* ── 10. GRID SYSTEM ─────────────────────────────────────────── */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.mb-6  { margin-bottom: 6px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

/* ── 11. HOME HERO ───────────────────────────────────────────── */
.home-hero {
  position: relative;
  background: var(--gradient-hero);
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
  border-radius: var(--radius-xl);
  padding: 48px 48px;
  color: #fff;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Decorative blobs */
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  pointer-events: none;
  opacity: 0;
  animation: blobFade 1.2s var(--ease-spring) forwards;
}
.hero-blob-1 {
  width: 300px; height: 300px;
  background: rgba(99, 102, 241, 0.5);
  top: -80px; right: 80px;
  animation-delay: 0.2s;
}
.hero-blob-2 {
  width: 250px; height: 250px;
  background: rgba(14, 165, 233, 0.45);
  bottom: -60px; right: 280px;
  animation-delay: 0.4s;
}
.hero-blob-3 {
  width: 200px; height: 200px;
  background: rgba(139, 92, 246, 0.4);
  top: 20px; left: 40%;
  animation-delay: 0.6s;
}
@keyframes blobFade {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

/* Grid pattern overlay */
.home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.hero-content { position: relative; z-index: 2; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  padding: 5px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.9);
  margin-bottom: 16px;
}
.hero-eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #34D399;
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(1.4); }
}
.home-hero h2 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin-bottom: 12px;
}
.home-hero p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.78);
  max-width: 480px;
  line-height: 1.75;
}

/* Hero Stats */
.hero-stats {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-stat {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  text-align: center;
  min-width: 110px;
}
.hero-stat .hs-num {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
  line-height: 1;
}
.hero-stat .hs-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.65);
  margin-top: 6px;
  line-height: 1.4;
}

/* ── 12. PENSION LADDER ──────────────────────────────────────── */
.pension-ladder { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.ladder-item {
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: transform var(--t) var(--ease-spring);
}
.ladder-item:hover { transform: translateX(4px); }
.ladder-item.l1 { background: linear-gradient(90deg, #1e1b4b, #312e81); color: #fff; }
.ladder-item.l2 { background: linear-gradient(90deg, #1e40af, #2563eb); color: #fff; }
.ladder-item.l3 { background: linear-gradient(90deg, #0369a1, #0891b2); color: #fff; }
.li-name  { font-weight: 700; font-size: 0.9rem; }
.li-desc  { font-size: 0.75rem; opacity: 0.8; margin-top: 2px; }
.li-rate  {
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(255,255,255,0.18);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.2);
}

/* ── 13. INFO LIST ───────────────────────────────────────────── */
.info-list { display: flex; flex-direction: column; gap: 8px; }
.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  border: 1px solid var(--border-subtle);
  transition: background var(--t-fast);
}
.info-item:hover { background: #EEF2FF; }
.info-item .label { color: var(--text-secondary); }
.info-item .value { font-weight: 600; color: var(--text); }

/* ── 14. KEY POINTS ──────────────────────────────────────────── */
.key-points { display: flex; flex-direction: column; gap: 10px; }
.key-point {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  border: 1px solid var(--border-subtle);
  line-height: 1.65;
  transition: all var(--t-fast);
}
.key-point:hover { background: #EEF2FF; border-color: var(--border-brand); }
.kp-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* ── 15. HIGHLIGHT BOX ───────────────────────────────────────── */
.highlight-box {
  background: linear-gradient(135deg, #EEF2FF 0%, #E0F2FE 100%);
  border-radius: var(--radius);
  padding: 20px 24px;
  border-left: 4px solid var(--primary);
  margin-bottom: 24px;
  border: 1px solid rgba(99,102,241,0.12);
  border-left: 4px solid var(--primary);
}
.highlight-box h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary-hover);
  margin-bottom: 8px;
}
.highlight-box p { font-size: 0.86rem; color: #334155; line-height: 1.75; }

/* ── 16. BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.badge-blue   { background: #DBEAFE; color: #1D4ED8; }
.badge-green  { background: #D1FAE5; color: #065F46; }
.badge-orange { background: #FEF3C7; color: #92400E; }
.badge-red    { background: #FFE4E6; color: #9F1239; }
.badge-purple { background: #F3E8FF; color: #5B21B6; }
.badge-brand  { background: #EEF2FF; color: #4338CA; }
.badge-gradient {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

/* ── 17. TABLE ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }

thead th {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: rgba(255,255,255,0.9);
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
thead th:first-child { border-radius: 0; }

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:nth-child(even) { background: #FAFBFF; }
tbody tr:hover { background: rgba(99,102,241,0.04); }

tbody td {
  padding: 12px 16px;
  white-space: nowrap;
  color: var(--text);
}

.td-right  { text-align: right; }
.td-center { text-align: center; }

/* Return colors (Korean market convention: red=up, blue=down) */
.positive { color: #DC2626; font-weight: 700; }
.negative { color: #2563EB; font-weight: 700; }

/* Rank Badge */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 700;
  background: #E2E8F0;
  color: var(--text-secondary);
}
.rank-badge.gold   { background: linear-gradient(135deg, #F59E0B, #FBBF24); color: #fff; box-shadow: 0 2px 6px rgba(245,158,11,0.4); }
.rank-badge.silver { background: linear-gradient(135deg, #6B7280, #9CA3AF); color: #fff; }
.rank-badge.bronze { background: linear-gradient(135deg, #92400E, #B45309); color: #fff; }

/* ── 18. ETF SUB-TABS ────────────────────────────────────────── */
.sub-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.sub-tab-btn {
  padding: 9px 20px;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all var(--t) var(--ease-spring);
  letter-spacing: -0.01em;
}
.sub-tab-btn:hover { border-color: var(--primary); color: var(--primary); }
.sub-tab-btn.active {
  background: var(--gradient-brand);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-brand);
}
.sub-content { display: none; }
.sub-content.active {
  display: block;
  animation: tabFadeIn var(--t) var(--ease-spring);
}

/* ── 19. COMPARE CARDS ───────────────────────────────────────── */
.compare-card { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border-subtle); }
.compare-card-head { padding: 22px; color: #fff; text-align: center; }
.compare-card-head.blue   { background: linear-gradient(135deg, #1e40af, #2563eb); }
.compare-card-head.green  { background: linear-gradient(135deg, #064e3b, #059669); }
.compare-card-head.purple { background: linear-gradient(135deg, #4c1d95, #7c3aed); }
.compare-card-head h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.02em; }
.compare-card-head p  { font-size: 0.75rem; opacity: 0.8; font-style: italic; }
.compare-card-body { background: #fff; padding: 20px; }
.compare-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
  gap: 12px;
}
.compare-item:last-child { border-bottom: none; }
.compare-item .c-label { color: var(--text-secondary); flex-shrink: 0; }
.compare-item .c-val   { font-weight: 600; text-align: right; }

/* ── 20. CALCULATOR ──────────────────────────────────────────── */
.calc-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
  letter-spacing: -0.01em;
}
.input-unit { position: relative; }
.input-unit input {
  width: 100%;
  padding: 11px 46px 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  background: var(--bg);
  color: var(--text);
  transition: all var(--t-fast);
}
.input-unit input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.input-unit span {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  pointer-events: none;
}

.calc-btn {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 14px;
  background: var(--gradient-brand);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: all var(--t) var(--ease-spring);
  box-shadow: var(--shadow-brand);
}
.calc-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(99,102,241,0.4);
}
.calc-btn:active { transform: translateY(0); }

.calc-result { display: none; }
.calc-result.visible {
  display: block;
  animation: tabFadeIn var(--t-slow) var(--ease-spring);
}

.result-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.result-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
  border-top: 3px solid transparent;
  border-top-color: var(--primary);
  transition: all var(--t) var(--ease-spring);
}
.result-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.result-card:nth-child(1) { border-top-color: #6366F1; }
.result-card:nth-child(2) { border-top-color: #10B981; }
.result-card:nth-child(3) { border-top-color: #0EA5E9; }
.result-card:nth-child(4) {
  border-top: none;
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.result-card .r-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.result-card:nth-child(4) .r-label { color: rgba(255,255,255,0.7); }
.result-card .r-value { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em; color: var(--text); }
.result-card:nth-child(4) .r-value { color: #fff; }
.result-card .r-sub { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }
.result-card:nth-child(4) .r-sub { color: rgba(255,255,255,0.65); }

/* ── 21. TAX VISUAL ──────────────────────────────────────────── */
.tax-visual { display: flex; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.tax-box {
  flex: 1;
  min-width: 160px;
  border-radius: var(--radius-sm);
  padding: 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  text-align: center;
  transition: all var(--t);
}
.tax-box:hover { border-color: var(--primary); background: #EEF2FF; }
.tax-box.highlight {
  border-color: var(--primary);
  background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
  box-shadow: var(--shadow-brand);
}
.tx-amount { font-size: 1.4rem; font-weight: 800; color: var(--primary); letter-spacing: -0.03em; }
.tx-label  { font-size: 0.73rem; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }

/* ── 22. CHART WRAPPER ───────────────────────────────────────── */
.chart-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  padding: 28px;
  transition: box-shadow var(--t);
}
.chart-wrap:hover { box-shadow: var(--shadow-md); }

/* ── 23. ANIMATIONS (Scroll Reveal) ─────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--t-slow) var(--ease-spring),
              transform var(--t-slow) var(--ease-spring);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Card animation delay cascade */
.reveal-1 { transition-delay: 0.05s; }
.reveal-2 { transition-delay: 0.10s; }
.reveal-3 { transition-delay: 0.15s; }
.reveal-4 { transition-delay: 0.20s; }
.reveal-5 { transition-delay: 0.25s; }

/* ── 24. NUMBER COUNTER ──────────────────────────────────────── */
.counter { font-variant-numeric: tabular-nums; }

/* ── 25. CUSTOM SCROLLBAR ────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

/* ── 26. SIDEBAR OVERLAY ─────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 99;
}
.sidebar-overlay.open { display: block; }

/* ── 27. RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .result-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1000px) {
  .main-inner { padding: 24px 20px; }
  .page-header { padding: 16px 20px; }
  .home-hero { padding: 36px 32px; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .content { margin-left: 0; }
  .hamburger { display: flex; }
  .page-header { padding: 14px 16px; padding-left: 62px; }
  .main-inner { padding: 20px 16px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .calc-form { grid-template-columns: 1fr; }
  .home-hero { flex-direction: column; padding: 28px 24px; }
  .hero-stats { width: 100%; justify-content: flex-start; }
}
@media (max-width: 600px) {
  .grid-4 { grid-template-columns: 1fr; }
  .result-cards { grid-template-columns: 1fr; }
  .tax-visual { flex-direction: column; }
  .home-hero h2 { font-size: 1.5rem; }
  .sub-tabs { gap: 6px; }
  .sub-tab-btn { padding: 7px 14px; font-size: 0.8rem; }
}
