/* Employee clock + kiosk app */
.app { min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 6px; }
.app-header .who { text-align: right; min-width: 0; }
.app-header .who .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.app-header .who .sub { font-size: 14px; color: var(--muted); }
.screen { flex: 1; padding: 8px 16px calc(84px + env(safe-area-inset-bottom)); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); z-index: 20; }
.tabbar button { background: none; border: 0; flex: 1; min-height: 56px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.tabbar button .ic { font-size: 22px; line-height: 1; }
.tabbar button.active { color: var(--accent); background: var(--accent-soft); }
.tabbar button .badge { position: absolute; }
.tab-badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 12px; margin-left: 4px; }

/* Status + stamp button */
.status-line { text-align: center; margin: 6px 0 14px; }
.status-line .state { font-size: 15px; color: var(--muted); }
.status-line .since { font-size: 32px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.status-line .elapsed { font-size: 15px; color: var(--muted); }
.stamp-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 10px 0 18px; }
.stamp { width: 232px; height: 232px; border-radius: 50%; border: 0; color: #fff; font-size: 26px; font-weight: 800; letter-spacing: .02em; cursor: pointer; box-shadow: 0 10px 26px rgba(0,0,0,.18), inset 0 -6px 0 rgba(0,0,0,.18); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; transition: transform .08s ease, box-shadow .08s ease; -webkit-tap-highlight-color: transparent; position: relative; }
.stamp small { font-size: 15px; font-weight: 600; opacity: .92; color: inherit; }
.stamp:active, .stamp.pressed { transform: scale(.96); box-shadow: 0 4px 10px rgba(0,0,0,.2), inset 0 -2px 0 rgba(0,0,0,.18); }
.stamp-in { background: radial-gradient(circle at 35% 30%, #35A866, var(--in) 70%); }
.stamp-out { background: radial-gradient(circle at 35% 30%, #D86A3F, var(--out) 70%); }
.stamp-break { background: radial-gradient(circle at 35% 30%, #4F8BD6, var(--info) 70%); }
.stamp:disabled { filter: grayscale(.5); opacity: .7; cursor: wait; }
.secondary-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.secondary-actions .btn { min-height: 56px; }
.secondary-actions .btn.single { grid-column: 1 / -1; }
.checks { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--muted); }
.chip.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.chip.warn { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.last-punch { text-align: center; color: var(--muted); font-size: 15px; }
.pending-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius); background: var(--warn-soft); margin-bottom: 12px; font-size: 15px; }
.pending-banner.ok { background: var(--in-soft); }
.pending-banner .btn { margin-left: auto; }
.alert-banner { padding: 10px 14px; border-radius: var(--radius); background: var(--info-soft); margin-bottom: 12px; font-size: 15px; }

/* Punch flow sheet */
.flow { position: fixed; inset: 0; background: var(--bg); z-index: 40; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
.flow-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.flow-head h2 { margin: 0; flex: 1; font-size: 20px; }
.flow-body { flex: 1; overflow: auto; padding: 8px 16px; }
.flow-foot { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); display: grid; gap: 10px; background: var(--panel); border-top: 1px solid var(--line); }
.steps { display: flex; gap: 6px; padding: 0 16px 8px; }
.steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.steps span.done { background: var(--in); } .steps span.now { background: var(--accent); }
.camera-box { position: relative; width: 100%; aspect-ratio: 3/4; max-height: 56dvh; background: #000; border-radius: 16px; overflow: hidden; }
.camera-box video, .camera-box img, .camera-box canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-box video { transform: scaleX(-1); }
.camera-hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: #fff; text-shadow: 0 1px 3px #000; font-weight: 600; }
.big-choice { display: grid; gap: 10px; }
.big-choice .btn { min-height: 60px; justify-content: flex-start; text-align: left; padding: 0 16px; }
.big-choice .btn .code { font-family: var(--mono); background: var(--panel-2); border-radius: 6px; padding: 2px 8px; margin-right: 10px; color: var(--muted); }
.big-choice .btn.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.search { margin-bottom: 10px; }
.gps-status { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.gps-status .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--line-strong); flex: 0 0 auto; }
.gps-status.ok .dot { background: var(--in); } .gps-status.err .dot { background: var(--danger); } .gps-status.busy .dot { background: var(--warn); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.confirm-summary { display: grid; gap: 8px; }
.confirm-summary .line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.confirm-summary .line b { text-align: right; }
.stamped { text-align: center; padding: 30px 0; }
.stamped .ink { display: inline-block; border: 4px solid var(--in); color: var(--in); border-radius: 12px; padding: 10px 20px; font-size: 34px; font-weight: 900; letter-spacing: .04em; transform: rotate(-6deg); font-variant-numeric: tabular-nums; animation: stampIn .35s cubic-bezier(.2,1.4,.4,1); }
.stamped.out .ink { border-color: var(--out); color: var(--out); }
.stamped .ink small { display: block; font-size: 14px; letter-spacing: .14em; }
@keyframes stampIn { from { transform: rotate(-6deg) scale(1.6); opacity: 0; } to { transform: rotate(-6deg) scale(1); opacity: 1; } }

/* Enroll */
.enroll { padding: 24px 16px; }
.code-input { font-family: var(--mono); font-size: 28px; letter-spacing: .12em; text-align: center; text-transform: uppercase; min-height: 64px; }

/* My time */
.period-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.period-nav .btn { min-width: 48px; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.totals .tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; text-align: center; }
.totals .tile b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.totals .tile span { font-size: 13px; color: var(--muted); }
.day { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.day-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; font-weight: 650; }
.day-head .hrs { font-variant-numeric: tabular-nums; }
.day-head.today { background: var(--accent-soft); }
.day .punch { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 15px; }
.day .punch .t { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 76px; }
.day .punch .k { color: var(--muted); }
.day .actions { padding: 8px 14px 12px; border-top: 1px solid var(--line); }

/* Kiosk */
.kiosk { max-width: 720px; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 360px; margin: 0 auto; }
.pinpad button { min-height: 74px; font-size: 28px; font-weight: 700; border-radius: 16px; border: 1.5px solid var(--line-strong); background: var(--panel); cursor: pointer; }
.pinpad button:active { background: var(--panel-2); }
.pin-display { text-align: center; font-size: 36px; letter-spacing: .3em; min-height: 56px; font-family: var(--mono); margin: 10px 0 16px; }
.kiosk-clock { text-align: center; font-size: 48px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kiosk-date { text-align: center; color: var(--muted); margin-bottom: 10px; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.roster .btn { min-height: 64px; flex-direction: column; gap: 2px; }
.roster .btn small { font-weight: 500; color: var(--muted); }
.roster .btn.in { border-color: var(--in); }

/* Help */
.help h3 { margin-top: 18px; }
.help ul, .help ol { padding-left: 22px; }
.help .note { background: var(--info-soft); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 15px; }
