/* ======================================================
   Kaam ATS — Design System v2.0
   Premium Applicant Tracking System

   Ported from: KaamOS Design System v1.0
   Palette: Brown (#7e481c) + Cyan (#06b6d4)
   Font: Inter
   ====================================================== */


/* ==============================================
   1. DESIGN TOKENS
   ============================================== */
:root {
  /* Primary -- Warm Brown */
  --primary: #7e481c;
  --primary-hover: #6a3c17;
  --primary-active: #563112;
  --primary-light: #d4a574;
  --primary-50: #fdf8f3;
  --primary-100: #f9edd9;
  --primary-200: #f0d5b0;

  /* Accent -- Cyan Contrast */
  --accent: #06b6d4;
  --accent-hover: #0891b2;
  --accent-light: #67e8f9;
  --accent-50: #ecfeff;

  /* Neutral Scale */
  --gray-25: #fcfcfd;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --gray-950: #020617;

  /* Semantic */
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --info: #3b82f6;
  --info-light: #eff6ff;

  /* Shadows -- Layered depth system */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 8px -2px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.08), 0 4px 8px -4px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 24px 48px -8px rgba(0, 0, 0, 0.1), 0 8px 16px -4px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 8px 24px -4px rgba(0, 0, 0, 0.08), 0 2px 6px -2px rgba(0, 0, 0, 0.04);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  /* Layout */
  --sidebar-width: 240px;
  --sidebar-collapsed: 68px;
  --header-height: 56px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 0.15s;
  --duration-normal: 0.2s;
  --duration-slow: 0.3s;

  /* Focus -- Accessibility */
  --focus-ring: 0 0 0 2px #fff, 0 0 0 4px var(--primary);
  --focus-ring-inset: inset 0 0 0 2px var(--primary);

  /* Content-area theming */
  --card-bg: #fff;
  --card-border: var(--gray-200);
  --card-hover-shadow: var(--shadow-card-hover);
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-tertiary: var(--gray-500);
  --text-quaternary: var(--gray-400);
  --header-bg: rgba(255, 255, 255, 0.82);
  --header-border: rgba(126, 72, 28, 0.08);
  --input-bg: #fff;
  --input-border: var(--gray-200);
  --hover-bg: var(--gray-50);
  --divider-color: var(--gray-100);
  --page-bg: #faf8f5;
}


/* ==============================================
   2. RESET & BASE
   ============================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--page-bg);
  color: var(--text-primary);
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.006em;
}

a { color: var(--primary); text-decoration: none; transition: color var(--duration-fast) var(--ease-in-out); }
a:hover { color: var(--primary-hover); }

::selection { background: var(--primary-100); color: var(--primary-active); }

img { max-width: 100%; display: block; }


/* ==============================================
   2.1 FOCUS VISIBLE
   ============================================== */
:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}
.sidebar :focus-visible {
  box-shadow: var(--focus-ring-inset);
}
button:focus-visible,
[role="button"]:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary);
}


/* ==============================================
   2.2 REDUCED MOTION
   ============================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ==============================================
   3. CUSTOM SCROLLBAR
   ============================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
* { scrollbar-width: thin; scrollbar-color: var(--gray-300) transparent; }


/* ==============================================
   4. TYPOGRAPHY
   ============================================== */
.text-xs { font-size: 11px; line-height: 1.45; }
.text-sm { font-size: 12px; line-height: 1.5; }
.text-base { font-size: 13px; line-height: 1.55; }
.text-md { font-size: 14px; line-height: 1.5; }
.text-lg { font-size: 16px; line-height: 1.4; }
.text-xl { font-size: 20px; line-height: 1.3; }
.text-2xl { font-size: 24px; line-height: 1.2; }
.text-3xl { font-size: 28px; line-height: 1.15; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.text-muted { color: var(--gray-500); }
.text-secondary { color: var(--gray-600); }
.text-primary-color { color: var(--primary); }

.label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gray-600);
}

.mono { font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace; font-size: 0.92em; }
.tabular { font-variant-numeric: tabular-nums; }


/* ==============================================
   5. SIDEBAR -- Elite Dark Navigation
   ============================================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, var(--sidebar-start, #1e1208) 0%, var(--sidebar-end, #140c04) 100%);
  z-index: 1040;
  transition: width var(--duration-slow) var(--ease-out);
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 2px 0 32px rgba(0, 0, 0, 0.18);
}
.sidebar.collapsed { width: var(--sidebar-collapsed); overflow: visible; }
.sidebar.collapsed .sidebar-nav { overflow: visible; }

/* Sidebar scrollbar */
.sidebar::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 2px; }
.sidebar::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); }

