/* ============================================================
   SURYA TEJA FACILITIES MANAGEMENT PVT LTD
   Brand: Indigo #4f46e5 | Violet #7c3aed | Slate surfaces
   Redesigned: Modern, clean, professional
   ============================================================ */
:root {
  --font-family-base: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.75rem;
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.65;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px;

  /* Brand Colors — Indigo/Violet */
  --brand-navy: #4f46e5;
  --brand-navy-dark: #3730a3;
  --brand-navy-light: #6366f1;
  --brand-gold: #f59e0b;
  --brand-gold-dark: #d97706;
  --brand-gold-soft: #fef3c7;
  --brand-orange: #f97316;
  --brand-orange-soft: #fff7ed;
  --brand-violet: #7c3aed;
  --brand-violet-soft: #ede9fe;

  /* Sidebar */
  --sidebar-bg: #1e1b4b;
  --sidebar-bg-dark: #13104a;
  --sidebar-item-hover: rgba(99,102,241,0.18);
  --sidebar-item-active: rgba(99,102,241,0.28);
  --sidebar-text: rgba(255,255,255,0.85);
  --sidebar-text-muted: rgba(255,255,255,0.45);
  --sidebar-icon: #a5b4fc;
  --sidebar-border: rgba(255,255,255,0.07);
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 68px;
  --topbar-height: 64px;

  /* Surfaces */
  --app-bg: #f1f5f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  /* Status */
  --success: #059669;
  --success-soft: #d1fae5;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --info: #0284c7;
  --info-soft: #e0f2fe;

  /* Shadows & Radius */
  --shadow-card: 0 4px 24px rgba(15,23,42,0.08);
  --shadow-soft: 0 1px 8px rgba(15,23,42,0.05);
  --shadow-md: 0 8px 32px rgba(15,23,42,0.12);
  --focus-ring: 0 0 0 3px rgba(99,102,241,0.3);
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background: var(--app-bg);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ── LAYOUT ── */
.container { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
#sidebar-placeholder .sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #1e1b4b 0%, #13104a 60%, #0f0c3d 100%);
  border-right: 1px solid var(--sidebar-border);
  box-shadow: 4px 0 24px rgba(15,12,61,0.35);
  z-index: 100;
  overflow: hidden;
  transition: width 0.22s cubic-bezier(.4,0,.2,1);
}

#sidebar-placeholder .sidebar-header {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
}

#sidebar-placeholder .sidebar-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 8px;
}

#sidebar-placeholder .sidebar-brand {
  min-width: 0;
  overflow: hidden;
}

#sidebar-placeholder .sidebar-brand-name {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

#sidebar-placeholder .sidebar-brand-sub {
  display: block;
  font-size: 0.66rem;
  color: var(--sidebar-icon);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#sidebar-placeholder .sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
}

#sidebar-placeholder .sidebar-scroll::-webkit-scrollbar { width: 4px; }
#sidebar-placeholder .sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
}

#sidebar-placeholder .sidebar-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--sidebar-text-muted);
  padding: 12px 12px 4px;
}

#sidebar-placeholder .sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#sidebar-placeholder .menu-item,
#sidebar-placeholder .dropdown-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--sidebar-text);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  font-size: 0.875rem;
  font-weight: 500;
}

#sidebar-placeholder .menu-item:hover,
#sidebar-placeholder .dropdown-toggle:hover {
  background: var(--sidebar-item-hover);
  color: #ffffff;
}

#sidebar-placeholder .menu-item.active {
  background: var(--sidebar-item-active);
  color: #a5b4fc;
  font-weight: 600;
}

#sidebar-placeholder .menu-item.active .menu-icon { color: #a5b4fc; }

#sidebar-placeholder .menu-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  color: var(--sidebar-icon);
  opacity: 0.9;
}

#sidebar-placeholder .menu-icon svg { width: 16px; height: 16px; stroke: currentColor; }
#sidebar-placeholder .menu-text { min-width: 0; font-size: 0.875rem; }

#sidebar-placeholder .dropdown-toggle { justify-content: space-between; }

#sidebar-placeholder .dropdown-arrow {
  font-size: 0.8rem;
  color: var(--sidebar-text-muted);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

#sidebar-placeholder .dropdown-toggle.open .dropdown-arrow { transform: rotate(180deg); }

