/* Painel do error tracker (ETV2-08..16). Só o que os componentes compartilhados (card,
   table, badge, btn, form-*) não têm: nível, números, sparkline, barras, abas, filtros,
   distribuições, backtrace e linha do tempo da telemetria. Prefixo `et-`. */

:root {
  --et-critical: #7f1d1d;
  --et-critical-bg: #fee2e2;
  --et-error: var(--color-danger-600);
  --et-error-bg: var(--color-danger-50);
  --et-warning: var(--color-warning-600);
  --et-warning-bg: var(--color-warning-50);
  --et-info: var(--color-info-600);
  --et-info-bg: var(--color-info-50);
  --et-code-bg: var(--color-gray-50);
  --et-bar: var(--color-primary-500);
  --et-bar-muted: var(--color-gray-200);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --et-critical: #fca5a5;
    --et-critical-bg: rgba(220, 38, 38, 0.35);
    --et-error: #f87171;
    --et-error-bg: rgba(239, 68, 68, 0.15);
    --et-warning: #fbbf24;
    --et-warning-bg: rgba(245, 158, 11, 0.15);
    --et-info: #60a5fa;
    --et-info-bg: rgba(59, 130, 246, 0.15);
    --et-code-bg: #0f172a;
    --et-bar: #60a5fa;
    --et-bar-muted: #334155;
  }
}

:root[data-theme="dark"] {
  --et-critical: #fca5a5;
  --et-critical-bg: rgba(220, 38, 38, 0.35);
  --et-error: #f87171;
  --et-error-bg: rgba(239, 68, 68, 0.15);
  --et-warning: #fbbf24;
  --et-warning-bg: rgba(245, 158, 11, 0.15);
  --et-info: #60a5fa;
  --et-info-bg: rgba(59, 130, 246, 0.15);
  --et-code-bg: #0f172a;
  --et-bar: #60a5fa;
  --et-bar-muted: #334155;
}

/* ---------- Nível ---------- */
.et-level {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.5;
  white-space: nowrap;
}
.et-level::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.et-level--critical { color: #fff; background: var(--et-critical); }
.et-level--error { color: var(--et-error); background: var(--et-error-bg); }
.et-level--warning { color: var(--et-warning); background: var(--et-warning-bg); }
.et-level--info { color: var(--et-info); background: var(--et-info-bg); }
:root[data-theme="dark"] .et-level--critical { color: #fff; background: #b91c1c; }

.et-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-3);
}

/* ---------- Visão geral ---------- */
.et-overview { margin-bottom: var(--space-4); padding: var(--space-4) var(--space-5); }
.et-overview__summary {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.et-overview__summary::-webkit-details-marker { display: none; }
/* Chevron dos blocos recolhíveis (visão geral, filtros). */
.et-overview__summary::before,
.et-filters__toggle::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--transition-fast);
  align-self: center;
  margin-right: 2px;
}
.et-overview__summary::before { color: var(--color-text-secondary); }
.et-overview[open] > .et-overview__summary::before,
.et-filters[open] > .et-filters__toggle::before { transform: rotate(45deg); }
.et-overview__title { font-weight: 600; }
.et-overview__grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--space-6);
  margin-top: var(--space-4);
}
.et-overview__top { border-left: 1px solid var(--color-border-light); padding-left: var(--space-6); min-width: 0; }

.et-stats { display: flex; gap: var(--space-6); flex-wrap: wrap; margin-bottom: var(--space-4); }
.et-stat { display: flex; flex-direction: column; }
.et-stat__value { font-size: var(--text-2xl); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.et-stat__label { font-size: var(--text-xs); color: var(--color-text-secondary); }
.et-stat--alert .et-stat__value { color: var(--et-error); }

/* Barras por hora (HTML/CSS, sem JS). */
.et-bars {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--color-border);
}
.et-bars__max {
  position: absolute;
  top: -2px;
  left: 0;
  font-size: 10px;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}
