.content-wrapper:has(#wa-insights-wrapper) {
    background: #eef3f0;
}

.wa-insights {
    --wa-green: #0b6b57;
    --wa-accent: #25d366;
    --wa-ink: #10231d;
    --wa-muted: #5c6d67;
    --wa-line: #dde6e2;
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    color: var(--wa-ink);
    padding: 22px;
    max-width: 1200px;
    margin-inline: auto; /* center the panel once the viewport exceeds max-width (lg/xl) */
}

.wa-insights__head h1 {
    font-family: "Bricolage Grotesque", "Plus Jakarta Sans", sans-serif;
    font-weight: 700;
    font-size: 28px;
    margin: 0;
}
.wa-insights__head p {
    color: var(--wa-muted);
    margin: 4px 0 18px;
}

/* Filters */
.wa-insights__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
    background: #fff;
    border: 1px solid var(--wa-line);
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 10px 30px rgba(10, 40, 35, 0.06);
    margin-bottom: 18px;
}
.wa-insights__filters label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--wa-muted);
    margin: 0;
}
.wa-insights__filters input,
.wa-insights__filters select {
    font-family: inherit;
    font-size: 14px;
    color: var(--wa-ink);
    border: 1px solid var(--wa-line);
    border-radius: 10px;
    padding: 8px 10px;
    background: #fff;
    min-width: 150px;
    color-scheme: light; /* keep native select/date popups light regardless of OS dark mode */
}
/* Toggle chips (country / category) */
.wa-chips {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.wa-chips__label {
    font-size: 12px;
    font-weight: 600;
    color: var(--wa-muted);
}
.wa-chips__row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.wa-chip {
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--wa-ink);
    background: #fff;
    border: 1px solid var(--wa-line);
    border-radius: 999px;
    padding: 7px 14px;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.wa-chip:hover {
    border-color: var(--wa-accent);
}
.wa-chip--on {
    background: var(--wa-green);
    border-color: var(--wa-green);
    color: #fff;
}
.wa-insights__filters input:focus,
.wa-insights__filters select:focus {
    outline: none;
    border-color: var(--wa-accent);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.18);
}
.wa-insights__apply {
    font-family: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--wa-green);
    border: none;
    border-radius: 10px;
    padding: 10px 22px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.wa-insights__apply:hover:not(:disabled) {
    background: #095446;
}
.wa-insights__apply:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.wa-insights__alert {
    background: #fdecee;
    color: #8a1c26;
    border: 1px solid #f4c2c8;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
}
.wa-insights__loading {
    color: var(--wa-muted);
    padding: 10px 2px;
}

/* Skeleton loading — mirrors the real layout, green-tinted shimmer */
.wa-skel {
    display: block;
    border-radius: 8px;
    background: #e8efeb;
    background-image: linear-gradient(90deg, #e8efeb 0%, #f2f8f4 40%, #d7ece0 60%, #e8efeb 100%);
    background-size: 220% 100%;
    animation: wa-skel-shimmer 1.25s ease-in-out infinite;
}
.wa-skel-line { height: 12px; margin: 6px 0; }
.wa-skel-num { width: 120px; height: 30px; margin-top: 4px; border-radius: 10px; }
.wa-skel-chart { width: 100%; height: 100%; border-radius: 12px; }
.wa-skel-rows { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.wa-skel-wrap .wa-kpi { background: #f4f8f6; border-color: var(--wa-line); }

@keyframes wa-skel-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -120% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .wa-skel { animation: none; }
}

/* Cards */
.wa-card {
    background: #fff;
    border: 1px solid var(--wa-line);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(10, 40, 35, 0.06);
    margin-bottom: 20px;
}
.wa-card h2 {
    font-family: "Bricolage Grotesque", sans-serif;
    font-weight: 600;
    font-size: 18px;
    margin: 0 0 14px;
}

/* KPIs */
.wa-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.wa-kpi {
    background: linear-gradient(135deg, #f2fbf6, #eafaf1);
    border: 1px solid #d3efe0;
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.wa-kpi__label {
    font-size: 13px;
    color: var(--wa-muted);
    font-weight: 600;
}
.wa-kpi__value {
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--wa-green);
}

.wa-chart {
    position: relative;
    height: 320px;
    margin-bottom: 22px;
}

/* Tables */
.wa-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.wa-table th,
.wa-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--wa-line);
}
.wa-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--wa-muted);
}
.wa-table .wa-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.wa-table tbody tr:last-child td {
    border-bottom: none;
}
.wa-empty {
    color: var(--wa-muted);
    text-align: center;
    padding: 18px;
}

/* Badges */
.wa-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #eceff1;
    color: #556;
}
.wa-badge--green {
    background: #e3f8ec;
    color: #14804a;
}
.wa-badge--yellow {
    background: #fff4d6;
    color: #8a6100;
}
.wa-badge--red {
    background: #fdecee;
    color: #b0202e;
}
