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

:root {
  --bg: #060812;
  --bg2: #0d1123;
  --surface: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.08);
  --accent: #6c63ff;
  --accent2: #00d4ff;
  --green: #00f5a0;
  --red: #ff4d6d;
  --yellow: #ffd166;
  --text: #e8eaf6;
  --muted: rgba(232,234,246,0.45);
  --glass: rgba(13,17,35,0.7);
  --glow: 0 0 40px rgba(108,99,255,0.2);
  --r: 16px;
  --sidebar: 260px;
}

* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

h1,h2,h3,h4,h5 { font-family: 'Syne', sans-serif; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

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

.sidebar {
  width: var(--sidebar);
  background: var(--glass);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(20px);
  position: fixed;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 10;
  transition: transform .3s ease;
}

.main { margin-left: var(--sidebar); flex: 1; padding: 32px; }

/* ── LOGO ── */
.logo {
  padding: 28px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 18px;
}
.logo-text { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 800; }
.logo-text span { color: var(--accent); }

/* ── NAV ── */
.nav { flex: 1; padding: 20px 12px; display: flex; flex-direction: column; gap: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: all .2s ease;
  text-decoration: none;
  position: relative;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(108,99,255,0.2), rgba(0,212,255,0.1));
  color: var(--text);
  border: 1px solid rgba(108,99,255,0.3);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; height: 60%;
  width: 3px;
  background: linear-gradient(var(--accent), var(--accent2));
  border-radius: 0 4px 4px 0;
}
.nav-item .icon { font-size: 18px; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

.nav-section {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--muted);
  padding: 12px 14px 6px;
  text-transform: uppercase;
}

/* ── USER CARD at bottom ── */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}
.user-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .2s;
}
.user-mini:hover { background: var(--surface); }
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.avatar.lg { width: 72px; height: 72px; font-size: 28px; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--accent); font-weight: 500; }

/* ── TOPBAR ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}
.topbar-title { font-size: 26px; font-weight: 800; flex: 1; }
.topbar-title span { color: var(--accent); }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  backdrop-filter: blur(10px);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--glow); border-color: rgba(108,99,255,0.3); }

.card-title { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.card-value { font-family: 'Syne', sans-serif; font-size: 36px; font-weight: 800; }
.card-delta { font-size: 12px; color: var(--green); margin-top: 4px; }

/* ── STAT GRID ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all .3s ease;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  border-radius: 50%;
  opacity: 0.08;
}
.stat-card.blue::before { background: var(--accent2); }
.stat-card.purple::before { background: var(--accent); }
.stat-card.green::before { background: var(--green); }
.stat-card.red::before { background: var(--red); }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 20px 40px rgba(0,0,0,0.3); }

.stat-icon { font-size: 28px; margin-bottom: 12px; }

/* ── GRID ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s ease;
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #9c63ff);
  color: white;
  box-shadow: 0 4px 20px rgba(108,99,255,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(108,99,255,0.6); }

.btn-glass {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-glass:hover { background: rgba(255,255,255,0.08); border-color: var(--accent); }

.btn-danger { background: rgba(255,77,109,0.15); border: 1px solid rgba(255,77,109,0.4); color: var(--red); }
.btn-danger:hover { background: rgba(255,77,109,0.25); }

.btn-success { background: rgba(0,245,160,0.15); border: 1px solid rgba(0,245,160,0.4); color: var(--green); }
.btn-success:hover { background: rgba(0,245,160,0.25); }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-icon { padding: 10px; }

/* ── FORMS ── */
.form-group { margin-bottom: 20px; position: relative; }
.form-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  transition: all .2s ease;
  outline: none;
  box-sizing: border-box;
  position: relative;
  z-index: 99999;
  pointer-events: auto;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,99,255,0.15); }
.form-input::placeholder { color: var(--muted); }
select.form-input option { background: var(--bg2); }
textarea.form-input { resize: vertical; min-height: 100px; }

