/* ============================================================
   TEPTO Warenausgang Monitor – Corporate Design CSS
   Based on Tepto Designguide 2025 v2.0
   ============================================================ */

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    /* === F01–F06 Brand Colors === */
    --tepto-primary: #78B833; /* F01 Primärfarbe */
    --tepto-secondary: #333333; /* F02 Sekundärfarbe */
    --tepto-green-dark: #538731; /* F03 Zusatzfarbe */
    --tepto-green-light: #99C21F; /* F04 Zusatzfarbe */
    --tepto-green-darkest: #355C27; /* F05 Zusatzfarbe */
    --tepto-gray-light: #F2F2F2; /* F06 Zusatzfarbe */
    /* === Signal Colors === */
    --tepto-error: #b83a00; /* Achtungsfarbe */
    --tepto-warning: #ed9e00; /* Hinweisfarbe */
    --tepto-info: #4da0a3; /* Infofarbe */
    --tepto-success: #78B833; /* Erfolgsfarbe = F01 */
    /* === Surface / Neutrals === */
    --surface: #ffffff;
    --background: #F2F2F2;
    --on-primary: #ffffff;
    --on-surface: #333333;
    --on-background: #333333;
    --border: #e0e0e0;
    --border-hover: #bdbdbd;
    --text-muted: rgba(51, 51, 51, 0.6);
    /* === Shadows === */
    --shadow-2dp: 0 2px 4px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-4dp: 0 4px 8px 0 rgba(0, 0, 0, 0.10), 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    --shadow-8dp: 0 8px 24px 0 rgba(0, 0, 0, 0.12), 0 4px 8px 0 rgba(0, 0, 0, 0.08);
    /* === Gradients (as CSS vars for reuse) === */
    --gradient-green-v01: linear-gradient(330deg, #78B833 75%, #538731 0%);
    --gradient-green-v02: linear-gradient(330deg, #99C21F 100%, #78B833 25%);
    --gradient-gray-v03: radial-gradient(ellipse at 30% 30%, #545658 25%, #1F1F1E 80%);
    --gradient-gray-v04: radial-gradient(ellipse at 40% 40%, #4F702A 0%, #262626 60%);
    --gradient-gray-v05: linear-gradient(180deg, #F2F2F2 0%, #ffffff 100%);
    /* === Radius === */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 16px;
}


/* ============================================================
   BASE
   ============================================================ */

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background);
    color: var(--on-background);
    line-height: 1.6;
    font-size: 0.875rem;
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--tepto-secondary);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}


/* ============================================================
   HEADER – App Bar with Tepto gradient
   ============================================================ */

header {
    background: var(--gradient-gray-v04);
    color: var(--on-primary);
    padding: 28px 32px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    box-shadow: var(--shadow-4dp);
    position: relative;
    overflow: hidden;
}

    header::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -20%;
        width: 300px;
        height: 300px;
        background: radial-gradient(circle, rgba(120, 184, 51, 0.15) 0%, transparent 70%);
        pointer-events: none;
    }

    header::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 80px;
        height: 4px;
        background: var(--tepto-primary);
        border-radius: 0 2px 0 0;
    }

    header h1 {
        font-size: 1.75rem;
        font-weight: 600;
        margin: 0 0 4px 0;
        letter-spacing: -0.02em;
        color: var(--on-primary);
        position: relative;
        z-index: 1;
    }

.subtitle {
    font-size: 0.9rem;
    font-weight: 300;
    opacity: 0.85;
    margin: 0;
    position: relative;
    z-index: 1;
    letter-spacing: -0.01em;
}


/* ============================================================
   FILTER / SCAN SECTION
   ============================================================ */

