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

:root {
  /* Elegant Dark Theme Palette */
  --bg-page: #050505;
  --bg-card: #0e0e11;
  --bg-input: #15151a;
  --border: #22222a;
  --border-glow: rgba(99, 102, 241, 0.3);
  
  --text-main: #ffffff;
  --text-dim: #a1a1aa;
  --text-muted: #52525b;
  
  --primary: #6366f1; /* Premium Indigo */
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.15);
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.15);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.15);
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --coin-bg: #ffd700;
  --coin-border: #daa520;
  --coin-text: #b8860b;
  --coin-glow: rgba(0, 0, 0, 0.1);
}

/* ─── Light Theme Overrides ─── */
html.light-theme {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;
  --border: #e2e8f0;
  --border-glow: rgba(99, 102, 241, 0.2);
  --text-main: #0f172a;
  --text-dim: #475569;
  --text-muted: #94a3b8;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
  --coin-bg: #ffd700;
  --coin-border: #daa520;
  --coin-text: #b8860b;
  --coin-glow: rgba(0, 0, 0, 0.1);
}

/* ─── Global Reset & Base ─── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
  color-scheme: dark;
}

html.light-theme body {
  color-scheme: light;
}

/* ─── Animations ─── */
@keyframes slideUpFade {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 var(--primary-glow); }
  70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.animate-slide-up { animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }

/* ─── Layout Architecture ─── */
.main-layout {
  display: none;
  opacity: 0;
  min-height: 100vh;
  transition: opacity 0.3s ease;
}

.sidebar {
  position: sticky;
  left: 0; top: 0;
  height: 100vh;
  width: 80px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  min-height: 0;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}
.sidebar:hover .sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--text-muted);
}

.sidebar:hover {
  width: 260px;
  padding: 32px 20px;
}

.content-area {
  padding: 48px 64px;
  flex: 1;
  max-width: 100%;
  overflow-x: auto;
}

.sidebar .brand-text,
.sidebar .nav-item-text,
.sidebar .user-info-text {
  opacity: 0;
  transition: opacity 0.2s ease;
  display: inline-block;
  vertical-align: middle;
}

.sidebar:hover .brand-text,
.sidebar:hover .nav-item-text,
.sidebar:hover .user-info-text {
  opacity: 1;
  transition-delay: 0.1s;
}

/* ─── Typography ─── */
h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.page-title { font-size: 32px; font-weight: 800; margin-bottom: 8px; }
.page-subtitle { color: var(--text-muted); font-size: 16px; margin-bottom: 40px; }

/* ─── Elite Dashboard Cards ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-lg);
}

.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--primary), transparent);
  opacity: 0; transition: opacity 0.3s ease;
}
.stat-card:hover::before { opacity: 1; }

.stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.stat-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  font-family: 'JetBrains Mono', monospace;
}

/* ─── Glassmorphism Tables ─── */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.01);
}

.table-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: separate; border-spacing: 0; }
th {
  text-align: left;
  padding: 16px 32px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-input);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

tr:hover td { background: var(--bg-input); }
tr:last-child td { border-bottom: none; }

/* ─── Premium Buttons ─── */
.btn {
  height: 44px;
  padding: 0 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px 0 var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 var(--primary-glow);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-input);
  border-color: var(--text-dim);
}

/* ─── Elegant Forms ─── */
.form-group { margin-bottom: 24px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.form-input {
  width: 100%;
  height: 48px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 16px;
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  transition: all 0.2s ease;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
  background: var(--bg-card);
}

/* Date Input Specifics */
input[type="date"] {
  position: relative;
  color: var(--text-main);
  color-scheme: dark;
}

html.light-theme input[type="date"] {
  color-scheme: light;
}

input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
  color: inherit;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px;
  filter: none !important;
  opacity: 1 !important;
  transition: 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 0.7 !important;
}

html.light-theme input[type="date"]::-webkit-calendar-picker-indicator {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>');
  filter: none !important;
}