.et-bars__col {
  position: relative;
  flex: 1 1 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.et-bars__bar {
  width: 100%;
  min-height: 0;
  background: var(--et-bar);
  border-radius: 2px 2px 0 0;
  opacity: 0.85;
}
.et-bars__col:hover .et-bars__bar { opacity: 1; }
.et-bars__col:hover { background: var(--color-border-light); }
.et-bars__bar--zero { height: 1px !important; background: var(--et-bar-muted); }
.et-bars__label {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.et-bars__deploy {
  position: absolute;
  top: 0;
  bottom: 18px;
  width: 0;
  border-left: 2px dashed var(--color-warning-500);
  pointer-events: auto;
}
.et-bars__deploy-label {
  position: absolute;
  top: -2px;
  left: 3px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--color-warning-700);
  background: var(--color-surface);
  padding: 0 2px;
  white-space: nowrap;
}

/* Top 5 */
.et-top { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.et-top__item { display: flex; align-items: flex-start; gap: var(--space-3); }
.et-top__link {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: inherit;
  text-decoration: none;
}
.et-top__link:hover code { color: var(--color-primary-600); }
.et-top__name { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.et-top__name code { font-size: var(--text-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.et-top__message { font-size: var(--text-xs); color: var(--color-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.et-top__meter { height: 3px; background: var(--color-border-light); border-radius: 2px; overflow: hidden; }
.et-top__meter > span { display: block; height: 100%; background: var(--et-error); opacity: 0.55; }
.et-top__count { font-weight: 700; font-variant-numeric: tabular-nums; font-size: var(--text-sm); }

/* ---------- Abas de status ---------- */
.et-tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-3);
  overflow-x: auto;
  scrollbar-width: none;
}
.et-tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.et-tabs__tab:hover { color: var(--color-text); }
.et-tabs__tab--active { color: var(--color-primary-600); border-bottom-color: var(--color-primary-600); }
.et-tabs__count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--color-border-light);
  color: var(--color-text-secondary);
}
.et-tabs__tab--active .et-tabs__count { background: var(--color-primary-50); color: var(--color-primary-700); }

/* ---------- Busca e filtros ---------- */
.et-search { margin-bottom: var(--space-3); }
.et-search__bar { display: flex; gap: var(--space-2); align-items: center; }
.et-search__input { flex: 1; min-width: 0; }

/* Select nativo: o `select.form-select` do produto vira o dropdown pesquisável do
   application.js, que reordena as opções em ordem alfabética (a ordenação e o período
   têm ordem própria) e ocupa a largura toda. */
.et-select {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
  cursor: pointer;
}
.et-search__bar .et-search__sort { width: auto; flex: 0 0 auto; }
.et-select:focus { outline: none; border-color: var(--color-primary-500); box-shadow: 0 0 0 3px var(--color-primary-50); }
.et-filters { margin-top: var(--space-3); }
.et-filters__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-primary-600);
  list-style: none;
  user-select: none;
}
.et-filters__toggle::-webkit-details-marker { display: none; }
.et-filters__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3) var(--space-4);
  margin-top: var(--space-3);
}
.et-filters__grid .form-group { margin-bottom: 0; }
.et-filters__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border-light);
}

.et-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}
.et-summary strong { color: var(--color-text); font-variant-numeric: tabular-nums; }
.et-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.et-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px 2px 10px;
  border-radius: var(--radius-full);
  background: var(--color-primary-50);
  color: var(--color-primary-800);
  font-size: var(--text-xs);
}
.et-chip__label { font-weight: 600; }
.et-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
  line-height: 1;
}
.et-chip__remove:hover { background: var(--color-primary-100); }
.et-chips__clear { font-size: var(--text-xs); }
:root[data-theme="dark"] .et-chip { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }

