/* ===========================================
   C4-AI Customer Panel - Main Styles
   Additional Components & Utilities
   =========================================== */

/* ===========================================
   Dashboard Specific
   =========================================== */

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-action-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
    transform: translateY(-2px);
}

.quick-action-btn .icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    color: var(--primary);
}

.quick-action-btn .icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

.quick-action-btn span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

/* Recent Activity */
.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.activity-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

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

.activity-icon.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.activity-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.activity-content {
    flex: 1;
}

.activity-content h4 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin: 0 0 4px;
}

.activity-content p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ===========================================
   Plans Grid
   =========================================== */
.plans-header {
    text-align: center;
    margin-bottom: 32px;
}

.plans-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.plans-header p {
    color: var(--text-muted);
    font-size: 15px;
}

.plans-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.plan-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    transition: all var(--transition-fast);
    position: relative;
}

.plan-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.plan-card.featured {
    border-color: var(--primary);
    background: linear-gradient(to bottom, rgba(99, 102, 241, 0.05), transparent);
}

.plan-card.featured::before {
    content: 'محبوب‌ترین';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.plan-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 16px;
}

.plan-card .price {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 4px;
}

.plan-card .duration {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 24px;
}

.plan-card .features {
    text-align: right;
    margin: 0 0 24px;
}

.plan-card .features li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.plan-card .features li svg {
    width: 18px;
    height: 18px;
    stroke: var(--success);
    flex-shrink: 0;
}

.plan-card .btn {
    width: 100%;
}

/* ===========================================
   Settings Sections
   =========================================== */
.settings-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    cursor: pointer;
    background: var(--content-bg);
    transition: background var(--transition-fast);
}

.settings-header:hover {
    background: rgba(99, 102, 241, 0.05);
}

.settings-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-header h4 svg {
    width: 20px;
    height: 20px;
    stroke: var(--primary);
}

.settings-header .chevron {
    width: 20px;
    height: 20px;
    stroke: var(--text-muted);
    transition: transform var(--transition-fast);
}

.settings-section.open .settings-header .chevron {
    transform: rotate(180deg);
}

.settings-body {
    padding: 24px;
    display: none;
    border-top: 1px solid var(--border-color);
}

.settings-section.open .settings-body {
    display: block;
}

/* Toggle Row */
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--content-bg);
    border-radius: 10px;
    margin-bottom: 12px;
}

.toggle-row:last-child {
    margin-bottom: 0;
}

.toggle-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toggle-label span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

.toggle-label small {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===========================================
   Products Grid
   =========================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.product-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.1);
}

.product-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.product-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
}

.product-header p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
}

.product-body {
    padding: 20px;
}

.product-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.product-stat {
    flex: 1;
    text-align: center;
    padding: 12px;
    background: var(--content-bg);
    border-radius: 10px;
}

.product-stat strong {
    display: block;
    font-size: 18px;
    color: var(--text-dark);
}

.product-stat span {
    font-size: 12px;
    color: var(--text-muted);
}

.product-actions {
    display: flex;
    gap: 10px;
}

.product-actions .btn {
    flex: 1;
}

/* ===========================================
   Section Header
   =========================================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

/* ===========================================
   Items List (Generic)
   =========================================== */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all var(--transition-fast);
}

.list-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.item-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.item-actions {
    display: flex;
    gap: 8px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.error-state {
    text-align: center;
    padding: 40px;
    color: var(--danger);
}

/* ===========================================
   Commands List (Legacy)
   =========================================== */
.commands-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.command-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--content-bg);
    border-radius: 12px;
    transition: all var(--transition-fast);
}

.command-item:hover {
    background: rgba(99, 102, 241, 0.05);
}

.command-trigger {
    font-family: monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 6px 12px;
    border-radius: 6px;
    min-width: 120px;
}

