:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0284c7;
  --sidebar-w: 250px;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { text-decoration: none; color: inherit; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: #0f172a;
  color: #cbd5e1;
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform 0.25s ease;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 20px;
  font-size: 17px; font-weight: 700; color: #fff;
  border-bottom: 1px solid #1e293b;
}
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: grid; place-items: center; font-size: 18px;
}
.nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.nav-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: #64748b; padding: 10px 12px 6px;
}
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; margin-bottom: 2px;
  border-radius: 8px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: #1e293b; color: #fff; }
.nav a.active { background: var(--primary); color: #fff; }
.nav a .ico { font-size: 17px; width: 22px; text-align: center; }
.sidebar-footer {
  padding: 16px 20px; border-top: 1px solid #1e293b;
  font-size: 12px; color: #64748b;
}

/* ---------- Main layout ---------- */
.main { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
}
.topbar h1 { font-size: 20px; font-weight: 700; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 700;
}
.menu-btn {
  display: none; background: none; border: 1px solid var(--border);
  border-radius: 8px; width: 38px; height: 38px; font-size: 18px; cursor: pointer;
  margin-right: 12px;
}
.topbar-left { display: flex; align-items: center; }
.content { padding: 28px; max-width: 1400px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 10px; flex-wrap: wrap;
}
.card-head h2 { font-size: 16px; font-weight: 600; }

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px; margin-bottom: 24px;
}
.stat { display: flex; align-items: center; gap: 16px; }
.stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: grid; place-items: center; font-size: 24px;
}
.stat-icon.blue { background: #e0e7ff; }
.stat-icon.green { background: #dcfce7; }
.stat-icon.orange { background: #ffedd5; }
.stat-icon.purple { background: #f3e8ff; }
.stat .num { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-bottom: 24px; }
.grid-2-even { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all 0.15s; font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 13px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12px; }
.actions { display: flex; gap: 6px; }
.empty { text-align: center; color: var(--muted); padding: 30px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-applied { background: #e0f2fe; color: #0369a1; }
.badge-shortlisted { background: #fef3c7; color: #b45309; }
.badge-interview { background: #f3e8ff; color: #7e22ce; }
.badge-selected { background: #dcfce7; color: #15803d; }
.badge-rejected { background: #fee2e2; color: #b91c1c; }
.badge-open { background: #dcfce7; color: #15803d; }
.badge-closed { background: #f1f5f9; color: #64748b; }
.badge-placed { background: #dcfce7; color: #15803d; }
.badge-unplaced { background: #fef3c7; color: #b45309; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 13px; font-weight: 500; }
input, select, textarea {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.field-error { color: var(--danger); font-size: 12px; min-height: 14px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar input, .toolbar select { min-width: 160px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55);
  display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 16px;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 580px;
  max-height: 92vh; overflow-y: auto; padding: 26px;
}
.modal h2 { margin-bottom: 18px; font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ---------- Progress / bars ---------- */
.bar-row { margin-bottom: 14px; }
.bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.bar-track { background: #f1f5f9; height: 10px; border-radius: 10px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 10px; background: var(--primary); transition: width 0.6s ease; }

/* ---------- List items ---------- */
.list-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.date-box {
  background: var(--primary-soft); color: var(--primary);
  border-radius: 10px; padding: 6px 12px; text-align: center; min-width: 56px;
}
.date-box .d { font-size: 18px; font-weight: 700; line-height: 1.1; }
.date-box .m { font-size: 11px; text-transform: uppercase; }

/* ---------- Toast ---------- */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 8px;
  box-shadow: var(--shadow); animation: slideIn 0.25s ease;
  border-left: 4px solid var(--success);
}
.toast.error { border-left-color: var(--danger); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .grid-2, .grid-2-even { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-btn { display: block; }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .form-grid { grid-template-columns: 1fr; }
}
