: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: auto;
}

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

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

/* Spaltenbreiten festlegen */
th:nth-child(1),
td:nth-child(1) {
    width: 13%;
} /* Autor */
th:nth-child(2),
td:nth-child(2) {
    width: 36%;
} /* Titel */
/*
th:nth-child(3),
td:nth-child(3) {
    width: 3%;
} */ /* Ex. */
th:nth-child(4),
td:nth-child(4) {
    width: 11%;
} /* Status */
th:nth-child(5),
td:nth-child(5) {
    width: 8%;
} /* Von */
th:nth-child(6),
td:nth-child(6) {
    width: 8%;
} /* Bis */
th:nth-child(7),
td:nth-child(7) {
    width: 8%;
} /* Rückgabe */
th:nth-child(8),
td:nth-child(8) {
    width: 10%;
} /* Entleiher */
/*
th:nth-child(9),
td:nth-child(9) {
    width: 3%;
} */ /* Link */

/* Exemplar-Spalte minimal halten */
th:nth-child(3),
td:nth-child(3) {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

/* Lösch-Icon-Spalte minimal halten */
th:last-child,
td:last-child {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

td:last-child a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

tr:hover {
    background: #eef6ff;
}

/* 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;
}

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

.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;
}




/* Überschrift + Info-Icon nebeneinander */
.title-with-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tooltip-Container */
.info-tooltip {
    position: relative;
}

/* Icon */
.info-tooltip .icon {
    font-size: 1.2em;
    color: var(--main-dark);
    cursor: pointer;
}

/* Tooltip */
.info-tooltip .tooltip-text {
    position: absolute;
    top: 50%;
    left: calc(100% + 10px);
    transform: translateY(-50%);

    width: 650px;
    background: #eef6ff;
    border: 1px solid var(--main-light);
    border-left: 4px solid var(--main);
    border-radius: 6px;
    padding: 10px;

    font-size: 0.9em;
    line-height: 1.4;
    color: var(--main-dark);

    box-shadow: 0 4px 10px rgba(0,0,0,0.15);

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Hover */
.info-tooltip:hover .tooltip-text {
    opacity: 1;
}

