:root {
    --orange: #ff5c00;
    --orange-dark: #e04e00;
    --ink: #1a1a1a;
    --muted: #5e584f;
    --line: #efe6df;
    --bg: #f6f3ef;
    --card: #ffffff;
    --sidebar: #141414;
    --ok-bg: #e8f6ee;
    --ok: #0d6b3d;
    --bad-bg: #fdeceb;
    --bad: #9f2218;
    --shadow: 0 16px 40px rgba(26, 26, 26, 0.08);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
}

img { max-width: 100%; height: auto; }

a { color: inherit; }

button, input, textarea { font: inherit; }

h1, h2, p { margin-top: 0; }

h1 { font-size: 1.7rem; letter-spacing: -0.03em; }

h2 { font-size: 1.15rem; }

.logo { display: block; width: min(220px, 70vw); height: auto; border-radius: 16px; }

.btn, .store, .nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: 12px;
    border: 0;
    text-decoration: none;
    cursor: pointer;
    padding: 0.75rem 1.1rem;
}

.btn-orange { background: var(--orange); color: white; font-weight: 700; }
.btn-orange:hover { background: var(--orange-dark); }
.btn-dark { background: var(--ink); color: white; font-weight: 700; }
.btn-ghost { background: white; color: var(--ink); border: 1px solid var(--line); }

.alert { border-radius: 12px; padding: 0.8rem 1rem; }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-bad { background: var(--bad-bg); color: var(--bad); }
.alert p { margin: 0.2rem 0; }
.help, .muted, .lede, .eyebrow { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; font-weight: 700; margin-bottom: 0.2rem; }
.field-error { color: var(--bad); margin: -0.4rem 0 0.6rem; font-size: 0.92rem; }

.guest-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.guest-card, .card, .hero {
    background: var(--card);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.guest-card { width: min(440px, 100%); padding: 1.6rem; }
.stack { display: grid; gap: 0.9rem; }

label { display: grid; gap: 0.35rem; font-weight: 650; }
input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="file"], textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    background: #fff;
    color: var(--ink);
}
.check { grid-template-columns: auto 1fr; align-items: start; font-weight: 500; gap: 0.7rem; }
.check input { margin-top: 0.25rem; }

.admin-frame { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { background: var(--sidebar); color: white; padding: 1.2rem; display: flex; flex-direction: column; gap: 1.2rem; }
.sidebar .brand img { width: 150px; }
.nav { display: grid; gap: 0.35rem; }
.nav a, .nav-button {
    color: white;
    text-decoration: none;
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
    background: transparent;
    text-align: left;
    justify-content: flex-start;
}
.nav a.active, .nav a:hover { background: var(--orange); }
.sidebar form { margin-top: auto; }
.nav-button { width: 100%; }
.admin-main { padding: 1.4rem; }
.admin-top { margin-bottom: 1rem; }
.admin-content { display: grid; gap: 1rem; }
.card { padding: 1.2rem; }
.stat-grid, .split { display: grid; gap: 1rem; }
.stat-grid { grid-template-columns: repeat(4, 1fr); }
.stat { background: white; border-radius: 18px; padding: 1rem; box-shadow: var(--shadow); }
.stat p { margin-bottom: 0.3rem; color: var(--muted); }
.stat strong { font-size: 1.6rem; }
.split { grid-template-columns: 1fr 1fr; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.65rem 0.2rem; border-bottom: 1px solid var(--line); }
.logo-row, .copy-row, .button-row { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.qr-preview { width: 280px; height: auto; background: white; padding: 12px; border-radius: 16px; }
.copy-row input { flex: 1; }
.link-list { padding-left: 1.1rem; }
.link-list code { word-break: break-all; }

.public-body { background: linear-gradient(180deg, #fff 0%, var(--bg) 40%); }
.stage { min-height: calc(100vh - 88px); display: grid; place-items: center; padding: 1.5rem 1rem 2rem; }
.hero { width: min(460px, 100%); padding: 1.5rem 1.2rem 1.3rem; text-align: center; }
.hero .logo { margin: 0 auto 1rem; }
.qr-card { background: white; border-radius: 20px; padding: 16px; margin: 1rem 0; }
.qr-card img { width: min(280px, 72vw); background: white; }
.qr-caption, .qr-pending { color: var(--muted); margin: 0.6rem 0 0; }
.stores { display: grid; gap: 0.75rem; }
.store { background: var(--ink); color: white; text-align: left; gap: 0.75rem; padding: 0.7rem 0.9rem; }
.store svg { width: 28px; height: 28px; flex: none; }
.store span { display: grid; line-height: 1.1; }
.store small { font-size: 0.72rem; font-weight: 500; opacity: 0.8; }
.store strong { font-size: 1.05rem; }
.site-footer { text-align: center; color: var(--muted); padding: 0 1rem 1.5rem; font-size: 0.92rem; }

.modal { display: none; position: fixed; inset: 0; background: rgba(20, 20, 20, 0.55); place-items: center; padding: 1rem; z-index: 20; }
.modal.is-open { display: grid; }
.modal-card { width: min(380px, 100%); background: white; border-radius: 24px; padding: 1.4rem; text-align: center; box-shadow: var(--shadow); }
.clock { width: 64px; height: 64px; margin: 0 auto 0.6rem; color: var(--orange); background: #fff1e8; border-radius: 50%; display: grid; place-items: center; }
.clock svg { width: 34px; height: 34px; }
.modal-card .btn { width: 100%; }

.print-body { background: white; }
.print-sheet { width: min(520px, 100%); margin: 2rem auto; text-align: center; }
.print-sheet .logo, .print-sheet .qr-preview { margin-left: auto; margin-right: auto; }
.no-print { text-align: center; }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

@media (max-width: 900px) {
    .admin-frame { grid-template-columns: 1fr; }
    .sidebar { position: sticky; top: 0; z-index: 5; }
    .nav { grid-auto-flow: column; overflow-x: auto; }
    .nav-button { width: auto; }
    .stat-grid, .split { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .stat-grid { grid-template-columns: 1fr; }
    h1 { font-size: 1.45rem; }
}

@media print {
    .no-print, .site-footer, .stores, .sidebar, .admin-top { display: none !important; }
    body, .print-body { background: white; }
    .print-sheet { box-shadow: none; }
}
