/* Absensi QR — satu stylesheet tanpa build step (cocok untuk shared hosting). */
:root {
    --brand: #0f766e;
    --brand-ink: #ffffff;
    --bg: #f4f5f7;
    --card: #ffffff;
    --ink: #1f2933;
    --muted: #64748b;
    --line: #e2e8f0;
    --ok: #15803d;
    --ok-bg: #dcfce7;
    --warn: #a16207;
    --warn-bg: #fef9c3;
    --bad: #b91c1c;
    --bad-bg: #fee2e2;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 2px 8px rgba(15, 23, 42, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
}
a { color: var(--brand); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
small, .muted { color: var(--muted); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Layout */
.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 520px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.mt { margin-top: 16px; }
[hidden] { display: none !important; }
.mb { margin-bottom: 16px; }
.center { text-align: center; }
.right { text-align: right; }
.hidden { display: none !important; }

/* Topbar admin */
.topbar { background: #0f172a; color: #e2e8f0; }
.topbar .container { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.topbar a { color: #e2e8f0; text-decoration: none; }
.topbar .brand { font-weight: 700; color: #fff; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { padding: 6px 10px; border-radius: 8px; }
.topbar nav a.active, .topbar nav a:hover { background: rgba(255, 255, 255, .1); }
.topbar .user { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: .9rem; }
.topbar form { margin: 0; }
.topbar button { background: none; border: 1px solid rgba(255,255,255,.25); color: #e2e8f0; border-radius: 8px; padding: 4px 10px; cursor: pointer; }
main.page { padding: 24px 0 48px; }

/* Tabs event */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--ink); border-color: var(--brand); font-weight: 600; }

/* Card */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card.flush { padding: 0; overflow: hidden; }

/* Stat */
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 1.9rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; background: #f8fafc; }
tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline; }

/* Form */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date],
input[type=datetime-local], input[type=number], input[type=search], input[type=file], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}
input[type=color] { width: 56px; height: 40px; border: 1px solid #cbd5e1; border-radius: 10px; padding: 2px; background: #fff; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: 18px; height: 18px; }
.error { color: var(--bad); font-size: .85rem; margin-top: 4px; }

/* Button */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
    background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 600;
    text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn:hover { filter: brightness(.95); }
.btn.secondary { background: #fff; color: var(--ink); border-color: #cbd5e1; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.wa { background: #25d366; color: #073b1d; }
.btn.sm { padding: 5px 10px; font-size: .85rem; border-radius: 8px; }
.btn.lg { padding: 14px 20px; font-size: 1.05rem; border-radius: 12px; }
.btn.block { display: flex; width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--bad); cursor: pointer; font: inherit; padding: 0; }

/* Alert & badge */
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }
.alert.ok { background: var(--ok-bg); color: #14532d; }
.alert.bad { background: var(--bad-bg); color: #7f1d1d; }
.alert.warn { background: var(--warn-bg); color: #713f12; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: #e2e8f0; color: #334155; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }

/* Pagination */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.pagination a, .pagination span { padding: 6px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Halaman peserta (branding event) */
.public { min-height: 100vh; background: #f1f5f9; }
.public-head { background: var(--brand); color: var(--brand-ink); padding: 0 0 56px; }
.public-head .banner { width: 100%; max-height: 220px; object-fit: cover; display: block; }
.public-head .identity { display: flex; gap: 14px; align-items: center; padding: 20px 16px 0; max-width: 520px; margin: 0 auto; }
.public-head .logo { width: 64px; height: 64px; border-radius: 14px; background: #fff; object-fit: contain; padding: 6px; flex: none; }
.public-head .company { opacity: .85; font-size: .9rem; }
.public-head h1 { margin: 0; font-size: 1.35rem; }
.public-head .tagline { opacity: .9; margin: 4px 0 0; font-size: .95rem; }
.public-body { max-width: 520px; margin: -40px auto 0; padding: 0 16px 40px; position: relative; }
.ticket-qr { background: #fff; border-radius: 14px; padding: 12px; width: 100%; max-width: 300px; margin: 0 auto; }
.ticket-qr svg { display: block; width: 100%; height: auto; }
.ticket-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.6rem; font-weight: 700; letter-spacing: .12em; text-align: center; }
.big-check { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px; font-size: 48px; color: #fff; background: var(--ok); }
.big-check.warn { background: #ca8a04; }
.public-foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 16px; }

/* Crew */
.crew-bar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0; }
#reader { width: 100%; max-width: 480px; margin: 0 auto; border-radius: 14px; overflow: hidden; background: #000; min-height: 240px; }
#reader video { border-radius: 14px; }
.scan-result { border-radius: 14px; padding: 18px; text-align: center; color: #fff; margin-top: 12px; }
.scan-result.ok { background: var(--ok); }
.scan-result.already { background: #ca8a04; }
.scan-result.invalid { background: var(--bad); }
.scan-result .name { font-size: 1.4rem; font-weight: 700; }
.kit-list { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.kit-toggle { border: 2px solid rgba(255,255,255,.7); background: transparent; color: inherit; border-radius: 99px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.kit-toggle.on { background: #fff; color: var(--ok); }
.card .kit-toggle { border-color: #cbd5e1; color: var(--ink); }
.card .kit-toggle.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.person { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.person:last-child { border-bottom: 0; }

/* Standee A5 */
.standee-page { background: #e5e7eb; padding: 24px 0; }
.standee {
    width: 148mm; height: 210mm; margin: 0 auto; background: #fff; display: flex; flex-direction: column;
    box-shadow: 0 4px 16px rgba(0,0,0,.15); overflow: hidden;
}
.standee .top { background: var(--brand); color: var(--brand-ink); padding: 10mm 10mm 8mm; text-align: center; }
.standee .top img { max-height: 18mm; max-width: 60mm; background: #fff; border-radius: 3mm; padding: 2mm; }
.standee .top .scan { font-size: 13mm; font-weight: 800; letter-spacing: .02em; margin-top: 4mm; line-height: 1; }
.standee .top .what { font-size: 6mm; font-weight: 600; margin-top: 2mm; }
.standee .qr { flex: 1; display: grid; place-items: center; padding: 6mm; }
.standee .qr svg { width: 95mm; height: 95mm; }
.standee .bottom { padding: 0 10mm 10mm; text-align: center; }
.standee .bottom .event { font-size: 5.5mm; font-weight: 700; }
.standee .bottom .steps { font-size: 3.6mm; color: #475569; margin-top: 2mm; }
.standee .bottom .url { font-size: 3mm; color: #64748b; margin-top: 2mm; word-break: break-all; }
@page { size: A5; margin: 0; }
@media print {
    .no-print { display: none !important; }
    .standee-page { background: none; padding: 0; }
    .standee { box-shadow: none; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 640px) {
    main.page { padding-top: 16px; }
    .card { padding: 16px; }
    .topbar .user span { display: none; }
    .hide-sm { display: none; }
}
