:root {
  --bg: #040506;
  --bg-soft: #0a0c0f;
  --panel: rgba(13, 16, 20, 0.94);
  --panel-2: rgba(10, 12, 15, 0.98);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-border-strong: rgba(255, 255, 255, 0.14);
  --text: #f3f5f7;
  --muted: #8f98a4;
  --muted-strong: #cad1da;
  --accent: #eef2f6;
  --accent-2: #d5dce5;
  --blue: #94a3b8;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
  --shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 12px 26px rgba(0, 0, 0, 0.22);
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --transition: 180ms ease;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 255, 255, 0.05), transparent 30%),
    linear-gradient(180deg, #030405 0%, #050608 48%, #040506 100%);
  color: var(--text);
  overflow-x: hidden;
}

a {
  color: #d9e0e8;
  text-decoration: none;
}

a:hover {
  color: #ffffff;
}

button, input, select, textarea {
  font: inherit;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.18rem 0.4rem;
}

.ambient {
  position: fixed;
  inset: auto;
  width: 38rem;
  height: 38rem;
  border-radius: 999px;
  filter: blur(110px);
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
  animation: drift 15s ease-in-out infinite alternate;
}

.ambient-a {
  top: -12rem;
  right: -10rem;
  background: rgba(255, 255, 255, 0.32);
}

.ambient-b {
  bottom: -14rem;
  left: -10rem;
  background: rgba(148, 163, 184, 0.18);
  animation-duration: 18s;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at center, black 46%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.app-shell > :not(.ambient):not(.grid-overlay) {
  position: relative;
  z-index: 1;
}

.app-nav {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 0.9rem 0.9rem 1rem;
}

.app-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.7rem 0.9rem;
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(14, 17, 21, 0.96), rgba(9, 11, 14, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-soft);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.nav-brand {
  color: #f4f6f8;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.nav-link {
  padding: 0.46rem 0.72rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.nav-link:hover,
.nav-link.active {
  color: #f4f6f8;
  background: rgba(255, 255, 255, 0.05);
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  min-width: 0;
}

.nav-identity-pill {
  padding: 0.42rem 0.72rem;
  white-space: nowrap;
}

.panel,
.auth-panel,
.hero-card,
.bot-card {
  background: linear-gradient(180deg, rgba(14, 17, 21, 0.96), rgba(9, 11, 14, 0.98));
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.panel {
  border-radius: var(--radius-xl);
  padding: 1rem;
}

.inset-panel {
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(17, 20, 25, 0.9), rgba(10, 12, 15, 0.94));
}

.eyebrow {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.64rem;
  font-weight: 700;
}

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

.subheading {
  color: #e6e8ec;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.panel-header-row.compact {
  margin-bottom: 0.75rem;
}

.sticky-header {
  position: sticky;
  top: 0;
  padding-bottom: 0.75rem;
  background: linear-gradient(180deg, rgba(14, 17, 21, 0.98), rgba(14, 17, 21, 0.72));
  backdrop-filter: blur(12px);
  z-index: 2;
}

.btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  padding: 0.6rem 0.88rem;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(180deg, rgba(245, 247, 250, 0.96), rgba(212, 220, 229, 0.92));
  color: #06080b;
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-ghost {
  background: transparent;
}

.btn-success {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.32);
  color: #baf5ca;
}

.btn-success:hover,
.btn-success-soft:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
}

.btn-success-soft {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.2);
  color: #baf5ca;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.32);
  color: #ffc8c8;
}

.btn-danger:hover,
.btn-danger-soft:hover,
.btn-ghost.danger,
.danger {
  border-color: rgba(239, 68, 68, 0.3);
  color: #ffc8c8;
}

.btn-danger-soft {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: #ffc8c8;
}

.btn-block {
  width: 100%;
}

.status-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  display: inline-block;
}

.status-dot.live {
  background: var(--green);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.55);
}

.status-dot.subtle {
  background: rgba(255, 255, 255, 0.42);
}

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: 1.25rem;
}

