:root {
  color-scheme: light;
  --ink: oklch(27% 0.035 155);
  --muted: oklch(49% 0.026 155);
  --quiet: oklch(57% 0.025 155);
  --paper: oklch(97.5% 0.012 112);
  --surface: oklch(100% 0.004 112);
  --wash: oklch(94% 0.022 126);
  --line: oklch(87% 0.022 140);
  --accent: oklch(43% 0.095 153);
  --accent-hover: oklch(37% 0.09 153);
  --accent-soft: oklch(91% 0.045 145);
  --warning: oklch(48% 0.12 60);
  --warning-soft: oklch(95% 0.045 83);
  --danger: oklch(47% 0.15 27);
  --danger-soft: oklch(95% 0.035 25);
  --success: oklch(42% 0.1 151);
  --success-soft: oklch(94% 0.045 145);
  --shadow: 0 14px 36px oklch(30% 0.04 150 / 0.07);
  --radius-sm: 0.65rem;
  --radius-md: 1rem;
  --radius-lg: 1.35rem;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

html,
body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

* { box-sizing: border-box; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--warning);
  outline-offset: 3px;
}
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
[hidden] { display: none !important; }

.topbar {
  width: min(100% - 40px, 1180px);
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-size: 1.02rem;
  font-weight: 750;
  letter-spacing: -0.025em;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--surface);
  background: var(--accent);
  border-radius: 11px;
}
.brand-mark svg, .camera-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.quiet-link { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.quiet-link:hover { color: var(--accent); }

.worker-main {
  width: min(100% - 32px, 520px);
  margin: 0 auto;
  padding: 35px 0 54px;
}
.worker-intro { margin: 0 0 22px; }
.eyebrow { margin: 0 0 0.4rem; color: var(--accent); font-size: 0.72rem; font-weight: 750; letter-spacing: 0.08em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0.4rem; font-size: 1.85rem; line-height: 1.15; letter-spacing: -0.045em; overflow-wrap: break-word; min-width: 0; }
.intro-copy { margin: 0; max-width: 42ch; color: var(--muted); font-size: 0.97rem; }
.worker-panel, .attendance-panel {
  padding: 21px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.attendance-panel { margin-top: 15px; }
.step-heading { display: flex; align-items: flex-start; gap: 0.8rem; margin-bottom: 19px; }
.step-number { flex: 0 0 29px; width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 0.78rem; font-weight: 760; }
.step-heading h2 { margin: 0 0 0.13rem; font-size: 1.03rem; letter-spacing: -0.018em; }
.step-heading p { margin: 0; color: var(--muted); font-size: 0.84rem; }
.form-field { min-width: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.form-field + .form-field { margin-top: 15px; }
.form-field label, .login-form label { color: var(--ink); font-size: 0.83rem; font-weight: 650; }
input, select {
  width: 100%;
  min-width: 0;
  height: 49px;
  padding: 0 0.82rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
input::placeholder { color: var(--quiet); }
select:disabled { background: var(--wash); color: var(--quiet); }
.inline-field { display: flex; min-width: 0; gap: 8px; }
.inline-field input { flex: 1 1 0; }
.button {
  min-height: 47px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.66rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out, transform 160ms ease-out;
}
.button:active:not(:disabled) { transform: translateY(1px); }
.button-primary { color: var(--surface); background: var(--accent); }
.button-primary:hover:not(:disabled) { background: var(--accent-hover); }
.button-secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
.button-secondary:hover:not(:disabled) { background: var(--wash); border-color: var(--quiet); }
.inline-field .button { flex: 0 0 auto; }
.field-note { min-height: 1.2em; margin: 0; color: var(--muted); font-size: 0.78rem; }
.camera-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: clip;
  background: oklch(25% 0.025 155);
  border-radius: var(--radius-md);
  color: oklch(91% 0.02 120);
}
.camera-placeholder { display: flex; flex-direction: column; align-items: center; gap: 0.65rem; padding: 1rem; color: oklch(83% 0.024 140); font-size: 0.86rem; text-align: center; }
.camera-icon { width: 45px; height: 45px; display: grid; place-items: center; border: 1px solid oklch(60% 0.03 145); border-radius: 50%; }
.camera-frame video { width: 100%; height: 100%; object-fit: contain; }
.camera-frame img { width: 100%; height: auto; object-fit: contain; }
.camera-frame:has(img:not([hidden])) { aspect-ratio: auto; }
.evidence-detail-note { color: var(--muted); font-size: 0.8rem; overflow-wrap: anywhere; }
.evidence-details { min-width: 145px; max-width: 32ch; overflow-wrap: anywhere; }
.evidence-details summary { cursor: pointer; color: var(--accent); font-size: 0.78rem; padding-block: 0.35rem; }
.evidence-details p { margin: 0.35rem 0; color: var(--muted); font-size: 0.78rem; }
.camera-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 11px; }
.evidence-note { display: flex; align-items: flex-start; gap: 0.52rem; margin: 14px 0; color: var(--muted); font-size: 0.82rem; }
.evidence-check { width: 19px; height: 19px; flex: 0 0 19px; display: grid; place-items: center; border-radius: 50%; background: var(--wash); color: var(--accent); font-size: 0.75rem; font-weight: 800; }
.attendance-button { width: 100%; min-height: 55px; font-size: 1rem; }
.server-time { min-height: 1.4rem; margin: 11px 0 0; color: var(--muted); font-size: 0.82rem; text-align: center; font-variant-numeric: tabular-nums; }
.result-message { margin: 12px 0 0; padding: 0.7rem 0.8rem; border-radius: var(--radius-sm); background: var(--warning-soft); color: var(--warning); font-size: 0.87rem; font-weight: 600; }
.result-message.is-success { background: var(--success-soft); color: var(--success); }
.result-message.is-error { background: var(--danger-soft); color: var(--danger); }
.privacy-note { margin: 17px 0 0; color: var(--quiet); font-size: 0.75rem; line-height: 1.55; text-align: center; }
.privacy-note span { display: block; }

.admin-top-label { color: var(--muted); font-size: 0.86rem; font-weight: 600; }
.admin-main { width: min(100% - 40px, 1180px); margin: 0 auto; padding: 36px 0 64px; }
.login-view { width: min(100%, 430px); margin: 6vh auto; padding: 29px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.login-copy { margin-bottom: 25px; }
.login-copy p:last-child { margin-bottom: 0; color: var(--muted); }
.login-form { display: flex; flex-direction: column; gap: 10px; }
.login-form .button { width: 100%; margin-top: 3px; }
.admin-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 26px; }
.admin-heading h1 { margin-bottom: 0.35rem; }
.admin-heading p:last-child { margin-bottom: 0; color: var(--muted); }
.admin-tabs { display: flex; gap: 6px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--wash); width: fit-content; max-width: 100%; }
.tab-button { min-height: 39px; padding: 0.52rem 0.92rem; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 0.86rem; font-weight: 650; }
.tab-button:hover { color: var(--ink); }
.tab-button.is-active { background: var(--surface); color: var(--accent); box-shadow: 0 2px 5px oklch(30% 0.04 150 / 0.08); }
.admin-view { margin-top: 22px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.section-heading h2 { margin: 0 0 0.2rem; font-size: 1.15rem; }
.section-heading p { margin: 0; color: var(--muted); font-size: 0.87rem; }
.filter-bar { display: grid; grid-template-columns: repeat(4, minmax(125px, 1fr)) auto auto; gap: 10px; align-items: end; padding: 15px; margin-bottom: 18px; background: var(--wash); border-radius: var(--radius-md); }
.filter-bar .form-field { gap: 5px; }
.filter-bar .form-field + .form-field { margin-top: 0; }
.filter-bar label { font-size: 0.75rem; }
.filter-bar input, .filter-bar select { height: 43px; padding: 0 0.65rem; font-size: 0.82rem; }
.filter-bar .button { min-height: 43px; white-space: nowrap; }
.export-button { padding-inline: 0.8rem; }
.table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.attendance-table { width: 100%; min-width: 880px; border-collapse: collapse; text-align: left; }
.attendance-table th { padding: 11px 12px; background: var(--wash); color: var(--muted); font-size: 0.74rem; font-weight: 700; white-space: nowrap; }
.attendance-table td { padding: 12px; border-top: 1px solid var(--line); font-size: 0.83rem; vertical-align: top; }
.attendance-table td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.attendance-table a { color: var(--accent); font-weight: 650; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.event-type, .status-tag { align-items: center; min-height: 25px; padding: 0.22rem 0.48rem; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 0.73rem; font-weight: 700; white-space: nowrap; }
.status-tag { display: inline-flex; white-space: normal; overflow-wrap: anywhere; }
.event-type { display: inline-flex; }
.event-type.check-out { background: var(--warning-soft); color: var(--warning); }
.empty-cell { padding: 26px !important; color: var(--muted); text-align: center; }
.missing-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.status-tag.missing { background: var(--warning-soft); color: var(--warning); }
.management-form { display: grid; grid-template-columns: minmax(140px, 0.7fr) minmax(180px, 1.2fr) auto; gap: 10px; align-items: end; padding: 15px; margin-bottom: 15px; background: var(--wash); border-radius: var(--radius-md); }
.management-form .form-field + .form-field { margin-top: 0; }
.record-list { display: grid; gap: 8px; }
.record-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) 100px auto; gap: 12px; align-items: center; padding: 12px 3px; border-bottom: 1px solid var(--line); }
.record-row:last-child { border-bottom: 0; }
.record-code { color: var(--muted); font-size: 0.82rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.record-name { overflow-wrap: anywhere; }
.record-status { color: var(--success); font-size: 0.76rem; font-weight: 650; }
.record-status.inactive { color: var(--quiet); }
.record-row .button { min-height: 38px; font-size: 0.77rem; }
.record-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.record-actions input { width: min(100%, 260px); min-width: 0; }
.admin-message { min-height: 1.4em; margin: 13px 0 0; color: var(--muted); font-size: 0.86rem; }

@media (max-width: 760px) {
  .admin-main { width: min(100% - 28px, 600px); padding-top: 24px; }
  .admin-top-label { font-size: 0.78rem; }
  .admin-heading { margin-bottom: 19px; }
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar > .button, .filter-bar > .export-button { width: 100%; }
  .admin-view { padding: 16px; }
}

@media (max-width: 420px) {
  .topbar { width: calc(100% - 28px); height: 64px; }
  .worker-main { width: calc(100% - 28px); padding-top: 24px; }
  .worker-panel, .attendance-panel { padding: 16px; border-radius: 18px; }
  h1 { font-size: 1.65rem; }
  .step-heading { gap: 0.62rem; }
  .inline-field { flex-wrap: wrap; }
  .inline-field input { flex-basis: 140px; }
  .inline-field .button { padding-inline: 0.7rem; }
  .admin-main { width: calc(100% - 24px); padding-top: 20px; }
  .admin-heading { align-items: flex-start; }
  .admin-heading .button { min-height: 40px; padding-inline: 0.65rem; font-size: 0.78rem; }
  .admin-tabs { width: 100%; }
  .tab-button { flex: 1; padding-inline: 0.4rem; }
  .filter-bar { padding: 11px; gap: 8px; }
  .filter-bar input, .filter-bar select { font-size: 0.76rem; }
  .management-form { grid-template-columns: minmax(0, 1fr); }
  .record-row { grid-template-columns: 72px minmax(0, 1fr); gap: 8px; }
  .record-status { grid-column: 1; }
  .record-actions { grid-column: 2; }
}

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

.attendance-map-card { margin: 24px 0; min-width: 0; }
#attendance-map { height: 380px; width: 100%; border: 1px solid var(--border, #d2ddcf); border-radius: 16px; z-index: 0; background: #e7ede5; }
.map-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; margin: 12px 0; }
.map-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.map-dot.in { background: #17633e; }.map-dot.out { background: #b65a22; }
.map-popup p { margin: 5px 0; overflow-wrap: anywhere; }.map-popup { max-width: 230px; }
.map-location-button { display: block; border: 0; background: none; color: #17633e; text-decoration: underline; cursor: pointer; padding: 8px 0; font: inherit; }
@media(max-width: 600px) { #attendance-map { height: 310px; }.leaflet-popup-content { margin: 12px; max-width: 210px; } }

/* Compact worker app: camera uses the remaining viewport space. */
.worker-body { min-height: 100dvh; display: flex; flex-direction: column; }
.worker-body .topbar { min-height: 50px; padding-block: 8px; }
.worker-main { width: min(100% - 24px, 520px); padding: 8px 0 12px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.worker-intro, .worker-main > .privacy-note { display: none; }
.worker-panel, .attendance-panel { padding: 12px; border-radius: 16px; }
.worker-panel .step-heading, .attendance-panel .step-heading { display: none; }
.worker-main input, .worker-main select { height: 44px; }
.worker-main .button { min-height: 44px; padding-block: 8px; }
.worker-main .form-field { gap: 3px; }
.worker-main .form-field + .form-field { margin-top: 6px; }
.worker-main .field-note { font-size: 12px; }
.attendance-panel { margin-top: 0; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.worker-main .camera-frame, .worker-main .camera-frame:has(img:not([hidden])) { aspect-ratio: auto; height: clamp(90px, calc(100dvh - 420px), 360px); min-height: 90px; flex: 1; }
.worker-main .camera-frame img, .worker-main .camera-frame video { height: 100%; width: 100%; object-fit: contain; min-height: 0; }
.worker-main .camera-controls { margin: 0; gap: 8px; }
.worker-main .evidence-note { margin: 0; font-size: 12px; line-height: 1.35; }
.worker-main .evidence-detail-note { margin: 0; font-size: 11px; line-height: 1.3; }
.worker-main .server-time { margin: 0; min-height: 0; font-size: 11px; line-height: 1.3; }
.worker-main .result-message { margin: 0; padding: 7px; font-size: 12px; }
.worker-main .attendance-button { min-height: 46px; flex-shrink: 0; }
.worker-main .camera-frame, .worker-main .camera-frame:has(img:not([hidden])) { flex: none; height: clamp(64px, calc(100dvh - 500px), 360px); min-height: 0; grid-template-rows: minmax(0, 1fr); }
.worker-main .camera-frame > * { max-height: 100%; }
.worker-body .topbar { height: 50px; flex-shrink: 0; }

.event-dialog { width: min(94vw, 480px); max-height: 90dvh; overflow: auto; border: 1px solid var(--line); border-radius: 18px; padding: 24px; color: var(--ink); }
.event-dialog::backdrop { background: #102a1c88; }
.event-dialog .form-field { margin-top: 16px; }.event-dialog .camera-controls { margin-top: 20px; }
.admin-adjusted { margin: 4px 0; color: #99501a; font-size: 12px; font-weight: 700; }
.audit-content { max-width: 300px; overflow-wrap: anywhere; }.attendance-table summary { cursor: pointer; font-size: 12px; }

select, .filter-bar select, .worker-main select { -webkit-appearance: none; appearance: none; background-image: url('/chevron-down.svg'); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px 16px; padding-right: 38px; text-overflow: ellipsis; }
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.history-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0; font-size: 13px; }
.page-size-control { display: flex; align-items: center; gap: 8px; }.page-size-control select { width: 80px; height: 42px; }
.page-buttons { display: flex; gap: 8px; }
@media(max-width: 600px) { .history-pagination { gap: 10px; }.page-buttons { width: 100%; }.page-buttons .button { flex: 1; } }
@media (forced-colors: active) { select, .filter-bar select, .worker-main select { appearance: auto; background-image: none; } }

/* Admin workspace: lists first, creation as a deliberate action. */
.admin-body { background: oklch(97% 0.008 135); }
.admin-main { padding-top: 24px; }
.admin-heading { align-items: center; margin-bottom: 20px; }
.admin-heading h1 { font-size: 1.6rem; margin: 0; }.admin-heading .eyebrow { font-size: 11px; }
.admin-view { padding: 0; border: 0; box-shadow: none; background: transparent; margin-top: 26px; }
.admin-tabs { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 0; gap: 16px; width: 100%; }
.tab-button { border-radius: 0; border-bottom: 2px solid transparent; padding: 12px 4px; min-height: 46px; }
.tab-button.is-active { border-bottom-color: var(--accent); box-shadow: none; background: transparent; }
.filter-bar { background: var(--surface); border: 1px solid var(--line); padding: 14px; margin-bottom: 10px; border-radius: 12px; }
#history-view > .field-note { margin-bottom: 18px; font-size: 12px; }
.table-scroll { background: var(--surface); }
.attendance-table th { background: oklch(94% 0.012 135); }
.history-pagination { margin: 14px 0; }
.list-footer-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.list-footer-actions .button { white-space: nowrap; }
.management-view .list-footer-actions { justify-content: flex-end; }
.record-list { background: var(--surface); padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; }
.record-row { padding: 14px 0; }
.attendance-map-card { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.dialog-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.dialog-form > .form-field { margin-top: 0; }.dialog-form .form-field:last-of-type { grid-column: 1 / -1; }
.dialog-form > .field-note, .dialog-actions { grid-column: 1 / -1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.event-dialog { width: min(calc(100vw - 24px), 560px); padding: 24px; box-shadow: 0 20px 80px oklch(20% 0.02 145 / .2); }
.event-dialog > h2 { font-size: 1.3rem; margin-bottom: 10px; }.event-dialog input, .event-dialog select { min-height: 46px; }
@media(max-width: 600px) {
 .admin-main { width: calc(100% - 24px); padding-top: 16px; }.admin-view { padding: 0; margin-top: 20px; }
 .admin-heading { gap: 12px; }.admin-heading h1 { font-size: 1.3rem; }.admin-heading .button { min-height: 40px; font-size: 12px; padding: 8px 10px; }
 .filter-bar { padding: 12px; }.filter-bar input, .filter-bar select { font-size: 13px; min-height: 44px; }
 .list-footer-actions { flex-wrap: wrap; gap: 10px; }.list-footer-actions > .button { width: 100%; }
 .event-dialog { padding: 20px; }.dialog-form { grid-template-columns: 1fr; gap: 14px; }.dialog-actions { flex-wrap: wrap; }.dialog-actions .button { flex: 1; }
 .record-list { padding: 0 12px; }.record-actions { justify-content: flex-start; }
}

.dialog-form .form-field:has(#manual-reason) { grid-column: 1 / -1; }

@media (max-width: 600px) {
 #history-view .table-scroll { overflow: visible; border: 0; background: transparent; }
 .attendance-table { min-width: 0; width: 100%; display: block; }
 .attendance-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
 .attendance-table tbody { display: grid; gap: 12px; width: 100%; }
 .attendance-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
 .attendance-table td { display: block; border: 0; padding: 0; min-width: 0; overflow-wrap: anywhere; }
 .attendance-table td::before { content: attr(data-label); display: block; font-size: 10px; color: var(--muted); margin-bottom: 4px; font-weight: 650; }
 .attendance-table td:nth-child(2) { grid-column: 1; grid-row: 1; font-weight: 650; }
 .attendance-table td:nth-child(4) { grid-column: 2; grid-row: 1; }
 .attendance-table td:nth-child(3) { grid-column: 1; grid-row: 2; }
 .attendance-table td:nth-child(1) { grid-column: 2; grid-row: 2; white-space: normal; }
 .attendance-table td:nth-child(5) { grid-column: 1 / -1; grid-row: 3; border-block: 1px solid var(--line); padding-block: 10px; }
 .attendance-table td:nth-child(5) > .map-location-button { display: inline-block; padding: 0 8px; }
 .attendance-table td:nth-child(5) > details { margin-top: 6px; }
 .attendance-table td:nth-child(6) { grid-column: 1; grid-row: 4; }
 .attendance-table td:nth-child(7) { grid-column: 2; grid-row: 4; }
 .attendance-table .evidence-details { min-width: 0; }
 .attendance-table .empty-cell { grid-column: 1 / -1 !important; padding: 14px !important; }
}

.missing-summary { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; margin: 24px 0; }
.missing-table-panel { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.missing-table-heading { margin: 0; padding: 14px; display: flex; align-items: center; justify-content: space-between; font-size: 15px; color: var(--warning); background: var(--warning-soft); }
.missing-table-count { padding: 2px 8px; border-radius: 20px; background: var(--surface); font-size: 12px; }
.missing-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.missing-table th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 650; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.missing-table td { vertical-align: top; padding: 12px 8px; font-size: 12px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.missing-table th:nth-child(1) { width: 21%; }.missing-table th:nth-child(2) { width: 30%; }.missing-table th:nth-child(3) { width: 29%; }.missing-table th:nth-child(4) { width: 20%; }
.missing-table tr:last-child td { border-bottom: 0; }.missing-record-name { display: block; margin-top: 3px; color: var(--muted); line-height: 1.4; }
.missing-add-button { font-size: 11px; min-height: 36px; padding: 6px; }.missing-empty { color: var(--muted); text-align: center; padding: 20px !important; }
.event-detail-button { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 6px; border: 0; padding: 0; background: transparent; color: var(--accent); cursor: pointer; text-align: left; border-radius: 7px; }
.event-thumbnail { display: block; width: 100px; height: 76px; object-fit: contain; background: var(--wash); border: 1px solid var(--line); border-radius: 7px; }
.detail-button-label { font-size: 12px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.event-detail-dialog { width: min(calc(100vw - 24px), 960px); }.event-detail-content { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 24px; margin-top: 20px; }
.event-detail-image { min-width: 0; }#event-detail-photo { width: 100%; height: auto; max-height: 65dvh; object-fit: contain; background: var(--wash); border-radius: 8px; }
.event-detail-metadata { font-size: 13px; overflow-wrap: anywhere; }.event-detail-metadata p { margin: 0 0 12px; }.event-detail-metadata a { display: block; margin-bottom: 14px; color: var(--accent); font-weight: 650; }
@media(max-width:900px) { .missing-summary { grid-template-columns: minmax(0,1fr); } }
@media(max-width:600px) {
 .event-detail-content { grid-template-columns: 1fr; gap: 16px; }.event-detail-dialog .dialog-actions { position: sticky; bottom: -20px; padding-block: 12px; background: var(--surface); }
 .attendance-table td:nth-child(6) { grid-column: 1 / -1; grid-row: 4; }.event-detail-button { flex-direction: row; align-items: center; gap: 12px; }.missing-table td { font-size: 11px; padding: 10px 6px; }.missing-table th { padding: 10px 6px; }
}

.worker-location-label { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Dense desktop workspace for everyday internal operations. */
.admin-body { font-size: 13px; }
.admin-body .admin-topbar, .admin-main { width: calc(100% - 32px); max-width: none; }
.admin-body .admin-topbar { height: 52px; }.admin-body .brand { font-size: 14px; }.admin-body .brand-mark { width: 28px; height: 28px; }
.admin-main { padding: 14px 0 24px; }.admin-heading { margin-bottom: 10px; }.admin-heading h1 { font-size: 20px; }.admin-heading .eyebrow { display: none; }
.admin-tabs { gap: 20px; }.admin-body .tab-button { min-height: 36px; padding: 7px 2px; font-size: 12px; }
.admin-view { margin-top: 16px; }.admin-body .section-heading { margin-bottom: 12px; }.admin-body .section-heading h2 { font-size: 16px; }.admin-body .section-heading p { font-size: 12px; }
.admin-body .button { min-height: 30px; padding: 5px 9px; border-radius: 6px; font-size: 12px; line-height: 1.25; }
.admin-body input, .admin-body select, .admin-body .filter-bar input, .admin-body .filter-bar select { height: 32px; min-height: 32px; font-size: 12px; border-radius: 6px; }
.admin-body .filter-bar { padding: 10px; gap: 10px; border-radius: 8px; }.admin-body .filter-bar .button { min-height: 32px; }.admin-body .filter-bar label { font-size: 11px; }
.admin-body .form-field { gap: 3px; }#history-view > .field-note { font-size: 11px; margin-bottom: 10px; }
.attendance-table { min-width: 740px; table-layout: fixed; }.attendance-table th { padding: 8px 10px; font-size: 11px; }.attendance-table td { padding: 6px 10px; font-size: 12px; line-height: 1.35; vertical-align: middle; }
.attendance-table th:nth-child(1) { width: 9%; }.attendance-table th:nth-child(2) { width: 20%; }.attendance-table th:nth-child(3) { width: 27%; }.attendance-table th:nth-child(4) { width: 10%; }.attendance-table th:nth-child(5) { width: 20%; }.attendance-table th:nth-child(6) { width: 14%; }
.event-type { min-height: 20px; padding: 2px 6px; font-size: 10px; }.admin-adjusted { font-size: 10px; margin: 2px 0; }
.attendance-table .map-location-button { display: inline-block; padding: 0 6px; font-size: 11px; }.attendance-table td > details { display: inline-block; margin-left: 4px; }.attendance-table summary { font-size: 10px; }
.event-detail-button { flex-direction: row; align-items: center; gap: 6px; }.event-thumbnail { width: 56px; height: 42px; border-radius: 4px; }.detail-button-label { font-size: 11px; text-decoration: none; }
.admin-body button:focus-visible, .admin-body a:focus-visible, .admin-body input:focus-visible, .admin-body select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.admin-body .history-pagination { gap: 10px; font-size: 11px; margin: 10px 0; }.admin-body .page-size-control select { width: 68px; height: 30px; }
.list-footer-actions { padding: 10px 0; }.list-footer-actions .field-note { font-size: 11px; }
.record-list { gap: 0; padding: 0 10px; }.record-row { padding: 8px 0; gap: 10px; }.record-row .button { min-height: 26px; font-size: 11px; }.record-name { font-size: 12px; }
.missing-summary { margin: 16px 0; gap: 16px; }.missing-table-heading { padding: 9px 10px; font-size: 13px; }.missing-table th { padding: 7px 8px; }.missing-table td { padding: 8px; font-size: 11px; }.missing-table .button { font-size: 10px; min-height: 28px; }
.attendance-map-card { margin-top: 20px; padding-top: 16px; }#attendance-map { height: 320px; }.map-legend { font-size: 11px; margin: 8px 0; }
.admin-footer { margin-top: 16px; text-align: right; color: var(--quiet); font-size: 10px; }.admin-footer a { text-decoration: none; }
@media(max-width:760px) {
 .admin-body .admin-topbar, .admin-main { width: calc(100% - 24px); }.admin-body .filter-bar { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .admin-body .button { min-height: 40px; }.admin-body input, .admin-body select, .admin-body .filter-bar input, .admin-body .filter-bar select { height: 40px; min-height: 40px; font-size: 13px; }
 .admin-body .filter-bar .button { min-height: 40px; }.admin-body .record-row .button { min-height: 36px; }
 .admin-body .event-dialog input, .admin-body .event-dialog select { min-height: 44px; height: 44px; }.admin-body .event-dialog .button { min-height: 44px; }
}
@media(max-width:600px) {
 .attendance-table { min-width: 0; }.attendance-table td { padding: 0; font-size: 12px; vertical-align: top; }.attendance-table tr { padding: 12px; gap: 10px 12px; }
 .attendance-table td:nth-child(5) { padding-block: 8px; }.attendance-table td > details { margin: 6px 0 0; display: block; }
 .admin-body .event-thumbnail { width: 64px; height: 48px; }.admin-body .event-detail-button { min-height: 44px; }
 .missing-table .button { min-height: 36px; }.admin-body .page-size-control select { height: 40px; }
}

.map-debug { margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.map-debug pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.5; margin: 8px 0; }
