/* ============================================================
   MathCalc Pro — Global Stylesheet
   Color: Deep Blue #1a237e | Accent Cyan #00bcd4
   Fonts: Plus Jakarta Sans + JetBrains Mono
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── CSS Variables ── */
:root {
  --primary:        #1a237e;
  --primary-dark:   #0d1354;
  --primary-light:  #283593;
  --accent:         #00bcd4;
  --accent-dark:    #0097a7;
  --accent-light:   #4dd0e1;
  --success:        #00c853;
  --warning:        #ffab00;
  --danger:         #ff1744;

  --bg:             #ffffff;
  --bg-secondary:   #f0f4ff;
  --bg-card:        #ffffff;
  --bg-input:       #f5f7ff;

  --text-primary:   #0d1354;
  --text-secondary: #4a5568;
  --text-muted:     #8896b3;
  --text-inverse:   #ffffff;

  --border:         #dde3f5;
  --border-focus:   #00bcd4;
  --shadow-sm:      0 2px 8px rgba(26,35,126,0.08);
  --shadow-md:      0 4px 20px rgba(26,35,126,0.12);
  --shadow-lg:      0 8px 40px rgba(26,35,126,0.16);
  --shadow-xl:      0 20px 60px rgba(26,35,126,0.20);

  --radius-sm:      6px;
  --radius-md:      12px;
  --radius-lg:      20px;
  --radius-xl:      28px;

  --header-h:       68px;
  --transition:     0.22s cubic-bezier(0.4,0,0.2,1);
  --font-main:      'Plus Jakarta Sans', sans-serif;
  --font-mono:      'JetBrains Mono', monospace;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg:             #070d2a;
  --bg-secondary:   #0d1540;
  --bg-card:        #111b47;
  --bg-input:       #0d1540;
  --text-primary:   #e8eeff;
  --text-secondary: #a0aec0;
  --text-muted:     #5a6a8a;
  --border:         #1e2f6b;
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:      0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg:      0 8px 40px rgba(0,0,0,0.5);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dark); }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--font-main); }
input, select, textarea { font-family: var(--font-main); }

/* ── Typography ── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.25; color: var(--text-primary); }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); }
h4 { font-size: 1.1rem; }
p  { color: var(--text-secondary); line-height: 1.75; }
.mono { font-family: var(--font-mono); }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow var(--transition), background var(--transition);
}
.site-header.scrolled { box-shadow: var(--shadow-md); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  text-decoration: none;
}
.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.1rem; font-weight: 900;
  flex-shrink: 0;
}
.logo span { color: var(--accent); }

.main-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--bg-secondary);
}
.nav-dropdown { position: relative; }
.nav-dropdown-toggle { display: flex; align-items: center; gap: 4px; }
.nav-dropdown-toggle::after { content: '▾'; font-size: 0.7rem; }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
  z-index: 100;
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-dropdown-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition);
}
.nav-dropdown-menu a:hover { background: var(--bg-secondary); color: var(--primary); }
.nav-dropdown-menu .menu-icon { font-size: 1rem; width: 24px; text-align: center; }

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

/* Search Bar */
.header-search {
  position: relative;
  flex: 1;
  max-width: 280px;
}
.header-search input {
  width: 100%;
  padding: 8px 16px 8px 38px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition);
}
.header-search input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0,188,212,0.15);
}
.header-search .search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 200;
  display: none;
}
.search-results.active { display: block; }
.search-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-secondary); }
.search-result-item .result-icon { font-size: 1rem; width: 28px; text-align: center; }
.search-result-item .result-text { flex: 1; }
.search-result-item .result-title { font-size: 0.88rem; font-weight: 600; color: var(--text-primary); }
.search-result-item .result-cat  { font-size: 0.75rem; color: var(--text-muted); }

