/* =========================================================
   Datei: assets/css/emp-archive-einsatz-table.css
   Zweck: Styling für Einsatz-Archiv (Tabellenansicht)
   Feinschliff: ruhiger, luftiger, hochwertiger
   ========================================================= */

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

.emp-archive-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 18px 44px;
    box-sizing: border-box;
}

.emp-archive-header {
    margin-bottom: 18px;
}

.emp-archive-header h1 {
    margin: 0;
    color: var(--emp-dark, #1d2327);
    font-size: clamp(2rem, 3.2vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.emp-archive-subtitle {
    display: inline-block;
    margin-left: 10px;
    font-size: 0.72em;
    font-weight: 650;
    color: var(--emp-muted, #6b7280);
    vertical-align: baseline;
}

/* =========================================================
   Controls / Filterbar
   ========================================================= */

.emp-controls-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border: 1px solid var(--emp-border, #dcdcde);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.04);
    margin: 0 0 20px;
}

.emp-controls-form {
    display: flex;
    gap: 10px 14px;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
}

.emp-filter-section {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.emp-filter-label {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--emp-dark, #1d2327);
}

.emp-select-style {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-height: 44px;
    padding: 10px 40px 10px 14px;
    border-radius: 14px;
    border: 1px solid var(--emp-border, #dcdcde);
    background: #fff;
    color: var(--emp-dark, #1d2327);
    font-size: 0.98rem;
    line-height: 1.2;
    box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.02);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--emp-muted, #6b7280) 50%),
        linear-gradient(135deg, var(--emp-muted, #6b7280) 50%, transparent 50%);
    background-position:
        calc(100% - 19px) calc(50% - 2px),
        calc(100% - 14px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.emp-select-style:focus {
    outline: none;
    border-color: var(--emp-primary, #d63638);
    box-shadow: 0 0 0 3px var(--emp-primary-soft, rgba(214, 54, 56, 0.12));
}

.emp-actions-right {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.emp-reset-link {
    color: var(--emp-muted, #6b7280);
    text-decoration: none;
    font-weight: 700;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.emp-reset-link:hover,
.emp-reset-link:focus {
    color: var(--emp-primary, #d63638);
    border-color: var(--emp-primary, #d63638);
    background: var(--emp-primary-soft, rgba(214, 54, 56, 0.08));
    text-decoration: none;
}

/* View Switch */
.emp-view-switch {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    padding: 5px;
    border: 1px solid var(--emp-border, #dcdcde);
    border-radius: 999px;
    background: #fff;
}

.emp-view-btn {
    width: 42px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--emp-muted, #6b7280);
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.emp-view-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.emp-view-btn:hover,
.emp-view-btn:focus {
    color: var(--emp-primary, #d63638);
    background: var(--emp-primary-soft, rgba(214, 54, 56, 0.10));
    border-color: var(--emp-primary, #d63638);
    transform: translateY(-1px);
}

.emp-view-btn.is-active {
    background: var(--emp-primary, #d63638);
    color: #fff;
    border-color: var(--emp-primary, #d63638);
}

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

.emp-table-wrapper {
    width: 100%;
    overflow-x: auto;
    background: #fff;
    border-radius: 18px;
    border: 1px solid var(--emp-border, #dcdcde);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.05);
}

.emp-einsatz-table {
    width: 100%;
    min-width: 860px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    text-align: left;
    background: #fff;
}

/* Spaltenbreiten */
.emp-einsatz-table th:nth-child(1),
.emp-einsatz-table td:nth-child(1) {
    width: 132px;
}

.emp-einsatz-table th:nth-child(2),
.emp-einsatz-table td:nth-child(2) {
    width: 150px;
}

.emp-einsatz-table th:nth-child(4),
.emp-einsatz-table td:nth-child(4) {
    width: 140px;
}

.emp-einsatz-table th:nth-child(5),
.emp-einsatz-table td:nth-child(5) {
    width: 190px;
}

/* Header */
.emp-einsatz-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8f9fa;
    padding: 14px 14px;
    border-bottom: 1px solid var(--emp-border, #dcdcde);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #607085;
    font-weight: 800;
    white-space: nowrap;
}

.emp-einsatz-table thead th:first-child {
    border-top-left-radius: 18px;
}

.emp-einsatz-table thead th:last-child {
    border-top-right-radius: 18px;
}

/* Body */
.emp-einsatz-table tbody td {
    padding: 14px 14px;
    border-bottom: 1px solid #edf0f2;
    font-size: 0.96rem;
    vertical-align: top;
    color: #2c3338;
    line-height: 1.45;
    background: #fff;
}

.emp-einsatz-table tbody tr:last-child td {
    border-bottom: 0;
}

.emp-einsatz-table tbody tr:nth-child(even) td {
    background: #fcfcfd;
}

.emp-einsatz-table tbody tr:hover td {
    background: rgba(214, 54, 56, 0.03);
}

/* Fehlalarm-Zeile */
.tr-fehlalarm td {
    background: #fff8f8 !important;
    border-bottom-color: #f3d1d1 !important;
}

/* =========================================================
   Zellen-Styles
   ========================================================= */

/* NR. */
.emp-table-nr {
    display: inline-block;
    padding: 0;
    margin: 0;
    background: transparent;
    border-radius: 0;
    color: var(--emp-dark, #1d2327);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-transform: none;
    line-height: 1.18;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Datum / Uhrzeit */
.emp-einsatz-table td small {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.82rem;
    line-height: 1.2;
    color: var(--emp-muted, #6b7280);
}

/* Ereignis */
.emp-table-link {
    display: inline-block;
    margin-top: 1px;
    text-decoration: none;
    color: var(--emp-dark, #1d2327);
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.36;
}

.emp-table-link:hover,
.emp-table-link:focus {
    color: var(--emp-primary, #d63638);
    text-decoration: underline;
}

.emp-einsatz-table td:nth-child(3) {
    line-height: 1.4;
    word-break: break-word;
}

/* Fehlalarm-Icon */
.fehlalarm-icon-table {
    color: var(--emp-primary, #d63638);
    font-size: 1rem;
    margin-right: 6px;
    position: relative;
    top: 1px;
    cursor: help;
    vertical-align: middle;
}

/* Feuerwehr / Einsatzart Badges */
.emp-table-fw-badge,
.emp-table-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1;
    margin-right: 5px;
    margin-bottom: 5px;
    white-space: nowrap;
    box-sizing: border-box;
}

.emp-table-fw-badge {
    background: #1f2933;
    color: #fff;
    box-shadow: none;
    border: 0;
}

.emp-table-badge {
    background: #f5f6f7;
    color: #4b5563;
    border: 1px solid #d7dce1;
}

/* leere Zustände */
.emp-empty-state {
    text-align: center;
    padding: 34px 20px !important;
    color: var(--emp-muted, #6b7280);
    font-style: italic;
}

/* =========================================================
   Pagination
   ========================================================= */

.pagination {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    align-items: center;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid var(--emp-border, #dcdcde);
    text-decoration: none;
    color: var(--emp-dark, #1d2327);
    border-radius: 999px;
    font-weight: 700;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.page-numbers.current {
    background: var(--emp-primary, #d63638);
    color: #fff;
    border-color: var(--emp-primary, #d63638);
}

.page-numbers:hover:not(.current),
.page-numbers:focus:not(.current) {
    color: var(--emp-primary, #d63638);
    border-color: var(--emp-primary, #d63638);
    background: var(--emp-primary-soft, rgba(214, 54, 56, 0.08));
    text-decoration: none;
}

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

@media (max-width: 940px) {
    .emp-controls-bar {
        align-items: stretch;
    }

    .emp-actions-right {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 640px) {
    .emp-archive-container {
        padding: 18px 12px 30px;
    }

    .emp-archive-header h1 {
        font-size: 2.2rem;
        line-height: 1.05;
    }

    .emp-archive-subtitle {
        display: block;
        margin: 6px 0 0;
        font-size: 0.48em;
    }

    .emp-controls-form {
        width: 100%;
        gap: 10px;
    }

    .emp-filter-section {
        width: 100%;
        justify-content: space-between;
    }

    .emp-select-style {
        min-width: 0;
        width: 100%;
        max-width: 220px;
    }

    .emp-einsatz-table {
        min-width: 760px;
    }

    .emp-einsatz-table thead th,
    .emp-einsatz-table tbody td {
        padding: 12px 12px;
    }

    .emp-table-link {
        font-size: 0.94rem;
    }

    .emp-table-nr {
        font-size: 0.92rem;
    }
}

@media (max-width: 420px) {
    .emp-actions-right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .emp-view-switch {
        justify-content: center;
    }

    .emp-reset-link {
        text-align: center;
    }
}