/* =====================================================
   Marketing Analytics Dashboard - Supplemental Styles
   ===================================================== */

/* Page Tabs */
.mkt-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}

.mkt-tabs a {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
    white-space: nowrap;
}

.mkt-tabs a:hover {
    background: rgba(37, 99, 235, 0.06);
    color: var(--accent-blue);
}

.mkt-tabs a.active {
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.mkt-tabs a .badge {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: 10px;
}

/* KPI variations with delta */
.kpi-card .kpi-delta {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.kpi-card .kpi-delta.up { color: #059669; }
.kpi-card .kpi-delta.down { color: #dc2626; }
.kpi-card .kpi-delta.flat { color: var(--text-secondary); }

.kpi-card .kpi-sub {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Insight / Analysis comment box */
.insight-box {
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(124, 58, 237, 0.06));
    border: 1px solid rgba(37, 99, 235, 0.15);
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.insight-box .insight-icon {
    font-size: 28px;
    color: var(--accent-blue);
    flex-shrink: 0;
    background: #fff;
    border-radius: 50%;
    padding: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.insight-box .insight-body {
    flex: 1;
}

.insight-box .insight-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.insight-box .insight-title .tag {
    background: var(--accent-blue);
    color: #fff;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.insight-box .insight-title .tag.warn {
    background: #f59e0b;
}
.insight-box .insight-title .tag.good {
    background: #059669;
}
.insight-box .insight-title .tag.bad {
    background: #dc2626;
}

.insight-box ul {
    margin: 0;
    padding-left: 20px;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.8;
}

.insight-box ul li strong {
    color: var(--accent-blue);
}

/* Schedule Gantt */
.schedule-card {
    padding: 24px;
}

.schedule-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.schedule-wrapper {
    overflow-x: auto;
    padding-bottom: 8px;
}

.schedule-grid {
    display: grid;
    grid-template-columns: 180px repeat(12, minmax(60px, 1fr));
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    min-width: 900px;
}

.schedule-grid .sg-header {
    background: #f1f5f9;
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.schedule-grid .sg-header.label-col {
    text-align: left;
    padding-left: 16px;
}

.schedule-grid .sg-row-label {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.schedule-grid .sg-row-label .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.schedule-grid .sg-cell {
    padding: 8px 4px;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    min-height: 38px;
}

.schedule-grid .sg-bar {
    position: absolute;
    height: 22px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    padding: 0 8px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.schedule-grid .sg-bar.campaign { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.schedule-grid .sg-bar.sale { background: linear-gradient(90deg, #dc2626, #ef4444); }
.schedule-grid .sg-bar.ads { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.schedule-grid .sg-bar.sns { background: linear-gradient(90deg, #059669, #10b981); }
.schedule-grid .sg-bar.crm { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.schedule-grid .sg-bar.lp { background: linear-gradient(90deg, #0891b2, #22d3ee); }

/* Small grid variant for media schedules (weekly x 12 cols -> days x 30) */
.schedule-grid-fine {
    grid-template-columns: 180px repeat(30, minmax(22px, 1fr));
    min-width: 1100px;
}

/* Demographics */
.demographics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.4fr;
    gap: 24px;
}

@media (max-width: 1100px) {
    .demographics-grid {
        grid-template-columns: 1fr;
    }
}

/* Legend chips */
.legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
}
.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}
.legend-chip .sw {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Table enhancements for ranking / comparison */
.compact-table td, .compact-table th {
    padding: 10px 12px;
}
.rank-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}
.rank-cell.gold { background: #fde68a; color: #92400e; }
.rank-cell.silver { background: #e5e7eb; color: #1f2937; }
.rank-cell.bronze { background: #fcd9b6; color: #7c2d12; }

.trend-up { color: #059669; font-weight: 600; }
.trend-down { color: #dc2626; font-weight: 600; }

/* Page title header with sub */
.page-header-sub {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 2px;
}

/* Quad chart grid */
.quad-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}
@media (max-width: 1100px) {
    .quad-grid {
        grid-template-columns: 1fr;
    }
}

/* Triple chart grid */
.triple-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
@media (max-width: 1200px) {
    .triple-grid {
        grid-template-columns: 1fr;
    }
}

/* Media card */
.media-card {
    padding: 20px;
}
.media-card .media-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.media-card .media-head h4 {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.media-card .media-head .delta {
    font-size: 12px;
    font-weight: 700;
}
.media-card .media-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
}
.media-card .media-metrics .m {
    text-align: center;
}
.media-card .media-metrics .m .lbl {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.media-card .media-metrics .m .val {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
