/* ===== INSIGHTS THEME VARIABLES ===== */
.insights-wrapper {
    --ins-bg-primary: #0f172a;
    --ins-bg-secondary: #1e293b;
    --ins-bg-card: #334155;
    --ins-text-primary: #f1f5f9;
    --ins-text-secondary: #94a3b8;
    --ins-text-muted: #64748b;
    --ins-border: #475569;
    --ins-accent: #6366f1;
    --ins-accent-light: #818cf8;
    --ins-success: #10b981;
    --ins-warning: #f59e0b;
    --ins-danger: #ef4444;
    min-height: 60vh;
    background: var(--ins-bg-primary);
    color: var(--ins-text-primary);
    padding-bottom: 3rem;
}

.insights-wrapper[data-theme="light"] {
    --ins-bg-primary: #f8fafc;
    --ins-bg-secondary: #ffffff;
    --ins-bg-card: #ffffff;
    --ins-text-primary: #0f172a;
    --ins-text-secondary: #475569;
    --ins-text-muted: #94a3b8;
    --ins-border: #e2e8f0;
    --ins-accent: #6366f1;
    --ins-accent-light: #818cf8;
}

/* ===== INSIGHTS NAV ===== */
.insights-nav {
    background: var(--ins-bg-secondary);
    border-bottom: 1px solid var(--ins-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.insights-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: var(--ins-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    white-space: nowrap;
    transition: all 0.2s;
}

.insights-nav-link:hover {
    color: var(--ins-text-primary);
    background: rgba(99, 102, 241, 0.1);
}

.insights-nav-link.active {
    color: #fff;
    background: var(--ins-accent);
}

/* ===== THEME TOGGLE ===== */
.insights-theme-toggle {
    background: transparent;
    border: 1px solid var(--ins-border);
    color: var(--ins-text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.insights-theme-toggle:hover {
    color: var(--ins-accent);
    border-color: var(--ins-accent);
}

/* ===== INSIGHTS CARDS ===== */
.insights-card {
    background: var(--ins-bg-card);
    border: 1px solid var(--ins-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.2s;
}

.insights-card:hover {
    border-color: var(--ins-accent);
}

.insights-card h3 {
    color: var(--ins-text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.insights-card .card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ins-text-primary);
}

.insights-card .card-label {
    font-size: 0.8125rem;
    color: var(--ins-text-muted);
}

/* ===== STAT CARDS ===== */
.stat-card {
    background: var(--ins-bg-card);
    border: 1px solid var(--ins-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ins-text-primary);
}

.stat-card .stat-label {
    font-size: 0.8125rem;
    color: var(--ins-text-muted);
}

/* ===== STATUS BADGES ===== */
.badge-active { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-pending { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-cancelled { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.badge-past-due { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.badge-new { background: rgba(99, 102, 241, 0.15); color: #6366f1; }
.badge-processing { background: rgba(99, 102, 241, 0.15); color: #6366f1; }
.badge-dispatched { background: rgba(16, 185, 129, 0.15); color: #10b981; }

/* ===== TABLES ===== */
.insights-table {
    width: 100%;
    color: var(--ins-text-primary);
}

.insights-table thead th {
    color: var(--ins-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--ins-border);
}

.insights-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--ins-border);
    font-size: 0.875rem;
}

.insights-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

/* ===== PRICING CARDS ===== */
.pricing-card {
    background: var(--ins-bg-card);
    border: 1px solid var(--ins-border);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pricing-card:hover {
    transform: translateY(-4px);
    border-color: var(--ins-accent);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.15);
}

.pricing-card.featured {
    border-color: var(--ins-accent);
    position: relative;
}

.pricing-card.featured::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ins-accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 1rem;
    border-radius: 1rem;
}

.pricing-card .price {
    font-size: 3rem;
    font-weight: 800;
    color: var(--ins-text-primary);
    line-height: 1;
    margin: 1rem 0 0.5rem;
}

.pricing-card .price span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--ins-text-muted);
}

.pricing-card .features-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    text-align: left;
    flex: 1;
}

.pricing-card .features-list li {
    padding: 0.5rem 0;
    color: var(--ins-text-secondary);
    font-size: 0.875rem;
}

.pricing-card .features-list li i {
    color: var(--ins-success);
    margin-right: 0.5rem;
    width: 16px;
}

.pricing-card .features-list li i.fa-times {
    color: var(--ins-text-muted);
}

/* ===== FORM CONTROLS (dark compatible) ===== */
.insights-wrapper .form-control,
.insights-wrapper .form-select {
    background: var(--ins-bg-secondary);
    border-color: var(--ins-border);
    color: var(--ins-text-primary);
}

.insights-wrapper .form-control:focus,
.insights-wrapper .form-select:focus {
    background: var(--ins-bg-secondary);
    border-color: var(--ins-accent);
    color: var(--ins-text-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.insights-wrapper .form-control::placeholder {
    color: var(--ins-text-muted);
}

/* ===== BUTTONS ===== */
.btn-insights {
    background: var(--ins-accent);
    color: #fff;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-insights:hover {
    background: var(--ins-accent-light);
    color: #fff;
    transform: translateY(-1px);
}

.btn-insights-outline {
    background: transparent;
    color: var(--ins-accent);
    border: 1px solid var(--ins-accent);
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-insights-outline:hover {
    background: var(--ins-accent);
    color: #fff;
}

/* ===== TIER GATE ===== */
.tier-gate {
    background: var(--ins-bg-card);
    border: 1px dashed var(--ins-border);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
}

.tier-gate i {
    font-size: 2rem;
    color: var(--ins-text-muted);
    margin-bottom: 1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 767.98px) {
    .insights-nav .d-flex {
        gap: 0.25rem;
    }
    .insights-nav-link {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
}
