/* FSXTurnierIT — Admin-UI
 *
 * Farbpalette und Komponenten-Stil sind 1:1 an FSXVereinskasse
 * angelehnt (Tailwind Slate-Palette), damit beide Anwendungen wie
 * zwei Funktionsbereiche derselben Software wirken.
 */

:root {
    /* Tailwind-Slate-Palette */
    --slate-50:  #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    /* Akzentfarben (analog Vereinskasse) */
    --blue-50:    #eff6ff;
    --blue-300:   #93c5fd;
    --blue-500:   #3b82f6;
    --blue-600:   #2563eb;
    --blue-700:   #1d4ed8;

    --emerald-50:  #ecfdf5;
    --emerald-200: #a7f3d0;
    --emerald-300: #6ee7b7;
    --emerald-600: #059669;
    --emerald-700: #047857;
    --emerald-900: #064e3b;

    --amber-50:  #fffbeb;
    --amber-100: #fef3c7;
    --amber-500: #f59e0b;
    --amber-700: #b45309;

    --rose-50:  #fff1f2;
    --rose-300: #fda4af;
    --rose-600: #e11d48;
    --rose-700: #be123c;
    --rose-900: #881337;

    /* Semantische Aliasse */
    --c-bg: var(--slate-50);
    --c-card: #ffffff;
    --c-border: var(--slate-200);
    --c-border-strong: var(--slate-300);
    --c-text: var(--slate-900);
    --c-muted: var(--slate-500);
    --c-primary: var(--slate-800);
    --c-primary-hover: var(--slate-700);
    --c-link: var(--blue-600);
    --c-link-hover: var(--blue-700);
    --c-danger: var(--rose-600);
    --c-danger-hover: var(--rose-700);
    --c-accent-bg: var(--slate-100);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Roboto, "Helvetica Neue", Arial,
                 "Apple Color Emoji", "Segoe UI Emoji";
    font-size: 0.875rem;        /* Tailwind text-sm — wie Vereinskasse */
    line-height: 1.5;
    overflow-x: hidden;
    max-width: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--c-link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code {
    background: var(--c-accent-bg);
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-size: 0.92em;
}

/* ===========================================================
   TurnierIT-spezifische Stile.

   Layout-Basics (Topbar, App-Shell, Sidebar, Context-Bar, .btn,
   .flash, .card-Basis, Mobile-Burger) leben in fsxbk-layout.css
   (style-share von FSXVereinskasse). Diese Datei wird DANACH
   geladen und liefert nur noch das App-spezifische:

   - Mandanten-Switcher (TurnierIT-Add-on in der Topbar)
   - Legacy-Aliasse für `.btn.primary`, `.btn.small`, `.callout`
     (während der Migration; entfernen sobald alle Templates auf
     `.btn .btn-primary`, `.flash.is-success` umgeschrieben sind)
   - Rollen-Matrix-Editor, Hilfe-Layout
   - .data-Tabellen, .form, .muted, .badge, .page-header,
     .breadcrumbs (Inline-Variante), .cards/.card-stat
   - Lauf-Erfassung, Wertungs-Tabelle, Helfer-PIN-Flash
   =========================================================== */

body.app {
    min-height: 100vh;
}

/* Inline-Form-Helper (Buttons als Form-Submit ohne block-layout) */
.inline-form {
    display: inline;
    margin: 0;
}

/* Mandanten-Wechsler-Stile leben jetzt in fsxbk-layout.css (style-share).
   Hier behalten wir nur den .active-Legacy-Alias, falls Templates die
   alte Klasse statt der neuen `.is-active` verwenden — entfernen, sobald
   alle Templates auf `.is-active` umgestellt sind. */
.mandant-switcher-item.active {
    background: var(--slate-800);
    color: #ffffff;
    font-weight: 500;
}
.mandant-switcher-item.active small {
    color: rgba(255, 255, 255, 0.75);
}

/* Statisches Badge wenn der User nur in einem Mandanten ist */
.mandant-badge {
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--slate-200);
    border-radius: 5px;
    background: var(--slate-100);
    font-size: 0.88rem;
}

/* ===========================================================
   Rollen-/Berechtigungsmatrix — rollen-zentrisch
   (Rollen-Liste links, Detail rechts mit 3 Aktion-Sektionen)
   =========================================================== */