/* Brand Area */
.sidebar-brand {
  padding: 20px 18px 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: var(--header-height);
  position: relative;
  flex-shrink: 0;
}
.sidebar-brand::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 18px;
  right: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.08) 30%, rgba(255, 255, 255, 0.08) 70%, transparent 100%);
}
.sidebar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #9a5a25 0%, #c47d3e 50%, #e0a86e 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(126, 72, 28, 0.35), 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all var(--duration-normal) var(--ease-spring);
}
.sidebar-brand:hover .brand-icon {
  box-shadow: 0 4px 20px rgba(126, 72, 28, 0.45), 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: scale(1.05) rotate(-2deg);
}
.sidebar-brand .brand-icon span {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.sidebar-brand .brand-text {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  letter-spacing: -0.025em;
}
.sidebar-brand .brand-sub {
  color: rgba(255, 255, 255, 0.3);
  font-size: 9.5px;
  display: block;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 1px;
}
.sidebar.collapsed .brand-text,
.sidebar.collapsed .brand-sub { display: none; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 20px 0 18px; gap: 0; }
.sidebar.collapsed .sidebar-brand .brand-icon { margin: 0; width: 40px; height: 40px; }
.sidebar.collapsed .sidebar-brand .brand-icon span { font-size: 17px; }

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 12px 0 8px;
  overflow-y: auto;
}

/* Nav Group -- Collapsible Sections */
.nav-group { margin-bottom: 2px; }
.sidebar-nav .nav-section {
  padding: 6px 12px;
  margin: 10px 12px 4px;
  font-size: 10.5px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s var(--ease-out);
}
.sidebar-nav .nav-section:hover {
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.03);
}
.nav-group.open > .nav-section {
  color: rgba(255, 255, 255, 0.5);
}
.sidebar-nav .nav-section .nav-section-icon {
  font-size: 9px;
  width: 14px;
  text-align: center;
  opacity: 0.5;
  flex-shrink: 0;
}
.nav-group.open > .nav-section .nav-section-icon { opacity: 0.8; }
.sidebar-nav .nav-section .nav-chevron {
  font-size: 7px;
  margin-left: auto;
  transition: transform 0.25s var(--ease-out);
  transform: rotate(-90deg);
  opacity: 0.25;
  flex-shrink: 0;
}
.nav-group.open > .nav-section .nav-chevron { transform: rotate(0deg); opacity: 0.4; }
.nav-group-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s var(--ease-out);
}
.nav-group.open > .nav-group-items { max-height: 600px; }
.sidebar-nav .nav-group:first-child .nav-section { margin-top: 0; }

/* Collapsed: Nav sections become icon-only triggers */
.sidebar.collapsed .nav-section {
  justify-content: center;
  padding: 14px 0;
  margin: 4px 6px;
  font-size: 0;
  color: transparent;
  border-radius: 8px;
  position: relative;
}
.sidebar.collapsed .nav-section .nav-section-icon {
  font-size: 15px !important;
  opacity: 0.6;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
  width: auto;
}
.sidebar.collapsed .nav-section:hover {
  background: rgba(255, 255, 255, 0.06);
}
.sidebar.collapsed .nav-section:hover .nav-section-icon {
  opacity: 1;
  color: #fff;
}
.sidebar.collapsed .nav-section span { display: none; }
.sidebar.collapsed .nav-chevron { display: none; }
.sidebar.collapsed .nav-group-items { display: none !important; }
.sidebar.collapsed .nav-group { margin-bottom: 0; }

/* Nav Items */
.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  margin: 2px 10px;
  color: rgba(255, 255, 255, 0.75);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13.5px;
  font-weight: 460;
  cursor: pointer;
  transition: all 0.18s var(--ease-out);
  border-radius: 9px;
  white-space: nowrap;
  position: relative;
  letter-spacing: -0.008em;
  text-decoration: none;
}
.sidebar-nav .nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateX(2px);
}
.sidebar-nav .nav-item:hover i {
  opacity: 0.9;
  color: #fff;
}
.sidebar-nav .nav-item:active {
  transform: translateX(2px) scale(0.985);
  transition-duration: 0.06s;
}
.sidebar-nav .nav-item.active {
  background: rgba(6, 182, 212, 0.14);
  color: #fff;
  font-weight: 600;
}
.sidebar-nav .nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.5),
              6px 0 20px rgba(6, 182, 212, 0.12);
}
.sidebar-nav .nav-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.55;
  transition: all 0.18s var(--ease-out);
}
.sidebar-nav .nav-item.active i {
  opacity: 1;
  color: var(--accent-light);
  filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.4));
}

/* Nav Badge */
.nav-badge {
  margin-left: auto;
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-light);
  font-size: 9.5px;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  padding: 0 6px;
  letter-spacing: 0.02em;
  border: 1px solid rgba(6, 182, 212, 0.08);
}
.sidebar.collapsed .nav-badge { display: none; }

/* Collapsed nav items */
.sidebar.collapsed .nav-item span { display: none; }
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
  margin: 2px 6px;
  gap: 0;
  border-radius: 8px;
}
.sidebar.collapsed .nav-item i {
  font-size: 16px;
  width: auto;
}


/* ==============================================
   5.1 FLYOUT SUBMENU -- Collapsed sidebar hover
   ============================================== */
