/* ========================================
   DASHBOARD COMPONENTS - GLOBAL CSS
   Contains reusable styles extracted from individual pages
   ======================================== */

/* --- Customer/User Avatars --- */
.customer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #FFD700);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: 700;
    font-size: 1.1rem;
    position: relative;
    flex-shrink: 0;
}

.customer-avatar-sm {
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
}

/* --- Badges --- */
.online-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: var(--success, #22C55E);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
}

.online-badge iconify-icon {
    font-size: 10px;
    color: white;
}

.online-badge-sm {
    width: 14px;
    height: 14px;
}

.inline-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    background: rgba(34, 197, 94, 0.1);
    color: var(--success, #22C55E);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: 500;
}

/* --- Category Icons & Colors --- */
.category-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.color-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: var(--text);
}

/* --- Icon Picker --- */
.icon-picker-box {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    background: var(--bg);
}

.icon-search {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    background: var(--surface);
}

.icon-search:focus {
    outline: none;
    border-color: var(--primary);
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    max-height: 180px;
    overflow-y: auto;
}

.icon-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    cursor: pointer;
    background: var(--surface);
    border: 2px solid transparent;
    transition: all 0.15s;
}

.icon-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.icon-item.selected {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
}

.icon-item iconify-icon {
    font-size: 1.4rem;
    color: #6b7280;
}

.icon-item.selected iconify-icon {
    color: var(--primary);
}

.icon-item:hover iconify-icon {
    color: #374151;
}

/* --- Stat Icons Colors --- */
.stat-icon.stat-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success, #22C55E);
}

.stat-icon.stat-purple {
    background: rgba(168, 85, 247, 0.15);
    color: #A855F7;
}

.stat-icon.stat-blue {
    background: rgba(59, 130, 246, 0.15);
    color: #3B82F6;
}

/* --- Modals Helper Classes --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem
}

.modal-overlay .modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: var(--error);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Form Styles for Modals */
.form-group {
    margin-bottom: 1rem
}

.form-label {
    display: block;
    margin-bottom: .5rem;
    font-weight: 500;
    color: var(--text-secondary)
}

.form-input {
    width: 100%;
    padding: .75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: .95rem
}

.form-input:focus {
    outline: none;
    border-color: var(--primary)
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem
}

@media(max-width:480px) {
    .modal-overlay .form-grid-2 {
        grid-template-columns: 1fr
    }
}