:root {
  --slate-950: #020617;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --cyan-500: #06b6d4;
  --cyan-400: #22d3ee;
  --cyan-300: #67e8f9;
  --blue-600: #2563eb;
  --emerald-400: #34d399;
  --amber-400: #fbbf24;
  --error-bg: rgba(127, 29, 29, 0.35);
  --error-text: #fca5a5;
  --brand-logo-filter: invert(1) brightness(1.22) contrast(1.08) drop-shadow(0 0 10px rgba(96, 165, 250, 0.16));
  --brand-logo-height: 52px;
  --radius: 12px;
  --bot-control-content-max-width: 1440px;
  font-family: ui-sans-serif, system-ui, 'Segoe UI', Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--slate-200);
  line-height: 1.5;
}

::selection {
  background: rgba(6, 182, 212, 0.3);
  color: var(--cyan-400);
}

.lg-hidden {
  display: block;
}

@media (min-width: 1024px) {
  .lg-hidden {
    display: none;
  }
}

/* ——— Brand ——— */

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.25rem 0.45rem;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(2, 6, 23, 0.56)),
    rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(96, 165, 250, 0.16);
  border-radius: 0.75rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 24px rgba(2, 6, 23, 0.22);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.brand:hover,
.brand:focus-visible {
  border-color: rgba(96, 165, 250, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 12px 28px rgba(2, 6, 23, 0.28);
}

.brand-logo {
  display: block;
  width: auto;
  height: var(--brand-logo-height);
  max-width: 220px;
  filter: var(--brand-logo-filter);
  opacity: 1;
  object-fit: contain;
  object-position: left center;
}

.brand-product {
  display: inline-flex;
  align-items: center;
  padding-left: 0.7rem;
  color: var(--slate-300);
  border-left: 1px solid rgba(96, 165, 250, 0.18);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(34, 211, 238, 0.25);
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.15);
}

.brand-mark img {
  display: block;
  width: 2rem;
  height: 2rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand-name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #fff;
  line-height: 1.1;
}

.brand-tag {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan-400);
}

/* ——— Icons ——— */

.icon-inline,
.input-icon,
.stat-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-inline svg,
.input-icon svg,
.stat-icon-wrap svg {
  width: 1.125rem;
  height: 1.125rem;
  stroke: currentColor;
}

.input-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-500);
  pointer-events: none;
}

.stat-icon-wrap {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.8);
}

.stat-icon-wrap--green {
  color: var(--emerald-400);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.stat-icon-wrap--amber {
  color: var(--amber-400);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.icon-spin svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ——— Login page ——— */

.login-page {
  background: var(--slate-950);
}

.login-shell {
  display: flex;
  min-height: 100vh;
}

.login-visual {
  display: none;
  position: relative;
  width: 50%;
  flex-direction: column;
  overflow: hidden;
  background: #0b1121;
  border-right: 1px solid rgba(30, 41, 59, 0.6);
}

@media (min-width: 1024px) {
  .login-visual {
    display: flex;
  }
}

.login-visual-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(128, 128, 128, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(128, 128, 128, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
}

.login-visual-glow {
  position: absolute;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
}

.login-visual-glow--cyan {
  top: 25%;
  left: -8rem;
  background: rgba(8, 145, 178, 0.2);
}

.login-visual-glow--blue {
  bottom: 25%;
  right: -8rem;
  background: rgba(37, 99, 235, 0.2);
}

.login-visual-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 2.5rem 3rem;
  gap: 2rem;
}

.login-visual-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 28rem;
}

.bot-showcase {
  position: relative;
  width: 7rem;
  height: 7rem;
  margin-bottom: 1.75rem;
}

.bot-showcase-img {
  position: relative;
  z-index: 2;
  width: 6rem;
  height: 6rem;
  margin: 0.5rem;
  filter: drop-shadow(0 0 20px rgba(34, 211, 238, 0.45));
}

.bot-showcase-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 50%;
  animation: bot-pulse 3s ease-out infinite;
}

.bot-showcase-ring--delay {
  animation-delay: 1.5s;
}

@keyframes bot-pulse {
  0% {
    transform: scale(0.85);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.hero-title {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

.hero-gradient {
  background: linear-gradient(to right, var(--cyan-400), #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-text {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--slate-400);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(12px);
  border: 1px solid var(--slate-800);
  border-radius: var(--radius);
}

.stat-label {
  margin: 0 0 0.2rem;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--slate-500);
}

.stat-value {
  margin: 0;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.terminal-panel {
  margin-top: auto;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(30, 41, 59, 0.8);
  border-radius: 0.5rem;
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--slate-800);
  color: var(--slate-500);
  font-size: 0.75rem;
}

.terminal-body {
  max-height: 7rem;
  overflow-y: auto;
}

.terminal-line {
  margin: 0.15rem 0;
  color: var(--slate-400);
}

.terminal-line--cyan {
  color: var(--cyan-400);
}

.terminal-line--error {
  color: #f87171;
  font-weight: 600;
}

.terminal-line--warn {
  color: var(--amber-400);
}

.login-form-panel {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

@media (min-width: 640px) {
  .login-form-panel {
    padding: 2.5rem 3rem;
  }
}

.login-form-wrap {
  width: 100%;
  max-width: 28rem;
}

.login-mobile-brand {
  margin-bottom: 2rem;
}

.login-form-header {
  margin-bottom: 1.75rem;
  text-align: center;
}

.login-form-header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
}

.login-form-header p {
  margin: 0;
  color: var(--slate-400);
  font-size: 0.95rem;
}

.method-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  margin-bottom: 1.5rem;
  background: var(--slate-900);
  border: 1px solid var(--slate-800);
  border-radius: 0.5rem;
}

.method-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--slate-400);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.method-tab:hover {
  color: var(--slate-200);
}

.method-tab.is-active {
  color: #fff;
  background: var(--slate-800);
  border-color: var(--slate-700);
}

.method-panel.is-hidden {
  display: none;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-300);
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.65rem;
  font-size: 0.875rem;
  color: var(--slate-200);
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--slate-800);
  border-radius: 0.75rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-mono {
  font-family: ui-monospace, monospace;
}

.input-wrap input::placeholder {
  color: var(--slate-600);
}

.input-wrap input:focus {
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12);
}

.input-apikey {
  color: var(--cyan-400);
  letter-spacing: 0.05em;
}

.field-hint {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: var(--slate-500);
}

.btn-connect {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.875rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(to right, #0891b2, var(--blue-600));
  border: 1px solid transparent;
  border-radius: 0.75rem;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.25);
  transition: box-shadow 0.2s, opacity 0.2s, transform 0.15s;
}

.btn-connect:hover:not(:disabled) {
  background: linear-gradient(to right, var(--cyan-500), #3b82f6);
  box-shadow: 0 0 28px rgba(6, 182, 212, 0.45);
  transform: translateY(-1px);
}

.btn-connect:disabled {
  opacity: 0.85;
  cursor: wait;
}

.btn-connect span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.is-hidden {
  display: none !important;
}

.login-security {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1.75rem;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--slate-500);
}

.login-security .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--slate-500);
  margin: 0 0.25rem;
}

.version-tag {
  color: var(--emerald-400);
}

/* Unified login screen: one professional backdrop with the auth card centered. */

.login-page {
  overflow: hidden;
}

.login-theme-bar {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 20;
}

.login-theme-bar .theme-toggle-btn {
  color: var(--slate-300);
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.28);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.28);
}

.login-theme-bar .theme-toggle-btn:hover,
.login-theme-bar .theme-toggle-btn:focus-visible {
  color: #f8fafc;
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(148, 163, 184, 0.45);
}

.login-page .login-shell {
  position: relative;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.22), transparent 28rem),
    linear-gradient(180deg, #0f172a 0%, #020617 100%);
}

.login-page .login-visual {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  border-right: 0;
  border-radius: 0;
  pointer-events: none;
}

.login-page .login-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(37, 99, 235, 0.12), transparent 34rem),
    linear-gradient(180deg, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0.72));
}

.login-page .login-visual-inner {
  display: none;
}

.login-page .login-form-panel {
  position: relative;
  z-index: 1;
  flex: none;
  width: min(100%, 28rem);
  padding: 0;
}

.login-page .login-form-wrap {
  position: relative;
  max-width: none;
  padding: 2rem;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 1rem;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(18px);
}

