* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #C41E3A;
    --primary-dark: #A01828;
    --primary-light: #E8C547;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #E8C547;
    --error: #C41E3A;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
}

.container {
    max-width: 1700px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}

/* Navbar */
.navbar {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 0;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--primary);
}

.navbar-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2rem;
    min-height: 80px;
}

.nav-left,
.nav-center,
.nav-right {
    display: flex;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.nav-brand-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary);
}

.nav-center {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: var(--gray-100);
    color: var(--primary);
}

.nav-link i {
    font-size: 0.95rem;
}

.nav-right {
    justify-content: flex-end;
}

.nav-user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.75rem;
    padding-right: 0.75rem;
    margin-right: 0.75rem;
    border-right: 1px solid var(--gray-200);
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.nav-user-info:hover {
    background-color: var(--gray-100);
}

.nav-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
}

.nav-user-details {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.nav-user-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9rem;
    line-height: 1.2;
}

.nav-user-role {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    display: inline-block;
    width: fit-content;
}

.nav-user-role.badge-admin {
    background: var(--primary-light);
    color: #78350f;
}

.nav-user-role.badge-staff {
    background: #dbeafe;
    color: #1e40af;
}

.nav-logout {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-logout:hover {
    background-color: var(--gray-100);
    color: var(--primary);
}

.nav-logout i {
    font-size: 1rem;
}

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

.login-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.login-box h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.login-box h2 {
    text-align: center;
    color: var(--gray-700);
    margin-bottom: 2rem;
    font-size: 1.25rem;
    font-weight: 500;
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--gray-700);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
}

