html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 60px;
    background: #f5f7fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.hero {
    padding: 40px 10px;
    text-align: center;
    background: linear-gradient(135deg, #ff9ad9, #7dd9ff);
    color: white;
    border-radius: 15px;
    margin: 15px auto;
    max-width: 800px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

    .hero h1 {
        font-size: 2.2rem;
        margin-bottom: 15px;
        font-weight: 700;
    }

    .hero p {
        font-size: 1rem;
        opacity: 0.9;
    }

@media (max-width: 768px) {
    .hero {
        padding: 40px 15px;
        max-width: 95%;
    }

        .hero h1 {
            font-size: 1.6rem;
        }

        .hero p {
            font-size: 0.9rem;
        }
}

@media (max-width: 480px) {
    .hero {
        padding: 30px 10px;
        border-radius: 10px;
    }

        .hero h1 {
            font-size: 1.3rem;
        }

        .hero p {
            font-size: 0.8rem;
        }
}

.feature-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s ease;
}

    .feature-card:hover {
        transform: translateY(-5px);
    }

.card-container {
    margin: 40px auto;
    max-width: 1100px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    text-align: left;
    box-shadow: 0 8px 20px rgba(0,0,0,0.07);
    transition: 0.25s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

    .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    }

    .card h3 {
        margin-bottom: 10px;
    }

.btn-main {
    display: inline-block;
    padding: 8px 20px;
    margin-top: 15px;
    background: #4e73df;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: 0.2s;
}

    .btn-main:hover {
        background: #3752a6;
    }

.geraet-bild {
    max-width: 120px;
    margin: 5px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

    .geraet-bild:hover {
        transform: scale(1.05);
    }

#imageModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

    #imageModal img {
        max-width: 90%;
        max-height: 90%;
    }

.navbar-brand-custom {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    text-decoration: none;
}

.navbar-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
    display: block;
}

.navbar-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #000;
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    .navbar-logo {
        height: 36px;
    }

    .navbar-title {
        font-size: 1rem;
        white-space: normal;
        line-height: 1.2;
    }
}

@media (max-width: 576px) {
    .navbar-logo {
        height: 30px;
    }

    .navbar-title {
        font-size: 0.9rem;
    }
}

.ausleihe-container {
    max-width: 400px;
    margin: 50px auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    text-align: center;
}

    .ausleihe-container h1 {
        font-size: 1.6rem;
        margin-bottom: 20px;
        color: #333;
    }

.ausleihe-form .form-group {
    margin-bottom: 15px;
    text-align: left;
}

.ausleihe-form label {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
    color: #444;
}

.small-input {
    font-size: 0.85rem;
    padding: 6px 10px;
}

.action-group {
    text-align: center;
}

.radio-inline {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 8px;
}

    .radio-inline input {
        margin-right: 5px;
    }

.historie-container {
    max-width: 800px;
    margin: 40px auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

    .historie-container h1 {
        text-align: center;
        margin-bottom: 25px;
        font-size: 1.8rem;
        color: #333;
    }

    .historie-container h2 {
        margin-top: 20px;
        font-size: 1.2rem;
        color: #4e73df;
    }

.item-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

    .item-list li {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #f5f7fa;
        padding: 12px 15px;
        border-radius: 8px;
        margin-bottom: 10px;
    }

.item-title {
    font-weight: 600;
    color: #333;
}

.item-room {
    font-size: 0.9rem;
    color: #666;
    margin-left: 15px;
    flex: 1;
}

.item-list li.item-ok {
    background-color: #e6f4ea;
    border: 1px solid #28a745;
    border-radius: 8px;
}

.item-list li.item-bad {
    background-color: #fdeaea;
    border: 1px solid #dc3545;
    border-radius: 8px;
}

.geraete-container {
    max-width: 900px;
    margin: 40px auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

    .geraete-container h1 {
        text-align: center;
        margin-bottom: 25px;
        font-size: 1.8rem;
        color: #333;
    }

.search-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

    .search-bar input {
        flex: 1;
        max-width: 400px;
        padding: 8px;
        border-radius: 8px;
        border: 1px solid #ccc;
    }

.raum-block {
    margin-bottom: 25px;
    padding: 15px;
    background: #f5f7fa;
    border-radius: 10px;
}

.historie-page {
    max-width: 100%;
}

.historie-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,.08);
    overflow: hidden;
}

.historie-table {
    width: 100%;
    margin-bottom: 0;
    table-layout: fixed;
}

    .historie-table th,
    .historie-table td {
        padding: 14px 16px;
        vertical-align: middle;
        word-break: break-word;
        overflow-wrap: break-word;
    }

