/* ============================================
   Component Styles

   Contains all reusable UI component styling:
   - Dashboard stats cards & workflow visualization
   - Item lists & cards (Anfragen, Angebote, Aufträge, Rechnungen)
   - Button styles (primary, secondary, success, danger, AI, small)
   - Modal system (overlay, content, header, close, footer)
   - Form elements (inputs, selects, textareas, validation)
   - Badges & status indicators
   - Toast notifications
   - Settings cards & views
   - Material view (inventory management)
   - Dunning management (Mahnwesen)
   - Responsive adjustments for tablet & mobile

   Cleanup Notes:
   - Removed duplicate button styles (moved to single definition)
   - Consolidated form styling with consistent focus states
   - Used CSS variables for all colors
   - Unified modal styling across all modals
   - Removed hardcoded color values in favor of var() references

   ============================================ */

/* ============================================
   Utility Classes (extracted from inline styles)
   ============================================ */

/* Hidden file inputs */
.u-file-input-hidden {
    display: none;
}

/* Empty state centered text */
.empty-state-centered {
    padding: 20px;
    text-align: center;
}

/* Action button row (flex with gap) */
.action-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

/* Section heading with spacing */
.section-heading-spaced {
    margin: 24px 0 16px;
}

/* Automation status list item */
.automation-status-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.automation-status-item:last-child {
    border-bottom: none;
}

/* User info panel in sidebar */
.user-info-panel .user-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.user-info-panel .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.user-info-panel .user-details {
    flex: 1;
    min-width: 0;
}

.user-info-panel .user-email {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info-panel .user-company {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Info text secondary (small muted text) */
.text-secondary-sm {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Compact form group for inline date inputs */
.form-group-compact {
    margin: 0;
    flex: 1;
}

.form-group-compact label {
    font-size: 11px;
}

.form-group-compact input {
    font-size: 12px;
}

/* Auftrag search input */
.auftrag-search-input {
    margin-left: auto;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    width: 200px;
    max-width: 100%;
}

.auftrag-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Horizontal rule separator */
.hr-separator {
    margin: 24px 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

/* PO detail table styles */
.po-detail-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.po-detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    min-width: 500px;
}

.po-detail-table th,
.po-detail-table td {
    text-align: left;
    padding: 10px 8px;
}

.po-detail-table th.text-right,
.po-detail-table td.text-right {
    text-align: right;
}

.po-detail-table tr.table-header {
    border-bottom: 2px solid var(--border-color);
}

/* Card section (used in PO detail, supplier info) */
.card-section {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
}

.card-section h3 {
    margin-top: 0;
}

.card-section p {
    margin: 4px 0;
}

/* Summary row with top border */
.summary-row-bold {
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    margin-top: 8px;
    font-weight: bold;
}

/* Small note text */
.text-note {
    font-size: 11px;
    margin-top: 10px;
    opacity: 0.6;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 32px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    background: rgba(99, 102, 241, 0.1);
}

.stat-anfragen .stat-icon {
    background: rgba(59, 130, 246, 0.15);
}

.stat-angebote .stat-icon {
    background: rgba(245, 158, 11, 0.15);
}

.stat-auftraege .stat-icon {
    background: rgba(99, 102, 241, 0.15);
}

.stat-rechnungen .stat-icon {
    background: rgba(34, 197, 94, 0.15);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

/* Workflow Visual */
.workflow-visual {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 32px;
    border: 1px solid var(--border-color);
    margin-bottom: 40px;
}

.workflow-visual h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.workflow-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow-x: auto;
    padding: 8px 0;
}

.workflow-step {
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-hover), var(--bg-card));
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: var(--transition);
}

.workflow-step:hover .step-icon {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.step-label {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.step-arrow {
    font-size: 24px;
    color: var(--text-muted);
    margin: 0 8px;
}

/* Activity List */
.recent-activity {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.recent-activity h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.activity-icon {
    font-size: 20px;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    font-size: 14px;
}

.activity-time {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
    font-style: italic;
}

/* ============================================
   Items List (Anfragen, Angebote, etc.)
   ============================================ */

.items-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.item-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.item-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.item-title {
    font-size: 18px;
    font-weight: 600;
}

.item-id {
    color: var(--text-muted);
    font-size: 12px;
    font-family: monospace;
    background: var(--bg-dark);
    padding: 4px 8px;
    border-radius: 4px;
}

.item-meta {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.item-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.item-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.item-actions {
    display: flex;
    gap: 12px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.status-neu {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-info);
}

.status-badge.status-offen {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-warning);
}

.status-badge.status-aktiv {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
}

.status-badge.status-bezahlt {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-success);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-info));
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-input);
    border-color: var(--text-muted);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-success), #16a34a);
    color: white;
}

.btn-success:hover {
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
}

.btn-small,
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-ai {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    padding: 8px 16px;
}