.login-page .login-form-wrap::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0.25rem;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.9), transparent);
  opacity: 0.75;
}

.login-page .login-form-wrap > * {
  position: relative;
  z-index: 1;
}

.abstract-logo {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
}

.abstract-logo .circle {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.abstract-logo .circle-1 {
  width: 100%;
  height: 100%;
  border: 2px solid rgba(96, 165, 250, 0.92);
  border-top-color: transparent;
  animation: jarvis-ring-spin 8s linear infinite;
}

.abstract-logo .circle-2 {
  width: 75%;
  height: 75%;
  border: 2px solid rgba(96, 165, 250, 0.58);
  border-right-color: transparent;
  animation: jarvis-ring-spin-reverse 6s linear infinite;
}

.abstract-logo .circle-3 {
  width: 50%;
  height: 50%;
  background: rgba(96, 165, 250, 0.22);
  border: 1px solid rgba(147, 197, 253, 0.55);
}

@keyframes jarvis-ring-spin {
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes jarvis-ring-spin-reverse {
  100% {
    transform: translate(-50%, -50%) rotate(-360deg);
  }
}

.login-page .login-form-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
  text-align: center;
}

.login-page .login-form-header h1 {
  margin: 0 0 0.35rem;
  color: #f8fafc;
  font-family: ui-sans-serif, system-ui, 'Segoe UI', Roboto, sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.1;
  text-align: center;
  /* Compensate letter-spacing so the title looks optically centered */
  padding-inline-start: 0.14em;
}

.login-page .login-form-header p {
  max-width: none;
  margin: 0;
  color: #60a5fa;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-align: center;
  padding-inline-start: 0.25em;
}

.login-page .login-form {
  gap: 1.25rem;
}

.login-page .input-wrap {
  position: static;
}

.login-page .input-wrap input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.72rem 1rem;
  color: #f8fafc;
  background: rgba(30, 41, 59, 0.88);
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 0.65rem;
  font-family: inherit;
  font-size: 0.95rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.login-page .input-wrap input:hover {
  border-color: rgba(96, 165, 250, 0.32);
}

.login-page .input-wrap input:focus {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(96, 165, 250, 0.85);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.24);
}

.login-page .input-wrap input::placeholder {
  color: #64748b;
}

.login-page .btn-connect {
  width: 100%;
  min-height: 3.3rem;
  margin-top: 0.75rem;
  border-radius: 0.65rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: #2563eb;
  box-shadow: 0 16px 28px rgba(37, 99, 235, 0.28);
}

.login-page .btn-connect:hover:not(:disabled) {
  background: #1d4ed8;
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.34);
}

.login-page .otp-step {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-page .otp-setup-box {
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.55);
  text-align: center;
}

.login-page .otp-setup-title {
  margin: 0 0 0.75rem;
  color: #e2e8f0;
  font-size: 0.9rem;
  font-weight: 600;
}

.login-page .otp-qr-image {
  display: block;
  max-width: 12.5rem;
  max-height: 12.5rem;
  margin: 0 auto 0.75rem;
  padding: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 0.5rem;
  background: #ffffff;
}

.login-page .otp-setup-hint {
  margin: 0 0 0.4rem;
  color: #94a3b8;
  font-size: 0.75rem;
}

.login-page .otp-manual-key {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(2, 6, 23, 0.55);
  color: #e2e8f0;
  font-size: 0.75rem;
  line-height: 1.4;
  word-break: break-all;
}

.login-page .login-security {
  justify-content: center;
  gap: 0.55rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  color: #94a3b8;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0;
}

.login-security-icon {
  display: inline-flex;
  color: #60a5fa;
}

.login-security-icon svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  stroke-width: 1.8;
}

@media (min-width: 640px) {
  .login-page .login-shell {
    padding: 1rem;
  }

  .login-page .login-form-wrap {
    padding: 2.5rem;
  }
}

.alert {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.alert-error {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid rgba(127, 29, 29, 0.6);
}

/* ——— Dashboard ——— */

.dashboard-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--slate-950);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: #0b1121;
  border-bottom: 1px solid var(--slate-800);
}

.sidebar-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  color: var(--slate-400);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.sidebar-toggle-btn:hover,
.sidebar-toggle-btn:focus-visible {
  color: #fff;
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(34, 211, 238, 0.18);
  outline: none;
}

.sidebar-toggle-btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

html[data-sidebar-collapsed="true"] .sidebar-toggle-btn {
  color: var(--cyan-400);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--slate-400);
}

/* Shared chip look: same height/padding/radius; width follows label text. */
.topbar-user .theme-toggle-btn,
.topbar-user .tv-overview-link,
.topbar-user .topbar-user-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-sizing: border-box;
  width: auto;
  min-width: 0;
  height: 2.25rem;
  min-height: 2.25rem;
  padding: 0 0.85rem;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  border-radius: 0.5rem;
  border: 1px solid rgba(34, 211, 238, 0.42);
  background:
    linear-gradient(180deg, rgba(8, 145, 178, 0.28), rgba(14, 165, 233, 0.16)),
    rgba(15, 23, 42, 0.72);
  color: #ecfeff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(6, 182, 212, 0.08);
  flex: 0 0 auto;
}

.topbar-user .theme-toggle-btn,
.topbar-user .tv-overview-link,
.topbar-user .topbar-user-menu-trigger {
  color: #ecfeff;
}

.topbar-user .theme-toggle-btn:hover,
.topbar-user .theme-toggle-btn:focus-visible,
.topbar-user .tv-overview-link:hover,
.topbar-user .tv-overview-link:focus-visible,
.topbar-user .topbar-user-menu-trigger:hover,
.topbar-user .topbar-user-menu-trigger:focus-visible,
.topbar-user-menu.is-open .topbar-user-menu-trigger {
  color: #ffffff;
  border-color: rgba(34, 211, 238, 0.7);
  background:
    linear-gradient(180deg, rgba(8, 145, 178, 0.4), rgba(14, 165, 233, 0.24)),
    rgba(15, 23, 42, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 16px rgba(6, 182, 212, 0.18);
  outline: none;
}

.topbar-user .theme-toggle-label,
.topbar-user .topbar-user-menu-label {
  color: inherit;
  font-weight: inherit;
}

.topbar-user .icon-inline {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  opacity: 1;
}

.topbar-user .theme-toggle-btn .icon-inline,
.topbar-user .tv-overview-link .icon-inline,
.topbar-user .topbar-user-menu-trigger .icon-inline {
  color: var(--cyan-300);
}

.topbar-user .icon-inline svg {
  width: 1rem;
  height: 1rem;
}

.theme-toggle-btn {
  gap: 0.4rem;
  padding: 0.42rem 0.8rem;
  white-space: nowrap;
  line-height: 1.2;
}

a.tv-overview-link {
  text-decoration: none;
  color: inherit;
}

a.tv-overview-link:hover,
a.tv-overview-link:focus-visible {
  text-decoration: none;
}

.theme-toggle-label {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.topbar-user-menu {
  position: relative;
  flex: 0 0 auto;
}

.topbar-user-menu-label {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-user-menu-caret {
  opacity: 0.75;
  transition: transform 0.15s ease;
}

.topbar-user-menu.is-open .topbar-user-menu-caret {
  transform: rotate(180deg);
}

.topbar-user-menu-panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 80;
  min-width: 10.5rem;
  padding: 0.35rem;
  background: #0f172a;
  border: 1px solid var(--slate-800);
  border-radius: 0.6rem;
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.45);
}

.topbar-user-menu-form {
  margin: 0;
  display: block;
}

.topbar-user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.topbar-user-menu-item .icon-inline {
  width: 1rem;
  height: 1rem;
  color: inherit;
}

.topbar-user-menu-item .icon-inline svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
}

.topbar-user-menu-item.topbar-logout-button {
  color: #fca5a5;
}

.topbar-user-menu-item.topbar-logout-button .icon-inline {
  color: inherit;
}

.topbar-user-menu-item.topbar-logout-button:hover,
.topbar-user-menu-item.topbar-logout-button:focus-visible {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.32);
  border-color: rgba(248, 113, 113, 0.42);
  outline: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s, opacity 0.15s;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(to right, #0891b2, var(--blue-600));
  border: none;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.2);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ghost {
  color: var(--slate-400);
  background: transparent;
  border: 1px solid var(--slate-800);
}

