/* =============================================================================
   Rechnungstracker - Modern UI Styles
   TeDaCo GmbH
============================================================================= */

:root {
    /* Colors - Dark Theme */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-card-hover: #22222f;
    --bg-glass: rgba(26, 26, 37, 0.8);

    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;

    --accent-primary: #6366f1;
    --accent-primary-hover: #818cf8;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #3b82f6;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(99, 102, 241, 0.3);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.2);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

/* =============================================================================
   Header
============================================================================= */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-tabs {
    display: flex;
    gap: var(--space-xs);
    background: var(--bg-secondary);
    padding: var(--space-xs);
    border-radius: var(--radius-lg);
}

.nav-tab {
    padding: var(--space-sm) var(--space-lg);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.nav-tab:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-tab.active {
    color: var(--text-primary);
    background: var(--gradient-primary);
}

/* =============================================================================
   Buttons
============================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm), 0 0 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 30px rgba(99, 102, 241, 0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
}

.btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
}

/* =============================================================================
   Main Content
============================================================================= */

.main-content {
    padding: var(--space-xl);
    max-width: 1600px;
    margin: 0 auto;
}

.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================================================
   Dashboard
============================================================================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.stat-card.primary::before {
    background: var(--gradient-primary);
}

.stat-card.success::before {
    background: var(--gradient-success);
}

.stat-card.warning::before {
    background: var(--gradient-warning);
}

.stat-card.danger::before {
    background: var(--gradient-danger);
}

.stat-card.accent::before {
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #a855f7);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-glow);
}

.stat-card.wide {
    grid-column: span 2;
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.9;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stat-sublabel {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ust-breakdown {
    display: flex;
    gap: var(--space-md);
    margin-left: auto;
    flex-wrap: wrap;
}

.ust-q {
    text-align: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.ust-q-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
}

.ust-q-value {
    font-size: 0.9rem;
    font-weight: 600;
}

/* =============================================================================
   Cards
============================================================================= */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card.wide {
    grid-column: span 2;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

/* =============================================================================
   Invoice List
============================================================================= */

.invoice-list {
    max-height: 400px;
    overflow-y: auto;
}

.invoice-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.invoice-item:last-child {
    border-bottom: none;
}

.invoice-item:hover {
    background: var(--bg-card-hover);
}

.invoice-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.invoice-nr {
    font-weight: 600;
    color: var(--text-primary);
}

.invoice-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.invoice-amount {
    font-weight: 600;
    font-size: 1.1rem;
}

/* =============================================================================
   Status Badges
============================================================================= */

.status {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-offen {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.status-bezahlt {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.status-ueberfaellig {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.status-teilweise {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.status-storniert {
    background: rgba(107, 107, 123, 0.2);
    color: #a0a0b0;
}

/* =============================================================================
   View Header & Search
============================================================================= */

.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
    gap: var(--space-md);
}

/* Quick Filter Buttons */
.quick-filters {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.quick-filter-btn {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-filter-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.quick-filter-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

/* Filter Row */
.filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.filter-summary {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.view-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.search-bar {
    display: flex;
    gap: var(--space-sm);
}

.search-bar input,
.search-bar select {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.search-bar input {
    min-width: 280px;
}

.search-bar input:focus,
.search-bar select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* =============================================================================
   Data Table
============================================================================= */

.table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
}

.data-table th {
    background: var(--bg-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.data-table td {
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--bg-card-hover);
}

.data-table .actions {
    display: flex;
    gap: var(--space-xs);
}

/* =============================================================================
   Customers Grid
============================================================================= */

.customers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.customer-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.customer-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.customer-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.customer-stats {
    display: flex;
    gap: var(--space-lg);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.customer-stat {
    display: flex;
    flex-direction: column;
}

.customer-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.customer-stat-value {
    font-size: 1rem;
    font-weight: 600;
}

/* =============================================================================
   Modal
============================================================================= */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-lg);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* =============================================================================
   Form
============================================================================= */

#invoice-form {
    padding: var(--space-lg);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

/* =============================================================================
   Upload Dropzone
============================================================================= */

.upload-section {
    padding: 0 var(--space-lg);
    padding-top: var(--space-lg);
}

.upload-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: var(--bg-secondary);
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.upload-dropzone.uploading {
    border-color: var(--accent-warning);
    background: rgba(245, 158, 11, 0.1);
    pointer-events: none;
}

.upload-dropzone.success {
    border-color: var(--accent-success);
    background: rgba(16, 185, 129, 0.1);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.dropzone-icon {
    font-size: 3rem;
    opacity: 0.7;
}

.dropzone-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.dropzone-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.upload-status {
    margin-top: var(--space-md);
    text-align: center;
}

.upload-status.loading {
    color: var(--accent-warning);
}

.upload-status.success {
    color: var(--accent-success);
}

.upload-status.error {
    color: var(--accent-danger);
}

.upload-divider {
    display: flex;
    align-items: center;
    margin: var(--space-lg) 0;
    gap: var(--space-md);
}

.upload-divider::before,
.upload-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.upload-divider span {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =============================================================================
   ELLIE Chat Widget
============================================================================= */

.ellie-widget {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: 500;
}

.ellie-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-xl);
    color: white;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transition: all var(--transition-normal);
}

.ellie-toggle:hover {
    transform: scale(1.05);
}

.ellie-avatar {
    font-size: 1.25rem;
}

.ellie-chat {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.ellie-chat.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ellie-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: var(--gradient-primary);
    color: white;
}

.ellie-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.ellie-title small {
    display: block;
    font-size: 0.7rem;
    opacity: 0.8;
}

.ellie-minimize {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.ellie-minimize:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ellie-messages {
    flex: 1;
    padding: var(--space-md);
    max-height: 350px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.message {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    line-height: 1.5;
    max-width: 90%;
}

.message.bot {
    background: var(--bg-secondary);
    align-self: flex-start;
}

.message.user {
    background: var(--gradient-primary);
    color: white;
    align-self: flex-end;
}

.message ul {
    margin: var(--space-sm) 0;
    padding-left: var(--space-lg);
}

.message li {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.ellie-input {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.ellie-input input {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.ellie-input input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.ellie-input button {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.ellie-input button:hover {
    transform: scale(1.05);
}

/* =============================================================================
   Scrollbar
============================================================================= */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* =============================================================================
   Responsive
============================================================================= */

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: var(--space-md);
    }

    .nav-tabs {
        order: 3;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stat-card.wide,
    .card.wide {
        grid-column: span 1;
    }

    .search-bar {
        flex-direction: column;
    }

    .search-bar input {
        min-width: auto;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    .ellie-chat {
        width: calc(100vw - 40px);
        right: -10px;
    }
}

/* =============================================================================
   Customer Accordion & Projects View
============================================================================= */

.customers-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.customer-accordion {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.customer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.customer-header:hover {
    background: var(--bg-card-hover);
}

.customer-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.customer-info .customer-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
}

.customer-nr {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.customer-stats-row {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.customer-stats-row .stat {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.customer-stats-row .stat.warning {
    color: var(--accent-warning);
}

.customer-stats-row .stat.success {
    color: var(--accent-success);
}

.expand-icon {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.customer-projects {
    background: var(--bg-secondary);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.project-group {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    overflow: hidden;
}

.project-group:last-child {
    margin-bottom: 0;
}

.project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background var(--transition-fast);
}

.project-header:hover {
    background: var(--bg-card-hover);
}

.project-header.no-project {
    color: var(--text-muted);
    font-style: italic;
}

.project-stats {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.expand-icon-sm {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.project-invoices {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
}

.mini-table {
    width: 100%;
    border-collapse: collapse;
}

.mini-table td {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.mini-table tr:last-child td {
    border-bottom: none;
}

.mini-table strong {
    color: var(--text-primary);
}

.loading {
    padding: var(--space-md);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.no-data {
    padding: var(--space-md);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.status-offen {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.status-badge.status-bezahlt {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.status-badge.status-ueberfaellig {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.status-badge.status-teilweise {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.status-badge.status-storniert {
    background: rgba(107, 107, 123, 0.2);
    color: #a0a0b0;
}

/* =============================================================================
   Project Budget Progress Bar
============================================================================= */

.project-title {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
    cursor: pointer;
}

.project-actions {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.project-budget {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.budget-bar {
    flex: 1;
    min-width: 150px;
    height: 8px;
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
}

.budget-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.budget-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.budget-remaining {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-success);
}

.budget-remaining:has(⚠️) {
    color: var(--accent-warning);
}

/* Warning status for upload duplicate detection */
.upload-status.warning {
    color: var(--accent-warning);
    background: rgba(245, 158, 11, 0.1);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid rgba(245, 158, 11, 0.3);
}