/* Globale Variablen für Farben (Dark Mode) */
:root {
    --bg-color: #121212;
    --bg-color-light: #1e1e1e; /* Etwas heller für Karten etc. */
    --text-color: #e0e0e0;
    --primary-color: #0D6EFD; /* Moderneres Blau statt Grün */
    --secondary-color: #333;
    --border-color: #444; /* Etwas heller für bessere Sichtbarkeit */
    --menu-width: 300px; /* Etwas breiter */
    --menu-bg: #212529; /* Dunkelgrau */
    --menu-hover-bg: #343A40;
    --menu-active-bg: var(--primary-color);
    --border-radius-base: 8px; /* Basis für Rundungen */
}

/* Basis-Reset und Body-Styling */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body {
    font-family: sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex; /* Verhindert Margin-Kollaps */
    min-height: 100vh;
}

.app-container {
    display: flex;
    width: 100%;
    position: relative; /* Für absoluten Toggle-Button */
}

/* Seitenmenü */
.side-menu {
    width: var(--menu-width);
    background-color: var(--menu-bg);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
    z-index: 100;
    border-right: 1px solid var(--border-color);
    border-top-right-radius: var(--border-radius-base); /* Abrundung oben rechts */
    border-bottom-right-radius: var(--border-radius-base); /* Abrundung unten rechts */
}

.side-menu.collapsed {
    transform: translateX(-100%);
}

.menu-header {
    padding: 20px 15px; /* Weniger horizontal padding */
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.menu-header h2 { 
    font-size: 1.4em; 
}

#menu-items {
    list-style: none;
    overflow-y: auto;
    flex-grow: 1;
    padding-top: 10px; /* Abstand oben */
}

#menu-items li a {
    display: flex; /* Für Icon-Ausrichtung */
    align-items: center;
    padding: 12px 20px; /* Angepasstes Padding */
    margin: 5px 10px; /* Außenabstand für Trennung, Rundung */
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--border-radius-base); /* Abgerundete Ecken */
    transition: background-color 0.2s ease, color 0.2s ease;
}
#menu-items li a i { /* Styling für Icons im Menü */
    margin-right: 12px; /* Abstand zum Text */
    width: 20px; /* Feste Breite für Ausrichtung */
    text-align: center;
    color: #adb5bd; /* Etwas gedämpfte Farbe */
    transition: color 0.2s ease;
}

#menu-items li a:hover {
    background-color: var(--menu-hover-bg);
    color: #fff; /* Hellerer Text bei Hover */
}
#menu-items li a:hover i {
     color: #fff; /* Icon heller bei Hover */
}

#menu-items li a.active {
    background-color: var(--menu-active-bg);
    color: white;
    font-weight: bold;
}
#menu-items li a.active i {
    color: white; 
}


.menu-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}
.menu-footer a {
    display: flex; /* Für Icon */
    align-items: center;
    padding: 10px; /* Kleineres Padding */
    margin: 0;
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--border-radius-base);
    transition: background-color 0.2s ease, color 0.2s ease;
}
.menu-footer a i { /* Footer Icon */
    margin-right: 12px;
    width: 20px;
    text-align: center;
    color: #adb5bd;
}
.menu-footer a:hover {
    background-color: var(--menu-hover-bg);
    color: #fff;
}
.menu-footer a:hover i {
    color: #fff;
}
.menu-footer a.active { /* Aktive Einstellungen hervorheben */
    background-color: var(--menu-active-bg);
    color: white;
    font-weight: bold;
}
.menu-footer a.active i {
    color: white;
}


/* Dashboard Styling */
#dashboard-grid {
    display: grid;
    /* Mindestens 250px breit, maximal 1fr (füllt Platz auf) */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px; /* Größerer Abstand */
    padding-top: 20px;
    text-align: center; /* Zentriert den Text in den Tiles */
}

.dashboard-tile {
    background-color: var(--bg-color-light);
    border-radius: var(--border-radius-base);
    padding: 25px;
    display: flex;
    flex-direction: column; /* Elemente untereinander */
    /* align-items: center; */ /* Zentriert horizontal */
    text-align: left; /* Text linksbündig */
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
}

.dashboard-tile:hover {
    transform: translateY(-5px); /* Leichter Schwebeeffekt */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3); /* Stärkerer Schatten */
    border-color: var(--primary-color); /* Rahmen hervorheben */
}

