﻿html,
body {
  width: 100%;
  max-width: 100%;
}

:root {
  --bg: #f7fbf8;
  --panel: rgba(255, 255, 255, 0.95);
  --ink: #17251d;
  --muted: #5e6b82;
  --accent: #4b7453;
  --accent-soft: #2f5a39;
  --mansa-green: #496f4e;
  --mansa-deep: #203b2a;
  --mansa-gold: #c7ae72;
  --mansa-rust: #c76010;
  --eds-blue: #2157d5;
  --eds-steel: #d8e2f2;
  --emhs-magenta: #cf1dbb;
  --emhs-violet: #6d28d9;
  --emhs-orange: #ffb400;
  --border: rgba(148, 163, 184, 0.22);
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  --table-head: #eef4ff;
  --field-bg: #ffffff;
  --readonly-bg: #f3f7fd;
  --surface-soft: rgba(255, 255, 255, 0.94);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-size: 15px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--ink);
  overflow-x: hidden;
  background:
    radial-gradient(circle at top center, rgba(73, 111, 78, 0.16), transparent 34%),
    radial-gradient(circle at 50% 18%, rgba(255, 180, 0, 0.1), transparent 30%),
    radial-gradient(circle at 82% 6%, rgba(207, 29, 187, 0.07), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

body.theme-dark {
  --bg: #07110c;
  --panel: rgba(9, 22, 14, 0.9);
  --ink: #edf5ff;
  --muted: #98aac4;
  --accent: #8bbf91;
  --accent-soft: #4b7453;
  --border: rgba(139, 191, 145, 0.18);
  --shadow: 0 26px 80px rgba(2, 6, 23, 0.45);
  --table-head: rgba(30, 41, 59, 0.95);
  --field-bg: rgba(15, 23, 42, 0.92);
  --readonly-bg: rgba(30, 41, 59, 0.95);
  --surface-soft: rgba(15, 23, 42, 0.82);
  background:
    radial-gradient(circle at top center, rgba(73, 111, 78, 0.28), transparent 34%),
    radial-gradient(circle at 50% 20%, rgba(249, 115, 22, 0.11), transparent 28%),
    radial-gradient(circle at 82% 8%, rgba(109, 40, 217, 0.14), transparent 24%),
    linear-gradient(180deg, #050a07 0%, var(--bg) 100%);
}

body.theme-light {
  color-scheme: light;
}

body.theme-dark {
  color-scheme: dark;
}

.app-shell {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 18px 14px 36px;
  min-width: 0;
}

main,
#rhDashboard,
#employeeView,
#rhView,
.view-stack,
.panel,
.panel-wide,
.dashboard-grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

.hero-brand-block {
  display: grid;
  gap: 14px;
}

.brand-ribbon {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.brand-card {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.brand-card-fusion {
  grid-template-columns: minmax(190px, 280px) 1fr;
  max-width: 720px;
}

.brand-card strong,
.brand-card span {
  display: block;
}

.brand-card strong {
  font-size: 0.95rem;
}

.brand-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.brand-mark,
.brand-logo-wrap {
  display: grid;
  place-items: center;
  height: 60px;
  border-radius: 16px;
}

.brand-mark {
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 1.1rem;
  color: #fff;
}

.brand-mark-eds {
  background: linear-gradient(135deg, #082e84, var(--eds-blue) 55%, #7fa7ff);
}

.brand-mark-emhs {
  background: linear-gradient(135deg, var(--emhs-orange), #ff6a00 22%, var(--emhs-magenta) 48%, var(--emhs-violet) 76%, #3b82f6);
}

.brand-logo-wrap {
  padding: 6px;
  background: rgba(255, 255, 255, 0.98);
  overflow: hidden;
}

.brand-logo-pair {
  display: grid;
  grid-template-columns: minmax(128px, 1fr) 72px;
  gap: 10px;
  align-items: center;
}

.brand-logo-wrap-mansa,
.brand-logo-wrap-emhs {
  height: 72px;
  border-radius: 16px;
}

.brand-logo-wrap-mansa {
  padding: 11px 14px;
  background: linear-gradient(135deg, var(--mansa-green), var(--mansa-deep));
}

.brand-logo-wrap-emhs {
  padding: 4px;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.74)),
    linear-gradient(135deg, rgba(255, 180, 0, 0.16), rgba(207, 29, 187, 0.12), rgba(33, 87, 213, 0.14));
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-logo-eds {
  transform: scale(1.22);
}

.brand-logo-emhs {
  transform: scale(1.1);
}

.brand-logo-mansa,
.brand-logo-emhs-new {
  filter: drop-shadow(0 10px 20px rgba(15, 23, 42, 0.14));
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
}

.hero-tag-mansa {
  background: rgba(73, 111, 78, 0.12);
  color: var(--mansa-deep);
}

.hero-tag-emhs {
  background: linear-gradient(135deg, rgba(255, 180, 0, 0.14), rgba(207, 29, 187, 0.1), rgba(109, 40, 217, 0.1));
  color: #9a3412;
}

.hero h1,
.panel h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(1.75rem, 3.5vw, 3.15rem);
  line-height: 0.95;
  margin-bottom: 10px;
}

.eyebrow,
.panel-kicker,
.hero-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
  color: var(--accent-soft);
  font-weight: 700;
}

.hero-copy,
.hero-note,
.feedback,
.muted {
  color: var(--muted);
}

.hero-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at top right, rgba(255, 180, 0, 0.14), transparent 28%),
    radial-gradient(circle at bottom left, rgba(73, 111, 78, 0.12), transparent 32%),
    radial-gradient(circle at 78% 74%, rgba(207, 29, 187, 0.08), transparent 26%),
    rgba(255, 255, 255, 0.96);
}

.hero-time {
  font-size: clamp(1.75rem, 3.5vw, 2.7rem);
  font-weight: 700;
  margin: 8px 0 4px;
}

.hero-divider {
  height: 1px;
  margin: 14px 0;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.08), rgba(255, 180, 0, 0.42), rgba(207, 29, 187, 0.35), rgba(148, 163, 184, 0.08));
}

