:root {
  color-scheme: light;
  --bg: #eef3f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #111827;
  --muted: #65728a;
  --line: #d8dee8;
  --blue: #1464f6;
  --blue-soft: #e8f0ff;
  --green: #0f8f4f;
  --green-soft: #e4f8ed;
  --yellow: #bd7b18;
  --yellow-soft: #fff4d9;
  --red: #c93a3a;
  --red-soft: #ffe7e7;
  --gray: #8b96a8;
  --ink: #0b1220;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgb(20 100 246 / 10%), transparent 32rem),
    linear-gradient(180deg, #f8fbff 0, var(--bg) 320px);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.app-header {
  align-items: center;
  background: linear-gradient(135deg, #07111f 0%, #102033 58%, #0c1725 100%);
  border-bottom: 1px solid rgb(255 255 255 / 9%);
  color: #fff;
  display: flex;
  justify-content: space-between;
  padding: 18px 28px;
}

.app-header h1 {
  font-size: 22px;
  margin: 0;
}

.app-header p {
  color: #b9c1d1;
  margin: 2px 0 0;
}

.app-header a {
  color: #fff;
  text-decoration: none;
}

.header-brand {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 42px minmax(0, 1fr);
}

.header-brand img {
  display: block;
  height: 42px;
  width: 42px;
}

body.auth-screen {
  background:
    radial-gradient(circle at 20% 16%, rgb(11 108 255 / 28%), transparent 28rem),
    radial-gradient(circle at 78% 18%, rgb(23 209 121 / 17%), transparent 30rem),
    linear-gradient(160deg, #050b13 0%, #07111f 48%, #02060b 100%);
  color: #f8fafc;
  min-height: 100vh;
}

body.auth-screen .app-header {
  display: none;
}

.app-root {
  padding: 0;
}

body.auth-screen .app-root {
  min-height: 100vh;
}

.auth-page {
  align-items: center;
  display: grid;
  min-height: 100vh;
  overflow: hidden;
  padding: 42px;
  position: relative;
}

.auth-page::before {
  background:
    linear-gradient(rgb(255 255 255 / 4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 4%) 1px, transparent 1px);
  background-size: 68px 68px;
  content: "";
  inset: 0;
  mask-image: radial-gradient(circle at 60% 40%, black, transparent 68%);
  opacity: 0.48;
  pointer-events: none;
  position: absolute;
}

.auth-card {
  align-items: center;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 12%), rgb(255 255 255 / 4%)),
    rgb(6 13 24 / 82%);
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 8px;
  box-shadow: 0 28px 90px rgb(0 0 0 / 42%);
  display: grid;
  gap: 44px;
  grid-template-columns: minmax(0, 1fr) 360px;
  margin: 0 auto;
  max-width: 980px;
  min-height: 520px;
  min-width: 0;
  overflow: hidden;
  padding: 52px;
  position: relative;
  width: 100%;
}

.auth-card::after {
  background: linear-gradient(90deg, #0b6cff, #17d179);
  content: "";
  height: 3px;
  inset: 0 0 auto;
  position: absolute;
}

.auth-copy {
  max-width: 520px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.auth-brand {
  align-items: center;
  display: flex;
  gap: 12px;
  margin: 0 0 52px;
}

.auth-brand img {
  height: 42px;
  width: 42px;
}

.auth-brand strong {
  color: #fff;
  display: block;
  font-size: 18px;
  letter-spacing: 0;
  line-height: 1;
}

.auth-brand span {
  color: #91a0b6;
  display: block;
  font-size: 12px;
  margin-top: 5px;
  text-transform: uppercase;
}

.auth-copy h1 {
  color: #fff;
  font-size: 52px;
  letter-spacing: 0;
  line-height: 1.02;
  margin: 0 0 18px;
}

.auth-copy p {
  color: #aeb9ca;
  font-size: 18px;
  line-height: 1.62;
  margin: 0 0 28px;
}

.auth-button {
  align-items: center;
  background: linear-gradient(135deg, #0b6cff, #075be0);
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 14px;
  box-shadow: 0 18px 38px rgb(11 108 255 / 28%);
  color: #fff;
  display: inline-flex;
  font-size: 16px;
  font-weight: 800;
  gap: 12px;
  justify-content: center;
  min-height: 54px;
  padding: 0 22px;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-button:hover {
  box-shadow: 0 20px 42px rgb(11 108 255 / 36%);
  transform: translateY(-1px);
}

.auth-button svg {
  height: 20px;
  width: 20px;
}

.auth-button.secondary-auth {
  background: rgb(255 255 255 / 8%);
  box-shadow: none;
}

.auth-footnote,
.auth-note {
  color: #7f8ca0;
  font-size: 14px;
  line-height: 1.5;
  margin: 20px 0 0;
}

.auth-note strong {
  color: #f8fafc;
}

.auth-visual {
  align-items: center;
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 50% 38%, rgb(11 108 255 / 18%), transparent 32%),
    linear-gradient(180deg, rgb(255 255 255 / 7%), rgb(255 255 255 / 2%));
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 30px;
  display: grid;
  justify-items: center;
  overflow: hidden;
  position: relative;
  min-width: 0;
}

.auth-visual::before,
.auth-visual::after {
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 999px;
  content: "";
  height: 74%;
  position: absolute;
  width: 74%;
}

.auth-visual::after {
  height: 48%;
  width: 48%;
}

.auth-orbit {
  display: grid;
  grid-template-columns: repeat(6, 42px);
  gap: 14px;
  position: relative;
  z-index: 1;
}

.auth-node {
  align-items: center;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 16px;
  display: grid;
  height: 64px;
  justify-content: center;
  box-shadow: 0 16px 40px rgb(0 0 0 / 24%);
  width: 64px;
  background: linear-gradient(180deg, rgb(255 255 255 / 14%), rgb(255 255 255 / 5%));
  position: relative;
  animation: authLogoHaze 18s ease-in-out infinite;
  will-change: box-shadow, border-color, background;
}

.auth-node::after {
  background: radial-gradient(circle, rgb(255 255 255 / 26%), transparent 68%);
  border-radius: inherit;
  content: "";
  inset: -10px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transition: opacity 900ms ease;
  z-index: -1;
}

.auth-node img {
  position: relative;
  z-index: 1;
}

.auth-node:nth-child(1) {
  animation-delay: -1.6s;
  animation-duration: 19s;
  grid-column: 1 / span 2;
}

.auth-node:nth-child(2) {
  animation-delay: -8.7s;
  animation-duration: 21s;
  grid-column: 3 / span 2;
}

.auth-node:nth-child(3) {
  animation-delay: -4.1s;
  animation-duration: 17s;
  grid-column: 5 / span 2;
}

.auth-node:nth-child(4) {
  animation-delay: -12.8s;
  animation-duration: 22s;
  grid-column: 2 / span 2;
}

.auth-node:nth-child(5) {
  animation-delay: -15.2s;
  animation-duration: 20s;
  grid-column: 4 / span 2;
}

.auth-node img {
  display: block;
  height: 38px;
  object-fit: contain;
  width: 38px;
}

.auth-pipeline {
  bottom: 34px;
  display: flex;
  gap: 8px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
}

.auth-pipeline span {
  background: rgb(255 255 255 / 22%);
  border-radius: 999px;
  height: 6px;
  width: 34px;
}

.auth-pipeline span:nth-child(2) {
  background: #17d179;
}

@keyframes authLogoHaze {
  0%,
  16%,
  100% {
    background: linear-gradient(180deg, rgb(255 255 255 / 14%), rgb(255 255 255 / 5%));
    border-color: rgb(255 255 255 / 16%);
    box-shadow: 0 16px 40px rgb(0 0 0 / 24%);
  }

  6% {
    background: linear-gradient(180deg, rgb(255 255 255 / 22%), rgb(255 255 255 / 8%));
    border-color: rgb(255 255 255 / 34%);
    box-shadow:
      0 16px 40px rgb(0 0 0 / 24%),
      0 0 28px rgb(255 255 255 / 18%),
      0 0 52px rgb(255 255 255 / 8%);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .auth-node::after {
    animation: authLogoHazeAura 18s ease-in-out infinite;
  }

  .auth-node:nth-child(1)::after { animation-delay: -1.6s; animation-duration: 19s; }
  .auth-node:nth-child(2)::after { animation-delay: -8.7s; animation-duration: 21s; }
  .auth-node:nth-child(3)::after { animation-delay: -4.1s; animation-duration: 17s; }
  .auth-node:nth-child(4)::after { animation-delay: -12.8s; animation-duration: 22s; }
  .auth-node:nth-child(5)::after { animation-delay: -15.2s; animation-duration: 20s; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-node {
    animation: none;
  }
}

@keyframes authLogoHazeAura {
  0%,
  16%,
  100% {
    opacity: 0;
  }

  6% {
    opacity: 1;
  }
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: calc(100vh - 77px);
  width: 100%;
}

.side-nav {
  background: rgb(255 255 255 / 78%);
  border-right: 1px solid var(--line);
  display: grid;
  gap: 18px;
  grid-template-rows: auto auto 1fr auto;
  padding: 20px 14px;
}

.side-brand {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 42px minmax(0, 1fr);
  padding: 0 8px 8px;
}

.side-brand img {
  display: block;
  height: 42px;
  width: 42px;
}

.side-brand strong {
  font-size: 18px;
}

.side-brand span,
.side-user span {
  color: var(--muted);
  font-size: 12px;
}

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

.dashboard-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  max-width: 1720px;
  width: 100%;
}

.layout {
  display: grid;
  gap: 18px;
  width: 100%;
}

.layout.single {
  grid-template-columns: minmax(0, 980px);
}

.layout.wide {
  grid-template-columns: minmax(0, 1fr);
}

.full-width {
  grid-column: 1 / -1;
}

.tabs {
  display: grid;
  gap: 8px;
}

.tabs button {
  background: rgb(255 255 255 / 72%);
  border: 1px solid var(--line);
  color: var(--text);
  justify-content: flex-start;
  text-align: left;
  width: 100%;
}

.tabs button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 10px 24px rgb(20 100 246 / 22%);
}

.planned-nav {
  align-content: start;
  display: grid;
  gap: 8px;
}

.planned-nav button {
  background: transparent;
  border: 1px dashed #c6cedb;
  color: var(--muted);
  cursor: default;
  display: grid;
  gap: 2px;
  justify-items: start;
  opacity: 1;
  text-align: left;
}

.planned-nav button span {
  background: var(--yellow-soft);
  border-radius: 999px;
  color: #7c4a03;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
}

.planned-nav button:disabled {
  opacity: 1;
}

.side-user {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 2px;
  padding: 14px 8px 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgb(15 23 42 / 5%);
  padding: 18px;
}

.panel h2,
.panel h3 {
  margin: 0 0 12px;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 12px;
}

.dashboard-main,
.dashboard-rail {
  display: grid;
  gap: 20px;
  align-content: start;
  min-width: 0;
}

.dashboard-rail {
  position: sticky;
  top: 18px;
}

.stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.compact-stats {
  margin: 12px 0;
}

.stat {
  background:
    linear-gradient(135deg, rgb(20 100 246 / 7%), transparent 55%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.stat strong {
  display: block;
  font-size: 24px;
}

.status-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 14px 0 18px;
}

.status-grid.single {
  grid-template-columns: 1fr;
}

.status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.status-card.ok {
  border-color: #9bd2ad;
}

.status-card.warn {
  border-color: #e0bd76;
}

.status-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.status-card dl {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.status-card dl div {
  display: grid;
  gap: 4px;
  grid-template-columns: 120px minmax(0, 1fr);
}

.status-card dt {
  color: var(--muted);
  font-size: 12px;
}

.status-card dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.job {
  background:
    linear-gradient(180deg, rgb(248 250 252 / 80%), #fff),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 90%);
  padding: 16px;
  min-width: 0;
}

.worker-panel {
  margin-bottom: 18px;
}

.job-head {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.job-head > div {
  min-width: 0;
}

.job-head .muted {
  overflow-wrap: anywhere;
}

.badge {
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  min-height: 30px;
  min-width: 74px;
  padding: 8px 12px;
  text-align: center;
  white-space: nowrap;
}

.badge.gray { background: var(--gray); }
.badge.blue { background: var(--blue); }
.badge.green { background: var(--green); }
.badge.yellow { background: var(--yellow); }
.badge.red { background: var(--red); }

.stage {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(106px, 1fr));
  margin: 16px 0 8px;
}

.stage-step {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.stage-bar {
  background: #e7eaf0;
  border-radius: 999px;
  display: block;
  height: 16px;
  width: 100%;
}

.stage-label {
  color: var(--muted);
  display: block;
  font-size: 11px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-step.done .stage-bar {
  background: linear-gradient(90deg, #0c8a4a, #16b96f);
}

.stage-step.active .stage-bar {
  background: linear-gradient(90deg, #1464f6, #5d8cff);
  box-shadow: 0 8px 18px rgb(20 100 246 / 22%);
}

.stage-step.blocked .stage-bar {
  background: linear-gradient(90deg, #bd7b18, #f3b547);
}

.stage-step.done .stage-label,
.stage-step.active .stage-label,
.stage-step.blocked .stage-label {
  color: var(--text);
  font-weight: 600;
}

.compact-job {
  padding: 12px;
}

.compact-job .job-head {
  display: grid;
  gap: 8px;
}

.compact-job .badge {
  justify-self: start;
  min-height: 26px;
  min-width: 0;
  padding: 7px 10px;
}

.compact-stage {
  grid-template-columns: 1fr;
}

.compact-stage .stage-step {
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
}

.compact-stage .stage-bar {
  grid-column: 2;
  grid-row: 1;
  height: 10px;
}

.compact-stage .stage-label {
  grid-column: 1;
  grid-row: 1;
}

.rail-list {
  display: grid;
  gap: 10px;
}

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

.health-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.health-row strong {
  color: var(--muted);
  font-size: 12px;
}

.health-dot {
  border-radius: 50%;
  display: inline-block;
  height: 9px;
  width: 9px;
}

.health-dot.ok {
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.health-dot.warn {
  background: var(--yellow);
  box-shadow: 0 0 0 4px var(--yellow-soft);
}

.under-development {
  overflow: hidden;
  position: relative;
}

.under-development::after {
  background: repeating-linear-gradient(
    135deg,
    #f7c948 0 10px,
    #111827 10px 20px
  );
  color: #111827;
  content: "";
  height: 10px;
  left: -12px;
  opacity: 0.88;
  position: absolute;
  right: -12px;
  top: 0;
}

.under-development span {
  background: var(--yellow-soft);
  border: 1px solid #f1ce77;
  border-radius: 999px;
  color: #7c4a03;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
}

label {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  padding: 8px;
  width: 100%;
}

textarea {
  min-height: 82px;
}

button {
  background: var(--blue);
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  padding: 8px 11px;
}

.button-link {
  background: var(--blue);
  border-radius: 6px;
  color: #fff;
  display: inline-block;
  padding: 8px 11px;
  text-decoration: none;
}

.secondary-link {
  background: #334155;
}

button.secondary {
  background: #4b5563;
}

button.danger {
  background: var(--red);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.busy::before {
  animation: spin 0.8s linear infinite;
  border: 2px solid rgb(255 255 255 / 45%);
  border-radius: 50%;
  border-top-color: #fff;
  content: "";
  display: inline-block;
  height: 12px;
  margin-right: 8px;
  vertical-align: -1px;
  width: 12px;
}

.button-link.disabled {
  opacity: 0.45;
  pointer-events: none;
}

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

.job-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.job-actions button,
.job-actions .button-link {
  font-size: 12px;
  padding: 7px 10px;
}

.action-note {
  background: var(--yellow-soft);
  border: 1px solid #f1ce77;
  border-radius: 8px;
  color: #7c4a03;
  font-size: 12px;
  padding: 7px 9px;
}

.notice {
  background: #111827;
  border-radius: 8px;
  bottom: 18px;
  color: #fff;
  left: 50%;
  padding: 10px 14px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 20;
}

.debug-terminal {
  background: #0f172a;
  border-radius: 8px;
  color: #dbeafe;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin: 8px 0 0;
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.history-panel {
  min-width: 0;
}

.history-header {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.history-header h2 {
  margin-bottom: 4px;
}

.history-toolbar {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(320px, 1fr) 220px 260px 220px 44px;
  margin-bottom: 14px;
}

.history-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.history-field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.history-field input,
.history-field select,
.select-control {
  height: 44px;
  min-height: 44px;
  width: 100%;
}

.history-field select,
.select-control {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #8d98aa 50%) calc(100% - 18px) 19px / 6px 6px no-repeat,
    linear-gradient(135deg, #8d98aa 50%, transparent 50%) calc(100% - 14px) 19px / 6px 6px no-repeat,
    #07111d;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 8px;
  color: #f6f8fb;
  font: inherit;
  padding: 0 36px 0 12px;
}

.history-field select:focus,
.select-control:focus {
  border-color: rgb(11 108 255 / 65%);
  box-shadow: 0 0 0 4px rgb(11 108 255 / 12%);
  outline: none;
}

.history-toggle {
  align-self: end;
  height: 44px;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  width: 100%;
}

.history-refresh-button {
  align-self: end;
  background: rgb(255 255 255 / 3%);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 8px;
  color: #c7d0dd;
  display: inline-grid;
  height: 44px;
  min-width: 44px;
  padding: 0;
  place-items: center;
  width: 44px;
}

.history-refresh-button:hover {
  background: rgb(11 108 255 / 16%);
  border-color: rgb(11 108 255 / 38%);
  color: #fff;
}

.history-refresh-button img {
  filter: invert(88%) sepia(10%) saturate(312%) hue-rotate(179deg) brightness(93%) contrast(90%);
  height: 20px;
  width: 20px;
}

.history-refresh-button.busy img {
  animation: spin 800ms linear infinite;
}

.checkbox-field {
  align-items: center;
  background: rgb(255 255 255 / 3%);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 9px;
  padding: 10px 12px;
}

.checkbox-field input {
  accent-color: var(--blue);
  height: 16px;
  margin: 0;
  width: 16px;
}

.switch-field {
  align-items: center;
  background: rgb(255 255 255 / 3%);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 10px;
  min-height: 42px;
  padding: 9px 12px;
  user-select: none;
}

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

.switch-track {
  background: #334155;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 999px;
  box-shadow: inset 0 1px 3px rgb(0 0 0 / 30%);
  display: inline-flex;
  flex: 0 0 44px;
  height: 26px;
  padding: 2px;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  width: 44px;
}

.switch-track::before {
  background: #f8fafc;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgb(0 0 0 / 35%);
  content: "";
  display: block;
  height: 20px;
  transform: translateX(0);
  transition: transform 180ms ease;
  width: 20px;
}

.switch-field input:checked + .switch-track {
  background: linear-gradient(135deg, #16c784, #0f8f4f);
  border-color: rgb(23 209 121 / 56%);
  box-shadow: 0 0 0 4px rgb(23 209 121 / 10%), inset 0 1px 3px rgb(0 0 0 / 18%);
}

.switch-field input:checked + .switch-track::before {
  transform: translateX(18px);
}

.switch-field input:focus-visible + .switch-track {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.switch-label {
  min-width: 0;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-record {
  background: rgb(255 255 255 / 3%);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.history-record.open {
  border-color: rgb(11 108 255 / 36%);
  box-shadow: 0 16px 36px rgb(0 0 0 / 18%);
}

.history-compact {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(160px, 1fr) minmax(210px, 1.2fr) 170px 170px 280px auto;
  min-height: 60px;
  padding: 8px 12px;
  text-align: left;
  width: 100%;
}

.history-compact:hover {
  background: rgb(255 255 255 / 4%);
}

.history-main,
.history-customer,
.history-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.history-main strong,
.history-customer strong,
.history-meta strong {
  color: #fff;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-main span,
.history-customer span,
.history-meta span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-compact > .badge {
  justify-content: center;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.history-chevron {
  color: var(--muted);
  font-size: 20px;
  transition: transform 180ms ease;
}

.history-record.open .history-chevron {
  transform: rotate(180deg);
}

.history-record.open .history-compact {
  grid-template-columns: minmax(160px, 1fr) minmax(210px, 1.2fr) 170px 170px auto;
}

.history-record.open .history-compact .automation-flow.horizontal {
  display: none;
}

.history-expanded {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 210px minmax(0, 1fr);
  padding: 12px;
}

.history-expanded[hidden] {
  display: none;
}

.user-access-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.user-record {
  background: rgb(255 255 255 / 3%);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.user-record.open {
  border-color: rgb(11 108 255 / 36%);
  box-shadow: 0 16px 36px rgb(0 0 0 / 18%);
}

.user-compact {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: 44px minmax(180px, 1fr) minmax(180px, 260px) 132px auto;
  min-height: 62px;
  padding: 9px 12px;
  text-align: left;
  width: 100%;
}

.user-compact:hover {
  background: rgb(255 255 255 / 4%);
}

.user-avatar {
  align-items: center;
  background: linear-gradient(135deg, #123a74, #0f8f4f);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.user-compact > .badge {
  justify-content: center;
  width: 100%;
}

.user-record.open .history-chevron {
  transform: rotate(180deg);
}

.user-expanded {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  padding: 12px;
}

.user-expanded[hidden] {
  display: none;
}

.user-expanded section {
  background: rgb(255 255 255 / 3%);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 10px;
}

.user-expanded h3 {
  color: #fff;
  font-size: 13px;
  margin: 0 0 8px;
}

.user-expanded select {
  margin-bottom: 10px;
  width: 100%;
}

.user-expanded .switch-field {
  width: 100%;
}

.history-stage-column {
  border-right: 1px solid var(--line);
  padding-right: 12px;
}

.history-details-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.history-details-grid section {
  background: rgb(255 255 255 / 3%);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 10px;
}

.history-details-grid h3 {
  color: #fff;
  font-size: 13px;
  margin: 0 0 6px;
}

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

.review-guidance,
.review-comments {
  grid-column: span 2;
}

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

.review-guidance-grid div,
.comment-item {
  background: rgb(0 0 0 / 16%);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}

.review-guidance-grid strong,
.review-guidance-grid span,
.comment-item strong,
.comment-item time,
.comment-item p {
  display: block;
}

.review-guidance-grid span,
.comment-item time,
.comment-item p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 4px 0 0;
}

.comment-list {
  display: grid;
  gap: 8px;
}

.comment-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.comment-form textarea {
  background: rgb(255 255 255 / 6%);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  min-width: 0;
  padding: 8px;
  resize: vertical;
}

.history-pagination {
  display: flex;
  justify-content: center;
  padding-top: 12px;
}

.automation-flow {
  --stage-size: 38px;
  align-items: center;
  display: flex;
  min-width: 0;
}

.automation-flow.horizontal {
  justify-content: center;
  --stage-size: 34px;
}

.automation-flow.vertical {
  align-items: flex-start;
  flex-direction: column;
}

.automation-stage {
  align-items: center;
  display: flex;
  gap: 9px;
  min-width: 0;
  position: relative;
}

.stage-control {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: inherit;
  cursor: default;
  display: inline-flex;
  padding: 0;
  text-decoration: none;
}

a.stage-control {
  cursor: pointer;
}

.stage-control:hover .app-logo,
.stage-control:focus-visible .app-logo {
  outline: 2px solid rgb(255 218 117 / 70%);
  outline-offset: 4px;
}

.automation-flow.horizontal .automation-stage {
  gap: 0;
}

.automation-flow.horizontal .automation-label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateX(-6px);
  transition: max-width 180ms ease, opacity 180ms ease, transform 180ms ease;
  white-space: nowrap;
}

.history-record.open .automation-flow.horizontal .automation-label {
  max-width: 0;
  opacity: 0;
  transform: translateX(-6px);
}

.automation-flow.vertical .automation-label {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.app-logo {
  align-items: center;
  background: #273140;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 4%);
  color: #aab4c3;
  display: inline-flex;
  flex: 0 0 var(--stage-size);
  font-size: 10px;
  font-weight: 800;
  height: var(--stage-size);
  justify-content: center;
  letter-spacing: 0;
  width: var(--stage-size);
}

.app-logo img {
  display: block;
  filter: grayscale(1) saturate(0.2) opacity(0.55);
  height: 78%;
  max-width: 78%;
  object-fit: contain;
  transition: filter 180ms ease, transform 180ms ease;
}

.automation-stage.complete .app-logo img,
.automation-stage.active .app-logo img,
.automation-stage.failed .app-logo img {
  filter: none;
}

.automation-stage.active .app-logo img {
  transform: scale(1.06);
}

.automation-stage.complete .app-logo {
  background: color-mix(in srgb, var(--green) 22%, #102116);
  border-color: rgb(23 209 121 / 55%);
  box-shadow: 0 0 0 5px rgb(23 209 121 / 12%), 0 0 20px rgb(23 209 121 / 28%);
  color: #dfffee;
}

.automation-stage.active .app-logo {
  background: color-mix(in srgb, var(--blue) 24%, #101b31);
  border-color: rgb(11 108 255 / 62%);
  box-shadow: 0 0 0 5px rgb(11 108 255 / 12%), 0 0 22px rgb(11 108 255 / 42%);
  color: #e6f0ff;
  animation: stage-pulse 1300ms ease-in-out infinite;
}

.automation-stage.failed .app-logo {
  background: color-mix(in srgb, var(--red) 24%, #2c1118);
  border-color: rgb(255 93 93 / 62%);
  box-shadow: 0 0 0 5px rgb(255 93 93 / 12%), 0 0 20px rgb(255 93 93 / 30%);
  color: #ffecec;
}

.stage-link {
  background: #273140;
  display: block;
  flex: 0 0 28px;
  height: 3px;
  min-width: 24px;
}

.automation-flow.vertical .stage-link {
  flex: 0 0 17px;
  height: 17px;
  margin-left: calc(var(--stage-size) / 2 - 1px);
  min-width: 2px;
  width: 2px;
}

.stage-link.complete {
  background: linear-gradient(90deg, var(--green), rgb(23 209 121 / 52%));
  box-shadow: 0 0 14px rgb(23 209 121 / 35%);
}

.automation-flow.vertical .stage-link.complete {
  background: linear-gradient(180deg, var(--green), rgb(23 209 121 / 52%));
}

.stage-link.active {
  background: linear-gradient(90deg, var(--blue), rgb(11 108 255 / 40%));
  box-shadow: 0 0 14px rgb(11 108 255 / 36%);
  animation: link-pulse 1300ms ease-in-out infinite;
}

.automation-flow.vertical .stage-link.active {
  background: linear-gradient(180deg, var(--blue), rgb(11 108 255 / 40%));
}

.stage-link.failed {
  background: linear-gradient(90deg, var(--red), rgb(255 93 93 / 42%));
  box-shadow: 0 0 14px rgb(255 93 93 / 30%);
}

@keyframes stage-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes link-pulse {
  0%, 100% { opacity: .65; }
  50% { opacity: 1; }
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: auto;
}

.history-table {
  border-collapse: collapse;
  min-width: 1480px;
  width: 100%;
}

.history-table th,
.history-table td {
  border-bottom: 1px solid #edf0f4;
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.history-table th {
  background: #f7f9fc;
  color: #334155;
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.history-table tr:last-child td {
  border-bottom: 0;
}

.history-table td {
  background: #fff;
}

.history-table .badge {
  margin: 6px 0;
}

.metadata-line {
  display: grid;
  gap: 2px;
  margin-bottom: 3px;
  border-radius: 8px;
  padding: 3px 5px;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.metadata-line span,
.cell-muted {
  color: var(--muted);
  display: block;
  font-size: 11px;
}

.metadata-line strong,
.metadata-line a {
  color: var(--text);
  display: block;
  font-size: 11px;
  font-weight: 600;
  max-width: 260px;
  overflow-wrap: anywhere;
}

.metadata-line a {
  color: #9cc5ff;
  text-decoration: none;
}

.metadata-line a:hover {
  text-decoration: underline;
}

.history-record[data-highlight-stage="sipgate"] [data-stage-target~="sipgate"],
.history-record[data-highlight-stage="workdrive"] [data-stage-target~="workdrive"],
.history-record[data-highlight-stage="crm"] [data-stage-target~="crm"],
.history-record[data-highlight-stage="n8n"] [data-stage-target~="n8n"],
.history-record[data-highlight-stage="gpt"] [data-stage-target~="gpt"] {
  background: rgb(255 218 117 / 13%);
  box-shadow: inset 3px 0 0 rgb(255 218 117 / 70%);
}

.cell-error {
  background: var(--red-soft);
  border: 1px solid #f3b1b1;
  border-radius: 8px;
  color: #8f1f1f;
  display: block;
  font-size: 12px;
  margin-top: 6px;
  max-width: 260px;
  overflow-wrap: anywhere;
  padding: 6px 8px;
}

.storage-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  margin: 0 6px 6px 0;
  padding: 5px 8px;
}

.storage-pill.ok {
  background: var(--green-soft);
  color: var(--green);
}

.storage-pill.pending {
  background: #edf1f6;
  color: var(--muted);
}

.storage-pill a {
  color: inherit;
  text-decoration: underline;
}

.history-table .job-actions {
  align-items: flex-start;
  display: grid;
  gap: 6px;
  margin: 0;
}

.history-table .job-actions button,
.history-table .job-actions .button-link {
  justify-self: start;
  white-space: nowrap;
}

.form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.form-grid.compact {
  align-items: center;
  grid-template-columns: 1fr auto;
}

.check {
  align-items: center;
  display: flex;
  gap: 6px;
  margin: 0;
}

.check input {
  width: auto;
}

.full {
  grid-column: 1 / -1;
}

.credential {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.credential-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.credential-record {
  background: rgb(255 255 255 / 3%);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.credential-record.open {
  border-color: rgb(11 108 255 / 36%);
  box-shadow: 0 16px 36px rgb(0 0 0 / 18%);
}

.credential-compact {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto 128px;
  min-height: 70px;
  padding: 9px 12px;
}

.credential-summary-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: 44px minmax(180px, 1fr) minmax(280px, auto) auto;
  min-width: 0;
  padding: 0;
  text-align: left;
  width: 100%;
}

.credential-compact:hover {
  background: rgb(255 255 255 / 4%);
}

.credential-record.open .history-chevron {
  transform: rotate(180deg);
}

.credential-toggle {
  justify-self: end;
  min-width: 142px;
}

.credential-toggle .switch-label {
  font-size: 12px;
}

.credential-toggle-expanded {
  margin-bottom: 8px;
  width: 100%;
}

.credential-expanded {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 12px;
}

.credential-expanded[hidden] {
  display: none;
}

.credential-expanded section {
  background: rgb(255 255 255 / 3%);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 10px;
}

.credential-expanded h3 {
  color: #fff;
  font-size: 13px;
  margin: 0 0 8px;
}

.mini-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.mini-status span {
  background: rgb(148 163 184 / 16%);
  border: 1px solid rgb(148 163 184 / 22%);
  border-radius: 999px;
  color: #aab4c3;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
}

.mini-status span.done {
  background: rgb(23 209 121 / 13%);
  border-color: rgb(23 209 121 / 30%);
  color: #39e58e;
}

.mini-status span.missing {
  background: rgb(148 163 184 / 12%);
  border-color: rgb(148 163 184 / 20%);
  color: #8995a8;
}

.mini-status.modern {
  margin: 0;
}

.readonly-field {
  background: #07111f;
  color: #9aa6b8;
}

.search-wrap {
  position: relative;
}

.search-results {
  background: #07111f;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgb(0 0 0 / 34%);
  display: grid;
  left: 0;
  max-height: 280px;
  overflow: auto;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 10;
}

.search-result {
  background: transparent;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--text);
  display: grid;
  gap: 2px;
  padding: 10px;
  text-align: left;
}

.search-result:hover {
  background: rgb(11 108 255 / 12%);
}

.search-result span,
.search-empty {
  color: var(--muted);
  font-size: 12px;
}

.search-empty {
  padding: 10px;
}

.modal-backdrop {
  align-items: center;
  background: rgb(3 7 18 / 62%);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 22px;
  position: fixed;
  z-index: 30;
}

.dialog {
  background: #07111f;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgb(0 0 0 / 42%);
  max-height: min(860px, calc(100vh - 44px));
  max-width: 760px;
  overflow: auto;
  width: min(760px, 100%);
}

.dialog-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 18px;
}

.dialog-head h3 {
  margin: 0 0 4px;
}

.dialog-body {
  padding: 18px;
}

.dialog-actions {
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 18px;
}

.icon-button {
  min-width: 34px;
  padding: 6px 10px;
}

.detail-grid {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
}

.detail-grid div {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 6px;
  grid-template-columns: 160px minmax(0, 1fr);
  padding-bottom: 8px;
}

.detail-grid dt {
  color: var(--muted);
  font-size: 12px;
}

.detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.scope-box {
  background: rgb(255 255 255 / 3%);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
}

.scope-box strong {
  flex-basis: 100%;
}

.scope-box span {
  background: rgb(11 108 255 / 12%);
  border: 1px solid rgb(11 108 255 / 24%);
  border-radius: 999px;
  color: #6fb0ff;
  font-size: 12px;
  padding: 3px 8px;
}

.conflict-box {
  background: rgb(255 93 93 / 10%);
  border: 1px solid rgb(255 93 93 / 32%);
  border-radius: 8px;
  color: #ff8b8b;
  display: grid;
  gap: 4px;
  padding: 10px;
}

.conflict-box[hidden] {
  display: none;
}

.conflict-box span {
  color: #7f1d1d;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1180px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-rail {
    position: static;
  }
}

@media (max-width: 980px) {
  .stats,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .app-content {
    padding: 16px;
  }

  .detail-grid div {
    grid-template-columns: 1fr;
  }
}

/* Dark operational dashboard theme */
:root {
  color-scheme: dark;
  --bg: #03080f;
  --panel: #0b131e;
  --panel-soft: #111b27;
  --text: #f6f8fb;
  --muted: #8d98aa;
  --line: rgb(255 255 255 / 9%);
  --blue: #0b6cff;
  --blue-soft: rgb(11 108 255 / 14%);
  --green: #17d179;
  --green-soft: rgb(23 209 121 / 14%);
  --yellow: #f4b84a;
  --yellow-soft: rgb(244 184 74 / 14%);
  --red: #ff5d5d;
  --red-soft: rgb(255 93 93 / 14%);
  --gray: #6c7688;
  --ink: #f8fafc;
}

body {
  background: linear-gradient(180deg, #07111d 0, #03080f 360px), #03080f;
  color: var(--text);
}

.app-header {
  display: none;
}

.app-shell {
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell > .app-content {
  grid-column: 2;
  margin-left: 0;
}

.side-nav {
  background: linear-gradient(180deg, #07111d 0%, #050b13 100%);
  border-right: 1px solid rgb(255 255 255 / 10%);
  box-shadow: inset -1px 0 0 rgb(255 255 255 / 3%);
  bottom: 0;
  height: 100vh;
  left: 0;
  min-height: 0;
  overflow-y: hidden;
  padding: 24px 18px 18px;
  position: fixed;
  top: 0;
  width: 260px;
  z-index: 10;
}

.side-nav:hover,
.side-nav:focus-within {
  overflow-y: auto;
}

.side-brand {
  min-height: 50px;
  padding: 0 8px 18px;
}

.side-brand::before {
  content: none;
}

.side-brand strong,
.side-brand span {
  margin-left: 0;
}

.side-brand strong {
  color: #fff;
  font-size: 20px;
  letter-spacing: 0;
}

.side-brand span,
.side-user span,
.muted {
  color: #8d98aa;
}

.side-brand span {
  display: block;
  white-space: nowrap;
}

.tabs button,
.planned-nav button {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #b5bfce;
  display: flex;
  font-weight: 600;
  justify-content: flex-start;
  min-height: 40px;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}

.tabs button:hover {
  background: rgb(255 255 255 / 5%);
  color: #fff;
}

.tabs button.active {
  background: linear-gradient(135deg, #0b6cff, #075be0);
  border-color: rgb(255 255 255 / 12%);
  box-shadow: 0 16px 35px rgb(11 108 255 / 28%);
  color: #fff;
}

.planned-nav button {
  border: 0;
  color: #8d98aa;
  cursor: default;
  opacity: 0.74;
}

.planned-nav button span {
  display: none;
}

.side-user {
  border-top: 1px solid rgb(255 255 255 / 10%);
  padding: 22px 8px 0;
}

.app-content {
  padding: 30px 30px 34px;
}

.overview-shell {
  margin: 0 auto;
  max-width: 1580px;
}

.overview-top {
  align-items: flex-start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.overview-top h2 {
  font-size: 24px;
  line-height: 1.15;
  margin: 0 0 6px;
}

.overview-top p {
  color: #8d98aa;
  margin: 0;
}

.overview-controls,
.panel-title-row,
.job-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.overview-controls {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ghost-control {
  align-items: center;
  background: #0b131f;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 7px;
  color: #d8dee8;
  display: inline-flex;
  gap: 9px;
  min-height: 42px;
  padding: 10px 16px;
}

.metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  margin-bottom: 18px;
}

.stat {
  align-items: center;
  background: linear-gradient(180deg, rgb(255 255 255 / 5%), rgb(255 255 255 / 2%));
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 5%);
  display: grid;
  gap: 14px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 108px;
  padding: 20px;
  position: relative;
}

.stat-icon {
  border-radius: 50%;
  display: block;
  height: 46px;
  position: relative;
  width: 46px;
}

.stat-icon::after {
  border: 2px solid currentColor;
  border-radius: 50%;
  content: "";
  height: 16px;
  left: 13px;
  position: absolute;
  top: 13px;
  width: 16px;
}

.stat-icon.phone,
.stat-icon.call { background: rgb(23 209 121 / 15%); color: #17d179; }
.stat-icon.wave { background: rgb(139 92 246 / 18%); color: #a678ff; }
.stat-icon.check { background: rgb(23 209 121 / 16%); color: #17d179; }

.stat span {
  color: #c7d0dd;
  display: block;
  font-size: 13px;
}

.stat strong {
  color: #fff;
  display: block;
  font-size: 30px;
  line-height: 1.1;
  margin-top: 6px;
}

.stat small {
  color: #8d98aa;
  display: block;
  font-size: 12px;
  margin-top: 7px;
}

.stat em {
  align-self: end;
  color: #17d179;
  font-size: 12px;
  font-style: normal;
  position: absolute;
  right: 18px;
  top: 18px;
  white-space: nowrap;
}

.overview-body {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 320px;
  min-width: 0;
}

.overview-left {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, 0.85fr);
  min-width: 0;
}

.overview-left .activity-panel,
.overview-left .debug-panel {
  grid-column: 1 / -1;
}

.overview-right {
  align-content: start;
  display: grid;
  gap: 18px;
  min-width: 0;
}

.panel {
  background: linear-gradient(180deg, rgb(255 255 255 / 5%), rgb(255 255 255 / 2%));
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 8px;
  box-shadow: 0 22px 70px rgb(0 0 0 / 18%), inset 0 1px 0 rgb(255 255 255 / 5%);
  min-width: 0;
  padding: 20px;
}

.panel h2,
.panel h3 {
  color: #fff;
  font-size: 17px;
  margin: 0 0 14px;
}

.panel-title-row {
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-title-row h2 {
  margin: 0;
}

.panel-title-row a,
.panel-title-row span {
  color: #0b80ff;
  font-size: 13px;
  text-decoration: none;
}

.live-call-list,
.recent-list,
.activity-strip,
.health-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.live-panel {
  container-type: inline-size;
}

.live-call-row {
  align-items: center;
  background: rgb(255 255 255 / 3%);
  border: 1px solid rgb(255 255 255 / 4%);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(105px, 1fr) 34px minmax(105px, 1fr) 6.5ch minmax(124px, 170px);
  min-height: 76px;
  min-width: 0;
  overflow: hidden;
  padding: 14px;
}

.avatar {
  align-items: center;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  height: 38px;
  justify-content: center;
  width: 38px;
}
.avatar.blue { background: linear-gradient(135deg, #20568f, #233a66); }
.avatar.green { background: linear-gradient(135deg, #0b8653, #0b5c40); }
.avatar.violet { background: linear-gradient(135deg, #7c3aed, #5532a8); }
.avatar.red { background: linear-gradient(135deg, #a64040, #793131); }

.call-party {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.call-party strong,
.activity-item strong,
.recent-row strong {
  color: #fff;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-party span,
.activity-item span,
.recent-row span {
  color: #8d98aa;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-arrow,
.call-duration {
  color: #dce4ef;
}

.call-duration {
  display: inline-block;
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-variant-numeric: tabular-nums lining-nums;
  justify-self: center;
  min-width: 7ch;
  text-align: center;
  white-space: nowrap;
}

.call-arrow {
  align-items: center;
  background: rgb(255 255 255 / 4%);
  border: 1px solid rgb(255 255 255 / 6%);
  border-radius: 999px;
  display: inline-flex;
  font-size: 19px;
  font-weight: 800;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.call-arrow.outbound {
  color: #17d179;
}

.call-arrow.inbound {
  color: #6fb0ff;
}

.waveform {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  gap: 3px;
  height: 34px;
  justify-content: center;
  max-width: 116px;
  min-width: 64px;
  overflow: hidden;
  width: 100%;
}

.live-call-recording {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  justify-self: end;
  min-width: 0;
  width: 100%;
}

.waveform i {
  background: linear-gradient(180deg, #35ffad, #16d681);
  border-radius: 999px;
  display: block;
  height: 100%;
  transform: scaleY(0.15);
  transform-origin: center;
  flex: 0 0 4px;
  width: 4px;
  will-change: transform, opacity;
}

.waveform.idle {
  gap: 6px;
}

.waveform.idle i {
  height: 6px;
  opacity: 0.55;
  transform: none;
  width: 6px;
}

.waveform.recording i {
  opacity: 0.92;
}

.recording-state-icon {
  align-items: center;
  background: rgb(255 255 255 / 5%);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 50%;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  justify-self: end;
  flex: 0 0 auto;
  width: 44px;
}

.recording-state-icon.recording {
  background: rgb(23 209 121 / 18%);
  border-color: rgb(38 255 158 / 58%);
  box-shadow:
    0 0 0 5px rgb(23 209 121 / 12%),
    0 0 24px rgb(23 209 121 / 22%);
}

.recording-state-icon.external {
  background: rgb(148 163 184 / 12%);
  border-color: rgb(148 163 184 / 28%);
  box-shadow: 0 0 0 5px rgb(148 163 184 / 8%);
}

.recording-state-icon.idle {
  background: rgb(148 163 184 / 12%);
  border-color: rgb(148 163 184 / 22%);
}

.recording-state-icon img {
  display: block;
  height: 24px;
  object-fit: contain;
  width: 24px;
}

.recording-state-icon.recording img {
  filter:
    invert(93%) sepia(68%) saturate(772%) hue-rotate(82deg) brightness(106%) contrast(103%)
    drop-shadow(0 0 0 rgb(190 255 222))
    drop-shadow(0 0 6px rgb(23 209 121 / 95%));
  height: 29px;
  opacity: 1;
  width: 29px;
}

.recording-state-icon.external img {
  filter: invert(69%) sepia(10%) saturate(425%) hue-rotate(178deg) brightness(96%) contrast(86%);
}

.recording-state-icon.idle img {
  filter: invert(67%) sepia(9%) saturate(484%) hue-rotate(178deg) brightness(91%) contrast(86%);
}

.chart-panel {
  min-height: 420px;
}

.automation-flow-card {
  display: grid;
  gap: 14px;
}

.flow-week-strip {
  align-items: end;
  background: rgb(255 255 255 / 2%);
  border: 1px solid rgb(255 255 255 / 5%);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-height: 170px;
  padding: 12px 12px 10px;
  position: relative;
}

.flow-week-legend {
  display: flex;
  gap: 12px;
  grid-column: 1 / -1;
  justify-content: flex-end;
  margin-bottom: 2px;
}

.flow-week-legend span {
  align-items: center;
  color: #8d98aa;
  display: inline-flex;
  font-size: 10px;
  gap: 5px;
}

.flow-week-legend i {
  border-radius: 999px;
  display: inline-block;
  height: 7px;
  width: 7px;
}

.flow-week-legend i.last {
  background: #0b80ff;
}

.flow-week-legend i.current {
  background: #a855f7;
}

.flow-week-day {
  align-items: center;
  display: grid;
  gap: 4px;
  justify-items: center;
  min-width: 0;
}

.flow-week-bars {
  align-items: end;
  display: flex;
  gap: 4px;
  height: 100px;
}

.flow-week-bar {
  border-radius: 999px 999px 3px 3px;
  display: block;
  min-height: 3px;
  width: 11px;
}

.flow-week-bar.last {
  background: linear-gradient(180deg, #0b80ff, rgb(11 128 255 / 24%));
}

.flow-week-bar.current {
  background: linear-gradient(180deg, #c084fc, rgb(168 85 247 / 26%));
}

.flow-week-day.warn .flow-week-bar.current {
  box-shadow: 0 0 16px rgb(168 85 247 / 28%);
}

.flow-week-day strong,
.flow-week-day small {
  color: #8d98aa;
  font-size: 10px;
  line-height: 1;
}

.flow-week-day small {
  color: #f8fafc;
  font-weight: 800;
}

.flow-summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.flow-metric {
  background: rgb(255 255 255 / 3%);
  border: 1px solid rgb(255 255 255 / 6%);
  border-radius: 8px;
  color: inherit;
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 11px;
  text-decoration: none;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.flow-metric:hover {
  background: rgb(255 255 255 / 5%);
  border-color: rgb(255 255 255 / 14%);
  transform: translateY(-1px);
}

.flow-metric span,
.flow-metric small,
.flow-stage-head span,
.flow-focus span {
  color: #8d98aa;
}

.flow-metric span,
.flow-metric small {
  font-size: 11px;
  line-height: 1.2;
}

.flow-metric strong {
  color: #fff;
  font-size: 20px;
  line-height: 1;
}

.flow-metric.ok {
  background: rgb(23 209 121 / 8%);
  border-color: rgb(23 209 121 / 18%);
}

.flow-metric.active {
  background: rgb(11 128 255 / 8%);
  border-color: rgb(11 128 255 / 22%);
}

.flow-metric.warn {
  background: rgb(255 176 32 / 8%);
  border-color: rgb(255 176 32 / 24%);
}

.flow-stage-list {
  display: grid;
  gap: 10px;
}

.flow-stage {
  display: grid;
  gap: 7px;
}

.flow-stage-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.flow-stage-head strong {
  color: #f8fafc;
  font-size: 12px;
  min-width: 0;
}

.flow-stage-head span {
  font-size: 11px;
  white-space: nowrap;
}

.flow-progress {
  background: rgb(148 163 184 / 13%);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.flow-progress span {
  background: linear-gradient(90deg, #0b80ff, #19d37f);
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 0;
  transition: width 220ms ease;
}

.flow-stage.active .flow-progress span {
  background: linear-gradient(90deg, #0b80ff, #5db7ff);
  box-shadow: 0 0 18px rgb(11 128 255 / 38%);
}

.flow-stage.warn .flow-progress span {
  background: linear-gradient(90deg, #ffb020, #ff5e5e);
}

.flow-focus {
  align-items: center;
  background: rgb(255 255 255 / 3%);
  border: 1px solid rgb(255 255 255 / 6%);
  border-radius: 8px;
  color: inherit;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
  text-decoration: none;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.flow-focus:hover {
  background: rgb(255 255 255 / 5%);
  border-color: rgb(255 255 255 / 14%);
  transform: translateY(-1px);
}

.flow-focus strong {
  color: #fff;
  font-size: 12px;
}

.flow-focus span {
  font-size: 11px;
  text-align: right;
}

.flow-focus.ok {
  background: rgb(23 209 121 / 8%);
  border-color: rgb(23 209 121 / 18%);
}

.flow-focus.active {
  background: rgb(11 128 255 / 8%);
  border-color: rgb(11 128 255 / 22%);
}

.flow-focus.warn {
  background: rgb(255 176 32 / 8%);
  border-color: rgb(255 176 32 / 24%);
}

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

.activity-item {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
}

.activity-check {
  background: #64748b;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgb(100 116 139 / 12%);
  display: block;
  height: 14px;
  margin-top: 3px;
  width: 14px;
}

.activity-item.running .activity-check {
  background: #0b6cff;
  box-shadow: 0 0 0 4px rgb(11 108 255 / 14%), 0 0 18px rgb(11 108 255 / 30%);
}

.activity-item.failed .activity-check {
  background: #ff5d5d;
  box-shadow: 0 0 0 4px rgb(255 93 93 / 14%);
}

.activity-item small {
  color: #ff9b9b;
  grid-column: 2;
}

.activity-item .job-actions {
  grid-column: 2;
  margin-top: 6px;
  min-width: 0;
}

.activity-item .job-actions button,
.activity-item .job-actions a {
  min-height: 34px;
  padding: 8px 12px;
  white-space: nowrap;
}

.activity-panel {
  overflow: hidden;
}

.health-head {
  align-items: start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.health-head h2 {
  margin-bottom: 6px;
}

.system-ok,
.system-warn {
  color: #17d179;
  font-size: 13px;
  margin: 0;
}

.system-warn {
  color: #f4b84a;
}

.health-score {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
}

.health-score.ok {
  background: rgb(23 209 121 / 14%);
  color: #17d179;
}

.health-score.warn {
  background: rgb(244 184 74 / 14%);
  color: #f4b84a;
}

.health-row {
  align-items: center;
  border-top: 1px solid rgb(255 255 255 / 6%);
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 34px;
  padding-top: 10px;
}

.health-row strong {
  color: #17d179;
  font-size: 12px;
  text-align: right;
}

.health-dot.ok { background: #17d179; box-shadow: 0 0 0 4px rgb(23 209 121 / 12%); }
.health-dot.warn { background: #f4b84a; box-shadow: 0 0 0 4px rgb(244 184 74 / 12%); }

.recent-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.play-dot {
  background: #0b6cff;
  border-radius: 50%;
  display: block;
  height: 30px;
  position: relative;
  width: 30px;
}

.play-dot::after {
  border-bottom: 6px solid transparent;
  border-left: 9px solid #fff;
  border-top: 6px solid transparent;
  content: "";
  left: 12px;
  position: absolute;
  top: 9px;
}

.recent-row time {
  color: #8d98aa;
  font-size: 12px;
}

.worker-compact .worker-panel {
  margin: 0;
}

.worker-compact .compact-stats {
  grid-template-columns: 1fr 1fr;
}

.worker-panel .stat {
  background: linear-gradient(180deg, rgb(255 255 255 / 4%), rgb(255 255 255 / 2%));
  border-color: rgb(255 255 255 / 8%);
  display: block;
  min-height: 0;
  padding: 14px;
}

.worker-panel .stat-icon,
.worker-panel .stat small,
.worker-panel .stat em {
  display: none;
}

.worker-panel .stat strong {
  font-size: 20px;
  margin-top: 4px;
}

.debug-panel .debug-terminal {
  max-height: 180px;
}

.debug-terminal {
  background: #050b13;
  border: 1px solid rgb(255 255 255 / 7%);
  color: #80a6d9;
}

.badge {
  border-radius: 999px;
  min-height: 24px;
  min-width: 0;
  padding: 6px 10px;
}

.badge.gray { background: #4b5563; }
.badge.blue { background: #0b6cff; }
.badge.green { background: #0b8f58; }
.badge.yellow { background: #a66b13; }
.badge.red { background: #b93b3b; }

input,
select,
textarea {
  background: #07111d;
  border-color: rgb(255 255 255 / 10%);
  color: #f6f8fb;
}

button,
.button-link {
  background: #0b6cff;
  border-radius: 7px;
}

button.secondary,
.secondary-link {
  background: #152236;
  border: 1px solid rgb(255 255 255 / 9%);
}

.prompts-panel {
  display: grid;
  gap: 18px;
}

.prompt-section-heading {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.prompt-section-heading h3 {
  margin-bottom: 4px;
}

.prompt-profile-creator {
  border-style: dashed;
}

.prompt-profile-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.prompt-card,
.prompt-section {
  background: rgb(255 255 255 / 3%);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 18px;
}

.prompt-card-header {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.prompt-card-header h3,
.prompt-section h3,
.prompt-model-settings h4 {
  color: #fff;
  margin: 0 0 6px;
}

.prompt-card textarea,
.prompt-section textarea {
  min-height: 150px;
  resize: vertical;
}

.prompt-model-settings,
.prompt-model-summary,
.prompt-version-meta {
  background: rgb(0 0 0 / 16%);
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 8px;
  padding: 14px;
}

.prompt-model-summary,
.prompt-version-meta {
  color: #91a0b6;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.prompt-model-list {
  display: grid;
  gap: 14px;
}

.prompt-model-step {
  background: rgb(255 255 255 / 3%);
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 12px;
}

.prompt-model-step strong {
  color: #fff;
  font-size: 13px;
  text-transform: capitalize;
}

.role-mapping-list {
  display: grid;
  gap: 10px;
}

.role-mapping-row {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
}

.role-custom-input {
  margin-top: 8px;
  width: 100%;
}

.compact-switch {
  align-items: center;
  background: rgb(0 0 0 / 12%);
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
}

.compact-switch input {
  width: auto;
}

.runtime-settings-panel {
  display: grid;
  gap: 18px;
}

.runtime-hero {
  align-items: start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.runtime-hero h2 {
  font-size: 24px;
  margin-bottom: 6px;
}

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

.runtime-card {
  background:
    radial-gradient(circle at top right, rgb(11 108 255 / 12%), transparent 45%),
    rgb(255 255 255 / 3%);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  min-height: 112px;
  padding: 16px;
}

.runtime-card.primary {
  border-color: rgb(11 108 255 / 34%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 6%), 0 0 0 1px rgb(11 108 255 / 8%);
}

.runtime-card span,
.runtime-card p,
.runtime-card small {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.runtime-card strong {
  color: #fff;
  font-size: 18px;
  line-height: 1.2;
}

.runtime-form {
  display: grid;
  gap: 16px;
}

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

.monitor-mode {
  background: rgb(255 255 255 / 3%);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 8px;
  cursor: pointer;
  display: block;
  min-height: 118px;
  padding: 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.monitor-mode:hover {
  border-color: rgb(11 108 255 / 36%);
  transform: translateY(-1px);
}

.monitor-mode.selected {
  background:
    linear-gradient(135deg, rgb(11 108 255 / 20%), rgb(23 209 121 / 8%)),
    rgb(255 255 255 / 4%);
  border-color: rgb(11 108 255 / 62%);
  box-shadow: 0 0 0 1px rgb(11 108 255 / 28%), 0 18px 42px rgb(0 0 0 / 18%);
}

.monitor-mode input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.monitor-mode span {
  display: grid;
  gap: 8px;
}

.monitor-mode strong {
  color: #fff;
  font-size: 16px;
}

.monitor-mode small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.runtime-control-row {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
}

.runtime-control-row label {
  display: grid;
  gap: 7px;
}

.runtime-control-row label span,
.schedule-editor-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.runtime-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.schedule-editor {
  background: rgb(255 255 255 / 3%);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.schedule-editor-head {
  align-items: center;
  border-bottom: 1px solid rgb(255 255 255 / 7%);
  display: flex;
  justify-content: space-between;
  padding-bottom: 10px;
}

.schedule-editor-head h3 {
  margin: 0;
}

.schedule-day {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(190px, 1fr) 128px auto 128px;
}

.schedule-day .switch-field {
  background: rgb(255 255 255 / 2%);
  width: 100%;
}

.schedule-day input[type="time"] {
  min-height: 42px;
}

.schedule-day > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
}

.operations-panel {
  display: grid;
  gap: 18px;
}

.operations-hero {
  align-items: start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.operations-hero h2 {
  font-size: 24px;
  margin-bottom: 6px;
}

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

.ops-lane {
  background:
    radial-gradient(circle at top right, rgb(11 108 255 / 13%), transparent 46%),
    rgb(255 255 255 / 3%);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 18px;
}

.ops-lane h3 {
  font-size: 20px;
  margin: 0;
}

.ops-lane p {
  color: var(--muted);
  margin: 0;
}

.lane-kicker {
  color: #6fb0ff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.monitor-lane {
  border-color: rgb(23 209 121 / 22%);
}

.automation-lane {
  border-color: rgb(11 108 255 / 24%);
}

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

.ops-metrics div {
  background: rgb(0 0 0 / 14%);
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 8px;
  padding: 10px;
}

.ops-metrics span {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.ops-metrics strong {
  color: #fff;
  display: block;
  font-size: 18px;
  margin-top: 4px;
}

.queue-table {
  display: grid;
  gap: 8px;
}

.queue-head,
.queue-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 1.2fr) minmax(190px, 1fr) 110px 90px minmax(132px, 0.8fr) minmax(136px, auto);
}

.queue-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 12px;
}

.queue-row {
  background: rgb(255 255 255 / 3%);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 8px;
  min-height: 58px;
  padding: 10px 12px;
}

.queue-row small {
  color: #ff9b9b;
  grid-column: 1 / -1;
}

.queue-row .queue-context {
  color: var(--muted);
  display: block;
  grid-column: auto;
  margin-top: 3px;
}

.queue-open-button {
  min-height: 34px;
  padding: 0 12px;
}

.queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.queue-actions button {
  min-height: 34px;
  padding: 0 10px;
}

.queue-status {
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  justify-self: start;
  padding: 4px 10px;
}

.queue-status.queued { background: #475569; }
.queue-status.running { background: #0b6cff; }
.queue-status.failed { background: #b93b3b; }
.queue-status.completed { background: #0b8f58; }

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

.ops-terminal {
  background: rgb(0 0 0 / 16%);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
}

.ops-terminal .debug-terminal {
  max-height: 360px;
  min-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
}

.table-wrap,
.history-table th,
.history-table td,
.credential-card,
.status-card,
.dialog,
.search-results {
  background: #0b131e;
  border-color: rgb(255 255 255 / 9%);
  color: #f6f8fb;
}

.history-table th {
  color: #c7d0dd;
}

.history-table td {
  background: #0b131e;
  border-color: rgb(255 255 255 / 7%);
}

.metadata-line strong {
  color: #f6f8fb;
}

@media (max-width: 1180px) {
  .history-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .history-search-field {
    grid-column: 1 / -1;
  }

  .runtime-grid,
  .monitor-mode-grid,
  .ops-terminal-grid {
    grid-template-columns: 1fr 1fr;
  }

  .runtime-control-row {
    grid-template-columns: 1fr;
  }

  .runtime-presets {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .history-toolbar {
    grid-template-columns: 1fr;
  }

  .history-search-field {
    grid-column: auto;
  }

  .runtime-hero {
    display: grid;
  }

  .runtime-grid,
  .monitor-mode-grid,
  .ops-lanes,
  .ops-terminal-grid,
  .schedule-day {
    grid-template-columns: 1fr;
  }

  .schedule-day > span {
    text-align: left;
  }
}

@media (max-width: 1320px) {
  .overview-left {
    grid-template-columns: 1fr;
  }

  .overview-right {
    grid-template-columns: 1fr;
  }

  .worker-compact {
    grid-column: auto;
  }
}

@container (max-width: 820px) {
  .live-call-row {
    grid-template-columns: auto minmax(96px, 1fr) 34px minmax(96px, 1fr) 6.5ch minmax(112px, 148px);
  }
}

@container (max-width: 560px) {
  .live-call-row {
    grid-template-areas:
      "avatar internal arrow external duration"
      ". recording recording recording recording";
    grid-template-columns: auto minmax(0, 1fr) 38px minmax(0, 1fr) 7ch;
    min-height: 116px;
    row-gap: 10px;
  }

  .live-call-row .avatar {
    grid-area: avatar;
  }

  .live-call-row .internal-party {
    grid-area: internal;
  }

  .live-call-row .call-arrow {
    grid-area: arrow;
  }

  .live-call-row .external-party {
    grid-area: external;
  }

  .live-call-row .call-duration {
    grid-area: duration;
  }

  .live-call-recording {
    grid-area: recording;
    justify-self: stretch;
    padding-left: 52px;
  }

  .live-call-recording .waveform {
    max-width: none;
  }
}

@media (max-width: 1120px) {
  .overview-body {
    grid-template-columns: 1fr;
  }

  .overview-right {
    grid-template-columns: 1fr 1fr;
  }

  .worker-compact {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .auth-page {
    align-items: stretch;
    overflow-x: hidden;
    padding: 18px;
  }

  .auth-card {
    border-radius: 8px;
    gap: 28px;
    grid-template-columns: 1fr;
    justify-self: center;
    max-width: calc(100vw - 36px);
    min-height: 0;
    padding: 30px;
    width: auto;
  }

  .auth-brand {
    margin-bottom: 34px;
  }

  .auth-copy h1 {
    font-size: 38px;
  }

  .auth-copy p {
    font-size: 16px;
  }

  .auth-button {
    max-width: 100%;
    width: 100%;
  }

  .auth-visual {
    aspect-ratio: 1.9;
    border-radius: 8px;
    order: -1;
    width: 100%;
  }

  .auth-orbit {
    gap: 10px;
    grid-template-columns: repeat(5, 48px);
  }

  .auth-node {
    border-radius: 13px;
    grid-column: auto !important;
    height: 48px;
    width: 48px;
  }

  .auth-node img {
    height: 30px;
    width: 30px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-shell > .app-content {
    grid-column: 1;
    margin-left: 0;
  }

  .side-nav {
    bottom: auto;
    height: auto;
    left: auto;
    min-height: 0;
    overflow-y: visible;
    position: static;
    top: auto;
    width: auto;
  }

  .metric-grid,
  .activity-strip,
  .overview-right {
    grid-template-columns: 1fr;
  }

  .overview-top {
    align-items: stretch;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .auth-page {
    padding: 18px;
  }

  .auth-card {
    justify-self: start;
    max-width: none;
    padding: 24px;
    width: 354px;
  }

  .auth-copy h1 {
    font-size: 36px;
  }

  .auth-visual {
    aspect-ratio: 1.55;
  }

  .auth-orbit {
    gap: 8px;
    grid-template-columns: repeat(5, 40px);
  }

  .auth-node {
    height: 40px;
    width: 40px;
  }

  .auth-node img {
    height: 26px;
    width: 26px;
  }
}

@media (max-width: 380px) {
  .auth-card {
    width: 324px;
  }

  .auth-copy h1 {
    font-size: 33px;
  }
}