#sidebar-placeholder .dropdown-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.22s ease;
  padding-left: 30px;
}

#sidebar-placeholder .dropdown-list.open { max-height: 800px; }

#sidebar-placeholder .sub-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: rgba(255,255,255,0.65);
  text-align: left;
  cursor: pointer;
  font-size: 0.82rem;
  transition: background 0.15s ease, color 0.15s ease;
}

#sidebar-placeholder .sub-menu-item:hover { background: var(--sidebar-item-hover); color: #fff; }
#sidebar-placeholder .sub-menu-item.active { color: #a5b4fc; font-weight: 600; }

#sidebar-placeholder .sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

#sidebar-placeholder .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

#sidebar-placeholder .user-details { min-width: 0; overflow: hidden; flex: 1; }

#sidebar-placeholder .user-details strong {
  display: block;
  font-size: 0.82rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#sidebar-placeholder .user-details span {
  display: block;
  font-size: 0.7rem;
  color: var(--sidebar-text-muted);
}

#sidebar-placeholder .logout-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--sidebar-text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

#sidebar-placeholder .logout-btn:hover { background: rgba(239,68,68,0.2); color: #fca5a5; }
#sidebar-placeholder .logout-btn svg { width: 16px; height: 16px; stroke: currentColor; }

/* ── MAIN CONTENT ── */
.main {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 14px 20px 20px;
  transition: margin-left 0.22s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  height: 100vh;
}

.app-main { display: flex; flex-direction: column; height: calc(100vh - 28px); }

/* ── TOPBAR ── */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.topbar-page-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-navy);
}

.topbar-actions {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.topbar-search { position: relative; width: 260px; }

.topbar-search input {
  width: 100%;
  padding: 9px 12px 9px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--text-primary);
  outline: none;
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.topbar-search input:focus { border-color: var(--brand-navy); box-shadow: var(--focus-ring); }

.topbar-search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
}

.icon-button {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--brand-navy);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.icon-button:hover { background: var(--brand-violet-soft); border-color: var(--brand-navy); }
.icon-button svg { width: 17px; height: 17px; stroke: currentColor; }

.icon-badge {
  position: absolute;
  top: -4px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--brand-orange);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.user-chip .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
}

.user-chip-copy { display: flex; flex-direction: column; gap: 1px; }
.user-chip-copy strong { font-size: 0.88rem; font-weight: 700; color: var(--brand-navy); }
.user-chip-copy span { color: var(--text-muted); font-size: 0.75rem; }

/* ── PAGE BODY ── */
.page-body { flex: 1; min-height: 0; overflow: auto; padding: 2px; }
.page-body::-webkit-scrollbar { width: 6px; }
.page-body::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.18); border-radius: 999px; }

/* ── PAGE HEADER ── */
.page-header, .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.page-header h1, .page-header h2, .page-header h3,
.header h1, .header h2, .header h3, .header .title {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 700;
  color: var(--brand-navy);
}

.page-header p, .header p { margin: 0; color: var(--text-secondary); font-size: 0.84rem; }
.page-header .actions, .header .actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.header-unified.page-header,
.header-unified.header,
.header-unified.mc-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-unified.page-header p,
.header-unified.header p,
.header-unified.mc-page-header p {
  display: none;
}

.page-header-right,
.app-page-userbar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-left: auto;
}

.notify-btn,
.app-notify-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  box-shadow: var(--shadow-soft);
}

.notify-dot,
.app-notify-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 3px #fff;
}

.user-chip,
.app-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.avatar,
.app-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e0e7ff;
  color: var(--brand-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.user-copy strong,
.app-user-copy strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.92rem;
}

.user-copy span,
.app-user-copy span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.page-header-tools {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin: -6px 0 14px;
}

/* ── CARDS ── */
.card, .report-card, .filters-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 16px;
  margin-bottom: 16px;
}