.auth-layout {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 1.5rem;
  align-items: stretch;
  max-height: min(44rem, calc(100dvh - 2.5rem));
}

.auth-panel {
  border-radius: 24px;
  padding: 1.8rem;
  min-height: 0;
}

.auth-hero {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.auth-hero h1,
.topbar h1 {
  margin: 0;
  font-size: clamp(1.65rem, 2.1vw, 2.05rem);
  line-height: 1;
}

.auth-hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  line-height: 1;
}

.topbar h1 {
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

.auth-hero p {
  max-width: 42rem;
  color: #c6ccd4;
  font-size: 0.96rem;
  line-height: 1.55;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-points span,
.identity-pill,
.pill,
.hero-metric span:last-child {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.42rem 0.68rem;
}

.auth-form-panel h2,
.panel h2 {
  margin: 0.1rem 0 0;
  font-size: 1.05rem;
}

.auth-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.auth-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-form label,
.table-card label {
  display: grid;
  gap: 0.45rem;
  color: #d9dde4;
  font-size: 0.84rem;
}

input,
select,
textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-radius: 11px;
  padding: 0.72rem 0.84rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

textarea {
  resize: vertical;
  min-height: 5.8rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.banner {
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin-top: 1rem;
}

.banner.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ffd5db;
}

.info-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 1rem;
  border-radius: 14px;
  max-width: 30rem;
}

.auth-footer {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: var(--muted);
}

.dashboard-page {
  padding: 1rem;
  font-size: 13.5px;
}

#app {
  display: grid;
  gap: 1rem;
}

.page-summary {
  margin-top: 0.38rem;
  max-width: 40rem;
  font-size: 0.82rem;
}

.topbar,
.hero-strip,
.dashboard-layout {
  width: min(1540px, 100%);
  margin: 0 auto;
}

.page-topbar {
  padding-top: 0.1rem;
}

.notice-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 12;
  width: min(24rem, calc(100vw - 1.5rem));
  display: grid;
  gap: 0.75rem;
  pointer-events: none;
}

.notice {
  border-radius: 14px;
  padding: 0.72rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 15, 18, 0.96);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  pointer-events: auto;
}

.notice.error {
  border-color: rgba(239, 68, 68, 0.3);
  color: #ffd2d8;
}

.notice.info {
  border-color: rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
}

.notice.success {
  border-color: rgba(34, 197, 94, 0.28);
  color: #c9ffea;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.control-panel {
  padding: 0.9rem;
  margin: 0;
  width: 100%;
}

.control-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  align-items: start;
}

.toolbar-group {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}

.process-toolbar-group .button-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.console-toolbar-group .console-row {
  flex-wrap: nowrap;
}

.topbar-actions,
.pill-row,
.button-row,
.console-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.identity-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.hero-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.hero-metric {
  display: grid;
  align-content: start;
  gap: 0.38rem;
}

.hero-card {
  border-radius: 15px;
  padding: 0.9rem 0.96rem;
  overflow: hidden;
  position: relative;
}

.hero-card::after,
.bot-card::after {
  content: none;
}

