/* =====================================================================
   Recruitment HR System - Modern UI
   Theme: Professional dark sidebar + clean content area
   ===================================================================== */

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

:root {
  --primary:       #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #e0e7ff;
  --secondary:     #7c3aed;
  --accent:        #06b6d4;

  --sidebar-bg:    #0f172a;
  --sidebar-hover: rgba(255,255,255,0.06);
  --sidebar-active:#4f46e5;
  --sidebar-width: 265px;

  --bg:            #f1f5f9;
  --panel:         #ffffff;
  --border:        #e2e8f0;
  --border-light:  #f1f5f9;

  --text:          #0f172a;
  --text-muted:    #64748b;
  --text-subtle:   #94a3b8;

  --success:       #10b981;
  --info:          #3b82f6;
  --warning:       #f59e0b;
  --danger:        #ef4444;

  --topbar-h:      64px;
  --radius:        0.75rem;
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:        0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg:     0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: var(--primary); transition: color 0.2s; }
a:hover { text-decoration: none; color: var(--primary-hover); }

button { font-family: inherit; }

/* ===================== UTILITIES ===================== */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-left    { text-align: left; }
.text-muted   { color: var(--text-muted); }
.text-subtle  { color: var(--text-subtle); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-error   { color: var(--danger); }
.text-primary { color: var(--primary); }
.text-sm  { font-size: 0.875rem; }
.text-xs  { font-size: 0.75rem; }
.text-lg  { font-size: 1.125rem; }
.fw-400   { font-weight: 400; }
.fw-500   { font-weight: 500; }
.fw-600   { font-weight: 600; }
.fw-700   { font-weight: 700; }
.inline   { display: inline; }
.block    { display: block; }
.hidden   { display: none !important; }
.flex     { display: flex; }
.flex-col { flex-direction: column; }
.flex-1   { flex: 1; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.w-full  { width: 100%; }
.h-full  { height: 100%; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.p0 { padding: 0 !important; }
.py-2 { padding-top: 0.5rem;  padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem;    padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem;  padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem;    padding-bottom: 2rem; }
.px-4 { padding-left: 1rem;   padding-right: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opacity-50 { opacity: 0.5; }
.cursor-pointer { cursor: pointer; }

/* ===================== SIDEBAR ===================== */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* Subtle gradient overlay */
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(79,70,229,0.08) 0%, transparent 40%);
  pointer-events: none;
}

.sidebar-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  gap: 0.875rem;
}

.brand-icon {
  width: 2.25rem;
  height: 2.25rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79,70,229,0.4);
}