/* ── FILTERS ── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.filters .search-box, .filters .search { flex: 1; min-width: 240px; max-width: 340px; }

.filters-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.search-box input, .filters input, .filters select,
.filters-grid input, .filters-grid select, .filter {
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  border-radius: var(--radius-md) !important;
  padding: 9px 12px !important;
  font-size: 0.875rem !important;
  color: var(--text-primary) !important;
  min-height: 40px !important;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box input { padding-left: 36px !important; }

.search-box input:focus, .filters input:focus, .filters select:focus, .filter:focus {
  border-color: var(--brand-navy) !important;
  box-shadow: var(--focus-ring) !important;
}

/* ── BUTTONS ── */
.btn, .button, .btn-add, .btn-view, .btn-approve, .btn-reject, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, background 0.15s ease;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.btn-primary, .btn-green, .btn.btn-primary, .btn-add, .btn-approve {
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-violet)) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 2px 8px rgba(79,70,229,0.25) !important;
}

.btn-primary:hover, .btn-green:hover, .btn.btn-primary:hover, .btn-add:hover {
  background: linear-gradient(135deg, var(--brand-navy-light), var(--brand-violet)) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79,70,229,0.3) !important;
}

.btn-gold {
  background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark)) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 2px 8px rgba(245,158,11,0.25) !important;
}

.btn-outline, .btn-view {
  background: var(--surface) !important;
  color: var(--brand-navy) !important;
  border-color: var(--border-strong) !important;
}

.btn-outline:hover, .btn-view:hover {
  background: var(--brand-violet-soft) !important;
  border-color: var(--brand-navy) !important;
}

.btn-reject {
  background: var(--danger) !important;
  color: #ffffff !important;
  border-color: var(--danger) !important;
  box-shadow: 0 2px 8px rgba(220,38,38,0.2) !important;
}

.btn:hover, .button:hover { transform: translateY(-1px); }

/* ── TABLE ── */
.table-container {
  overflow: auto;
  max-width: 100%;
  max-height: min(60vh, calc(100vh - 260px));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.table-container table, .card table, .report-card table {
  width: 100%;
  min-width: 800px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
}

.table-container th, .table-container td,
.card th, .card td, .report-card th, .report-card td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
  font-size: 0.82rem;
  vertical-align: middle;
  line-height: 1.3;
}

.table-container th, .card th, .report-card th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-violet));
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.table-container tbody tr:hover, .card tbody tr:hover, .report-card tbody tr:hover {
  background: #f5f3ff;
}

/* ── BADGES ── */
.badge, .status-pill, .role, .role-tag, .status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.badge.active, .badge.approved, .status-pill.active, .green { background: var(--success-soft); color: var(--success); }
.badge.inactive, .badge.rejected, .status-pill.inactive, .grey { background: #f1f5f9; color: #64748b; }
.badge.pending, .orange { background: var(--warning-soft); color: var(--warning); }
.role, .role-tag { background: var(--brand-violet-soft); color: var(--brand-violet); }

/* ── DASHBOARD ── */
.dashboard-page { display: flex; flex-direction: column; gap: 16px; }

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  min-height: 110px;
  border-bottom: 3px solid var(--brand-navy);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-card:nth-child(2n) { border-bottom-color: var(--brand-violet); }
.dashboard-card:nth-child(3n) { border-bottom-color: var(--brand-gold); }
.dashboard-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }

.dashboard-card-link { text-decoration: none; color: inherit; cursor: pointer; display: block; }

.dashboard-card-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
}

.dashboard-card-number {
  display: block;
  margin-bottom: 5px;
  font-size: 2rem;
  line-height: 1;
  font-weight: 800;
  color: var(--brand-navy);
  letter-spacing: -0.03em;
}

.dashboard-card-label {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
}

.dashboard-card-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--brand-violet-soft);
}

.dashboard-card-icon svg { width: 22px; height: 22px; stroke: var(--brand-violet); }

.dashboard-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.dashboard-table-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dashboard-table-header h2 { margin: 0; font-size: 1rem; font-weight: 700; color: var(--brand-navy); }

.dashboard-table .table-container { border: none; border-radius: 0; max-height: min(45vh, calc(100vh - 380px)); }

.dashboard-quick-links { padding: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

.dashboard-quick-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--brand-violet-soft);
  border: 1px solid rgba(124,58,237,0.15);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--brand-violet);
  font-weight: 600;
  font-size: 0.82rem;
  transition: background 0.15s ease, transform 0.15s ease;
}

.dashboard-quick-link:hover { background: rgba(124,58,237,0.15); transform: translateY(-1px); }

