/* =============================================================================
   DASHBOARD ▸ OVERVIEW — MITRE ATT&CK insights (ovi-*), rendered by
   dashboard-overview-sections.js. Lives inside .ovx, so it reuses the card
   and chart primitives from dashboard-overview.css; the rest is --theme-*.
   ATT&CK uses ONE sequential hue (--ovv-att), never red/green: steel blue,
   inspired by the ATT&CK matrix itself (attack.mitre.org draws it in slate
   text with steel-blue technique links, #3F709E). Its orange/red brand
   colours are not used — they mean severity here.
   ============================================================================= */

.ovx {
    --ovv-att: 110, 151, 196;          /* ATT&CK sequential hue (dark) */
    --ovv-att-ink: #a9c3df;            /* text / icons in that hue */
    --ovv-att-on: #0b1a2b;             /* text on a solid fill of that hue */
}
[data-theme="light"] .ovx {
    --ovv-att: 63, 112, 158;
    --ovv-att-ink: #2f5a82;
    --ovv-att-on: #fff;
}

/* ------------------------------------------------------------- primitives */
.ovi-card code { padding: 0; border: 0; background: none; font-family: "JetBrains Mono", Consolas, monospace; }

/* ================================================================== card + tabs */
.ovi-head-ic { color: var(--ovv-att-ink); background: rgba(var(--ovv-att), .14); }
.ovi-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 11px; background: var(--theme-bg-subtle); border: 1px solid var(--theme-border-subtle); }
.ovi-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 40px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--theme-text-secondary); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.ovi-tabs button .fa { color: var(--theme-text-muted); }
.ovi-tabs button:hover { color: var(--theme-text-primary); background: var(--theme-bg-subtle-hover); }
.ovi-tabs button.is-on { background: rgba(var(--ovv-att), .14); border-color: rgba(var(--ovv-att), .55); color: var(--theme-text-primary); }
.ovi-tabs button.is-on .fa { color: var(--ovv-att-ink); }
.ovi-title { margin: 20px 0 12px; font-size: 14px; font-weight: 700; color: var(--theme-text-primary); }

/* ranked rows (top tactics / least covered): icon, name + detail line, bar, value */
.ovi-bars { display: flex; flex-direction: column; gap: 16px; margin-bottom: 22px; }
.ovi-bar-row { display: grid; grid-template-columns: minmax(250px, 1.1fr) minmax(0, 1.4fr) 50px; align-items: center; gap: 16px; cursor: default; }
.ovi-bar-k { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: 14px; color: var(--theme-text-primary); }
.ovi-bar-k > .fa { width: 34px; height: 34px; flex: none; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; color: var(--ovv-att-ink); background: rgba(var(--ovv-att), .12); }
.ovi-bar-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ovi-bar-t b { font-size: 13px; font-weight: 600; color: var(--theme-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ovi-bar-t em { font-style: normal; font-size: 12px; color: var(--theme-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ovi-bar { height: 16px; border-radius: 5px; background: var(--theme-bg-subtle-strong); overflow: hidden; }
.ovi-bar i { display: block; height: 100%; border-radius: 5px; }
.ovi-rank-0 { background: rgba(var(--ovv-att), .95); }
.ovi-rank-1 { background: rgba(var(--ovv-att), .8); }
.ovi-rank-2 { background: rgba(var(--ovv-att), .65); }
.ovi-rank-3 { background: rgba(var(--ovv-att), .52); }
.ovi-rank-4 { background: rgba(var(--ovv-att), .42); }
.ovi-bar-row > strong { text-align: right; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--theme-text-primary); }

/* gaps */
.ovi-gaps { display: flex; flex-direction: column; margin-bottom: 22px; }
.ovi-gap { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--theme-border-subtle); }
.ovi-gap:first-child { border-top: 0; }
.ovi-gap-ic { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--theme-text-muted); border: 1px dashed var(--theme-text-muted); }
.ovi-gap strong { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; color: var(--theme-text-primary); }
.ovi-gap strong code { font-size: 11.5px; color: var(--theme-text-secondary); }
.ovi-gap div > span { display: block; margin-top: 2px; font-size: 12px; color: var(--theme-text-secondary); }

/* key insight, pinned to the bottom of the card */
.ovi-insight { display: flex; align-items: center; gap: 14px; margin-top: auto; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--theme-border-color); background: var(--theme-bg-subtle); }
.ovi-insight > .fa { font-size: 20px; color: var(--ovv-att-ink); }
.ovi-insight > div { flex: 1; min-width: 0; }
.ovi-insight b { color: var(--theme-text-primary); }
.ovi-insight > div > b { display: block; font-size: 13px; color: var(--ovv-att-ink); }
.ovi-insight p { margin: 3px 0 0; font-size: 12.5px; color: var(--theme-text-secondary); line-height: 1.45; }

/* ============================================================ the chart under the rows */
.ovi-chart { margin: 4px 0 20px; }
.ovi-chart .ovc-sub { margin: 0 2px 10px; }
.ovi-chart .ovc-sub-note { display: inline-flex; align-items: center; gap: 6px; }
.ovi-chart .ovc-sub-note b { color: var(--theme-text-primary); }

