:root {
  font-family:
    Vazirmatn, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@property --chart-value {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}

@font-face {
  font-family: Vazirmatn;
  font-style: normal;
  font-weight: 100 900;
  src: url("./assets/fonts/Vazirmatn.woff2") format("woff2");
}

:root {
  --accent: #f0bb0b;
  --accent-strong: #d9a500;
  --cyan: #0bb3f0;
  --cyan-soft: #e7f8ff;
  --green: #26a17b;
  --green-soft: #e7f8f1;
  --red: #c92627;
  --red-soft: #fff0ef;
  --orange: #f7931a;
  --orange-soft: #fff6e8;
  --ink: #232426;
  --muted: #6f747a;
  --subtle: #eef2f5;
  --border: #dce3e8;
  --panel: #ffffff;
  --panel-raised: #f9fbfc;
  --background: #f4f7f9;
  --shadow: 0 18px 46px rgb(35 36 38 / 8%);
  --terminal-scroll-thumb: #0bb3f0;
  --terminal-scroll-thumb-hover: #f0bb0b;
  --terminal-scroll-track: #171b1f;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] {
  --accent: #f0bb0b;
  --accent-strong: #f3c833;
  --cyan: #0bb3f0;
  --cyan-soft: #082d3a;
  --green: #31c995;
  --green-soft: #102e26;
  --red: #ff5a5b;
  --red-soft: #361819;
  --orange: #f9a73c;
  --orange-soft: #352515;
  --ink: #ecf0f1;
  --muted: #a5adb5;
  --subtle: #2f3133;
  --border: #3e444a;
  --panel: #1f2224;
  --panel-raised: #25282b;
  --background: #141618;
  --shadow: 0 18px 46px rgb(0 0 0 / 28%);
  --terminal-scroll-thumb: #f0bb0b;
  --terminal-scroll-thumb-hover: #55c8ff;
  --terminal-scroll-track: #101316;
}

* {
  box-sizing: border-box;
}

body {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--cyan) 10%, transparent), transparent 260px),
    var(--background);
  margin: 0;
  min-width: 320px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  align-items: center;
  background: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 86%, var(--ink));
  border-radius: 6px;
  color: #232426;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  gap: 7px;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
}

.secondary-button {
  align-items: center;
  border-radius: 6px;
  display: inline-flex;
  font-weight: 800;
  gap: 7px;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  background: var(--subtle);
  border-color: var(--border);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.68;
}

button:disabled:hover {
  background: var(--subtle);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--cyan) 34%, transparent);
  outline-offset: 2px;
}