/* ─── Beautiful Modals ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(20px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.show .modal { transform: scale(1) translateY(0); }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.modal-header h3 { font-size: 24px; }
.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover { background: var(--bg-input); color: var(--text-main); }

/* ─── Navigation Styling ─── */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  color: var(--text-dim);
  text-decoration: none;
  margin-bottom: 4px;
  font-weight: 500;
  transition: all 0.2s ease;
  width: 220px;
}
.sidebar:hover .nav-item {
  padding: 12px 16px;
}
.nav-item svg { width: 18px; height: 18px; opacity: 0.7; transition: opacity 0.2s; min-width: 18px; }
.nav-item:hover { background: var(--bg-input); color: var(--text-main); transform: translateX(4px); }
.nav-item:hover svg { opacity: 1; color: var(--primary); }
.nav-item.active { background: var(--primary-glow); color: var(--primary); font-weight: 600; }
.nav-item.active svg { opacity: 1; }

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin: 24px 0 12px 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.sidebar:hover .nav-section-title {
  opacity: 1;
}

.sidebar-user-section {
  display: flex; 
  align-items: center; 
  gap: 12px; 
  padding: 8px; 
  border-radius: var(--radius-md); 
  cursor: pointer; 
  transition: 0.2s;
  background: transparent;
  margin-bottom: 16px;
  width: 220px;
}
.sidebar:hover .sidebar-user-section {
  padding: 12px;
  background: rgba(255,255,255,0.02);
}
.sidebar-user-section:hover {
  background: rgba(255,255,255,0.05);
}

.sidebar-user-avatar {
  min-width: 32px; 
  height: 32px; 
  border-radius: 50%; 
  background: var(--primary); 
  color: #fff; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-weight: 700; 
  font-size: 14px;
}

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ─── Toasts & Loaders ─── */
.toast-container { position: fixed; bottom: 32px; right: 32px; z-index: 9999; display: flex; flex-direction: column; gap: 12px; }
.toast {
  padding: 16px 24px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideUpFade 0.3s ease forwards;
  display: flex;
  align-items: center;
  gap: 12px;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--primary); }

/* ─── Indian Rupee Coin Loader ─── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 5, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease;
}
.loading-overlay.active { display: flex; opacity: 1; }

.coin {
  width: 80px;
  height: 80px;
  background-color: var(--coin-bg);
  border: 4px solid var(--coin-border);
  border-radius: 50%;
  position: relative;
  transform-style: preserve-3d;
  animation: spin 1s linear infinite;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 40px;
  font-weight: bold;
  color: var(--coin-text);
  box-shadow: inset 0 0 10px rgba(0,0,0,0.1), 0 0 20px var(--coin-glow);
}

.coin .front, .coin .back {
  position: absolute;
  backface-visibility: hidden;
}

.coin .back {
  transform: rotateY(180deg);
}

@keyframes spin {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

/* .loading-bar removed — replaced by coin loader overlay */
/* ─── High-End Status Selects ─── */
.status-select-container {
  position: relative;
  display: inline-block;
}

.status-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 6px 32px 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: 25px;
  background-color: var(--bg-input);
  color: var(--text-main);
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 110px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.status-select-container::after {
  content: "▾";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-dim);
  font-size: 16px;
}

/* ─── Sticky Table Columns ─── */
.table-container {
  position: relative;
  overflow-x: auto;
}

.pipeline-table th:nth-child(1), .pipeline-table td:nth-child(1) { position: sticky; left: 0; z-index: 10; background: var(--bg-card); }
.pipeline-table th:nth-child(2), .pipeline-table td:nth-child(2) { position: sticky; left: 60px; z-index: 10; background: var(--bg-card); }
.pipeline-table th:nth-child(3), .pipeline-table td:nth-child(3) { position: sticky; left: 210px; z-index: 10; background: var(--bg-card); }
.pipeline-table th:nth-child(4), .pipeline-table td:nth-child(4) { position: sticky; left: 330px; z-index: 10; background: var(--bg-card); }

.pipeline-table th:nth-child(1), .pipeline-table th:nth-child(2), .pipeline-table th:nth-child(3), .pipeline-table th:nth-child(4) { z-index: 15; background: var(--bg-input); }

/* Add vertical border to indicate frozen edge */
.pipeline-table th:nth-child(4), .pipeline-table td:nth-child(4) {
  border-right: 2px solid var(--border) !important;
  box-shadow: 4px 0 8px -4px rgba(0,0,0,0.2);
}