.dashboard-tile i { /* Icon */
    font-size: 2.5em; /* Angepasste Größe */
    margin-bottom: 15px;
    color: var(--primary-color); /* Hauptfarbe für Icon */
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 40px; /* Begrenzt Breite des Icons */
    text-align: center;
}

.dashboard-tile h3 { /* Titel */
    margin-bottom: 8px;
    font-size: 1.2em;
    color: var(--text-color);
    text-align: center;
}

.dashboard-tile p { /* Beschreibung */
    font-size: 0.9em;
    color: #adb5bd; /* Gedämpfte Farbe für Beschreibung */
    line-height: 1.4;
    flex-grow: 1; /* Sorgt dafür, dass Tiles bei wenig Text gleiche Höhe haben (wenn im Grid aligned) */
    text-align: center;
}


/* Hauptinhaltsbereich */
.main-content {
    flex-grow: 1;
    padding: 20px;
    margin-left: var(--menu-width);
    margin-right: auto;
    transition: margin-left 0.3s ease-in-out;
    max-width: calc(100% - var(--menu-width)); 
}

.main-content.menu-collapsed {
    margin-left: 0;
    max-width: 100%;
}

/* Styling für Formularelemente (Basis) */
label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="time"],
input[type="date"], /* Datum hinzugefügt */

textarea,select {
    width: 100%; /* Volle Breite des Containers */
    max-width: 15cm; /* Behält die gewünschte Maximalbreite bei */
    padding: 8px;
    margin-bottom: 15px;
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color); 
    border-radius: var(--border-radius-base); /* Einheitliche Rundung */
    font-size: 1em; /* Einheitliche Schriftgröße */
    padding: 10px; /* Mehr Innenabstand */
    display: block; /* Stellt sicher, dass es die Breite annimmt */
}

input, textarea, select {
    width: 100%; /* Volle Breite des Containers */
    max-width: 15cm; /* Behält die gewünschte Maximalbreite bei */
    padding: 8px;
    margin-bottom: 15px;
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color); 
    border-radius: var(--border-radius-base); /* Einheitliche Rundung */
    font-size: 1em; /* Einheitliche Schriftgröße */
    padding: 10px; /* Mehr Innenabstand */
    display: block; /* Stellt sicher, dass es die Breite annimmt */
}

textarea#setting-colleagues{
   width: 100%; /* Volle Breite des Containers */
    max-width: 15cm; /* Behält die gewünschte Maximalbreite bei */
    padding: 8px;
    margin-bottom: 15px;
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color); 
    border-radius: var(--border-radius-base); /* Einheitliche Rundung */
    font-size: 1em; /* Einheitliche Schriftgröße */
    padding: 10px; /* Mehr Innenabstand */
    display: block; /* Stellt sicher, dass es die Breite annimmt */
    font-family: sans-serif;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25); /* Leichter Fokus-Schatten */
}

/* Container für Module um Breite zu steuern */
.module-container {
    width: 100%;
     max-width: 15cm; /* Feste Breite wie gewünscht */
     margin: 0 auto; /* Zentriert, falls .main-content breiter ist */
}

.module-container, h1{
    width: 100%;
     max-width: 15cm; /* Feste Breite wie gewünscht */
     margin: 0 auto; /* Zentriert, falls .main-content breiter ist */
}

.headline, h1 {
    text-align: center;
}

button {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: var(--border-radius-base); /* Rundung */
    cursor: pointer;
    margin-top: 10px;
    margin-bottom: 10px;
    margin-right: 5px;
    transition: background-color 0.2s ease;
}

button:hover {
    opacity: 0.9;
}

button.secondary { /* Z.B. für Löschen/Abbrechen */
    background-color: #f44336; /* Rot */
}
button.secondary:hover {
    opacity: 0.9;
}