.command-response {
    flex: 1;
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.command-actions {
    display: flex;
    gap: 8px;
}

/* ===========================================
   Users Table Enhanced
   =========================================== */
.user-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-details strong {
    font-size: 14px;
    color: var(--text-dark);
}

.user-details span {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===========================================
   Broadcast Section
   =========================================== */
.broadcast-form {
    max-width: 600px;
}

.broadcast-preview {
    background: var(--content-bg);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.broadcast-preview h4 {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 12px;
}

.message-bubble {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.message-bubble p {
    font-size: 14px;
    color: var(--text-dark);
    margin: 0;
    white-space: pre-wrap;
}

/* ===========================================
   Tabs
   =========================================== */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--content-bg);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.tab {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
}

.tab:hover {
    color: var(--text-dark);
}

.tab.active {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ===========================================
   File Upload
   =========================================== */
.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-upload:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.02);
}

.file-upload.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.file-upload svg {
    width: 48px;
    height: 48px;
    stroke: var(--text-muted);
    margin-bottom: 16px;
}

.file-upload p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 8px;
}

.file-upload span {
    font-size: 13px;
    color: var(--text-muted);
}

.file-upload input {
    display: none;
}

/* ===========================================
   Charts Placeholder
   =========================================== */
.chart-container {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--content-bg);
    border-radius: 12px;
}

.chart-container p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ===========================================
   Scrollbar
   =========================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--content-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===========================================
   Utilities
   =========================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.w-100 { width: 100%; }
.hidden { display: none !important; }

/* Count Badge */
.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    margin-right: 8px;
}

/* Loader Animation */
.loader {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ===========================================
   Responsive Utilities
   =========================================== */
@media (max-width: 768px) {
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .command-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .command-response {
        white-space: normal;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .product-stats {
        flex-direction: column;
    }
}

/* ===========================================
   Toast Notifications
   =========================================== */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    animation: slideDown 0.3s ease-out;
    max-width: 90%;
}

@keyframes slideDown {
    from { opacity: 0; transform: translate(-50%, -20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.toast-notification.toast-success {
    border-color: #22c55e;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), var(--card-bg));
}

.toast-notification.toast-error {
    border-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), var(--card-bg));
}

.toast-notification.toast-info {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), var(--card-bg));
}

.toast-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.toast-info .toast-icon {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

/* ===========================================
   Plan Expired Modal & Restrictions
   =========================================== */
.plan-expired-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.plan-expired-modal.show {
    opacity: 1;
    visibility: visible;
}

.plan-expired-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.plan-expired-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.plan-expired-modal.show .plan-expired-content {
    transform: translate(-50%, -50%) scale(1);
}

.plan-expired-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    border-radius: 50%;
    border: 2px solid rgba(239, 68, 68, 0.3);
}

.plan-expired-icon svg {
    width: 40px;
    height: 40px;
    stroke: #ef4444;
}

.plan-expired-content h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.plan-expired-content > p {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 28px;
}

.plan-expired-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.plan-expired-actions .btn {
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
}

.plan-expired-actions .btn svg {
    width: 20px;
    height: 20px;
    margin-left: 8px;
}

.plan-expired-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    font-size: 13px;
    color: var(--primary);
}

.plan-expired-note svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Expired Banner */
.expired-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    margin-bottom: 24px;
}

.expired-banner-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.expired-banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.expired-banner-text strong {
    font-size: 15px;
    color: #ef4444;
}

.expired-banner-text span {
    font-size: 13px;
    color: var(--text-muted);
}

.expired-banner .btn {
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .plan-expired-content {
        padding: 28px 20px;
    }
    
    .plan-expired-content h2 {
        font-size: 18px;
    }
    
    .plan-expired-actions {
        flex-direction: column;
    }
    
    .plan-expired-actions .btn {
        width: 100%;
    }
    
    .expired-banner {
        flex-direction: column;
        text-align: center;
    }
}

/* ===========================================
   Consultations Section Styles
   =========================================== */

.consultations-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.consultations-stats .stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.consultations-stats .stat-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.consultations-stats .stat-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
}

.consultations-stats .stat-info {
    display: flex;
    flex-direction: column;
}

.consultations-stats .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
}

.consultations-stats .stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* Consultation Form */
.consultation-form-card {
    margin-bottom: 20px;
}

.consultation-form .form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.consultation-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.consultation-form .form-group.full-width {
    grid-column: 1 / -1;
}

.consultation-form label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
}

.consultation-form label .required {
    color: #ef4444;
}

.consultation-form input,
.consultation-form select {
    padding: 12px 14px;
    background: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-dark);
    transition: all var(--transition-fast);
}

.consultation-form input:focus,
.consultation-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.consultation-form .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