.rollen-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
    align-items: flex-start;
}

@media (max-width: 900px) {
    .rollen-shell {
        grid-template-columns: 1fr;
    }
}

/* Linke Spalte — Rollen-Liste */
.rollen-list {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 0.6rem;
    position: sticky;
    top: calc(var(--topbar-height) + 1rem);
    max-height: calc(100vh - var(--topbar-height) - 2rem);
    overflow-y: auto;
    box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
}

.rollen-list-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--slate-500);
    padding: 0.6rem 0.7rem 0.3rem;
    font-weight: 600;
}

.rollen-list-section-zentrale {
    margin-top: 0.4rem;
    border-top: 1px solid var(--c-border);
    padding-top: 0.8rem;
    color: var(--amber-700);
}

.rollen-list-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.2rem 0.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
    color: var(--slate-700);
    text-decoration: none;
    margin-bottom: 0.15rem;
    border: 1px solid transparent;
    line-height: 1.25;
}

.rollen-list-item:hover {
    background: var(--slate-100);
    color: var(--slate-900);
    text-decoration: none;
}

.rollen-list-item.active {
    background: var(--slate-800);
    color: #ffffff;
}

.rollen-list-item.active:hover {
    background: var(--slate-700);
}

.rollen-list-item.locked {
    opacity: 0.85;
}

.rollen-list-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.rollen-list-label small {
    font-size: 0.7rem;
    margin-left: 0.2rem;
}

.rollen-list-slug {
    grid-column: 1 / -1;
    font-size: 0.7rem;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    color: var(--slate-500);
}

.rollen-list-item.active .rollen-list-slug {
    color: var(--slate-300);
}

.rollen-list-badge {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    background: var(--amber-500);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    line-height: 1.2;
    min-width: 1.5rem;
    text-align: center;
}

.rollen-list-item.active .rollen-list-badge {
    background: var(--amber-100);
    color: var(--amber-700);
}

/* Rechte Spalte — Detail-Panel */
.rollen-detail {
    min-width: 0;
}

.rollen-empty {
    background: var(--c-card);
    border: 1px dashed var(--c-border);
    border-radius: 8px;
    padding: 2.5rem;
    text-align: center;
}

.rollen-detail-header {
    margin-bottom: 1.2rem;
}

.rollen-detail-header h2 {
    margin: 0 0 0.4rem;
    font-size: 1.5rem;
    color: var(--slate-900);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.rollen-detail-header p {
    margin: 0;
}

/* Berechtigungsmatrix — echte HTML-Tabelle */
table.permissions-table {
    margin: 1rem 0;
}

table.permissions-table th.perm-col,
table.permissions-table td.perm-col {
    width: 56px;
    text-align: center;
    padding: 0.6rem 0.4rem;
}

table.permissions-table thead th.perm-col {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--slate-700);
    cursor: help;
}

table.permissions-table td.perm-text {
    padding: 0.7rem 1rem;
}

.permission-label {
    font-weight: 600;
    color: var(--slate-900);
    font-size: 0.95rem;
}

.permission-desc {
    font-size: 0.82rem;
    color: var(--slate-500);
    line-height: 1.35;
    margin-top: 0.15rem;
}

table.permissions-table tr.row-override td {
    background: var(--blue-50);
}

table.permissions-table tr.row-override:hover td {
    background: #dceaff;
}

/* Checkbox-Wrapper für Override-Markierung */
.perm-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
}

.perm-checkbox:hover {
    background: var(--slate-100);
}

.perm-checkbox.is-override {
    background: var(--blue-50);
    border-color: var(--blue-300);
    position: relative;
}

.perm-checkbox.is-override::after {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--blue-600);
}

.perm-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--slate-800);
}

.perm-empty {
    display: inline-block;
    color: var(--slate-300);
    font-size: 1.2rem;
    line-height: 1;
    user-select: none;
    cursor: help;
}

/* ===========================================================
   Online-Hilfe-Layout (Themen-Sidebar + Content)
   =========================================================== */

.hilfe-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
    align-items: flex-start;
}

@media (max-width: 900px) {
    .hilfe-shell {
        grid-template-columns: 1fr;
    }
}