.hero-metric strong {
  display: block;
  font-size: 1.52rem;
  margin: 0.16rem 0 0;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.hero-metric span:last-child {
  display: inline-flex;
  align-items: center;
  align-self: start;
  margin-top: 0.18rem;
  line-height: 1.2;
  padding: 0.48rem 0.74rem;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.fleet-column,
.detail-panel,
.admin-panel {
  min-width: 0;
}

.bot-grid {
  display: grid;
  gap: 0.65rem;
}

.bot-card {
  position: relative;
  border-radius: 13px;
  padding: 0.84rem 0.88rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
  overflow: hidden;
}

.bot-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.bot-card.selected {
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.bot-card-header,
.metric-row,
.detail-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.bot-card-header {
  margin-bottom: 0.35rem;
}

.bot-card-title strong {
  display: block;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.bot-card-meta {
  margin-bottom: 0.7rem;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.71rem;
}

.bot-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.mini-metric {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
  padding: 0.55rem 0.6rem;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mini-metric strong,
.mini-metric small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-metric strong {
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.mini-metric small {
  font-size: 0.68rem;
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.36rem 0.58rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill.online,
.pill.online {
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
  border: 1px solid rgba(34, 197, 94, 0.24);
}

.status-pill.warning,
.pill.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #fed7aa;
  border: 1px solid rgba(245, 158, 11, 0.24);
}

.status-pill.offline,
.pill.offline {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.24);
}

.pill-row {
  gap: 0.42rem;
}

.pill {
  padding: 0.28rem 0.52rem;
  border-radius: 999px;
  font-size: 0.68rem;
  color: #dde2e8;
}

.metric-stack {
  display: grid;
  gap: 0.5rem;
}

.metric-row {
  padding: 0.5rem 0.56rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.metric-label {
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.metric-value {
  text-align: right;
}

.metric-value strong {
  display: block;
  font-size: 0.84rem;
}

.metric-value small {
  font-size: 0.72rem;
}

.metric-value small {
  color: var(--muted);
}

.detail-column {
  display: grid;
  gap: 1rem;
}

.selected-panel {
  display: grid;
  gap: 0.95rem;
}

.selected-overview,
.selected-identity {
  display: grid;
}

.selected-overview {
  gap: 0.85rem;
}

.selected-identity {
  gap: 0.18rem;
}

.selected-summary {
  max-width: 52rem;
  line-height: 1.5;
}

.selected-status-row {
  min-height: 2rem;
  align-items: flex-start;
}

.selected-primary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
}

.selected-section {
  display: grid;
  gap: 0.8rem;
  padding: 0.95rem;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.022);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.process-section {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.016));
}

.selected-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.selected-section-copy {
  display: grid;
  gap: 0.18rem;
}

.selected-section-title {
  color: #eef2f6;
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.process-summary {
  max-width: 28rem;
  line-height: 1.35;
  text-align: right;
}

.process-action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  gap: 0.6rem;
}

.process-action-row .btn {
  width: 100%;
  min-width: 0;
  padding-inline: 0.78rem;
}

.detail-section-grid,
.metrics-grid,
.admin-sections {
  display: grid;
  gap: 0.8rem;
}

.detail-section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0.8rem;
}

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

.detail-metrics-grid {
  margin-top: 0;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
}

.selected-primary-metric,
.detail-metric {
  display: grid;
  gap: 0.42rem;
  padding: 0.82rem;
  border-radius: 13px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.selected-primary-metric {
  padding: 0.94rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.038), rgba(255, 255, 255, 0.02));
}

.selected-primary-metric strong,
.detail-metric strong {
  font-weight: 650;
  letter-spacing: -0.02em;
}

.selected-primary-metric strong {
  font-size: 1.08rem;
}

.detail-metric strong {
  font-size: 0.98rem;
}

.selected-primary-metric strong,
.detail-metric strong,
.mode-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selected-primary-metric .muted,
.detail-metric .muted {
  font-size: 0.74rem;
  line-height: 1.35;
}

.selected-primary-metric strong,
.detail-metric strong {
  white-space: nowrap;
}

.detail-metric {
  background: rgba(255, 255, 255, 0.022);
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.chart-panel {
  display: grid;
  gap: 0.9rem;
  min-width: 0;
}

.chart-panel-header {
  align-items: flex-start;
  margin-bottom: 0;
}

.chart-panel-side {
  display: grid;
  gap: 0.45rem;
  justify-items: end;
  text-align: right;
}

.chart-panel-full {
  width: 100%;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.66rem;
  color: var(--muted-strong);
}

.legend-chip.series-sell-revenue {
  --series-color: #c084fc;
}

.legend-chip.series-balance {
  --series-color: #60a5fa;
}

.legend-chip.series-orders-net {
  --series-color: #34d399;
}

.legend-chip.series-orders-gross {
  --series-color: #34d399;
}

.legend-chip.series-auto-pay {
  --series-color: #fb7185;
}

.legend-chip.series-ah-spent {
  --series-color: #fbbf24;
}

.legend-chip.series-production-total {
  --series-color: #f4f7fb;
}

.legend-label {
  color: var(--series-color, inherit);
}

.legend-swatch {
  display: inline-block;
  background: var(--series-color, rgba(255, 255, 255, 0.6));
}

.legend-swatch.line {
  width: 1rem;
  height: 0.18rem;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.legend-swatch.marker {
  width: 0.16rem;
  height: 0.85rem;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.chart-canvas {
  width: 100%;
  height: 280px;
  display: block;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(255,255,255,0.018), rgba(255,255,255,0.01));
}

.chart-canvas-wide {
  height: 320px;
}

.activity-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.63fr) minmax(0, 1.37fr);
  gap: 1rem;
}

.activity-panel,
.console-panel {
  min-width: 0;
}

.feed-list,
.table-list {
  display: grid;
  gap: 0.45rem;
}

.feed-item,
.table-card {
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.62rem 0.7rem;
}

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

.feed-item .meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.feed-item {
  font-size: 0.74rem;
  line-height: 1.35;
}

.feed-item strong {
  font-size: 0.76rem;
}

.log-stream {
  margin: 0;
  min-height: 28rem;
  max-height: 34rem;
  overflow-y: auto;
  overflow-x: auto;
  background: rgba(2, 4, 6, 0.7);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.92rem;
  color: #d7dce3;
  line-height: 1.45;
  font-size: 0.8rem;
  scrollbar-gutter: stable;
}

.console-command-bar {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mode-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.6rem;
}

.mode-control,
.table-card-grid {
  display: grid;
  gap: 0.45rem;
}

.mode-control {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.78rem 0.82rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mode-control.active {
  border-color: rgba(34, 197, 94, 0.2);
  background: rgba(34, 197, 94, 0.06);
}

.mode-copy {
  display: grid;
  gap: 0.22rem;
}

.mode-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mode-name {
  min-width: 0;
  color: #e5e7eb;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.mode-state {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.46rem;
  border-radius: 999px;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mode-state.active {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.24);
  color: #bbf7d0;
}

.mode-control .mini-actions {
  justify-content: flex-end;
}

.mode-control .mini-actions .btn {
  min-width: 4.75rem;
  padding: 0.38rem 0.66rem;
  font-size: 0.69rem;
}

.admin-sections {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.directory-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-bottom: 0.8rem;
}

.admin-block {
  min-width: 0;
}

.bot-definitions-block {
  min-width: 0;
}

.directory-card,
.bot-config-card {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.8rem 0.86rem;
}

.directory-card {
  display: grid;
  gap: 0.55rem;
}

.directory-card-header,
.bot-config-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.7rem;
}

.directory-card-header strong,
.bot-config-header strong {
  font-size: 0.9rem;
  letter-spacing: -0.015em;
}

.directory-meta-grid,
.bot-config-layout {
  display: grid;
  gap: 0.65rem;
}

.directory-meta-grid.two-col,
.bot-config-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.directory-meta-grid .full-span {
  grid-column: 1 / -1;
}

.compact-grid {
  gap: 0.5rem 0.7rem;
}

.bot-config-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.bot-config-card {
  display: grid;
  gap: 0.7rem;
}

#adminApp {
  display: grid;
  gap: 1rem;
}

.admin-hero-strip,
.admin-page-layout {
  width: min(1540px, 100%);
  margin: 0 auto;
}

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

.admin-page-layout {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.admin-sidebar-column,
.admin-main-column {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.admin-summary-panel,
.admin-action-panel,
.admin-directory-panel {
  min-width: 0;
}

.admin-directory-panel,
.admin-action-panel,
.admin-summary-panel {
  display: grid;
  gap: 0.9rem;
}

.admin-panel-header {
  align-items: start;
  margin-bottom: 0;
}

.admin-section-summary {
  margin-top: 0.38rem;
  max-width: 42rem;
  font-size: 0.79rem;
  line-height: 1.45;
}

.admin-form-card {
  display: grid;
  gap: 0.8rem;
  padding: 0.95rem;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.024);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-form-field {
  display: grid;
  gap: 0.42rem;
  color: #d9dde4;
  font-size: 0.8rem;
}

.admin-form-field span {
  color: var(--muted-strong);
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.account-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem;
}

.account-badge-card {
  display: grid;
  gap: 0.22rem;
  padding: 0.82rem;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.024);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.account-badge-card strong {
  color: #eef2f6;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.admin-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.8rem;
}

.admin-entry-card {
  display: grid;
  gap: 0.72rem;
  padding: 0.9rem;
}

.admin-entry-card .directory-card-header > div {
  min-width: 0;
}

.admin-entry-card .directory-card-header .eyebrow {
  margin-bottom: 0.18rem;
}

.admin-entry-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem 0.72rem;
}

.admin-entry-grid > div {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
  padding: 0.58rem 0.62rem;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.055);
}

.admin-entry-grid > div > div {
  min-width: 0;
  color: #e6ebf1;
  font-size: 0.77rem;
  line-height: 1.4;
}

.admin-entry-actions {
  justify-content: flex-end;
  padding-top: 0.05rem;
}

.admin-entry-actions .btn {
  min-width: 5.75rem;
}

.bot-config-group {
  display: grid;
  gap: 0.42rem;
}

.startup-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.mode-chip,
.toggle-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.5rem 0.58rem;
}

