/* ==========================================
   ADMIN LAYOUT
========================================== */

body.admin-mode #page {
    max-width: 100%;
    width: 100%;
    margin: 0;
    background: #eef2f5;
    overflow-x: hidden;
}

body.admin-mode #content.admin-page {
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Footer im Adminbereich optional ausblenden */
/*
body.admin-mode #footer {
    display: none;
}
*/

.admin-shell {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background: #eef2f5;
    overflow: hidden;
}

/* ==========================================
   SIDEBAR
========================================== */

.admin-sidebar {
    width: 290px;
    min-width: 290px;
    max-width: 290px;
    flex: 0 0 290px;
    background: #1f2a30;
    color: #fff;
    border-right: 1px solid #162025;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: sticky;
    top: 0;
    z-index: 20;
}

.admin-sidebar::-webkit-scrollbar {
    width: 8px;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 8px;
}

.admin-sidebar-inner {
    padding: 0 0 20px 0;
}

.admin-sidebar-title {
    padding: 22px 20px 18px 20px;
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #182127;
    position: sticky;
    top: 0;
    z-index: 21;
}

.admin-nav-group {
    padding: 14px 0 8px 0;
}

.admin-nav-category {
    padding: 8px 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #9fb0b8;
    font-weight: 700;
}

.admin-nav-link {
    display: block;
    padding: 11px 20px 11px 24px;
    color: #e7edf0;
    text-decoration: none;
    border-left: 4px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    font-size: 14px;
}

.admin-nav-link:hover {
    background: #2b3941;
    color: #fff;
    text-decoration: none;
}

.admin-nav-link.active {
    background: #32464f;
    border-left-color: #ff7f50;
    color: #fff;
    font-weight: 700;
}

.admin-nav-logout,
.admin-nav-danger {
    color: #ffb8b8;
}

/* ==========================================
   WORKSPACE
========================================== */

.admin-workspace {
    flex: 1 1 auto;
    min-width: 0;
    width: calc(100% - 290px);
    max-width: calc(100% - 290px);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.admin-workspace-header {
    background: #ffffff;
    padding: 22px 30px;
    border-bottom: 1px solid #d8e0e5;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
    flex: 0 0 auto;
}

.admin-workspace-header h1 {
    margin: 0;
    font-size: 28px;
    color: #2f6b2f;
    font-weight: 700;
}

.admin-module-content {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 30px;
    box-sizing: border-box;
}

/* ==========================================
   BOXEN IM ADMINBEREICH
========================================== */

body.admin-mode .box {
    background: #fff;
    border-radius: 10px;
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.07);
    box-sizing: border-box;
    max-width: 100%;
}

body.admin-mode .box h2,
body.admin-mode .box h3 {
    margin-top: 0;
}

/* ==========================================
   MELDUNGEN
========================================== */

.success {
    color: #1f7a35;
    font-weight: 600;
}

.error {
    color: #b33c3c;
    font-weight: 600;
}

/* ==========================================
   FORMULAR / TABELLEN FEINSCHLIFF
========================================== */

body.admin-mode input,
body.admin-mode textarea,
body.admin-mode select {
    background: #fff;
    box-sizing: border-box;
}

body.admin-mode .admin-table {
    background: #fff;
}

body.admin-mode .admin-table th {
    position: sticky;
    top: 0;
    z-index: 2;
}

/* ==========================================
   ABRECHNUNGEN EXCEL
========================================== */

.fullwidth-table {
    width: 100%;
    max-width: 100%;
    padding: 0 !important;
    overflow: hidden;
    box-sizing: border-box;
}

.excel-table-frame {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.excel-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 70vh;
    position: relative;
    box-sizing: border-box;
    border-radius: 10px;
}

.excel-table {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 1400px;
    table-layout: auto;
    background: #fff;
}

.excel-table th,
.excel-table td {
    white-space: nowrap;
    vertical-align: middle;
    border-right: 1px solid #d8e0e5;
    border-bottom: 1px solid #d8e0e5;
    padding: 8px 10px;
    background: #fff;
}

.excel-table tr th:first-child,
.excel-table tr td:first-child {
    border-left: 1px solid #d8e0e5;
}

.excel-table thead tr:first-child th {
    border-top: 1px solid #d8e0e5;
}

.excel-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #ffffff;
    box-shadow: 0 1px 0 #d8e0e5;
}

.excel-table .sum-row td {
    font-weight: 700;
    background: #f3f3f3;
}

.excel-table td.num,
.excel-table th.num {
    text-align: right;
}

.excel-table td.center,
.excel-table th.center {
    text-align: center;
}

.excel-table td.strong {
    font-weight: 700;
}

/* Erste Spalte links fixieren */
.excel-table th:first-child,
.excel-table td:first-child {
    position: sticky;
    left: 0;
    min-width: 140px;
    background: #ffffff;
    z-index: 4;
    box-shadow: 2px 0 0 #d8e0e5;
}

.excel-table .sum-row td:first-child {
    background: #f3f3f3;
    z-index: 5;
}

.excel-table thead th:first-child {
    left: 0;
    z-index: 7;
    background: #ffffff;
}

/* ==========================================
   MOBILE
========================================== */

@media (max-width: 1000px) {
    .admin-shell {
        flex-direction: column;
        min-height: auto;
        overflow: visible;
    }

    .admin-sidebar {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        flex: none;
        height: auto;
        max-height: 320px;
        position: relative;
        top: auto;
    }

    .admin-workspace {
        width: 100%;
        max-width: 100%;
        height: auto;
        overflow: visible;
    }

    .admin-module-content {
        overflow-y: visible;
        overflow-x: hidden;
        padding: 16px;
    }

    .admin-workspace-header {
        padding: 16px 20px;
    }

    .admin-workspace-header h1 {
        font-size: 22px;
    }

    .excel-table-wrap {
        max-height: none;
    }
}