:root {
  --bg: #0b0d14;
  --surface: #13151f;
  --surface2: #1c1f2e;
  --surface3: #252840;
  --border: #2a2d45;
  --accent: #6366f1;
  --accent2: #818cf8;
  --accent3: #4f46e5;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --muted: #64748b;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; line-height: 1.6; }

a { color: var(--accent2); text-decoration: none; }
a:hover { color: var(--accent); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* NAV */
.nav { position: sticky; top: 0; z-index: 100; background: rgba(11,13,20,.85); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 64px; max-width: 1200px; margin: 0 auto; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 800; color: var(--text); }
.nav-brand i { color: var(--accent); font-size: 1.5rem; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link { padding: 7px 14px; border-radius: var(--radius-sm); color: var(--text2); font-size: 0.9rem; font-weight: 500; transition: all .2s; }
.nav-link:hover, .nav-link.active { background: var(--surface2); color: var(--text); }
.nav-user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; color: #fff; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.9rem; cursor: pointer; border: none; transition: all .2s; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent3); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,.4); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: #fff; }
.btn-lg { padding: 13px 28px; font-size: 1rem; border-radius: 10px; }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* HERO */
.hero { position: relative; overflow: hidden; padding: 100px 0 80px; }
.hero-bg { position: absolute; inset: 0; background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(99,102,241,.25), transparent); pointer-events: none; }
.hero .container { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.hero-content { position: relative; }
.badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(99,102,241,.15); border: 1px solid rgba(99,102,241,.3); color: var(--accent2); padding: 6px 14px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; margin-bottom: 20px; }
.hero h1 { font-size: 3.2rem; font-weight: 900; line-height: 1.1; margin-bottom: 20px; }
.gradient-text { background: linear-gradient(135deg, var(--accent), #a78bfa, #60a5fa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: var(--text2); font-size: 1.1rem; margin-bottom: 32px; max-width: 480px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* CV Preview Card */
.hero-visual { display: flex; justify-content: center; }
.cv-preview-card { width: 280px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: float 4s ease-in-out infinite; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
.cv-preview-header { height: 80px; background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.cv-preview-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--surface3); border: 3px solid var(--bg); margin: -26px auto 0; }
.cv-preview-lines { padding: 16px; }
.line { height: 10px; border-radius: 5px; background: var(--surface3); margin-bottom: 8px; }
.l1 { width: 60%; } .l2 { width: 80%; } .l3 { width: 45%; } .l4 { width: 70%; } .l5 { width: 90%; } .l6 { width: 55%; }
.short { width: 40% !important; }
.line-gap { height: 12px; }

/* FEATURES */
.features { padding: 80px 0; }
.section-title { font-size: 2rem; font-weight: 800; margin-bottom: 40px; text-align: center; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; transition: all .3s; }
.feature-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.feature-icon { width: 48px; height: 48px; border-radius: 12px; background: rgba(99,102,241,.15); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.feature-icon i { font-size: 1.5rem; color: var(--accent2); }
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: var(--text2); font-size: 0.88rem; }
.feature-card code { background: var(--surface3); padding: 1px 5px; border-radius: 4px; font-size: 0.82rem; }

/* DASHBOARD */
.dashboard { padding: 40px 0 80px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.page-title { font-size: 1.8rem; font-weight: 800; }
.page-sub { color: var(--text2); margin-top: 4px; font-size: 0.9rem; }

.cv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.cv-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all .3s; }
.cv-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.cv-card-header { padding: 20px; background: linear-gradient(135deg, var(--surface2), var(--surface3)); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; }
.cv-card-avatar { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; color: #fff; flex-shrink: 0; }
.cv-card-info { flex: 1; min-width: 0; }
.cv-card-name { font-weight: 700; font-size: 1rem; }
.cv-card-slug { color: var(--muted); font-size: 0.8rem; }
.cv-card-body { padding: 16px 20px; }
.cv-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.badge-type { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-professional { background: rgba(99,102,241,.2); color: var(--accent2); }
.badge-student { background: rgba(34,197,94,.15); color: #86efac; }
.badge-public { background: rgba(245,158,11,.15); color: #fcd34d; }
.badge-private { background: rgba(100,116,139,.15); color: var(--muted); }
.cv-card-actions { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; }

.empty-state { text-align: center; padding: 80px 20px; }
.empty-state i { font-size: 4rem; color: var(--border); margin-bottom: 16px; display: block; }
.empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; }
.empty-state p { color: var(--text2); margin-bottom: 24px; }

/* FORMS */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.form-card-header { padding: 24px 28px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.form-card-header h2 { font-size: 1.2rem; font-weight: 700; }
.form-card-header i { color: var(--accent); font-size: 1.3rem; }
.form-card-body { padding: 28px; }
.form-section { margin-bottom: 36px; }
.form-section-title { font-size: 0.95rem; font-weight: 700; color: var(--accent2); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: .05em; font-size: 0.8rem; }
.form-group { margin-bottom: 16px; }
label.form-label { display: block; font-size: 0.85rem; color: var(--text2); margin-bottom: 6px; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=tel], input[type=url], input[type=number], textarea, select {
  width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); padding: 10px 14px; font-size: 0.92rem; transition: border .2s; font-family: inherit;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); }
.form-row { display: grid; gap: 14px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* DYNAMIC LIST */
.dynamic-list { display: flex; flex-direction: column; gap: 12px; }
.dynamic-item { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; position: relative; }
.dynamic-item-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; cursor: pointer; }
.dynamic-item-handle { color: var(--muted); cursor: grab; }
.dynamic-item-title { font-weight: 600; font-size: 0.9rem; flex: 1; }
.dynamic-item-remove { color: var(--danger); background: none; border: none; cursor: pointer; padding: 4px; border-radius: 6px; display: flex; align-items: center; }
.dynamic-item-remove:hover { background: rgba(239,68,68,.1); }
.add-btn { display: flex; align-items: center; gap: 8px; color: var(--accent2); background: rgba(99,102,241,.1); border: 1px dashed rgba(99,102,241,.3); border-radius: var(--radius-sm); padding: 10px 16px; cursor: pointer; font-size: 0.9rem; font-weight: 500; width: 100%; transition: all .2s; }
.add-btn:hover { background: rgba(99,102,241,.15); border-color: var(--accent); }

/* TABS */
.tabs { display: flex; gap: 4px; background: var(--surface2); padding: 4px; border-radius: 10px; margin-bottom: 28px; }
.tab { flex: 1; padding: 9px; text-align: center; border-radius: 7px; font-size: 0.88rem; font-weight: 600; cursor: pointer; color: var(--text2); transition: all .2s; border: none; background: none; }
.tab.active { background: var(--surface3); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.3); }

/* TEMPLATES */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.template-card { border: 2px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; transition: all .2s; }
.template-card:hover, .template-card.selected { border-color: var(--accent); }
.template-card.selected { box-shadow: 0 0 0 3px rgba(99,102,241,.2); }
.template-preview { height: 110px; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.template-preview.modern { background: linear-gradient(135deg, #1e1b4b, #312e81); }
.template-preview.classic { background: linear-gradient(135deg, #1e3a2f, #14532d); }
.template-preview.minimal { background: linear-gradient(135deg, #1a1a2e, #2d2d44); }
.template-preview.bold { background: linear-gradient(135deg, #450a0a, #7f1d1d); }
.template-name { padding: 10px; text-align: center; font-size: 0.85rem; font-weight: 600; background: var(--surface2); }

/* ALERTS */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.alert-error { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.25); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.25); color: #86efac; }
.alert-info { background: rgba(99,102,241,.12); border: 1px solid rgba(99,102,241,.25); color: var(--accent2); }

/* TOGGLE */
.toggle-wrap { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle { appearance: none; width: 42px; height: 22px; background: var(--border); border-radius: 999px; position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.toggle:checked { background: var(--accent); }
.toggle::after { content: ''; position: absolute; width: 16px; height: 16px; background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: left .2s; }
.toggle:checked::after { left: 23px; }

/* FOOTER */
footer { border-top: 1px solid var(--border); padding: 24px; text-align: center; color: var(--muted); font-size: 0.85rem; }

/* AUTH PAGES */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo h1 { font-size: 1.6rem; font-weight: 800; }
.auth-logo p { color: var(--text2); font-size: 0.9rem; margin-top: 6px; }

/* CV PUBLIC VIEW - MODERN */
.cv-public { min-height: 100vh; }
.cv-header-modern { background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%); padding: 60px 0 80px; position: relative; overflow: hidden; }
.cv-header-modern::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 60px; background: var(--bg); clip-path: ellipse(55% 100% at 50% 100%); }
.cv-body { max-width: 820px; margin: 0 auto; padding: 0 24px 60px; }
.cv-section { margin-bottom: 48px; }
.cv-section-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent2); margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.cv-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* TIMELINE */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 28px; }
.timeline-item::before { content: ''; position: absolute; left: -24px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); box-shadow: 0 0 0 3px rgba(99,102,241,.2); }
.timeline-date { font-size: 0.78rem; color: var(--muted); margin-bottom: 4px; }
.timeline-title { font-weight: 700; font-size: 1rem; margin-bottom: 2px; }
.timeline-sub { color: var(--text2); font-size: 0.88rem; margin-bottom: 6px; }
.timeline-desc { color: var(--text2); font-size: 0.88rem; }

/* SKILL TAGS */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--surface2); border: 1px solid var(--border); padding: 5px 12px; border-radius: 999px; font-size: 0.82rem; color: var(--text2); }

/* CONTACT GRID */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.contact-item { display: flex; align-items: center; gap: 10px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.contact-item i { color: var(--accent2); font-size: 1.2rem; flex-shrink: 0; }
.contact-item-text { font-size: 0.85rem; }
.contact-item-label { color: var(--muted); font-size: 0.75rem; }

/* REFS */
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.ref-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; }
.ref-name { font-weight: 700; margin-bottom: 2px; }
.ref-title { color: var(--accent2); font-size: 0.85rem; margin-bottom: 10px; }
.ref-detail { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text2); margin-bottom: 4px; }

/* ADMIN */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 64px); }
.admin-sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 20px 0; }
.admin-sidebar-link { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: var(--text2); font-size: 0.9rem; transition: all .2s; }
.admin-sidebar-link:hover, .admin-sidebar-link.active { background: var(--surface2); color: var(--text); }
.admin-sidebar-link i { font-size: 1.1rem; }
.admin-content { padding: 32px; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-value { font-size: 2rem; font-weight: 800; }
.stat-label { color: var(--text2); font-size: 0.85rem; }

/* DATA TABLE */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 10px 14px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface2); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
}
