/* Fraud analyst console — monochrome "printed report" styling.
   Black and white only, hairline borders, sharp corners: the look of something
   printed and filed rather than a dashboard, which is what an audit trail is. */

* { box-sizing: border-box; }

:root {
  --ink: #000;
  --paper: #fff;
  --rule: #000;
  --muted: #555;
  --shade: #f2f2f2;
  --sans: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html, body {
  margin: 0; padding: 0;
  background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 14px; line-height: 1.55;
}

/* ---------------- layout ---------------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 190px;
  border-right: 1px solid var(--rule); padding: 22px 18px;
  display: flex; flex-direction: column;
}
.app-name { font-size: 26px; font-weight: 800; line-height: 1.05; margin: 0 0 14px; }
.sidebar nav { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.sidebar nav a {
  color: var(--ink); text-decoration: none; font-size: 14px; letter-spacing: .05em;
  padding: 9px 0; border-bottom: 1px solid var(--rule);
}
.sidebar nav a:hover { text-decoration: underline; }
.sidebar nav a.active { font-weight: 700; }
.sidebar-foot { margin-top: auto; font-size: 11px; color: var(--muted); }

main { margin-left: 190px; padding: 24px 28px 80px; max-width: 1200px; }
.view { display: none; }
.view.active { display: block; }

h1 { font-size: 22px; font-weight: 700; letter-spacing: .02em; margin: 0; }
.sub { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin: 2px 0 0; }
hr.heavy { border: none; border-top: 2px solid var(--rule); margin: 12px 0 14px; }
hr.thin { border: none; border-top: 1px solid var(--rule); margin: 10px 0; }
.legend { font-size: 12px; line-height: 1.5; margin: 8px 0; }
.bar {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em; margin: 10px 0 4px;
}
.section-head {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; margin: 22px 0 6px;
}
.sub-head {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em; margin: 12px 0 3px;
}

/* ---------------- controls ---------------- */
.actions { display: flex; gap: 8px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
button, .btn {
  background: var(--paper); color: var(--ink); border: 1px solid var(--rule);
  border-radius: 0; padding: 5px 14px; font-family: var(--sans); font-size: 13px;
  cursor: pointer; text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { background: var(--ink); color: var(--paper); }
button:disabled { opacity: .4; cursor: default; }
button:disabled:hover { background: var(--paper); color: var(--ink); }
.chk { font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

/* ---------------- tables ---------------- */
.scroll { overflow-x: auto; border-top: 2px solid var(--rule); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border: 1px solid var(--rule); padding: 5px 8px; text-align: left; vertical-align: top; }
th {
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  background: var(--shade); white-space: nowrap;
}
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--shade); }

table.kv td { padding: 4px 8px; }
table.kv td.k {
  font-weight: 600; width: 190px; text-transform: uppercase;
  font-size: 10px; letter-spacing: .04em;
}
/* A parameter name is an identifier someone will grep for, so it keeps its real
   lower-case spelling rather than being shouted like a column heading. */
table.kv td.k.param { text-transform: none; font-size: 12px; }
.param-label { font-weight: 400; text-transform: none; font-size: 11px; }

/* ---------------- counters ---------------- */
.counters { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.counter { flex: 1; min-width: 120px; border: 1px solid var(--rule); padding: 8px 10px; }
.counter b { display: block; font-size: 23px; font-weight: 700; line-height: 1.15; }
.counter span { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }

/* ---------------- cards ---------------- */
.card { border: 1px solid var(--rule); padding: 11px 13px; margin-bottom: 6px; }
.card-head { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.score { font-weight: 700; white-space: nowrap; font-family: var(--mono); }
.summary { font-size: 13px; line-height: 1.55; margin: 7px 0; }
.tags { font-family: var(--mono); font-size: 12px; }
.ref { font-size: 13px; line-height: 1.5; }
.reason { border: 1px solid var(--rule); padding: 7px 9px; font-weight: 600; margin: 6px 0 12px; }
.row-line { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--rule);
            display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.muted { color: var(--muted); }
.empty { font-style: italic; color: var(--muted); font-size: 13px; }

/* ---------------- drawer ---------------- */
.drawer { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50; }
.drawer-inner {
  position: absolute; inset: 0 0 0 auto; width: min(760px, 100%);
  background: var(--paper); border-left: 2px solid var(--rule);
  overflow-y: auto; padding: 16px 20px 60px;
}
.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 2px solid var(--rule); padding-bottom: 8px; margin-bottom: 12px;
  position: sticky; top: -16px; background: var(--paper);
}
#drawer-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
details { border: 1px solid var(--rule); padding: 6px 9px; margin: 8px 0; }
details summary { cursor: pointer; font-size: 12px; font-weight: 600; }

@media (max-width: 720px) {
  .sidebar { position: static; width: auto; border-right: none;
             border-bottom: 1px solid var(--rule); }
  main { margin-left: 0; padding: 16px; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .sidebar nav a { border-bottom: none; }
}
