/* ===============================================
   components.css
   Erweiterte Styles für Admin UI mit funktionierenden Modals
   =============================================== */

:root {
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --spacing-xs: 6px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 18px;
    --spacing-xl: 24px;
    --font-sm: 13px;
    --font-base: 15px;
    --font-lg: 18px;
    --font-xl: 22px;
    --text-primary: #2c3e50;
    --text-secondary: #64748b;
    --text-light: #ffffff;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #94d2ff 0%, #8b5cf6 100%);
    --success-gradient: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #fb923c 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    --shadow-light: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-medium: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-heavy: 0 12px 40px rgba(0,0,0,0.12);
    --card-shadow: 0 6px 20px rgba(0,0,0,0.06);
    --card-shadow-hover: 0 12px 36px rgba(0,0,0,0.10);
}

/* ===============================================
   MODAL STYLES - FIXED
   =============================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal.active {
    display: flex !important;
}

.modal-content {
    background: #ffffff;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
    overflow: hidden;
}

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

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    transform: scale(1.1);
}

.modal-body {
    padding: 1.5rem;
    background: #ffffff;
    color: var(--text-primary);
    overflow-y: auto;
    flex: 1;
}

.modal-body .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #ffffff;
    color: var(--text-primary);
    box-sizing: border-box;
}

.modal-body .form-control:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.modal-body .form-control:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    background: #f9fafb;
    flex-shrink: 0;
}

/* ===============================================
   BUTTON STYLES
   =============================================== */

.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5558e3 0%, #7c4ee8 100%);
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--text-primary);
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

/* Small buttons */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* ===============================================
   EMPLOYEE ACTIONS (AdminUI Buttons)
   =============================================== */

.employee-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.employee-actions .btn {
    min-width: auto;
    padding: 0.375rem 0.625rem;
    font-size: 0.875rem;
}

.employee-actions .btn:hover {
    transform: scale(1.05);
}

/* ===============================================
   TABLE STYLES
   =============================================== */

.table-container {
    background: #ffffff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table th {
    background: #f9fafb;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
}

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

/* ===============================================
   FORM STYLES
   =============================================== */

.form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.625rem 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    background: #ffffff;
    color: var(--text-primary);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9ca3af;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ===============================================
   BADGE STYLES
   =============================================== */

.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* ===============================================
   DASHBOARD CARDS
   =============================================== */

.dashboard-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dashboard-card:hover {
    box-shadow: var(--card-shadow-hover);
}

.dashboard-card h3,
.dashboard-card h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===============================================
   ICON COLORS
   =============================================== */

.fas.fa-users { color: #6366f1; }
.fas.fa-user-plus { color: #10b981; }
.fas.fa-key { color: #f59e0b; }
.fas.fa-edit { color: #8b5cf6; }
.fas.fa-trash { color: #ef4444; }
.fas.fa-file-export { color: #06b6d4; }
.fas.fa-info-circle { color: #3b82f6; }

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
        margin: 10px;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 0.75rem 1rem;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
    
    .employee-actions {
        flex-direction: column;
    }
    
    .employee-actions .btn {
        width: 100%;
    }
    .modal-overlay {
    position: fixed;
    top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.5);
    display:flex;
    align-items:center;
    justify-content:center;
    z-index:2000;
}
.modal-card {
    background:white;
    padding:2rem;
    border-radius:12px;
    width:400px;
    max-width:90%;
    box-shadow:0 10px 30px rgba(0,0,0,0.3);
}
.modal-card h3 {
    margin-top:0;
}