.filter-section {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    box-shadow: var(--shadow-2dp);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) auto;
    gap: 20px;
    align-items: end;
    transition: box-shadow 0.2s ease;
    border: 1px solid var(--border);
}

    .filter-section:hover {
        box-shadow: var(--shadow-4dp);
    }

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .filter-group label {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .filter-group input,
    .filter-group select {
        padding: 14px 12px;
        border: 2px solid var(--border);
        border-radius: var(--radius-sm);
        font-size: 0.875rem;
        font-family: 'Poppins', sans-serif;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
        background-color: var(--surface);
        color: var(--on-surface);
        outline: none;
    }

        .filter-group input:focus,
        .filter-group select:focus {
            border-color: var(--tepto-primary);
            box-shadow: 0 0 0 3px rgba(120, 184, 51, 0.15);
        }

        .filter-group input:hover,
        .filter-group select:hover {
            border-color: var(--border-hover);
        }


/* ============================================================
   BUTTONS – Tepto styled
   ============================================================ */

.btn-primary,
.btn-secondary {
    font-family: 'Poppins', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    outline: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-green-v01);
    color: var(--on-primary);
    box-shadow: 0 2px 8px rgba(120, 184, 51, 0.3);
}

    .btn-primary:hover {
        background: linear-gradient(330deg, #6aa52e 75%, #487428 0%);
        box-shadow: 0 4px 12px rgba(120, 184, 51, 0.4);
        transform: translateY(-1px);
    }

    .btn-primary:active {
        transform: translateY(0);
        box-shadow: 0 1px 4px rgba(120, 184, 51, 0.3);
    }

.btn-secondary {
    background-color: transparent;
    color: var(--on-primary);
    border: 2px solid rgba(255, 255, 255, 0.6);
}

    .btn-secondary:hover {
        background-color: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.9);
    }

/* btn-secondary auf hellem Hintergrund (z.B. filter-section) */
.filter-section .btn-secondary {
    color: var(--tepto-secondary);
    border-color: var(--border);
    background-color: var(--surface);
}

    .filter-section .btn-secondary:hover {
        background-color: var(--background);
        border-color: var(--tepto-primary);
        color: var(--tepto-primary);
    }

.btn-small {
    padding: 8px 16px;
    font-size: 0.75rem;
    min-width: 64px;
    margin: 4px;
}

.btn-create {
    background: var(--gradient-green-v01);
    color: var(--on-primary);
    box-shadow: 0 2px 8px rgba(120, 184, 51, 0.3);
    font-family: 'Poppins', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

    .btn-create:hover {
        background: linear-gradient(330deg, #6aa52e 75%, #487428 0%);
        box-shadow: 0 4px 12px rgba(120, 184, 51, 0.4);
        transform: translateY(-1px);
    }

.btn-view {
    background-color: var(--tepto-info);
    color: var(--on-primary);
    box-shadow: var(--shadow-2dp);
}

    .btn-view:hover {
        background-color: #3d8a8d;
        box-shadow: var(--shadow-4dp);
    }

.btn-edit-delivery {
    background-color: var(--tepto-warning);
    color: var(--on-primary);
    box-shadow: var(--shadow-2dp);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 12px 24px;
}

    .btn-edit-delivery:hover {
        background-color: #d68d00;
        box-shadow: var(--shadow-4dp);
    }

.btn-save-delivery {
    background: var(--gradient-green-v01);
    color: var(--on-primary);
    box-shadow: var(--shadow-2dp);
}

    .btn-save-delivery:hover {
        box-shadow: var(--shadow-4dp);
    }

.btn-cancel-edit {
    background-color: var(--tepto-error);
    color: var(--on-primary);
    box-shadow: var(--shadow-2dp);
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 12px 24px;
}

    .btn-cancel-edit:hover {
        background-color: #a03300;
        box-shadow: var(--shadow-4dp);
    }


/* ============================================================
   TABLE – Data Table
   ============================================================ */

.table-container {
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-2dp);
    border: 1px solid var(--border);
    transition: box-shadow 0.2s ease;
}

    .table-container:hover {
        box-shadow: var(--shadow-4dp);
    }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

thead {
    background-color: var(--tepto-gray-light);
}

th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--tepto-secondary);
    border-bottom: 2px solid var(--border);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease;
}

    tbody tr:hover {
        background-color: rgba(120, 184, 51, 0.04);
    }

    tbody tr:last-child {
        border-bottom: none;
    }