/* ── SWITCH ── */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; border-radius: 999px; background: #cbd5e1; transition: background 0.2s; }
.slider::before {
  content: "";
  position: absolute;
  left: 3px; top: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  transition: transform 0.18s ease;
}
input:checked + .slider { background: var(--brand-navy); }
input:checked + .slider::before { transform: translateX(18px); }

/* ── PAGINATION ── */
.pagination, .page-nav, .table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 8px 2px 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.pages, .page-nav-pages { display: flex; align-items: center; gap: 6px; }

.active-page {
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-violet));
  color: #ffffff;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
}

/* ── FORM ELEMENTS ── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 0.84rem; font-weight: 600; color: var(--text-primary); }
.form-group input, .form-group select, .form-group textarea {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--brand-navy);
  box-shadow: var(--focus-ring);
}

/* ── RESPONSIVE ── */
@media (max-width: 1200px) {
  .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 68px; }
  #sidebar-placeholder .sidebar-brand,
  #sidebar-placeholder .menu-text,
  #sidebar-placeholder .dropdown-arrow,
  #sidebar-placeholder .dropdown-list,
  #sidebar-placeholder .user-details { display: none; }
  #sidebar-placeholder .sidebar-header { justify-content: center; }
  #sidebar-placeholder .menu-item,
  #sidebar-placeholder .dropdown-toggle { justify-content: center; padding: 10px; }
  #sidebar-placeholder .sidebar-footer { justify-content: center; }
}

@media (max-width: 720px) {
  .dashboard-stats { grid-template-columns: 1fr; }
  .topbar-search { width: 100%; }
}

/* ── INLINE STYLE OVERRIDES (legacy page-header cleanup) ── */
/* Overrides old green-tinted inline page-header styles on inner pages */
.main .page-header,
.main .header {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-soft) !important;
}

/* Net wages field — updated to indigo theme */
.net-field {
  background: var(--brand-violet-soft) !important;
  border: 1px solid #c4b5fd !important;
  border-radius: 12px;
  padding: 16px;
}

.net-field label { color: var(--brand-violet) !important; font-weight: 600; }
.net-field input { border-color: #c4b5fd !important; font-weight: 700; color: var(--brand-violet) !important; font-size: 1.1rem; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 28px;
  max-width: 520px;
  width: 90%;
  border: 1px solid var(--border);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h2 { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }

.modal-close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  transition: background 0.15s, color 0.15s;
}

.modal-close:hover { background: var(--danger-soft); color: var(--danger); }

/* ── DROPZONE ── */
.import-dropzone {
  border: 2px dashed var(--border-strong) !important;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface-soft) !important;
}

.import-dropzone:hover,
.import-dropzone.dragover {
  border-color: var(--brand-navy) !important;
  background: var(--brand-violet-soft) !important;
}

/* ── SECTION TITLES IN FORMS ── */
.section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-navy);
  padding: 10px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ── BACK BUTTON ── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  border-radius: var(--radius-md) !important;
  padding: 8px 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  color: var(--text-primary) !important;
  font-size: 0.875rem;
  transition: background 0.15s, border-color 0.15s;
}

.back-btn:hover {
  background: var(--brand-violet-soft) !important;
  border-color: var(--brand-navy) !important;
  color: var(--brand-navy) !important;
}

/* ============================================================
   MASTER CONFIGURATION — Shared styles
   ============================================================ */
.mc-page { display: flex; flex-direction: column; gap: 16px; }
.mc-page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.mc-page-header h1 { margin: 0; font-size: 1.4rem; font-weight: 800; color: var(--brand-navy); }
.mc-page-header p { margin: 4px 0 0; color: var(--text-secondary); font-size: 0.84rem; }
.mc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); overflow: hidden; }

/* Toolbar */
.mc-toolbar { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--surface-soft); }
.mc-toolbar-search-row { display: flex; width: 100%; }
.mc-toolbar-controls-row { display: flex; flex-wrap: nowrap; gap: 10px; align-items: center; width: 100%; }
.mc-search-wrap { position: relative; width: 100%; min-width: 220px; max-width: 320px; }
.mc-search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; stroke: var(--text-muted); }
.mc-search-wrap input { width: 100%; padding: 9px 12px 9px 34px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); font-size: 0.875rem; outline: none; }
.mc-search-wrap input:focus { border-color: var(--brand-navy); box-shadow: var(--focus-ring); }
.mc-toolbar select { padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); font-size: 0.875rem; outline: none; min-height: 38px; color: var(--text-primary); min-width: 160px; }
.mc-toolbar select:focus { border-color: var(--brand-navy); box-shadow: var(--focus-ring); }
.mc-toolbar-controls-row .btn { white-space: nowrap; }

