/* ==========================================================================
   CareerPro AI — Global Design System
   Master stylesheet: tokens, base, components, utilities
   ========================================================================== */

/* ----------  Design Tokens  ---------- */
:root {
  /* Brand palette */
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-300: #a5b4fc;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-800: #3730a3;
  --brand-900: #312e81;

  /* Accent (teal/emerald for success & growth) */
  --accent-400: #2dd4bf;
  --accent-500: #14b8a6;
  --accent-600: #0d9488;

  /* Warm accent (amber for highlights) */
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;

  /* Status */
  --success: #10b981;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #3b82f6;

  /* Neutrals (light theme) */
  --bg:          #f6f7fb;
  --bg-soft:     #eef0f7;
  --surface:     #ffffff;
  --surface-2:   #f9fafb;
  --surface-3:   #f1f3f9;
  --border:      #e4e7f0;
  --text:        #1e2235;
  --text-muted:  #64708a;
  --text-soft:   #8a93ad;

  /* Gradients */
  --grad-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --grad-cool:  linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  --grad-warm:  linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --grad-hero:  linear-gradient(135deg, #4338ca 0%, #6366f1 45%, #8b5cf6 100%);
  --grad-mesh:  radial-gradient(at 0% 0%, #c7d2fe 0px, transparent 50%),
                radial-gradient(at 100% 0%, #e9d5ff 0px, transparent 50%),
                radial-gradient(at 100% 100%, #bcfeff 0px, transparent 50%),
                radial-gradient(at 0% 100%, #ddd6fe 0px, transparent 50%);

  /* Typography */
  --font-sans: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;

  /* Radius */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08), 0 2px 6px rgba(16, 24, 40, .06);
  --shadow-lg: 0 18px 40px -12px rgba(16, 24, 40, .18), 0 8px 20px -8px rgba(16, 24, 40, .12);
  --shadow-xl: 0 40px 80px -20px rgba(79, 70, 229, .35);
  --shadow-brand: 0 18px 40px -10px rgba(99, 102, 241, .45);

  /* Layout */
  --header-h: 72px;
  --sidebar-w: 264px;
  --container: 1240px;
  --gap: 1.5rem;

  /* Motion */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: .15s;
  --t: .25s;
  --t-slow: .45s;
}

/* Dark theme overrides */
[data-theme="dark"] {
  --bg:        #0b0f1e;
  --bg-soft:   #0e1430;
  --surface:   #151b33;
  --surface-2: #1a2140;
  --surface-3: #232b50;
  --border:    #283156;
  --text:      #e8ebf8;
  --text-muted:#9aa3c4;
  --text-soft: #6b7494;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,.35);
  --shadow-lg: 0 18px 40px -12px rgba(0,0,0,.55);
  --grad-mesh: radial-gradient(at 0% 0%, #1e2a5e 0px, transparent 50%),
               radial-gradient(at 100% 0%, #2d1b4e 0px, transparent 50%),
               radial-gradient(at 100% 100%, #0d3b4a 0px, transparent 50%),
               radial-gradient(at 0% 100%, #2a1e5e 0px, transparent 50%);
}

/* ----------  Reset & Base  ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
  min-height: 100vh;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--t-fast); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 1rem; }
ul, ol { list-style: none; }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
:focus-visible { outline: 3px solid var(--brand-400); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand-200); color: var(--brand-900); }
[data-theme="dark"] ::selection { background: var(--brand-600); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: var(--brand-300); border-radius: 8px; border: 2px solid var(--bg-soft); }
::-webkit-scrollbar-thumb:hover { background: var(--brand-500); }

/* ----------  Layout Utilities  ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }
.container-fluid { width: 100%; padding: 0 1.5rem; }
.section { padding: 5.5rem 0; }
.section-sm { padding: 3rem 0; }
.grid { display: grid; gap: var(--gap); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: .5rem; } .gap-md { gap: 1rem; } .gap-lg { gap: 1.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.text-gradient {
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hide { display: none !important; }
.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}.mt-4{margin-top:2rem}
.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}.mb-4{margin-bottom:2rem}

/* ----------  Typography Helpers  ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand-600); background: var(--brand-50);
  padding: .4rem .9rem; border-radius: var(--r-pill);
  border: 1px solid var(--brand-200);
}
[data-theme="dark"] .eyebrow { background: rgba(99,102,241,.12); border-color: rgba(99,102,241,.3); color: var(--brand-300); }
.section-title { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: .75rem; }
.section-subtitle { font-size: 1.05rem; color: var(--text-muted); max-width: 620px; }
.lead { font-size: 1.15rem; color: var(--text-muted); }

/* ----------  Buttons  ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-weight: 700; font-size: .95rem; line-height: 1;
  padding: .85rem 1.5rem; border-radius: var(--r-pill);
  transition: transform var(--t-fast) var(--ease-bounce), box-shadow var(--t), background var(--t), color var(--t);
  white-space: nowrap; user-select: none; border: 2px solid transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { box-shadow: 0 22px 48px -10px rgba(99,102,241,.6); color:#fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--brand-300); color: var(--brand-600); }
[data-theme="dark"] .btn-secondary { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-white { background: #fff; color: var(--brand-700); box-shadow: var(--shadow-md); }
.btn-white:hover { color: var(--brand-700); }
.btn-outline-white { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.4); backdrop-filter: blur(8px); }
.btn-outline-white:hover { background: rgba(255,255,255,.22); color:#fff; }
.btn-sm { padding: .55rem 1rem; font-size: .85rem; }
.btn-lg { padding: 1.05rem 2rem; font-size: 1.05rem; }
.btn-icon { padding: .6rem; width: 42px; height: 42px; border-radius: 50%; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ----------  Glass / Cards  ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.6rem;
  transition: transform var(--t) var(--ease), box-shadow var(--t), border-color var(--t);
}
.card-hover:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--brand-200); }
.glass {
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255,255,255,.5);
}
[data-theme="dark"] .glass {
  background: rgba(21,27,51,.7);
  border-color: rgba(255,255,255,.08);
}
.glass-dark {
  background: rgba(15,18,40,.55);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255,255,255,.12);
}

/* ----------  Badges & Pills  ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .75rem; font-weight: 700; padding: .3rem .7rem;
  border-radius: var(--r-pill); line-height: 1;
}
.badge-brand { background: var(--brand-50); color: var(--brand-700); }
.badge-success { background: rgba(16,185,129,.12); color: var(--success); }
.badge-warning { background: rgba(245,158,11,.14); color: var(--warning); }
.badge-danger { background: rgba(239,68,68,.12); color: var(--danger); }
.badge-info { background: rgba(59,130,246,.12); color: var(--info); }
.badge-soft { background: var(--surface-3); color: var(--text-muted); }
[data-theme="dark"] .badge-brand { background: rgba(99,102,241,.16); color: var(--brand-300); }

/* ----------  Forms  ---------- */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .45rem; color: var(--text); }
.form-label .req { color: var(--danger); }
.form-control, .form-select, textarea.form-control {
  width: 100%; padding: .8rem 1rem; font-size: .95rem;
  background: var(--surface-2); color: var(--text);
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t);
}
.form-control:focus, .form-select:focus, textarea.form-control:focus {
  outline: none; border-color: var(--brand-400);
  box-shadow: 0 0 0 4px rgba(99,102,241,.14); background: var(--surface);
}
.form-control::placeholder { color: var(--text-soft); }
textarea.form-control { resize: vertical; min-height: 120px; }
.input-group { position: relative; }
.input-group .form-control { padding-left: 2.6rem; }
.input-group-icon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--text-soft); }
.form-hint { font-size: .8rem; color: var(--text-soft); margin-top: .35rem; }
.form-error { font-size: .8rem; color: var(--danger); margin-top: .35rem; display: none; }
.form-control.invalid { border-color: var(--danger); }
.form-control.invalid + .form-error { display: block; }

/* ----------  Header / Navbar  ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border);
  transition: background var(--t), box-shadow var(--t);
}
[data-theme="dark"] .site-header { background: rgba(11,15,30,.8); }
.site-header.scrolled { box-shadow: var(--shadow-sm); }
.navbar { display: flex; align-items: center; gap: 1.5rem; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--grad-brand); display: grid; place-items: center;
  color: #fff; font-size: 1.2rem; box-shadow: var(--shadow-brand);
}
.brand-name b { color: var(--brand-600); }
[data-theme="dark"] .brand-name b { color: var(--brand-400); }
.nav-menu { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.nav-link {
  padding: .55rem .9rem; border-radius: var(--r-pill); font-weight: 600; font-size: .92rem;
  color: var(--text-muted); display: inline-flex; align-items: center; gap: .4rem;
  transition: color var(--t-fast), background var(--t-fast);
}
.nav-link:hover { color: var(--text); background: var(--surface-3); }
.nav-link.active { color: var(--brand-600); background: var(--brand-50); }
[data-theme="dark"] .nav-link.active { background: rgba(99,102,241,.15); color: var(--brand-300); }
.nav-actions { display: flex; align-items: center; gap: .6rem; }
.nav-toggle { display: none; font-size: 1.4rem; width: 44px; height: 44px; border-radius: 12px; align-items: center; justify-content: center; }
.theme-toggle { width: 42px; height: 42px; border-radius: 50%; background: var(--surface-3); color: var(--text); display: grid; place-items: center; transition: background var(--t-fast), transform var(--t-fast); }
.theme-toggle:hover { background: var(--brand-100); transform: rotate(20deg); }
[data-theme="dark"] .theme-toggle:hover { background: rgba(99,102,241,.25); }
.theme-toggle .fa-sun { display: none; }
[data-theme="dark"] .theme-toggle .fa-sun { display: block; }
[data-theme="dark"] .theme-toggle .fa-moon { display: none; }

/* Mobile drawer */
.mobile-nav {
  position: fixed; inset: 0 0 0 auto; width: min(320px, 85vw); z-index: 1100;
  background: var(--surface); box-shadow: var(--shadow-xl);
  transform: translateX(100%); transition: transform var(--t) var(--ease);
  display: flex; flex-direction: column; padding: 1.25rem;
  overflow-y: auto;
}
.mobile-nav.open { transform: translateX(0); }
.mobile-nav .nav-link { padding: .8rem 1rem; font-size: 1rem; border-radius: var(--r-md); }
.mobile-nav .nav-link.active { background: var(--brand-50); }
.mobile-nav-close { align-self: flex-end; font-size: 1.4rem; width: 40px; height: 40px; border-radius: 10px; }
.nav-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1050; opacity: 0; visibility: hidden; transition: opacity var(--t); }
.nav-backdrop.show { opacity: 1; visibility: visible; }

/* ----------  App Shell (dashboard layout)  ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: .25rem;
}
.app-sidebar .brand { padding: .5rem .75rem 1.25rem; margin-bottom: .5rem; border-bottom: 1px solid var(--border); }
.side-link {
  display: flex; align-items: center; gap: .85rem;
  padding: .75rem .9rem; border-radius: var(--r-md);
  color: var(--text-muted); font-weight: 600; font-size: .92rem;
  transition: all var(--t-fast);
}
.side-link i { width: 20px; text-align: center; font-size: 1rem; }
.side-link:hover { background: var(--surface-3); color: var(--text); }
.side-link.active { background: var(--grad-brand); color: #fff; box-shadow: var(--shadow-brand); }
.side-section-label { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-soft); padding: 1.1rem .9rem .4rem; }
.side-footer { margin-top: auto; padding: 1rem; }
.app-main { flex: 1; min-width: 0; }
.app-topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem;
  height: var(--header-h); padding: 0 1.75rem;
  background: rgba(255,255,255,.75); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .app-topbar { background: rgba(11,15,30,.75); }
.app-content { padding: 1.75rem; max-width: 1400px; margin: 0 auto; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.75rem; }
.page-title { font-size: 1.75rem; }
.page-desc { color: var(--text-muted); margin-top: .25rem; }
.sidebar-toggle { display: none; }

/* ----------  Stats / Metric Cards  ---------- */
.stat-card { display: flex; align-items: flex-start; gap: 1rem; }
.stat-icon { width: 52px; height: 52px; border-radius: var(--r-md); display: grid; place-items: center; font-size: 1.3rem; color: #fff; flex-shrink: 0; }
.stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.stat-label { color: var(--text-muted); font-size: .88rem; font-weight: 500; }
.stat-trend { font-size: .8rem; font-weight: 700; display: inline-flex; align-items: center; gap: .25rem; margin-top: .35rem; }
.trend-up { color: var(--success); } .trend-down { color: var(--danger); }

/* ----------  Progress Bars  ---------- */
.progress { height: 10px; background: var(--surface-3); border-radius: var(--r-pill); overflow: hidden; }
.progress-bar { height: 100%; border-radius: var(--r-pill); background: var(--grad-cool); transition: width 1s var(--ease); }
.progress-bar.brand { background: var(--grad-brand); }
.progress-bar.success { background: linear-gradient(90deg,#10b981,#34d399); }
.progress-bar.warm { background: var(--grad-warm); }

/* ----------  Ring / circular progress  ---------- */
.ring { position: relative; width: 140px; height: 140px; }
.ring svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 12; }
.ring-fg { fill: none; stroke: url(#ringGrad); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease); }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-value { font-size: 1.8rem; font-weight: 800; }

/* ----------  Tabs  ---------- */
.tabs { display: flex; gap: .35rem; flex-wrap: wrap; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; }
.tab-btn {
  padding: .7rem 1.1rem; font-weight: 600; font-size: .92rem; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--t-fast);
  display: inline-flex; align-items: center; gap: .45rem; border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.tab-btn:hover { color: var(--text); background: var(--surface-3); }
.tab-btn.active { color: var(--brand-600); border-bottom-color: var(--brand-600); }
[data-theme="dark"] .tab-btn.active { color: var(--brand-300); border-bottom-color: var(--brand-300); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .4s var(--ease); }

/* Pills filter variant */
.filter-pills { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.filter-pill {
  padding: .5rem 1rem; border-radius: var(--r-pill); font-size: .85rem; font-weight: 600;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
  transition: all var(--t-fast);
}
.filter-pill:hover { border-color: var(--brand-300); color: var(--text); }
.filter-pill.active { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }

/* ----------  Tables  ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th { text-align: left; padding: .9rem 1rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); font-weight: 700; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .9rem 1rem; border-bottom: 1px solid var(--border); font-size: .92rem; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--surface-2); }

/* ----------  Avatars  ---------- */
.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--grad-brand); display: inline-grid; place-items: center; color: #fff; font-weight: 700; }
.avatar-sm { width: 32px; height: 32px; font-size: .8rem; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.4rem; }

/* ----------  Toast  ---------- */
.toast-container { position: fixed; top: 1.5rem; right: 1.5rem; z-index: 2000; display: flex; flex-direction: column; gap: .65rem; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: .75rem; min-width: 280px; max-width: 360px;
  padding: .9rem 1.1rem; border-radius: var(--r-md); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); pointer-events: auto;
  animation: toastIn .4s var(--ease-bounce);
}
.toast.out { animation: toastOut .3s var(--ease) forwards; }
.toast-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.toast.success .toast-icon { background: var(--success); }
.toast.error .toast-icon { background: var(--danger); }
.toast.info .toast-icon { background: var(--info); }
.toast.warning .toast-icon { background: var(--warning); }
.toast-msg { font-size: .9rem; font-weight: 500; }

/* ----------  Modal  ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,18,40,.6); backdrop-filter: blur(4px); z-index: 1500; display: flex; align-items: center; justify-content: center; padding: 1.5rem; opacity: 0; visibility: hidden; transition: opacity var(--t); }
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-xl); width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; transform: translateY(20px) scale(.97); transition: transform var(--t) var(--ease-bounce); }
.modal-backdrop.open .modal { transform: translateY(0) scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.3rem 1.5rem; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 1.2rem; }
.modal-close { width: 36px; height: 36px; border-radius: 10px; font-size: 1.1rem; color: var(--text-muted); }
.modal-close:hover { background: var(--surface-3); }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1.1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: .65rem; }

/* ----------  Dropdown  ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: .4rem; z-index: 200;
  opacity: 0; visibility: hidden; transform: translateY(-8px); transition: all var(--t-fast);
}
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item { display: flex; align-items: center; gap: .65rem; padding: .6rem .75rem; border-radius: var(--r-sm); font-size: .9rem; font-weight: 500; color: var(--text); width: 100%; text-align: left; }
.dropdown-item:hover { background: var(--surface-3); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: .35rem 0; }

/* ----------  Empty state  ---------- */
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--text-muted); }
.empty-state i { font-size: 3rem; color: var(--brand-300); margin-bottom: 1rem; }

/* ----------  Skeleton loader  ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-sm); }
.skeleton-text { height: 12px; margin-bottom: .5rem; }
.skeleton-text.lg { height: 22px; }

/* ----------  Footer  ---------- */
.site-footer { background: #0e1430; color: #c7cee8; padding: 4rem 0 2rem; margin-top: 4rem; }
.site-footer a { color: #aab2d6; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2.5rem; margin-bottom: 3rem; }
.footer-brand .brand { color: #fff; margin-bottom: 1rem; }
.footer-brand p { color: #8b94be; max-width: 320px; }
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 1.1rem; }
.footer-col ul li { margin-bottom: .6rem; }
.footer-social { display: flex; gap: .6rem; margin-top: 1.25rem; }
.footer-social a { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.08); display: grid; place-items: center; font-size: 1.05rem; transition: all var(--t-fast); }
.footer-social a:hover { background: var(--grad-brand); transform: translateY(-3px); color:#fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.75rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: .88rem; color: #8b94be; }

/* ----------  Decorative blobs  ---------- */
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; z-index: 0; pointer-events: none; }
.blob-1 { width: 380px; height: 380px; background: var(--brand-300); top: -120px; right: -80px; }
.blob-2 { width: 320px; height: 320px; background: var(--accent-400); bottom: -120px; left: -80px; }

/* ----------  FAQ accordion  ---------- */
[data-faq] .fa-chevron-down { transition: transform var(--t); }
[data-faq] > div + div, [data-faq] > div:last-child {
  max-height: 0; overflow: hidden; transition: max-height var(--t-slow) var(--ease), margin-top var(--t);
}
[data-faq].open .fa-chevron-down { transform: rotate(180deg); }
[data-faq].open > div:last-child { max-height: 220px; }

/* ----------  Misc helpers  ---------- */
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.divider-y { width: 1px; background: var(--border); align-self: stretch; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.scrollbar-thin::-webkit-scrollbar { width: 6px; }
.tag { display: inline-flex; align-items: center; padding: .25rem .6rem; background: var(--surface-3); border-radius: var(--r-sm); font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.chip { display: inline-flex; align-items: center; gap:.35rem; padding: .35rem .75rem; border-radius: var(--r-pill); background: var(--brand-50); color: var(--brand-700); font-size:.82rem; font-weight:600; }
[data-theme="dark"] .chip { background: rgba(99,102,241,.15); color: var(--brand-300); }
.star { color: var(--amber-400); }

/* ==========================================================================
   Resume Builder — templates, preview, repeatable sections
   ========================================================================== */
.builder-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.builder-form { position: sticky; top: calc(var(--header-h) + 1rem); max-height: calc(100vh - var(--header-h) - 2rem); overflow-y: auto; padding-right: .5rem; }
@media (max-width: 992px) {
  .builder-layout { grid-template-columns: 1fr; }
  .builder-form { position: static; max-height: none; overflow: visible; }
}

.template-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.template-card {
  display: flex; flex-direction: column; gap: .2rem; padding: .85rem .6rem; text-align: center;
  border: 2px solid var(--border); border-radius: var(--r-md); background: var(--surface-2);
  transition: all var(--t-fast); cursor: pointer;
}
.template-card i { font-size: 1.2rem; color: var(--brand-500); }
.template-card strong { font-size: .85rem; }
.template-card small { font-size: .7rem; color: var(--text-soft); }
.template-card:hover { border-color: var(--brand-300); transform: translateY(-2px); }
.template-card.active { border-color: var(--brand-500); background: var(--brand-50); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .template-card.active { background: rgba(99,102,241,.12); }

.repeat-item { position: relative; padding: 1rem; border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: .75rem; background: var(--surface-2); }
.repeat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.repeat-grid .form-group:has(textarea), .repeat-grid .full { grid-column: 1 / -1; }
.repeat-del { position: absolute; top: .6rem; right: .6rem; color: var(--danger); }

/* Resume preview document */
.resume-preview {
  background: #fff; color: #1a1a2e; border-radius: var(--r-md); padding: 2.5rem 2.5rem;
  box-shadow: var(--shadow-lg); min-height: 600px; font-family: var(--font-sans);
  font-size: .92rem; line-height: 1.5;
}
[data-theme="dark"] .resume-preview { background: #fff; color: #1a1a2e; }
.resume-preview.pdf-mode { box-shadow: none; }
.rp-header { margin-bottom: 1.5rem; padding-bottom: 1rem; }
.rp-header h1 { font-size: 1.8rem; margin-bottom: .15rem; color: #1a1a2e; letter-spacing: -.02em; }
.rp-title { font-size: 1.05rem; color: var(--brand-600); font-weight: 600; margin-bottom: .5rem; }
.rp-contact { display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .8rem; color: #555; }
.rp-contact span { display: inline-flex; align-items: center; gap: .3rem; }
.rp-contact i { color: var(--brand-500); font-size: .75rem; }
.rp-section { margin-bottom: 1.3rem; }
.rp-section h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; color: var(--brand-600); border-bottom: 2px solid var(--brand-100); padding-bottom: .3rem; margin-bottom: .7rem; }
.rp-item { margin-bottom: .8rem; }
.rp-item-head { font-size: .92rem; }
.rp-item-head strong { color: #1a1a2e; }
.rp-item-meta { font-size: .78rem; color: #777; margin-bottom: .2rem; }
.rp-item p { font-size: .85rem; color: #444; }
.rp-empty { font-size: .8rem; color: #aaa; font-style: italic; }
.rp-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.rp-skills { display: flex; flex-wrap: wrap; gap: .4rem; }
.rp-skill { display: inline-flex; flex-direction: column; align-items: center; padding: .3rem .65rem; background: var(--brand-50); border-radius: var(--r-sm); font-size: .78rem; font-weight: 600; color: var(--brand-700); }
.rp-skill small { font-size: .65rem; font-weight: 500; opacity: .8; }
.rp-certs { list-style: disc inside; font-size: .85rem; }
.rp-certs span { color: #777; }

/* Template variants */
.tpl-modern .rp-header { border-left: 5px solid var(--brand-500); padding-left: 1rem; }
.tpl-classic { text-align: center; }
.tpl-classic .rp-header { text-align: center; border-bottom: 2px solid #1a1a2e; }
.tpl-classic .rp-contact { justify-content: center; }
.tpl-classic .rp-section h2 { text-align: left; }
.tpl-minimal .rp-header h1 { font-weight: 400; }
.tpl-minimal .rp-section h2 { border: none; text-transform: none; font-size: 1rem; }
.tpl-minimal .rp-item { border-bottom: 1px solid #eee; }
.tpl-creative .rp-header { background: var(--grad-brand); color: #fff; padding: 1.5rem; border-radius: var(--r-md); margin-bottom: 1.5rem; }
.tpl-creative .rp-header h1, .tpl-creative .rp-title { color: #fff; }
.tpl-creative .rp-title { opacity: .9; }
.tpl-creative .rp-contact { color: rgba(255,255,255,.9); }
.tpl-creative .rp-contact i { color: #fff; }

/* ATS checker */
.ats-check { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; font-size: .88rem; }
.ats-check i { font-size: 1rem; }
.ats-check strong { margin-left: auto; color: var(--text-soft); font-size: .8rem; }
.ats-check.ok i { color: var(--success); }
.ats-check.miss i { color: var(--text-soft); }
.ats-check.miss span { color: var(--text-muted); }

/* Resume version list */
.version-item { display: flex; align-items: center; justify-content: space-between; padding: .65rem; border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: .5rem; background: var(--surface-2); }

@media (max-width: 640px) {
  .template-grid { grid-template-columns: repeat(2, 1fr); }
  .repeat-grid { grid-template-columns: 1fr; }
  .resume-preview { padding: 1.5rem; }
  .rp-2col { grid-template-columns: 1fr; }
}
