/* Pokedata — tema técnico dark-only. Roxo (identidade) + verde (dados vivos/ok)
   + laranja reservado a variáveis importantes (receita, CAPI, conversão). */
:root {
  color-scheme: dark;
  --page: #0b0d10;
  --surface: #12151a;
  --surface-2: #171b21;
  --ink-1: #e6edf3;
  --ink-2: #9da7b3;
  --muted: #6e7681;
  --grid: #21262d;
  --baseline: #30363d;
  --border: rgba(255, 255, 255, 0.08);
  --purple: #a78bfa;      /* acento primário */
  --purple-dim: #6e46d9;
  --green: #3fb950;       /* vivo / ok / tempo real */
  --orange: #f0883e;      /* variáveis importantes */
  --critical: #f85149;
  /* rampa ordinal roxa do funil (validada vs --surface) */
  --funnel-1: #cdbdfc;
  --funnel-2: #a78bfa;
  --funnel-3: #8a63f4;
  --funnel-4: #6e46d9;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
body {
  font-family: var(--mono);
  background: var(--page);
  color: var(--ink-1);
  font-size: 13px;
  line-height: 1.55;
}
a { color: var(--purple); }
::selection { background: var(--purple-dim); color: #fff; }

/* layout com menu lateral */
.layout { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
.layout, .content { min-width: 0; } /* impede que conteúdo intrínseco force o grid a estourar a viewport no mobile */
.sidebar {
  background: var(--surface); border-right: 1px solid var(--grid);
  padding: 14px 12px; display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh;
}
.side-nav { display: grid; gap: 2px; }
.nav-item {
  display: block; padding: 7px 10px; border-radius: 4px; color: var(--ink-2);
  text-decoration: none; font-size: 12px; letter-spacing: 0.5px;
  border-left: 2px solid transparent;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink-1); }
.nav-item.active {
  background: var(--surface-2); color: var(--purple);
  border-left-color: var(--purple); font-weight: 650;
}
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.version { color: var(--muted); font-size: 10px; letter-spacing: 1px; }

/* mobile: sidebar vira um cabeçalho fixo de duas linhas — marca+status
   numa linha, navegação como abas de largura igual na linha de baixo.
   Sem scroll horizontal nem barras de rolagem visíveis: cabe tudo. */
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; width: 100%;
    display: grid; grid-template-columns: 1fr auto; grid-template-areas: "brand foot" "nav nav";
    align-items: center; row-gap: 10px; column-gap: 10px;
    padding: 12px 14px 0; border-right: none; border-bottom: 1px solid var(--grid);
  }
  .brand { grid-area: brand; }
  .brand h1 { white-space: nowrap; }
  .side-foot { grid-area: foot; margin: 0; flex-direction: row; align-items: center; gap: 8px; }
  .version { display: none; } /* redundante no espaço apertado do mobile */
  .side-nav {
    grid-area: nav; display: flex; gap: 0;
    border-top: 1px solid var(--grid); margin: 0 -14px;
  }
  .side-nav .nav-item {
    flex: 1; text-align: center; white-space: nowrap;
    border-left: none; border-bottom: 2px solid transparent; border-radius: 0;
    padding: 10px 4px;
  }
  .nav-item.active { background: transparent; border-left-color: transparent; border-bottom-color: var(--purple); }
  #project-nav { display: contents; } /* achata o grupo: os links viram abas iguais junto de "Projetos" */
  .project-nav-name { display: none; } /* já aparece no subtítulo abaixo da topbar */
  .tree-prefix { display: none; } /* glifos de árvore (▸ └) só fazem sentido na lista vertical do desktop */
}

/* barra superior */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; border-bottom: 1px solid var(--grid);
  background: var(--surface); position: sticky; top: 0; z-index: 10;
  flex-wrap: wrap; gap: 8px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 16px; letter-spacing: 0.5px; }
.brand h1::before { content: "> "; color: var(--green); }
.subtitle { color: var(--muted); font-size: 11px; }
.pokeball {
  width: 18px; height: 18px; border-radius: 50%; display: inline-block;
  background: linear-gradient(180deg, var(--purple) 46%, var(--page) 46%, var(--page) 54%, var(--surface-2) 54%);
  border: 2px solid var(--purple); position: relative;
}
.pokeball::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--page); border: 2px solid var(--purple);
}
.topbar-right { display: flex; gap: 8px; align-items: center; }