/* ---------- Tabela de grupos ---------- */
.et-table th,
.et-table td { padding: 10px; }
.et-table th:first-child,
.et-table td:first-child { padding-left: 14px; }
.et-table td { vertical-align: top; }
.et-table th .sort-link { justify-content: inherit; }
.et-row { cursor: pointer; }
.et-row > td:first-child { box-shadow: inset 3px 0 0 transparent; }
.et-row--critical > td:first-child { box-shadow: inset 3px 0 0 var(--et-critical); }
.et-row--error > td:first-child { box-shadow: inset 3px 0 0 var(--et-error); }
.et-row--warning > td:first-child { box-shadow: inset 3px 0 0 var(--et-warning); }
.et-row--info > td:first-child { box-shadow: inset 3px 0 0 var(--et-info); }
/* `pages/triages.css` força `.table td { white-space: nowrap !important }`; a célula do
   erro tem frases (mensagem, local) que precisam quebrar para a tabela caber. */
.table.et-table td.et-row__error { min-width: 220px; max-width: 360px; white-space: normal !important; }
.et-row__head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.et-row__class { color: var(--color-text); text-decoration: none; }
.et-row__class code { font-weight: 700; font-size: var(--text-sm); overflow-wrap: anywhere; }
.et-row__class:hover code { color: var(--color-primary-600); }
/* Duas linhas no máximo. Sem `-webkit-line-clamp`: o `-webkit-box` faz a célula
   medir a mensagem inteira como largura mínima e a tabela estoura no celular. */
.et-row__message {
  margin-top: 2px;
  font-size: var(--text-sm);
  line-height: 1.4;
  max-height: 2.8em;
  overflow: hidden;
  color: var(--color-text);
  overflow-wrap: anywhere;
}
.et-row__meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin-top: 4px; font-size: var(--text-xs); color: var(--color-text-secondary); }
.et-row__location { font-size: 11px; color: var(--color-text-secondary); overflow-wrap: anywhere; }
.et-row__release { font-family: var(--font-mono); font-size: 11px; }
.et-row__release::before { content: "\2387  "; }
.et-row__seen { white-space: nowrap; font-size: var(--text-sm); }
.et-row__first { display: block; font-size: var(--text-xs); color: var(--color-text-secondary); }
.et-row__assignee { text-align: center; }
.et-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-primary-100);
  color: var(--color-primary-800);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
:root[data-theme="dark"] .et-avatar { background: rgba(59, 130, 246, 0.25); color: #bfdbfe; }

.et-num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: var(--text-sm);
}
.et-num--strong { font-weight: 700; }
.et-num--zero { color: var(--color-gray-300); }
:root[data-theme="dark"] .et-num--zero { color: var(--color-gray-600); }

.et-spark { display: block; overflow: visible; }
.et-spark__bar { fill: var(--et-bar); }
.et-spark__bar--zero { fill: var(--et-bar-muted); }

.et-empty { text-align: center; padding: var(--space-10) var(--space-6); }
.et-empty__title { font-weight: 600; font-size: var(--text-lg); margin-bottom: var(--space-1); }
.et-empty__text { color: var(--color-text-secondary); font-size: var(--text-sm); margin-bottom: var(--space-4); }

/* ---------- Detalhe do grupo ---------- */
.et-breadcrumb { margin-bottom: var(--space-3); font-size: var(--text-sm); }
.et-breadcrumb a { color: var(--color-text-secondary); text-decoration: none; }
.et-breadcrumb a:hover { color: var(--color-primary-600); }

.et-group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-left: 4px solid var(--et-error);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.et-group-header--critical { border-left-color: var(--et-critical); }
.et-group-header--warning { border-left-color: var(--et-warning); }
.et-group-header--info { border-left-color: var(--et-info); }
.et-group-header__main { min-width: 0; flex: 1; }
.et-group-header__badges { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-bottom: var(--space-2); }
/* Classe do erro e mensagem no cabeçalho da página (faixa escura do layout). */
.et-group-header__title { overflow-wrap: anywhere; }
.et-page-message { max-width: 90ch; overflow-wrap: anywhere; white-space: pre-wrap; }
.et-group-header__message { margin: var(--space-1) 0 var(--space-3); font-size: var(--text-base); overflow-wrap: anywhere; white-space: pre-wrap; }
.et-group-header__meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin: 0; font-size: var(--text-sm); }
.et-group-header__meta > div { display: flex; gap: var(--space-2); min-width: 0; }
.et-group-header__meta dt { color: var(--color-text-secondary); }
.et-group-header__meta dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.et-group-header__actions { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-3); flex-shrink: 0; width: 280px; }
.et-group-header__actions form { margin: 0; }
.et-actions__buttons { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }
.et-actions__fields { display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--color-border-light); }
.et-actions__me { align-self: flex-end; }
.et-field { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: var(--space-2); }
.et-field__label { font-size: var(--text-xs); font-weight: 600; color: var(--color-text-secondary); margin: 0; }
.et-field__control { display: flex; gap: var(--space-2); min-width: 0; }
.et-input--sm { padding: 6px 10px; font-size: var(--text-sm); }