/* Theme Toggle */
.theme-toggle {
  width: 38px; height: 38px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.theme-toggle:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* Mobile Menu Toggle */
.mobile-menu-btn {
  display: none;
  width: 38px; height: 38px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-h); left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 999;
  overflow-y: auto;
  padding: 20px;
  transform: translateX(-100%);
  transition: transform var(--transition);
}
.mobile-nav.open { transform: translateX(0); }
.mobile-nav-links { display: flex; flex-direction: column; gap: 4px; }
.mobile-nav-links a {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  display: flex; align-items: center; gap: 10px;
  transition: all var(--transition);
}
.mobile-nav-links a:hover { background: var(--bg-secondary); color: var(--primary); }
.mobile-nav-section { margin-top: 16px; }
.mobile-nav-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 16px 4px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-main);
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 15px rgba(26,35,126,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(26,35,126,0.4);
  color: white;
}
.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  box-shadow: 0 4px 15px rgba(0,188,212,0.3);
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,188,212,0.4);
  color: white;
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-primary);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(26,35,126,0.04);
}
.btn-outline-accent {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}
.btn-outline-accent:hover {
  background: var(--accent);
  color: white;
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 14px;
}
.btn-ghost:hover { background: var(--bg-secondary); color: var(--primary); }
.btn-sm  { padding: 7px 16px; font-size: 0.82rem; }
.btn-lg  { padding: 14px 32px; font-size: 1rem; }
.btn-xl  { padding: 16px 40px; font-size: 1.05rem; border-radius: var(--radius-md); }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border: none;
}
.card-primary h3, .card-primary p, .card-primary h2 { color: white; }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  padding: 14px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--border); }
.breadcrumb .current { color: var(--text-primary); font-weight: 600; }

/* ── Page Header ── */
.page-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #1565c0 100%);
  padding: 56px 0 48px;
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.page-header .container { position: relative; z-index: 1; }
.page-header h1 { color: white; margin-bottom: 10px; }
.page-header p  { color: rgba(255,255,255,0.8); font-size: 1.05rem; max-width: 560px; }
.page-header .breadcrumb { margin-bottom: 16px; }
.page-header .breadcrumb, .page-header .breadcrumb a { color: rgba(255,255,255,0.65); }
.page-header .breadcrumb .current { color: white; }
.page-header .breadcrumb .sep { color: rgba(255,255,255,0.35); }

/* ── Section Titles ── */
.section-title { text-align: center; margin-bottom: 48px; }
.section-title h2 { margin-bottom: 12px; }
.section-title p  { color: var(--text-muted); max-width: 520px; margin: 0 auto; }
.section-title .tag {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(0,188,212,0.12);
  color: var(--accent-dark);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

/* ── Badge ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-primary  { background: rgba(26,35,126,0.12); color: var(--primary); }
.badge-accent   { background: rgba(0,188,212,0.12); color: var(--accent-dark); }
.badge-success  { background: rgba(0,200,83,0.12);  color: var(--success); }
.badge-warning  { background: rgba(255,171,0,0.15); color: #e65100; }
.badge-pro      { background: linear-gradient(135deg, #f6d365, #fda085); color: #7a3500; }
.badge-free     { background: var(--bg-secondary); color: var(--text-muted); }

/* ── Forms ── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 7px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition);
  font-family: var(--font-main);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0,188,212,0.12);
  background: var(--bg-card);
}
.form-input.mono { font-family: var(--font-mono); }
.form-input.error { border-color: var(--danger); }
.form-error {
  font-size: 0.78rem; color: var(--danger);
  margin-top: 5px; display: none;
}
.form-error.visible { display: block; }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-textarea { resize: vertical; min-height: 100px; }

/* ── Tabs ── */
.tabs { border-bottom: 1px solid var(--border); margin-bottom: 32px; display: flex; gap: 4px; overflow-x: auto; }
.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Result Box ── */
.result-box {
  background: linear-gradient(135deg, var(--primary) 0%, #1565c0 100%);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-top: 20px;
  display: none;
}
.result-box.visible { display: block; animation: slideUp 0.3s ease; }
.result-box .result-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.7);
  margin-bottom: 6px;
}
.result-box .result-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 600;
  color: white;
  word-break: break-all;
}
.result-box .result-sub {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
  margin-top: 6px;
}
.result-actions {
  display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap;
}
.result-actions .btn { font-size: 0.78rem; padding: 6px 14px; }

