/*
 * ==========================================================
 * Sportfest Manager RGW 3.0
 * ----------------------------------------------------------
 * Datei: assets/css/style-compact.css
 * Version: bereinigt 3.4
 * Aufgabe:
 *  - zentrales responsives Design
 *  - kompakter Kopfbereich
 *  - kompakte Hero-Überschriften
 *  - Tabellen, Formulare, Adminbereich, Lageplan
 * ----------------------------------------------------------
 * Hinweis:
 *  Diese Datei ist bewusst konsolidiert. Alte Hotfix-Blöcke
 *  wurden entfernt; die kompakten Werte sind direkt integriert.
 * ==========================================================
 */

/* ============================================================
   Variablen und Basis
   ============================================================ */

:root {
    --rgw-red: #b71f40;
    --rgw-red-dark: #8f1732;
    --rgw-red-soft: #f7e8ed;
    --rgw-red-muted: #cf5c75;

    --bg: #f4f5f7;
    --bg-soft: #fafafa;
    --surface: #ffffff;
    --surface-muted: #f8f8f9;
    --text: #222222;
    --text-soft: #555555;
    --text-muted: #777777;
    --border: #dedee3;
    --border-strong: #c9c9d1;

    --success: #2f7d4f;
    --success-soft: #e8f5ee;
    --warning: #a86f00;
    --warning-soft: #fff4d8;
    --danger: #b42335;
    --danger-soft: #fde8eb;
    --info: #2d5f8b;
    --info-soft: #e8f1fb;

    --shadow-sm: 0 2px 8px rgba(25, 25, 35, 0.07);
    --shadow-md: 0 12px 28px rgba(25, 25, 35, 0.11);
    --shadow-lg: 0 18px 46px rgba(25, 25, 35, 0.14);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;

    --content-max: 1180px;
    --header-row-height: 42px;
    --nav-height: 40px;

    --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    color-scheme: light;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(183, 31, 64, 0.08), transparent 30rem),
        linear-gradient(180deg, #ffffff 0%, var(--bg) 36rem, var(--bg) 100%);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.52;
}

img,
svg,
video,
canvas {
    max-width: 100%;
    height: auto;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: var(--rgw-red);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--rgw-red-dark);
}

p {
    margin: 0 0 1rem;
}

p:last-child {
    margin-bottom: 0;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 0.65em;
    color: #1f1f25;
    line-height: 1.16;
    font-weight: 800;
}

h1 {
    font-size: clamp(1.85rem, 3.6vw, 3rem);
    letter-spacing: -0.035em;
}

h2 {
    font-size: clamp(1.35rem, 2.2vw, 1.95rem);
    letter-spacing: -0.025em;
}

h3 {
    font-size: clamp(1.08rem, 1.45vw, 1.35rem);
}

hr {
    height: 1px;
    margin: 1.4rem 0;
    border: 0;
    background: var(--border);
}

code,
kbd,
pre {
    font-family: var(--mono);
}

pre {
    overflow-x: auto;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #15151d;
    color: #f7f7fb;
}

/* ============================================================
   Barrierefreiheit und Grundgerüst
   ============================================================ */

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 9999;
    transform: translateY(-150%);
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    background: var(--rgw-red);
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--shadow-md);
}

.skip-link:focus {
    transform: translateY(0);
    outline: 3px solid rgba(183, 31, 64, 0.25);
    outline-offset: 3px;
}

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   Kopfbereich und Navigation
   Aktuelle header.php:
   <header class="site-header">
       <div class="site-header__inner">Logo</div>
       <nav class="site-nav">...</nav>
   </header>
   Der komplette Kopfbereich scrollt normal mit der Seite weg.
   ============================================================ */

.site-header {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(222, 222, 227, 0.95);
    box-shadow: 0 3px 14px rgba(20, 20, 30, 0.045);
}