/* Cabeçalho do grupo no novo layout: a classe e a mensagem vão para a faixa da página;
   aqui ficam os selos e os dados à esquerda e, numa faixa abaixo, os campos (atribuir,
   nível) à esquerda e os botões de status à direita — sem a coluna alta de antes. */
.et-group-header:has(.et-group-header__actions) { flex-direction: column; align-items: stretch; }
.et-group-header:has(.et-group-header__actions) .et-group-header__meta { margin-bottom: 0; }
.et-group-header__actions {
  flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between;
  width: auto; padding-top: var(--space-4); border-top: 1px solid var(--color-border-light);
}
.et-group-header__actions .et-actions__buttons { order: 2; }
.et-group-header__actions .et-actions__fields {
  order: 1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5);
  padding-top: 0; border-top: 0;
}
.et-group-header__actions .et-field { grid-template-columns: auto 220px; }
.et-group-header__actions .et-actions__me { align-self: center; }

/* Navegação entre deploys: sem vizinho, o botão fica apagado. */
.main-content__header .btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }

/* Botão dividido (Resolver | ▾) e menus <details> das ações (sem JS). */
.et-split { display: inline-flex; position: relative; }
.et-split__main { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.et-split__toggle { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; border-left: 1px solid rgba(255, 255, 255, 0.35) !important; padding-left: 8px !important; padding-right: 8px !important; }
.et-chevron { display: inline-block; vertical-align: -1px; transition: transform 0.15s ease; }
.et-popover { position: relative; }
.et-split .et-popover { position: static; }
.et-popover > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.et-popover > summary::-webkit-details-marker { display: none; }
.et-popover[open] > summary .et-chevron { transform: rotate(180deg); }
.et-popover__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg, 0 10px 25px rgba(15, 23, 42, 0.15));
  text-align: left;
}
.et-popover--end .et-popover__panel { left: auto; right: 0; }
.et-popover__panel form { display: flex; flex-direction: column; gap: var(--space-2); }
.et-popover__title { font-size: var(--text-xs); font-weight: 600; color: var(--color-text-secondary); margin: 0; }
.et-popover__options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.et-popover__options form, .et-popover__options .btn { width: 100%; }
.et-popover__row { padding-top: var(--space-2); border-top: 1px solid var(--color-border-light); }
.et-popover__row input { flex: 1; min-width: 0; }
.et-popover__panel--wide { width: 360px; }
.et-merge-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; }
.et-merge-option { display: flex; align-items: flex-start; gap: var(--space-2); padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; margin: 0; }
.et-merge-option:hover { background: var(--et-code-bg); }
.et-merge-option input { margin-top: 3px; }
.et-merge-option__text { display: flex; flex-direction: column; min-width: 0; }
.et-merge-option__message { font-size: var(--text-sm); overflow-wrap: anywhere; }
.et-merge-option__meta { font-size: 11px; color: var(--color-text-secondary); overflow-wrap: anywhere; }
.et-popover__hint { font-size: 11px; line-height: 1.4; color: var(--color-text-secondary); margin: 0; }
.et-popover__panel .btn[type="submit"] { align-self: flex-start; }

.et-select--sm { padding: 6px 30px 6px 10px; font-size: var(--text-sm); background-position: right 10px center; }