.btn-ai:hover {
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

/* ============================================
   Modals
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s ease;
}

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

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-form {
    padding: 24px;
}

/* ============================================
   Forms
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

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

label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

select {
    cursor: pointer;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

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

/* AI Suggestion */
.ai-suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ai-hint {
    color: var(--text-muted);
    font-size: 12px;
}

/* Angebot specific */
.angebot-header-info {
    background: var(--bg-dark);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
}

.positionen-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.position-row {
    display: grid;
    grid-template-columns: 2fr 80px 100px 100px 40px;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
}

.position-row input {
    padding: 8px 12px;
}

.position-remove {
    background: none;
    border: none;
    color: var(--accent-danger);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    opacity: 0.7;
    transition: var(--transition-fast);
}

.position-remove:hover {
    opacity: 1;
}

.angebot-summary {
    background: var(--bg-dark);
    padding: 20px;
    border-radius: var(--border-radius-sm);
    margin-top: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    color: var(--text-secondary);
}

.summary-row.total {
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
    padding-top: 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Rechnung Preview */
.rechnung-preview {
    padding: 32px;
    background: white;
    color: #1a1a1a;
    margin: 24px;
    border-radius: var(--border-radius-sm);
}

.rechnung-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e5e5;
}

.rechnung-firma {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

.rechnung-nummer {
    text-align: right;
}

.rechnung-nummer h3 {
    color: var(--accent-primary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rechnung-nummer p {
    font-size: 20px;
    font-weight: 600;
}

.rechnung-adressen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.rechnung-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.rechnung-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.rechnung-table th {
    background: #f5f5f5;
    padding: 12px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
}

.rechnung-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e5e5;
}

.rechnung-table .text-right {
    text-align: right;
}

.rechnung-totals {
    display: flex;
    justify-content: flex-end;
}

.rechnung-totals table {
    width: 280px;
}

.rechnung-totals td {
    padding: 8px 0;
}

.rechnung-totals .total-row {
    font-size: 18px;
    font-weight: 700;
    border-top: 2px solid #1a1a1a;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }

    .logo span,
    .nav-item span:not(.nav-icon),
    .badge {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: 16px;
    }

    .btn-new-anfrage span:last-child {
        display: none;
    }

    .main-content {
        margin-left: 80px;
    }
}

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

    .modal-content {
        margin: 16px;
        max-height: calc(100vh - 32px);
    }

    .position-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .position-row input,
    .position-row select {
        min-height: 44px;
        font-size: 16px;
    }

    .position-remove {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .workflow-steps {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .step-arrow {
        transform: rotate(90deg);
        margin: 8px 0;
    }
}

/* ============================================
   Nav Divider
   ============================================ */

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 0;
}

/* ============================================
   Material View
   ============================================ */

.view-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.material-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.stat-mini {
    background: var(--bg-card);
    padding: 16px 24px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.stat-mini span:first-child {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-primary);
}

.stat-mini span:last-child {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-mini.stat-warning span:first-child {
    color: var(--accent-warning);
}

.material-filter {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.material-filter input {
    flex: 1;
    max-width: 400px;
}

.material-filter select {
    width: 200px;
}

.material-card {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto;
    gap: 16px;
    align-items: center;
}

.material-info {
    display: flex;
    flex-direction: column;
}

.material-name {
    font-weight: 600;
    font-size: 15px;
}

.material-sku {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
}

.material-kategorie {
    font-size: 12px;
    padding: 4px 10px;
    background: var(--bg-dark);
    border-radius: 12px;
    color: var(--text-secondary);
}

.material-preis {
    text-align: right;
}

.material-preis .vk {
    font-weight: 600;
    font-size: 16px;
    color: var(--accent-success);
}

.material-preis .ek {
    font-size: 12px;
    color: var(--text-muted);
}

.material-bestand {
    text-align: center;
    min-width: 80px;
}

.material-bestand .count {
    font-weight: 600;
    font-size: 18px;
}

.material-bestand .unit {
    font-size: 11px;
    color: var(--text-muted);
}

.material-bestand.low .count {
    color: var(--accent-danger);
}

/* ============================================
   Settings View
   ============================================ */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.settings-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.settings-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.settings-card>p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 20px;
}

.settings-card .form-group {
    margin-bottom: 16px;
}

.settings-card small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 11px;
}

.settings-card small a {
    color: var(--accent-primary);
}

.settings-card .btn {
    margin-right: 12px;
    margin-top: 8px;
}

.status-indicator {
    display: inline-block;
    font-size: 12px;
    margin-top: 12px;
    color: var(--text-muted);
}

.status-indicator.connected {
    color: var(--accent-success);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-danger), #dc2626);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 16px 24px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-color: var(--accent-success);
}

.toast.error {
    border-color: var(--accent-danger);
}

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

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

/* ============================================
   Mahnwesen
   ============================================ */

.dunning-overview {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.escalation-timeline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.escalation-step {
    flex: 1;
    min-width: 100px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    text-align: center;
    position: relative;
}

.escalation-step::after {
    content: '→';
    position: absolute;
    right: -16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.escalation-step:last-child::after {
    display: none;
}

.escalation-step.warning {
    border-color: var(--accent-warning);
    background: rgba(245, 158, 11, 0.1);
}

.escalation-step.danger {
    border-color: var(--accent-danger);
    background: rgba(239, 68, 68, 0.1);
}

.step-day {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.step-name {
    font-size: 13px;
    font-weight: 600;
}

.badge-warning {
    background: var(--accent-warning) !important;
}

.btn-warning {
    background: linear-gradient(135deg, var(--accent-warning), #d97706);
    color: white;
}

.btn-warning:hover {
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}

.dunning-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dunning-card.overdue {
    border-color: var(--accent-warning);
}

.dunning-card.critical {
    border-color: var(--accent-danger);
}

.dunning-info {
    flex: 1;
}

.dunning-kunde {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.dunning-status {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.mahnung-preview {
    padding: 32px;
    background: white;
    color: #333;
    border-radius: var(--border-radius-sm);
    margin: 24px;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
}

/* ============================================
   Buchhaltung / EÜR
   ============================================ */

.eur-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.eur-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.eur-card h3 {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 12px;
}

.eur-amount {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.eur-card.einnahmen .eur-amount {
    color: var(--accent-success);
}

.eur-card.ausgaben .eur-amount {
    color: var(--accent-danger);
}

.eur-card.gewinn .eur-amount {
    color: var(--accent-primary);
}

.eur-detail {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.eur-detail span {
    display: flex;
    gap: 4px;
}

.buchhaltung-actions {
    margin-bottom: 24px;
}

.buchung-item {
    display: grid;
    grid-template-columns: 80px 1fr 100px 120px;
    gap: 16px;
    align-items: center;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.buchung-datum {
    font-size: 13px;
    color: var(--text-muted);
}

.buchung-beschreibung {
    font-weight: 500;
}

.buchung-beschreibung small {
    display: block;
    color: var(--text-muted);
    font-weight: 400;
    font-size: 11px;
}

.buchung-kategorie {
    font-size: 11px;
    padding: 4px 8px;
    background: var(--bg-dark);
    border-radius: 10px;
    color: var(--text-secondary);
    text-align: center;
}

.buchung-betrag {
    text-align: right;
    font-weight: 600;
}

.buchung-betrag.einnahme {
    color: var(--accent-success);
}

.buchung-betrag.ausgabe {
    color: var(--accent-danger);
}

/* KI Stunden-Schätzung */
.ai-estimation {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(99, 102, 241, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    margin-top: 16px;
}

.ai-estimation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 600;
}

.ai-estimation-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.ai-estimation-details {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============================================
   Quick Actions
   ============================================ */

.quick-actions {
    margin-bottom: 24px;
}

.quick-actions h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(99, 102, 241, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.quick-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
    border-color: var(--accent-primary);
}

.qa-icon {
    font-size: 24px;
}

.qa-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.qa-shortcut {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 10px;
    padding: 2px 6px;
    background: var(--bg-dark);
    border-radius: 4px;
    color: var(--text-muted);
    font-family: monospace;
}

/* ============================================
   External Links
   ============================================ */

.external-links {
    margin-bottom: 24px;
}

.external-links h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.links-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ext-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}

.ext-link:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-1px);
}

.ext-icon {
    font-size: 16px;
}

/* ============================================
   Clickable Stat Cards
   ============================================ */

.stat-card.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.stat-card.clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Keyboard Shortcuts Help
   ============================================ */

.keyboard-help {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 12px 16px;
    font-size: 12px;
    color: var(--text-muted);
    z-index: 100;
}

.keyboard-help kbd {
    display: inline-block;
    padding: 2px 6px;
    background: var(--bg-dark);
    border-radius: 4px;
    font-family: monospace;
    margin-right: 4px;
}

/* ============================================
   Auto-suggest Dropdown
   ============================================ */

.suggest-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.suggest-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s ease;
}

.suggest-item:last-child {
    border-bottom: none;
}

.suggest-item:hover {
    background: rgba(139, 92, 246, 0.1);
}

.suggest-item-name {
    font-weight: 500;
}

.suggest-item-detail {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================
   Customer Presets & Autocomplete
   ============================================ */

.preset-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.preset-select {
    flex: 1;
    min-width: 200px;
}

.hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-style: italic;
}

.position-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Position with autocomplete wrapper */
.position-row {
    position: relative;
}

.pos-beschreibung-wrapper {
    position: relative;
    flex: 1;
}

.material-suggest {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--accent-primary);
    border-radius: var(--border-radius-sm);
    max-height: 180px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.material-suggest-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s ease;
}

.material-suggest-item:last-child {
    border-bottom: none;
}

.material-suggest-item:hover {
    background: rgba(139, 92, 246, 0.15);
}

.material-suggest-name {
    font-weight: 500;
    font-size: 13px;
}

.material-suggest-meta {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.material-suggest-meta .price {
    color: var(--accent-success);
    font-weight: 600;
}

.material-suggest-meta .stock {
    color: var(--text-secondary);
}

/* Material picker modal */
.material-picker-list {
    max-height: 400px;
    overflow-y: auto;
}

.material-picker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.material-picker-item:hover {
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.1);
}

.material-picker-item.selected {
    border-color: var(--accent-success);
    background: rgba(16, 185, 129, 0.1);
}

.material-picker-check {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.material-picker-item.selected .material-picker-check {
    background: var(--accent-success);
    border-color: var(--accent-success);
    color: white;
}

/* ============================================
   Follow-up & Low Stock Lists
   ============================================ */

.followup-list,
.lowstock-list {
    max-height: 400px;
    overflow-y: auto;
}

.followup-item,
.lowstock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
    background: var(--bg-card);
}

.followup-info,
.lowstock-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.followup-meta,
.lowstock-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.stock-critical {
    color: var(--accent-danger);
    font-weight: 600;
}

.lowstock-item {
    border-color: var(--accent-warning);
}

.followup-item:hover,
.lowstock-item:hover {
    border-color: var(--accent-primary);
}

/* ============================================
   Kanban Board (Tasks)
   ============================================ */

.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    min-height: 400px;
}

.kanban-column {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 16px;
    min-height: 300px;
}

.kanban-column h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.kanban-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kanban-task {
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-fast);
}

.kanban-task:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.kanban-task-title {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 8px;
}

.kanban-task-meta {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.kanban-task-priority {
    font-size: 12px;
}

.task-stats,
.customer-stats,
.email-stats,
.document-stats,
.time-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

/* ============================================
   Calendar Week View
   ============================================ */

.calendar-header {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.calendar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}

.calendar-day {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 16px;
    min-height: 200px;
}

.calendar-day.is-today {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-primary);
}

.calendar-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.calendar-day-name {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.calendar-day-number {
    font-size: 18px;
    font-weight: 600;
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calendar-event {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    background: rgba(99, 102, 241, 0.2);
    border-left: 3px solid var(--accent-primary);
}

/* ============================================
   Time Clock Display
   ============================================ */

.time-clock-display {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-hover));
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 40px;
    text-align: center;
    margin-bottom: 24px;
}

.clock-status {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.clock-timer {
    font-size: 48px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--accent-primary);
}

.time-clock-display.active .clock-status {
    color: var(--accent-success);
}

.time-clock-display.active .clock-timer {
    color: var(--accent-success);
}

/* ============================================
   Email List
   ============================================ */

.email-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.email-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-fast);
}

.email-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.email-item.unread {
    background: rgba(99, 102, 241, 0.05);
    border-color: var(--accent-primary);
}

.email-item.unread .email-sender {
    font-weight: 600;
}

.email-category-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    border-radius: 50%;
}

.email-content {
    flex: 1;
    min-width: 0;
}

.email-sender {
    font-size: 14px;
    margin-bottom: 4px;
}

.email-subject {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-preview {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-meta {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
}

.email-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* ============================================
   Document Grid
   ============================================ */

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

.document-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.document-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.document-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.document-name {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 8px;
    word-break: break-word;
}

.document-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.document-filter,
.customer-filter {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.document-filter input,
.customer-filter input {
    flex: 1;
}

.document-filter select {
    width: 200px;
}

/* ============================================
   Customer Grid
   ============================================ */

.customer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.customer-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 20px;
    transition: var(--transition-fast);
}

.customer-card:hover {
    border-color: var(--accent-primary);
}

.customer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-info));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: white;
    margin-bottom: 12px;
}

.customer-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.customer-company {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.customer-contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
}

.customer-contact a {
    color: var(--accent-primary);
    text-decoration: none;
}

.customer-stats-inline {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
}

/* ============================================
   Reports
   ============================================ */

.report-types {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.report-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px 32px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 140px;
}

.report-card:hover,
.report-card:focus-visible,
.report-card.active {
    border-color: var(--accent-primary);
    background: var(--accent-primary-alpha);
    outline: none;
}

.report-icon {
    font-size: 32px;
}

.report-name {
    font-size: 14px;
    font-weight: 500;
}

.report-filters {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.report-filters .form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.report-output {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    min-height: 200px;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.report-stat {
    background: var(--bg-dark);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    text-align: center;
}

.report-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-primary);
}

.report-stat-label {
    font-size: 12px;
}

/* ============================================
   Excel Import Wizard
   ============================================ */

.wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
    padding: 0 20px;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    flex: 1;
}

