:root {
  --bg: #070808;
  --bg-2: #0b0c0c;
  --panel: rgba(16, 17, 17, 0.72);
  --panel-solid: #101111;
  --line: rgba(255, 255, 255, 0.1);
  --line-soft: rgba(255, 255, 255, 0.055);
  --text: #f4f5f5;
  --muted: #a9adb5;
  --soft: #696f78;
  --green: #32f58b;
  --green-2: #00d972;
  --green-soft: rgba(50, 245, 139, 0.16);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}
.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 64px 1fr;
  min-height: 100vh;
}
.app-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  min-height: 64px;
  padding: 0 24px;
  background: rgba(7,8,8,.82);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(24px);
}
.sidebar {
  position: sticky;
  top: 64px;
  grid-column: 1;
  grid-row: 2;
  height: calc(100vh - 64px);
  padding: 20px 16px;
  background: rgba(7,8,8,.72);
  border-right: 1px solid var(--line-soft);
  backdrop-filter: blur(24px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 32px; height: 32px;
  flex: 0 0 32px;
  display: grid; place-items: center;
  background: transparent;
  clip-path: none;
}
.brand-mark img {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
}
.brand-title { font-size: 18px; font-weight: 820; line-height: 1; letter-spacing: 0; }
.brand-subtitle { display: none; }
.nav-stack { display: grid; gap: 7px; }
.nav-item {
  height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #cfd3d7;
  text-decoration: none;
  font-size: 14px;
  font-weight: 620;
}
.nav-item:hover,
.nav-item.active {
  color: var(--text);
  background: rgba(255,255,255,.045);
  border-color: var(--line);
}
.nav-item.active { box-shadow: inset 3px 0 0 var(--green); }
.nav-item kbd {
  color: var(--soft);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 400;
}
.sidebar-card {
  position: absolute;
  left: 22px; right: 22px; bottom: 22px;
  padding: 16px;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line);
}
.sidebar-label { color: var(--green); font-size: 11px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.sidebar-value { margin-top: 10px; font-size: 14px; font-weight: 720; }
.sidebar-muted { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.main { min-width: 0; padding: 28px 34px 58px; }
.main { grid-column: 2; grid-row: 2; }
.topbar {
  min-height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 16px 0 8px;
}
.eyebrow {
  color: var(--green);
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  margin-bottom: 8px;
}
h1 {
  max-width: 880px;
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.5px;
  font-weight: 800;
}
.topbar p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
}
.topbar-actions { display: flex; gap: 12px; align-items: center; justify-content: flex-end; flex: 0 0 auto; }
.live-pill, .mono-pill, .user-pill, .chip {
  height: 34px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.live-pill { background: var(--green); color: #050606; border-color: transparent; font-weight: 800; }
.live-pill i, .status-dot { width: 7px; height: 7px; border-radius: 50%; background: #050606; box-shadow: 0 0 16px rgba(50,245,139,.8); }
.status-dot { background: var(--green); display: inline-flex; }
.user-pill { color: #dfe3e6; }
.logout-form { margin: 0; }
.logout-form button {
  height: 34px;
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  cursor: pointer;
}
.logout-form button:hover { color: var(--text); border-color: rgba(50,245,139,.48); }
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.metric-card, .panel, .status-strip {
  background: linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.028));
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(18px);
}
.metric-card {
  min-height: 150px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.metric-card.compact { min-height: 116px; }
.metric-card.compact strong { margin-top: 18px; font-size: 36px; }
.metric-card span { color: var(--muted); font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.metric-card strong { display: block; margin-top: 24px; font-size: 46px; line-height: 1; font-weight: 780; letter-spacing: -1.2px; }
.metric-card em { display: block; margin-top: 10px; color: var(--soft); font-style: normal; font-size: 11px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.status-strip {
  min-height: 62px;
  margin-bottom: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.status-strip div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.status-strip strong { font-size: 14px; font-weight: 720; }
.status-strip span { color: var(--muted); font-size: 12px; }
.status-strip code { color: var(--soft); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48%; }
.panel {
  padding: 18px;
  margin-bottom: 16px;
}
.hero-panel { position: relative; overflow: hidden; }
.panel-head { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.panel h2 { margin: 0; font-size: 18px; font-weight: 780; letter-spacing: -0.2px; }
.panel p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.chip { color: #050606; background: var(--green); border-color: transparent; font-weight: 800; }
.chart { position: relative; z-index: 1; height: 390px; }
.table-wrap { overflow: auto; border: 1px solid var(--line-soft); background: rgba(0,0,0,.22); }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
thead { background: rgba(255,255,255,.055); }
th, td { padding: 14px 15px; border-bottom: 1px solid var(--line-soft); text-align: left; font-size: 13px; white-space: nowrap; }
th { color: var(--muted); font-weight: 760; }
td { color: #d8dcdf; }
tbody tr:hover { background: rgba(50,245,139,.045); }
.mono, .url-cell { color: #9ba1a8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.url-cell { max-width: 520px; overflow: hidden; text-overflow: ellipsis; }
.price { color: var(--green); font-weight: 760; }
.table-link { color: var(--green); text-decoration: none; font-weight: 760; }
.table-link:hover { text-decoration: underline; }
.empty { text-align: center; color: var(--soft); padding: 32px; }
.lookup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 10px;
  margin-bottom: 16px;
}
.lookup-form input {
  height: 42px;
  padding: 0 13px;
  color: var(--text);
  background: rgba(0,0,0,.3);
  border: 1px solid var(--line);
  outline: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}
.lookup-form input:focus { border-color: rgba(50,245,139,.7); box-shadow: 0 0 0 3px rgba(50,245,139,.12); }
.lookup-form button {
  color: #050606;
  background: var(--green);
  border: 0;
  font-weight: 820;
  cursor: pointer;
}
.message-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.message {
  padding: 11px 13px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  color: var(--text);
  font-size: 13px;
}
.message.success { border-color: rgba(50,245,139,.42); background: rgba(50,245,139,.1); }
.message.error { border-color: rgba(255,86,86,.42); background: rgba(255,86,86,.1); color: #ffd6d6; }
.muted-chip { color: var(--muted); background: rgba(255,255,255,.045); border-color: var(--line); }
.agent-warning {
  margin-bottom: 16px;
  padding: 13px 14px;
  color: #ffd6d6;
  background: rgba(255,86,86,.1);
  border: 1px solid rgba(255,86,86,.32);
  font-size: 13px;
}
.schedule-form {
  display: grid;
  grid-template-columns: 1.1fr repeat(3, minmax(140px, 190px)) 110px;
  gap: 12px;
  align-items: end;
}
.schedule-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}
.schedule-form input,
.schedule-form select {
  height: 36px;
  padding: 0 10px;
  color: var(--text);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  outline: none;
}
.schedule-form input:focus,
.schedule-form select:focus { border-color: rgba(50,245,139,.7); }
.switch-line {
  min-height: 36px;
  grid-template-columns: 18px 1fr;
  gap: 10px !important;
  align-items: center;
  color: var(--text) !important;
  font-weight: 760;
}
.switch-line input { width: 16px; height: 16px; padding: 0; accent-color: var(--green); }
.job-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.job-card {
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.2);
}
.job-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.job-title { font-size: 16px; font-weight: 780; }
.job-card p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.status-badge {
  height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 12px;
}
.status-badge.running { color: #050606; background: var(--green); border-color: transparent; font-weight: 800; }
.job-actions { display: flex; gap: 10px; margin-top: 16px; }
.job-actions form { margin: 0; }
.action-button {
  height: 34px;
  padding: 0 14px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}
.action-button.primary { color: #050606; background: var(--green); border-color: transparent; }
.action-button:disabled { opacity: .42; cursor: not-allowed; }
.job-meta {
  margin: 16px 0 0;
  display: grid;
  gap: 8px;
}
.job-meta div {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  font-size: 12px;
}
.job-meta dt { color: var(--soft); }
.job-meta dd { margin: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-panel {
  margin-top: 16px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: center;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line-soft);
}
.qr-panel-head {
  display: grid;
  gap: 10px;
}
.qr-panel-head form { margin: 0; }
.qr-panel strong { display: block; font-size: 13px; }
.qr-panel span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.qr-panel img, .qr-empty {
  width: 220px;
  height: 220px;
  flex: 0 0 220px;
  object-fit: contain;
  background: #fff;
}
.qr-empty {
  display: grid;
  place-items: center;
  color: var(--soft);
  background: rgba(255,255,255,.045);
  border: 1px dashed var(--line);
  font-size: 12px;
}
@media (max-width: 760px) {
  .qr-panel { grid-template-columns: 1fr; }
  .qr-panel img, .qr-empty { width: 100%; max-width: 260px; height: 260px; }
}
.log-tail {
  min-height: 120px;
  max-height: 220px;
  margin: 16px 0 0;
  padding: 12px;
  overflow: auto;
  color: #98a0a8;
  background: rgba(0,0,0,.34);
  border: 1px solid var(--line-soft);
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.log-head {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.log-head strong { font-size: 13px; }
.log-head span { color: var(--soft); font-size: 12px; }
@media (max-width: 1100px) {
  .schedule-form { grid-template-columns: 1fr; }
  .shell { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  .app-header { grid-row: 1; padding: 18px; flex-wrap: wrap; }
  .sidebar { position: relative; top: 0; grid-row: 2; grid-column: 1; height: auto; }
  .main { grid-row: 3; grid-column: 1; }
  .sidebar-card { position: static; margin-top: 22px; }
  .topbar { min-height: 112px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .job-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .main { padding: 22px 14px 40px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .topbar-actions { align-self: flex-start; }
  .metrics-grid { grid-template-columns: 1fr; }
  .lookup-form { grid-template-columns: 1fr; }
  h1 { font-size: 17px; }
  .topbar p { font-size: 18px; }
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #070808;
}
.auth-shell {
  width: min(1040px, calc(100vw - 40px));
  min-height: 620px;
  display: grid;
  align-items: center;
}
.auth-panel {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.052), rgba(255,255,255,.025));
  box-shadow: 0 40px 120px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.06);
  border-radius: 12px;
  overflow: hidden;
}
.auth-brand {
  padding: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  border-right: 1px solid var(--line-soft);
  text-align: center;
}
.auth-brand img {
  width: 96px;
  height: 96px;
  object-fit: contain;
}
.auth-brand h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.auth-brand p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}
.auth-form {
  padding: 56px 42px;
  display: grid;
  align-content: center;
  gap: 18px;
}
.auth-kicker {
  color: var(--green);
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.auth-error {
  padding: 12px 13px;
  color: #ffd9d9;
  background: rgba(255, 72, 72, .12);
  border: 1px solid rgba(255, 72, 72, .28);
  font-size: 13px;
}
.auth-form label { display: grid; gap: 8px; }
.auth-form label span {
  color: var(--muted);
  font-size: 13px;
}
.auth-form input {
  height: 46px;
  width: 100%;
  padding: 0 14px;
  color: var(--text);
  background: rgba(0,0,0,.3);
  border: 1px solid var(--line);
  outline: none;
}
.auth-form input:focus { border-color: rgba(50,245,139,.7); box-shadow: 0 0 0 3px rgba(50,245,139,.12); }
.auth-form button {
  height: 48px;
  margin-top: 6px;
  color: #050606;
  background: var(--green);
  border: 0;
  font-weight: 820;
  cursor: pointer;
}
@media (max-width: 860px) {
  .auth-panel { grid-template-columns: 1fr; }
  .auth-brand { border-right: 0; border-bottom: 1px solid var(--line-soft); padding: 42px 24px; }
  .auth-form { padding: 42px 24px; }
}