.mode-chip.checked,
.toggle-chip.checked {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.mode-chip input,
.toggle-chip input {
  width: auto;
  margin: 0;
  accent-color: #d7dee7;
}

.mode-chip span,
.toggle-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  color: #e5e7eb;
}

.bot-config-toggles {
  display: grid;
  gap: 0.45rem;
}

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

.console-row input {
  flex: 1;
  min-width: 16rem;
}

.table-card-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.small-label {
  font-size: 0.68rem;
  color: var(--muted);
}

.mini-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.empty-state {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  padding: 0.9rem;
  color: var(--muted);
}

.selected-primary-grid .empty-state,
.detail-metrics-grid .empty-state,
.mode-toolbar .empty-state,
.admin-directory-grid .empty-state,
.account-badge-grid .empty-state {
  grid-column: 1 / -1;
}

.stats-page-topbar,
.stats-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
}

.stats-page-topbar {
  padding: 0 0.2rem 0.2rem;
}

.stats-shell {
  display: grid;
  gap: 1rem;
}

.stats-surface,
.stats-table-shell {
  min-width: 0;
}

.stats-surface {
  padding: 1rem 1.05rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 12, 15, 0.84);
  box-shadow: none;
  backdrop-filter: none;
}

.stats-toolbar {
  display: grid;
  gap: 0.95rem;
}

