:root {
  /* LIGHT THEME TOKENS */
  --bg-app: #F8FAFC;              /* Canvas background */
  --bg-surface: #FFFFFF;          /* Primary cards / containers */
  --bg-subtle: #F1F5F9;           /* Nested cards / badge backgrounds */
  --bg-input: #FFFFFF;            /* Text inputs & selects */
  --border-subtle: #E2E8F0;       /* Hairline dividers / card borders */
  
  --text-primary: #0F172A;        /* Headings, titles, high-contrast text */
  --text-secondary: #475569;      /* Descriptions, subtext, card labels */
  --text-muted: #94A3B8;          /* Timestamps, disabled text */
  
  --status-green-bg: #ECFDF5;
  --status-green-text: #047857;
  --status-amber-bg: #FEF3C7;
  --status-amber-text: #B45309;
  --status-red-bg: #FEF2F2;
  --status-red-text: #B91C1C;

  /* Legacy Aliases */
  --bg-page: var(--bg-app);
  --bg-card: var(--bg-surface);
  --bg-card-nested: var(--bg-subtle);
  --border: var(--border-subtle);
  --text-main: var(--text-primary);
  --text-sub: var(--text-secondary);
  --table-th: var(--bg-subtle);
  --table-border: var(--border-subtle);
  --accent: #a20943;
  --ink: var(--text-primary);
  --muted: var(--text-secondary);
  --line: var(--border-subtle);
  --bg: var(--bg-app);
}

html[data-theme="dark"],
.dark {
  /* DARK THEME TOKENS */
  --bg-app: #04060C;              /* Deep dark background canvas */
  --bg-surface: #1F1F1F;          /* Elevated card surfaces */
  --bg-subtle: #3C3C3E;           /* Nested cards & table headers */
  --bg-input: #262627;            /* Dark inputs & selects */
  --border-subtle: #2E2E30;       /* Dark hairline border */
  
  --text-primary: #FFFFFF;        /* Pure readable high-contrast white text */
  --text-secondary: #A1A1AA;      /* Muted light-gray subtext */
  --text-muted: #71717A;          /* Subtle tertiary indicators */
  
  --status-green-bg: rgba(16, 185, 129, 0.15);
  --status-green-text: #34D399;
  --status-amber-bg: rgba(245, 158, 11, 0.15);
  --status-amber-text: #FBBF24;
  --status-red-bg: rgba(239, 68, 68, 0.15);
  --status-red-text: #F87171;

  /* Legacy Aliases */
  --bg-page: var(--bg-app);
  --bg-card: var(--bg-surface);
  --bg-card-nested: var(--bg-subtle);
  --border: var(--border-subtle);
  --text-main: var(--text-primary);
  --text-sub: var(--text-secondary);
  --table-th: var(--bg-surface);
  --table-td: #161618;
  --table-border: var(--border-subtle);
  --accent: #a20943;
  --ink: var(--text-primary);
  --muted: var(--text-secondary);
  --line: var(--border-subtle);
  --bg: var(--bg-app);
}

/* Global Reset on Typography & Body */
html, body {
  margin: 0;
  overflow-x: clip;
  background-color: var(--bg-app) !important;
  color: var(--text-primary) !important;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4, h5, h6, strong, b {
  color: var(--text-primary) !important;
}

p, span, label, small {
  color: var(--text-secondary);
}

/* Standardized Reusable UI Classes */

/* Main Card Wrapper */
.app-card,
.theme-card,
.content-card,
.stat-card,
.coverage-matrix-card,
.leaveRosterTableContainer,
.custom-modal-box,
.attention-section-card,
.settings-form-section,
.reports-header-card,
.employee-drawer,
.custom-calendar-popup {
  background-color: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
  border-radius: 16px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

/* Nested Mini Cards & Interactive Cards */
.app-card-nested,
.theme-card-nested,
.clickable-kpi-card,
.leave-item-row,
.attn-card,
.activity-feed-row,
.mode-card,
.settings-card {
  background-color: var(--bg-subtle) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
  border-radius: 12px !important;
}

.app-card-nested .card-title,
.theme-card-nested .card-title {
  color: var(--text-primary) !important;
  font-weight: 600;
}

.app-card-nested .card-meta,
.theme-card-nested .card-meta {
  color: var(--text-secondary) !important;
}

/* Form Controls & Dropdowns */
.app-input,
.theme-input,
input, select, textarea,
.filter-select,
.search-box input {
  background-color: var(--bg-input) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-subtle) !important;
}

.theme-table th,
.attendance-table th,
.matrix-table th {
  background-color: var(--table-th) !important;
  color: var(--text-main) !important;
  border-bottom: 1px solid var(--table-border) !important;
}

.theme-table td,
.attendance-table td,
.matrix-table td {
  background-color: var(--table-td, var(--bg-card)) !important;
  color: var(--text-main) !important;
  border-bottom: 1px solid var(--table-border) !important;
}

.layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: clip;
}

/* Sidebar Navigation */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 99999 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 64px;
  height: 100vh;
  padding: 12px 6px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-subtle);
  box-shadow: 1px 0 3px rgba(0, 0, 0, 0.03);
  overflow: visible !important;
}

.logo {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  place-items: center;
  flex-shrink: 0;
}

.logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* Sidebar Role / Portal Toggle Switch */
.sidebar-role-toggle-wrapper {
  width: 52px;
  height: 26px;
  margin: 0 auto 12px auto;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.sidebar-role-toggle {
  width: 100%;
  height: 100%;
  border-radius: 99px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 2px;
  box-sizing: border-box;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-role-toggle:hover {
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(162, 9, 67, 0.25);
  transform: scale(1.05);
}

.sidebar-role-toggle .role-toggle-knob {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.sidebar-role-toggle .role-toggle-label {
  font-size: 8.5px;
  font-weight: 800;
  font-family: Inter, sans-serif;
  letter-spacing: 0.04em;
  line-height: 1;
  flex: 1;
  text-align: center;
}

/* Admin Active State */
.sidebar-role-toggle.admin-active {
  background: rgba(162, 9, 67, 0.12);
  border-color: rgba(162, 9, 67, 0.4);
}
.sidebar-role-toggle.admin-active .role-toggle-knob {
  background: var(--accent);
  color: #ffffff;
}
.sidebar-role-toggle.admin-active .role-toggle-label {
  color: var(--accent);
  padding-left: 2px;
}

/* Employee Active State */
.sidebar-role-toggle.emp-active {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.4);
}
.sidebar-role-toggle.emp-active .role-toggle-knob {
  background: #3b82f6;
  color: #ffffff;
}
.sidebar-role-toggle.emp-active .role-toggle-label {
  color: #3b82f6;
  padding-right: 2px;
}

.nav-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow: visible !important;
}

.footer-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
  overflow: visible !important;
}

.nav-item {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: #64748b;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-item img, .nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-item:hover {
  background: #f1f5f9;
  color: var(--accent);
}

.nav-item.active {
  background: var(--accent) !important;
  color: #ffffff !important;
  border-radius: 14px;
}

.nav-item.active img {
  filter: brightness(0) invert(1);
}

.nav-item.active svg {
  stroke: #ffffff;
}

/* Tooltip Hover for Items WITHOUT Submenu */
.nav-item[data-tooltip]::after {
  position: absolute;
  left: 62px;
  top: 50%;
  transform: translateY(-50%) scale(0.92);
  transform-origin: left center;
  z-index: 999999 !important;
  content: attr(data-tooltip);
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border-subtle) !important;
  opacity: 0;
  visibility: hidden;
  will-change: opacity, transform;
  transition: opacity 0.15s ease-in, transform 0.15s ease-in, visibility 0.15s ease-in;
  pointer-events: none;
}

.nav-item[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) scale(1);
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-group {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  overflow: visible !important;
}

.menu-button {
  background: transparent;
  border: none;
  cursor: pointer;
}

/* Submenu Panel Flyout - Elevated in front of all page cards */
.submenu-panel {
  position: absolute;
  top: -4px;
  left: 56px;
  z-index: 999999 !important;
  width: 220px;
  overflow: visible !important;
  padding: 12px 14px;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4) !important;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px) scale(0.96);
  transform-origin: left top;
  will-change: opacity, transform;
  transition: opacity 0.15s ease-in, transform 0.15s ease-in, visibility 0.15s ease-in;
  pointer-events: none;
}

/* For footer / settings popup: anchor from bottom up */
.footer-box .submenu-panel {
  top: auto !important;
  bottom: 0 !important;
  transform-origin: left bottom !important;
}

/* Invisible Mouse Bridge */
.submenu-panel::before {
  content: '';
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: -24px;
  width: 28px;
  background: transparent;
}

.nav-group:hover > .submenu-panel,
.nav-group.open > .submenu-panel {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(0) scale(1) !important;
  pointer-events: auto !important;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.submenu-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-primary) !important;
  margin: 0 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.submenu-section {
  margin-bottom: 8px;
}

.submenu-section:last-child {
  margin-bottom: 0;
}

.submenu-section-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-secondary) !important;
  text-transform: uppercase;
  margin-bottom: 3px;
  padding-left: 4px;
}

.submenu-link {
  display: block;
  padding: 5px 8px;
  color: var(--text-primary) !important;
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.submenu-link:hover {
  background: var(--bg-subtle) !important;
  color: var(--accent) !important;
}

/* Submenu Theme Toggle Button */
.submenu-theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: 4px;
}

.submenu-theme-toggle-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-icon-indicator {
  font-size: 13px;
}

.theme-mode-switch-pill {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  background: #cbd5e1;
  color: #475569;
  transition: all 0.2s ease;
}

.theme-mode-switch-pill.active {
  background: #831843;
  color: #ffffff;
}

html[data-theme="dark"] .theme-mode-switch-pill,
.dark .theme-mode-switch-pill {
  background: #334155;
  color: #94a3b8;
}

