/* ============================================================================
   M-Office Portal Academy — Admin authoring polish.
   Loaded on every page (scoped to admin classes; no effect on public pages).
   Uses design tokens so it adapts to dark mode automatically.
   ========================================================================== */

/* Page header: title left, primary actions right. */
.admin-head { display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.admin-head h1 { margin: 0; }
.admin-sub { color: var(--muted); font-size: .92rem; margin: 2px 0 22px; max-width: 70ch; }

/* Card section headings (so a bare <h3> inside a card reads as a section). */
.dash-main .card-pad > h3:first-child { margin-top: 0; font-size: 1.05rem; }
.card-head { display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin: -2px 0 14px; padding-bottom: 12px;
    border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font-size: 1.05rem; }
.card-head .card-head-desc { color: var(--muted); font-size: .85rem; }

/* Tables — zebra, hover, sticky header, tidy action cells. */
.dash-main .table { background: var(--card); }
.dash-main .table thead th { position: sticky; top: 0; background: var(--card); z-index: 1; }
.dash-main .table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--bg) 55%, transparent); }
.dash-main .table tbody tr:hover { background: var(--green-wash); }
.dash-main .table td, .dash-main .table th { vertical-align: middle; }
.dash-main .table td .flex, .dash-main .table td form { align-items: center; }
.dash-main .table td:last-child { white-space: nowrap; }

/* Square icon button for ✕ / single-glyph actions. */
.btn-icon { padding: 0 !important; width: 30px; height: 30px; display: inline-flex;
    align-items: center; justify-content: center; line-height: 1; border-radius: 8px; }

/* Forms: a little more rhythm + comfortable grids. */
.dash-main .form-group { margin-bottom: 16px; }
.dash-main .grid.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-main .grid.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) {
    .dash-main .grid.grid-2, .dash-main .grid.grid-3 { grid-template-columns: 1fr; }
}
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.checkbox-row input { margin-top: 3px; }

/* Settings: tabs + sticky save bar so "Save" is always reachable. */
.set-tabs { position: sticky; top: 0; z-index: 5; background: var(--bg);
    padding: 12px 0; margin: 6px 0 18px; }
.set-savebar { position: sticky; bottom: 0; z-index: 5;
    background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: saturate(140%) blur(6px);
    border-top: 1px solid var(--line); padding: 12px 0; margin-top: 8px;
    display: flex; align-items: center; gap: 14px; }
.set-savebar .saved-hint { color: var(--muted); font-size: .85rem; }
/* While searching, panels are shown together and the tab strip is hidden. */
.dash-main.searching .set-tabs { display: none; }
.dash-main.searching .set-savebar { position: static; }
.set-field { scroll-margin-top: 80px; }

/* Question option rows + lesson block editor. */
.opt-row { background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
    padding: 8px 10px; }
.opt-row input[type="checkbox"] { width: 18px; height: 18px; flex: none; }
.block-card { border-left: 3px solid var(--green); }
.block-card .label { font-size: .82rem; }

/* Status pills with a leading dot for scannability. */
.pill.status::before { content: ""; display: inline-block; width: 7px; height: 7px;
    border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: middle; opacity: .9; }

/* Empty-state card. */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .empty-emoji { font-size: 2rem; display: block; margin-bottom: 8px; }

/* Mobile: let the admin sidebar collapse gracefully into a scroll strip. */
@media (max-width: 980px) {
    .dash-main { padding: 20px 16px; }
}

