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

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: #f8f9fa;
            min-height: 100vh;
            color: #333;
        }

        .container {
            /*max-width: 1200px;*/
            margin: 0 auto;
            padding: 20px;
        }

        /* Login Screen */
        .login-container {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }

        .login-form {
            background: white;
            padding: 40px;
            border-radius: 15px;
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
            width: 100%;
            max-width: 400px;
        }

        .login-form h2 {
            text-align: center;
            margin-bottom: 30px;
            color: #3b82f6;
        }

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

        .form-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: 500;
        }

        .form-group input {
            width: 100%;
            padding: 12px;
            border: 2px solid #e1e5e9;
            border-radius: 8px;
            font-size: 16px;
            transition: border-color 0.3s;
        }

        .form-group input:focus {
            outline: none;
            border-color: #3b82f6;
        }

        .btn {
            background: #3b82f6;
            color: white;
            padding: 12px 24px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 16px;
            transition: background 0.3s;
            width: 100%;
        }

        .btn:hover {
            background: #5a67d8;
        }

        .btn-secondary {
            background: #718096;
        }

        .btn-secondary:hover {
            background: #4a5568;
        }

        .btn-danger {
            background: #e53e3e;
        }

        .btn-danger:hover {
            background: #c53030;
        }

        .btn-success {
            background: #38a169;
        }

        .btn-success:hover {
            background: #2f855a;
        }

        .btn-small {
            padding: 8px 16px;
            font-size: 14px;
            margin: 2px;
        }

        /* Main App */
        .app-container {
            background: white;
            border-radius: 15px;
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
            overflow: hidden;
        }

        .header {
            background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
            color: white;
            padding: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
        }

        .header h1 {
            font-size: 24px;
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .navigation {
            background: #f7fafc;
            padding: 15px 20px;
            border-bottom: 1px solid #e2e8f0;
        }

        .nav-buttons {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .nav-btn {
            background: white;
            color: #3b82f6;
            border: 2px solid #3b82f6;
            padding: 10px 20px;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .nav-btn:hover, .nav-btn.active {
            background: #3b82f6;
            color: white;
        }

        .content {
            padding: 20px;
            min-height: 500px;
        }

        /* Priority Badges */
        .priority-badge {
            display: inline-block;
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-right: 8px;
            white-space: nowrap;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        .priority-ueberfaellig {
            background: linear-gradient(135deg, #fc8181 0%, #e53e3e 100%);
            color: white;
            animation: pulse 1.5s infinite;
            box-shadow: 0 0 10px rgba(229, 62, 62, 0.5);
        }

        .priority-heute {
            background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
            color: white;
            box-shadow: 0 2px 4px rgba(237, 137, 54, 0.3);
        }

        .priority-diese-woche {
            background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
            color: white;
            box-shadow: 0 2px 4px rgba(49, 130, 206, 0.3);
        }

        .priority-meine {
            background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
            color: white;
            box-shadow: 0 2px 4px rgba(56, 161, 105, 0.3);
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.6; }
        }

        /* Tables */
        .table-container {
            overflow-x: auto;
            margin-top: 20px;
            border-radius: 12px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
        }

        table {
            width: 100%;
            border-collapse: collapse;
            background: white;
            border-radius: 12px;
            overflow: hidden;
        }

        th, td {
            padding: 16px 12px;
            text-align: left;
            border-bottom: 1px solid #f1f5f9;
            vertical-align: middle;
        }

        th {
            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
            font-weight: 600;
            color: #334155;
            font-size: 13px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        tr:hover {
            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        }

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

        /* Filters */
        .filters {
            background: #f7fafc;
            padding: 20px;
            border-radius: 8px;
            margin-bottom: 20px;
        }

        .filter-row {
            display: flex;
            gap: 15px;
            flex-wrap: wrap;
            align-items: center;
        }

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

        .filter-group label {
            font-size: 14px;
            font-weight: 500;
        }

        .filter-group select, .filter-group input {
            padding: 8px;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            font-size: 14px;
        }

        /* Overview Stats */
        .overview-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .stat-card {
            background: white;
            padding: 20px;
            border-radius: 10px;
            border-left: 4px solid;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .stat-card.urgent {
            border-left-color: #e53e3e;
        }

        .stat-card.today {
            border-left-color: #d69e2e;
        }

        .stat-card.week {
            border-left-color: #3182ce;
        }

        .stat-card.my {
            border-left-color: #38a169;
        }

        .stat-card h3 {
            font-size: 24px;
            margin-bottom: 5px;
        }

        .stat-card p {
            color: #718096;
            font-size: 14px;
        }

        /* Modal */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
        }

        .modal-content {
            background-color: white;
            margin: 5% auto;
            padding: 30px;
            border-radius: 15px;
            width: 90%;
            max-width: 600px;
            max-height: 90vh;
            overflow-y: auto;
        }

        .close {
            color: #aaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            cursor: pointer;
        }

        .close:hover {
            color: #3b82f6;
        }

        /* Customer Details */
        .customer-details {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin-bottom: 20px;
        }

        .status-buttons {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            margin: 15px 0;
        }

        .status-btn {
            padding: 8px 16px;
            border: 2px solid #e2e8f0;
            background: white;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .status-btn.selected {
            background: #3b82f6;
            color: white;
            border-color: #3b82f6;
        }

        .notes-section {
            margin-top: 20px;
        }

        .notes-section textarea {
            width: 100%;
            min-height: 100px;
            padding: 12px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            resize: vertical;
            font-family: inherit;
        }

        .action-buttons {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
            margin-top: 20px;
            flex-wrap: wrap;
        }

        .call-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
            color: white;
            padding: 8px 16px;
            border-radius: 20px;
            text-decoration: none;
            font-size: 13px;
            font-weight: 500;
            transition: all 0.3s ease;
            box-shadow: 0 2px 4px rgba(56, 161, 105, 0.2);
            border: none;
            cursor: pointer;
            white-space: nowrap;
        }

        .call-btn:hover {
            background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(56, 161, 105, 0.3);
        }

        .call-btn:active {
            transform: translateY(0);
        }

        .list-selection {
            margin-bottom: 20px;
        }

        .list-cards {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }

        .list-card {
            background: white;
            border: 2px solid #e2e8f0;
            border-radius: 10px;
            padding: 20px;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .list-card:hover {
            border-color: #3b82f6;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.15);
        }

        .list-card h3 {
            color: #3b82f6;
            margin-bottom: 10px;
        }

        .list-card p {
            color: #718096;
            font-size: 14px;
        }

        /* Import Section */
        .import-section {
            background: #f7fafc;
            padding: 20px;
            border-radius: 8px;
            margin-bottom: 20px;
        }

        .import-section h3 {
            margin-bottom: 15px;
            color: #3b82f6;
        }

        .import-section textarea {
            width: 100%;
            height: 150px;
            padding: 12px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            font-family: monospace;
            font-size: 14px;
        }

        .import-format {
            background: #e6fffa;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 15px;
            border-left: 4px solid #38a169;
        }

        .import-format h4 {
            color: #38a169;
            margin-bottom: 10px;
        }

        .import-format code {
            background: #f7fafc;
            padding: 2px 4px;
            border-radius: 4px;
            font-family: monospace;
        }

        /* Responsive Design */
        @media (max-width: 768px) {
            .container {
                padding: 10px;
            }

            .header {
            background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
                flex-direction: column;
                gap: 10px;
                text-align: center;
            }

            .nav-buttons {
                justify-content: center;
            }

            .nav-btn {
                padding: 8px 16px;
                font-size: 14px;
            }

            .customer-details {
                grid-template-columns: 1fr;
            }

            .filter-row {
                flex-direction: column;
                align-items: stretch;
            }

            .action-buttons {
                justify-content: center;
            }

            .modal-content {
                margin: 10% auto;
                width: 95%;
                padding: 20px;
            }

            table {
                font-size: 14px;
            }

            th, td {
                padding: 8px;
            }

            .overview-stats {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 480px) {
            .login-form {
                padding: 20px;
            }

            .header h1 {
                font-size: 20px;
            }

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

            .list-cards {
                grid-template-columns: 1fr;
            }

            .btn {
                padding: 10px 20px;
                font-size: 14px;
            }
        }

        .hidden {
            display: none;
        }

        .alert {
            padding: 15px;
            margin-bottom: 20px;
            border-radius: 8px;
        }

        .alert-success {
            background: #f0fff4;
            border: 1px solid #9ae6b4;
            color: #22543d;
        }

        .alert-error {
            background: #fed7d7;
            border: 1px solid #feb2b2;
            color: #822727;
        }

        .loading {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 3px solid #f3f3f3;
            border-top: 3px solid #3b82f6;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

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

        .status-badge {
            display: inline-block;
            padding: 6px 12px;
            border-radius: 16px;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            white-space: nowrap;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            border: 1px solid transparent;
        }

        .status-nicht-kontaktiert { 
            background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%); 
            color: #4a5568; 
            border-color: #e2e8f0;
        }
        .status-kontaktiert { 
            background: linear-gradient(135deg, #bee3f8 0%, #90cdf4 100%); 
            color: #1a365d; 
            border-color: #63b3ed;
        }
        .status-interesse { 
            background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%); 
            color: #1a202c; 
            border-color: #68d391;
        }
        .status-nicht-interessiert { 
            background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%); 
            color: #742a2a; 
            border-color: #fc8181;
        }
        .status-blacklist { 
            background: linear-gradient(135deg, #feb2b2 0%, #f56565 100%); 
            color: #742a2a; 
            border-color: #f56565;
        }
        .status-vor-ort-termin { 
            background: linear-gradient(135deg, #fbb6ce 0%, #f687b3 100%); 
            color: #702459; 
            border-color: #ed64a6;
        }
        .status-wiedervorlage { 
            background: linear-gradient(135deg, #faf089 0%, #f6e05e 100%); 
            color: #744210; 
            border-color: #ecc94b;
        }
        .status-offen { 
            background: linear-gradient(135deg, #bee3f8 0%, #90cdf4 100%); 
            color: #1a365d; 
            border-color: #63b3ed;
        }
        .status-in-bearbeitung { 
            background: linear-gradient(135deg, #faf089 0%, #f6e05e 100%); 
            color: #744210; 
            border-color: #ecc94b;
        }
        .status-erledigt { 
            background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%); 
            color: #1a202c; 
            border-color: #68d391;
        }
   .status-vertrag, .status-vertraglich-vereinbart { 
            background: linear-gradient(135deg, #e9d5ff 0%, #c084fc 100%); 
            color: #581c87; 
            border-color: #a855f7;
        }
        /* Pagination und Tabellen-Verbesserungen */

/* Table Info und Einträge pro Seite */
.table-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 8px 8px 0 0;
    padding: 15px 20px;
}

.entries-per-page {
    display: flex;
    align-items: center;
    gap: 10px;
}

.entries-per-page label {
    font-size: 14px;
    color: #4a5568;
    font-weight: 500;
}

.entries-per-page select {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    min-width: 80px;
}

/* Table Scroll Container */
.table-scroll {
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-bottom: none;
}

/* Sticky Header */
.table-scroll table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.table-scroll table thead th {
    border-bottom: 2px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Custom Scrollbar */
.table-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.table-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.table-scroll::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    min-width: 40px;
    text-align: center;
    text-decoration: none;
}

.pagination-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.pagination-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9fafb;
}

.pagination-btn:disabled:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.pagination-info {
    color: #6b7280;
    font-size: 14px;
    margin: 0 15px;
    white-space: nowrap;
}

/* Quick Jump */
.pagination-jump {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
}

.pagination-jump label {
    font-size: 14px;
    color: #6b7280;
}

.pagination-jump input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

/* Loading State */
.table-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #6b7280;
}

.table-loading .loading {
    margin-right: 10px;
}

/* Empty State */
.table-empty {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

/* Responsive Pagination */
@media (max-width: 768px) {
    .table-info {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .pagination {
        flex-direction: column;
        gap: 15px;
    }
    
    .pagination-jump {
        margin-left: 0;
        justify-content: center;
    }
    
    .table-scroll {
        max-height: 60vh;
    }
}

@media (max-width: 480px) {
    .pagination-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 35px;
    }
    
    .pagination-info {
        font-size: 12px;
    }
    
    .table-info {
        padding: 10px 15px;
    }
    
    .entries-per-page {
        flex-direction: column;
        gap: 5px;
        align-items: center;
    }
}
/* CSS Erweiterungen für Vertragseinsicht - zu styles.css hinzufügen */

/* Contract Modal Styling */
.contract-modal {
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
}

.contract-info-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.contract-info-box h3 {
    color: #0369a1;
    margin-bottom: 15px;
    font-size: 18px;
}

.contract-info-box p {
    margin: 8px 0;
    font-size: 14px;
}

/* Contracts List */
.contracts-list {
    margin-bottom: 30px;
}

.contracts-list h3 {
    color: #374151;
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
}

.contract-item {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.contract-item:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.contract-icon {
    font-size: 32px;
    margin-right: 15px;
    min-width: 50px;
    text-align: center;
}

.contract-info {
    flex: 1;
    margin-right: 15px;
}

.contract-info h4 {
    margin: 0 0 5px 0;
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
}

.contract-info p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.4;
}

.contract-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.contract-actions button {
    white-space: nowrap;
    font-size: 12px;
    padding: 6px 12px;
}

/* Contract Content Display */
.contract-content-display {
    border-top: 2px solid #e5e7eb;
    padding-top: 25px;
    margin-top: 25px;
}

.contract-content-display h3 {
    color: #374151;
    margin-bottom: 20px;
    font-size: 18px;
}

.contract-html-content {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.contract-pdf-content {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.contract-pdf-content iframe {
    border: 1px solid #d1d5db;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.pdf-fallback {
    margin-top: 15px;
    padding: 10px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    font-size: 14px;
    color: #92400e;
}

.contract-content-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

/* Contract Status Indicators */
.status-badge.status-vertrag::after {
    content: " 📋";
    margin-left: 4px;
}

/* Contract Button in Order Table */
.order-contract-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 4px;
}

.order-contract-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

/* View Contract Button in Modal */
#viewContractBtn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: white;
    position: relative;
    overflow: hidden;
}

#viewContractBtn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

#viewContractBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#viewContractBtn:hover::before {
    left: 100%;
}

/* Contract Modal Responsive */
@media (max-width: 768px) {
    .contract-modal {
        width: 95%;
        max-width: 95%;
        margin: 2% auto;
        padding: 15px;
    }
    
    .contract-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .contract-info {
        margin-right: 0;
        text-align: center;
    }
    
    .contract-actions {
        justify-content: center;
        width: 100%;
    }
    
    .contract-content-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .contract-html-content {
        padding: 10px;
        font-size: 14px;
    }
    
    .contract-pdf-content iframe {
        width: 100%;
        height: 400px;
    }
}

@media (max-width: 480px) {
    .contract-modal {
        width: 98%;
        margin: 1% auto;
        padding: 10px;
    }
    
    .contract-actions button {
        font-size: 11px;
        padding: 5px 8px;
    }
    
    .contract-pdf-content iframe {
        height: 300px;
    }
}

/* Animation for Contract Loading */
.contract-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #6b7280;
}

.contract-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

/* Contract Status Badge Enhancement */
.status-badge.status-vertrag {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    color: white;
    font-weight: 600;
    position: relative;
}

.status-badge.status-vertrag::before {
    content: '✓';
    position: absolute;
    right: -8px;
    top: -8px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    font-weight: bold;
}

/* Print Styles for Contracts */
@media print {
    .contract-modal .close,
    .contract-content-actions,
    .contract-actions,
    .no-print {
        display: none !important;
    }
    
    .contract-modal {
        box-shadow: none;
        border: none;
        max-width: none;
        margin: 0;
        padding: 0;
    }
    
    .contract-html-content {
        border: none;
        box-shadow: none;
        padding: 0;
        max-height: none;
        overflow: visible;
    }
}

/* ==================== MODAL STYLES ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8f9fa;
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 25px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

/* ==================== SEARCH RESULTS STYLES ==================== */
.search-results {
    position: absolute;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    width: calc(100% - 24px);
    margin-top: 5px;
}

.search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

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

.search-result-item:hover {
    background: #f7fafc;
}

.search-result-item strong {
    color: #2d3748;
    font-size: 14px;
}

.search-result-item small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
}
/* Dark Mode Toggle Button */
.dark-mode-toggle {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

/* Dark Mode Styles */
body.dark-mode {
    background: #1a1a2e;
    color: #e0e0e0;
}

body.dark-mode .app-container {
    background: #16213e;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

body.dark-mode .header {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f2744 100%);
}

body.dark-mode .navigation {
    background: #1a1a2e;
    border-bottom-color: #2a2a4a;
}

body.dark-mode .nav-btn {
    color: #a0a0a0;
}

body.dark-mode .nav-btn:hover,
body.dark-mode .nav-btn.active {
    background: #3b82f6;
    color: white;
}

body.dark-mode .section {
    background: #16213e;
}

body.dark-mode .card,
body.dark-mode .stat-card,
body.dark-mode .security-card {
    background: #1a1a2e !important;
    border-color: #2a2a4a;
    color: #e0e0e0 !important;
}

body.dark-mode .security-card-value,
body.dark-mode .security-card-label,
body.dark-mode .security-card h3,
body.dark-mode .security-card h4,
body.dark-mode .security-card p,
body.dark-mode .security-card span,
body.dark-mode .security-card label,
body.dark-mode .security-card div {
    color: #e0e0e0 !important;
}

body.dark-mode .security-card input,
body.dark-mode .security-card select {
    background: #16213e !important;
    border-color: #3a3a5a !important;
    color: #e0e0e0 !important;
}

body.dark-mode .security-tab-content {
    background: #1a1a2e;
}

body.dark-mode .security-tabs button {
    background: #2a2a4a;
    color: #e0e0e0;
}

body.dark-mode .security-tabs button.active,
body.dark-mode .security-tabs button:hover {
    background: #3b82f6;
    color: white;
}

body.dark-mode .stat-card-value,
body.dark-mode .stat-card-label,
body.dark-mode .stat-number,
body.dark-mode .card-title,
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, body.dark-mode h4,
body.dark-mode p, body.dark-mode span, body.dark-mode label,
body.dark-mode .section-title,
body.dark-mode .info-label,
body.dark-mode .info-value,
body.dark-mode .customer-name,
body.dark-mode .order-info,
body.dark-mode legend {
    color: #e0e0e0 !important;
}

body.dark-mode .btn {
    border-color: #2a2a4a;
}

body.dark-mode .btn-secondary {
    background: #2a2a4a;
    color: #e0e0e0;
}

body.dark-mode .btn-secondary:hover {
    background: #3a3a5a;
}

body.dark-mode fieldset {
    border-color: #2a2a4a;
}

body.dark-mode .badge {
    background: #2a2a4a;
    color: #e0e0e0;
}

body.dark-mode .table,
body.dark-mode table {
    background: #1a1a2e;
    color: #e0e0e0;
}

body.dark-mode .table th,
body.dark-mode table th {
    background: #0f2744;
    color: #e0e0e0 !important;
}

body.dark-mode .table td,
body.dark-mode table td {
    border-color: #2a2a4a;
    color: #e0e0e0 !important;
}

body.dark-mode .table td a,
body.dark-mode table td a {
    color: #60a5fa !important;
}

body.dark-mode .table tr:hover,
body.dark-mode table tr:hover {
    background: #2a2a4a;
}

body.dark-mode .table td span,
body.dark-mode table td span,
body.dark-mode .table td div,
body.dark-mode table td div {
    color: #e0e0e0 !important;
}

body.dark-mode .status-badge,
body.dark-mode .badge {
    color: white !important;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: #1a1a2e;
    border-color: #2a2a4a;
    color: #e0e0e0;
}

body.dark-mode input::placeholder {
    color: #666;
}

body.dark-mode .modal-content {
    background: #16213e;
    color: #e0e0e0;
}

body.dark-mode .modal-header {
    background: #0f2744;
    border-color: #2a2a4a;
}

body.dark-mode .search-result-item:hover {
    background: #2a2a4a;
}

body.dark-mode .search-result-item strong {
    color: #e0e0e0;
}

/* Alle Inline-Hintergründe überschreiben */
body.dark-mode [style*="background: #f8f9fa"],
body.dark-mode [style*="background:#f8f9fa"],
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background:white"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background:#fff"] {
    background: #1a1a2e !important;
    color: #e0e0e0 !important;
}

body.dark-mode [style*="border: 1px solid #dee2e6"],
body.dark-mode [style*="border:1px solid #dee2e6"] {
    border-color: #2a2a4a !important;
}

/* Firewall Section */
body.dark-mode .firewall-section,
body.dark-mode #firewall-content,
body.dark-mode .firewall-rules,
body.dark-mode .firewall-log {
    background: #1a1a2e !important;
    color: #e0e0e0 !important;
}

/* KI-Analysen Section */
body.dark-mode #aiAnalysisSection,
body.dark-mode .ai-analysis-content,
body.dark-mode #aiAnalysisResults {
    background: #1a1a2e !important;
    color: #e0e0e0 !important;
}

body.dark-mode #aiAnalysisResults div,
body.dark-mode #aiAnalysisResults span,
body.dark-mode #aiAnalysisResults p {
    color: #e0e0e0 !important;
}

/* Bot-Erkennung Section */
body.dark-mode #botdetection-content,
body.dark-mode .bot-detection-content {
    background: #1a1a2e !important;
    color: #e0e0e0 !important;
}

/* Filter Rows */
body.dark-mode .filter-row,
body.dark-mode .filters {
    background: #16213e !important;
    color: #e0e0e0 !important;
}

/* Table Container */
body.dark-mode .table-container,
body.dark-mode .table-scroll,
body.dark-mode .table-info {
    background: #1a1a2e !important;
    color: #e0e0e0 !important;
}

/* List Cards */
body.dark-mode .list-card,
body.dark-mode .list-cards {
    background: #1a1a2e !important;
    color: #e0e0e0 !important;
    border-color: #2a2a4a !important;
}

body.dark-mode .list-card:hover {
    background: #2a2a4a !important;
}

/* Alert Boxes */
body.dark-mode .alert {
    background: #1a1a2e !important;
    border-color: #2a2a4a !important;
    color: #e0e0e0 !important;
}

/* Login Form Dark Mode */
body.dark-mode .login-form {
    background: #16213e !important;
    color: #e0e0e0 !important;
}

body.dark-mode .login-form input {
    background: #1a1a2e !important;
    border-color: #2a2a4a !important;
    color: #e0e0e0 !important;
}

/* Overview Stats */
body.dark-mode .overview-stats {
    background: transparent !important;
}

/* Pending Orders, Bot Detection Tabs */
body.dark-mode #pending-content,
body.dark-mode #settings-content,
body.dark-mode #security-settings {
    background: #1a1a2e !important;
    color: #e0e0e0 !important;
}

body.dark-mode #pending-content div,
body.dark-mode #pending-content span,
body.dark-mode #pending-content p,
body.dark-mode #settings-content div,
body.dark-mode #settings-content span {
    color: #e0e0e0 !important;
}

/* Backup Section */
body.dark-mode #backupsSection,
body.dark-mode .backup-list,
body.dark-mode .backup-item {
    background: #1a1a2e !important;
    color: #e0e0e0 !important;
}

/* Server Monitoring */
body.dark-mode #serverMonitoringSection div,
body.dark-mode #serverMonitoringSection span {
    color: #e0e0e0 !important;
}

/* Email Monitoring */
body.dark-mode #emailMonitoringSection div,
body.dark-mode #emailMonitoringSection span {
    color: #e0e0e0 !important;
}