td {
    padding: 14px 16px;
    color: var(--on-surface);
    vertical-align: middle;
}

.fully-delivered {
    background-color: rgba(120, 184, 51, 0.06);
    border-left: 4px solid var(--tepto-primary);
}

.partially-delivered {
    background-color: rgba(237, 158, 0, 0.06);
    border-left: 4px solid var(--tepto-warning);
}

.fully-delivered:hover {
    background-color: rgba(120, 184, 51, 0.10);
}

.partially-delivered:hover {
    background-color: rgba(237, 158, 0, 0.10);
}


/* ============================================================
   QUANTITY / DELIVERY INFO
   ============================================================ */

.quantity-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.open-quantity {
    font-weight: 600;
    color: var(--tepto-warning);
    font-size: 0.875rem;
}

.delivered-quantity {
    color: var(--tepto-success);
    font-weight: 400;
    font-size: 0.75rem;
}

.total-quantity {
    color: var(--text-muted);
    font-size: 0.75rem;
}


/* ============================================================
   ACTIONS COLUMN
   ============================================================ */

.actions-cell {
    min-width: 200px;
}

    .actions-cell .btn-small {
        display: block;
        margin-bottom: 4px;
        width: 100%;
        text-align: center;
    }


/* ============================================================
   MODAL – Dialog
   ============================================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--surface);
    margin: 5% auto;
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 700px;
    box-shadow: var(--shadow-8dp);
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    background: var(--gradient-gray-v04);
    color: var(--on-primary);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

    .modal-header::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 60px;
        height: 3px;
        background: var(--tepto-primary);
    }

    .modal-header h2 {
        font-size: 1.125rem;
        font-weight: 600;
        margin: 0;
        letter-spacing: -0.01em;
        color: var(--on-primary);
    }

.close {
    background: none;
    border: none;
    color: var(--on-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

    .close:hover {
        background-color: rgba(255, 255, 255, 0.15);
    }

.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

#existing-deliveries-modal .modal-body {
    max-height: 80vh;
}


/* ============================================================
   FORMS
   ============================================================ */

.form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

    .form-section:last-of-type {
        border-bottom: none;
    }

    .form-section h3 {
        color: var(--tepto-secondary);
        margin-bottom: 16px;
        font-size: 1.0625rem;
        font-weight: 600;
        letter-spacing: -0.01em;
        position: relative;
        padding-left: 14px;
    }

        .form-section h3::before {
            content: '';
            position: absolute;
            left: 0;
            top: 2px;
            bottom: 2px;
            width: 4px;
            background: var(--tepto-primary);
            border-radius: 2px;
        }

    .form-section h4 {
        color: var(--tepto-secondary);
        margin: 16px 0 12px 0;
        font-size: 0.875rem;
        font-weight: 600;
    }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 16px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
}

    .form-group label {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-muted);
        margin-bottom: 8px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .form-group input,
    .form-group select {
        padding: 14px 12px;
        border: 2px solid var(--border);
        border-radius: var(--radius-sm);
        font-size: 0.875rem;
        font-family: 'Poppins', sans-serif;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
        background-color: var(--surface);
        color: var(--on-surface);
        outline: none;
    }

        .form-group input:focus,
        .form-group select:focus {
            border-color: var(--tepto-primary);
            box-shadow: 0 0 0 3px rgba(120, 184, 51, 0.15);
        }

        .form-group input[readonly] {
            background-color: var(--tepto-gray-light);
            color: var(--text-muted);
        }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}