@media (max-width: 1100px) {
  .mc-toolbar-controls-row { flex-wrap: wrap; }
}

/* Table */
.mc-table-wrap { overflow-x: auto; width: 100%; }
.mc-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: auto; }
.mc-table th {
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-violet));
  color: #fff; font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 9px 10px; text-align: left;
  white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.mc-table td {
  padding: 7px 10px; border-bottom: 1px solid var(--border);
  font-size: 0.8rem; color: var(--text-primary);
  white-space: nowrap; vertical-align: middle; line-height: 1.3;
}
.mc-table tbody tr:hover { background: #f5f3ff; }

/* Badges */
.mc-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 0.68rem; font-weight: 700; white-space: nowrap; }
.badge-active { background: var(--success-soft); color: var(--success); }
.badge-inactive { background: #f1f5f9; color: #64748b; }
.badge-yes { background: var(--info-soft); color: var(--info); }
.badge-no { background: #f1f5f9; color: #64748b; }

/* Actions — always single row, never wrap */
.mc-actions {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  align-items: center;
  white-space: nowrap;
}
.mc-table td.mc-actions { padding: 5px 8px; }
.mc-btn-action {
  padding: 3px 8px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 0.72rem; font-weight: 600; cursor: pointer; transition: all 0.15s;
  white-space: nowrap; flex-shrink: 0; line-height: 1.6;
}
.mc-btn-edit { background: var(--brand-violet-soft); color: var(--brand-violet); border-color: rgba(124,58,237,0.2); }
.mc-btn-edit:hover { background: rgba(124,58,237,0.15); }
.mc-btn-deactivate { background: var(--danger-soft); color: var(--danger); border-color: rgba(220,38,38,0.2); }
.mc-btn-deactivate:hover { background: rgba(220,38,38,0.12); }
.mc-btn-activate { background: var(--success-soft); color: var(--success); border-color: rgba(5,150,105,0.2); }
.mc-btn-activate:hover { background: rgba(5,150,105,0.12); }
.mc-btn-view { background: var(--info-soft); color: var(--info); border-color: rgba(2,132,199,0.2); }
.mc-btn-view:hover { background: rgba(2,132,199,0.12); }

/* Empty state */
.mc-empty { padding: 48px 20px; text-align: center; color: var(--text-muted); }
.mc-empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.mc-empty p { font-size: 0.9rem; }

/* Pagination */
.mc-pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 0.82rem; color: var(--text-secondary); flex-wrap: wrap; }
.mc-pag-pages { display: flex; gap: 4px; }
.mc-pag-btn { padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 0.8rem; cursor: pointer; transition: all 0.15s; }
.mc-pag-btn:hover { background: var(--brand-violet-soft); border-color: var(--brand-navy); }
.mc-pag-btn.active { background: linear-gradient(135deg, var(--brand-navy), var(--brand-violet)); color: #fff; border-color: transparent; }

/* Modal */
.mc-modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 300; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); padding: 16px; }
.mc-modal { background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); width: 100%; max-width: 760px; max-height: 90vh; display: flex; flex-direction: column; border: 1px solid var(--border); }
.mc-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.mc-modal-header h2 { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--brand-navy); }
.mc-modal-close { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--text-muted); cursor: pointer; font-size: 1.3rem; line-height: 1; transition: background 0.15s, color 0.15s; }
.mc-modal-close:hover { background: var(--danger-soft); color: var(--danger); }
.mc-modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.mc-modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--border); flex-shrink: 0; }

/* Form inside modal */
.mc-form-section { margin-bottom: 20px; }
.mc-form-section-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand-navy); margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.mc-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.mc-form-group { display: flex; flex-direction: column; gap: 5px; }
.mc-form-group label { font-size: 0.84rem; font-weight: 600; color: var(--text-primary); }
.mc-form-group input, .mc-form-group select, .mc-form-group textarea { padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); font-size: 0.875rem; color: var(--text-primary); outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.mc-form-group input:focus, .mc-form-group select:focus, .mc-form-group textarea:focus { border-color: var(--brand-navy); box-shadow: var(--focus-ring); }
.mc-req { color: var(--danger); }
.mc-checkbox { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; cursor: pointer; padding: 9px 0; }
.mc-checkbox input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand-navy); cursor: pointer; }