.btn-ghost:hover {
  color: var(--slate-200);
  border-color: var(--slate-600);
}

.panel {
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--slate-800);
  border-radius: var(--radius);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.panel-head h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.125rem;
  color: #fff;
}

.panel-icon svg {
  color: var(--cyan-400);
}

.badge {
  display: inline-flex;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 999px;
}

.badge-muted {
  color: var(--slate-400);
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--slate-700);
}

/* ——— Bot Control workspace ——— */

.bot-control-layout {
  --bot-sidebar-width: 18rem;
  --bot-sidebar-width-collapsed: 3.5rem;
  display: grid;
  grid-template-columns: var(--bot-sidebar-width) minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  transition: grid-template-columns 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-sidebar-collapsed="true"] .bot-control-layout {
  grid-template-columns: var(--bot-sidebar-width-collapsed) minmax(0, 1fr);
}

.bot-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
  padding: 1.25rem;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.96)),
    #0b1121;
  border-right: 1px solid var(--slate-800);
  box-shadow: 12px 0 32px rgba(2, 6, 23, 0.28);
  transition:
    padding 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    gap 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.28s ease;
}

html[data-sidebar-collapsed="true"] .bot-sidebar {
  align-items: center;
  gap: 0;
  padding: 0.85rem 0.4rem;
  box-shadow: 6px 0 18px rgba(2, 6, 23, 0.2);
}

.bot-sidebar-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  width: 100%;
  margin: -0.15rem 0 0;
}

html[data-sidebar-collapsed="true"] .bot-sidebar-toolbar {
  margin: 0;
}

.bot-sidebar-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 1.25rem;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.18s ease;
}

html[data-sidebar-collapsed="true"] .bot-sidebar-body {
  display: none;
}

.bot-search label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate-500);
}

.bot-search .input-wrap input {
  padding-block: 0.72rem;
  background: rgba(2, 6, 23, 0.38);
}

.bot-sidebar-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem;
  background: rgba(2, 6, 23, 0.36);
  border: 1px solid var(--slate-800);
  border-radius: var(--radius);
}

.bot-sidebar-head h2 {
  margin: 0;
  font-size: 1rem;
  color: #fff;
}

.bot-sidebar-head p {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--slate-500);
}

.bot-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 1rem;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.bot-overview-link {
  justify-content: flex-start;
}

.bot-nav-title {
  margin: 0.25rem 0 0;
  padding: 0.55rem 0.35rem 0.45rem;
  border-bottom: 1px solid rgba(34, 211, 238, 0.18);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
}

#bot-nav-groups {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.bot-nav-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-left: 0.45rem;
}

.bot-nav-section h3 {
  margin: 0 0 0.25rem;
  padding: 0 0.35rem 0.45rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-500);
}

.bot-nav-category-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.25rem 0.35rem 0.45rem;
  color: var(--slate-100);
  font-family: inherit;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-bottom-color: rgba(148, 163, 184, 0.12);
  border-radius: 0;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, color 0.16s;
}

.bot-nav-category-toggle:hover,
.bot-nav-category-toggle:focus-visible {
  color: #fff;
  background: transparent;
  border-bottom-color: rgba(34, 211, 238, 0.22);
  outline: none;
}

.bot-nav-category-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--slate-300);
  transition: transform 0.18s, color 0.18s;
}

.bot-nav-category-arrow svg {
  width: 0.95rem;
  height: 0.95rem;
}

.bot-nav-section.is-open .bot-nav-category-arrow {
  color: var(--cyan-400);
  transform: rotate(90deg);
}

.bot-nav-category-label {
  min-width: 0;
  overflow: hidden;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.bot-nav-category-count {
  min-width: 1.55rem;
  padding: 0.1rem 0.4rem;
  color: var(--slate-300);
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.bot-nav-category-list {
  display: grid;
  gap: 0.25rem;
  /* Must fit every registered bot in the category (Support has 12+).
     Old 32rem clipped the last ~2 links while the badge still showed the full count. */
  max-height: 120rem;
  margin-top: 0.25rem;
  overflow: hidden;
  opacity: 1;
  transition: max-height 0.22s ease, opacity 0.18s ease, margin-top 0.18s ease;
}

.bot-nav-section.is-collapsed .bot-nav-category-list {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  pointer-events: none;
}

.bot-nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.75rem 0.8rem;
  color: var(--slate-300);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.16s, border-color 0.16s, color 0.16s, transform 0.16s;
}

.bot-nav-category-list .bot-nav-link {
  padding: 0.68rem 0.8rem 0.68rem 1.65rem;
  color: var(--slate-500);
  border-radius: 0.75rem;
}

.bot-nav-link svg {
  width: 1rem;
  height: 1rem;
}

.bot-nav-link:hover {
  color: #fff;
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(34, 211, 238, 0.18);
  transform: translateX(2px);
}

.bot-nav-link.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(8, 145, 178, 0.28), rgba(37, 99, 235, 0.18));
  border-color: rgba(34, 211, 238, 0.32);
  box-shadow: inset 3px 0 0 var(--cyan-400), 0 10px 24px rgba(6, 182, 212, 0.08);
}

.bot-nav-category-list .bot-nav-link.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(8, 145, 178, 0.34), rgba(37, 99, 235, 0.22));
  border-color: rgba(34, 211, 238, 0.34);
  box-shadow: inset 3px 0 0 var(--cyan-400), 0 8px 18px rgba(6, 182, 212, 0.1);
}

.bot-sidebar-system {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.sidebar-logout-form {
  margin: 0;
}

.sidebar-logout-button {
  justify-content: flex-start;
  color: #fca5a5;
}

.sidebar-logout-button .icon-inline {
  color: inherit;
}

.sidebar-logout-button .icon-inline svg {
  stroke: currentColor;
}

.sidebar-logout-button:hover,
.sidebar-logout-button:focus-visible {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.32);
  border-color: rgba(248, 113, 113, 0.42);
}

.sidebar-logout-button:hover .icon-inline,
.sidebar-logout-button:focus-visible .icon-inline {
  color: inherit;
}

.sidebar-empty {
  margin: 0;
  padding: 0.85rem;
  color: var(--slate-500);
  background: rgba(2, 6, 23, 0.32);
  border: 1px dashed var(--slate-800);
  border-radius: 0.75rem;
  font-size: 0.85rem;
}

.bot-workspace {
  min-width: 0;
  padding: clamp(1.25rem, 2vw, 2rem);
  overflow-y: auto;
}

.bot-detail-panel {
  width: 100%;
  max-width: var(--bot-control-content-max-width);
  margin: 0 auto;
}

.overview-panel {
  width: 100%;
  max-width: var(--bot-control-content-max-width);
  margin: 0 auto;
}

.panel-subtitle {
  margin: 0.35rem 0 0;
  color: var(--slate-400);
  font-size: 0.9rem;
}

.overview-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.overview-stat-card {
  position: relative;
  min-height: 6.1rem;
  padding: 1rem;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.08), transparent 34%),
    rgba(2, 6, 23, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 0.85rem;
}

.overview-stat-card strong {
  display: block;
  margin-top: 0.2rem;
  color: #fff;
  font-size: 1.55rem;
  line-height: 1.2;
}

.overview-stat-card p {
  margin: 0.35rem 0 0;
  color: var(--slate-400);
  font-size: 0.78rem;
}

.overview-stat-icon {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
}

.overview-stat-icon svg {
  width: 1rem;
  height: 1rem;
}

.overview-stat-card--total {
  border-color: rgba(34, 211, 238, 0.16);
}

.overview-stat-card--total .overview-stat-icon {
  color: var(--cyan-400);
  background: rgba(8, 145, 178, 0.2);
}

.overview-stat-card--active {
  border-color: rgba(52, 211, 153, 0.16);
}

.overview-stat-card--active .overview-stat-icon {
  color: var(--emerald-400);
  background: rgba(6, 78, 59, 0.32);
}

.overview-stat-card--active strong {
  color: var(--emerald-400);
}

.overview-stat-card--failed {
  border-color: rgba(248, 113, 113, 0.18);
}

.overview-stat-card--failed .overview-stat-icon {
  color: var(--error-text);
  background: rgba(127, 29, 29, 0.35);
}

.overview-stat-card--failed strong {
  color: #f87171;
}

.overview-stat-card--pending {
  border-color: rgba(251, 191, 36, 0.18);
}

