:root {
  color-scheme: light;
  --brand-navy: #082a63;
  --brand-navy-deep: #061f4b;
  --brand-blue: #0868d7;
  --brand-blue-hover: #0758b8;
  --brand-blue-soft: #e7f1ff;
  --page-background: #eef3fa;
  --surface-background: #ffffff;
  --surface-border: #dce5f1;
  --text-primary: #102344;
  --text-muted: #60718a;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

:root.dark { color-scheme: dark; }
* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; margin: 0; }
body { overflow-x: hidden; background: #f8fafc; color: #0f172a; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; flex: 0 0 auto; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dark body { background: #0b1220; color: #e2e8f0; }
:focus-visible { outline: 3px solid #38bdf8; outline-offset: 3px; }

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at 50% 0, rgba(79, 70, 229, 0.1), transparent 58%), #f8fafc;
}
.dark .auth-page { background: radial-gradient(ellipse at 50% 0, rgba(99, 102, 241, 0.18), transparent 58%), #0b1220; }
.auth-layout { width: min(100%, 440px); }
.auth-card {
  padding: 28px 22px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}
.dark .auth-card, .dark .surface-card {
  border-color: #243248;
  background: #111c2f;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}
.brand-lockup {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: #0f172a;
  font-weight: 700;
  letter-spacing: -0.035em;
}
.dark .brand-lockup { color: #f8fafc; }
.brand-logo {
  display: block;
  width: 120px;
  height: 80px;
  object-fit: contain;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}
/* Transparent logo on dark surfaces: thin white outline keeps the navy lettering readable. */
.dark .brand-logo,
.app-sidebar .brand-logo,
.mobile-nav-dialog .brand-logo,
.login-brand-lockup .brand-logo {
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 4px rgba(255, 255, 255, 0.45));
}
.app-sidebar .brand-logo {
  width: 48px;
  height: 36px;
}
.eyebrow { color: #0876e8; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.dark .eyebrow { color: #7dd3fc; }
.form-field { display: grid; min-width: 0; gap: 7px; }
.form-field label { color: #334155; font-size: 14px; font-weight: 500; }
.dark .form-field label { color: #cbd5e1; }
.form-input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  color: #0f172a;
  font-size: 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.form-input::placeholder { color: #94a3b8; }
.form-input:focus { border-color: var(--brand-blue); outline: none; box-shadow: 0 0 0 3px rgba(8, 104, 215, 0.18); }
.dark .form-input { border-color: #475569; background: #0b1220; color: #f8fafc; }
.field-error { min-height: 0; color: #b91c1c; font-size: 13px; }
.field-hint { color: #64748b; font-size: 13px; }
.password-control { position: relative; }
.password-toggle {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 48px;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #0876e8;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.button:active { transform: translateY(1px); }
.button-primary { background: #0876e8; color: #fff; }
.button-primary:hover { background: #075ec7; }
.button-secondary { border-color: #cbd5e1; background: #fff; color: #334155; }
.button-secondary:hover { background: #f1f5f9; }
.dark .button-secondary { border-color: #475569; background: #172338; color: #e2e8f0; }
.button:disabled { cursor: not-allowed; opacity: 0.55; }
.message { border: 1px solid transparent; border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.message-error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.message-success { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.message-warning { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.message-info { border-color: #bae6fd; background: #f0f9ff; color: #075985; }
.dark .message-error { border-color: #7f1d1d; background: #351b24; color: #fecaca; }
.dark .message-success { border-color: #14532d; background: #132d25; color: #bbf7d0; }
.dark .message-warning { border-color: #78350f; background: #342817; color: #fde68a; }
.dark .message-info { border-color: #075985; background: #102b3b; color: #bae6fd; }

.app-page { min-height: 100vh; background: #f8fafc; }
.dark .app-page { background: #0b1220; }
.app-sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  width: 72px;
  flex-direction: column;
  border-right: 1px solid #e2e8f0;
  background: #fff;
  padding: 20px 12px max(16px, env(safe-area-inset-bottom));
}
.dark .app-sidebar { border-color: #243248; background: #111c2f; }
.app-sidebar .brand-lockup { justify-content: center; margin-bottom: 30px; }
.app-sidebar > nav { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.sidebar-account-copy, .app-sidebar .nav-link span { display: none; }
.nav-link {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: background-color 160ms ease, color 160ms ease;
}
.nav-link:hover, .nav-link[aria-current="page"] { background: #eaf6ff; color: #075ec7; }
.dark .nav-link { color: #cbd5e1; }
.dark .nav-link:hover, .dark .nav-link[aria-current="page"] { background: #0b61c9; color: #fff; }
.nav-link svg { width: 21px; height: 21px; }
.sidebar-bottom { display: grid; gap: 8px; margin-top: auto; }
.account-chip { display: flex; min-width: 0; align-items: center; justify-content: center; gap: 10px; padding: 8px 0; }
.avatar {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #b9dcff;
  border-radius: 50%;
  background: #eaf6ff;
  color: #075ec7;
  font-size: 14px;
  font-weight: 600;
}
.dark .avatar { border-color: #1687ef; background: #245184; color: #e0f2fe; }
.app-content { min-height: 100vh; min-width: 0; margin-left: 0; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.app-topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.94);
  padding: 0 16px;
  backdrop-filter: blur(14px);
}
.dark .app-topbar { border-color: #243248; background: rgba(17, 28, 47, 0.94); }
.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #475569;
  cursor: pointer;
}
.icon-button:hover { background: #f1f5f9; }
.dark .icon-button { color: #cbd5e1; }
.dark .icon-button:hover { background: #1e293b; }
.search-trigger {
  display: flex;
  width: min(100%, 420px);
  min-height: 44px;
  align-items: center;
  gap: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 0 10px;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
}
.search-trigger kbd { margin-left: auto; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; padding: 2px 6px; color: #64748b; font-family: inherit; font-size: 12px; }
.dark .search-trigger { border-color: #334155; background: #0b1220; color: #94a3b8; }
.dark .search-trigger kbd { border-color: #475569; background: #172338; }
.topbar-profile { min-height: 44px; align-items: center; gap: 8px; border-radius: 12px; padding: 2px 8px 2px 2px; }
.topbar-profile:hover { background: #f1f5f9; }
.page-main { width: min(100%, 1440px); min-width: 0; margin: 0 auto; padding: 24px 16px 40px; }
.breadcrumbs { display: flex; min-width: 0; align-items: center; gap: 8px; color: #64748b; font-size: 13px; }
.breadcrumbs a:hover { color: #0876e8; }
.page-heading { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 14px; margin: 22px 0 24px; }
.page-heading h1 { margin-top: 6px; color: #0f172a; font-size: clamp(24px, 4vw, 32px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.2; overflow-wrap: anywhere; }
.dark .page-heading h1 { color: #f8fafc; }
.page-heading p:not(.eyebrow) { margin-top: 8px; color: #64748b; font-size: 14px; }
.surface-card { min-width: 0; border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05); }
.dark .surface-card { color: #e2e8f0; }
.profile-details { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.profile-details > div { display: grid; min-width: 0; grid-template-columns: minmax(90px, 0.7fr) minmax(0, 1.3fr); gap: 12px; border-top: 1px solid #f1f5f9; padding: 13px 0; font-size: 14px; }
.dark .profile-details > div { border-color: #243248; }
.profile-details dt { color: #64748b; }
.profile-details dd { min-width: 0; margin: 0; color: #0f172a; font-weight: 500; }
.dark .profile-details dd { color: #e2e8f0; }

.status-badge { display: inline-flex; min-height: 28px; flex: 0 0 auto; align-items: center; gap: 7px; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-present, .status-approved { background: #dcfce7; color: #166534; }
.status-late, .status-pending { background: #fef3c7; color: #92400e; }
.status-absent, .status-rejected { background: #fee2e2; color: #991b1b; }
.status-leave { background: #dbeafe; color: #1e40af; }
.status-inactive, .status-cancelled { background: #e2e8f0; color: #334155; }
.dark .status-present, .dark .status-approved { background: #123626; color: #bbf7d0; }
.dark .status-late, .dark .status-pending { background: #3a2b11; color: #fde68a; }
.dark .status-absent, .dark .status-rejected { background: #3b2027; color: #fecaca; }
.dark .status-leave { background: #172c4c; color: #bfdbfe; }
.dark .status-inactive, .dark .status-cancelled { background: #293548; color: #cbd5e1; }

.mobile-tabbar {
  position: fixed;
  z-index: 15;
  inset: auto 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.96);
  padding: 5px 8px max(6px, env(safe-area-inset-bottom));
  backdrop-filter: blur(16px);
}
.dark .mobile-tabbar { border-color: #243248; background: rgba(17, 28, 47, 0.96); }
.mobile-tabbar a, .mobile-tabbar button {
  display: flex;
  min-width: 0;
  min-height: 54px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
.mobile-tabbar a[aria-current="page"] { color: #075ec7; }
.dark .mobile-tabbar a[aria-current="page"] { color: #7dd3fc; }
.mobile-tabbar svg { width: 20px; height: 20px; }
.mobile-tabbar form { min-width: 0; }

.mobile-nav-dialog, .search-dialog, .confirm-dialog { border: 0; padding: 0; color: inherit; }
.mobile-nav-dialog {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(88vw, 340px);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0 auto 0 0;
  border-right: 1px solid #e2e8f0;
  background: #fff;
}
.dark .mobile-nav-dialog { border-color: #243248; background: #111c2f; }
.mobile-nav-dialog::backdrop, .search-dialog::backdrop, .confirm-dialog::backdrop { background: rgba(15, 23, 42, 0.46); backdrop-filter: blur(2px); }
.mobile-nav-panel { display: flex; min-height: 100%; flex-direction: column; padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); }
.mobile-nav-panel .nav-link { justify-content: flex-start; padding: 0 12px; }
.search-dialog { width: min(640px, calc(100vw - 32px)); margin: 12vh auto auto; border-radius: 16px; background: #fff; box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18); }
.dark .search-dialog, .dark .confirm-dialog { background: #111c2f; }
.search-dialog-content { padding: 16px; }
.search-dialog input { width: 100%; min-width: 0; min-height: 44px; border: 0; outline: 0; background: transparent; color: #0f172a; font-size: 16px; }
.dark .search-dialog input { color: #f8fafc; }
.confirm-dialog { width: min(480px, calc(100vw - 32px)); margin: auto; border-radius: 16px; background: #fff; box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18); }
.confirm-dialog-content { padding: 22px; }

.empty-state { display: grid; justify-items: center; padding: 40px 18px; text-align: center; }
.empty-state-icon { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 16px; background: #eaf6ff; color: #0876e8; }
.empty-state h2 { margin-top: 16px; font-size: 18px; font-weight: 600; }
.empty-state p { max-width: 440px; margin-top: 7px; color: #64748b; font-size: 14px; }
.skeleton-stack { display: grid; gap: 12px; }
.skeleton-line { display: block; height: 14px; border-radius: 999px; background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%); background-size: 200% 100%; animation: skeleton-shimmer 1.5s ease-in-out infinite; }
.skeleton-line-wide { width: 80%; }
.skeleton-line-medium { width: 58%; }
.skeleton-line-short { width: 38%; }
.toast { border: 1px solid #cbd5e1; border-radius: 12px; background: #fff; padding: 12px 16px; box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08); font-size: 14px; }
.toast-success { border-color: #86efac; }
.toast-error { border-color: #fca5a5; }

@keyframes skeleton-shimmer { to { background-position: -200% 0; } }

@media (min-width: 640px) {
  .auth-card { padding: 36px; }
  .page-main { padding: 32px 28px 48px; }
  .page-heading { flex-direction: row; align-items: center; justify-content: space-between; }
  .profile-details { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
}
@media (min-width: 768px) {
  .app-content { margin-left: 72px; padding-bottom: 0; }
  .mobile-nav-dialog { display: none; }
  .app-sidebar .account-chip { padding: 8px 0; }
}
@media (min-width: 1024px) {
  .app-sidebar { width: 256px; padding: 20px 16px max(16px, env(safe-area-inset-bottom)); }
  .app-sidebar .brand-lockup { justify-content: flex-start; }
  .app-sidebar .brand-logo { width: 100px; height: 67px; }
  .sidebar-account-copy, .app-sidebar .nav-link span { display: block; }
  .app-sidebar .nav-link { justify-content: flex-start; padding: 0 12px; }
  .account-chip { justify-content: flex-start; }
  .app-content { margin-left: 256px; }
  .app-topbar { padding: 0 32px; }
  .page-main { padding: 36px 32px 56px; }
}
@media (max-width: 767px) {
  .search-trigger { width: 44px; justify-content: center; padding: 0; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .search-dialog { position: fixed; inset: auto 0 0; width: 100%; max-width: none; margin: auto 0 0; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .confirm-dialog { position: fixed; inset: auto 0 0; width: 100%; max-width: none; margin: auto 0 0; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

.module-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.module-card {
  display: flex;
  min-width: 0;
  min-height: 92px;
  align-items: center;
  gap: 14px;
  padding: 18px;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.module-card:hover {
  transform: translateY(-2px);
  border-color: #b9dcff;
  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.1);
}
.module-card-icon, .department-card-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: #e7f1ff;
  color: #075ec7;
}
.dark .module-card-icon, .dark .department-card-icon { background: #1e4677; color: #dcecff; }
.module-card-copy { display: grid; min-width: 0; gap: 4px; }
.module-card-copy strong { color: #0f172a; font-size: 15px; font-weight: 600; }
.module-card-copy span { color: #64748b; font-size: 14px; }
.dark .module-card-copy strong { color: #f8fafc; }
.module-card-arrow { margin-left: auto; color: #94a3b8; }
.records-toolbar {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 18px;
}
.records-toolbar > .form-input { width: min(100%, 340px); }
.records-toolbar .form-field { min-width: min(100%, 180px); }
.records-table-wrap { width: 100%; min-width: 0; overflow-x: auto; }
.records-table { width: 100%; border-collapse: collapse; text-align: left; }
.records-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.dark .records-table th { background: #172338; color: #cbd5e1; }
.records-table th, .records-table td { min-width: 0; border-bottom: 1px solid #e2e8f0; padding: 13px 12px; vertical-align: top; }
.dark .records-table th, .dark .records-table td { border-color: #243248; }
.records-table td { color: #334155; font-size: 14px; overflow-wrap: anywhere; }
.dark .records-table td { color: #cbd5e1; }
.record-primary-link { color: #075ec7; font-weight: 600; }
.record-primary-link:hover, .action-link:hover { text-decoration: underline; }
.record-status { display: inline-flex; border-radius: 999px; background: #eaf6ff; padding: 4px 9px; color: #075ec7; font-size: 13px; font-weight: 500; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; color: #64748b; font-size: 14px; }
.department-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.department-card { display: grid; min-width: 0; gap: 12px; border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; padding: 18px; transition: border-color 160ms ease, transform 160ms ease; }
.department-card:hover { transform: translateY(-2px); border-color: #a5b4fc; }
.dark .department-card { border-color: #243248; background: #111c2f; }
.department-card h2 { font-size: 17px; font-weight: 600; }
.department-card p { color: #64748b; font-size: 14px; overflow-wrap: anywhere; }
.department-card-stats { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid #e2e8f0; padding-top: 12px; color: #475569; font-size: 14px; }
.dark .department-card-stats { border-color: #243248; color: #cbd5e1; }
.department-card-stats span + span { margin-left: auto; }
.form-card { padding: 20px; }
.form-grid { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.form-field-wide { grid-column: 1 / -1; }
.form-textarea { min-height: 112px; resize: vertical; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.multi-select { min-height: 180px; }
.account-actions, .department-actions { display: grid; gap: 12px; margin-top: 20px; }
.inline-password-reset, .department-actions form { display: flex; min-width: 0; flex-wrap: wrap; gap: 8px; }
.inline-password-reset .form-input, .department-actions .form-input { min-width: min(100%, 220px); flex: 1 1 200px; }
.simple-list { display: grid; }
.simple-list > div, .simple-list > a { display: flex; min-width: 0; flex-wrap: wrap; align-items: baseline; gap: 8px 18px; border-bottom: 1px solid #e2e8f0; padding: 13px 0; font-size: 14px; }
.simple-list > div:last-child, .simple-list > a:last-child { border-bottom: 0; }
.simple-list strong { min-width: 120px; color: #0f172a; font-weight: 600; }
.simple-list span { color: #64748b; overflow-wrap: anywhere; }
.dark .simple-list > div, .dark .simple-list > a { border-color: #243248; }
.dark .simple-list strong { color: #f8fafc; }
.profile-section { margin-top: 16px; padding: 20px; scroll-margin-top: 88px; }
.profile-section h2 { color: #0f172a; font-size: 17px; font-weight: 600; }
.dark .profile-section h2 { color: #f8fafc; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid #e2e8f0; }
.tabs a { display: inline-flex; min-height: 44px; align-items: center; padding: 0 12px; color: #475569; font-size: 14px; white-space: nowrap; }
.tabs a:hover { color: #075ec7; }
.dark .tabs { border-color: #243248; }
.dark .tabs a { color: #cbd5e1; }
.help-button { width: 44px; height: 44px; flex: 0 0 auto; border: 1px solid #cbd5e1; border-radius: 50%; background: transparent; color: #475569; cursor: help; font-size: 14px; font-weight: 600; }
.empty-note { margin-top: 16px; border-radius: 12px; background: #f1f5f9; padding: 14px; color: #475569; font-size: 14px; }
.dark .empty-note { background: #172338; color: #cbd5e1; }
.decision-actions { display: grid; gap: 12px; margin-top: 24px; }
.decision-actions form { display: flex; min-width: 0; flex-wrap: wrap; gap: 8px; }
.decision-actions .form-input { min-width: min(100%, 210px); flex: 1 1 210px; }
.button-danger { background: #b91c1c; color: #fff; }
.button-danger:hover { background: #991b1b; }
.clock-card { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 20px; }
.live-clock { margin-top: 8px; color: #0f172a; font-size: clamp(32px, 8vw, 48px); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.05em; }
.dark .live-clock { color: #f8fafc; }
.clock-actions { display: flex; min-width: 0; align-items: center; gap: 12px; }
.clock-button { min-width: 160px; min-height: 64px; border: 0; border-radius: 16px; background: #0876e8; color: #fff; cursor: pointer; font-size: 18px; font-weight: 600; box-shadow: 0 8px 20px rgba(8, 118, 232, 0.22); }
.clock-button:hover { background: #075ec7; }
.action-link { color: #075ec7; cursor: pointer; font-size: 14px; }
.audit-value { display: block; max-width: 260px; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 12px; }
.day-count-output { display: flex; align-items: center; color: #475569; }
.csv-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.chart-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.chart-card { min-width: 0; padding: 18px; }
.chart-card h3 { margin-bottom: 12px; color: #0f172a; font-size: 15px; font-weight: 600; }
.dark .chart-card h3 { color: #f8fafc; }
.chart-container { position: relative; width: 100%; min-width: 0; height: 260px; }
.analytics-page { min-width: 0; }
.analytics-visual-grid { display: grid; min-width: 0; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.analytics-visual-card { grid-column: span 12; min-width: 0; overflow: hidden; border: 1px solid #dce5f2; border-radius: 16px; background: #fff; box-shadow: 0 5px 16px rgba(15, 42, 84, 0.08); }
.dark .analytics-visual-card { border-color: #243248; background: #111c2f; box-shadow: 0 5px 16px rgba(0, 0, 0, 0.18); }
.analytics-card-bar { display: flex; min-height: 48px; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; padding: 8px 14px; background: linear-gradient(110deg, var(--brand-navy), #0755b5 58%, var(--brand-blue)); color: #fff; }
.analytics-bar-title { display: flex; min-width: 0; align-items: center; gap: 9px; }
.analytics-bar-title svg { width: 19px; height: 19px; flex: 0 0 auto; stroke-width: 2; }
.analytics-bar-title h2 { min-width: 0; color: #fff; font-size: 14px; font-weight: 650; line-height: 1.25; }
.analytics-visual-body { min-width: 0; padding: 13px 15px 15px; }
.analytics-visual-body .chart-container { height: 225px; }
.analytics-visual-body .analytics-line-chart { height: 270px; }
.chart-subtitle, .chart-footnote { color: #64748b; font-size: 12px; line-height: 1.4; }
.dark .chart-subtitle, .dark .chart-footnote { color: #a9bad0; }
.chart-footnote { padding: 0 15px 12px; }
.analytics-period-switch { display: inline-flex; flex: 0 0 auto; gap: 2px; border-radius: 999px; background: rgba(3, 13, 35, 0.5); padding: 2px; }
.analytics-period-switch button { min-width: 44px; min-height: 44px; border: 0; border-radius: 999px; background: transparent; padding: 0 9px; color: #dce8f8; cursor: pointer; font-size: 14px; font-weight: 600; }
.analytics-period-switch button[aria-pressed="true"] { background: #1769e0; color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22); }
.analytics-period-switch button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.risk-chart-body { display: grid; min-height: 245px; place-items: center; }
.risk-chart-container { max-width: 260px; height: 230px !important; }
.risk-chart-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.risk-chart-center strong { color: #172f57; font-size: 27px; font-weight: 700; line-height: 1.05; }
.risk-chart-center span { color: #64748b; font-size: 12px; }
.dark .risk-chart-center strong { color: #f1f6ff; }
.dark .risk-chart-center span { color: #a9bad0; }
.analytics-forecast-chart { height: 250px !important; }
.analytics-risk-score-chart { height: 255px !important; }

@media (min-width: 640px) {
  .module-grid, .department-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-card { padding: 26px; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-section { padding: 24px; }
  .clock-card { flex-direction: row; align-items: center; padding: 26px; }
  .account-actions { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  .analytics-span-4, .analytics-span-5, .analytics-span-6, .analytics-span-7 { grid-column: span 6; }
}
@media (min-width: 1024px) {
  .analytics-span-4 { grid-column: span 4; }
  .analytics-span-5 { grid-column: span 5; }
  .analytics-span-6 { grid-column: span 6; }
  .analytics-span-7 { grid-column: span 7; }
}
@media (min-width: 1280px) { .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 768px) {
  .records-table { min-width: 640px; }
  .account-actions { grid-template-columns: 1fr; }
}
@media (min-width: 1024px) {
  .module-grid, .department-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .account-actions { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .records-table-wrap { overflow: visible; }
  .records-table, .records-table tbody, .records-table tr, .records-table td { display: block; width: 100%; }
  .records-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
  .records-table tbody { display: grid; gap: 12px; }
  .records-table tr { min-width: 0; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; padding: 8px 12px; }
  .dark .records-table tr { border-color: #243248; background: #111c2f; }
  .records-table td { display: grid; grid-template-columns: minmax(88px, 0.65fr) minmax(0, 1.35fr); gap: 12px; border-bottom: 1px solid #f1f5f9; padding: 10px 0; }
  .records-table td::before { content: attr(data-label); color: #64748b; font-size: 14px; font-weight: 500; }
  .dark .records-table td { border-color: #243248; }
  .records-table td:last-child { border-bottom: 0; }
  .records-table td[colspan] { display: block; border: 0; }
  .records-table td[colspan]::before { content: none; }
  .records-table td[colspan] .empty-state { padding: 22px 10px; }
  .pagination { align-items: flex-start; }
}
@media (min-width: 1280px) {
  .account-actions { grid-template-columns: 1fr; }
}
.attendance-heatmap, .team-calendar { margin-top: 20px; border-top: 1px solid #e2e8f0; padding-top: 18px; }
.section-title { margin-bottom: 12px; font-size: 16px; font-weight: 600; }
.heatmap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 8px; }
.heatmap-day { display: grid; min-height: 64px; align-content: space-between; border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px; font-size: 14px; }
.heatmap-day small { font-size: 12px; }
.heatmap-present { border-color: #86efac; background: #f0fdf4; color: #166534; }
.heatmap-late, .heatmap-half-day { border-color: #fcd34d; background: #fffbeb; color: #92400e; }
.heatmap-absent { border-color: #fca5a5; background: #fef2f2; color: #991b1b; }
.heatmap-on-leave { border-color: #93c5fd; background: #eff6ff; color: #1e40af; }
.dark .attendance-heatmap, .dark .team-calendar { border-color: #243248; }
.dark .heatmap-day { border-color: #334155; background: #172338; color: #e2e8f0; }
.calendar-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.calendar-list li { display: flex; flex-wrap: wrap; gap: 8px 16px; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px; font-size: 14px; }
.dark .calendar-list li { border-color: #334155; }
.view-toggle { display: inline-flex; gap: 4px; margin: 12px 0; border: 1px solid #cbd5e1; border-radius: 12px; padding: 3px; }
.view-toggle a { display: inline-flex; min-height: 40px; align-items: center; border-radius: 9px; padding: 0 12px; color: #475569; font-size: 14px; font-weight: 500; }
.view-toggle a[aria-current="page"] { background: var(--brand-blue-soft); color: var(--brand-navy); }
.dark .view-toggle { border-color: #475569; }
.dark .view-toggle a { color: #cbd5e1; }
.dark .view-toggle a[aria-current="page"] { background: #0b61c9; color: #fff; }
.schedule-toolbar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 16px; }
.schedule-calendar { display: grid; gap: 12px; }
.schedule-employee { min-width: 0; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px; }
.schedule-employee h2 { margin-bottom: 10px; font-size: 16px; font-weight: 600; }
.schedule-day-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.schedule-day { display: grid; min-width: 0; min-height: 76px; align-content: space-between; gap: 5px; border-radius: 10px; background: #f8fafc; padding: 9px; font-size: 14px; }
.schedule-day span, .schedule-day small { color: #64748b; font-size: 12px; overflow-wrap: anywhere; }
.schedule-day strong { overflow-wrap: anywhere; font-weight: 600; }
.dark .schedule-employee { border-color: #334155; }
.dark .schedule-day { background: #172338; }
.dark .schedule-day span, .dark .schedule-day small { color: #94a3b8; }
@media (min-width: 768px) { .schedule-day-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .schedule-day-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); } }

:root:not(.dark) body,
:root:not(.dark) .app-page { background: var(--page-background); color: var(--text-primary); }
:root:not(.dark) .auth-page {
  background: radial-gradient(ellipse at 50% 0, rgba(8, 104, 215, 0.09), transparent 58%), var(--page-background);
}
:root:not(.dark) .auth-card,
:root:not(.dark) .surface-card,
:root:not(.dark) .department-card,
:root:not(.dark) .search-dialog,
:root:not(.dark) .confirm-dialog { border-color: var(--surface-border); background: var(--surface-background); }
:root:not(.dark) .app-sidebar,
:root:not(.dark) .mobile-nav-dialog {
  border-color: var(--brand-navy-deep);
  background: linear-gradient(180deg, var(--brand-navy) 0%, var(--brand-navy-deep) 100%);
  color: #f8fbff;
}
:root:not(.dark) .app-sidebar {
  box-shadow: 8px 0 28px rgba(8, 42, 99, 0.16), 2px 0 8px rgba(8, 42, 99, 0.08);
}
:root:not(.dark) .app-sidebar .brand-lockup,
:root:not(.dark) .mobile-nav-dialog .brand-lockup { color: #fff; }
:root:not(.dark) .app-sidebar .nav-link,
:root:not(.dark) .mobile-nav-dialog .nav-link { color: #d7e6fb; }
:root:not(.dark) .app-sidebar .nav-link:hover,
:root:not(.dark) .app-sidebar .nav-link:focus-visible,
:root:not(.dark) .mobile-nav-dialog .nav-link:hover,
:root:not(.dark) .mobile-nav-dialog .nav-link:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 18, 54, 0.24);
}
:root:not(.dark) .app-sidebar .nav-link[aria-current="page"],
:root:not(.dark) .mobile-nav-dialog .nav-link[aria-current="page"] {
  background: #0874ed;
  color: #fff;
  box-shadow: 0 5px 14px rgba(0, 18, 54, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
:root:not(.dark) .app-sidebar .nav-link[aria-current="page"]:hover,
:root:not(.dark) .app-sidebar .nav-link:active,
:root:not(.dark) .mobile-nav-dialog .nav-link[aria-current="page"]:hover,
:root:not(.dark) .mobile-nav-dialog .nav-link:active {
  background: #0a63cf;
  color: #fff;
}
:root:not(.dark) .app-sidebar .sidebar-account-copy .text-slate-500,
:root:not(.dark) .mobile-nav-dialog .sidebar-account-copy .text-slate-500 { color: #bbd0ed; }
:root:not(.dark) .app-topbar,
:root:not(.dark) .mobile-tabbar { border-color: var(--surface-border); background: rgba(255, 255, 255, 0.96); }
:root:not(.dark) .search-trigger,
:root:not(.dark) .form-input { border-color: #cbd8e9; background: #f8faff; }
:root:not(.dark) .button-secondary,
:root:not(.dark) .search-trigger kbd { border-color: #cbd8e9; background: #f6f9ff; }
:root:not(.dark) .form-input:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(8, 104, 215, 0.16); }
:root:not(.dark) .button-primary { background: var(--brand-blue); }
:root:not(.dark) .button-primary:hover { background: var(--brand-blue-hover); }
:root:not(.dark) .button-secondary:hover { border-color: #a9c5e8; background: #edf4ff; }
:root:not(.dark) .eyebrow,
:root:not(.dark) .breadcrumbs a:hover,
:root:not(.dark) .tabs a:hover,
:root:not(.dark) .action-link { color: var(--brand-blue); }
:root:not(.dark) .empty-state-icon { background: var(--brand-blue-soft); color: var(--brand-blue); }
:root:not(.dark) .avatar { border-color: #bfdbfe; background: #e5f0ff; color: var(--brand-navy); }
:root:not(.dark) .surface-card,
:root:not(.dark) .department-card { box-shadow: 0 8px 24px rgba(17, 47, 91, 0.055); }

.dark body,
.dark .app-page { background: #071a35; color: #e7effb; }
.dark .auth-page {
  background: radial-gradient(ellipse at 50% 0, rgba(8, 104, 215, 0.24), transparent 58%), #071a35;
}
.dark .auth-card,
.dark .surface-card,
.dark .department-card,
.dark .search-dialog,
.dark .confirm-dialog { border-color: #24436e; background: #10294d; }
.dark .app-sidebar,
.dark .mobile-nav-dialog { border-color: #041534; background: linear-gradient(180deg, #082a63 0%, #061f4b 100%); }
.dark .app-topbar,
.dark .mobile-tabbar { border-color: #24436e; background: rgba(12, 34, 66, 0.96); }
.dark .form-input,
.dark .search-trigger { border-color: #35547f; background: #0b2142; }
.dark .button-secondary,
.dark .search-trigger kbd,
.dark .records-table th,
.dark .empty-note,
.dark .heatmap-day { border-color: #35547f; background: #18365e; }
.dark .nav-link { color: #d7e6fb; }
.dark .nav-link:hover,
.dark .nav-link[aria-current="page"] {
  background: #0b61c9;
  color: #fff;
  box-shadow: 0 5px 14px rgba(0, 10, 32, 0.38);
}
.dark .app-sidebar .nav-link:hover,
.dark .app-sidebar .nav-link:focus-visible,
.dark .mobile-nav-dialog .nav-link:hover,
.dark .mobile-nav-dialog .nav-link:focus-visible { box-shadow: 0 4px 12px rgba(0, 10, 32, 0.3); }
.dark .mobile-tabbar a[aria-current="page"] { color: #66aaff; }
.dark .avatar,
.dark .module-card-icon,
.dark .department-card-icon { background: #1e4677; color: #dcecff; }
.dark .eyebrow { color: #7db8ff; }
.dark .text-slate-500,
.dark .breadcrumbs,
.dark .page-heading p:not(.eyebrow),
.dark .module-card-copy span,
.dark .department-card p,
.dark .empty-state p { color: #b0c4df; }
.dark .profile-details > div,
.dark .records-table th,
.dark .records-table td,
.dark .department-card-stats,
.dark .simple-list > div,
.dark .simple-list > a,
.dark .tabs,
.dark .attendance-heatmap,
.dark .team-calendar { border-color: #24436e; }

:root:not(.dark) .app-content {
  background:
    radial-gradient(ellipse at 86% 0, rgba(96, 165, 250, 0.14), transparent 34rem),
    linear-gradient(180deg, #f8fbff 0%, #edf3fb 100%);
}
:root:not(.dark) .app-topbar {
  box-shadow: 0 5px 18px rgba(8, 42, 99, 0.055);
}
:root:not(.dark) .surface-card {
  border-radius: 18px;
  box-shadow:
    0 14px 34px rgba(8, 42, 99, 0.075),
    0 3px 8px rgba(8, 42, 99, 0.035),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.dashboard-hero {
  position: relative;
  isolation: isolate;
  min-height: 148px;
  overflow: hidden;
  border: 1px solid rgba(147, 197, 253, 0.38);
  border-radius: 20px;
  background: linear-gradient(112deg, #082a63 0%, #0755b5 58%, #0876e8 100%);
  padding: 24px clamp(20px, 3vw, 36px);
  box-shadow: 0 18px 38px rgba(8, 61, 138, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.dashboard-hero::before,
.dashboard-hero::after {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(219, 234, 254, 0.18);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.dashboard-hero::before {
  top: -190px;
  right: 7%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle at 35% 35%, rgba(147, 197, 253, 0.42), rgba(59, 130, 246, 0.08) 58%, transparent 72%);
  box-shadow: 0 0 0 24px rgba(219, 234, 254, 0.035), 0 0 0 52px rgba(219, 234, 254, 0.025);
}
.dashboard-hero::after {
  right: 18%;
  bottom: -132px;
  width: 280px;
  height: 200px;
  transform: rotate(-24deg);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.015));
}
.dashboard-hero > * { position: relative; z-index: 1; }
.dashboard-hero .eyebrow,
.dark .dashboard-hero .eyebrow { color: #bfdbfe; }
:root:not(.dark) .dashboard-hero .eyebrow { color: #bfdbfe; }
.dashboard-hero h1,
.dark .dashboard-hero h1 { color: #fff; }
.dashboard-hero p:not(.eyebrow),
.dark .dashboard-hero p:not(.eyebrow) { color: #e2efff; }
.kpi-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: #d7e5f7;
  background: linear-gradient(145deg, #fff 0%, #f5f9ff 100%);
  box-shadow: 0 12px 28px rgba(8, 42, 99, 0.09), inset 0 1px 0 #fff;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.kpi-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #38bdf8, #0868d7);
  content: "";
}
.kpi-card::after {
  position: absolute;
  z-index: -1;
  top: -42px;
  right: -32px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.18), rgba(96, 165, 250, 0));
  content: "";
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(8, 42, 99, 0.14), inset 0 1px 0 #fff;
}
.kpi-card > * { position: relative; z-index: 1; }
.kpi-card > p:nth-child(2) { color: #082a63; font-size: clamp(26px, 3vw, 32px); }
.dark .kpi-card {
  border-color: #31537f;
  background: linear-gradient(145deg, #15365f, #10294d);
  box-shadow: 0 14px 30px rgba(0, 10, 32, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.dark .kpi-card > p:nth-child(2) { color: #f8fbff; }
.module-card { box-shadow: 0 8px 20px rgba(8, 42, 99, 0.045), inset 0 1px 0 #fff; }
.module-card:hover {
  transform: translateY(-3px);
  border-color: #9dc5f6;
  box-shadow: 0 16px 30px rgba(8, 82, 176, 0.13), inset 0 1px 0 #fff;
}
.button-primary {
  background: linear-gradient(180deg, #1683f6 0%, #0868d7 100%);
  box-shadow: 0 7px 16px rgba(8, 104, 215, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.button-primary:hover {
  background: linear-gradient(180deg, #0d72dc 0%, #0758b8 100%);
  box-shadow: 0 10px 20px rgba(8, 104, 215, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
.record-status {
  width: max-content;
  max-width: 100%;
  flex: 0 0 auto;
  align-items: center;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  border: 1px solid #c8e3ff;
  background: linear-gradient(180deg, #f0f8ff, #dceeff);
  box-shadow: 0 2px 6px rgba(8, 104, 215, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}
.onboarding-records-table th {
  background: linear-gradient(180deg, #edf5ff 0%, #e1eeff 100%);
  color: #173c70;
}
.dark .onboarding-records-table th { background: linear-gradient(180deg, #193c68, #15345b); color: #dcecff; }
.onboarding-records-table .onboarding-email { white-space: nowrap; overflow-wrap: normal; }
@media (min-width: 768px) {
  .onboarding-records-table { min-width: 1000px; table-layout: fixed; }
  .onboarding-records-table th:nth-child(1), .onboarding-records-table td:nth-child(1) { width: 14%; }
  .onboarding-records-table th:nth-child(2), .onboarding-records-table td:nth-child(2) { width: 16%; }
  .onboarding-records-table th:nth-child(3), .onboarding-records-table td:nth-child(3) { width: 14%; }
  .onboarding-records-table th:nth-child(4), .onboarding-records-table td:nth-child(4) { width: 19%; }
  .onboarding-records-table th:nth-child(5), .onboarding-records-table td:nth-child(5) { width: 12%; }
  .onboarding-records-table th:nth-child(6), .onboarding-records-table td:nth-child(6) { width: 25%; }
}
@media (max-width: 767px) {
  .onboarding-records-table { min-width: 0; }
  .onboarding-records-table .onboarding-email { white-space: normal; overflow-wrap: anywhere; }
}

main.page-main > .page-heading:not(.dashboard-hero) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 104px;
  align-items: center;
  border: 1px solid rgba(147, 197, 253, 0.38);
  border-radius: 18px;
  background:
    radial-gradient(circle at 96% 0, rgba(147, 197, 253, 0.28), transparent 13rem),
    linear-gradient(112deg, var(--brand-navy) 0%, #0755b5 58%, var(--brand-blue) 100%);
  padding: 18px 24px;
  box-shadow: 0 14px 30px rgba(8, 42, 99, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
main.page-main > .page-heading:not(.dashboard-hero)::before {
  position: absolute;
  inset: 14px auto 14px 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #38bdf8, #0868d7);
  content: "";
}
main.page-main > .page-heading:not(.dashboard-hero) > * { position: relative; z-index: 1; }
main.page-main > .page-heading:not(.dashboard-hero) h1 {
  color: #f8fbff;
  font-size: clamp(24px, 3vw, 30px);
}
main.page-main > .page-heading:not(.dashboard-hero) .eyebrow { color: #60a5fa; }
main.page-main > .page-heading:not(.dashboard-hero) p:not(.eyebrow) { color: #c3d7f0; }
.dark main.page-main > .page-heading:not(.dashboard-hero) {
  border-color: rgba(147, 197, 253, 0.38);
  background:
    radial-gradient(circle at 96% 0, rgba(147, 197, 253, 0.28), transparent 13rem),
    linear-gradient(112deg, var(--brand-navy) 0%, #0755b5 58%, var(--brand-blue) 100%);
  box-shadow: 0 14px 30px rgba(0, 10, 32, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

:root:not(.dark) .auth-card {
  border-color: #d7e5f7;
  background: radial-gradient(circle at 100% 0, rgba(96, 165, 250, 0.11), transparent 16rem), #fff;
  box-shadow: 0 20px 50px rgba(8, 42, 99, 0.12), inset 0 1px 0 #fff;
}
:root:not(.dark) .surface-card,
:root:not(.dark) .department-card,
:root:not(.dark) .chart-card,
:root:not(.dark) .schedule-employee,
:root:not(.dark) .analytics-visual-card {
  border-color: #d7e5f7;
  background: linear-gradient(145deg, #fff 0%, #f9fbff 100%);
  box-shadow: 0 12px 28px rgba(8, 42, 99, 0.075), 0 2px 6px rgba(8, 42, 99, 0.035), inset 0 1px 0 #fff;
}
.dark .auth-card,
.dark .surface-card,
.dark .department-card,
.dark .chart-card,
.dark .schedule-employee,
.dark .analytics-visual-card {
  border-color: #294c79;
  background: linear-gradient(145deg, #122e54 0%, #0f2748 100%);
  box-shadow: 0 14px 30px rgba(0, 10, 32, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
:root:not(.dark) .form-input,
:root:not(.dark) .search-trigger {
  box-shadow: inset 0 1px 2px rgba(8, 42, 99, 0.045), 0 1px 0 rgba(255, 255, 255, 0.8);
}
.dark .form-input,
.dark .search-trigger {
  box-shadow: inset 0 1px 2px rgba(0, 10, 32, 0.22);
}
.form-input:hover:not(:focus) { border-color: #a9c5e8; }
input[type="checkbox"],
input[type="radio"] { accent-color: var(--brand-blue); }
.button-secondary {
  box-shadow: 0 3px 8px rgba(8, 42, 99, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.button-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 14px rgba(8, 42, 99, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.dark .button-secondary { box-shadow: 0 3px 8px rgba(0, 10, 32, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.button-danger {
  background: linear-gradient(180deg, #dc3e4b, #b91c1c);
  box-shadow: 0 6px 14px rgba(185, 28, 28, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.button-danger:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #c92f3d, #991b1b);
  box-shadow: 0 9px 18px rgba(185, 28, 28, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.login-page {
  min-height: 100vh;
  padding: clamp(16px, 3vw, 36px);
  background:
    radial-gradient(ellipse at 8% 10%, rgba(32, 132, 237, 0.2), transparent 34rem),
    linear-gradient(135deg, #eaf4ff 0%, #d7eaff 100%);
}
.login-layout {
  position: relative;
  display: grid;
  width: min(100%, 1320px);
  min-height: min(760px, calc(100vh - 72px));
  grid-template-columns: minmax(0, 1.08fr) minmax(400px, 0.92fr);
  align-items: center;
  gap: clamp(22px, 4vw, 52px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 32px;
  background:
    radial-gradient(circle at 78% 12%, rgba(255, 255, 255, 0.92), transparent 30rem),
    linear-gradient(145deg, #eaf4ff, #dcecff);
  padding: clamp(16px, 2.5vw, 34px);
  box-shadow: 0 28px 80px rgba(8, 42, 99, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}
.login-brand-panel {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 620px;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 26px;
  background:
    radial-gradient(circle at 84% 18%, rgba(102, 190, 255, 0.5), transparent 17rem),
    linear-gradient(145deg, #0b3473 0%, #0868c8 58%, #1685ec 100%);
  padding: clamp(28px, 4vw, 54px);
  color: #fff;
  box-shadow: 0 18px 42px rgba(8, 42, 99, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.login-brand-panel::before,
.login-brand-panel::after {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(219, 234, 254, 0.15);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.login-brand-panel::before {
  top: -164px;
  right: -88px;
  width: 380px;
  height: 380px;
  box-shadow: 0 0 0 24px rgba(219, 234, 254, 0.035), 0 0 0 52px rgba(219, 234, 254, 0.025);
}
.login-brand-panel::after {
  right: -92px;
  bottom: -132px;
  width: 300px;
  height: 300px;
  background: rgba(191, 219, 254, 0.08);
}
.login-brand-lockup {
  position: relative;
  z-index: 1;
  width: fit-content;
  min-height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}
.login-brand-lockup .brand-logo {
  width: clamp(180px, 22vw, 280px);
  height: clamp(120px, 16vw, 190px);
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}
.login-brand-copy {
  position: relative;
  z-index: 1;
  max-width: 470px;
  margin-top: clamp(30px, 4vw, 54px);
}
.login-brand-kicker {
  margin: 0 0 12px;
  color: #bfdbfe;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.login-brand-copy h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(34px, 4.3vw, 58px);
  font-weight: 750;
  letter-spacing: -0.055em;
  line-height: 1.08;
}
.login-brand-copy > p:last-child {
  max-width: 340px;
  margin: 18px 0 0;
  color: #d7eaff;
  font-size: 16px;
  line-height: 1.65;
}
.login-brand-illustration {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 0;
  display: block;
  width: min(100%, 560px);
  height: auto;
  color: #d7eaff;
  pointer-events: none;
}
.login-card {
  width: min(100%, 500px);
  justify-self: center;
  border: 1px solid #e1eaf5;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.97);
  padding: clamp(28px, 4vw, 48px);
  box-shadow: 0 24px 60px rgba(8, 42, 99, 0.15), inset 0 1px 0 #fff;
}
.login-header { text-align: center; }
.login-header .eyebrow {
  margin: 0;
  color: var(--brand-blue);
  font-size: 13px;
  font-weight: 700;
}
.login-header h1 {
  margin: 10px 0 0;
  color: #102344;
  font-size: clamp(25px, 2.5vw, 32px);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.2;
}
.login-header > p:last-child {
  margin: 10px 0 0;
  color: #60718a;
  font-size: 15px;
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0;
}
.login-divider::before,
.login-divider::after {
  height: 1px;
  flex: 1;
  background: #e3ebf5;
  content: "";
}
.login-divider span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #55a7f5;
  box-shadow: 0 0 0 4px #e8f3ff;
}
.login-error { margin-bottom: 20px; }
.login-form { display: grid; gap: 20px; }
.login-form .form-field { gap: 9px; }
.login-form .form-field label {
  color: #243c60;
  font-size: 14px;
  font-weight: 650;
}
.login-input-control { position: relative; }
.login-input-control .login-field-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  width: 19px;
  height: 19px;
  transform: translateY(-50%);
  color: #7c91ac;
  pointer-events: none;
  stroke-width: 1.8;
}
.login-input {
  min-height: 52px;
  border-color: #d5e0ee;
  border-radius: 13px;
  background: #f9fbfe;
  padding: 12px 14px 12px 46px;
  color: #102344;
}
.login-input-control.password-control .login-input { padding-right: 56px; }
.login-input-control:focus-within .login-field-icon { color: var(--brand-blue); }
.login-input-control .password-toggle {
  top: 5px;
  right: 5px;
  display: grid;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  place-items: center;
  border-radius: 10px;
  color: #55708f;
}
.login-input-control .password-toggle:hover { background: #edf5ff; color: var(--brand-blue); }
.login-input-control .password-toggle svg { width: 19px; height: 19px; }
.login-input-control .password-toggle [data-eye-hide] { display: none; }
.login-input-control .password-toggle[aria-pressed="true"] [data-eye-show] { display: none; }
.login-input-control .password-toggle[aria-pressed="true"] [data-eye-hide] { display: block; }
.login-form-options { display: flex; align-items: center; justify-content: space-between; }
.login-remember {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 10px;
  color: #526782;
  cursor: pointer;
  font-size: 14px;
}
.login-remember input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--brand-blue);
}
.login-submit {
  min-height: 52px;
  border-radius: 13px;
  font-size: 16px;
  font-weight: 700;
}
.login-submit svg { width: 19px; height: 19px; }
.login-footer {
  display: grid;
  gap: 12px;
  margin-top: 28px;
  text-align: center;
}
.login-footer p {
  margin: 0;
  color: #526782;
  font-size: 13px;
}
.login-footer span {
  color: #8292a8;
  font-size: 12px;
}
.dark .login-page {
  background:
    radial-gradient(ellipse at 8% 10%, rgba(32, 132, 237, 0.22), transparent 34rem),
    linear-gradient(135deg, #071a35 0%, #0c2343 100%);
}
:root:not(.dark) .login-page {
  background:
    radial-gradient(ellipse at 8% 10%, rgba(32, 132, 237, 0.2), transparent 34rem),
    linear-gradient(135deg, #eaf4ff 0%, #d7eaff 100%);
}
.dark .login-layout {
  border-color: #294c79;
  background: radial-gradient(circle at 78% 12%, rgba(30, 66, 111, 0.68), transparent 30rem), #0c2343;
  box-shadow: 0 28px 80px rgba(0, 10, 32, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.dark .login-card {
  border-color: #294c79;
  background: linear-gradient(145deg, #122e54 0%, #0f2748 100%);
}
.dark .login-header h1 { color: #f8fbff; }
.dark .login-header > p:last-child,
.dark .login-remember,
.dark .login-footer p { color: #c3d7f0; }
.dark .login-form .form-field label { color: #d7e6fb; }
.dark .login-divider::before,
.dark .login-divider::after { background: #294c79; }
.dark .login-input {
  border-color: #35547f;
  background: #0b2142;
  color: #f8fbff;
}
.dark .login-input::placeholder { color: #90a6c2; }
.dark .login-input-control .password-toggle { color: #aac3e3; }
.dark .login-input-control .password-toggle:hover { background: #18365e; color: #bfdbfe; }
.dark .login-footer span { color: #90a6c2; }
@media (max-width: 900px) {
  .login-layout {
    width: min(100%, 640px);
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .login-brand-panel {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    padding: 20px 24px;
  }
  .login-brand-lockup { flex: 0 0 auto; border-radius: 15px; padding: 4px; }
  .login-brand-lockup .brand-logo { width: 120px; height: 82px; border-radius: 11px; }
  .login-brand-copy { margin: 0; }
  .login-brand-kicker { margin-bottom: 5px; font-size: 10px; }
  .login-brand-copy h2 { font-size: clamp(20px, 4vw, 30px); }
  .login-brand-copy > p:last-child { margin-top: 6px; font-size: 13px; }
  .login-brand-illustration { width: 52%; opacity: 0.45; }
  .login-card { width: min(100%, 500px); }
}
@media (max-width: 520px) {
  .login-page { padding: 12px; }
  .login-layout { gap: 12px; border-radius: 22px; padding: 10px; }
  .login-brand-panel { gap: 14px; border-radius: 17px; padding: 14px; }
  .login-brand-lockup .brand-logo { width: 78px; height: 58px; }
  .login-brand-copy h2 { font-size: 21px; }
  .login-brand-copy > p:last-child { max-width: 205px; font-size: 11px; }
  .login-brand-kicker { font-size: 9px; letter-spacing: 0.1em; }
  .login-brand-illustration { display: none; }
  .login-card { border-radius: 18px; padding: 24px 20px; }
  .login-header h1 { font-size: 25px; }
  .login-divider { margin: 22px 0; }
}
.clock-button {
  background: linear-gradient(180deg, #1683f6, #0868d7);
  box-shadow: 0 10px 22px rgba(8, 104, 215, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.clock-button:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(8, 104, 215, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.22); }
.dark .clock-button { background: linear-gradient(180deg, #1683f6, #0758b8); }

.records-table-wrap {
  border-radius: 14px;
  scrollbar-color: #9ab8df transparent;
  scrollbar-width: thin;
}
.records-table th {
  background: linear-gradient(180deg, #edf5ff 0%, #e1eeff 100%);
  color: #173c70;
}
.dark .records-table th { background: linear-gradient(180deg, #193c68, #15345b); color: #dcecff; }
.records-table tbody tr { transition: background-color 140ms ease; }
.records-table tbody tr:hover td { background: #f3f8ff; }
.dark .records-table tbody tr:hover td { background: #17375f; }
.record-primary-link { color: #075ec7; }
.dark .record-primary-link { color: #8fc4ff; }
.status-badge { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55); }
.dark .status-badge { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.dark .record-status {
  border-color: #315783;
  background: linear-gradient(180deg, #1a4777, #15365f);
  color: #dcecff;
}

.department-card,
.module-card,
.chart-card,
.analytics-visual-card,
.schedule-employee,
.calendar-list li,
.heatmap-day { transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease; }
.department-card:hover,
.chart-card:hover,
.analytics-visual-card:hover,
.schedule-employee:hover {
  transform: translateY(-2px);
  border-color: #a9c9f3;
  box-shadow: 0 16px 34px rgba(8, 42, 99, 0.12), inset 0 1px 0 #fff;
}
.dark .department-card:hover,
.dark .chart-card:hover,
.dark .analytics-visual-card:hover,
.dark .schedule-employee:hover {
  border-color: #3970ae;
  box-shadow: 0 17px 34px rgba(0, 10, 32, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.schedule-day {
  border: 1px solid #dce8f7;
  background: linear-gradient(145deg, #fff, #f1f7ff);
  box-shadow: 0 3px 8px rgba(8, 42, 99, 0.055), inset 0 1px 0 #fff;
}
.dark .schedule-day {
  border-color: #294c79;
  background: linear-gradient(145deg, #183961, #10294d);
  box-shadow: 0 4px 9px rgba(0, 10, 32, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.heatmap-day { box-shadow: 0 3px 8px rgba(8, 42, 99, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
.heatmap-day:hover,
.calendar-list li:hover { transform: translateY(-1px); box-shadow: 0 8px 16px rgba(8, 42, 99, 0.1); }
.calendar-list li {
  border-color: #d7e5f7;
  background: linear-gradient(145deg, #fff, #f7faff);
  box-shadow: 0 3px 8px rgba(8, 42, 99, 0.05), inset 0 1px 0 #fff;
}
.dark .calendar-list li { background: linear-gradient(145deg, #15365f, #10294d); box-shadow: 0 3px 8px rgba(0, 10, 32, 0.22); }
.view-toggle {
  border-color: #cbdcf1;
  background: #edf4ff;
  box-shadow: inset 0 1px 2px rgba(8, 42, 99, 0.06);
}
.view-toggle a[aria-current="page"] {
  background: linear-gradient(180deg, #1683f6, #0868d7);
  color: #fff;
  box-shadow: 0 4px 10px rgba(8, 104, 215, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.dark .view-toggle { border-color: #35547f; background: #0b2142; }
.dark .view-toggle a[aria-current="page"] { background: linear-gradient(180deg, #1683f6, #0758b8); color: #fff; }
.tabs a { transition: color 140ms ease, background-color 140ms ease; }
.tabs a[aria-current="page"] { border-bottom: 2px solid var(--brand-blue); color: var(--brand-blue); }
.dark .tabs a[aria-current="page"] { color: #8fc4ff; }
.help-button {
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.help-button:hover { background: rgba(255, 255, 255, 0.22); }
.message, .toast { box-shadow: 0 4px 12px rgba(8, 42, 99, 0.045), inset 0 1px 0 rgba(255, 255, 255, 0.45); }

@media (max-width: 639px) {
  main.page-main > .page-heading:not(.dashboard-hero) { min-height: 0; padding: 16px 18px; }
  .page-heading:not(.dashboard-hero) { align-items: stretch; }
  .records-table td { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .department-card:hover,
  .module-card:hover,
  .chart-card:hover,
  .analytics-visual-card:hover,
  .schedule-employee:hover,
  .heatmap-day:hover,
  .calendar-list li:hover,
  .button-secondary:hover,
  .button-danger:hover,
  .clock-button:hover { transform: none; }
}