.wizard-step::after {
    content: '';
    position: absolute;
    top: 18px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border-color);
    z-index: -1;
}

.wizard-step:last-child::after {
    display: none;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.wizard-step.active .step-number {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.wizard-step.completed .step-number {
    background: var(--color-success);
    border-color: var(--color-success);
    color: white;
}

.wizard-step.completed .step-number::before {
    content: '✓';
}

.step-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

.wizard-step.active .step-label {
    color: var(--text-primary);
    font-weight: 600;
}

.wizard-content {
    min-height: 400px;
    margin-bottom: 24px;
}

.wizard-step-content {
    padding: 0 20px;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-dark);
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.info-card {
    background: var(--bg-dark);
    border-radius: var(--border-radius);
    padding: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

/* Mapping Table */
.mapping-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin: 20px 0;
}

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

.mapping-table thead {
    position: sticky;
    top: 0;
    background: var(--bg-dark);
    z-index: 10;
}

.mapping-table th {
    padding: 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.mapping-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.sample-data {
    color: var(--text-secondary);
    font-size: 12px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mapping-select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
}

.mapping-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.mapping-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

/* Validation Results */
.validation-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.error-list,
.warning-list {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-dark);
    border-radius: var(--border-radius);
}

.error-list {
    border-left: 4px solid var(--color-error);
}

.warning-list {
    border-left: 4px solid var(--color-warning);
}

.error-item,
.warning-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.error-item:last-child,
.warning-item:last-child {
    border-bottom: none;
}

.error-item ul,
.warning-item ul {
    margin: 8px 0 0 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.more-errors {
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 13px;
}

.options-panel {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-dark);
    border-radius: var(--border-radius);
}

.options-panel h4 {
    margin-bottom: 12px;
    font-size: 14px;
}

.options-panel label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    cursor: pointer;
}

/* Import Progress */
.import-progress {
    margin: 40px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.import-summary {
    text-align: center;
    padding: 40px 20px;
}

.summary-icon {
    font-size: 64px;
    color: var(--color-success);
    margin-bottom: 16px;
}

.import-summary h3 {
    margin-bottom: 24px;
    font-size: 20px;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: capitalize;
}

.report-chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 24px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.report-table th,
.report-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.report-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
}

.report-table .text-right {
    text-align: right;
}

/* ============================================
   Stat Mini (reusable)
   ============================================ */

.stat-mini {
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    padding: 16px 24px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-mini span:first-child {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-mini span:last-child {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-mini.stat-warning span:first-child {
    color: var(--accent-warning);
}

.stat-mini.stat-success span:first-child {
    color: var(--accent-success);
}

/* ============================================
   Responsive Navigation Scroll
   ============================================ */

.nav-menu {
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* .btn-large defined in Onboarding Wizard section below */

/* Badge warning */
.badge-warning {
    background: var(--accent-warning);
}

.badge-success {
    background: var(--accent-success);
}

/* ============================================
   Chatbot Interface
   ============================================ */

.chatbot-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.chatbot-status {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.chatbot-status.active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-success);
    border-color: var(--accent-success);
}

.chatbot-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    height: 600px;
}

/* Conversations Sidebar */
.chatbot-sidebar {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-sidebar-header h3 {
    font-size: 14px;
    font-weight: 600;
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.conversation-item {
    padding: 12px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    margin-bottom: 4px;
}

.conversation-item:hover,
.conversation-item:focus-visible {
    background: var(--bg-hover);
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
}

.conversation-item.active {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.conversation-name {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
}

.conversation-preview {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Chat Main Area */
.chatbot-main {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-dark);
}

.chat-contact {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366, #128C7E);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chat-contact-name {
    font-weight: 600;
    font-size: 14px;
}

.chat-contact-phone {
    font-size: 12px;
    color: var(--text-muted);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(135deg, var(--bg-dark), var(--bg-card));
}

.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
}

.chat-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.chat-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    position: relative;
    animation: messageIn 0.2s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.chat-message.user {
    background: #25D366;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-message.bot {
    background: var(--bg-hover);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-message-content {
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.chat-message-time {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.7;
    text-align: right;
}

/* Chat Input */
.chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-dark);
}

.quick-replies {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.quick-reply-btn {
    padding: 6px 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.quick-reply-btn:hover,
.quick-reply-btn:focus-visible {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    outline: none;
}

.chat-input-row {
    display: flex;
    gap: 12px;
}

.chat-input-row input {
    flex: 1;
}

.chat-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
}

/* Chatbot Settings Panel */
.chatbot-settings-panel {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-top: 24px;
}

.chatbot-settings-panel h3 {
    margin-bottom: 16px;
    font-size: 16px;
}

.settings-grid-inline {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.settings-grid-inline .form-group {
    margin-bottom: 0;
}

.settings-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 16px;
    padding: 12px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: var(--border-radius-sm);
    border-left: 3px solid var(--accent-warning);
}

.empty-state-small {
    color: var(--text-muted);
    text-align: center;
    padding: 24px;
    font-size: 13px;
}

/* Chatbot responsive */
@media (max-width: 768px) {
    .chatbot-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .chatbot-sidebar {
        max-height: 200px;
        overflow-y: auto;
    }

    .chatbot-main {
        min-height: 400px;
    }
}

/* ============================================
   New Feature Panels (Workflows, Scanner, Backup)
   ============================================ */

/* Mini Stat Cards */
.workflow-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card-mini {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border-color);
}

.stat-icon-mini {
    font-size: 28px;
}

.stat-content-mini {
    display: flex;
    flex-direction: column;
}

.stat-value-mini {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label-mini {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Panel Styles */
.panel {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 24px;
    margin-bottom: 24px;
}

.panel h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.panel-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.panel-header-row h3 {
    margin: 0;
}

/* Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.template-card {
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-fast);
}

.template-card:hover,
.template-card:focus-visible {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    outline: none;
}

.template-card h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.template-card p {
    font-size: 12px;
    color: var(--text-muted);
}

/* workflows List */
.workflows-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.workflow-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.workflow-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.workflow-item-info h4 {
    font-size: 14px;
    font-weight: 500;
}

.workflow-item-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.workflow-item-actions {
    display: flex;
    gap: 8px;
}

/* Execution Log */
.execution-log {
    max-height: 300px;
    overflow-y: auto;
}

.log-entry {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: var(--text-muted);
    font-family: monospace;
    font-size: 11px;
    white-space: nowrap;
}

.log-type {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.log-type.start {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-info);
}

.log-type.action {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-primary);
}

.log-type.complete {
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-success);
}

.log-type.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
}

.log-type.skip {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-warning);
}

/* Scanner Styles */
.scanner-camera-panel {
    text-align: center;
}

.scanner-camera-panel video {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--border-radius-sm);
    background: #000;
}

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

.scanned-docs-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.scanned-doc-card {
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    border: 1px solid var(--border-color);
}

.scanned-doc-card .doc-preview {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
    background: var(--bg-card);
}

.scanned-doc-card h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.scanned-doc-card .doc-category {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    border-radius: 12px;
    font-size: 11px;
    margin-bottom: 8px;
}

.scanned-doc-card .doc-amount {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-success);
}

.scanned-doc-card .doc-date {
    font-size: 12px;
    color: var(--text-muted);
}

/* .filter-select moved to Auftrag Management section to avoid duplication */

/* DATEV Panel */
.datev-panel .datev-controls {
    margin-bottom: 16px;
}

.form-row-inline {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row-inline .form-group {
    margin-bottom: 0;
}

.form-row-inline .form-group label {
    font-size: 12px;
    margin-bottom: 4px;
}

.form-row-inline input[type="date"] {
    padding: 8px 12px;
    min-width: 150px;
}

.datev-result {
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

.datev-result:empty {
    display: none;
}

/* Backup Styles */
.backup-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.backup-option {
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.backup-option h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.backup-option p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.auto-backups-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.auto-backup-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
    font-size: 13px;
}

/* GDPR Panel */
.gdpr-panel .gdpr-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.gdpr-option {
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.gdpr-option h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.gdpr-option p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Activity Log */
.activity-log-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-log-item {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.activity-log-item:last-child {
    border-bottom: none;
}

/* Danger Button */
.btn-danger {
    background: linear-gradient(135deg, var(--accent-danger), #dc2626);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

/* Warning Button */
.btn-warning {
    background: linear-gradient(135deg, var(--accent-warning), #d97706);
    color: white;
}

.btn-warning:hover {
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}

/* Badge New */
.badge-new {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    font-size: 9px;
    padding: 2px 6px;
}

/* =====================================================
   OLLAMA AI ASSISTANT UI
   ===================================================== */

.ai-window {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    color: white;
}

.ai-header {
    padding: 16px 24px;
    background: rgba(30, 41, 59, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-llama-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.5));
}

.model-selector-wrapper {
    position: relative;
    min-width: 200px;
}

#ai-model-select {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    outline: none;
}

.ai-chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.ai-chat-area::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.ai-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.5;
    position: relative;
    animation: fadeInSlide 0.3s ease;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.ai-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message.bot {
    align-self: flex-start;
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-input-wrapper {
    padding: 24px;
    background: rgba(15, 23, 42, 0.2);
}

.ai-input-container {
    display: flex;
    align-items: center;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px 16px;
    gap: 12px;
    transition: all 0.3s ease;
}

.ai-input-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

#ai-chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 15px;
    padding: 8px 0;
    outline: none;
}

.ai-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0.5;
    text-align: center;
}

.ai-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.ai-typing {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 10px;
    align-self: flex-start;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Light theme support */
.light-theme .ai-window {
    background: rgba(255, 255, 255, 0.9);
    color: #1e293b;
    border-color: #e2e8f0;
}

.light-theme .ai-header {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.light-theme .ai-message.bot {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #cbd5e1;
}

.light-theme .ai-input-container {
    background: #fff;
    border-color: #cbd5e1;
}

.light-theme #ai-chat-input {
    color: #1e293b;
}

.light-theme #ai-model-select {
    background: #fff;
    color: #1e293b;
    border-color: #cbd5e1;
}

/* ============================================
   Stückliste (Bill of Materials)
   ============================================ */

.stueckliste-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.stueckliste-header {
    display: grid;
    grid-template-columns: 2fr 80px 60px 90px 90px 100px 36px;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(99, 102, 241, 0.08);
    border-bottom: 1px solid var(--border-color);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stueckliste-row {
    display: grid;
    grid-template-columns: 2fr 80px 60px 90px 90px 100px 36px;
    gap: 8px;
    padding: 8px 12px;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.stueckliste-row:hover {
    background: var(--bg-hover);
}

.stueckliste-row input,
.stueckliste-row select {
    width: 100%;
    padding: 6px 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
}

.stueckliste-row input:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.stueckliste-row .sl-name-wrapper {
    position: relative;
}

.stueckliste-row .sl-name-input {
    width: 100%;
}

.sl-suggest {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--accent-primary);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: var(--shadow-lg);
}

.sl-suggest-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}

.sl-suggest-item:hover {
    background: var(--bg-hover);
}

.sl-suggest-item .sl-suggest-name {
    font-weight: 500;
}

.sl-suggest-item .sl-suggest-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
}

.sl-gesamt {
    font-weight: 600;
    font-size: 13px;
    text-align: right;
    color: var(--accent-primary);
}

.sl-remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: all 0.15s;
    line-height: 1;
}

.sl-remove-btn:hover {
    color: var(--accent-danger);
    background: rgba(239, 68, 68, 0.1);
}

.stueckliste-footer {
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.stueckliste-add-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.stueckliste-summary {
    text-align: right;
    min-width: 220px;
}

.stueckliste-summary .summary-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 3px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Auftrag Total Summary */
.auftrag-total-summary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    margin-top: 16px;
}

.auftrag-total-summary h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.auftrag-total-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.auftrag-total-summary .summary-row.total {
    border-top: 2px solid var(--accent-primary);
    margin-top: 8px;
    padding-top: 8px;
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
}

/* Stückliste in Rechnung */
.rechnung-stueckliste {
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.rechnung-stueckliste h4 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .stueckliste-header {
        display: none;
    }

    .stueckliste-row {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 12px;
    }

    .stueckliste-row input,
    .stueckliste-row select {
        padding: 10px;
    }

    .stueckliste-footer {
        flex-direction: column;
    }

    .stueckliste-summary {
        width: 100%;
    }
}

/* ============================================
   Excel Import Wizard - Datatype Selection
   ============================================ */

.datatype-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.datatype-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.datatype-card:hover,
.datatype-card:focus-visible {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
    outline: none;
}

.datatype-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.datatype-card h4 {
    margin: 10px 0 8px 0;
    font-size: 18px;
    color: var(--text-primary, #f1f5f9);
}

.datatype-card p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary, #94a3b8);
}

/* Template Manager */
.template-manager {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.template-manager label {
    font-weight: 500;
    white-space: nowrap;
}

.template-select {
    flex: 1;
    padding: 8px 12px;
    background: var(--input-bg, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 6px;
    color: var(--text-primary, #f1f5f9);
    font-size: 14px;
}

.template-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Step Header with Actions */
.step-header-with-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.step-header-with-actions > div {
    flex: 1;
}

.step-header-with-actions h3 {
    margin-bottom: 8px;
}

/* ============================================
   Auftrag Management System
   ============================================ */

.auftrag-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.auftrag-filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.auftrag-filter-bar .filter-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition-fast);
}

.auftrag-filter-bar .filter-btn.active,
.auftrag-filter-bar .filter-btn:hover,
.auftrag-filter-bar .filter-btn:focus-visible {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
    outline: none;
}

.auftrag-kanban {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    min-height: 350px;
}

@media (max-width: 1024px) {
    .auftrag-kanban { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .auftrag-kanban { grid-template-columns: 1fr; }
}

.auftrag-kanban-col {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 12px;
    min-height: 200px;
}

.auftrag-kanban-col h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auftrag-kanban-col h4 .col-count {
    background: var(--bg-dark);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.auftrag-kanban-col h4 {
    border-bottom-color: var(--col-color, var(--border-color));
}

.auftrag-kanban-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auftrag-card {
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-fast);
}

.auftrag-card:hover,
.auftrag-card:focus-visible {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    outline: none;
}

.auftrag-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.auftrag-card-title {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
}

.auftrag-card-id {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.auftrag-card-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.auftrag-card-workers {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.worker-chip {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--accent-primary-transparent);
    color: var(--accent-primary);
}

.auftrag-progress-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.auftrag-progress-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.auftrag-progress-fill.low { background: var(--accent-danger); }
.auftrag-progress-fill.mid { background: var(--accent-warning); }
.auftrag-progress-fill.high { background: var(--accent-success); }

/* Auftrag Detail Modal */
.auftrag-detail-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
    overflow-x: auto;
}

.auftrag-tab {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition-fast);
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.auftrag-tab:hover,
.auftrag-tab:focus-visible {
    color: var(--text-primary);
    outline: none;
}

.auftrag-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.auftrag-tab-content {
    display: none;
    animation: fadeIn 0.2s ease;
}

.auftrag-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Auftrag Overview Tab */
.auftrag-overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .auftrag-overview-grid { grid-template-columns: 1fr; }
}

.auftrag-info-block {
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
    padding: 14px;
    border: 1px solid var(--border-color);
}

.auftrag-info-block h5 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.auftrag-info-block p {
    font-size: 14px;
    margin: 4px 0;
}

.auftrag-status-select {
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
}

.auftrag-fortschritt-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auftrag-fortschritt-wrapper input[type="range"] {
    flex: 1;
    accent-color: var(--accent-primary);
}

.auftrag-fortschritt-label {
    font-size: 14px;
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

/* Mitarbeiter */
.mitarbeiter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.mitarbeiter-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 16px;
    background: var(--accent-primary-transparent);
    color: var(--accent-primary);
    font-size: 13px;
}

.mitarbeiter-chip .remove-worker {
    cursor: pointer;
    opacity: 0.7;
    font-size: 14px;
}

.mitarbeiter-chip .remove-worker:hover {
    opacity: 1;
}

.mitarbeiter-add-row {
    display: flex;
    gap: 8px;
}

.mitarbeiter-add-row input {
    flex: 1;
    padding: 6px 10px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 13px;
}

/* Checkliste */
.checkliste-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.checkliste-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.checkliste-item.erledigt {
    opacity: 0.6;
}

.checkliste-item.erledigt .checkliste-text {
    text-decoration: line-through;
}

.checkliste-item input[type="checkbox"] {
    accent-color: var(--accent-primary);
    width: 16px;
    height: 16px;
}

.checkliste-text {
    flex: 1;
    font-size: 13px;
}

.checkliste-remove {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
}

.checkliste-remove:hover {
    color: var(--accent-danger);
}

.checkliste-add-row {
    display: flex;
    gap: 8px;
}

.checkliste-add-row input {
    flex: 1;
    padding: 6px 10px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 13px;
}

/* Kommentare */
.kommentar-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.kommentar-item {
    padding: 10px 12px;
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.kommentar-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.kommentar-autor {
    font-weight: 600;
    font-size: 12px;
}

.kommentar-datum {
    font-size: 11px;
    color: var(--text-muted);
}

.kommentar-text {
    font-size: 13px;
    line-height: 1.5;
}

.kommentar-add-row {
    display: flex;
    gap: 8px;
}

.kommentar-add-row textarea {
    flex: 1;
    padding: 8px 10px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 13px;
    resize: vertical;
    min-height: 60px;
}

/* Foto-Galerie */
.foto-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.foto-thumb {
    aspect-ratio: 1;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
    cursor: pointer;
    position: relative;
}

.foto-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.foto-thumb .foto-date {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    text-align: center;
}

/* Zeiterfassung pro Auftrag */
.zeit-entries-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.zeit-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    font-size: 13px;
}

.zeit-entry-date {
    color: var(--text-secondary);
    font-size: 12px;
}

.zeit-entry-hours {
    font-weight: 600;
}

.zeit-total-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--accent-primary-transparent);
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    margin-bottom: 12px;
}

/* Historie / Timeline */
.historie-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 20px;
    margin-bottom: 12px;
}

.historie-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--border-color);
}

