:root {
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --surface-2: #F4F3EE;
  --border: #E6E4DC;
  --border-strong: #D4D2C8;
  --fg: #1A1A1A;
  --fg-2: #4A4A48;
  --dim: #8A8880;
  --primary: oklch(0.45 0.08 240);
  --primary-fg: #FFFFFF;
  --primary-soft: oklch(0.96 0.02 240);
  --danger: oklch(0.55 0.15 25);
  --danger-soft: oklch(0.96 0.02 25);
  --ok: oklch(0.55 0.12 150);
  --ok-soft: oklch(0.96 0.02 150);
  --warn: oklch(0.75 0.13 80);
  --warn-soft: oklch(0.97 0.04 80);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 2px rgba(20,20,15,0.04), 0 4px 14px rgba(20,20,15,0.04);
  --shadow-sheet: 0 -8px 30px rgba(20,20,15,0.10);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.42;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
@media (min-width: 640px) {
  body { background: #1F1F1D; align-items: center; padding: 24px 0; }
}

.mono { font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace; font-feature-settings: "tnum"; }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.pos { color: var(--ok); }
.neg { color: var(--danger); }
.ta-r { text-align: right; }

/* ============ DEVICE / SCREEN ============ */
/* Mobile-first: full-bleed, no frame. */
.device {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
/* Tablet+: show as centered phone-mockup. */
@media (min-width: 640px) {
  .device {
    max-width: 480px;
    height: min(880px, calc(100dvh - 48px));
    max-height: 920px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  }
}
@media (min-width: 1280px) {
  .device { max-width: 540px; }
}

/* Removed: fake mockup status bar (.status-bar) — was prod-leaked phone chrome */

.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.content { flex: 1; overflow-y: auto; padding: 0 18px 100px; }

/* ============ HEADER ============ */
.hdr {
  padding: 6px 18px 14px;
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-shrink: 0;
}
.hdr-eyebrow { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; white-space: nowrap; }
.hdr-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; }

.role-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 6px 12px 6px 8px;
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  cursor: pointer;
  color: var(--fg);
}
.role-pill:hover { border-color: var(--border-strong); }
.role-dot { width: 8px; height: 8px; border-radius: 99px; }
.role-dot.emp { background: var(--primary); }
.role-dot.mgr { background: var(--ok); }

/* ============ TABBAR ============ */
.tabbar {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 8px 0 calc(env(safe-area-inset-bottom, 8px) + 8px);
}
.tab {
  background: transparent; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0;
  color: var(--dim); font-size: 11px; font-weight: 500;
}
.tab.on { color: var(--fg); }
.tab.on svg { color: var(--primary); }

/* ============ EMPLOYEE HOME ============ */
.big-clock-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 22px 22px 22px;
  box-shadow: var(--shadow-card);
}
.bc-date { color: var(--dim); font-size: 13px; margin-bottom: 12px; }
.bc-time {
  font-size: 64px; font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  display: flex; align-items: baseline; gap: 0;
  color: var(--fg);
}
.bc-colon { animation: blink 1s infinite; padding: 0 2px; }
@keyframes blink { 50% { opacity: 0.3; } }
.bc-sec { font-size: 24px; color: var(--dim); margin-left: 6px; font-weight: 400; }
.bc-shift { font-size: 12px; color: var(--dim); margin-top: 6px; margin-bottom: 22px; }