.overview-stat-card--pending .overview-stat-icon {
  color: var(--amber-400);
  background: rgba(120, 53, 15, 0.34);
}

.overview-stat-card--pending strong {
  color: var(--amber-400);
}

.system-health-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.system-health-checked-at {
  color: var(--slate-500);
  font-size: 0.78rem;
}

.system-health-badge {
  border: 1px solid transparent;
  text-transform: capitalize;
}

.system-health-badge--healthy,
.system-health-card-badge--healthy {
  color: var(--emerald-400);
  background: rgba(6, 78, 59, 0.28);
  border-color: rgba(52, 211, 153, 0.28);
}

.system-health-badge--warning,
.system-health-card-badge--warning {
  color: var(--amber-400);
  background: rgba(120, 53, 15, 0.28);
  border-color: rgba(251, 191, 36, 0.28);
}

.system-health-badge--critical,
.system-health-card-badge--critical {
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.28);
  border-color: rgba(248, 113, 113, 0.28);
}

.system-health-badge--unknown,
.system-health-card-badge--unknown {
  color: var(--slate-300);
  background: rgba(51, 65, 85, 0.42);
  border-color: rgba(148, 163, 184, 0.2);
}

.system-health-message {
  margin-bottom: 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--slate-800);
  border-radius: 0.75rem;
  background: rgba(2, 6, 23, 0.35);
  color: var(--slate-300);
  font-size: 0.88rem;
}

.system-health-message--loading {
  color: var(--amber-400);
  border-color: rgba(251, 191, 36, 0.22);
  background: rgba(120, 53, 15, 0.14);
}

.system-health-message--error {
  color: var(--error-text);
  border-color: rgba(248, 113, 113, 0.28);
  background: var(--error-bg);
}

.system-health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.system-health-card {
  min-width: 0;
  padding: 1rem;
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.06), transparent 36%),
    rgba(2, 6, 23, 0.35);
  border: 1px solid var(--slate-800);
  border-radius: 0.85rem;
}

.system-health-card--healthy {
  border-color: rgba(52, 211, 153, 0.22);
}

.system-health-card--warning {
  border-color: rgba(251, 191, 36, 0.24);
}

.system-health-card--critical {
  border-color: rgba(248, 113, 113, 0.28);
}

.system-health-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.system-health-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--cyan-400);
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(34, 211, 238, 0.14);
  border-radius: 999px;
}

.system-health-card-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.system-health-card h3,
.overview-table-wrap h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  color: #fff;
}

.system-health-card p {
  margin: 0;
  color: var(--slate-400);
  font-size: 0.85rem;
}

.system-health-card-badge {
  display: inline-flex;
  width: fit-content;
  padding: 0.22rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.system-health-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.system-health-detail {
  min-width: 0;
  padding: 0.65rem;
  background: rgba(15, 23, 42, 0.46);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 0.65rem;
}

.system-health-detail-value {
  display: block;
  color: var(--slate-200);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.system-health-detail-value--healthy {
  color: var(--emerald-400);
}

.system-health-detail-value--warning {
  color: var(--amber-400);
}

.system-health-detail-value--critical {
  color: var(--error-text);
}

.system-health-detail-value--unknown {
  color: var(--slate-400);
}

.system-health-error {
  margin-top: 1rem !important;
  padding: 0.75rem;
  color: var(--error-text) !important;
  background: var(--error-bg);
  border: 1px solid rgba(248, 113, 113, 0.24);
  border-radius: 0.65rem;
  overflow-wrap: anywhere;
}

.bot-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--slate-800);
  border-radius: 0.85rem;
}

.overview-table-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, 1fr));
  gap: 0.75rem;
  margin: 0.85rem 0 1rem;
  padding: 0.85rem;
  background: rgba(15, 23, 42, 0.38);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 0.85rem;
}

.overview-filter {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.overview-filter span {
  color: var(--slate-500);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.overview-filter input,
.overview-filter select {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.58rem 0.75rem;
  color: var(--slate-200);
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid var(--slate-700);
  border-radius: 0.7rem;
  outline: none;
}

.overview-search-input-wrap .input-icon {
  left: auto;
  right: 0.85rem;
}

.overview-search-input-wrap input {
  padding-left: 0.75rem;
  padding-right: 2.65rem;
}

.overview-filter input:focus,
.overview-filter select:focus {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.bot-overview-table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
  background: rgba(2, 6, 23, 0.25);
}

.bot-overview-table th,
.bot-overview-table td {
  padding: 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  text-align: left;
  font-size: 0.85rem;
}

.bot-overview-table th {
  color: var(--slate-400);
  background: rgba(15, 23, 42, 0.55);
  font-weight: 700;
  white-space: nowrap;
}

.bot-overview-table td {
  color: var(--slate-300);
  vertical-align: top;
}

.bot-overview-table tbody tr {
  cursor: pointer;
  outline: none;
  transition: background 0.15s, box-shadow 0.15s;
}

.bot-overview-table tbody tr:hover,
.bot-overview-table tbody tr:focus-visible {
  background: rgba(15, 23, 42, 0.55);
}

.bot-overview-table tbody tr:focus-visible {
  box-shadow: inset 3px 0 0 var(--cyan-400);
}

.bot-overview-table tbody tr:last-child td {
  border-bottom: 0;
}

.bot-overview-index-col,
.bot-overview-index-cell {
  width: 3.25rem;
  text-align: center !important;
}

.bot-overview-index-cell {
  color: var(--slate-500) !important;
  font-weight: 800;
}

.bot-overview-name-cell {
  color: #fff !important;
  font-weight: 700;
}

.bot-overview-result-cell {
  min-width: 220px;
}

.bot-overview-schedule-cell {
  white-space: pre-line;
  line-height: 1.25;
  min-width: 140px;
}

.bot-overview-source-cell {
  min-width: 230px;
}

.bot-overview-empty {
  padding: 1.5rem !important;
  color: var(--slate-500) !important;
  text-align: center !important;
}

.bot-overview-table code,
.bot-identity-section code,
.firestore-output-grid code {
  color: var(--cyan-400);
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.82rem;
}

.bot-detail-head {
  align-items: flex-start;
  justify-content: flex-end;
}

.bot-detail-category {
  margin: 0.35rem 0 0;
  color: var(--slate-400);
  font-size: 0.9rem;
}

.badge-status {
  text-transform: capitalize;
  border: 1px solid transparent;
}

.badge-status-active {
  color: var(--emerald-400);
  background: rgba(6, 78, 59, 0.28);
  border-color: rgba(52, 211, 153, 0.28);
}

.badge-status-status-connected {
  color: var(--emerald-400);
  background: rgba(6, 78, 59, 0.28);
  border-color: rgba(52, 211, 153, 0.28);
}

/* Manual-only bots (e.g. NDC SPRK) — distinct from Active/scheduled */
.badge-status-status-manual,
.badge-status-manual {
  color: var(--slate-200);
  background: rgba(51, 65, 85, 0.55);
  border-color: rgba(148, 163, 184, 0.35);
}

/* Env-disabled (*_ENABLED=0) — still listed in Overview with Disabled badge */
.badge-status-status-disabled,
.badge-status-disabled {
  color: var(--slate-400);
  background: rgba(51, 65, 85, 0.4);
  border-color: rgba(148, 163, 184, 0.28);
}

/* TV-aligned Overview displayStatus badges (same labels as /bots/tv) */
.badge-status-ov-active {
  color: var(--emerald-400);
  background: rgba(6, 78, 59, 0.28);
  border-color: rgba(52, 211, 153, 0.28);
}
.badge-status-ov-not-scheduled,
.badge-status-ov-pending-integration {
  color: #fbbf24;
  background: rgba(120, 53, 15, 0.28);
  border-color: rgba(251, 191, 36, 0.28);
}
.badge-status-ov-failed {
  color: #f87171;
  background: rgba(127, 29, 29, 0.28);
  border-color: rgba(248, 113, 113, 0.28);
}
.badge-status-ov-missed-schedule,
.badge-status-ov-config-missing,
.badge-status-ov-running-too-long,
.badge-status-ov-needs-attention {
  color: #f59e0b;
  background: rgba(120, 53, 15, 0.32);
  border-color: rgba(245, 158, 11, 0.35);
}
.badge-status-ov-disabled {
  color: var(--slate-400);
  background: rgba(51, 65, 85, 0.4);
  border-color: rgba(148, 163, 184, 0.28);
}

.badge-status-success {
  color: var(--emerald-400);
  background: rgba(6, 78, 59, 0.28);
  border-color: rgba(52, 211, 153, 0.28);
}

.badge-status-started,
.badge-status-running {
  color: var(--amber-400);
  background: rgba(120, 53, 15, 0.28);
  border-color: rgba(251, 191, 36, 0.28);
}

.badge-status-skipped {
  color: var(--slate-300);
  background: rgba(51, 65, 85, 0.42);
  border-color: rgba(148, 163, 184, 0.22);
}

.badge-status-timeout {
  color: var(--amber-400);
  background: rgba(120, 53, 15, 0.28);
  border-color: rgba(251, 191, 36, 0.28);
}

.badge-status-failed {
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.28);
  border-color: rgba(248, 113, 113, 0.28);
}

.badge-status-status-read-failed {
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.28);
  border-color: rgba(248, 113, 113, 0.28);
}