.site-header__inner {
    width: min(100% - 2rem, var(--content-max));
    min-height: var(--header-row-height);
    margin: 0 auto;
    padding: 0.22rem 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    gap: 0.55rem;
    color: inherit;
    text-decoration: none;
}

.site-brand__logo {
    display: block;
    width: auto;
    height: 30px;
    max-width: 155px;
    max-height: 30px;
    object-fit: contain;
    object-position: left center;
}

.site-brand__text {
    min-width: 0;
}

.site-brand__school {
    display: none;
}

.site-brand__event {
    display: inline-block;
    overflow: hidden;
    max-width: min(48vw, 28rem);
    color: var(--rgw-red);
    font-size: 0.98rem;
    font-weight: 850;
    line-height: 1.05;
    letter-spacing: -0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-nav {
    width: min(100% - 2rem, var(--content-max));
    min-height: var(--nav-height);
    margin: 0 auto;
    border-top: 1px solid rgba(222, 222, 227, 0.72);
}

.site-nav__checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.site-nav__toggle {
    display: none;
}

.site-nav__panel {
    min-height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.site-nav__list {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.16rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav__link,
.site-nav__button {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 0.24rem 0.58rem;
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 760;
    line-height: 1.15;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.site-nav__link:hover,
.site-nav__button:hover {
    background: var(--rgw-red-soft);
    color: var(--rgw-red-dark);
}

.site-nav__link--active {
    background: var(--rgw-red);
    color: #ffffff;
}

.site-nav__link--active:hover {
    background: var(--rgw-red-dark);
    color: #ffffff;
}

.site-nav__label-short {
    display: none;
}

.site-nav__account {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
}

.site-nav__logout {
    margin: 0;
}

.site-nav__user {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    background: #ffffff;
    color: var(--text-soft);
    font-size: 0.84rem;
    font-weight: 700;
}

.site-nav__button {
    background: #1f1f25;
    color: #ffffff;
}

.site-nav__button:hover {
    background: var(--rgw-red-dark);
    color: #ffffff;
}

/* ============================================================
   Hauptbereich und Footer
   ============================================================ */

.site-main {
    width: min(100% - 2rem, var(--content-max));
    margin: 0 auto;
    padding: clamp(0.75rem, 1.6vw, 1.25rem) 0 3rem;
    flex: 1 0 auto;
}

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: #ffffff;
}

.site-footer__inner {
    width: min(100% - 2rem, var(--content-max));
    margin: 0 auto;
    padding: 1.25rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.site-footer__text,
.site-footer__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.site-footer strong {
    color: var(--text);
}

/* ============================================================
   Allgemeine Layout-Helfer
   ============================================================ */

.container-narrow {
    width: min(100%, 760px);
    margin-inline: auto;
}

.container-medium {
    width: min(100%, 960px);
    margin-inline: auto;
}

.section {
    margin: 0 0 clamp(1rem, 2.2vw, 1.6rem);
}

.stack > * + * {
    margin-top: 1rem;
}

.stack-lg > * + * {
    margin-top: 1.35rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 1rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

/* ============================================================
   Kompakte Hero-Bereiche
   ============================================================ */

.hero {
    position: relative;
    overflow: hidden;
    margin-bottom: clamp(0.65rem, 1.4vw, 1rem);
    border-radius: var(--radius-md);
    background:
        linear-gradient(135deg, rgba(183, 31, 64, 0.96), rgba(143, 23, 50, 0.96)),
        var(--rgw-red);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto -5rem -8rem auto;
    width: 16rem;
    height: 16rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    opacity: 0.65;
}

.hero__inner {
    position: relative;
    z-index: 1;
    padding: clamp(0.65rem, 1.3vw, 0.95rem) clamp(0.9rem, 2vw, 1.35rem);
}

.hero h1,
.hero h2,
.hero h3 {
    color: #ffffff;
}

.hero h1 {
    margin-bottom: 0.25rem;
    font-size: clamp(1.25rem, 2.2vw, 1.85rem);
    line-height: 1.12;
    letter-spacing: -0.025em;
}

.hero h2 {
    margin-bottom: 0.25rem;
    font-size: clamp(1.15rem, 1.8vw, 1.55rem);
    line-height: 1.14;
}

.hero h3 {
    margin-bottom: 0.25rem;
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    line-height: 1.16;
}

.hero p {
    max-width: 58rem;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(0.88rem, 1vw, 0.98rem);
    line-height: 1.35;
}

.hero__actions,
.card__actions,
.form-actions,
.action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1rem;
}

.hero__actions {
    gap: 0.45rem;
    margin-top: 0.65rem;
}

/* ============================================================
   Cards, Badges, Kennzahlen
   ============================================================ */

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.card--flat {
    box-shadow: none;
}

.card--highlight {
    border-color: rgba(183, 31, 64, 0.26);
    background: linear-gradient(180deg, #ffffff 0%, #fff9fb 100%);
}

.card__header,
.card__body,
.card__footer {
    padding: clamp(1rem, 2.2vw, 1.45rem);
}

.card__header {
    border-bottom: 1px solid var(--border);
}

.card__footer {
    border-top: 1px solid var(--border);
    background: var(--surface-muted);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.card__title {
    margin-bottom: 0.25rem;
}

.card__subtitle,
.muted,
.help-text {
    color: var(--text-muted);
}

.help-text {
    margin-top: 0.35rem;
    font-size: 0.92rem;
}

.badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 28px;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    background: var(--surface-muted);
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.badge--primary,
.status-badge--primary {
    background: var(--rgw-red-soft);
    color: var(--rgw-red-dark);
}

.badge--success,
.status-badge--open,
.status-badge--success {
    background: var(--success-soft);
    color: var(--success);
}

.badge--warning,
.status-badge--warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.badge--danger,
.status-badge--closed,
.status-badge--danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 1rem;
}

.kpi {
    padding: 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.kpi__label {
    margin-bottom: 0.25rem;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi__value {
    color: var(--rgw-red);
    font-size: clamp(1.55rem, 2.8vw, 2.25rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
}

.kpi__meta {
    margin-top: 0.4rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================================
   Buttons
   ============================================================ */

.button,
.btn,
button.button,
input[type="submit"].button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.6rem 0.95rem;
    background: var(--rgw-red);
    color: #ffffff;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(183, 31, 64, 0.18);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.button:hover,
.btn:hover,
button.button:hover,
input[type="submit"].button:hover {
    transform: translateY(-1px);
    background: var(--rgw-red-dark);
    color: #ffffff;
    box-shadow: 0 12px 22px rgba(143, 23, 50, 0.22);
}

.button:active,
.btn:active {
    transform: translateY(0);
}

.hero .button,
.hero .btn,
.hero button.button,
.hero input[type="submit"].button {
    min-height: 34px;
    padding: 0.42rem 0.75rem;
    font-size: 0.9rem;
    box-shadow: none;
}

.button--secondary,
.btn-secondary {
    background: #1f1f25;
    box-shadow: 0 8px 16px rgba(30, 30, 40, 0.14);
}

.button--secondary:hover,
.btn-secondary:hover {
    background: #000000;
}

.button--outline,
.btn-outline {
    border-color: var(--border-strong);
    background: #ffffff;
    color: var(--text);
    box-shadow: none;
}

.button--outline:hover,
.btn-outline:hover {
    border-color: var(--rgw-red);
    background: var(--rgw-red-soft);
    color: var(--rgw-red-dark);
    box-shadow: none;
}

.button--ghost,
.btn-ghost {
    border-color: transparent;
    background: transparent;
    color: var(--rgw-red);
    box-shadow: none;
}

.button--ghost:hover,
.btn-ghost:hover {
    background: var(--rgw-red-soft);
    color: var(--rgw-red-dark);
    box-shadow: none;
}

.button--danger,
.btn-danger {
    background: var(--danger);
    box-shadow: 0 8px 16px rgba(180, 35, 53, 0.16);
}

.button--danger:hover,
.btn-danger:hover {
    background: #8e1726;
}

.button--small,
.btn-small {
    min-height: 34px;
    padding: 0.45rem 0.75rem;
    font-size: 0.9rem;
}

.button--block,
.btn-block {
    width: 100%;
}

.button[disabled],
.btn[disabled],
button:disabled {
    cursor: not-allowed;
    opacity: 0.58;
    transform: none;
    box-shadow: none;
}

/* ============================================================
   Meldungen
   ============================================================ */

.flash-stack {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.flash,
.notice,
.alert {
    border: 1px solid var(--border);
    border-left: 5px solid var(--rgw-red);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    background: #ffffff;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.flash--success,
.notice--success,
.alert--success {
    border-left-color: var(--success);
    background: var(--success-soft);
}

.flash--warning,
.notice--warning,
.alert--warning {
    border-left-color: var(--warning);
    background: var(--warning-soft);
}

.flash--error,
.flash--danger,
.notice--danger,
.alert--danger {
    border-left-color: var(--danger);
    background: var(--danger-soft);
}

.flash--info,
.notice--info,
.alert--info {
    border-left-color: var(--info);
    background: var(--info-soft);
}

/* ============================================================
   Formulare
   ============================================================ */

.form,
.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-row {
    display: grid;
    gap: 0.45rem;
}

.form-row--inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

label,
.label {
    color: var(--text-soft);
    font-size: 0.92rem;
    font-weight: 800;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.75rem;
    background: #ffffff;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input[type="file"] {
    padding: 0.55rem;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--rgw-red);
    box-shadow: 0 0 0 4px rgba(183, 31, 64, 0.13);
}

input[readonly],
textarea[readonly] {
    background: var(--surface-muted);
    color: var(--text-muted);
}

input[type="checkbox"],
input[type="radio"] {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--rgw-red);
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.checkbox-row label {
    margin: 0;
    color: var(--text);
    font-weight: 650;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.search-bar {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.search-bar input {
    flex: 1;
}

/* ============================================================
   Tabellen
   ============================================================ */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.table,
table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.table th,
.table td,
table th,
table td {
    padding: 0.82rem 0.88rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.table th,
table th {
    background: var(--surface-muted);
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    white-space: nowrap;
}

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

.table tbody tr:hover,
table tbody tr:hover {
    background: #fff9fb;
}

.table .num,
table .num,
.table .number,
table .number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.table .center,
table .center {
    text-align: center;
}

.table-link {
    color: var(--rgw-red);
    font-weight: 850;
    text-decoration: none;
}

.table-link:hover {
    text-decoration: underline;
}

.rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.05rem;
    height: 2.05rem;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text-soft);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.rank--1 {
    background: #ffe9a6;
    color: #7a5600;
}

.rank--2 {
    background: #e7e9ef;
    color: #4b5362;
}

.rank--3 {
    background: #f2d0b5;
    color: #7a3e16;
}

.points {
    color: var(--rgw-red);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.average {
    color: var(--text-soft);
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   Sportfest-spezifische Komponenten
   ============================================================ */

.leaderboard-table td:first-child,
.leaderboard-table th:first-child {
    width: 1%;
    white-space: nowrap;
}

.class-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.class-name {
    color: var(--rgw-red);
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
}

.station-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 0.85rem;
}

.station-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.95rem;
    background: #ffffff;
}

.station-card--done {
    border-color: rgba(47, 125, 79, 0.35);
    background: var(--success-soft);
}

.station-card--open {
    border-style: dashed;
    background: var(--surface-muted);
}

.station-card__name {
    color: var(--text);
    font-weight: 850;
}

.station-card__points {
    margin-top: 0.25rem;
    color: var(--rgw-red);
    font-size: 1.45rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.entry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 1rem;
}

.entry-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.95rem;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.entry-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.entry-card__title {
    margin: 0;
    font-size: 1.02rem;
}

.entry-card input[type="number"] {
    font-size: 1.3rem;
    font-weight: 850;
    text-align: center;
}

.map-frame {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: var(--shadow-md);
}

.map-frame img {
    width: 100%;
    display: block;
}

.map-placeholder {
    display: grid;
    min-height: 280px;
    place-items: center;
    padding: 2rem;
    background: repeating-linear-gradient(-45deg, #ffffff, #ffffff 12px, var(--surface-muted) 12px, var(--surface-muted) 24px);
    color: var(--text-muted);
    text-align: center;
}

.admin-link-panel {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px dashed rgba(183, 31, 64, 0.4);
    border-radius: var(--radius-md);
    background: var(--rgw-red-soft);
}

/* ============================================================
   Adminbereich
   ============================================================ */

.admin-tabs,
.subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.admin-tabs a,
.subnav a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.46rem 0.82rem;
    background: #ffffff;
    color: var(--text-soft);
    font-weight: 780;
    text-decoration: none;
}

.admin-tabs a:hover,
.subnav a:hover,
.admin-tabs a.is-active,
.subnav a.is-active {
    border-color: var(--rgw-red);
    background: var(--rgw-red-soft);
    color: var(--rgw-red-dark);
}

.admin-section {
    margin-bottom: 1.25rem;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.danger-zone {
    border-color: rgba(180, 35, 53, 0.35);
    background: linear-gradient(180deg, #ffffff, #fff8f9);
}

.log-list {
    display: grid;
    gap: 0.65rem;
}

.log-item {
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
}

.log-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.log-item__action {
    color: var(--text);
    font-weight: 850;
}

/* ============================================================
   Setup und Login
   ============================================================ */

.auth-layout,
.setup-layout {
    width: min(100%, 520px);
    margin: 0 auto;
}

.auth-card,
.setup-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: var(--shadow-md);
}

.auth-card__header,
.setup-card__header {
    padding: 1.4rem 1.4rem 0.95rem;
    text-align: center;
}

.auth-card__body,
.setup-card__body {
    padding: 1.4rem;
}

.auth-logo {
    width: min(280px, 78vw);
    margin: 0 auto 1rem;
    display: block;
}

.login-help {
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
}

.password-list {
    max-height: 420px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
}

.password-list table {
    box-shadow: none;
}

.password-value {
    font-family: var(--mono);
    font-weight: 850;
}

/* ============================================================
   Kleine Helfer
   ============================================================ */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.nowrap {
    white-space: nowrap;
}

.hidden,
[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.full-width {
    width: 100%;
}

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-3 { margin-top: 1.5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }

/* ============================================================
   Zwischenbreiten
   ============================================================ */

@media (max-width: 1280px) and (min-width: 901px) {
    .site-nav__label {
        display: none;
    }

    .site-nav__label-short {
        display: inline;
    }

    .site-nav__link,
    .site-nav__button {
        padding-inline: 0.52rem;
        font-size: 0.88rem;
    }

    .site-nav__user {
        max-width: 7rem;
    }
}

/* ============================================================
   Mobile Optimierung
   ============================================================ */

@media (max-width: 900px) {
    :root {
        --header-row-height: 40px;
        --nav-height: 40px;
    }

    .site-header__inner,
    .site-nav,
    .site-main,
    .site-footer__inner {
        width: min(100% - 1rem, var(--content-max));
    }

    .site-header__inner {
        min-height: var(--header-row-height);
        padding: 0.2rem 0;
    }

    .site-brand__logo {
        height: 27px;
        max-width: 138px;
        max-height: 27px;
    }

    .site-brand__event {
        max-width: calc(100vw - 11rem);
        font-size: 0.9rem;
    }

    .site-nav {
        min-height: var(--nav-height);
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .site-nav__toggle {
        min-height: 32px;
        margin: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.45rem;
        border-radius: 999px;
        padding: 0.28rem 0.62rem;
        background: var(--surface-muted);
        color: var(--text);
        font-size: 0.94rem;
        font-weight: 850;
        cursor: pointer;
    }

    .site-nav__toggle-icon {
        position: relative;
        width: 24px;
        height: 16px;
        display: inline-block;
        order: 2;
        border-top: 3px solid var(--rgw-red);
    }

    .site-nav__toggle-icon::before,
    .site-nav__toggle-icon::after {
        content: "";
        position: absolute;
        left: 0;
        width: 100%;
        border-top: 3px solid var(--rgw-red);
    }

    .site-nav__toggle-icon::before {
        top: 5px;
    }

    .site-nav__toggle-icon::after {
        top: 13px;
    }

    .site-nav__panel {
        position: absolute;
        top: calc(100% + 0.25rem);
        left: 50%;
        z-index: 110;
        display: none;
        width: min(calc(100vw - 1rem), var(--content-max));
        min-height: auto;
        margin: 0;
        padding: 0.55rem;
        transform: translateX(-50%);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: rgba(255, 255, 255, 0.98);
        box-shadow: var(--shadow-md);
    }

    .site-nav__checkbox:checked ~ .site-nav__panel {
        display: grid;
        gap: 0.45rem;
    }

    .site-nav__list,
    .site-nav__account {
        display: grid;
        gap: 0.38rem;
        width: 100%;
        margin-left: 0;
    }

    .site-nav__link,
    .site-nav__button {
        width: 100%;
        min-height: 38px;
        justify-content: flex-start;
        border-radius: var(--radius-md);
        padding: 0.5rem 0.68rem;
        font-size: 0.96rem;
    }

    .site-nav__user {
        width: 100%;
        max-width: none;
        border-radius: var(--radius-md);
        justify-content: center;
    }

    .grid-2,
    .grid-3,
    .form-grid--2,
    .form-grid--3 {
        grid-template-columns: 1fr;
    }

    .site-footer__inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 15px;
    }

    .site-brand__logo {
        height: 25px;
        max-width: 128px;
        max-height: 25px;
    }

    .site-brand__event {
        display: none;
    }

    .site-nav__toggle-text {
        display: none;
    }

    .hero {
        margin-bottom: 0.8rem;
        border-radius: var(--radius-sm);
    }

    .hero__inner,
    .card__header,
    .card__body,
    .card__footer,
    .auth-card__body,
    .setup-card__body {
        padding: 0.95rem;
    }

    .hero__inner {
        padding: 0.7rem 0.8rem;
    }

    .hero h1 {
        margin-bottom: 0.2rem;
        font-size: 1.22rem;
    }

    .hero h2 {
        margin-bottom: 0.2rem;
        font-size: 1.12rem;
    }

    .hero p {
        font-size: 0.9rem;
        line-height: 1.3;
    }

    .hero__actions,
    .card__actions,
    .form-actions,
    .action-row,
    .admin-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .hero__actions {
        margin-top: 0.55rem;
        gap: 0.4rem;
    }

    .button,
    .btn,
    button.button,
    input[type="submit"].button {
        width: 100%;
    }

    .hero .button,
    .hero .btn,
    .hero button.button,
    .hero input[type="submit"].button {
        min-height: 32px;
        padding: 0.4rem 0.65rem;
        font-size: 0.88rem;
    }

    .card,
    .table-wrap,
    .map-frame,
    .auth-card,
    .setup-card {
        border-radius: var(--radius-md);
    }

    .search-bar {
        display: grid;
    }

    .table th,
    .table td,
    table th,
    table td {
        padding: 0.68rem 0.62rem;
    }

    .site-nav__label {
        display: none;
    }

    .site-nav__label-short {
        display: inline;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