input,
textarea {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

input[type="checkbox"] {
  min-height: auto;
  width: auto;
}

textarea {
  min-height: 108px;
  resize: vertical;
}

.json-field,
pre,
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

label {
  color: var(--muted);
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  grid-template-rows: 72px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.topbar {
  align-items: center;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 16px;
  grid-column: 1 / -1;
  justify-content: space-between;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-lockup,
.topbar-actions,
.section-title,
.page-header {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand-logo {
  color: var(--ink);
  display: block;
  height: 42px;
  width: 72px;
}

.eyebrow {
  color: var(--cyan);
  display: block;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar h1 {
  font-size: 22px;
  line-height: 1.15;
  margin: 0;
}

.icon-button {
  background: var(--panel);
  border-color: var(--border);
  color: var(--ink);
  min-width: 42px;
  padding: 8px;
}

.icon-button:hover,
.secondary-button:hover {
  background: var(--panel-raised);
}

.secondary-button {
  background: var(--panel);
  border-color: var(--border);
  color: var(--ink);
}

.sidebar {
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border-right: 1px solid var(--border);
  grid-row: 2;
  height: calc(100vh - 72px);
  overflow-y: auto;
  padding: 16px;
  position: sticky;
  top: 72px;
  transition:
    background-color 220ms ease,
    border-color 220ms ease,
    padding 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-header {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 950;
  justify-content: space-between;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.sidebar-header span {
  max-width: 120px;
  opacity: 1;
  overflow: hidden;
  transition:
    max-width 220ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 160ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  display: flex;
  font-weight: 850;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    gap 240ms cubic-bezier(0.22, 1, 0.36, 1),
    justify-content 240ms cubic-bezier(0.22, 1, 0.36, 1),
    padding 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-item span {
  max-width: 140px;
  min-width: 0;
  opacity: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    max-width 220ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 160ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}

.nav-item.active {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent) 36%, transparent);
  color: var(--ink);
}

.sidebar-collapsed .sidebar {
  padding: 12px;
}

.sidebar-collapsed .sidebar-header span,
.sidebar-collapsed .nav-item span {
  max-width: 0;
  opacity: 0;
  transform: translateX(-4px);
}

.sidebar-collapsed .nav-item {
  gap: 0;
  justify-content: center;
  padding: 10px;
}

.sidebar-collapsed .collapse-button {
  margin: 0 auto;
}

.collapse-button {
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    margin 240ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.content {
  min-width: 0;
  padding: 20px;
}

.page {
  display: grid;
  gap: 16px;
  margin: 0 auto;
  max-width: 1320px;
}

.page-header {
  justify-content: space-between;
}

.page-header h2 {
  font-size: 26px;
  line-height: 1.15;
  margin: 0;
}

.panel {
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.panel h3,
.section-title h3 {
  font-size: 15px;
  margin: 0;
}

.section-title {
  justify-content: space-between;
  margin-bottom: 12px;
}

.stats-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.stat-card {
  align-items: start;
  animation: metric-enter 460ms ease-out both;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--ink);
  display: grid;
  gap: 9px;
  min-height: 112px;
  padding: 12px;
  position: relative;
}

.stat-card:nth-child(2) {
  animation-delay: 50ms;
}

.stat-card:nth-child(3) {
  animation-delay: 100ms;
}

.stat-card:nth-child(4) {
  animation-delay: 150ms;
}

.stat-card:nth-child(5) {
  animation-delay: 200ms;
}

.stat-card:nth-child(6) {
  animation-delay: 250ms;
}

.stat-card::after {
  background: var(--accent);
  border-radius: 999px;
  bottom: 10px;
  content: "";
  height: 3px;
  left: 12px;
  position: absolute;
  width: 28px;
}

.stat-card.running::after,
.stat-card.claimed::after,
.stat-card.queued::after {
  background: var(--cyan);
}

.stat-card.completed::after,
.stat-card.succeeded::after {
  background: var(--green);
}

.stat-card.failed::after {
  background: var(--red);
}

.stat-icon {
  align-items: center;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.stat-card strong {
  font-size: 26px;
}

.dashboard-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-panel {
  overflow: hidden;
  position: relative;
}

.chart-panel::before {
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--orange), var(--red));
  content: "";
  height: 3px;
  left: 14px;
  opacity: 0.78;
  position: absolute;
  right: 14px;
  top: 0;
}

.chart-summary-row {
  align-items: center;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
  min-height: 42px;
  padding: 9px 10px;
}

.chart-summary-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.chart-summary-row strong {
  font-size: 14px;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
}

.detail-wide {
  grid-column: 1 / -1;
}

.circle-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
}

.circle-chart {
  align-items: center;
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 900;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.circle-chart-ring {
  align-items: center;
  animation: chart-fill 850ms cubic-bezier(0.22, 1, 0.36, 1) both;
  background:
    radial-gradient(circle closest-side, var(--panel) 68%, transparent 70%),
    conic-gradient(var(--accent) var(--chart-value), var(--subtle) 0);
  border-radius: 999px;
  display: grid;
  height: 96px;
  justify-items: center;
  place-content: center;
  width: 96px;
}

.circle-chart-ring strong {
  color: var(--ink);
  font-size: 20px;
}

.circle-chart-ring span {
  font-size: 11px;
}

.circle-chart.cyan .circle-chart-ring {
  background:
    radial-gradient(circle closest-side, var(--panel) 68%, transparent 70%),
    conic-gradient(var(--cyan) var(--chart-value), var(--subtle) 0);
}

.circle-chart.green .circle-chart-ring {
  background:
    radial-gradient(circle closest-side, var(--panel) 68%, transparent 70%),
    conic-gradient(var(--green) var(--chart-value), var(--subtle) 0);
}

.circle-chart.orange .circle-chart-ring {
  background:
    radial-gradient(circle closest-side, var(--panel) 68%, transparent 70%),
    conic-gradient(var(--orange) var(--chart-value), var(--subtle) 0);
}

.circle-chart.red .circle-chart-ring {
  background:
    radial-gradient(circle closest-side, var(--panel) 68%, transparent 70%),
    conic-gradient(var(--red) var(--chart-value), var(--subtle) 0);
}

.dot-list {
  display: grid;
  gap: 12px;
}

.dot-chart-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(90px, 130px) minmax(120px, 1fr) 40px;
}

.dot-chart-row > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.dot-chart {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(8, 10px);
}

.dot-chart i {
  background: var(--subtle);
  border-radius: 999px;
  display: block;
  height: 10px;
  width: 10px;
}

.dot-chart i.active {
  animation: dot-enter 420ms ease-out both;
  background: var(--accent);
}

.dot-chart i:nth-child(2) {
  animation-delay: 20ms;
}

.dot-chart i:nth-child(3) {
  animation-delay: 40ms;
}

.dot-chart i:nth-child(4) {
  animation-delay: 60ms;
}

.dot-chart i:nth-child(5) {
  animation-delay: 80ms;
}

.dot-chart i:nth-child(6) {
  animation-delay: 100ms;
}

.dot-chart i:nth-child(7) {
  animation-delay: 120ms;
}

.dot-chart i:nth-child(8) {
  animation-delay: 140ms;
}

.dot-chart i:nth-child(9) {
  animation-delay: 160ms;
}

.dot-chart i:nth-child(10) {
  animation-delay: 180ms;
}

.dot-chart i:nth-child(11) {
  animation-delay: 200ms;
}

.dot-chart i:nth-child(12) {
  animation-delay: 220ms;
}

.dot-chart i:nth-child(13) {
  animation-delay: 240ms;
}

.dot-chart i:nth-child(14) {
  animation-delay: 260ms;
}

.dot-chart i:nth-child(15) {
  animation-delay: 280ms;
}

.dot-chart i:nth-child(16) {
  animation-delay: 300ms;
}

.dot-chart.cyan i.active {
  background: var(--cyan);
}

.dot-chart.green i.active {
  background: var(--green);
}

.histogram {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  min-height: 178px;
}

.histogram-item {
  align-items: center;
  display: grid;
  gap: 7px;
  justify-items: center;
  min-width: 0;
}

.histogram-column {
  align-items: end;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  height: 112px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.histogram-column::before {
  background:
    linear-gradient(to top, transparent 24%, rgb(127 139 147 / 18%) 25%, transparent 26%),
    linear-gradient(to top, transparent 49%, rgb(127 139 147 / 18%) 50%, transparent 51%),
    linear-gradient(to top, transparent 74%, rgb(127 139 147 / 18%) 75%, transparent 76%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.histogram-column i,
.metric-track i {
  background: var(--accent);
  display: block;
  transition:
    height 520ms cubic-bezier(0.22, 1, 0.36, 1),
    width 520ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 180ms ease;
}

.histogram-column i {
  border-radius: 6px 6px 0 0;
  position: relative;
  width: 100%;
  z-index: 1;
}

.histogram-column i.queued,
.histogram-column i.running,
.metric-track i.queued,
.metric-track i.running {
  background: var(--cyan);
}

.histogram-column i.succeeded,
.metric-track i.succeeded {
  background: var(--green);
}

.histogram-column i.failed,
.metric-track i.failed {
  background: var(--red);
}

.histogram-column i.orange,
.metric-track i.orange {
  background: var(--orange);
}

.histogram-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.histogram-item strong {
  font-size: 18px;
}

.job-tick-chart {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(16, minmax(8px, 1fr));
  margin-top: 14px;
}

.status-stack {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  display: flex;
  gap: 3px;
  height: 14px;
  margin-bottom: 12px;
  overflow: hidden;
  padding: 2px;
}

.status-stack i {
  background: var(--subtle);
  border-radius: 999px;
  display: block;
  min-width: 6px;
  transition:
    width 520ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 180ms ease;
}

.status-stack i.queued,
.status-stack i.running {
  background: var(--cyan);
}

.status-stack i.succeeded {
  background: var(--green);
}

.status-stack i.failed {
  background: var(--red);
}

.job-tick {
  background: var(--subtle);
  border-radius: 5px;
  display: block;
  height: 32px;
  transition:
    background-color 240ms ease,
    transform 220ms ease;
}

.job-tick:hover {
  transform: translateY(-2px);
}

.job-tick.running {
  background: var(--cyan);
}

.job-tick.succeeded {
  background: var(--green);
}

.job-tick.failed {
  background: var(--red);
}

.metric-bars {
  display: grid;
  gap: 12px;
}

.metric-bar-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(100px, 130px) minmax(120px, 1fr) 42px;
}

.metric-bar-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.metric-track {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
}

.metric-track i {
  border-radius: inherit;
  height: 100%;
}

.dashboard-footnote {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-top: 12px;
}

.bar-list,
.compact-list,
.modal-form {
  display: grid;
  gap: 10px;
}

.bar-row,
.compact-row {
  align-items: center;
  display: grid;
  gap: 10px;
}

.bar-row {
  grid-template-columns: 130px minmax(80px, 1fr) 40px;
}

.bar-track {
  background: var(--subtle);
  border-radius: 999px;
  height: 9px;
  overflow: hidden;
}

.bar-fill {
  background: var(--accent);
  border-radius: inherit;
  height: 100%;
}

.bar-fill.running,
.bar-fill.claimed,
.bar-fill.queue {
  background: var(--cyan);
}

.bar-fill.completed {
  background: var(--green);
}

.bar-fill.failed {
  background: var(--red);
}

.bar-fill.expired {
  background: var(--orange);
}

.compact-row {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  grid-template-columns: minmax(120px, 1fr) minmax(80px, 120px) minmax(120px, 180px);
  padding: 9px;
}

.detail-fields,
.json-stack,
.timeline-list {
  display: grid;
  gap: 10px;
}

.detail-field {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px;
}

.detail-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.code-token {
  max-width: 100%;
  min-width: 0;
  padding: 6px 8px;
}

.code-token.wrap {
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
}

.json-block {
  max-height: 320px;
  overflow: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.error-block {
  background: color-mix(in srgb, var(--red) 10%, var(--panel-raised));
  border: 1px solid color-mix(in srgb, var(--red) 34%, var(--border));
  border-radius: 6px;
  margin: 0;
  padding: 10px;
}

.timeline-item {
  display: grid;
  gap: 10px;
  grid-template-columns: 18px minmax(0, 1fr);
  position: relative;
}

.timeline-item::before {
  background: var(--border);
  bottom: -10px;
  content: "";
  left: 8px;
  position: absolute;
  top: 18px;
  width: 1px;
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  background: var(--cyan);
  border: 3px solid var(--panel);
  border-radius: 999px;
  box-shadow: 0 0 0 1px var(--border);
  display: block;
  height: 16px;
  margin-top: 10px;
  position: relative;
  width: 16px;
  z-index: 1;
}

.timeline-card {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px;
}

.timeline-heading,
.timeline-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.timeline-heading {
  justify-content: space-between;
}

.timeline-meta,
.timeline-card p {
  color: var(--muted);
  font-size: 12px;
}

.timeline-meta > span,
.timeline-card p {
  overflow-wrap: anywhere;
}

.timeline-card p {
  margin: 0;
}

.timeline-count {
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
}

.toolbar,
.filter-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.toolbar {
  grid-template-columns: 190px minmax(160px, 1fr);
}

.compact-toolbar {
  display: flex;
  justify-content: flex-end;
}

.pagination-bar {
  align-items: center;
  border-top: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 900;
  gap: 12px;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
}

.pagination-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.pagination-controls .select-field {
  min-width: 120px;
}

.page-number-field {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 7px;
}

.page-number-field input {
  min-height: 38px;
  text-align: center;
  width: 74px;
}

.attempt-meter {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 128px;
}

.attempt-square {
  align-items: center;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  display: inline-flex;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.attempt-square.succeeded {
  background: var(--green-soft);
  border-color: color-mix(in srgb, var(--green) 42%, var(--border));
  color: var(--green);
}

.attempt-square.failed {
  background: var(--red-soft);
  border-color: color-mix(in srgb, var(--red) 42%, var(--border));
  color: var(--red);
}

.attempt-square.running {
  animation: attempt-running 960ms ease-in-out infinite alternate;
  background: var(--orange-soft);
  border-color: color-mix(in srgb, var(--orange) 42%, var(--border));
  color: var(--orange);
}

.attempt-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  margin-left: 3px;
  white-space: nowrap;
}

.event-feed-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.infinite-sentinel {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 900;
  justify-content: center;
  min-height: 64px;
  padding-top: 12px;
}

.terminal-panel {
  background: #101316;
  border: 1px solid #2d3439;
  border-radius: 8px;
  box-shadow: 0 22px 56px rgb(0 0 0 / 28%);
  color: #d8e2e8;
  overflow: hidden;
}

.terminal-header {
  align-items: center;
  background: #171b1f;
  border-bottom: 1px solid #2d3439;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 44px;
  padding: 9px 12px;
}

.terminal-window-controls {
  display: flex;
  gap: 6px;
}

.terminal-window-controls i {
  border-radius: 999px;
  display: block;
  height: 11px;
  width: 11px;
}

.terminal-window-controls i:nth-child(1) {
  background: #ff5f57;
}

.terminal-window-controls i:nth-child(2) {
  background: #ffbd2e;
}

.terminal-window-controls i:nth-child(3) {
  background: #28c840;
}

.terminal-header code {
  background: transparent;
  border: 0;
  color: #d8e2e8;
  font-size: 13px;
  overflow: hidden;
  padding: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-header span {
  color: #83919b;
  font-size: 12px;
  font-weight: 900;
}

.terminal-feed {
  display: grid;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  gap: 0;
  max-height: calc(100vh - 230px);
  min-height: 420px;
  overflow: auto;
  padding: 8px;
  scrollbar-color: var(--terminal-scroll-thumb) var(--terminal-scroll-track);
  scrollbar-width: thin;
}

.terminal-feed::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.terminal-feed::-webkit-scrollbar-track {
  background: var(--terminal-scroll-track);
}

.terminal-feed::-webkit-scrollbar-thumb {
  background: var(--terminal-scroll-thumb);
  border: 2px solid var(--terminal-scroll-track);
  border-radius: 999px;
}

.terminal-feed::-webkit-scrollbar-thumb:hover {
  background: var(--terminal-scroll-thumb-hover);
}

.terminal-feed::-webkit-scrollbar-corner {
  background: var(--terminal-scroll-track);
}

.terminal-line {
  align-items: baseline;
  border-left: 3px solid transparent;
  display: grid;
  gap: 8px;
  grid-template-columns: 80px 16px minmax(130px, 170px) minmax(110px, 150px) minmax(88px, 110px) minmax(150px, 220px) minmax(180px, 1fr);
  line-height: 1.55;
  min-width: 0;
  padding: 7px 8px;
}

.terminal-line:nth-child(odd) {
  background: rgb(255 255 255 / 2.5%);
}

.terminal-line:hover {
  background: rgb(255 255 255 / 6%);
}

.terminal-line.success {
  border-left-color: #42d392;
}

.terminal-line.danger {
  border-left-color: #ff6b6b;
}

.terminal-line.warning {
  border-left-color: #f5b84b;
}

.terminal-line.info {
  border-left-color: #55c8ff;
}

.terminal-line.accent {
  border-left-color: #b388ff;
}

.terminal-time,
.terminal-token,
.terminal-worker,
.terminal-message {
  color: #8d9aa5;
  font-size: 12px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.terminal-prompt {
  color: #63717b;
}

.terminal-event {
  color: #d8e2e8;
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.terminal-line.success .terminal-event,
.terminal-line.success .terminal-prompt {
  color: #42d392;
}

.terminal-line.danger .terminal-event,
.terminal-line.danger .terminal-prompt {
  color: #ff6b6b;
}

.terminal-line.warning .terminal-event,
.terminal-line.warning .terminal-prompt {
  color: #f5b84b;
}

.terminal-line.info .terminal-event,
.terminal-line.info .terminal-prompt {
  color: #55c8ff;
}

.terminal-line.accent .terminal-event,
.terminal-line.accent .terminal-prompt {
  color: #b388ff;
}

.terminal-job {
  color: #9ae6ff;
  font-size: 12px;
  font-weight: 900;
  min-width: 0;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.terminal-job:hover {
  color: #ffffff;
}

.terminal-message {
  color: #c0ccd4;
}

.terminal-feed .empty-state {
  background: rgb(255 255 255 / 4%);
  border-color: #2d3439;
  color: #8d9aa5;
}

.terminal-panel .infinite-sentinel {
  border-top: 1px solid #2d3439;
  color: #8d9aa5;
  padding: 12px;
}

.terminal-panel .secondary-button {
  background: #171b1f;
  border-color: #2d3439;
  color: #d8e2e8;
}

.filter-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.select-field {
  position: relative;
}

.select-trigger {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.select-trigger.open,
.select-trigger:focus-visible {
  border-color: var(--cyan);
}

.select-trigger:hover {
  background: var(--panel-raised);
}

.select-menu {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 4px;
  left: 0;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 35;
}

.select-option {
  background: transparent;
  border: 0;
  color: var(--ink);
  justify-content: flex-start;
  min-height: 34px;
  padding: 7px 9px;
}

.select-option:hover,
.select-option.active {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 11px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.badge,
.pill,
.connection {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 950;
  gap: 6px;
  padding: 5px 8px;
}

.badge.pending,
.badge.queued,
.badge.claimed,
.pill.muted {
  background: var(--subtle);
  color: var(--muted);
}

.badge.running {
  background: var(--cyan-soft);
  border-color: color-mix(in srgb, var(--cyan) 30%, transparent);
  color: var(--cyan);
}

.badge.completed,
.badge.succeeded,
.pill.success,
.connection.open {
  background: var(--green-soft);
  border-color: color-mix(in srgb, var(--green) 30%, transparent);
  color: var(--green);
}

.badge.failed,
.connection.closed,
.error {
  background: var(--red-soft);
  border-color: color-mix(in srgb, var(--red) 30%, transparent);
  color: var(--red);
}

.result-title {
  margin-top: 14px;
}

.badge.expired,
.connection.connecting {
  background: var(--orange-soft);
  border-color: color-mix(in srgb, var(--orange) 30%, transparent);
  color: var(--orange);
}

.error,
.empty-state {
  border: 1px solid;
  border-radius: 7px;
  font-weight: 800;
  padding: 10px 12px;
}

.empty-state {
  background: var(--panel-raised);
  border-color: var(--border);
  color: var(--muted);
  margin-top: 10px;
}

pre,
code {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  overflow: auto;
  padding: 8px;
}

code {
  display: inline-block;
  text-overflow: ellipsis;
}

.inline-code {
  max-width: 100%;
  padding: 4px 7px;
  white-space: nowrap;
}

.action-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.checkbox-row {
  align-items: center;
  display: flex;
}

.toggle-field {
  align-items: center;
  display: flex;
  gap: 10px;
}

.toggle-field input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.toggle-track {
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  display: inline-flex;
  height: 28px;
  padding: 3px;
  transition:
    background 140ms ease,
    border-color 140ms ease;
  width: 48px;
}

.toggle-thumb {
  background: var(--muted);
  border-radius: 999px;
  display: block;
  height: 20px;
  transform: translateX(0);
  transition:
    background 140ms ease,
    transform 140ms ease;
  width: 20px;
}

.toggle-field input:checked + .toggle-track {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  border-color: var(--accent);
}

.toggle-field input:checked + .toggle-track .toggle-thumb {
  background: var(--accent);
  transform: translateX(20px);
}

.toggle-field input:focus-visible + .toggle-track {
  outline: 3px solid color-mix(in srgb, var(--cyan) 34%, transparent);
  outline-offset: 2px;
}

.datetime {
  display: grid;
  gap: 2px;
  line-height: 1.2;
}

.datetime span,
.muted-text {
  color: var(--muted);
  font-size: 12px;
}

.datetime strong {
  color: var(--ink);
  font-size: 13px;
}

[data-sonner-toaster] {
  font-family: inherit;
}

[data-sonner-toast] {
  background: var(--panel) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  box-shadow: var(--shadow) !important;
  color: var(--ink) !important;
  font-weight: 800;
}

[data-sonner-toast] [data-title],
[data-sonner-toast] [data-description] {
  color: var(--ink) !important;
}

[data-sonner-toast] [data-description] {
  color: var(--muted) !important;
}

[data-sonner-toast][data-type="success"] {
  border-left: 4px solid var(--green) !important;
}

[data-sonner-toast][data-type="error"] {
  border-left: 4px solid var(--red) !important;
}

[data-sonner-toast][data-type="warning"] {
  border-left: 4px solid var(--orange) !important;
}

[data-sonner-toast][data-type="info"] {
  border-left: 4px solid var(--cyan) !important;
}

@keyframes metric-enter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes chart-fill {
  from {
    --chart-value: 0%;
  }

  to {
    --chart-value: var(--percent);
  }
}

@keyframes dot-enter {
  from {
    opacity: 0;
    transform: scale(0.35);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes attempt-running {
  from {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--orange) 18%, transparent);
  }

  to {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 4%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

.modal-backdrop {
  align-items: center;
  backdrop-filter: blur(10px);
  background: rgb(0 0 0 / 48%);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 40;
}

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgb(0 0 0 / 36%);
  max-height: calc(100vh - 36px);
  max-width: 640px;
  overflow: auto;
  padding: 14px;
  width: 100%;
}

.modal-header,
.modal-actions {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-header h2 {
  font-size: 18px;
  margin: 0;
}

.modal-actions {
  justify-content: flex-end;
  margin: 0;
}

@media (max-width: 1060px) {
  .app-shell:not(.sidebar-collapsed) {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .dashboard-grid,
  .detail-grid,
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .circle-grid {
    grid-template-columns: 1fr 1fr;
  }

  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .terminal-line {
    grid-template-columns: 80px 16px minmax(120px, 1fr) minmax(100px, 1fr);
  }
}

@media (max-width: 720px) {
  .app-shell {
    display: block;
  }

  .topbar {
    padding: 10px 12px;
  }

  .brand-logo {
    width: 64px;
  }

  .brand-lockup h1,
  .brand-lockup .eyebrow {
    display: none;
  }

  .sidebar {
    background: color-mix(in srgb, var(--panel) 92%, transparent);
    border: 1px solid var(--border);
    border-radius: 18px;
    bottom: 12px;
    box-shadow: 0 16px 54px rgb(0 0 0 / 22%);
    height: auto;
    left: 12px;
    overflow-y: visible;
    padding: 8px;
    position: fixed;
    right: 12px;
    top: auto;
    transform: none;
    width: auto;
    z-index: 30;
  }

  .app-shell.sidebar-collapsed {
    display: block;
  }

  .sidebar-header {
    display: none;
  }

  .sidebar nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
  }

  .sidebar-collapsed .nav-item,
  .nav-item {
    border-radius: 12px;
    display: grid;
    font-size: 11px;
    gap: 4px;
    justify-items: center;
    min-width: 74px;
    min-height: 56px;
    padding: 7px 4px;
  }

  .sidebar-collapsed .nav-item span,
  .nav-item span {
    display: inline;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .collapse-button {
    display: none;
  }

  .content {
    padding: 12px 12px 92px;
  }

  .page-header,
  .topbar-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .dashboard-grid,
  .detail-grid,
  .stats-grid,
  .circle-grid,
  .filter-grid,
  .preset-grid,
  .toolbar,
  .compact-row,
  .dot-chart-row {
    grid-template-columns: 1fr;
  }

  .terminal-header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .terminal-header span {
    grid-column: 2;
  }

  .terminal-feed {
    max-height: none;
    min-height: 360px;
  }

  .terminal-line {
    grid-template-columns: 64px 14px minmax(0, 1fr);
  }

  .terminal-job,
  .terminal-token,
  .terminal-worker,
  .terminal-message {
    grid-column: 3;
  }
}
