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

/* ============================================================
   DESIGN SYSTEM — HRMS India  |  Purple / Indigo Modern Theme
   ============================================================ */
:root {
  /* Brand */
  --violet:       #7C3AED;
  --violet-dark:  #6D28D9;
  --violet-light: #8B5CF6;
  --indigo:       #4F46E5;
  --indigo-light: #6366F1;

  /* Gradient */
  --grad-sidebar: linear-gradient(160deg, #3B0764 0%, #4C1D95 35%, #4338CA 75%, #312E81 100%);
  --grad-primary: linear-gradient(135deg, #7C3AED, #4F46E5);
  --grad-blue:    linear-gradient(135deg, #2563EB, #06B6D4);
  --grad-green:   linear-gradient(135deg, #059669, #10B981);
  --grad-amber:   linear-gradient(135deg, #D97706, #F59E0B);
  --grad-rose:    linear-gradient(135deg, #DC2626, #F43F5E);
  --grad-cyan:    linear-gradient(135deg, #0891B2, #22D3EE);

  /* Semantic */
  --success: #10B981;
  --warning: #F59E0B;
  --danger:  #EF4444;
  --info:    #06B6D4;

  /* Background */
  --bg-base:    #F1F5FF;
  --bg-surface: #FFFFFF;
  --bg-card:    #FFFFFF;
  --bg-muted:   #F8FAFF;

  /* Border */
  --border:       rgba(99,102,241,0.12);
  --border-light: rgba(99,102,241,0.07);

  /* Text */
  --text-primary:   #0F172A;
  --text-secondary: #475569;
  --text-muted:     #94A3B8;
  --text-on-dark:   #FFFFFF;

  /* Sidebar text */
  --sidebar-text:        rgba(255,255,255,0.7);
  --sidebar-text-active: #FFFFFF;
  --sidebar-text-muted:  rgba(255,255,255,0.4);

  /* Dimensions */
  --sidebar-w: 265px;
  --topbar-h:  68px;

  /* Radius */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* Shadow */
  --shadow-xs: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm: 0 2px 8px rgba(15,23,42,0.08), 0 1px 3px rgba(15,23,42,0.05);
  --shadow-md: 0 4px 20px rgba(15,23,42,0.10), 0 2px 8px rgba(15,23,42,0.06);
  --shadow-lg: 0 8px 40px rgba(15,23,42,0.13), 0 4px 16px rgba(15,23,42,0.08);
  --shadow-card: 0 2px 12px rgba(99,102,241,0.08), 0 1px 4px rgba(15,23,42,0.05);
  --shadow-glow: 0 0 30px rgba(124,58,237,0.25);
  --shadow-btn:  0 4px 14px rgba(124,58,237,0.35);

  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.25); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(124,58,237,0.5); }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1 { font-size: 2rem;   font-weight: 800; line-height: 1.2; }
h2 { font-size: 1.4rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
h4 { font-size: 0.95rem; font-weight: 600; }
p  { color: var(--text-secondary); }

.text-primary   { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-success   { color: var(--success) !important; }
.text-danger    { color: var(--danger) !important; }
.text-warning   { color: var(--warning) !important; }
.text-center    { text-align: center; }
.text-right     { text-align: right; }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
}

.page-content {
  flex: 1;
  padding: 2rem 2rem 2.5rem;
  margin-top: var(--topbar-h);
}

/* ============================================================
   SIDEBAR — Purple Gradient
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--grad-sidebar);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: visible;
  box-shadow: 4px 0 24px rgba(76,29,149,0.25);
}

/* subtle pattern overlay */
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 10% 20%, rgba(124,58,237,0.3) 0%, transparent 60%),
    radial-gradient(ellipse at 90% 80%, rgba(99,102,241,0.2) 0%, transparent 60%);
  pointer-events: none;
}

.sidebar-logo {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  position: relative;
}

.sidebar-logo-icon {
  width: 42px; height: 42px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-logo-icon.has-logo {
  background: #fff;
  border-color: rgba(255,255,255,0.5);
  padding: 0;
}

.sidebar-logo-text h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.sidebar-logo-text span {
  font-size: 0.68rem;
  color: var(--sidebar-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.875rem;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 99px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.35); }

.sidebar-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--sidebar-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 0.85rem 0.75rem 0.3rem;
  margin-top: 0.25rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 0.845rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  margin-bottom: 1px;
  position: relative;
  user-select: none;
}

.sidebar-item:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.sidebar-item.active {
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(4px);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
}

.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 15%; bottom: 15%;
  width: 3px;
  background: #fff;
  border-radius: 0 3px 3px 0;
}

.sidebar-item .icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.85;
}
.sidebar-item.active .icon { opacity: 1; }

.sidebar-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1rem 0.42rem;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem 0.875rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  position: relative;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.sidebar-user:hover { background: rgba(255,255,255,0.1); }

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, rgba(255,255,255,0.35), rgba(255,255,255,0.15));
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  color: #fff; flex-shrink: 0;
}

.user-info .name { font-size: 0.8rem; font-weight: 600; color: #fff; }
.user-info .role { font-size: 0.68rem; color: var(--sidebar-text-muted); }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 1rem;
  z-index: 90;
  box-shadow: var(--shadow-xs);
}

.topbar-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-spacer { flex: 1; }

.topbar-search { position: relative; }
.topbar-search input {
  background: var(--bg-muted);
  border: 1.5px solid var(--border);
  border-radius: 99px;
  padding: 0.5rem 1.1rem 0.5rem 2.6rem;
  color: var(--text-primary);
  font-size: 0.845rem;
  width: 280px;
  transition: all var(--transition);
  outline: none;
}
.topbar-search input:focus {
  border-color: var(--violet-light);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search .search-icon {
  position: absolute;
  left: 0.9rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

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

.icon-btn {
  width: 38px; height: 38px;
  background: var(--bg-muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all var(--transition);
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--violet-light); color: var(--violet); background: rgba(124,58,237,0.06); }

/* ============================================================
   STAT CARDS — Gradient
   ============================================================ */
.stat-card {
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  color: #fff;
  border: none;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.stat-card::after {
  content: '';
  position: absolute;
  right: -20px; bottom: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
.stat-card::before {
  content: '';
  position: absolute;
  right: 30px; bottom: 30px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.stat-card.blue  { background: var(--grad-primary); box-shadow: 0 4px 20px rgba(124,58,237,0.3); }
.stat-card.green { background: var(--grad-green);   box-shadow: 0 4px 20px rgba(5,150,105,0.3); }
.stat-card.amber { background: var(--grad-amber);   box-shadow: 0 4px 20px rgba(217,119,6,0.3); }
.stat-card.rose  { background: var(--grad-rose);    box-shadow: 0 4px 20px rgba(220,38,38,0.3); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.1rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-change {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.5rem;
  color: rgba(255,255,255,0.9);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: box-shadow var(--transition);
  box-shadow: var(--shadow-card);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ============================================================
   GRID
   ============================================================ */
.grid { display: grid; gap: 1.25rem; }
.grid-2  { grid-template-columns: repeat(2, 1fr); }
.grid-3  { grid-template-columns: repeat(3, 1fr); }
.grid-4  { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 1.2rem; }

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-control {
  width: 100%;
  background: var(--bg-muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.875rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--violet-light);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
select.form-control option { background: #fff; color: var(--text-primary); }

.form-row { display: grid; gap: 1rem; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.855rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: var(--shadow-btn);
  border-color: transparent;
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 6px 20px rgba(124,58,237,0.45); }

.btn-secondary {
  background: var(--bg-muted);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--violet-light); color: var(--violet); background: rgba(124,58,237,0.05); }

.btn-success {
  background: var(--grad-green);
  color: #fff;
  box-shadow: 0 4px 14px rgba(5,150,105,0.3);
}
.btn-success:hover { filter: brightness(1.06); }

.btn-danger {
  background: var(--grad-rose);
  color: #fff;
  box-shadow: 0 4px 14px rgba(220,38,38,0.3);
}
.btn-danger:hover { filter: brightness(1.06); }

.btn-outline {
  background: transparent;
  border-color: var(--violet-light);
  color: var(--violet);
}
.btn-outline:hover { background: rgba(124,58,237,0.08); }

.btn-sm { padding: 0.38rem 0.875rem; font-size: 0.79rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn-icon { padding: 0.6rem; }

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table thead tr {
  background: var(--bg-muted);
  border-bottom: 1.5px solid var(--border);
}
.data-table th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  white-space: nowrap;
}
.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(99,102,241,0.06);
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: rgba(124,58,237,0.04); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-success { background: rgba(16,185,129,0.1); color: #059669; border: 1px solid rgba(16,185,129,0.2); }
.badge-danger  { background: rgba(239,68,68,0.1);  color: #DC2626; border: 1px solid rgba(239,68,68,0.2); }
.badge-warning { background: rgba(245,158,11,0.1); color: #D97706; border: 1px solid rgba(245,158,11,0.2); }
.badge-info    { background: rgba(6,182,212,0.1);  color: #0891B2; border: 1px solid rgba(6,182,212,0.2); }
.badge-neutral { background: rgba(99,102,241,0.08); color: var(--text-secondary); border: 1px solid var(--border); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(24px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: var(--shadow-lg);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }

.modal-header {
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.modal-close {
  background: var(--bg-muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition);
}
.modal-close:hover { color: var(--danger); border-color: var(--danger); background: rgba(239,68,68,0.06); }

.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-muted);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 0.2rem;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  border: 1.5px solid var(--border);
}
.tab-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.tab-btn.active {
  background: #fff;
  color: var(--violet);
  box-shadow: var(--shadow-xs);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   TOASTS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.855rem;
  font-weight: 500;
  color: #fff;
  min-width: 280px;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  animation: slideInToast 0.3s cubic-bezier(0.34,1.56,0.64,1);
  border: 1px solid rgba(255,255,255,0.15);
}
.toast.success { background: linear-gradient(135deg, #047857, #10B981); }
.toast.error   { background: linear-gradient(135deg, #B91C1C, #EF4444); }
.toast.info    { background: linear-gradient(135deg, #1D4ED8, #3B82F6); }
.toast.warning { background: linear-gradient(135deg, #B45309, #F59E0B); }

@keyframes slideInToast {
  from { opacity: 0; transform: translateX(60px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* ============================================================
   AVATAR
   ============================================================ */
.emp-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700;
  color: #fff; flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(124,58,237,0.25);
}
.emp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.emp-avatar.lg { width: 60px; height: 60px; font-size: 1.3rem; }
.emp-avatar.xl { width: 88px; height: 88px; font-size: 1.8rem; }

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.section-header h2 {
  font-size: 1.15rem;
  color: var(--text-primary);
  font-weight: 700;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 2.8rem; margin-bottom: 0.875rem; opacity: 0.35; }
.empty-state p { font-size: 0.875rem; }

/* ============================================================
   SPINNER
   ============================================================ */
.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid rgba(124,58,237,0.15);
  border-top-color: var(--violet);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   PAGE HEADER BANNER  (optional hero on overview)
   ============================================================ */
.page-banner {
  background: var(--grad-primary);
  border-radius: var(--radius-xl);
  padding: 1.75rem 2rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  box-shadow: 0 6px 30px rgba(124,58,237,0.3);
}
.page-banner::before {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 180px; height: 180px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.page-banner::after {
  content: '';
  position: absolute;
  right: 60px; bottom: -30px;
  width: 120px; height: 120px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}
.page-banner h2 { color: #fff; font-size: 1.2rem; margin-bottom: 0.25rem; }
.page-banner p  { color: rgba(255,255,255,0.75); font-size: 0.85rem; }
.page-banner .banner-icon {
  font-size: 2.5rem;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

/* ============================================================
   UTILITY
   ============================================================ */
.d-flex         { display: flex; }
.flex-col       { flex-direction: column; }
.align-center   { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm  { gap: 0.5rem; }
.gap-md  { gap: 1rem; }
.gap-lg  { gap: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.p-0  { padding: 0; }
.w-full { width: 100%; }
.rupee::before { content: '₹'; }

/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1.25rem 0;
}

/* ============================================================
   TOGGLE SWITCH
   ============================================================ */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #CBD5E1;
  border-radius: 99px;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--violet); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* btn-danger */
.btn-danger {
  background: var(--danger);
  color: #fff;
  border: none;
}
.btn-danger:hover { background: #DC2626; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); transition: transform var(--transition); }
  .sidebar.open { transform: translateX(0); --sidebar-w: 265px; }
  .main-content { margin-left: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-content { padding: 1rem; }
  .topbar { left: 0; padding: 0 1rem; }
}
