:root,
[data-theme="dark"] {
  --bg-primary: #08121f;
  --bg-secondary: #0f1f32;
  --surface: #142840;
  --surface-elevated: #19314e;
  --brand-primary: #0b1829;
  --brand-gold: #b08a61;
  --brand-gold-hover: #8a6846;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #38bdf8;
  --sidebar-bg: #0b1829;
  --sidebar-active-bg: rgba(176, 138, 97, 0.18);
  --sidebar-text: #bccbdf;
  --sidebar-muted: #8aa0bd;
  --card-bg: #142840;
  --input-bg: #0f1f32;
  --input-border: rgba(173, 216, 255, 0.15);
  --table-header-bg: rgba(15, 23, 42, 0.9);
  --table-row-bg: rgba(148, 163, 184, 0.04);
  --shadow: 0 8px 26px rgba(0, 0, 0, 0.16);
  --bg-card: var(--card-bg);
  --bg-card-hover: var(--surface-elevated);
  --bg-sidebar: var(--sidebar-bg);
  --accent: var(--brand-gold);
  --accent-light: #d1b184;
  --accent-dark: var(--brand-gold-hover);
  --accent-glow: rgba(176, 138, 97, 0.18);
  --blue: var(--info);
  --green: var(--success);
  --red: var(--danger);
  --purple: #a78bfa;
  --cyan: #06b6d4;
  --text-primary: #e7eef9;
  --text-secondary: #bccbdf;
  --text-muted: #8aa0bd;
  --border: rgba(173, 216, 255, 0.15);
  --border-accent: rgba(176, 138, 97, 0.48);
  --body-bg:
    radial-gradient(circle at 15% 12%, rgba(56, 189, 248, 0.14), transparent 30%),
    radial-gradient(circle at 86% 85%, rgba(176, 138, 97, 0.16), transparent 34%),
    linear-gradient(155deg, #07111d 0%, #0b1b2f 44%, #112841 100%);
  --link: #8bc8ff;
  --link-hover: #b7ddff;
  --focus-ring: rgba(176, 138, 97, 0.18);
  --sidebar-border: rgba(173, 216, 255, 0.15);
  --topbar-bg: rgba(10, 22, 37, 0.84);
  --card-shadow: var(--shadow);
  --row-hover: rgba(34, 197, 94, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-width: 232px;
  --sidebar-collapsed-width: 76px;
  --transition: all 0.22s ease;
}

[data-theme="light"] {
  --bg-primary: #F6F8FB;
  --bg-secondary: #EEF2F7;
  --surface: #FFFFFF;
  --surface-elevated: #FFFFFF;
  --card-bg: #FFFFFF;
  --border: #E2E8F0;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --brand-primary: #0F172A;
  --brand-gold: #B88A55;
  --brand-gold-hover: #A87843;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #0EA5E9;
  --sidebar-bg: #0B1624;
  --sidebar-surface: #111827;
  --sidebar-active-bg: rgba(184, 138, 85, 0.22);
  --sidebar-active-border: #B88A55;
  --sidebar-text: #CBD5E1;
  --sidebar-muted: #94A3B8;
  --sidebar-text-muted: var(--sidebar-muted);
  --input-bg: #FFFFFF;
  --input-border: #CBD5E1;
  --table-header-bg: #F1F5F9;
  --table-row-bg: #FFFFFF;
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  --bg-card: var(--card-bg);
  --bg-card-hover: #F8FAFC;
  --bg-sidebar: var(--sidebar-bg);
  --accent: var(--brand-gold);
  --accent-light: #D8B98B;
  --accent-dark: var(--brand-gold-hover);
  --accent-glow: rgba(184, 138, 85, 0.14);
  --blue: var(--info);
  --green: var(--success);
  --red: var(--danger);
  --purple: #7C3AED;
  --cyan: #0891B2;
  --border-accent: rgba(184, 138, 85, 0.44);
  --body-bg: linear-gradient(180deg, var(--bg-primary), var(--bg-secondary));
  --link: #0369A1;
  --link-hover: #075985;
  --focus-ring: rgba(184, 138, 85, 0.2);
  --sidebar-border: rgba(148, 163, 184, 0.18);
  --topbar-bg: rgba(255, 255, 255, 0.94);
  --card-shadow: var(--shadow);
  --row-hover: rgba(14, 165, 233, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-primary);
  background: var(--body-bg);
}

html[data-theme="dark"],
html[data-theme="dark"] body {
  color-scheme: dark;
}

html[data-theme="light"],
html[data-theme="light"] body {
  color-scheme: light;
}

a {
  color: var(--link);
}

a:hover {
  color: var(--link-hover);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

::-webkit-scrollbar-thumb {
  background: rgba(142, 164, 195, 0.45);
  border-radius: 999px;
}

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, rgba(11, 24, 41, 0.98), rgba(11, 24, 41, 0.9));
  border-left: 1px solid var(--sidebar-border);
  overflow-y: auto;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.sidebar-collapse-toggle {
  margin-right: auto;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--sidebar-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--sidebar-text);
  padding: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}

.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #130c05;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
  box-shadow: 0 8px 20px rgba(176, 138, 97, 0.28);
}