.hilfe-nav {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 0.6rem;
    position: sticky;
    top: calc(var(--topbar-height) + 1rem);
    max-height: calc(100vh - var(--topbar-height) - 2rem);
    overflow-y: auto;
    box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
}

.hilfe-nav-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--slate-500);
    padding: 0.4rem 0.7rem 0.5rem;
    font-weight: 600;
}

.hilfe-nav-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    border-radius: 6px;
    color: var(--slate-700);
    text-decoration: none;
    margin-bottom: 0.15rem;
    line-height: 1.25;
}

.hilfe-nav-item:hover {
    background: var(--slate-100);
    color: var(--slate-900);
    text-decoration: none;
}

.hilfe-nav-item.active {
    background: var(--slate-800);
    color: #ffffff;
}

.hilfe-nav-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

.hilfe-nav-label {
    font-size: 0.88rem;
    font-weight: 500;
}

.hilfe-content {
    min-width: 0;
}

.hilfe-content h2 {
    margin-top: 0;
}

.hilfe-content .card h3 {
    margin: 1.2rem 0 0.5rem;
    font-size: 1rem;
    color: var(--slate-900);
}

.hilfe-content table.data {
    margin: 0.5rem 0 1rem;
}

/* Footer-Aktionen */
.rollen-detail-actions {
    display: flex;
    gap: 0.5rem;
    margin: 1.2rem 0 2rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    padding: 1rem;
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
    position: sticky;
    bottom: 1rem;
}

/* Alte Matrix-Klassen entfernen wir nicht — sie werden nicht mehr genutzt,
   aber Audit-Log und andere Templates referenzieren keine davon. */

.matrix-wrap {
    overflow-x: auto;
    background: var(--c-card);
    border: 2px solid #4b5563;
    border-radius: 6px;
    margin: 1rem 0;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

table.matrix {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.9rem;
}

table.matrix th,
table.matrix td {
    border-bottom: 1px solid #b5bcc7;
    border-right: 1px solid #d8dde3;
    padding: 0;
    text-align: center;
    vertical-align: middle;
    background: var(--c-card);
}

/* Erste Spalte (Ressource) — sticky links */
table.matrix .matrix-th-ressource,
table.matrix .matrix-td-ressource {
    text-align: left;
    padding: 0.55rem 0.8rem;
    background: #e7eaf0;
    font-weight: 600;
    white-space: normal;
    position: sticky;
    left: 0;
    z-index: 5;
    min-width: 240px;
    max-width: 320px;
    border-right: 3px solid #4b5563;
}

.ressource-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1f2933;
    line-height: 1.25;
}

.ressource-slug {
    margin-top: 0.15rem;
    line-height: 1;
}

.ressource-slug code {
    font-size: 0.72rem;
    color: var(--c-muted);
    background: transparent;
    padding: 0;
}

.ressource-beschreibung {
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: #50596b;
    font-weight: 400;
    line-height: 1.35;
}

/* Kopf-Reihe (Rollen) — sticky oben */
table.matrix thead tr:first-child th {
    position: sticky;
    top: 0;
    z-index: 6;
    background: #d8dde3;
    padding: 0.6rem 0.5rem;
    border-bottom: 2px solid #4b5563;
    font-size: 0.85rem;
}

table.matrix thead tr:first-child .matrix-th-ressource {
    z-index: 10;
    background: #cfd6df;
}

table.matrix .matrix-th-rolle {
    min-width: 110px;
    line-height: 1.2;
}

.rolle-label {
    display: block;
    font-weight: 700;
    color: #1f2933;
    word-break: keep-all;
}