.historie-item {
    position: relative;
    padding: 6px 0 6px 16px;
    font-size: 12px;
}

.historie-item::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 2px solid var(--bg-card);
}

.historie-item .historie-datum {
    color: var(--text-muted);
    font-size: 11px;
}

/* Status badges for Aufträge */
.status-geplant { color: var(--accent-info, #60a5fa); }
.status-material_bestellt { color: #a78bfa; }
.status-in_bearbeitung { color: var(--accent-warning); }
.status-qualitaetskontrolle { color: #06b6d4; }
.status-abnahme { color: #8b5cf6; }
.status-abgeschlossen { color: var(--accent-success); }
.status-pausiert { color: var(--text-muted); }
.status-storniert { color: var(--accent-danger); }

/* Pipeline Visualization */
.auftrag-pipeline {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.pipeline-flow {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    padding: 4px 0;
}

.pipeline-flow.compact {
    gap: 0;
}

.pipeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    padding: 6px 4px;
    opacity: 0.4;
    transition: all 0.2s ease;
    position: relative;
}

.pipeline-step.active,
.pipeline-step.current {
    opacity: 1;
}

.pipeline-step.done {
    opacity: 0.7;
}

.pipeline-step.current {
    transform: scale(1.1);
}

.pipeline-step.current .pipeline-step-icon {
    background: var(--step-color);
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 12px color-mix(in srgb, var(--step-color) 50%, transparent);
}

.pipeline-step-icon {
    font-size: 18px;
    margin-bottom: 4px;
}

.pipeline-step-label {
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    color: var(--text-secondary);
    white-space: nowrap;
}

.pipeline-step-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--step-color);
}

.pipeline-arrow {
    color: var(--text-muted);
    font-size: 16px;
    margin: 0 2px;
    opacity: 0.5;
    flex-shrink: 0;
}

.pipeline-step.done .pipeline-step-label {
    color: var(--step-color);
}

.pipeline-step.done .pipeline-step-icon::after {
    content: '✓';
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 10px;
    background: var(--accent-success);
    color: white;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 640px) {
    .pipeline-step {
        min-width: 60px;
    }
    .pipeline-step-label {
        font-size: 9px;
    }
}
.status-abgeschlossen { color: var(--accent-success, #22c55e); }

/* ============================================
   Email Automation
   ============================================ */

.automation-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.email-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.email-history-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    transition: var(--transition);
}

.email-history-item:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.email-history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.email-history-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.email-history-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.email-history-status.success {
    background: var(--accent-success-light);
    color: var(--accent-success);
}

.email-history-status.pending {
    background: var(--accent-warning-light);
    color: var(--accent-warning);
}

.email-history-status.failed {
    background: var(--accent-danger-light);
    color: var(--accent-danger);
}

.email-history-status.test {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

.email-history-content {
    font-size: 14px;
    line-height: 1.5;
}

.email-preview {
    background: var(--bg-primary);
    border-left: 3px solid var(--border-color);
    padding: 12px;
    margin: 12px 0;
    font-size: 13px;
    color: var(--text-muted);
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 150px;
    overflow-y: auto;
}

.email-analysis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.analysis-item {
    font-size: 13px;
}

.analysis-label {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.analysis-value {
    color: var(--text-primary);
    font-weight: 500;
}

.email-history-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
}

#test-result {
    display: none;
}

#test-result.visible {
    display: block;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.test-result-section {
    margin-bottom: 20px;
}

.test-result-section:last-child {
    margin-bottom: 0;
}

.test-result-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text-muted);
}

.test-analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.filter-select {
    padding: 8px 12px;
    background: var(--bg-input, var(--bg-dark));
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm, 6px);
    color: var(--text-primary);
    font-size: 13px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* .panel-header-row defined in Email Templates section above */

/* ============================================
   Setup Wizard
   ============================================ */

.setup-wizard-modal {
    z-index: 10000;
}

.setup-wizard-modal .modal-content {
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

/* Scoped to setup wizard to avoid overriding Excel Import Wizard styles */
.setup-wizard-modal .wizard-content {
    padding: 0;
}

.wizard-header {
    padding: 32px 32px 24px 32px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.wizard-header h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
}

.wizard-subtitle {
    margin: 0 0 20px 0;
    opacity: 0.9;
    font-size: 15px;
}

/* Scoped to setup wizard to avoid overriding Excel Import Wizard styles */
.setup-wizard-modal .wizard-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wizard-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.wizard-progress-fill {
    height: 100%;
    background: white;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.wizard-progress-text {
    font-size: 13px;
    opacity: 0.9;
    min-width: 100px;
    text-align: right;
}

.wizard-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.setup-wizard-modal .wizard-step {
    animation: wizard-fade-in 0.3s ease;
}

@keyframes wizard-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wizard-step-header h3 {
    margin: 0 0 8px 0;
    font-size: 22px;
    color: var(--text-primary);
}

.wizard-step-header p {
    margin: 0 0 24px 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.wizard-links {
    margin-bottom: 24px;
}

.wizard-links h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wizard-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.wizard-link:hover,
.wizard-link:focus-visible {
    border-color: var(--accent-primary);
    background: var(--accent-bg);
    transform: translateX(4px);
    outline: none;
}

.wizard-link-icon {
    font-size: 20px;
}

.wizard-link-arrow {
    margin-left: auto;
    color: var(--accent-primary);
    font-weight: bold;
}

.wizard-instructions {
    margin-bottom: 24px;
}

.wizard-instructions h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wizard-instructions ol {
    margin: 0;
    padding-left: 0;
    list-style: none;
    counter-reset: instruction-counter;
}

.wizard-instructions li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    counter-increment: instruction-counter;
}

.instruction-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.instruction-number::before {
    content: counter(instruction-counter);
}

.wizard-form {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.wizard-form h4 {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wizard-field {
    margin-bottom: 16px;
}

.wizard-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.wizard-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: monospace;
    transition: var(--transition);
}

.wizard-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

.wizard-test-result {
    margin-top: 12px;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    display: none;
}

.wizard-test-result:not(:empty) {
    display: block;
}

.wizard-test-result.success {
    background: var(--accent-success-light);
    color: var(--accent-success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.wizard-test-result.error {
    background: var(--accent-danger-light);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.wizard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 20px 32px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.wizard-footer-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

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

.wizard-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--accent-success), #16a34a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    animation: wizard-success-pulse 0.5s ease;
}

@keyframes wizard-success-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.wizard-complete h3 {
    margin: 0 0 12px 0;
    font-size: 24px;
}

.wizard-complete p {
    margin: 0 0 24px 0;
    color: var(--text-muted);
}

.wizard-config-summary {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    text-align: left;
}

.wizard-config-summary h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text-muted);
}

.config-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.config-item:last-child {
    border-bottom: none;
}

.config-key {
    color: var(--text-muted);
    font-family: monospace;
}

.config-value {
    color: var(--text-primary);
    font-family: monospace;
    font-weight: 500;
}

/* Scoped to setup wizard to avoid overriding Excel Import Wizard */
.setup-wizard-modal .wizard-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}

.wizard-next-steps {
    background: var(--accent-bg);
    padding: 20px;
    border-radius: 8px;
    text-align: left;
    border: 1px solid var(--accent-primary);
}

.wizard-next-steps h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--accent-primary);
}

.wizard-next-steps ul {
    margin: 0;
    padding-left: 20px;
}

.wizard-next-steps li {
    margin-bottom: 6px;
    color: var(--text-primary);
    line-height: 1.6;
}

/* ============================================
   User Onboarding Wizard (Boomer-Friendly)
   ============================================ */

.setup-wizard-user .modal-content {
    max-width: 600px;
}

.wizard-header-user {
    padding: 40px 32px 24px 32px;
    text-align: center;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.wizard-title-user {
    margin: 0 0 8px 0;
    font-size: 32px;
    font-weight: bold;
}

.wizard-subtitle-user {
    margin: 0;
    opacity: 0.95;
    font-size: 18px;
    line-height: 1.6;
}

.wizard-body-user {
    padding: 40px 32px;
    background: var(--bg-primary);
}

.wizard-step-user {
    animation: wizard-fade-in 0.3s ease;
}

.wizard-form-user {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.wizard-field-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wizard-field-label {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.wizard-input-user {
    width: 100%;
    padding: 16px 18px;
    font-size: 18px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.2s ease;
    min-height: 48px;
}

.wizard-input-user:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-bg);
}

.wizard-input-user::placeholder {
    color: var(--text-muted);
    font-size: 16px;
}

.wizard-input-user.required {
    border-color: var(--border-color);
}

/* File upload (logo) */
.wizard-file-upload {
    position: relative;
}

.wizard-file-input {
    display: none;
}

.logo-upload-area {
    padding: 32px 24px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
}

.logo-upload-area:hover {
    border-color: var(--accent-primary);
    background: var(--accent-bg);
}

.wizard-logo-dropzone.dragging .logo-upload-area {
    border-color: var(--accent-primary);
    background: var(--accent-bg);
    transform: scale(1.02);
}

.logo-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.logo-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.logo-hint {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

.logo-preview-container {
    text-align: center;
    padding: 24px;
}

.logo-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Error messages */
.wizard-errors-user {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.error-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 16px;
    color: var(--accent-danger);
}

.error-icon {
    font-size: 20px;
    flex-shrink: 0;
}

/* Completion step */
.wizard-step-complete {
    text-align: center;
    animation: wizard-fade-in 0.3s ease;
}

.wizard-success-check {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--accent-success), #16a34a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    animation: wizard-success-pulse 0.5s ease;
}

.wizard-step-complete h2 {
    margin: 0 0 12px 0;
    font-size: 28px;
    color: var(--text-primary);
}

.wizard-complete-description {
    margin: 0 0 32px 0;
    font-size: 18px;
    color: var(--text-muted);
    line-height: 1.6;
}

.wizard-company-summary {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 32px;
    text-align: left;
}

.summary-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
}

.summary-value {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.5;
}

.summary-logo {
    max-width: 150px;
    max-height: 150px;
    border-radius: 6px;
}

.wizard-welcome-message {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
}

.wizard-welcome-message p {
    margin: 0 0 8px 0;
    font-size: 16px;
    line-height: 1.6;
}

.wizard-welcome-message p:last-child {
    margin-bottom: 0;
}

/* Buttons */
.btn-large {
    padding: 14px 32px;
    font-size: 16px;
    min-height: 50px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary.btn-large {
    background: var(--accent-primary);
    color: white;
    border: none;
    min-width: 140px;
}

.btn-primary.btn-large:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary.btn-large {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary.btn-large:hover {
    border-color: var(--accent-primary);
    background: var(--accent-bg);
}

.wizard-footer-user {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    padding: 28px 32px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* Admin step message */
.wizard-step-admin {
    padding: 40px 20px;
    text-align: center;
    background: var(--accent-bg);
    border-radius: 8px;
}

.wizard-admin-message {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.8;
}

/* ============================================
   Admin Technical Settings Modal
   ============================================ */

.admin-pin-modal {
    z-index: 10001;
}

.admin-pin-content {
    max-width: 400px;
}

.admin-pin-header {
    padding: 32px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.admin-pin-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
}

.admin-pin-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
}

.admin-pin-body {
    padding: 32px;
}

.pin-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.pin-field label {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.admin-pin-input {
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.admin-pin-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

.pin-error {
    color: var(--accent-danger);
    font-size: 14px;
    padding: 8px 12px;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 4px;
    margin-bottom: 16px;
}

.admin-pin-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 32px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Admin settings modal */
.admin-settings-modal {
    z-index: 10001;
}

.admin-settings-content {
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.admin-settings-header {
    padding: 32px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.admin-settings-header h2 {
    margin: 0 0 12px 0;
    font-size: 24px;
}

.admin-warning {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 16px;
    border-radius: 4px;
}

.admin-settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

#admin-settings-form {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.admin-settings-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-settings-section h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-field label {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.admin-input,
.admin-checkbox {
    font-size: 15px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.admin-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

.admin-input[type="password"] {
    font-family: monospace;
    letter-spacing: 1px;
}

.admin-hint {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-primary);
}

.admin-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    min-height: auto;
    padding: 0;
    margin: 0;
}

.admin-errors {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 6px;
    padding: 12px;
    margin-top: 24px;
}

.admin-settings-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 32px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Mobile responsive */
@media (max-width: 640px) {
    .setup-wizard-modal .modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .wizard-header {
        padding: 24px 20px 20px 20px;
        border-radius: 0;
    }

    .wizard-header h2 {
        font-size: 24px;
    }

    .wizard-body {
        padding: 20px;
    }

    .wizard-footer {
        flex-direction: column;
        gap: 8px;
        border-radius: 0;
    }

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

    .wizard-footer-actions button {
        width: 100%;
    }

    #wizard-prev-btn {
        width: 100%;
    }

    /* User onboarding mobile */
    .wizard-header-user {
        padding: 32px 20px 20px 20px;
    }

    .wizard-title-user {
        font-size: 28px;
    }

    .wizard-subtitle-user {
        font-size: 16px;
    }

    .wizard-body-user {
        padding: 24px 20px;
    }

    .wizard-form-user {
        gap: 20px;
    }

    .wizard-field-label {
        font-size: 16px;
    }

    .wizard-input-user {
        font-size: 16px;
        padding: 14px 16px;
        min-height: 44px;
    }

    .wizard-footer-user {
        flex-direction: column;
        gap: 12px;
        padding: 20px;
    }

    .btn-large {
        width: 100%;
        padding: 12px 24px;
    }

    .btn-primary.btn-large {
        min-width: unset;
    }

    .summary-item {
        grid-template-columns: 100px 1fr;
        gap: 12px;
    }

    .wizard-company-summary {
        padding: 16px;
    }
}

/* ============================================
   Dashboard Charts
   ============================================ */

.dashboard-charts {
    margin-bottom: 40px;
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.chart-card:hover,
.chart-card:focus-visible {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
    outline: none;
}

.chart-container {
    width: 100%;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-container svg {
    width: 100%;
    height: auto;
    max-width: 100%;
}

/* KPI Cards */
.kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.kpi-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    padding: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: var(--transition);
}

.kpi-card:hover,
.kpi-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--accent-primary);
    outline: none;
}

.kpi-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1.2;
}

/* Responsive charts */
@media (max-width: 768px) {
    .charts-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .chart-card {
        padding: 16px;
    }

    .chart-container {
        min-height: 250px;
    }

    .kpi-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .kpi-card {
        padding: 16px;
    }

    .kpi-value {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .charts-row {
        grid-template-columns: 1fr;
    }

    .kpi-cards {
        grid-template-columns: 1fr;
    }

    .chart-card {
        padding: 12px;
    }

    .chart-container {
        min-height: 200px;
    }
}

/* ============================================
   Notification System
   ============================================ */

.notification-bell-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 16px;
}

.notification-bell {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    position: relative;
    padding: 4px;
    transition: var(--transition);
    color: var(--text-primary);
}

.notification-bell:hover,
.notification-bell:focus-visible {
    transform: scale(1.1);
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: 50%;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent-danger);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid var(--bg-primary);
}

.notification-panel {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 360px;
    max-width: 90vw;
    max-height: 600px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    animation: slideIn 0.2s ease-out;
}

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

.notification-panel-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.notification-close:hover,
.notification-close:focus-visible {
    color: var(--text-primary);
    transform: scale(1.1);
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.notification-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.notification-list:empty::after {
    content: 'Keine Benachrichtigungen';
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    font-size: 14px;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notification-item:hover,
.notification-item:focus-visible {
    background: rgba(99, 102, 241, 0.05);
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
}

.notification-item.unread {
    background: rgba(99, 102, 241, 0.08);
    border-left: 3px solid var(--accent-primary);
    padding-left: 13px;
}

.notification-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-item.unread .notification-title {
    font-weight: 700;
}

.notification-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notification-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.notification-panel-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
}

.notification-panel-footer .btn {
    flex: 1;
    font-size: 12px;
    padding: 8px 12px;
}

/* Dark theme notification styles */
:root {
    --notification-bg-anfrage-neu: rgba(59, 130, 246, 0.1);
    --notification-bg-angebot-akzeptiert: rgba(16, 185, 129, 0.1);
    --notification-bg-rechnung-ueberfaellig: rgba(239, 68, 68, 0.1);
    --notification-bg-rechnung-bezahlt: rgba(16, 185, 129, 0.1);
    --notification-bg-termin-erinnerung: rgba(245, 158, 11, 0.1);
    --notification-bg-aufgabe-faellig: rgba(245, 158, 11, 0.1);
    --notification-bg-system: rgba(107, 114, 128, 0.1);
}

.notification-item[data-type="anfrage_neu"] {
    border-left-color: #3b82f6;
}

.notification-item[data-type="angebot_akzeptiert"] {
    border-left-color: #10b981;
}

.notification-item[data-type="rechnung_ueberfaellig"] {
    border-left-color: var(--accent-danger);
}

.notification-item[data-type="rechnung_bezahlt"] {
    border-left-color: #10b981;
}

.notification-item[data-type="termin_erinnerung"] {
    border-left-color: var(--accent-warning);
}

.notification-item[data-type="aufgabe_faellig"] {
    border-left-color: var(--accent-warning);
}

.notification-item[data-type="system"] {
    border-left-color: #6b7280;
}

/* Material Picker Selector in Angebot Position Rows */
.position-material-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.position-material-picker {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: all 0.2s;
}

.position-material-picker:hover,
.position-material-picker:focus {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

.position-material-info {
    font-size: 12px;
    color: var(--text-muted);
    flex: 1;
    min-width: 120px;
}

.position-material-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    font-size: 14px;
    transition: color 0.2s;
}

.position-material-clear:hover,
.position-material-clear:focus {
    color: var(--accent-warning);
}

.position-stock-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

.position-margin-info {
    font-size: 11px;
    color: var(--accent-primary);
    margin-top: 4px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .notification-panel {
        position: fixed;
        top: 60px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
    }

    .notification-bell-container {
        margin-right: 8px;
    }

    .position-material-selector {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================
   Entity Trail (breadcrumb chain between
   Anfrage → Angebot → Auftrag → Rechnung)
   ============================================ */
.entity-trail {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    margin: 8px 0;
    flex-wrap: wrap;
}
.trail-item {
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-secondary);
    transition: background 0.2s;
}
.trail-item:hover {
    background: var(--accent-primary);
    color: white;
}
.trail-current {
    font-weight: 600;
    color: var(--text-primary);
    cursor: default;
}
.trail-current:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.trail-arrow {
    color: var(--text-muted);
    font-size: 12px;
}
.trail-correction {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-secondary);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s;
}
.trail-correction:hover {
    background: var(--accent-primary);
    color: white;
}

/* ============================================
   View Toolbar — Shared filter tabs + search
   Used by Angebote and Rechnungen views
   ============================================ */
.view-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-tabs .filter-btn {
    padding: 6px 14px;
    min-height: 36px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.filter-tabs .filter-btn:hover,
.filter-tabs .filter-btn:focus-visible {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
    outline: none;
}

.filter-tabs .filter-btn.active {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

.filter-tabs .filter-btn .filter-count {
    display: inline-block;
    margin-left: 4px;
    font-size: 11px;
    opacity: 0.85;
}

.search-input-wrapper {
    position: relative;
    min-width: 200px;
    max-width: 320px;
    flex-shrink: 0;
}

.search-input-wrapper::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
}

.search-input {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px 8px 36px;
    border-radius: 22px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition-fast);
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .view-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .search-input-wrapper {
        max-width: none;
        min-width: 0;
    }
}

/* ============================================
   Wareneingang (Goods Receipt) Styles
   ============================================ */

/* Tabs */
.we-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary, #f1f5f9);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
}

.we-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
}

.we-tab:hover {
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #1e293b);
}

.we-tab.active {
    background: var(--bg-primary, #fff);
    color: var(--accent, #2563eb);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.we-tab-icon {
    font-size: 1.2rem;
}

/* Tab content */
.we-tab-content {
    display: none;
}

.we-tab-content.active {
    display: block;
}

/* Dropzone */
.we-dropzone {
    border: 2px dashed var(--border-color, #cbd5e1);
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    background: var(--bg-secondary, #f8fafc);
}

.we-dropzone.drag-over {
    border-color: var(--accent, #2563eb);
    background: rgba(37, 99, 235, 0.05);
}

.we-dropzone-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

.we-dropzone-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    margin-bottom: 4px;
}

.we-dropzone-hint {
    font-size: 0.85rem;
    color: var(--text-secondary, #64748b);
    margin-bottom: 16px;
}

.we-dropzone-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Camera Preview */
.we-camera-preview {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    background: #000;
}

.we-camera-preview video {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.we-camera-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.7);
}

/* Processing/Spinner */
.we-processing {
    text-align: center;
    padding: 48px 24px;
}

.we-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color, #e2e8f0);
    border-top-color: var(--accent, #2563eb);
    border-radius: 50%;
    animation: we-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes we-spin {
    to { transform: rotate(360deg); }
}

.we-processing p {
    font-size: 1rem;
    color: var(--text-secondary, #64748b);
}

/* Parsed Results Table */
.we-results {
    margin-top: 16px;
}

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

.we-results-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.we-results-supplier {
    font-size: 0.9rem;
    color: var(--text-secondary, #64748b);
    background: var(--bg-secondary, #f1f5f9);
    padding: 4px 12px;
    border-radius: 20px;
}

.we-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.we-items-table th {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 2px solid var(--border-color, #e2e8f0);
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.we-items-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color, #f1f5f9);
    vertical-align: middle;
}

.we-items-table tr:hover {
    background: var(--bg-secondary, #f8fafc);
}

.we-items-table input,
.we-items-table select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    font-size: 0.85rem;
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #1e293b);
}

.we-items-table input:focus,
.we-items-table select:focus {
    outline: none;
    border-color: var(--accent, #2563eb);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.we-items-table input[type="number"] {
    width: 80px;
}

/* Match confidence indicator */
.we-match-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.we-match-indicator.high { background: #22c55e; }
.we-match-indicator.medium { background: #f59e0b; }
.we-match-indicator.low { background: #ef4444; }
.we-match-indicator.none { background: #94a3b8; }

/* Auftrag assignment */
.we-auftrag-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-top: 2px solid var(--border-color, #e2e8f0);
    margin-top: 8px;
    flex-wrap: wrap;
}

.we-auftrag-row label {
    font-weight: 600;
    white-space: nowrap;
}

.we-auftrag-row select {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    font-size: 0.9rem;
}

.we-auftrag-suggestion {
    font-size: 0.8rem;
    color: var(--accent, #2563eb);
    padding: 2px 8px;
    background: rgba(37, 99, 235, 0.08);
    border-radius: 12px;
}

/* Action row */
.we-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.we-total {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin-right: auto;
    align-self: center;
}

/* Bank detection tab */
.we-bank-info {
    background: var(--bg-secondary, #f8fafc);
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    border-left: 3px solid var(--accent, #2563eb);
}

.we-bank-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary, #64748b);
}

.we-bank-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.we-bank-item-info {
    flex: 1;
    min-width: 200px;
}

.we-bank-item-supplier {
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}

.we-bank-item-purpose {
    font-size: 0.85rem;
    color: var(--text-secondary, #64748b);
}

.we-bank-item-date {
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
}

.we-bank-item-amount {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--danger, #ef4444);
    white-space: nowrap;
}

/* CSV import controls */
.we-csv-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.we-csv-controls select {
    padding: 10px 14px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    font-size: 0.9rem;
    min-width: 180px;
}

/* History section */
.we-history-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid var(--border-color, #e2e8f0);
}

.we-history-section h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.we-history-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    margin-bottom: 8px;
    gap: 12px;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.we-history-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.we-history-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.we-history-info {
    flex: 1;
    min-width: 0;
}

.we-history-title {
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}

.we-history-meta {
    font-size: 0.8rem;
    color: var(--text-secondary, #64748b);
}

.we-history-value {
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    white-space: nowrap;
}

.we-history-details {
    display: none;
    padding: 12px 16px;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 0 0 10px 10px;
    margin-top: -8px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-top: none;
}

.we-history-details.open {
    display: block;
}

/* Quick-entry form (for bank detection) */
.we-quick-entry {
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.we-quick-entry h3 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.we-quick-entry-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.we-quick-entry-row input,
.we-quick-entry-row select {
    padding: 8px 10px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    font-size: 0.85rem;
}

.we-quick-entry-row .we-material-search {
    flex: 2;
    min-width: 150px;
}

.we-quick-entry-row .we-qty {
    width: 70px;
}

.we-quick-entry-row .we-unit {
    width: 70px;
}

.we-quick-entry-row .we-price {
    width: 90px;
}

.we-quick-entry-row .btn-icon-sm {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--danger, #ef4444);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .we-tabs {
        flex-direction: column;
    }

    .we-tab {
        justify-content: flex-start;
    }

    .we-dropzone {
        padding: 32px 16px;
    }

    .we-items-table {
        font-size: 0.8rem;
    }

    .we-items-table th:nth-child(n+4),
    .we-items-table td:nth-child(n+4) {
        display: none;
    }

    .we-auftrag-row {
        flex-direction: column;
        align-items: stretch;
    }

    .we-bank-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .we-csv-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .we-quick-entry-row {
        flex-direction: column;
    }

    .we-quick-entry-row input,
    .we-quick-entry-row select {
        width: 100%;
    }
}

/* ============================================
   Angebot Detail View
   ============================================ */

.angebot-detail-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.angebot-detail-section:last-child {
    border-bottom: none;
}

.angebot-detail-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.angebot-customer-card {
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text-secondary);
}

.angebot-customer-card strong {
    color: var(--text-primary);
    font-size: 16px;
}

.angebot-doc-chain {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
}

.doc-chain-item {
    padding: 6px 12px;
    background: var(--bg-hover);
    border-radius: 6px;
    font-size: 13px;
    font-family: monospace;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid var(--border-color);
}

.doc-chain-item:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.doc-chain-item.doc-chain-active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    cursor: default;
}

.doc-chain-arrow {
    color: var(--text-muted);
    font-size: 16px;
}

.angebot-bom-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.angebot-bom-table th {
    background: var(--bg-dark);
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.angebot-bom-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.angebot-bom-table .text-right {
    text-align: right;
}

.angebot-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 14px;
}

.angebot-summary .summary-row {
    display: flex;
    gap: 20px;
    min-width: 240px;
    justify-content: space-between;
}

.angebot-summary .summary-row.total {
    font-weight: 700;
    font-size: 16px;
    border-top: 2px solid var(--text-primary);
    padding-top: 8px;
    margin-top: 4px;
}

.angebot-comm-item {
    display: flex;
    gap: 16px;
    padding: 10px 12px;
    background: var(--bg-dark);
    border-radius: var(--border-radius-sm);
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.angebot-comm-item span:first-child {
    white-space: nowrap;
    color: var(--text-muted);
}
