:root {
  color-scheme: light;
  --bg: #eefbf8;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: rgba(244, 250, 252, 0.98);
  --surface: rgba(255, 255, 255, 0.72);
  --surface-soft: rgba(255, 255, 255, 0.34);
  --surface-hover: rgba(255, 255, 255, 0.82);
  --input-bg: rgba(255, 255, 255, 0.9);
  --input-hover: rgba(255, 255, 255, 0.98);
  --table-head: rgba(236, 246, 250, 0.98);
  --camera-bg: #dbeafe;
  --line: rgba(35, 76, 130, 0.18);
  --text: #102033;
  --muted: #51657d;
  --accent: #154ed0;
  --accent-2: #219a7a;
  --danger: #d63f4f;
  --warn: #b98200;
  --radius: 8px;
  --blue-soft: #6387db;
  --steel: #6b92ae;
  --shadow-soft: 0 24px 70px rgba(24, 68, 118, 0.12);
  --shadow-hover: 0 30px 90px rgba(21, 78, 208, 0.18);
  --shine: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.22) 42%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0.18) 58%, transparent 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #07131c;
    --panel: rgba(13, 25, 38, 0.9);
    --panel-strong: rgba(17, 32, 48, 0.98);
    --surface: rgba(16, 31, 46, 0.72);
    --surface-soft: rgba(16, 31, 46, 0.5);
    --surface-hover: rgba(23, 43, 63, 0.9);
    --input-bg: rgba(10, 22, 34, 0.88);
    --input-hover: rgba(18, 34, 51, 0.96);
    --table-head: rgba(18, 35, 50, 0.98);
    --camera-bg: #13273a;
    --line: rgba(154, 184, 220, 0.2);
    --text: #ecf5ff;
    --muted: #a9bdd4;
    --accent: #7aa7ff;
    --accent-2: #54d6b5;
    --danger: #ff6372;
    --warn: #f7c55f;
    --blue-soft: #89aaff;
    --steel: #85a9c7;
    --shadow-soft: 0 24px 70px rgba(0, 0, 0, 0.34);
    --shadow-hover: 0 30px 90px rgba(38, 102, 255, 0.25);
    --shine: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.04) 42%, rgba(255, 255, 255, 0.18) 50%, rgba(255, 255, 255, 0.05) 58%, transparent 100%);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eefbf8;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: rgba(244, 250, 252, 0.98);
  --surface: rgba(255, 255, 255, 0.72);
  --surface-soft: rgba(255, 255, 255, 0.34);
  --surface-hover: rgba(255, 255, 255, 0.82);
  --input-bg: rgba(255, 255, 255, 0.9);
  --input-hover: rgba(255, 255, 255, 0.98);
  --table-head: rgba(236, 246, 250, 0.98);
  --camera-bg: #dbeafe;
  --line: rgba(35, 76, 130, 0.18);
  --text: #102033;
  --muted: #51657d;
  --accent: #154ed0;
  --accent-2: #219a7a;
  --danger: #d63f4f;
  --warn: #b98200;
  --blue-soft: #6387db;
  --steel: #6b92ae;
  --shadow-soft: 0 24px 70px rgba(24, 68, 118, 0.12);
  --shadow-hover: 0 30px 90px rgba(21, 78, 208, 0.18);
  --shine: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.22) 42%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0.18) 58%, transparent 100%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07131c;
  --panel: rgba(13, 25, 38, 0.9);
  --panel-strong: rgba(17, 32, 48, 0.98);
  --surface: rgba(16, 31, 46, 0.72);
  --surface-soft: rgba(16, 31, 46, 0.5);
  --surface-hover: rgba(23, 43, 63, 0.9);
  --input-bg: rgba(10, 22, 34, 0.88);
  --input-hover: rgba(18, 34, 51, 0.96);
  --table-head: rgba(18, 35, 50, 0.98);
  --camera-bg: #13273a;
  --line: rgba(154, 184, 220, 0.2);
  --text: #ecf5ff;
  --muted: #a9bdd4;
  --accent: #7aa7ff;
  --accent-2: #54d6b5;
  --danger: #ff6372;
  --warn: #f7c55f;
  --blue-soft: #89aaff;
  --steel: #85a9c7;
  --shadow-soft: 0 24px 70px rgba(0, 0, 0, 0.34);
  --shadow-hover: 0 30px 90px rgba(38, 102, 255, 0.25);
  --shine: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.04) 42%, rgba(255, 255, 255, 0.18) 50%, rgba(255, 255, 255, 0.05) 58%, transparent 100%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .portal-card,
  :root:not([data-theme="light"]) .portal-card.advance-card,
  :root:not([data-theme="light"]) input,
  :root:not([data-theme="light"]) select {
    background-color: rgba(17, 32, 48, 0.88);
  }

  :root:not([data-theme="light"]) input::placeholder {
    color: rgba(169, 189, 212, 0.68);
  }

  :root:not([data-theme="light"]) .panel::before {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 30%),
      linear-gradient(315deg, rgba(122, 167, 255, 0.1), transparent 52%);
    opacity: 0.62;
  }

  :root:not([data-theme="light"]) button.ghost {
    border-color: rgba(255, 99, 114, 0.45);
    background: rgba(255, 99, 114, 0.12);
    color: #ffb8c0;
  }

  :root:not([data-theme="light"]) .brand-logo {
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.28));
  }
}

:root[data-theme="dark"] .portal-card,
:root[data-theme="dark"] .portal-card.advance-card,
:root[data-theme="dark"] input,
:root[data-theme="dark"] select {
  background-color: rgba(17, 32, 48, 0.88);
}

:root[data-theme="dark"] input::placeholder {
  color: rgba(169, 189, 212, 0.68);
}

:root[data-theme="dark"] .panel::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 30%),
    linear-gradient(315deg, rgba(122, 167, 255, 0.1), transparent 52%);
  opacity: 0.62;
}

:root[data-theme="dark"] button.ghost {
  border-color: rgba(255, 99, 114, 0.45);
  background: rgba(255, 99, 114, 0.12);
  color: #ffb8c0;
}

:root[data-theme="dark"] .brand-logo {
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.28));
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, transparent 0 64%, rgba(99, 135, 219, 0.18) 64% 70%, transparent 70%),
    linear-gradient(315deg, transparent 0 74%, rgba(107, 146, 174, 0.16) 74% 81%, transparent 81%),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.72;
  background-image:
    linear-gradient(135deg, transparent 0 9%, rgba(21, 78, 208, 0.08) 9% 13%, transparent 13%),
    linear-gradient(45deg, transparent 0 84%, rgba(107, 146, 174, 0.13) 84% 89%, transparent 89%);
  background-size: 360px 360px, 440px 440px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 82%);
  animation: backgroundDrift 26s ease-in-out infinite alternate;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid rgba(21, 78, 208, 0.42);
  outline-offset: 3px;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  width: clamp(180px, 20vw, 280px);
  height: auto;
  max-height: 96px;
  object-fit: contain;
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  background: transparent;
  box-shadow: none;
  transition: transform 180ms ease, filter 180ms ease;
}

