:root {
    --main: #6699cc;
    --main-dark: #336699;
    --main-light: #99cccc;
    --accent: #ffcc66;
}

/* Grundlayout */
body {
    font-family: Arial, sans-serif;
    margin: 10px;
    background: #f7f9fc;
}

/* Überschriften */
h1 {
    color: var(--main-dark);
    margin-bottom: 10px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 14px;
    background: var(--main);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: 0.2s;
    border: 1px solid var(--main-dark);
}

.btn:hover {
    background: var(--main-dark);
}

.btn-accent {
    background: var(--accent);
    color: black;
    border-color: #d4a843;
}

.btn-accent:hover {
    background: #e6b85c;
}

/* Filterbereich */
form.filterbar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

form.filterbar label {
    font-weight: bold;
    color: var(--main-dark);
}

form.filterbar input[type="text"],
form.filterbar select {
    padding: 6px;
    border: 1px solid var(--main-dark);
    border-radius: 4px;
}

/* Tabellen */
table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #999;
    background: white;
    table-layout: fixed;
}

th,
td {
    padding: 10px;
    border: 1px solid #ccc;
}

th {
    background: var(--main-light);
    color: #003355;
    cursor: pointer;
    font-weight: bold;
}

th:nth-child(1),
td:nth-child(1) {
    width: 20%;
} /* Autor */
th:nth-child(2),
td:nth-child(2) {
    width: 40%;
} /* Titel */
th:nth-child(3),
td:nth-child(3) {
    width: 5%;
} /* Exemplar */
th:nth-child(4),
td:nth-child(4) {
    width: 20%;
} /* Genre */
th:nth-child(5),
td:nth-child(5) {
    width: 10%;
} /* Status */
th:nth-child(6),
td:nth-child(6) {
    width: 5%;
} /* Links */

tr:hover {
    background: #eef6ff;
}

/* Feste Breite + Zentrierung für Exemplar-Spalte */
th.col-ex,
td.col-ex {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    text-align: center !important;
}

/* Feste Breite + Zentrierung für Bearbeiten-Spalte */
th.col-edit,
td.col-edit {
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
    text-align: center !important;
}

/* Link in der Bearbeiten-Spalte zentrieren */
td.col-edit a {
    display: inline-block;
    text-align: center;
    width: 100%;
}

/* Paging */
.paging {
    margin-top: 20px;
    text-align: center;
}

.paging a {
    margin: 0 5px;
}

/* Mobile */
@media (max-width: 800px) {
    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead {
        display: none;
    }

    tr {
        margin-bottom: 15px;
        border: 1px solid #ccc;
        padding: 10px;
        border-radius: 6px;
        background: white;
    }

    td {
        border: none;
        padding: 6px 0;
    }

    td::before {
        content: attr(data-label);
        font-weight: bold;
        color: var(--main-dark);
        display: block;
    }
}

/* Buttons rechts in der Filterzeile ausrichten */
.filterbar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

/* Drei-Punkte-Menü rechts */
.menu-wrapper {
    margin-left: auto;
    position: relative;
    margin-right: 10px; /* Abstand vom rechten Rand */
}

/* Icon */
.menu-icon {
    font-size: 20px;
    width: 36px;
    height: 36px;
    background: var(--main);
    color: white;
    border: 1px solid var(--main-dark);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-icon:hover {
    background: var(--main-dark);
}

/* Dropdown */
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 35px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    min-width: 180px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* Einträge */
.dropdown-menu a {
    display: block;
    padding: 10px;
    text-decoration: none;
    color: black;
}

.dropdown-menu a:hover {
    background: #eef6ff;
}

/* sichtbar */
.dropdown-menu.show {
    display: block;
}

/* Min-/Max-Breiten */
td[data-label="Autor"] {
    min-width: 180px;
}

td[data-label="Titel"] {
    max-width: 800px;
}

td[data-label="Genre"] {
    max-width: 300px;
}

/* verhindert Umbruch im Header (Autor + Pfeil) */
th:first-child a {
    white-space: nowrap;
}

/* Linkfarben in der Statusspalte */
.status-green {
    color: #008000;       /* Grün */
    font-weight: bold;
}

.status-orange {
    color: #d97a00;       /* Orange */
    font-weight: bold;
}

.status-red {
    color: #cc0000;       /* Rot */
    font-weight: bold;
}
