:root {
  --bg: #fafafa;
  --panel: #ffffff;
  --panel-alt: #f4f4f5;
  --panel-deep: #ececef;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #09090b;
  --muted: #71717a;
  --faint: #a1a1aa;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --green: #16a34a;
  --green-soft: rgba(22, 163, 74, 0.1);
  --amber: #c77400;
  --amber-soft: rgba(199, 116, 0, 0.1);
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, 0.08);
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body, #app { min-height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
}
button, input { font: inherit; }
button { cursor: pointer; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(250,250,250,.96)),
    repeating-linear-gradient(90deg, rgba(9,9,11,.035) 0, rgba(9,9,11,.035) 1px, transparent 1px, transparent 64px),
    repeating-linear-gradient(0deg, rgba(9,9,11,.028) 0, rgba(9,9,11,.028) 1px, transparent 1px, transparent 64px);
}
.login-panel {
  width: min(1080px, 100%);
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.92);
  box-shadow: 0 24px 70px rgba(9, 9, 11, .10);
}
.login-copy {
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border);
}
.login-brand {
  width: fit-content;
  padding: 7px 8px;
  border: 1px solid var(--border);
  background: var(--panel);
}
.login-copy h1 {
  max-width: 620px;
  margin: 70px 0 16px;
  font-size: 54px;
  line-height: .98;
  font-weight: 650;
  letter-spacing: 0;
}
.login-copy p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}
.login-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 44px;
}
.login-points > div {
  min-height: 118px;
  padding: 13px;
  border: 1px solid var(--border);
  background: var(--panel);
}
.login-points p {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
}
.login-card {
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--panel);
}
.login-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 620;
}
.login-card p {
  margin: 0 0 26px;
  color: var(--muted);
  line-height: 1.55;
}
.field-label {
  margin: 12px 0 6px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.login-input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--bg);
  color: var(--text);
  padding: 0 11px;
  font-family: var(--mono);
}
.login-input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
  background: var(--panel);
}
.login-error {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid transparent;
  background: var(--red-soft);
  color: var(--red);
  font-family: var(--mono);
  font-size: 11px;
}
.login-submit {
  width: 100%;
  height: 42px;
  margin-top: 18px;
}
.login-secondary {
  width: 100%;
  height: 38px;
  margin-top: 8px;
}
.login-note {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}
.login-note strong {
  color: var(--text);
  font-weight: 500;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px 1fr;
}
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--mono);
}
.brand {
  padding: 4px 8px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--text);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
}
.brand-title {
  font-size: 13px;
  font-weight: 600;
}
.brand-domain {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  color: var(--muted);
  font-size: 11px;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}
.nav-label {
  margin: 14px 8px 5px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 5px 8px;
  border-radius: 3px;
  text-align: left;
  font-family: var(--mono);
}
.nav-item.active {
  background: var(--panel-alt);
  border-left-color: var(--accent);
  color: var(--text);
}
.nav-count {
  margin-left: auto;
  color: var(--faint);
  font-size: 10.5px;
}
.kbd {
  min-width: 14px;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0 3px;
  color: var(--faint);
  font-size: 9.5px;
  text-align: center;
}
.agent-card {
  margin-top: auto;
  padding: 10px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-size: 10.5px;
}
.kv-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
}
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  padding: 0 16px;
  font-family: var(--mono);
  font-size: 12px;
}
.path {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 6px;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
}
.status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 3px 4px 3px 8px;
  color: var(--muted);
  font-size: 11px;
}
.user-pill button {
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--accent);
  padding: 2px 4px 2px 8px;
  font-family: var(--mono);
  font-size: 10.5px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.metric {
  padding: 14px 18px;
  border-right: 1px solid var(--border);
  min-width: 0;
}
.metric:last-child { border-right: 0; }
.metric-label {
  margin-bottom: 6px;
  font-family: var(--mono);
  color: var(--faint);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.metric-value {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 580;
  white-space: nowrap;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  font-family: var(--mono);
}
.notice {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--amber-soft);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 11.5px;
}
.filter-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-alt);
}
.filter-chip {
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel);
  color: var(--muted);
  padding: 5px 9px;
  font-family: var(--mono);
  font-size: 11.5px;
}
.filter-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.toolbar-spacer { flex: 1; }
.button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 3px;
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 12px;
}
.button.primary {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}
.button[disabled] {
  color: var(--faint);
  cursor: not-allowed;
}
.content {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.table-head, .tender-row {
  display: grid;
  grid-template-columns: 36px 80px minmax(260px, 1fr) 220px 120px 120px 90px 70px;
  column-gap: 12px;
  align-items: center;
}
.table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.th {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font-family: var(--mono);
  text-transform: uppercase;
}
.th.active { color: var(--text); font-weight: 600; }
.tender-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 11px 16px;
  text-align: left;
}
.tender-row:nth-child(odd) { background: rgba(0,0,0,.012); }
.tender-row.selected { background: var(--accent-soft); }
.title {
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sub {
  margin-top: 2px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
  display: flex;
  gap: 8px;
}
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.right { text-align: right; }
.score {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-weight: 600;
}
.score-bar {
  width: 28px;
  height: 4px;
  border-radius: 1px;
  background: var(--panel-deep);
  overflow: hidden;
}
.score-fill { height: 100%; background: var(--accent); }
.score.good .score-fill { background: var(--green); }
.score.warn .score-fill { background: var(--amber); }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  border-radius: 2px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  padding: 1px 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.tag.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.tag.amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.tag.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.tag.blue { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.detail {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.detail.open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
}
.detail-main {
  padding: 18px 22px;
  border-right: 1px solid var(--border);
}
.detail-aside { padding: 16px; }
.section-title {
  margin: 0 0 8px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.panel {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel);
  overflow: hidden;
  margin-bottom: 18px;
}
.panel-row {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.panel-row:first-child { border-top: 0; }
.grid-kv {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11.5px;
}
.grid-kv:first-child { border-top: 0; }
.timeline-item {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11.5px;
}
.timeline-item:first-child { border-top: 0; }
.empty {
  border: 1px dashed var(--border-strong);
  border-radius: 4px;
  background: var(--panel);
  padding: 14px;
  color: var(--muted);
  line-height: 1.5;
}
.agent-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}
.command-box {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel);
  color: var(--text);
  padding: 14px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
}
.command-box:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}
.command-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.example-row {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 11px 12px;
  text-align: left;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.45;
}
.example-row:first-child { border-top: 0; }
.example-row:hover { background: var(--accent-soft); }
.footer-note {
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
  background: var(--panel);
}

@media (max-width: 980px) {
  .login-shell { padding: 14px; place-items: start; }
  .login-panel { grid-template-columns: 1fr; min-height: 0; }
  .login-copy { border-right: 0; border-bottom: 1px solid var(--border); padding: 22px; }
  .login-copy h1 { margin-top: 36px; font-size: 38px; }
  .login-points { grid-template-columns: 1fr; }
  .login-card { padding: 22px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .table-head, .tender-row {
    grid-template-columns: 34px 64px minmax(180px, 1fr) 100px 90px;
  }
  .hide-md { display: none; }
  .detail.open { grid-template-columns: 1fr; }
  .detail-main { border-right: 0; }
  .agent-grid { grid-template-columns: 1fr; }
}