.stats-toolbar-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.stats-toolbar-row-stack {
  align-items: stretch;
}

.stats-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.stats-chip-row {
  gap: 0.5rem;
  margin-top: 0.45rem;
}

.stats-chip-button {
  min-width: 4.2rem;
}

.stats-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.55rem;
  flex: 1;
}

.stats-toggle-chip {
  align-items: flex-start;
  padding: 0.68rem 0.74rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}

.stats-toggle-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.stats-toggle-copy strong,
.stats-toggle-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-toggle-copy strong {
  color: #eef2f6;
  font-size: 0.8rem;
  letter-spacing: -0.015em;
}

.stats-toggle-copy small {
  color: var(--muted);
  font-size: 0.69rem;
}

.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.stats-kpi-card {
  display: grid;
  gap: 0.35rem;
}

.stats-kpi-card strong {
  font-size: clamp(1.45rem, 2vw, 1.95rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.stats-kpi-card span:last-child {
  line-height: 1.35;
}

.stats-main-grid,
.stats-secondary-grid,
.stats-table-grid {
  display: grid;
  gap: 1rem;
}

.stats-main-grid {
  grid-template-columns: minmax(0, 1.9fr) minmax(320px, 0.95fr);
}

.stats-secondary-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.85fr);
}

.stats-table-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.stats-section-header h2 {
  margin: 0.08rem 0 0;
  font-size: 1.02rem;
}