.rolle-slug {
    display: block;
    font-size: 0.7rem;
    color: var(--c-muted);
    margin-top: 0.15rem;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

table.matrix .matrix-th-rolle small.muted {
    display: block;
    font-size: 0.68rem;
    margin-top: 0.2rem;
}

table.matrix .rolle-zentrale {
    background: #fde8b8 !important;
}

table.matrix .rolle-locked {
    background: #d4c7cd !important;
}

/* Zweite Header-Reihe: R/W/X-Beschriftung */
.matrix-th-aktionen th {
    position: sticky;
    top: 76px; /* unter erste Zeile (ca. Höhe Rolle-Header) */
    background: #f1eff3;
    border-bottom: 2px solid #4b5563;
    padding: 0.35rem 0.4rem !important;
    z-index: 5;
}

.matrix-th-aktionen th:first-child {
    z-index: 8;
}

.aktion-h {
    display: inline-block;
    width: 32px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #1f2933;
    letter-spacing: 0.05em;
}

/* Daten-Zellen */
table.matrix .matrix-cell {
    padding: 0.35rem 0.3rem;
    line-height: 1;
    min-width: 110px;
}

table.matrix tbody tr:nth-child(even) td {
    background: #fafbfc;
}

table.matrix tbody tr:nth-child(even) .matrix-td-ressource {
    background: #dde2e9;
}

table.matrix tbody tr:hover td {
    background: #eaf2fc;
}

table.matrix tbody tr:hover .matrix-td-ressource {
    background: #c8d3e3;
}

table.matrix .cell-locked {
    background: #e8e2e6 !important;
}

/* R/W/X-Checkboxen pro Zelle */
.cell-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    position: relative;
    cursor: pointer;
    border-radius: 4px;
}

.cell-action:hover {
    background: rgba(31, 95, 168, 0.12);
}

.cell-action.is-on {
    background: rgba(31, 95, 168, 0.18);
}

.cell-action.has-override {
    box-shadow: inset 0 0 0 2px #2c6cb0;
}

.cell-action input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #1f5fa8;
    /* Stärkerer Standard-Rahmen für nicht-WebKit */
    border: 2px solid #4b5563;
    border-radius: 3px;
}

.cell-action input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.cell-action-empty {
    color: #b5bcc7;
    user-select: none;
    cursor: default;
    font-size: 1rem;
    font-weight: 600;
}

/* Override-Dot oben rechts an der Zelle */
.override-dot {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #2c6cb0;
    box-shadow: 0 0 0 1.5px #ffffff;
    pointer-events: none;
}

.override-dot-inline {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #2c6cb0;
    box-shadow: 0 0 0 1.5px #ffffff;
    vertical-align: middle;
    margin: 0 0.2rem;
}

/* Bulk-Save-Buttons unter der Matrix */
.matrix-actions {
    display: flex;
    gap: 0.5rem;
    margin: 1.2rem 0 2rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* App-Shell-Sidebar Add-on: zusätzlich Nav-Group-Subheading (TurnierIT). */
.nav-group-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--slate-500);
    padding: 0 12px;
    margin-bottom: 6px;
    font-weight: 600;
}

.nav-group-zentrale {
    border-top: 1px solid var(--slate-200);
    padding-top: 1rem;
    margin-top: 0.6rem;
}
.nav-group-zentrale .nav-group-title {
    color: var(--amber-700);
}

/* Sub-Nav-Link (eingerückte zweite Ebene unter einem Eintrag) */
.nav-link-sub {
    font-size: 0.8rem;
    color: var(--slate-500);
    padding-left: 1.4rem;
}

/* Page-Header: H1 + Subtitle */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.875rem;       /* Tailwind text-3xl */
    font-weight: 700;
    margin: 0 0 0.4rem;
    color: var(--slate-900);
}

.page-header p {
    margin: 0;
    color: var(--slate-600);
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.88rem;
    color: var(--c-muted);
    margin-bottom: 0.6rem;
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: var(--c-muted);
}

.breadcrumbs a:hover {
    color: var(--c-primary);
}

.breadcrumbs span {
    color: var(--c-muted);
}

footer {
    text-align: center;
    color: var(--c-muted);
    padding: 1.5rem 0 2rem;
}

footer a {
    color: var(--c-muted);
}

h1 {
    font-size: 1.6rem;
    margin: 0.2rem 0 0.8rem;
}

h2 {
    font-size: 1.2rem;
    margin: 2rem 0 0.6rem;
}

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

.empty {
    background: var(--c-card);
    border: 1px dashed var(--c-border);
    padding: 1.5rem;
    border-radius: 6px;
    text-align: center;
}

.row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

/* ===========================================================
   Karten + Sections
   =========================================================== */

/* Dashboard-Karten-Grid (Index, Mandanten-Übersicht etc.) */
.cards {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    margin-top: 1.5rem;
}