.logo-icon--image {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(209, 177, 132, 0.34);
  box-shadow: 0 8px 20px rgba(176, 138, 97, 0.24);
  overflow: hidden;
}

.logo-icon--image img {
  width: 92%;
  height: 92%;
  object-fit: contain;
  display: block;
}

.logo-title {
  font-size: 15px;
  font-weight: 700;
}

.logo-sub {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.sidebar-section {
  padding: 14px 10px 2px;
}

.sidebar-section-label {
  margin: 0 8px 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--sidebar-muted);
  letter-spacing: 1.2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
  margin-bottom: 4px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid transparent;
  transition: var(--transition);
  position: relative;
}

.nav-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: rgba(173, 216, 255, 0.15);
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  border-color: var(--border-accent);
  color: #ead8bd;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 15%;
  width: 3px;
  height: 70%;
  border-radius: 4px;
  background: var(--accent);
}

.nav-badge {
  margin-right: auto;
  min-width: 20px;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 7px;
  color: #111827;
  background: var(--accent);
}

.nav-group {
  margin-bottom: 4px;
}

.nav-group summary {
  list-style: none;
  cursor: pointer;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group-summary::after {
  content: "\f107";
  margin-right: auto;
  color: var(--sidebar-muted);
  font-family: "Font Awesome 6 Free";
  font-size: 11px;
  font-weight: 900;
  transition: transform 0.18s ease;
}

.nav-group[open] .nav-group-summary::after {
  transform: rotate(180deg);
}

.nav-submenu {
  display: grid;
  gap: 2px;
  margin: 2px 16px 8px 0;
  padding-right: 8px;
  border-right: 1px solid rgba(173, 216, 255, 0.12);
}

.nav-subitem {
  margin-bottom: 0;
  padding-block: 8px;
  font-size: 12.5px;
}

.nav-badge.blue {
  background: var(--blue);
  color: #04253c;
}

.nav-badge.green {
  background: var(--green);
  color: #042411;
}

.nav-badge.red {
  background: var(--red);
  color: #fff;
}

.nav-badge.new {
  color: #fff;
  background: linear-gradient(135deg, #a78bfa, #06b6d4);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 12px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  padding: 10px;
  transition: var(--transition);
}

.user-profile:hover {
  background: rgba(255, 255, 255, 0.05);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border: 2px solid rgba(176, 138, 97, 0.42);
}

.user-name {
  font-size: 13px;
  font-weight: 600;
}

.user-role {
  font-size: 11px;
  color: var(--sidebar-muted);
}

.sidebar-logout {
  color: var(--text-muted);
  font-size: 12px;
}

.main {
  margin-right: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

html.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
  overflow-x: visible;
}

html.sidebar-collapsed .main {
  margin-right: var(--sidebar-collapsed-width);
  width: calc(100% - var(--sidebar-collapsed-width));
}

html.sidebar-collapsed .logo {
  justify-content: center;
  padding-inline: 10px;
}

html.sidebar-collapsed .logo-text,
html.sidebar-collapsed .sidebar-section-label,
html.sidebar-collapsed .nav-text,
html.sidebar-collapsed .user-info,
html.sidebar-collapsed .sidebar-footer a,
html.sidebar-collapsed .nav-badge,
html.sidebar-collapsed .nav-group-summary::after {
  display: none;
}

html.sidebar-collapsed .sidebar-collapse-toggle i {
  transform: rotate(180deg);
}

html.sidebar-collapsed .sidebar-section {
  padding-inline: 8px;
}

html.sidebar-collapsed .nav-item {
  justify-content: center;
  gap: 0;
  padding: 11px 8px;
}

html.sidebar-collapsed .nav-submenu {
  margin: 2px 0 8px;
  padding: 0;
  border-right: 0;
}

html.sidebar-collapsed .nav-item[data-title]:hover::after,
html.sidebar-collapsed .nav-group-summary[data-title]:hover::after {
  content: attr(data-title);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  z-index: 120;
  min-width: max-content;
  max-width: 220px;
  transform: translateY(-50%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(8, 18, 31, 0.96);
  color: var(--text-primary);
  padding: 6px 9px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
  display: block;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 68px;
  padding: 10px 24px;
  background: rgba(10, 22, 37, 0.84);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
}

.mobile-sidebar-toggle {
  display: none;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(173, 216, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-primary) !important;
  padding: 0 !important;
}

.content {
  flex: 1;
  padding: 20px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.page {
  animation: pageIn 0.26s ease;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.dashboard-stack {
  display: grid;
  gap: 10px;
}

.dashboard-period-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(173, 216, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(8, 18, 31, 0.28);
}

.dashboard-period-title {
  font-size: 13px;
  font-weight: 700;
}

.dashboard-period-range {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11.5px;
}

.period-filter {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.period-filter-link {
  border: 1px solid rgba(173, 216, 255, 0.16);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--sidebar-text);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.period-filter-link.active {
  border-color: rgba(176, 138, 97, 0.46);
  background: rgba(176, 138, 97, 0.16);
  color: #ead8bd;
}

.dashboard-stats-main {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 0;
}

.dashboard-stats-secondary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 0;
}

.stat-card,
.card,
.summary-card,
.emp-card,
.task-col,
.payroll-summary,
.wps-card,
.biometric-card {
  border: 1px solid rgba(173, 216, 255, 0.12);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20, 40, 64, 0.9), rgba(20, 40, 64, 0.78));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
  color: var(--text-primary);
}

.card,
.summary-card,
.stat-card {
  padding: 13px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}

.stat-card {
  min-height: 98px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "icon value"
    "icon label";
  align-items: center;
  column-gap: 12px;
}

.stat-card--primary {
  min-height: 104px;
}

.stat-card--compact {
  min-height: 78px;
  padding: 10px;
  opacity: 0.92;
}

.stat-card--compact .stat-value {
  font-size: 21px;
}

.stat-card--compact .stat-label {
  font-size: 11.5px;
}

.stat-card--amber {
  border-color: rgba(176, 138, 97, 0.32);
}

.stat-card--green {
  border-color: rgba(34, 197, 94, 0.26);
}

.stat-card--red {
  border-color: rgba(239, 68, 68, 0.25);
}

.stat-card--blue {
  border-color: rgba(56, 189, 248, 0.25);
}

.stat-icon {
  grid-area: icon;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 17px;
}

.stat-icon.amber {
  color: #ead8bd;
  background: rgba(176, 138, 97, 0.16);
}

.stat-icon.green {
  color: #86efac;
  background: rgba(34, 197, 94, 0.14);
}

.stat-icon.red {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.14);
}

.stat-icon.blue {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.14);
}

.stat-icon.purple {
  color: #d8b4fe;
  background: rgba(167, 139, 250, 0.14);
}

.stat-icon.cyan {
  color: #67e8f9;
  background: rgba(6, 182, 212, 0.14);
}

.stat-value {
  grid-area: value;
  font-size: 25px;
  font-weight: 800;
  line-height: 1.1;
}

.stat-label {
  grid-area: label;
  color: var(--text-muted);
  font-size: 12.5px;
}

.dashboard-quick-row {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(280px, 0.86fr);
  gap: 10px;
  align-items: stretch;
}

.dashboard-quick-card {
  min-height: 0;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
}

.dashboard-period-summary {
  min-height: 0;
}

.period-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.period-summary-grid div {
  min-height: 48px;
  display: grid;
  align-content: center;
  gap: 2px;
  border: 1px solid rgba(173, 216, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: rgba(8, 18, 31, 0.32);
}

.period-summary-grid span {
  color: var(--text-muted);
  font-size: 11.5px;
}

.period-summary-grid strong {
  font-size: 18px;
}

.quick-action {
  min-height: 40px;
  justify-content: center;
  gap: 7px;
  padding: 8px 10px !important;
  font-size: 12.5px !important;
  line-height: 1.25;
}

.quick-action--secondary,
.btn-outline {
  border-color: rgba(173, 216, 255, 0.22) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--text-secondary) !important;
}

.quick-action--outline {
  border-color: rgba(176, 138, 97, 0.38) !important;
  background: transparent !important;
  color: #ead8bd !important;
}

.dashboard-tables {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-table-card--wide {
  grid-column: 1 / -1;
}

.empty-state {
  min-height: 126px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed rgba(173, 216, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(8, 18, 31, 0.32);
  color: var(--text-muted);
  text-align: center;
}

.empty-state i {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.dashboard-error-title {
  margin: 0 0 8px;
}

.dashboard-error-message {
  margin: 0 0 14px;
}

.mono-cell {
  font-family: "JetBrains Mono", Consolas, monospace;
}

.grid-2,
.grid-3,
.grid-70-30,
.summary-grid,
.form-grid,
.task-board {
  gap: 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 16px;
}

.grid-70-30 {
  display: grid;
  grid-template-columns: 1fr 340px;
  margin-bottom: 16px;
}

.attendance-page {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.attendance-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  min-width: 0;
}

.attendance-hero h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.attendance-hero .muted {
  margin: 5px 0 0;
}

.attendance-eyebrow {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.attendance-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 520px;
}

.attendance-primary-action,
.attendance-secondary-action,
.attendance-ghost-action {
  min-height: 38px;
  white-space: nowrap;
}

.attendance-primary-action {
  background: var(--green) !important;
  border-color: rgba(34, 197, 94, 0.45) !important;
  color: #052e16 !important;
}

.attendance-secondary-action,
.attendance-ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid rgba(173, 216, 255, 0.18);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-primary);
  padding: 8px 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.summary-grid.attendance-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(128px, 1fr));
  gap: 8px;
  margin-bottom: 0;
}

.summary-card.attendance-summary-card {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  overflow: hidden;
}

.attendance-summary-card i {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: #fff;
  background: rgba(148, 163, 184, 0.28);
}

.attendance-card-present i {
  background: rgba(34, 197, 94, 0.8);
}

.attendance-card-late i {
  background: rgba(245, 158, 11, 0.82);
}

.attendance-card-absent i {
  background: rgba(239, 68, 68, 0.82);
}

.attendance-card-total i {
  background: rgba(59, 130, 246, 0.82);
}

.attendance-card-neutral i {
  background: rgba(100, 116, 139, 0.88);
}

.attendance-summary-card .summary-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  margin: 3px 0;
}

