:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #16202e;
  --muted: #5f6b7a;
  --line: #dde1e7;
  --brand: #12325a;
  --brand-ink: #ffffff;
  --accent: #1f7a4d;
  --accent-soft: #e5f3ec;
  --warn: #a8551a;
  --warn-soft: #fbeee3;
  --danger: #b42318;
  --radius: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; text-align: right; }

.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 9px 14px; font-weight: 600; }
.btn:hover { border-color: #b9c0ca; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.green { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.danger { color: var(--danger); }
.btn.link { border: none; background: none; padding: 4px 6px; color: var(--muted); font-weight: 500; text-decoration: underline; }
.btn:disabled { opacity: .5; cursor: default; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%;
}
label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.error-text { color: var(--danger); font-size: 14px; min-height: 20px; margin: 6px 0; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; transition: all .2s; z-index: 100; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--danger); }

/* ---------------- Kiosk ---------------- */
.kiosk { min-height: 100vh; display: flex; flex-direction: column; }
.kiosk-top { background: var(--brand); color: #fff; padding: 22px 16px; text-align: center; }
.kiosk-top .co { font-size: 14px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.kiosk-top .clock { font-size: clamp(44px, 9vw, 80px); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kiosk-top .date { font-size: 17px; opacity: .85; }
.kiosk-body { flex: 1; padding: 24px 16px; max-width: 1000px; width: 100%; margin: 0 auto; }
.kiosk-body h2 { text-align: center; font-size: 22px; margin: 0 0 18px; }
.name-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.name-tile { background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 22px 14px;
  font-size: 19px; font-weight: 600; display: flex; align-items: center; gap: 10px; justify-content: center; min-height: 82px; }
.name-tile:hover { border-color: var(--brand); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #c6ccd4; flex: none; }
.dot.on { background: #22a35a; box-shadow: 0 0 0 4px #d5f0e0; }
.kiosk-foot { text-align: center; padding: 14px; }
.pin-wrap { max-width: 360px; margin: 0 auto; text-align: center; }
.pin-wrap .who { font-size: 26px; font-weight: 700; margin: 0 0 4px; }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 18px 0 8px; min-height: 20px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--brand); }
.pin-dots i.f { background: var(--brand); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.pinpad button { padding: 18px 0; font-size: 24px; font-weight: 600; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.pinpad button:active { background: #e9edf2; }
.punch-btn { width: 100%; padding: 18px; font-size: 20px; border-radius: 12px; }
.confirm { text-align: center; padding: 40px 10px; }
.confirm .big { font-size: 34px; font-weight: 800; }
.confirm .big.in { color: var(--accent); }
.confirm .big.out { color: var(--brand); }
.confirm .when { font-size: 22px; margin-top: 8px; }

/* ---------------- Manager ---------------- */
.topbar { background: var(--brand); color: #fff; display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.topbar .title { font-weight: 700; font-size: 17px; }
.topbar .spacer { flex: 1; }
.topbar .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); padding: 6px 12px; }
.tabs { display: flex; gap: 4px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: none; background: none; padding: 13px 14px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.wrap { max-width: 1150px; margin: 0 auto; padding: 18px 16px 60px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.period-label { font-weight: 700; font-size: 16px; }
.live { background: var(--accent-soft); border: 1px solid #bfe3cf; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }
.live b { color: var(--accent); }
.chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.chip .k { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.chip .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfc; }
tr:last-child td { border-bottom: none; }
tr.sub td { background: #f7f9fb; font-weight: 700; }
tr.week-head td { background: #eef2f7; font-weight: 700; color: var(--brand); }
td .btn { padding: 4px 9px; font-size: 13px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: #eef1f5; color: var(--muted); }
.badge.mgr { background: var(--warn-soft); color: var(--warn); }
.badge.open { background: var(--accent-soft); color: var(--accent); }
.note-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td input[type=text], td input[type=number] { padding: 5px 8px; }
td input.rate { width: 100px; }
.section-title { font-size: 16px; margin: 22px 0 10px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.notice { background: var(--warn-soft); border: 1px solid #efd2b8; border-radius: var(--radius); padding: 10px 14px; font-size: 14px; margin-bottom: 14px; }

dialog { border: none; border-radius: 12px; padding: 0; width: min(480px, 94vw); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10, 20, 35, .45); }
dialog .dhead { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 17px; }
dialog .dbody { padding: 16px 20px; }
dialog .dfoot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

@media print {
  .topbar, .tabs, .toolbar button, td .btn, .live, .no-print { display: none !important; }
  body { background: #fff; }
}

.banner { border-radius: var(--radius); padding: 12px 16px; margin: 0 auto 16px; max-width: 820px; font-size: 15px; }
.banner.warn { background: var(--warn-soft); border: 1px solid #efd2b8; }
.banner.bad { background: #fdecea; border: 1px solid #f3c2bd; color: #7a1a12; }
.banner ul { margin: 8px 0 10px; padding-left: 20px; }

/* ---------------- Up board ---------------- */
.mode-switch { display: flex; gap: 6px; justify-content: center; margin: 0 auto 20px; background: #e6e9ee; padding: 5px; border-radius: 12px; width: fit-content; }
.mode-switch button { border: none; background: none; padding: 10px 22px; border-radius: 9px; font-weight: 700; font-size: 16px; color: var(--muted); }
.mode-switch button.active { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.up-next { background: var(--panel); border: 2px solid var(--brand); border-radius: 14px; padding: 22px 18px; text-align: center; margin-bottom: 20px; }
.up-next .k { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.up-next .who { font-size: clamp(34px, 7vw, 58px); font-weight: 800; color: var(--brand); line-height: 1.15; margin: 4px 0 2px; }
.up-next .then { color: var(--muted); font-size: 16px; margin-bottom: 16px; }
.up-next .acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.up-next .acts .btn { padding: 15px 26px; font-size: 18px; border-radius: 12px; }
.up-next.empty { border-style: dashed; border-color: var(--line); }
.board-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.board-h { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.line-list { list-style: none; margin: 0 0 18px; padding: 0; }
.line-list li { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.line-list .pos { width: 30px; height: 30px; border-radius: 50%; background: #eef2f7; color: var(--brand); font-weight: 800; display: grid; place-items: center; flex: none; }
.line-list li.first .pos { background: var(--brand); color: #fff; }
.line-list .nm { font-weight: 700; font-size: 17px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-list .meta { color: var(--muted); font-size: 13px; white-space: nowrap; }
.line-list .btn { padding: 7px 12px; font-size: 14px; }
.line-list .none { color: var(--muted); justify-content: center; border-style: dashed; background: none; }
.board-foot { text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center; }
@media (max-width: 480px) { #line-list .meta { display: none; } }
.outcome-btns { display: flex; gap: 6px; flex: none; }
.line-list .btn.green { color: #fff; }
.stale-warn { display: block; background: var(--warn-soft); border: 1px solid #efd2b8; color: #6b3a10; border-radius: 10px; padding: 10px 12px; font-size: 15px; max-width: 420px; margin: 0 auto; }
.alerts { display: grid; gap: 10px; margin-bottom: 14px; }
.alerts .banner { max-width: none; margin: 0; }
.alerts .banner .btn { padding: 5px 10px; font-size: 13px; }

/* ---------- Pay period close, schedule, time off ---------- */
.banner.ok-banner { background: var(--accent-soft); border: 1px solid #b9d9c6; max-width: none; }
.late { color: #b3261e; font-size: 12px; font-weight: 700; }
.small.ok, .ok { color: var(--accent); }
table.sched { min-width: 1020px; table-layout: fixed; }
table.sched th:first-child { width: 120px; }
table.sched th:last-child { width: 70px; }
table.sched th { white-space: nowrap; }
.sched-name { font-weight: 600; white-space: nowrap; }
.sched-cell { vertical-align: top; }
.sched-cell input.sh { width: 100%; padding: 6px 8px; font-size: 14px; }
.sched-cell input.sh.bad { border-color: #b3261e; box-shadow: 0 0 0 2px #fdecea; }
.sched-status { min-height: 16px; margin-top: 4px; font-size: 12px; line-height: 1.3; }
.period-label { font-weight: 600; }

/* ---------- Time cards: name list ---------- */
.emp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 12px; }
.emp-tile { padding: 18px 14px; font-size: 16px; font-weight: 600; text-align: left; background: var(--card, #fff);
  border: 1px solid var(--line, #d9dee3); border-radius: 10px; cursor: pointer; color: inherit; }
.emp-tile:hover { border-color: var(--accent); background: var(--accent-soft); }
.card-name { margin: 0 4px 0 8px; font-size: 18px; }
@media print { #cards-back { display: none; } }
.brand-mini { display: inline-block; font-weight: 800; color: var(--brand); text-decoration: none; font-size: 15px; margin-bottom: 10px; letter-spacing: -.01em; }
#acct-banner .banner, #acct-banner .notice { margin-bottom: 12px; }

.gs { margin-bottom: 16px; border-left: 4px solid var(--accent, #2f7a4f); }
.gs-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.gs-list { list-style: none; margin: 0; padding: 0; }
.gs-step { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(0,0,0,.07); }
.gs-step:first-child { border-top: 0; }
.gs-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.gs-step code { word-break: break-all; }
.gs-check { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 2px solid #c9d1db; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; color: #fff; }
.gs-done .gs-check { background: var(--accent, #2f7a4f); border-color: var(--accent, #2f7a4f); }
.gs-done b { text-decoration: line-through; opacity: .65; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.topbar { flex-wrap: wrap; row-gap: 6px; }
a.btn { text-decoration: none; display: inline-block; color: inherit; }