.mode-switch {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.mode-tab {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font: inherit;
}

.mode-tab.active {
  background: linear-gradient(135deg, var(--mansa-green), var(--accent-soft));
  color: #fff;
}

.theme-toggle {
  margin-left: auto;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
}

body.theme-dark .theme-toggle,
body.theme-dark .mode-tab {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(96, 165, 250, 0.18);
}

body.theme-dark .mode-tab.active {
  background: linear-gradient(135deg, #4b7453, #2157d5);
}

.view-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.hidden {
  display: none !important;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel-accent {
  background:
    radial-gradient(circle at top right, rgba(255, 180, 0, 0.11), transparent 26%),
    radial-gradient(circle at bottom left, rgba(73, 111, 78, 0.1), transparent 28%),
    linear-gradient(135deg, rgba(239, 248, 241, 0.96), rgba(255, 255, 255, 0.98) 46%, rgba(246, 240, 255, 0.9));
}

.panel-wide {
  grid-column: 1 / -1;
}

.kiosk-panel {
  max-width: 500px;
  margin: 0 auto;
}

.narrow-panel {
  max-width: 480px;
}

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

.stack-form,
.employee-form {
  display: grid;
  gap: 10px;
}

.employee-form {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 16px;
}

.rh-user-form {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

label,
select,
input,
button {
  font: inherit;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

select,
input,
.readonly-field {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--field-bg);
  color: var(--ink);
}

.readonly-field {
  background: var(--readonly-bg);
  font-weight: 600;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
}

.primary-btn {
  background: linear-gradient(135deg, var(--mansa-green), var(--accent-soft) 54%, var(--eds-blue));
  color: #fff;
}

.secondary-btn {
  background: linear-gradient(135deg, rgba(255, 180, 0, 0.2), rgba(207, 29, 187, 0.12));
  color: #7c2d12;
}

body.theme-dark .secondary-btn {
  background: linear-gradient(135deg, #f59e0b, #ea580c 42%, #c026d3);
  color: #fff7ed;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 24px rgba(234, 88, 12, 0.24);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--ink);
}

.danger-btn {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  color: #fff;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.security-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-weight: 700;
  font-size: 0.82rem;
}

.security-indicator.warn {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.security-indicator.danger {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.feedback {
  min-height: 24px;
  font-weight: 600;
}

.feedback.success {
  color: #0b3ea9;
}

.feedback.error {
  color: #b91c1c;
}

.early-reason {
  padding: 16px;
  border: 1px solid rgba(245, 158, 11, 0.34);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(255, 255, 255, 0.92));
  box-shadow: 0 16px 34px rgba(245, 158, 11, 0.12);
}

.early-reason textarea {
  margin-top: 10px;
  min-height: 104px;
  resize: vertical;
  border-color: rgba(245, 158, 11, 0.48);
  background: #fffaf0;
}

.early-reason small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.optional-note {
  display: inline-flex;
  margin-left: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 800;
}

.attendance-result {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
  animation: attendanceReveal 0.45s ease;
}

.attendance-result.hidden {
  display: none !important;
}

.attendance-result-mark {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
}

.attendance-result-body strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.02rem;
}

.attendance-result-body p {
  margin: 0;
  color: var(--muted);
}

.attendance-result.success .attendance-result-mark {
  background: linear-gradient(135deg, #0f766e, #2563eb);
  animation: haloPulse 1.2s ease 1;
}

.attendance-result.success {
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.16), transparent 30%),
    rgba(255, 255, 255, 0.97);
}

.attendance-result.warning .attendance-result-mark {
  background: linear-gradient(135deg, #f97316, #dc2626);
  animation: alertShake 0.5s ease 1;
}

.attendance-result.warning {
  background:
    radial-gradient(circle at top right, rgba(249, 115, 22, 0.18), transparent 32%),
    rgba(255, 255, 255, 0.97);
}

.attendance-result.neutral .attendance-result-mark {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.identity-preview {
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.94);
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  align-items: center;
}

.kiosk-panel .stack-form {
  max-width: 100%;
}

.kiosk-panel .primary-btn {
  width: 100%;
}

.identity-preview img,
.employee-thumb {
  width: 82px;
  height: 82px;
  border-radius: 16px;
  object-fit: cover;
  background: #e8eef8;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.employee-thumb {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.identity-preview h3 {
  margin: 0 0 6px;
}

.identity-secret {
  margin: 8px 0 0;
  font-weight: 700;
  color: #0b3ea9;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.stats-grid article,
.info-box {
  border-radius: 16px;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid rgba(148, 163, 184, 0.14);
  overflow-wrap: anywhere;
}

.stats-grid span {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.stats-grid strong {
  font-size: 1.6rem;
}

.dashboard-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.dashboard-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.dashboard-nav-link:hover {
  border-color: rgba(37, 99, 235, 0.28);
  color: #1d4ed8;
}

.metric-card {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background:
    radial-gradient(circle at top right, rgba(255, 180, 0, 0.16), transparent 35%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 255, 0.96));
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.metric-card span {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.metric-card strong {
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
}

.dashboard-grid {
  align-items: start;
}

.quick-filters,
.toolbar-row {
  display: grid;
  gap: 10px;
}

.quick-filters {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-top: 14px;
}

.toolbar-row {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-bottom: 14px;
}

.period-toolbar {
  align-items: end;
}

.period-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-chip {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--muted);
}

.filter-chip.active {
  background: linear-gradient(135deg, rgba(11, 62, 169, 0.15), rgba(59, 130, 246, 0.16));
  color: #0b3ea9;
  border-color: rgba(37, 99, 235, 0.28);
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.chart-card {
  padding: 16px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 255, 0.96)),
    rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 14px;
}

.chart-head h3 {
  margin: 0;
  font-size: 1rem;
}

.chart-head span,
.empty-chart {
  color: var(--muted);
  font-size: 0.88rem;
}

.chart-list {
  display: grid;
  gap: 12px;
}

.chart-row {
  display: grid;
  gap: 8px;
}

.chart-row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 0.9rem;
}

.chart-row-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.chart-bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.2);
}

.chart-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.chart-bar-fill.ok {
  background: linear-gradient(135deg, #2563eb, #0f766e);
}

.chart-bar-fill.late {
  background: linear-gradient(135deg, #f97316, #dc2626);
}

.chart-bar-fill.warn {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
}

.chart-bar-fill.accent {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  width: 100%;
  max-width: 100%;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  background: rgba(255, 255, 255, 0.96);
}

th,
td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 0.88rem;
  vertical-align: middle;
}

th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1d4ed8;
  background: var(--table-head);
}

tbody tr {
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

tbody tr:hover {
  background: rgba(37, 99, 235, 0.035);
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.76rem;
  font-weight: 700;
}

.pill.ok {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.pill.late {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.table-actions {
  width: 1%;
  min-width: 150px;
  white-space: nowrap;
}

.employee-action-select {
  width: 150px;
  min-height: 38px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  padding: 8px 34px 8px 14px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(241, 246, 255, 0.96));
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.employee-action-select:focus {
  outline: 3px solid rgba(37, 99, 235, 0.16);
  border-color: rgba(37, 99, 235, 0.42);
}

.empty-row {
  text-align: center;
  color: var(--muted);
  padding: 18px;
}

.qr-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

body.theme-dark .brand-card,
body.theme-dark .hero-card,
body.theme-dark .panel,
body.theme-dark .metric-card,
body.theme-dark .chart-card,
body.theme-dark table,
body.theme-dark .table-wrap,
body.theme-dark .identity-preview,
body.theme-dark .brand-logo-wrap {
  background: rgba(9, 18, 33, 0.9);
  color: var(--ink);
}

body.theme-dark .brand-card span,
body.theme-dark .hero-copy,
body.theme-dark .hero-note,
body.theme-dark .muted,
body.theme-dark .chart-head span,
body.theme-dark .chart-row-head span,
body.theme-dark .metric-card span,
body.theme-dark th,
body.theme-dark label,
body.theme-dark .empty-row {
  color: var(--muted);
}

body.theme-dark .brand-logo-wrap-mansa {
  background: linear-gradient(135deg, #4b7453, #1f3a29);
}

body.theme-dark .brand-logo-wrap-emhs {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.88), rgba(226, 232, 240, 0.72)),
    linear-gradient(135deg, rgba(255, 180, 0, 0.18), rgba(207, 29, 187, 0.18), rgba(33, 87, 213, 0.2));
}

body.theme-dark th {
  color: #93c5fd;
}

body.theme-dark .hero-tag,
body.theme-dark .ghost-btn,
body.theme-dark .employee-action-select,
body.theme-dark .filter-chip {
  background: rgba(15, 23, 42, 0.9);
  color: var(--ink);
  border-color: rgba(96, 165, 250, 0.14);
}

body.theme-dark .filter-chip.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(14, 116, 144, 0.26));
  color: #dbeafe;
}

body.theme-dark .dashboard-nav-link {
  background: rgba(15, 23, 42, 0.9);
  color: var(--ink);
  border-color: rgba(96, 165, 250, 0.14);
}

body.theme-dark .dashboard-nav-link:hover {
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.32);
}

body.theme-dark .chart-card,
body.theme-dark .metric-card,
body.theme-dark .stats-grid article,
body.theme-dark .info-box {
  border-color: rgba(96, 165, 250, 0.12);
}

body.theme-dark td {
  border-bottom-color: rgba(96, 165, 250, 0.08);
}

body.theme-dark tbody tr:hover {
  background: rgba(96, 165, 250, 0.055);
}

body.theme-dark .pill.ok {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

body.theme-dark .pill.late {
  background: rgba(248, 113, 113, 0.14);
  color: #fca5a5;
}

body.theme-dark .attendance-result {
  background: rgba(9, 18, 33, 0.95);
  border-color: rgba(96, 165, 250, 0.14);
}

body.theme-dark .early-reason {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(15, 23, 42, 0.94));
  border-color: rgba(245, 158, 11, 0.32);
}

body.theme-dark .early-reason textarea {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(245, 158, 11, 0.38);
}

body.theme-dark .optional-note {
  background: rgba(96, 165, 250, 0.16);
  color: #bfdbfe;
}

body.theme-dark .attendance-result-body p {
  color: var(--muted);
}

@keyframes attendanceReveal {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes haloPulse {
  0% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35);
  }
  70% {
    transform: scale(1.04);
    box-shadow: 0 0 0 16px rgba(37, 99, 235, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

@keyframes alertShake {
  0%, 100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-3px);
  }
  40% {
    transform: translateX(4px);
  }
  60% {
    transform: translateX(-2px);
  }
  80% {
    transform: translateX(2px);
  }
}

@media print {
  .hero,
  .mode-switch,
  #employeeView,
  #rhAuthPanel,
  .grid,
  .table-wrap,
  #employeeForm,
  #logoutRhBtn,
  #exportBtn,
  #refreshBtn,
  #settingsForm,
  .info-box {
    display: none !important;
  }

  #rhView,
  #rhDashboard,
  .panel,
  .panel-wide {
    display: block !important;
  }

  body {
    background: #fff;
    color: #111827;
  }

  .panel {
    border: 0;
    box-shadow: none;
    padding: 0;
  }
}

@media (max-width: 920px) {
  .app-shell {
    padding: 14px 12px 28px;
  }

  .hero,
  .grid {
    grid-template-columns: 1fr;
  }

  .brand-ribbon {
    grid-template-columns: 1fr;
  }

  .brand-card-fusion {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .brand-logo-pair {
    grid-template-columns: minmax(0, 1fr) 68px;
  }

  .brand-logo-wrap-mansa,
  .brand-logo-wrap-emhs {
    height: 68px;
  }

  .employee-form,
  .rh-user-form,
  .toolbar-row,
  .quick-filters,
  .dashboard-strip,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .period-actions {
    width: 100%;
  }

  .period-actions button {
    width: 100%;
  }

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

  .attendance-result-mark {
    width: 58px;
    height: 58px;
  }

  .mode-switch {
    flex-wrap: wrap;
  }

  .panel-head,
  .chart-row-head {
    flex-direction: column;
    align-items: flex-start;
  }

  table {
    min-width: 760px;
  }

  .table-actions {
    min-width: 132px;
  }

  .employee-action-select {
    width: 132px;
  }
}