.attendance-summary-card .summary-label {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}

.attendance-summary-card .summary-note {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
}

.attendance-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 280px);
  align-items: start;
  gap: 12px;
  min-width: 0;
}

.attendance-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.attendance-section-head h3 {
  margin: 0;
  font-size: 15px;
}

.attendance-section-head p {
  margin: 3px 0 0;
  font-size: 11.5px;
}

.attendance-table-card {
  min-width: 0;
  padding: 12px;
}

.attendance-filter-card {
  margin-bottom: 10px;
  padding: 10px;
}

.attendance-filter-card .hr-filter-toolbar {
  align-items: end;
}

.attendance-filter-result-row {
  display: flex;
  align-items: end;
  padding-bottom: 7px;
  flex: 0 0 auto;
  order: 4;
}

.attendance-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 0.8fr) minmax(150px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  min-width: 0;
}

.attendance-filters label,
.attendance-tool-form label {
  margin: 0;
}

.attendance-filters span,
.attendance-tool-form span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.attendance-table-wrap {
  border-radius: var(--radius-sm);
  max-width: 100%;
}

.table-wrap .attendance-table {
  min-width: 900px;
  table-layout: fixed;
}

.attendance-table th,
.attendance-table td {
  padding: 7px 9px;
  vertical-align: middle;
  white-space: nowrap;
  word-break: normal;
}