.light-theme .pipeline-table th:nth-child(1), .light-theme .pipeline-table td:nth-child(1),
.light-theme .pipeline-table th:nth-child(2), .light-theme .pipeline-table td:nth-child(2),
.light-theme .pipeline-table th:nth-child(3), .light-theme .pipeline-table td:nth-child(3),
.light-theme .pipeline-table th:nth-child(4), .light-theme .pipeline-table td:nth-child(4) { background: #fff; }
.light-theme .pipeline-table th:nth-child(1), .light-theme .pipeline-table th:nth-child(2),
.light-theme .pipeline-table th:nth-child(3), .light-theme .pipeline-table th:nth-child(4) { background: #f9fafb; }

/* Dynamic State Themes - Vibrant & Modern */
.status-select.stage-fic { 
  border-color: var(--primary); color: var(--primary); 
  background: rgba(99,102,241,0.12); 
}
.status-select.stage-joined { 
  border-color: var(--success); color: var(--success); 
  background: rgba(16,185,129,0.12); 
}
.status-select.stage-credit-note { 
  border-color: var(--danger); color: var(--danger); 
  background: rgba(239,68,68,0.12); 
}

.status-select.payout-pending { 
  border-color: #f59e0b; color: #f59e0b; 
  background: rgba(245,158,11,0.12); 
}
.status-select.payout-paid { 
  border-color: var(--success); color: var(--success); 
  background: rgba(16,185,129,0.12); 
}
.status-select.payout-no-payment { 
  border-color: #64748b; color: #64748b; 
  background: rgba(100,116,139,0.12); 
}

.status-select:hover { 
  border-color: var(--primary); 
  background: var(--bg-card);
}




/* ─── Premium Theme Toggle (Uiverse.io by TahaShameli) ─── */
.switch {
  font-size: 17px;
  position: relative;
  display: inline-block;
  width: 3.5em;
  height: 2em;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #333;
  transition: 0.4s;
  border-radius: 30px;
  overflow: hidden;
}

.circle {
  position: absolute;
  content: "";
  height: 1.4em;
  width: 1.4em;
  border-radius: 20px;
  left: 0.3em;
  bottom: 0.3em;
  background-color: #fff000;
  transform: rotate(360deg) translateX(0);
  transition: 0.4s;
}

.switch input:checked + .slider .circle {
  transform: rotate(0deg) translateX(1.5em) !important;
  background-color: #fff !important;
}

.switch input:checked + .slider .circle .shine {
  transform: translate(0%, 0%) !important;
}

.switch input:checked + .slider .circle .moon {
  left: -10%;
  opacity: 1;
  transform: translateY(-60%);
  background-color: #333 !important; /* Keep the eclipse shadow matching the slider bg */
}


.moon {
  position: absolute;
  left: -100%;
  top: 50%;
  opacity: 0;
  background-color: #333;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 99999px;
  transform: translateY(-50%);
  transition: all 0.4s;
}

.shine {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.25rem;
  height: 0.25rem;
  background-color: #fff000;
  border-radius: 1rem;
  transition: all 0.4s;
}

.shine-1 { transform: translate(-50%, -375%); }
.shine-2 { transform: translate(175%, -275%); }
.shine-3 { transform: translate(275%, -50%); }
.shine-4 { transform: translate(175%, 175%); }
.shine-5 { transform: translate(-50%, 275%); }
.shine-6 { transform: translate(-275%, 175%); }
.shine-7 { transform: translate(-375%, -50%); }
.shine-8 { transform: translate(-275%, -275%); }

/* ─── Responsive Design ─── */
.mobile-only { display: none; }

@media (max-width: 1024px) {
  .content-area { padding: 32px 24px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .mobile-only { display: flex; }
  
  .sidebar {
    width: 260px;
    left: -260px;
    z-index: 2000; /* Above topNav */
    position: fixed;
    height: 100vh;
  }
  
  .sidebar.active {
    left: 0;
    padding: 32px 20px;
    box-shadow: 20px 0 50px rgba(0,0,0,0.5);
  }
  
  .sidebar .brand-text, 
  .sidebar .nav-item-text { 
    opacity: 1; 
  }

  .content-area { 
    padding: 80px 16px 16px 16px; /* top = header height + gap */
    margin-top: 0;
    width: 100%;
  }
  
  #topNav {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: var(--bg-card);
    z-index: 1100;
    padding: 0 16px;
    margin: 0;
    height: 64px;
    border-bottom: 1px solid var(--border);
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  /* Responsive Grid Utility */
  .responsive-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  
  /* Period Tabs Responsive */
  .period-tabs {
    display: flex !important;
    overflow-x: auto !important;
    padding-bottom: 4px;
    margin-bottom: 12px !important;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    border-bottom: none !important;
    flex-direction: row !important; /* Force row */
  }

  .period-tab {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 6px 12px !important;
    font-size: 12px !important;
    border-radius: 20px !important;
  }

  .stats-grid { grid-template-columns: 1fr; gap: 12px; }
  
  .dashboard-filters { 
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important; 
    padding: 12px !important;
  }
  
  .dashboard-filters > * { 
    width: 100% !important; 
    flex: none !important; 
    min-width: 0 !important;
  }

  /* Search input should take full width in the filter grid */
  .dashboard-filters input[type="text"],
  .dashboard-filters .searchable-dropdown:first-child {
    grid-column: span 2;
  }

  .card-header { 
    flex-direction: column !important; 
    align-items: stretch !important; 
    gap: 12px !important; 
    padding: 12px !important;
  }
  
  .card-header > div:not(.period-tabs) {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  
  .card-header .btn { width: 100%; }

  .header-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }

  /* Tables */
  .table-container { 
    margin: 0 -16px; 
    padding: 0 16px; 
    border-radius: 0;
    border-left: none;
    border-right: none;
    overflow-x: auto;
  }

  table { min-width: 800px; } /* Ensure horizontal scroll on mobile instead of squishing */

  table th, table td {
    padding: 12px 16px !important;
    font-size: 13px !important;
  }
  
  /* Modal */
  .modal { 
    padding: 24px; 
    max-width: 95vw; 
    margin: 10px;
    border-radius: var(--radius-lg);
  }
  
  .modal-body {
    padding-right: 0 !important;
  }

  .page-title { font-size: 20px; }
  .page-subtitle { font-size: 13px; margin-bottom: 16px; }

  /* Sidebar Overlay */
  #sidebarOverlay {
    animation: fadeIn 0.3s ease;
  }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Recruiter Goal Card Responsive */
@media (max-width: 900px) {
  #recruiterGoalCard > div {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  #recruiterGoalCard > div > div {
    border: none !important;
    padding: 0 !important;
    text-align: center !important;
  }
}

/* ─── Searchable Dropdown (Shadcn Style) ─── */
.searchable-dropdown {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.sd-toggle {
  width: 100%;
  height: 38px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 16px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: 0.2s;
  user-select: none;
}

.sd-toggle:hover { border-color: var(--primary); }

.sd-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 8px;
  animation: slideUpFade 0.2s ease forwards;
}

.sd-menu.show { display: flex; }

.sd-search {
  height: 36px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  color: var(--text-main);
  font-size: 13px;
  width: 100%;
}

.sd-search:focus { outline: none; border-color: var(--primary); }

.sd-options {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding-right: 4px;
}

.sd-options::-webkit-scrollbar { width: 4px; }
.sd-options::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sd-option {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-dim);
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sd-option:hover { background: var(--bg-input); color: var(--text-main); }
.sd-option.selected { background: var(--primary-glow); color: var(--primary); font-weight: 600; }

.sd-option.no-results {
  pointer-events: none;
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  justify-content: center;
}


/* Modern Sortable Table Headers */
th.sortable {
  position: relative;
  cursor: pointer;
  padding-right: 28px !important;
  transition: all 0.2s ease;
  user-select: none;
}
th.sortable:hover {
  background: var(--bg-hover) !important;
}
th.sortable::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 15l5 5 5-5'/%3E%3Cpath d='M7 9l5-5 5 5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.3;
  filter: var(--theme-invert);
}
th.sort-asc::after {
  opacity: 1 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 9l5-5 5 5'/%3E%3C/svg%3E") !important;
}
th.sort-desc::after {
  opacity: 1 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 15l5 5 5-5'/%3E%3C/svg%3E") !important;
}
:root { --theme-invert: invert(1); }
.light-theme { --theme-invert: invert(0); }
