/*
 * Pfotenmond Inventar – statische Version
 * Dieses Stylesheet definiert das Pfotenmond‑Corporate‑Design mit modernen
 * Farben, Schriften und Layouts. Es richtet sich an eine HTML/JS/CSS‑App,
 * die komplett ohne Server läuft und im Browser mit localStorage
 * funktioniert.
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #f39720;
    /* Etwas hellere Variante für den Verlauf */
    --primary-dark: #e08a1c;
    /* Helle Hintergründe und sekundäre Farbe für ein cleanes Layout */
    --secondary-color: #f9f9f9;
    --text-color: #333333;
    --light-bg: #fdfcfa;
}

/* General styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
}

h1, h2, h3 {
    margin-top: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    /* Für ein sauberes, luftiges Layout verwenden wir eine helle Navigationsleiste
       mit einer dünnen Akzentlinie. */
    background: #ffffff;
    border-bottom: 3px solid var(--primary-color);
    color: var(--text-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-text {
    font-weight: 700;
    font-size: 1.6rem;
}

.logo-accent {
    color: #2b2b2b;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-link {
    margin-left: 1.25rem;
    color: var(--text-color);
    font-weight: 500;
    position: relative;
    font-size: 0.95rem;
    padding: 0.25rem 0;
}

.nav-link.active {
    font-weight: 600;
    color: var(--primary-color);
}

.nav-link:hover::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

/* Hamburger menu button */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.hamburger .bar, .hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    margin: 4px 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Navigation settings form */
.nav-settings-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}
.nav-settings-form label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.nav-settings-form input[type="checkbox"] {
    accent-color: var(--primary-color);
}

/* Logs section inside adjust modal */
.adjust-logs {
    max-height: 180px;
    overflow-y: auto;
    border-top: 1px solid #eee;
    margin-top: 1rem;
    padding-top: 0.5rem;
    font-size: 0.85rem;
}
.adjust-logs h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.adjust-logs ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.adjust-logs li {
    margin-bottom: 0.25rem;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 0.25rem;
}

/* Responsive navigation styles */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background: linear-gradient(90deg, var(--primary-dark), var(--primary-color));
        position: absolute;
        top: 100%;
        left: 0;
        padding: 0.5rem 1rem;
    }
    .nav-links.show {
        display: flex;
    }
    .nav-links .nav-link {
        margin-left: 0;
        padding: 0.5rem 0;
    }
    .hamburger {
        display: flex;
    }
}

/* Containers */
.container {
    max-width: 1200px;
    margin: 2.5rem auto;
    padding: 0 1rem;
}

/* Login page */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #fdf7f0 0%, #ffffff 100%);
}

.login-wrapper {
    background-color: #fff;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 400px;
    text-align: center;
}

.login-wrapper .logo-text {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    text-align: left;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 0.55rem 0.7rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.94rem;
}

.login-form input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(243, 151, 32, 0.2);
}

.flash-message {
    color: #d9534f;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.55rem 1.3rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.94rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}
.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid #ccc;
}
.btn-secondary:hover {
    background-color: #efefef;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* New product section */
.new-product-section {
    background-color: #fff;
    padding: 1.75rem;
    border-radius: 12px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.04);
    margin-bottom: 2rem;
}

.new-product-form .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 160px;
}

.form-group label {
    font-size: 0.83rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.form-group input {
    padding: 0.55rem 0.7rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.93rem;
    background-color: #fff;
}

.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(243, 151, 32, 0.2);
}

/* Table */
.table-wrapper {
    overflow-x: auto;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 0;
    margin-top: 1rem;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.inventory-table th, .inventory-table td {
    padding: 0.75rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid #e8e8e8;
    vertical-align: middle;
    font-size: 0.94rem;
}

.inventory-table thead th {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
    border-bottom: 3px solid var(--primary-dark);
}

.inventory-table tbody tr:nth-child(even) {
    background-color: #fcfcfc;
}

.inventory-table tbody tr:hover {
    background-color: #f6f6f6;
}

.product-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.no-products {
    padding: 1rem;
    color: #666;
}

/* Alert for low stock */
.alert {
    /* Dezentere Warnung für Lagerbestand */
    background-color: #fde9e7;
    color: #a83c3c;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* Receipt form section */
.receipt-form-section {
    background-color: #fff;
    padding: 1.75rem 1.5rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
    margin-bottom: 2rem;
}

.receipt-form .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Export receipts wrapper */
.export-receipts {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
    background-color: #fff;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* Danger button for delete */
.btn-danger {
    /* Dezentes Erscheinungsbild für den Entfernen‑Button */
    background-color: #fceae9;
    color: #c65858;
    border-color: #f4d2d0;
    padding: 0.55rem 1.3rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.94rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.btn-danger:hover {
    background-color: #f2b4b2;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Vorschau des Produkts im Warenannahmeformular */
.product-preview img {
    max-width: 100%;
    height: 40px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Container für gruppierte Warenannahmen */
.receipts-container {
    background-color: #fff;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
    margin-bottom: 2rem;
}
.receipt-date-section {
    margin-bottom: 1rem;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.receipt-date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    /* Leichte Hintergrundfarbe für Datumskopf und dezente Trennlinie */
    background-color: #fbfbfb;
    cursor: pointer;
    border-bottom: 1px solid #efefef;
    font-weight: 600;
}
.receipt-date-header:hover {
    background-color: #f0f0f0;
}
.receipt-date-body {
    display: none;
    padding: 0.5rem 0.75rem;
}
.receipt-date-body table {
    width: 100%;
    border-collapse: collapse;
}
.receipt-date-body th,
.receipt-date-body td {
    text-align: left;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid #f4f4f4;
    font-size: 0.88rem;
}
.receipt-date-body th {
    font-weight: 600;
    background-color: #fcfcfc;
}

/* Management section */
.management-section {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}
.management-section h3 {
    margin-bottom: 1rem;
}
.management-lists {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}
.management-employees,
.management-reasons {
    flex: 1 1 300px;
}
.management-employees h4,
.management-reasons h4 {
    margin-bottom: 0.5rem;
}
.list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem 0;
}
.list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}
.list li:last-child {
    border-bottom: none;
}
.inline-form {
    display: flex;
    gap: 0.5rem;
}
.inline-form input[type="text"] {
    flex: 1;
    padding: 0.45rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.88rem;
}
.inline-form button {
    padding: 0.45rem 0.8rem;
}

/* Entfernen‑Icon in Listen */
.remove-item {
    background: none;
    border: none;
    color: #c9302c;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

/* Low stock quantity cell */
.low-stock-cell {
    color: #c9302c;
    font-weight: 600;
}

/* Out of stock cell */
.no-stock-cell {
    color: #a83533;
    font-weight: 700;
}

/* Image in receipts table */
.receipt-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Receipt date filter */
.receipt-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
    background-color: #fff;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
.receipt-filter label {
    font-size: 0.85rem;
    font-weight: 500;
}
.receipt-filter input[type="date"] {
    padding: 0.4rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9rem;
}
.receipt-filter input[type="date"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(243, 151, 32, 0.2);
}

/* Settings section */
#settingsSection .settings-wrapper {
    background-color: #fff;
    padding: 1.75rem;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
    margin-bottom: 2rem;
}


/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background-color: #fff;
    margin: auto;
    border-radius: 12px;
    padding: 2rem 1.5rem 1.25rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    position: relative;
}

.modal-content h3 {
    margin-top: 0;
}

.close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #666;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.5rem;
}

/* Responsive */
@media (max-width: 600px) {
    .new-product-form .form-row {
        flex-direction: column;
    }
}