/* ==========================================================================
   GPTFREE REGISTER CONSOLE - MODERN HUMAN-CENTERED DESIGN SYSTEM
   ========================================================================== */

:root {
  /* Typography */
  --font: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "DM Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Surfaces & Backgrounds */
  --paper: #f8fafc;
  --paper-2: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --surface-hover: #f8fafc;

  /* Borders & Dividers */
  --line: #e2e8f0;
  --line-dark: #cbd5e1;
  --line-light: #f1f5f9;

  /* Typography Colors */
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #475569;
  --faint: #94a3b8;
  --subtle: #64748b;

  /* Brand Accent (Electric Indigo / Violet) */
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-strong: #3730a3;
  --accent-soft: #eef2ff;
  --accent-softer: #f5f7ff;
  --accent-border: #c7d2fe;
  --accent-glow: rgba(79, 70, 229, 0.16);

  /* Semantic Feedback Palette */
  --green: #059669;
  --green-hover: #047857;
  --green-soft: #ecfdf5;
  --green-border: #a7f3d0;
  --green-text: #065f46;

  --amber: #d97706;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;
  --amber-text: #92400e;

  --red: #e11d48;
  --red-hover: #be123c;
  --red-soft: #fff1f2;
  --red-border: #fecdd3;
  --red-text: #9f1239;

  --blue: #0284c7;
  --blue-soft: #f0f9ff;
  --blue-border: #bae6fd;
  --blue-text: #0369a1;

  /* Elevation & Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-lift: 0 8px 24px rgba(15, 23, 42, 0.08);

  /* Radius Tokens */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   BASE & RESET
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 14px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

button, a {
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--line-dark);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--faint);
}

/* ==========================================================================
   APP SHELL & SIDEBAR NAVIGATION
   ========================================================================== */

.app-shell {
  min-height: 100vh;
  display: flex;
  background: var(--paper);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 256px;
  padding: 20px 14px 16px;
  color: var(--ink-2);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 50;
  box-shadow: 1px 0 3px rgba(15, 23, 42, 0.02);
  transition: transform var(--transition-normal);
}

/* Brand */
.brand {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.brand:hover {
  background: var(--surface-2);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 8px 7px;
  box-shadow: 0 4px 12px var(--accent-glow);
  flex-shrink: 0;
}

.brand-mark i {
  display: block;
  align-self: end;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 1.5px;
}
.brand-mark i:nth-child(1) { height: 45%; }
.brand-mark i:nth-child(2) { height: 75%; }
.brand-mark i:nth-child(3) { height: 100%; }

.brand strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.12em;
}