.submenu-flyout {
  position: fixed;
  min-width: 220px;
  background: linear-gradient(135deg, var(--sidebar-start, #1e1208) 0%, var(--sidebar-end, #2a1a0e) 100%);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--theme-border, rgba(255, 255, 255, 0.08));
  padding: 8px 0;
  z-index: 9999;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: flyoutSlide 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.submenu-flyout::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 14px;
  border: 8px solid transparent;
  border-right-color: var(--flyout-arrow, #1e1208);
}
.submenu-flyout-header {
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--theme-border, rgba(255, 255, 255, 0.08));
  margin-bottom: 4px;
}
.submenu-flyout-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--theme-section-text, rgba(255, 255, 255, 0.45));
}
.submenu-flyout-item {
  display: block;
  padding: 10px 16px;
  color: var(--theme-text, rgba(255, 255, 255, 0.85));
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.submenu-flyout-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, var(--primary), transparent);
  transition: width 0.2s ease;
}
.submenu-flyout-item:hover {
  color: var(--theme-text-hover, #fff);
  background: var(--theme-hover-bg, rgba(255, 255, 255, 0.08));
  padding-left: 20px;
}
.submenu-flyout-item:hover::before {
  width: 3px;
}
.submenu-flyout-item.active-item {
  color: var(--theme-text-hover, #fff);
  background: var(--theme-active-bg, rgba(255, 255, 255, 0.06));
}
.submenu-flyout-item.active-item::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}
.submenu-flyout-item i {
  width: 16px;
  text-align: center;
  margin-right: 10px;
  font-size: 12px;
  opacity: 0.6;
}
.submenu-flyout-item:hover i { opacity: 1; }

@keyframes flyoutSlide {
  0% { opacity: 0; transform: translateX(-10px) scale(0.95); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}


/* ==============================================
   5.2 SIDEBAR FOOTER
   ============================================== */
.sidebar-footer {
  padding: 10px 18px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  cursor: default;
  position: relative;
  margin-top: auto;
}
.sidebar-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.08) 30%, rgba(255, 255, 255, 0.08) 70%, transparent 100%);
}
.sidebar-footer .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #9a5a25 0%, #c47d3e 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08), 0 2px 8px rgba(0, 0, 0, 0.2);
}
.sidebar-footer .user-avatar::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid #140c04;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
  animation: status-pulse 3s ease-in-out infinite;
}
@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 12px rgba(16, 185, 129, 0.6); }
}
.sidebar-footer .user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
}
.sidebar-footer .user-info {
  overflow: hidden;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.sidebar-footer .user-name {
  color: rgba(255, 255, 255, 0.85);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.sidebar-footer .user-role {
  color: rgba(255, 255, 255, 0.3);
  font-size: 10px;
  white-space: nowrap;
  letter-spacing: 0.02em;
  font-weight: 450;
}
.sidebar-footer-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.sidebar-footer-actions button {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.25s var(--ease-out);
  flex-shrink: 0;
}
.sidebar-footer-actions button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.12);
}
.sidebar.collapsed .sidebar-footer .user-info { display: none; }
.sidebar.collapsed .sidebar-footer { justify-content: center; padding: 14px 8px; flex-wrap: wrap; gap: 4px; }
.sidebar.collapsed .sidebar-footer-actions { gap: 4px; }
.sidebar.collapsed .sidebar-footer-actions button { width: 28px; height: 28px; font-size: 11px; }

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


/* ==============================================
   6. MAIN CONTENT & HEADER
   ============================================== */
.main-content {
  margin-left: var(--sidebar-width);
  transition: margin-left var(--duration-slow) var(--ease-out);
  min-height: 100vh;
}
.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed); }

.top-header {
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--header-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 4px 12px rgba(0, 0, 0, 0.01);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--gray-500);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease-in-out);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-toggle:hover { background: var(--gray-100); color: var(--gray-700); }

/* Header search / command palette trigger */
.header-search {
  position: relative;
  max-width: 480px;
  flex: 1;
  margin: 0 24px;
}
.header-search input {
  width: 100%;
  height: 36px;
  padding: 0 36px 0 36px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  background: var(--gray-50);
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
}
.header-search input::placeholder { color: var(--gray-400); }
.header-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(126, 72, 28, 0.15);
  background: #fff;
}
.header-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 13px;
  pointer-events: none;
}
.header-search .search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--gray-400);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: inherit;
  pointer-events: none;
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  color: var(--text-tertiary);
  cursor: pointer;
  position: relative;
  transition: background-color var(--duration-fast) var(--ease-in-out), color var(--duration-fast) var(--ease-in-out), border-color var(--duration-fast) var(--ease-in-out);
  font-size: 14px;
}
.btn-icon:hover { background: var(--hover-bg); color: var(--text-primary); border-color: var(--text-quaternary); }

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  padding: 0 4px;
  border: 2px solid #fff;
  animation: pulse-badge 2s ease-in-out infinite;
}
@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Header avatar */
.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow var(--duration-fast) var(--ease-out);
}
.header-avatar:hover {
  box-shadow: 0 0 0 3px rgba(126, 72, 28, 0.15);
}
.header-avatar img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
}


/* ==============================================
   7. PAGE CONTENT
   ============================================== */
.page-content { padding: 28px; }


/* ==============================================
   8. PAGE HEADER ROW
   ============================================== */