.attendance-table td {
  font-size: 12.5px;
}

.attendance-employee-col {
  width: 180px;
}

.attendance-time-col {
  width: 86px;
}

.attendance-table th:nth-child(2),
.attendance-table td:nth-child(2) {
  width: 112px;
}

.attendance-table th:nth-child(5),
.attendance-table td:nth-child(5) {
  width: 132px;
}

.attendance-table th:nth-child(6),
.attendance-table td:nth-child(6),
.attendance-table th:nth-child(7),
.attendance-table td:nth-child(7) {
  width: 150px;
}

.attendance-table th:nth-child(8),
.attendance-table td:nth-child(8) {
  width: 104px;
}

.attendance-employee-cell,
.attendance-truncate,
.attendance-source-cell {
  overflow: hidden;
  text-overflow: ellipsis;
}

.attendance-row-actions {
  width: 90px;
  white-space: nowrap;
  text-align: center;
}

.attendance-auto-row td {
  background: rgba(239, 68, 68, 0.08) !important;
  opacity: 0.78;
}

.attendance-empty-row {
  padding: 24px !important;
  text-align: center;
}

.attendance-tools-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  min-width: 0;
}

.attendance-tool-form {
  display: grid;
  gap: 10px;
  margin: 0;
}

.attendance-tool-note {
  margin: 0;
  padding: 9px 10px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.08);
  color: #fde68a;
  font-size: 12px;
  line-height: 1.55;
}

.attendance-tool-form input,
.attendance-tool-form button {
  width: 100%;
}

.leaves-page {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.leaves-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  min-width: 0;
}

.leaves-hero h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.leaves-hero .muted {
  margin: 5px 0 0;
}

.leaves-eyebrow {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.leaves-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.leaves-primary-action,
.leaves-secondary-action,
.leaves-filter-submit {
  min-height: 38px;
  white-space: nowrap;
}

.leaves-primary-action {
  background: var(--green) !important;
  border-color: rgba(34, 197, 94, 0.45) !important;
  color: #052e16 !important;
}

.leaves-secondary-action,
.leaves-filter-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid rgba(173, 216, 255, 0.18);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-primary);
  padding: 8px 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.leaves-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.leaves-summary-card {
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  overflow: hidden;
}

.leaves-summary-card i {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: #fff;
  background: rgba(59, 130, 246, 0.82);
}

.leaves-card-pending i {
  background: rgba(245, 158, 11, 0.82);
}

.leaves-card-approved i {
  background: rgba(34, 197, 94, 0.8);
}

.leaves-card-rejected i {
  background: rgba(239, 68, 68, 0.82);
}