.cards.cards-stats {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

/* Card-Variante 1: Stat-Kachel (Zahlen-Kacheln auf Dashboards) */
.card-stat {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 1.25rem 1rem;
    text-align: center;
    color: var(--c-text);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    text-decoration: none;
    box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
}

a.card-stat:hover {
    border-color: var(--slate-400);
    text-decoration: none;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08);
}

.card-num {
    font-size: 1.875rem;        /* Tailwind text-3xl */
    font-weight: 700;
    color: var(--slate-900);
}

.card-label {
    color: var(--c-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Card-Variante 2: Section-Box (rounded-lg shadow wie Vereinskasse) */
.card {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
}

.card h2 {
    margin-top: 0;
}

/* Card-Variante 3: Klickbare Aktions-CTA (Index) */
.action-card {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 1.25rem;
    text-decoration: none;
    color: var(--c-text);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: border-color 120ms, box-shadow 120ms;
    box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
}

.action-card:hover {
    border-color: var(--slate-400);
    text-decoration: none;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08);
}

.action-card .ac-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--slate-900);
}

.action-card .ac-desc {
    color: var(--c-muted);
    font-size: 0.85rem;
}

/* Badges — Vereinskasse-Look (pill, dezent) */
.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    font-size: 0.75rem;
    border-radius: 4px;
    background: var(--slate-100);
    color: var(--slate-700);
    font-weight: 500;
    line-height: 1.4;
}

.badge-ok {
    background: var(--emerald-50);
    color: var(--emerald-700);
}

.badge-off {
    background: var(--slate-100);
    color: var(--slate-500);
}

.badge-warn {
    background: var(--amber-100);
    color: var(--amber-700);
}

/* Tabellen-Helper */
.col-actions {
    width: 1%;
    white-space: nowrap;
}

tr.row-inactive td {
    opacity: 0.55;
}

/* Tabellen — Vereinskasse-Look (Header bg-slate-100, divide-y) */
table.data {
    width: 100%;
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    margin-top: 1rem;
    box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
}

table.data th,
table.data td {
    text-align: left;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--c-border);
    vertical-align: top;
    font-size: 0.875rem;
}

table.data thead th {
    background: var(--slate-100);
    font-weight: 600;
    color: var(--slate-700);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

table.data tbody tr:last-child td {
    border-bottom: none;
}

table.data tbody tr:hover td {
    background: var(--slate-50);
}

table.parcours tbody tr {
    background: var(--c-card);
}

/* Buttons — Vereinskasse-Look (rounded, slate-Farben) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--slate-100);
    border: 1px solid var(--slate-300);
    border-radius: 6px;
    padding: 0.5rem 0.9rem;
    color: var(--slate-900);
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.2;
    font-weight: 500;
    text-decoration: none;
    min-height: 36px;
    transition: background 120ms, border-color 120ms;
}

.btn:hover {
    background: var(--slate-200);
    border-color: var(--slate-400);
    text-decoration: none;
}

.btn.primary {
    background: var(--slate-800);
    border-color: var(--slate-800);
    color: #ffffff;
}

.btn.primary:hover {
    background: var(--slate-700);
    border-color: var(--slate-700);
}

.btn.danger {
    background: #ffffff;
    color: var(--rose-700);
    border-color: var(--rose-300);
}

.btn.danger:hover {
    background: var(--rose-600);
    border-color: var(--rose-600);
    color: #ffffff;
}

.btn.success {
    background: var(--emerald-600);
    border-color: var(--emerald-600);
    color: #ffffff;
}

.btn.success:hover {
    background: var(--emerald-700);
    border-color: var(--emerald-700);
}

.btn.small,
.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
    min-height: 28px;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Forms */
.form {
    background: transparent;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 640px;
}

.form label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--slate-700);
}

.form label.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
}

/* Globale Input/Select-Styles leben jetzt in fsxbk-layout.css
   (style-share), Scope `.app-main` statt `.container` — passt zur
   neuen Layout-Struktur. Padding/Font auf Vereinskasse-Niveau
   (`px-3 py-2 text-base`). Hier nichts mehr nötig. */