/* seletor de período — dropdown com presets + calendário embutido */
.period-picker { position: relative; }
.period-trigger {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface-2); color: var(--ink-1); font: inherit; font-size: 11.5px;
  border: 1px solid var(--baseline); border-radius: 4px; padding: 5px 10px; cursor: pointer;
}
.period-trigger:hover { border-color: var(--purple); }
.period-cal-icon { color: var(--purple); font-size: 11px; }
.period-caret { color: var(--muted); font-size: 9px; transition: transform 0.15s; }
.period-trigger[aria-expanded="true"] .period-caret { transform: rotate(180deg); }

.period-panel {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--purple-dim); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); padding: 10px;
  width: min(280px, calc(100vw - 24px)); /* nunca estoura a tela em viewports estreitas */
  display: grid; gap: 10px;
}
@media (max-width: 480px) {
  /* o botão pode ficar em qualquer lugar da topbar (que quebra linha no
     mobile) — em vez de ancorar no trigger (podendo cortar a lateral),
     fixa como uma folha centralizada, sempre inteira na tela */
  .period-panel {
    position: fixed; top: auto; bottom: 14px; left: 12px; right: 12px;
    width: auto; max-width: 340px; margin: 0 auto;
  }
}
.period-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.period-preset {
  background: var(--surface-2); border: 1px solid var(--baseline); color: var(--ink-2);
  border-radius: 5px; padding: 6px 8px; font: inherit; font-size: 11px; cursor: pointer;
  text-align: left;
}
.period-preset:hover { border-color: var(--purple); color: var(--ink-1); }
.period-preset.active { border-color: var(--purple); color: var(--purple); background: rgba(167, 139, 250, 0.1); }