.leaves-summary-card .summary-value {
  margin: 3px 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.leaves-summary-card .summary-label {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}

.leaves-summary-card .summary-note {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
}

.leaves-filter-card,
.leaves-table-card {
  min-width: 0;
  padding: 14px;
}

.leaves-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.leaves-section-head h3 {
  margin: 0;
  font-size: 15px;
}

.leaves-section-head p {
  margin: 3px 0 0;
  font-size: 11.5px;
}

.leaves-filter-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(110px, 0.75fr) minmax(120px, 0.8fr) minmax(132px, 0.85fr) minmax(132px, 0.85fr) minmax(110px, 0.75fr) minmax(98px, 0.65fr) minmax(92px, 0.55fr) auto;
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.leaves-filter-grid label {
  margin: 0;
}

.leaves-filter-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.leaves-bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid rgba(173, 216, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(8, 18, 31, 0.32);
}

.leaves-bulk-bar select {
  width: min(260px, 100%);
}

.leaves-bulk-bar .muted {
  font-size: 12px;
}

.leaves-table-wrap {
  max-width: 100%;
  border-radius: var(--radius-sm);
}

.leaves-table {
  min-width: 1120px;
  table-layout: fixed;
}

.leaves-table th,
.leaves-table td {
  padding: 8px 10px;
  vertical-align: middle;
  white-space: nowrap;
  word-break: normal;
}

.leaves-table td {
  font-size: 12.5px;
}

.leaves-check-col {
  width: 54px;
}

.leaves-table th:nth-child(2),
.leaves-table td:nth-child(2) {
  width: 180px;
}

.leaves-table th:nth-child(3),
.leaves-table td:nth-child(3) {
  width: 120px;
}

.leaves-table th:nth-child(4),
.leaves-table td:nth-child(4) {
  width: 160px;
}

.leaves-table th:nth-child(5),
.leaves-table td:nth-child(5) {
  width: 72px;
  text-align: center;
}

.leaves-table th:nth-last-child(1),
.leaves-table td:nth-last-child(1) {
  width: 230px;
}

.leaves-employee-cell,
.leaves-reason-cell {
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaves-date-range {
  display: grid;
  gap: 2px;
}

.leaves-date-range span:last-child {
  color: var(--text-muted);
  font-size: 11.5px;
}

.leaves-row-action {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto;
  gap: 7px;
  margin: 0;
}

.leaves-row-action select {
  min-width: 0;
}

.leaves-row-action button {
  min-width: 70px;
}

.leaves-empty-row {
  padding: 24px !important;
  text-align: center;
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
  background: rgba(8, 18, 31, 0.44);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  background: transparent;
}

th,
td {
  padding: 11px 12px;
  text-align: right;
  white-space: normal;
  word-break: break-word;
  border-bottom: 1px solid rgba(173, 216, 255, 0.1);
}

th {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  background: rgba(8, 18, 31, 0.65);
  position: sticky;
  top: 0;
}

td {
  color: #d3def0;
  font-size: 13px;
}

.grid-2 .table-wrap table {
  min-width: 0;
}

.grid-2 .table-wrap th,
.grid-2 .table-wrap td {
  padding: 10px;
  font-size: 12.5px;
}

tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.015);
}

tr:hover td {
  background: rgba(176, 138, 97, 0.1);
}

label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
}

input,
select,
textarea,
.form-control,
.chat-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(8, 18, 31, 0.62);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 10px 12px;
  transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.chat-input:focus,
.topbar-search:focus-within {
  outline: none;
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px rgba(176, 138, 97, 0.18);
}

button,
.btn,
input[type="submit"],
input[type="button"] {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #140f08;
  font-weight: 700;
  font-family: inherit;
  padding: 9px 14px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

button:hover,
.btn:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
}

.btn-warn {
  background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
  color: #271507;
}

.flash {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  border: 1px solid transparent;
}

.flash.success {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.35);
  color: #bbf7d0;
}

.flash.error {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fecaca;
}

.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border: 1px solid transparent;
}

.status-pill.success,
.badge-green {
  color: #86efac;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.35);
}

.status-pill.warn,
.badge-amber {
  color: #ead8bd;
  background: rgba(176, 138, 97, 0.16);
  border-color: rgba(176, 138, 97, 0.38);
}

.status-pill.danger,
.badge-red {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
}

.status-pill.info,
.badge-blue {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.35);
}

.status-pill.neutral {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.35);
}

.badge-purple {
  color: #d8b4fe;
  background: rgba(167, 139, 250, 0.14);
  border-color: rgba(167, 139, 250, 0.35);
}

.badge-gray {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.35);
}

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(8, 18, 31, 0.52);
  border: 1px solid var(--border);
}

.tab-btn {
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 12px;
}

.tab-btn.active {
  border-color: var(--border-accent);
  background: rgba(176, 138, 97, 0.14);
  color: #ead8bd;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 18, 31, 0.62);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  width: 290px;
}

.topbar-search input {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0 1000px rgba(8, 18, 31, 0.95) inset;
  transition: background-color 9999s ease-in-out 0s;
}

.card *,
.summary-card *,
.stat-card * {
  color: inherit;
}

.topbar-search i {
  color: var(--text-muted);
  font-size: 13px;
}

.muted {
  color: var(--text-muted);
}

.hr-filter-card {
  margin-bottom: 14px;
  padding: 12px;
  min-width: 0;
}

.hr-filter-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  list-style: none;
  cursor: default;
}