.big-btn {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  border: none;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.08s, background 0.15s;
}
.big-btn:active { transform: scale(0.98); }
.big-btn.primary { background: var(--fg); color: var(--bg); }
.big-btn.primary:hover { background: #000; }
.big-btn.danger { background: var(--danger); color: white; }
.big-btn.ghost { background: var(--surface-2); color: var(--fg); }
.big-btn.ghost.danger-text { color: var(--danger); }

.checkin-active { display: flex; flex-direction: column; gap: 12px; }
.ci-meta {
  display: flex; align-items: baseline; gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.ci-meta .lg { font-size: 22px; font-weight: 600; }

.today-done {
  display: flex; flex-direction: column; gap: 8px;
  padding-top: 4px;
}
.td-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.td-row .mono { font-size: 16px; font-weight: 500; }

/* ============ FIELDS ============ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; color: var(--dim); font-weight: 500; }
.field input, .field select, .field textarea {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 15px;
  color: var(--fg);
  resize: none;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--fg);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ============ SECTIONS ============ */
.section { margin-top: 26px; }
.section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.section-head h3, .month-head h3 {
  font-size: 14px; font-weight: 600; margin: 0;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.month-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.link {
  background: none; border: none; cursor: pointer;
  font-size: 12px; font-weight: 500; color: var(--primary);
  font-family: inherit;
}
.list { display: flex; flex-direction: column; gap: 8px; }
.empty { padding: 40px; text-align: center; color: var(--dim); font-size: 14px; }

/* ============ HISTORY ROW ============ */
.hist-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--fg);
}
.hist-row:hover { border-color: var(--border-strong); }
.hist-date {
  width: 38px;
  text-align: center;
}
.hd-day { font-size: 18px; font-weight: 600; line-height: 1; }
.hd-month { font-size: 10px; color: var(--dim); margin-top: 2px; text-transform: uppercase; }
.hist-times { font-size: 13px; font-weight: 500; }
.hist-arrow { color: var(--dim); margin: 0 6px; }
.hist-note { font-size: 12px; color: var(--dim); margin-top: 2px; }
.hist-right { text-align: right; }
.hist-hours { font-size: 14px; font-weight: 500; margin-bottom: 4px; }

/* ============ STATUS PILL ============ */
.pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11px; font-weight: 600;
  letter-spacing: -0.005em;
}
.pill.sm { font-size: 10px; padding: 2px 7px; }
.pill.pending { background: var(--warn-soft); color: oklch(0.45 0.13 80); }
.pill.approved { background: var(--ok-soft); color: var(--ok); }
.pill.rejected { background: var(--danger-soft); color: var(--danger); }

.dot-status { display: inline-block; width: 8px; height: 8px; border-radius: 99px; margin-right: 6px; vertical-align: middle; }
.dot-status.approved { background: var(--ok); }

/* ============ PAGES ============ */
.page-title {
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.02em;
  margin: 4px 0 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.add-btn {
  background: var(--fg); color: var(--bg);
  border: none;
  border-radius: 99px;
  padding: 8px 14px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ============ SALARY ============ */
.month-switcher {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px;
  width: fit-content;
  margin-bottom: 16px;
}
.ms-btn { background: none; border: none; cursor: pointer; padding: 4px 10px; font-size: 16px; color: var(--dim); border-radius: 99px; }
.ms-btn:hover { background: var(--surface-2); color: var(--fg); }
.ms-label { font-size: 13px; font-weight: 500; padding: 0 6px; }

.salary-card {
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
}
.sc-eyebrow { font-size: 11px; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.sc-amount { font-size: 32px; font-weight: 500; letter-spacing: -0.03em; margin: 6px 0 8px; }
.sc-status { font-size: 12px; opacity: 0.8; }
.sc-status .dot-status.approved { background: oklch(0.75 0.15 150); }

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.kpi-label { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.kpi-val { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; margin-top: 4px; }

.breakdown {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.breakdown h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 10px; color: var(--fg-2); }
.bd-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0;
  font-size: 14px;
  border-top: 1px solid var(--border);
}
.bd-row:first-of-type { border-top: none; padding-top: 4px; }
.bd-row.total {
  border-top: 1px solid var(--fg);
  margin-top: 4px;
  padding-top: 12px;
  font-weight: 600;
  font-size: 15px;
}
.bd-row.total .mono { font-size: 17px; }

/* Empty-state cho NV chưa có chấm công */
.salary-empty { display: flex; flex-direction: column; gap: 14px; align-items: stretch; text-align: center; padding-top: 12px; }
.se-icon {
  width: 64px; height: 64px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--dim);
  display: inline-flex; align-items: center; justify-content: center;
  align-self: center;
}
.se-title { font-size: 16px; font-weight: 600; }
.se-sub { font-size: 13px; color: var(--dim); padding: 0 12px; line-height: 1.5; }
.se-sub b { color: var(--fg); font-weight: 600; }
.se-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
  text-align: left;
}
.se-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px;
}
.se-row + .se-row { border-top: 1px solid var(--border); padding-top: 8px; }