/* ============================================================
   STATUS BADGES – Chip style
   ============================================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    min-width: 80px;
    justify-content: center;
}

.status-bestellt {
    background-color: rgba(237, 158, 0, 0.12);
    color: #b87a00;
}

.status-bezahlt {
    background-color: rgba(77, 160, 163, 0.12);
    color: #3d8a8d;
}

.status-unterwegs {
    background-color: rgba(120, 184, 51, 0.12);
    color: var(--tepto-green-dark);
}

.status-teilweise-geliefert {
    background-color: rgba(237, 158, 0, 0.12);
    color: #b87a00;
}

.status-storniert {
    background-color: rgba(184, 58, 0, 0.10);
    color: var(--tepto-error);
}

.status-geliefert,
.status-shipped {
    background-color: rgba(120, 184, 51, 0.12);
    color: var(--tepto-green-dark);
}

.status-unbekannt {
    background-color: var(--tepto-gray-light);
    color: #616161;
}

/* Additional status badges for pallet statuses */
.status-created {
    background-color: rgba(77, 160, 163, 0.12);
    color: #3d8a8d;
}

.status-weightchecked {
    background-color: rgba(120, 184, 51, 0.12);
    color: var(--tepto-green-dark);
}

.status-qualitycheckrequired {
    background-color: rgba(237, 158, 0, 0.12);
    color: #b87a00;
}

.status-qualitycheckapproved {
    background-color: rgba(120, 184, 51, 0.12);
    color: var(--tepto-green-dark);
}

.status-qualitycheckrejected {
    background-color: rgba(184, 58, 0, 0.10);
    color: var(--tepto-error);
}

.status-labelprinted {
    background-color: rgba(77, 160, 163, 0.12);
    color: #3d8a8d;
}

.status-ingoodsoutboundzone {
    background-color: rgba(153, 194, 31, 0.15);
    color: var(--tepto-green-darkest);
}

.status-inloadingcheck {
    background-color: rgba(237, 158, 0, 0.12);
    color: #b87a00;
}


/* ============================================================
   NO DATA STATE
   ============================================================ */

.no-data {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-2dp);
    border: 1px solid var(--border);
}

    .no-data p {
        font-size: 0.9375rem;
        margin: 0;
        font-weight: 400;
    }


/* ============================================================
   DELIVERY ITEMS / PALLET CARDS
   ============================================================ */

.delivery-item {
    background: var(--surface);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    border-left: 4px solid var(--tepto-primary);
    box-shadow: var(--shadow-2dp);
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

    .delivery-item:hover {
        box-shadow: var(--shadow-4dp);
        transform: translateY(-1px);
    }

.delivery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.delivery-reference {
    font-weight: 600;
    font-size: 1rem;
    color: var(--tepto-secondary);
    letter-spacing: -0.01em;
}

.delivery-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.delivery-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    font-size: 0.8125rem;
}

.delivery-detail {
    display: flex;
    flex-direction: column;
}

    .delivery-detail strong {
        color: var(--text-muted);
        margin-bottom: 4px;
        font-size: 0.6875rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        font-weight: 600;
    }


/* ============================================================
   DELIVERY SUMMARY
   ============================================================ */

.delivery-summary {
    background: var(--gradient-gray-v04);
    color: var(--on-primary);
    padding: 24px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    box-shadow: var(--shadow-4dp);
    position: relative;
    overflow: hidden;
}

    .delivery-summary::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 60px;
        height: 3px;
        background: var(--tepto-primary);
    }

    .delivery-summary h3 {
        margin-bottom: 16px;
        font-size: 1.125rem;
        font-weight: 600;
        color: var(--on-primary);
        padding-left: 0;
    }

        .delivery-summary h3::before {
            display: none;
        }

