/* ARGUS console — dark operations-intelligence surface.
   Design intent: information density over decoration. Hairline rules instead
   of cards, one accent per meaning, monospace throughout so identifiers,
   addresses and hashes stay column-aligned and scannable. */

:root {
  --bg:        #070a0e;
  --panel:     #0c1117;
  --panel-2:   #10161e;
  --raise:     #141c25;
  --line:      #1b232e;
  --line-2:    #26313f;

  --txt:       #c6d2df;
  --txt-hi:    #ffffff;
  --dim:       #64788d;
  --muted:     #445769;

  --cy:        #35d0e0;
  --am:        #e8a838;
  --rd:        #e85b52;
  --gn:        #45b98a;
  --vi:        #9b8ff0;
  --pk:        #e070a8;

  --critical:  #e85b52;
  --high:      #e8a838;
  --medium:    #35d0e0;
  --low:       #45b98a;
  --info:      #64788d;

  --topbar-h:  46px;
  --head-h:    34px;
  --left-w:    338px;
  --right-w:   412px;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
          "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

/* `hidden` must beat any layout display we set later (.modal is a flex box). */
[hidden] { display: none !important; }

html, body {
  height: 100%; margin: 0; background: var(--bg); color: var(--txt);
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}

button, input { font-family: inherit; font-size: inherit; color: inherit; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1d2732; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2c3a4a; }

.scroll { overflow-y: auto; overflow-x: hidden; }

/* ---------------------------------------------------------------- topbar */

#topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 14px;
  padding: 0 12px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: relative; z-index: 40;
}

.brand {
  display: flex; align-items: center; gap: 8px; color: var(--cy);
  letter-spacing: .28em; font-weight: 600; font-size: 13px; padding-right: 4px;
}
.brand span { color: var(--txt-hi); }

.searchwrap { position: relative; flex: 1 1 auto; max-width: 720px; }

#omnibox {
  width: 100%; height: 28px; padding: 0 10px;
  background: var(--bg); border: 1px solid var(--line-2); outline: none;
  color: var(--txt-hi); letter-spacing: .02em;
}
#omnibox:focus { border-color: var(--cy); box-shadow: 0 0 0 1px #35d0e022; }
#omnibox::placeholder { color: var(--muted); }

.suggest {
  position: absolute; top: 30px; left: 0; right: 0; max-height: 420px;
  overflow-y: auto; background: var(--panel-2);
  border: 1px solid var(--line-2); z-index: 60;
  box-shadow: 0 18px 40px #000a;
}
.suggest .s-row {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px;
  cursor: pointer; border-bottom: 1px solid var(--line);
}
.suggest .s-row:hover, .suggest .s-row.sel { background: var(--raise); }
.suggest .s-hint { color: var(--dim); margin-left: auto; font-size: 10px; }
.suggest .s-head {
  padding: 4px 10px; color: var(--dim); font-size: 10px;
  letter-spacing: .16em; background: var(--panel); border-bottom: 1px solid var(--line);
}

.topstats { display: flex; gap: 12px; align-items: center; margin-left: auto; }
.topstat { text-align: right; line-height: 1.15; }
.topstat b { display: block; color: var(--txt-hi); font-size: 13px; font-weight: 600; }
.topstat span { color: var(--dim); font-size: 9px; letter-spacing: .14em; }

.topactions { display: flex; gap: 6px; }

.btn {
  height: 26px; padding: 0 10px; background: var(--raise);
  border: 1px solid var(--line-2); color: var(--txt); cursor: pointer;
  letter-spacing: .12em; font-size: 10px; white-space: nowrap;
}
.btn:hover { border-color: var(--cy); color: var(--txt-hi); }
.btn.primary { color: var(--cy); border-color: #1f4a52; }
.btn.primary:hover { background: #12242a; }
.btn.sm { height: 20px; padding: 0 7px; font-size: 9px; }
.btn.on { background: #12242a; color: var(--cy); border-color: var(--cy); }

/* ----------------------------------------------------------------- shell */

#shell {
  display: grid; grid-template-columns: var(--left-w) 1fr var(--right-w);
  height: calc(100vh - var(--topbar-h));
}

#left, #right { background: var(--panel); display: flex; flex-direction: column;
                min-height: 0; }
#left { border-right: 1px solid var(--line); }
#right { border-left: 1px solid var(--line); }
#center { display: flex; flex-direction: column; min-width: 0; min-height: 0;
          background: var(--bg); }

.panel-head {
  height: var(--head-h); flex: 0 0 var(--head-h); display: flex;
  align-items: center; gap: 10px; padding: 0 10px;
  border-bottom: 1px solid var(--line); background: var(--panel);
}
.panel-title {
  color: var(--dim); letter-spacing: .2em; font-size: 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 55%; flex: 0 1 auto;
}
.crumbs { margin-left: auto; display: flex; align-items: center; gap: 2px;
          font-size: 10px; overflow: hidden; white-space: nowrap; }