/* Innerhalb von .form sollen Inputs flexibel sein */
.form input:not([type="checkbox"]):not([type="radio"]),
.form select,
.form textarea {
    flex: 1 1 auto;
}

.form input[type="checkbox"],
.form input[type="radio"] {
    flex: 0 0 auto;
    width: auto;
}

.form .row {
    margin-top: 0.4rem;
    justify-content: flex-end;
}

.form-inline {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.6rem;
}

.form-inline input:not([type="checkbox"]):not([type="radio"]),
.form-inline select {
    flex: 1 1 240px;
}

/* Subnav (Buttons unter einer Heading) */
.subnav {
    display: flex;
    gap: 0.6rem;
    margin: 0.4rem 0 1.4rem;
    flex-wrap: wrap;
}

/* Callouts — DEPRECATED, durch `.flash.is-{success,warning,danger}` ersetzen.
   Beide Klassen-Sets leben hier nebeneinander, damit Templates während der
   Migration nicht alle auf einmal umgeschrieben werden müssen. */
.callout {
    background: var(--amber-50);
    border: 1px solid var(--amber-100);
    border-left: 4px solid var(--amber-500);
    padding: 0.7rem 1rem;
    border-radius: 6px;
    margin: 0.5rem 0 1rem;
    font-size: 0.875rem;
    color: var(--amber-700);
}

.callout-success {
    background: var(--emerald-50);
    border-color: var(--emerald-200);
    border-left: 4px solid var(--emerald-600);
    color: var(--emerald-900);
}

.callout-danger {
    background: var(--rose-50);
    border-color: var(--rose-300);
    border-left: 4px solid var(--rose-600);
    color: var(--rose-900);
}

/* Flash-Variante "info" (slate-getönt) — style-share liefert nur
   success/warning/danger; für neutrale Info-Banner brauchen wir
   einen vierten Modifier. */
.flash.is-info {
    background: var(--slate-100);
    border-color: var(--slate-300);
    color: var(--slate-700);
}

/* Helfer-PIN Flash-Block */
.pin-flash {
    padding: 1rem 1.2rem;
}

.pin-flash-inner {
    display: flex;
    gap: 1.5rem;
    align-items: baseline;
    flex-wrap: wrap;
}

.pin-flash-label {
    font-size: 1.05rem;
}

.pin-flash-code {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 2.2rem;
    letter-spacing: 0.25em;
    font-weight: 700;
    background: #ffffff;
    border: 1px solid #9bcf8f;
    border-radius: 6px;
    padding: 0.2rem 0.8rem;
    user-select: all;
}

.pin-flash-hint {
    margin-top: 0.7rem;
    font-size: 0.85rem;
}

/* Highlighted Row (Selektierter Fahrer in der Suche) */
table.data tbody tr.selected {
    background: var(--c-accent-bg);
}

/* Lauf-Erfassung */
.lauf-form {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.6rem;
}

.lauf-meta {
    display: flex;
    gap: 1.2rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}

.lauf-meta label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.92rem;
    color: var(--c-text);
}

.lauf-meta input,
.lauf-meta select {
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    background: #ffffff;
    font-size: 1rem;
    min-width: 0;
    max-width: 100%;
}

table.fehler-tabelle {
    margin-top: 0.6rem;
}

input.fehler-input {
    width: 4.5em;
    padding: 0.55rem 0.45rem;
    font-size: 1.15rem;
    text-align: center;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    min-width: 0;
    max-width: 100%;
}

/* Wertungs-Tabelle */
table.wertung td.num,
table.wertung th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

table.wertung tr.row-pokal {
    background: #f3f7d6;
}

table.wertung tr.row-pokal td:first-child::before {
    content: "";
}

/* ===========================================================
   Mobile / Tablet — TurnierIT-spezifische Anpassungen.
   Sidebar-Burger + .app-shell + Backdrop kommen aus fsxbk-layout.css.
   Hier nur App-spezifisches (Tabellen-Padding etc.).
   =========================================================== */

@media (max-width: 720px) {
    table.data {
        font-size: 0.88rem;
    }
    table.data th,
    table.data td {
        padding: 0.45rem 0.5rem;
    }
    .pin-flash-code {
        font-size: 1.8rem;
    }
    h1 {
        font-size: 1.35rem;
    }
}