/* Steps display */
.steps-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 16px;
  display: none;
}
.steps-box.visible { display: block; }
.steps-box h4 { margin-bottom: 12px; font-size: 0.9rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.step-item {
  display: flex; gap: 12px; margin-bottom: 12px; align-items: flex-start;
}
.step-num {
  min-width: 24px; height: 24px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.step-text { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; }
.step-text .math { font-family: var(--font-mono); color: var(--primary); font-weight: 600; }

/* ── AdSense Banners ── */
.ad-banner {
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.ad-banner::before {
  content: 'Advertisement';
  position: absolute;
  top: 4px; left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.ad-leaderboard { width: 100%; height: 90px; }
.ad-rectangle   { width: 300px; height: 250px; }
.ad-responsive  { width: 100%; height: 120px; margin: 32px 0; }

/* ── Affiliate Cards ── */
.affiliate-section { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.affiliate-section h3 { font-size: 1rem; color: var(--text-muted); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.affiliate-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.affiliate-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex; align-items: center; gap: 12px;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
}
.affiliate-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.affiliate-card .aff-icon {
  width: 40px; height: 40px;
  background: var(--bg-secondary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.affiliate-card .aff-text .aff-name { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.affiliate-card .aff-text .aff-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }

/* ── Toast ── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  min-width: 260px;
  max-width: 360px;
  animation: toastIn 0.3s ease;
  border-left: 3px solid var(--accent);
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast .toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast .toast-msg  { flex: 1; color: var(--text-primary); font-weight: 500; }
.toast .toast-close { cursor: pointer; color: var(--text-muted); font-size: 1rem; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(7,13,42,0.65);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.3s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.1rem; }
.modal-close {
  width: 32px; height: 32px;
  background: var(--bg-secondary);
  border: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--danger); color: white; }
.modal-body { padding: 24px 28px; }
.modal-footer {
  padding: 16px 28px 24px;
  display: flex; gap: 10px; justify-content: flex-end;
  border-top: 1px solid var(--border);
}

/* ── Loader / Spinner ── */
.spinner {
  width: 22px; height: 22px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.spinner.dark {
  border-color: rgba(26,35,126,0.2);
  border-top-color: var(--primary);
}
.spinner.visible { display: block; }

/* ── Pro Gate ── */
.pro-gate {
  background: linear-gradient(135deg, #fffde7, #fff8e1);
  border: 1px solid #ffcc02;
  border-radius: var(--radius-md);
  padding: 20px;
  display: none;
  text-align: center;
}
[data-theme="dark"] .pro-gate { background: linear-gradient(135deg, #2a2000, #1a1500); border-color: #664d00; }
.pro-gate.visible { display: block; }
.pro-gate .pro-icon { font-size: 2rem; margin-bottom: 8px; }
.pro-gate h4 { margin-bottom: 6px; }
.pro-gate p  { font-size: 0.85rem; margin-bottom: 14px; }

/* ── Sidebar Layout ── */
.page-layout { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: start; }
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; }
.sidebar-card h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 14px; }

/* ── Stats Strip ── */
.stats-strip {
  background: var(--primary);
  padding: 24px 0;
}
.stats-strip .stats-inner {
  display: flex; align-items: center; justify-content: space-around;
  gap: 24px; flex-wrap: wrap;
}
.stat-item { text-align: center; color: white; }
.stat-item .stat-num { font-size: 1.8rem; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-item .stat-label { font-size: 0.8rem; opacity: 0.7; }

/* ── Footer ── */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.8);
  padding: 56px 0 32px;
  margin-top: auto;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand .logo { margin-bottom: 14px; }
.footer-brand .logo { color: white; }
.footer-brand p { font-size: 0.88rem; opacity: 0.7; line-height: 1.7; }
.footer-col h5 { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: white; margin-bottom: 16px; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { font-size: 0.85rem; color: rgba(255,255,255,0.6); transition: color var(--transition); }
.footer-col ul li a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.footer-bottom p { font-size: 0.82rem; opacity: 0.6; }
.footer-socials { display: flex; gap: 10px; }
.footer-socials a {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  transition: all var(--transition);
}
.footer-socials a:hover { background: var(--accent); color: white; }

/* ── Animations ── */
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp  { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes modalIn  { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes pulse    { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes float    { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.animate-fadeIn { animation: fadeIn 0.5s ease; }
.animate-slideUp { animation: slideUp 0.4s ease; }
.animate-float   { animation: float 3s ease-in-out infinite; }

/* ── Utilities ── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-primary-color { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.w-full { width: 100%; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .grid-4  { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; }
  .sidebar-card { flex: 1 1 260px; }
  .ad-rectangle { width: 100%; height: 90px; }
}
@media (max-width: 768px) {
  :root { --header-h: 60px; }
  .main-nav, .header-search { display: none; }
  .mobile-menu-btn { display: flex; }
  .mobile-nav { display: block; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .form-row { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .stats-strip .stats-inner { gap: 16px; }
  .stat-item .stat-num { font-size: 1.4rem; }
  .tabs { gap: 0; }
  .tab-btn { padding: 9px 14px; font-size: 0.82rem; }
  .modal { border-radius: var(--radius-lg); }
  .page-header { padding: 36px 0 28px; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .card { padding: 20px; }
  .grid-4 { grid-template-columns: 1fr; }
  .btn-xl { padding: 13px 28px; font-size: 0.95rem; }
  h1 { font-size: 1.7rem; }
}
