/* Users Tab Styles */
.users-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.user-stat-card {
    background: var(--bg-card, white);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--border, #e5e7eb);
}

.user-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.user-stat-icon.total { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: white; }
.user-stat-icon.active { background: linear-gradient(135deg, #10b981, #34d399); color: white; }
.user-stat-icon.inactive { background: linear-gradient(135deg, #ef4444, #f87171); color: white; }
.user-stat-icon.admins { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: white; }
.user-stat-icon.business { background: linear-gradient(135deg, #ec4899, #f472b6); color: white; }
.user-stat-icon.users { background: linear-gradient(135deg, #3b82f6, #60a5fa); color: white; }

.user-stat-info h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

.user-stat-info p {
    font-size: 0.7rem;
    margin: 0;
    color: #6b7280;
}

/* Users Filters */
.users-filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-card, white);
    border-radius: 16px;
    border: 1px solid var(--border, #e5e7eb);
}

/* Users Table */
.users-table-wrapper {
    background: var(--bg-card, white);
    border-radius: 20px;
    border: 1px solid var(--border, #e5e7eb);
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.users-table th,
.users-table td {
    padding: 1rem;
    text-align: left;
}

.users-table th {
    background: var(--bg-primary, #f9fafb);
    font-weight: 600;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.users-table tr:hover td {
    background: var(--bg-primary, #f9fafb);
}

/* User Cell */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-placeholder {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.user-id {
    font-size: 0.7rem;
    color: #6b7280;
}

/* Role Badges */
.role-badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.role-admin {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.role-business {
    background: rgba(236, 72, 153, 0.15);
    color: #db2777;
}

.role-user {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

/* Status Badges */
.status-badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.status-badge-modern.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.status-badge-modern.status-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

/* User Actions */
.user-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.user-action-btn {
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s;
}

.user-action-btn.view { background: rgba(99, 102, 241, 0.1); color: #6366f1; }
.user-action-btn.view:hover { background: #6366f1; color: white; }
.user-action-btn.edit { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.user-action-btn.edit:hover { background: #3b82f6; color: white; }
.user-action-btn.toggle { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.user-action-btn.toggle:hover { background: #f59e0b; color: white; }
.user-action-btn.sms { background: rgba(37, 211, 102, 0.1); color: #25D366; }
.user-action-btn.sms:hover { background: #25D366; color: white; }
.user-action-btn.delete { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.user-action-btn.delete:hover { background: #ef4444; color: white; }

/* User View Modal */
.user-view-modal .modal-body {
    padding: 0;
}

.user-view-header {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-radius: 16px 16px 0 0;
}

.user-view-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.user-view-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-view-avatar-placeholder {
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
}

.user-view-name {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
}

.user-view-role {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 1rem;
    background: rgba(255,255,255,0.2);
    border-radius: 30px;
    font-size: 0.8rem;
}

.user-view-details {
    padding: 1.5rem;
}

.user-view-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.user-view-detail-label {
    font-weight: 500;
    color: #6b7280;
}

.user-view-detail-value {
    color: #111827;
}

@media (max-width: 1200px) {
    .users-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .users-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .users-filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
}
/* Users Card View */
.users-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.5rem;
}

.user-card {
    background: var(--bg-card, white);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border, #e5e7eb);
    transition: all 0.3s ease;
    position: relative;
}

.user-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

/* Role Corner Badge */
.role-corner-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    color: white;
}

.role-corner-badge.role-admin { background: #f59e0b; }
.role-corner-badge.role-business { background: #ec4899; }
.role-corner-badge.role-user { background: #3b82f6; }

.user-card-header {
    padding: 1.25rem;
    background: var(--bg-primary, #f9fafb);
    border-bottom: 1px solid var(--border, #e5e7eb);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.user-avatar-lg {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-secondary, #f3f4f6);
    border: 2px solid var(--primary, #6366f1);
    flex-shrink: 0;
}

.user-avatar-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder-lg {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
}

.user-card-info {
    flex: 1;
}

.user-card-info .user-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--text-primary, #111827);
}

.user-card-info .user-id {
    font-size: 0.7rem;
    color: var(--text-muted, #6b7280);
}

.user-contact-info {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.user-contact-info .contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary, #4b5563);
    margin-bottom: 0.5rem;
}

.user-contact-info .contact-item:last-child {
    margin-bottom: 0;
}

.user-contact-info .contact-item i {
    width: 16px;
    color: var(--primary, #6366f1);
}

.user-stats-row {
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 1.25rem;
    background: var(--bg-primary, #f9fafb);
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.user-stat-item {
    text-align: center;
}

.user-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
}

.user-stat-label {
    font-size: 0.6rem;
    color: var(--text-muted, #6b7280);
}

.user-actions-row {
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* List View Compact */
.users-list-view {
    background: var(--bg-card, white);
    border-radius: 20px;
    border: 1px solid var(--border, #e5e7eb);
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.users-table th,
.users-table td {
    padding: 0.75rem 1rem;
    text-align: left;
}

.users-table th {
    background: var(--bg-primary, #f9fafb);
    font-weight: 600;
    color: var(--text-primary, #111827);
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.users-table td {
    color: var(--text-secondary, #4b5563);
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.users-table tr:hover td {
    background: var(--bg-primary, #f9fafb);
}

.joined-date {
    font-size: 0.7rem;
    color: var(--text-muted, #6b7280);
    margin-top: 0.25rem;
}

.joined-date i {
    margin-right: 0.25rem;
    font-size: 0.65rem;
}

.business-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary, #6366f1);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    min-width: 30px;
}

.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .users-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .users-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (max-width: 768px) {
    .users-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .users-cards-grid {
        grid-template-columns: 1fr;
    }
    .user-actions-row {
        flex-direction: column;
    }
    .action-group, .contact-group {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .users-stats-grid {
        grid-template-columns: 1fr;
    }
}
/* Delete Progress Bar */
.delete-progress {
    margin-top: 1rem;
}

.progress-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.progress {
    height: 8px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.3s ease;
}

.progress-bar.bg-danger {
    background-color: #ef4444 !important;
}

.progress-bar.bg-success {
    background-color: #10b981 !important;
}

/* Update delete list styles */
.delete-list {
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    background: #f9fafb;
    border-radius: 10px;
    padding: 0.75rem;
}

.delete-list li {
    padding: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.delete-list li:last-child {
    border-bottom: none;
}

.delete-list li i {
    width: 20px;
    color: #ef4444;
}

.warning-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 0.75rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ef4444;
}

.delete-warning > i {
    font-size: 3rem;
    color: #ef4444;
    margin-bottom: 1rem;
    display: block;
    text-align: center;
}
/* Selection Toolbar */
.selection-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    color: white;
}

.selection-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.selection-btn {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.selection-btn.select-all {
    background: #10b981;
    color: white;
}

.selection-btn.select-all:hover:not(:disabled) {
    background: #059669;
}

.selection-btn.unselect-all {
    background: #f59e0b;
    color: white;
}

.selection-btn.unselect-all:hover:not(:disabled) {
    background: #d97706;
}

.selection-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.selection-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.bulk-actions-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bulk-action-btn {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.bulk-action-btn.activate {
    background: #10b981;
    color: white;
}

.bulk-action-btn.activate:hover:not(:disabled) {
    background: #059669;
}

.bulk-action-btn.deactivate {
    background: #f59e0b;
    color: white;
}

.bulk-action-btn.deactivate:hover:not(:disabled) {
    background: #d97706;
}

.bulk-action-btn.delete {
    background: #ef4444;
    color: white;
}

.bulk-action-btn.delete:hover:not(:disabled) {
    background: #dc2626;
}

.bulk-action-btn.clear {
    background: #6b7280;
    color: white;
}

.bulk-action-btn.clear:hover:not(:disabled) {
    background: #4b5563;
}

.bulk-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* User Select Checkbox */
.user-select {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
}

.user-select input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.user-card-header {
    padding-left: 2rem;
}

/* Bulk Loading Overlay */
.bulk-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bulk-loading-overlay .loading-spinner {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    min-width: 250px;
}

.bulk-loading-overlay .loading-spinner i {
    color: #6366f1;
    margin-bottom: 1rem;
}

/* Table checkbox alignment */
.users-table th input[type="checkbox"],
.users-table td input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* User info wrapper */
.user-info-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .selection-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .selection-buttons {
        justify-content: center;
    }
    
    .bulk-actions-buttons {
        justify-content: center;
    }
    
    .user-card-header {
        flex-direction: column;
        text-align: center;
        padding-left: 1rem;
    }
    
    .user-select {
        position: absolute;
        top: 8px;
        left: 8px;
    }
    
    .users-table {
        min-width: 650px;
    }
}
/* Completion Tooltip Styles - No Points */
.user-completion-section {
    position: relative;
    background: var(--bg-secondary, #f8fafc);
    padding: 10px 12px;
    border-radius: 12px;
    margin: 10px 0;
}

.completion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.completion-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.completion-tooltip-container {
    position: relative;
    display: inline-block;
}

.completion-info-btn {
    background: none;
    border: none;
    color: #6366f1;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
}

.completion-info-btn:hover {
    color: #4f46e5;
}

.completion-tooltip {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    min-width: 260px;
    max-width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

/* Dark mode */
body.dark-mode .completion-tooltip {
    background: #1e293b;
    border-color: #334155;
}

.tooltip-header {
    background: #fef3c7;
    padding: 10px 12px;
    color: #d97706;
    font-size: 12px;
    font-weight: 600;
    border-bottom: 1px solid #fde68a;
}

.tooltip-header i {
    margin-right: 8px;
}

body.dark-mode .tooltip-header {
    background: #451a03;
    border-bottom-color: #78350f;
    color: #fbbf24;
}

.tooltip-body {
    max-height: 250px;
    overflow-y: auto;
    padding: 8px 0;
}

.tooltip-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
}

.tooltip-item:last-child {
    border-bottom: none;
}

body.dark-mode .tooltip-item {
    border-bottom-color: #334155;
}

.tooltip-item i {
    color: #f59e0b;
    font-size: 12px;
    flex-shrink: 0;
}

.tooltip-item-text {
    flex: 1;
    color: #334155;
}

body.dark-mode .tooltip-item-text {
    color: #cbd5e1;
}

.tooltip-complete {
    padding: 20px;
    text-align: center;
    color: #10b981;
}

.tooltip-complete i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

/* Arrow indicator */
.completion-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 12px;
    width: 12px;
    height: 12px;
    background: white;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    transform: rotate(45deg);
}

body.dark-mode .completion-tooltip::after {
    background: #1e293b;
    border-right-color: #334155;
    border-bottom-color: #334155;
}

/* Completion bar styles */
.completion-bar-mini {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin: 6px 0;
}

body.dark-mode .completion-bar-mini {
    background: #334155;
}

.completion-fill-mini {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.completion-percent-text {
    font-size: 10px;
    font-weight: 600;
    color: #6366f1;
    text-align: right;
}

.completion-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.completion-percent-mini {
    font-size: 11px;
    font-weight: 600;
    color: #1e293b;
}

body.dark-mode .completion-percent-mini {
    color: #e2e8f0;
}

.view-missing-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6366f1;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}

.view-missing-btn:hover {
    background: #eef2ff;
    color: #4f46e5;
}