/* ============================================
   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 {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 32px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(200, 149, 108, 0.08);
}

.stat-anfragen .stat-icon {
    background: rgba(107, 143, 196, 0.1);
}

.stat-angebote .stat-icon {
    background: rgba(201, 160, 79, 0.1);
}

.stat-auftraege .stat-icon {
    background: rgba(200, 149, 108, 0.1);
}

.stat-rechnungen .stat-icon {
    background: rgba(90, 158, 111, 0.1);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 32px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: 0.01em;
    width: fit-content;
}

.stat-trend.trend-up {
    color: #3a8c5c;
    background: rgba(58, 140, 92, 0.12);
}

.stat-trend.trend-down {
    color: #c0392b;
    background: rgba(192, 57, 43, 0.1);
}

.stat-trend.trend-neutral {
    color: var(--text-secondary);
    background: rgba(128, 128, 128, 0.1);
}

/* 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 12px rgba(200, 149, 108, 0.2);
}

.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;
}

/* ============================================
   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;
    }

    .material-card {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .material-filter {
        flex-direction: column;
    }

    .material-filter select {
        width: 100%;
    }

    .po-detail-table-wrapper {
        position: relative;
    }

    .po-detail-table-wrapper::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 24px;
        background: linear-gradient(to right, transparent, rgba(0,0,0,0.15));
        pointer-events: none;
    }
}

/* ============================================
   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: rgba(200, 149, 108, 0.1);
    border: 1px solid rgba(200, 149, 108, 0.2);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.quick-action:hover {
    box-shadow: 0 4px 16px rgba(200, 149, 108, 0.2);
    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: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.ext-link:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.ext-icon {
    font-size: 16px;
}

/* ============================================
   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);
}

.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(200, 149, 108, 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);
}

/* ============================================
   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(200, 149, 108, 0.15);
    border: 1px solid rgba(200, 149, 108, 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);
    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(200, 149, 108, 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(200, 149, 108, 0.15);
    color: var(--accent-primary);
    border-radius: var(--border-radius);
    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;
}

/* Badge New */
.badge-new {
    background: var(--accent-purple, #8b5cf6);
    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(200, 149, 108, 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: var(--accent-primary);
    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: var(--border-radius);
    padding: 8px 16px;
    gap: 12px;
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.ai-input-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(200, 149, 108, 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: #1c1f22;
    border-color: #e2e8f0;
}

.light-theme .ai-header {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.light-theme .ai-message.bot {
    background: #f1f5f9;
    color: #1c1f22;
    border-color: #cbd5e1;
}

.light-theme .ai-input-container {
    background: #fff;
    border-color: #cbd5e1;
}

.light-theme #ai-chat-input {
    color: #1c1f22;
}

.light-theme #ai-model-select {
    background: #fff;
    color: #1c1f22;
    border-color: #cbd5e1;
}

/* ============================================
   Setup Wizard
   ============================================ */

.setup-wizard-modal {
    z-index: var(--z-top, 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: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, border-color 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: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, border-color 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: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, border-color 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);
    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;
}

/* ============================================
   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);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.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(200, 149, 108, 0.05);
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
}

.notification-item.unread {
    background: rgba(200, 149, 108, 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(90, 158, 111, 0.1);
    --notification-bg-rechnung-ueberfaellig: rgba(239, 68, 68, 0.1);
    --notification-bg-rechnung-bezahlt: rgba(90, 158, 111, 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: var(--accent-info, #6b8fc4);
}

.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: opacity 0.2s, transform 0.2s, background-color 0.2s, border-color 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;
    }
}

