:root {
  color-scheme: dark;
  --bg: #000;
  --sidebar: #030303;
  --surface: #080808;
  --surface-raised: #0d0d0d;
  --surface-hover: #120a0f;
  --line: #232323;
  --line-soft: #171717;
  --text: #f5f5f5;
  --muted: #969696;
  --muted-strong: #b9b9b9;
  --accent: #e83e8c;
  --accent-hover: #f0529d;
  --accent-soft: #25101b;
  --accent-line: #6f2448;
  --info: #68b9f8;
  --info-soft: #071621;
  --ok: #45d89a;
  --ok-soft: #06180f;
  --warn: #f4c84a;
  --warn-soft: #1a1404;
  --danger: #ff6673;
  --danger-soft: #1c070a;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; letter-spacing: 0; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px 14px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 5px;
  min-width: 0;
}
.brand-logo, .login-logo {
  display: block;
  object-fit: cover;
  object-position: 50% 42%;
  background: #fff;
  border: 1px solid #432536;
}
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  flex: 0 0 auto;
}
.brand span, .account > span:last-child { min-width: 0; }
.brand strong, .brand small, .account strong, .account small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand strong { font-size: 16px; }
.brand small, .account small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.nav { display: grid; gap: 18px; }
.nav-group { display: grid; gap: 4px; }
.nav-label {
  padding: 0 10px 5px;
  color: #666;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.nav a {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 650;
}
.nav a:hover { background: var(--surface-raised); border-color: var(--line); color: #fff; }
.nav a.active {
  color: #ffd8e9;
  background: var(--accent-soft);
  border-color: var(--accent-line);
  box-shadow: inset 3px 0 0 var(--accent);
}
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.account { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px; }
.account-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: #ffb4d4;
  font-weight: 800;
}
.account strong { font-size: 12px; }
.sign-out {
  display: block;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
}
.sign-out:hover { background: var(--surface-raised); color: var(--text); }
.main { min-width: 0; padding: 26px 28px 44px; }
.topbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
h1 { margin: 0; font-size: 23px; line-height: 1.15; }
h2 { margin: 0; font-size: 16px; line-height: 1.25; }
p { line-height: 1.5; }
.user-chip {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-strong);
  background: var(--surface);
  font-size: 12px;
}
.runtime-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 1px solid #5f4b12;
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--warn);
}
.runtime-banner strong { font-size: 12px; }
.runtime-banner span { color: #c9b86e; font-size: 12px; }
.runtime-banner.ok { border-color: #18563a; background: var(--ok-soft); color: var(--ok); }
.runtime-banner.ok span { color: #8abfa8; }
.runtime-banner.danger { border-color: #62232b; background: var(--danger-soft); color: var(--danger); }
.runtime-banner.danger span { color: #d9969d; }
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.metric-card {
  min-width: 0;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.metric-card:hover { border-color: #4b2b3b; background: var(--surface-hover); }
.metric-card.static:hover { border-color: var(--line); background: var(--surface); }
.metric-card.ok strong { color: var(--ok); }
.metric-card.err strong { color: var(--danger); }
.metric-card.info strong { color: var(--info); }
.metric-card.accent strong { color: var(--accent); }
.metric-card > span { color: var(--muted); font-size: 11px; font-weight: 750; }
.metric-card strong { margin: 7px 0 3px; color: #ff9bc7; font-size: 27px; line-height: 1; }
.metric-card small {
  margin-top: auto;
  overflow: hidden;
  color: #777;
  font-size: 10px;
  line-height: 1.35;
}
.compact-metrics { grid-template-columns: repeat(5, minmax(130px, 1fr)); }
.capability-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.capability-strip strong, .capability-strip span { display: block; }
.capability-strip strong { margin-bottom: 3px; font-size: 12px; }
.capability-strip > div > span { color: var(--muted); font-size: 11px; }
.capability-list { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.content-section { margin-top: 18px; }
.narrow-section { max-width: 920px; }
.section-heading {
  min-height: 42px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1.7fr) repeat(3, minmax(130px, .7fr)) auto auto;
  gap: 8px;
  margin-bottom: 12px;
}
input, select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #2c2c2c;
  border-radius: 7px;
  background: #050505;
  color: var(--text);
  font-size: 13px;
}
input:hover, select:hover { border-color: #444; }
input:focus, select:focus { border-color: var(--accent); }
.btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid #373737;
  border-radius: 7px;
  background: #101010;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: #171717; border-color: #555; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.secondary { background: #0b0b0b; }
.btn.quiet { background: transparent; color: var(--muted-strong); }
.btn.danger { color: #ffc0c6; border-color: #62232b; background: var(--danger-soft); }
.btn.compact { min-height: 30px; padding: 5px 8px; font-size: 11px; }
.table-card, .form-panel, .login-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.table-wrap { width: 100%; overflow: auto; border-radius: 8px; }
table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 12px;
}
.watcher-table { min-width: 1260px; }
.jobs-table { min-width: 980px; }
th, td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #777;
  background: #050505;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-hover); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; }
.watch-cell { width: 260px; min-width: 220px; max-width: 320px; }
.watch-cell strong {
  display: block;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.watch-cell > .mono { display: block; margin-bottom: 7px; color: #666; }
.source-cell { min-width: 150px; max-width: 210px; }
.source-cell a {
  display: block;
  margin-bottom: 6px;
  overflow: hidden;
  color: #d7d7d7;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.schedule-cell strong, .schedule-cell > span { display: block; }
.schedule-cell strong { margin-bottom: 5px; }
.checked-cell { min-width: 96px; max-width: 130px; color: var(--muted-strong); white-space: normal; }
.checked-cell .mono, .checked-cell small { display: block; white-space: nowrap; }
.checked-cell small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.muted-text { color: var(--muted); font-size: 11px; }
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #101010;
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.pill.ok { color: var(--ok); border-color: #18563a; background: var(--ok-soft); }
.pill.warn { color: var(--warn); border-color: #5f4b12; background: var(--warn-soft); }
.pill.err { color: var(--danger); border-color: #62232b; background: var(--danger-soft); }
.pill.info { color: var(--info); border-color: #194966; background: var(--info-soft); }
.pill.accent { color: #ffabd0; border-color: var(--accent-line); background: var(--accent-soft); }
.pill.muted, .pill.neutral { color: var(--muted); }
.row-error {
  max-width: 210px;
  margin-top: 6px;
  overflow: hidden;
  color: var(--danger);
  font-size: 10px;
  line-height: 1.35;
}
.job-error {
  max-width: 260px;
  margin-top: 7px;
  color: var(--danger);
  font-size: 10px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.job-actions { min-width: 142px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.toggle-form, form.inline { display: inline; margin: 0; }
.switch-control, .unavailable {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.switch-control { padding: 4px 2px; cursor: pointer; }
.switch-track {
  width: 32px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 2px;
  border: 1px solid #393939;
  border-radius: 999px;
  background: #171717;
}
.switch-track span {
  width: 12px;
  height: 12px;
  display: block;
  border-radius: 50%;
  background: #747474;
  transition: transform .15s ease, background .15s ease;
}
.switch-control.is-on { color: #ffc2dd; }
.switch-control.is-on .switch-track { border-color: var(--accent-line); background: var(--accent-soft); }
.switch-control.is-on .switch-track span { transform: translateX(14px); background: var(--accent); }
.unavailable { color: #666; }
.unavailable .switch-track { opacity: .55; }
.row-actions { min-width: 168px; display: flex; align-items: center; gap: 5px; }
.empty-state { height: 120px; color: var(--muted); text-align: center; }
.pill-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.form-panel { padding: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid label {
  display: grid;
  align-content: start;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 650;
}
.form-grid .wide { grid-column: 1 / -1; }
.consumer-controls {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050505;
}
.consumer-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.consumer-heading strong, .consumer-heading small { display: block; }
.consumer-heading strong { color: var(--text); font-size: 12px; }
.consumer-heading small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 500; }
.check-row { display: flex !important; flex-direction: row; align-items: center; min-height: 38px; }
.check-row input { width: 17px; min-height: 17px; accent-color: var(--accent); }
.input-suffix { display: grid; grid-template-columns: 1fr auto; }
.input-suffix input { border-radius: 7px 0 0 7px; }
.input-suffix span {
  display: grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid #2c2c2c;
  border-left: 0;
  border-radius: 0 7px 7px 0;
  background: #0c0c0c;
  color: var(--muted);
  font-size: 11px;
}
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.notice { margin-bottom: 14px; padding: 10px 12px; border-radius: 8px; font-size: 12px; }
.notice:not(.error) { color: #ffc2dd; border: 1px solid var(--accent-line); background: var(--accent-soft); }
.notice.error { color: #ffc0c6; border: 1px solid #62232b; background: var(--danger-soft); }
.tool-selector {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}
.tool-selector label, .tool-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 650;
}
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tool-panel { display: flex; min-height: 205px; flex-direction: column; gap: 16px; }
.tool-panel h3 { margin: 0 0 6px; font-size: 15px; }
.tool-panel p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.tool-panel > form { display: grid; gap: 12px; margin-top: auto; }
.tool-panel > .btn { align-self: flex-start; margin-top: auto; }
.danger-zone { border-color: #522029; }
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-card { width: min(440px, 100%); padding: 22px; }
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-logo { width: 62px; height: 62px; border-radius: 8px; }
.login-brand h1 { font-size: 22px; }
.login-brand p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.login-copy { margin: 20px 0 0; color: var(--muted-strong); font-size: 13px; }
.login-actions { display: grid; gap: 12px; margin-top: 20px; }
.login-actions .btn { width: 100%; }
@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .filter-bar { grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(130px, .7fr)); }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; gap: 12px; padding: 13px; }
  .brand { padding: 0; }
  .brand-logo { width: 36px; height: 36px; }
  .nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .nav-group { display: contents; }
  .nav-label { display: none; }
  .nav a { min-height: 36px; justify-content: center; padding: 6px; text-align: center; font-size: 11px; }
  .sidebar-footer { display: none; }
  .main { padding: 18px 14px 34px; }
  .tool-grid, .tool-selector { grid-template-columns: 1fr; }
  .topbar { margin-bottom: 16px; }
  .user-chip { display: none; }
  h1 { font-size: 20px; }
  .metrics-grid, .compact-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metrics-grid > .metric-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .metric-card { min-height: 104px; padding: 12px; }
  .metric-card strong { font-size: 24px; }
  .runtime-banner { align-items: flex-start; flex-direction: column; gap: 3px; }
  .capability-strip, .consumer-heading { align-items: flex-start; flex-direction: column; }
  .capability-list { justify-content: flex-start; }
  .section-heading { align-items: center; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar input { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
}
@media (max-width: 430px) {
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics-grid, .compact-metrics { grid-template-columns: 1fr 1fr; }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-bar input { grid-column: auto; }
  .section-heading { align-items: flex-start; }
}
