:root {
    font-family:
        Inter,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    color: #1f2937;
    background: #f3f4f6;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f3f4f6;
    color: #1f2937;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;

    min-height: 64px;
    padding: 0 32px;

    background: #ffffff;
    border-bottom: 1px solid #d1d5db;
}

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

.brand-logo {
    display: block;
    width: auto;
    height: 54px;
}

.brand strong {
    font-size: 1.25rem;
    white-space: nowrap;
}

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

.main-navigation {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.main-navigation a {
    display: inline-block;
    padding: 8px 12px;

    color: #374151;
    font-weight: 600;
    text-decoration: none;

    border-radius: 6px;
}

.main-navigation a:hover {
    color: #111827;
    background: #f3f4f6;
}

main {
    width: min(1100px, calc(100% - 32px));
    margin: 40px auto;
}

section {
    max-width: 480px;
    padding: 32px;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgb(0 0 0 / 8%);
}

h1 {
    margin-top: 0;
    margin-bottom: 28px;
    font-size: 1.75rem;
}

form > div {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

input,
select {
    width: 100%;
    padding: 10px 12px;

    font: inherit;

    background: #ffffff;
    border: 1px solid #9ca3af;
    border-radius: 6px;
}

input[type="checkbox"] {
    width: auto;
    padding: 0;
    margin: 0 8px 0 0;
    vertical-align: middle;
}

input:focus,
select:focus {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
    border-color: #2563eb;
}

button {
    padding: 10px 16px;

    font: inherit;
    font-weight: 600;

    cursor: pointer;

    background: #1f2937;
    color: #ffffff;
    border: 0;
    border-radius: 6px;
}

button:hover {
    background: #374151;
}

a {
    color: #1d4ed8;
}

a:hover {
    text-decoration: none;
}

.content-card {
    padding: 32px;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgb(0 0 0 / 8%);
}

.content-card-wide {
    max-width: none;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 28px;
}

.page-header h1 {
    margin-bottom: 6px;
}

.page-description {
    margin: 0;
    color: #6b7280;
}

.button-link {
    display: inline-block;
    padding: 10px 16px;

    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;

    background: #1f2937;
    color: #ffffff;
    border-radius: 6px;
}

.button-link:hover {
    background: #374151;
    color: #ffffff;
}

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

.user-table {
    width: 100%;
    border-collapse: collapse;
}

.user-table th,
.user-table td {
    padding: 12px 14px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #e5e7eb;
}

.user-table th {
    font-size: 0.875rem;
    color: #4b5563;
    background: #f9fafb;
}

.user-table tbody tr:hover {
    background: #f9fafb;
}

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

.table-actions form {
    margin: 0;
}

.table-actions a {
    white-space: nowrap;
}

.button-secondary {
    padding: 6px 10px;

    font-size: 0.875rem;

    background: #ffffff;
    color: #374151;
    border: 1px solid #9ca3af;
}

.button-secondary:hover {
    background: #f3f4f6;
}

.danger-link {
    color: #b91c1c;
}

.page-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.form-card {
    max-width: 560px;
    margin: 0 auto;
}

.error-message {
    margin-bottom: 24px;
    padding: 12px 14px;

    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

.info-message {
    margin-bottom: 24px;
    padding: 12px 14px;

    background: #eff6ff;
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
}

.info-message p {
    margin: 6px 0 0;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 28px;
}

.button-cancel {
    display: inline-block;
    padding: 10px 16px;

    font-weight: 600;
    text-decoration: none;

    color: #374151;
    background: #ffffff;
    border: 1px solid #9ca3af;
    border-radius: 6px;
}

.button-cancel:hover {
    background: #f3f4f6;
    color: #374151;
}

.danger-message {
    margin-bottom: 24px;
    padding: 12px 14px;

    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

.danger-message p {
    margin: 6px 0 0;
}

.user-summary {
    margin: 20px 0 24px;
    padding: 16px;

    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.user-summary dl {
    margin: 16px 0 0;
}

.user-summary dt {
    margin-top: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
}

.user-summary dd {
    margin: 2px 0 0;
}

.button-danger {
    background: #b91c1c;
}

.button-danger:hover {
    background: #991b1b;
}

@media (max-width: 600px) {
    header {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;

        padding: 16px;
    }

    main {
        width: calc(100% - 24px);
        margin: 24px auto;
    }

    section {
        padding: 24px;
    }
}

/* =========================================================
 * Interne Bänklikarte
 * ========================================================= */

body.internal-map-page {
    height: 100vh;
    overflow: hidden;
}

body.internal-map-page header {
    height: 64px;
}

body.internal-map-page main {
    width: 100%;
    height: calc(100vh - 64px);
    margin: 0;
}

.internal-map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    width: 100%;
    height: 100%;
}

.internal-map-area {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: none;
    padding: 0;

    background: #ffffff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.internal-map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    min-height: 54px;
    padding: 8px 16px;

    background: #ffffff;
    border-bottom: 1px solid #d1d5db;
}

.internal-map-toolbar > div {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.internal-map-toolbar strong {
    font-size: 1rem;
}

.internal-map-toolbar span {
    color: #6b7280;
    font-size: 0.875rem;
}

.internal-map-toolbar a {
    white-space: nowrap;
}

.internal-map {
    position: relative;
    flex: 1;
    min-height: 0;

    background: #e5e7eb;
}

.internal-map-placeholder {
    position: absolute;
    inset: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 24px;
    text-align: center;
    color: #6b7280;
}

.internal-map-placeholder strong {
    color: #374151;
    font-size: 1.25rem;
}

.baenkli-detail-panel {
    min-width: 0;
    overflow-y: auto;

    padding: 24px;

    background: #ffffff;
    border-left: 1px solid #d1d5db;
}

.baenkli-detail-empty {
    padding: 20px;

    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.baenkli-detail-empty p {
    margin: 8px 0 0;
    color: #6b7280;
    line-height: 1.5;
}

.baenkli-detail-back {
    display: none;
}

@media (max-width: 800px) {
    body.internal-map-page header {
        height: auto;
        min-height: 0;
    }

    body.internal-map-page main {
        height: calc(100vh - 118px);
    }

    .internal-map-layout {
        display: block;
        position: relative;
    }

    .internal-map-area {
        width: 100%;
        height: 100%;
    }

    .internal-map-toolbar span {
        display: none;
    }

    .baenkli-detail-back {
    display: block;
    width: 100%;
    margin: 0 0 16px;
    padding: 10px 12px;

    background: #f3f4f6;
    color: #111827;

    border: 1px solid #d1d5db;
    border-radius: 6px;

    text-align: left;
    }

    .baenkli-detail-panel {
        display: none;
        position: absolute;
        z-index: 2000;
        inset: 0;

        width: 100%;
        height: 100%;

        border-left: 0;
    }

    .baenkli-detail-panel.is-open {
        display: block;
    }
}
/* =========================================================
 * Bänkli-Marker
 * Entspricht der Darstellung der öffentlichen Bänklikarte.
 * ========================================================= */

.baenkli-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 2px solid white;
    border-radius: 50%;
    background: #2468a2;
    color: white;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

/* =========================================================
 * Bänkli-Detailansicht
 * ========================================================= */

.baenkli-detail-content {
    width: 100%;
}

.baenkli-detail-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #d1d5db;
}

.baenkli-detail-kicker {
    display: block;
    margin-bottom: 4px;

    color: #6b7280;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.baenkli-detail-header h2 {
    margin: 0;
    font-size: 1.6rem;
}

.baenkli-detail-section {
    max-width: none;
    margin: 0 0 24px;
    padding: 0;

    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.baenkli-detail-section h3 {
    margin: 0 0 8px;
    padding-bottom: 6px;

    border-bottom: 2px solid #2468a2;

    font-size: 1rem;
}

.baenkli-detail-row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 12px;

    padding: 7px 0;

    border-bottom: 1px solid #f0f0f0;
}

.baenkli-detail-label {
    color: #6b7280;
    font-size: 0.85rem;
}

.baenkli-detail-value {
    min-width: 0;

    color: #111827;
    font-size: 0.9rem;
    font-weight: 500;

    overflow-wrap: anywhere;
}

@media (max-width: 800px) {
    .baenkli-detail-row {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

/* =========================================================
 * Bänkli-Fotos
 * ========================================================= */

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

.baenkli-photo-item {
    min-width: 0;
}

.baenkli-photo-item > strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.baenkli-photo {
    display: block;
    width: 100%;
    height: auto;

    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.baenkli-photo-missing {
    padding: 16px 8px;

    color: #6b7280;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;

    font-size: 0.8rem;
    text-align: center;
}

@media (max-width: 800px) {
    .baenkli-photo-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
 * Bänkli-Fotos – grosse Darstellung
 * ========================================================= */

.baenkli-photo-grid {
    grid-template-columns: 1fr;
    gap: 20px;
}

.baenkli-photo {
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    background: #f9fafb;
}

/* =========================================================
 * Foto-Grossansicht
 * Entspricht der öffentlichen Bänklikarte.
 * ========================================================= */

.baenkli-photo-button,
.baenkli-photo-button:hover,
.baenkli-photo-button:focus {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;

    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;

    cursor: pointer;
}

.photo-overlay {
    display: none;
    position: fixed;
    z-index: 10000;

    top: 0;
    right: 0;
    bottom: 0;
    left: 0;

    align-items: center;
    justify-content: center;

    padding: 30px;
    box-sizing: border-box;

    background: rgba(0, 0, 0, 0.85);
}

.photo-overlay.visible {
    display: flex;
}

.photo-overlay-image {
    display: block;
    max-width: 95%;
    max-height: 90%;

    object-fit: contain;

    background: white;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.6);
}

.photo-overlay-close,
.photo-overlay-close:hover,
.photo-overlay-close:focus {
    position: absolute;
    top: 15px;
    right: 25px;

    margin: 0;
    padding: 0;
    border: 0;

    background: transparent;
    color: white;
    box-shadow: none;

    font-size: 42px;
    line-height: 1;

    cursor: pointer;
}

/* =========================================================
 * Koordinaten – interne Bänklikarte
 * ========================================================= */

.baenkli-coordinate-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.baenkli-coordinate-block {
    padding: 12px;

    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.baenkli-coordinate-block > strong {
    display: block;
    margin-bottom: 8px;

    color: #111827;
    font-size: 0.9rem;
}

.baenkli-coordinate-values {
    margin-bottom: 10px;

    color: #374151;
    font-size: 0.9rem;
    line-height: 1.5;
}

.coordinate-copy-button {
    width: 100%;
    padding: 7px 10px;

    background: #ffffff;
    color: #1d4ed8;

    border: 1px solid #93c5fd;
    border-radius: 5px;

    font-size: 0.85rem;
    font-weight: 600;
}

.coordinate-copy-button:hover,
.coordinate-copy-button:focus {
    background: #eff6ff;
    color: #1d4ed8;
}

/* =========================================================
 * Interne Bänklilisten
 * ========================================================= */

.internal-list-header {
    margin-bottom: 24px;
}

.internal-list-header h1 {
    margin-bottom: 8px;
}

.internal-list-header p {
    margin: 0 0 16px;
}

.internal-list-header > a {
    display: inline-block;

    color: #374151;
    font-weight: 600;
    text-decoration: none;
}

.internal-list-header > a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.internal-list-actions {
    margin-bottom: 28px;
}

.internal-list-placeholder {
    padding: 20px;

    color: #6b7280;
    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

/* =========================================================
 * Interne Bänkliliste – Tabelle
 * ========================================================= */

.internal-list-table-container {
    width: 100%;
    max-height: 65vh;

    overflow: auto;

    background: #ffffff;
    border: 1px solid #b7b7b7;
    border-radius: 8px;
}

.internal-list-table {
    width: 100%;
    min-width: 2600px;

    border-collapse: collapse;
    table-layout: fixed;

    font-size: 0.9rem;
}

.internal-list-table th,
.internal-list-table td {
    padding: 8px 12px;

    border: 1px solid #b7b7b7;

    text-align: left;
    vertical-align: middle;
    white-space: normal;
    overflow-wrap: anywhere;
}

.internal-list-table th {
    background: #d9eaf7;

    font-weight: 700;
    text-align: center;
}

.internal-list-table tbody tr:nth-child(even) {
    background: #eaf4fb;
}

.internal-list-table tbody tr:hover {
    background: #dbeafe;
}

.internal-list-table td a {
    font-weight: 600;
    white-space: nowrap;
}

.internal-list-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;

    background: #d9eaf7;
}

/* =========================================================
 * Interne Bänkliliste – verstellbare Spalten
 * ========================================================= */

.internal-list-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;

    background: #d9eaf7;
}

.internal-list-table th {
    position: relative;
}

.column-resizer {
    position: absolute;
    top: 0;
    right: -3px;
    bottom: 0;

    width: 7px;

    cursor: col-resize;
    user-select: none;

    z-index: 20;
}

.column-resizer:hover {
    background: rgb(37 99 235 / 25%);
}

body.is-resizing-column {
    cursor: col-resize;
    user-select: none;
}

/* =========================================================
 * Zu vermieten – interne Bänklikarte
 * Entspricht der Hervorhebung der öffentlichen Bänklikarte.
 * ========================================================= */

.baenkli-rental-toggle {
    width: auto;
    margin: 0;
    padding: 7px 12px;

    border: 1px solid #4f7f4f;
    border-radius: 6px;

    background: #f5fff5;
    color: #245524;

    font-size: 0.875rem;
    font-weight: bold;
    white-space: nowrap;

    cursor: pointer;
}

.baenkli-rental-toggle:hover,
.baenkli-rental-toggle:focus {
    background: #e8f7e8;
    color: #245524;
}

.baenkli-rental-toggle.active {
    background: #2f7d32;
    color: #ffffff;
}

.baenkli-rental-highlight {
    width: 50px;
    height: 50px;

    box-sizing: border-box;

    border: 5px solid #20a83a;
    border-radius: 50%;
    outline: 2px solid rgba(255, 255, 255, 0.95);

    box-shadow:
        0 0 0 0 rgba(32, 168, 58, 0.75),
        0 0 8px rgba(0, 0, 0, 0.65);

    animation:
        baenkli-rental-pulse 2.2s ease-out infinite;

    pointer-events: none;
}

@keyframes baenkli-rental-pulse {
    0% {
        transform: scale(0.85);
        box-shadow: 0 0 0 0 rgba(47, 158, 68, 0.55);
    }

    70% {
        transform: scale(1.12);
        box-shadow: 0 0 0 12px rgba(47, 158, 68, 0);
    }

    100% {
        transform: scale(0.85);
        box-shadow: 0 0 0 0 rgba(47, 158, 68, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .baenkli-rental-highlight {
        animation: none;
    }
}

/* =========================================================
 * Leaflet-Layerauswahl – interne Bänklikarte
 * Kompakte Darstellung; wirkt nur innerhalb der Karte.
 * ========================================================= */

.internal-map .leaflet-control-layers {
    margin: 8px 8px 0 0;
    padding: 0;

    background: #ffffff;
    border: 1px solid #b8b8b8;
    border-radius: 3px;
    box-shadow: 0 1px 4px rgb(0 0 0 / 25%);
}

.internal-map .leaflet-control-layers-expanded {
    width: auto;
    min-width: 0;
    padding: 8px 12px;
}

.internal-map .leaflet-control-layers-list {
    margin: 0;
    padding: 0;
}

.internal-map .leaflet-control-layers-base,
.internal-map .leaflet-control-layers-overlays {
    margin: 0;
    padding: 0;
}

.internal-map .leaflet-control-layers label {
    display: block;
    margin: 0;
    padding: 2px 0;

    font-size: 13px;
    font-weight: 400;
    line-height: 18px;
    white-space: nowrap;
}

.internal-map .leaflet-control-layers label > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.internal-map .leaflet-control-layers input[type="radio"],
.internal-map .leaflet-control-layers input[type="checkbox"] {
    width: 13px;
    height: 13px;
    margin: 0;
    padding: 0;

    flex: 0 0 auto;
    vertical-align: middle;
}

/* =========================================================
 * Kopfbereich – Benutzer und Abmelden
 * ========================================================= */

.header-user-area {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: 12px;
}

.header-logout {
    display: inline-block;
    padding: 8px 12px;

    color: #374151;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;

    border-radius: 6px;
}

.header-logout:hover,
.header-logout:focus {
    color: #111827;
    background: #f3f4f6;
}


/* =========================================================
 * Benutzerverwaltung – Aktionsschaltflächen
 * ========================================================= */

.table-actions {
    gap: 6px;
}

.button-action {
    display: inline-block;
    padding: 6px 10px;

    color: #374151;
    background: #ffffff;
    border: 1px solid #9ca3af;
    border-radius: 6px;

    font-size: 0.875rem;
    font-weight: 600;
    line-height: normal;
    text-decoration: none;
    white-space: nowrap;
}

.button-action:hover,
.button-action:focus {
    color: #111827;
    background: #f3f4f6;
    text-decoration: none;
}

.button-action-danger {
    color: #b91c1c;
    border-color: #fca5a5;
}

.button-action-danger:hover,
.button-action-danger:focus {
    color: #991b1b;
    background: #fef2f2;
}

@media (max-width: 600px) {
    .header-user-area {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }
}

/* =========================================================
 * Anmeldung
 * ========================================================= */

.login-help {
    margin-top: 16px;
}

.login-help-link {
    font-size: 0.9rem;
    color: #6b7280;
    text-decoration: none;
}

.login-help-link:hover,
.login-help-link:focus {
    color: #374151;
    text-decoration: underline;
}

/* =========================================================
 * Passwort-Reset
 * ========================================================= */

.password-reset-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-top: 20px;
}

.password-reset-link {
    font-size: 0.9rem;
    color: #6b7280;
    text-decoration: none;
}

.password-reset-link:hover,
.password-reset-link:focus {
    color: #374151;
    text-decoration: underline;
}


/* =========================================================
 * Flash-Meldungen
 * ========================================================= */

.flash-messages { margin-bottom: 24px; }
.flash-message { margin-bottom: 12px; padding: 12px 14px; border: 1px solid; border-radius: 6px; }
.flash-message:last-child { margin-bottom: 0; }
.flash-message-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.flash-message-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.flash-message-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
