@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Bricolage+Grotesque:wght@600;700;800&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0c12; --bg2: #0d1018; --surface: #111520; --surface2: #161b27;
  --border: rgba(255,255,255,0.06); --border-h: rgba(99,102,241,0.35);
  --accent: #6366f1; --accent-l: #818cf8; --accent-dim: rgba(99,102,241,0.12);
  --teal: #14b8a6; --teal-dim: rgba(20,184,166,0.1);
  --amber: #f59e0b; --text: #e8eaf0; --text2: #a0a8b8; --text3: #5a6278;
  --green: #10b981; --red: #ef4444; --radius: 14px; --radius-sm: 8px;
}

html { scroll-behavior: smooth; }
body { font-family: 'Outfit', sans-serif; background: var(--bg); color: var(--text); display: flex; min-height: 100vh; }
body::before { content: ''; position: fixed; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px); background-size: 40px 40px; pointer-events: none; z-index: 0; }

/* SIDEBAR */
.sidebar { width: 240px; min-height: 100vh; background: var(--bg2); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0; z-index: 10; }
.sidebar-logo { padding: 22px 18px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 32px; height: 32px; background: linear-gradient(135deg, var(--accent), #a78bfa); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-family: 'Bricolage Grotesque', sans-serif; font-size: 14px; font-weight: 800; color: white; }
.logo-text { font-family: 'Bricolage Grotesque', sans-serif; font-size: 16px; font-weight: 700; color: var(--text); }
.sidebar-nav { padding: 14px 10px; flex: 1; }
.nav-label { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 1.2px; padding: 8px 10px 5px; margin-top: 6px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text2); text-decoration: none; font-size: 13.5px; font-weight: 500; transition: all 0.18s; margin-bottom: 2px; position: relative; }
.nav-link:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-link.active { background: var(--accent-dim); color: var(--accent-l); }
.nav-link.active::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; background: var(--accent); border-radius: 0 3px 3px 0; }
.nav-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-user { border-top: 1px solid var(--border); padding: 10px; }
.user-pill { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: background 0.18s; text-decoration: none; }
.user-pill:hover { background: rgba(255,255,255,0.04); }
.u-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #312e81, #4f46e5); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: white; overflow: hidden; border: 1.5px solid rgba(99,102,241,0.4); flex-shrink: 0; }
.u-avatar img { width: 100%; height: 100%; object-fit: cover; }
.u-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.u-sub { font-size: 11px; color: var(--text3); }

/* MAIN */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; z-index: 1; }

/* TOPNAV */
.topnav { display: flex; align-items: center; gap: 14px; padding: 13px 28px; border-bottom: 1px solid var(--border); background: rgba(10,12,18,0.85); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 9; }
.page-title { font-family: 'Bricolage Grotesque', sans-serif; font-size: 18px; font-weight: 700; color: var(--text); }

/* CONTENT */
.content { flex: 1; padding: 28px 32px 48px; }