.stats-chart-surface {
  display: grid;
  gap: 0.85rem;
}

.stats-side-surface {
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.stats-donut-canvas {
  height: 260px;
}

.stats-mix-list,
.stats-callout-list,
.stats-rank-list {
  display: grid;
  gap: 0.55rem;
}

.stats-mix-row,
.stats-callout-row,
.stats-rank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.68rem 0.74rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}

.stats-mix-label,
.stats-rank-copy,
.stats-rank-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.stats-mix-label {
  min-width: 0;
}

.stats-mix-swatch {
  width: 0.68rem;
  height: 0.68rem;
  border-radius: 2px;
  flex: 0 0 auto;
}

.stats-mix-values {
  display: grid;
  justify-items: end;
  text-align: right;
  gap: 0.1rem;
}

.stats-callout-row {
  align-items: flex-start;
  flex-direction: column;
}

.stats-callout-row strong {
  font-size: 0.92rem;
  line-height: 1.35;
}

.stats-rank-row {
  padding: 0.72rem 0.78rem;
}

.stats-rank-copy {
  min-width: 0;
}

.stats-rank-index {
  width: 1.5rem;
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  flex: 0 0 auto;
}

.stats-rank-title {
  color: #eef2f6;
  font-size: 0.86rem;
  font-weight: 600;
}

.stats-rank-value {
  color: #eef2f6;
  font-size: 0.9rem;
  font-weight: 650;
  white-space: nowrap;
}

.stats-table-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.018);
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

.stats-table th,
.stats-table td {
  padding: 0.78rem 0.82rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.77rem;
  white-space: nowrap;
}

.stats-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(10, 12, 15, 0.98);
  color: var(--muted-strong);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.stats-table tfoot td {
  background: rgba(255, 255, 255, 0.03);
  border-bottom: none;
  font-weight: 650;
}

.stats-table-primary {
  color: #eef2f6;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(1.5rem, -1.8rem, 0) scale(1.08);
  }
}

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

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .admin-page-layout {
    grid-template-columns: 1fr;
  }

  .chart-grid,
  .activity-grid,
  .stats-main-grid,
  .stats-secondary-grid,
  .stats-table-grid-two {
    grid-template-columns: 1fr;
  }

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

  .admin-sections {
    grid-template-columns: 1fr;
  }

  .bot-config-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 980px) {
  .app-nav-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-left,
  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-actions {
    width: 100%;
  }

  .auth-page {
    height: auto;
    min-height: 100dvh;
    overflow-y: auto;
  }

  .auth-layout,
  .hero-strip,
  .chart-grid,
  .activity-grid,
  .admin-hero-strip,
  .admin-directory-grid,
  .account-badge-grid,
  .admin-entry-grid,
  .detail-section-grid,
  .mode-toolbar,
  .directory-grid,
  .bot-config-layout,
  .startup-mode-grid,
  .table-card-grid.two,
  .stats-kpi-grid {
    grid-template-columns: 1fr;
  }

  .stats-toolbar-row,
  .stats-toolbar-actions,
  .stats-section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .bot-card-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .console-toolbar-group .console-row {
    flex-wrap: wrap;
  }

  .auth-layout {
    max-height: none;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .chart-panel-header,
  .chart-panel-side {
    align-items: start;
    justify-items: start;
    text-align: left;
  }

  .selected-section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .process-summary {
    max-width: none;
    text-align: left;
  }

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

  .chart-canvas {
    height: 240px;
  }

  .chart-canvas-wide {
    height: 260px;
  }

  .log-stream {
    min-height: 22rem;
    max-height: 28rem;
  }
}

@media (max-width: 620px) {
  .process-action-row {
    grid-template-columns: 1fr;
  }

  .bot-card-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .bot-card-metrics {
    grid-template-columns: 1fr;
  }
}

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