.hr-filter-result {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.hr-filter-toolbar {
  display: flex;
  align-items: end;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.hr-filter-group {
  flex: 0 1 128px;
  min-width: 96px;
  margin: 0;
}

.hr-filter-group span,
.hr-filter-group label {
  display: block;
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.hr-filter-search {
  flex: 1 1 260px;
  min-width: 190px;
}

.hr-filter-wide {
  flex-basis: 170px;
}

.hr-filter-compact {
  flex-basis: 92px;
  min-width: 78px;
}

.hr-filter-group input,
.hr-filter-group select,
.hr-filter-select {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  font-size: 12px;
}

.hr-filter-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
  margin-inline-start: auto;
  min-width: max-content;
}

.hr-filter-actions form {
  margin: 0;
}

.hr-bulk-toolbar-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(300px, 1.15fr) minmax(240px, 0.85fr);
  gap: 10px;
  margin-bottom: 16px;
  min-width: 0;
}

.hr-bulk-toolbar-row .hr-filter-card {
  margin-bottom: 0;
}

.hr-bulk-shift-card .hr-filter-toolbar {
  grid-template-columns: minmax(150px, 1fr) auto;
}

.hr-wizard-card {
  margin-bottom: 14px;
  min-width: 0;
}

.hr-wizard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.hr-wizard-title {
  display: grid;
  gap: 3px;
}

.hr-wizard-title h3 {
  margin: 0;
  font-size: 15px;
}

.hr-wizard-title p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.hr-wizard-steps {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(173, 216, 255, 0.13);
  border-radius: 10px;
  background: rgba(8, 18, 31, 0.32);
}

.hr-wizard-step {
  min-height: 32px;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.hr-wizard-step.active {
  border-color: var(--border-accent);
  background: rgba(176, 138, 97, 0.16);
  color: #ead8bd;
}

.hr-wizard-panel[hidden] {
  display: none;
}

.hr-wizard-panel {
  min-width: 0;
}

.hr-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 8, 23, 0.68);
}

.hr-modal-backdrop[hidden] {
  display: none;
}

.hr-modal {
  width: min(720px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 31, 50, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.hr-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.hr-modal-head h3 {
  margin: 0;
  font-size: 15px;
}

.hr-modal-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(173, 216, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.hr-modal-body {
  padding: 14px;
}

.hr-btn-apply,
.hr-btn-reset,
.hr-btn-export {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.hr-btn-apply {
  background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
  border-color: var(--border-accent);
  color: #160f07;
}

.hr-btn-reset {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(173, 216, 255, 0.14);
  color: var(--text-secondary);
}

.hr-btn-export {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.16);
  color: #bde9ff;
}

@media (max-width: 1160px) {
  .grid-2,
  .grid-3,
  .grid-70-30,
  .task-board,
  .chat-layout,
  .payroll-breakdown {
    grid-template-columns: 1fr;
  }

  .attendance-workspace {
    grid-template-columns: 1fr;
  }

  .attendance-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .leaves-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hr-filter-toolbar {
    flex-wrap: wrap;
  }

  .hr-filter-search {
    flex-basis: 100%;
  }

  .hr-bulk-toolbar-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1240px) {
  .dashboard-stats-main,
  .dashboard-stats-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-tables {
    grid-template-columns: 1fr;
  }

  .dashboard-table-card--wide {
    grid-column: auto;
  }
}

@media (max-width: 980px) {
  .attendance-hero,
  .attendance-section-head,
  .leaves-hero,
  .leaves-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .attendance-actions,
  .leaves-hero-actions {
    justify-content: flex-start;
  }

  .attendance-filters {
    grid-template-columns: 1fr 1fr;
  }

  .attendance-filters .attendance-ghost-action {
    width: 100%;
  }

  .hr-filter-group {
    flex: 1 1 150px;
  }

  .hr-filter-actions {
    flex: 1 1 100%;
    justify-content: flex-start;
    margin-inline-start: 0;
  }

  .hr-wizard-head {
    align-items: stretch;
    flex-direction: column;
  }

  .hr-wizard-steps {
    width: 100%;
  }

  .hr-wizard-step {
    flex: 1 1 0;
  }

  .dashboard-quick-row {
    grid-template-columns: 1fr;
  }

  .dashboard-period-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  html.sidebar-collapsed .sidebar {
    width: 100%;
  }

  html.sidebar-collapsed .main {
    margin-right: 0;
    width: 100%;
  }

  html.sidebar-collapsed .logo-text,
  html.sidebar-collapsed .sidebar-section-label,
  html.sidebar-collapsed .nav-text,
  html.sidebar-collapsed .user-info,
  html.sidebar-collapsed .sidebar-footer a,
  html.sidebar-collapsed .nav-badge {
    display: initial;
  }

  html.sidebar-collapsed .nav-item {
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 12px;
  }

  html.sidebar-collapsed .nav-item[data-title]:hover::after,
  html.sidebar-collapsed .nav-group-summary[data-title]:hover::after,
  .sidebar-collapse-toggle {
    display: none;
  }

  .sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: min(84vw, 300px);
    height: 100vh;
    border-left: 1px solid var(--border);
    border-bottom: 0;
    transform: translateX(105%);
    transition: transform 0.22s ease;
    box-shadow: -20px 0 40px rgba(0, 0, 0, 0.32);
  }

  html.sidebar-drawer-open .sidebar {
    transform: translateX(0);
  }

  html.sidebar-drawer-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(2, 8, 23, 0.55);
  }

  .mobile-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .main {
    margin-right: 0;
    width: 100%;
  }

  .topbar {
    flex-wrap: wrap;
    padding: 10px 14px;
  }

  .topbar .btn {
    width: 100%;
  }

  .content {
    padding: 14px;
  }

  table {
    min-width: 540px;
  }
}

@media (max-width: 640px) {
  .attendance-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .leaves-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .attendance-actions,
  .attendance-primary-action,
  .attendance-secondary-action,
  .attendance-ghost-action,
  .leaves-hero-actions,
  .leaves-primary-action,
  .leaves-secondary-action,
  .leaves-filter-submit {
    width: 100%;
  }

  .attendance-filters,
  .leaves-filter-grid {
    grid-template-columns: 1fr;
  }

  .hr-filter-card {
    padding: 10px;
  }

  .hr-filter-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .hr-filter-group,
  .hr-filter-search,
  .hr-filter-wide,
  .hr-filter-compact {
    min-width: 0;
    width: 100%;
  }

  .hr-filter-actions {
    display: grid;
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .hr-btn-apply,
  .hr-btn-reset,
  .hr-btn-export {
    width: 100%;
  }

  .attendance-summary-card {
    min-height: 72px;
  }

  .attendance-summary-card .summary-value {
    font-size: 19px;
  }

  .leaves-summary-card .summary-value {
    font-size: 19px;
  }

  .leaves-bulk-bar,
  .leaves-row-action {
    display: grid;
    grid-template-columns: 1fr;
  }

  .leaves-bulk-bar select,
  .leaves-bulk-bar button,
  .leaves-row-action button {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-stats-main,
  .dashboard-stats-secondary,
  .quick-actions-grid,
  .dashboard-tables {
    grid-template-columns: 1fr;
  }

  .card,
  .stat-card,
  .summary-card {
    padding: 12px;
  }

  .logo {
    padding: 14px;
  }

  .sidebar-section {
    padding: 10px 8px 2px;
  }
}

.theme-toggle {
  min-height: 34px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--card-shadow);
}

.theme-toggle i {
  color: var(--accent);
}

html.sidebar-collapsed .theme-toggle .theme-toggle-text {
  display: none;
}

[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(11, 24, 41, 0.98), rgba(11, 24, 41, 0.94));
}

[data-theme="light"] .logo-sub,
[data-theme="light"] .nav-group-summary::after,
[data-theme="light"] .user-role,
[data-theme="light"] .sidebar-logout {
  color: var(--sidebar-muted);
}

[data-theme="light"] .nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  border-color: rgba(226, 232, 240, 0.16);
}

