/*

--------------------------------------------------

Fernschütze Core

--------------------------------------------------

*/

.fs-core-ergebnisverwaltung {

    max-width: 1400px;

    margin: 40px auto;

    font-size: 14px;

}

.fs-status-section {

    margin-bottom: 50px;

}

.fs-status-title {

    display: flex;

    align-items: center;

    gap: 15px;

    font-size: 42px;

    margin-bottom: 20px;

}

.fs-status-count {

    display: flex;

    justify-content: center;

    align-items: center;

    width: 52px;

    height: 52px;

    border-radius: 50%;

    background: #eef2f7;

    font-size: 24px;

}

.fs-status-content {

    min-height: 120px;

    border-radius: 18px;

    background: #fff;

    border: 1px solid #e6e6e6;

    box-shadow: 0 6px 18px rgba(0,0,0,.06);

}

.fs-row {

    display: grid;

    grid-template-columns:
        2fr
        2fr
        2fr
        1fr;

    gap: 20px;

    padding: 18px;

    border-bottom: 1px solid #ececec;

}

.fs-row:last-child {

    border-bottom: none;

}

.fs-table {

    width: 100%;

    border-collapse: collapse;

}

.fs-table th {

    background: #f6f7fa;

    text-align: left;

    padding: 18px;

}

.fs-table td {

    padding: 18px;

    border-top: 1px solid #ececec;

}

.fs-table th,
.fs-table td {

    white-space: normal;

    word-break: break-word;

    overflow-wrap: anywhere;

    vertical-align: middle;

}

.fs-table td small {

    color: #777;

    font-size: 0.85em;

}


/* ==========================================
   Bearbeiten-Modal
========================================== */

.fs-modal {

    position: fixed;

    inset: 0;

    background: rgba(0,0,0,.45);

    display: none;

    justify-content: center;

    align-items: center;

    z-index: 99999;

}

.fs-modal-content {

    background: #fff;

    width: 600px;

    max-width: 95%;

    /*
     * Verhindert, dass das Modal höher
     * als das Browserfenster wird.
     */
    max-height: 90vh;

    border-radius: 12px;

    /*
     * Header, Inhalt und Footer
     * untereinander anordnen.
     */
    display: flex;

    flex-direction: column;

    overflow: hidden;

    box-shadow: 0 10px 35px rgba(0,0,0,.25);

}

.fs-modal-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 18px 24px;

    border-bottom: 1px solid #eee;

    /*
     * Header bleibt immer sichtbar.
     */
    flex-shrink: 0;

}

.fs-modal-body {

    padding: 24px;

    /*
     * Nur der Inhalt des Modals scrollt.
     */
    overflow-y: auto;

    flex: 1;

    min-height: 0;

}

.fs-modal-footer {

    padding: 18px 24px;

    border-top: 1px solid #eee;

    text-align: right;

    /*
     * Speichern-Button bleibt immer sichtbar.
     */
    flex-shrink: 0;

    background: #fff;

}

.fs-modal-body input {

    width: 100%;

    margin-top: 5px;

}

.fs-modal-close {

    border: none;

    background: none;

    cursor: pointer;

    font-size: 22px;

}


/* ==========================================
   Tabelle
========================================== */

.fs-table-wrapper {

    overflow: hidden;

    border: 1px solid #e5e5e5;

    border-radius: 12px;

}

.fs-table {

    width: 100%;

    border-collapse: collapse;

    border: 0;

}

.fs-table th,
.fs-table td {

    border: 0;

    border-right: 1px solid #e8e8e8;

    border-bottom: 1px solid #e8e8e8;

}

.fs-table th:last-child,
.fs-table td:last-child {

    border-right: 0;

}

.fs-table tbody tr:last-child td {

    border-bottom: 0;

}


/* ==========================================================
   SPALTENBREITEN
   ========================================================== */

.fs-table th:nth-child(1),
.fs-table td:nth-child(1) {

    width: 150px;

}

.fs-table th:nth-child(2),
.fs-table td:nth-child(2) {

    width: 170px;

}

.fs-table th:nth-child(3),
.fs-table td:nth-child(3) {

    width: 110px;

}

.fs-table th:nth-child(4),
.fs-table td:nth-child(4) {

    width: 105px;

}

.fs-table th:nth-child(5),
.fs-table td:nth-child(5) {

    width: 90px;

    text-align: center;

}

.fs-table th:nth-child(6),
.fs-table td:nth-child(6) {

    width: 100px;

    text-align: center;

}

.fs-table th:nth-child(7),
.fs-table td:nth-child(7) {

    width: 115px;

}

.fs-table th:nth-child(8),
.fs-table td:nth-child(8) {

    width: 115px;

}

.fs-table th:nth-child(9),
.fs-table td:nth-child(9) {

    width: 120px;

    text-align: center;

}

.fs-table td {

    vertical-align: middle;

}

.fs-table th {

    background: #f7f8fa;

    font-weight: 700;

    color: #374151;

}

.fs-table tbody tr {

    transition: background .15s;

}

.fs-table tbody tr:hover {

    background: #fafbfd;

}


/* ==========================================
   Speichern-Meldung
========================================== */