.summary-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.summary-item {
    background: rgba(255, 255, 255, 0.08);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

    .summary-item strong {
        display: block;
        margin-bottom: 6px;
        font-size: 0.6875rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        opacity: 0.7;
        font-weight: 600;
    }


/* ============================================================
   MESSAGE POPUPS – Snackbar
   ============================================================ */

.message-popup {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    max-width: 420px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-8dp);
    animation: messageSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.message-success {
    background-color: var(--tepto-primary);
    color: var(--on-primary);
}

.message-error {
    background-color: var(--tepto-error);
    color: var(--on-primary);
}

.message-content {
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.message-text {
    font-weight: 500;
    flex-grow: 1;
    margin-right: 12px;
    font-size: 0.8125rem;
}

.message-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

    .message-close:hover {
        background-color: rgba(255, 255, 255, 0.15);
    }


/* ============================================================
   LOADING POPUP
   ============================================================ */

.loading-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-content {
    background: var(--surface);
    padding: 36px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-8dp);
    min-width: 260px;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border);
    border-top: 3px solid var(--tepto-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 0.875rem;
    color: var(--on-surface);
    font-weight: 400;
    text-align: center;
    line-height: 1.5;
}


/* ============================================================
   LOGIN SCREEN
   ============================================================ */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--gradient-gray-v03);
    position: relative;
}

    .login-container::before {
        content: '';
        position: absolute;
        top: 20%;
        left: 10%;
        width: 400px;
        height: 400px;
        background: radial-gradient(circle, rgba(120, 184, 51, 0.08) 0%, transparent 70%);
        pointer-events: none;
    }

.login-card {
    background: var(--surface);
    padding: 48px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-8dp);
    width: 100%;
    max-width: 420px;
    position: relative;
}

    .login-card header {
        background: var(--gradient-gray-v04);
        margin: -48px -48px 32px -48px;
        padding: 32px 48px;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }

        .login-card header::after {
            display: none;
        }


/* ============================================================
   TAB NAVIGATION
   ============================================================ */

.tab-navigation {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--surface);
    padding: 6px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-2dp);
    border: 1px solid var(--border);
}

.tab-button {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.8125rem;
    transition: all 0.2s ease;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

    .tab-button:hover {
        background: rgba(120, 184, 51, 0.06);
        color: var(--tepto-secondary);
    }

    .tab-button.active {
        background: var(--gradient-green-v01);
        color: var(--on-primary);
        box-shadow: 0 2px 6px rgba(120, 184, 51, 0.3);
    }

.tab-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ============================================================
   ARTICLE CHECKBOX LIST – Pallet creation items
   ============================================================ */

.article-checkbox-list {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    background: var(--tepto-gray-light);
}

.article-checkbox-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 8px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 12px;
}

    .article-checkbox-item:last-child {
        margin-bottom: 0;
    }

    .article-checkbox-item:hover {
        border-color: var(--tepto-primary);
        background: rgba(120, 184, 51, 0.03);
    }

    .article-checkbox-item.selected {
        border-color: var(--tepto-primary);
        background: rgba(120, 184, 51, 0.06);
    }

    .article-checkbox-item input[type="checkbox"] {
        width: 20px;
        height: 20px;
        cursor: pointer;
        accent-color: var(--tepto-primary);
        flex-shrink: 0;
    }

    .article-checkbox-item label {
        flex: 1;
        cursor: pointer;
        font-size: 0.8125rem;
        text-transform: none;
        letter-spacing: normal;
        margin-bottom: 0;
        font-weight: 400;
        color: var(--on-surface);
        line-height: 1.5;
    }

        .article-checkbox-item label strong {
            font-weight: 600;
            color: var(--tepto-secondary);
        }

    .article-checkbox-item input[type="number"] {
        padding: 8px 10px;
        border: 2px solid var(--border);
        border-radius: var(--radius-sm);
        font-size: 0.8125rem;
        font-family: 'Poppins', sans-serif;
        width: 80px;
        text-align: center;
        outline: none;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
        background: var(--surface);
        color: var(--on-surface);
        flex-shrink: 0;
    }

        .article-checkbox-item input[type="number"]:focus {
            border-color: var(--tepto-primary);
            box-shadow: 0 0 0 3px rgba(120, 184, 51, 0.15);
        }

        .article-checkbox-item input[type="number"]:disabled {
            background: var(--tepto-gray-light);
            color: var(--text-muted);
            cursor: not-allowed;
            border-color: var(--border);
        }

    .article-checkbox-item .article-available {
        font-size: 0.75rem;
        color: var(--text-muted);
        margin-left: 8px;
    }