.period-cal { border-top: 1px solid var(--grid); padding-top: 10px; display: grid; gap: 8px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
#cal-month-label { font-size: 11.5px; color: var(--ink-1); font-weight: 650; text-transform: capitalize; }
.cal-nav {
  background: transparent; border: 1px solid var(--baseline); color: var(--ink-2);
  border-radius: 4px; width: 22px; height: 22px; font: inherit; cursor: pointer; line-height: 1;
}
.cal-nav:hover { border-color: var(--purple); color: var(--purple); }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-weekdays span { text-align: center; font-size: 9.5px; color: var(--muted); padding: 2px 0; }
.cal-day {
  background: transparent; border: none; color: var(--ink-1); font: inherit; font-size: 11px;
  border-radius: 4px; padding: 5px 0; cursor: pointer; text-align: center; font-variant-numeric: tabular-nums;
}
.cal-day:hover:not(:disabled) { background: var(--surface-2); }
.cal-day:disabled { color: var(--grid); cursor: default; }
.cal-day.other-month { color: var(--muted); }
.cal-day.today { color: var(--green); font-weight: 650; }
.cal-day.in-range { background: rgba(167, 139, 250, 0.14); border-radius: 0; }
.cal-day.range-start, .cal-day.range-end { background: var(--purple-dim); color: #fff; font-weight: 650; }
.cal-day.range-start { border-radius: 4px 0 0 4px; }
.cal-day.range-end { border-radius: 0 4px 4px 0; }
.cal-day.range-start.range-end { border-radius: 4px; }
.period-cal-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.period-cal-foot .dim { color: var(--muted); font-size: 10.5px; }
#cal-apply {
  background: transparent; border: 1px solid var(--purple-dim); color: var(--purple);
  border-radius: 4px; padding: 5px 12px; font: inherit; font-size: 11.5px; cursor: pointer;
}
#cal-apply:hover:not(:disabled) { background: var(--purple-dim); color: #fff; }
#cal-apply:disabled { opacity: 0.35; cursor: default; }

/* paginação */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; }
.pager-btn {
  background: transparent; border: 1px solid var(--baseline); color: var(--ink-2);
  border-radius: 4px; padding: 5px 12px; font: inherit; font-size: 11.5px; cursor: pointer;
}
.pager-btn:hover:not(:disabled) { border-color: var(--purple); color: var(--purple); }
.pager-btn:disabled { opacity: 0.35; cursor: default; }
.pager-info { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pill {
  border: 1px solid var(--border); border-radius: 4px; padding: 3px 10px;
  font-size: 11px; color: var(--ink-2); background: var(--surface-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
.pill.ok { color: var(--green); border-color: rgba(63, 185, 80, 0.4); }
.pill.err { color: var(--orange); border-color: rgba(240, 136, 62, 0.4); }
.online-pill b { color: var(--green); }
@keyframes pulse { 50% { opacity: 0.35; } }

main { max-width: 1180px; margin: 0 auto; padding: 20px; display: grid; gap: 14px; min-width: 0; }
main[hidden] { display: none; }
main > * { min-width: 0; } /* impede que grids internos (tiles, painéis) estourem a largura no mobile */

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; min-width: 0; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  padding: 12px 16px; display: grid; gap: 2px; position: relative; min-width: 0;
}
.tile::before { content: "//"; position: absolute; top: 10px; right: 12px; color: var(--grid); font-size: 11px; }
.tile-label { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.tile-value { font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; }
/* variáveis importantes em laranja: compras e receita */
.tile:nth-child(3) .tile-value, .tile:nth-child(4) .tile-value { color: var(--orange); }

.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  padding: 14px 18px;
}
.panel h2 {
  font-size: 11px; font-weight: 600; margin-bottom: 12px; color: var(--purple);
  text-transform: uppercase; letter-spacing: 1.2px;
}
.panel h2::before { content: "# "; color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.empty { color: var(--muted); font-size: 12px; }

@media (max-width: 600px) {
  main { padding: 14px; gap: 12px; }
  .topbar { padding: 10px 14px; }
  .panel { padding: 12px 14px; }
  .tile { padding: 10px 12px; }
  .tile-value { font-size: 22px; }
  .d-head img { width: 60px; height: 60px; }
  .d-head img.hd { width: 84px; height: 84px; }
}

/* cards de visitantes online */
.online-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.v-card {
  border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px;
  display: flex; gap: 12px; align-items: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s; background: var(--surface-2);
  text-align: left; color: inherit; font: inherit; width: 100%;
}
.v-card:hover { border-color: var(--purple); background: var(--surface); }
.v-sprite {
  width: 52px; height: 52px; flex: none; border-radius: 6px;
  background: var(--page); border: 1px solid var(--grid);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.v-sprite img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; }
.v-info { min-width: 0; display: grid; gap: 1px; }
.v-name { font-weight: 650; display: flex; align-items: center; gap: 6px; color: var(--purple); }
.v-name .lvl { color: var(--muted); font-weight: 400; font-size: 11px; }
.v-meta { font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-time { font-variant-numeric: tabular-nums; color: var(--green); font-size: 11.5px; white-space: nowrap; }
.badge {
  font-size: 10px; border-radius: 3px; padding: 1px 7px; border: 1px solid var(--baseline);
  color: var(--ink-2); display: inline-block; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge.s2 { border-color: var(--funnel-2); color: var(--funnel-2); }
.badge.s3 { border-color: var(--funnel-3); color: var(--funnel-2); }
.badge.s4 { border-color: var(--orange); color: var(--orange); font-weight: 650; }

/* funil — barras horizontais, rampa ordinal roxa, extremidades 4px, vão 2px */
.funnel { display: grid; gap: 2px; }
.f-row { display: grid; grid-template-columns: 96px 1fr 56px; align-items: center; gap: 10px; }
.f-label { font-size: 11px; color: var(--ink-2); text-align: right; }
.f-track { position: relative; height: 22px; border-left: 2px solid var(--baseline); }
.f-bar {
  position: absolute; inset: 2px auto 2px 0; min-width: 2px;
  border-radius: 0 4px 4px 0; transition: width 0.4s;
}
.f-value { font-size: 11.5px; color: var(--ink-1); font-variant-numeric: tabular-nums; }
.table-view { margin-top: 10px; font-size: 11.5px; color: var(--ink-2); }
.table-view summary { cursor: pointer; color: var(--muted); }
.table-view table { border-collapse: collapse; margin-top: 6px; }
.table-view td, .table-view th { border: 1px solid var(--grid); padding: 3px 10px; text-align: left; }

/* feed ao vivo */
.live-feed { list-style: none; max-height: 260px; overflow-y: auto; display: grid; gap: 5px; padding: 0; }
.live-feed li {
  display: flex; gap: 8px; align-items: center; font-size: 11.5px;
  border-bottom: 1px dashed var(--grid); padding-bottom: 5px; color: var(--ink-2);
}
.live-feed li::before { content: "»"; color: var(--green); }
.live-feed img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }
.live-feed b { color: var(--purple); font-weight: 650; }
.live-feed .ev { color: var(--ink-1); }
.live-feed time { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }

/* filtros da pokédex — barra única, estilo campo de busca unificado */
.filters-bar {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 2px;
  background: var(--page); border: 1px solid var(--baseline); border-radius: 7px;
  padding: 3px 6px; margin-bottom: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; -ms-overflow-style: none;
}
.filters-bar::-webkit-scrollbar { display: none; height: 0; }
.f-icon { color: var(--muted); font-size: 12px; padding: 0 4px 0 4px; flex: none; }
.f-sep { width: 1px; align-self: stretch; margin: 4px 2px; background: var(--grid); flex: none; }
.filters-bar input, .filters-bar select {
  background: transparent; border: none; color: var(--ink-1);
  border-radius: 4px; padding: 7px 6px; font: inherit; font-size: 11.5px;
  color-scheme: dark; flex: 1 1 0; min-width: 0;
}
.filters-bar select { flex-basis: 88px; }
.filters-bar input[type="text"] { flex-basis: 72px; }
.filters-bar input[type="number"] { flex: 0 1 88px; min-width: 60px; }
.filters-bar input::placeholder { color: var(--muted); }
.f-toggle {
  display: flex; align-items: center; gap: 5px; flex: none;
  font-size: 11.5px; color: var(--ink-2); white-space: nowrap; cursor: pointer;
  padding: 0 6px;
}
.f-toggle input { flex: none; cursor: pointer; }
.badge-merged {
  font-size: 9.5px; color: var(--muted); border: 1px solid var(--grid);
  border-radius: 3px; padding: 0 4px; margin-left: 4px;
}
.filters-bar input:focus, .filters-bar select:focus {
  outline: none; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--purple);
}
.filters-bar button {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  border-radius: 5px; width: 26px; height: 26px; flex: none; font: inherit; font-size: 12px;
  cursor: pointer; margin-left: 4px; line-height: 1;
}
.filters-bar button:hover { border-color: var(--critical); color: var(--critical); }

/* mobile: campos mantêm largura fixa e legível, a barra rola em vez de
   espremer tudo até ficar ilegível — mesma lógica já usada na tabela */
@media (max-width: 600px) {
  .filters-bar select { flex: none; width: 108px; }
  .filters-bar input[type="text"] { flex: none; width: 104px; }
  .filters-bar input[type="number"] { flex: none; min-width: 0; width: 84px; }
}

/* tabela pokédex */
.table-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; -ms-overflow-style: none;
}
.table-scroll::-webkit-scrollbar { display: none; height: 0; }
.visitors-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.visitors-table th {
  text-align: left; color: var(--muted); font-weight: 500; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 1px;
  border-bottom: 1px solid var(--baseline); padding: 6px 10px;
}
.visitors-table td { padding: 6px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.visitors-table tbody tr { cursor: pointer; }
.visitors-table tbody tr:hover { background: var(--surface-2); }
.cell-poke { display: flex; align-items: center; gap: 8px; color: var(--purple); font-weight: 600; }
.cell-poke img { width: 26px; height: 26px; object-fit: contain; image-rendering: pixelated; }
.num { font-variant-numeric: tabular-nums; }

/* drawer da timeline */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 20; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw);
  background: var(--surface); border-left: 1px solid var(--purple-dim); z-index: 21;
  overflow-y: auto; padding: 20px;
}
.drawer-close {
  position: absolute; top: 8px; right: 12px; font-size: 20px; border: none;
  background: none; color: var(--ink-2); cursor: pointer; font-family: var(--mono);
}
.drawer-close:hover { color: var(--critical); }
.d-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.d-head img { width: 72px; height: 72px; object-fit: contain; image-rendering: pixelated; }
.d-head img.hd { width: 110px; height: 110px; image-rendering: auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4)); }
.d-head h3 { font-size: 17px; color: var(--purple); }
.d-sub { font-size: 11.5px; color: var(--ink-2); }
.d-sub code { color: var(--green); font-size: 10.5px; word-break: break-all; }
.d-stats { display: flex; gap: 14px; margin: 12px 0; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.d-stats b { color: var(--ink-1); font-variant-numeric: tabular-nums; }
.timeline { list-style: none; border-left: 1px solid var(--baseline); margin-left: 6px; padding-left: 14px; display: grid; gap: 9px; }
.timeline li { position: relative; font-size: 11.5px; color: var(--ink-2); }
.timeline li::before {
  content: ""; position: absolute; left: -18px; top: 5px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--muted);
}
.timeline li.meta-ev::before { background: var(--purple); }
.timeline li.purchase::before { background: var(--orange); box-shadow: 0 0 6px var(--orange); }
.timeline li.refund::before { background: var(--critical); }
.timeline .t-name { color: var(--ink-1); font-weight: 650; }
.timeline li.meta-ev .t-name { color: var(--purple); }
.timeline li.purchase .t-name { color: var(--orange); }
.timeline li.refund .t-name { color: var(--critical); }
.timeline .t-when { color: var(--muted); }
.t-session {
  margin: 14px 0 4px; font-size: 10px; color: var(--green);
  text-transform: uppercase; letter-spacing: 1px;
}
.t-session::before { content: "$ "; color: var(--muted); }

