:root {
  --bg: #eef2f8;
  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --text: #16213e;
  --muted: #6b7684;
  --accent: #2563eb;
  --accent-2: #16a34a;
  --danger: #dc2626;
  --border: #e2e8f0;
}

* { box-sizing: border-box; }
button, input, select, textarea { font-family: inherit; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

#app { height: 100%; position: relative; overflow: hidden; }
#app::before, #app::after {
  content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.16), transparent 70%);
  filter: blur(10px); z-index: 0; pointer-events: none;
}
#app::before { bottom: -180px; left: -140px; }
#app::after { top: -160px; right: -120px; background: radial-gradient(circle, rgba(37, 99, 235, 0.1), transparent 70%); }

.screen {
  display: none;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
  position: relative;
  z-index: 1;
  overflow-y: auto;
}
.screen.active { display: flex; }
#screen-pin.active { align-items: stretch; justify-content: flex-start; padding: 0; }

/* ---- Sign-in: header, stepper, and the three step cards ---- */
.kiosk-header {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 16px 36px; background: rgba(255, 255, 255, 0.7); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px); z-index: 2; flex-shrink: 0;
}
.kiosk-clock { font-size: 26px; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.kiosk-date { font-size: 14px; color: var(--muted); margin-top: 2px; }
.kiosk-brand { display: flex; align-items: center; gap: 12px; }
.kiosk-brand img { width: 46px; height: 46px; border-radius: 50%; }
.brand-name { font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -0.01em; }
.brand-divider { width: 1px; height: 30px; background: var(--border); margin: 0 6px; }
.brand-sub { font-size: 22px; color: var(--muted); }
.location-chip {
  justify-self: end; display: flex; align-items: center; gap: 12px; max-width: 100%;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 16px;
  padding: 8px 14px 8px 8px; cursor: pointer; font-family: inherit; text-align: left; color: var(--text);
}
.location-chip-text { display: flex; flex-direction: column; min-width: 0; }
.location-chip-text strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.location-chip-text small { font-size: 12px; color: var(--muted); }
.location-chip .chevron { color: var(--text); flex-shrink: 0; margin-left: 6px; }

.tile-icon {
  width: 48px; height: 48px; border-radius: 12px; background: #dbe7fb; color: var(--accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tile-icon.small { width: 42px; height: 42px; background: var(--panel-2); color: #475569; }
.location-chip .tile-icon { width: 40px; height: 40px; background: transparent; }

.stepper { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; max-width: 760px; margin: 24px auto 20px; padding: 0 24px; flex-shrink: 0; }
.stepper li { position: relative; display: flex; justify-content: center; }
.stepper li:not(:last-child)::after {
  content: ""; position: absolute; top: 22px; left: calc(50% + 34px); width: calc(100% - 68px); height: 3px;
  border-radius: 2px; background: var(--border);
}
.stepper li.active:not(:last-child)::after { background: linear-gradient(to right, var(--accent) 60%, var(--border) 60%); }
.stepper li.done:not(:last-child)::after { background: var(--accent); }
.stepper button { display: flex; flex-direction: column; align-items: center; gap: 10px; background: none; border: none; cursor: pointer; font-family: inherit; padding: 0; }
.stepper button:disabled { cursor: default; }
.step-dot {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #e8edf5; color: var(--text); font-weight: 700; font-size: 17px; transition: background 0.2s, color 0.2s;
}
.step-label { font-size: 15px; color: var(--muted); font-weight: 500; }
.stepper li.done .step-dot, .stepper li.active .step-dot { background: var(--accent); color: #fff; }
.stepper li.active .step-dot { box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.15); }
.stepper li.active .step-label { color: var(--accent); font-weight: 700; }

.login-steps {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start;
  width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 36px 36px;
}
.step-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 22px; padding: 28px;
  box-shadow: 0 10px 40px rgba(16, 30, 60, 0.06); display: flex; flex-direction: column; gap: 16px; min-width: 0;
}
.step-card-header { display: flex; align-items: center; gap: 18px; margin-bottom: 4px; }
.step-icon {
  width: 64px; height: 64px; border-radius: 50%; background: #eef4ff; color: var(--accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.step-card-header h2 { margin: 0; font-size: 22px; color: var(--text); }
.step-card-header p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.link-notice { margin: 0; padding: 10px 14px; border-radius: 10px; background: #fef3c7; color: #92400e; font-size: 14px; }
.link-notice[hidden] { display: none; }

.selected-box {
  display: flex; align-items: center; gap: 14px; min-height: 80px;
  border: 1.5px solid var(--accent); background: #f5f9ff; border-radius: 16px; padding: 14px 16px;
}
.selected-box.empty { border: 1.5px dashed #cbd5e1; background: var(--panel-2); }
.selected-box.empty strong { color: var(--muted); }
.selected-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.selected-text strong { font-size: 17px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-text small { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.avatar-initials {
  width: 52px; height: 52px; border-radius: 50%; background: #dbe7fb; color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; flex-shrink: 0;
}

.list-label { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 6px; }
.search-box {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 12px;
  padding: 0 14px; color: var(--muted); background: var(--panel);
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.search-box input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; padding: 13px 0; font-size: 15px; color: var(--text); font-family: inherit; }

.pick-list { display: flex; flex-direction: column; gap: 10px; max-height: 330px; overflow-y: auto; padding: 2px; }
.pick-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; font-family: inherit;
  border: 1px solid var(--border); border-radius: 14px; background: var(--panel); padding: 11px 14px; cursor: pointer;
}
.pick-row:hover { border-color: #bcd3fb; }
.pick-row.selected { background: #f0f6ff; border-color: #bcd3fb; }
.pick-row.selected .tile-icon.small { background: #dbe7fb; color: var(--accent); }
.pick-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.pick-text strong { font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-text small { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-end { color: var(--muted); display: flex; flex-shrink: 0; }
.pick-end.check { color: var(--accent); }
.pick-empty { margin: 0; padding: 18px; text-align: center; color: var(--muted); font-size: 14px; }

.pin-step { align-items: stretch; }
.pin-dots { display: flex; justify-content: center; gap: 22px; margin: 22px 0 4px; }
.pin-dots span { width: 18px; height: 18px; border-radius: 50%; background: #e8edf5; transition: background 0.15s; }
.pin-dots span.filled { background: var(--accent); }
.pin-error { color: var(--danger); min-height: 20px; font-size: 14px; margin: 0; text-align: center; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: 100%; max-width: 360px; margin: 0 auto; }
.keypad button {
  height: 72px; font-size: 26px; font-weight: 600; border-radius: 14px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); cursor: pointer; font-family: inherit;
  box-shadow: 0 2px 8px rgba(16, 30, 60, 0.05); display: flex; align-items: center; justify-content: center; gap: 8px;
}
.keypad button:active { background: #eef4ff; border-color: #bcd3fb; }
.keypad .key-clear { font-size: 15px; font-weight: 600; color: var(--text); }
.keypad .key-back { background: #eef4ff; border-color: #d3e1fb; color: var(--accent); }
.secure-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 0; color: var(--accent); font-size: 14px; font-weight: 600; }

/* Opened from a direct link: fixed to the linked warehouse's PIN pad. */
.locked .location-chip { cursor: default; }
.locked .location-chip .chevron { display: none; }
.locked .stepper, .locked .step-card[data-card="1"] { display: none; }
.locked .login-steps { grid-template-columns: minmax(0, 1fr); max-width: 520px; padding-top: 32px; }

/* Narrower than two comfortable columns: one step at a time, driven by the stepper. */
@media (max-width: 900px) {
  .login-steps { grid-template-columns: minmax(0, 1fr); max-width: 580px; padding: 0 20px 28px; }
  .login-steps[data-view="1"] .step-card:not([data-card="1"]),
  .login-steps[data-view="2"] .step-card:not([data-card="2"]) { display: none; }
}

.pin-page-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.panel-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(16, 30, 60, 0.08);
}
.panel-card.wide { max-width: 480px; text-align: left; }
.panel-card h1 { margin: 0 0 24px; font-size: 22px; color: var(--text); }
.status-line { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.link-button {
  background: none; border: none; color: var(--accent);
  font-size: 14px; font-weight: 600; cursor: pointer; padding: 6px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: inherit;
}
.link-button[hidden] { display: none; }

/* ---- Employee home ---- */
#screen-home.active { justify-content: safe center; }
.home-page { width: 100%; max-width: 560px; flex-shrink: 0; }
.home-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 24px; padding: 28px;
  box-shadow: 0 10px 40px rgba(16, 30, 60, 0.08); display: flex; flex-direction: column; gap: 18px; text-align: left;
}
.home-top { display: flex; align-items: center; gap: 16px; }
.avatar-initials.large { width: 60px; height: 60px; font-size: 21px; background: var(--accent); color: #fff; }
.home-identity { flex: 1; min-width: 0; }
.home-identity h1 { margin: 0; font-size: 22px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-identity p { margin: 3px 0 0; font-size: 14px; color: var(--muted); }
.signout-button {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; font-family: inherit;
  border: 1px solid var(--border); background: var(--panel); color: var(--muted);
  border-radius: 10px; padding: 9px 14px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.signout-button:hover { color: var(--text); background: var(--panel-2); }

.status-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px;
}
.status-panel.in { background: #f0fdf4; border-color: #bbf7d0; }
.status-chip {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--muted);
}
.status-panel.in .status-chip { color: #15803d; }
.status-main { font-size: 18px; font-weight: 700; color: var(--text); margin-top: 6px; }
.status-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.status-timer { text-align: right; flex-shrink: 0; }
.status-timer strong { display: block; font-size: 26px; font-weight: 800; color: #15803d; font-variant-numeric: tabular-nums; }
.status-timer small { font-size: 12px; color: var(--muted); }
.dot.off { background: #94a3b8; }
.dot.live { background: #16a34a; box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }

.clock-button {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 24px 0; font-size: 22px; font-weight: 700; font-family: inherit; letter-spacing: 0.01em;
  border-radius: 16px; border: none; cursor: pointer; color: #fff;
  background: linear-gradient(180deg, #22c55e, #16a34a); box-shadow: 0 10px 24px rgba(22, 163, 74, 0.28);
  transition: transform 0.1s, box-shadow 0.2s;
}
.clock-button:active { transform: scale(0.99); }
.clock-button:disabled { opacity: 0.7; cursor: default; }
.clock-button.clock-out { background: linear-gradient(180deg, #ef4444, #dc2626); box-shadow: 0 10px 24px rgba(220, 38, 38, 0.25); }

.home-location { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; }
.home-location-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.home-location-text small { font-size: 12px; color: var(--muted); }
.home-location-text strong { font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.action-tile {
  display: flex; align-items: center; gap: 12px; text-align: left; font-family: inherit; cursor: pointer;
  border-radius: 16px; padding: 16px 14px; border: 1.5px solid; transition: transform 0.1s, box-shadow 0.2s;
}
.action-tile:hover { box-shadow: 0 6px 18px rgba(16, 30, 60, 0.08); }
.action-tile:active { transform: scale(0.99); }
.action-tile.blue { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.action-tile.amber { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.action-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: #fff; }
.action-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.action-text strong { font-size: 15px; color: var(--text); }
.action-text small { font-size: 12px; color: var(--muted); }
.action-chevron { flex-shrink: 0; opacity: 0.7; }

.recent-header { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.recent-header h2 { margin: 0; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.recent-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; padding-right: 2px; }
.recent-row { display: flex; align-items: center; gap: 14px; border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; }
.recent-date { width: 46px; flex-shrink: 0; text-align: center; background: #f0fdf4; border-radius: 10px; padding: 5px 0; }
.recent-date span { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; color: #16a34a; }
.recent-date strong { display: block; font-size: 18px; color: var(--text); line-height: 1.1; }
.recent-date.ongoing { background: #fff7ed; }
.recent-date.ongoing span { color: #c2410c; }
.recent-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.recent-main strong { font-size: 15px; color: var(--text); }
.recent-main small { font-size: 13px; color: var(--muted); }

.feedback { min-height: 20px; font-size: 14px; color: var(--accent-2); margin: 12px 0 0; }
.feedback.error { color: var(--danger); }
.home-card .feedback { margin: 0; text-align: center; }
.home-card .feedback:empty { display: none; }

.warehouse-grid { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.warehouse-grid button {
  padding: 18px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-size: 16px; cursor: pointer;
}
.warehouse-grid button.selected { border-color: var(--accent); background: #dbeafe; }


.secondary-button {
  padding: 12px 20px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel); color: var(--muted); cursor: pointer;
}
.primary-button {
  padding: 12px 24px; border-radius: 10px; border: none;
  background: var(--accent); color: #fff; font-weight: 600; cursor: pointer;
}
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }

#reg-form { display: flex; flex-direction: column; gap: 14px; }
#reg-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
#reg-form input, #reg-form select, #reg-form textarea {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 10px; font-size: 14px; font-family: inherit;
}

.panel-card h2, .section-label { font-size: 13px; color: var(--muted); margin: 20px 0 10px; text-align: left; text-transform: uppercase; letter-spacing: 0.03em; }
.reg-history-header { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; }
.reg-history-header h2 { margin: 0; }
.reg-history-header select {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 5px 8px; font-size: 12px;
}
.request-list { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }
.request-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  background: var(--panel-2); border-radius: 8px; padding: 10px 12px; font-size: 13px;
}
.request-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.request-row-sub { color: var(--muted); font-size: 11px; }
.request-row-reason { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge.pending { background: #fef3c7; color: #92400e; }
.badge.approved { background: #dcfce7; color: #166534; }
.badge.rejected { background: #fee2e2; color: #991b1b; }
.badge.complete { background: #dcfce7; color: #166534; }
.badge.active { background: #dbeafe; color: #1e40af; }

/* Attendance History: a calm, airy dashboard — neutral grey page, white cards, light type weights. */
#screen-history.active { justify-content: flex-start; align-items: center; background: #f6f7f8; padding-top: 24px; }
.history-page { flex-shrink: 0; width: 100%; max-width: 1180px; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.history-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.history-header h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: #111827; }
.history-header .pin-page-subtitle { font-size: 13px; color: #6b7280; margin-top: 4px; }
.history-header .secondary-button { padding: 8px 14px; font-size: 13px; }
.history-header .secondary-button { color: #374151; font-weight: 500; border-color: #e5e7eb; }
.history-card { background: #fff; border: 1px solid #ececec; border-radius: 16px; box-shadow: 0 1px 2px rgba(17, 24, 39, 0.03); }
.history-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; }
.segmented { display: inline-flex; background: #f3f4f6; border: 1px solid #ececec; border-radius: 10px; padding: 3px; }
.segmented button { border: none; background: none; padding: 6px 14px; border-radius: 8px; font-size: 13px; color: #6b7280; cursor: pointer; font-weight: 500; font-family: inherit; }
.segmented button.active { background: #fff; color: #111827; box-shadow: 0 1px 3px rgba(17, 24, 39, 0.08); }
.history-range { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.history-range[hidden] { display: none; }
.history-range select, .history-range input {
  background: #fff; border: 1px solid #e5e7eb; color: #111827; border-radius: 12px;
  padding: 7px 12px; font-size: 13px; font-family: inherit; box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}
.history-range select { min-width: 130px; border-radius: 10px; }
.history-range label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #6b7280; }
.history-range .primary-button { padding: 7px 16px; font-weight: 500; font-size: 13px; }
.history-week-label { font-size: 13px; font-weight: 500; color: #111827; min-width: 160px; text-align: center; }
.icon-button {
  width: 32px; height: 32px; border-radius: 10px; border: 1px solid #e5e7eb; background: #fff;
  color: #374151; font-size: 16px; cursor: pointer;
}
.icon-button:disabled, .history-pager button:disabled { opacity: 0.4; cursor: default; }
.history-error { color: var(--danger); font-size: 13px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card { background: #fff; border: 1px solid #ececec; border-radius: 16px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(17, 24, 39, 0.03); }
.stat-card-label { display: flex; align-items: center; gap: 10px; color: #6b7280; font-size: 13px; margin-bottom: 12px; }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; background: #f3f4f6; color: #374151; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-card-value { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: #111827; font-variant-numeric: tabular-nums; }

.history-body { display: grid; grid-template-columns: minmax(270px, 1fr) 2.4fr; gap: 14px; align-items: start; }
.history-calendar { padding: 18px 20px; }
.cal-title { font-weight: 600; font-size: 14px; color: #111827; margin-bottom: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 10px; column-gap: 4px; text-align: center; }
.cal-weekday { font-size: 11px; color: #6b7280; font-weight: 500; }
.cal-day {
  position: relative; aspect-ratio: 1; max-width: 34px; width: 100%; margin: 0 auto;
  border: 2px solid transparent; border-radius: 10px; background: none;
  font-size: 12px; color: #111827; cursor: pointer; font-family: inherit;
}
.cal-day.weekend, .cal-day.outside { color: #b5bac1; }
.cal-day.present { background: #e8f5ec; color: #15803d; font-weight: 500; }
.cal-day.present.outside { background: #f3f9f5; color: #8fb49c; }
.cal-day::after { content: ""; position: absolute; bottom: -7px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: transparent; }
.cal-day.present::after { background: #16a34a; }
.cal-day.absent::after { background: #ef4444; }
.cal-day.today { border-color: #1d4ed8; }
.cal-day:disabled { cursor: default; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; padding-top: 12px; border-top: 1px solid #ececec; font-size: 12px; color: #6b7280; }
.cal-legend span { display: inline-flex; align-items: center; gap: 7px; }
.cal-legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

.history-sessions { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-empty { background: #fff; border: 1px solid #ececec; border-radius: 16px; padding: 24px; text-align: center; margin: 0; }
.history-row {
  display: flex; align-items: center; gap: 16px;
  background: #fff; border: 1px solid #ececec; border-radius: 16px; padding: 14px 18px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.03);
}
.history-date { flex-shrink: 0; width: 50px; text-align: center; background: #eef7f1; border-radius: 10px; padding: 6px 2px; }
.history-date .weekday, .history-date .month { display: block; font-size: 9px; font-weight: 500; color: #15803d; text-transform: uppercase; letter-spacing: 0.06em; }
.history-date .day { display: block; font-size: 19px; font-weight: 600; color: #111827; line-height: 1.25; }
.history-date.ongoing { background: #fdf3e7; }
.history-date.ongoing .weekday, .history-date.ongoing .month { color: #c2410c; }
.history-main { flex: 1; min-width: 0; }
.session-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.session-chip {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 100%;
  border: 1px solid #e5e7eb; border-radius: 8px; padding: 4px 10px; font-size: 13px; color: #111827;
}
.session-label { font-size: 11px; font-weight: 500; color: #6b7280; }
.session-time { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.session-duration { color: #6b7280; font-size: 12px; font-variant-numeric: tabular-nums; }
.history-location { display: inline-flex; align-items: center; gap: 5px; color: #6b7280; min-width: 0; }
.history-location svg { flex-shrink: 0; }
.history-main > .history-location { margin-top: 6px; font-size: 12px; }
.history-count { font-size: 11px; color: #6b7280; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #16a34a; flex-shrink: 0; }
.dot.ongoing { background: #f59e0b; }
.history-bar-track { height: 5px; background: #f1f2f4; border-radius: 3px; margin-top: 10px; overflow: hidden; }
.history-bar-fill { height: 100%; background: #16a34a; border-radius: 3px; }
.history-bar-fill.ongoing { background: #d97706; }
.history-side { flex-shrink: 0; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.history-duration { font-size: 16px; font-weight: 600; color: #111827; font-variant-numeric: tabular-nums; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 500; }
.status-pill.complete { background: #f0faf3; color: #16a34a; border: 1px solid #cfeedb; }
.status-pill.ongoing { background: #fdf6ec; color: #c2410c; border: 1px solid #f6dcbc; }
.history-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: #6b7280; }
.history-pager[hidden] { display: none; }
.history-pager .secondary-button { padding: 7px 14px; font-size: 13px; color: #374151; border-color: #e5e7eb; }

@media (max-width: 860px) {
  .history-body { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .kiosk-header { grid-template-columns: auto 1fr; padding: 12px 16px; row-gap: 10px; }
  .kiosk-brand { grid-column: 1 / -1; grid-row: 1; justify-content: center; }
  .kiosk-brand img { width: 36px; height: 36px; }
  .brand-name { font-size: 20px; }
  .brand-sub { font-size: 17px; }
  .kiosk-clock { font-size: 18px; }
  .kiosk-date { font-size: 12px; }
  .location-chip { padding: 6px 10px 6px 4px; gap: 6px; border-radius: 12px; }
  .location-chip .tile-icon { width: 32px; height: 32px; }
  .location-chip-text strong { font-size: 13px; }
  .stepper { margin: 16px auto 14px; padding: 0 8px; }
  .step-dot { width: 36px; height: 36px; font-size: 15px; }
  .stepper li:not(:last-child)::after { top: 18px; left: calc(50% + 26px); width: calc(100% - 52px); }
  .step-label { font-size: 12px; text-align: center; }
  .login-steps { padding: 0 12px 20px; }
  .step-card { padding: 20px 16px; border-radius: 18px; }
  .step-icon { width: 48px; height: 48px; }
  .step-card-header { gap: 14px; }
  .step-card-header h2 { font-size: 19px; }
  .keypad { gap: 10px; }
  .keypad button { height: 62px; font-size: 22px; }
}

@media (max-width: 480px) {
  .pin-page-subtitle { font-size: 13px; }
  .panel-card { padding: 24px 20px; border-radius: 16px; max-width: 100%; }
  .home-card { padding: 20px 16px; border-radius: 20px; gap: 14px; }
  .clock-button { padding: 20px 0; font-size: 20px; }
  .action-grid { grid-template-columns: 1fr; }
  .signout-button { padding: 8px 10px; }
  .status-timer strong { font-size: 22px; }
  #app::before, #app::after { width: 260px; height: 260px; }
  .stat-grid { gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-card-value { font-size: 20px; }
  .history-header h1 { font-size: 22px; }
  .history-toolbar { padding: 12px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; padding: 8px 6px; }
  .history-range { width: 100%; }
  .history-range select { flex: 1; }
  .history-range label { flex: 1 1 100%; }
  .history-range input { flex: 1; }
  .history-week-label { flex: 1; min-width: 0; }
  /* Date and day totals on top, the day's sessions full-width underneath. */
  .history-row { display: grid; grid-template-columns: 58px 1fr; gap: 12px; padding: 12px 14px; }
  .history-side { grid-column: 2; grid-row: 1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 10px; }
  .history-main { grid-column: 1 / -1; grid-row: 2; }
}