/* ============================================================
   SELECTED ARTICLES QUANTITIES
   ============================================================ */

.selected-articles-quantities {
    margin-top: 16px;
}

.article-quantity-row {
    display: grid;
    grid-template-columns: 1fr 120px 100px;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    background: rgba(120, 184, 51, 0.04);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border-left: 3px solid var(--tepto-primary);
}

    .article-quantity-row .article-info {
        font-size: 0.8125rem;
    }

    .article-quantity-row .article-number {
        font-weight: 600;
        color: var(--tepto-secondary);
    }

    .article-quantity-row .article-desc {
        font-size: 0.75rem;
        color: var(--text-muted);
    }

    .article-quantity-row input {
        padding: 8px 12px;
        border: 2px solid var(--border);
        border-radius: var(--radius-sm);
        font-size: 0.8125rem;
        font-family: 'Poppins', sans-serif;
        outline: none;
    }

        .article-quantity-row input:focus {
            border-color: var(--tepto-primary);
            box-shadow: 0 0 0 3px rgba(120, 184, 51, 0.15);
        }

.no-articles-selected {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}


/* ============================================================
   FULLY DELIVERED / MISSING DATA ARTICLES
   ============================================================ */

.article-checkbox-item.fully-delivered-article {
    background: rgba(120, 184, 51, 0.06);
    border-color: var(--tepto-primary);
    cursor: not-allowed;
    opacity: 0.6;
}

    .article-checkbox-item.fully-delivered-article:hover {
        background: rgba(120, 184, 51, 0.06);
        border-color: var(--tepto-primary);
    }

.article-checkbox-item.missing-data {
    border-color: var(--tepto-warning);
    background: rgba(237, 158, 0, 0.05);
}

    .article-checkbox-item.missing-data:hover {
        border-color: var(--tepto-warning);
        background: rgba(237, 158, 0, 0.08);
    }

    .article-checkbox-item.missing-data.selected {
        border-color: var(--tepto-warning);
        background: rgba(237, 158, 0, 0.10);
    }

.missing-data-warning {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6875rem;
    color: var(--tepto-warning);
    margin-top: 4px;
    flex-wrap: wrap;
}

    .missing-data-warning i {
        font-size: 0.875rem;
    }

.missing-field-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    background: rgba(237, 158, 0, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.625rem;
    font-weight: 600;
    color: #b87a00;
}