.badge-status-disabled {
  color: var(--slate-400);
  background: rgba(51, 65, 85, 0.42);
  border-color: rgba(148, 163, 184, 0.2);
}

.badge-status-integration-pending,
.badge-status-not-integrated {
  color: var(--slate-300);
  background: rgba(15, 23, 42, 0.8);
  border-color: var(--slate-700);
}

.badge-status-unknown {
  color: var(--slate-300);
  background: rgba(15, 23, 42, 0.8);
  border-color: var(--slate-700);
}

.bot-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.bot-metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bot-detail-card {
  padding: 1rem;
  background: rgba(2, 6, 23, 0.35);
  border: 1px solid var(--slate-800);
  border-radius: 0.85rem;
}

.bot-detail-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-500);
}

.bot-detail-card strong {
  color: var(--slate-200);
  font-size: 0.95rem;
}

.bot-section-stack {
  display: grid;
  gap: 1rem;
}

.bot-info-section {
  padding: 1rem;
  background: rgba(2, 6, 23, 0.35);
  border: 1px solid var(--slate-800);
  border-radius: 0.85rem;
}

.bot-info-section h3 {
  margin: 0 0 0.7rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-500);
}

.bot-detail-panel.is-glassix-conversation-analyzer .glassix-section-title {
  color: var(--slate-100);
}

.bot-detail-panel.is-glassix-conversation-tagger .glassix-section-title {
  color: var(--slate-100);
}

.glassix-tagger-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.glassix-tagger-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--slate-300);
}

.glassix-tagger-rationale {
  margin: 0;
  color: var(--slate-200);
  line-height: 1.5;
}

.glassix-tagger-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.glassix-tagger-tag-badge {
  color: #dbeafe;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.bot-info-section p {
  margin: 0;
  color: var(--slate-300);
}

.bot-actions-section {
  display: grid;
  gap: 1rem;
}

.bot-actions-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.bot-actions-head h3 {
  margin-bottom: 0;
}

.bot-actions-state {
  flex: 0 0 auto;
  padding: 0.3rem 0.55rem;
  color: var(--slate-400);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--slate-700);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bot-actions-state--available {
  color: var(--emerald-400);
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
}

.bot-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.bot-action-card {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.9rem;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid var(--slate-800);
  border-radius: 0.85rem;
}

.bot-action-card--disabled {
  opacity: 0.78;
}

.bot-action-card--enabled {
  border-color: rgba(34, 211, 238, 0.28);
}

.bot-action-hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--amber-400);
}

.bot-action-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}

.bot-action-card h4 {
  margin: 0;
  color: var(--slate-100);
  font-size: 0.95rem;
}

.bot-action-status {
  flex: 0 0 auto;
  padding: 0.22rem 0.48rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bot-action-status--disabled {
  color: var(--slate-400);
  background: rgba(51, 65, 85, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.bot-action-status--enabled {
  color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.bot-action-button {
  justify-self: start;
  min-height: 2.2rem;
}

.bot-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.glassix-api-test-section {
  display: grid;
  gap: 0.85rem;
  border-color: rgba(34, 211, 238, 0.22);
}

.glassix-api-test-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.glassix-api-test-head h3 {
  margin-bottom: 0.35rem;
}

.glassix-api-test-head p {
  color: var(--slate-400);
  font-size: 0.85rem;
}

.glassix-api-test-status {
  padding: 0.7rem 0.8rem;
  border-radius: 0.65rem;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid var(--slate-800);
  background: rgba(15, 23, 42, 0.58);
}

.glassix-api-test-status--idle,
.glassix-api-test-status--loading {
  color: var(--slate-300);
}

.glassix-api-test-status--success {
  color: var(--emerald-400);
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.1);
}

.glassix-api-test-status--error {
  color: var(--error-text);
  border-color: rgba(248, 113, 113, 0.28);
  background: var(--error-bg);
}

.glassix-api-test-output {
  max-height: 24rem;
}

/* Compact env config summary (no cards) */
.icb-config-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0;
  margin: 0.35rem 0 0.85rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--slate-300);
}

.icb-config-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0 0.85rem;
  border-left: 1px solid var(--slate-700);
}

.icb-config-item:first-child {
  padding-left: 0;
  border-left: none;
}

.icb-config-k {
  color: var(--slate-500);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.icb-config-item strong {
  color: var(--slate-200);
  font-size: 0.86rem;
  font-weight: 600;
}

/* Cancel Stale Agent — manual test panel */
.csar-panel {
  display: grid;
  gap: 1rem;
}

.csar-full-run {
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  background: rgba(8, 47, 73, 0.28);
  padding: 0.85rem 1.05rem;
  display: grid;
  gap: 0;
}

.csar-manual-block {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.35);
  padding: 0.85rem 1.05rem;
  display: grid;
  gap: 0;
}

.csar-collapsible__toggle,
.panel-collapsible__toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  width: 100%;
  margin: 0;
  padding: 0.15rem 0;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.csar-collapsible__toggle:hover .csar-full-run__title,
.csar-collapsible__toggle:focus-visible .csar-full-run__title,
.panel-collapsible__toggle:hover .panel-collapsible__title,
.panel-collapsible__toggle:focus-visible .panel-collapsible__title {
  color: #fff;
}

.csar-collapsible__toggle:focus-visible,
.panel-collapsible__toggle:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.55);
  outline-offset: 3px;
  border-radius: 0.45rem;
}

.csar-collapsible__titles,
.panel-collapsible__titles {
  min-width: 0;
  flex: 1 1 auto;
}

.panel-collapsible__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--slate-100);
}

.panel-collapsible__hint {
  margin: 0;
  color: var(--slate-400);
  font-size: 0.82rem;
  line-height: 1.45;
}

.csar-collapsible__arrow,
.panel-collapsible__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.45);
  color: var(--cyan-300);
  transition: transform 0.18s ease, background 0.15s ease, border-color 0.15s ease;
}

.csar-collapsible__arrow svg,
.panel-collapsible__arrow svg {
  width: 1rem;
  height: 1rem;
}

.csar-collapsible.is-open .csar-collapsible__arrow,
.panel-collapsible.is-open .panel-collapsible__arrow {
  transform: rotate(180deg);
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(8, 145, 178, 0.2);
}

.csar-collapsible__body,
.panel-collapsible__body {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.csar-collapsible__body[hidden],
.panel-collapsible__body[hidden] {
  display: none;
}

#selected-bot-output-section.panel-collapsible {
  display: grid;
  gap: 0;
}

.csar-full-run__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.csar-full-run__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--slate-100);
}

.csar-full-run__hint {
  margin: 0;
  color: var(--slate-400);
  font-size: 0.82rem;
  line-height: 1.45;
}

.csar-full-run__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.csar-full-progress {
  display: grid;
  gap: 0.35rem;
}

.csar-full-progress.is-hidden {
  display: none;
}

.csar-full-progress__bar {
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.csar-full-progress__fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.85), rgba(34, 197, 94, 0.85));
  transition: width 0.35s ease;
}

.csar-full-progress__text {
  font-size: 0.78rem;
  color: var(--slate-400);
  word-break: break-all;
}

.csar-full-run__tables {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
  min-width: 0;
}

.csar-full-table-block {
  min-width: 0;
}

.csar-full-table-title {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  color: var(--slate-300);
}

.csar-full-table-wrap {
  max-height: 14rem;
  overflow-x: hidden;
  overflow-y: auto;
  min-width: 0;
}

