/* ============================================================
   OMGQA — design-system skin for MudBlazor.
   Dark-first, Linear/GitHub/Vercel lineage, indigo accent.
   Tokens ported from the OMGQA design prototype (styles.css).
   ============================================================ */

:root {
  --bg:            #0C0D11;
  --bg-elev:       #121319;
  --surface:       #16171E;
  --surface-2:     #1C1D26;
  --surface-3:     #232430;

  --line:          rgba(255,255,255,0.08);
  --line-2:        rgba(255,255,255,0.05);
  --line-strong:   rgba(255,255,255,0.14);

  --fg-1:          #EDEEF2;
  --fg-2:          #A6A8B3;
  --fg-3:          #6E707C;

  --accent:        #5E6AD2;
  --accent-hover:  #6E7AE6;
  --accent-soft:   color-mix(in srgb, var(--accent) 16%, transparent);

  --sev-critical:  #F2555A;
  --sev-high:      #FF8A3D;
  --sev-medium:    #E5B636;
  --sev-low:       #57B6E5;
  --sev-none:      #6E707C;

  --st-open:       #57B6E5;
  --st-triage:     #C792EA;
  --st-progress:   #E5B636;
  --st-review:     #FF8A3D;
  --st-resolved:   #38C793;
  --st-closed:     #6E707C;

  --ai:            #C792EA;

  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

html, body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg-1);
}

.mud-typography, .mud-input, .mud-button-root, .mud-nav-link, .mud-table {
  font-family: var(--font-sans) !important;
}

code, .t-mono, .mono { font-family: var(--font-mono); }
.om-muted { color: var(--fg-2); }
.om-faint { color: var(--fg-3); }