.note-box {
  background: var(--surface-2);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--fg-2);
}

/* ============ MANAGER ============ */
.filter-tabs {
  display: flex; gap: 6px; margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.ft {
  background: var(--surface); border: 1px solid var(--border); cursor: pointer;
  padding: 8px 12px; border-radius: 99px;
  font-size: 13px; font-weight: 500;
  color: var(--fg-2);
  font-family: inherit;
  white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.ft.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.ft-c {
  font-size: 11px;
  background: rgba(0,0,0,0.06);
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 600;
}
.ft.on .ft-c { background: rgba(255,255,255,0.18); }

.callout {
  background: var(--primary-soft);
  border: 1px solid oklch(0.88 0.04 240);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.callout-title { font-size: 14px; font-weight: 600; color: var(--primary); }
.callout-sub { font-size: 12px; color: var(--fg-2); margin-top: 2px; }

.warn-callout {
  background: var(--warn-soft);
  border: 1px solid oklch(0.88 0.07 80);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: oklch(0.40 0.10 80);
  margin-bottom: 12px;
}

.mgr-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--fg);
}
.mgr-row:hover { border-color: var(--border-strong); }

.mr-avatar {
  width: 36px; height: 36px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  color: var(--fg-2);
  flex-shrink: 0;
}
.mr-avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.mr-avatar.sm { width: 28px; height: 28px; font-size: 11px; }

.mr-name { font-size: 14px; font-weight: 500; }
.mr-role { color: var(--dim); font-weight: 400; font-size: 13px; }
.mr-meta { font-size: 12px; color: var(--dim); margin-top: 2px; }
.dot-sep { margin: 0 6px; opacity: 0.5; }
.mr-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.mini-tag {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--dim); font-weight: 600;
}

/* ============ TEAM ============ */
.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.tc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.tc-head > div:nth-child(2) { min-width: 0; }
.tc-name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.emp-type {
  font-size: 9px; font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.emp-type.ft { background: var(--primary-soft); color: var(--primary); }
.emp-type.pt { background: var(--ok-soft); color: var(--ok); }
.tc-role { font-size: 12px; color: var(--dim); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.badge {
  margin-left: auto;
  background: var(--warn-soft);
  color: oklch(0.40 0.10 80);
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
}
.manage-btn {
  background: var(--surface-2);
  border: none;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12px; font-weight: 500;
  cursor: pointer; font-family: inherit;
  color: var(--fg);
  white-space: nowrap;
  flex-shrink: 0;
}
.tc-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  font-size: 13px;
}
.tc-stats .dim { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 2px; }
.tc-stats .mono { font-weight: 500; }

/* ============ PAYROLL ============ */
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}
.summary-card .sc-amount { color: var(--fg); font-size: 28px; }
.summary-card .sc-eyebrow { color: var(--dim); }
.sc-divider { height: 1px; background: var(--border); margin: 14px 0; }
.sc-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; font-size: 13px; }
.sc-mini .dim { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 2px; }
.sc-mini .mono { font-weight: 500; font-size: 15px; }

.payroll-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.pt-head, .pt-row {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr 1fr;
  gap: 10px;
  padding: 10px 14px;
  align-items: center;
  font-size: 13px;
}
.pt-head {
  background: var(--surface-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--dim);
}
.pt-row { border-top: 1px solid var(--border); }
.pt-name { display: flex; align-items: center; gap: 10px; }
.pt-amount { font-weight: 500; }
.ot-tag { font-size: 10px; color: var(--dim); margin-top: 2px; }