/* Products Tags */
.products-tags-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.products-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 32px;
}

.products-tags .tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: 13px;
}

.products-tags .tag .remove-tag {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.products-tags .tag .remove-tag:hover {
    opacity: 1;
}

/* Filter Card */
.filter-card {
    margin-bottom: 20px;
    padding: 16px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
}

.filter-group label {
    font-size: 12px;
    color: var(--text-muted);
}

.filter-group input,
.filter-group select {
    padding: 10px 12px;
    background: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-dark);
}

/* Consultations List */
.consultations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.consultation-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all var(--transition-fast);
}

.consultation-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.consultation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.consultation-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.consultation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.consultation-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.consultation-products {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.consultation-products .product-tag {
    padding: 5px 12px;
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border-radius: 16px;
    font-size: 12px;
}

.consultation-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.consultation-actions .action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.consultation-actions .action-btn svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 2;
}

.consultation-actions .action-btn:hover {
    background: var(--content-bg);
    border-color: var(--primary);
}

.consultation-actions .action-btn:hover svg {
    stroke: var(--primary);
}

.consultation-actions .action-btn.delete:hover {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.consultation-actions .action-btn.delete:hover svg {
    stroke: #ef4444;
}

.consultation-date {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Empty State */
.consultations-list .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.consultations-list .empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.consultations-list .empty-state p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .consultation-form .form-row {
        grid-template-columns: 1fr;
    }
    
    .filter-row {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .consultation-header {
        flex-direction: column;
    }
    
    .consultation-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ===========================================
   Reports Section Styles
   =========================================== */

.reports-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    min-height: 600px;
}

.reports-nav {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-color);
    height: fit-content;
    position: sticky;
    top: 80px;
}

.reports-nav-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    padding: 0 12px;
}

.reports-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.reports-nav-item svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

.reports-nav-item:hover {
    background: var(--content-bg);
    color: var(--primary);
}

.reports-nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-weight: 500;
}

.reports-content {
    min-width: 0;
}

.reports-tab {
    display: none;
}

.reports-tab.active {
    display: block;
}

/* Reports Stats Grid */
.reports-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.report-stat-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-fast);
}

.report-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.report-stat-card.highlight {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(124, 58, 237, 0.05));
    border-color: rgba(139, 92, 246, 0.3);
}

.report-stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.report-stat-icon svg {
    width: 28px;
    height: 28px;
    stroke: white;
    fill: none;
    stroke-width: 1.5;
}

.report-stat-info {
    display: flex;
    flex-direction: column;
}

.report-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.report-stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Charts Grid */
.reports-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.chart-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.chart-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.chart-body {
    padding: 24px;
}

/* Donut Chart */
.donut-chart-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-dark);
    display: block;
}

.donut-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* Chart Legend */
.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-value {
    margin-right: auto;
    font-weight: 600;
    color: var(--text-dark);
}

/* Products Performance Table */
.products-performance-table {
    overflow-x: auto;
}

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

.products-performance-table th,
.products-performance-table td {
    padding: 14px 16px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.products-performance-table th {
    background: var(--content-bg);
    font-weight: 600;
    color: var(--text-dark);
}

.products-performance-table tr:hover {
    background: var(--content-bg);
}

.performance-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
}

.performance-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.excellent {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-badge.good {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.status-badge.average {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.status-badge.poor {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    background: transparent;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Consultation Report List */
.consultation-report-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--content-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.report-item:hover {
    border-color: var(--primary);
}

.report-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.report-item-name {
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-item-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.report-item-products {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.report-item-products .product-tag {
    padding: 3px 10px;
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border-radius: 12px;
    font-size: 11px;
}

.report-item-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.purchase-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.purchase-status.purchased {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.purchase-status.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.purchase-status svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* Empty State */
.consultation-report-list .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .reports-layout {
        grid-template-columns: 1fr;
    }
    
    .reports-nav {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 16px;
    }
    
    .reports-nav-title {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .reports-nav-item {
        padding: 8px 16px;
        margin-bottom: 0;
    }
    
    .reports-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .reports-charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .reports-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .report-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .report-item-status {
        align-items: flex-start;
        width: 100%;
    }
    
    .filter-buttons {
        flex-wrap: wrap;
    }
}