/* ---------- App shell ---------- */
.om-appbar {
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.om-brand { font-weight: 700; letter-spacing: -.2px; }
.om-drawer .mud-drawer-content { border-right: 1px solid var(--line); background: var(--bg-elev); }
.om-main { background: var(--bg); }
.om-page { padding: 20px 24px; max-width: 1240px; }

/* ---------- Sidebar bits ---------- */
.om-ws {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px 6px; color: var(--fg-1);
}
.om-ws-mark {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700;
}
.om-ws-name { font-size: 13.5px; font-weight: 600; }
.om-ws-plan { font-size: 11px; color: var(--fg-3); }

.om-nav-head {
  display: block; padding: 14px 16px 4px; color: var(--fg-3);
  text-transform: uppercase; letter-spacing: .5px; font-weight: 600; font-size: 11.5px;
}
.om-proj-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 19px; height: 19px; border-radius: 5px; margin-right: 9px;
  font-size: 8.5px; font-weight: 700; font-family: var(--font-mono); letter-spacing: -.3px;
}
.om-user {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px; margin-top: auto; border-top: 1px solid var(--line-2);
}
.om-user-name { font-size: 13px; font-weight: 500; color: var(--fg-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.om-user-role { font-size: 11px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.om-user form { flex-shrink: 0; }

/* active nav link tint */
.om-drawer .mud-nav-link.active {
  background: var(--accent-soft) !important; color: var(--accent) !important;
}
.om-drawer .mud-nav-link.active .mud-icon-root { color: var(--accent) !important; }

/* ---------- Severity bars ---------- */
.om-sev-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.om-sev-bars > span { width: 3px; border-radius: 1px; display: block; }

/* ---------- Status badge ---------- */
.om-status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 7px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}

/* ---------- Tag ---------- */
.om-tag {
  display: inline-flex; align-items: center; gap: 1px;
  padding: 2px 8px; border-radius: 7px;
  background: var(--surface-3); color: var(--fg-2);
  font-size: 12px; font-weight: 500; white-space: nowrap;
  border: 1px solid var(--line-2);
}
.om-minitag {
  padding: 1px 6px; border-radius: 5px; background: var(--surface-2);
  color: var(--fg-3); font-size: 11px; white-space: nowrap;
}

/* ---------- Cards / papers ---------- */
.om-card {
  background: var(--surface) !important;
  border: 1px solid var(--line);
  border-radius: 12px; padding: 16px;
}
.om-card h3, .om-card-title { font-size: 13px; font-weight: 600; color: var(--fg-1); margin: 0 0 12px; }

/* ---------- Stat cards ---------- */
.om-stat { display: flex; flex-direction: column; gap: 6px; }
.om-stat-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.om-stat-val { font-size: 26px; font-weight: 600; letter-spacing: -.5px; }
.om-stat-label { font-size: 12.5px; color: var(--fg-2); }

/* ---------- Bars ---------- */
.om-bar-row { display: flex; align-items: center; gap: 10px; margin: 7px 0; }
.om-bar-label { width: 74px; font-size: 12.5px; color: var(--fg-2); }
.om-bar-track { flex: 1; height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.om-bar-fill { display: block; height: 100%; border-radius: 999px; }
.om-bar-val { width: 24px; text-align: right; font-size: 12.5px; color: var(--fg-2); font-variant-numeric: tabular-nums; }

/* ---------- Findings table refinements ---------- */
.om-ftitle { font-weight: 450; color: var(--fg-1); }
.om-id { color: var(--fg-2); font-size: 12.5px; }

/* ---------- Finding detail ---------- */
.om-d-title { font-size: 22px; font-weight: 600; letter-spacing: -.4px; margin: 8px 0 12px; line-height: 1.3; }
.om-d-topline { display: flex; align-items: center; gap: 8px; color: var(--fg-2); font-size: 13px; }
.om-d-quickbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.om-d-h { font-size: 13px; font-weight: 600; color: var(--fg-2); text-transform: uppercase; letter-spacing: .4px; margin: 0 0 10px; }
.om-d-desc p { color: var(--fg-1); line-height: 1.65; margin: 0 0 12px; }
.om-ai-panel {
  border: 1px solid color-mix(in srgb, var(--ai) 35%, transparent);
  background: color-mix(in srgb, var(--ai) 8%, var(--surface));
  border-radius: 12px; padding: 16px;
}
.om-ai-orb {
  width: 26px; height: 26px; border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--ai) 22%, transparent); color: var(--ai);
}
.om-ev-card {
  display: flex; align-items: center; gap: 10px; padding: 9px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
}
.om-ev-thumb { width: 44px; height: 44px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.om-prop { display: flex; align-items: center; min-height: 30px; }
.om-prop-label { width: 96px; color: var(--fg-3); font-size: 12.5px; flex-shrink: 0; }
.om-rail-h { color: var(--fg-3); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.om-pill-soft { padding: 2px 8px; border-radius: 6px; background: var(--surface-3); font-size: 12.5px; }

/* Workspace switcher — native <details> disclosure (B3). */
.om-ws-switch { position: relative; }
.om-ws-switch > summary {
  list-style: none; cursor: pointer; outline: none;
}
.om-ws-switch > summary::-webkit-details-marker { display: none; }
.om-ws-switch > summary::marker { content: ""; }
.om-ws-switch[open] > summary .om-ws-plan { color: var(--accent); }
.om-ws-menu {
  position: absolute; left: 8px; right: 8px; top: calc(100% - 2px); z-index: 1200;
  background: var(--bg-elev, var(--surface)); border: 1px solid var(--line);
  border-radius: 10px; padding: 5px; box-shadow: 0 10px 30px rgba(0,0,0,.28);
}
.om-ws-sep { height: 1px; background: var(--line-2); margin: 5px 6px; }
.om-ws-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: 0; text-align: left; cursor: pointer;
  padding: 8px 12px; border-radius: 7px; font-size: 13.5px; color: var(--fg-1);
  text-decoration: none;
}
.om-ws-item:hover { background: var(--surface-2); }

/* Paste-a-screenshot target in the New Finding dialog (permission-free clipboard paste). */
.om-pastebox {
  min-height: 38px; border: 1px dashed var(--line); border-radius: 8px;
  padding: 9px 12px; color: var(--fg-1); font-size: 13px; cursor: text;
  transition: border-color .12s ease;
}
.om-pastebox:empty::before { content: attr(data-ph); color: var(--fg-3); }
.om-pastebox:focus { outline: none; border-color: var(--accent); background: var(--surface-2); }

/* ============================================================
   E23 — In-app debugging: evidence timeline + trace step viewer.
   ============================================================ */
.om-tl { margin-top: 6px; }
.om-tl-lane {
  display: grid; grid-template-columns: 78px 1fr; align-items: center;
  gap: 10px; min-height: 30px; padding: 3px 0;
}
.om-tl-lane-label {
  color: var(--fg-3); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px; text-align: right;
}
.om-tl-track {
  position: relative; height: 22px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--line-2);
}
.om-tl-mark {
  position: absolute; top: 3px; width: 12px; height: 12px; margin-left: -6px;
  border-radius: 50%; border: 2px solid var(--bg); cursor: pointer;
  background: var(--accent);
}
.om-tl-mark.is-error { background: var(--sev-critical); }
.om-tl-mark.k-screenshot { background: var(--st-open); }
.om-tl-mark.k-video { background: var(--st-triage); }
.om-tl-mark.k-network { background: var(--st-resolved); }
.om-tl-mark.k-console { background: var(--st-progress); }
.om-tl-axis {
  display: flex; justify-content: space-between;
  color: var(--fg-3); font-size: 10.5px; padding: 2px 0 0 88px;
}
.om-step {
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); padding: 10px 12px; margin-top: 8px;
}
.om-step.is-failed { border-color: color-mix(in srgb, var(--sev-critical) 55%, transparent); }
.om-step-head { display: flex; align-items: center; gap: 8px; }
.om-step-idx {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--fg-2);
}
.om-step-dur { color: var(--fg-3); font-size: 11.5px; margin-left: auto; }
.om-step-err {
  margin-top: 8px; padding: 8px 10px; border-radius: 8px; font-size: 12px;
  background: color-mix(in srgb, var(--sev-critical) 12%, transparent);
  color: var(--sev-critical); white-space: pre-wrap;
}
.om-net-row {
  display: grid; grid-template-columns: 52px 56px 1fr 70px; gap: 8px;
  align-items: center; font-size: 12px; padding: 5px 0;
  border-bottom: 1px solid var(--line-2);
}
.om-net-status { font-weight: 700; }
.om-net-status.is-error { color: var(--sev-critical); }
.om-net-status.is-ok { color: var(--st-resolved); }
.om-lightbox-img { max-width: 100%; max-height: 78vh; display: block; margin: 0 auto; border-radius: 8px; }
