/**
 * User Management Styles (Version 3.0.0)
 */

/* Users Page Header */
.users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.users-header p {
    margin: 0;
    color: #6c757d;
}

/* Role Description */
.role-description {
    margin-top: 0.5rem;
}

.info-box {
    background: #e7f3ff;
    border-left: 4px solid #667eea;
    padding: 1rem;
    border-radius: 6px;
    color: #2c3e50;
    font-size: 0.9rem;
}

/* Checkbox Group */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.checkbox-label:hover {
    background: #f8f9fa;
    border-color: #667eea;
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

.checkbox-label input[type="checkbox"]:checked + span {
    color: #667eea;
    font-weight: 600;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Role Badges */
.badge-role-admin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.badge-role-manager {
    background-color: #17a2b8;
    color: white;
}

.badge-role-clerk {
    background-color: #28a745;
    color: white;
}

.badge-role-view_only {
    background-color: #6c757d;
    color: white;
}

/* Action Badges */
.badge-action-login {
    background-color: #17a2b8;
    color: white;
}

.badge-action-create {
    background-color: #28a745;
    color: white;
}

.badge-action-update {
    background-color: #ffc107;
    color: #212529;
}

.badge-action-delete {
    background-color: #dc3545;
    color: white;
}

/* Company Access Column */
.company-access {
    max-width: 200px;
    font-size: 0.85rem;
    color: #6c757d;
}

/* Activity Log Section */
.activity-log-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-top: 2rem;
}

.activity-log-section h3 {
    color: #667eea;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.activity-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.activity-filters select {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.activity-filters button {
    padding: 0.5rem 1rem;
}

/* Activity Log Table */
#activity-log-table {
    font-size: 0.9rem;
}

#activity-log-table td {
    vertical-align: middle;
}

/* User Status Indicators */
.user-status-active {
    color: #28a745;
    font-weight: 600;
}

.user-status-inactive {
    color: #6c757d;
    font-weight: 600;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.5rem;
    height: 4px;
    border-radius: 2px;
    background: #e9ecef;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: all 0.3s;
}

.password-strength-weak {
    width: 33%;
    background: #dc3545;
}

.password-strength-medium {
    width: 66%;
    background: #ffc107;
}

.password-strength-strong {
    width: 100%;
    background: #28a745;
}

/* User Actions Buttons */
.actions button.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .users-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .activity-filters {
        flex-direction: column;
    }
    
    .activity-filters select {
        width: 100%;
    }
    
    .company-access {
        max-width: none;
    }
}

/* Empty State */
.no-data {
    text-align: center;
    color: #6c757d;
    padding: 2rem;
    font-style: italic;
}

/* Form Grid Adjustments for Users */
.form-group.full-width {
    grid-column: 1 / -1;
}

/* User Info Cards (for future use) */
.user-info-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 1rem;
}

.user-info-card h4 {
    color: #667eea;
    margin-bottom: 1rem;
}

.user-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.user-info-item {
    display: flex;
    flex-direction: column;
}

.user-info-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.user-info-value {
    font-weight: 600;
    color: #2c3e50;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: #667eea;
}

.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