/* Fixed layout — no bot-overview-table min-width:1280px bleed into this panel */
.csar-result-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  background: transparent;
}

.hhpc-clickable-table tbody tr[data-reservation-id] {
  cursor: pointer;
}

.hhpc-clickable-table tbody tr[data-reservation-id]:hover td {
  background: rgba(56, 189, 248, 0.08);
}

.hhpc-clickable-table tbody tr[data-reservation-id].is-selected td {
  background: rgba(56, 189, 248, 0.16);
}

.csar-result-table th,
.csar-result-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.csar-result-table th {
  color: var(--slate-500);
  background: rgba(15, 23, 42, 0.72);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.csar-result-table td {
  color: var(--slate-300);
  font-size: 0.8rem;
  line-height: 1.35;
}

.dtf-work-fields-table__col-field {
  width: 42%;
}

.dtf-work-fields-table__col-value {
  width: 58%;
}

.dtf-work-fields-table td.dtf-work-fields-table__field,
.dtf-work-fields-table td.dtf-work-fields-table__value {
  color: var(--slate-200);
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  background: transparent;
}

.dtf-work-fields-table td.dtf-work-fields-table__field {
  color: var(--slate-400);
  font-weight: 700;
}

.dtf-work-fields-table td.dtf-work-fields-table__value {
  color: var(--slate-100);
}

.csar-result-table tbody tr:last-child td {
  border-bottom: 0;
}

.csar-result-table--canceled .csar-col-id,
.csar-result-table--skipped .csar-col-id {
  width: 34%;
}

.csar-result-table--canceled .csar-col-mode {
  width: 28%;
}

.csar-result-table--canceled .csar-col-status {
  width: 38%;
}

.csar-result-table--skipped .csar-col-reason {
  width: 28%;
}

.csar-result-table--skipped .csar-col-detail {
  width: 38%;
}

.csar-result-table .csar-cell-id {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-weight: 600;
  font-size: 0.78rem;
}

.csar-result-table .csar-cell-mode,
.csar-result-table .csar-cell-reason {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.csar-result-table .csar-cell-status,
.csar-result-table .csar-cell-detail {
  white-space: normal;
}

.csar-output-slot:empty {
  display: none;
}

.csar-embedded-output.csar-manual-block {
  margin: 0;
}

.csar-embedded-output .bot-output-preview {
  margin: 0;
  min-height: 4rem;
}

.csar-recent-logs__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.csar-logs-table-wrap {
  max-height: 18rem;
  overflow-x: auto;
}

.csar-logs-table {
  min-width: 52rem;
}

.csar-logs-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

.csar-logs-table tbody tr:hover,
.csar-logs-table tbody tr:focus-visible {
  background: rgba(56, 189, 248, 0.1);
}

.csar-logs-table tbody tr.is-selected {
  background: rgba(56, 189, 248, 0.16);
  box-shadow: inset 3px 0 0 rgba(56, 189, 248, 0.85);
}

.csar-logs-col-started { width: 14%; }
.csar-logs-col-trigger { width: 9%; }
.csar-logs-col-status { width: 9%; }
.csar-logs-col-mode { width: 8%; }
.csar-logs-col-listed { width: 7%; }
.csar-logs-col-canceled { width: 9%; }
.csar-logs-col-skipped { width: 8%; }
.csar-logs-col-duration { width: 9%; }
.csar-logs-col-runid { width: 27%; }

.csar-log-detail {
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 10px;
  background: rgba(8, 47, 73, 0.22);
  padding: 0.85rem 0.95rem;
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.csar-log-detail.is-hidden {
  display: none;
}

.csar-log-detail__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.csar-manual-divider {
  margin-top: 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.csar-manual-divider h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--slate-100);
}

.csar-manual-divider p {
  margin: 0;
  color: var(--slate-400);
  font-size: 0.82rem;
  line-height: 1.45;
}

.csar-flow-track {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.csar-flow-step {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.45);
  color: var(--slate-300);
  font-size: 0.78rem;
  font-weight: 600;
}

.csar-flow-step span {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  font-size: 0.7rem;
}

.csar-flow-step.is-pass {
  border-color: rgba(34, 197, 94, 0.45);
  color: #bbf7d0;
}

.csar-flow-step.is-pass span {
  background: rgba(34, 197, 94, 0.35);
}

.csar-flow-step.is-fail {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

.csar-flow-step.is-next {
  border-color: rgba(56, 189, 248, 0.55);
  color: #bae6fd;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.2);
}

.csar-flow-step.is-next span {
  background: rgba(56, 189, 248, 0.35);
}

.csar-step-card.is-muted {
  opacity: 0.55;
  filter: grayscale(0.15);
}

.csar-step-card.is-open-path {
  opacity: 1;
  filter: none;
  outline: 1px solid rgba(56, 189, 248, 0.35);
  outline-offset: 2px;
}

.csar-step-card.is-blocked-path {
  opacity: 0.5;
  outline: 1px solid rgba(248, 113, 113, 0.25);
  outline-offset: 2px;
}

.csar-step-card.is-skip-path {
  opacity: 0.55;
  outline: 1px dashed rgba(250, 204, 21, 0.45);
  outline-offset: 2px;
}

.csar-step-card.is-blocked-path .csar-step-meta {
  color: #fecaca;
}

.csar-flow-step.is-fail span {
  background: rgba(248, 113, 113, 0.3);
}

.csar-manual-grid {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.35rem;
}

.csar-step-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.35);
  padding: 0.95rem 1rem;
  display: grid;
  gap: 0.65rem;
}

.csar-step-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.csar-step-card__head h4 {
  margin: 0;
  font-size: 0.92rem;
  color: var(--slate-100);
}

.csar-step-card__hint {
  margin: 0;
  color: var(--slate-400);
  font-size: 0.8rem;
  line-height: 1.4;
}

.csar-step-card__fields {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.65rem;
}

.csar-input {
  min-width: 10rem;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.75);
  color: var(--slate-100);
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
}

.csar-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--slate-300);
  font-size: 0.8rem;
  padding-bottom: 0.35rem;
}

.csar-step-meta {
  font-size: 0.78rem;
  color: var(--slate-400);
  word-break: break-all;
}

.csar-json {
  max-height: 16rem;
  margin: 0;
}

.csar-verdict {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--slate-300);
}

.csar-verdict--pass {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.15);
  color: #bbf7d0;
}

.csar-verdict--fail {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
}

.csar-verdict--idle {
  opacity: 0.75;
}

.csar-list-toolbar {
  display: flex;
  align-items: end;
  gap: 0.65rem;
  padding: 0.15rem 0 0.1rem;
}

.csar-list-toolbar__filter {
  flex: 1 1 auto;
  min-width: 12rem;
  max-width: 28rem;
}

.csar-id-table-wrap {
  max-height: 28rem;
}

.csar-id-table-wrap tr.is-selected td {
  background: rgba(56, 189, 248, 0.14);
}

.csar-id-table-wrap tr.utb-issue-row td {
  background: rgba(251, 191, 36, 0.12);
}

.csar-id-table-wrap tr.utb-issue-row.is-selected td {
  background: rgba(251, 191, 36, 0.22);
}

/* CPRP step-1: compact 2-column ID list (do not use bot-overview-table — it forces min-width 1280px) */
.cprp-step1-toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  width: max-content;
  max-width: 100%;
  margin: 0.35rem 0 0.45rem;
}

.cprp-step1-btn.btn {
  width: 10.25rem;
  min-height: 0;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.2;
  border-radius: 0.45rem;
}

.cprp-step1-toolbar .csar-step-meta {
  margin: 0;
  font-size: 0.75rem;
}

.cprp-id-table-wrap {
  display: inline-block;
  width: max-content;
  max-width: 100%;
  max-height: 20rem;
  margin-top: 0.5rem;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 0.5rem;
  background: rgba(2, 6, 23, 0.35);
  vertical-align: top;
}

.cprp-id-table {
  width: max-content;
  min-width: 0 !important;
  max-width: none;
  table-layout: fixed;
  border-collapse: collapse;
  background: transparent;
}

.cprp-id-table .cprp-id-col-num {
  width: 2.75rem;
}

.cprp-id-table .cprp-id-col-id {
  width: 7.5rem;
}

.cprp-id-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.95);
  color: var(--slate-400);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  white-space: nowrap;
}

