/* =========================================================
   1. GRUNDLAGEN & DESIGN-BASIS (Schwarz / Grau / Weiß)
========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #121212;
    color: #f1f5f9;
    min-height: 100vh;
    display: flex;
}

/* =========================================================
   2. SIDEBAR (Admin-Navigation)
========================================================= */

.sidebar {
    width: 260px;
    background: #18181b;
    color: white;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    z-index: 100;
    border-right: 1px solid #27272a;
}

.sidebar h3 {
    text-align: center;
    color: #ffffff;
    font-size: 1.25rem;
    margin: 35px 0;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #a1a1aa;
    padding: 16px 28px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
    cursor: pointer;
}

.sidebar a:hover {
    background: #27272a;
    color: #ffffff;
}

.sidebar a.active {
    background: #27272a;
    color: #ffffff;
    border-left-color: #ffffff;
    font-weight: 600;
}

/* =========================================================
   3. HAUPTBEREICH & KARTEN
========================================================= */

.admin-content, .content, .employee-content {
    margin-left: 260px;
    padding: 45px;
    flex: 1;
    max-width: calc(100% - 260px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.admin-content a, .content a {
    display: inline-block;
    margin-bottom: 15px;
    text-decoration: none;
    color: #a1a1aa;
    font-weight: 600;
}
.admin-content a:hover, .content a:hover {
    color: #ffffff;
}

h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    margin-top: 0 !important;
    margin-bottom: 25px !important;
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.card {
    background: #18181b;
    color: #f1f5f9;
    border-radius: 14px;
    padding: 30px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid #27272a;
    position: relative;
    width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* =========================================================
   4. TABELLEN & SPALTENBREITEN
========================================================= */

table {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 15px;
    background: #18181b;
    color: #f5f5f5;
    border: 1px solid #27272a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    font-size: 0.95rem;
}

thead {
    background: #27272a;
}

th {
    padding: 16px 20px;
    background: #27272a;
    color: #ffffff !important;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #3f3f46;
    white-space: nowrap;
}

td {
    padding: 16px 20px;
    color: #d4d4d8 !important;
    background: #18181b;
    border-bottom: 1px solid #27272a;
    line-height: 1.5;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    max-width: 0;
}

tbody tr:last-child td {
    border-bottom: none;
}

td:first-child {
    color: #ffffff !important;
    font-weight: 600;
}

.card th:nth-child(1), .card td:nth-child(1) { width: 22%; }
.card th:nth-child(2), .card td:nth-child(2) { width: 12%; }
.card th:nth-child(3), .card td:nth-child(3) { width: 15%; }
.card th:nth-child(4), .card td:nth-child(4) { width: 12%; }
.card th:nth-child(5), .card td:nth-child(5) { width: 27%; }
.card th:nth-child(6), .card td:nth-child(6) { width: 12%; }

/* =========================================================
   5. FORMULARE & INPUTS
========================================================= */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: 600;
    color: #d4d4d8;
}

input[type="text"], 
input[type="password"], 
input[type="time"], 
input[type="file"],
select, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #3f3f46;
    border-radius: 8px;
    background: #121212;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: #71717a;
    box-shadow: 0 0 0 3px rgba(113, 113, 122, 0.2);
    background: #18181b;
}

.task-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    background: #121212;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #27272a;
}

.task-row textarea {
    flex: 1;
    background: #18181b;
    color: #fff;
    border: 1px solid #3f3f46;
    border-radius: 6px;
    padding: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 42px;
    outline: none;
}

/* =========================================================
   6. BUTTONS
========================================================= */

