@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto+Mono:wght@400;500;600&display=swap");

:root {
  --bg: #08090d;
  --bg-2: #0e1016;
  --panel: #13151d;
  --panel-2: #1a1d27;
  --line: rgba(255, 255, 255, 0.06);
  --ink: #f3efe4;
  --muted: #8d9086;
  --accent: #d6ff4a;
  --accent-ink: #14180a;
  --ok: #62e3a4;
  --wait: #ffc14a;
  --bad: #ff6f5e;
  --link: #e7f7a8;
  --stale: rgba(255, 111, 94, 0.12);
  --side: 248px;
  --font: Inter, "Segoe UI", system-ui, sans-serif;
  --font-display: Inter, "Segoe UI", sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(214, 255, 74, 0.07), transparent 50%),
    var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" 1, "kern" 1;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-card .brand-mark { letter-spacing: 0.12em; }

.login-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.login-card input {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  font: 15px var(--font);
}

.login-card input:focus {
  outline: none;
  border-color: var(--accent);
}

.login-card .btn-solid { width: 100%; margin-top: 6px; }
.login-card .flash { margin: 0; }

.shell {
  display: grid;
  grid-template-columns: var(--side) 1fr;
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 18px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 8px;
}

.brand-mark {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.brand-sub {
  color: var(--muted);
  font-size: 12px;
}

.search-side {
  display: flex;
}

.search-side input {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  font: 13px var(--font-mono), ui-monospace, monospace;
}

.search-side input::placeholder { color: #5e6158; }
.search-side input:focus {
  outline: none;
  border-color: var(--accent);
}

.side nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  padding: 9px 10px;
  border-radius: 10px;
  text-decoration: none;
}

.side nav a:hover { background: var(--panel); text-decoration: none; }
.side nav a.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.side nav a.active .badge { color: var(--accent-ink); opacity: 0.7; }

.badge {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
}

.badge-ban { color: var(--bad); }

.flag-ban {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #3a1c18;
  color: var(--bad);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

.btn-danger {
  background: var(--bad);
  color: #1a0c0a;
}

.btn-ok {
  background: var(--ok);
  color: #0c1a12;
}

.ban-banner { margin-top: -8px; }

.side-foot {
  margin-top: auto;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.main {
  padding: 28px 40px 64px;
  max-width: 1360px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hint { color: var(--muted); margin: 6px 0 0; }

.crumb {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.pills { display: flex; gap: 6px; flex-wrap: wrap; }

.pills a, .btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
}

.pills a.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  text-decoration: none;
}

.pills a:hover { text-decoration: none; border-color: #3a3e2a; }

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

.toolbar .search {
  flex: 1;
  min-width: 240px;
  margin: 0;
}

.search { display: flex; gap: 8px; margin-bottom: 16px; }

.top-search {
  flex: 1 1 240px;
  max-width: 420px;
  margin: 0;
}

.search input, .search-side input {
  font-family: var(--font-mono), ui-monospace, monospace;
}

.search input {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.search button, .btn-solid {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font: 500 14px var(--font);
  cursor: pointer;
}

.btn-solid.btn-ok {
  background: var(--ok);
  color: #0c1a12;
}

.btn-solid.btn-danger {
  background: var(--bad);
  color: #1a0c0a;
}

.kpis, .meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  position: relative;
  overflow: hidden;
}

.kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0.7;
}

.kpi.warn::before { background: var(--wait); }
.kpi.bad::before { background: var(--bad); }
.kpi.ok::before { background: var(--ok); }

.kpi .label {
  font-family: var(--font-display);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.kpi .value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.kpi .sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  margin-bottom: 16px;
}

.grid-2.equal { grid-template-columns: 1fr 1fr; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
}

.card h2, .card-head {
  margin: 0;
  padding: 14px 16px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-head a { font-size: 12px; letter-spacing: 0; text-transform: none; }

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-family: var(--font-display);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

tr[data-href] { cursor: pointer; }
tr[data-href]:hover td, tr:hover td { background: var(--panel-2); }
tr.stale td { background: var(--stale); }

.mono {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 13px;
}

.num { font-variant-numeric: tabular-nums; }

.st {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
  white-space: nowrap;
}

.st-pending { background: #3a3018; color: var(--wait); }
.st-accepted, .st-paid { background: #173528; color: var(--ok); }
.st-rejected { background: #3a1c18; color: var(--bad); }

.wait {
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-mono), ui-monospace, monospace;
}
.wait.stale { color: var(--bad); font-weight: 600; }

.empty { padding: 28px 16px; color: var(--muted); }

.details, .clip {
  white-space: pre-wrap;
  word-break: break-word;
}

.person .sub {
  color: var(--muted);
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 12px;
  margin-top: 2px;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #242818;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  margin-right: 8px;
  vertical-align: middle;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  padding: 16px 16px 8px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  max-width: 28px;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  opacity: 0.85;
}

.bar-col span {
  color: var(--muted);
  font-size: 10px;
  font-family: var(--font-mono), ui-monospace, monospace;
}

.meter {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.meter-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; }
.meter-row span { color: var(--muted); font-size: 13px; }
.meter-row b { font-size: 13px; font-weight: 500; }
.track { height: 8px; background: #22252f; border-radius: 99px; overflow: hidden; }
.track i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}

.facts {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 40rem);
  gap: 0;
  padding: 4px 0;
}

.facts dt,
.facts dd {
  margin: 0;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.facts dt {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-right: 0;
}

.facts dd {
  word-break: break-word;
  padding-left: 8px;
}
.facts dt:nth-last-child(2),
.facts dd:last-child { border-bottom: 0; }

.ext {
  color: var(--link);
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 13px;
}

.copy {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
  font-size: 13px;
}

.copy:hover { color: var(--accent); }

.pager {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 13px;
}

.pager a {
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink);
}

.flag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 99px;
  background: #3a3018;
  color: var(--wait);
  margin-left: 6px;
}

.neg { color: var(--bad); }
.pos { color: var(--ok); }

.id-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.filters input[type="search"] {
  flex: 1;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 10px;
  font: 14px var(--font-mono), ui-monospace, monospace;
}

.date-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.filters input[type="date"] {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: 13px var(--font-mono), ui-monospace, monospace;
  color-scheme: dark;
}

.log-card { padding-bottom: 8px; }

.day-head {
  padding: 14px 16px 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-top: 1px solid var(--line);
}

.day-head:first-child { border-top: 0; }

.log-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 10px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.log-row:last-child { border-bottom: 0; }

.log-time {
  color: var(--muted);
  padding-top: 3px;
}

.log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.muted { color: var(--muted); }
.quiet { color: var(--muted); font-size: 12px; }

.log-quote {
  margin-top: 6px;
  padding: 10px 12px;
  background: #0c0e14;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.log-code {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.st-message { background: #1b2230; color: #c9d4ff; }
.st-button { background: #243018; color: var(--accent); }
.st-command { background: #2a2438; color: #d4b8ff; }
.st-media { background: #2a2618; color: var(--wait); }
.st-edit { background: #1c2a2a; color: #9be7e0; }
.st-system { background: #3a1c18; color: var(--bad); }
.kind-system { background: rgba(255, 111, 94, 0.04); }

.kind-button { background: rgba(214, 255, 74, 0.03); }

.id-chip {
  font-family: var(--font-mono), ui-monospace, monospace;
  color: var(--accent);
  letter-spacing: 0.04em;
  font-weight: 500;
}
.id-chip:hover { text-decoration: underline; text-underline-offset: 3px; }

.dossier-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.dossier-kicker {
  font-family: var(--font-display);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.dossier-id {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  line-height: 1.1;
}

.st-lg {
  font-size: 14px;
  padding: 6px 14px;
}

.callout {
  padding: 14px 18px;
  border-radius: 14px;
  margin-bottom: 18px;
  font-size: 15px;
}
.callout.ok { background: #173528; color: var(--ok); }
.callout.wait { background: #3a3018; color: var(--wait); }
.callout.bad { background: #3a1c18; color: var(--bad); }
.callout-body {
  margin-top: 8px;
  color: var(--ink);
  white-space: pre-wrap;
}

.shot {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 0;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 16px;
}
.shot:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.shot-kicker {
  font-family: var(--font-display);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.shot-url {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 13px;
  word-break: break-all;
  color: var(--ink);
}
.shot-go { color: var(--accent); font-weight: 600; }

.pay-box {
  margin: 0 16px 8px;
  padding: 16px 18px;
  background: #0c0e14;
  border-radius: 12px;
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 16px;
  white-space: pre-wrap;
  word-break: break-word;
}

.pay-box.compact {
  margin: 10px 0 0;
  padding: 10px 12px;
  font-size: 13px;
}

.flash {
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 14px;
}
.flash.ok { background: #173528; color: var(--ok); }
.flash.bad { background: #3a1c18; color: var(--bad); }
.flash.wait { background: #3a3018; color: var(--wait); }

.desk {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px 14px;
  margin-bottom: 10px;
}

.desk-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}

.desk-head .muted { color: var(--muted); font-size: 13px; margin-left: 6px; }

.desk-sum {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-weight: 600;
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.desk-links {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 13px;
}

.review {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 18px;
}

.review .callout {
  margin: 0;
  border-radius: 0;
}

.review .desk-actions {
  margin: 0;
  padding: 12px 14px 14px;
}

.desk-actions {
  display: grid;
  grid-template-columns: max-content minmax(240px, 1fr);
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}

.desk-form {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: 40px;
  gap: 6px;
  align-items: stretch;
}

.desk-form.grow {
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
}

.desk-actions input:not([type="hidden"]) {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: 0 12px;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  line-height: 38px;
  box-sizing: border-box;
    appearance: none;
  -webkit-appearance: none;
  font: 13px/38px var(--font-mono), ui-monospace, monospace;
}

.desk-actions input.amt { width: 92px; }
.desk-actions input.reason { width: 100%; min-width: 0; }

.desk-actions .btn-solid {
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  padding: 0 16px;
  font-size: 13px;
  line-height: 40px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.proof-body {
  padding: 12px 14px 16px;
}

.proof-tg {
  display: inline-flex;
  margin-bottom: 12px;
}

.proof-media {
  display: block;
  width: 100%;
  max-height: 520px;
  background: #0c0e14;
  border-radius: 10px;
}

.proof-fail {
  margin: 0;
  padding: 16px 18px;
  background: #3a3018;
  color: var(--wait);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
}

.proof-dl {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
}

@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: relative; height: auto; }
  .kpis, .meta, .grid-2 { grid-template-columns: 1fr; }
  .main { padding: 20px 16px 48px; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { padding-bottom: 0; min-height: 0; border-bottom: 0; }
  .desk-actions { grid-template-columns: 1fr; }
  .log-row { grid-template-columns: 1fr; }
  .dossier-id { font-size: 28px; }
}
