/*
 * RI & Savings Plan Utilisation — pane styles.
 * Doc 32 batch-3 §11. Top scorecard + two stacked tables (commitments
 * + uncovered services). No hex.
 */

.lp-pane {

    container-type: inline-size;
}

.lp-ri-savings-body { padding: 18px var(--lp-pane-pad-x) 4px; }

/* Top scorecard (4 KPIs across) */
.lp-ri-savings-scorecard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    padding: 4px 0 16px;
}

.lp-ri-savings-kpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: center;
}

.lp-ri-savings-kpi-num {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    color: var(--lp-pane-amber-900);
    font-variant-numeric: tabular-nums;
}

.lp-ri-savings-kpi-num--ok    { color: var(--lp-pane-status-ok-ink); }
.lp-ri-savings-kpi-num--warn  { color: var(--lp-pane-amber-700); }
.lp-ri-savings-kpi-num--crit  { color: var(--lp-pane-status-critical-ink); }

.lp-ri-savings-kpi-label {
    font-size: 11px;
    color: var(--lp-pane-ink-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Embedded tables */

.lp-ri-savings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--lp-pane-bg);
}

.lp-ri-savings-table thead th {
    background: var(--lp-pane-amber-100);
    color: var(--lp-pane-amber-900);
    text-align: left;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--lp-pane-divider);
}

.lp-ri-savings-table thead th.num,
.lp-ri-savings-table tbody td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.lp-ri-savings-table tbody tr {
    border-bottom: 1px solid var(--lp-pane-divider);
    cursor: pointer;
}

.lp-ri-savings-table tbody tr:last-child { border-bottom: 0; }
.lp-ri-savings-table tbody tr:hover { background: var(--lp-pane-amber-50); }
.lp-ri-savings-table tbody tr[aria-expanded="true"] { background: var(--lp-pane-detail-bg); }

.lp-ri-savings-table tbody td {
    padding: 9px 10px;
    color: var(--lp-pane-ink);
    vertical-align: middle;
}

.lp-ri-savings-name {
    font-family: inherit;   /* §15: match row font, heavier weight (like EC2 inventory) */
    font-size: 12.5px; font-weight: 600;
}

/* Utilisation bar */
.lp-ri-savings-util {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 110px;
}

.lp-ri-savings-util-track {
    flex: 1;
    height: 8px;
    background: var(--lp-pane-amber-100);
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}

.lp-ri-savings-util-fill {
    height: 100%;
    background: var(--lp-pane-amber-700);
    border-radius: 3px;
    transition: width 200ms ease;
}

.lp-ri-savings-util-fill--ok    { background: var(--lp-pane-status-ok-ink); }
.lp-ri-savings-util-fill--warn  { background: var(--lp-pane-amber-700); }
.lp-ri-savings-util-fill--crit  { background: var(--lp-pane-status-critical-ink); }

.lp-ri-savings-util-pct {
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 32px;
    text-align: right;
}

/* Chevron column needs explicit width + right padding to keep the
   SVG clear of the embedded-table-frame's right border. */
.lp-ri-savings-arrow {
    width: 22px;
    text-align: center;
    padding-left: 0 !important;
    padding-right: 8px !important;
}

.lp-pane-chevron {
    display: block;
    color: var(--lp-pane-amber-700);
    transition: transform 150ms ease, color 120ms ease;
    transform-origin: center;
}

.lp-ri-savings-table tbody tr:hover .lp-pane-chevron { color: var(--lp-pane-amber-900); }
.lp-ri-savings-table tbody tr[aria-expanded="true"] .lp-pane-chevron { transform: rotate(90deg); }

.lp-ri-savings-detail-row td {
    padding: 0 !important;
    background: var(--lp-pane-amber-50);
}

.lp-ri-savings-detail {
    padding: 12px 14px;
    font-size: 13px;
    color: var(--lp-pane-ink);
    line-height: 1.5;
}

.lp-ri-savings-detail strong { color: var(--lp-pane-amber-900); font-weight: 600; }