/* ============ SHEETS ============ */
.sheet-overlay {
  position: absolute; inset: 0;
  background: rgba(20,20,15,0.4);
  display: flex; align-items: flex-end;
  z-index: 100;
  animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  background: var(--bg);
  width: 100%;
  border-radius: 18px 18px 0 0;
  max-height: 90%;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-sheet);
  animation: slideUp 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slideUp { from { transform: translateY(20%); } to { transform: translateY(0); } }
.sheet-handle {
  width: 36px; height: 4px;
  background: var(--border-strong);
  border-radius: 99px;
  margin: 8px auto 4px;
}
.sheet-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.sheet-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.x-btn {
  background: var(--surface-2); border: none;
  width: 30px; height: 30px; border-radius: 99px;
  cursor: pointer; font-size: 13px; color: var(--fg-2);
}
.sheet-body {
  padding: 18px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  flex: 1;
}
.sheet-foot {
  padding: 14px 18px 22px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px;
}
.sheet-foot .big-btn { padding: 13px; font-size: 14px; }

/* ============ DETAIL SHEET ============ */
.ds-emp {
  display: flex; align-items: center; gap: 12px;
}
.ds-emp .pill { margin-left: auto; }
.ds-name { font-size: 16px; font-weight: 600; }
.ds-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.ds-grid .dim { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 4px; }
.ds-grid .mono { font-size: 14px; font-weight: 500; }
.ds-note, .ds-reject {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
}
.ds-reject { background: var(--danger-soft); border-color: oklch(0.90 0.04 25); }
.ds-note .dim, .ds-reject .dim { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 4px; }

.edit-block {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.edit-title { font-size: 13px; font-weight: 600; color: var(--fg-2); text-transform: uppercase; letter-spacing: 0.06em; }
.edit-block textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: inherit;
  font-size: 14px;
  resize: none;
  width: 100%;
}
.edit-block textarea:focus { outline: none; border-color: var(--fg); }

/* ============ EXPORT SHEET ============ */
.format-choices { display: flex; flex-direction: column; gap: 8px; }
.fc {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--fg);
}
.fc.on { border-color: var(--fg); background: var(--bg); }
.fc-radio {
  width: 20px; height: 20px;
  border-radius: 99px;
  border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.fc.on .fc-radio { border-color: var(--fg); }
.fc-dot { width: 10px; height: 10px; border-radius: 99px; background: var(--fg); }
.fc-label { font-size: 14px; font-weight: 600; }
.fc-sub { font-size: 12px; }
.mb { margin-bottom: 8px; }
.mt { margin-top: 12px; }

.incl-list { display: flex; flex-direction: column; gap: 6px; }
.incl {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--fg-2);
}
.incl span:first-child {
  width: 18px; height: 18px;
  background: var(--ok-soft); color: var(--ok);
  border-radius: 99px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}

.export-progress {
  align-items: center; justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--fg-2);
}
.spinner {
  width: 40px; height: 40px;
  border: 2.5px solid var(--border);
  border-top-color: var(--fg);
  border-radius: 99px;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.export-done {
  text-align: center;
  padding: 20px 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.ok-mark {
  width: 56px; height: 56px;
  border-radius: 99px;
  background: var(--ok-soft);
  color: var(--ok);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 600;
  margin-bottom: 8px;
}
.ed-title { font-size: 18px; font-weight: 600; }

/* ============ LOGIN ============ */
.login {
  padding: 14px 22px 32px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.login-brand {
  text-align: center;
  padding: 28px 0 22px;
  flex-shrink: 0;
}
.brand-mark {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--fg);
  color: var(--bg);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.brand-name {
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.02em;
}
.brand-tag { font-size: 13px; color: var(--dim); margin-top: 2px; }

.login-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  white-space: nowrap;
}
.login-eyebrow > * { white-space: nowrap; }
.back-btn {
  background: none; border: none; cursor: pointer;
  font-size: 13px; color: var(--fg);
  padding: 0;
  font-family: inherit;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.login-title {
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  text-wrap: pretty;
}

.role-cards { display: flex; flex-direction: column; gap: 8px; }
.role-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--fg);
}
.role-card.on { border-color: var(--fg); }
.rc-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rc-icon.emp { background: var(--primary-soft); color: var(--primary); }
.rc-icon.mgr { background: var(--ok-soft); color: var(--ok); }
.rc-text { flex: 1; }
.rc-title { font-size: 15px; font-weight: 600; }
.rc-sub { font-size: 12px; color: var(--dim); margin-top: 2px; }
.rc-radio {
  width: 22px; height: 22px;
  border-radius: 99px;
  border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rc-radio.sm { width: 18px; height: 18px; }
.rc-radio span {
  width: 12px; height: 12px;
  background: var(--fg);
  border-radius: 99px;
}
.rc-radio.sm span { width: 9px; height: 9px; }
.role-card.on .rc-radio { border-color: var(--fg); }

.user-list { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.user-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--fg);
}
.user-row.on { border-color: var(--fg); }
.ur-text { flex: 1; }
.ur-name { font-size: 14px; font-weight: 500; }
.ur-role { font-size: 12px; color: var(--dim); }

.mgr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
}