.cprp-id-table tbody td {
  padding: 0.32rem 0.55rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  color: var(--slate-300);
  font-size: 0.8rem;
  white-space: nowrap;
  vertical-align: middle;
}

.cprp-id-table thead th:first-child,
.cprp-id-table tbody td:first-child {
  text-align: center;
  color: var(--slate-500);
  font-variant-numeric: tabular-nums;
}

.cprp-id-table thead th:last-child,
.cprp-id-table tbody td:last-child {
  text-align: center;
}

.cprp-id-table tbody td:last-child {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.01em;
}

.cprp-id-table tbody tr {
  cursor: pointer;
}

.cprp-id-table tbody tr:hover td,
.cprp-id-table-wrap tr.is-selected td {
  background: rgba(56, 189, 248, 0.12);
}

.cprp-id-table tbody tr:last-child td {
  border-bottom: none;
}

.cprp-step-waiting {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.55rem 0 0.15rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 0.5rem;
  background: rgba(14, 165, 233, 0.08);
  color: #bae6fd;
  font-size: 0.8rem;
  font-weight: 600;
}

.cprp-step-waiting.is-hidden {
  display: none;
}

.cprp-step-waiting__spinner {
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid rgba(186, 230, 253, 0.25);
  border-top-color: #38bdf8;
  border-radius: 999px;
  animation: spin 0.75s linear infinite;
  flex: 0 0 auto;
}

.cprp-step-waiting__text {
  line-height: 1.2;
}

/* Queue Change Notify — control panel */
.qcn-panel {
  padding: 0;
  overflow: hidden;
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.42);
}

.qcn-panel__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.35);
}

.qcn-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate-100);
}

.qcn-panel__title-sep {
  color: var(--slate-500);
  font-weight: 300;
}

.qcn-panel__subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--slate-400);
  line-height: 1.45;
}

.qcn-panel__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem;
}

.qcn-field {
  display: grid;
  gap: 0.25rem;
}

.qcn-field__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--slate-400);
}

.qcn-select {
  min-width: 5.5rem;
  padding: 0.42rem 1.75rem 0.42rem 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid var(--slate-700);
  background: rgba(15, 23, 42, 0.72);
  color: var(--slate-100);
  font-size: 0.82rem;
  box-shadow: 0 1px 2px rgba(2, 6, 23, 0.25);
}

.qcn-toolbar-btn {
  font-size: 0.82rem;
  white-space: nowrap;
}

.qcn-toolbar-btn--refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.qcn-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 1.25rem 0;
  padding: 0.7rem 0.85rem;
  border-radius: 0.65rem;
  font-size: 0.84rem;
  border: 1px solid transparent;
}

.qcn-banner__icon {
  display: inline-flex;
  flex-shrink: 0;
}

.qcn-banner__icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.qcn-banner__icon--spin svg {
  animation: spin 0.9s linear infinite;
}

.qcn-banner__sep {
  color: var(--slate-500);
}

.qcn-banner--idle,
.qcn-banner--loading {
  color: var(--slate-300);
  background: rgba(15, 23, 42, 0.55);
  border-color: var(--slate-800);
}

.qcn-banner--success {
  color: #a7f3d0;
  background: rgba(6, 78, 59, 0.28);
  border-color: rgba(52, 211, 153, 0.28);
}

.qcn-banner--error {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.28);
  border-color: rgba(248, 113, 113, 0.28);
}

.qcn-dashboard {
  padding: 1rem 1.25rem 1.25rem;
}

.qcn-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.qcn-setting-card,
.qcn-stat-card {
  padding: 0.95rem 1rem;
  border-radius: 0.7rem;
  border: 1px solid var(--slate-800);
  min-height: 5.25rem;
}

.qcn-setting-card {
  background: rgba(2, 6, 23, 0.42);
}

.qcn-card-label {
  margin: 0 0 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate-500);
}

.qcn-card-hint {
  margin: -0.35rem 0 0.45rem;
  font-size: 0.62rem;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  color: var(--slate-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qcn-setting-value {
  color: var(--slate-100);
  font-size: 0.88rem;
  font-weight: 600;
}

.qcn-mono {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-weight: 700;
}

.qcn-status-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.qcn-status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--slate-600);
}

.qcn-status-dot--on {
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}

.qcn-status-dot--off {
  background: #94a3b8;
}

.qcn-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  user-select: none;
}

.qcn-toggle__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.qcn-toggle__track {
  position: relative;
  width: 2.35rem;
  height: 1.2rem;
  border-radius: 999px;
  background: var(--slate-700);
  transition: background 0.2s ease;
}

.qcn-toggle__track::after {
  content: '';
  position: absolute;
  top: 0.12rem;
  left: 0.12rem;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.45);
  transition: transform 0.2s ease;
}

.qcn-toggle__input:checked + .qcn-toggle__track {
  background: #0ea5e9;
}

.qcn-toggle__input:checked + .qcn-toggle__track::after {
  transform: translateX(1.1rem);
}

.qcn-toggle__input:focus-visible + .qcn-toggle__track {
  outline: 2px solid rgba(14, 165, 233, 0.55);
  outline-offset: 2px;
}

.qcn-toggle__text {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--slate-200);
}

.qcn-stat-card {
  background: rgba(15, 23, 42, 0.55);
  box-shadow: 0 1px 2px rgba(2, 6, 23, 0.2);
}

.qcn-stat-card__label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-500);
}

.qcn-stat-card__icon {
  display: inline-flex;
}

.qcn-stat-card__icon svg {
  width: 0.95rem;
  height: 0.95rem;
}

.qcn-stat-card__value {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--slate-50);
}

.qcn-stat-card--whatsapp .qcn-stat-card__icon { color: #4ade80; }
.qcn-stat-card--email .qcn-stat-card__icon { color: #60a5fa; }
.qcn-stat-card--post-scan .qcn-stat-card__icon { color: #c084fc; }
.qcn-stat-card--reminders .qcn-stat-card__icon { color: #fbbf24; }
.qcn-stat-card--errors .qcn-stat-card__icon { color: #f87171; }
.qcn-stat-card--muted .qcn-stat-card__icon { color: #94a3b8; }

.qcn-table-block {
  margin-top: 1.15rem;
}

.qcn-table-block__title {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate-400);
}

.qcn-table-scroll {
  overflow: auto;
  border: 1px solid var(--slate-800);
  border-radius: 0.65rem;
  background: rgba(2, 6, 23, 0.35);
}

.qcn-table {
  margin: 0;
}

.qcn-table thead th {
  background: rgba(15, 23, 42, 0.72);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-500);
}

.qcn-table tbody td {
  font-size: 0.82rem;
}

.agw-testing-layout {
  display: grid;
  gap: 1rem;
  max-width: 56rem;
}

.agw-testing-connection {
  padding: 1rem 1.1rem;
  border-color: rgba(34, 211, 238, 0.18);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.72), rgba(8, 47, 73, 0.35));
}

.agw-testing-connection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;
}

.agw-testing-connection-item {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.agw-testing-connection-label {
  color: var(--slate-500);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.agw-testing-connection-value {
  color: var(--slate-100);
  font-size: 0.95rem;
}

.agw-testing-connection-url,
.agw-testing-connection-key {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 0.35rem 0.55rem;
  border-radius: 0.45rem;
  border: 1px solid var(--slate-700);
  background: rgba(15, 23, 42, 0.65);
  color: var(--cyan-300);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  word-break: break-all;
}

.agw-testing-connection-hint {
  color: var(--slate-400);
  font-size: 0.82rem;
  line-height: 1.45;
}

.agw-testing-connection-hint code {
  color: var(--slate-200);
  font-size: 0.78rem;
}

.agw-testing-request {
  padding: 1rem 1.1rem 1.15rem;
}

.agw-testing-actions {
  flex-shrink: 0;
}

.agw-testing-form-section {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--slate-800);
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.38);
}

.agw-testing-form-section-title {
  margin: 0;
  color: var(--slate-200);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.agw-testing-form-grid {
  display: grid;
  gap: 0.75rem;
}

.agw-testing-form-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.agw-testing-form-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.agw-testing-result-details {
  border: 1px solid var(--slate-800);
  border-radius: 0.75rem;
  padding: 0.65rem 0.85rem 0.85rem;
  background: rgba(15, 23, 42, 0.38);
}

.agw-testing-result-details .glassix-api-test-output {
  margin-top: 0.65rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.agw-testing-form-grid .glassix-ticket-lookup-field select,
.agw-testing-form-grid .glassix-ticket-lookup-field input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  color: var(--slate-200);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--slate-800);
  border-radius: 0.65rem;
  outline: none;
}

.agw-testing-form-grid .glassix-ticket-lookup-field select:focus,
.agw-testing-form-grid .glassix-ticket-lookup-field input:focus {
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}

.agw-testing-lead {
  color: var(--slate-400);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.agw-testing-doc-block {
  border: 1px solid var(--slate-800);
  border-radius: 0.65rem;
  padding: 0.65rem 0.85rem;
  background: rgba(15, 23, 42, 0.35);
}

.agw-testing-doc-block summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--slate-100);
}

