/**
 * admin.css
 * Styles für Admin Dashboard und Benutzerverwaltung
 */

/* ============================================================================
   ADMIN LAYOUT
   ============================================================================ */

.admin-page {
    min-height: 100vh;
    background-color: var(--color-bg);
}

.admin-header {
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: var(--spacing-md) var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.admin-header-left h1 {
    font-size: 1.25rem;
    margin: 0;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.admin-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-xl);
}

/* ============================================================================
   STATS CARDS
   ============================================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.stat-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.stat-icon.pending { background: #fff3e0; }
.stat-icon.active { background: #e8f5e9; }
.stat-icon.inactive { background: #ffebee; }
.stat-icon.total { background: #e3f2fd; }

.stat-content h3 {
    font-size: 1.75rem;
    margin: 0;
    line-height: 1;
}

.stat-content p {
    margin: var(--spacing-xs) 0 0;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

/* ============================================================================
   USER TABLE
   ============================================================================ */

.users-section {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.users-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.users-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.users-filters {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    font-size: 0.875rem;
    cursor: pointer;
}

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

.users-table-wrapper {
    overflow-x: auto;
}

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

.users-table th,
.users-table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.users-table th {
    background: #fafafa;
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table tr:hover {
    background-color: #fafafa;
}

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

/* ============================================================================
   STATUS & ROLE BADGES
   ============================================================================ */

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-pending {
    background: #fff3e0;
    color: #e65100;
}

.badge-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-inactive {
    background: #ffebee;
    color: #c62828;
}

.badge-admin {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-editor {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-viewer {
    background: #f5f5f5;
    color: #616161;
}

/* ============================================================================
   ACTION BUTTONS
   ============================================================================ */

.action-buttons {
    display: flex;
    gap: var(--spacing-xs);
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-fast);
}

.btn-icon:hover {
    background-color: var(--color-border);
}

.btn-icon.activate {
    color: #2e7d32;
}

.btn-icon.activate:hover {
    background-color: #e8f5e9;
}

.btn-icon.deactivate {
    color: #e65100;
}

.btn-icon.deactivate:hover {
    background-color: #fff3e0;
}

.btn-icon.delete {
    color: #c62828;
}

.btn-icon.delete:hover {
    background-color: #ffebee;
}

/* ============================================================================
   EMPTY STATE
   ============================================================================ */

.empty-state {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    color: var(--color-text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

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

@media (max-width: 768px) {
    .admin-header-content {
        flex-direction: column;
        gap: var(--spacing-md);
    }

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

    .users-table th,
    .users-table td {
        padding: var(--spacing-sm);
        font-size: 0.875rem;
    }

    .users-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