.article-dimensions {
    display: flex;
    gap: 8px;
    font-size: 0.625rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.dimension-item {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

    .dimension-item.missing {
        color: var(--tepto-error);
        font-weight: 600;
    }

    .dimension-item.valid {
        color: var(--tepto-success);
    }


/* ============================================================
   MASTER DATA LEGEND
   ============================================================ */

.masterdata-legend {
    display: flex;
    gap: 16px;
    padding: 8px 12px;
    background: var(--tepto-gray-light);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 0.6875rem;
}

.masterdata-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

    .masterdata-legend-item .legend-indicator {
        width: 12px;
        height: 12px;
        border-radius: 2px;
    }

        .masterdata-legend-item .legend-indicator.complete {
            background: var(--tepto-success);
        }

        .masterdata-legend-item .legend-indicator.incomplete {
            background: var(--tepto-warning);
        }

.article-quantity-row.missing-data-row {
    border-left-color: var(--tepto-warning);
    background: rgba(237, 158, 0, 0.05);
}

.no-articles-available {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    gap: 12px;
}

    .no-articles-available p {
        margin: 0;
    }


/* ============================================================
   EDITABLE DELIVERY REFERENCE
   ============================================================ */

.delivery-reference-container {
    display: flex;
    align-items: center;
}

.delivery-reference-edit {
    display: none;
}

.delivery-reference-input {
    padding: 8px 12px;
    border: 2px solid var(--tepto-primary);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    color: var(--tepto-secondary);
    width: 250px;
    transition: border-color 0.2s ease;
    outline: none;
}

    .delivery-reference-input:focus {
        border-color: var(--tepto-green-dark);
        box-shadow: 0 0 0 3px rgba(120, 184, 51, 0.15);
    }

.delivery-status-select,
.estimated-arrival-input,
.actual-arrival-input,
.carrier-input,
.tracking-input {
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-family: 'Poppins', sans-serif;
    width: 100%;
    max-width: 200px;
    transition: border-color 0.2s ease;
    outline: none;
    background-color: var(--surface);
    color: var(--on-surface);
}

    .delivery-status-select:focus,
    .estimated-arrival-input:focus,
    .actual-arrival-input:focus,
    .carrier-input:focus,
    .tracking-input:focus {
        border-color: var(--tepto-primary);
        box-shadow: 0 0 0 3px rgba(120, 184, 51, 0.15);
    }


/* ============================================================
   INLINE ACTION BUTTONS (delivery list)
   ============================================================ */

.btn-delete-delivery-item {
    background-color: var(--tepto-error) !important;
    color: var(--on-primary) !important;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(184, 58, 0, 0.2);
    font-family: 'Poppins', sans-serif;
}

    .btn-delete-delivery-item:hover {
        background-color: #a03300 !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(184, 58, 0, 0.3);
    }

    .btn-delete-delivery-item:active {
        transform: translateY(0);
    }

.btn-save-delivery-item {
    background: var(--gradient-green-v01) !important;
    color: var(--on-primary) !important;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(120, 184, 51, 0.2);
    font-family: 'Poppins', sans-serif;
}

    .btn-save-delivery-item:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(120, 184, 51, 0.3);
    }

.btn-cancel-edit-item {
    background-color: #616161 !important;
    color: var(--on-primary) !important;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(97, 97, 97, 0.2);
    font-family: 'Poppins', sans-serif;
}

    .btn-cancel-edit-item:hover {
        background-color: #4e4e4e !important;
        transform: translateY(-1px);
    }

.btn-edit-delivery-item {
    background-color: var(--tepto-warning) !important;
    color: var(--on-primary) !important;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(237, 158, 0, 0.2);
    font-family: 'Poppins', sans-serif;
}

    .btn-edit-delivery-item:hover {
        background-color: #d68d00 !important;
        transform: translateY(-1px);
    }

    .btn-delete-delivery-item i,
    .btn-save-delivery-item i,
    .btn-cancel-edit-item i,
    .btn-edit-delivery-item i {
        font-size: 0.875rem;
    }


/* ============================================================
   DELETE CONFIRMATION
   ============================================================ */

.delete-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(4px);
}

.delete-confirm-dialog {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-8dp);
    animation: modalSlideIn 0.3s ease;
}