.pin-block {
  display: flex; flex-direction: column; gap: 12px;
  margin-top: 4px;
}
.pin-label {
  font-size: 12px; color: var(--dim);
  font-weight: 500;
  text-align: center;
}
.pin-dots {
  display: flex; gap: 14px;
  justify-content: center;
}
.pin-dots.shake { animation: shake 0.4s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.pin-dot {
  width: 12px; height: 12px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1.5px solid var(--border-strong);
  transition: background 0.15s, border-color 0.15s;
}
.pin-dot.on { background: var(--fg); border-color: var(--fg); }
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pin-key {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 0;
  font-size: 20px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Geist Mono', ui-monospace, monospace;
  color: var(--fg);
  transition: background 0.1s;
}
.pin-key:hover { background: var(--surface-2); }
.pin-key:active { background: var(--border); }
.pin-key.faded { font-size: 14px; color: var(--dim); font-family: inherit; font-weight: 500; }

.login-hint { font-size: 12px; text-align: center; }

/* login form */
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form.shake { animation: shake 0.4s; }
.pwd-wrap { position: relative; display: flex; }
.pwd-wrap input { flex: 1; padding-right: 56px !important; }
.pwd-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: var(--surface-2); border: none;
  padding: 5px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600; cursor: pointer;
  font-family: inherit; color: var(--fg-2);
}
.login-error {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.demo-hint {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.dh-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 600; color: var(--dim);
}
.dh-row {
  background: var(--surface-2); border: none;
  padding: 10px 12px; border-radius: var(--radius-sm);
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; font-family: inherit; text-align: left;
  color: var(--fg);
}
.dh-row:hover { background: var(--border); }
.dh-label { font-size: 13px; font-weight: 500; }
.dh-cred { font-size: 11px; color: var(--dim); margin-top: 2px; }
.dh-fill {
  font-size: 11px; font-weight: 600; color: var(--primary);
  background: var(--primary-soft);
  padding: 4px 10px; border-radius: 99px;
}

/* account mgmt */
.locked-tag {
  display: inline-block;
  margin-left: 6px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.manage-btn {
  background: var(--surface-2);
  border: none;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12px; font-weight: 500;
  cursor: pointer; font-family: inherit;
  color: var(--fg);
}
.manage-btn:hover { background: var(--border); }

/* old duplicate block removed below */

.action-list { display: flex; flex-direction: column; gap: 6px; }
.action-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; font-family: inherit; text-align: left;
  color: var(--fg);
}
.action-row:hover { border-color: var(--border-strong); }
.action-row.danger { color: var(--danger); }
.action-row span:last-child { color: var(--dim); font-size: 18px; }
.ar-title { font-size: 14px; font-weight: 500; }
.ar-sub { font-size: 12px; color: var(--dim); margin-top: 2px; }

.info-box {
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  color: oklch(0.35 0.08 240);
}

.login-foot {
  margin-top: auto;
  padding-top: 18px;
  text-align: center;
  font-size: 11px;
  color: var(--dim);
}
.big-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ============ MGR HOME ============ */
.mgr-home { display: flex; flex-direction: column; gap: 16px; padding-top: 4px; }
.hero-card {
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.hc-eyebrow { font-size: 11px; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.hc-row {
  display: flex; align-items: center;
  margin-top: 12px;
  gap: 14px;
}
.hc-row > div:not(.hc-divider) { flex: 1; }
.hc-num { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; }
.hc-den { font-size: 14px; opacity: 0.5; }
.hc-lbl { font-size: 11px; opacity: 0.7; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.hc-divider { width: 1px; height: 36px; background: rgba(255,255,255,0.15); }

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  height: 90px;
  align-items: end;
  margin-bottom: 10px;
}
.bar-wrap { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 4px; }
.bar {
  width: 100%;
  background: var(--fg);
  border-radius: 4px 4px 2px 2px;
  min-height: 4px;
  flex-shrink: 0;
}
.bar-wrap:last-child .bar { background: var(--primary); }
.bar-lbl { font-size: 10px; color: var(--dim); }
.chart-foot {
  display: flex;
  gap: 18px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.chart-foot .mono { font-size: 14px; font-weight: 500; }

.month-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  text-align: left;
  color: var(--fg);
}
.month-tile:hover { border-color: var(--border-strong); }
.mt-amount { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; margin-top: 2px; }
.mt-arrow { color: var(--dim); font-size: 24px; }

.logout-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--danger);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 8px;
}
.logout-btn:hover { background: var(--danger-soft); border-color: oklch(0.90 0.04 25); }

.change-pw-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--fg-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 8px;
}
.change-pw-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }

/* Force change-password screen */
.change-pw-screen { flex: 1; }

.must-change-banner {
  background: var(--warn-soft);
  border: 1px solid oklch(0.88 0.07 80);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  color: oklch(0.40 0.10 80);
  line-height: 1.5;
}
.must-change-banner strong { color: oklch(0.35 0.10 80); }

/* Login helper hint (replaces demo-hint block) */
.login-helper-hint {
  font-size: 13px;
  color: var(--fg-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  line-height: 1.5;
}
.login-helper-hint strong { color: var(--fg); }

/* ============ TOAST ============ */
.toast {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--fg);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 99px;
  font-size: 13px; font-weight: 500;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(20,20,15,0.2);
  animation: toastIn 0.2s;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Scan overlay (employee QR + selfie) ---------- */
.scan-overlay {
  position: fixed; inset: 0;
  background: #0a0a0a;
  color: #fff;
  display: flex; flex-direction: column;
  z-index: 100;
}
.scan-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: rgba(0,0,0,0.7);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.scan-x {
  background: rgba(255,255,255,0.1); color: #fff;
  border: 0; width: 36px; height: 36px; border-radius: 18px;
  font-size: 16px; cursor: pointer;
}
.scan-title { line-height: 1.2; }
.scan-step { font-size: 11px; opacity: 0.7; margin-top: 2px; }
.scan-stage {
  flex: 1; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: #000;
}
.scan-video {
  width: 100%; height: 100%; object-fit: cover;
}
.scan-preview {
  max-width: 100%; max-height: 100%;
  border-radius: 12px;
}
.scan-viewfinder {
  position: absolute;
  width: 70vw; height: 70vw; max-width: 320px; max-height: 320px;
  border: 3px solid rgba(255,255,255,0.9);
  border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.45);
  pointer-events: none;
}
.scan-spinner-wrap { display: flex; align-items: center; justify-content: center; }
.scan-error {
  position: absolute; bottom: 14px; left: 14px; right: 14px;
  background: rgba(220, 60, 60, 0.95); color: #fff;
  padding: 10px 12px; border-radius: 10px; font-size: 13px;
}
.scan-foot {
  display: flex; gap: 10px;
  padding: 14px;
  background: rgba(0,0,0,0.7);
  border-top: 1px solid rgba(255,255,255,0.08);
}
.scan-hint {
  font-size: 13px; opacity: 0.85;
  padding: 6px 8px; flex: 1; text-align: center;
}