[data-theme="light"] .main::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0));
}

[data-theme="light"] .topbar,
[data-theme="light"] .card,
[data-theme="light"] .summary-card,
[data-theme="light"] .emp-card,
[data-theme="light"] .hr-filter-card,
[data-theme="light"] .hr-modal,
[data-theme="light"] .tabs,
[data-theme="light"] .table-wrap {
  background-color: var(--surface);
  border-color: var(--border);
  box-shadow: var(--card-shadow);
}

[data-theme="light"] .topbar {
  background: var(--topbar-bg);
}

[data-theme="light"] .card,
[data-theme="light"] .summary-card,
[data-theme="light"] .emp-card {
  background-image: none;
}

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea,
[data-theme="light"] .hr-filter-group input,
[data-theme="light"] .hr-filter-group select,
[data-theme="light"] .hr-filter-search input {
  background: var(--input-bg);
  border-color: var(--input-border);
  color: var(--text-primary);
}

[data-theme="light"] table th {
  background: var(--table-header-bg);
  color: var(--text-primary);
}

[data-theme="light"] table tbody tr,
[data-theme="light"] table tbody tr:nth-child(odd) {
  background: var(--table-row-bg);
}

[data-theme="light"] table tbody tr:hover {
  background: var(--row-hover);
}

[data-theme="light"] tr td {
  border-bottom-color: var(--border);
}

[data-theme="light"] .flash.success,
[data-theme="light"] .status-pill.success,
[data-theme="light"] .hr-badge-success {
  color: #166534;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
}

[data-theme="light"] .flash.error,
[data-theme="light"] .status-pill.danger,
[data-theme="light"] .hr-badge-danger {
  color: #991b1b;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="light"] .status-pill.warn,
[data-theme="light"] .hr-badge-warning {
  color: #92400e;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.32);
}

[data-theme="light"] .status-pill.info,
[data-theme="light"] .hr-badge-info {
  color: #075985;
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.3);
}

[data-theme="light"] .hr-modal-backdrop {
  background: rgba(15, 23, 42, 0.38);
}

[data-theme="light"] select:-webkit-autofill,
[data-theme="light"] input:-webkit-autofill,
[data-theme="light"] textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset;
}

[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-surface));
  border-left-color: var(--sidebar-border);
}

[data-theme="light"] .logo-title,
[data-theme="light"] .user-name,
[data-theme="light"] .nav-item:hover,
[data-theme="light"] .nav-item.active {
  color: #F8FAFC;
}

[data-theme="light"] .logo-sub,
[data-theme="light"] .sidebar-section-label,
[data-theme="light"] .nav-group-summary::after,
[data-theme="light"] .user-role,
[data-theme="light"] .sidebar-logout {
  color: var(--sidebar-text-muted);
}

[data-theme="light"] .nav-item {
  color: var(--sidebar-text);
}

