/* =========================================================================
   1. BASIS-LAYOUT (für alle Tabellen)
   ========================================================================= */
.table-responsive {
    width: 100% !important;
    overflow-x: auto;
    margin: 0;
    padding: 0;
}

#anyid {
    font-size: 0.9rem;
    width: 100% !important;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 0 !important;
}

#anyid tbody tr:nth-child(odd) {
    background-color: #FFF8D1 !important;
}

#anyid tbody tr:nth-child(even) {
    background-color: #F2EBC6 !important;
}

#anyid tbody td {
    padding: 2px 4px;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
    overflow: hidden;
}

/* =========================================================================
   2. HEADER & FILTER-ZEILE
   ========================================================================= */
#anyid thead tr.header th {
    color: #0a58ca !important;
    text-decoration: none !important; /* Unterstreichung weg für besseres Pfeil-Handling */
    cursor: pointer;
    background-color: #f5f5f5;
    padding: 8px 22px 8px 10px; /* Rechts Platz für Pfeil etwas reduziert, links etwas weniger Padding */
    font-weight: bold;
}

#anyid thead tr.filters th {
    background-color: #eee;
    padding: 2px;
}

.search-filter {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ccc;
}

/* =========================================================================
   3. FILTER-UI
   ========================================================================= */
.filter-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.filter-wrapper::after {
    content: "▼";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.6rem;
    color: #888;
    pointer-events: none;
    z-index: 2;
}

.filter-wrapper:has(input:not(:placeholder-shown))::after {
    opacity: 0;
}

.filter-clear {
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    color: #ff0000;
    cursor: pointer;
    display: none;
    user-select: none;
    z-index: 10;
    font-size: 1.4rem;
    line-height: 1;
}

/* =========================================================================
   4. AUTOCOMPLETE
   ========================================================================= */
.autocomplete-list {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    display: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.autocomplete-item {
    padding: 4px 6px;
    cursor: pointer;
}

.autocomplete-item:hover {
    background: #eee;
}

/* =========================================================================
   5. TEXT-BEHANDLUNG (ELLIPSIS)
   ========================================================================= */
.nowrap-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: top;
    width: 100%;
}

.nowrap-ellipsis.expanded {
    white-space: normal;
    overflow: visible;
    width: auto;
}

/* =========================================================================
   6. MOBILE LOGIK (Intelligent: Nur wenn Tabelle zu breit ist)
   ========================================================================= */
.control-icon {
    display: none;
}

/* Modus: Tabelle braucht Platz-Hilfe */
#anyid.is-responsive {
    table-layout: auto !important;
}

#anyid.is-responsive td:first-child {
    position: relative;
    padding-left: 35px !important;
    cursor: pointer;
}

#anyid.is-responsive .control-icon {
    display: block;
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    line-height: 16px;
    text-align: center;
    background-color: #31b131;
    color: white;
    border-radius: 50%;
    font-family: monospace;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 0 2px #444;
}

#anyid.is-responsive tr.parent .control-icon {
    background-color: #d33333;
}

/* =========================================================================
   7. CHILD-ROW
   ========================================================================= */
.child-row td {
    background-color: #f9f9f9;
    padding: 10px !important;
}

.child-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.child-content li {
    padding: 4px 0;
    border-bottom: 1px solid #eee;
}

.child-content b {
    display: inline-block;
    width: 120px;
    color: #555;
}

/* =========================================================================
   8. LINKS
   ========================================================================= */
.go-link,
.maiw-link {
    color: #0a58ca !important; /* Abgedunkelt auf Header-Blau für besseren Kontrast (PageSpeed) */
    text-decoration: underline !important;
    font-weight: normal;
    cursor: pointer;
}

/* =========================================================================
   9. PAGINATION
   ========================================================================= */
#pagination {
    margin-top: 10px;
    text-align: center;
}

#pagination button {
    margin: 0 2px;
}

#pagination .d-flex {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: center;
    gap: 6px;
    padding: 10px 5px;

    -ms-overflow-style: none;
    scrollbar-width: none;
}

#pagination .d-flex::-webkit-scrollbar {
    display: none;
}

@media (max-width: 600px) {
    #pagination .d-flex {
        justify-content: flex-start;
    }
}

/* =========================================================================
   10. SEITENSPEZIFISCHE SPALTENBREITEN (über Klassen)
   ========================================================================= */

/* ============================================================
   AIAIRCRAFT (12 Spalten)
   ============================================================ */
.tbl-aiaircraft thead th:nth-child(1) {
    width: 15%;
}

.tbl-aiaircraft thead th:nth-child(2) {
    width: 8%;
}

.tbl-aiaircraft thead th:nth-child(3) {
    width: 22%;
}

.tbl-aiaircraft thead th:nth-child(4) {
    width: 12%;
}

.tbl-aiaircraft thead th:nth-child(5) {
    width: 10%;
}

.tbl-aiaircraft thead th:nth-child(6) {
    width: 8%;
}