.et-tiles {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, 1.4fr));
  gap: 1px;
  margin-bottom: var(--space-4);
  background: var(--color-border-light);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.et-tile { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4); background: var(--color-surface); min-width: 0; }
.et-tile__value { font-size: var(--text-2xl); font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.et-tile--time .et-tile__value { font-size: var(--text-lg); font-weight: 600; }
.et-tile__label { font-size: var(--text-xs); color: var(--color-text-secondary); overflow-wrap: anywhere; }
.et-tile__label code { font-size: 11px; }

.et-chart-card { margin-bottom: var(--space-4); padding: var(--space-4) var(--space-5); }
.et-chart__head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.et-chart__canvas { position: relative; height: 200px; }
.et-chart__legend { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-2) 0 0; font-size: var(--text-xs); color: var(--color-text-secondary); }
.et-chart__legend-mark { width: 14px; height: 0; border-top: 2px dashed var(--color-warning-500); }
.et-segmented { display: inline-flex; border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.et-segmented__btn {
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 0;
  cursor: pointer;
}
.et-segmented__btn + .et-segmented__btn { border-left: 1px solid var(--color-border); }
.et-segmented__btn[aria-pressed="true"] { background: var(--color-primary-600); color: #fff; }

.et-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  align-items: start;
}
.et-detail-grid > .card { margin: 0; padding: var(--space-4) var(--space-5); }
.et-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-3); }

.et-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2) var(--space-4); margin: 0; font-size: var(--text-sm); }
.et-dl dt { color: var(--color-text-secondary); font-weight: 500; }
.et-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.et-pre {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  background: var(--et-code-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 320px;
  overflow: auto;
}

.et-dist-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4) var(--space-5); }
.et-dist__title { font-size: var(--text-xs); font-weight: 600; color: var(--color-text-secondary); margin: 0 0 var(--space-2); }
.et-dist__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.et-dist__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 3px 6px;
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.et-dist__bar { position: absolute; inset: 0 auto 0 0; background: var(--color-primary-50); z-index: 0; border-radius: var(--radius-sm); }
:root[data-theme="dark"] .et-dist__bar { background: rgba(59, 130, 246, 0.16); }
.et-dist__item--active { outline: 1px solid var(--color-primary-500); }
.et-dist__value, .et-dist__count, .et-dist__percent { position: relative; z-index: 1; }
.et-dist__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-text); text-decoration: none; }
a.et-dist__value:hover { color: var(--color-primary-600); }
.et-dist__count { font-weight: 600; font-variant-numeric: tabular-nums; }
.et-dist__percent { width: 44px; text-align: right; color: var(--color-text-secondary); font-variant-numeric: tabular-nums; }

.et-occurrences { margin-bottom: var(--space-6); }
.et-occ-row__when, .et-occ-row__target { white-space: nowrap; }
.et-occ-row__target code { font-size: 12px; }
.et-occ-row__user { font-size: var(--text-sm); }

/* ---------- Página da ocorrência ---------- */
.et-breadcrumb { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.et-occ-row { cursor: pointer; }
.et-occ-row__when a { color: inherit; text-decoration: none; }
.et-occ-row__when a:hover { color: var(--color-primary-600); }
.et-occ-nav { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); flex-shrink: 0; }
.et-occ-nav .et-segmented__btn { text-decoration: none; display: inline-block; }
.et-segmented__btn--disabled { opacity: 0.45; cursor: default; }

.et-section-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: var(--space-1);
  margin: 0 0 var(--space-4);
  padding: var(--space-2) 0;
  background: var(--color-body);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  scrollbar-width: none;
}
.et-section-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  white-space: nowrap;
}
.et-section-nav a:hover { background: var(--color-border-light); color: var(--color-text); }

.et-occ-section { margin-bottom: var(--space-4); padding: var(--space-4) var(--space-5); scroll-margin-top: 56px; }
.et-occ-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4); }
.et-occ-section .et-occ-columns { margin-top: var(--space-4); }
.et-occ-columns > .et-occ-section { margin-bottom: var(--space-4); }