.tabs { display: flex; gap: 2px; }
.tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--dim); cursor: pointer; padding: 8px 9px 6px;
  letter-spacing: .13em; font-size: 10px;
}
.tab:hover { color: var(--txt); }
.tab.active { color: var(--cy); border-bottom-color: var(--cy); }
.tabs.small .tab { padding: 8px 7px 6px; font-size: 9px; }

.view-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.view-tools label { color: var(--dim); font-size: 10px; letter-spacing: .1em; }

.view { flex: 1 1 auto; position: relative; min-height: 0; }
.view.scroll { padding: 14px 16px 40px; }

/* ----------------------------------------------------------------- queue */

.filterbar {
  display: flex; gap: 4px; padding: 6px 8px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); background: var(--panel-2);
}
.queue { flex: 1 1 auto; overflow-y: auto; min-height: 0; }

.q-item {
  padding: 9px 11px 10px; border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent; cursor: pointer;
}
.q-item:hover { background: var(--panel-2); }
.q-item.sel { background: var(--raise); border-left-color: var(--cy); }
.q-item .q-top { display: flex; align-items: baseline; gap: 8px; }
.q-score {
  font-weight: 700; font-size: 13px; min-width: 34px; letter-spacing: -.02em;
}
.q-title {
  color: var(--txt-hi); flex: 1 1 auto; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.q-sub { color: var(--dim); font-size: 10px; margin-top: 3px;
         display: flex; gap: 9px; flex-wrap: wrap; }
.q-tags { margin-top: 5px; display: flex; gap: 3px; flex-wrap: wrap; }

/* ------------------------------------------------------------ primitives */

.chip {
  display: inline-block; padding: 1px 6px; border: 1px solid var(--line-2);
  color: var(--dim); font-size: 9px; letter-spacing: .08em; white-space: nowrap;
}
.chip.cy { color: var(--cy); border-color: #1f4a52; }
.chip.am { color: var(--am); border-color: #4a3a17; }
.chip.rd { color: var(--rd); border-color: #4d201d; }
.chip.gn { color: var(--gn); border-color: #1d4438; }
.chip.vi { color: var(--vi); border-color: #35306b; }
.chip.solid { background: var(--raise); }

.sev-critical { color: var(--critical); }
.sev-high     { color: var(--high); }
.sev-medium   { color: var(--medium); }
.sev-low      { color: var(--low); }
.sev-info     { color: var(--info); }

.bar { height: 3px; background: var(--line); position: relative; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--cy); }

.empty { position: absolute; inset: 0; display: flex; align-items: center;
         justify-content: center; color: var(--dim); text-align: center;
         padding: 40px; }

h3.sec {
  color: var(--cy); font-size: 10px; letter-spacing: .2em; font-weight: 500;
  margin: 20px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line);
  text-transform: uppercase;
}
h3.sec:first-child { margin-top: 0; }

.kv { display: grid; grid-template-columns: 118px 1fr; gap: 2px 10px; }
.kv dt { color: var(--dim); font-size: 10px; letter-spacing: .06em;
         overflow: hidden; text-overflow: ellipsis; }
.kv dd { margin: 0; color: var(--txt); word-break: break-word; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; color: var(--dim); font-weight: 400; font-size: 9px;
  letter-spacing: .14em; padding: 4px 7px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--panel); z-index: 2;
}
.tbl { table-layout: fixed; }
.tbl td { padding: 4px 7px; border-bottom: 1px solid var(--line);
          vertical-align: top; overflow-wrap: anywhere; }
.tbl tr:hover td { background: var(--panel-2); }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }

.link { color: var(--cy); cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }

.mono-block {
  background: var(--bg); border: 1px solid var(--line); padding: 8px 10px;
  white-space: pre-wrap; word-break: break-all; color: #93a6b8;
  font-size: 11px; max-height: 260px; overflow: auto;
}

.narrative {
  background: var(--panel-2); border-left: 2px solid var(--cy);
  padding: 10px 12px; white-space: pre-wrap; color: #a9bacb; font-size: 11.5px;
}

.evrow { border-bottom: 1px solid var(--line); padding: 7px 0 8px; }
.evmeta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
          color: var(--dim); font-size: 10px; }
.evdetail { color: var(--txt); margin: 3px 0 4px; overflow-wrap: anywhere; }

details.raw { border: 1px solid var(--line); margin-top: 4px; }
details.raw > summary {
  cursor: pointer; padding: 3px 8px; color: var(--dim); font-size: 10px;
  letter-spacing: .1em; list-style: none;
}
details.raw > summary::-webkit-details-marker { display: none; }
details.raw > summary:before { content: "▸ "; color: var(--cy); }
details.raw[open] > summary:before { content: "▾ "; }
details.raw > div { border-top: 1px solid var(--line); }

/* ---------------------------------------------------------- kill chain */

.chain { position: relative; padding-left: 18px; }
.chain:before {
  content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px;
  width: 1px; background: var(--line-2);
}
.step { position: relative; padding: 0 0 12px 4px; }
.step:before {
  content: ""; position: absolute; left: -16px; top: 5px; width: 7px;
  height: 7px; border: 1px solid var(--cy); background: var(--bg);
  border-radius: 50%;
}
.step.critical:before { border-color: var(--critical); background: var(--critical); }
.step.high:before { border-color: var(--high); background: var(--high); }
.step .s-tac { color: var(--am); font-size: 9px; letter-spacing: .18em; }
.step .s-title { color: var(--txt-hi); cursor: pointer; }
.step .s-title:hover { color: var(--cy); }
.step .s-meta { color: var(--dim); font-size: 10px; }
.step .s-sum { color: var(--muted); font-size: 10.5px; margin-top: 2px; }

/* ------------------------------------------------------------- ATT&CK */

.matrix { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 14px; }
.mcol { min-width: 152px; flex: 0 0 auto; }
.mcol > h4 {
  margin: 0 0 5px; font-size: 9px; letter-spacing: .12em; color: var(--dim);
  font-weight: 500; border-bottom: 1px solid var(--line); padding-bottom: 4px;
  height: 30px; display: flex; align-items: flex-end;
}
.mcell {
  border: 1px solid var(--line); padding: 3px 6px; margin-bottom: 3px;
  font-size: 10px; color: var(--muted); cursor: default; line-height: 1.35;
  display: grid; grid-template-columns: 1fr auto; gap: 0 6px;
  align-items: start;
}
.mcell.hit { color: var(--txt-hi); cursor: pointer; }
.mcell .mid { font-size: 9px; color: var(--dim); letter-spacing: .05em;
              grid-column: 1; }
.mcell.hit .mid { color: inherit; opacity: .75; }
.mcell .mname { grid-column: 1; }
.mcell .mct { grid-column: 2; grid-row: 1 / span 2; font-weight: 700;
              align-self: center; }

/* -------------------------------------------------------- attack paths */

.pathcard {
  border: 1px solid var(--line); border-left: 2px solid var(--am);
  padding: 10px 12px; margin-bottom: 10px; background: var(--panel);
}
.hop { display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
       margin: 4px 0; }
.hop .node {
  border: 1px solid var(--line-2); padding: 1px 7px; color: var(--txt-hi);
  cursor: pointer; background: var(--raise);
}
.hop .node:hover { border-color: var(--cy); }
.hop .node.jewel { border-color: #4a3a17; color: var(--am); }
.hop .act { color: var(--dim); font-size: 10px; }
.hop .arrow { color: var(--am); }

/* -------------------------------------------------------------- graph */

#graph-canvas, #timeline-canvas { display: block; width: 100%; height: 100%; }
#view-graph, #view-timeline { overflow: hidden; }

.legend {
  position: absolute; left: 12px; bottom: 12px; display: flex; gap: 10px;
  flex-wrap: wrap; max-width: 70%; background: #070a0ecc; padding: 6px 9px;
  border: 1px solid var(--line); pointer-events: none;
}
.legend span { display: flex; align-items: center; gap: 5px; color: var(--dim);
               font-size: 9px; letter-spacing: .1em; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: block; }

.tip {
  position: absolute; pointer-events: none; z-index: 30; max-width: 340px;
  background: var(--panel-2); border: 1px solid var(--line-2);
  padding: 6px 9px; font-size: 11px; box-shadow: 0 10px 30px #000b;
}
.tip b { color: var(--txt-hi); }
.tip .t-dim { color: var(--dim); font-size: 10px; }

/* -------------------------------------------------------------- hunt */

.hunt-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.hunt-bar input {
  flex: 1 1 auto; height: 28px; padding: 0 10px; background: var(--bg);
  border: 1px solid var(--line-2); outline: none; color: var(--txt-hi);
}
.hunt-bar input:focus { border-color: var(--cy); }
.example { cursor: pointer; }
.example:hover code { color: var(--cy); }
.example code { color: var(--txt); }

/* -------------------------------------------------------------- misc */

.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--cy); color: var(--txt-hi);
  padding: 8px 16px; z-index: 200; box-shadow: 0 14px 40px #000c;
}

.modal {
  position: fixed; inset: 0; background: #04060999; z-index: 150;
  display: flex; align-items: center; justify-content: center; padding: 40px;
}
.modal-box {
  width: min(920px, 100%); max-height: 84vh; background: var(--panel);
  border: 1px solid var(--line-2); display: flex; flex-direction: column;
  box-shadow: 0 30px 90px #000d;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-bottom: 1px solid var(--line);
  color: var(--cy); letter-spacing: .2em; font-size: 10px;
}
#modal-body { padding: 16px 18px 26px; }

.spin { color: var(--dim); padding: 24px; text-align: center; }

@media (max-width: 1500px) { :root { --right-w: 360px; --left-w: 300px; } }
@media (max-width: 1220px) {
  #shell { grid-template-columns: 260px 1fr; }
  #right { display: none; }
}
