:root {
  --bg: #0c0f0e;
  --bg-elev: #141a18;
  --bg-soft: #1a221f;
  --line: rgba(232, 240, 234, 0.08);
  --text: #e8f0ea;
  --muted: #8a9a90;
  --accent: #c8f542;
  --accent-dim: rgba(200, 245, 66, 0.14);
  --green: #3dde8c;
  --red: #ff5c6a;
  --amber: #f0b429;
  --radius: 14px;
  --font: "Syne", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  background: var(--bg);
  overflow: hidden;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}
.glow {
  pointer-events: none;
  position: fixed;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(90px);
  z-index: 0;
  opacity: 0.22;
}
.glow-a { top: -12%; left: -8%; background: #1f4d3a; }
.glow-b { bottom: -18%; right: -10%; background: #3a4a12; }

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 220px 1fr;
  height: 100vh;
}

.rail {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20,26,24,0.92), rgba(12,15,14,0.98));
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: #10140f;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: #000;
  border: 1px solid rgba(200, 245, 66, 0.25);
}
.brand-text strong {
  display: block;
  font-size: 1.08rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.rail-account {
  display: grid;
  grid-template-columns: 36px 1fr 34px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(200, 245, 66, 0.04);
}
.rail-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #10140f;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: -0.04em;
}
.rail-account-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.rail-account-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.rail-user-name {
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-logout {
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.rail-logout:hover {
  color: var(--accent);
  border-color: rgba(200, 245, 66, 0.3);
  background: rgba(200, 245, 66, 0.06);
}
.rail-live {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 0 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}
.shell.is-app-hidden {
  visibility: hidden;
  pointer-events: none;
}
body.is-locked {
  overflow: hidden;
}
body.is-locked .glow,
body.is-locked .noise {
  opacity: 0.35;
}
.rail-nav { display: grid; gap: 8px; }
.rail-link {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}
.rail-link:hover { color: var(--text); background: var(--bg-soft); }
.rail-link.is-on {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(200,245,66,0.2);
}
.rail-foot {
  margin-top: auto;
  display: grid;
  gap: 0;
}
.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(61,222,140,0.5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(61,222,140,0); }
  100% { box-shadow: 0 0 0 0 rgba(61,222,140,0); }
}

.stage {
  overflow: auto;
  padding: 28px 32px 48px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.topbar h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.05em;
  font-weight: 800;
}
.topbar-sub { margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; }
.topbar-actions {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}
.field {
  display: grid;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.field select, .date-chip input[type="date"] {
  font-family: var(--mono);
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 180px;
}
.date-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
}
.date-chip button, .ghost {
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
}
.date-chip button:hover, .ghost:hover { background: var(--bg-soft); }
.ghost.danger { color: var(--red); }
.date-chip input[type="date"] {
  border: 0;
  background: transparent;
  min-width: 140px;
  padding: 6px;
}

.panel { display: none; animation: fade 0.35s ease; }
.panel.is-on { display: block; }
@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.kpi {
  background: linear-gradient(160deg, rgba(26,34,31,0.95), rgba(20,26,24,0.8));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 12px;
  display: grid;
  gap: 8px;
}
.kpi span {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kpi strong {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.kpi-g strong { color: var(--green); }
.kpi-r strong { color: var(--red); }
.kpi-u strong { color: var(--accent); }

.board {
  background: rgba(20,26,24,0.72);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  backdrop-filter: blur(10px);
}
.board-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.board-head h2 { margin: 0; font-size: 1rem; letter-spacing: -0.02em; margin-right: auto; }
.chip-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.chip.is-on {
  color: #10140f;
  background: var(--accent);
  border-color: var(--accent);
}

.table-wrap { overflow: auto; max-height: calc(100vh - 320px); }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  position: sticky;
  top: 0;
  background: #121816;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}
td { font-family: var(--mono); font-size: 0.8rem; }
.empty { text-align: center; color: var(--muted); padding: 40px !important; font-family: var(--font) !important; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-green { background: rgba(61,222,140,0.15); color: var(--green); }
.badge-red { background: rgba(255,92,106,0.15); color: var(--red); }
.badge-pending { background: rgba(240,180,41,0.15); color: var(--amber); }
.badge-tg { background: var(--accent-dim); color: var(--accent); }
.badge-off { color: var(--muted); }

.bots-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.bots-head h2 { margin: 0 0 6px; letter-spacing: -0.03em; }
.bots-head p { margin: 0; color: var(--muted); }

.bots-list {
  display: grid;
  gap: 12px;
}
.bot-block {
  position: relative;
  background: linear-gradient(165deg, #171e1b, #121816);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.bot-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 92, 106, 0.35);
  background: rgba(255, 92, 106, 0.08);
  color: #ff8a95;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0.75;
  transition: opacity .15s, background .15s, border-color .15s;
}
.bot-delete:hover {
  opacity: 1;
  background: rgba(255, 92, 106, 0.18);
  border-color: rgba(255, 92, 106, 0.55);
  color: #ffb0b8;
}
.bot-block:hover { border-color: rgba(200, 245, 66, 0.22); }
.bot-block.is-on {
  box-shadow: inset 3px 0 0 var(--accent);
}
.bot-block.is-expanded {
  border-color: rgba(200, 245, 66, 0.28);
}
.bot-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.9fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 44px 14px 16px;
}
.bot-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.bot-units-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  line-height: 1;
  flex-shrink: 0;
}
.bot-units-arrow svg {
  display: block;
}
.bot-units-arrow.up {
  color: #2f9e57;
  background: transparent;
}
.bot-units-arrow.down {
  color: #ff6b78;
  background: transparent;
}
.bot-units-arrow.is-empty {
  visibility: hidden;
}
.bot-row-left {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.bot-row-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.bot-live {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #10140f;
  background: var(--red);
  border-radius: 999px;
  padding: 3px 8px;
}
.bot-live.off {
  background: #3a4440;
  color: var(--muted);
}
.bot-id {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}
.bot-row h3 {
  margin: 0;
  font-size: 0.98rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bot-pill {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.bot-pill.bk {
  background: rgba(61, 222, 140, 0.16);
  color: var(--green);
}
.bot-pill.mkt {
  background: rgba(200, 245, 66, 0.14);
  color: var(--accent);
}
.bot-pill.st {
  background: rgba(232, 240, 234, 0.08);
  color: var(--muted);
}
.bot-pill.st.on {
  background: var(--accent-dim);
  color: var(--accent);
}
.bot-row-mid {
  display: grid;
  gap: 6px;
}
.bot-row-mid label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.bot-row-mid input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.bot-row-right {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}
.bot-row-right .toggle {
  margin-right: 4px;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.save {
  border: 0;
  background: var(--accent);
  color: #10140f;
  font: inherit;
  font-weight: 700;
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
}
.save:hover { filter: brightness(1.06); }
.bot-act {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
}
.bot-act:hover { background: var(--bg-soft); }
.bot-act.is-on {
  border-color: rgba(200, 245, 66, 0.45);
  background: var(--accent-dim);
  color: var(--accent);
}
.bot-act.primary {
  border: 0;
  background: var(--accent);
  color: #10140f;
}
.bot-act.primary:hover { filter: brightness(1.06); }

/* Ver â€” abre/fecha suave (altura + fade) */
.bot-drop {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  border-top: 1px solid transparent;
}
.bot-block.is-expanded .bot-drop {
  grid-template-rows: 1fr;
  border-top-color: var(--line);
}
.bot-drop-inner {
  overflow: hidden;
  min-height: 0;
  padding: 14px 16px 16px;
  background:
    linear-gradient(180deg, rgba(200, 245, 66, 0.04), transparent 48%),
    #0f1412;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 0.26s ease,
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.bot-block.is-expanded .bot-drop-inner {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition:
    opacity 0.28s ease 0.05s,
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-reduced-motion: reduce) {
  .bot-drop,
  .bot-drop-inner,
  .bot-block.is-expanded .bot-drop-inner {
    transition: none;
  }
}
.bot-drop-loading {
  color: var(--muted);
  font-size: 0.86rem;
  padding: 4px 0 8px;
}
.bot-drop-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.bot-drop-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.bot-drop-day {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
}
.bot-drop-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.drop-stat {
  background: rgba(26, 34, 31, 0.9);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
}
.drop-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}
.drop-stat strong {
  font-family: var(--mono);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.drop-stat.pos strong { color: var(--green); }
.drop-stat.neg strong { color: var(--red); }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  background: var(--accent);
  color: #10140f;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

/* HistÃ³rico â€” modal grande */
.confirm-card.hist-card {
  max-width: 1180px;
  width: min(1180px, 96vw);
  max-height: min(92vh, 860px);
  overflow: auto;
  padding: 0;
  background: linear-gradient(165deg, #171e1b 0%, #101614 55%, #0c100e 100%);
  border: 1px solid rgba(200, 245, 66, 0.16);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}
.hist-top {
  padding: 20px 24px 0;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 60% 80% at 0% 0%, rgba(200, 245, 66, 0.08), transparent 55%),
    linear-gradient(180deg, rgba(26, 34, 31, 0.65), transparent);
}
.hist-top-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.hist-identity {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-width: 0;
}
.hist-badge {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: #10140f;
  background: var(--accent);
  border-radius: 12px;
  padding: 10px 12px;
  line-height: 1;
}
.hist-identity-text { min-width: 0; }
.hist-kicker {
  margin: 0 0 4px;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.hist-identity-text h3 {
  margin: 0;
  font-size: 1.28rem;
  letter-spacing: -0.04em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(520px, 55vw);
}
.hist-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.hist-x {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  font-size: 1rem;
  flex-shrink: 0;
}
.hist-controls {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-bottom: 16px;
}
.hist-ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(12, 15, 14, 0.72);
  border: 1px solid var(--line);
  width: fit-content;
  max-width: 100%;
}
.hist-range {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 8px;
  padding: 8px 11px;
  cursor: pointer;
}
.hist-range:hover {
  color: var(--text);
  background: rgba(232, 240, 234, 0.06);
}
.hist-range.is-on {
  background: var(--accent);
  color: #10140f;
}
.hist-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-family: var(--mono);
}
.hist-meta strong { color: var(--accent); font-weight: 700; }
.hist-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(260px, 0.7fr);
  gap: 16px;
  padding: 16px 24px 24px;
}
.hist-chart-wrap,
.hist-side {
  background: rgba(12, 15, 14, 0.55);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}
.hist-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.hist-chart-head h4 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.02em;
}
.hist-chart-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.hist-legend {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.hist-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}
.lg-g { background: var(--green); }
.lg-r { background: var(--red); }
.lg-u { background: var(--accent); }
.hist-chart-stage {
  position: relative;
  margin-top: 4px;
}
.hist-chart {
  width: 100%;
  min-height: 360px;
}
.hist-empty {
  display: grid;
  place-items: center;
  min-height: 280px;
  color: var(--muted);
  font-size: 0.92rem;
}
.hist-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.hist-grid {
  stroke: rgba(232, 240, 234, 0.07);
  stroke-width: 1;
}
.hist-zero {
  stroke: rgba(200, 245, 66, 0.22);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}
.hist-axis {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}
.hist-axis-u { fill: rgba(200, 245, 66, 0.55); }
.hist-lab { font-size: 10px; }
.seg-g { fill: var(--green); }
.seg-r { fill: var(--red); }
.seg-empty { fill: rgba(232, 240, 234, 0.12); }
.hist-bar-g:hover .seg-g { filter: brightness(1.12); }
.hist-bar-g:hover .seg-r { filter: brightness(1.12); }
.hist-units-line {
  stroke: var(--accent);
  stroke-width: 2.25;
  stroke-linejoin: round;
  stroke-linecap: round;
  opacity: 0.95;
}
.hist-units-fill {
  fill: url(#histGrad);
  opacity: 0.35;
}
.hist-dot { fill: var(--accent); stroke: #0c0f0e; stroke-width: 1.5; }
.hist-float {
  position: absolute;
  z-index: 5;
  min-width: 168px;
  pointer-events: none;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0a0d0c;
  border: 1px solid rgba(200, 245, 66, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  font-size: 0.8rem;
}
.hist-float.is-hidden { display: none; }
.hf-date {
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  color: var(--accent);
  font-family: var(--mono);
}
.hf-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 3px 0;
  color: var(--muted);
}
.hf-row strong { color: var(--text); font-family: var(--mono); }
.hf-row strong.pos { color: var(--green); }
.hf-row strong.neg { color: var(--red); }
.hist-side-head h4 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.02em;
}
.hist-side-head p {
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 0.78rem;
}
.hist-kpi {
  background: linear-gradient(145deg, rgba(200, 245, 66, 0.1), rgba(26, 34, 31, 0.4));
  border: 1px solid rgba(200, 245, 66, 0.18);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.hist-kpi span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}
.hist-kpi strong {
  font-family: var(--mono);
  font-size: 1.65rem;
  letter-spacing: -0.03em;
}
.hist-kpi.pos strong { color: var(--green); }
.hist-kpi.neg strong { color: var(--red); }
.hist-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.hist-mini {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 10px;
}
.hist-mini span {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.hist-mini strong {
  font-family: var(--mono);
  font-size: 1.05rem;
}
.hist-mini.pos strong { color: var(--green); }
.hist-mini.neg strong { color: var(--red); }
.hist-side-foot {
  margin-top: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.hist-side-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.86rem;
}
.hist-side-row span { color: var(--muted); }
.hist-side-row strong { font-family: var(--mono); }
.hist-alltime {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(200, 245, 66, 0.06);
  border: 1px solid rgba(200, 245, 66, 0.14);
  display: grid;
  gap: 4px;
}
.hist-alltime span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.hist-alltime strong {
  font-family: var(--mono);
  font-size: 1.1rem;
}
.hist-alltime strong.pos { color: var(--green); }
.hist-alltime strong.neg { color: var(--red); }
.hist-alltime em {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .bot-row {
    grid-template-columns: 1fr;
  }
  .bot-row-right { justify-content: flex-start; }
  .bot-drop-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hist-layout { grid-template-columns: 1fr; }
  .hist-identity-text h3 { max-width: 70vw; }
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(6, 8, 7, 0.72);
  backdrop-filter: blur(6px);
  padding: 20px;
}
.confirm-overlay.is-hidden { display: none !important; }
.confirm-card {
  width: min(420px, 100%);
  background: linear-gradient(165deg, #1a221f, #121816);
  border: 1px solid rgba(255, 92, 106, 0.28);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: fade 0.2s ease;
}
.confirm-card h3 {
  margin: 0 0 10px;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}
.confirm-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.confirm-card strong { color: var(--text); }
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
.confirm-danger {
  border: 0;
  background: var(--red);
  color: #fff;
  font: inherit;
  font-weight: 700;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
}
.confirm-danger:hover { filter: brightness(1.08); }

.export-card { max-width: 420px; }
.confirm-card.hist-card {
  width: min(1180px, 96vw);
  max-width: 1180px;
  padding: 0;
  border-color: rgba(200, 245, 66, 0.16);
}
.export-sub {
  margin: 0 0 16px;
  color: var(--green);
  font-weight: 600;
  font-size: 0.95rem;
}
.export-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.export-range .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.export-range .field span {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.export-range input[type="date"] {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
}
.export-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}
.export-ok { min-width: 140px; }

/* â€”â€” ConexÃ£o Telegram â€”â€” */
.conn-layout {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 920px;
}
.conn-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.conn-kicker {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.conn-hero h2 {
  margin: 0;
  font-size: 1.85rem;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.conn-lead {
  margin: 10px 0 0;
  max-width: 42ch;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.95rem;
}
.conn-lead em { color: var(--accent); font-style: normal; font-weight: 600; }
.conn-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  font-family: var(--mono);
  font-size: 0.78rem;
  white-space: nowrap;
}
.conn-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.conn-status[data-state="connected"] {
  border-color: rgba(61, 222, 140, 0.35);
  background: rgba(61, 222, 140, 0.08);
  color: var(--green);
}
.conn-status[data-state="connected"] .conn-status-dot { background: var(--green); box-shadow: 0 0 10px var(--green); }
.conn-status[data-state="awaiting_code"],
.conn-status[data-state="awaiting_password"] {
  border-color: rgba(240, 180, 41, 0.35);
  color: var(--amber);
}
.conn-status[data-state="awaiting_code"] .conn-status-dot,
.conn-status[data-state="awaiting_password"] .conn-status-dot { background: var(--amber); }

.conn-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
}
.conn-main, .conn-side {
  padding: 22px 22px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(26, 34, 31, 0.9), rgba(20, 26, 24, 0.72));
  transition: opacity 0.25s ease, border-color 0.25s ease;
}
.conn-main.is-dim, .conn-side:not(.is-live) { opacity: 0.55; }
.conn-main.is-focus {
  opacity: 1;
  border-color: rgba(200, 245, 66, 0.28);
  box-shadow: 0 0 0 1px rgba(200, 245, 66, 0.08);
}
.conn-side.is-live {
  opacity: 1;
  border-color: rgba(61, 222, 140, 0.28);
}
.conn-main h3, .conn-side h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.conn-hint {
  margin: 0 0 18px;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}
.conn-hint a { color: var(--accent); text-decoration: none; }
.conn-hint a:hover { text-decoration: underline; }
.conn-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.conn-field-wide { grid-column: 1 / -1; }
.conn-fields .field span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--mono);
}
.conn-fields input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  padding: 11px 12px;
}
.conn-fields input:focus {
  outline: none;
  border-color: rgba(200, 245, 66, 0.45);
}
.conn-fields input.conn-secret {
  -webkit-text-security: disc;
}
.conn-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.conn-actions-col { flex-direction: column; align-items: stretch; }
.conn-as {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.conn-error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 92, 106, 0.35);
  background: rgba(255, 92, 106, 0.08);
  color: var(--red);
  font-size: 0.88rem;
  line-height: 1.4;
}
.conn-pass-wrap.is-hidden,
.field.is-hidden { display: none !important; }

@media (max-width: 860px) {
  .conn-hero { flex-direction: column; }
  .conn-grid { grid-template-columns: 1fr; }
  .conn-fields { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    overflow-x: auto;
  }
  .rail-nav { display: flex; }
  .rail-foot { display: none; }
  .stage { padding: 18px 16px 40px; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* â€”â€”â€” Panda Tips auth gate â€”â€”â€” */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: minmax(320px, 42vw) 1fr;
  background: #050605;
  overflow: hidden;
}
.auth-gate.is-hidden { display: none; }

.auth-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.auth-panda {
  position: absolute;
  right: -4%;
  bottom: -8%;
  height: min(108vh, 980px);
  width: auto;
  max-width: none;
  object-fit: contain;
  object-position: right bottom;
  filter: drop-shadow(0 0 40px rgba(200, 245, 66, 0.12));
  animation: panda-in 1.1s cubic-bezier(.16,1,.3,1) both;
}
.auth-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 70% at 78% 55%, transparent 0%, rgba(5,6,5,0.15) 45%, rgba(5,6,5,0.88) 78%),
    linear-gradient(90deg, #050605 0%, rgba(5,6,5,0.92) 28%, rgba(5,6,5,0.35) 52%, transparent 72%);
}
.auth-scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(200,245,66,0.04) 50%, transparent 60%);
  background-size: 220% 100%;
  animation: scan-slide 7s ease-in-out infinite;
}

.auth-panel {
  position: relative;
  z-index: 2;
  align-self: center;
  margin: 0 clamp(1.25rem, 4vw, 4.5rem);
  max-width: 420px;
  animation: form-in 0.85s cubic-bezier(.16,1,.3,1) 0.15s both;
}
.auth-brand { margin-bottom: 1.75rem; }
.auth-kicker {
  margin: 0 0 0.65rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.auth-title {
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  font-weight: 800;
}
.auth-title-panda { color: #f4f7f2; display: block; }
.auth-title-tips {
  display: block;
  color: var(--accent);
  text-shadow: 0 0 28px rgba(200, 245, 66, 0.35);
}
.auth-lead {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
  max-width: 28ch;
}
.auth-form {
  display: grid;
  gap: 0.85rem;
}
.auth-form.is-hidden { display: none; }
.auth-setup-hint {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}
.auth-field {
  display: grid;
  gap: 0.35rem;
}
.auth-field span {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.auth-field input {
  width: 100%;
  border: 1px solid rgba(232, 240, 234, 0.12);
  background: rgba(12, 15, 14, 0.72);
  color: var(--text);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-family: var(--font);
  font-size: 1rem;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.auth-field input:focus {
  border-color: rgba(200, 245, 66, 0.55);
  box-shadow: 0 0 0 3px rgba(200, 245, 66, 0.12);
}
.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin: 0.35rem 0 0.1rem;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: var(--mono);
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}
.auth-submit {
  margin-top: 0.35rem;
  border: 0;
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  background: var(--accent);
  color: #0c100a;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: transform .15s, filter .15s;
}
.auth-actions {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.25rem;
}
.auth-secondary {
  border: 1px solid rgba(200, 245, 66, 0.35);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  background: transparent;
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.auth-secondary:hover {
  background: rgba(200, 245, 66, 0.08);
  border-color: rgba(200, 245, 66, 0.55);
}
.auth-ok {
  min-height: 1.25rem;
  margin: 0.55rem 0 0;
  color: var(--accent);
  font-size: 0.88rem;
}
.auth-submit:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.auth-submit:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}
.auth-error {
  min-height: 1.25rem;
  margin: 0.85rem 0 0;
  color: var(--red);
  font-size: 0.88rem;
}

@keyframes panda-in {
  from { opacity: 0; transform: translateX(36px) scale(1.02); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes form-in {
  from { opacity: 0; transform: translateX(-18px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes scan-slide {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: 0% 0; }
}

@media (max-width: 900px) {
  .auth-gate {
    grid-template-columns: 1fr;
    align-content: start;
  }
  .auth-panel {
    margin: 8vh 1.25rem 0;
    max-width: none;
  }
  .auth-panda {
    right: 50%;
    transform: translateX(42%);
    bottom: -18%;
    height: 62vh;
    opacity: 0.55;
  }
  .auth-vignette {
    background:
      linear-gradient(180deg, #050605 0%, rgba(5,6,5,0.75) 42%, rgba(5,6,5,0.2) 70%),
      radial-gradient(ellipse at 70% 80%, transparent 0%, rgba(5,6,5,0.85) 75%);
  }
}

/* —— Convites (admin) —— */
.invites-layout { max-width: 720px; }
.invites-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.invites-kicker {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.invites-hero h2 {
  margin: 0 0 8px;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}
.invites-lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  max-width: 36rem;
}
.invites-list { display: grid; gap: 10px; }
.invites-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.invite-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 20, 18, 0.65);
}
.invite-row code {
  font-family: var(--mono);
  font-size: 0.78rem;
  word-break: break-all;
  color: var(--text);
}
.invite-row-meta {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}
.invite-pill {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}
.invite-pill.open {
  background: var(--accent-dim);
  color: var(--accent);
}
.invite-pill.used {
  background: rgba(232, 240, 234, 0.08);
  color: var(--muted);
}
.invite-card { border-color: rgba(200, 245, 66, 0.28); }
.invite-hint {
  margin: 0 0 14px !important;
}
.invite-code {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.4;
  word-break: break-all;
  color: var(--accent);
  user-select: all;
}