.password-wrapper { position: relative; display: flex; align-items: center; overflow: hidden; }
.password-wrapper .form-input { padding-right: 40px; flex: 1; box-sizing: border-box; }
.password-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  color: var(--muted);
  z-index: 10;
}
.password-toggle:hover { color: var(--text); }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-green { background: rgba(0,245,160,0.15); color: var(--green); border: 1px solid rgba(0,245,160,0.3); }
.badge-red { background: rgba(255,77,109,0.15); color: var(--red); border: 1px solid rgba(255,77,109,0.3); }
.badge-yellow { background: rgba(255,209,102,0.15); color: var(--yellow); border: 1px solid rgba(255,209,102,0.3); }
.badge-blue { background: rgba(0,212,255,0.15); color: var(--accent2); border: 1px solid rgba(0,212,255,0.3); }
.badge-purple { background: rgba(108,99,255,0.15); color: var(--accent); border: 1px solid rgba(108,99,255,0.3); }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.03); font-size: 14px; }
tr:hover td { background: var(--surface); }
tr:last-child td { border-bottom: none; }

/* ── SEARCH ── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  transition: border-color .2s;
}
.search-bar:focus-within { border-color: var(--accent); }
.search-bar input { background: none; border: none; outline: none; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 14px; flex: 1; }
.search-bar input::placeholder { color: var(--muted); }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 99999;
  display: none;
  place-items: center;
  pointer-events: auto;
}
.modal-overlay.open { display: grid; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .3s ease;
  z-index: 100000;
  position: relative;
  pointer-events: auto;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-size: 20px; font-weight: 800; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; padding: 4px; border-radius: 8px; transition: color .2s, background .2s; }
.modal-close:hover { color: var(--text); background: var(--surface); }

/* ── TOAST ── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  animation: toastIn .3s ease;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.toast.success { border-color: rgba(0,245,160,0.4); }
.toast.error { border-color: rgba(255,77,109,0.4); }
.toast.info { border-color: rgba(108,99,255,0.4); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── JOB CARD ── */
.job-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px;
  transition: all .25s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.job-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transform: scaleX(0);
  transition: transform .3s ease;
}
.job-card:hover::after { transform: scaleX(1); }
.job-card:hover { border-color: rgba(108,99,255,0.3); transform: translateY(-3px); box-shadow: 0 20px 40px rgba(0,0,0,0.3); }

