:root {
    --mhd-red: #e30613;
    --mhd-red-dark: #b91c1c;
    --ink: #0f172a;
    --ink-soft: #1f2937;
    --muted: #64748b;
    --page: #f3f6fb;
    --card: #ffffff;
    --line: #e5e7eb;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --info: #0284c7;
    --shadow: 0 12px 30px rgba(15, 23, 42, .08);
    --radius: 18px;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(227, 6, 19, .10), transparent 34rem),
        linear-gradient(180deg, #f8fafc 0%, var(--page) 100%);
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: inherit; }

.top {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #111827 100%);
    color: #fff;
    padding: 18px 28px 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
    border-bottom: 4px solid var(--mhd-red);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 1350px;
    margin: 0 auto;
}

.event-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.event-logo,
.malteser-logo {
    height: 84px;
    max-width: 255px;
    object-fit: contain;
    background: rgba(255, 255, 255);
    border-radius: 14px;
    padding: 8px 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .18);
}

.event-logo.placeholder {
    width: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #334155;
    font-weight: 800;
}

.brand {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: .2px;
    line-height: 1.1;
}

.event-name {
    margin-top: 4px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 650;
}

.right-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user {
    color: #e2e8f0;
    font-size: 13px;
    white-space: nowrap;
}

.main-nav {
    max-width: 1350px;
    margin: 16px auto 0;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    text-decoration: none;
    color: #fff;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .10);
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
    white-space: nowrap;
}

.main-nav a:hover {
    background: rgba(227, 6, 19, .95);
    border-color: rgba(255, 255, 255, .25);
    transform: translateY(-1px);
}

.wrap {
    max-width: 1350px;
    margin: 28px auto;
    padding: 0 22px 40px;
}

.page-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 8px 0 18px;
}

h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.05;
    letter-spacing: -.8px;
}

h2 {
    margin: 0 0 14px;
    font-size: 21px;
    letter-spacing: -.2px;
}

h3 { margin: 0 0 10px; }

.card,
details.card {
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(226, 232, 240, .96);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}

details.card > summary {
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 850;
    color: var(--ink);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

details.card > summary::-webkit-details-marker { display: none; }

details.card > summary::before {
    content: "▸";
    color: var(--mhd-red);
    font-size: 20px;
    transition: transform .15s ease;
}

details.card[open] > summary::before {
    transform: rotate(90deg);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
    gap: 18px;
}

.kpi {
    font-size: 38px;
    font-weight: 950;
    line-height: 1;
    letter-spacing: -1px;
}

.muted { color: var(--muted); }

.flash {
    background: #ecfeff;
    border: 1px solid #67e8f9;
    color: #164e63;
    padding: 13px 16px;
    border-radius: 14px;
    margin-bottom: 18px;
    font-weight: 650;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 18px;
}

.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    padding: 10px 15px;
    background: var(--mhd-red);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(227, 6, 19, .20);
    transition: transform .12s ease, filter .12s ease;
}

.btn:hover,
button:hover {
    transform: translateY(-1px);
    filter: brightness(.98);
}

.btn.secondary { background: #334155; box-shadow: none; }
.btn.ok { background: var(--success); box-shadow: none; }
.btn.warn { background: var(--warning); box-shadow: none; }
.btn.bad { background: var(--danger); box-shadow: none; }

label {
    display: block;
    margin: 10px 0 6px;
    font-weight: 850;
    color: #1e293b;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    outline: none;
    transition: box-shadow .12s ease, border-color .12s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--mhd-red);
    box-shadow: 0 0 0 4px rgba(227, 6, 19, .12);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
}

th,
td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

th {
    background: #f8fafc;
    color: #334155;
    font-weight: 900;
}

tr:last-child td { border-bottom: 0; }

tbody tr:hover { background: #fff7f7; }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    background: #e2e8f0;
    color: #334155;
}

.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.bad { background: #fee2e2; color: #991b1b; }

.progress {
    height: 12px;
    background: #e5e7eb;
    overflow: hidden;
    border-radius: 999px;
}

.progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--mhd-red), #fb7185);
    border-radius: inherit;
}

.login {
    max-width: 440px;
    margin: 70px auto;
}

.danger { color: var(--danger); font-weight: 850; }

@media (max-width: 800px) {
    .top { padding: 14px 16px 12px; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .right-brand { width: 100%; justify-content: space-between; }
    .event-logo, .malteser-logo { height: 46px; max-width: 140px; }
    .main-nav { margin-top: 12px; }
    .wrap { margin: 20px auto; padding: 0 14px 28px; }
    .card, details.card { padding: 16px; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
}