/* Main Nav */
.main-nav {
  margin-top: 20px;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.nav-eyebrow {
  margin: 18px 10px 8px;
  color: var(--faint);
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-eyebrow:first-of-type {
  margin-top: 6px;
}

.nav-item {
  position: relative;
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.nav-item:hover {
  color: var(--ink);
  background: var(--paper-2);
}

.nav-item.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
  transition: color var(--transition-fast);
}

.nav-item:hover .nav-icon {
  color: var(--ink);
}

.nav-item.active .nav-icon {
  color: var(--accent);
}

.nav-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item > span:nth-child(2) {
  flex: 1;
}

.nav-item kbd, .nav-item em {
  border: 0;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--paper-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  font-style: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-item.active kbd, .nav-item.active em {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.12);
}

/* Sidebar Footer */
.sidebar-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.health-pulse {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: border-color var(--transition-fast);
}

.health-pulse > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.health-pulse > span.ok {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
  position: relative;
}

.health-pulse > span.ok::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--green);
  animation: healthPing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes healthPing {
  75%, 100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

.health-pulse > span.warn {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

.health-pulse strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}

.health-pulse small {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.version-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding: 0 6px;
  color: var(--faint);
  font-size: 11px;
}

.version-row code {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 6px;
  background: var(--paper-2);
  border-radius: 4px;
}

/* ==========================================================================
   WORKSPACE, TOPBAR & VIEW CONTAINERS
   ========================================================================== */

.workspace {
  margin-left: 256px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  height: 64px;
  padding: 0 clamp(20px, 3vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 40;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.breadcrumb span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.breadcrumb b {
  color: var(--line-dark);
  font-weight: 400;
  font-size: 12px;
}

.breadcrumb strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

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

.live-clock {
  margin-right: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}

.live-clock i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
}

.icon-button, .mobile-menu {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
}

.icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button:hover, .mobile-menu:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.mobile-menu {
  display: none;
}

/* View Container */
.view {
  display: none;
  padding: 36px clamp(20px, 3.5vw, 48px) 72px;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
  animation: viewFadeIn var(--transition-normal) both;
}

.view.active {
  display: block;
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Page Headings */
.page-heading {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.page-heading h1 {
  margin: 6px 0 8px;
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.page-heading > div > p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.kicker, .section-index {
  margin: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-action {
  min-width: 140px;
  height: 42px;
  justify-content: space-between !important;
}

/* ==========================================================================
   BUTTONS & ACTION ELEMENTS
   ========================================================================== */

.primary, .secondary, .danger, .danger-soft {
  height: 38px;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition-fast);
  user-select: none;
}

.primary {
  border: 1px solid var(--accent);
  color: #ffffff;
  background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 2px 8px var(--accent-glow);
}

.primary:hover {
  background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%);
  border-color: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.primary:active {
  transform: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.secondary:hover {
  border-color: var(--line-dark);
  background: var(--paper-2);
  color: var(--ink-2);
  transform: translateY(-1px);
}

.secondary:active {
  transform: none;
}

.danger {
  border: 1px solid var(--red-border);
  color: #ffffff;
  background: var(--red);
  box-shadow: var(--shadow-xs);
}

.danger:hover {
  background: var(--red-hover);
  transform: translateY(-1px);
}

.danger-soft {
  border: 1px solid var(--red-border);
  color: var(--red);
  background: var(--red-soft);
}

.danger-soft:hover {
  border-color: var(--red);
  background: #ffe4e6;
  color: var(--red-hover);
}

.primary.compact, .secondary.compact, .danger.compact, .danger-soft.compact {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.full {
  width: 100%;
}

.text-button {
  padding: 4px 8px;
  border: 0;
  border-radius: var(--radius-xs);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.text-button:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.text-button span {
  color: var(--accent);
}

/* ==========================================================================
   CARDS, METRICS & SURFACES
   ========================================================================== */

.surface {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

/* ==========================================================================
   OVERVIEW V2: OPERATIONAL MISSION CONTROL
   ========================================================================== */

/* 1. Core Metrics Grid (4 High-Value Asset Cards) */
.overview-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 136px;
  transition: all var(--transition-fast);
  position: relative;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-dark);
}

.metric-card .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.metric-card .card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-card .card-action-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  transition: all var(--transition-fast);
}

.metric-card .card-action-link:hover {
  background: var(--accent);
  color: #ffffff;
}

.metric-card .card-main-val {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.metric-card .card-main-val strong {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  font-feature-settings: "tnum";
}

.metric-card .card-main-val small {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.metric-card .card-sub-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--faint);
}

.metric-card .card-sub-stats b {
  color: var(--ink-2);
  font-weight: 600;
}

.metric-card .stat-divider {
  color: var(--line-dark);
}

.metric-card .card-footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-card .card-footer .text-button {
  padding: 0;
  font-size: 11px;
  font-weight: 600;
}

.metric-card .card-hint {
  font-size: 11px;
  color: var(--faint);
}

/* Highlighted Metric Card */
.metric-card.featured-card {
  border-color: var(--accent-border);
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-softer) 100%);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.metric-card.featured-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, #6366f1, #4f46e5);
}

.metric-card.featured-card strong {
  color: var(--accent);
}

/* 2. Quick Action Fast Lane */
.quick-action-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  margin-bottom: 20px;
  overflow-x: auto;
}

.quick-action-strip .strip-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  padding-right: 10px;
  border-right: 1px solid var(--line);
}

.quick-action-strip .strip-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.quick-btn:hover {
  background: #ffffff;
  border-color: var(--line-dark);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.quick-btn.primary-glow {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.quick-btn.primary-glow:hover {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.quick-btn .btn-icon {
  font-size: 13px;
  line-height: 1;
}

/* 3. Operational Dual Grid */
.overview-dual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.live-tasks-surface, .recent-accounts-surface {
  padding: 22px;
  min-height: 380px;
}

/* Recent Accounts List (Right Column) */
.recent-accounts-list {
  display: flex;
  flex-direction: column;
}

.recent-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line-light);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.recent-account-row:last-child {
  border-bottom: 0;
}

.recent-account-row:hover {
  background: var(--surface-2);
}

.recent-account-row .account-info {
  min-width: 0;
}

.recent-account-row .account-info b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-account-row .account-info small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}

.recent-account-row .account-badges {
  display: flex;
  align-items: center;
  gap: 5px;
}

.recent-account-row .account-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 4. Compact Status Bar */
.overview-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  flex-wrap: wrap;
}

.overview-status-bar .status-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.overview-status-bar .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.16);
  flex-shrink: 0;
}

.overview-status-bar .status-dot.warn {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.16);
}