.brand-text { display: flex; flex-direction: column; overflow: hidden; }
.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: #f8fafc;
  line-height: 1.2;
  white-space: nowrap;
}
.brand-sub {
  font-size: 0.7rem;
  color: #64748b;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar-nav {
  flex: 1;
  padding: 1.25rem 0.75rem;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
  font-weight: 700;
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}
.nav-section-label.mt-4 { margin-top: 1.5rem; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.875rem;
  color: #94a3b8;
  border-radius: 0.5rem;
  margin-bottom: 0.125rem;
  transition: all 0.2s;
  position: relative;
  font-size: 0.875rem;
  font-weight: 500;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: #e2e8f0;
  text-decoration: none;
}
.nav-item.active {
  background: rgba(79,70,229,0.2);
  color: #a5b4fc;
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

.nav-icon { width: 1.125rem; height: 1.125rem; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
  font-weight: 700;
  min-width: 1.25rem;
  text-align: center;
  animation: navBadgePulse 2s infinite;
}

@keyframes navBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  background: rgba(0,0,0,0.15);
}
.user-info { display: flex; align-items: center; gap: 0.625rem; overflow: hidden; flex: 1; }
.user-avatar {
  width: 2.125rem; height: 2.125rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.875rem; color: white;
  flex-shrink: 0;
}
.user-details { overflow: hidden; }
.user-name  { display: block; font-size: 0.8125rem; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { display: block; font-size: 0.6875rem; color: #64748b; white-space: nowrap; }
.logout-btn {
  color: #475569; padding: 0.375rem; border-radius: 0.375rem;
  transition: all 0.2s; flex-shrink: 0;
  display: flex; align-items: center;
}
.logout-btn:hover { background: rgba(239,68,68,0.15); color: #f87171; }

/* ===================== MAIN LAYOUT ===================== */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.menu-toggle {
  display: none; background: none; border: none;
  color: var(--text-muted); cursor: pointer; padding: 0.25rem;
  border-radius: 0.375rem; transition: all 0.2s;
}
.menu-toggle:hover { background: var(--border-light); color: var(--text); }

.page-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }

.content { flex: 1; padding: 1rem 1.25rem; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .menu-toggle { display: flex; }
}

/* ===================== CARDS ===================== */
.card {
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(to right, rgba(248,250,252,0.8), rgba(248,250,252,0.4));
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.card-body { padding: 1.5rem; }
.card-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 1px 3px rgba(79,70,229,0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
  color: white;
  box-shadow: 0 4px 6px rgba(79,70,229,0.3);
  transform: translateY(-1px);
}

.btn-outline {
  border-color: var(--border);
  background: var(--panel);
  color: var(--text);
}
.btn-outline:hover {
  background: var(--border-light);
  border-color: #cbd5e1;
  color: var(--text);
}

.btn-danger {
  background: #fee2e2;
  color: var(--danger);
  border-color: #fca5a5;
}
.btn-danger:hover { background: #fecaca; border-color: #f87171; }

.btn-ai {
  background: linear-gradient(135deg, #4f46e5, #8b5cf6);
  color: white; border: none;
  box-shadow: 0 4px 12px rgba(139,92,246,0.4);
}
.btn-ai:hover {
  background: linear-gradient(135deg, #4338ca, #7c3aed);
  color: white;
  box-shadow: 0 6px 16px rgba(139,92,246,0.5);
  transform: translateY(-1px);
}

.btn-sm  { padding: 0.3125rem 0.625rem; font-size: 0.8125rem; border-radius: 0.375rem; }
.btn-xs  { padding: 0.1875rem 0.5rem; font-size: 0.75rem; border-radius: 0.3125rem; }
.btn-lg  { padding: 0.75rem 1.75rem; font-size: 1rem; border-radius: 0.625rem; }

/* ===================== BADGES / TAGS ===================== */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.625rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-lg { padding: 0.3rem 0.875rem; font-size: 0.8125rem; }

.badge-primary { background: var(--primary-light);   color: #3730a3; }
.badge-success { background: #d1fae5;                 color: #065f46; }
.badge-warning { background: #fef3c7;                 color: #78350f; }
.badge-danger  { background: #fee2e2;                 color: #7f1d1d; }
.badge-error   { background: #fee2e2;                 color: #7f1d1d; }
.badge-info    { background: #dbeafe;                 color: #1e3a8a; }
.badge-muted   { background: var(--border-light);     color: var(--text-muted); }

.tag {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===================== TABLES ===================== */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  padding: 0.75rem 1.25rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #fafbfc;
}
.table td {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  font-size: 0.9rem;
}
.table tbody tr { transition: background 0.15s; }
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: rgba(79,70,229,0.03); }
.link { color: var(--primary); font-weight: 500; }
.link:hover { color: var(--primary-hover); text-decoration: underline; }

/* ===================== FORMS ===================== */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.5625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--panel);
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.5;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}
.form-input::placeholder { color: #b0bec5; }
.form-textarea { resize: vertical; min-height: 100px; }
.form-row { display: flex; gap: 1rem; }

/* ===================== ALERTS ===================== */
.alert {
  padding: 0.875rem 1rem;
  border-radius: 0.575rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-left-width: 4px;
  border-style: solid;
  animation: slideDown 0.3s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.alert-success { background: #f0fdf4; border-color: var(--success); color: #14532d; }
.alert-error   { background: #fff5f5; border-color: var(--danger);  color: #7f1d1d; }
.alert-info    { background: #eff6ff; border-color: var(--info);    color: #1e3a8a; }
.alert-warning { background: #fffbeb; border-color: var(--warning); color: #78350f; }

/* ===================== AUTH PAGE ===================== */
.auth-body {
  margin: 0; min-height: 100vh; overflow: hidden;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
}
.auth-bg {
  position: relative; width: 100vw; height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
/* Decorative circles */
.auth-bg::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79,70,229,0.15) 0%, transparent 70%);
  top: -200px; right: -100px;
}
.auth-bg::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.1) 0%, transparent 70%);
  bottom: -100px; left: -100px;
}

.auth-particles { position: absolute; inset: 0; overflow: hidden; }
.particle {
  position: absolute; left: var(--x); top: var(--y);
  width: var(--size, 6px); height: var(--size, 6px);
  border-radius: 50%;
  background: rgba(99,102,241,0.35);
  animation: float var(--duration, 8s) var(--delay, 0s) ease-in-out infinite alternate;
}
@keyframes float {
  from { transform: translateY(0) scale(1); opacity: 0.3; }
  to   { transform: translateY(-30px) scale(1.2); opacity: 0.7; }
}

.auth-card {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  padding: 2.75rem;
  border-radius: 1.25rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
  z-index: 10;
  position: relative;
}

.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo-icon {
  width: 4.5rem; height: 4.5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: 1.25rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.4);
}
.auth-title { font-size: 1.625rem; font-weight: 800; color: #0f172a; margin-bottom: 0.25rem; }
.auth-subtitle { color: var(--text-muted); font-size: 0.875rem; }

.auth-alert {
  display: flex; align-items: center; gap: 0.5rem;
  background: #fff5f5; color: #7f1d1d; border: 1px solid #fecaca;
  border-left: 4px solid var(--danger);
  border-radius: 0.5rem; padding: 0.75rem 1rem;
  font-size: 0.875rem; font-weight: 500;
  margin-bottom: 1.25rem;
}

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 0.875rem; color: #94a3b8; pointer-events: none; flex-shrink: 0; }
.auth-form .form-input {
  padding-left: 2.75rem;
  height: 2.75rem;
  border-radius: 0.625rem;
  border: 1.5px solid var(--border);
  font-size: 0.9375rem;
}
.toggle-password {
  position: absolute; right: 0.75rem; background: none; border: none;
  color: #94a3b8; cursor: pointer; padding: 0.25rem; border-radius: 0.25rem;
  transition: color 0.2s;
}
.toggle-password:hover { color: var(--primary); }

.btn-login {
  width: 100%; height: 2.875rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white; border: none; border-radius: 0.625rem;
  font-size: 0.9375rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  margin-top: 1.75rem; transition: all 0.25s;
  box-shadow: 0 4px 12px rgba(79,70,229,0.4);
}
.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79,70,229,0.5);
}
.btn-login:active { transform: translateY(0); }

.auth-hint {
  text-align: center; margin-top: 1.5rem; font-size: 0.75rem;
  color: #94a3b8; background: #f8fafc; padding: 0.625rem; border-radius: 0.5rem;
  border: 1px dashed var(--border);
}

/* ===================== DASHBOARD ===================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--panel);
  padding: 1.375rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-card::after {
  content: '';
  position: absolute; right: -20px; top: 50%;
  transform: translateY(-50%);
  width: 80px; height: 80px; border-radius: 50%;
  opacity: 0.06;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 4px; height: 100%;
  border-radius: 0 0 0 0;
}
.stat-total::before    { background: linear-gradient(180deg, var(--primary), var(--secondary)); }
.stat-new::before      { background: linear-gradient(180deg, var(--success), #34d399); }
.stat-shortlist::before { background: linear-gradient(180deg, var(--info), #60a5fa); }
.stat-rejected::before { background: linear-gradient(180deg, var(--danger), #f87171); }
.stat-total::after    { background: var(--primary); }
.stat-new::after      { background: var(--success); }
.stat-shortlist::after { background: var(--info); }
.stat-rejected::after { background: var(--danger); }

.stat-icon {
  width: 3rem; height: 3rem; border-radius: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  margin-right: 1rem; flex-shrink: 0;
}
.stat-total .stat-icon { background: rgba(79,70,229,0.1); color: var(--primary); }
.stat-new .stat-icon { background: rgba(16,185,129,0.1); color: var(--success); }
.stat-shortlist .stat-icon { background: rgba(59,130,246,0.1); color: var(--info); }
.stat-rejected .stat-icon { background: rgba(239,68,68,0.1); color: var(--danger); }

.stat-info { display: flex; flex-direction: column; flex: 1; }
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; margin-bottom: 0.25rem; letter-spacing: -0.03em; }
.stat-label { font-size: 0.8125rem; color: var(--text-muted); font-weight: 500; }
.stat-badge {
  position: absolute; top: 0.75rem; right: 0.75rem;
  font-size: 0.65rem; background: var(--danger); color: white;
  padding: 0.125rem 0.5rem; border-radius: 99px; font-weight: 700;
  animation: pulse 2s infinite;
}

.dashboard-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; }
.chart-card { grid-column: 1; }
@media (max-width: 1100px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* ===================== CANDIDATES ===================== */
.candidate-cell { display: flex; align-items: center; gap: 0.75rem; }
.avatar-sm {
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), #c7d2fe);
  color: var(--primary); font-weight: 700; font-size: 0.875rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.score-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.125rem; height: 2.125rem; border-radius: 50%;
  font-weight: 700; font-size: 0.8125rem;
}
.score-high { background: #dcfce7; color: #14532d; box-shadow: 0 0 0 2px #bbf7d0; }
.score-mid  { background: #fef3c7; color: #78350f; box-shadow: 0 0 0 2px #fde68a; }
.score-low  { background: #fee2e2; color: #7f1d1d; box-shadow: 0 0 0 2px #fecaca; }

/* Filter */
.filter-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.filter-group { flex: 1; min-width: 180px; margin-bottom: 0 !important; }
.filter-actions { display: flex; gap: 0.5rem; }

/* ===================== CANDIDATE DETAIL ===================== */
.candidate-detail-grid { display: grid; grid-template-columns: 340px 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 960px) { .candidate-detail-grid { grid-template-columns: 1fr; } }

.profile-header {
  padding: 2rem 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex; flex-direction: column; align-items: center;
  background: linear-gradient(160deg, rgba(79,70,229,0.04) 0%, transparent 60%);
}
.profile-avatar {
  width: 5rem; height: 5rem; font-size: 2rem; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), #c7d2fe);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  font-weight: 800; margin-bottom: 1rem;
  box-shadow: 0 0 0 4px rgba(79,70,229,0.1);
}
.profile-name  { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.25rem; text-align: center; }
.profile-position { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.25rem; text-align: center; }

.score-ring {
  width: 80px; height: 80px; border-radius: 50%;
  border: 4px solid var(--score-color, var(--primary));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 0 auto 0.75rem;
  box-shadow: 0 0 0 6px rgba(79,70,229,0.08);
}
.score-value { font-size: 1.5rem; font-weight: 800; color: var(--score-color, var(--primary)); line-height: 1; }
.score-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.profile-info { padding: 1.25rem 1.5rem; }
.info-row { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 0.625rem; font-size: 0.875rem; color: var(--text-color); }
.info-row svg { color: var(--text-muted); flex-shrink: 0; }

.skills-section, .education-section { padding: 1.25rem 1.5rem; border-top: 1px solid var(--border-light); }
.section-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-subtle); font-weight: 700; margin-bottom: 0.75rem; }
.skills-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.skill-tag { background: var(--border-light); color: var(--text); padding: 0.2rem 0.6rem; border-radius: 0.375rem; font-size: 0.75rem; border: 1px solid var(--border); }
.skill-matched { background: #d1fae5; border-color: #6ee7b7; color: #065f46; font-weight: 600; }
.edu-item { margin-bottom: 0.75rem; font-size: 0.875rem; }

.status-form { padding: 1.5rem; background: #fafbfc; border-top: 1px solid var(--border-light); }

/* AI Evaluation */
.ai-card { border-color: #c7d2fe; border-top: 3px solid var(--primary); }
.ai-summary {
  font-size: 1rem; border-left: 4px solid var(--info); padding-left: 1rem;
  margin-bottom: 1.5rem; color: #1e293b; line-height: 1.7;
  background: #f0f9ff; padding: 1rem 1rem 1rem 1.25rem; border-radius: 0 0.5rem 0.5rem 0;
}
.ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 600px) { .ai-grid { grid-template-columns: 1fr; } }
.ai-col-title { font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.ai-col-title.strength { color: #065f46; }
.ai-col-title.weakness { color: #7f1d1d; }
.ai-list { list-style: none; padding-left: 0.25rem; }
.ai-list li { position: relative; padding-left: 1.375rem; margin-bottom: 0.625rem; font-size: 0.875rem; line-height: 1.5; color: var(--text); }
.ai-col-title.strength + .ai-list li::before { content: '✓'; position: absolute; left: 0; color: var(--success); font-weight: 700; }
.ai-col-title.weakness + .ai-list li::before { content: '✕'; position: absolute; left: 0; color: var(--danger); font-weight: 700; }
.cv-text { background: #f8fafc; padding: 1.5rem; border-radius: 0.5rem; font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace; font-size: 0.8125rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word; color: #334155; max-height: 600px; overflow-y: auto; border: 1px solid var(--border); }

/* ===================== JOBS ===================== */
.jobs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.job-card {
  display: flex; flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border);
}
.job-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #c7d2fe; }
.job-card-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border-light);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem;
}
.job-title { font-size: 1.0625rem; font-weight: 700; margin-bottom: 0.25rem; color: var(--text); line-height: 1.3; }
.job-desc  { padding: 0.875rem 1.25rem 0; font-size: 0.875rem; color: var(--text-muted); flex: 1; min-height: 50px; line-height: 1.5; }
.job-salary {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem; font-weight: 600; color: var(--success);
  display: flex; align-items: center; gap: 0.375rem; margin-top: 0.5rem;
}
.job-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(to right, rgba(248,250,252,0.9), rgba(248,250,252,0.5));
}
.job-count { text-align: center; }
.count-num { display: block; font-size: 1.375rem; font-weight: 800; color: var(--primary); line-height: 1; }
.count-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.125rem; }
.job-actions { display: flex; gap: 0.5rem; }

/* ===================== SCANNER ===================== */
.pulse-animation { animation: ctaPulse 2.5s infinite; }
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(79, 70, 229, 0); }
}

/* ===================== MISC ANIMATIONS ===================== */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Sidebar mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 199; backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

/* ===================== RESPONSIVE CARD TABLE ===================== */
@media (max-width: 1024px) {
  .table-responsive-card thead { display: none; }
  .table-responsive-card, .table-responsive-card tbody, .table-responsive-card tr, .table-responsive-card td {
    display: block; width: 100%;
  }
  .table-responsive-card tr {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 0.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
    position: relative;
  }
  .table-responsive-card td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-light);
    text-align: right;
  }
  .table-responsive-card td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  .table-responsive-card td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: left;
    margin-right: 1rem;
    flex-shrink: 0;
  }
  /* Căn chỉnh một số ô đặc biệt */
  .table-responsive-card td.td-checkbox {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    border: none;
    padding: 0;
  }
  .table-responsive-card td.td-checkbox::before { content: none; }
  
  .table-responsive-card td.td-candidate {
    padding-top: 0;
    padding-left: 2rem; /* Tránh checkbox */
    justify-content: flex-start;
  }
  .table-responsive-card td.td-candidate::before { content: none; }
  
  .table-responsive-card td.td-actions {
    justify-content: flex-end;
    margin-top: 0.5rem;
    background: var(--bg);
    border-radius: 0.5rem;
    padding: 0.5rem;
  }
  .table-responsive-card td.td-actions::before { content: none; }
  
  .table-responsive-card .job-select-inline,
  .table-responsive-card .hr-select-inline {
    width: 100%; max-width: 150px; text-align: right;
  }
  
  /* Bulk Action Toolbar on mobile */
  #bulkToolbar {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-top: 10px;
  }
  #bulkToolbar select { width: 100% !important; margin-bottom: 5px; }
  #bulkToolbar button { width: 100%; margin-bottom: 5px; }
  
  /* Filter mobile */
  .filter-row.collapsed {
    display: none !important;
  }
}

