/* =========================================
   BHV – Base Theme / Variables
========================================= */

:root {
    --bg: #ffffff;
    --bg-alt: #f3f4f6;
    --accent: #4499b5;
    --accent-soft: rgba(68, 153, 181, 0.08);

    --text: #111827;
    --text-muted: #6b7280;

    --border: #e5e7eb;

    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

/* =========================================
   Global Reset / Basics
========================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-alt);
    color: var(--text);
    line-height: 1.6;
}

/* =========================================
   Layout Container
========================================= */

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* =========================================
   Header / Navigation
========================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0;
    gap: 1.5rem;
}

/* Home-Link als Menüpunkt */
.home .home-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 0 0.75rem;
}

.home .home-link i {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.2s ease, transform 0.2s ease;
}

.home .home-link:hover i {
    color: var(--accent);
}

.home .home-link:active i {
    transform: scale(0.95);
}

/* Navigation */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    position: relative;
    padding-bottom: 0.25rem;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 0;
    background: var(--accent);
    transition: width 0.2s ease;
}

.main-nav a:hover {
    color: var(--text);
}

.main-nav a:hover::after {
    width: 100%;
}

/* Mail Icon vor mailto: Links */
.main-nav li a[href^="mailto:"]::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f0e0"; /* envelope */
    margin-right: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Mobile Menü Button */
.menu-toggle {
    display: none;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 1.1rem;
}

/* =========================================
   Hero
========================================= */

.hero {
    padding: 2.5rem 0 2rem;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
}

.hero-inner {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

.hero-subtitle {
    max-width: 38rem;
    color: var(--text-muted);
    margin: 0 0 1rem;
}

.hero-image {
    display: flex;
    justify-content: flex-end;
    margin-left: auto;
}

/* =========================================
   Generische Sektionen
   ========================================= */
/* =========================================
   Grid / Kartenlayout
   ========================================= */
.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.card {
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

/* Allgemeine Card-Überschrift */
.card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

/* Karten-Icon vor der Überschrift (z. B. Link-Karten) */
.card h3 i {
    font-size: 1rem;
    color: var(--accent);
}

/* Optional: Farbänderung bei Hover über die gesamte Karte */
.card-link:hover .card h3 i {
    color: #2d7284;
}

/* Info-Karten mit Icon vor der Überschrift */
.info-card h3 {
    position: relative;
    padding-left: 1.5rem; /* Platz für das Info-Icon */
}

.info-card h3::before {
    content: "\f05a"; /* Font Awesome: fa-circle-info */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* =========================================
   Link-Listen in Cards
   ========================================= */
.link-list {
    list-style: none;
    padding-left: 0;
}

.link-list li {
    position: relative;
    padding-left: 1.8rem;
    margin-bottom: 0.4rem;
}

/* Standardpunkt (neutral) */
.link-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.4rem;
    width: 0.4rem;
    height: 0.4rem;
    background-color: var(--text-muted);
    border-radius: 50%;
}

/* Linkstil in Listen: BHV-Farbe für Links, grauer Text für Info */
.link-list li a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.link-list li a:hover {
    text-decoration: underline;
}

/* Info-Eintrag mit Info-Icon */
.link-list li.info::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f05a"; /* fa-circle-info */
    background: none;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.link-list li.info {
    color: var(--text-muted);
}

/* Externer Link mit Launch-Icon */
.link-list li.external::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f35d"; /* fa-up-right-from-square */
    background: none;
    font-size: 0.9rem;
    color: var(--accent);
}

/* Download-Link mit Download-Icon */
.link-list li.download::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f019"; /* fa-download */
    background: none;
    font-size: 0.9rem;
    color: var(--accent);
}



/* Klickbare Karten als Link um die komplette Card */
.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-link .card {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-link:hover .card {
    transform: translateY(-4px);
    box-shadow: 0 10px 22px rgba(68, 153, 181, 0.3);
}


/* =========================================
   Dropdown
========================================= */

.dropdown-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.dropdown {
    appearance: none;
    padding: 0.6rem 1.3rem;
    border-radius: 999px;
    border: 1px solid var(--accent);
    background: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent);
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(68, 153, 181, 0.20);
    transition: 0.2s ease-in-out;
    max-width: 100%;
}