.badge-admin {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-staff {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-pending {
    background-color: var(--gray-200);
    color: var(--gray-700);
}

.badge-processing {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-parsed {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-failed {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-manual_review {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-completed {
    background-color: #d1fae5;
    color: #065f46;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 1.875rem;
    color: var(--gray-900);
}

/* Filters */
.filters {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filter-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.filter-form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1.5fr;
    gap: 1rem;
    align-items: end;
}

.filter-form-grid .form-control,
.filter-form-grid .btn {
    height: 46px;
    box-sizing: border-box;
}

.filter-form-grid .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1200px) {
    .filter-form-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .filter-form-grid {
        grid-template-columns: 1fr;
    }
}

/* Table */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: visible;
    margin-bottom: 1.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background-color: var(--gray-50);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
}

.data-table tbody tr:hover {
    background-color: var(--gray-50);
}

.text-truncate {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--gray-600);
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    background-color: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.25rem;
    color: var(--gray-900);
}

.card-body {
    padding: 1.5rem;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.info-item label {
    display: block;
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.info-item div {
    color: var(--gray-900);
}

/* Logs */
.logs {
    max-height: 400px;
    overflow-y: auto;
}

.log-entry {
    padding: 0.75rem;
    border-left: 3px solid;
    margin-bottom: 0.5rem;
    background-color: var(--gray-50);
    border-radius: 4px;
}

.log-entry.log-info {
    border-left-color: var(--primary);
}

.log-entry.log-warning {
    border-left-color: var(--warning);
    background-color: #fef3c7;
}

.log-entry.log-error {
    border-left-color: var(--error);
    background-color: #fee2e2;
}

.log-time {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-right: 0.5rem;
}

.log-level {
    font-weight: 600;
    font-size: 0.75rem;
    margin-right: 0.5rem;
}

.log-message {
    color: var(--gray-800);
}

/* Line Items */
.line-item-row {
    display: grid;
    grid-template-columns: 1fr 100px 2fr;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.line-item-row textarea {
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* Pagination */
.pagination {
    padding: 1rem;
    text-align: center;
    color: var(--gray-600);
}

/* Footer */
footer {
    margin-top: 4rem;
    padding: 2rem 0;
    text-align: center;
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: white;
    margin: 2rem auto;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.2s ease-out;
}

.modal-large {
    max-width: 700px;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--gray-200);
    background: linear-gradient(to bottom, white, var(--gray-50));
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header h3 i {
    color: var(--primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.modal-content form > div:not(.modal-footer):not(.modal-header) {
    flex: 1;
}

.close {
    color: var(--gray-600);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    background: none;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.close:hover,
.close:focus {
    background: var(--gray-200);
    color: var(--gray-900);
}

/* Modal Grid Layout */
.modal-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.modal-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.modal-avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-form-section {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    transition: .3s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider:hover {
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

/* Profile Avatar */
.profile-avatar-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 0 auto;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-large i {
    font-size: 5rem;
}

/* Table improvements */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background-color: var(--gray-50);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    border-bottom: 1px solid var(--gray-200);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.table tbody tr:hover {
    background-color: var(--gray-50);
}

/* Button variations */
.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

.btn-danger {
    background-color: var(--error);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    color: var(--gray-900);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-error {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .filter-form {
        flex-direction: column;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .line-item-row {
        grid-template-columns: 1fr;
    }
}

/* Order detail page specific styles */
.order-detail .container {
    max-width: none !important;
    padding: 0 1.5rem !important;
}

/* SweetAlert Custom Styles */
.email-poll-popup {
    border-radius: 12px !important;
    padding: 0 !important;
}

.email-poll-title {
    font-size: 1.5rem !important;
    padding: 1.5rem 1.5rem 1rem !important;
}

.swal2-html-container {
    padding: 0 1.5rem 1.5rem !important;
    margin: 0 !important;
}

.swal2-confirm {
    padding: 0.625rem 1.5rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
}


.response-mail-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.btn-send-response {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border: 1px solid #2563eb;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-send-response:hover:not(:disabled) {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.btn-send-response:disabled {
    background: #e5e7eb;
    border-color: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

.response-mail-hint {
    font-size: 0.75rem;
    color: #6b7280;
}

.am-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    padding-top: 0.75rem;
    margin-top: 0.25rem;
}

.am-checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
}

.am-checkbox-row label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.am-checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.btn-anlegen {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 1px 8px;
    border: 1px solid #dc2626;
    border-radius: 4px;
    background: #fff;
    color: #dc2626;
    cursor: pointer;
    white-space: nowrap;
    margin-left: 0.35rem;
}

.btn-anlegen:hover {
    background: #dc2626;
    color: #fff;
}

.btn-parken,
.btn-freigeben {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    white-space: nowrap;
    margin-left: 0.35rem;
}

.btn-parken {
    border: 1px solid #d97706;
    color: #d97706;
}

.btn-parken:hover {
    background: #d97706;
    color: #fff;
}

.btn-freigeben {
    border: 1px solid #059669;
    color: #059669;
}

.btn-freigeben:hover {
    background: #059669;
    color: #fff;
}

.problem-report-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.problem-report-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.problem-report-hint {
    font-size: 0.78rem;
    color: #6b7280;
}

.problem-table .problem-col-action {
    text-align: right;
    white-space: nowrap;
}

.ladestellen-block {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    border-radius: 6px;
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.75rem;
}

.ladestellen-titel {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 0.5rem;
}

.ladestellen-tabelle {
    font-size: 0.82rem;
    width: 100%;
    background: #fff;
}

.ladestellen-hinweis {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.4rem;
}

.hinweis-fremdlager,
.hinweis-ohne-lagerort {
    border-radius: 6px;
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.75rem;
    font-size: 0.82rem;
}

.hinweis-fremdlager {
    background: #f5f3ff;
    border: 1px solid #c4b5fd;
    color: #5b21b6;
}

.hinweis-ohne-lagerort {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.hinweis-liste {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.hinweis-liste code {
    background: rgba(255, 255, 255, 0.7);
    padding: 1px 5px;
    border-radius: 3px;
}

.pallet-section {
    margin-bottom: 0.75rem;
}

.pallet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.pallet-titel {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f2937;
}

.pallet-stats {
    font-size: 0.82rem;
    color: #6b7280;
}

.pallet-tabs,
.pallet-layers {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.pallet-layer-btn {
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    cursor: pointer;
}

.pallet-layer-btn.active {
    background: #b08968;
    border-color: #b08968;
    color: #fff;
}

.pallet-body {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.pallet-canvas {
    flex: 1 1 0;
    min-width: 320px;
}

.pallet-side {
    flex: 0 0 260px;
    min-width: 180px;
}

.pallet-side-titel {
    font-size: 0.78rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4rem;
}

.pallet-legend {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 340px;
    overflow-y: auto;
}

.pallet-legend-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.78rem;
    color: #374151;
}

.pallet-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
    border: 2px solid rgba(0, 0, 0, 0.3);
    margin-top: 2px;
}

.pallet-legend-desc {
    color: #6b7280;
    font-size: 0.72rem;
}

.pallet-hinweis {
    margin-top: 1rem;
    font-size: 0.72rem;
    color: #9ca3af;
    line-height: 1.6;
}

.viz-section {
    margin-bottom: 0.75rem;
}

.viz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.viz-titel {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f2937;
}

.viz-stats {
    font-size: 0.82rem;
    color: #6b7280;
}

.viz-ok {
    color: #10b981;
    font-weight: 700;
}

.viz-overload {
    color: #dc2626;
    font-weight: 700;
}

.viz-tabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.viz-tab-btn {
    padding: 0.25rem 0.65rem;
    font-size: 0.8rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    color: #374151;
    transition: background 0.15s;
}

.viz-tab-btn.active {
    background: #1f2937;
    color: #fff;
    border-color: #1f2937;
}

.viz-tab-btn:hover:not(.active) {
    background: #f3f4f6;
}

.viz-body {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.viz-canvas {
    flex: 1 1 0;
    min-width: 320px;
}

.viz-side {
    flex: 0 0 280px;
    min-width: 180px;
}

.viz-side-titel {
    font-size: 0.78rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4rem;
}

.viz-legend {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 380px;
    overflow-y: auto;
}

.viz-legend-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.78rem;
    color: #374151;
}

.viz-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
    border: 2px solid rgba(0, 0, 0, 0.3);
    margin-top: 2px;
}

.viz-legend-artikel {
    margin-top: 2px;
    font-size: 0.71rem;
    line-height: 1.5;
}

.viz-legend-art {
    color: #374151;
    font-weight: 600;
}

.viz-legend-desc {
    color: #6b7280;
}

.viz-legend-stapel {
    color: #059669;
    font-size: 0.71rem;
}

.viz-legend-zubehoer {
    color: #b08968;
    font-size: 0.71rem;
    font-weight: 600;
}

.viz-hinweis-fuss {
    margin-top: 1rem;
    font-size: 0.72rem;
    color: #9ca3af;
    line-height: 1.6;
}

.viz-hinweis {
    padding: 1.5rem;
    color: #6b7280;
    font-size: 0.88rem;
}

body.seite-auftragsdetail main.container {
    max-width: 1800px;
    padding: 0 24px;
}

.viz-canvas,
.pallet-canvas {
    position: relative;
}

.viz-tooltip {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    background: rgba(17, 24, 39, 0.92);
    color: #fff;
    font-size: 0.74rem;
    line-height: 1.45;
    padding: 0.35rem 0.55rem;
    border-radius: 5px;
    max-width: 260px;
}

.pallet-select {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
}