.tbl-aiaircraft thead th:nth-child(7) {
    width: 8%;
}

.tbl-aiaircraft thead th:nth-child(8) {
    width: 55px;
}

.tbl-aiaircraft thead th:nth-child(9) {
    width: 55px;
}

.tbl-aiaircraft thead th:nth-child(10) {
    width: 55px;
}

.tbl-aiaircraft thead th:nth-child(11) {
    width: 55px;
}

.tbl-aiaircraft thead th:nth-child(12) {
    width: 7%;
}

/* ============================================================
   MAIW (5 Spalten)
   ============================================================ */
.tbl-maiw thead th:nth-child(1) {
    width: 45px;
}

.tbl-maiw thead th:nth-child(2) {
    width: fit-content(25%);
}

.tbl-maiw thead th:nth-child(3) {
    width: auto;
}

.tbl-maiw thead th:nth-child(4) {
    width: 130px;
}

.tbl-maiw thead th:nth-child(5) {
    width: 200px;
}

/* ============================================================
   AIFSXP3D (10 Spalten) – optimierte Breiten & 2-Zeilen-Text
   ============================================================ */
.tbl-aifsxp3d thead th:nth-child(1) {
    width: 20%;
}

.tbl-aifsxp3d thead th:nth-child(2) {
    width: 25%;
}

.tbl-aifsxp3d thead th:nth-child(3) {
    width: 8%;
}

/* Safari-Bugfix: KEIN fit-content() */
.tbl-aifsxp3d thead th:nth-child(4) {
    width: 130px;
    max-width: 130px;
}

.tbl-aifsxp3d thead th:nth-child(5) {
    width: 130px;
    max-width: 130px;
}

.tbl-aifsxp3d thead th:nth-child(6) {
    width: 45px;
}

.tbl-aifsxp3d thead th:nth-child(7) {
    width: 45px;
}

.tbl-aifsxp3d thead th:nth-child(8) {
    width: 45px;
}

.tbl-aifsxp3d thead th:nth-child(9) {
    width: 90px;
}

/* Bildspalte exakt 80px – thead */
.tbl-aifsxp3d thead th:nth-child(10) {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    padding: 0;
    text-align: center;
}

/* Zeilenhöhe auf exakt 45px festlegen & Text vertikal zentrieren */
.tbl-aifsxp3d tbody tr,
.tbl-aifsxp3d tbody td {
    height: 45px;
    max-height: 45px;
    padding: 0;
    overflow: hidden;
    vertical-align: middle; /* Zentriert Text in den anderen Spalten */
}

/* Bildspalte exakt 80px – tbody mit Flexbox für perfekte Zentrierung */
.tbl-aifsxp3d tbody td:nth-child(10) {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 45px;
}

/* Bild auf fixe Maße zwingen (80x45px) */
.tbl-aifsxp3d tbody td:nth-child(10) img {
    width: 80px; /* Fixe Breite */
    height: 45px; /* Fixe Höhe */
    object-fit: cover; /* Verhindert Verzerrung durch leichtes Beschneiden */
    display: block;
    margin: 0;
}

/* STYLING FÜR DIE NAVIGATION IM FILTER-DROPDOWN (PFEILTASTEN-AUSWAHL) */
.autocomplete-active {
    background-color: #e9ecef !important; /* Hellgrauer Hintergrund für das aktive Element */
    color: #000 !important; /* Schwarze Textfarbe für bessere Lesbarkeit */
    border-left: 3px solid #31b131; /* Grüner linker Rand als optischer Fokus-Indikator */
    cursor: pointer; /* Zeigt den Mauszeiger als Hand (Interaktions-Feedback) */
    outline: none; /* Entfernt den Standard-Browser-Fokusrahmen */
}

.filter-highlight {
    color: red;
    font-weight: bold;
}

/* ============================================================
   MILAI (11 Spalten)
   ============================================================ */
.tbl-milai thead th:nth-child(1) {
    width: 15%;
}

/* Company */
.tbl-milai thead th:nth-child(2) {
    width: 20%;
}

/* Aircraft */
.tbl-milai thead th:nth-child(3) {
    width: 60px;
}

/* Year */
.tbl-milai thead th:nth-child(4) {
    width: 70px;
}

/* Built */
.tbl-milai thead th:nth-child(5) {
    width: 50px;
}

/* Crew */
.tbl-milai thead th:nth-child(6) {
    width: 80px;
}

/* Speed */
.tbl-milai thead th:nth-child(7) {
    width: 80px;
}

/* Range */
.tbl-milai thead th:nth-child(8) {
    width: 80px;
}

/* Ceiling */
.tbl-milai thead th:nth-child(9) {
    width: 80px;
}

/* Wingspan */
.tbl-milai thead th:nth-child(10) {
    width: 60px;
}

/* FSX */
.tbl-milai thead th:nth-child(11) {
    width: 12%;
}

/* Country */