/* Menü-Toggle-Button */
.menu-toggle {
    position: fixed;
   /* top: 15px;  Etwas tiefer */
    left: 15px;
    z-index: 110;
    background: var(--menu-bg);
    border: 1px solid var(--border-color);
    width: 45px; /* Etwas größer */
    height: 45px;
    padding: 0;
    font-size: 20px; /* Angepasste Größe */
    line-height: 45px;
    text-align: center;
    border-radius: 50%; /* Rund */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.menu-toggle:hover {
    background-color: var(--secondary-color);
}


/* Dialog für Bestätigung */
.dialog-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.dialog-box {
    background-color: var(--bg-color-light);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.dialog-box p {
    margin-bottom: 20px;
}

.dialog-box button {
    margin: 0 10px;
}



@media (max-width: 768px) {
    .side-menu {
        transform: translateX(-100%);
        box-shadow: 2px 0 5px rgba(0,0,0,0.5);
    }
    .side-menu.visible {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        max-width: 100%;
        transition: none;
    }

    .main-content.menu-visible { 
        margin-left: 0;
    }
}

#feedback-box {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--border-radius-base);
    z-index: 1100;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none; /* Verhindert Interaktion */
}
#feedback-box.show {
    opacity: 1;
}

/* Spezifische Stile für dieses Modul, um es übersichtlich zu halten */
.form-section {
    margin-bottom: 25px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-base);
}
.item-category {
    margin-bottom: 15px;
    border: 1px solid var(--secondary-color);
    border-radius: var(--border-radius-base);
    padding: 10px;
}
.item-category legend {
    padding: 0 10px;
    font-weight: bold;
    color: var(--primary-color);
}
.item-row {
    display: grid; 
    grid-template-columns: auto 1fr auto 1fr; 
    gap: 20px; 
    align-items: center;
    padding: 5px 0;
    align-content: stretch;
    flex-direction: row-reverse;
}
.item-row label {
    margin-bottom: 0; 
}
/* Container für das Input-Feld und die Buttons */
.item-quantity-control {
    display: flex; /* Nutzt Flexbox innerhalb der Grid-Zelle */
    align-items: center;
    /* Um sicherzustellen, dass es nicht zu breit wird, obwohl es 1fr in item-row bekommt */
    max-width: 150px; /* Beispielbreite, die Buttons und Input aufnehmen kann */
    width: 100%; /* Füllt die zugewiesene Grid-Zelle aus */
}

.item-quantity-input {
    width: 100%; /* Füllt den verfügbaren Platz innerhalb von item-quantity-control aus */
    text-align: center; /* Zahl zentriert */
    margin-bottom: 0 !important; 
    /* Entferne feste/prozentuale Breite hier, da Flexbox/Grid das nun regeln */
    flex-grow: 1; /* Sorgt dafür, dass das Input-Feld den restlichen Platz einnimmt */
    min-width: 50px; /* Mindestbreite, damit 4 Zahlen passen */
    max-width: 70px; /* Maximale Breite, damit es nicht zu groß wird */
}

/* Styling für die neuen Plus/Minus Buttons */
.quantity-button {
    background-color: var(--primary-color); /* Blaue Farbe für die Buttons */
    color: white;
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius-base); /* Abgerundete Ecken */
    width: 30px; /* Feste Breite */
    height: 30px; /* Feste Höhe */
    font-size: 1.2em; /* Größerer Text für die Symbole */
    line-height: 1; /* Vertikale Zentrierung des Symbols */
    padding: 0;
    display: flex; /* Für bessere Zentrierung des Symbols */
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0; /* Verhindert, dass der Button schrumpft */
    margin: 0 2px; /* Kleiner Abstand zwischen Buttons und Input */
}

.quantity-button:hover {
    background-color: color-mix(in srgb, var(--primary-color) 80%, black); /* Dunkler bei Hover */
    border-color: color-mix(in srgb, var(--primary-color) 80%, black);
}

.minus-button {
    background-color: #f44336; /* Rote Farbe für Minus */
    border-color: #f44336;
}

.minus-button:hover {
    background-color: color-mix(in srgb, #f44336 80%, black);
    border-color: color-mix(in srgb, #f44336 80%, black);
}

#output-ausgabe, #output-einlagerung {
    font-family: monospace;
    white-space: pre-wrap;
}

.item-list-container, label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600 !important;
}

/* Spezifische Stile für dieses Modul, um es übersichtlich zu halten */
.form-section {
    margin-bottom: 25px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-base);
}
.item-category {
    margin-bottom: 15px;
    border: 1px solid var(--secondary-color);
    border-radius: var(--border-radius-base);
    padding: 10px;
}
.item-category legend {
    padding: 0 10px;
    font-weight: bold;
    color: var(--primary-color);
}
.item-row {
    display: grid; 
    grid-template-columns: auto 1fr; 
    gap: 10px; 
    align-items: center;
    padding: 5px 0;
}
.item-row label {
    margin-bottom: 0; 
}