.fs-save-message {

    display: none;

    margin: 20px 24px 0;

    padding: 12px 16px;

    border-radius: 8px;

    background: #dff6dd;

    color: #1d5e20;

    border: 1px solid #9ed59a;

    font-weight: 600;

}


/* ==========================================
   Aktionen
========================================== */

.fs-actions {

    display: flex;

    justify-content: center;

    align-items: center;

    white-space: nowrap;

    gap: 8px;

}

.fs-actions button {

    cursor: pointer;

    border: none;

    background: none;

    font-size: 18px;

    padding: 4px;

    vertical-align: middle;

}

.fs-actions button:hover {

    transform: scale(1.15);

}


/* ==========================================
   Änderungshistorie
========================================== */

#fs-modal-history {

    max-height: 220px;

    overflow-y: auto;

    margin-top: 10px;

    padding: 10px;

    border: 1px solid #ddd;

    border-radius: 8px;

    background: #fafafa;

}

.fs-history-entry {

    padding: 8px 0;

}

.fs-history-entry:last-child {

    padding-bottom: 0;

}

#fs-modal-history hr {

    margin: 8px 0;

    border: 0;

    border-top: 1px solid #e5e5e5;

}


/* ==========================================
   Status-Überschriften kompakter
========================================== */

.fs-status-header h2 {

    display: flex;

    align-items: center;

    gap: 10px;

    margin: 0 0 16px 0;

    font-size: 22px;

    line-height: 1.2;

}

.fs-status-count {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 30px;

    height: 30px;

    padding: 0 8px;

    font-size: 14px;

    font-weight: 600;

    border-radius: 15px;

}


/* ==========================================
   Statusbereiche ein-/ausklappen
========================================== */

.fs-status-header {

    cursor: pointer;

    user-select: none;

}

.fs-status-header h2 {

    width: 100%;

}

.fs-status-toggle {

    margin-left: auto;

    font-size: 18px;

    font-weight: normal;

    transition: transform 0.2s ease;

}

.fs-status-section.is-collapsed .fs-status-toggle {

    transform: rotate(180deg);

}

.fs-status-section.is-collapsed .fs-status-content {

    display: none;

}


/* ==========================================
   Nachweis-Button
========================================== */

.fs-proof-button {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    font-size: 18px;

    line-height: 1;

    text-decoration: none;

    cursor: pointer;

}

.fs-proof-button:hover {

    transform: scale(1.15);

}


/* ==========================================
   Nachweis-Viewer
========================================== */

.fs-proof-modal {

    position: fixed;

    inset: 0;

    display: none;

    align-items: center;

    justify-content: center;

    padding: 30px;

    background: rgba(0, 0, 0, 0.75);

    z-index: 100000;

}

.fs-proof-modal-content {

    position: relative;

    display: flex;

    flex-direction: column;

    width: 90vw;

    height: 90vh;

    background: #fff;

    border-radius: 12px;

    overflow: hidden;

}

.fs-proof-image-wrapper {

    flex: 1;

    display: flex;

    align-items: center;

    justify-content: center;

    overflow: hidden;

    padding: 20px;

}

#fs-proof-image {

    max-width: 100%;

    max-height: 100%;

    object-fit: contain;

    transition: transform 0.2s ease;

}

.fs-proof-close {

    position: absolute;

    top: 10px;

    right: 12px;

    z-index: 2;

    border: 0;

    background: none;

    font-size: 22px;

    cursor: pointer;

}

.fs-proof-controls {

    padding: 12px;

    text-align: center;

    border-top: 1px solid #eee;

}

#fs-proof-rotate {

    cursor: pointer;

    padding: 7px 14px;

}


/* ==========================================
   Status-Farbbalken
========================================== */

.fs-status-section {

    border-left: 4px solid transparent;

    padding-left: 14px;

}

.fs-status-open {

    border-left-color: #e6a23c;

}

.fs-status-approved {

    border-left-color: #67a86b;

}

.fs-status-rejected {

    border-left-color: #d76565;

}


/* ==========================================
   Mobile Darstellung
========================================== */

@media (max-width: 768px) {

    .fs-core-ergebnisverwaltung {

        margin: 20px 0;

        width: 100%;

    }


    /* ------------------------------------------
       Tabelle
    ------------------------------------------ */

    .fs-table-wrapper {

        width: 100%;

        overflow-x: auto;

        overflow-y: hidden;

        -webkit-overflow-scrolling: touch;

    }

    .fs-table {

        min-width: 1100px;

    }

    .fs-table th,
    .fs-table td {

        white-space: normal;

        word-break: normal;

        overflow-wrap: normal;

    }


    /* ------------------------------------------
       Bearbeiten-Modal auf Smartphone
    ------------------------------------------ */

    .fs-modal {

        padding: 10px;

    }

    .fs-modal-content {

        width: 100%;

        max-width: 100%;

        /*
         * Nutzt die tatsächlich verfügbare
         * Bildschirmhöhe auf Smartphones.
         */
        max-height: calc(100dvh - 20px);

    }

    .fs-modal-header {

        padding: 12px 16px;

    }

    .fs-modal-body {

        padding: 16px;

    }

    .fs-modal-footer {

        padding: 12px 16px;

    }

    /*
     * Historie auf kleinen Bildschirmen
     * etwas kompakter.
     */
    #fs-modal-history {

        max-height: 160px;

    }

}