/* ── Shared chart system (App\Support\Chart) ─────────────────────────────── */
.chart { width: 100%; height: 120px; display: block; }
.chart text { fill: var(--muted); font-size: 8px; font-family: var(--font-sans); }
.chart rect.bar-green { fill: var(--green); } .chart rect.bar-gold { fill: var(--gold); }
.chart rect.bar-blue { fill: #2f6db5; } .chart rect.bar-red { fill: var(--red); }
.chart .line-green { stroke: var(--green); stroke-width: 2; }
.chart .line-green-fill { fill: var(--green); opacity: .10; }
.chart .line-gold { stroke: var(--gold); stroke-width: 2; }
.chart .line-gold-fill { fill: var(--gold); opacity: .10; }
.chart .line-green-dot, .chart .line-gold-dot { fill: var(--green-deep); }
.spark { width: 120px; height: 28px; display: inline-block; vertical-align: middle; }
.spark .spark-green { stroke: var(--green); stroke-width: 1.6; }
.spark .spark-gold { stroke: var(--gold); stroke-width: 1.6; }
.spark .spark-red { stroke: var(--red); stroke-width: 1.6; }

/* Donut + legend */
.donut-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.donut text.donut-top { fill: var(--ink, #1c1c1a); font-size: 20px; font-weight: 800; font-family: var(--font-sans); }
.donut text.donut-sub { fill: var(--muted); font-size: 8px; font-family: var(--font-sans); }
.donut-legend { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.donut-legend li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.donut-legend .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* Horizontal bars */
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar-row { display: grid; grid-template-columns: 130px 1fr 64px; align-items: center; gap: 10px; }
.hbar-label { font-size: .84rem; }
.hbar-track { background: var(--line); border-radius: 6px; height: 12px; overflow: hidden; }
.hbar-fill { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--green), var(--green-deep)); }
.hbar-fill.bar-gold { background: linear-gradient(90deg, var(--gold), #b8860b); }
.hbar-val { text-align: right; font-weight: 700; font-size: .82rem; }

/* ── Insights hub ────────────────────────────────────────────────────────── */
.ins-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 980px) { .ins-grid { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .n { font-size: 1.5rem; font-weight: 800; color: var(--green-deep); line-height: 1.05; }
.stat .l { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.stat .d { font-size: .74rem; margin-top: 3px; color: var(--muted); }

/* Cohort retention grid */
.cohort { border-collapse: separate; border-spacing: 3px; width: 100%; }
.cohort th { font-size: .72rem; color: var(--muted); font-weight: 600; padding: 2px 4px; text-align: center; }
.cohort td { text-align: center; font-size: .74rem; padding: 7px 4px; border-radius: 5px; color: var(--ink); min-width: 40px; }
.cohort td.lab { text-align: left; color: var(--ink, #1c1c1a); font-weight: 600; background: transparent; white-space: nowrap; }
.cohort td.empty { background: transparent; color: var(--line); }

/* Security-posture gauge */
.posture { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.posture .gauge { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
    font-size: 1.6rem; font-weight: 800; color: #fff; flex: none; }
.posture .gauge.good { background: var(--green); } .posture .gauge.warn { background: var(--gold); }
.posture .gauge.bad { background: var(--red); }
.factor-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.factor-row:last-child { border-bottom: 0; }
.factor-bar { height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; grid-column: 1 / -1; }
.factor-bar > span { display: block; height: 6px; border-radius: 4px; }
.factor-bar > span.good { background: var(--green); } .factor-bar > span.warn { background: var(--gold); } .factor-bar > span.bad { background: var(--red); }
.factor-rec { grid-column: 1 / -1; font-size: .78rem; color: var(--muted); }

/* Clickable KPI / stat cards — affordance + keyboard focus. */
a.kpi, a.stat { transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast); color: inherit; }
a.kpi:hover, a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--green); }
a.kpi:focus-visible, a.stat:focus-visible { outline: none; box-shadow: var(--ring); }

/* Drill-down affordances: linked chart elements + hbar rows + funnel rows. */
.hbar-link { text-decoration: none; color: inherit; border-radius: 6px; }
.hbar-link:hover .hbar-label { color: var(--green); text-decoration: underline; }
.chart a rect:hover, .donut a circle:hover { opacity: .75; cursor: pointer; }
.chart a:focus-visible rect, .donut a:focus-visible circle { opacity: .75; }
a.cc-funnel-row, a.funnel-row { text-decoration: none; color: inherit; }
a.cc-funnel-row:hover span, a.funnel-row:hover span { color: var(--green); }
a.cc-bar-col { text-decoration: none; color: inherit; }
a.cc-bar-col:hover .cc-bar { opacity: .75; }
a.cc-hero-main, a.cc-mini { text-decoration: none; display: block; }
a.cc-mini { color: inherit; transition: transform var(--t-fast), border-color var(--t-fast); }
a.cc-mini:hover { transform: translateY(-2px); border-color: var(--green); }
a.cc-hero-main:hover { filter: brightness(1.07); }
a.cc-hero-main:focus-visible, a.cc-mini:focus-visible { outline: none; box-shadow: var(--ring); }
.cohort-caption { font-size: .72rem; color: var(--muted); margin: 0 0 6px; }

/* ── Process Mining ──────────────────────────────────────────────────────── */
.pm-graph { width: 100%; max-width: 640px; height: auto; display: block; font-family: var(--font-sans); }
.pm-graph .pm-node rect { fill: var(--card); stroke: var(--green); stroke-width: 1.5; }
.pm-graph .pm-start rect { fill: var(--green); stroke: var(--green); }
.pm-graph .pm-end rect { fill: var(--red); stroke: var(--red); }
.pm-graph .pm-start .pm-nlabel, .pm-graph .pm-end .pm-nlabel,
.pm-graph .pm-start .pm-ncount, .pm-graph .pm-end .pm-ncount { fill: #fff; }
.pm-graph .pm-nlabel { fill: var(--ink); font-size: 11px; font-weight: 600; }
.pm-graph .pm-ncount { fill: var(--muted); font-size: 10px; }
.pm-graph .pm-bar { fill: var(--green); opacity: .55; }
.pm-graph .pm-fwd { stroke: var(--green); color: var(--green); opacity: .55; }
.pm-graph .pm-back { stroke: var(--gold); color: var(--gold); opacity: .7; }
.pm-graph .pm-loop { stroke: var(--gold); color: var(--gold); opacity: .7; }
.pm-graph .pm-elabel { fill: var(--muted); font-size: 9px; }

.pm-key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; }
.pm-key.fwd { background: var(--green); } .pm-key.back { background: var(--gold); }

.pm-variant { padding: 10px 0; border-bottom: 1px solid var(--line); }
.pm-variant:last-child { border-bottom: 0; }
.pm-variant-head { display: flex; align-items: center; gap: 10px; font-size: .85rem; margin-bottom: 6px; }
.pm-variant-rank { background: var(--green-wash); color: var(--green-deep); font-weight: 800; font-size: .72rem;
    padding: 1px 8px; border-radius: 999px; }
.pm-variant-flow { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.pm-step { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: .78rem; }
.pm-arrow { color: var(--muted); font-size: .8rem; }

/* Process Mining — conformance overlay */
.pm-graph .pm-forbidden { stroke: var(--red); color: var(--red); opacity: .9; stroke-dasharray: 4 3; }
.pm-key.forb { background: var(--red); }

/* ── Process Mining — interactive animated map ───────────────────────────── */
.pm-stage { background: radial-gradient(circle at 30% 0%, color-mix(in srgb, var(--green) 7%, var(--card)), var(--card));
    border: 1px solid var(--line); border-radius: var(--radius, 14px); overflow: hidden; }
.pm-map { width: 100%; max-width: 680px; height: auto; display: block; margin: 0 auto; font-family: var(--font-sans); }
.pm-map .pm-n-box { fill: var(--card); stroke: var(--green); stroke-width: 1.5; }
.pm-map .pm-n-start .pm-n-box { fill: var(--green); stroke: var(--green); }
.pm-map .pm-n-end .pm-n-box { fill: var(--red); stroke: var(--red); }
.pm-map .pm-n-other .pm-n-box { fill: var(--bg); stroke: var(--line); stroke-dasharray: 3 3; }
.pm-map .pm-n-label { fill: var(--ink); font-size: 11px; font-weight: 600; }
.pm-map .pm-n-count { fill: var(--muted); font-size: 10px; font-weight: 700; }
.pm-map .pm-n-start .pm-n-label, .pm-map .pm-n-end .pm-n-label,
.pm-map .pm-n-start .pm-n-count, .pm-map .pm-n-end .pm-n-count { fill: #fff; }
.pm-map .pm-n-bar { fill: var(--green); opacity: .5; }
.pm-map .pm-n { transition: filter .2s ease; }
.pm-map .pm-n.pm-firing .pm-n-box { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--green) 70%, transparent)); }
.pm-map .pm-n.pm-firing.pm-n-end .pm-n-box { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--red) 70%, transparent)); }

.pm-map .pm-e { stroke: var(--green); color: var(--green); opacity: .5; transition: opacity .15s ease; }
.pm-map .pm-e-back, .pm-map .pm-e-loop { stroke: var(--gold); color: var(--gold); opacity: .65; }
.pm-map .pm-e-skip { stroke: var(--green); color: var(--green); opacity: .42; }
.pm-map.pm-dim .pm-e { opacity: .12; }
.pm-map .pm-e.pm-e-hot { opacity: 1 !important; }
.pm-map .pm-e-label { fill: var(--muted); font-size: 9px; pointer-events: none; }
.pm-map.pm-metric-perf .pm-e-label { fill: var(--ink-soft); font-weight: 600; }

.pm-token { fill: #fff; stroke: var(--green-deep); stroke-width: 1.5;
    filter: drop-shadow(0 0 5px color-mix(in srgb, var(--green) 85%, transparent)); }
.pm-map.pm-metric-perf .pm-token { stroke: #b8860b; filter: drop-shadow(0 0 5px rgba(217,163,0,.85)); }
@media (prefers-reduced-motion: reduce) { .pm-token { filter: none; } }

/* Replay controls */
.pm-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--card); }
.pm-controls.pm-empty .pm-play, .pm-controls.pm-empty .pm-scrub, .pm-controls.pm-empty .pm-speed { display: none; }
.pm-play { min-width: 92px; }
.pm-scrub { flex: 1; min-width: 160px; accent-color: var(--green); cursor: pointer; }
.pm-clock { font-family: var(--font-mono); font-weight: 700; font-size: .9rem; color: var(--green-deep);
    min-width: 96px; text-align: center; }
.pm-live { font-size: .78rem; color: var(--muted); min-width: 150px; }
.pm-speed { font-size: .82rem; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.pm-metric { display: inline-flex; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pm-metric .btn { border-radius: 0; border: 0; }
.pm-note { font-size: .78rem; color: var(--muted); }
.pm-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .76rem; color: var(--muted); margin: 8px 0 0; align-items: center; }
.pm-legend .pm-key.heat { width: 44px; height: 6px; background: linear-gradient(90deg, #1f8a4c, #d9a300, #c0392b); }
.pm-legend .pm-key.tok { width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 1.5px solid var(--green-deep); }

/* Map abstraction + faded (de-spaghetti) */
.pm-controls-2 { border-bottom: 0; border-top: 1px dashed var(--line); }
.pm-abstract { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); }
.pm-abstract input[type=range] { width: 110px; accent-color: var(--green); }
.pm-abstract-val { font-variant-numeric: tabular-nums; min-width: 34px; font-weight: 600; color: var(--ink-soft); }
.pm-solo { font-size: .82rem; color: var(--green-deep); font-weight: 600; }
.pm-map .pm-faded { opacity: .07 !important; transition: opacity .2s ease; }
.pm-map .pm-n.pm-faded .pm-n-box { stroke-dasharray: 2 2; }

/* Filter bar */
.pm-filterbar { padding: 12px 16px; }
.pm-filter-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.pm-field { display: flex; flex-direction: column; gap: 3px; font-size: .72rem; font-weight: 700; letter-spacing: .03em;
    text-transform: uppercase; color: var(--muted); }
.pm-field input, .pm-field select { font-size: .9rem; font-weight: 400; text-transform: none; letter-spacing: 0;
    padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.pm-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pm-chip { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600;
    background: var(--green-wash); color: var(--green-deep); border-radius: 999px; padding: 4px 10px; }
.pm-chip a { color: var(--green-deep); text-decoration: none; font-weight: 800; }

/* Conversion funnel */
.pm-funnel { display: flex; flex-direction: column; gap: 4px; }
.pm-funnel-row { display: grid; grid-template-columns: 180px 1fr 150px 70px; align-items: center; gap: 12px; padding: 4px 0; }
.pm-funnel-name { font-size: .86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-funnel-track { background: var(--line); border-radius: 8px; height: 22px; overflow: hidden; }
.pm-funnel-fill { display: block; height: 22px; border-radius: 8px;
    background: linear-gradient(90deg, var(--green), var(--green-deep)); transition: width .4s ease; }
.pm-funnel-val { font-size: .82rem; color: var(--ink-soft); text-align: right; }
.pm-funnel-drop { font-size: .76rem; font-weight: 700; color: var(--red); text-align: right; }
@media (max-width: 720px) { .pm-funnel-row { grid-template-columns: 110px 1fr 90px; } .pm-funnel-drop { display: none; } }

/* Case explorer + mini-Gantt */
.pm-cases-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.pm-cases-wrap { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.pm-cases { margin: 0; }
.pm-cases thead th { position: sticky; top: 0; background: var(--card); z-index: 1; user-select: none; }
.pm-cases .pm-sort::after { content: " ⇅"; color: var(--muted); font-size: .7rem; }
.pm-cases tbody tr { cursor: pointer; }
.pm-cases tbody tr:hover { background: var(--green-wash); }
.pm-cases tr.pm-row-active { background: color-mix(in srgb, var(--green) 16%, var(--card)); box-shadow: inset 3px 0 0 var(--green); }
.pm-case-id { font-family: var(--font-mono); font-size: .82rem; }
.pm-gantt { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.pm-gantt-head { font-size: .85rem; margin-bottom: 8px; color: var(--ink-soft); }
.pm-gantt-track { display: flex; align-items: center; gap: 0; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.pm-gantt-step { flex: 0 0 auto; background: var(--card); border: 1px solid var(--green-tint); color: var(--green-deep);
    border-radius: 6px; padding: 4px 8px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.pm-gantt-gap { flex: 1 1 auto; min-width: 30px; height: 2px; background: var(--green); opacity: .35; position: relative; margin: 0 2px; }
.pm-gantt-dur { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: .66rem; color: var(--muted); white-space: nowrap; }

/* Clickable variants */
.pm-variant-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.pm-variant-link:hover { color: var(--green-deep); }
.pm-variant-go { margin-left: auto; font-size: .76rem; font-weight: 700; color: var(--green); opacity: 0; transition: opacity .15s ease; }
.pm-variant-link:hover .pm-variant-go { opacity: 1; }

/* Root-cause comparison */
.pm-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pm-cohort { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.pm-cohort-a { border-left: 4px solid var(--green); }
.pm-cohort-b { border-left: 4px solid var(--red); }
.pm-cohort-h { font-weight: 800; font-size: .95rem; }
.pm-cohort-n { color: var(--muted); font-size: .82rem; margin-bottom: 8px; }
.pm-cohort-kpi { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.pm-cohort-kpi li { display: flex; justify-content: space-between; font-size: .85rem; border-bottom: 1px dashed var(--line); padding-bottom: 3px; }
.pm-cohort-kpi span { color: var(--muted); }
@media (max-width: 640px) { .pm-compare { grid-template-columns: 1fr; } }

/* Where the time goes */
.pm-time-row { display: grid; grid-template-columns: 230px 1fr 130px; align-items: center; gap: 12px; padding: 4px 0; }
.pm-time-name { font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-time-track { background: var(--line); border-radius: 8px; height: 18px; overflow: hidden; }
.pm-time-fill { display: block; height: 18px; border-radius: 8px; background: linear-gradient(90deg, var(--gold), var(--red)); }
.pm-time-val { font-size: .8rem; color: var(--ink-soft); text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .pm-time-row { grid-template-columns: 130px 1fr 90px; } }

/* Activity / edge inspector */
.pm-stage-body { position: relative; }
.pm-inspector { position: absolute; top: 10px; right: 10px; width: 250px; max-height: calc(100% - 20px); overflow: auto;
    background: var(--card); border: 1px solid var(--green-tint); border-radius: 12px; padding: 14px 16px;
    box-shadow: var(--shadow); z-index: 5; }
.pm-inspector h4 { margin: 0 28px 10px 0; font-size: .95rem; color: var(--green-deep); }
.pm-insp-close { position: absolute; top: 8px; right: 10px; background: 0; border: 0; font-size: 1rem; cursor: pointer; color: var(--muted); }
.pm-insp-row { display: flex; justify-content: space-between; gap: 10px; font-size: .84rem; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.pm-insp-row span { color: var(--muted); }
.pm-insp-drill { display: block; text-align: center; margin-top: 12px; }
@media (max-width: 700px) { .pm-inspector { position: static; width: auto; max-height: none; margin: 10px; } }

.pm-export { float: right; }

/* Section jump-nav (sticky) */
.pm-jump { position: sticky; top: 0; z-index: 6; display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto;
    background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(5px);
    padding: 9px 2px; margin: 10px 0 2px; border-bottom: 1px solid var(--line); }
.pm-jump a { flex: 0 0 auto; font-size: .8rem; font-weight: 600; color: var(--ink-soft); text-decoration: none;
    padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); white-space: nowrap; }
.pm-jump a:hover { background: var(--green-wash); color: var(--green-deep); border-color: var(--green-tint); }
[id^="sec-"], #pm-explorer { scroll-margin-top: 58px; }

/* Operational monitor */
.pm-ops { border-top: 3px solid var(--green); }

/* Alignment moves */
.al-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin-right: 3px; }
.al-key.al-sync { background: var(--green); }
.al-key.al-log { background: var(--gold); }
.al-key.al-model { background: var(--red); }
.al-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: .85rem; }
.al-fit { flex: 0 0 42px; font-weight: 800; font-size: .78rem; color: var(--ink-soft); text-align: right; }
.al-moves { display: flex; flex-wrap: wrap; gap: 4px; }
.al-move { font-size: .72rem; font-weight: 600; border-radius: 5px; padding: 2px 7px; border: 1px solid transparent; white-space: nowrap; }
.al-move.al-sync { background: var(--green-wash); color: var(--green-deep); border-color: var(--green-tint); }
.al-move.al-log { background: #fbf3df; color: #8a6d00; border-color: #ecdca5; }
.al-move.al-model { background: #fdecec; color: var(--red-deep); border-color: #f3b9b9; text-decoration: line-through; }
[data-theme="dark"] .al-move.al-log { background: #2e2613; color: #d9b65a; border-color: #4a3d1a; }
[data-theme="dark"] .al-move.al-model { background: #2a1414; color: #e88; border-color: #5a2626; }

/* Process tree (Inductive Miner) */
.pt-wrap { overflow: auto; padding: 6px 2px; }
.pt-node { display: inline-block; vertical-align: top; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 4px; background: var(--card); }
.pt-op { display: inline-block; font-weight: 800; font-size: .76rem; padding: 2px 8px; border-radius: 999px; margin-bottom: 6px; }
.pt-op em { font-style: normal; font-weight: 600; opacity: .85; }
.pt-seq > .pt-op { background: var(--green-wash); color: var(--green-deep); }
.pt-xor > .pt-op { background: #fbf3df; color: #8a6d00; }
.pt-and > .pt-op { background: #e7eefb; color: #2952cc; }
.pt-loop > .pt-op { background: #efe6fb; color: #6a3fb0; }
.pt-flower > .pt-op { background: #fdecec; color: var(--red-deep); }
.pt-children { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.pt-children > li { display: block; }
.pt-leaf { display: inline-block; background: var(--green); color: #fff; border-radius: 7px; padding: 5px 10px; font-size: .8rem; font-weight: 600; margin: 4px; }
.pt-tau { display: inline-block; background: var(--bg); color: var(--muted); border: 1px dashed var(--line); border-radius: 7px; padding: 5px 10px; font-size: .8rem; margin: 4px; }

/* Interactive force-directed network (referral / handover) */
.pm-net-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 8px; }
.pm-net-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); align-items: center; }
.pm-net-legend .pm-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: -1px; margin-right: 4px; }
.pm-dot-hub { background: radial-gradient(circle at 35% 30%, #6fd08a, #15823f); }
.pm-dot-sub { background: radial-gradient(circle at 35% 30%, #7fc7d8, #2f6db5); }
.pm-dot-leaf { background: radial-gradient(circle at 35% 30%, #cfd4cf, #8a938c); }
.pm-net-stage { position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
    background:
      radial-gradient(900px 300px at 30% -10%, color-mix(in srgb, var(--green) 8%, transparent), transparent 60%),
      var(--bg);
    background-image: radial-gradient(var(--line) 0.6px, transparent 0.6px); background-size: 22px 22px; }
.pm-net { display: block; width: 100%; height: 480px; touch-action: none; cursor: grab; font-family: var(--font-sans); }
.pm-net.pmn-grabbing { cursor: grabbing; }

.pmn-edge { stroke: var(--green); opacity: .35; transition: opacity .15s ease, stroke .15s ease; }
.pmn-edges .pmn-edge { color: var(--green); }
.pmn-node { cursor: pointer; }
.pmn-node circle { stroke: rgba(255,255,255,.85); stroke-width: 1.5; transition: r .15s ease; }
.pmn-hub circle { filter: drop-shadow(0 2px 6px rgba(21,130,63,.45)); }
.pmn-sub circle { filter: drop-shadow(0 2px 5px rgba(47,109,181,.35)); }
.pmn-label { fill: var(--ink); font-size: 10px; font-weight: 700; paint-order: stroke;
    stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
[data-theme="dark"] .pmn-label { stroke: #0c0c0c; }

/* Hover focus: spotlight the node + its neighbours, fade the rest. */
.pm-net.pmn-focus .pmn-node:not(.is-hot):not(.is-near) { opacity: .18; }
.pm-net.pmn-focus .pmn-edge:not(.is-hot) { opacity: .06; }
.pmn-edge.is-hot { opacity: .95; stroke-width: 3; }
.pmn-node.is-hot circle { stroke: var(--green-deep); stroke-width: 2.5; }

.pm-net-tip { position: absolute; z-index: 4; pointer-events: none; min-width: 150px; max-width: 230px;
    background: var(--card); border: 1px solid var(--green-tint); border-radius: 10px; box-shadow: var(--shadow);
    padding: 9px 12px; font-size: .8rem; display: flex; flex-direction: column; gap: 2px; }
.pm-net-tip strong { font-size: .9rem; color: var(--green-deep); margin-bottom: 3px; }
.pm-net-tip span { color: var(--muted); }
.pm-net-tip b { color: var(--ink); }
.pm-net-hint { display: block; margin-top: 2px; }

/* Process Intelligence cards */
.pi-card { border-left: 4px solid var(--line); }
.pi-card.pi-high { border-left-color: var(--red); }
.pi-card.pi-med { border-left-color: var(--gold); }
.pi-card.pi-low { border-left-color: var(--green); }