.brand:hover .brand-logo {
  transform: translateY(-2px);
  filter: drop-shadow(0 10px 18px rgba(21, 78, 208, 0.16));
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: 1.08rem;
  font-weight: 900;
  background: linear-gradient(90deg, #0f3ea9 0%, #154ed0 56%, #587fdc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.brand p,
.muted {
  color: var(--muted);
}

.hero {
  display: grid;
  min-height: calc(100vh - 96px);
  align-items: center;
  padding-bottom: 56px;
}

.landing {
  min-height: 100vh;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 28px;
  align-items: end;
  min-height: 64vh;
  padding: 42px 0 38px;
}

.landing-copy {
  max-width: 820px;
  text-shadow: none;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.landing-copy h2 {
  margin: 0;
  font-size: clamp(2.4rem, 5.8vw, 5.2rem);
  line-height: 1;
}

.company-title {
  display: grid;
  gap: 4px;
  max-width: 980px;
  background: linear-gradient(92deg, #101828 0%, #154ed0 54%, #6387db 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-size: clamp(3rem, 6.8vw, 6rem) !important;
  line-height: 0.96 !important;
  font-weight: 950;
}

.company-title span {
  display: block;
}

.motto {
  margin: 14px 0 0;
  color: #154ed0;
  font-size: clamp(1.25rem, 3vw, 2.1rem);
  font-weight: 900;
  letter-spacing: 0;
}

.landing-copy p:not(.eyebrow) {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-badges span {
  min-height: 34px;
  border: 1px solid rgba(21, 78, 208, 0.22);
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.hero-badges span:hover {
  transform: translateY(-2px);
  border-color: rgba(21, 78, 208, 0.42);
  background: var(--surface-hover);
}

.portal-actions {
  display: grid;
  gap: 14px;
}

.portal-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 132px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(21, 78, 208, 0.1), transparent 40%),
    var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.portal-card::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -80%;
  width: 58%;
  background: var(--shine);
  transform: skewX(-18deg);
  opacity: 0;
  pointer-events: none;
  transition: transform 520ms ease, opacity 180ms ease;
}

.portal-card:hover {
  transform: translateY(-4px);
  border-color: rgba(21, 78, 208, 0.52);
  box-shadow: var(--shadow-hover);
}

.portal-card:hover::after {
  opacity: 0.84;
  transform: translateX(320%) skewX(-18deg);
}

.portal-card.primary {
  border-color: rgba(21, 78, 208, 0.44);
  background: linear-gradient(135deg, #154ed0, #6387db 68%, #219a7a);
  color: #ffffff;
}

.portal-card.advance-card {
  border-color: rgba(107, 146, 174, 0.44);
  background:
    linear-gradient(135deg, rgba(107, 146, 174, 0.2), transparent 42%),
    var(--surface);
}

.portal-card span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
}

.portal-card.primary span {
  color: rgba(255, 255, 255, 0.78);
}

.portal-card strong {
  font-size: 1.72rem;
}

.about-company {
  border-top: 1px solid var(--line);
  padding: 28px 0 44px;
}

.about-company h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.about-company p {
  max-width: 840px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: center;
}

.hero h2 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 5rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero p {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

.actions,
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn,
button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 16px;
  background: linear-gradient(135deg, rgba(21, 78, 208, 0.08), rgba(255, 255, 255, 0.04)), var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(24, 68, 118, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.btn::after,
button::after {
  content: "";
  position: absolute;
  inset: -80% auto -80% -70%;
  width: 46%;
  background: var(--shine);
  transform: skewX(-20deg);
  opacity: 0;
  pointer-events: none;
  transition: transform 420ms ease, opacity 140ms ease;
}

.back-btn::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.btn:hover,
button:hover {
  transform: translateY(-2px);
  border-color: rgba(21, 78, 208, 0.44);
  box-shadow: 0 14px 30px rgba(21, 78, 208, 0.14);
}

.btn:hover::after,
button:hover::after {
  opacity: 0.7;
  transform: translateX(360%) skewX(-20deg);
}

.btn:active,
button:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(24, 68, 118, 0.1);
}

.btn.primary,
button.primary {
  border-color: transparent;
  background: var(--accent);
  color: #ffffff;
}

.btn.success,
button.success {
  border-color: transparent;
  background: var(--accent-2);
  color: #ffffff;
}

.btn.danger,
button.danger {
  border-color: transparent;
  background: var(--danger);
  color: #ffffff;
}

button.ghost {
  border-color: rgba(214, 63, 79, 0.45);
  background: rgba(214, 63, 79, 0.08);
  color: #9f2633;
}

:root[data-theme="dark"] .btn:not(.primary):not(.success):not(.danger),
:root[data-theme="dark"] button:not(.primary):not(.success):not(.danger):not(.ghost) {
  border-color: rgba(122, 167, 255, 0.26);
  background: rgba(19, 39, 58, 0.95);
  color: #f4f9ff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn:not(.primary):not(.success):not(.danger),
  :root:not([data-theme="light"]) button:not(.primary):not(.success):not(.danger):not(.ghost) {
    border-color: rgba(122, 167, 255, 0.26);
    background: rgba(19, 39, 58, 0.95);
    color: #f4f9ff;
  }
}

.btn:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.54;
  transform: none;
  box-shadow: none;
}

.btn:disabled::after,
button:disabled::after {
  display: none;
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(21, 78, 208, 0.08), transparent 42%),
    linear-gradient(315deg, rgba(107, 146, 174, 0.08), transparent 46%),
    var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.58), transparent 30%),
    linear-gradient(315deg, rgba(21, 78, 208, 0.08), transparent 52%);
  mix-blend-mode: screen;
  opacity: 0.72;
}

.panel > * {
  position: relative;
  z-index: 1;
}

.panel.pad {
  padding: 22px;
}

.login-panel {
  width: min(440px, 100%);
  margin-left: auto;
}

.saved-profiles {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.saved-profile-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.saved-profile-heading span,
.saved-profile-main small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.saved-profile-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.saved-profile-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.saved-profile-main strong,
.saved-profile-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-profile-main span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.saved-profile-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.mini-avatar {
  width: 48px;
  height: 48px;
  font-size: 0.9rem;
}

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

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, transform 160ms ease;
}

input::placeholder {
  color: rgba(81, 101, 125, 0.7);
}

input:hover,
select:hover {
  border-color: rgba(21, 78, 208, 0.34);
  background: var(--input-hover);
}

input:focus,
select:focus {
  border-color: rgba(21, 78, 208, 0.58);
  box-shadow: 0 0 0 4px rgba(21, 78, 208, 0.12);
  outline: 0;
}

form {
  display: grid;
  gap: 14px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

#metrics.grid.cols-4 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

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

.attendance-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.attendance-actions button {
  min-height: 58px;
  font-size: 1.08rem;
}

.metric {
  padding: 18px;
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.metric:hover {
  transform: translateY(-3px);
  border-color: rgba(21, 78, 208, 0.34);
  box-shadow: 0 20px 50px rgba(21, 78, 208, 0.11);
}

.metric span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

.profile-card {
  display: grid;
  gap: 18px;
}

.profile-card .row > div:last-child {
  min-width: 0;
}

.avatar {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #154ed0, #6387db);
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36), 0 16px 32px rgba(21, 78, 208, 0.2);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.profile-card:hover .avatar {
  transform: translateY(-2px) scale(1.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 20px 42px rgba(21, 78, 208, 0.26);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  width: fit-content;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  transition: transform 150ms ease, background 150ms ease;
}

.status-chip:hover {
  transform: translateY(-1px);
  background: var(--surface);
}

.status-chip.present {
  border-color: rgba(33, 154, 122, 0.45);
  color: #087154;
}

.status-chip.absent {
  border-color: rgba(214, 63, 79, 0.45);
  color: #b72c3b;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
  background: var(--surface-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  transition: background 130ms ease, color 130ms ease;
}

tbody tr {
  transition: transform 130ms ease, box-shadow 130ms ease;
}

tbody tr:hover td {
  background: rgba(21, 78, 208, 0.055);
}

tbody tr:hover {
  box-shadow: inset 3px 0 0 rgba(21, 78, 208, 0.36);
}

.empty-cell {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

th {
  color: var(--muted);
  background: var(--table-head);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.sticky {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--panel-strong);
}

.message {
  min-height: 22px;
  color: var(--warn);
  font-weight: 700;
}

.camera-box {
  display: grid;
  gap: 12px;
  cursor: pointer;
}

.camera-box button {
  justify-self: stretch;
}

.camera-box video,
.camera-box canvas {
  width: 100%;
  max-height: 280px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--camera-bg);
  object-fit: cover;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.location-quality {
  position: relative;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.location-quality::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--quality, 0%);
  background: linear-gradient(90deg, var(--danger), var(--warn), var(--accent-2));
  opacity: 0.78;
  transition: width 220ms ease;
}

.location-quality span {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

.manual-location {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.manual-location button {
  grid-column: 1 / -1;
}

.compact-panel {
  box-shadow: none;
}

.compact-panel h3,
.compact-panel p {
  margin-top: 0;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px 140px minmax(180px, 1fr) 180px;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, max-content));
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.admin-filter-grid label {
  min-width: 170px;
}

.admin-filter-grid.daily-filter {
  grid-template-columns: minmax(190px, 260px);
}

.admin-filter-grid.monthly-filter {
  grid-template-columns: minmax(130px, 170px) minmax(160px, 220px);
}

.export-modal-card {
  width: min(620px, 100%);
}

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

.export-form fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.export-form legend {
  padding: 0 8px;
  color: var(--muted);
  font-weight: 900;
}

.inline-choice {
  display: inline-flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--text);
}

.inline-choice input {
  width: 18px;
  min-height: 18px;
  height: 18px;
}

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

.btn.mini {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.84rem;
}

.table-actions button {
  min-height: 36px;
  padding: 0 12px;
}

.table-wrap td .btn,
.table-wrap td button {
  white-space: nowrap;
}

.review-actions {
  justify-content: flex-start;
}

.review-actions button {
  min-width: 82px;
  font-weight: 800;
}

.review-approve,
.decision-approve {
  color: #ffffff;
  border-color: rgba(111, 160, 255, 0.78);
  background: linear-gradient(135deg, #3267d8, #78a6ff);
  box-shadow: 0 10px 22px rgba(50, 103, 216, 0.18);
}

.decision-reject {
  color: #ffced4;
  border-color: rgba(255, 99, 114, 0.62);
  background: rgba(255, 99, 114, 0.14);
}

.qr-action,
.map-action,
.selfie-action {
  color: #dff7ff;
  border-color: rgba(42, 190, 205, 0.58);
  background: rgba(42, 190, 205, 0.13);
}

.map-action,
.selfie-action {
  min-width: 86px;
}

.copy-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
}

.copy-inline > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-icon-btn {
  all: unset;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  min-width: 18px;
  height: 18px;
  border-radius: 4px;
  color: #aecaef;
  opacity: 0.84;
  cursor: pointer;
  vertical-align: middle;
  transition: color 140ms ease, opacity 140ms ease, background 140ms ease;
}

.copy-icon-btn:hover,
.copy-icon-btn:focus-visible {
  transform: none;
  box-shadow: none;
  opacity: 1;
  color: #ffffff;
  background: rgba(111, 160, 255, 0.1);
}

.copy-icon-btn::after {
  content: none;
}

.copy-svg {
  width: 17px;
  height: 17px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  transform: translate(-50%, 12px);
  pointer-events: none;
  opacity: 0;
  padding: 10px 14px;
  border: 1px solid rgba(111, 160, 255, 0.42);
  border-radius: 999px;
  color: #f5f8ff;
  background: rgba(12, 28, 46, 0.92);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
  font-size: 0.92rem;
  font-weight: 800;
  transition: opacity 160ms ease, transform 160ms ease;
}

.site-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.site-toast[data-type="error"] {
  border-color: rgba(255, 99, 114, 0.58);
  color: #ffd2d7;
}

.bulk-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 0 0 12px;
}

.bulk-toolbar button {
  min-height: 38px;
}

.bulk-check {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.selectable-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.selectable-row button {
  min-height: 36px;
}

.settings-form {
  max-width: 520px;
}

.maintenance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.maintenance-grid .compact-panel {
  display: flex;
  min-height: 238px;
  flex-direction: column;
  align-items: flex-start;
}

.maintenance-grid .compact-panel p {
  flex: 1;
}

.maintenance-grid .compact-panel button {
  min-width: 172px;
}

.file-picker input {
  padding-top: 10px;
}

.progress-track {
  position: relative;
  height: 14px;
  border: 1px solid rgba(21, 78, 208, 0.22);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: inset 0 1px 4px rgba(24, 68, 118, 0.1);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #154ed0, #6387db, #219a7a);
  box-shadow: 0 0 18px rgba(21, 78, 208, 0.38);
  transition: width 260ms ease;
}

.mini-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.mini-list > div,
.notice {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.mini-list > div:hover,
.notice:hover {
  transform: translateY(-2px);
  border-color: rgba(21, 78, 208, 0.3);
  background: var(--surface-hover);
  box-shadow: 0 16px 38px rgba(21, 78, 208, 0.1);
}

.notice p {
  margin: 6px 0;
  color: var(--text);
}

.notice span {
  color: var(--muted);
  font-size: 0.84rem;
}

.suspicious-row td {
  background: rgba(185, 130, 0, 0.09);
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.tab {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
}

.tab.active {
  border-color: var(--accent);
  color: var(--accent);
}

.hidden {
  display: none !important;
}

.mode-switch {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.mode-pill {
  min-height: 38px;
  border: 0;
  background: transparent;
}

.mode-pill.active {
  background: linear-gradient(135deg, #154ed0, #6387db);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(21, 78, 208, 0.16);
}

.photo-preview {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.photo-preview img {
  display: none;
  width: 160px;
  height: 160px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--surface);
  box-shadow: 0 18px 36px rgba(24, 68, 118, 0.12);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.photo-preview img.ready:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 24px 50px rgba(21, 78, 208, 0.16);
}

.photo-preview img.ready {
  display: block;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(16, 32, 51, 0.38);
  backdrop-filter: blur(12px);
  animation: modalFade 180ms ease;
}

.modal-card {
  width: min(520px, 100%);
  animation: modalLift 220ms ease;
}

.worker-modal-card {
  width: min(860px, 100%);
}

.worker-flow-card {
  max-width: 420px;
  text-align: center;
}

.confirm-card {
  text-align: center;
}

.confirm-card label {
  margin-top: 14px;
  text-align: left;
}

.confirm-icon {
  display: inline-grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  place-items: center;
  border-radius: 999px;
  background: rgba(214, 63, 79, 0.13);
  color: var(--danger);
  font-size: 1.45rem;
  font-weight: 900;
}

.confirm-card h2 {
  margin: 0 0 8px;
}

.flow-icon {
  display: inline-grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 999px;
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1;
}

.flow-icon.working {
  color: #154ed0;
  background: rgba(21, 78, 208, 0.12);
}

.flow-icon.success {
  color: #087154;
  background: rgba(33, 154, 122, 0.14);
}

.flow-icon.error {
  color: #b72c3b;
  background: rgba(214, 63, 79, 0.12);
}

.worker-flow-card h2 {
  margin-bottom: 8px;
}

.worker-flow-card .progress-track {
  margin: 16px 0 0;
}

.worker-flow-card button {
  width: 100%;
  margin-top: 16px;
}

.modal-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.selfie-preview {
  display: block;
  width: 100%;
  max-height: 68vh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  object-fit: contain;
  background: var(--surface);
}

.worker-edit-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1fr);
  gap: 18px;
  align-items: start;
}

.modal-photo {
  margin: 0;
}

.modal-photo img,
.modal-photo img.ready {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.admin-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 344px minmax(0, 1fr);
  gap: 32px;
  width: min(1720px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 0;
}

.admin-sidebar {
  position: sticky;
  top: 32px;
  display: grid;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  align-content: start;
  padding: 22px;
  scrollbar-width: thin;
}

.admin-brand {
  margin-bottom: 16px;
}

.admin-sidebar h1 {
  margin: 0 0 24px;
  color: var(--accent);
  font-size: 1.8rem;
}

.admin-nav {
  display: grid;
  gap: 10px;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 58px;
  border-color: transparent;
  padding: 0 18px;
  color: var(--muted);
  background: transparent;
  font-size: 1rem;
  box-shadow: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

a.nav-item {
  text-decoration: none;
}

.nav-item::after {
  display: none;
}

.nav-item:hover {
  transform: translateX(3px);
  background: rgba(21, 78, 208, 0.07);
  color: #154ed0;
}

.nav-item.active {
  border-color: rgba(21, 78, 208, 0.42);
  background: rgba(21, 78, 208, 0.12);
  color: #154ed0;
  box-shadow: inset 3px 0 0 rgba(21, 78, 208, 0.78);
}

.admin-sidebar-footer {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.logout-link {
  color: #fb7185;
  background: transparent;
  border-color: transparent;
}

.admin-main {
  min-width: 0;
  padding: 28px 34px 36px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.admin-tab h2,
.quick-actions h2 {
  margin: 0 0 20px;
  font-size: 1.85rem;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.admin-metric {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 142px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 30px;
  background: var(--surface);
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.admin-metric::after {
  content: "";
  position: absolute;
  inset: -60% auto -60% -80%;
  width: 46%;
  background: var(--shine);
  transform: skewX(-18deg);
  opacity: 0;
  pointer-events: none;
  transition: transform 500ms ease, opacity 160ms ease;
}

.admin-metric:hover {
  transform: translateY(-4px);
  background: var(--surface-hover);
  box-shadow: var(--shadow-hover);
}

.admin-metric:hover::after {
  opacity: 0.72;
  transform: translateX(360%) skewX(-18deg);
}

.metric-icon {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 18px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54);
  transition: transform 180ms ease;
}

.admin-metric:hover .metric-icon {
  transform: scale(1.04);
}

.admin-metric span {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 800;
}

.admin-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 2.15rem;
}

.admin-metric.blue {
  border-color: rgba(21, 78, 208, 0.34);
}

.admin-metric.blue .metric-icon {
  background: rgba(21, 78, 208, 0.12);
  color: #154ed0;
}

.admin-metric.green {
  border-color: rgba(33, 154, 122, 0.34);
}

.admin-metric.green .metric-icon {
  background: rgba(33, 154, 122, 0.12);
  color: #087154;
}

.admin-metric.red {
  border-color: rgba(214, 63, 79, 0.34);
}

.admin-metric.red .metric-icon {
  background: rgba(214, 63, 79, 0.12);
  color: #b72c3b;
}

.admin-metric.orange {
  border-color: rgba(185, 130, 0, 0.34);
}

.admin-metric.orange .metric-icon {
  background: rgba(185, 130, 0, 0.12);
  color: #9a6b00;
}

.admin-metric.purple {
  border-color: rgba(107, 146, 174, 0.34);
}

.admin-metric.purple .metric-icon {
  background: rgba(107, 146, 174, 0.14);
  color: #416b89;
}

.admin-metric.slate .metric-icon {
  background: rgba(81, 101, 125, 0.12);
  color: #51657d;
}

.quick-actions {
  margin-top: 42px;
}

.admin-mobile-head {
  display: contents;
}

.admin-menu-toggle {
  display: none;
}

@keyframes backgroundDrift {
  from {
    background-position: 0 0, 0 0;
  }

  to {
    background-position: 80px 42px, -70px 58px;
  }
}

@keyframes modalFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modalLift {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 820px) {
  .landing-hero,
  .hero-grid,
  .grid.cols-4,
  #metrics.grid.cols-4,
  .grid.cols-2,
  .attendance-actions {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 14px;
  }

  .actions {
    width: 100%;
  }

  .actions .btn,
  .actions button {
    flex: 1 1 180px;
  }

  .landing-hero {
    min-height: auto;
    padding: 18px 0 28px;
  }

  .portal-card {
    min-height: 84px;
    padding: 16px;
  }

  .landing-copy h2,
  .hero h2 {
    line-height: 1.03;
  }

  .login-panel {
    margin-left: 0;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .admin-filter-grid,
  .admin-filter-grid.daily-filter,
  .admin-filter-grid.monthly-filter,
  .maintenance-grid {
    grid-template-columns: 1fr;
  }

  .manual-location {
    grid-template-columns: 1fr;
  }

  .worker-edit-layout {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 680px;
  }
}

@media (max-width: 1180px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: relative;
    top: auto;
    min-height: auto;
  }

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

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

@media (max-width: 720px) {
  .admin-shell {
    width: min(100% - 18px, 1720px);
    gap: 16px;
    padding: 12px 0;
  }

  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-height: 44px;
    padding: 0 14px;
    scroll-snap-align: start;
  }

  .admin-header {
    flex-direction: column;
  }

  .admin-main {
    padding: 18px 14px;
  }

  .admin-sidebar {
    padding: 16px;
  }

  .admin-sidebar h1 {
    margin-bottom: 14px;
    font-size: 1.35rem;
  }

  .admin-sidebar-footer {
    margin-top: 14px;
  }

  .admin-metric {
    min-height: 96px;
    padding: 18px;
  }

  .metric-icon {
    width: 56px;
    height: 56px;
  }

  .admin-metric strong {
    font-size: 1.7rem;
  }
}

@media (min-width: 560px) and (max-width: 820px) {
  .portal-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-card strong {
    font-size: 1.35rem;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 18px, 1160px);
    padding-top: 12px;
  }

  .brand {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .brand-logo {
    width: min(310px, 90vw);
    max-height: 136px;
  }

  .brand h1 {
    font-size: 0.95rem;
  }

  .brand p {
    font-size: 0.86rem;
  }

  .landing-copy h2,
  .company-title {
    font-size: 2.75rem !important;
    line-height: 0.94 !important;
  }

  .landing-copy p:not(.eyebrow),
  .hero p,
  .about-company p {
    font-size: 0.96rem;
    line-height: 1.58;
  }

  .btn,
  button {
    width: 100%;
  }

  .panel.pad {
    padding: 16px;
  }

  .avatar {
    width: 64px;
    height: 64px;
    font-size: 1.35rem;
  }

  .admin-tab h2,
  .quick-actions h2 {
    font-size: 1.35rem;
  }

  .table-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 820px) {
  html {
    width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
  }

  body {
    width: 100%;
    overflow-x: hidden;
    background:
      linear-gradient(135deg, transparent 0 72%, rgba(99, 135, 219, 0.14) 72% 78%, transparent 78%),
      var(--bg);
  }

  body::before {
    opacity: 0.42;
    animation: none;
    background-size: 300px 300px, 360px 360px;
  }

  .shell,
  .admin-shell {
    width: 100%;
    max-width: 100%;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .shell {
    padding-top: 10px;
    padding-bottom: 24px;
  }

  .landing {
    min-height: auto;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 12;
    margin: 0 -12px 14px;
    padding: 10px 12px;
    border: 1px solid rgba(35, 76, 130, 0.12);
    border-radius: 0 0 14px 14px;
    background: rgba(248, 253, 253, 0.92);
    backdrop-filter: blur(18px);
    box-shadow: 0 14px 36px rgba(24, 68, 118, 0.1);
  }

  .brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .brand-logo {
    width: min(220px, 66vw);
    max-height: 82px;
  }

  .brand span {
    min-width: 0;
  }

  .brand h1 {
    font-size: clamp(0.94rem, 3.8vw, 1.08rem);
    line-height: 1.18;
    overflow-wrap: anywhere;
  }

  .brand p,
  .muted,
  label {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .landing-hero,
  .hero-grid {
    gap: 16px;
    align-items: stretch;
    padding: 10px 0 24px;
  }

  .hero {
    min-height: auto;
    align-items: start;
    padding-bottom: 24px;
  }

  .landing-copy h2,
  .company-title {
    font-size: clamp(2.35rem, 13vw, 3.8rem) !important;
    line-height: 0.96 !important;
    overflow-wrap: anywhere;
  }

  .hero h2 {
    font-size: clamp(2rem, 10vw, 3.1rem);
    line-height: 1.02;
    overflow-wrap: anywhere;
  }

  .motto {
    margin-top: 10px;
    font-size: clamp(1.05rem, 5vw, 1.45rem);
  }

  .landing-copy p:not(.eyebrow),
  .hero p,
  .about-company p {
    max-width: 100%;
    font-size: 0.98rem;
    line-height: 1.62;
  }

  .hero-badges {
    gap: 8px;
    margin-top: 16px;
  }

  .hero-badges span {
    min-height: 32px;
    padding: 7px 10px;
    font-size: 0.8rem;
  }

  .portal-actions,
  .grid,
  form,
  .profile-card,
  .camera-box,
  .mini-list {
    gap: 12px;
  }

  .portal-card,
  .panel.pad,
  .compact-panel,
  .notice,
  .mini-list > div {
    border-radius: 12px;
  }

  .portal-card {
    width: 100%;
    min-height: 92px;
    padding: 16px;
  }

  .portal-card strong {
    font-size: clamp(1.25rem, 5vw, 1.55rem);
    line-height: 1.14;
  }

  .about-company {
    padding: 22px 0 28px;
  }

  .btn,
  button {
    min-height: 48px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 0.98rem;
  }

  .actions {
    gap: 9px;
  }

  input,
  select,
  textarea {
    min-height: 48px;
    border-radius: 10px;
    font-size: 16px;
  }

  input[type="file"] {
    min-height: 52px;
    padding-top: 12px;
  }

  .mode-switch {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
    border-radius: 12px;
  }

  .mode-pill {
    width: 100%;
    min-height: 44px;
  }

  .login-panel,
  .settings-form,
  .export-modal-card,
  .modal-card,
  .worker-modal-card {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
  }

  .panel.pad {
    padding: 16px;
  }

  .profile-card .row {
    align-items: flex-start;
    flex-wrap: nowrap;
  }

  .avatar {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    font-size: 1rem;
  }

  #workerName,
  #advanceWorkerName {
    font-size: 1.22rem !important;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .camera-box video,
  .camera-box canvas {
    max-height: none;
    aspect-ratio: 3 / 4;
  }

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

  .attendance-actions button {
    min-height: 54px;
  }

  .photo-preview img {
    width: min(180px, 100%);
    height: auto;
    aspect-ratio: 1;
  }

  .modal {
    align-items: end;
    padding: 12px;
    background: rgba(5, 18, 29, 0.34);
    backdrop-filter: blur(18px);
  }

  .modal-card {
    max-height: calc(100vh - 24px);
    overflow: auto;
    border-radius: 18px 18px 12px 12px;
    box-shadow: 0 -18px 64px rgba(16, 32, 51, 0.18);
  }

  .worker-flow-card,
  .confirm-card {
    border-radius: 22px 22px 14px 14px;
    padding: 20px 16px 16px;
  }

  .selfie-preview {
    max-height: 72vh;
  }

  .export-period-controls {
    grid-template-columns: 1fr;
  }

  .export-form fieldset {
    gap: 8px;
    padding: 12px;
  }

  .inline-choice {
    min-height: 40px;
    padding-right: 8px;
  }

  .admin-shell {
    display: block;
    min-height: auto;
    padding-top: 0;
    padding-bottom: 18px;
  }

  .admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 18;
    display: block;
    min-height: 0;
    margin: 0 -12px 12px;
    padding: 10px 12px;
    border-width: 0 0 1px;
    border-radius: 0 0 16px 16px;
    background:
      linear-gradient(135deg, rgba(21, 78, 208, 0.08), transparent 46%),
      rgba(248, 253, 253, 0.95);
    box-shadow: 0 16px 42px rgba(24, 68, 118, 0.13);
  }

  .admin-brand {
    display: none;
  }

  .admin-mobile-head {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .admin-sidebar h1 {
    margin: 0;
    font-size: clamp(1.18rem, 5vw, 1.45rem);
    line-height: 1.15;
  }

  .admin-menu-toggle {
    display: inline-grid;
    flex: 0 0 auto;
    width: 48px;
    min-height: 48px;
    place-items: center;
    gap: 4px;
    padding: 11px;
    border-color: rgba(21, 78, 208, 0.18);
    background: var(--surface);
  }

  .admin-menu-toggle::after {
    display: none;
  }

  .admin-menu-toggle span {
    display: block;
    width: 21px;
    height: 2px;
    border-radius: 999px;
    background: #154ed0;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .admin-menu-open .admin-menu-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .admin-menu-open .admin-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .admin-menu-open .admin-menu-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .admin-nav-wrap {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    transition: grid-template-rows 220ms ease;
  }

  .admin-menu-open .admin-nav-wrap {
    grid-template-rows: 1fr;
  }

  .admin-nav-wrap > * {
    min-height: 0;
  }

  .admin-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 12px;
  }

  .admin-sidebar-footer {
    gap: 8px;
    margin-top: 8px;
    padding-bottom: 4px;
  }

  .nav-item,
  .logout-link {
    width: 100%;
    min-height: 48px;
    justify-content: flex-start;
    padding: 0 14px;
    border-radius: 10px;
    background: var(--surface);
  }

  .nav-item:hover {
    transform: none;
  }

  .admin-main {
    width: 100%;
    padding: 16px 12px 20px;
    border-radius: 14px;
  }

  .admin-header {
    gap: 12px;
    margin-bottom: 18px;
  }

  .admin-header .actions,
  .quick-actions .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-tab h2,
  .quick-actions h2 {
    margin-bottom: 14px;
    font-size: clamp(1.35rem, 6vw, 1.65rem);
    line-height: 1.16;
  }

  .admin-metrics {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .admin-metric {
    min-height: 96px;
    gap: 14px;
    padding: 16px;
    border-radius: 12px;
  }

  .metric-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }

  .admin-metric span {
    font-size: 0.88rem;
  }

  .admin-metric strong {
    font-size: 1.65rem;
  }

  .quick-actions {
    margin-top: 18px;
  }

  .inline-form,
  .admin-filter-grid,
  .admin-filter-grid.daily-filter,
  .admin-filter-grid.monthly-filter,
  .maintenance-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .admin-filter-grid label {
    min-width: 0;
  }

  .bulk-toolbar {
    justify-content: stretch;
  }

  .bulk-toolbar button {
    width: 100%;
  }

  .table-wrap {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
  }

  table {
    min-width: 720px;
  }

  th,
  td {
    padding: 10px;
    font-size: 0.86rem;
  }

  .sticky {
    position: static;
  }

  .table-actions {
    flex-direction: row;
    align-items: center;
  }

  .table-actions button,
  .selectable-row button {
    width: auto;
    min-height: 40px;
  }

  .selectable-row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .selectable-row button {
    grid-column: 2;
    justify-self: start;
  }

  .maintenance-grid .compact-panel {
    min-height: auto;
  }

  .worker-edit-layout {
    grid-template-columns: 1fr;
  }

  .modal-photo img,
  .modal-photo img.ready {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .progress-track {
    height: 12px;
  }

  .portal-card::after,
  .admin-metric::after,
  .btn::after,
  button::after {
    display: none;
  }

  .portal-card:hover,
  .admin-metric:hover,
  .metric:hover,
  .notice:hover,
  .mini-list > div:hover,
  .btn:hover,
  button:hover,
  .photo-preview img.ready:hover,
  .profile-card:hover .avatar {
    transform: none;
  }
}

@media (min-width: 821px) {
  .admin-nav-wrap {
    display: contents;
  }
}

@media (min-width: 560px) and (max-width: 1180px) {
  .admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 821px) and (max-width: 1180px) {
  .admin-sidebar {
    position: relative;
    top: auto;
    min-height: auto;
  }

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

@media (max-width: 430px) {
  .shell,
  .admin-shell {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  .topbar,
  .admin-sidebar {
    margin-left: -10px;
    margin-right: -10px;
  }

  .brand-logo {
    width: min(184px, 58vw);
    max-height: 72px;
  }

  .landing-copy h2,
  .company-title {
    font-size: clamp(2.1rem, 12.5vw, 3.15rem) !important;
  }

  .portal-card,
  .panel.pad {
    padding: 14px;
  }

  .admin-main {
    padding: 14px 10px 18px;
  }

  .admin-header .actions .btn,
  .admin-header .actions button {
    width: 100%;
  }

  table {
    min-width: 680px;
  }
}

@media (max-width: 360px) {
  .brand-logo {
    width: min(158px, 54vw);
  }

  .brand h1 {
    font-size: 0.9rem;
  }

  .brand p {
    font-size: 0.78rem;
  }

  .landing-copy h2,
  .company-title {
    font-size: 2rem !important;
  }

  .hero h2 {
    font-size: 1.82rem;
  }

  .btn,
  button {
    padding: 0 12px;
  }

  .admin-metric {
    padding: 14px;
  }
}

@media (max-width: 820px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
  }

  body {
    background-size: 170px 170px, 190px 190px;
  }

  .shell,
  .admin-shell {
    width: 100%;
    gap: 12px;
    padding: 10px max(10px, env(safe-area-inset-right)) 18px max(10px, env(safe-area-inset-left));
  }

  .panel,
  .portal-card,
  .notice,
  .compact-panel {
    border-radius: 12px;
  }

  .panel.pad,
  .portal-card,
  .notice,
  .compact-panel {
    padding: 12px;
  }

  .topbar {
    margin: -10px -10px 12px;
    padding: 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .admin-sidebar {
    margin: -10px -10px 12px;
    padding: 10px;
    border-width: 0 0 1px;
    border-radius: 0 0 14px 14px;
    box-shadow: 0 10px 28px rgba(24, 68, 118, 0.11);
  }

  .brand {
    gap: 10px;
  }

  .brand-logo {
    width: 56px;
    height: 56px;
    max-height: 56px;
  }

  .brand h1,
  .admin-sidebar h1 {
    font-size: clamp(1rem, 4.6vw, 1.18rem);
    line-height: 1.12;
  }

  .brand p,
  .muted,
  .helper,
  .message,
  .compact-panel p {
    font-size: 0.84rem;
    line-height: 1.45;
  }

  h1,
  h2,
  h3,
  .admin-tab h2,
  .quick-actions h2 {
    letter-spacing: 0;
    line-height: 1.14;
  }

  .admin-tab h2,
  .quick-actions h2 {
    margin-bottom: 10px;
    font-size: clamp(1.24rem, 5.8vw, 1.52rem);
  }

  .landing-copy h2,
  .company-title,
  .hero h2 {
    font-size: clamp(1.65rem, 8vw, 2.15rem) !important;
  }

  .btn,
  button {
    min-height: 42px;
    padding: 0 12px;
    border-radius: 9px;
    font-size: 0.92rem;
    line-height: 1.15;
  }

  input,
  select,
  textarea {
    min-height: 42px;
    padding: 0 10px;
    border-radius: 9px;
    font-size: 16px;
  }

  textarea {
    min-height: 84px;
    padding-top: 10px;
  }

  input[type="file"] {
    min-height: 44px;
    padding-top: 8px;
  }

  label {
    gap: 6px;
    font-size: 0.84rem;
  }

  .grid,
  .grid.cols-2,
  .grid.cols-4,
  form,
  .profile-card,
  .portal-actions,
  .mini-list,
  .attendance-actions,
  .inline-form,
  .admin-filter-grid,
  .admin-filter-grid.daily-filter,
  .admin-filter-grid.monthly-filter,
  .maintenance-grid {
    gap: 10px;
  }

  .hero-grid,
  .landing-hero {
    gap: 12px;
    padding: 6px 0 16px;
  }

  .admin-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .admin-menu-toggle {
    display: inline-grid;
    flex: 0 0 42px;
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 9px;
    place-items: center;
    gap: 4px;
    border-color: rgba(21, 78, 208, 0.2);
    background: var(--surface);
  }

  .admin-menu-toggle span {
    width: 20px;
    height: 2px;
  }

  .admin-menu-toggle::after {
    display: none;
  }

  .admin-nav-wrap {
    display: block;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transition: max-height 220ms ease, opacity 160ms ease, transform 180ms ease;
  }

  .admin-menu-open .admin-nav-wrap {
    max-height: calc(100vh - 78px);
    opacity: 1;
    overflow-y: auto;
    pointer-events: auto;
    transform: translateY(0);
    -webkit-overflow-scrolling: touch;
  }

  .admin-nav {
    gap: 6px;
    padding-top: 10px;
  }

  .admin-sidebar-footer {
    gap: 6px;
    margin-top: 6px;
    padding-bottom: 2px;
  }

  .nav-item,
  .logout-link {
    min-height: 42px;
    padding: 0 12px;
    border-radius: 9px;
    font-size: 0.92rem;
  }

  .admin-main {
    width: 100%;
    padding: 12px 10px 16px;
    border-radius: 12px;
  }

  .admin-header {
    gap: 8px;
    margin-bottom: 12px;
  }

  .admin-header .actions,
  .quick-actions .actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .admin-header .actions .btn,
  .admin-header .actions button,
  .quick-actions .actions .btn,
  .quick-actions .actions button {
    width: 100%;
  }

  .back-btn {
    width: auto;
    min-width: 116px;
    max-width: 160px;
  }

  .admin-metrics {
    gap: 8px;
  }

  .admin-metric {
    min-height: 72px;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
  }

  .metric-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 0.86rem;
  }

  .admin-metric span {
    font-size: 0.82rem;
  }

  .admin-metric strong {
    margin-top: 2px;
    font-size: 1.35rem;
  }

  .quick-actions {
    margin-top: 12px;
  }

  .maintenance-grid .compact-panel {
    min-height: auto;
  }

  .compact-panel h3 {
    margin-bottom: 8px;
    font-size: 1.05rem;
  }

  .compact-panel p {
    margin-bottom: 10px;
  }

  .photo-preview {
    gap: 8px;
    margin: 10px 0;
  }

  .photo-preview img,
  .profile-card .avatar {
    max-width: 140px;
  }

  .table-wrap {
    width: 100%;
    max-width: 100%;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 12px;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 640px;
  }

  #monthlyTable {
    min-width: 900px;
  }

  th,
  td {
    padding: 8px 9px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  th {
    font-size: 0.72rem;
  }

  .sticky {
    position: sticky;
    left: 0;
    z-index: 2;
    background: rgba(245, 251, 252, 0.98);
  }

  #monthlyTable .sticky {
    min-width: 168px;
  }

  .table-actions {
    gap: 6px;
  }

  .table-actions button,
  .selectable-row button,
  td button {
    width: auto;
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.8rem;
  }

  .modal-card {
    width: min(100%, 420px);
    max-height: calc(100vh - 28px);
    padding: 14px;
    border-radius: 12px;
  }

  .modal-actions {
    gap: 8px;
  }

  .modal-actions button,
  .modal-actions .btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .admin-header .actions {
    grid-template-columns: 1fr;
  }

  .portal-card {
    min-height: 72px;
  }

  .selectable-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  table {
    min-width: 620px;
  }

  #monthlyTable {
    min-width: 860px;
  }
}

@media (max-width: 380px) {
  .shell,
  .admin-shell {
    padding-left: 8px;
    padding-right: 8px;
  }

  .topbar,
  .admin-sidebar {
    margin-left: -8px;
    margin-right: -8px;
  }

  .panel.pad,
  .portal-card,
  .notice,
  .compact-panel,
  .admin-main {
    padding: 10px;
  }

  .btn,
  button,
  input,
  select {
    min-height: 40px;
  }
}

@media (max-width: 820px) {
  .landing .topbar {
    margin: -10px -10px 12px;
    padding: 10px 14px;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
  }

  .landing .brand {
    justify-content: flex-start;
    text-align: left;
    gap: 10px;
  }

  .landing .brand-logo {
    width: 58px;
    height: 58px;
    max-height: 58px;
  }

  .landing .brand h1 {
    font-size: clamp(0.98rem, 4.6vw, 1.18rem);
    line-height: 1.12;
  }

  .landing .brand p {
    font-size: 0.78rem;
    line-height: 1.2;
  }

  .landing .landing-hero {
    display: grid;
    min-height: auto;
    padding: 6px 0 16px;
  }

  .landing .landing-copy {
    display: block;
  }

  .landing .portal-actions {
    gap: 10px;
  }

  .landing .portal-card {
    min-height: 84px;
  }

  .back-btn {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 12px;
    font-size: 0;
  }

  .back-btn::before {
    width: 12px;
    height: 12px;
    margin-right: 0;
    border-left-width: 2.5px;
    border-bottom-width: 2.5px;
  }

  .admin-header > .actions {
    display: none;
  }

  .admin-header {
    margin-bottom: 10px;
  }

  .admin-menu-toggle {
    position: relative;
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 9px;
    border-radius: 12px;
    gap: 4px;
  }

  .admin-menu-toggle span {
    width: 22px;
    height: 2.5px;
    transform-origin: center;
  }

  .admin-menu-open .admin-menu-toggle {
    color: #154ed0;
  }

  .admin-menu-open .admin-menu-toggle span {
    opacity: 0;
    transform: scaleX(0);
  }

  .admin-menu-open .admin-menu-toggle::before,
  .admin-menu-open .admin-menu-toggle::after {
    content: "";
    position: absolute;
    inset: auto;
    left: 50%;
    top: 50%;
    display: block;
    width: 28px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: none;
    opacity: 1;
    pointer-events: none;
    transition: none;
    transform-origin: center;
  }

  .admin-menu-open .admin-menu-toggle::before {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .admin-menu-open .admin-menu-toggle::after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  .admin-menu-open .admin-menu-toggle span:nth-child(1) {
    transform: scaleX(0);
  }

  .admin-menu-open .admin-menu-toggle span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .admin-menu-open .admin-menu-toggle span:nth-child(3) {
    transform: scaleX(0);
  }

  .admin-nav .nav-item {
    align-items: center;
    display: flex;
    min-height: 44px;
    padding: 0 16px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
  }

  .admin-nav a.nav-item {
    display: flex;
    color: var(--muted);
  }

  .admin-nav a.nav-item:hover {
    color: #154ed0;
  }

  #workerForm > button.primary {
    width: 100%;
  }
}

@media (min-width: 821px) {
  #workerForm > button.primary {
    min-width: 220px;
    padding-inline: 28px;
  }
}

@media (max-width: 820px) {
  .worker-page .worker-gate > div:first-child h2,
  .worker-page .worker-gate > div:first-child p {
    display: none;
  }

  .worker-page .worker-gate {
    padding-top: 0;
  }

  .worker-page .mode-switch {
    margin-top: 0;
  }

  .maintenance-grid .compact-panel {
    min-height: auto;
  }

  .maintenance-grid .compact-panel button {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 820px) {
  .worker-page.worker-attendance-active,
  .worker-page:has(#profilePanel:not(.hidden)) {
    height: 100dvh;
    overflow: hidden;
  }

  .worker-page.worker-attendance-active .shell,
  .worker-page:has(#profilePanel:not(.hidden)) .shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    height: 100dvh;
    padding: 8px 10px 10px;
    overflow: hidden;
  }

  .worker-page.worker-attendance-active .topbar,
  .worker-page:has(#profilePanel:not(.hidden)) .topbar {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0 0 8px;
  }

  .worker-page.worker-attendance-active .brand,
  .worker-page:has(#profilePanel:not(.hidden)) .brand {
    gap: 8px;
  }

  .worker-page.worker-attendance-active .brand-logo,
  .worker-page:has(#profilePanel:not(.hidden)) .brand-logo {
    width: 48px;
    max-height: 48px;
  }

  .worker-page.worker-attendance-active .brand h1,
  .worker-page:has(#profilePanel:not(.hidden)) .brand h1 {
    font-size: 0.96rem;
    line-height: 1.08;
  }

  .worker-page.worker-attendance-active .brand p,
  .worker-page.worker-attendance-active .actions,
  .worker-page.worker-attendance-active #siteMeta,
  .worker-page.worker-attendance-active #locationMapLink,
  .worker-page:has(#profilePanel:not(.hidden)) .brand p,
  .worker-page:has(#profilePanel:not(.hidden)) .actions,
  .worker-page:has(#profilePanel:not(.hidden)) #siteMeta,
  .worker-page:has(#profilePanel:not(.hidden)) #locationMapLink {
    display: none;
  }

  .worker-page.worker-attendance-active .worker-gate,
  .worker-page:has(#profilePanel:not(.hidden)) .worker-gate {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
    min-height: 0;
    padding: 0;
  }

  .worker-page.worker-attendance-active .worker-gate > div:first-child,
  .worker-page:has(#profilePanel:not(.hidden)) .worker-gate > div:first-child {
    min-height: 0;
  }

  .worker-page.worker-attendance-active .mode-switch,
  .worker-page:has(#profilePanel:not(.hidden)) .mode-switch {
    min-height: 40px;
  }

  .worker-page.worker-attendance-active .mode-pill,
  .worker-page:has(#profilePanel:not(.hidden)) .mode-pill {
    min-height: 36px;
    font-size: 0.88rem;
  }

  .worker-page.worker-attendance-active #profilePanel,
  .worker-page:has(#profilePanel:not(.hidden)) #profilePanel {
    align-self: stretch;
    min-height: 0;
    padding: 10px;
    overflow: hidden;
  }

  .worker-page.worker-attendance-active .profile-card,
  .worker-page:has(#profilePanel:not(.hidden)) .profile-card {
    height: 100%;
    min-height: 0;
    gap: 8px;
    grid-template-rows: auto auto minmax(150px, 1fr) auto auto auto auto;
  }

  .worker-page.worker-attendance-active .profile-card .row,
  .worker-page:has(#profilePanel:not(.hidden)) .profile-card .row {
    gap: 8px;
  }

  .worker-page.worker-attendance-active .avatar,
  .worker-page:has(#profilePanel:not(.hidden)) .avatar {
    width: 44px;
    height: 44px;
    font-size: 0.82rem;
  }

  .worker-page.worker-attendance-active #workerName,
  .worker-page:has(#profilePanel:not(.hidden)) #workerName {
    font-size: 1rem !important;
  }

  .worker-page.worker-attendance-active #workerMeta,
  .worker-page.worker-attendance-active .muted,
  .worker-page:has(#profilePanel:not(.hidden)) #workerMeta,
  .worker-page:has(#profilePanel:not(.hidden)) .muted {
    font-size: 0.78rem;
    line-height: 1.25;
  }

  .worker-page.worker-attendance-active .status-chip,
  .worker-page:has(#profilePanel:not(.hidden)) .status-chip {
    min-height: 24px;
    padding: 0 8px;
    font-size: 0.72rem;
  }

  .worker-page.worker-attendance-active .camera-box,
  .worker-page:has(#profilePanel:not(.hidden)) .camera-box {
    min-height: 0;
    gap: 6px;
  }

  .worker-page.worker-attendance-active .camera-box video,
  .worker-page.worker-attendance-active .camera-box canvas,
  .worker-page:has(#profilePanel:not(.hidden)) .camera-box video,
  .worker-page:has(#profilePanel:not(.hidden)) .camera-box canvas {
    height: 100%;
    min-height: 130px;
    max-height: 28dvh;
    aspect-ratio: auto;
    object-fit: cover;
  }

  .worker-page.worker-attendance-active #selfieStatus,
  .worker-page.worker-attendance-active #locationStatus,
  .worker-page.worker-attendance-active #attendanceMessage,
  .worker-page:has(#profilePanel:not(.hidden)) #selfieStatus,
  .worker-page:has(#profilePanel:not(.hidden)) #locationStatus,
  .worker-page:has(#profilePanel:not(.hidden)) #attendanceMessage {
    margin: 0;
    min-height: 0;
  }

  .worker-page.worker-attendance-active #captureSelfieBtn,
  .worker-page.worker-attendance-active #workerLogout,
  .worker-page:has(#profilePanel:not(.hidden)) #captureSelfieBtn,
  .worker-page:has(#profilePanel:not(.hidden)) #workerLogout {
    min-height: 38px;
    font-size: 0.88rem;
  }

  .worker-page.worker-attendance-active .compact-panel,
  .worker-page:has(#profilePanel:not(.hidden)) .compact-panel {
    padding: 8px 10px;
  }

  .worker-page.worker-attendance-active .compact-panel strong,
  .worker-page:has(#profilePanel:not(.hidden)) .compact-panel strong {
    display: none;
  }

  .worker-page.worker-attendance-active .attendance-actions,
  .worker-page:has(#profilePanel:not(.hidden)) .attendance-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .worker-page.worker-attendance-active .attendance-actions button,
  .worker-page:has(#profilePanel:not(.hidden)) .attendance-actions button {
    min-height: 48px;
    font-size: 0.98rem;
  }
}

@media (max-width: 380px), (max-height: 680px) {
  .worker-page.worker-attendance-active .shell,
  .worker-page:has(#profilePanel:not(.hidden)) .shell {
    padding: 6px 8px 8px;
  }

  .worker-page.worker-attendance-active .topbar,
  .worker-page:has(#profilePanel:not(.hidden)) .topbar {
    padding-bottom: 6px;
  }

  .worker-page.worker-attendance-active .brand-logo,
  .worker-page:has(#profilePanel:not(.hidden)) .brand-logo {
    width: 40px;
    max-height: 40px;
  }

  .worker-page.worker-attendance-active .brand h1,
  .worker-page:has(#profilePanel:not(.hidden)) .brand h1 {
    font-size: 0.88rem;
  }

  .worker-page.worker-attendance-active .mode-switch,
  .worker-page:has(#profilePanel:not(.hidden)) .mode-switch {
    display: none;
  }

  .worker-page.worker-attendance-active #profilePanel,
  .worker-page:has(#profilePanel:not(.hidden)) #profilePanel {
    padding: 8px;
  }

  .worker-page.worker-attendance-active .profile-card,
  .worker-page:has(#profilePanel:not(.hidden)) .profile-card {
    gap: 6px;
    grid-template-rows: auto auto minmax(120px, 1fr) auto auto auto auto;
  }

  .worker-page.worker-attendance-active .camera-box video,
  .worker-page.worker-attendance-active .camera-box canvas,
  .worker-page:has(#profilePanel:not(.hidden)) .camera-box video,
  .worker-page:has(#profilePanel:not(.hidden)) .camera-box canvas {
    min-height: 112px;
    max-height: 23dvh;
  }

  .worker-page.worker-attendance-active .compact-panel,
  .worker-page:has(#profilePanel:not(.hidden)) .compact-panel {
    padding: 6px 8px;
  }

  .worker-page.worker-attendance-active #captureSelfieBtn,
  .worker-page.worker-attendance-active #workerLogout,
  .worker-page:has(#profilePanel:not(.hidden)) #captureSelfieBtn,
  .worker-page:has(#profilePanel:not(.hidden)) #workerLogout {
    min-height: 34px;
  }

  .worker-page.worker-attendance-active .attendance-actions button,
  .worker-page:has(#profilePanel:not(.hidden)) .attendance-actions button {
    min-height: 44px;
  }
}