.historie-action-cell {
    text-align: right;
}

    .historie-action-cell .btn,
    .historie-btn-mobile,
    .historie-action-cell button {
        display: inline-block;
        width: auto;
        max-width: 100%;
    }

@media (max-width: 991.98px) {
    .historie-page,
    .historie-section,
    .historie-table,
    .historie-table tbody,
    .historie-table tr,
    .historie-table td {
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .historie-section {
        padding: 14px;
    }

    .responsive-table thead {
        display: none !important;
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block !important;
        width: 100% !important;
    }

        .responsive-table tr.searchable-row {
            background: #fff;
            border: 1px solid #e9ecef;
            border-radius: 12px;
            padding: 12px;
            margin-bottom: 12px;
            overflow: hidden;
        }

        .responsive-table td {
            border: 0 !important;
            padding: 0 !important;
            margin: 0 0 10px 0 !important;
            word-break: normal !important;
            overflow-wrap: anywhere;
            white-space: normal !important;
        }

            .responsive-table td::before {
                content: attr(data-label);
                display: block;
                margin-bottom: 4px;
                font-size: 0.75rem;
                font-weight: 700;
                color: #6c757d;
                text-transform: uppercase;
            }

            .responsive-table td[data-label="Aktion"] {
                margin-bottom: 0 !important;
            }

                .responsive-table td[data-label="Aktion"] .btn,
                .responsive-table td[data-label="Aktion"] button {
                    width: 100% !important;
                }

        .responsive-table tr.searchable-row.table-success {
            background-color: #d1e7dd !important;
            border-color: #d1e7dd !important;
        }

        .responsive-table tr.searchable-row.table-danger {
            background-color: #f8d7da !important;
            border-color: #f8d7da !important;
        }

        .responsive-table tr.searchable-row.table-warning {
            background-color: #fff3cd !important;
            border-color: #fff3cd !important;
        }

            .responsive-table tr.searchable-row.table-success td,
            .responsive-table tr.searchable-row.table-danger td,
            .responsive-table tr.searchable-row.table-warning td,
            .responsive-table tr.searchable-row.table-success td::before,
            .responsive-table tr.searchable-row.table-danger td::before,
            .responsive-table tr.searchable-row.table-warning td::before {
                background: transparent !important;
            }

    .raum-header-responsive {
        flex-direction: column;
        align-items: stretch;
    }

    .raum-add-btn {
        width: 100%;
        text-align: center;
    }
}

.historie-pagination {
    gap: 8px;
}

    .historie-pagination .page-item {
        display: flex;
    }

.historie-page-link {
    min-width: 48px;
    height: 44px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 10px;
    font-weight: 600;
}

.historie-pagination .page-item:first-child .historie-page-link,
.historie-pagination .page-item:last-child .historie-page-link {
    min-width: 95px;
}

.raum-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

    .raum-header h2 {
        font-size: 1.2rem;
        color: #4e73df;
        margin: 0;
    }

.verantwortlicher {
    font-size: 0.9rem;
    color: #666;
}

.geraete-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .geraete-list li {
        padding: 6px 0;
        border-bottom: 1px solid #ddd;
        font-size: 0.95rem;
    }

.raum-header-responsive {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.raum-add-btn {
    white-space: nowrap;
}

.raum-card {
    overflow: hidden;
}

.geraet-row {
    padding: 15px;
}

.geraet-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
}

.geraet-info {
    flex: 1;
    min-width: 0;
}

.geraet-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.geraet-thumb {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ccc;
}

@media (max-width: 768px) {
    .geraet-content {
        flex-direction: column;
        align-items: stretch;
    }

    .geraet-actions {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }

        .geraet-actions .btn {
            width: auto;
            padding: 6px 10px;
            font-size: 0.8rem;
        }

    .raum-add-btn {
        width: 100%;
        text-align: center;
    }

    .geraet-thumb {
        width: 75px;
        height: 75px;
    }
}

@media (max-width: 480px) {
    .geraet-row {
        padding: 12px;
    }

    .geraet-thumb {
        width: 65px;
        height: 65px;
    }
}

@media (max-width: 991.98px) {

    .historie-responsive-table thead {
        display: none !important;
    }

    .historie-responsive-table,
    .historie-responsive-table tbody,
    .historie-responsive-table tr,
    .historie-responsive-table td {
        display: block !important;
        width: 100% !important;
    }

        .historie-responsive-table tr.search-row {
            background: #fff;
            border: 1px solid #e9ecef;
            border-radius: 12px;
            padding: 12px;
            margin-bottom: 12px;
            overflow: hidden;
        }

        .historie-responsive-table td {
            border: 0 !important;
            padding: 0 !important;
            margin: 0 0 10px 0 !important;
            word-break: normal !important;
            overflow-wrap: anywhere;
            white-space: normal !important;
            text-align: left !important;
        }

            .historie-responsive-table td::before {
                content: attr(data-label);
                display: block;
                margin-bottom: 4px;
                font-size: 0.75rem;
                font-weight: 700;
                color: #6c757d;
                text-transform: uppercase;
            }

            .historie-responsive-table td[data-label="Aktion"] {
                margin-bottom: 0 !important;
                text-align: left !important;
            }

                .historie-responsive-table td[data-label="Aktion"] .btn,
                .historie-responsive-table td[data-label="Aktion"] button,
                .historie-responsive-table td[data-label="Aktion"] a.btn {
                    width: 100% !important;
                }

                .historie-responsive-table td[data-label="Aktion"] .d-flex {
                    flex-direction: column;
                    align-items: stretch;
                    width: 100%;
                }
}

@media (max-width: 991.98px) {
    .raum-table .table-responsive {
        overflow-x: visible !important;
    }

    .raum-table thead {
        display: none !important;
    }

    .raum-table table, .raum-table tbody, .raum-table tr, .raum-table td {
        display: block !important;
        width: 100% !important;
    }

        .raum-table tr.geraet-row {
            background: #fff;
            border: 1px solid #e9ecef;
            border-radius: 12px;
            padding: 12px;
            margin-bottom: 12px;
        }

    .raum-table td {
        border: 0 !important;
        padding: 0 !important;
        margin: 0 0 10px 0 !important;
        text-align: left !important;
    }

        .raum-table td:last-child {
            margin-bottom: 0 !important;
        }

        .raum-table td .btn {
            width: 100% !important;
        }
}

@media (max-width: 991.98px) {
    .raum-card .geraet-row {
        display: flex !important;
        align-items: flex-start;
        gap: 12px;
    }

        .raum-card .geraet-row > span, .raum-card .geraet-row > div:first-child {
            flex: 1 1 auto !important;
            min-width: 0 !important;
        }

            .raum-card .geraet-row > span, .raum-card .geraet-row > span *,
            .raum-card .geraet-row > div:first-child, .raum-card .geraet-row > div:first-child * {
                word-break: normal !important;
                overflow-wrap: normal !important;
                white-space: normal !important;
            }

        .raum-card .geraet-row > div:last-child {
            display: flex !important;
            flex-direction: column !important;
            gap: 8px;
            align-items: flex-end;
            flex: 0 0 auto;
        }

            .raum-card .geraet-row > div:last-child .btn,
            .raum-card .geraet-row > div:last-child button {
                width: 90px !important;
                min-height: 40px;
                padding: 5px 10px;
                text-align: center;
                white-space: normal;
                word-break: normal;
                overflow-wrap: anywhere;
            }

            .raum-card .geraet-row > div:last-child .me-2 {
                margin-right: 0 !important;
            }
}

@media (max-width: 991.98px) {
    table.table.table-sm thead {
        display: none !important;
    }

    table.table.table-sm, table.table.table-sm tbody, table.table.table-sm tr, table.table.table-sm td {
        display: block !important;
        width: 100% !important;
    }

        table.table.table-sm tr {
            background: #fff;
            border: 1px solid #e9ecef;
            border-radius: 12px;
            padding: 12px;
            margin-bottom: 12px;
        }

        table.table.table-sm td {
            border: 0 !important;
            padding: 0 !important;
            margin: 0 0 10px 0 !important;
            text-align: left !important;
        }

            table.table.table-sm td:last-child {
                margin-bottom: 0 !important;
            }

            table.table.table-sm td form,
            table.table.table-sm td a.btn {
                display: block;
                width: 100%;
            }

            table.table.table-sm td .btn {
                width: 140px !important;
            }

        table.table.table-sm td {
            display: flex !important;
            justify-content: space-between;
            align-items: flex-start;
            gap: 12px;
        }

            table.table.table-sm td > *:first-child {
                flex: 1 1 auto;
                min-width: 0;
            }

            table.table.table-sm td > *:last-child {
                flex: 0 0 auto;
            }
}

@media (max-width: 991.98px) {
    .actions-row {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .btn-fix {
        width: 160px;
        text-align: center;
        white-space: normal;
    }

    .actions-row .ms-2 {
        margin-left: 0 !important;
    }
}

@media (max-width: 991.98px) {
    .actions-row {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .btn-fix {
        width: 160px;
    }

    .actions-row form {
        margin: 0;
    }
}

@media (max-width: 991.98px) {
    .actions-row {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px;
    }

        .actions-row form {
            margin: 0;
        }

    .btn-fix {
        width: 160px;
        text-align: center;
        white-space: normal;
    }
}
