:root {
  --gold: #C9A84C;
  --gold-dark: #a8863a;
  --gold-light: #e8d08e;
  --bg: #f8f9fa;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6c757d;
  --border: #dee2e6;
  --danger: #dc3545;
  --success: #198754;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-dark); }

/* ── LANDING ── */
.hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hero-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
}

.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; }
.logo-icon { width: 36px; height: 36px; background: var(--gold); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 900; color: #1a1a2e; }

.hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}

.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.2; margin-bottom: 20px; }
.hero h1 span { color: var(--gold); }
.hero p { font-size: 1.1rem; color: rgba(255,255,255,0.75); max-width: 560px; margin-bottom: 36px; }

.hero-badges { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 40px; }
.badge { background: rgba(255,255,255,0.1); border: 1px solid rgba(201,168,76,0.4); color: var(--gold-light); padding: 6px 14px; border-radius: 20px; font-size: 0.85rem; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  padding: 60px 40px;
  max-width: 1000px;
  margin: 0 auto;
}

.feature-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 12px;
  padding: 24px;
  text-align: left;
}
.feature-card .icon { font-size: 2rem; margin-bottom: 12px; }
.feature-card h3 { color: var(--gold-light); margin-bottom: 8px; }
.feature-card p { color: rgba(255,255,255,0.6); font-size: 0.9rem; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-gold { background: var(--gold); color: #1a1a2e; }
.btn-gold:hover { background: var(--gold-dark); color: #1a1a2e; }
.btn-outline { background: transparent; border: 2px solid var(--gold); color: var(--gold); }
.btn-outline:hover { background: var(--gold); color: #1a1a2e; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b02a37; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #ced4da; }
.btn-success { background: var(--success); color: #fff; }

/* ── AUTH FORMS ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 20px;
}

.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-card .logo { justify-content: center; margin-bottom: 28px; color: var(--text); font-size: 1.3rem; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; color: var(--text-muted); }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  background: var(--bg);
}
.form-control:focus { outline: none; border-color: var(--gold); background: #fff; }

.form-divider { text-align: center; color: var(--text-muted); margin: 16px 0; position: relative; }
.form-divider::before, .form-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--border);
}
.form-divider::before { left: 0; }
.form-divider::after { right: 0; }

.btn-google {
  width: 100%;
  justify-content: center;
  background: #fff;
  border: 2px solid var(--border);
  color: var(--text);
  font-weight: 600;
  padding: 10px;
  border-radius: 8px;
}
.btn-google:hover { border-color: #aaa; }
.btn-google svg { width: 20px; height: 20px; }

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

.sidebar {
  width: var(--sidebar-w);
  background: #1a1a2e;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar .logo { padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar .logo .logo-icon { background: var(--gold); }

.nav-section { padding: 16px 12px 8px; color: rgba(255,255,255,0.4); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: rgba(255,255,255,0.7);
  border-radius: 8px;
  margin: 2px 8px;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
}
.nav-item:hover, .nav-item.active { background: rgba(201,168,76,0.15); color: var(--gold); }
.nav-item .nav-icon { width: 20px; text-align: center; }

.sidebar-footer { margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-footer .user-info { font-size: 0.85rem; color: rgba(255,255,255,0.6); margin-bottom: 10px; }
.sidebar-footer .user-name { color: #fff; font-weight: 600; }

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar h1 { font-size: 1.25rem; font-weight: 700; }

.page-content { padding: 28px; flex: 1; }

/* ── CARDS ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.card-title { font-size: 1rem; font-weight: 700; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.stat-num { font-size: 2rem; font-weight: 800; color: var(--gold); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); }

/* ── TABLES ── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--bg); padding: 10px 14px; text-align: left; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); border-bottom: 2px solid var(--border); }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
tr:hover td { background: var(--bg); }

/* ── STATUS BADGES ── */
.status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}
.status-draft { background: #f0f0f0; color: #666; }
.status-published { background: #d1f5ea; color: #0a6640; }
.status-closed { background: #fde8e8; color: #a02020; }
.status-new { background: #e3f2fd; color: #1565c0; }
.status-reviewing { background: #fff3e0; color: #e65100; }
.status-interview_scheduled { background: #f3e5f5; color: #6a1b9a; }
.status-rejected { background: #fde8e8; color: #a02020; }
.status-hired { background: #d1f5ea; color: #0a6640; }

/* ── AI SCORE ── */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
}
.score-high { background: var(--success); }
.score-mid { background: var(--gold); }
.score-low { background: var(--danger); }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--bg-card);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h2 { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 1.4rem; color: var(--text-muted); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── ALERTS ── */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-danger { background: #fde8e8; color: #a02020; border-left: 4px solid var(--danger); }
.alert-success { background: #d1f5ea; color: #0a6640; border-left: 4px solid var(--success); }
.alert.hidden { display: none; }

/* ── AI TOOLS PAGE ── */
.ai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.ai-result {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
  font-size: 0.9rem;
  white-space: pre-wrap;
  max-height: 300px;
  overflow-y: auto;
}
.ai-result.hidden { display: none; }

textarea.form-control { resize: vertical; min-height: 120px; }

select.form-control { appearance: auto; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hero-nav { padding: 16px 20px; }
  .features-grid { padding: 40px 20px; }
}