button, .btn {
    padding: 11px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

button:hover, .btn:hover {
    transform: translateY(-1px);
}

.btn-blue, table a, .secondary-btn {
    background: #27272a;
    color: #ffffff;
    border: 1px solid #3f3f46;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

.btn-blue:hover, table a:hover {
    background: #3f3f46;
}

.btn-green {
    background: #059669;
    color: #ffffff;
    border: none;
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 700;
}

.btn-green:hover {
    background: #047857;
}

.btn-red {
    background: #7f1d1d;
    color: #fca5a5;
    border: 1px solid #991b1b;
    padding: 8px 14px;
    cursor: pointer;
}

.btn-red:hover {
    background: #991b1b;
    color: #ffffff;
}

/* =========================================================
   7. BADGES & LOGIN
========================================================= */

.badge-offen {
    background: #27272a;
    color: #fbbf24;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap !important;
    display: inline-block;
}

.badge-erledigt {
    background: #27272a;
    color: #34d399;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap !important;
    display: inline-block;
}

.login-container, .login-card, .login-box {
    width: 100%;
    max-width: 400px;
    margin: 100px auto;
    background: #18181b;
    color: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid #27272a;
    text-align: center;
}

.login-container h2, .login-card h2, .login-box h2 {
    color: #ffffff;
    margin-bottom: 25px;
}

/* =========================================================
   8. RESPONSIVE
========================================================= */

@media (max-width: 1000px) {
    body {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .admin-content, .content, .employee-content {
        margin-left: 0;
        max-width: 100%;
        padding: 20px;
    }
}

/* =========================================================
   9. MOBILE OPTIMIERUNG FÜR TABELLEN
========================================================= */

@media (max-width: 768px) {
    .card {
        padding: 12px;
        overflow-x: auto;
    }
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        table-layout: auto !important;
    }
    .card th, .card td {
        width: auto !important;
        white-space: normal;
        min-width: 120px;
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    .admin-content, .content, .employee-content {
        padding: 10px;
    }
    table, thead, tbody, th, td, tr {
        display: block;
        width: 100% !important;
    }
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    tbody tr {
        margin-bottom: 15px;
        background: #121212;
        border: 1px solid #27272a;
        border-radius: 10px;
        padding: 12px;
    }
    tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 10px;
        text-align: right;
        border-bottom: 1px solid #27272a;
        max-width: none !important;
        width: 100% !important;
    }
    tbody td:last-child {
        border-bottom: none;
    }
    tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #a1a1aa;
        text-align: left;
        margin-right: 15px;
        font-size: 0.8rem;
        text-transform: uppercase;
    }
}

/* =========================================================
   10. Tabellenreihen Farb-Logik Admin
========================================================= */

/* Aktuelle Schicht (Grün) */
.shift-active-row td { background-color: rgba(34, 197, 94, 0.1) !important; color: #fff !important; transition: background-color 0.2s; }
.shift-active-row td:first-child { border-left: 5px solid #22c55e !important; }
.shift-active-row:hover td { background-color: rgba(34, 197, 94, 0.2) !important; }

/* Nächste Schicht (Hellblau) */
.shift-next-row td { background-color: rgba(56, 189, 248, 0.1) !important; transition: background-color 0.2s; }
.shift-next-row td:first-child { border-left: 5px solid #38bdf8 !important; }
.shift-next-row:hover td { background-color: rgba(56, 189, 248, 0.2) !important; }

/* Zukünftige Schichten (Dunkelblau) */
.shift-future-row td { background-color: rgba(30, 58, 138, 0.15) !important; transition: background-color 0.2s; }
.shift-future-row td:first-child { border-left: 5px solid #1e3a8a !important; }
.shift-future-row:hover td { background-color: rgba(30, 58, 138, 0.25) !important; }

/* Letzte vergangene Schicht (Türkis) */
.shift-last-past-row td { background-color: rgba(45, 212, 191, 0.1) !important; transition: background-color 0.2s; }
.shift-last-past-row td:first-child { border-left: 5px solid #2dd4bf !important; }
.shift-last-past-row:hover td { background-color: rgba(45, 212, 191, 0.2) !important; }

/* Ältere Schichten (Orange) */
.shift-older-row td { background-color: rgba(251, 146, 60, 0.1) !important; transition: background-color 0.2s; }
.shift-older-row td:first-child { border-left: 5px solid #fb923c !important; }
.shift-older-row:hover td { background-color: rgba(251, 146, 60, 0.2) !important; }