/* ===========================================================================
   Strategic Debt Widget — Phase 1 Shadow Data
   Informative tone: graduated color hints, no alarm-level red pulsing.
   The status attribute drives the accent; the base widget stays neutral.
   =========================================================================== */

.strategic-debt-widget {
    background: var(--bg-card, #111823);
    border: 1px solid var(--border-color, #2d3550);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 16px 0;
    position: relative;
}

.strategic-debt-widget .sd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 12px;
}

.strategic-debt-widget .sd-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.strategic-debt-widget .sd-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #8892a4);
}

.strategic-debt-widget .sd-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-secondary, #1e2433);
    color: var(--text-muted, #8892a4);
    font-size: 0.68rem;
    font-weight: 700;
    font-style: italic;
    cursor: help;
    position: relative;
    user-select: none;
}

.strategic-debt-widget .sd-info-tooltip {
    position: absolute;
    top: calc(100% + 6px);
    left: -8px;
    width: 320px;
    padding: 12px 14px;
    background: var(--bg-primary, #0a0e17);
    border: 1px solid var(--border-color, #2d3550);
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 400;
    font-style: normal;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-secondary, #cdd3e0);
    line-height: 1.5;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s, visibility 0.15s;
    z-index: 20;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.strategic-debt-widget .sd-info-icon:hover .sd-info-tooltip,
.strategic-debt-widget .sd-info-icon:focus .sd-info-tooltip,
.strategic-debt-widget .sd-info-icon:focus-within .sd-info-tooltip {
    opacity: 1;
    visibility: visible;
}

.strategic-debt-widget .sd-status-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-muted, #8892a4);
}

/* Status accents — graduated, never aggressive. */
.strategic-debt-widget[data-status="healthy"]  .sd-status-badge {
    background: rgba(16, 185, 129, 0.14);
    color: #10b981;
}
.strategic-debt-widget[data-status="warning"]  .sd-status-badge {
    background: rgba(245, 158, 11, 0.14);
    color: #f59e0b;
}
.strategic-debt-widget[data-status="danger"]   .sd-status-badge {
    background: rgba(249, 115, 22, 0.14);
    color: #f97316;
}
.strategic-debt-widget[data-status="critical"] .sd-status-badge {
    background: rgba(239, 68, 68, 0.14);
    color: #ef4444;
}

.strategic-debt-widget .sd-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.strategic-debt-widget .sd-main {
    display: grid;
    grid-template-columns: minmax(0, auto) 1fr;
    gap: 20px;
    align-items: center;
}

.strategic-debt-widget .sd-value-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.strategic-debt-widget .sd-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: "JetBrains Mono", monospace;
    color: var(--text-primary, #e8ecf3);
    line-height: 1.1;
}

.strategic-debt-widget .sd-pct {
    font-size: 0.85rem;
    color: var(--text-muted, #8892a4);
    font-weight: 500;
}

/* ─── Gauge track ──────────────────────────────────────────────────── */

.strategic-debt-widget .sd-gauge {
    position: relative;
    padding: 6px 0 20px 0;
}

.strategic-debt-widget .sd-gauge-track {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--bg-secondary, #1e2433);
}

.strategic-debt-widget .sd-gauge-zone {
    height: 100%;
}

/* Gauge zone widths scaled so thresholds at 5 / 10 / 12 / max=18% NLV
   map proportionally. We render as: healthy 0-5 (28%), warning 5-10
   (28%), danger 10-12 (11%), critical 12-18 (33%). */
.strategic-debt-widget .sd-zone-healthy  { width: 28%; background: rgba(16, 185, 129, 0.5); }
.strategic-debt-widget .sd-zone-warning  { width: 28%; background: rgba(245, 158, 11, 0.5); }
.strategic-debt-widget .sd-zone-danger   { width: 11%; background: rgba(249, 115, 22, 0.55); }
.strategic-debt-widget .sd-zone-critical { width: 33%; background: rgba(239, 68, 68, 0.55); }

.strategic-debt-widget .sd-gauge-marker {
    position: absolute;
    top: 2px;
    width: 2px;
    height: 14px;
    background: var(--text-primary, #e8ecf3);
    box-shadow: 0 0 0 2px var(--bg-card, #111823);
    border-radius: 1px;
    transition: left 0.4s ease-out;
    transform: translateX(-1px);
}

.strategic-debt-widget .sd-gauge-labels {
    position: absolute;
    top: 16px;
    left: 0;
    right: 0;
    height: 12px;
    pointer-events: none;
}

.strategic-debt-widget .sd-gauge-labels > span {
    position: absolute;
    font-size: 0.66rem;
    color: var(--text-muted, #8892a4);
    font-family: "JetBrains Mono", monospace;
    transform: translateX(-50%);
}

/* Each label sits at its threshold boundary, matching zone widths. */
.strategic-debt-widget #sd-threshold-warning  { left: 28%; }
.strategic-debt-widget #sd-threshold-danger   { left: 56%; }
.strategic-debt-widget #sd-threshold-critical { left: 67%; }

/* ─── Decomposition toggle + panel ─────────────────────────────────── */

.strategic-debt-widget .sd-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted, #8892a4);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    align-self: flex-start;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.strategic-debt-widget .sd-toggle:hover {
    color: var(--text-primary, #e8ecf3);
}

.strategic-debt-widget .sd-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
    transition: transform 0.2s;
}

.strategic-debt-widget .sd-decomposition {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: var(--bg-secondary, #1e2433);
    border-radius: 8px;
    margin-top: 4px;
}

.strategic-debt-widget .sd-component {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
}

.strategic-debt-widget .sd-comp-label {
    color: var(--text-secondary, #cdd3e0);
}

.strategic-debt-widget .sd-comp-value {
    color: var(--text-primary, #e8ecf3);
    font-family: "JetBrains Mono", monospace;
    font-weight: 500;
}
