/* Big Creative Training — BCT Time. Tokens follow the policies and forms sites. */

:root {
    --brand: #00abb1;
    --brand-strong: #00787c;
    --brand-ink: #006c70;
    --brand-soft: #e2f5f5;
    --brand-softer: #f1fafa;

    --bg: #f5f8f8;
    --surface: #ffffff;
    --ink: #13252b;
    --muted: #5a6b71;
    --line: #dde7e8;
    --line-strong: #c6d5d7;

    --staff: #8a5a00;
    --staff-soft: #fff3dc;
    --out: #2a5cb0;
    --out-soft: #e6eefb;
    --danger: #a12a1d;
    --danger-soft: #fdecea;
    --check: #6b3fa0;
    --check-soft: #efe6f8;

    --radius: 16px;
    --shadow: 0 1px 2px rgb(16 40 48 / 0.05), 0 6px 20px rgb(16 40 48 / 0.06);
    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 16px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
button, input, select { font: inherit; color: inherit; }

.logo { display: block; flex: none; width: 104px; height: 104px; border-radius: 50%; background: #fff; }

.eyebrow {
    color: var(--brand-ink);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.lede { color: var(--muted); font-size: 1.05rem; max-width: 60ch; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    background: var(--brand-strong);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--brand-ink); }
.btn-quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-quiet:hover { background: var(--brand-soft); color: var(--brand-ink); }
.btn-sm { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: 0.86rem; }
.btn-danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }

.notice, .alert, .warn, .self-note {
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.94rem;
}
.notice { background: var(--brand-soft); color: var(--brand-ink); }
.alert { background: var(--danger-soft); color: var(--danger); }
.warn, .self-note { background: var(--staff-soft); color: var(--staff); }
.self-note { font-weight: 500; }

.field { display: flex; flex-direction: column; gap: 6px; text-align: left; font-weight: 600; font-size: 0.92rem; }
.field input, .field select {
    height: 50px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
    font-weight: 400;
    font-size: 1rem;
    min-width: 0;
    max-width: 100%;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgb(0 171 177 / 0.2); }

/* ============================================================== kiosk */

body.kiosk {
    min-height: 100vh;
    min-height: 100dvh;
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
.kiosk input, .kiosk select { -webkit-user-select: auto; user-select: auto; }

.kiosk-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

.kiosk-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    isolation: isolate;
    transform: translateZ(0);
}
.kiosk-head::after {
    content: "";
    position: absolute;
    right: -70px;
    top: -120px;
    width: 260px;
    height: 260px;
    border: 36px solid var(--brand-soft);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}
.kiosk-brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.kiosk-brand .logo { width: 64px; height: 64px; }
.kiosk-site { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; }
.kiosk-clock { text-align: right; }
.kiosk-time { font-size: 2.4rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.kiosk-date { color: var(--muted); font-weight: 600; margin-top: 4px; }

.kiosk-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0 8px;
}
.screen {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    text-align: center;
}
.screen-title { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
.status-line { color: var(--muted); font-size: 1.15rem; font-weight: 500; }
.status-line:empty { display: none; }

.pin-dots { display: flex; justify-content: center; gap: 18px; padding: 4px 0; }
.pin-dots span {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--line-strong);
    background: var(--surface);
    transition: background 0.1s, border-color 0.1s;
}
.pin-dots span.on { background: var(--brand-strong); border-color: var(--brand-strong); }
.pin-dots.shake { animation: shake 0.35s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.pin-msg { min-height: 1.5em; color: var(--muted); font-weight: 600; }
.pin-msg.is-error { color: var(--danger); }
.pin-msg:empty::before { content: "\00a0"; }

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.keypad button {
    height: clamp(64px, 9.5vh, 96px);
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
    font-size: 2rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.08s, transform 0.08s;
}
.keypad button:active { background: var(--brand-soft); transform: scale(0.97); }
.keypad .key-quiet { font-size: 1.1rem; color: var(--muted); background: transparent; box-shadow: none; }
.keypad [data-key="back"] { font-size: 1.8rem; }

.actions { display: flex; flex-direction: column; gap: 12px; }
.btn-xl { min-height: 72px; font-size: 1.3rem; border-radius: 18px; }
.btn-in { background: var(--brand-strong); }
.btn-out { background: var(--out); }
.btn-out:hover { background: #1f4a92; }
.btn-xl.btn-quiet { font-size: 1.1rem; min-height: 60px; }
.btn-link {
    align-self: center;
    padding: 12px 20px;
    border: 0;
    background: none;
    color: var(--muted);
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    touch-action: manipulation;
}

.forgot-form { display: flex; flex-direction: column; gap: 16px; text-align: left; }
.forgot-form .field { font-size: 1rem; }
.forgot-form .field input, .forgot-form .field select { height: 60px; font-size: 1.2rem; -webkit-appearance: none; appearance: none; }
.forgot-form .field select {
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
    background-size: 6px 6px;
    background-repeat: no-repeat;
}
.forgot-form .pin-msg { color: var(--danger); text-align: center; }

.done-mark {
    align-self: center;
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: 3rem;
    font-weight: 700;
}
.done-mark.done-out { background: var(--out-soft); color: var(--out); }
.done-mark.done-self { background: var(--staff-soft); color: var(--staff); }

.kiosk-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 20px; padding-top: 6px; color: var(--muted); font-size: 0.84rem; }
.kiosk-foot p { display: flex; align-items: center; gap: 7px; }
.kiosk-foot p a { display: inline-flex; border-radius: 4px; }
.kiosk-foot img { display: block; width: auto; height: 12px; }
.kiosk-foot .kiosk-admin { color: var(--line-strong); font-size: 0.85rem; text-decoration: none; padding: 8px; }

.kiosk-setup {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: calc(100vh - 110px);
    min-height: calc(100dvh - 110px);
    padding: 24px;
    text-align: center;
}
.kiosk-setup h1 { font-size: 1.8rem; }

/* Landscape tablets: keypad beside the header to fit the shorter height. */
@media (orientation: landscape) and (min-width: 900px) {
    .kiosk-shell { display: grid; grid-template-columns: minmax(280px, 0.8fr) 1.2fr; grid-template-rows: 1fr auto; gap: 0 28px; }
    .kiosk-head { flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 28px; grid-row: 1; }
    .kiosk-head::after { right: -110px; top: auto; bottom: -110px; width: 320px; height: 320px; }
    .kiosk-brand { flex-direction: column; align-items: flex-start; }
    .kiosk-brand .logo { width: 88px; height: 88px; }
    .kiosk-site { font-size: 1.9rem; }
    .kiosk-clock { text-align: left; }
    .kiosk-time { font-size: 4rem; }
    .kiosk-date { font-size: 1.15rem; }
    .kiosk-main { grid-row: 1; padding: 0; }
    .kiosk-foot { grid-column: 1 / -1; }
    .keypad button { height: clamp(60px, 12.5vh, 92px); }
}

/* Small phones or split-screen: keep everything reachable. */
@media (max-width: 520px) {
    .kiosk-head { padding: 12px 16px; border-radius: 18px; }
    .kiosk-brand .logo { width: 44px; height: 44px; }
    .kiosk-site { font-size: 1.1rem; }
    .kiosk-time { font-size: 1.8rem; }
    .kiosk-date { font-size: 0.85rem; }
    .keypad { gap: 10px; }
}

/* ============================================================== admin */

.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 24px 64px; }
.wrap.narrow { max-width: 440px; }

.admin-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.admin-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.admin-brand img { border-radius: 50%; }
.admin-brand span { display: flex; flex-direction: column; line-height: 1.2; }
.admin-brand small { color: var(--muted); font-size: 0.8rem; }
.admin-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.admin-nav a, .admin-nav button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.94rem;
    text-decoration: none;
    cursor: pointer;
}
.admin-nav a:hover, .admin-nav button:hover, .admin-nav a[aria-current] { color: var(--brand-ink); background: var(--brand-soft); }
.admin-nav form { margin: 0; }
.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 8px 0 20px; }
.page-head h1 { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem); letter-spacing: -0.02em; line-height: 1.15; }
.page-head p { color: var(--muted); margin-top: 4px; }
.wrap > .notice, .wrap > .alert { margin-bottom: 16px; }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}
.panel h2 { font-size: 1.15rem; margin-bottom: 12px; }
.panel-tight { padding: 0; overflow: hidden; }
.panel-tight h2 { padding: 16px 20px 0; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 20px; }
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.stat { flex: 1 1 160px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.9rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-weight: 600; font-size: 0.9rem; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.data th, .data td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.data th { color: var(--muted); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; background: var(--brand-softer); white-space: nowrap; }
.data tbody tr:hover { background: var(--brand-softer); }
.data td.num, .data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data tfoot td { font-weight: 700; border-bottom: 0; }
.data .empty { color: var(--muted); text-align: center; padding: 28px; }

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
    background: var(--brand-soft);
    color: var(--brand-ink);
}
.tag-self { background: var(--staff-soft); color: var(--staff); }
.tag-mgr { background: var(--out-soft); color: var(--out); }
.tag-missed { background: var(--danger-soft); color: var(--danger); }
.tag-long { background: var(--check-soft); color: var(--check); }
.tag-muted { background: var(--bg); color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.filters .field input, .filters .field select { height: 44px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.quick a {
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--bg);
    color: var(--muted);
    font-weight: 600;
    font-size: 0.86rem;
    text-decoration: none;
    box-shadow: inset 0 0 0 1px var(--line);
}
.quick a:hover, .quick a[aria-current] { background: var(--brand-soft); color: var(--brand-ink); box-shadow: none; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a {
    padding: 9px 14px;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 600;
    text-decoration: none;
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
}
.tabs a[aria-current] { background: var(--brand-strong); color: #fff; box-shadow: none; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.form-grid.pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) {
    .form-grid.pairs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .form-grid.pairs .span2 { grid-column: span 2; }
}
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.pin { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.12em; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions form { margin: 0; }

.login { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; text-align: center; gap: 16px; }
.login .logo { margin: 0 auto; }
.login form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.login .btn { min-height: 50px; }

.site-foot {
    width: min(1052px, calc(100% - 48px));
    margin: 0 auto;
    padding: 20px 0 32px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.84rem;
    text-align: center;
}
.wrap.narrow + .site-foot { width: min(392px, calc(100% - 48px)); }
.site-foot p { display: flex; align-items: center; justify-content: center; gap: 7px; }
.site-foot a { display: inline-flex; border-radius: 4px; }
.site-foot img { display: block; width: auto; height: 12px; transition: opacity 0.15s; }
.site-foot a:hover img { opacity: 0.75; }

@media (max-width: 760px) {
    .admin-bar { flex-direction: column; align-items: flex-start; padding: 10px 16px; position: static; }
    .admin-nav span { display: none; }
    .admin-nav a, .admin-nav button { padding: 10px; }
    .wrap { padding: 16px 16px 48px; }
    .site-foot, .wrap.narrow + .site-foot { width: calc(100% - 32px); }
}

@media print {
    .admin-bar, .filters, .quick, .tabs, .row-actions, .site-foot, .no-print { display: none !important; }
    .panel { box-shadow: none; border: 0; padding: 0; }
    body { background: #fff; }
}