.page-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.greeting {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0 0 2px;
  line-height: 1.2;
}
.greeting-sub {
  font-size: 13px;
  color: var(--gray-500);
  margin: 0;
  line-height: 1.4;
}
.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}


/* ==============================================
   9. WIDGET CARDS
   ============================================== */
.widget-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--duration-normal) var(--ease-out), transform var(--duration-normal) var(--ease-out);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.widget-card:hover { box-shadow: var(--shadow-sm); }
.page-content > .widget-card,
.page-content > .animate-in { margin-bottom: 20px; }
.page-content > :last-child { margin-bottom: 0; }

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--divider-color);
  flex-shrink: 0;
}
.widget-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.widget-action {
  color: var(--primary);
  font-size: 12px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
}
.widget-action:hover { color: var(--accent); }


/* ==============================================
   10. KPI / MINI-STAT CARDS
   ============================================== */
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--duration-normal) var(--ease-out), transform var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}
.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}
.stat-card .stat-label {
  font-size: 11.5px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.mini-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: all var(--duration-normal) var(--ease-out);
}
.mini-stat:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}
.mini-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.mini-stat-icon.primary { background: var(--primary-50); color: var(--primary); }
.mini-stat-icon.accent  { background: var(--accent-50); color: var(--accent-hover); }
.mini-stat-icon.success { background: var(--success-light); color: var(--success); }
.mini-stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.mini-stat-icon.danger  { background: var(--danger-light); color: var(--danger); }
.mini-stat-icon.info    { background: var(--info-light); color: var(--info); }

.mini-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.mini-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}


/* ==============================================
   11. STATUS BADGES
   ============================================== */
.badge-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.badge-success { background: rgba(16, 185, 129, 0.1); color: #059669; }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.badge-danger  { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.badge-info    { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
.badge-primary { background: rgba(126, 72, 28, 0.1); color: var(--primary); }
.badge-accent  { background: rgba(6, 182, 212, 0.1); color: var(--accent-hover); }

/* ATS-specific stage badges */
.badge-status.new        { background: var(--info-light); color: var(--info); }
.badge-status.screening  { background: var(--accent-50); color: var(--accent-hover); }
.badge-status.interview  { background: var(--warning-light); color: #d97706; }
.badge-status.offer      { background: var(--success-light); color: var(--success); }
.badge-status.hired      { background: var(--success-light); color: #059669; }
.badge-status.rejected   { background: var(--danger-light); color: var(--danger); }
.badge-status.on-hold    { background: var(--gray-100); color: var(--gray-600); }
.badge-status.active     { background: var(--success-light); color: var(--success); }
.badge-status.draft      { background: var(--gray-100); color: var(--gray-500); }
.badge-status.closed     { background: var(--gray-100); color: var(--gray-600); }


/* ==============================================
   12. FORM FIELDS
   ============================================== */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--input-border);
  padding: 9px 14px;
  font-size: 13.5px;
  color: var(--text-primary);
  transition: border-color var(--duration-fast) var(--ease-in-out), box-shadow var(--duration-fast) var(--ease-in-out);
  background-color: var(--input-bg);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(126, 72, 28, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
  outline: none;
}
.form-control::placeholder { color: var(--gray-400); }
.form-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.init-field {
  margin-bottom: 16px;
}
.init-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}


/* ==============================================
   13. BUTTONS
   ============================================== */
.btn {
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  transition: background-color var(--duration-fast) var(--ease-in-out), box-shadow var(--duration-fast) var(--ease-in-out), transform var(--duration-fast) var(--ease-in-out), border-color var(--duration-fast) var(--ease-in-out), color var(--duration-fast) var(--ease-in-out);
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  cursor: pointer;
}
.btn i { font-size: 0.9em; }

.btn-primary-custom {
  background: var(--primary);
  color: #fff;
  border: none;
  box-shadow: 0 1px 2px rgba(126, 72, 28, 0.3);
}
.btn-primary-custom:hover {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  box-shadow: 0 2px 12px rgba(6, 182, 212, 0.35);
  color: #fff;
}

.btn-secondary {
  background: var(--card-bg);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  color: var(--gray-900);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: none;
  box-shadow: none;
}
.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: none;
  box-shadow: 0 1px 2px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.btn-success {
  background: var(--success);
  color: #fff;
  border: none;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
  background: #059669;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: 0 1px 2px rgba(6, 182, 212, 0.3);
}
.btn-accent:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.35);
}

/* Button Sizes */
.btn-xs { padding: 4px 8px; font-size: 11px; border-radius: 4px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-md { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 10px 20px; font-size: 14px; }
.btn-xl { padding: 12px 24px; font-size: 15px; border-radius: var(--radius-md); }

/* Disabled States */
.btn:disabled,
.btn.disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.form-control:disabled,
.form-select:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--gray-50);
  color: var(--gray-400);
}


/* ==============================================
   14. MODALS
   ============================================== */
.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}
.modal-header {
  border-bottom: 1px solid var(--gray-100);
  padding: 18px 24px;
}
.modal-header .modal-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}
.modal-body { padding: 24px; }
.modal-footer {
  border-top: 1px solid var(--gray-100);
  padding: 14px 24px;
}
.modal-backdrop.show { opacity: 0.3; }