.job-company { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.job-title { font-family: 'Syne', sans-serif; font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.job-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.job-tag { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 3px 10px; font-size: 11px; color: var(--muted); }
.job-meta { display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--muted); }
.job-meta span { display: flex; align-items: center; gap: 4px; }

/* ── CANDIDATE CARD ── */
.candidate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all .2s ease;
}
.candidate-card:hover { border-color: rgba(108,99,255,0.3); background: rgba(255,255,255,0.06); }
.candidate-info { flex: 1; }
.candidate-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.candidate-title { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.candidate-actions { display: flex; gap: 8px; }

/* ── CHART CONTAINER ── */
.chart-container { position: relative; height: 220px; }

/* ── CHAT ── */
.chat-wrap { display: grid; grid-template-columns: 260px 1fr; gap: 0; height: 560px; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.chat-list { border-right: 1px solid var(--border); overflow-y: auto; }
.chat-item { padding: 14px 16px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background .2s; display: flex; gap: 10px; align-items: flex-start; }
.chat-item:hover, .chat-item.active { background: var(--surface); }
.chat-item-info { flex: 1; min-width: 0; }
.chat-item-name { font-size: 13px; font-weight: 600; }
.chat-item-preview { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-main { display: flex; flex-direction: column; }
.chat-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 70%; padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.5; }
.msg.sent { background: linear-gradient(135deg, var(--accent), #9c63ff); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.recv { background: var(--surface); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-input-bar { padding: 16px; border-top: 1px solid var(--border); display: flex; gap: 10px; }
.chat-input-bar input { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; color: var(--text); font-family: 'DM Sans', sans-serif; outline: none; }

/* ── TABS ── */
.tabs { display: flex; gap: 4px; background: var(--surface); border-radius: 12px; padding: 4px; margin-bottom: 24px; }
.tab { padding: 8px 20px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); border: none; background: none; font-family: 'DM Sans', sans-serif; transition: all .2s; }
.tab.active { background: var(--bg2); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }

/* ── PROGRESS ── */
.progress-bar { height: 6px; background: var(--surface); border-radius: 10px; overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 10px; transition: width .5s ease; }

/* ── TIMELINE ── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 16px; padding-bottom: 20px; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: 15px; top: 30px; bottom: 0; width: 1px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); display: grid; place-items: center; font-size: 12px; flex-shrink: 0; }
.timeline-content { flex: 1; }
.timeline-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.timeline-time { font-size: 11px; color: var(--muted); }

/* ── AUTH PAGE ── */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; position: relative; }
.auth-left {
  background: linear-gradient(135deg, var(--bg2), var(--bg));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
  z-index: 0;
}
.auth-left::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(108,99,255,0.15), transparent 70%);
  top: -100px; left: -100px;
  border-radius: 50%;
}
.auth-left::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(0,212,255,0.1), transparent 70%);
  bottom: -100px; right: -100px;
  border-radius: 50%;
}
.auth-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  background: var(--bg);
  z-index: 99999;
  position: relative;
}
.auth-form { max-width: 400px; width: 100%; z-index: 99999; position: relative; }
.auth-title { font-size: 32px; font-weight: 800; margin-bottom: 8px; }
.auth-sub { color: var(--muted); font-size: 14px; margin-bottom: 32px; }

.role-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.role-btn {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  transition: all .2s;
  font-size: 14px;
  font-weight: 500;
}
.role-btn:hover { border-color: var(--accent); color: var(--text); }
.role-btn.active { border-color: var(--accent); background: rgba(108,99,255,0.15); color: var(--text); }
.role-btn .role-icon { font-size: 24px; display: block; margin-bottom: 6px; }

/* ── MISC ── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.text-muted { color: var(--muted); font-size: 13px; }
.text-accent { color: var(--accent); }
.text-success { color: var(--green); }
.text-danger { color: var(--red); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-auto { margin-top: auto; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.page { display: none; }
.page.active { display: block; }

/* ── ANIMATIONS ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes spin { to { transform: rotate(360deg); } }

.fade-in { animation: fadeIn .4s ease forwards; }
.loading { animation: pulse 1.5s infinite; }

.skeleton { background: linear-gradient(90deg, var(--surface) 25%, rgba(255,255,255,0.08) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .chat-wrap { grid-template-columns: 1fr; }
  .chat-list { display: none; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 20px; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ── DROPDOWN ── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 180px;
  overflow: hidden;
  z-index: 500;
  display: none;
  animation: fadeIn .2s ease;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}
.dropdown-menu.open { display: block; }
.dropdown-item { padding: 10px 16px; font-size: 13px; cursor: pointer; transition: background .15s; display: flex; align-items: center; gap: 8px; }
.dropdown-item:hover { background: var(--surface); }
.dropdown-item.danger { color: var(--red); }

/* ── PROFILE ── */
.profile-header {
  background: linear-gradient(135deg, rgba(108,99,255,0.1), rgba(0,212,255,0.05));
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}
.profile-stats { display: flex; gap: 32px; margin-left: auto; }
.profile-stat { text-align: center; }
.profile-stat-value { font-family: 'Syne', sans-serif; font-size: 24px; font-weight: 800; }
.profile-stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

/* ── BG GLOW ── */
body::before {
  content: '';
  position: fixed;
  top: -200px; left: 30%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(108,99,255,0.06), transparent 70%);
  pointer-events: none;
  z-index: 0;
}