/* Support Section */
body.dark-mode #supportSection div,
body.dark-mode #supportSection span {
    color: #e0e0e0 !important;
}

/* Pre und Code Blöcke */
body.dark-mode pre,
body.dark-mode code {
    background: #0f172a !important;
    color: #e0e0e0 !important;
    border-color: #2a2a4a !important;
}

/* CrowdSec Tabellen */
body.dark-mode #crowdsecDecisionsTable,
body.dark-mode #crowdsecAlertsTable,
body.dark-mode #crowdsecStatusCards {
    background: #1a1a2e !important;
    color: #e0e0e0 !important;
}

body.dark-mode #crowdsecDecisionsTable table,
body.dark-mode #crowdsecAlertsTable table,
body.dark-mode #crowdsecDecisionsTable td,
body.dark-mode #crowdsecAlertsTable td,
body.dark-mode #crowdsecDecisionsTable th,
body.dark-mode #crowdsecAlertsTable th,
body.dark-mode #crowdsecDecisionsTable tr,
body.dark-mode #crowdsecAlertsTable tr {
    background: #1a1a2e !important;
    color: #e0e0e0 !important;
    border-color: #2a2a4a !important;
}

body.dark-mode #crowdsecDecisionsTable span,
body.dark-mode #crowdsecAlertsTable span,
body.dark-mode #crowdsecDecisionsTable div,
body.dark-mode #crowdsecAlertsTable div,
body.dark-mode #crowdsecStatusCards div,
body.dark-mode #crowdsecStatusCards span {
    color: #e0e0e0 !important;
}

body.dark-mode #crowdsecDecisionsTable th,
body.dark-mode #crowdsecAlertsTable th {
    background: #0f2744 !important;
}

body.dark-mode #crowdsecDecisionsTable tr:hover,
body.dark-mode #crowdsecAlertsTable tr:hover {
    background: #2a2a4a !important;
}