/* ==============================================
   15. DATA TABLE
   ============================================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table thead th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  padding: 10px 14px;
  border-bottom: 2px solid var(--gray-200);
  text-align: left;
  white-space: nowrap;
}
.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tbody tr {
  transition: background var(--duration-fast) var(--ease-out);
}
.data-table tbody tr:hover {
  background: var(--gray-50);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}


/* ==============================================
   16. EMPTY STATES
   ============================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--gray-400);
  margin-bottom: 16px;
}
.empty-state-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.empty-state-text {
  font-size: 13px;
  color: var(--text-tertiary);
  max-width: 320px;
  margin-bottom: 16px;
}


/* ==============================================
   17. TOAST NOTIFICATIONS
   ============================================== */
#toastContainer {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.ats-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 420px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  pointer-events: auto;
  animation: toastSlideIn var(--duration-normal) var(--ease-spring) forwards;
}
.ats-toast.removing {
  animation: toastSlideOut var(--duration-fast) var(--ease-out) forwards;
}
.ats-toast-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: 16px;
}
.ats-toast.success { border-left: 3px solid var(--success); }
.ats-toast.success .ats-toast-icon { color: var(--success); }
.ats-toast.error   { border-left: 3px solid var(--danger); }
.ats-toast.error .ats-toast-icon   { color: var(--danger); }
.ats-toast.warning { border-left: 3px solid var(--warning); }
.ats-toast.warning .ats-toast-icon { color: var(--warning); }
.ats-toast.info    { border-left: 3px solid var(--info); }
.ats-toast.info .ats-toast-icon    { color: var(--info); }

.ats-toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
}
.ats-toast-close:hover { color: var(--gray-600); }


/* ==============================================
   18. ANIMATIONS
   ============================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-in {
  animation: slideIn 0.4s var(--ease-out) both;
}
.animate-in:nth-child(1)  { animation-delay: 0.02s; }
.animate-in:nth-child(2)  { animation-delay: 0.04s; }
.animate-in:nth-child(3)  { animation-delay: 0.06s; }
.animate-in:nth-child(4)  { animation-delay: 0.08s; }
.animate-in:nth-child(5)  { animation-delay: 0.10s; }
.animate-in:nth-child(6)  { animation-delay: 0.12s; }
.animate-in:nth-child(7)  { animation-delay: 0.14s; }
.animate-in:nth-child(8)  { animation-delay: 0.16s; }
.animate-in:nth-child(9)  { animation-delay: 0.18s; }
.animate-in:nth-child(10) { animation-delay: 0.20s; }

.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}


/* ==============================================
   19. ATS KANBAN BOARD
   ============================================== */
.ats-kanban {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 500px;
}
.ats-kanban::-webkit-scrollbar { height: 6px; }

.ats-column {
  min-width: 280px;
  max-width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

.ats-col-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.ats-col-header-bar {
  width: 4px;
  height: 18px;
  border-radius: 2px;
  margin-right: 10px;
  flex-shrink: 0;
}
.ats-col-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}
.ats-col-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  background: var(--gray-200);
  padding: 1px 8px;
  border-radius: var(--radius-full);
}

.ats-col-body {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ats-col-body.drop-active {
  background: var(--primary-50);
  border: 2px dashed var(--primary-light);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.ats-col-body:empty::after {
  content: 'Drop candidates here';
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-md);
  color: var(--text-quaternary);
  font-size: 12px;
  font-weight: 500;
}

.ats-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: grab;
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
}
.ats-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.ats-card:active { cursor: grabbing; }
.ats-card.sortable-ghost {
  opacity: 0.4;
  background: var(--primary-50);
}
.ats-card.sortable-chosen {
  box-shadow: var(--shadow-lg);
  transform: rotate(2deg);
}