/* Activity · tactic trends — one card per top tactic */
.ovi-sm { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ovi-sm-card { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 11px 12px 10px; border-radius: 12px; border: 1px solid var(--theme-border-subtle); background: linear-gradient(180deg, rgba(var(--ovv-att), .07), transparent 60%), var(--theme-bg-subtle); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.ovi-sm-card:hover { transform: translateY(-2px); border-color: rgba(var(--ovv-att), .5); box-shadow: 0 8px 22px -12px rgba(var(--ovv-att), .6); }
.ovi-sm-card.is-hot { border-color: rgba(var(--ovv-att), .6); box-shadow: inset 0 0 0 1px rgba(var(--ovv-att), .25), 0 0 24px -10px rgba(var(--ovv-att), .8); }
.ovi-sm-k { display: flex; align-items: flex-start; gap: 7px; min-height: 30px; font-size: 12px; font-weight: 700; line-height: 1.25; color: var(--theme-text-primary); }
.ovi-sm-k > .fa { flex: none; margin-top: 2px; color: var(--ovv-att-ink); }
.ovi-sm-k > span { flex: 1; min-width: 0; }
.ovi-sm-badge { position: absolute; top: -9px; right: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: .2px; white-space: nowrap; color: var(--ovv-att-on); background: rgb(var(--ovv-att)); box-shadow: 0 2px 8px rgba(var(--ovv-att), .45); }

.ovi-tr-plot { position: relative; height: 58px; margin: 2px 0 0; }
.ovi-tr-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ovi-tr-line { fill: none; stroke: rgb(var(--ovv-att)); stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ovi-tr-line.is-past { stroke-width: 1.5; opacity: .45; stroke-dasharray: 3 3; }
.ovi-tr-line.is-now { stroke-width: 2.4; stroke: var(--ovv-att-ink); stroke-dasharray: 1; stroke-dashoffset: 0; animation: ovi-draw .9s ease-out both; }
@keyframes ovi-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.ovi-tr-split { position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px dashed var(--theme-border-color); pointer-events: none; }
.ovi-tr-dot { position: absolute; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: var(--theme-bg-card); box-shadow: inset 0 0 0 1.5px rgba(var(--ovv-att), .7); pointer-events: none; }
.ovi-tr-dot.is-now { width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; background: var(--ovv-att-ink); box-shadow: 0 0 0 3px rgba(var(--ovv-att), .28), 0 0 10px rgba(var(--ovv-att), .8); animation: ovi-pop .4s .75s ease-out both; }
@keyframes ovi-pop { from { transform: scale(0); } to { transform: scale(1); } }
.ovi-tr-hover { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); }
.ovi-tr-hover i { position: relative; cursor: default; }
.ovi-tr-hover i:hover::after { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px solid rgba(var(--ovv-att), .7); }
.ovi-tr-axis { display: grid; grid-template-columns: 1fr 1fr; font-size: 10.5px; color: var(--theme-text-muted); }
.ovi-tr-axis span { text-align: center; white-space: nowrap; }
.ovi-tr-axis b { font-weight: 700; color: var(--theme-text-secondary); }
.ovi-tr-axis span:last-child b { color: var(--theme-text-primary); }
.ovi-sm-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 2px; }
.ovi-sm-foot strong { font-size: 22px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; color: var(--theme-text-primary); }
/* change pill: steel for up, quiet grey for down — never red/green */
.ovi-pill { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ovi-pill.is-up { color: var(--ovv-att-on); background: rgb(var(--ovv-att)); }
.ovi-pill.is-down { color: var(--theme-text-secondary); background: var(--theme-bg-subtle-strong); }
.ovi-pill.is-flat { color: var(--theme-text-muted); background: var(--theme-bg-subtle-strong); }

/* Plain style and reduced motion: no draw-in, glow or hover lift */
.ovx--plain .ovi-sm-card { background: var(--theme-bg-subtle); }
.ovx--plain .ovi-sm-card:hover { transform: none; box-shadow: none; }
.ovx--plain .ovi-sm-card.is-hot { box-shadow: none; }
.ovx--plain .ovi-tr-line.is-now, .ovx--plain .ovi-tr-dot.is-now { animation: none; }
.ovx--plain .ovi-tr-dot.is-now { box-shadow: 0 0 0 3px rgba(var(--ovv-att), .22); }
@media (prefers-reduced-motion: reduce) {
    .ovi-tr-line.is-now, .ovi-tr-dot.is-now { animation: none; }
    .ovi-sm-card:hover { transform: none; }
}

/* Coverage · rule coverage over 12 weeks */
.ovi-ct { display: block; width: 100%; height: auto; overflow: visible; }
.ovi-ct-area { fill: rgba(var(--ovv-att), .14); }
.ovi-ct-line { fill: none; stroke: rgb(var(--ovv-att)); stroke-width: 2; stroke-linejoin: round; }
.ovi-ct-ev line { stroke: var(--theme-border-color); stroke-width: 1; stroke-dasharray: 2 3; }
.ovi-ct-ev circle { fill: var(--theme-bg-card); stroke: var(--ovv-att-ink); stroke-width: 2; cursor: default; }
.ovi-ct-now { font-size: 12px; font-weight: 800; fill: var(--theme-text-primary); }
.ovi-ct-tick { font-size: 10.5px; fill: var(--theme-text-muted); }

/* ======================================================== responsive (desktop first) */
@media (max-width: 1500px) {
    .ovi-sm { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ovi-bar-row { grid-template-columns: minmax(200px, 1fr) minmax(0, 1fr) 44px; }
}