/* Container für das Input-Feld und die Buttons */
.item-quantity-control {
    display: flex; 
    align-items: center;
    max-width: 150px; 
    width: 100%; 
}

.item-quantity-input {
    width: 100%; 
    text-align: center; 
    margin-bottom: 0; 
    flex-grow: 1; 
    min-width: 50px; 
    max-width: 70px; 
}

/* Styling für die neuen Plus/Minus Buttons */
.quantity-button {
    background-color: var(--primary-color); 
    color: white;
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius-base); 
    width: 30px; 
    height: 30px; 
    font-size: 1.2em; 
    line-height: 1; 
    padding: 0;
    display: flex; 
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0; 
    margin: 0 2px; 
}

.quantity-button:hover {
    background-color: color-mix(in srgb, var(--primary-color) 80%, black); 
    border-color: color-mix(in srgb, var(--primary-color) 80%, black);
}

.minus-button {
    background-color: #f44336; 
    border-color: #f44336;
}

.minus-button:hover {
    background-color: color-mix(in srgb, #f44336 80%, black);
    border-color: color-mix(in srgb, #f44336 80%, black);
}


#output-ausgabe, #output-einlagerung {
    font-family: monospace;
    white-space: pre-wrap;
}

.floating-button-container {
    position: fixed; /* Macht den Container schwebend */
    bottom: 20px;    /* 20px vom unteren Rand */
    left: 50%;       /* 50% von links */
    transform: translateX(-50%); /* Zentriert den Container horizontal */
    z-index: 999;    /* Stellt sicher, dass er über anderen Elementen liegt */
    background-color: var(--bg-color-light); /* Hintergrundfarbe für bessere Sichtbarkeit */
    padding: 10px 20px; /* Innenabstand */
    border-radius: var(--border-radius-base); /* Abgerundete Ecken */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* Leichter Schatten für Tiefe */
}

/* Stil für den Button selbst im schwebenden Container (optional, da button schon definiert ist) */
.floating-button-container button {
    margin: 0; /* Entfernt zusätzliche Margins, die von der globalen Button-Regel kommen könnten */
    padding: 12px 25px; /* Etwas größere Polsterung */
    font-size: 1.1em; /* Etwas größerer Text */
}

#lager-ausgabe-module {
    display: flex; /* Flexbox für horizontale Anordnung */
    flex-direction: column; /* Elemente untereinander anordnen */
    gap: 15px; /* Abstand zwischen den Modulen */
    max-width: 100%;  /*Maximale Breite für bessere Lesbarkeit */
    margin: 0 auto; /* Zentriert den Container */
}

.bussgeld-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9em;
}

.bussgeld-table th,
.bussgeld-table td {
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
}

.bussgeld-table thead th {
    background-color: var(--secondary-color);
    color: var(--text-color);
    font-weight: bold;
}

.bussgeld-table tbody tr:nth-child(even) {
    background-color: var(--secondary-color);
}

.bussgeld-table tbody tr:hover {
    background-color: var(--menu-hover-bg);
}


.accordion-item {
    border-bottom: 1px solid var(--border-color);
}
.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    padding: 15px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    color: var(--text-color);
    transition: background-color 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-header:hover {
    background-color: var(--menu-hover-bg);
}

.accordion-header::after {
    content: '+'; /* Plus-Icon für "geschlossen" */
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
    transition: transform 0.3s ease-out;
}

.accordion-header.active::after {
    content: '−'; /* Minus-Icon für "geöffnet" */
    transform: rotate(180deg);
}

.accordion-content {
    background-color: var(--secondary-color);
    padding: 0 15px; /* Padding nur horizontal, vertikal kommt durch max-height */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.accordion-content > *:last-child {
    padding-bottom: 15px; /* Sorgt für Abstand im aufgeklappten Zustand */
}

#no-results-message {
    display: none;
    padding: 15px;
    margin-top: 15px;
    text-align: center;
    font-style: italic;
    background-color: var(--secondary-color);
    border-radius: var(--border-radius-base);
}

.bussgeld-table th:first-child,
.bussgeld-table td:first-child {
    width: 40px;
    text-align: center;
}

/* .pinned-row {
    background-color: #3a321a !important; 
    font-weight: bold;
} */