/* ── SmartConnect Next Actions panel ───────────────────────────────── */

.sc-next-actions {
    --na-primary: #2D1350;
    --na-primary-soft: #7040B0;
    --na-text: #1A1A2E;
    --na-text-soft: #555570;
    --na-text-muted: #8888A0;
    --na-border: #E8E6EF;
    --na-bg: #FFFFFF;
    --na-bg-soft: #F8F6FB;

    --na-positive-bg: #ECFDF5;
    --na-positive-fg: #047857;
    --na-positive-border: #A7F3D0;

    --na-warning-bg: #FFFBEB;
    --na-warning-fg: #B45309;
    --na-warning-border: #FDE68A;

    --na-opportunity-bg: #EFF6FF;
    --na-opportunity-fg: #1D4ED8;
    --na-opportunity-border: #BFDBFE;

    --na-critical-bg: #FEF2F2;
    --na-critical-fg: #B91C1C;
    --na-critical-border: #FECACA;

    --na-soon-bg: #F8F6FB;
    --na-soon-fg: #8888A0;
    --na-soon-border: #E8E6EF;

    margin: 24px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--na-text);
    box-sizing: border-box;
}

.sc-next-actions *,
.sc-next-actions *::before,
.sc-next-actions *::after { box-sizing: border-box; }

.sc-next-actions__header {
    margin-bottom: 16px;
}

.sc-next-actions__title {
    /* Size/weight/color from portal-typography.css */
    margin: 0 0 4px;
}

.sc-next-actions__subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--na-text-muted);
    line-height: 1.4;
}

.sc-next-actions__grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.sc-next-actions__empty {
    grid-column: 1 / -1;
    padding: 32px;
    text-align: center;
    background: var(--na-bg-soft);
    border: 1px dashed var(--na-border);
    border-radius: 10px;
    color: var(--na-text-muted);
    font-size: 14px;
}

/* ── Cards ─────────────────────────────────────────────────────────── */

.sc-next-action {
    display: flex;
    flex-direction: column;
    background: var(--na-bg);
    border: 1px solid var(--na-border);
    border-radius: 12px;
    padding: 18px;
    transition: box-shadow 0.15s, transform 0.1s;
    min-height: 140px;
}

.sc-next-action:hover {
    box-shadow: 0 4px 16px rgba(45, 19, 80, 0.06);
    transform: translateY(-1px);
}

/* Tone-specific top border accent */
.sc-next-action--positive    { border-top: 3px solid var(--na-positive-border); }
.sc-next-action--warning     { border-top: 3px solid var(--na-warning-border); }
.sc-next-action--opportunity { border-top: 3px solid var(--na-opportunity-border); }
.sc-next-action--critical    { border-top: 3px solid var(--na-critical-border); }
.sc-next-action--soon        { background: var(--na-bg-soft); }

.sc-next-action__header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: start;
    margin-bottom: 12px;
}

.sc-next-action__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
}

.sc-next-action__icon svg {
    width: 18px;
    height: 18px;
}

.sc-next-action--positive    .sc-next-action__icon { background: var(--na-positive-bg);    color: var(--na-positive-fg); }
.sc-next-action--warning     .sc-next-action__icon { background: var(--na-warning-bg);     color: var(--na-warning-fg); }
.sc-next-action--opportunity .sc-next-action__icon { background: var(--na-opportunity-bg); color: var(--na-opportunity-fg); }
.sc-next-action--critical    .sc-next-action__icon { background: var(--na-critical-bg);    color: var(--na-critical-fg); }
.sc-next-action--soon        .sc-next-action__icon { background: var(--na-bg);              color: var(--na-soon-fg); }

.sc-next-action__title-wrap {
    min-width: 0;
}

.sc-next-action__title {
    margin: 0 0 2px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--na-text);
    line-height: 1.25;
}

.sc-next-action__desc {
    margin: 0;
    font-size: 12px;
    color: var(--na-text-muted);
    line-height: 1.35;
}

.sc-next-action__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 14px;
    font-size: 12.5px;
    font-weight: 700;
    color: #fff;
    background: var(--na-text);
    flex-shrink: 0;
}

.sc-next-action--positive    .sc-next-action__count { background: var(--na-positive-fg); }
.sc-next-action--warning     .sc-next-action__count { background: var(--na-warning-fg); }
.sc-next-action--opportunity .sc-next-action__count { background: var(--na-opportunity-fg); }
.sc-next-action--critical    .sc-next-action__count { background: var(--na-critical-fg); }

.sc-next-action__badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 11px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--na-soon-fg);
    background: var(--na-bg);
    border: 1px solid var(--na-border);
    flex-shrink: 0;
}

/* ── List of accounts within a card ────────────────────────────────── */

.sc-next-action__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sc-next-action__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    background: var(--na-bg-soft);
    border-radius: 6px;
    transition: background 0.1s;
}

.sc-next-action__row:hover {
    background: var(--na-bg);
    box-shadow: inset 0 0 0 1px var(--na-border);
}

.sc-next-action__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--na-text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

.sc-next-action__name:hover {
    color: var(--na-primary-soft);
    text-decoration: underline;
}

.sc-next-action__value {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--na-text-muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .sc-next-actions__grid { grid-template-columns: 1fr; }
    .sc-next-action { padding: 14px; }
}