@media (max-width: 600px) {
  .mc-form-grid { grid-template-columns: 1fr; }
  .mc-modal { max-width: 100%; }
}

/* ============================================================
   SYSTEM SETTINGS — Shared styles
   ============================================================ */
.ss-page { display: flex; flex-direction: column; gap: 0; }

/* Tabs */
.ss-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 14px 16px 0; background: var(--surface-soft); border-bottom: 2px solid var(--border); }
.ss-tab { padding: 8px 16px; border: none; border-radius: var(--radius-md) var(--radius-md) 0 0; background: transparent; color: var(--text-secondary); font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.15s; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.ss-tab:hover { background: var(--brand-violet-soft); color: var(--brand-navy); }
.ss-tab.active { background: var(--surface); color: var(--brand-navy); border-bottom: 2px solid var(--brand-navy); }

/* Panels */
.ss-panel { display: none; padding: 20px; }
.ss-panel.active { display: block; }
.ss-section-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand-navy); margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

/* Fields grid */
.ss-fields-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.ss-field-group { display: flex; flex-direction: column; gap: 5px; }
.ss-label { font-size: 0.84rem; font-weight: 600; color: var(--text-primary); }
.ss-req { color: var(--danger); }
.ss-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* Inputs */
.ss-input { padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); font-size: 0.875rem; color: var(--text-primary); outline: none; transition: border-color 0.15s, box-shadow 0.15s; width: 100%; }
.ss-input:not(:disabled):focus { border-color: var(--brand-navy); box-shadow: var(--focus-ring); }
.ss-input:disabled { background: var(--surface-soft); color: var(--text-secondary); cursor: default; }
textarea.ss-input { resize: vertical; min-height: 80px; }

/* Toggle */
.ss-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 0; }
.ss-toggle input[type="checkbox"] { display: none; }
.ss-toggle-slider { position: relative; width: 42px; height: 24px; border-radius: 999px; background: #cbd5e1; transition: background 0.2s; flex-shrink: 0; }
.ss-toggle-slider::before { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.18); transition: transform 0.18s ease; }
.ss-toggle input:checked ~ .ss-toggle-slider { background: var(--brand-navy); }
.ss-toggle input:checked ~ .ss-toggle-slider::before { transform: translateX(18px); }
.ss-toggle input:disabled ~ .ss-toggle-slider { opacity: 0.6; cursor: default; }
.ss-toggle-label { font-size: 0.82rem; color: var(--text-secondary); }

/* File input */
.ss-file-wrap { display: flex; align-items: center; gap: 10px; }
.ss-file-input { flex: 1; }
.ss-file-name { font-size: 0.78rem; color: var(--text-muted); }

/* Action bar */
.ss-action-bar { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-soft); }

/* Page wrapper */
.ss-page-wrap { display: flex; flex-direction: column; gap: 16px; }
.ss-page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.ss-page-header h1 { margin: 0; font-size: 1.4rem; font-weight: 800; color: var(--brand-navy); }
.ss-page-header p { margin: 4px 0 0; color: var(--text-secondary); font-size: 0.84rem; }
.ss-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); overflow: hidden; }

/* Financial Year list table inside settings */
.ss-fy-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.ss-fy-table th { background: linear-gradient(135deg, var(--brand-navy), var(--brand-violet)); color: #fff; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 9px 12px; white-space: nowrap; }
.ss-fy-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 0.82rem; white-space: nowrap; vertical-align: middle; }
.ss-fy-table tbody tr:hover { background: #f5f3ff; }

@media (max-width: 700px) {
  .ss-fields-grid { grid-template-columns: 1fr; }
  .ss-tabs { gap: 2px; }
  .ss-tab { padding: 7px 10px; font-size: 0.75rem; }
}

/* ============================================================
   GLOBAL CARD CLEANUP
   ============================================================ */
.dashboard-card-note,
.dashboard-card-icon,
.metric-card .eyebrow,
.metric-card p,
.metric-card small,
.summary-card p,
.stat-card p,
.kpi-card p {
  display: none !important;
}
