:root {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --surface-soft: #f8f9fa;
  --border: #e1e4e8;
  --border-strong: #cfd4da;
  --text: #18212b;
  --muted: #68727d;
  --accent: #294c60;
  --accent-hover: #1f3c4d;
  --accent-soft: #edf3f6;
  --success: #315d4b;
  --success-soft: #edf5f1;
  --warning: #725a2a;
  --warning-soft: #f7f3e9;
  --danger: #85413f;
  --danger-soft: #f8eeee;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 7px 24px rgba(16, 24, 40, .04);
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 10; width: 248px; padding: 26px 18px 20px;
  display: flex; flex-direction: column; background: #111a22; color: #e8edf0;
}
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #70818b;
  border-radius: 11px; background: #20313c; color: #f7fafb; font-size: 12px; font-weight: 750;
  letter-spacing: .06em;
}
.brand > span:last-child { display: grid; gap: 1px; }
.brand strong { font-size: 15px; letter-spacing: -.01em; }
.brand small { color: #9eabb3; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.nav { margin-top: 38px; }
.nav { display: grid; gap: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 9px;
  color: #b9c3c9; font-size: 14px; font-weight: 600;
}
.nav-link.active { background: #243540; color: #fff; }
.nav-icon { font-size: 20px; line-height: 1; }
.sidebar-footer { margin-top: auto; display: grid; gap: 14px; }
.operator { display: flex; align-items: center; gap: 10px; padding: 12px 8px; border-top: 1px solid #2d3941; }
.operator-avatar, .avatar {
  display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px;
  background: #e8edf0; color: #31424c; font-size: 13px; font-weight: 750;
}
.operator > span:last-child { display: grid; min-width: 0; }
.operator small { color: #87969f; font-size: 10px; }
.operator strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; }

.main { min-height: 100vh; margin-left: 248px; }
.content { width: min(1180px, 100%); margin: 0 auto; padding: 42px 38px 72px; }
.mobile-header { display: none; }
.mobile-menu-button, .mobile-menu-close, .sidebar-backdrop { display: none; }
.page-heading, .detail-heading {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px;
}
.page-heading.compact { margin-bottom: 24px; }
.page-heading h1, .detail-heading h1 { margin: 2px 0 7px; font-size: clamp(27px, 3vw, 36px); line-height: 1.15; letter-spacing: -.035em; }
.page-heading p, .detail-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.eyebrow { color: var(--accent) !important; font-size: 11px !important; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 19px; color: var(--muted); font-size: 12px; }
.breadcrumbs a { color: var(--accent); font-weight: 650; }

.button {
  min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer;
  font-size: 13px; font-weight: 680; line-height: 1.2; transition: background .15s, border-color .15s, transform .15s;
}
.button:active:not(:disabled) { transform: translateY(1px); }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-hover); }
.button-secondary { border-color: var(--border-strong); background: var(--surface); color: #34414a; }
.button-secondary:hover { background: var(--surface-soft); border-color: #aeb6bd; }
.button-danger { border-color: #d8bdbc; background: var(--surface); color: var(--danger); }
.button-danger:hover { background: var(--danger-soft); }
.button-quiet { border-color: #394750; background: transparent; color: #c7d0d5; }
.button-full { width: 100%; }
.button-large { min-height: 46px; }
.button-small { min-height: 32px; padding: 6px 10px; font-size: 11px; }
.button:disabled { cursor: not-allowed; opacity: .55; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-grid-three { grid-template-columns: repeat(3, 1fr); }
.stat-card {
  min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: 12px;
  display: grid; gap: 5px; background: var(--surface); box-shadow: 0 1px 2px rgba(16,24,40,.025);
}
.stat-card:hover, .stat-card.selected { border-color: #aab9c1; }
.stat-card.selected { box-shadow: inset 0 2px 0 var(--accent); }
.stat-card span { color: #4e5a64; font-size: 12px; font-weight: 650; }
.stat-card strong { font-size: 26px; letter-spacing: -.035em; }
.stat-card small { color: #8a939a; font-size: 11px; }

.panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-toolbar { min-height: 68px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--border); }
.search-form { display: flex; align-items: end; gap: 8px; width: min(820px, 100%); }
.search-box { flex: 1; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); }
.search-box span { color: #78848c; font-size: 19px; }
.search-box input { width: 100%; height: 38px; border: 0; outline: 0; color: var(--text); background: transparent; }
.clear-link { color: var(--accent); font-size: 12px; font-weight: 650; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 18px; background: #fafbfb; color: #77818a; font-size: 10px; font-weight: 750; letter-spacing: .065em; text-align: left; text-transform: uppercase; }
td { padding: 14px 18px; border-top: 1px solid #eaedef; color: #4b5660; font-size: 13px; }
tbody tr:hover { background: #fbfcfc; }
.person { display: flex; align-items: center; gap: 11px; color: var(--text); }
.person > span:last-child { display: grid; gap: 2px; }
.person strong { font-size: 13px; }
.person small { color: #8a939a; font-size: 10px; }
.table-subtitle { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.table-action { width: 45px; text-align: right; }
.selection-column { width: 64px; }
.table-bulk-actions { display: flex; justify-content: flex-end; padding: 14px 0 0; }
.table-action a { display: inline-grid; width: 30px; height: 30px; place-items: center; border-radius: 7px; color: var(--accent); font-size: 18px; }
.table-action a:hover { background: var(--accent-soft); }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .94em; }
.coordinate { color: #56636c; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; white-space: nowrap; }
.location-avatar { background: var(--accent-soft); color: var(--accent); font-size: 17px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; white-space: nowrap; }
.row-actions form { margin: 0; }
.icon-button { width: 32px; height: 32px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: #58636b; cursor: pointer; font-size: 18px; }
.danger-icon { color: var(--danger); }
.danger-icon:hover { border-color: #d8bdbc; background: var(--danger-soft); }

.badge { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 720; white-space: nowrap; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-pending { background: var(--warning-soft); color: var(--warning); }
.badge-approved { background: var(--success-soft); color: var(--success); }
.badge-deactivated { background: #f0f1f2; color: #69727a; }

.empty-state { min-height: 320px; padding: 52px 20px; display: grid; place-items: center; align-content: center; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 12px; border-radius: 13px; background: var(--surface-soft); color: #849099; font-size: 25px; }
.empty-state h2 { margin: 0 0 5px; font-size: 17px; }
.empty-state p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }

.form-layout { display: grid; gap: 16px; }
.form-panel { padding: 25px; }
.muted-panel { background: #fbfcfc; box-shadow: none; }
.section-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px; }
.section-heading h2, .panel-title h2 { margin: 0 0 4px; font-size: 16px; letter-spacing: -.015em; }
.section-heading p, .panel-title p { margin: 0; color: var(--muted); font-size: 12px; }
.step { display: grid; place-items: center; flex: 0 0 auto; width: 27px; height: 27px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 750; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid-three { grid-template-columns: 1fr 1fr 1fr; }
.field { display: grid; align-content: start; gap: 7px; }
.field-wide { grid-column: 1 / -1; }
.field > span { color: #3c4851; font-size: 12px; font-weight: 680; }
.field b { color: var(--danger); }
.field input, .field select {
  width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid var(--border-strong);
  border-radius: 9px; outline: 0; background: var(--surface); color: var(--text);
}
.field input:focus, .field select:focus, .search-box:focus-within { border-color: #678293; box-shadow: 0 0 0 3px rgba(41,76,96,.09); }
.field small { color: #818b93; font-size: 10px; }
.compact-field { min-width: 230px; gap: 4px; }
.compact-field > span { font-size: 10px; }
.compact-field select { min-height: 40px; padding-block: 7px; }
.inline-form { display: flex; align-items: end; gap: 10px; }
.inline-form .field { flex: 1; }
.workplace-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.choice-card { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; }
.choice-card:hover { border-color: var(--border-strong); background: var(--surface-soft); }
.choice-card > span { display: grid; gap: 3px; }
.choice-card small { color: var(--muted); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.form-actions form { margin: 0; }
.notice-row, .success-block { display: flex; align-items: flex-start; gap: 13px; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.geo-notice { margin-top: 22px; background: var(--surface-soft); }
.notice-icon { display: grid; place-items: center; flex: 0 0 auto; width: 31px; height: 31px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.notice-row strong, .success-block strong { font-size: 12px; }
.notice-row p, .success-block p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.detail-heading { align-items: center; }
.identity-heading, .title-row { display: flex; align-items: center; gap: 15px; }
.avatar-large { width: 58px; height: 58px; border-radius: 15px; background: #dfe6e9; font-size: 19px; }
.title-row { gap: 10px; flex-wrap: wrap; }
.title-row h1 { margin: 0; }
.detail-actions { display: flex; gap: 8px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-card { padding: 22px; }
.detail-card-wide { grid-column: 1 / -1; }
.panel-title { min-height: 30px; margin-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.panel-description { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.subtle { color: #8a939a; font-size: 10px; }
.definition-list { margin: 0; }
.definition-list > div { min-height: 46px; padding: 10px 0; border-top: 1px solid #edf0f1; display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 16px; }
.definition-list > div:first-child { border-top: 0; }
.definition-list dt { color: var(--muted); font-size: 11px; }
.definition-list dd { margin: 0; color: #3e4952; font-size: 12px; font-weight: 570; }
.compact-notice { margin-bottom: 13px; background: var(--surface-soft); }
.success-block { border-color: #dbe9e2; background: var(--success-soft); }
.success-block > span { color: var(--success); font-weight: 800; }
.assignment-attach-form { margin-bottom: 16px; padding: 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); }
.assignment-attach-form label { display: block; margin-bottom: 7px; color: #4c5962; font-size: 11px; font-weight: 650; }
.assignment-attach-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.assignment-attach-controls select { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; }
.assignment-guidance { margin-bottom: 16px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: var(--surface-soft); font-size: 11px; }
.assignment-guidance a { color: var(--accent); font-weight: 650; }
.assignment-list { display: grid; gap: 10px; }
.assignment-item, .inline-empty { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--border); border-radius: 9px; }
.assignment-summary { min-width: 0; flex: 1; }
.assignment-actions { flex: none; }
.location-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--surface-soft); color: var(--accent); }
.assignment-list strong { font-size: 12px; }
.assignment-list p, .inline-empty p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.review-actions { margin-top: 18px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.review-actions form { margin: 0; }
.review-portrait { margin-top: 16px; padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: #f4f7f8; text-align: center; }
.review-portrait img { display: block; width: 100%; max-width: 420px; max-height: 460px; margin: 0 auto; border-radius: 10px; object-fit: contain; background: #18232b; }
.review-portrait-inline { max-width: 460px; margin-right: auto; margin-left: auto; }
.review-reject-form { display: flex; align-items: center; gap: 8px; }
.review-reject-form input { min-width: min(280px, 55vw); min-height: 40px; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: 9px; color: var(--text); background: var(--surface); }
.pin-form { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 10px; }
.pin-form .button { grid-column: 1 / -1; }
.pin-guidance { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

.enrollment-layout { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(420px, 1.1fr); gap: 16px; }
.enrollment-camera-panel, .enrollment-captures-panel { padding: 22px; }
.camera-stage { position: relative; aspect-ratio: 4 / 3; margin-bottom: 12px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: #151d22; }
.camera-stage video { width: 100%; height: 100%; display: block; object-fit: cover; transform: scaleX(-1); }
.camera-guide { position: absolute; inset: 12% 25%; border: 2px solid rgba(255,255,255,.72); border-radius: 48% 48% 44% 44%; box-shadow: 0 0 0 999px rgba(10,18,23,.16); pointer-events: none; }
.camera-placeholder { position: absolute; inset: 0; padding: 30px; display: grid; place-items: center; color: #d6dde1; font-size: 12px; line-height: 1.55; text-align: center; }
.privacy-note { margin-top: 12px; padding: 12px; border-radius: 8px; background: var(--accent-soft); color: var(--muted); font-size: 10px; line-height: 1.5; }
.privacy-note strong { color: var(--accent); }
.capture-list { display: grid; gap: 10px; }
.capture-card { padding: 12px; border: 1px solid var(--border); border-radius: 10px; display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.capture-card.complete { border-color: #b9d1c5; background: var(--success-soft); }
.capture-thumbnail { position: relative; width: 58px; height: 58px; overflow: hidden; border-radius: 9px; display: grid; place-items: center; background: #e9edef; color: var(--muted); font-size: 12px; font-weight: 750; }
.capture-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.capture-thumbnail img:not([src]) { display: none; }
.capture-copy { min-width: 0; }
.capture-copy strong { font-size: 12px; }
.capture-copy p { margin: 3px 0 7px; color: var(--muted); font-size: 10px; }
.capture-file { width: 100%; color: var(--muted); font-size: 9px; }
.capture-file::file-selector-button { margin-right: 7px; padding: 5px 7px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; }
.enrollment-actions { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 9px; }

.alert { margin-bottom: 18px; padding: 12px 14px; border: 1px solid; border-radius: 9px; font-size: 12px; }
.alert-success { border-color: #cfe0d7; background: var(--success-soft); color: var(--success); }
.alert-error { border-color: #e3c9c8; background: var(--danger-soft); color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.report-filter-panel { margin-bottom: 20px; padding: 18px; }
.report-filters { display: grid; grid-template-columns: .65fr .9fr 1fr 1.2fr auto; align-items: end; gap: 12px; }
.tracking-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.tracking-filter .field { flex: 1 1 190px; min-width: 0; }
.filter-guidance { margin: 11px 0 0; color: var(--muted); font-size: 10px; }
.report-stats { margin-top: 20px; }
.report-name { overflow: hidden; font-size: 19px !important; text-overflow: ellipsis; white-space: nowrap; }
.report-panel-title { min-height: 68px; margin: 0; padding: 17px 18px; border-bottom: 1px solid var(--border); }
.report-legend { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.report-legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--success-soft); box-shadow: inset 0 0 0 1px #bed3c8; }
.compact-empty { min-height: 220px; }
.report-welcome { min-height: 210px; padding: 34px; display: flex; align-items: center; justify-content: center; gap: 16px; text-align: left; }
.report-welcome .empty-icon { margin: 0; }
.report-welcome h2 { margin: 0 0 5px; font-size: 17px; }
.report-welcome p { margin: 0; color: var(--muted); font-size: 12px; }
.monthly-sheet-wrap { max-height: 620px; }
.monthly-sheet { min-width: 1240px; }
.monthly-sheet th, .monthly-sheet td { padding: 9px 7px; text-align: center; }
.monthly-sheet .sticky-employee { position: sticky; left: 0; z-index: 2; min-width: 190px; text-align: left; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
.monthly-sheet thead .sticky-employee { z-index: 3; background: #fafbfb; }
.monthly-sheet .sticky-employee a { display: grid; gap: 2px; }
.monthly-sheet .sticky-employee small { color: var(--muted); font-size: 9px; font-weight: 500; }
.day-column { min-width: 32px; }
.day-column span, .day-column small { display: block; }
.day-column small { margin-top: 2px; color: #9aa2a8; font-size: 8px; }
.attendance-cell { color: #a0a7ad; font-size: 10px; }
.attendance-cell.present { background: var(--success-soft); color: var(--success); font-weight: 800; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }

.tracking-note { margin: 16px 0; padding: 12px 14px; border: 1px solid #dce3e7; border-radius: 9px; display: flex; gap: 10px; background: var(--accent-soft); color: var(--muted); font-size: 10px; }
.tracking-note strong { color: var(--accent); }
.tracking-section-heading { margin: 27px 0 12px; display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.tracking-section-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.tracking-section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.tracking-section-heading.history-heading { margin-top: 34px; padding-top: 23px; border-top: 1px solid var(--border); }
.tracking-limit-note { margin: 18px 2px 0; color: var(--muted); font-size: 10px; text-align: right; }
.tracking-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tracking-card { padding: 19px; transition: border-color .15s, transform .15s; }
.tracking-card-history { background: #fbfcfc; }
.tracking-card:hover { border-color: #aab9c1; transform: translateY(-1px); }
.tracking-card-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; }
.tracking-card-heading > div { min-width: 0; display: grid; gap: 3px; }
.tracking-card-heading strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.tracking-card-heading small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.tracking-summary { margin: 17px 0 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tracking-summary div { padding: 10px; border-radius: 8px; background: var(--surface-soft); }
.tracking-summary dt { color: var(--muted); font-size: 9px; }
.tracking-summary dd { margin: 4px 0 0; color: var(--text); font-size: 11px; font-weight: 650; }
.tracking-open { color: var(--accent); font-size: 11px; font-weight: 680; }
.tracking-detail-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .7fr); gap: 16px; }
.map-panel { position: relative; min-height: 570px; overflow: hidden; }
.tracking-map { width: 100%; height: 570px; background: #e9edef; }
.map-message { position: absolute; z-index: 500; left: 12px; bottom: 12px; padding: 7px 10px; border: 1px solid rgba(207,212,218,.9); border-radius: 7px; background: rgba(255,255,255,.92); color: var(--muted); font-size: 9px; box-shadow: var(--shadow); }
.tracking-side-panel { padding: 21px; }
.map-legend { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); display: grid; gap: 9px; color: var(--muted); font-size: 10px; }
.map-legend span { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.route-dot { background: var(--success); }
.office-dot { background: var(--accent); }
.outside-dot { background: var(--danger); }
.legend-arrow { color: var(--success); font-size: 16px; font-weight: 800; line-height: 1; }
.route-direction-icon { background: transparent; border: 0; }
.route-direction-icon span {
  display: block;
  width: 0;
  height: 0;
  margin: 4px auto;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 10px solid var(--success);
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, .9));
  transform-origin: 50% 50%;
}
.map-refresh { margin: 18px 0 0; color: #89929a; font-size: 9px; line-height: 1.5; }

.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.dashboard-heading h1 { margin: 2px 0 7px; font-size: clamp(29px, 3vw, 38px); letter-spacing: -.04em; }
.dashboard-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.dashboard-updated { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.dashboard-updated > div { display: grid; gap: 2px; text-align: right; }
.dashboard-updated strong { color: var(--text); font-size: 11px; }
.dashboard-updated small { font-size: 9px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.refresh-button { display: grid; place-items: center; color: var(--accent); font-size: 18px; }
.dashboard-filter-panel { margin-bottom: 17px; overflow: hidden; }
.period-tabs { padding: 12px 15px 0; display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); }
.period-tab { padding: 9px 11px 11px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 11px; font-weight: 680; white-space: nowrap; }
.period-tab.active { border-color: var(--accent); color: var(--accent); }
.dashboard-filters { padding: 15px; display: grid; grid-template-columns: .72fr .72fr 1.25fr 1.25fr auto auto; align-items: end; gap: 10px; }
.dashboard-filters .field { gap: 5px; }
.dashboard-filters .field > span { font-size: 10px; }
.dashboard-filters .field input, .dashboard-filters .field select { min-height: 39px; padding-block: 7px; font-size: 11px; }
.dashboard-filters .clear-link { align-self: center; }
.dashboard-kpis { margin-bottom: 17px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; }
.dashboard-kpi { min-width: 0; padding: 17px; display: grid; gap: 7px; transition: border-color .15s, transform .15s; }
.dashboard-kpi:hover { border-color: #aab9c1; transform: translateY(-1px); }
.dashboard-kpi .kpi-label { color: var(--muted); font-size: 10px; font-weight: 720; letter-spacing: .04em; text-transform: uppercase; }
.dashboard-kpi > strong { font-size: 29px; letter-spacing: -.04em; }
.dashboard-kpi small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.dashboard-kpi small b { margin-right: 3px; }
.delta-up { color: var(--success); }
.delta-down { color: var(--danger); }
.delta-flat { color: var(--muted); }
.dashboard-main-grid { margin-bottom: 17px; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(275px, .65fr); gap: 17px; }
.dashboard-secondary-grid { margin-bottom: 17px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 17px; }
.dashboard-chart-panel, .dashboard-facts-panel, .dashboard-ranking-panel, .dashboard-attention-panel { padding: 20px; }
.dashboard-panel-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dashboard-panel-title > a { color: var(--accent); font-size: 10px; font-weight: 700; white-space: nowrap; }
.dashboard-chip { padding: 5px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 700; white-space: nowrap; }
.trend-scroll { margin-top: 22px; overflow-x: auto; }
.trend-chart { min-width: max(100%, calc(var(--trend-days) * 28px)); height: 215px; display: grid; grid-template-columns: repeat(var(--trend-days), minmax(20px, 1fr)); align-items: end; gap: 5px; }
.trend-column { height: 100%; display: grid; grid-template-rows: 20px minmax(130px, 1fr) 25px; align-items: end; text-align: center; }
.trend-value { color: var(--muted); font-size: 8px; }
.trend-track { height: 100%; min-height: 130px; display: flex; align-items: end; justify-content: center; border-bottom: 1px solid var(--border); }
.trend-track i { width: min(17px, 75%); border-radius: 4px 4px 1px 1px; background: var(--accent); opacity: .88; }
.trend-column small { padding-top: 7px; color: var(--muted); font-size: 8px; }
.trend-column small b { display: block; margin-top: 2px; color: #9aa2a8; font-weight: 600; }
.fact-list { margin: 17px 0 0; display: grid; }
.fact-list > div { padding: 12px 0; border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }
.fact-list dt { color: var(--muted); font-size: 10px; }
.fact-list dd { margin: 0; max-width: 155px; color: var(--text); font-size: 12px; font-weight: 720; text-align: right; }
.fact-list dd small { margin-top: 3px; display: block; color: var(--muted); font-size: 8px; font-weight: 500; }
.ranking-list { margin-top: 17px; display: grid; gap: 4px; }
.ranking-row { padding: 9px 7px; border-radius: 8px; display: grid; grid-template-columns: minmax(120px, .8fr) 1fr 50px; align-items: center; gap: 11px; }
.ranking-row:hover { background: var(--surface-soft); }
.ranking-name { min-width: 0; display: grid; gap: 2px; }
.ranking-name strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.ranking-name small, .ranking-value small { color: var(--muted); font-size: 8px; }
.ranking-bar { height: 7px; overflow: hidden; border-radius: 99px; background: #edf0f2; }
.ranking-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.ranking-value { display: grid; gap: 1px; text-align: right; }
.ranking-value strong { font-size: 11px; }
.attention-list { margin-top: 17px; display: grid; }
.attention-list > a { padding: 12px 0; border-top: 1px solid var(--border); display: grid; grid-template-columns: 29px 1fr auto; align-items: center; gap: 9px; }
.attention-list > a:hover strong { color: var(--accent); }
.attention-icon { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 800; }
.attention-warn { background: var(--warning-soft); color: var(--warning); }
.attention-list span:nth-child(2) { display: grid; gap: 2px; }
.attention-list strong { font-size: 10px; }
.attention-list small { color: var(--muted); font-size: 8px; }
.attention-list > a > b { min-width: 28px; font-size: 15px; text-align: right; }
.dashboard-table-panel { margin-bottom: 15px; overflow: hidden; }
.dashboard-table-panel > .panel-title { min-height: 67px; margin: 0; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.dashboard-disclaimer { margin: 16px 3px 0; color: var(--muted); font-size: 9px; line-height: 1.55; text-align: center; }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eef1f2; }
.login-card { width: min(410px, 100%); padding: 34px; border: 1px solid var(--border); border-radius: 17px; background: var(--surface); box-shadow: 0 18px 60px rgba(20,32,40,.09); }
.login-brand { margin-bottom: 38px; }
.login-brand .brand-mark { background: var(--accent); border-color: var(--accent); }
.login-brand small { color: var(--muted); }
.login-heading { margin-bottom: 24px; }
.login-heading h1 { margin: 0 0 7px; font-size: 27px; letter-spacing: -.035em; }
.login-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.form-stack { display: grid; gap: 16px; }
.login-note { margin: 23px 0 0; color: #8b949b; font-size: 10px; text-align: center; }

@media (max-width: 920px) {
  .sidebar { width: 210px; }
  .main { margin-left: 210px; }
  .content { padding-inline: 24px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .report-filters { grid-template-columns: 1fr 1fr; }
  .tracking-detail-grid { grid-template-columns: 1fr; }
  .dashboard-filters { grid-template-columns: 1fr 1fr; }
  .dashboard-filters .button { width: 100%; }
  .dashboard-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-main-grid, .dashboard-secondary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  body.menu-open { overflow: hidden; }
  .sidebar {
    z-index: 1100; width: min(82vw, 300px); padding-top: 22px; display: flex;
    box-shadow: 18px 0 45px rgba(15, 25, 32, .22); transform: translateX(-105%);
    visibility: hidden; transition: transform .22s ease, visibility .22s ease;
  }
  .sidebar.is-open { transform: translateX(0); visibility: visible; }
  .mobile-menu-close {
    position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border: 0;
    border-radius: 9px; display: grid; place-items: center; background: #243540;
    color: #fff; cursor: pointer; font-size: 25px; line-height: 1;
  }
  .sidebar > .brand { padding-right: 45px; }
  .sidebar-backdrop {
    position: fixed; inset: 0; z-index: 1090; border: 0; display: block;
    background: rgba(15, 24, 30, .48); cursor: pointer; opacity: 0;
    pointer-events: none; transition: opacity .22s ease;
  }
  .sidebar-backdrop.is-visible { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .mobile-header { position: sticky; top: 0; z-index: 900; height: 62px; padding: 0 17px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); }
  .mobile-header-leading { display: flex; align-items: center; gap: 11px; }
  .mobile-menu-button {
    width: 40px; height: 40px; padding: 9px; border: 1px solid var(--border); border-radius: 10px;
    display: grid; align-content: center; gap: 4px; background: var(--surface); cursor: pointer;
  }
  .mobile-menu-button span { width: 20px; height: 2px; border-radius: 2px; background: var(--text); }
  .mobile-menu-button:focus-visible, .mobile-menu-close:focus-visible { outline: 3px solid rgba(71,112,135,.35); outline-offset: 2px; }
  .mobile-header .brand-mark { width: 34px; height: 34px; background: var(--accent); border-color: var(--accent); }
  .mobile-section { color: var(--muted); font-size: 11px; font-weight: 680; }
  .content { padding: 26px 16px 54px; }
  .page-heading, .detail-heading { align-items: stretch; flex-direction: column; }
  .page-heading .button { width: 100%; }
  .stat-grid { display: flex; margin: 0 -16px 18px; padding: 0 16px 4px; overflow-x: auto; scroll-snap-type: x proximity; }
  .stat-card { min-width: 155px; scroll-snap-align: start; }
  .panel-toolbar, .search-form, .inline-form { align-items: stretch; flex-direction: column; }
  .workplace-choice-grid { grid-template-columns: 1fr; }
  .clear-link { padding: 2px; }
  .table-wrap { overflow: visible; }
  table, thead, tbody, tr, td { display: block; }
  thead { display: none; }
  tbody { padding: 0 14px; }
  tr { position: relative; padding: 15px 35px 15px 0; border-top: 1px solid var(--border); }
  tr:first-child { border-top: 0; }
  td { min-height: 27px; padding: 4px 0; border: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: right; }
  td::before { content: attr(data-label); color: #889199; font-size: 10px; font-weight: 650; text-align: left; }
  td:first-child { margin-bottom: 7px; display: block; text-align: left; }
  td:first-child::before { display: none; }
  .table-action { position: absolute; top: 17px; right: -4px; width: auto; }
  .table-action::before { display: none; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .enrollment-layout { grid-template-columns: 1fr; }
  .field-wide, .detail-card-wide { grid-column: auto; }
  .form-panel, .detail-card { padding: 19px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .detail-actions, .detail-actions form, .detail-actions .button { width: 100%; }
  .definition-list > div { grid-template-columns: 105px 1fr; }
  .assignment-attach-controls { grid-template-columns: 1fr; }
  .pin-form { grid-template-columns: 1fr; }
  .pin-form .button { grid-column: auto; width: 100%; }
  .assignment-attach-controls .button { width: 100%; }
  .assignment-item { align-items: flex-start; flex-wrap: wrap; }
  .assignment-actions { width: 100%; padding-left: 44px; }
  .assignment-actions .button { width: 100%; }
  .row-actions { position: static; padding-top: 11px; justify-content: flex-end; }
  .row-actions::before { display: none; }
  .capture-card { grid-template-columns: 52px minmax(0, 1fr); }
  .capture-thumbnail { width: 52px; height: 52px; }
  .webcam-capture { grid-column: 1 / -1; width: 100%; }
  .enrollment-actions { flex-direction: column-reverse; }
  .enrollment-actions .button { width: 100%; }
  .report-filters { grid-template-columns: 1fr; }
  .report-filters .button { width: 100%; }
  .tracking-filter { align-items: stretch; flex-direction: column; }
  .tracking-filter .field { width: 100%; }
  .tracking-grid { grid-template-columns: 1fr; }
  .tracking-note { align-items: flex-start; flex-direction: column; }
  .tracking-detail-heading .button { width: 100%; }
  .tracking-map, .map-panel { height: 440px; min-height: 440px; }
  .dashboard-heading { align-items: stretch; flex-direction: column; }
  .dashboard-updated { justify-content: space-between; }
  .dashboard-updated > div { margin-right: auto; text-align: left; }
  .dashboard-filters { grid-template-columns: 1fr; }
  .dashboard-kpis { display: flex; margin-inline: -16px; padding: 0 16px 4px; overflow-x: auto; }
  .dashboard-kpi { flex: 0 0 155px; }
  .dashboard-chart-panel, .dashboard-facts-panel, .dashboard-ranking-panel, .dashboard-attention-panel { padding: 17px; }
  .dashboard-panel-title { align-items: flex-start; flex-direction: column; }
  .ranking-row { grid-template-columns: minmax(105px, .8fr) 1fr 42px; }
  .dashboard-table-panel .panel-title { padding: 16px; }
  .monthly-sheet-wrap { overflow-x: auto; }
  .monthly-sheet { display: table; }
  .monthly-sheet thead { display: table-header-group; }
  .monthly-sheet tbody { display: table-row-group; padding: 0; }
  .monthly-sheet tr { display: table-row; padding: 0; border: 0; }
  .monthly-sheet th, .monthly-sheet td { display: table-cell; min-height: 0; padding: 9px 7px; border-top: 1px solid #eaedef; text-align: center; }
  .monthly-sheet td::before { display: none; }
  .monthly-sheet .sticky-employee { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