.delete-confirm-title {
    color: var(--tepto-error);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.delete-confirm-message {
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

.delete-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-confirm-delete {
    background-color: var(--tepto-error);
    color: var(--on-primary);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

    .btn-confirm-delete:hover {
        background-color: #a03300;
    }

.btn-cancel-delete {
    background-color: transparent;
    color: var(--text-muted);
    border: 2px solid var(--border);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .btn-cancel-delete:hover {
        background-color: var(--tepto-gray-light);
    }


/* ============================================================
   HEADER ACTIONS
   ============================================================ */

.header-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    justify-content: center;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    header {
        padding: 20px 24px;
        text-align: center;
    }

        header h1 {
            font-size: 1.375rem;
        }

    .filter-section {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .table-container {
        overflow-x: auto;
    }

    table {
        min-width: 800px;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .modal-body {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-actions {
        flex-direction: column;
    }

        .form-actions button {
            width: 100%;
        }

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

    .delivery-details {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .summary-info {
        grid-template-columns: 1fr;
    }

    .message-popup {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }

    .tab-navigation {
        flex-wrap: wrap;
    }

    .tab-button {
        flex: 1 1 auto;
        min-width: 120px;
        padding: 10px 12px;
        font-size: 0.75rem;
    }

    .header-actions {
        flex-direction: column;
        align-items: center;
    }

    .login-card {
        padding: 32px;
    }

        .login-card header {
            margin: -32px -32px 24px -32px;
            padding: 24px 32px;
        }

    .article-checkbox-item {
        flex-wrap: wrap;
    }

        .article-checkbox-item input[type="number"] {
            width: 100%;
            margin-top: 8px;
        }
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }

    th, td {
        padding: 10px 8px;
        font-size: 0.75rem;
    }

    .btn-small {
        padding: 6px 12px;
        font-size: 0.6875rem;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-body {
        padding: 16px;
    }

    .delivery-summary {
        padding: 16px;
    }

    .delivery-item {
        padding: 14px;
    }
}


/* ============================================================
   ANIMATIONS
   ============================================================ */

.fade-in {
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-up {
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--tepto-gray-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 3px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #a0a0a0;
    }


/* ============================================================
   GLOBAL INPUT STYLING (for dynamically created inputs)
   ============================================================ */

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    color: var(--on-surface);
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select {
    padding: 14px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--surface);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    input[type="text"]:focus,
    input[type="number"]:focus,
    input[type="email"]:focus,
    input[type="password"]:focus,
    select:focus {
        border-color: var(--tepto-primary);
        box-shadow: 0 0 0 3px rgba(120, 184, 51, 0.15);
    }

    input[type="text"]:hover,
    input[type="number"]:hover,
    select:hover {
        border-color: var(--border-hover);
    }

/* Style the native select dropdown arrow */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}


/* ============================================================
   GLOBAL BUTTON STYLING (for dynamically created buttons)
   ============================================================ */

button {
    font-family: 'Poppins', sans-serif;
}


/* ============================================================
   SIGNALR – Live-Status-Indikator & Toast-Notifications
   ============================================================ */

/* --- Status-Indikator (unten links, "● Live") --- */
#signalr-status {
    position: fixed;
    bottom: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 6px 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--on-surface);
    box-shadow: var(--shadow-2dp);
    z-index: 1000;
    transition: opacity 0.3s ease;
}

#signalr-status .signalr-dot {
    font-size: 0.85rem;
    line-height: 1;
}

#signalr-status.is-connected    .signalr-dot { color: #4caf50; }
#signalr-status.is-reconnecting .signalr-dot { color: #ff9800; }
#signalr-status.is-disconnected .signalr-dot { color: var(--tepto-error); }

#signalr-status.is-hidden {
    opacity: 0;
    pointer-events: none;
}

/* --- Toast-Notifications (unten links, über dem Status-Chip) --- */
.signalr-toast {
    position: fixed;
    bottom: 56px;
    left: 16px;
    border-radius: var(--radius-md);
    border-width: 1.5px;
    border-style: solid;
    padding: 10px 16px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    box-shadow: var(--shadow-4dp);
    z-index: 1100;
    max-width: 340px;
    cursor: pointer;
    animation: signalrSlideIn 0.25s ease;
    transition: opacity 0.4s ease;
}

.signalr-toast--info {
    background: rgba(77, 160, 163, 0.10);
    border-color: var(--tepto-info);
    color: var(--tepto-info);
}

.signalr-toast--success {
    background: rgba(120, 184, 51, 0.10);
    border-color: var(--tepto-success);
    color: var(--tepto-green-dark);
}

.signalr-toast--warning {
    background: rgba(237, 158, 0, 0.10);
    border-color: var(--tepto-warning);
    color: var(--tepto-warning);
}

.signalr-toast--error {
    background: rgba(184, 58, 0, 0.10);
    border-color: var(--tepto-error);
    color: var(--tepto-error);
}

@keyframes signalrSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