.et-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3) var(--space-5); margin: 0; }
.et-kv > div { min-width: 0; }
.et-kv--wide { grid-column: 1 / -1; }
.et-kv dt { font-size: var(--text-xs); color: var(--color-text-secondary); margin-bottom: 2px; }
.et-kv dd { margin: 0; font-size: var(--text-sm); overflow-wrap: anywhere; }

.et-note {
  font-size: var(--text-xs);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  background: var(--et-warning-bg);
  color: var(--et-warning);
}

.et-headers { width: 100%; border-collapse: collapse; font-size: 12px; }
.et-headers th, .et-headers td { padding: 4px 8px; border-bottom: 1px solid var(--color-border-light); text-align: left; vertical-align: top; }
.et-headers th { font-family: var(--font-mono); font-weight: 600; color: var(--color-text-secondary); white-space: nowrap; width: 1%; }
.et-headers td { font-family: var(--font-mono); overflow-wrap: anywhere; }

/* Backtrace */
.et-trace { list-style: none; margin: 0; padding: 0; font-family: var(--font-mono); font-size: 12px; border: 1px solid var(--color-border-light); border-radius: var(--radius-md); overflow: hidden; }
.et-trace > li { border-bottom: 1px solid var(--color-border-light); }
.et-trace > li:last-child { border-bottom: 0; }
.et-trace__frame { padding: 6px 12px; overflow-wrap: anywhere; }
.et-trace__frame--app { background: var(--color-surface); border-left: 3px solid var(--color-primary-500); }
.et-trace__frame--plain { color: var(--color-text-secondary); background: var(--et-code-bg); }
.et-trace__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); }
.et-trace__path { font-weight: 700; color: var(--color-text); }
.et-trace__loc { overflow-wrap: anywhere; }
.et-trace__line { color: var(--color-primary-600); font-weight: 700; }
.et-trace__label { color: var(--color-text-secondary); }
.et-trace__label code { font-size: 12px; }
.et-trace__libs { background: var(--et-code-bg); }
.et-trace__libs summary { padding: 5px 12px; cursor: pointer; color: var(--color-text-secondary); font-family: var(--font-sans); font-size: var(--text-xs); user-select: none; }
.et-trace__libs summary:hover { color: var(--color-text); }
.et-trace__lib-list { list-style: none; margin: 0; padding: 0 12px 6px; }
.et-trace__lib { padding: 2px 0; color: var(--color-text-secondary); overflow-wrap: anywhere; }

.et-code { width: 100%; margin-top: 6px; border-collapse: collapse; background: var(--et-code-bg); border-radius: var(--radius-sm); }
.et-code td { padding: 0 8px; line-height: 1.55; white-space: pre; vertical-align: top; }
.et-code__n { width: 1%; text-align: right; color: var(--color-gray-400); user-select: none; border-right: 1px solid var(--color-border-light); }
.et-code__src { white-space: pre-wrap !important; overflow-wrap: anywhere; }
.et-code__current td { background: var(--et-error-bg); }
.et-code__current .et-code__n { color: var(--et-error); font-weight: 700; }
.et-raw { margin-top: var(--space-3); }
.et-raw summary { cursor: pointer; font-size: var(--text-xs); color: var(--color-text-secondary); margin-bottom: var(--space-2); }