[data-theme="light"] .nav-item.active {
  background: var(--sidebar-active-bg);
  border-color: var(--sidebar-active-border);
}

[data-theme="light"] .sidebar-footer {
  border-top-color: var(--sidebar-border);
}

[data-theme="light"] .theme-toggle {
  min-height: 36px;
  padding: 8px 12px;
  gap: 8px;
  border-color: var(--border);
  background: #FFFFFF;
  color: var(--text-primary);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .theme-toggle i {
  color: #334155;
}

[data-theme="light"] .dashboard-period-bar,
[data-theme="light"] .stat-card,
[data-theme="light"] .summary-card,
[data-theme="light"] .card,
[data-theme="light"] .dashboard-period-summary,
[data-theme="light"] .dashboard-quick-card,
[data-theme="light"] .dashboard-table-card,
[data-theme="light"] .attendance-summary-card,
[data-theme="light"] .leaves-summary-card {
  background: #FFFFFF;
  background-image: none;
  border-color: var(--border);
  color: var(--text-primary);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .dashboard-period-title,
[data-theme="light"] .card-title,
[data-theme="light"] .stat-value,
[data-theme="light"] .summary-value,
[data-theme="light"] .attendance-summary-card .summary-value,
[data-theme="light"] .leaves-summary-card .summary-value,
[data-theme="light"] .period-summary-grid strong {
  color: #0F172A;
}

[data-theme="light"] .dashboard-period-range,
[data-theme="light"] .stat-label,
[data-theme="light"] .summary-label,
[data-theme="light"] .attendance-summary-card .summary-label,
[data-theme="light"] .leaves-summary-card .summary-label,
[data-theme="light"] .period-summary-grid span,
[data-theme="light"] .period-summary-grid div,
[data-theme="light"] .muted {
  color: #475569;
}

[data-theme="light"] .stat-card--compact {
  opacity: 1;
}

[data-theme="light"] .stat-card--amber,
[data-theme="light"] .stat-card--green,
[data-theme="light"] .stat-card--red,
[data-theme="light"] .stat-card--blue {
  border-color: var(--border);
}

[data-theme="light"] .stat-icon,
[data-theme="light"] .attendance-summary-card i,
[data-theme="light"] .leaves-summary-card i {
  color: #0284C7;
  background: #E0F2FE;
}

[data-theme="light"] .stat-icon.green,
[data-theme="light"] .attendance-card-present i,
[data-theme="light"] .leaves-card-approved i {
  color: #16A34A;
  background: #DCFCE7;
}

[data-theme="light"] .stat-icon.red,
[data-theme="light"] .attendance-card-absent i,
[data-theme="light"] .leaves-card-rejected i {
  color: #DC2626;
  background: #FEE2E2;
}

[data-theme="light"] .stat-icon.amber,
[data-theme="light"] .attendance-card-late i,
[data-theme="light"] .leaves-card-pending i {
  color: #D97706;
  background: #FEF3C7;
}

[data-theme="light"] .stat-icon.blue,
[data-theme="light"] .stat-icon.cyan,
[data-theme="light"] .attendance-card-overtime i,
[data-theme="light"] .attendance-card-early i {
  color: #0284C7;
  background: #E0F2FE;
}

[data-theme="light"] .stat-icon.purple {
  color: #7C3AED;
  background: #EDE9FE;
}

[data-theme="light"] .period-filter-link {
  background: #FFFFFF;
  border-color: #CBD5E1;
  color: #334155;
}

[data-theme="light"] .period-filter-link:hover {
  border-color: var(--brand-gold);
  color: #0F172A;
}

[data-theme="light"] .period-filter-link.active {
  background: rgba(184, 138, 85, 0.14);
  border-color: var(--brand-gold);
  color: #7C4A1F;
}

[data-theme="light"] .period-summary-grid div {
  background: #F8FAFC;
  border-color: #E2E8F0;
}

[data-theme="light"] .quick-action--primary {
  background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-hover));
  border-color: var(--brand-gold-hover);
  color: #111827;
}

[data-theme="light"] .quick-action--secondary,
[data-theme="light"] .quick-action--outline,
[data-theme="light"] .btn-outline {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  color: #334155 !important;
}

[data-theme="light"] .quick-action--secondary:hover,
[data-theme="light"] .quick-action--outline:hover,
[data-theme="light"] .btn-outline:hover {
  border-color: var(--brand-gold) !important;
  color: #0F172A !important;
  background: #F8FAFC !important;
}

[data-theme="light"] .table-wrap {
  background: #FFFFFF;
  border-color: var(--border);
}

[data-theme="light"] th {
  background: var(--table-header-bg);
  color: #475569;
  border-bottom-color: var(--border);
}

[data-theme="light"] td {
  color: #334155;
  border-bottom-color: var(--border);
}

[data-theme="light"] tr:nth-child(odd) td {
  background: #FFFFFF;
}

[data-theme="light"] tr:hover td {
  background: #F8FAFC;
}

[data-theme="light"] .empty-state {
  background: #F8FAFC;
  border-color: #E2E8F0;
  color: #475569;
}

[data-theme="light"] .empty-state i {
  background: #E0F2FE;
  color: #0284C7;
}