.overview-status-bar .status-item b {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.overview-status-bar .status-item small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

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

.section-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.section-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* Activity Feed */
.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 140px 72px;
  gap: 14px;
  align-items: center;
  min-height: 60px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-light);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.activity-row:last-child {
  border-bottom: 0;
}

.activity-row:hover {
  background: var(--surface-2);
}

.activity-row > i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-dark);
  margin-left: 6px;
  flex-shrink: 0;
}

.activity-row > i.running {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
  animation: pulseDot 1.8s infinite;
}

.activity-row > i.completed {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.16);
}

.activity-row > i.failed {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.16);
}

@keyframes pulseDot {
  50% {
    box-shadow: 0 0 0 7px rgba(79, 70, 229, 0);
  }
}

.activity-name b, .activity-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-name b {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.activity-name small {
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.mini-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-progress div {
  height: 5px;
  flex: 1;
  border-radius: var(--radius-full);
  background: var(--paper-2);
  overflow: hidden;
}

.mini-progress i {
  height: 100%;
  display: block;
  border-radius: var(--radius-full);
  background: var(--accent);
  transition: width var(--transition-normal);
}

.mini-progress span {
  width: 32px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-align: right;
  color: var(--muted);
}

.activity-row time {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-align: right;
}

.blank-list {
  min-height: 240px;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
  padding: 30px;
}

.blank-list span {
  margin-bottom: 12px;
  font-size: 28px;
  color: var(--line-dark);
}

.blank-list b {
  color: var(--ink);
  font-size: 14px;
}

.blank-list p {
  margin: 6px 0 0;
  font-size: 12px;
}

/* Readiness & Health */
.readiness-score {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.score-ring {
  --score: 0deg;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
  background: radial-gradient(circle at center, var(--surface) 60%, transparent 62%), conic-gradient(var(--accent) var(--score), var(--paper-2) 0);
  box-shadow: var(--shadow-sm);
}

.score-ring strong {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
}

.score-ring small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.readiness-score b {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.readiness-score p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.check-list {
  margin: 14px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.check-row {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12px;
}

.check-row span {
  color: var(--muted);
  font-weight: 500;
}

.check-row b {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}

.check-row b.ok {
  color: var(--green);
}

.check-row b.fail {
  color: var(--red);
}

/* Status Badges */

/* ==========================================================================
   STATUS BADGES / PILLS
   ========================================================================== */

.status-pill {
  min-width: 60px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--green-text);
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-pill.running {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.status-pill.failed, .status-pill.stopped, .status-pill.interrupted {
  color: var(--red-text);
  background: var(--red-soft);
  border-color: var(--red-border);
}

.status-pill.warning {
  color: var(--amber-text);
  background: var(--amber-soft);
  border-color: var(--amber-border);
}

.status-pill.neutral, .status-pill.queued {
  color: var(--muted);
  background: var(--paper-2);
  border-color: var(--line);
}

/* ==========================================================================
   FORMS, INPUTS & CONTROL GROUPS
   ========================================================================== */

.form-section {
  padding: 24px;
  margin-bottom: 20px;
}

.form-section-head {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
}

.form-section-head > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.form-section-head > div {
  flex: 1;
}

.form-section-head h2 {
  margin: 0 0 3px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.form-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* Form Fields & Grid */
.field-grid {
  display: grid;
  gap: 16px;
}

.field-grid.two {
  grid-template-columns: repeat(2, 1fr);
}

.field-grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.field-grid.four {
  grid-template-columns: repeat(4, 1fr);
}

.field-grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.param-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin: 12px 0;
}

.param-strip.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.param-strip.six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.sub-form-group {
  padding: 18px 20px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.sub-form-group:hover {
  border-color: var(--line-dark);
}

.sub-form-title {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sub-form-title::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 13px;
  background: var(--accent);
  border-radius: var(--radius-full);
}

.field-grid.two-wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

label {
  display: flex;
  flex-direction: column;
}

label > span, .field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: 0;
  color: var(--ink);
  background: #ffffff;
  font-family: var(--font);
  font-size: 13px;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

input, select {
  height: 38px;
  padding: 0 12px;
}

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 34px;
  appearance: none;
  -webkit-appearance: none;
}

textarea {
  padding: 12px;
  resize: vertical;
  line-height: 1.55;
  font-family: var(--mono);
  font-size: 12px;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: #ffffff;
}

input::placeholder, textarea::placeholder {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12px;
}

input[type="checkbox"], input[type="radio"] {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}

/* Number Fields */
.number-field {
  position: relative;
}

.number-field input {
  padding-right: 64px;
}

.number-field small {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  pointer-events: none;
}

/* Switch Line */
.switch-line {
  position: relative;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
}

.switch-line:hover {
  border-color: var(--line-dark);
}

.switch-line b, .switch-line small {
  display: block;
}

.switch-line b {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.switch-line small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.switch-line input {
  position: absolute;
  width: auto;
  height: auto;
  opacity: 0;
}

.switch-line i {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--line-dark);
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.switch-line i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  transition: transform var(--transition-fast);
}

.switch-line input:checked + i {
  background: var(--accent);
}

.switch-line input:checked + i::after {
  transform: translateX(16px);
}

/* Segmented Control */
.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 3px;
  gap: 3px;
}

.segmented label {
  position: relative;
  height: 32px;
  border-radius: var(--radius-xs);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.segmented label:has(input:checked) {
  color: var(--accent);
  background: #ffffff;
  box-shadow: var(--shadow-xs);
}

.segmented label:has(input:checked) span {
  color: var(--accent);
  font-weight: 700;
}

/* Proxy Summary Card */
.proxy-summary {
  margin-top: 14px;
  padding: 14px 18px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--accent-softer);
}

.proxy-orbit {
  width: 36px;
  height: 36px;
  border: 1px solid var(--accent-border);
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #ffffff;
}

.proxy-orbit i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.proxy-summary div {
  flex: 1;
}

.proxy-summary b {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.proxy-summary p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.proxy-summary em {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
}

/* Help text & Inline feedback */
.field-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.field-help b {
  color: var(--ink);
}

.field-help code {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
}

.inline-result {
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid var(--green-border);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-sm);
  color: var(--green-text);
  background: var(--green-soft);
  font-family: var(--mono);
  font-size: 12px;
}

.inline-result.error {
  border-color: var(--red-border);
  border-left-color: var(--red);
  color: var(--red-text);
  background: var(--red-soft);
}

.launch-button {
  width: 100%;
  height: 46px;
  margin-top: 20px;
  font-size: 14px;
  justify-content: space-between;
}

.launch-note {
  margin: 10px 0 0;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
}

.draft-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.draft-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* ==========================================================================
   DEVELOPER-GRADE LOG VIEWERS & TERMINALS
   ========================================================================== */

.trial-log {
  max-height: 280px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
  background: #090d16;
  color: #c8d3f5;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  padding: 14px 16px;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 12px 0 0;
  border: 1px solid #1e293b;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

#launchRunLog {
  max-height: 320px;
}

/* ==========================================================================
   FILTERS, TOOLBARS & TABLES
   ========================================================================== */

.heading-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.action-cluster {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.action-cluster select {
  height: 32px;
  font-size: 12px;
}

.action-cluster .secondary, .action-cluster .primary, .action-cluster .danger-soft {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.action-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-bar {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.filter-tabs button {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-full);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.filter-tabs button:hover {
  color: var(--ink);
}

.filter-tabs button.active {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
}

.filter-tabs button em {
  font-style: normal;
  display: inline-block;
  padding: 1px 6px;
  background: var(--paper-2);
  color: var(--muted);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
}

.filter-tabs button.active em {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.search-box {
  width: 250px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  display: flex;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-box span {
  color: var(--faint);
  font-size: 14px;
  flex-shrink: 0;
  line-height: 1;
  margin-bottom: 0 !important;
}

.search-box input {
  height: 100%;
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
}

.search-box input:focus {
  border: 0;
  box-shadow: none;
}

/* Tables */
.table-surface {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.table-wrap {
  overflow-x: auto;
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  height: 40px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-light);
  font-size: 13px;
  white-space: nowrap;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background var(--transition-fast);
}

tbody tr:hover {
  background: var(--surface-2);
}

.task-cell b, .account-cell b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-cell code, .account-cell small {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
}

.table-progress {
  width: 140px;
}

.table-progress div {
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--paper-2);
  overflow: hidden;
}

.table-progress i {
  display: block;
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent);
}

.table-progress span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.result-counts b {
  color: var(--green);
  font-weight: 700;
}

.result-counts em {
  margin-left: 8px;
  color: var(--red);
  font-style: normal;
  font-weight: 700;
}

.row-action {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.row-action:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(2px);
}

.empty-state {
  min-height: 260px;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 30px;
}

.empty-state span {
  color: var(--line-dark);
  font-size: 36px;
}

.empty-state h3 {
  margin: 12px 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* Result Stats Bar */
.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.result-stats > div {
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.result-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.result-stats strong {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  font-feature-settings: "tnum";
}

/* Pagination */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  padding: 4px 2px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

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

.pagination-controls label {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
}

.pagination-controls select {
  width: 76px;
  height: 32px;
}

.pagination-controls button {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

/* Toolbars for Phonebind / Trial / Cardpay */
.trial-toolbar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin: 14px 0;
  flex-wrap: wrap;
}

.toolbar-spacer {
  flex: 1;
}

.trial-toolbar .search-box {
  width: 240px;
}

.trial-toolbar .trial-region {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trial-toolbar .trial-region span {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.trial-toolbar .trial-region select {
  width: 145px;
}

.trial-toolbar .grow {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trial-toolbar .bind-field {
  flex: 0 0 110px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trial-toolbar .bind-field span {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.trial-toolbar .token-input {
  flex: 1 1 100%;
  width: 100%;
  min-height: 96px;
  font-size: 11px;
}

.trial-selection {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  white-space: nowrap;
}

.copy-button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
  margin-left: 6px;
  color: var(--muted);
  transition: all var(--transition-fast);
}

.copy-button:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.cred-badges {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cred-badges code {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Collapsible Sections */
.collapsible.collapsed .collapsible-body {
  display: none;
}

.collapse-toggle {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.collapse-toggle::before {
  content: "▾";
  font-family: var(--mono);
}

.collapsible.collapsed .collapse-toggle::before {
  content: "▸";
}

.collapse-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.record-count {
  margin-left: 6px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
}

/* Settings View Layout */
.settings-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-nav button {
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-left: 3px solid var(--line);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.settings-nav button:hover {
  color: var(--ink);
  background: var(--paper-2);
}

.settings-nav button.active {
  border-left-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
}

.settings-content {
  min-height: 520px;
  padding: 28px;
}

.setting-panel {
  display: none;
}

.setting-panel.active {
  display: block;
  animation: viewFadeIn var(--transition-normal);
}

.setting-title {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.setting-title p {
  margin: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.setting-title h2 {
  margin: 6px 0 4px;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.setting-title span {
  color: var(--muted);
  font-size: 12px;
}

.runtime-timezone {
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  align-items: end;
}

.runtime-timezone p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

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

.runtime-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.runtime-card span {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.runtime-card b {
  display: block;
  margin-top: 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.runtime-card b.fail {
  color: var(--red);
}

/* SMS Market Table */
.sms-market {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.sms-market-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sms-market-head b {
  font-size: 13px;
  font-weight: 700;
}

.sms-market tbody tr.recommended {
  background: var(--accent-softer);
}

.sms-market tbody tr.recommended td:first-child::after {
  content: " ★";
  color: var(--accent);
  font-weight: bold;
}

/* ==========================================================================
   DRAWER (JOB DETAILS) & MODAL DIALOGS
   ========================================================================== */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.job-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(680px, 94vw);
  z-index: 100;
  background: var(--surface);
  box-shadow: -10px 0 40px rgba(15, 23, 42, 0.18);
  transform: translateX(104%);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.job-drawer.open {
  transform: none;
}

.job-drawer > header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.job-drawer header p {
  margin: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.job-drawer header h2 {
  margin: 4px 0 2px;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.job-drawer header code {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.job-drawer header button, .modal-card header button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 18px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.job-drawer header button:hover, .modal-card header button:hover {
  color: var(--ink);
  background: var(--paper-2);
}

.drawer-progress {
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.drawer-progress > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-progress > div:first-child b {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.progress-track {
  height: 6px;
  margin-top: 10px;
  border-radius: var(--radius-full);
  background: var(--paper-2);
  overflow: hidden;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent);
  transition: width 0.25s ease;
}

.drawer-progress ul {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.drawer-progress li {
  padding: 8px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--line);
  text-align: center;
}

.drawer-progress li span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.drawer-progress li b {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.drawer-tabs {
  height: 44px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 20px;
  background: var(--surface);
}

.drawer-tabs button {
  padding: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.drawer-tabs button.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.drawer-body {
  min-height: 0;
  flex: 1;
  background: #090d16;
  overflow: auto;
}

.drawer-body pre {
  min-height: 100%;
  margin: 0;
  padding: 16px 20px;
  color: #c8d3f5;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.drawer-result-list {
  padding: 16px;
  color: var(--ink);
  background: var(--surface);
  min-height: 100%;
}

.drawer-result-row {
  margin-bottom: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.drawer-result-row b {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.drawer-result-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.job-drawer footer {
  min-height: 64px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
}

.job-drawer footer > div {
  display: flex;
  gap: 8px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-card {
  width: min(640px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xl);
  animation: modalScaleIn var(--transition-normal) both;
}

@keyframes modalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-card header p {
  margin: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.modal-card header h2 {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.modal-intro {
  margin: 14px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.modal-actions {
  margin-top: 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.modal-actions label {
  width: 180px;
}

.modal-actions label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

/* Toast Notifications */
.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 440px;
  padding: 12px 16px;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  color: #ffffff;
  background: #0f172a;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  animation: toastSlideIn var(--transition-normal) both;
}

.toast.error {
  border-left-color: var(--red);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN ADAPTATIONS
   ========================================================================== */

@media (max-width: 1200px) {
  .metric-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .workflow-band {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .workflow-band ol {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-104%);
    box-shadow: 20px 0 60px rgba(15, 23, 42, 0.2);
  }
  .sidebar.open {
    transform: none;
  }
  .workspace {
    margin-left: 0;
  }
  .mobile-menu {
    display: inline-flex;
  }
  .breadcrumb span, .breadcrumb b {
    display: none;
  }
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .settings-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  .settings-nav button {
    border-left: 0;
    border-bottom: 2px solid var(--line);
    border-radius: 0;
    white-space: nowrap;
  }
  .settings-nav button.active {
    border-bottom-color: var(--accent);
  }
  .field-grid.four {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .topbar {
    height: 56px;
    padding: 0 16px;
  }
  .view {
    padding: 24px 14px 60px;
  }
  .top-actions .live-clock, .top-actions .compact {
    display: none;
  }
  .page-heading {
    flex-direction: column;
    gap: 14px;
  }
  .page-heading h1 {
    font-size: 22px;
  }
  .metric-strip {
    grid-template-columns: 1fr;
  }
  .workflow-band ol {
    grid-template-columns: 1fr;
  }
  .field-grid.two, .field-grid.three, .field-grid.four, .field-grid.two-wide {
    grid-template-columns: 1fr;
  }
  .result-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .activity-row {
    grid-template-columns: 20px minmax(0, 1fr) 60px;
  }
  .activity-row .mini-progress {
    display: none;
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    width: 100%;
  }
  .job-drawer {
    width: 100vw;
  }
  .job-drawer footer {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  .job-drawer footer > div {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .modal-actions label, .modal-actions button {
    width: 100%;
  }
}