html[data-theme="dark"] .theme-mode-switch-pill.active,
.dark .theme-mode-switch-pill.active {
  background: #831843;
  color: #ffffff;
}

main {
  flex: 1;
  min-width: 0;
  max-width: calc(100vw - 64px);
  margin-left: 64px;
  padding: 0 24px 24px 24px;
  box-sizing: border-box;
  overflow-x: clip;
}

.mobile-toggle, .overlay {
  display: none;
}

/* View Section & Subtabs */
.view-section {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.subtab-content {
  display: none;
  width: 100%;
  box-sizing: border-box;
}

.subtab-content.active {
  display: block !important;
}

/* =========================================================================
   PRINCIPAL TOP-MOST GLOBAL HEADER BAR (Always Sticky on Scroll)
   ========================================================================= */
.main-top-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px 24px;
  margin-left: -24px;
  margin-right: -24px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 10000;
  background-color: var(--bg-app) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.main-top-navbar.is-scrolled {
  padding: 8px 24px;
  background-color: var(--bg-surface) !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.top-page-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.top-page-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  transition: font-size 0.2s ease;
}

.main-top-navbar.is-scrolled .top-page-title {
  font-size: 16px;
  font-weight: 800;
}

.top-page-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.3;
  max-height: 24px;
  opacity: 1;
  margin-top: 2px;
  transition: all 0.2s ease;
  overflow: hidden;
  display: block;
}

.main-top-navbar.is-scrolled .top-page-subtitle {
  display: none !important;
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  pointer-events: none;
}

.top-header-right-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* 1. Chat Button with Green Dot */
.topbar-chat-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #831843;
  border: 1px solid #831843;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  box-shadow: 0 2px 6px rgba(131, 24, 67, 0.25);
  transition: all 0.15s ease;
}

.topbar-chat-btn:hover {
  background: #9f1239;
  border-color: #9f1239;
  transform: translateY(-1px);
}

.topbar-online-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border: 1.5px solid #ffffff;
  border-radius: 50%;
  position: absolute;
  top: -2px;
  right: -2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
}

/* 2. Bell Button */
.topbar-bell-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
}

.topbar-bell-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* 3. Developer Mode Pill Switch */
.topbar-dev-mode-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 4px 12px 4px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
}

.topbar-dev-mode-pill:hover {
  border-color: #cbd5e1;
  background: var(--bg-subtle);
}

.dev-mode-switch {
  width: 32px;
  height: 18px;
  background: #cbd5e1;
  border-radius: 99px;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.dev-mode-switch.active {
  background: #831843;
}

.dev-mode-knob {
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.dev-mode-switch.active .dev-mode-knob {
  left: 16px;
}

.dev-mode-text-group {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.dev-mode-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.dev-mode-status {
  font-size: 9.5px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.15s ease;
}

.dev-mode-switch.active + .dev-mode-text-group .dev-mode-status {
  color: #831843;
  font-weight: 700;
}

/* 4. Help / Question Button */
.topbar-help-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #059669;
  border: 2.5px solid #831843;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.15s ease;
}

.topbar-help-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* Dark Mode Adjustments */
html[data-theme="dark"] .main-top-navbar,
.dark .main-top-navbar {
  background-color: var(--bg-app) !important;
  border-bottom-color: var(--border-subtle) !important;
}

html[data-theme="dark"] .main-top-navbar.is-scrolled,
.dark .main-top-navbar.is-scrolled {
  background-color: var(--bg-surface) !important;
  border-bottom-color: var(--border-subtle) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

html[data-theme="dark"] .topbar-chat-btn,
.dark .topbar-chat-btn {
  background: #831843;
  border-color: #831843;
}

html[data-theme="dark"] .topbar-bell-btn,
.dark .topbar-bell-btn {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: #f1f5f9;
}

html[data-theme="dark"] .topbar-dev-mode-pill,
.dark .topbar-dev-mode-pill {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
}

html[data-theme="dark"] .dev-mode-switch,
.dark .dev-mode-switch {
  background: #334155;
}

html[data-theme="dark"] .dev-mode-switch.active,
.dark .dev-mode-switch.active {
  background: #831843;
}

/* Subtab Section Header */
.subtab-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border-subtle);
}

.subtab-section-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

/* Top Subnav Header Row */
.subnav-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.subnav-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

/* Circular Topbar Back Button */
.topbar-back-btn,
.subnav-back-btn {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  border-radius: 50% !important;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0 !important;
  flex-shrink: 0;
  box-sizing: border-box;
}

.topbar-back-btn:hover,
.subnav-back-btn:hover {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #ffffff !important;
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(162, 9, 67, 0.28);
}

.topbar-back-btn:hover svg,
.subnav-back-btn:hover svg {
  stroke: #ffffff !important;
}

.topbar-back-btn:active,
.subnav-back-btn:active {
  transform: scale(0.95);
}

.subnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary) !important;
  font-family: Inter, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.subnav-btn:not(.active):hover {
  color: var(--text-primary) !important;
  background: var(--bg-subtle) !important;
}

.subnav-btn.active,
.subnav-btn.active:hover,
.subnav-btn.active:focus {
  background: var(--accent) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(162, 9, 67, 0.28) !important;
}

.subnav-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-top-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: Inter, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-top-action:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-notif-bell-inline {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.btn-notif-bell-inline:hover {
  background: var(--bg-subtle);
  border-color: var(--border-subtle);
}

.notif-badge-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 7px; height: 7px;
  background: #ef4444;
  border: 1.5px solid #fff;
  border-radius: 50%;
}

.top-user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: pointer;
}

.top-user-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Page Header */
.overview-top-header {
  margin-bottom: 24px;
}

.overview-title-group h1 {
  font-size: 26px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.03em;
}

.overview-title-group p {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0 0;
}

/* Stat Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.overview-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 12px !important;
  width: 100% !important;
  margin-bottom: 16px !important;
  box-sizing: border-box !important;
}

@media (max-width: 1100px) {
  .overview-kpi-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 640px) {
  .overview-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

.stat-card {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.stat-card-compact {
  padding: 12px 16px !important;
  border-radius: 12px !important;
  min-height: 64px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
}

.stat-card-compact .stat-title {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: var(--text-secondary) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  margin-bottom: 2px !important;
  line-height: 1.2 !important;
}

.stat-card-compact .stat-value {
  font-size: 22px !important;
  font-weight: 800 !important;
  margin: 2px 0 3px 0 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.02em !important;
}

.stat-card-compact .stat-subtitle {
  font-size: 11px !important;
  line-height: 1.2 !important;
  color: var(--text-secondary) !important;
}

.stat-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary) !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  margin: 4px 0;
  color: var(--text-primary) !important;
  letter-spacing: -0.02em;
}

.stat-subtitle {
  font-size: 11.5px;
  color: var(--text-secondary) !important;
}

/* Soft Modern Badges & Status Pills */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
}

