* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

:root {
    --bg: #f4f4f4;
    --card: #ffffff;
    --text: #222222;
    --muted: #666666;
    --header: #111827;
    --gold: #d4af37;
    --tile: linear-gradient(135deg, #111827, #1f2937);
    --border: #dddddd;
    --input: #ffffff;
}

body.dark {
    --bg: #0b1220;
    --card: #111827;
    --text: #f9fafb;
    --muted: #cbd5e1;
    --header: #030712;
    --gold: #facc15;
    --tile: linear-gradient(135deg, #1f2937, #374151);
    --border: #374151;
    --input: #1f2937;
}

body {
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

#loginOverlay {
    position: fixed;
    inset: 0;
    background: #111827;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.loginCard {
    background: white;
    color: #222;
    width: 520px;
    max-width: 92%;
    padding: 38px;
    border-radius: 18px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,.3);
}

.logo {
    width: 420px;
    max-width: 96%;
    height: auto;
    margin-bottom: 22px;
}

.logoSmall {
    width: 430px;
    max-width: 100%;
    height: auto;
    background: white;
    padding: 10px;
    border-radius: 10px;
}

.loginCard h1 {
    margin-bottom: 8px;
    font-size: 30px;
}

.loginCard p {
    margin-bottom: 25px;
    color: #666;
}

input,
select {
    width: 100%;
    max-width: 420px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 9px;
    margin-bottom: 14px;
    font-size: 16px;
    background: var(--input);
    color: var(--text);
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
}

button {
    background: var(--gold);
    color: #111;
    border: none;
    padding: 13px 22px;
    border-radius: 9px;
    cursor: pointer;
    font-weight: bold;
    font-size: 15px;
}

button:hover {
    opacity: .9;
}

header {
    background: var(--header);
    color: white;
    padding: 30px 42px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.headerLeft {
    display: flex;
    align-items: center;
    gap: 28px;
}

.headerLeft h2 {
    font-size: 34px;
    line-height: 1.1;
}

.headerLeft span {
    font-size: 20px;
}

.headerButtons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

main {
    width: 100%;
    max-width: 1400px;
    margin: 35px auto;
    padding: 0 24px;
}

.card {
    background: var(--card);
    color: var(--text);
    padding: 30px;
    margin-bottom: 25px;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    border: 1px solid rgba(255,255,255,.04);
}

.card h3 {
    margin-bottom: 20px;
    font-size: 26px;
}

#gesamtstunden {
    font-size: 38px;
    font-weight: bold;
    color: var(--gold);
}

.dashboardGrid {
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    gap: 18px;
}

.dashboardTile {
    background: var(--tile);
    color: white;
    padding: 26px;
    border-radius: 18px;
    box-shadow: 0 8px 18px rgba(0,0,0,.12);
}

.dashboardTile strong {
    display: block;
    font-size: 34px;
    line-height: 1.1;
    color: var(--gold);
    margin-bottom: 8px;
}

.dashboardTile span {
    font-size: 17px;
    color: #e5e7eb;
}

.filterRow {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.tableScroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th {
    background: var(--header);
    color: white;
    padding: 14px;
    text-align: left;
    white-space: nowrap;
}

td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.deleteBtn {
    background: #dc2626;
    color: white;
    margin-left: 6px;
}

.buttonRow {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.modalOverlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, .78);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 18px;
}

.modalCard {
    width: 520px;
    max-width: 96%;
    background: var(--card);
    color: var(--text);
    padding: 30px;
    border-radius: 18px;
    box-shadow: 0 15px 40px rgba(0,0,0,.35);
}

.modalCard h3 {
    margin-bottom: 20px;
    font-size: 25px;
}

#printReport {
    display: none;
}

@media(max-width: 1100px) {
    .dashboardGrid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width: 900px) {

    header {
        padding: 18px;
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }

    .headerLeft {
        gap: 14px;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .logoSmall {
        width: 100%;
        max-width: 460px;
    }

    .headerLeft h2 {
        font-size: 25px;
    }

    .headerLeft span {
        font-size: 16px;
    }

    .headerButtons {
        width: 100%;
        flex-direction: column;
    }

    .headerButtons button {
        width: 100%;
    }

    main {
        margin: 22px auto;
        padding: 0 14px;
    }

    .card {
        padding: 22px;
        border-radius: 16px;
    }

    .card h3 {
        font-size: 23px;
    }

    .dashboardGrid {
        grid-template-columns: 1fr;
    }

    .dashboardTile strong {
        font-size: 34px;
    }

    #gesamtstunden {
        font-size: 34px;
    }

    input,
    select,
    button {
        max-width: 100%;
        width: 100%;
        font-size: 16px;
    }

    .buttonRow,
    .filterRow {
        flex-direction: column;
    }

    table {
        min-width: 780px;
        font-size: 15px;
    }
}

@media print {
    body * {
        visibility: hidden;
    }

    #printReport,
    #printReport * {
        visibility: visible;
    }

    #printReport {
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 30px;
        background: white;
        color: black;
    }

    #printReport table {
        min-width: 0;
        width: 100%;
        border-collapse: collapse;
    }

    #printReport th {
        background: #111827 !important;
        color: white !important;
        padding: 10px;
    }

    #printReport td {
        padding: 10px;
        border-bottom: 1px solid #ccc;
    }

    #printReport h1,
    #printReport h2,
    #printReport h3 {
        margin-bottom: 15px;
    }
}