/* Petrol brand: red #E30613, black #1A1A1A, white #FFFFFF */
:root {
    --red: #E30613;
    --red-dark: #B8050F;
    --black: #1A1A1A;
    --ink: #1A1A1A;
    --muted: #6b6b6b;
    --line: #e4e4e4;
    --soft: #f6f6f6;
    --white: #FFFFFF;
    --ok: #1e7b3a;
    --warn: #9a6700;
    --radius: 10px;
}

* { box-sizing: border-box; }

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

body {
    background: var(--soft);
    color: var(--ink);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

main.container {
    flex: 1;
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: 1.6rem; }
a { color: var(--red); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--soft); padding: 2px 6px; border-radius: 4px; }
small { font-size: 0.85em; }

/* ---------- Top bar ---------- */
.topbar {
    background: var(--black);
    color: var(--white);
    border-bottom: 4px solid var(--red);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.logo { font-weight: 800; letter-spacing: 3px; font-size: 1.25rem; }
.logo::after { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--red); border-radius: 50%; margin-left: 8px; vertical-align: middle; }
.brand-sub { opacity: 0.75; font-size: 0.9rem; }
.nav a { color: var(--white); text-decoration: none; margin-left: 16px; font-size: 0.95rem; }
.nav a:hover { text-decoration: underline; }

.footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 16px; }

/* ---------- Hero ---------- */
.hero { margin-bottom: 20px; }
.hero-banner {
    width: 100%;
    aspect-ratio: 16 / 5;
    background: linear-gradient(135deg, var(--black) 60%, var(--red));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-bottom: 16px;
}
.hero h1 { font-size: 2rem; color: var(--black); }
.lead { font-size: 1.05rem; color: var(--muted); max-width: 60ch; }
.event-meta { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 16px 0 0; }
.event-meta div { min-width: 140px; }
.event-meta dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.event-meta dd { margin: 0; font-weight: 600; }

/* ---------- Cards and alerts ---------- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
    margin-bottom: 20px;
}
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.muted { color: var(--muted); font-size: 0.9rem; }
.empty { text-align: center; color: var(--muted); padding: 24px; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border-left: 4px solid; background: var(--soft); }
.alert-ok { border-color: var(--ok); background: #eef8f1; }
.alert-warn { border-color: var(--warn); background: #fff8e6; }
.alert-error { border-color: var(--red); background: #fdeeee; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field-label, legend.field-label { font-weight: 600; font-size: 0.95rem; }
.req { color: var(--red); }
.field input, .field select, .filters input, .filters select {
    width: 100%;
    font: inherit;
    padding: 11px 12px;
    border: 1px solid #cfcfcf;
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
}
.field input:focus, .field select:focus, .filters input:focus, .filters select:focus {
    outline: 3px solid rgba(227,6,19,0.25);
    border-color: var(--red);
}
.field input:disabled { background: #f0f0f0; }
.field-error { color: var(--red); font-size: 0.88rem; }
.fineprint { font-size: 0.82rem; color: var(--muted); margin: 0; text-align: center; }

.section { display: grid; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; }
.section[hidden] { display: none; }

.mode-picker { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
.mode-picker legend { font-weight: 700; margin-bottom: 8px; padding: 0; }

.choice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #cfcfcf;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}
.choice:has(input:checked) { border-color: var(--red); background: #fff5f5; }
.choice input { accent-color: var(--red); width: 18px; height: 18px; margin: 0; }
.choice-inline { display: inline-flex; padding: 10px 14px; }
.radio-row { display: flex; gap: 12px; flex-wrap: wrap; }
fieldset.field { padding: 0; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font: inherit;
    font-weight: 600;
    padding: 11px 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
}
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { background: var(--white); color: var(--ink); border-color: #cfcfcf; }
.btn-ghost:hover { border-color: var(--ink); }
.btn-small { padding: 6px 10px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Admin ---------- */
.page-title { margin-bottom: 16px; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--white); border-radius: var(--radius); padding: 14px 16px; border-left: 4px solid var(--red); }
.stat-n { display: block; font-size: 1.6rem; font-weight: 800; }
.stat-l { color: var(--muted); font-size: 0.85rem; }

.filters { display: grid; gap: 10px; grid-template-columns: 1fr; margin-bottom: 14px; }
.filters .btn { justify-content: center; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 8px; }
.table { width: 100%; min-width: 1000px; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: var(--black); color: var(--white); font-weight: 600; white-space: nowrap; position: sticky; top: 0; }
.table tbody tr:hover { background: #fafafa; }
.table td:last-child, .table code { white-space: nowrap; }
.row-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; }
.row-actions form { margin: 0; }
.row-actions .btn { white-space: nowrap; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); font-size: 0.8rem; }
.pill-yes { background: #eef8f1; border-color: #bfe3c9; color: var(--ok); }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

/* Admin uses the full browser width */
body.admin main.container { max-width: none; padding-left: 16px; padding-right: 16px; }

/* ---------- Wider screens ---------- */
@media (min-width: 640px) {
    main.container { padding: 32px 24px 48px; }
    .hero h1 { font-size: 2.4rem; }
    .stats { grid-template-columns: repeat(3, 1fr); }
    .filters { grid-template-columns: 2fr 1fr 1fr auto auto auto; align-items: center; }
    .section { grid-template-columns: 1fr 1fr; }
    .section .field:has(input[type="radio"]), .section fieldset.field { grid-column: 1 / -1; }
    .card { padding: 28px; }
}
@media (max-width: 639px) {
    .section { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
    .btn { transition: background 0.15s ease, border-color 0.15s ease; }
}