.badge-success { background: #ecfdf5 !important; color: #047857 !important; border: 1px solid #a7f3d0 !important; }
.badge-danger { background: #fef2f2 !important; color: #b91c1c !important; border: 1px solid #fecaca !important; }
.badge-warning { background: #fef3c7 !important; color: #b45309 !important; border: 1px solid #fde68a !important; }
.badge-info { background: #eff6ff !important; color: #1d4ed8 !important; border: 1px solid #bfdbfe !important; }
.badge-purple { background: #f3e8ff !important; color: #6d28d9 !important; border: 1px solid #ddd6fe !important; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid transparent;
}

.pill-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-present { background: #ecfdf5 !important; color: #047857 !important; border-color: #a7f3d0 !important; }
.status-late { background: #fef3c7 !important; color: #b45309 !important; border-color: #fde68a !important; }
.status-leave { background: #eff6ff !important; color: #1d4ed8 !important; border-color: #bfdbfe !important; }
.status-absent { background: #fef2f2 !important; color: #b91c1c !important; border-color: #fecaca !important; }

.mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}

.mode-office { background: #ecfdf5 !important; color: #047857 !important; border-color: #a7f3d0 !important; }
.mode-remote { background: #eff6ff !important; color: #1d4ed8 !important; border-color: #bfdbfe !important; }

/* Content Cards & Tables */
.content-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
}

.card-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin: 3px 0 0 0;
}

.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.attendance-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.attendance-table th {
  padding: 12px 14px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
}

.attendance-table td {
  padding: 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.attendance-table tr:last-child td {
  border-bottom: none;
}

.attendance-table tr:hover td {
  background: var(--bg-subtle) !important;
  cursor: pointer;
}

.emp-profile-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.avatar-eng { background: #3b82f6; }
.avatar-sales { background: #10b981; }
.avatar-mkt { background: #8b5cf6; }
.avatar-hr { background: #f59e0b; }

.emp-name { display: block; font-weight: 700; color: var(--ink); }
.emp-role { display: block; font-size: 11px; color: var(--muted); }

.btn-edit-attendance {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: Inter, sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-edit-attendance svg {
  flex-shrink: 0;
}

.btn-edit-attendance:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Attention Cards - Inspired by Soft Widget Layouts */
.attention-section-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid #f59e0b;
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 24px;
}

.attention-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.attention-title {
  font-size: 15px;
  font-weight: 800;
  color: #b45309;
  display: flex;
  align-items: center;
  gap: 8px;
}

.attention-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 1280px) {
  .attention-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .attention-grid-4 {
    grid-template-columns: 1fr;
  }
}

.attn-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.attn-card-header {
  margin-bottom: 12px;
}

/* Floating Soft Pill Badges */
.attn-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}

.badge-pending {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fef08a;
}

.badge-high-priority {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.badge-discrepancy {
  background: #fff7ed;
  color: #c2410c;
  border-color: #ffedd5;
}

.badge-policy {
  background: #fefce8;
  color: #a16207;
  border-color: #fef08a;
}

.attn-card-body {
  flex: 1;
  margin-bottom: 14px;
}

.attn-card-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px 0;
  line-height: 1.35;
}

.attn-card-subtext {
  font-size: 11.5px;
  color: #64748b;
  margin: 0 0 12px 0;
  line-height: 1.45;
}

/* Overlapping Avatar Stack with Photos */
.attn-avatar-stack {
  display: flex;
  align-items: center;
}

.attn-avatar-stack img, .attn-avatar-stack .avatar-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: -8px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.avatar-img-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-more {
  background: #64748b !important;
  color: #ffffff !important;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 10px;
}

.filter-select {
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: Inter, sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.filter-select:hover, .filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(162, 9, 67, 0.08);
}

/* Settings Sub-Page Form Controls & High-End Layout */
.settings-form-layout {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.settings-form-section {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}

.form-section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section-desc {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 18px;
  line-height: 1.4;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

.form-grid-2 > * {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  position: relative;
}

.form-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control,
input.form-control,
textarea.form-control,
.has-custom-clock,
.has-custom-cal {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  padding: 10px 14px !important;
  height: 42px !important;
  background-color: var(--bg-input) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 10px !important;
  font-family: Inter, sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  outline: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
  display: block !important;
}

/* Universal Custom-Styled Select Dropdowns (No Browser Defaults Allowed) */
select,
select.form-control,
.filter-select,
.scope-select {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  padding: 0 36px 0 14px !important;
  height: 40px !important;
  background-color: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 10px !important;
  font-family: Inter, sans-serif !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  cursor: pointer !important;
  outline: none !important;
  display: block !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;

  /* Embedded Custom SVG Chevron Arrow (Slate in light mode) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 14px 14px !important;
}

textarea.form-control {
  height: auto !important;
  min-height: 80px !important;
}

.form-control:focus, 
.form-control:hover,
select:focus,
select:hover,
select.form-control:focus,
select.form-control:hover,
.has-custom-clock:hover,
.has-custom-cal:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(162, 9, 67, 0.12) !important;
}

/* Dark Mode Overrides for Universal Select Dropdowns */
html[data-theme="dark"] select,
html[data-theme="dark"] select.form-control,
html[data-theme="dark"] .filter-select,
html[data-theme="dark"] .scope-select,
.dark select,
.dark select.form-control,
.dark .filter-select,
.dark .scope-select {
  background-color: #202024 !important;
  color: #FFFFFF !important;
  border: 1px solid #27272A !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A1A1AA' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

select option {
  background-color: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  padding: 10px 14px !important;
  font-weight: 600 !important;
}

html[data-theme="dark"] select option,
.dark select option {
  background-color: #18181B !important;
  color: #FFFFFF !important;
}

.days-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.day-toggle-pill {
  padding: 8px 16px;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 10px;
  font-family: Inter, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary) !important;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.day-toggle-pill.active {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] .day-toggle-pill.active,
.dark .day-toggle-pill.active {
  background: #a20943 !important;
  border-color: #a20943 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .day-toggle-pill:not(.active),
.dark .day-toggle-pill:not(.active) {
  background: #1F1F1F !important;
  border-color: #2E2E30 !important;
  color: #A1A1AA !important;
}

.form-actions-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

/* Action Buttons */
.attn-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
}

.btn-attn-primary {
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-dark-primary {
  padding: 7px 14px;
  background: #0f172a !important;
  color: #ffffff !important;
  border: 1px solid #0f172a !important;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-dark-primary:hover {
  background: #1e293b !important;
  border-color: #1e293b !important;
  color: #ffffff !important;
}

.btn-attn-primary:hover {
  background: var(--accent);
  color: #ffffff;
}

.btn-attn-primary.btn-red {
  border-color: #ef4444;
  color: #dc2626;
}

.btn-attn-primary.btn-red:hover {
  background: #ef4444;
  color: #ffffff;
}

.btn-attn-secondary {
  padding: 6px 14px;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Principal UX Redesign: Segmented Radio Cards & Approval Flow Components */
.mode-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .mode-cards-grid {
    grid-template-columns: 1fr;
  }
}

.mode-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.15s ease;
}

.mode-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.mode-card.active {
  border-color: #6366f1;
  background: #f5f3ff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.mode-card-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: grid;
  place-items: center;
  margin-top: 2px;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.mode-card.active .mode-card-radio {
  border-color: #6366f1;
  background: #ffffff;
}

.radio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6366f1;
  display: none;
}

.mode-card.active .radio-dot {
  display: block;
}

.mode-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
}

.mode-desc {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.35;
}

.info-tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 10px;
  font-weight: 800;
  cursor: help;
  margin-left: 4px;
}

/* Linear/Stripe/WorkOS Enterprise Design System Rules */
.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack-item {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 9.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid #ffffff;
  margin-left: -8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.avatar-stack-item:first-child {
  margin-left: 0;
}

.avatar-stack-more {
  background: #e2e8f0;
  color: #475569;
  font-size: 9px;
}

.kpi-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
  display: inline-block;
  margin-right: 6px;
}

.badge-dept {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.badge-leave-sick,
.badge-leave-casual,
.badge-leave-annual {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #e2e8f0;
  font-size: 11px;
  font-weight: 700;
}

/* Coverage Matrix Gantt */
.coverage-matrix-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.gantt-grid {
  display: grid;
  grid-template-columns: 180px repeat(7, 1fr);
  gap: 1px;
  background: #cbd5e1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}

.gantt-cell {
  background: #ffffff;
  padding: 10px 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
}

.gantt-header {
  background: #f8fafc;
  font-weight: 800;
  color: #475569;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  justify-content: center;
}

.gantt-header:first-child {
  justify-content: flex-start;
}

.gantt-bar-onleave {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 10.5px;
  font-weight: 700;
  width: 100%;
  text-align: center;
}

.gantt-bar-present {
  background: #f0fdf4;
  color: #166534;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 10.5px;
  font-weight: 600;
  width: 100%;
  text-align: center;
}

/* Modal Backdrop & Box */
.custom-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
}

.custom-modal-backdrop.open,
.custom-modal-backdrop.active {
  display: flex !important;
}

.custom-modal-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  width: 90%;
  max-width: 480px;
  padding: 24px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Clickable KPI Tiles & Leave Filter Pills */
.clickable-kpi-card {
  cursor: pointer;
}

/* Monthly Attendance Matrix Grid System */
.matrix-table-wrapper {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
}

.matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.matrix-table th, .matrix-table td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
  white-space: nowrap;
}

.matrix-table th {
  background: #f8fafc;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.matrix-table th.sticky-col, .matrix-table td.sticky-col {
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 2;
  text-align: left;
  padding: 10px 14px;
  border-right: 2px solid #e2e8f0;
  min-width: 180px;
}

.matrix-table tr:hover td.sticky-col {
  background: #f8fafc;
}

.matrix-table th.sticky-summary-col, .matrix-table td.sticky-summary-col {
  position: sticky;
  right: 0;
  background: #ffffff;
  z-index: 2;
  border-left: 2px solid #e2e8f0;
  padding: 8px 12px;
  min-width: 140px;
}

.matrix-cell-badge {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 800;
  text-align: center;
}

.m-cell-p { background: #ecfdf5; color: #047857; }
.m-cell-l { background: #fef3c7; color: #b45309; }
.m-cell-lv { background: #eff6ff; color: #1d4ed8; }
.m-cell-a { background: #fef2f2; color: #b91c1c; }
.m-cell-off { background: #f8fafc; color: #94a3b8; }

.leave-filter-pill {
  padding: 5px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.leave-filter-pill:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.leave-filter-pill.active {
  background: #0f172a !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
}

/* Principal Enterprise UX Reports Tokens */
.btn-date-preset {
  padding: 4px 10px;
  background: transparent;
  border: none;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-date-preset:hover {
  color: #0f172a;
}

.btn-date-preset.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.heatmap-cell {
  height: 32px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.heatmap-cell:hover {
  transform: scale(1.05);
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Senior UI/UX Designer: Leave Balance & Allocation Breakdown Widgets */
.leave-balance-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1200px) {
  .leave-balance-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .leave-balance-grid {
    grid-template-columns: 1fr;
  }
}

.leave-balance-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

.leave-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.leave-type-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
}

.icon-annual { background: #eef2ff; color: #4f46e5; }
.icon-sick { background: #ecfdf5; color: #059669; }
.icon-casual { background: #fffbeb; color: #d97706; }
.icon-unpaid { background: #fff1f2; color: #e11d48; }

.leave-remaining-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
}

.pill-indigo { background: #e0e7ff; color: #3730a3; }
.pill-emerald { background: #d1fae5; color: #065f46; }
.pill-amber { background: #fef3c7; color: #92400e; }
.pill-rose { background: #ffe4e6; color: #9f1239; }

.leave-card-title {
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.leave-big-value {
  font-size: 24px;
  font-weight: 900;
  color: #0f172a;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.leave-big-value span {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

.leave-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #64748b;
  margin-top: 10px;
  margin-bottom: 8px;
}

.leave-progress-track {
  width: 100%;
  height: 6px;
  background: #f1f5f9;
  border-radius: 10px;
  overflow: hidden;
}

.leave-progress-bar {
  height: 100%;
  border-radius: 10px;
  transition: width 0.3s ease;
}

.bar-indigo { background: linear-gradient(90deg, #6366f1, #4f46e5); }
.bar-emerald { background: linear-gradient(90deg, #10b981, #059669); }
.bar-amber { background: linear-gradient(90deg, #f59e0b, #d97706); }
.bar-rose { background: linear-gradient(90deg, #f43f5e, #e11d48); }

/* Settings Scope Filter Bar (Matching Uploaded Screenshots) */
.settings-scope-bar {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.scope-filters-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.scope-filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scope-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--ink);
}

.scope-select {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  min-width: 160px;
  background: #ffffff;
}

.btn-scope-apply {
  padding: 8px 24px;
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  height: 38px;
  box-shadow: 0 2px 8px rgba(162, 9, 67, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-scope-apply:hover {
  background: #8b0638 !important;
  border-color: #8b0638 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(162, 9, 67, 0.4) !important;
  transform: translateY(-1px);
}

.scope-explainer-text {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.4;
}

.btn-attn-secondary {
  padding: 6px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-attn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Activity Feed */
.activity-feed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-feed-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 8px;
}

.activity-user-badge {
  width: 32px; height: 32px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 800; flex-shrink: 0;
}

.activity-content { flex: 1; font-size: 13px; }
.activity-main-line { color: var(--ink); }
.activity-meta-line { font-size: 11px; color: var(--muted); margin-top: 2px; }
.activity-timestamp { font-size: 11px; color: var(--muted); font-weight: 700; }

/* Custom Dropdown Popup Menu (Matching media_1787817084977.png) */
.custom-dropdown { position: relative; }

.custom-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px 8px 14px;
  background: var(--bg-input) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 12px;
  font-family: Inter, sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary) !important;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
  white-space: nowrap;
  min-height: 38px;
}

.custom-dropdown-trigger:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dropdown-chevron {
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-left: 6px;
  margin-right: 2px;
}

.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 600;
  min-width: 100%;
  width: max-content;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25) !important;
  display: none;
}

.custom-dropdown.open .custom-dropdown-menu {
  display: block;
}

.custom-dropdown-option {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary) !important;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  transition: all 0.15s ease;
}

.custom-dropdown-option:hover, 
.custom-dropdown-option.selected {
  background: var(--bg-subtle) !important;
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .custom-dropdown-option:hover,
html[data-theme="dark"] .custom-dropdown-option.selected,
.dark .custom-dropdown-option:hover,
.dark .custom-dropdown-option.selected {
  background: #3C3C3E !important;
  color: #FFFFFF !important;
  box-shadow: inset 3px 0 0 0 var(--accent);
}

/* Inline Action Buttons */
.pending-actions { display: flex; gap: 6px; }

.btn-inline-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  transition: all 0.15s ease;
}

.btn-inline-action svg {
  flex-shrink: 0;
}

.btn-approve { border: 1px solid #10b981; color: #047857; }
.btn-approve:hover { background: #ecfdf5; }
.btn-reject { border: 1px solid #ef4444; color: #b91c1c; }
.btn-reject:hover { background: #fef2f2; }

/* Settings Hub Cards */
.settings-top-bar {
  padding: 18px 22px; background: var(--bg-surface) !important; border: 1px solid var(--border-subtle) !important; border-radius: 14px; margin-bottom: 20px;
}

.settings-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 1100px) {
  .settings-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .settings-cards-grid {
    grid-template-columns: 1fr;
  }
}

.settings-card {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.settings-icon-tile {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.tile-blue { background: #e0e7ff; color: #3b82f6; }
.tile-amber { background: #fef3c7; color: #d97706; }
.tile-green { background: #dcfce7; color: #16a34a; }
.tile-teal { background: #ccfbf1; color: #0d9488; }
.tile-rose { background: #ffe4e6; color: #e11d48; }
.tile-purple { background: #f3e8ff; color: #9333ea; }
.tile-orange { background: #ffedd5; color: #ea580c; }

.settings-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 2px;
}

.settings-card-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.4;
}

/* Reports Header */
.reports-header-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 20px; flex-wrap: wrap;
}

.export-actions { display: flex; gap: 8px; }

.btn-export {
  padding: 7px 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-input); font-size: 12px; font-weight: 700; color: var(--text-main); cursor: pointer;
}

.btn-export:hover { border-color: var(--accent); color: var(--accent); }

/* Slide-over Drawer & Modals */
.drawer-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: none;
}

.drawer-overlay.active, .drawer-overlay.open { display: block; }

.employee-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 380px; max-width: 90vw;
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  z-index: 1001;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.35);
  display: none;
}

.employee-drawer.active, .employee-drawer.open { display: block; }

.drawer-header {
  display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border-subtle);
}

.btn-close-drawer {
  background: transparent; border: none; font-size: 20px; cursor: pointer; color: var(--text-secondary);
}

.edit-attendance-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 420px; max-width: 92vw;
  background: var(--bg-surface) !important; border-radius: 14px;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-subtle) !important;
  z-index: 1001;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  display: none;
  overflow: visible !important;
}

.edit-attendance-modal.active, .edit-attendance-modal.open { display: block; }

.avatar-lg {
  width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px;
}

.user-name { margin: 0; font-size: 16px; font-weight: 800; }
.user-meta { margin: 2px 0 0 0; font-size: 12px; color: var(--text-secondary); }

.search-box input {
  padding: 7px 12px; border: 1px solid var(--border-subtle); border-radius: 8px; font-family: Inter, sans-serif; font-size: 12px; outline: none; min-width: 180px;
}

.search-box input:focus { border-color: var(--accent); }

.btn-submit-leave {
  padding: 10px 16px; border: none; border-radius: 8px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; cursor: pointer;
}

/* Custom Visual Calendar Picker Widget */
.custom-calendar-popup {
  position: absolute;
  z-index: 99999;
  width: 330px;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  display: none;
  font-family: Inter, sans-serif;
}

.custom-calendar-popup.open {
  display: block;
  animation: popupScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popupScale {
  from { opacity: 0; transform: scale(0.95) translateY(-6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cal-month-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary) !important;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cal-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle) !important;
  background: var(--bg-surface) !important;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--text-primary) !important;
  font-weight: 700;
  transition: all 0.15s ease;
}

.cal-nav-btn:hover {
  background: var(--bg-subtle) !important;
  border-color: var(--border-subtle) !important;
}

.cal-weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-secondary) !important;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day-cell {
  height: 36px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary) !important;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cal-day-cell:hover {
  background: var(--bg-subtle) !important;
}

.cal-day-cell.faded {
  color: var(--text-secondary) !important;
  opacity: 0.4;
}

.cal-day-cell.selected-solid {
  background: var(--accent) !important;
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(162, 9, 67, 0.35);
}

.cal-day-cell.selected-outline {
  border: 2px solid var(--accent) !important;
  color: var(--text-primary) !important;
  font-weight: 800;
  background: var(--bg-subtle) !important;
}

/* Date input calendar icon light in dark mode */
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.8;
}

html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
.dark input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.8) !important;
  opacity: 1 !important;
}

/* Custom Visual Time / Clock Picker Widget */
.custom-clock-popup {
  position: absolute;
  z-index: 9999;
  width: 300px;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  display: none;
  font-family: Inter, sans-serif;
}

.custom-clock-popup.open {
  display: block;
  animation: popupScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.clock-digital-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg-subtle) !important;
  border-radius: 16px;
  margin-bottom: 16px;
}

.clock-digital-time {
  font-size: 28px;
  font-weight: 900;
  color: var(--text-primary) !important;
  letter-spacing: -0.5px;
}

.clock-ampm-toggle {
  display: flex;
  background: var(--bg-input) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 10px;
  padding: 2px;
}

.clock-ampm-btn {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.clock-ampm-btn.active {
  background: var(--accent);
  color: #ffffff;
}

.clock-chips-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.clock-chip {
  padding: 8px;
  text-align: center;
  background: var(--bg-subtle) !important;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary) !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

.clock-chip:hover, .clock-chip.active {
  background: #4f46e5;
  color: #ffffff;
}

/* ==========================================================================
   GLOBAL SEMANTIC THEME ENGINE (SEAMLESS LIGHT & DARK MODE SUPPORT)
   ========================================================================== */

/* Cards, Modals, and Main Surface Containers */
.sidebar, 
.submenu-popout, 
.content-card, 
.stat-card, 
.coverage-matrix-card, 
.leaveRosterTableContainer,
.custom-modal-box,
.attention-section-card,
.settings-form-section {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-main) !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease !important;
}

/* Inner Nested Cards & Rows */
.clickable-kpi-card,
.leave-item-row,
.attn-card,
.activity-feed-row,
.mode-card,
.dept-card-item {
  background: var(--bg-card-muted) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-main) !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease !important;
}

.content-card:hover, 
.stat-card:hover, 
.clickable-kpi-card:hover, 
.attn-card:hover,
.leave-item-row:hover,
.mode-card:hover {
  border-color: var(--border-subtle) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
}

/* Form Controls, Inputs, and Dropdowns */
.btn-top-action,
.badge,
.status-pill,
.mode-badge,
.leave-filter-pill,
.btn-notif-bell-inline,
.avatar-stack-item,
.btn-attn-primary,
.btn-attn-secondary,
.attn-badge,
.badge-pending,
.badge-high-priority,
.badge-discrepancy,
.badge-policy,
.btn-edit-attendance,
.btn-inline-action,
.btn-date-preset,
input,
select,
textarea,
.filter-select,
.search-box input {
  background: var(--input-bg) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-subtle) !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-top-action:hover,
.btn-attn-primary:hover,
.btn-attn-secondary:hover,
.btn-edit-attendance:hover,
.btn-inline-action:hover,
.btn-date-preset:hover,
.btn-notif-bell-inline:hover {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

/* Active State Tabs & Filters */
.dept-card-item.active,
.leave-filter-pill.active,
.subnav-btn.active,
.btn-date-preset.active {
  background: var(--accent) !important;
  color: #ffffff !important;
  border-color: var(--accent) !important;
}

/* Global Typography & Label Visibility */
h1, h2, h3, h4, h5, h6,
strong, b,
.stat-value, .stat-title,
.card-title,
.attn-card-title,
.activity-main-line,
.mode-title,
.form-section-title,
.emp-name {
  color: var(--text-main) !important;
}

.stat-subtitle, p, span.subtext, .card-subtitle,
.attn-card-subtext,
.activity-meta-line,
.activity-timestamp,
.mode-desc,
.form-section-desc,
.emp-role {
  color: var(--text-muted) !important;
}

/* Data Tables */
.attendance-table th, 
.matrix-table th, 
.table-responsive th {
  background: var(--table-head) !important;
  color: var(--text-muted) !important;
  border-color: var(--border-subtle) !important;
}

.attendance-table td, 
.matrix-table td, 
.table-responsive td {
  background: var(--bg-card) !important;
  color: var(--text-main) !important;
  border-color: var(--border-subtle) !important;
  transition: background 0.15s ease !important;
}

.attendance-table tr:hover td, 
.matrix-table tr:hover td {
  background: var(--bg-card-muted) !important;
}

.matrix-table th.sticky-col, 
.matrix-table td.sticky-col {
  background: var(--bg-card) !important;
  border-color: var(--border-subtle) !important;
}

/* Dropdown Menus & Popups */
.custom-dropdown-menu,
#timeframeMenu,
#customCalendarPopup,
#customClockPopup {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-main) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25) !important;
}

.custom-dropdown-option,
.tf-menu-item {
  color: var(--text-main) !important;
  transition: background 0.15s ease, color 0.15s ease !important;
}

.custom-dropdown-option:hover,
.custom-dropdown-option.selected,
.tf-menu-item:hover,
.tf-menu-item.active {
  background: var(--bg-subtle) !important;
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .custom-dropdown-option:hover,
html[data-theme="dark"] .custom-dropdown-option.selected,
html[data-theme="dark"] .tf-menu-item:hover,
html[data-theme="dark"] .tf-menu-item.active,
.dark .custom-dropdown-option:hover,
.dark .custom-dropdown-option.selected,
.dark .tf-menu-item:hover,
.dark .tf-menu-item.active {
  background: #3C3C3E !important;
  color: #FFFFFF !important;
}

/* Subnav Tabs */
.subnav-btn {
  color: var(--text-muted) !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.subnav-btn:not(.active):hover {
  background: var(--bg-card-muted) !important;
  color: var(--text-main) !important;
}

/* ==========================================================================
   STRICT DARK MODE TEXT WHITENING & ZERO ACCIDENTAL COLOR ENFORCEMENT
   ========================================================================== */

html[data-theme="dark"],
.dark {
  color: #FFFFFF !important;
}

html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3, 
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6, 
html[data-theme="dark"] strong, html[data-theme="dark"] b, html[data-theme="dark"] th,
html[data-theme="dark"] td, html[data-theme="dark"] label, html[data-theme="dark"] select,
html[data-theme="dark"] input, html[data-theme="dark"] button, html[data-theme="dark"] .stat-value,
html[data-theme="dark"] .stat-title, html[data-theme="dark"] .card-title, html[data-theme="dark"] .emp-name,
html[data-theme="dark"] .attn-card-title, html[data-theme="dark"] .activity-main-line,
html[data-theme="dark"] .mode-title, html[data-theme="dark"] .form-section-title,
html[data-theme="dark"] .dropdown-selected-val, html[data-theme="dark"] .custom-dropdown-option,
.dark h1, .dark h2, .dark h3, .dark h4, .dark h5, .dark h6, 
.dark strong, .dark b, .dark th, .dark td, .dark label, .dark select,
.dark input, .dark button, .dark .stat-value, .dark .stat-title, .dark .card-title,
.dark .emp-name, .dark .attn-card-title, .dark .activity-main-line,
.dark .mode-title, .dark .form-section-title, .dark .dropdown-selected-val, .dark .custom-dropdown-option {
  color: #FFFFFF !important;
}

html[data-theme="dark"] p, 
html[data-theme="dark"] span:not(.badge):not(.dept-card-item):not(.stat-value):not(.tabular-nums),
.dark p, 
.dark span:not(.badge):not(.dept-card-item):not(.stat-value):not(.tabular-nums) {
  color: #FFFFFF !important;
}

html[data-theme="dark"] .stat-subtitle,
html[data-theme="dark"] .card-subtitle,
html[data-theme="dark"] .emp-role,
html[data-theme="dark"] .attn-card-subtext,
html[data-theme="dark"] .activity-meta-line,
html[data-theme="dark"] .activity-timestamp,
html[data-theme="dark"] .subtext,
html[data-theme="dark"] .card-meta,
.dark .stat-subtitle,
.dark .card-subtitle,
.dark .emp-role,
.dark .attn-card-subtext,
.dark .activity-meta-line,
.dark .activity-timestamp,
.dark .subtext,
.dark .card-meta {
  color: #A1A1AA !important;
}

/* Sidebar Navigation Icons Dark Mode Whitening */
html[data-theme="dark"] .sidebar .nav-item img,
html[data-theme="dark"] .sidebar .nav-item svg,
.dark .sidebar .nav-item img,
.dark .sidebar .nav-item svg {
  filter: brightness(0) invert(1) !important;
  color: #FFFFFF !important;
  stroke: #FFFFFF !important;
}

html[data-theme="dark"] .sidebar .nav-item:hover,
.dark .sidebar .nav-item:hover {
  background: var(--bg-card-muted) !important;
}

/* Department Badge & Small Table Pills Fix */
.badge-dept {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--bg-subtle) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border-subtle) !important;
}

html[data-theme="dark"] .badge-dept,
.dark .badge-dept {
  background: #3C3C3E !important;
  color: #A1A1AA !important;
  border: 1px solid #4A4A4C !important;
}

html[data-theme="dark"] .badge-danger,
.dark .badge-danger {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
}

html[data-theme="dark"] .badge-warning,
.dark .badge-warning {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
}

/* Native Select Option Theme Styling */
select option {
  background-color: var(--bg-surface) !important;
  color: var(--text-primary) !important;
}

html[data-theme="dark"] select option,
.dark select option {
  background-color: #1F1F1F !important;
  color: #FFFFFF !important;
}

/* Dark Mode Status Badges */
html[data-theme="dark"] .badge-success,
.dark .badge-success {
  background: rgba(16, 185, 129, 0.18) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
}

html[data-theme="dark"] .badge-warning,
.dark .badge-warning {
  background: rgba(245, 158, 11, 0.18) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
}

html[data-theme="dark"] .badge-danger,
.dark .badge-danger {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
}

html[data-theme="dark"] .badge-purple,
.dark .badge-purple {
  background: rgba(139, 92, 246, 0.18) !important;
  color: #c084fc !important;
  border: 1px solid rgba(139, 92, 246, 0.35) !important;
}

html[data-theme="dark"] .badge-info,
.dark .badge-info {
  background: rgba(59, 130, 246, 0.18) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(59, 130, 246, 0.35) !important;
}

/* Universal Button & Active Pill Rules - Tezway Signature Burgundy (#a20943) Brand Theme */
.btn-attn-primary,
.btn-dark-primary,
.btn-submit-leave {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  border: 1px solid var(--accent) !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(162, 9, 67, 0.25) !important;
  transition: all 0.15s ease !important;
}

.btn-attn-primary:hover,
.btn-dark-primary:hover,
.btn-submit-leave:hover {
  background: #830736 !important;
  border-color: #830736 !important;
  box-shadow: 0 4px 12px rgba(162, 9, 67, 0.35) !important;
}

html[data-theme="dark"] .btn-attn-primary,
html[data-theme="dark"] .btn-dark-primary,
html[data-theme="dark"] .btn-submit-leave,
.dark .btn-attn-primary,
.dark .btn-dark-primary,
.dark .btn-submit-leave {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  border: 1px solid var(--accent) !important;
  box-shadow: 0 2px 8px rgba(162, 9, 67, 0.35) !important;
}

html[data-theme="dark"] .btn-attn-primary:hover,
html[data-theme="dark"] .btn-dark-primary:hover,
html[data-theme="dark"] .btn-submit-leave:hover,
.dark .btn-attn-primary:hover,
.dark .btn-dark-primary:hover,
.dark .btn-submit-leave:hover {
  background: #bd0d51 !important;
  border-color: #bd0d51 !important;
}

.dept-card-item.active,
.leave-filter-pill.active,
.roster-page-btn.active,
.btn-date-preset.active,
.clock-chip.active,
.clock-ampm-btn.active,
.day-toggle-pill.active {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  border-color: var(--accent) !important;
  font-weight: 700 !important;
}

.dept-card-item.active *,
.leave-filter-pill.active *,
.roster-page-btn.active *,
.btn-date-preset.active *,
.clock-chip.active *,
.clock-ampm-btn.active *,
.day-toggle-pill.active *,
.dept-card-item.active span,
.leave-filter-pill.active span,
.roster-page-btn.active span,
.dept-card-item.active svg,
.leave-filter-pill.active svg,
.roster-page-btn.active svg {
  color: #FFFFFF !important;
  stroke: #FFFFFF !important;
  fill: none;
}

/* Light Mode Dropdown Trigger Styling */
html[data-theme="light"] .custom-dropdown-trigger,
html[data-theme="light"] .btn-top-action {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1px solid #E2E8F0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="light"] .custom-dropdown-trigger .dropdown-selected-val,
html[data-theme="light"] .btn-top-action .dropdown-selected-val {
  color: #0F172A !important;
}

html[data-theme="light"] .custom-dropdown-trigger .dropdown-chevron,
html[data-theme="light"] .btn-top-action .dropdown-chevron {
  stroke: #64748B !important;
  color: #64748B !important;
}

/* Dark Mode Dropdown Triggers & Buttons Contrast */
html[data-theme="dark"] .custom-dropdown-trigger,
html[data-theme="dark"] .btn-top-action,
.dark .custom-dropdown-trigger,
.dark .btn-top-action {
  background: #202024 !important;
  color: #FFFFFF !important;
  border: 1px solid #27272A !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

html[data-theme="dark"] .custom-dropdown-trigger *,
html[data-theme="dark"] .btn-top-action *,
.dark .custom-dropdown-trigger *,
.dark .btn-top-action * {
  color: #FFFFFF !important;
  stroke: #A1A1AA !important;
}

/* Hover & Open States for Dropdown Triggers */
.custom-dropdown-trigger:hover,
.custom-dropdown-trigger.open,
.btn-top-action:hover {
  border-color: var(--accent) !important;
}

/* Universal Static Card Rule - Zero Hover Jumping or Lifting on any Card */
.stat-card,
.app-card,
.app-card-nested,
.clickable-kpi-card,
.attn-card,
.leave-balance-card,
.settings-card,
.content-card {
  transform: none !important;
  transition: none !important;
}

.stat-card:hover,
.app-card:hover,
.app-card-nested:hover,
.clickable-kpi-card:hover,
.attn-card:hover,
.leave-balance-card:hover,
.settings-card:hover,
.content-card:hover {
  transform: none !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
}

/* Explicit Sidebar Submenu Popout Theme Styling */
html[data-theme="dark"] .submenu-panel,
.dark .submenu-panel {
  background: #18181B !important;
  border: 1px solid #27272A !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="dark"] .submenu-title,
.dark .submenu-title {
  color: #FFFFFF !important;
  border-bottom: 1px solid #27272A !important;
}

html[data-theme="dark"] .submenu-section-label,
.dark .submenu-section-label {
  color: #71717A !important;
}

html[data-theme="dark"] .submenu-link,
.dark .submenu-link {
  color: #D4D4D8 !important;
}

html[data-theme="dark"] .submenu-link:hover,
.dark .submenu-link:hover {
  background: rgba(162, 9, 67, 0.15) !important;
  color: #FFFFFF !important;
}

/* Card Action Buttons - Tezway Burgundy Theme */
.btn-card-action-primary,
.btn-ess-primary,
.btn-primary-burgundy {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 7px 14px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  border: 1px solid var(--accent, #9f1239) !important;
  cursor: pointer !important;
  background: var(--accent, #9f1239) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(162, 9, 67, 0.22) !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
}

.btn-card-action-primary:hover,
.btn-ess-primary:hover,
.btn-primary-burgundy:hover {
  background: #830736 !important;
  border-color: #830736 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(162, 9, 67, 0.32) !important;
}

/* Strict Universal White Text & Icon Rule on ALL Burgundy Buttons & Triggers */
.subnav-btn.active,
.subnav-btn.active *,
.btn-card-action-primary,
.btn-card-action-primary *,
.btn-attn-primary,
.btn-attn-primary *,
.btn-ess-primary,
.btn-ess-primary *,
.btn-micro-burgundy,
.btn-micro-burgundy *,
.btn-top-action.btn-burgundy,
.btn-top-action.btn-burgundy *,
.btn-top-action.active,
.btn-top-action.active *,
button[style*="background: var(--accent)"],
button[style*="background: var(--accent)"] *,
button[style*="background: #9f1239"],
button[style*="background: #9f1239"] *,
button[style*="background: #9F1239"],
button[style*="background: #9F1239"] *,
button[style*="background: #a20943"],
button[style*="background: #a20943"] *,
button[style*="background: #881337"],
button[style*="background: #881337"] * {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

.subnav-btn.active svg,
.btn-card-action-primary svg,
.btn-attn-primary svg,
.btn-ess-primary svg,
.btn-micro-burgundy svg,
.btn-top-action.btn-burgundy svg,
.btn-top-action.active svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

.subnav-btn.active svg *,
.btn-card-action-primary svg *,
.btn-attn-primary svg *,
.btn-ess-primary svg *,
.btn-micro-burgundy svg *,
.btn-top-action.btn-burgundy svg *,
.btn-top-action.active svg * {
  stroke: #ffffff !important;
}

.btn-card-action-secondary {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
  user-select: none;
}

.btn-card-action-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* Dark Mode Overrides for Action Buttons */
html[data-theme="dark"] .btn-card-action-primary,
.dark .btn-card-action-primary {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  border: 1px solid var(--accent) !important;
  box-shadow: 0 2px 8px rgba(162, 9, 67, 0.35) !important;
}

html[data-theme="dark"] .btn-card-action-primary:hover,
.dark .btn-card-action-primary:hover {
  background: #bd0d51 !important;
  border-color: #bd0d51 !important;
}

html[data-theme="dark"] .btn-card-action-secondary,
.dark .btn-card-action-secondary {
  background: #27272A !important;
  color: #FFFFFF !important;
  border: 1px solid #3F3F46 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .btn-card-action-secondary:hover,
.dark .btn-card-action-secondary:hover {
  background: #3F3F46 !important;
  border-color: var(--accent) !important;
  color: #FFFFFF !important;
}

/* Highly Visible & Polished "Back to Settings" Button */
.btn-back-settings {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1.5px solid var(--border-subtle);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.btn-back-settings svg {
  color: var(--accent);
  transition: transform 0.2s ease;
}

.btn-back-settings:hover {
  background: var(--accent) !important;
  color: #ffffff !important;
  border-color: var(--accent) !important;
  transform: translateX(-3px);
  box-shadow: 0 4px 14px rgba(162, 9, 67, 0.35) !important;
}

.btn-back-settings:hover svg {
  color: #ffffff !important;
  transform: translateX(-2px);
}

html[data-theme="dark"] .btn-back-settings,
.dark .btn-back-settings {
  background: #27272A !important;
  color: #FFFFFF !important;
  border: 1.5px solid #3F3F46 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .btn-back-settings:hover,
.dark .btn-back-settings:hover {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  border-color: var(--accent) !important;
}

html[data-theme="dark"] .btn-back-settings:hover *,
.dark .btn-back-settings:hover * {
  color: #FFFFFF !important;
  stroke: #FFFFFF !important;
}

/* White/Light Mode & Universal Burgundy Hover Enforcement: White Text & White SVG Arrow */
html[data-theme="light"] .btn-back-settings:hover,
html:not([data-theme="dark"]) .btn-back-settings:hover,
.btn-back-settings:hover {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  border-color: var(--accent) !important;
}

html[data-theme="light"] .btn-back-settings:hover *,
html:not([data-theme="dark"]) .btn-back-settings:hover *,
.btn-back-settings:hover * {
  color: #FFFFFF !important;
  stroke: #FFFFFF !important;
}

html[data-theme="light"] .btn-card-action-primary:hover,
html:not([data-theme="dark"]) .btn-card-action-primary:hover,
.btn-card-action-primary:hover {
  background: #8b0638 !important;
  color: #FFFFFF !important;
}

html[data-theme="light"] .btn-card-action-primary:hover *,
html:not([data-theme="dark"]) .btn-card-action-primary:hover *,
.btn-card-action-primary:hover * {
  color: #FFFFFF !important;
  stroke: #FFFFFF !important;
}

html[data-theme="light"] .btn-attn-primary:hover,
html:not([data-theme="dark"]) .btn-attn-primary:hover,
.btn-attn-primary:hover {
  background: #8b0638 !important;
  color: #FFFFFF !important;
}

html[data-theme="light"] .btn-attn-primary:hover *,
html:not([data-theme="dark"]) .btn-attn-primary:hover *,
.btn-attn-primary:hover * {
  color: #FFFFFF !important;
  stroke: #FFFFFF !important;
}

html[data-theme="light"] .btn-submit-leave:hover,
html:not([data-theme="dark"]) .btn-submit-leave:hover,
.btn-submit-leave:hover {
  background: #8b0638 !important;
  color: #FFFFFF !important;
}

html[data-theme="light"] .btn-submit-leave:hover *,
html:not([data-theme="dark"]) .btn-submit-leave:hover *,
.btn-submit-leave:hover * {
  color: #FFFFFF !important;
  stroke: #FFFFFF !important;
}

html[data-theme="light"] .btn-scope-apply:hover,
html:not([data-theme="dark"]) .btn-scope-apply:hover,
.btn-scope-apply:hover {
  background: #8b0638 !important;
  color: #FFFFFF !important;
}

html[data-theme="light"] .btn-scope-apply:hover *,
html:not([data-theme="dark"]) .btn-scope-apply:hover *,
.btn-scope-apply:hover * {
  color: #FFFFFF !important;
  stroke: #FFFFFF !important;
}

/* ============================================================
   ENTERPRISE SKELETON SHIMMER SYSTEM (FOR ALL 5 SCREENS)
============================================================ */
:root {
  --skel-base-color: #e2e8f0;
  --skel-shine-color: #ffffff;
}

html[data-theme="dark"],
.dark,
[data-theme="dark"] {
  --skel-base-color: #27272a;
  --skel-shine-color: #71717a;
}

@keyframes skeletonWave {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.skel-bone {
  display: block;
  background-color: var(--skel-base-color) !important;
  background-image: linear-gradient(
    90deg,
    var(--skel-base-color) 0%,
    var(--skel-base-color) 25%,
    var(--skel-shine-color) 50%,
    var(--skel-base-color) 75%,
    var(--skel-base-color) 100%
  ) !important;
  background-size: 300% 100% !important;
  background-repeat: no-repeat !important;
  animation: skeletonWave 1.2s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
  border-radius: 6px;
  flex-shrink: 0;
}

.skel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.subtab-skeleton-screen,
.subtab-skeleton-screen.active {
  display: none !important;
  pointer-events: none !important;
}

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

.subtab-content.active {
  animation: contentReveal 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes contentReveal {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   OVERVIEW TEAM ATTENDANCE ROSTER MULTI-PARTITION TABLE
============================================================ */
.roster-card {
  padding: 18px 20px !important;
  border-radius: 14px !important;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  margin-top: 16px !important;
}

.roster-pills-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px !important;
  flex-wrap: wrap;
  gap: 10px;
}

.roster-pill-btn {
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.roster-pill-btn:hover {
  background: var(--bg-card-muted);
  color: var(--text-primary);
}

.roster-pill-btn.active {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  border-color: var(--accent) !important;
  box-shadow: 0 2px 8px rgba(162, 9, 67, 0.25);
}

.roster-view-toggle {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.roster-view-btn {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.roster-view-btn:hover {
  color: var(--text-primary);
}

.roster-view-btn.active {
  background: var(--bg-card-muted);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.roster-partitions-wrapper {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: stretch;
  background: transparent;
  border: none;
}

.roster-partition-col {
  flex: 1 1 290px;
  max-width: calc(33.333% - 8px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

@media (max-width: 992px) {
  .roster-partition-col {
    max-width: 100%;
    flex: 1 1 100%;
  }
}

.roster-mini-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.roster-mini-table thead th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 8px 8px 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  white-space: nowrap;
}

.roster-mini-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.12s ease;
}

.roster-mini-table tbody tr:last-child {
  border-bottom: none;
}

.roster-mini-table tbody tr:hover {
  background: var(--bg-subtle);
}

.roster-mini-table td {
  padding: 7px 8px 7px 12px;
  font-size: 12px;
  color: var(--text-primary);
  vertical-align: middle;
  white-space: nowrap;
}

.roster-emp-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 105px;
}

.roster-avatar-wrapper {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.roster-avatar-img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-muted);
}

.roster-avatar-fallback {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.roster-status-badge-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--bg-card);
}

.roster-status-badge-dot.present {
  background: #10b981;
}

.roster-status-badge-dot.late {
  background: #f59e0b;
}

.roster-status-badge-dot.absent {
  background: #ef4444;
}

.roster-status-badge-dot.leave {
  background: #3b82f6;
}

.roster-emp-meta {
  display: flex;
  flex-direction: column;
}

.roster-emp-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
}

.roster-emp-role {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 1px;
}

.roster-time-cell {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 400;
}

.roster-hours-cell {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-primary);
}

/* 4-Column Micro Cards Grid */
.roster-matrix-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 2px 0;
}

@media (max-width: 1100px) {
  .roster-matrix-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .roster-matrix-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.roster-micro-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.roster-micro-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--bg-subtle);
}

.roster-page-btn {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.roster-page-btn:hover:not(:disabled) {
  background: var(--bg-card-muted);
  color: var(--text-primary);
}

.roster-page-btn.active {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  border-color: var(--accent) !important;
}

.roster-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================
   TEAM ATTENDANCE OPERATIONAL WORKBENCH STYLES
============================================================ */
.workbench-dept-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
  width: 100%;
}

@media (max-width: 1280px) {
  .workbench-dept-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .workbench-dept-grid {
    grid-template-columns: 1fr;
  }
}

.workbench-dept-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.workbench-dept-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.workbench-dept-card.active {
  background: rgba(162, 9, 67, 0.08) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 1px var(--accent);
}

.workbench-seg-bar {
  height: 6px;
  background: var(--border-subtle);
  border-radius: 99px;
  overflow: hidden;
  display: flex;
  gap: 2px;
  margin: 12px 0 6px 0;
}

.workbench-pill-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.workbench-pill-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.workbench-pill-btn:hover {
  background: var(--border-subtle);
  color: var(--text-primary);
}

.workbench-pill-btn.active {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  border-color: var(--accent) !important;
  font-weight: 700;
}

.workbench-table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.workbench-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.workbench-table thead tr {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.workbench-table th {
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.workbench-table tbody tr {
  height: 48px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.12s ease;
}

.workbench-table tbody tr:last-child {
  border-bottom: none;
}

.workbench-table tbody tr:hover {
  background: var(--bg-subtle);
}

.workbench-table tbody tr.row-selected {
  background: rgba(162, 9, 67, 0.06);
}

.workbench-table td {
  padding: 8px 14px;
  font-size: 12.5px;
  vertical-align: middle;
}

.badge-in-progress {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.badge-missing-punch {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-regularize-action {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-regularize-action:hover {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
}

/* Monthly Matrix View Styles (Zero-Scroll 100% Width Fit) */
.matrix-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
}

.matrix-table th {
  padding: 8px 1px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid rgba(0, 0, 0, 0.04);
  background: var(--bg-surface);
  color: var(--text-secondary);
  vertical-align: middle;
  overflow: hidden;
}

.matrix-table th.th-weekend {
  background: rgba(0, 0, 0, 0.02);
  color: var(--text-muted);
}

.matrix-table td {
  padding: 6px 1px;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid rgba(0, 0, 0, 0.03);
  vertical-align: middle;
  overflow: hidden;
}

.matrix-table td.td-weekend {
  background: rgba(0, 0, 0, 0.015);
}

.matrix-table .col-sticky {
  position: sticky;
  left: 0;
  background: var(--bg-surface);
  z-index: 5;
  text-align: left;
  padding: 8px 10px;
  border-right: 2px solid var(--border-subtle);
  width: 145px;
  min-width: 135px;
  max-width: 155px;
}

.matrix-table tbody tr:hover .col-sticky {
  background: var(--bg-subtle);
}

.matrix-table tbody tr:hover td {
  background-color: rgba(162, 9, 67, 0.02);
}

.matrix-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
  margin: 0 auto;
}

.matrix-badge:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.mb-present {
  background: rgba(16, 185, 129, 0.16);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.mb-late {
  background: rgba(245, 158, 11, 0.18);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.mb-absent {
  background: rgba(239, 68, 68, 0.16);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.mb-leave {
  background: rgba(59, 130, 246, 0.16);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.35);
  font-size: 8px;
}

.mb-off {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  font-size: 7.5px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  cursor: default;
}
.mb-off:hover {
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   STRICT UNIVERSAL ACTIVE BUTTON THEME: Pure White Text on Burgundy (#a20943)
   ========================================================================== */
.roster-page-btn.active,
.leave-filter-pill.active,
.dept-card-item.active,
.workbench-pill-btn.active,
button.active {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #FFFFFF !important;
}

.roster-page-btn.active *,
.leave-filter-pill.active *,
.dept-card-item.active *,
.workbench-pill-btn.active *,
button.active *,
.roster-page-btn.active span,
.leave-filter-pill.active span,
.dept-card-item.active span,
.workbench-pill-btn.active span,
button.active span,
.roster-page-btn.active svg,
.leave-filter-pill.active svg,
.dept-card-item.active svg,
.workbench-pill-btn.active svg,
button.active svg {
  color: #FFFFFF !important;
  stroke: #FFFFFF !important;
  fill: none;
}

/* Dedicated Primary Brand Button */
.btn-brand-primary {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  border: 1px solid var(--accent) !important;
  box-shadow: 0 2px 6px rgba(162, 9, 67, 0.25) !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.15s ease !important;
}

.btn-brand-primary:hover {
  background: #870637 !important;
  border-color: #870637 !important;
  box-shadow: 0 4px 12px rgba(162, 9, 67, 0.35) !important;
}

.btn-brand-primary *,
.btn-brand-primary span,
.btn-brand-primary svg {
  color: #FFFFFF !important;
  stroke: #FFFFFF !important;
  fill: none !important;
}

/* Clean Dashboard-Themed Approve & Reject Action Buttons */
.btn-leave-approve {
  background: var(--accent) !important;
  border: 1px solid var(--accent) !important;
  color: #FFFFFF !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  padding: 5px 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 1px 3px rgba(162, 9, 67, 0.2) !important;
}

.btn-leave-approve,
.btn-leave-approve *,
.btn-leave-approve span {
  color: #FFFFFF !important;
}

.btn-leave-approve svg {
  stroke: #FFFFFF !important;
}

.btn-leave-approve:hover {
  background: #870637 !important;
  border-color: #870637 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 8px rgba(162, 9, 67, 0.35) !important;
}

.btn-leave-reject {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-secondary) !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  padding: 5px 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.btn-leave-reject,
.btn-leave-reject *,
.btn-leave-reject span {
  color: var(--text-secondary) !important;
}

.btn-leave-reject svg {
  stroke: var(--text-secondary) !important;
}

.btn-leave-reject:hover {
  background: var(--bg-subtle) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-subtle) !important;
  transform: translateY(-1px) !important;
}

.btn-leave-reject:hover *,
.btn-leave-reject:hover span {
  color: var(--text-primary) !important;
}

.btn-leave-reject:hover svg {
  stroke: var(--text-primary) !important;
}

/* ========================================================================== */
/* COMPREHENSIVE RESPONSIVENESS & ADAPTIVE BREAKPOINTS                        */
/* ========================================================================== */

.leave-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1200px) {
  .leave-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .leave-kpi-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .content-card.app-card {
    padding: 14px !important;
  }
  
  /* Filter strips & search boxes */
  .search-box input {
    width: 100% !important;
    min-width: 140px;
  }
  
  /* Custom Modal responsive */
  .custom-modal-box {
    width: 95% !important;
    max-width: 95% !important;
    margin: 12px auto !important;
    padding: 18px 16px !important;
  }
}

@media (max-width: 480px) {
  .leave-kpi-grid {
    grid-template-columns: 1fr;
  }

  .roster-page-btn {
    font-size: 11px !important;
    padding: 5px 9px !important;
  }

  .btn-brand-primary {
    font-size: 11.5px !important;
    padding: 0 12px !important;
  }

  .stat-card {
    padding: 14px !important;
  }
}

/* =========================================================================
   PROGRESS OVERVIEW AREA CHART & DONUT SPLIT (Matching Reference Design)
   ========================================================================= */

.progress-analytics-grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 1024px) {
  .progress-analytics-grid {
    grid-template-columns: 1fr;
  }
}

.chart-dropdown-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: all 0.15s ease;
}

.chart-dropdown-pill:hover {
  border-color: var(--accent);
  background: var(--bg-subtle);
}

.chart-tooltip-floating {
  position: absolute;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: 0 12px 28px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  pointer-events: none;
  z-index: 10;
  min-width: 145px;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -100%) translateY(-6px) scale(0.96);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), left 0.15s cubic-bezier(0.16, 1, 0.3, 1), top 0.15s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
}

.chart-tooltip-floating.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -100%) translateY(-10px) scale(1);
}

.chart-tooltip-floating::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 9px;
  height: 9px;
  background: #ffffff;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.chart-dot-pin {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--accent);
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 5;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.chart-dot-pin:hover,
.chart-dot-pin.active {
  transform: translate(-50%, -50%) scale(1.6);
  background: var(--accent);
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(162, 9, 67, 0.3);
}

/* Enlarged Live Dot with Dual Pulsing Radar Aura */
.chart-dot-pin.live-now {
  width: 7px !important;
  height: 7px !important;
  background: var(--accent) !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 0 0 2.5px rgba(162, 9, 67, 0.35), 0 2px 6px rgba(162, 9, 67, 0.4);
}

@keyframes livePulseRing {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.8);
    opacity: 0;
  }
}

.chart-dot-pin.live-now::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--accent);
  animation: livePulseRing 1.6s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  pointer-events: none;
}

.chart-active-guideline {
  position: absolute;
  bottom: 0;
  width: 1.5px;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  transform: translateX(-50%);
  transition: opacity 0.2s ease, left 0.2s cubic-bezier(0.16, 1, 0.3, 1), height 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.donut-legend-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.donut-legend-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.donut-legend-box .legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* =========================================================================
   EXACT SPLINE WAVE CHART (Perfect Round Dots & Reference Tooltip Card)
   ========================================================================= */

.spline-point-marker {
  position: absolute;
  width: 9px;
  height: 9px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--accent);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1), height 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
}

.spline-point-marker.active {
  width: 14px;
  height: 14px;
  background: var(--accent) !important;
  border: 2.5px solid #ffffff !important;
  box-shadow: 0 0 12px 2px rgba(162, 9, 67, 0.75), 0 2px 5px rgba(0, 0, 0, 0.25) !important;
  z-index: 15;
}

.spline-point-marker.live-point {
  width: 13px;
  height: 13px;
  background: var(--accent);
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 12px 2px rgba(162, 9, 67, 0.75), 0 2px 6px rgba(0, 0, 0, 0.25);
  z-index: 14;
}

@keyframes liveRadarPulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.95;
  }
  100% {
    transform: translate(-50%, -50%) scale(3.2);
    opacity: 0;
  }
}

.spline-point-marker.live-point::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--accent);
  animation: liveRadarPulse 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  pointer-events: none;
  z-index: -1;
}

.spline-interactive-drop-line {
  position: absolute;
  width: 1.5px;
  background: transparent;
  border-left: 1.5px dashed var(--accent);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 8;
  transition: opacity 0.15s ease, visibility 0.15s;
}

.spline-interactive-drop-line.visible {
  opacity: 0.85;
  visibility: visible;
}

.spline-scrub-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--accent);
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 10px 2px rgba(162, 9, 67, 0.65), 0 2px 5px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 18;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s;
}

.spline-scrub-dot.visible {
  opacity: 1;
  visibility: visible;
}

.spline-interactive-drop-line.visible {
  opacity: 0.85;
  visibility: visible;
}

.spline-interactive-tooltip {
  position: absolute;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.12), 0 4px 10px -2px rgba(0, 0, 0, 0.06);
  pointer-events: none;
  z-index: 20;
  min-width: 135px;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -100%) translateY(-6px) scale(0.96);
  transition: left 0.12s cubic-bezier(0.16, 1, 0.3, 1), top 0.12s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.18s;
}

.spline-interactive-tooltip::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 9px;
  height: 9px;
  background: #ffffff;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.spline-interactive-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -100%) translateY(-12px) scale(1);
}

/* =========================================================================
   MODERN ATTENDANCE TABLE ACTION BUTTONS
   ========================================================================= */

.table-action-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.table-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  line-height: 1.2;
  white-space: nowrap;
}

.table-action-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-default);
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}

.table-action-btn.btn-regularize {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(162, 9, 67, 0.25);
}

.table-action-btn.btn-regularize span,
.table-action-btn.btn-regularize * {
  color: #ffffff !important;
}

.table-action-btn.btn-regularize svg {
  stroke: #ffffff !important;
  fill: none !important;
  color: #ffffff !important;
  transition: stroke 0.15s ease;
}

.table-action-btn.btn-regularize:hover {
  background: #850636 !important;
  border-color: #850636 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(162, 9, 67, 0.4);
  transform: translateY(-1px);
}

.table-action-btn.btn-regularize:hover span,
.table-action-btn.btn-regularize:hover * {
  color: #ffffff !important;
}

.table-action-btn.btn-regularize:hover svg {
  stroke: #ffffff !important;
}

.btn-brand-primary {
  background: var(--accent) !important;
  border: 1px solid var(--accent) !important;
  color: #ffffff !important;
}

.btn-brand-primary span,
.btn-brand-primary * {
  color: #ffffff !important;
}

.btn-brand-primary svg {
  stroke: #ffffff !important;
  fill: none !important;
  color: #ffffff !important;
}

.btn-brand-primary:hover {
  background: #850636 !important;
  border-color: #850636 !important;
  color: #ffffff !important;
}

.btn-brand-primary:hover span,
.btn-brand-primary:hover * {
  color: #ffffff !important;
}

.btn-brand-primary:hover svg {
  stroke: #ffffff !important;
}

.table-action-btn.btn-pending {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
  color: #d97706;
  font-weight: 600;
  cursor: default;
}

.table-action-btn.btn-verified {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.2);
  color: #10b981;
  font-weight: 600;
  cursor: default;
}

.table-action-btn.btn-verified:hover {
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
  transform: none;
  box-shadow: none;
}

#regAuditNote::placeholder {
  color: #94a3b8 !important;
  opacity: 0.85;
}

/* =========================================================================
   TOP ACTION DROPDOWN BUTTONS (Clean Light Button with Dark Text)
   ========================================================================= */

.btn-top-action,
.custom-dropdown-trigger {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0 12px !important;
  height: 32px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  font-family: Inter, sans-serif !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
  transition: all 0.15s ease !important;
}

.btn-top-action *,
.custom-dropdown-trigger * {
  color: #0f172a !important;
}

.btn-top-action svg,
.custom-dropdown-trigger svg,
.dropdown-chevron {
  stroke: #64748b !important;
  fill: none !important;
}

.btn-top-action:hover,
.custom-dropdown-trigger:hover,
.custom-dropdown.open .btn-top-action,
.custom-dropdown.open .custom-dropdown-trigger {
  background: #f8fafc !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

.btn-top-action:hover *,
.custom-dropdown-trigger:hover *,
.custom-dropdown.open .btn-top-action *,
.custom-dropdown.open .custom-dropdown-trigger * {
  color: var(--accent) !important;
}

.btn-top-action:hover svg,
.custom-dropdown-trigger:hover svg,
.custom-dropdown.open .btn-top-action svg,
.custom-dropdown.open .custom-dropdown-trigger svg {
  stroke: var(--accent) !important;
}

/* =========================================================================
   STRICT GLOBAL CONTRAST ENFORCEMENT: PURE WHITE (#FFFFFF) ON ALL SOLID BURGUNDY/ACCENT ELEMENTS
   ========================================================================= */

.subnav-btn.active,
.subnav-btn.active *,
.subnav-btn.active span,
.subnav-btn.active svg,
.roster-page-btn.active,
.roster-page-btn.active *,
.roster-page-btn.active span,
.filter-pill.active,
.filter-pill.active *,
.filter-pill.active span,
.btn-brand-primary,
.btn-brand-primary *,
.btn-brand-primary span,
.btn-brand-primary svg,
.table-action-btn.btn-regularize,
.table-action-btn.btn-regularize *,
.table-action-btn.btn-regularize span,
.table-action-btn.btn-regularize svg,
.btn-attn-primary,
.btn-attn-primary *,
.btn-attn-primary span,
.btn-attn-primary svg,
.btn-submit-leave,
.btn-submit-leave *,
.btn-submit-leave span,
.btn-date-preset.active,
.btn-date-preset.active *,
.btn-date-preset.active span,
.cal-day-cell.selected-solid,
.cal-day-cell.selected-solid * {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

.custom-dropdown-option.selected,
.custom-dropdown-option:hover {
  background: var(--accent) !important;
  color: #ffffff !important;
}
.custom-dropdown-option.selected *,
.custom-dropdown-option:hover * {
  color: #ffffff !important;
}

/* =========================================================================
   PROPRIETARY WFH PROFESSIONAL CARDS (COMPACT, MODERN, DREWHUB-INSPIRED)
   ========================================================================= */
.wfh-pro-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px -1px rgba(0, 0, 0, 0.03);
  position: relative;
}

.wfh-pro-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -2px rgba(0, 0, 0, 0.07);
  border-color: rgba(162, 9, 67, 0.3);
}

/* Professional SaaS Table Styling matching Kirridesk / Flows */
.wfh-saas-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.wfh-saas-table thead tr {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.wfh-saas-table thead th {
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.wfh-saas-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s ease;
}

.wfh-saas-table tbody tr:hover {
  background: rgba(162, 9, 67, 0.02) !important;
}

.wfh-saas-table tbody tr:last-child {
  border-bottom: none;
}

.wfh-saas-table tbody td {
  padding: 12px 16px;
  vertical-align: middle;
}

.wfh-saas-table td .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.2;
}





