:root {
  --bg: #0e1117;
  --panel: #161b26;
  --panel2: #1c2333;
  --border: #262f45;
  --text: #dbe2f0;
  --muted: #7b869e;
  --accent: #5b9dff;
  --green: #2ecc8f;
  --red: #ff6b6b;
  --amber: #f0b429;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topnav {
  display: flex; align-items: center; gap: 2rem;
  padding: 0.7rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 1.1rem; }
.brand span { color: var(--accent); }
.topnav .links { display: flex; gap: 0.25rem; }
.topnav a {
  color: var(--muted); text-decoration: none;
  padding: 0.35rem 0.8rem; border-radius: 8px;
}
.topnav a:hover { color: var(--text); background: var(--panel2); }
.topnav a.on { color: var(--text); background: var(--panel2); }

main { flex: 1; padding: 1.5rem; max-width: 1400px; width: 100%; margin: 0 auto; }
footer { padding: 1rem 1.5rem; color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--border); }

h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1rem; margin: 0 0 0.75rem; color: var(--text); }
h3 { font-size: 0.9rem; margin: 1rem 0 0.4rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 1rem 1.25rem;
}
.card .num { font-size: 1.8rem; font-weight: 700; }
.card .lbl { color: var(--muted); font-size: 0.85rem; }

.cols { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; }
.grow { flex: 3 1 600px; }
.sidecol { flex: 1 1 260px; display: flex; flex-direction: column; gap: 1.25rem; }

.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.1rem 1.25rem; margin-bottom: 1.25rem;
}

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 0.78rem;
     text-transform: uppercase; letter-spacing: 0.04em; padding: 0.4rem 0.6rem;
     border-bottom: 1px solid var(--border); }
td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--panel2); }
td.empty { text-align: center; color: var(--muted); padding: 2rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; white-space: nowrap; }
.muted { color: var(--muted); }
.asset { max-width: 320px; }

.chip {
  display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; background: var(--panel2);
  border: 1px solid var(--border); white-space: nowrap;
}
.chip-house { color: #7fb3ff; }
.chip-senate { color: #c39bff; }
.chip-oge { color: #ffc46b; }

.badge {
  display: inline-block; padding: 0.1rem 0.55rem; border-radius: 6px;
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.badge-purchase { background: rgba(46, 204, 143, 0.15); color: var(--green); }
.badge-sale { background: rgba(255, 107, 107, 0.15); color: var(--red); }
.badge-exchange { background: rgba(240, 180, 41, 0.15); color: var(--amber); }
.badge-other { background: var(--panel2); color: var(--muted); }

.ticker { font-family: ui-monospace, Menlo, monospace; font-weight: 700; }

.ok { color: var(--green); font-size: 0.85rem; }
.err { color: var(--red); font-size: 0.85rem; }

.filters { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
input[type="text"], input[type="number"], select, textarea {
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0.45rem 0.7rem; font-size: 0.9rem; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 1px solid var(--accent); }
input.short { width: 110px; }
textarea { width: 100%; }
button {
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0.45rem 1rem; font-size: 0.9rem; cursor: pointer;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: #0b1220; font-weight: 600; }
button.small { padding: 0.25rem 0.7rem; font-size: 0.8rem; }

.field { display: block; margin: 0.9rem 0; font-size: 0.9rem; }
.field input, .field textarea { display: block; margin-top: 0.35rem; }
.field input[type="text"] { width: 100%; max-width: 480px; }
.checks { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.5rem 0 1rem; }
.checks label { display: flex; gap: 0.5rem; align-items: center; font-size: 0.9rem; }
.formtable input[type="number"] { width: 90px; }
.actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; }

.flash { padding: 0.7rem 1rem; border-radius: 10px; margin-bottom: 1rem;
         border: 1px solid var(--border); background: var(--panel); }
.flash.ok { border-color: rgba(46, 204, 143, 0.4); }

.statuslist, .tickerlist, .filinglist, .newslist, .loglist { list-style: none; margin: 0; padding: 0; }
.statuslist li, .tickerlist li, .loglist li {
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem;
}
.loglist li { justify-content: flex-start; }
.loglist .logtitle { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statuslist li:last-child, .tickerlist li:last-child, .loglist li:last-child { border-bottom: none; }
.filinglist li { padding: 0.35rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.filinglist li:last-child { border-bottom: none; }
.filinglist .muted { display: block; font-size: 0.78rem; }
.newslist li { padding: 0.3rem 0; font-size: 0.9rem; }
.newslist .muted { display: block; font-size: 0.78rem; }

.pager { display: flex; gap: 1rem; justify-content: center; padding-top: 0.9rem; }