/* ---------- Manager QR display modal ---------- */
.qr-modal {
  position: fixed; inset: 0;
  background: #fafaf7;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px;
  z-index: 100;
}
.qr-close {
  position: absolute; top: 18px; right: 18px;
  background: #efeee8; border: 0; border-radius: 8px;
  padding: 8px 12px; cursor: pointer;
}
.qr-eyebrow { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: #666; }
.qr-title { font-size: 22px; font-weight: 600; margin: 4px 0 18px; }
.qr-frame {
  background: #fff; padding: 18px; border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.qr-skel {
  width: 320px; height: 320px;
  display: flex; align-items: center; justify-content: center;
  background: #f1f0ec; color: #aaa; border-radius: 8px;
}
.qr-counter { margin-top: 22px; font-size: 14px; }
.qr-hint { margin-top: 14px; font-size: 13px; color: #666; max-width: 420px; text-align: center; }
.qr-err { margin-top: 8px; color: #b33; font-size: 13px; }

/* CTA on Manager Home */
.qr-cta {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; margin-bottom: 14px;
  background: #1a1a1a; color: #fff;
  border: 0; border-radius: 16px;
  cursor: pointer; text-align: left;
}
.qr-cta-eyebrow { font-size: 11px; opacity: 0.7; letter-spacing: 0.06em; text-transform: uppercase; }
.qr-cta-title { font-size: 16px; font-weight: 600; margin-top: 2px; }
.qr-cta-arrow { font-size: 22px; opacity: 0.7; }

/* ---------- Evidence in DetailSheet ---------- */
.ds-evidence { margin-top: 10px; }
.ds-evi-row {
  display: flex; gap: 12px; align-items: center;
  padding: 8px 0;
}
.ds-evi-thumb {
  display: block; width: 96px; height: 96px;
  border-radius: 10px; overflow: hidden; background: #efeee8;
}
.ds-evi-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ds-evi-missing {
  width: 96px; height: 96px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #888; text-align: center; padding: 6px;
  background: #efeee8; border-radius: 10px;
}
.ds-evi-meta { display: flex; flex-direction: column; gap: 4px; }

/* ---------- Audit log tab ---------- */
.audit-log { padding-bottom: 60px; }
.audit-filters {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px;
}
.audit-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: #fff; border: 1px solid #f0eee8;
  border-radius: 12px; margin-bottom: 8px; text-align: left;
  cursor: pointer;
}
.audit-thumb {
  width: 56px; height: 56px; border-radius: 8px; object-fit: cover;
  background: #efeee8;
}
.audit-mid { flex: 1; min-width: 0; }
.audit-name { font-weight: 600; font-size: 14px; }
.audit-meta { font-size: 12px; color: #666; margin-top: 2px; }
.audit-right { display: flex; }

.audit-img-wrap {
  background: #efeee8; border-radius: 12px; overflow: hidden;
  display: flex; justify-content: center; max-height: 360px;
  margin-bottom: 12px;
}
.audit-img-wrap img { max-width: 100%; max-height: 360px; object-fit: contain; }

.pill.small { font-size: 10px; padding: 2px 6px; }

/* ---------- Archived employee UI ---------- */
.archived-toggle {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0 12px; padding: 8px 10px;
  background: #f5f4ee; border-radius: 10px;
  font-size: 13px; cursor: pointer; user-select: none;
}
.archived-toggle input { width: 16px; height: 16px; }
.team-card.archived { opacity: 0.6; }
.team-card.archived .tc-name { text-decoration: line-through; text-decoration-color: rgba(0,0,0,0.25); }
.archived-tag {
  display: inline-block; margin-left: 6px;
  padding: 1px 8px; font-size: 10px; font-weight: 600;
  background: #888; color: #fff; border-radius: 999px; letter-spacing: 0.04em;
}
.action-row.danger { color: #b33; }
.action-row.danger .ar-title { color: #b33; }