.lp-ri-savings-detail-grid {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 4px 14px;
    margin: 6px 0 0 0;
    font-size: 12px;
}

.lp-ri-savings-detail-grid dt {
    color: var(--lp-pane-ink-dim);
    font-weight: 500;
}

.lp-ri-savings-detail-grid dd { margin: 0; color: var(--lp-pane-ink); }

.lp-ri-savings-detail-spark {
    margin-top: 10px;
    padding: 8px 10px;
    background: var(--lp-pane-bg);
    border: 1px solid var(--lp-pane-divider);
    border-radius: 4px;
}

.lp-ri-savings-detail-spark-label {
    font-size: 11px;
    color: var(--lp-pane-ink-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.lp-ri-savings-detail-spark-svg {
    width: 100%;
    height: 50px;
    display: block;
}

.lp-ri-savings-detail-hint {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--lp-pane-divider);
    font-size: 12px;
    color: var(--lp-pane-ink-dim);
    line-height: 1.5;
}

@container (max-width: 520px) {
    .lp-ri-savings-body { padding: 14px 12px 4px; }
/* stripped 2026-05-27 — canonical lp-pane-* class now
   owned by embed/sd-embed.css. Restore by un-commenting
   if you need a deliberate per-pane override. */
/*     .lp-pane-subhead { padding: 8px 12px; }
     */

    .lp-ri-savings-scorecard { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .lp-ri-savings-kpi-num { font-size: 18px; }
    .lp-ri-savings-table thead th,
    .lp-ri-savings-table tbody td { padding: 8px 6px; font-size: 12px; }
    .lp-ri-savings-table thead th { font-size: 10px; }
    /* Commitments table: drop "Monthly value" — utilisation + waste
       are the priority signals. Drop the chevron column entirely
       (both th and td) so the header bg stays uniform; leaving the
       th hidden but the td visible creates a gap above the chevron
       in the header row. */
    .lp-ri-savings-table thead th:nth-child(3),
    .lp-ri-savings-table tbody td:nth-child(3) { display: none; }
    .lp-ri-savings-table thead th:last-child,
    .lp-ri-savings-table tbody td:last-child { display: none; }
    .lp-ri-savings-util { min-width: 0; }
}

@media (max-width: 520px) {
    .lp-ri-savings-body { padding: 14px 12px 4px; }
/* stripped 2026-05-27 — canonical lp-pane-* class now
   owned by embed/sd-embed.css. Restore by un-commenting
   if you need a deliberate per-pane override. */
/*     .lp-pane-subhead { padding: 8px 12px; }
     */

    .lp-ri-savings-scorecard { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .lp-ri-savings-kpi-num { font-size: 18px; }
    .lp-ri-savings-table thead th,
    .lp-ri-savings-table tbody td { padding: 8px 6px; font-size: 12px; }
    .lp-ri-savings-table thead th { font-size: 10px; }
    .lp-ri-savings-table thead th:nth-child(3),
    .lp-ri-savings-table tbody td:nth-child(3) { display: none; }
    .lp-ri-savings-table thead th:last-child { display: none; }
    .lp-ri-savings-util { min-width: 0; }
}

/* ------- Empty / no-commitments message ---------------------------
   Mirrors compute-optimizer / rightsize / cost-by-tag empty states
   for visual consistency. */
.lp-ri-savings-empty {
    margin: 16px;
    padding: 18px 16px;
    background: var(--lp-pane-amber-50);
    border: 1px dashed var(--lp-pane-amber-300);
    border-radius: 6px;
    color: var(--lp-pane-ink);
    font-size: 13px;
    line-height: 1.55;
}

.lp-ri-savings-empty strong { color: var(--lp-pane-amber-900); }

.lp-ri-savings-empty a {
    color: var(--lp-pane-amber-900);
    text-decoration: none;
    border-bottom: 1px dotted var(--lp-pane-amber-700);
}

.lp-ri-savings-empty a:hover {
    background: var(--lp-pane-amber-100);
    border-bottom-style: solid;
}
