html, body {
    height: auto;
    min-height: 100%;
    overflow-y: auto; /* gesamte Seite scrollbar */
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5e8d2; /* Pastell-Sand-Beige */
    margin: 0;
    padding: 20px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.top-left .logo {
    height: 140px; /* doppelte Logo-Größe */
}

.top-right {
    text-align: right;
    font-size: 14px;
}

button {
    margin: 5px;
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    background-color: #3a7d4c;
    color: white;
    cursor: pointer;
}

button:hover {
    background-color: #2e5f3b;
}

.task {
    padding: 10px;
    border: 1px solid #ccc;
    margin-top: 10px;
    border-radius: 6px;
    background-color: #ffffff;
    overflow-wrap: anywhere;  /* lange Wörter umbrechen */
    word-break: break-word;
}

.task.notStarted {
    background-color: #e0e0e0;
}

.task.inProgress {
    background-color: #ffcccc;
}

.task.paused {
    background-color: #fff2b3;
}

.task.done {
    background-color: #d2f8d2;
}

.task.reopened {
    background-color: #b3d9ff;
}

.button-group {
    margin: 15px 0;
}

/* Aufgabenpakete UI */
.pkg-badge {
    background: #374151;
    color: #fff;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    margin-left: 8px;
}

.pkg-panel {
    display: none;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px;
    margin-top: 8px;
    max-height: 240px; /* scrollbar bei langen Listen */
    overflow-y: auto;
}

.pkg-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.pkg-row input[type="text"] {
    width: 70px;
    padding: 4px 6px;
    font-size: 12px;
}

.package-options {
    max-height: 220px; /* scrollbar im Formular */
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px;
    background: #ffffff;
    text-align: left;           /* Inhalte linksbündig */
    display: flex;              /* alle Optionen untereinander */
    flex-direction: column;
    gap: 6px;
}

.package-options label {
    display: grid;               /* Stabile Spalten: Checkbox | Text */
    grid-template-columns: 18px 1fr;
    align-items: start;
    column-gap: 8px;
    margin: 0;
    justify-content: flex-start; /* Sicher links ausgerichtet */
    width: 100%;                 /* volle Breite, Text linksbündig */
    line-height: 1.3;
}

.package-options input[type="checkbox"] {
    margin: 0;                   /* Grid übernimmt Abstand */
}

.package-options label span {
    text-align: left;
    display: block;
}

.popup {
    display: none;
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid black;
    padding: 20px;
    width: min(700px, 90vw);
    max-height: 80vh;  /* Popup selbst scrollbar */
    overflow: auto;
    z-index: 999;
}

.form-popup {
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 2px solid #ccc;
    padding: 20px;
    width: min(450px, 92vw); /* responsive Breite */
    max-height: 80vh;        /* Modal scrollbar bei kleiner Höhe */
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border-radius: 8px;
}

.form-popup input,
.form-popup textarea {
    width: 100%;
    padding: 8px;
    margin: 5px 0 10px;
    font-size: 14px;
    border: 1px solid #aaa;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-popup button {
    margin-top: 10px;
}

/* Admin-Statistiken */
.admin-stats {
    margin: 16px 0;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.admin-stats h2 {
    margin: 0 0 8px 0;
}

.admin-stats .stats-section {
    margin-top: 12px;
}

.admin-stats .stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-stats .stats-table th,
.admin-stats .stats-table td {
    border: 1px solid #e5e7eb;
    padding: 8px;
    text-align: left;
}

.admin-stats .stats-table thead th {
    background: #f3f4f6;
}

/* Mobile Tweaks */
@media (max-width: 600px) {
    body { padding: 12px; }
    .top-left .logo { height: 90px; }
    button { font-size: 13px; padding: 8px 12px; }
    .pkg-badge { font-size: 12px; padding: 3px 8px; }
}