/* hierarquia: projeto aberto no menu lateral */
.project-nav { display: grid; gap: 2px; margin-top: 6px; }
.project-nav-name {
  color: var(--orange); font-size: 11px; font-weight: 650; padding: 4px 10px 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.nav-item.sub { padding-left: 18px; font-size: 11.5px; }
.open-btn {
  border: 1px solid var(--green); color: var(--green); border-radius: 4px;
  padding: 3px 12px; font-size: 11.5px; text-decoration: none;
}
.open-btn:hover { background: var(--green); color: var(--page); }
.projects-list { display: grid; gap: 12px; }
.project-card { border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; background: var(--surface-2); display: grid; gap: 10px; }
.p-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.p-name { color: var(--purple); font-weight: 650; font-size: 14px; }
.p-id { color: var(--muted); font-size: 11px; }
.p-id code { color: var(--green); }
.p-snippet { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11px; }
.p-snippet .dim { color: var(--muted); }
.snippet {
  background: var(--page); border: 1px solid var(--grid); border-radius: 4px;
  padding: 5px 10px; color: var(--orange); font-size: 11px; overflow-x: auto; white-space: nowrap;
  max-width: 100%; scrollbar-width: none; -ms-overflow-style: none;
}
.snippet::-webkit-scrollbar { display: none; height: 0; }
.copy-btn, .project-form button {
  background: transparent; border: 1px solid var(--purple-dim); color: var(--purple);
  border-radius: 4px; padding: 5px 12px; font: inherit; font-size: 11.5px; cursor: pointer;
}
.copy-btn:hover, .project-form button:hover { background: var(--purple-dim); color: #fff; }
.project-form { display: flex; gap: 8px; flex-wrap: wrap; }
.project-form input {
  background: var(--page); border: 1px solid var(--baseline); color: var(--ink-1);
  border-radius: 4px; padding: 6px 10px; font: inherit; font-size: 12px; flex: 1; min-width: 180px;
}
.project-form input::placeholder { color: var(--muted); }

/* tela de eventos */
.hint { font-size: 11.5px; color: var(--ink-2); margin-bottom: 12px; max-width: 640px; }
.hint b { color: var(--purple); }
.events-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.events-table th {
  text-align: left; color: var(--muted); font-weight: 500; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 1px;
  border-bottom: 1px solid var(--baseline); padding: 6px 10px;
}
.events-table td { padding: 7px 10px; border-bottom: 1px solid var(--grid); }
.events-table code { color: var(--green); font-size: 11px; }
.events-table .ev-name { color: var(--purple); font-weight: 650; }
.events-table .ev-name.important { color: var(--orange); }
.events-table .dim { color: var(--muted); font-size: 11px; }
/* interruptor */
.switch { position: relative; display: inline-block; width: 34px; height: 18px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px; cursor: pointer;
  background: var(--baseline); border: 1px solid var(--grid); transition: background 0.15s;
}
.switch .track::before {
  content: ""; position: absolute; width: 12px; height: 12px; border-radius: 50%;
  left: 2px; top: 2px; background: var(--muted); transition: transform 0.15s, background 0.15s;
}
.switch input:checked + .track { background: rgba(63, 185, 80, 0.25); border-color: var(--green); }
.switch input:checked + .track::before { transform: translateX(15px); background: var(--green); }
.switch input:focus-visible + .track { outline: 1px solid var(--purple); outline-offset: 2px; }
.save-status { font-size: 11px; color: var(--green); display: block; margin-top: 8px; min-height: 16px; }
.save-status.err { color: var(--critical); }

.tooltip {
  position: fixed; z-index: 50; background: var(--surface-2); border: 1px solid var(--purple-dim);
  border-radius: 4px; padding: 6px 10px; font-size: 11.5px; color: var(--ink-1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); pointer-events: none; font-family: var(--mono);
}