.ats-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.candidate-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.candidate-avatar.av-1 { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.candidate-avatar.av-2 { background: linear-gradient(135deg, var(--accent), var(--accent-light)); }
.candidate-avatar.av-3 { background: linear-gradient(135deg, var(--info), #93c5fd); }
.candidate-avatar.av-4 { background: linear-gradient(135deg, var(--success), #6ee7b7); }
.candidate-avatar.av-5 { background: linear-gradient(135deg, var(--warning), #fcd34d); }
.candidate-avatar.av-6 { background: linear-gradient(135deg, #8b5cf6, #c4b5fd); }
.candidate-avatar img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.ats-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.ats-card-role {
  font-size: 11px;
  color: var(--text-tertiary);
}

.ats-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.ats-card-meta i {
  font-size: 10px;
  margin-right: 3px;
}

.ats-card-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--success-light);
  color: var(--success);
}
.ats-card-score.medium { background: var(--warning-light); color: #d97706; }
.ats-card-score.low    { background: var(--danger-light); color: var(--danger); }

.ats-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-100);
}
.ats-card-action-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--gray-400);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  transition: all var(--duration-fast) var(--ease-out);
}
.ats-card-action-btn:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}


/* ==============================================
   20. TIMELINE
   ============================================== */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--gray-200);
  border-radius: 1px;
}
.timeline-item {
  position: relative;
  padding-bottom: 20px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-icon {
  position: absolute;
  left: -28px;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #fff;
  background: var(--gray-400);
  z-index: 1;
}
.timeline-icon.primary { background: var(--primary); }
.timeline-icon.accent  { background: var(--accent); }
.timeline-icon.success { background: var(--success); }
.timeline-icon.warning { background: var(--warning); }
.timeline-icon.danger  { background: var(--danger); }
.timeline-icon.info    { background: var(--info); }

.timeline-content {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.timeline-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.timeline-text {
  font-size: 12px;
  color: var(--text-tertiary);
}
.timeline-time {
  font-size: 11px;
  color: var(--text-quaternary);
  margin-top: 4px;
}


/* ==============================================
   21. COMMAND PALETTE
   ============================================== */
.cmd-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 9998;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
}
.cmd-palette-overlay.active { display: flex; }

.cmd-palette {
  width: 560px;
  max-width: 90vw;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: fadeInUp var(--duration-normal) var(--ease-spring);
}
.cmd-palette-input {
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-bottom: 1px solid var(--gray-200);
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  background: transparent;
}
.cmd-palette-input:focus { outline: none; }
.cmd-palette-input::placeholder { color: var(--gray-400); }

.cmd-palette-results {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}
.cmd-palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}
.cmd-palette-item:hover,
.cmd-palette-item.focused {
  background: var(--gray-100);
}
.cmd-palette-item i {
  width: 20px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
}
.cmd-palette-item span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.cmd-palette-item .cmd-type {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-quaternary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}


/* ==============================================
   22. GRID LAYOUTS
   ============================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.section-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 20px;
  margin-bottom: 24px;
}
.section-grid-half {
  grid-template-columns: 1fr 1fr;
}
.section-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}


/* ==============================================
   23. LOGIN PAGE
   ============================================== */
.login-page {
  display: flex;
  min-height: 100vh;
}

.login-brand {
  flex: 0 0 420px;
  background: linear-gradient(160deg, #1e1208 0%, #140c04 50%, #2a1a0e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.login-brand::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(126, 72, 28, 0.15);
  top: -100px;
  right: -100px;
}
.login-brand::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.08);
  bottom: -80px;
  left: -80px;
}

.login-brand-logo {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #9a5a25 0%, #c47d3e 50%, #e0a86e 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 20px rgba(126, 72, 28, 0.45), 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.login-brand h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
  letter-spacing: -0.025em;
}
.login-brand h1 span { color: var(--accent-light); }
.login-brand p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  max-width: 280px;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}
.login-brand .brand-sub-text {
  font-size: 9.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.25);
  margin-top: 4px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.login-form-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: var(--page-bg);
}
.login-form-inner {
  width: 100%;
  max-width: 380px;
}
.login-form-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}
.login-form-sub {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 28px;
}

.login-error {
  background: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: none;
}
.login-error.show { display: block; }

.login-field {
  margin-bottom: 18px;
}
.login-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.login-field input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--input-bg);
  transition: all var(--duration-fast) var(--ease-out);
}
.login-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(126, 72, 28, 0.15);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 13px;
}
.login-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  cursor: pointer;
}
.login-options a {
  color: var(--primary);
  font-weight: 500;
}

.login-btn {
  width: 100%;
  padding: 11px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  box-shadow: 0 1px 2px rgba(126, 72, 28, 0.3);
}
.login-btn:hover {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  box-shadow: 0 2px 12px rgba(6, 182, 212, 0.35);
}
.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}


/* ==============================================
   24. PROGRESS BAR
   ============================================== */
.progress-track {
  height: 5px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill-bar {
  height: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  transition: width 0.5s ease;
  border-radius: var(--radius-full);
}


/* ==============================================
   25. QUICK ACTIONS BAR
   ============================================== */
.quick-actions-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.qa-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}
.qa-btn i {
  color: var(--primary);
  font-size: 13px;
  transition: color 0.2s;
}
.qa-btn:hover {
  border-color: var(--accent);
  color: var(--gray-800);
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.1);
  transform: translateY(-1px);
}
.qa-btn:hover i {
  color: var(--accent);
}


/* ==============================================
   26. UTILITIES
   ============================================== */
.text-primary-u { color: var(--primary) !important; }
.text-accent  { color: var(--accent) !important; }
.text-muted   { color: var(--text-tertiary) !important; }
.text-danger  { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }

.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }

.fs-11 { font-size: 11px !important; }
.fs-12 { font-size: 12px !important; }
.fs-13 { font-size: 13px !important; }
.fs-14 { font-size: 14px !important; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ==============================================
   27. RESPONSIVE
   ============================================== */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  .main-content {
    margin-left: 0 !important;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .section-grid {
    grid-template-columns: 1fr;
  }
  .section-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .page-content { padding: 16px; }
  .greeting { font-size: 20px; }
  .page-header-row { flex-direction: column; align-items: flex-start; }
  .header-search { display: none; }
  .mini-stat { padding: 14px 16px; }
  .mini-stat-value { font-size: 18px; }
  .widget-card { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .section-grid-3 { grid-template-columns: 1fr; }

  /* Login responsive */
  .login-page { flex-direction: column; }
  .login-brand {
    flex: none;
    padding: 32px 24px;
    min-height: auto;
  }
  .login-brand h1 { font-size: 22px; }
  .login-form-wrap { padding: 32px 24px; }
}

@media (max-width: 480px) {
  .page-content { padding: 12px; }
  .top-header { padding: 0 12px; }
  .ats-column { min-width: 260px; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   THEME OVERRIDES — Sidebar, flyouts, header follow theme
   ═══════════════════════════════════════════════════════════ */

/* Sidebar text/icons use theme CSS variables */
[data-theme] .sidebar-nav .nav-item { color: var(--theme-text, rgba(255,255,255,0.75)); }
[data-theme] .sidebar-nav .nav-item:hover { background: var(--theme-hover-bg, rgba(255,255,255,0.08)); color: var(--theme-text-hover, #fff); }
[data-theme] .sidebar-nav .nav-item.active { background: var(--theme-active-bg, rgba(6,182,212,0.14)); color: var(--theme-text-hover, #fff); }
[data-theme] .sidebar-nav .nav-item i { color: var(--theme-text, rgba(255,255,255,0.55)); }
[data-theme] .sidebar-nav .nav-item:hover i,
[data-theme] .sidebar-nav .nav-item.active i { color: var(--theme-text-hover, #fff); opacity: 1; }
[data-theme] .sidebar-nav .nav-section { color: var(--theme-section-text, rgba(255,255,255,0.35)); }
[data-theme] .sidebar-nav .nav-section:hover { color: var(--theme-text, rgba(255,255,255,0.55)); }
[data-theme] .sidebar-brand .brand-text { color: var(--theme-text-hover, #fff); }
[data-theme] .sidebar-brand .brand-sub { color: var(--theme-section-text, rgba(255,255,255,0.3)); }
[data-theme] .sidebar-footer .user-name { color: var(--theme-text-hover, #fff); }
[data-theme] .sidebar-footer .user-role { color: var(--theme-text, rgba(255,255,255,0.5)); }
[data-theme] .sidebar-footer-actions button { color: var(--theme-text, rgba(255,255,255,0.5)); }
[data-theme] .sidebar-footer-actions button:hover { color: var(--theme-text-hover, #fff); }
[data-theme] .sidebar { border-right-color: var(--theme-border, rgba(255,255,255,0.05)); }

/* Flyout follows theme */
[data-theme] .submenu-flyout {
  background: var(--flyout-bg, linear-gradient(135deg, #1e1208 0%, #2a1a0e 100%)) !important;
}
[data-theme] .submenu-flyout::before { border-right-color: var(--flyout-arrow, #1e1208) !important; }
[data-theme] .submenu-flyout-title { color: var(--theme-section-text, rgba(255,255,255,0.45)); }
[data-theme] .submenu-flyout-item { color: var(--theme-text, rgba(255,255,255,0.85)); }
[data-theme] .submenu-flyout-item:hover { color: var(--theme-text-hover, #fff); background: var(--theme-hover-bg, rgba(255,255,255,0.08)); }
[data-theme] .submenu-flyout-header { border-bottom-color: var(--theme-border, rgba(255,255,255,0.08)); }

/* Collapsed sidebar icons follow theme */
[data-theme] .sidebar.collapsed .nav-section .nav-section-icon { color: var(--theme-text, rgba(255,255,255,0.65)); }
[data-theme] .sidebar.collapsed .nav-section:hover .nav-section-icon { color: var(--theme-text-hover, #fff); }
[data-theme] .sidebar.collapsed .nav-section:hover { background: var(--theme-hover-bg, rgba(255,255,255,0.06)); }

/* Light sidebar themes — dark text on light bg */
[data-theme="clean-white"] .sidebar-nav .nav-item,
[data-theme="lavender"] .sidebar-nav .nav-item,
[data-theme="sky"] .sidebar-nav .nav-item,
[data-theme="mint"] .sidebar-nav .nav-item,
[data-theme="blush"] .sidebar-nav .nav-item,
[data-theme="warm-sand"] .sidebar-nav .nav-item { color: var(--theme-text); }

[data-theme="clean-white"] .sidebar-nav .nav-section,
[data-theme="lavender"] .sidebar-nav .nav-section,
[data-theme="sky"] .sidebar-nav .nav-section,
[data-theme="mint"] .sidebar-nav .nav-section,
[data-theme="blush"] .sidebar-nav .nav-section,
[data-theme="warm-sand"] .sidebar-nav .nav-section { color: var(--theme-section-text, rgba(0,0,0,0.35)); }

[data-theme="clean-white"] .sidebar-brand .brand-text,
[data-theme="lavender"] .sidebar-brand .brand-text,
[data-theme="sky"] .sidebar-brand .brand-text,
[data-theme="mint"] .sidebar-brand .brand-text,
[data-theme="blush"] .sidebar-brand .brand-text,
[data-theme="warm-sand"] .sidebar-brand .brand-text { color: var(--theme-text-hover, #1e293b); }

[data-theme="clean-white"] .sidebar-brand .brand-sub,
[data-theme="lavender"] .sidebar-brand .brand-sub,
[data-theme="sky"] .sidebar-brand .brand-sub,
[data-theme="mint"] .sidebar-brand .brand-sub,
[data-theme="blush"] .sidebar-brand .brand-sub,
[data-theme="warm-sand"] .sidebar-brand .brand-sub { color: var(--theme-section-text, rgba(0,0,0,0.4)); }

[data-theme="clean-white"] .sidebar-footer .user-name,
[data-theme="lavender"] .sidebar-footer .user-name,
[data-theme="sky"] .sidebar-footer .user-name,
[data-theme="mint"] .sidebar-footer .user-name,
[data-theme="blush"] .sidebar-footer .user-name,
[data-theme="warm-sand"] .sidebar-footer .user-name { color: var(--theme-text-hover, #1e293b); }

[data-theme="clean-white"] .sidebar-footer .user-role,
[data-theme="lavender"] .sidebar-footer .user-role,
[data-theme="sky"] .sidebar-footer .user-role,
[data-theme="mint"] .sidebar-footer .user-role,
[data-theme="blush"] .sidebar-footer .user-role,
[data-theme="warm-sand"] .sidebar-footer .user-role { color: var(--theme-text, rgba(0,0,0,0.5)); }

[data-theme="clean-white"] .sidebar-footer-actions button,
[data-theme="lavender"] .sidebar-footer-actions button,
[data-theme="sky"] .sidebar-footer-actions button,
[data-theme="mint"] .sidebar-footer-actions button,
[data-theme="blush"] .sidebar-footer-actions button,
[data-theme="warm-sand"] .sidebar-footer-actions button { color: var(--theme-text, rgba(0,0,0,0.5)); }

[data-theme="clean-white"] .sidebar-brand::after,
[data-theme="lavender"] .sidebar-brand::after,
[data-theme="sky"] .sidebar-brand::after,
[data-theme="mint"] .sidebar-brand::after,
[data-theme="blush"] .sidebar-brand::after,
[data-theme="warm-sand"] .sidebar-brand::after { background: linear-gradient(90deg, transparent, rgba(0,0,0,0.06), transparent); }

[data-theme="clean-white"] .sidebar::-webkit-scrollbar-thumb,
[data-theme="lavender"] .sidebar::-webkit-scrollbar-thumb,
[data-theme="sky"] .sidebar::-webkit-scrollbar-thumb,
[data-theme="mint"] .sidebar::-webkit-scrollbar-thumb,
[data-theme="blush"] .sidebar::-webkit-scrollbar-thumb,
[data-theme="warm-sand"] .sidebar::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); }

/* Immersive theme — cards, inputs, text all transform */
.immersive-theme body { background: var(--page-bg); color: var(--text-primary); }
.immersive-theme .page-content { background: var(--page-bg); }
.immersive-theme .top-header { background: var(--header-bg, rgba(0,0,0,0.9)); border-bottom-color: var(--header-border, var(--divider-color)); }
.immersive-theme .widget-card,
.immersive-theme .ac-form-card,
.immersive-theme .src-form-card,
.immersive-theme .src-card { background: var(--card-bg); border-color: var(--card-border); }
.immersive-theme .form-control,
.immersive-theme .form-select { background: var(--input-bg); border-color: var(--input-border); color: var(--text-primary); }
.immersive-theme .form-control:focus,
.immersive-theme .form-select:focus { border-color: var(--primary); }
.immersive-theme .mini-stat { background: var(--card-bg); border-color: var(--card-border); }
.immersive-theme .data-table thead th { background: var(--hover-bg); color: var(--text-secondary); border-color: var(--divider-color); }
.immersive-theme .data-table tbody td { border-color: var(--divider-color); color: var(--text-primary); }
.immersive-theme .modal-content { background: var(--card-bg); color: var(--text-primary); }
.immersive-theme .modal-header { border-color: var(--divider-color); }
.immersive-theme .modal-footer { border-color: var(--divider-color); background: var(--hover-bg); }
.immersive-theme .cp-hero { background: var(--card-bg); border-color: var(--card-border); }
.immersive-theme .cp-stat { background: var(--card-bg); border-color: var(--card-border); }
.immersive-theme .cp-tab-bar { background: var(--hover-bg); }
.immersive-theme .cp-tab.active { background: var(--card-bg); color: var(--text-primary); }
.immersive-theme .cmd-palette { background: var(--card-bg); border-color: var(--card-border); }
.immersive-theme .cmd-palette-input { background: var(--input-bg); color: var(--text-primary); border-color: var(--divider-color); }
.immersive-theme .cmd-palette-item:hover { background: var(--hover-bg); }
.immersive-theme .dropdown-menu { background: var(--card-bg); border-color: var(--card-border); }
.immersive-theme .dropdown-item { color: var(--text-primary); }
.immersive-theme .dropdown-item:hover { background: var(--hover-bg); }

/* Theme picker modal z-index fix */
#themePickerModal { z-index: 1060; }
#themePickerModal .modal-backdrop { z-index: 1059; }