.agw-testing-doc-body {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.55rem;
  color: var(--slate-300);
  font-size: 0.88rem;
}

.agw-testing-doc-body ol,
.agw-testing-doc-body ul {
  margin: 0;
  padding-inline-start: 1.25rem;
}

.agw-testing-inline-code {
  max-height: none;
  margin: 0;
  font-size: 0.82rem;
}

.agw-testing-field-wide {
  grid-column: 1 / -1;
}

.agw-testing-body-hint {
  margin: 0;
  color: var(--slate-400);
  font-size: 0.82rem;
  line-height: 1.45;
}

.agw-testing-body-hint code {
  color: var(--cyan-300);
  font-size: 0.78rem;
}

.agw-testing-json-input {
  width: 100%;
  min-height: 10rem;
  padding: 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid var(--slate-700);
  background: rgba(15, 23, 42, 0.72);
  color: var(--slate-100);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  resize: vertical;
}

.agw-testing-json-input:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}

@media (max-width: 768px) {
  .agw-testing-connection-grid,
  .agw-testing-form-grid--2,
  .agw-testing-form-grid--3 {
    grid-template-columns: 1fr;
  }

  .glassix-api-test-head {
    flex-direction: column;
    align-items: stretch;
  }

  .agw-testing-actions {
    width: 100%;
  }

  .agw-testing-actions .btn {
    flex: 1 1 auto;
  }
}

.agw-credentials-wrap {
  display: grid;
  gap: 0.65rem;
}

.agw-credentials-title {
  margin: 0;
  font-size: 0.92rem;
}

.agw-credentials-table td {
  font-size: 0.82rem;
  vertical-align: top;
}

.ndc-sprk-credentials-form {
  display: grid;
  gap: 0.85rem;
}

.ndc-sprk-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.app-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(10px);
}

.app-dialog-panel {
  width: min(480px, 96vw);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.bot-schedule-dialog-field {
  display: grid;
  gap: 0.35rem;
}

.bot-schedule-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.selected-run-output-wrap {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
}

.glassix-ticket-lookup {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 0.85rem;
  align-items: end;
}

.glassix-normalized-ticket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.glassix-ticket-lookup-field {
  display: grid;
  gap: 0.35rem;
}

.glassix-ticket-lookup-field span,
.glassix-raw-ticket-head {
  color: var(--slate-500);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.glassix-debug-output-toggle {
  padding: 0.45rem 0.55rem;
  border-radius: 0.45rem;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
}

.glassix-debug-output-toggle:hover,
.glassix-debug-output-toggle:focus-visible {
  color: var(--cyan-400);
  background: rgba(34, 211, 238, 0.08);
  outline: none;
}

.glassix-ticket-lookup-field input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  color: var(--slate-200);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--slate-800);
  border-radius: 0.65rem;
  outline: none;
}

.glassix-ticket-lookup-field input:focus {
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}

.glassix-ticket-lookup-output,
.glassix-ticket-normalize-output {
  max-height: 34rem;
}

.integration-summary-section {
  margin-top: 1rem;
}

.integration-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.integration-summary-card {
  min-width: 0;
  padding: 0.9rem;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid var(--slate-800);
  border-radius: 0.85rem;
}

.integration-summary-card strong {
  display: block;
  color: var(--slate-200);
  font-size: 0.9rem;
  line-height: 1.4;
}

.bot-identity-section {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
}

.firestore-output-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.firestore-output-grid div {
  min-width: 0;
}

.firestore-output-grid strong {
  display: block;
  color: var(--slate-200);
}

.bot-identity-meta {
  display: grid;
  gap: 0.45rem;
}

.bot-identity-line {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  min-width: 0;
  color: var(--slate-300);
  font-size: 0.88rem;
}

.bot-identity-line span {
  flex: 0 0 auto;
  color: var(--slate-500);
  font-weight: 700;
}

.bot-identity-line strong,
.bot-identity-line code {
  min-width: 0;
  overflow-wrap: anywhere;
}

.bot-identity-line strong {
  color: var(--slate-200);
}

.firestore-output-grid {
  margin-bottom: 1rem;
}

.firestore-note {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem;
  color: var(--slate-300) !important;
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 0.65rem;
  font-size: 0.85rem;
}

.bot-source-file,
.bot-firestore-path {
  display: block;
  padding: 0.75rem;
  color: var(--cyan-400);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(34, 211, 238, 0.14);
  border-radius: 0.65rem;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
}

.bot-output-preview,
.bot-logs {
  margin: 0;
  min-height: 4rem;
  padding: 0.85rem;
  color: var(--slate-400);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--slate-800);
  border-radius: 0.65rem;
}

.bot-output-preview {
  overflow-x: auto;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.85rem;
}

.ndc-sprk-live-output {
  max-height: min(28rem, 52vh);
  overflow-y: auto;
}

.run-logs-panel {
  width: 100%;
  max-width: var(--bot-control-content-max-width);
  margin: 0 auto;
}

.integration-panel {
  width: 100%;
  max-width: var(--bot-control-content-max-width);
  margin: 0 auto;
}

.run-logs-filters {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.7fr) auto;
  align-items: end;
}

.run-logs-table {
  min-width: 1120px;
}

.run-logs-table tbody tr {
  cursor: pointer;
}

.run-log-row.is-selected {
  background: rgba(8, 145, 178, 0.18);
  box-shadow: inset 3px 0 0 var(--cyan-400);
}

.run-logs-filter-action {
  display: flex;
  justify-content: flex-end;
}

.run-log-id-cell,
.run-log-bot-cell {
  min-width: 250px;
}

.run-log-duration-cell {
  white-space: nowrap;
}

.run-log-error-cell {
  min-width: 260px;
  max-width: 420px;
  overflow-wrap: anywhere;
}

.selected-run-panel {
  margin-top: 1rem;
}

.selected-run-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.selected-run-grid code,
.selected-run-grid strong {
  color: var(--slate-200);
  overflow-wrap: anywhere;
}

.selected-run-error {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.selected-run-error p {
  color: var(--slate-300);
  overflow-wrap: anywhere;
}

.bot-logs-empty,
.bot-log-line {
  margin: 0;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.85rem;
}

.bot-empty-state {
  padding-block: 3.5rem;
}

@media (max-width: 900px) {
  .bot-control-layout {
    grid-template-columns: 1fr;
  }

  html[data-sidebar-collapsed="true"] .bot-control-layout {
    grid-template-columns: var(--bot-sidebar-width-collapsed) minmax(0, 1fr);
  }

  .bot-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--slate-800);
  }

  html[data-sidebar-collapsed="true"] .bot-sidebar {
    border-bottom: 0;
    border-right: 1px solid var(--slate-800);
  }

  .bot-nav {
    max-height: 22rem;
  }

  .bot-detail-grid {
    grid-template-columns: 1fr;
  }

  .bot-metrics-grid {
    grid-template-columns: 1fr;
  }

  .qcn-metrics-grid {
    grid-template-columns: 1fr;
  }

  .qcn-panel__header {
    flex-direction: column;
    align-items: stretch;
  }

  .qcn-panel__toolbar {
    width: 100%;
  }

  .overview-stats-grid,
  .bot-actions-grid,
  .integration-summary-grid,
  .system-health-grid,
  .system-health-detail-grid,
  .firestore-output-grid,
  .selected-run-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .overview-table-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 901px) and (max-width: 1200px) {
  .qcn-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bot-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .integration-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1201px) and (max-width: 1400px) {
  .qcn-metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .overview-table-filters {
    grid-template-columns: 1fr;
  }

  .glassix-ticket-lookup {
    grid-template-columns: 1fr;
  }
}
