/* ABQ Forensics — enterprise application foundation */
:root {
  --ink: #141716;
  --ink-soft: #343936;
  --muted: #69706c;
  --muted-2: #89908c;
  --line: #e1e4e1;
  --line-strong: #d3d8d4;
  --paper: #f3f5f3;
  --panel: #ffffff;
  --panel-subtle: #f8f9f8;
  --sidebar: #111513;
  --sidebar-raised: #1a1f1c;
  --blue: #5b82f6;
  --blue-soft: #eef3ff;
  --green: #4f825e;
  --green-soft: #edf5ef;
  --amber: #9a6d24;
  --amber-soft: #faf3e7;
  --red: #a45151;
  --red-soft: #faeeee;
  --shadow-sm: 0 1px 2px rgba(17, 24, 20, .035), 0 7px 22px rgba(17, 24, 20, .025);
  --shadow-md: 0 1px 2px rgba(17, 24, 20, .04), 0 14px 36px rgba(17, 24, 20, .045);
  --radius-sm: 7px;
  --radius-md: 11px;
  --radius-lg: 15px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

html { background: var(--paper); }

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 78% -10%, rgba(91, 130, 246, .035), transparent 28%),
    var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid rgba(91, 130, 246, .48);
  outline-offset: 2px;
}

.app-shell { grid-template-columns: 258px minmax(0, 1fr); }

.sidebar {
  width: 258px;
  padding: 24px 16px 18px;
  border-right: 1px solid rgba(255, 255, 255, .055);
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), transparent 24%),
    var(--sidebar);
}

.platform-mark.inverse {
  gap: 12px;
  margin: 0 8px;
  font-size: 11px;
  letter-spacing: .12em;
}

.platform-mark.inverse img {
  width: 35px;
  height: 35px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.1);
}

.platform-mark.inverse > span { display: grid; gap: 5px; }
.platform-mark.inverse b { font-size: 10px; font-weight: 650; letter-spacing: .15em; }
.platform-mark.inverse small {
  color: #777f7a;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: none;
}

.nav-label {
  margin: 46px 14px 10px;
  color: #626a65;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.sidebar nav { gap: 3px; margin-top: 0; }

.nav-item {
  position: relative;
  gap: 13px;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #8e9691;
  font-size: 11px;
  font-weight: 520;
  transition: color 160ms var(--ease), background 160ms var(--ease), border-color 160ms var(--ease);
}

.nav-item i {
  width: 18px;
  color: #59615c;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.nav-item:hover { border-color: rgba(255,255,255,.045); background: rgba(255,255,255,.035); color: #e9ecea; }
.nav-item.active {
  border-color: rgba(255,255,255,.06);
  background: linear-gradient(90deg, rgba(91,130,246,.12), rgba(255,255,255,.04));
  box-shadow: inset 2px 0 var(--blue);
  color: #fff;
}
.nav-item.active i { color: #89a6ff; }

.sidebar-foot {
  display: block;
  margin-top: auto;
  padding: 14px 10px 0;
  border-top: 1px solid #272c29;
}

.workspace-identity { display: flex; align-items: center; gap: 11px; }
.workspace-identity > div { min-width: 0; }
.workspace-identity strong, .workspace-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-identity strong { color: #e8ebe9; font-size: 10px; font-weight: 600; }
.workspace-identity small { margin-top: 4px; color: #747c77; font-size: 8px; }
.status-dot { width: 7px; height: 7px; flex: 0 0 auto; box-shadow: 0 0 0 4px rgba(79,130,94,.13); }

.environment-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #222724;
}
.environment-line span { color: #7fa58a; font-size: 8px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.environment-line small { color: #5f6762; font-size: 7px; }

.workspace { padding: 0 38px 64px; }

.workspace-head {
  min-height: 112px;
  padding: 22px 0 20px;
  border-bottom-color: var(--line);
}

.workspace-head-main { min-width: 0; }
.page-context { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; color: var(--muted); font-size: 9px; }
.page-context > span:first-child { max-width: 440px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-context > i { width: 3px; height: 3px; border-radius: 50%; background: #b2b8b4; }
.environment-badge {
  padding: 3px 6px;
  border: 1px solid #d8e7dc;
  border-radius: 4px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 7px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.workspace-head h1 { margin: 0; font-size: 23px; font-weight: 590; letter-spacing: -.025em; }
.workspace-head-main > p { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.head-actions { gap: 8px; }
.context-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.7);
  color: #656c68;
  font-size: 8px;
  font-weight: 600;
  box-shadow: 0 1px 1px rgba(17,24,20,.02);
}
.context-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.account { width: 32px; height: 32px; margin-left: 4px; border: 1px solid #303532; background: #1b201d; font-weight: 650; transition: transform 160ms var(--ease), background 160ms var(--ease); }
.account:hover { transform: translateY(-1px); background: #272d29; }

.view { padding-top: 24px; animation: view-in 180ms var(--ease); }
@keyframes view-in { from { opacity: .72; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } * { scroll-behavior: auto !important; } }

.metric-grid, .panel, .upload-card, .drop-zone, .source-disclosure, .report-source, .autopsy-grid, .analysis-trade, .report-download {
  border-color: var(--line);
}
.metric-grid, .panel, .upload-card { box-shadow: var(--shadow-sm); }
.metric-grid article, .panel, .upload-card { background: rgba(255,255,255,.88); }
.metric-grid strong, .autopsy-grid strong { font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.panel, .upload-card { border-radius: var(--radius-md); }
.panel h2 { color: var(--ink); letter-spacing: -.025em; }
.panel-head button, .empty-product button {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink-soft);
  font-weight: 650;
  letter-spacing: .08em;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), transform 160ms var(--ease);
}
.panel-head button:hover, .empty-product button:hover { transform: translateY(-1px); border-color: #bfc6c1; box-shadow: var(--shadow-sm); }
.good { color: var(--green) !important; }

.state-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-subtle);
  color: var(--muted);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: .04em;
}
.state-badge.good { border-color: #d8e7dc; background: var(--green-soft); }
.state-badge.warning { border-color: #eadcc3; background: var(--amber-soft); color: var(--amber); }
.state-badge.critical { border-color: #ecd7d7; background: var(--red-soft); color: var(--red); }

.state-panel { display: grid; place-items: center; min-height: 220px; padding: 32px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: rgba(255,255,255,.46); text-align: center; }
.state-panel strong { font-size: 13px; font-weight: 600; }
.state-panel p { max-width: 430px; margin: 8px auto 0; color: var(--muted); font-size: 10px; line-height: 1.6; }

.skeleton { position: relative; overflow: hidden; border-radius: 5px; background: #e8ebe8; color: transparent !important; }
.skeleton::after { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.68), transparent); content: ""; transform: translateX(-100%); animation: skeleton 1.4s infinite; }
@keyframes skeleton { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; } }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { width: auto; }
  .nav-label { display: none; }
  .workspace { padding: 0 22px 48px; }
  .workspace-head { min-height: 102px; }
  .context-chip { display: none; }
}

@media (max-width: 620px) {
  .workspace { padding-inline: 16px; }
  .workspace-head-main > p { max-width: 260px; }
  .page-context > span:first-child { max-width: 190px; }
}
