:root {
  --tela-ink: #15202b;
  --tela-panel: #1e2a38;
  --tela-panel-2: #243447;
  --tela-sand: #e8e0d4;
  --tela-muted: #9aa7b8;
  --tela-accent: #c45c26;
  --tela-ok: #2f6f4e;
  --tela-warn: #8a6d1d;
  --tela-down: #8b2e2e;
}

body.admin-body {
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(196, 92, 38, 0.18), transparent),
    linear-gradient(165deg, #121820 0%, #1a2332 45%, #121820 100%);
  color: var(--tela-sand);
}

.admin-nav {
  background: rgba(18, 24, 32, 0.92);
  backdrop-filter: blur(8px);
}

.admin-nav .navbar-brand,
.admin-nav .nav-link {
  color: var(--tela-sand) !important;
}

.admin-nav .nav-link.active {
  color: #fff !important;
  border-bottom: 2px solid var(--tela-accent);
}

.admin-nav .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.25);
}

.admin-nav .navbar-toggler-icon {
  filter: invert(1);
}

.panel {
  background: var(--tela-panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  height: 100%;
}

.panel h2,
.panel h3 {
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tela-muted);
  margin-bottom: 1rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

.stat-label {
  color: var(--tela-muted);
  font-size: 0.85rem;
}

.form-control,
.form-select {
  background: var(--tela-panel-2);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--tela-sand);
}

.form-control:focus,
.form-select:focus {
  background: var(--tela-panel-2);
  border-color: var(--tela-accent);
  color: var(--tela-sand);
  box-shadow: 0 0 0 0.2rem rgba(196, 92, 38, 0.25);
}

.form-control::placeholder {
  color: rgba(232, 224, 212, 0.45);
}

.form-select option {
  background: #1e2a38;
  color: var(--tela-sand);
}

.btn-tela {
  background: var(--tela-accent);
  border: 0;
  color: #fff;
}

.btn-tela:hover {
  background: #a74b1d;
  color: #fff;
}

.badge-status-ok { background: var(--tela-ok); }
.badge-status-degraded { background: var(--tela-warn); }
.badge-status-down { background: var(--tela-down); }

.table-admin {
  --bs-table-bg: transparent;
  --bs-table-color: var(--tela-sand);
  --bs-table-border-color: rgba(255, 255, 255, 0.08);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
  --bs-table-hover-bg: rgba(196, 92, 38, 0.12);
  color: var(--tela-sand);
}

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

.chart-wrap {
  position: relative;
  height: 260px;
}

.live-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--tela-ok);
  box-shadow: 0 0 0 0 rgba(47, 111, 78, 0.7);
  animation: pulse 1.6s infinite;
  margin-right: 0.4rem;
  vertical-align: middle;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 111, 78, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(47, 111, 78, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 111, 78, 0); }
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.alert {
  border: 0;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 70vh;
  overflow: auto;
  padding-right: 0.25rem;
}

.analyst-thread {
  max-height: 50vh;
  min-height: 180px;
}

.bubble {
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  background: rgba(0, 0, 0, 0.22);
}

.bubble.user { background: #2a3a4d; }
.bubble.assistant { background: #243628; }
.bubble.system,
.bubble.tool,
.bubble.summary { background: rgba(0, 0, 0, 0.28); opacity: 0.95; }

.bubble-role {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tela-muted);
  margin-bottom: 0.35rem;
}

.bubble-body {
  white-space: normal;
  word-break: break-word;
}

.bubble-detail {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  color: #c9d4e0;
}

.font-monospace {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

