﻿/* admin.css - Admin page */

/* ==================== ADMIN PAGE ==================== */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1200px) {
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.admin-stat-card {
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.admin-stat-icon.users { background: #dbeafe; color: #3b82f6; }
.admin-stat-icon.accounts { background: #dcfce7; color: #198754; }
.admin-stat-icon.active { background: #fef3c7; color: #f59e0b; }
.admin-stat-icon.pending { background: #fee2e2; color: #ef4444; }

.admin-stat-info h3 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
}

.admin-stat-info p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.admin-section {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.admin-section-header {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    padding: 1.25rem 1.5rem;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-section-header h5 {
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-section-body {
    padding: 1.5rem;
}

.user-list-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s ease;
}

.user-list-item:hover {
    background: #f9fafb;
}

.user-list-item:last-child {
    border-bottom: none;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.user-avatar.admin-role {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.user-avatar.standard-role {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #16a34a;
}

.user-info {
    flex: 1;
}

.user-info h6 {
    margin: 0 0 0.25rem 0;
    font-weight: 600;
}

.user-info p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.user-role-tag {
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 1rem;
}

.user-role-tag.admin {
    background: #fef2f2;
    color: #dc2626;
}

.user-role-tag.standard {
    background: #f0fdf4;
    color: #16a34a;
}

.user-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 1rem;
}

.user-status.active { background: #22c55e; }
.user-status.inactive { background: #d1d5db; }

.user-actions {
    display: flex;
    gap: 0.5rem;
}

.user-actions .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.account-access-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.account-access-tag {
    background: #e0f2fe;
    color: #0369a1;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
}

/* Analytics Drilldown Modal */
.analytics-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.analytics-modal.show {
    display: flex;
}

.analytics-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.analytics-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
    color: white;
}

.analytics-modal-header h5 {
    margin: 0;
    font-weight: 600;
}

.analytics-modal-header .close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.analytics-modal-header .close-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.analytics-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.analytics-modal-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.analytics-modal-summary .summary-stat {
    flex: 1;
    text-align: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.analytics-modal-summary .summary-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #198754;
}

.analytics-modal-summary .summary-label {
    font-size: 0.85rem;
    color: #6b7280;
}

.analytics-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #f8fafc;
}

/* Add User Modal */
.add-user-modal {
    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: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.add-user-modal.show {
    opacity: 1;
    visibility: visible;
}

.add-user-modal-content {
    background: #fff;
    border-radius: 1rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.add-user-modal.show .add-user-modal-content {
    transform: scale(1);
}

.add-user-modal-header {
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
    padding: 1.5rem;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.add-user-modal-header h5 {
    margin: 0;
    font-weight: 600;
}

.add-user-modal-header .close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-user-modal-body {
    padding: 1.5rem;
}

.add-user-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}