/* CARDS */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.card-title { font-family: 'Bricolage Grotesque', sans-serif; font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

/* FORM */
.field-group { margin-bottom: 16px; }
.field-group label { display: block; font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px; }
.field-group input, .field-group textarea, .field-group select { width: 100%; background: var(--surface2); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-sm); padding: 11px 14px; color: var(--text); font-size: 14px; font-family: 'Outfit', sans-serif; outline: none; transition: all 0.2s; }
.field-group input:focus, .field-group textarea:focus, .field-group select:focus { border-color: var(--accent); background: rgba(99,102,241,0.05); }
.field-group input::placeholder, .field-group textarea::placeholder { color: var(--text3); }
.field-group textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.field-group select option { background: var(--surface2); }
.field-readonly { background: rgba(255,255,255,0.03) !important; border-color: rgba(255,255,255,0.04) !important; color: var(--text3) !important; cursor: not-allowed !important; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* BUTTONS */
.btn { padding: 10px 22px; border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; font-family: 'Outfit', sans-serif; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #4f46e5; transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text2); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-l); }
.btn-danger { background: rgba(239,68,68,0.12); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.btn-success { background: rgba(16,185,129,0.12); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.btn-full { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* BADGES */
.badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; display: inline-block; }
.badge-pending { background: rgba(245,158,11,0.15); color: var(--amber); }
.badge-shortlisted, .badge-approved { background: rgba(16,185,129,0.12); color: var(--green); }
.badge-rejected { background: rgba(239,68,68,0.12); color: #f87171; }
.badge-hired { background: var(--accent-dim); color: var(--accent-l); }

/* TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 13px 14px; font-size: 13.5px; color: var(--text2); border-bottom: 1px solid rgba(255,255,255,0.04); }
tr:hover td { background: rgba(255,255,255,0.02); }

/* MESSAGES */
.msg { font-size: 14px; font-weight: 600; min-height: 20px; margin-bottom: 14px; }
.msg-success { color: var(--green); }
.msg-error { color: #f87171; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text3); }
.empty-state .emoji { font-size: 48px; margin-bottom: 14px; }
.empty-state h3 { font-size: 17px; color: var(--text2); margin-bottom: 8px; }

/* STATS GRID */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-icon { font-size: 22px; margin-bottom: 10px; }
.stat-val { font-family: 'Bricolage Grotesque', sans-serif; font-size: 28px; font-weight: 800; color: var(--accent-l); margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--text3); font-weight: 500; }

/* FOOTER */
.dash-footer { border-top: 1px solid var(--border); padding: 18px 28px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-copy { font-size: 12px; color: var(--text3); }
.footer-links { display: flex; gap: 18px; }
.footer-links a { font-size: 12px; color: var(--text3); text-decoration: none; }
.footer-links a:hover { color: var(--text2); }

/* MOBILE */
.mob-topbar { display: none; align-items: center; justify-content: space-between; padding: 13px 18px; border-bottom: 1px solid var(--border); background: var(--bg2); }
.hamburger { width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 17px; color: var(--text); }
.mob-logo { font-family: 'Bricolage Grotesque', sans-serif; font-size: 17px; font-weight: 700; color: var(--text); }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 9; }
.sidebar-overlay.show { display: block; }

@media(max-width: 768px) {
  body { display: block; }
  .sidebar { position: fixed; left: -100%; top: 0; height: 100vh; z-index: 10; width: 260px; transition: left 0.3s ease; }
  .sidebar.mob-open { left: 0; }
  .mob-topbar { display: flex; }
  .main { display: block; }
  .content { padding: 20px 16px 40px; }
  .two-col, .three-col { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .topnav { padding: 12px 16px; }
}

/* ── MOBILE IMPROVEMENTS ─────────────────────────── */
@media(max-width: 768px) {
  .content { padding: 16px 14px 40px; }
  .page-title { font-size: 16px; }
  .btn { padding: 9px 16px; font-size: 13px; }
  .btn-full { width: 100%; justify-content: center; }
  .card { padding: 16px; }
  th, td { padding: 9px 8px; font-size: 12px; }
  .stat-card { padding: 14px; }
  .stat-val { font-size: 22px; }
  .field-group input,
  .field-group textarea,
  .field-group select { font-size: 16px; } /* prevent iOS zoom */
  .dash-footer { padding: 14px 16px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .topnav { flex-wrap: wrap; gap: 8px; }
  .sidebar { box-shadow: 4px 0 24px rgba(0,0,0,0.5); }
}
@media(max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .two-col, .three-col { grid-template-columns: 1fr; }
  .mob-logo { font-size: 15px; }
}

/* ═══════════════════════════════════════════════════════
   LIGHT MODE THEME
═══════════════════════════════════════════════════════ */
html.light-mode {
  --bg:       #f0f2f7;
  --surface:  #ffffff;
  --surface2: #f5f7fa;
  --border:   #e2e6ef;
  --border-h: #c8cfe0;
  --text:     #0f1724;
  --text2:    #374151;
  --text3:    #6b7280;
  --accent:   #6366f1;
  --accent-l: #4f46e5;
  --accent-dim: rgba(99,102,241,0.08);
  --amber:    #d97706;
  --green:    #059669;
  background-color: #f0f2f7;
  color: #0f1724;
}
html.light-mode .sidebar { background:#ffffff; border-right:1px solid #e2e6ef; }
html.light-mode .card    { background:#ffffff; border-color:#e2e6ef; }
html.light-mode .topnav  { background:#ffffff; border-bottom:1px solid #e2e6ef; }
html.light-mode .mob-topbar { background:#ffffff; border-bottom:1px solid #e2e6ef; }
html.light-mode .dash-footer { background:#ffffff; border-top:1px solid #e2e6ef; }
html.light-mode .stat-card { background:#ffffff; }
html.light-mode input, html.light-mode textarea, html.light-mode select {
  background:#f9fafc; border-color:#d1d5db; color:#0f1724;
}
html.light-mode .nav-link:hover, html.light-mode .nav-link.active {
  background:rgba(99,102,241,0.08); color:#4f46e5;
}
html.light-mode .u-avatar { background:linear-gradient(135deg,#6366f1,#a78bfa); }
html.light-mode .u-name { color:#0f1724; }
html.light-mode .u-sub { color:#6b7280; }
html.light-mode .logo-text { color:#0f1724; }
html.light-mode table th { color:#374151; border-color:#e2e6ef; }
html.light-mode table td { border-color:#f3f4f6; color:#374151; }
html.light-mode table tr:hover { background:rgba(99,102,241,0.04); }