.dropdown:hover {
    border-color: #2d7284;
    color: #2d7284;
    box-shadow: 0 10px 25px rgba(68, 153, 181, 0.30);
}

/* =========================================
   Meta Box (leicht dunkelgrau)
========================================= */

.meta-box {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 0.9rem;
    background: #f1f3f5;
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

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

.meta-field label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    color: var(--text);
}

.meta-input {
    width: 100%;
    border-radius: 0.6rem;
    border: 1px solid var(--border);
    padding: 0.5rem 0.65rem;
    background: #ffffff;
    font-size: 0.9rem;
}

.meta-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(68, 153, 181, 0.15);
}

/* Meta Error State */
.meta-field.has-error .meta-input {
    border-color: #dc2626;
    box-shadow: 0 0 0 1px #fecaca;
}

/* =========================================
   Rechtsgrundlage + RO Card
========================================= */

.paragraph-row {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: stretch;
}

/* Rechtsgrundlage Box */
.paragraph-box {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    min-width: 240px;
}

.paragraph-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.paragraph-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
}

/* RO Link Card */
.ro-card {
    text-decoration: none;
    color: inherit;
    display: block;
    min-width: 240px;
    flex: 0 1 auto;
}

.ro-card-inner {
    height: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ro-card-inner i {
    color: var(--accent);
    font-size: 1.1rem;
}

.ro-card-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.ro-card-title {
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.ro-card-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ro-card-external {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.ro-card:hover .ro-card-inner {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(68, 153, 181, 0.22);
}

.ro-card:hover .ro-card-external {
    color: var(--accent);
}

/* =========================================
   Bescheid Status
========================================= */

.paragraph-box.status-default {
    border-color: #4499b5;
    background: rgba(68,153,181,0.08);
}

.paragraph-box.status-error {
    border-color: #dc2626;
    background: #fee2e2;
}

.paragraph-box.status-success {
    border-color: #16a34a;
    background: #dcfce7;
}

/* =========================================
   Buttons
   ========================================= */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.3rem;
    border-radius: 999px;
    border: none;
    background: var(--accent);
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(68, 153, 181, 0.4);
    font-size: 0.95rem;
}

.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

/* Kopier-Button in Textareas */
/* =========================================
   Sections
========================================= */

.section {
    padding: 3rem 0;
    background: var(--bg-alt);
}

/* =========================================
   Form / Textareas / Copy Button
========================================= */

.penalty-form h2 {
    margin: 0 0 1.5rem;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
}

.textarea-wrapper {
    position: relative;
}

.textarea-large {
    width: 100%;
    min-height: 10rem;
    padding: 0.75rem 0.9rem;
    padding-right: 2.5rem; /* Platz für Copy Button */
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    background: #ffffff;
    color: var(--text);
}

.textarea-large::placeholder {
    color: var(--text-muted);
}

/* Copy Button (neutral, transparent) */
.copy-btn {
    position: absolute;
    top: 0.4rem;
    right: 0.6rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    transition: transform 0.15s ease, color 0.15s ease;
}

.copy-btn:hover {
    color: var(--accent);
    transform: scale(1.06);
}

/* =========================================
   Errors (Textareas + Meta)
========================================= */

.form-row.has-error .textarea-large {
    border-color: #dc2626;
    box-shadow: 0 0 0 1px #fecaca;
}

.field-error {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: #b91c1c;
    display: none; /* nur anzeigen bei Fehler */
}

.form-row.has-error .field-error {
    display: block;
}

/* Meta-Errors: anzeigen, wenn Text vorhanden */
.meta-field .field-error:empty {
    display: none;
}

.meta-field .field-error:not(:empty) {
    display: block;
}

/* =========================================
   Footer
========================================= */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 0;
    background: #ffffff;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9rem;
}

.scroll-top-btn {
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    padding: 0.3rem 0.9rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.scroll-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* =========================================
   Responsive
========================================= */

@media (max-width: 900px) {
    .hero-inner {
        flex-direction: column;
    }

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

@media (max-width: 700px) {
    .menu-toggle {
        display: inline-block;
    }

    /* Navigation dropdown (wenn du das in main.js togglest) */
    .main-nav {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: #ffffff;
        border-bottom: 1px solid var(--border);
        transform: translateY(-120%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .main-nav.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .main-nav ul {
        flex-direction: column;
        padding: 0.75rem 1.5rem 1rem;
        gap: 0.5rem;
    }

    .meta-grid {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================================
   Upload Tool GUI
========================================= */

.upload-tool-section .container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.tool-header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tool-title {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.tool-subtitle {
    margin: 0;
    color: var(--text-muted);
}

/* =========================================
   Upload Grid
========================================= */

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

.upload-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    padding: 1.25rem;
}

.upload-card-header h2 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
}

.upload-card-header p {
    margin: 0 0 1rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* =========================================
   Upload Dropzone
========================================= */

/* =========================================
   Upload Dropzone – Basis
========================================= */

.upload-dropzone {
    position: relative;
    min-height: 220px;
    border: 2px dashed var(--accent);
    border-radius: 1rem;
    background: var(--accent-soft);
    overflow: hidden;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

/* Standard / neutral */
.upload-dropzone:not(.is-loading):not(.is-success):not(.is-error) {
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* Loading */
.upload-dropzone.is-loading {
    border-color: var(--accent);
    background: rgba(68, 153, 181, 0.08);
    box-shadow: 0 0 0 1px rgba(68, 153, 181, 0.15);
}

/* Success */
.upload-dropzone.is-success {
    border-color: #16a34a;
    background: #dcfce7;
    box-shadow: 0 0 0 1px #bbf7d0;
}

/* Error */
.upload-dropzone.is-error {
    border-color: #dc2626;
    background: #fee2e2;
    box-shadow: 0 0 0 1px #fecaca;
}

/* =========================================
   Upload Input / Label
========================================= */

.upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.upload-label {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    padding: 1.5rem;
}

.upload-icon {
    font-size: 2rem;
    color: var(--accent);
}

.upload-label-title {
    font-weight: 600;
    color: var(--text);
}

.upload-label-text {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Statusabhängige Icon-Farben */
.upload-dropzone.is-success .upload-icon {
    color: #16a34a;
}

.upload-dropzone.is-error .upload-icon {
    color: #dc2626;
}

/* =========================================
   Upload Overlays
========================================= */

.upload-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
}

.upload-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
    padding: 1rem;
}

.upload-overlay-content i {
    font-size: 2rem;
}

/* Loading Overlay */
.upload-overlay-loading .upload-overlay-message {
    color: var(--text);
}

/* Success Overlay */
.upload-overlay-success {
    background: rgba(240, 253, 244, 0.94);
}

.upload-overlay-success i {
    color: #16a34a;
}

/* Error Overlay */
.upload-overlay-error {
    background: rgba(254, 242, 242, 0.96);
}

.upload-overlay-error i {
    color: #dc2626;
}

/* Klickbare Meldung */
.upload-overlay-action {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    color: var(--text);
}

.upload-overlay-success .upload-overlay-action {
    color: #166534;
}

.upload-overlay-error .upload-overlay-action {
    color: #991b1b;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Utility */
/* =========================================
   Spinner
========================================= */

.upload-spinner {
    width: 2.25rem;
    height: 2.25rem;
    border: 3px solid rgba(68, 153, 181, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================
   Result Area
========================================= */

.result-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.result-section-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.result-box {
    min-height: 420px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    padding: 1.25rem;
}

.result-placeholder {
    min-height: 390px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-align: center;
    color: var(--text-muted);
}

.result-placeholder i {
    font-size: 2rem;
    color: var(--accent);
}

/* =========================================
   Tertiary Button
========================================= */

.btn-tertiary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-tertiary:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(68, 153, 181, 0.06);
}

.btn-tertiary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: var(--text-muted);
    border-color: var(--border);
    background: transparent;
    box-shadow: none;
}

/* Hover deaktivieren */
.btn-tertiary:disabled:hover {
    color: var(--text-muted);
    border-color: var(--border);
    background: transparent;
    transform: none;
}
/* =========================================
   Ergebnis Overlay / Spinner
========================================= */

.result-box {
    position: relative;
}

/* Overlay */
.result-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Inhalt */
.result-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
}

/* Spinner */
.result-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid rgba(68, 153, 181, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

/* Utility */
.is-hidden {
    display: none;
}

/* =========================================
   Ergebnis Empty State (BHV Design)
========================================= */

.result-table-container {
    min-height: 420px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    padding: 1.25rem;
    position: relative;
}

/* Zentrierter Placeholder */
.result-empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-empty-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    color: var(--text-muted);
}

/* Icon */
.result-empty-content i {
    font-size: 2.2rem;
    color: var(--accent);
    opacity: 0.8;
}

/* Text */
.result-empty-content p {
    margin: 0;
    font-size: 0.95rem;
}

.result-empty-content i {
    transition: transform 0.2s ease;
}

.result-empty-content:hover i {
    transform: scale(1.1);
}

/* =========================================
   Ergebnis Tabelle (BHV Style)
========================================= */

.result-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.result-table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    white-space: nowrap;
    word-break: break-all;
    border: 1px solid var(--border);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

/* Header */
.result-table thead {
    background: var(--accent);
    color: white;
}

.result-table th {
    text-align: left;
    padding: 0.65rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Body */
.result-table td {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

/* Zebra */
.result-table tbody tr:nth-child(even) {
    background: var(--bg-alt);
}

/* Hover */
.result-table tbody tr:hover {
    background: rgba(68, 153, 181, 0.08);
}

/* Statusfarben (optional für später) */
.row-success {
    background: #dcfce7 !important;
}

.row-error {
    background: #fee2e2 !important;
}

/* Empty State */
.result-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* =========================================
   Ergebnis Fade-In
========================================= */

.result-fade-in {
    animation: resultFadeIn 0.25s ease-out;
}

@keyframes resultFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   Header
========================================= */

/* Header als Flex-Container */
/* Buttons nach rechts schieben */
.result-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}
/* =========================================
   SR-Ermahnungen – eigenständiges Tool
   Aufbau auf dem gemeinsamen BHV-Theme
========================================= */
.sr-section { padding-top: 2.3rem; }
.sr-layout { display: flex; flex-direction: column; gap: 1.5rem; }
.sr-form-card, .sr-list-card { padding: 1.5rem; }
.sr-hero-icon { margin-left: auto; color: var(--accent); font-size: 3rem; line-height: 1.2; }
.sr-card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.sr-card-heading h2 { margin: 0; font-size: 1.25rem; }
.sr-card-heading p { color: var(--text-muted); font-size: .92rem; margin: .2rem 0 0; }
.sr-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; margin-top: 1.2rem; }
.sr-field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.sr-field label, .sr-search label { font-weight: 600; font-size: .92rem; }
.sr-field label span { color: #a12626; }
.sr-field .meta-input { min-height: 43px; }
.sr-field select.meta-input { cursor: pointer; }
.sr-readonly-date { background: var(--bg-alt); color: var(--text-muted); cursor: default; }
.sr-date-hint { color: var(--text-muted); font-size: .79rem; line-height: 1.4; }
.sr-form-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.4rem; align-items: center; }
.sr-form-actions .btn-primary { gap: .45rem; }
.sr-feedback { min-height: 1.3rem; color: #166534; font-size: .9rem; margin: .75rem 0 0; }
.sr-feedback:empty { margin-top: 0; min-height: 0; }
.sr-feedback-error { color: #b91c1c; }
.sr-list-tools { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin: 1.2rem 0; }
.sr-search { display: flex; flex-direction: column; gap: .35rem; flex: 1 1 230px; max-width: 410px; }
.sr-search-input-wrap { position: relative; }
.sr-search-input-wrap .fa-magnifying-glass { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.sr-search-input-wrap .meta-input { padding-left: 2.3rem; min-height: 42px; }
.sr-export-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.sr-export-tools .btn-tertiary { gap: .45rem; font-size: .88rem; min-height: 41px; }
.sr-import-label { cursor: pointer; }
.sr-import-label:hover { color: var(--accent); border-color: var(--accent); background: rgba(68, 153, 181, .06); }
.sr-visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.sr-import-label:has(+ .sr-visually-hidden:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: .75rem; }
.sr-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .93rem; }
.sr-table th { background: #f7f9fa; color: var(--text-muted); font-size: .81rem; letter-spacing: .025em; white-space: nowrap; }
.sr-table th, .sr-table td { padding: .85rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.sr-table tbody tr:last-child td { border-bottom: 0; }
.sr-table tbody tr:hover { background: rgba(68, 153, 181, .045); }
.sr-number { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.sr-empty { text-align: center; color: var(--text-muted); padding: 2.5rem 1rem !important; }
.sr-actions-cell { text-align: right; white-space: nowrap; }
.sr-icon-button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: #fff; color: var(--text-muted); border-radius: .55rem; width: 34px; height: 34px; cursor: pointer; margin-left: .35rem; }
.sr-icon-button:hover { color: var(--accent); border-color: var(--accent); }
.sr-icon-button.sr-danger:hover { color: #b91c1c; border-color: #b91c1c; }
.sr-storage-note { font-size: .85rem; color: var(--text-muted); margin: 1rem 0 0; line-height: 1.5; }
.sr-storage-note i { margin-right: .3rem; color: var(--accent); }
@media (max-width: 700px) {
    .sr-form-grid { grid-template-columns: 1fr; }
    .sr-hero-icon { display: none; }
    .sr-form-card, .sr-list-card { padding: 1rem; }
    .sr-search { max-width: none; }
    .sr-export-tools { width: 100%; }
}

/* -----------------------------------------
   Gemeinsame Utilities & kleine Displays
----------------------------------------- */
[hidden] { display: none !important; }
:is(.hero, .section) { scroll-margin-top: 3.5rem; }
.sr-show-more { display: block; margin: 1rem auto 0; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
    .grid, .upload-grid { grid-template-columns: 1fr; }
    .result-section-header { flex-wrap: wrap; }
    .result-actions { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* SR-Ermahnungen: kombinierte Vergehen und eigene Datumsfelder */
.sr-offence-group { grid-column: 1 / -1; border: 1px solid var(--border); border-radius: .85rem; padding: 1rem; margin: 0; min-width: 0; }
.sr-offence-group legend { padding: 0 .35rem; font-weight: 700; font-size: .94rem; }
.sr-offence-group legend span { color: #a12626; }
.sr-offence-group > p { margin: 0 0 .9rem; font-size: .85rem; color: var(--text-muted); }
.sr-offence-choice { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(160px, 220px); gap: 1.25rem; align-items: center; padding: .75rem; background: var(--bg-alt); border-radius: .65rem; margin-bottom: .65rem; }
.sr-check-label { display: flex; align-items: center; gap: .7rem; cursor: pointer; font-weight: 600; }
.sr-check-label input { accent-color: var(--accent); width: 1.1rem; height: 1.1rem; flex: 0 0 auto; }
.sr-date-choice { display: flex; align-items: center; gap: .5rem; }
.sr-date-choice label { font-size: .85rem; font-weight: 600; }
.sr-date-choice input { min-width: 0; width: 100%; }
.sr-date-choice input:disabled { background: #e5e7eb; color: var(--text-muted); }
/* Die Detailzellen bilden nun echte Tabellenzeilen; so liegen die Trennlinien
   in Vergehen, Spielnummer und Datum auch bei Zeilenumbrüchen exakt übereinander. */
.sr-table td.sr-shared-cell,
.sr-table td.sr-detail-cell { vertical-align: top; }
.sr-table td.sr-detail-cell { padding-top: .75rem; padding-bottom: .75rem; line-height: 1.5; }
.sr-table td.sr-game-number,
.sr-table td.sr-date-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sr-table tr.sr-group-subrow td.sr-detail-cell { border-top: 1px solid var(--border); }
#sr-nummer[aria-invalid="true"] { border-color: #b91c1c; box-shadow: 0 0 0 1px #b91c1c; }
@media (max-width: 650px) {
    .sr-offence-choice { grid-template-columns: 1fr; gap: .5rem; }
    .sr-date-choice { justify-content: space-between; }
    .sr-date-choice input { max-width: 220px; }
}

/* SR-Ermahnungen: Spielnummer je einzeln ausgewähltem Vergehen */
.sr-offence-choice {
    grid-template-columns: minmax(185px, 1fr) minmax(150px, 210px) minmax(160px, 210px);
    gap: .75rem;
}
.sr-game-choice {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
}
.sr-game-choice label { font-size: .85rem; font-weight: 600; }
.sr-game-choice input { min-width: 0; width: 100%; }
.sr-game-choice input:disabled { background: #e5e7eb; color: var(--text-muted); }
@media (max-width: 800px) {
    .sr-offence-choice { grid-template-columns: 1fr; gap: .55rem; }
    .sr-game-choice, .sr-date-choice { justify-content: space-between; }
    .sr-game-choice input, .sr-date-choice input { max-width: 240px; }
}