/* Linha do tempo da telemetria */
.et-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.et-timeline__item {
  --tone: var(--color-gray-500);
  --tone-bg: var(--color-gray-100);
  position: relative;
  display: grid;
  grid-template-columns: 76px 28px minmax(0, 1fr);
  gap: var(--space-2);
  padding: 6px 0;
}
.et-timeline__item::before {
  content: "";
  position: absolute;
  left: calc(76px + var(--space-2) + 13px);
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}
.et-timeline__item:first-child::before { top: 18px; }
.et-timeline__item:last-child::before { bottom: calc(100% - 18px); }
.et-timeline__offset { text-align: right; font-family: var(--font-mono); font-size: 12px; color: var(--color-text-secondary); padding-top: 5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.et-timeline__dot {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tone-bg);
  color: var(--tone);
  box-shadow: 0 0 0 3px var(--color-surface);
}
.et-timeline__body { min-width: 0; padding-top: 3px; }
.et-timeline__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-xs); }
.et-timeline__type { font-weight: 700; color: var(--tone); text-transform: uppercase; letter-spacing: 0.04em; }
.et-timeline__status { font-family: var(--font-mono); font-weight: 700; padding: 0 6px; border-radius: var(--radius-sm); background: var(--tone-bg); color: var(--tone); }
.et-timeline__meta { color: var(--color-text-secondary); }
.et-timeline__duration { margin-left: auto; font-family: var(--font-mono); color: var(--color-text-secondary); }
.et-timeline__message { font-size: var(--text-sm); overflow-wrap: anywhere; margin-top: 1px; }
.et-timeline__message--code { font-family: var(--font-mono); font-size: 12px; }
.et-timeline__item--sql { --tone: #7c3aed; --tone-bg: #ede9fe; }
.et-timeline__item--http { --tone: var(--color-primary-600); --tone-bg: var(--color-primary-50); }
.et-timeline__item--action { --tone: var(--color-gray-600); --tone-bg: var(--color-gray-100); }
.et-timeline__item--job { --tone: #0d9488; --tone-bg: #ccfbf1; }
.et-timeline__item--mail { --tone: #db2777; --tone-bg: #fce7f3; }
.et-timeline__item--navigation { --tone: #0891b2; --tone-bg: #cffafe; }
.et-timeline__item--click { --tone: #4f46e5; --tone-bg: #e0e7ff; }
.et-timeline__item--warning { --tone: var(--et-warning); --tone-bg: var(--et-warning-bg); }
.et-timeline__item--danger,
.et-timeline__item--error { --tone: var(--et-error); --tone-bg: var(--et-error-bg); }
.et-timeline__item--error .et-timeline__offset { color: var(--et-error); font-weight: 700; }
:root[data-theme="dark"] .et-timeline__item--sql { --tone: #c4b5fd; --tone-bg: rgba(124, 58, 237, 0.2); }
:root[data-theme="dark"] .et-timeline__item--http { --tone: #93c5fd; --tone-bg: rgba(37, 99, 235, 0.2); }
:root[data-theme="dark"] .et-timeline__item--action { --tone: #cbd5e1; --tone-bg: rgba(100, 116, 139, 0.25); }
:root[data-theme="dark"] .et-timeline__item--job { --tone: #5eead4; --tone-bg: rgba(13, 148, 136, 0.2); }
:root[data-theme="dark"] .et-timeline__item--mail { --tone: #f9a8d4; --tone-bg: rgba(219, 39, 119, 0.2); }
:root[data-theme="dark"] .et-timeline__item--navigation { --tone: #67e8f9; --tone-bg: rgba(8, 145, 178, 0.2); }
:root[data-theme="dark"] .et-timeline__item--click { --tone: #a5b4fc; --tone-bg: rgba(79, 70, 229, 0.2); }

/* Deploys (ETV2-23) */
.et-deploy-header { border-left-color: var(--color-primary-500); }
.et-deploy-header__eyebrow { margin: 0 0 2px; font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-secondary); }
.et-deploy__release { text-decoration: none; }
.et-deploy__release code { font-weight: 600; }
.et-tiles.et-tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.et-num--alert, .et-num--alert span { color: var(--et-error); font-weight: 700; }

/* Atividade do grupo: comentários + histórico (reaproveita a linha do tempo). */
.et-history { margin-bottom: var(--space-6); padding: var(--space-4) var(--space-5); }
.et-timeline--history .et-timeline__item { grid-template-columns: 84px 28px minmax(0, 1fr); padding: 8px 0; }
.et-timeline--history .et-timeline__item::before { left: calc(84px + var(--space-2) + 13px); }
.et-timeline--history .et-timeline__offset { font-family: var(--font-sans); font-size: var(--text-xs); padding-top: 6px; }
.et-timeline--history .et-timeline__head { font-size: var(--text-sm); padding-top: 4px; }
.et-history__line { font-size: var(--text-sm); padding-top: 4px; overflow-wrap: anywhere; }
.et-history__actor { color: var(--color-text); font-weight: 600; }
.et-history__actor--system { color: var(--color-text-secondary); font-style: italic; }
.et-comment {
  margin-top: 6px;
  padding: var(--space-2) var(--space-3);
  background: var(--et-code-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.et-timeline__item--success { --tone: var(--color-success-600); --tone-bg: var(--color-success-50); }
.et-timeline__item--comment { --tone: var(--color-primary-600); --tone-bg: var(--color-primary-50); }
:root[data-theme="dark"] .et-timeline__item--success { --tone: #86efac; --tone-bg: rgba(22, 163, 74, 0.2); }
:root[data-theme="dark"] .et-timeline__item--comment { --tone: #93c5fd; --tone-bg: rgba(37, 99, 235, 0.2); }
.et-comment-form { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-border-light); }
.et-comment-form .form-label { margin: 0; }
.et-comment-form__actions { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }

/* ---------- Celular ---------- */
@media (max-width: 1100px) {
  .et-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .et-detail-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .et-overview__grid { grid-template-columns: minmax(0, 1fr); }
  .et-overview__top { border-left: 0; padding-left: 0; border-top: 1px solid var(--color-border-light); padding-top: var(--space-4); }
}

@media (max-width: 640px) {
  .et-overview { padding: var(--space-3) var(--space-4); }
  .et-stats { gap: var(--space-4); }
  .et-stat__value { font-size: var(--text-xl); }
  .et-bars { height: 90px; gap: 1px; }
  .et-bars__deploy-label { display: none; }
  .et-search__bar { flex-wrap: wrap; }
  .et-search__input { flex-basis: 100%; }
  .et-search__bar .et-search__sort { flex: 1; }
  .et-group-header { flex-direction: column; padding: var(--space-4); }
  .et-occ-nav { align-items: flex-start; }
  .et-occ-columns { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .et-occ-section { padding: var(--space-3) var(--space-4); }
  .et-timeline__item { grid-template-columns: 58px 28px minmax(0, 1fr); gap: 6px; }
  .et-timeline__item::before { left: calc(58px + 6px + 13px); }
  .et-history { padding: var(--space-3) var(--space-4); }
  .et-timeline--history .et-timeline__item { grid-template-columns: 64px 28px minmax(0, 1fr); gap: 6px; }
  .et-timeline--history .et-timeline__item::before { left: calc(64px + 6px + 13px); }
  .et-group-header__actions { width: 100%; flex-direction: column; align-items: stretch; gap: var(--space-3); }
  .et-group-header__actions .et-actions__buttons { order: 0; }
  .et-group-header__actions .et-actions__fields { flex-direction: column; align-items: stretch; }
  .et-group-header__actions .et-field { grid-template-columns: 92px minmax(0, 1fr); }
  .et-group-header__actions .et-actions__me { align-self: flex-start; }
  .et-actions__buttons { justify-content: flex-start; }
  .et-actions__me { align-self: flex-start; }
  /* No celular os menus se ancoram na linha de botões inteira, à esquerda. */
  .et-actions__buttons { position: relative; }
  .et-actions__buttons .et-popover, .et-split { position: static; }
  .et-popover--end .et-popover__panel { left: 0; right: auto; }
  .et-popover__panel, .et-popover__panel--wide { width: min(320px, calc(100vw - 48px)); }

  .et-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .et-tile__value { font-size: var(--text-xl); }
  .et-dist-grid { grid-template-columns: minmax(0, 1fr); }
  .et-chart__canvas { height: 170px; }
  .et-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .et-dl dd { margin-bottom: var(--space-2); }
  .table.et-table td.et-row__error { min-width: 190px; max-width: none; }
  .et-row__release { display: none; }
}
