/* Módulo Indicadores — telas fora do painel (Rodada A, fase 2): histórico, eventos
   adversos, indicadores-chave, metas, benchmarking e widgets. Reaproveita a barra
   (.dash-toolbar, .seg, .fsheet), os indicadores (.dash-kpi) e os cartões de gráfico
   (.viz-card) de pages/dashboard.css; aqui só o que é destas telas, com prefixos
   próprios (ind-, ae-, ki-, goal-, bm-, wd-) para não vazar para o resto do app. */

/* ---------- Histórico: pílulas de seleção ---------- */
.ind-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.ind-pill {
  --pill-tone: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px 0 10px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font: 600 13px/1.2 var(--font-sans);
}

.ind-pill:hover { color: var(--color-text); background: var(--surface-2); text-decoration: none; }
.ind-pill .ms { color: var(--color-text-secondary); }

.ind-pill--on,
.ind-pill--on:hover {
  color: var(--color-text);
  border-color: color-mix(in srgb, var(--pill-tone) 45%, transparent);
  background: color-mix(in srgb, var(--pill-tone) 12%, var(--color-surface));
}

.ind-pill--on .ms { color: var(--pill-tone); }
span.ind-pill--on { cursor: default; }

.ind-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 14px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* ---------- Histórico: cartão do indicador ---------- */
.ind-hist .viz-card__head { align-items: flex-start; }

.ind-trend {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 20px;
  font: 600 12px/1 var(--font-sans);
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--color-text-secondary);
}

.ind-trend--ok { background: var(--ok-soft); color: var(--ok); }
.ind-trend--warn { background: var(--warn-soft); color: var(--warn); }

.ind-hist__stats {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 12px;
  margin: 0 0 12px;
}

.ind-hist__stat {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
}

.ind-hist__stat dt {
  font: 600 11px/1.2 var(--font-sans);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ind-hist__stat dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  font: 700 18px/1.1 var(--font-sans);
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.ind-hist__stat--main dd { font-size: 26px; letter-spacing: -.01em; }
.ind-hist__stat dd .chip { font-size: 11px; }
dd.ind-hist__none { font-size: 14px; font-weight: 500; color: var(--color-text-secondary); }

/* No destaque escuro, os números ficam sobre vidro. */
.viz-card--hero .ind-hist__stat { background: rgba(255, 255, 255, .07); }
.viz-card--hero .ind-hist__stat dt { color: #a9b4d6; }
.viz-card--hero .ind-hist__stat dd { color: #fff; }
.viz-card--hero dd.ind-hist__none { color: #a9b4d6; }
.viz-card--hero .ind-trend { background: rgba(255, 255, 255, .1); color: #c3cafb; }
.viz-card--hero .ind-trend--ok { color: #7be0b5; }
.viz-card--hero .ind-trend--warn { color: #ffc56b; }

/* ---------- Eventos adversos: lista ---------- */
.ae-list {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  margin-bottom: 16px;
  overflow: hidden;
}

.ae-list__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.ae-list__title { margin: 0; font: 700 15px/1.25 var(--font-sans); color: var(--color-text); }
.ae-list__sub { margin: 4px 0 0; font-size: 12px; color: var(--color-text-secondary); }
.ae-list__n { font: 500 11px/1 var(--font-mono); opacity: .7; }
.ae-list > .viz-empty { margin: 16px 20px; }

.ae-item {
  position: relative;
  display: grid;
  /* Colunas fixas (exceto a principal): as linhas alinham entre si. */
  grid-template-columns: 56px minmax(0, 1fr) 150px 120px 150px 24px;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-top: 1px solid var(--color-border);
}

.ae-list__rows > .ae-item:first-child { border-top: 0; }
.ae-item:hover { background: var(--surface-2); }
.ae-item__link { position: absolute; inset: 0; z-index: 0; }

.ae-item__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 11px;
  background: var(--surface-2);
}

.ae-item:hover .ae-item__date { background: var(--color-surface); }
.ae-item__day { font: 600 13px/1 var(--font-mono); color: var(--color-text); }
.ae-item__year { margin-top: 3px; font: 500 10px/1 var(--font-mono); color: var(--color-text-secondary); }

.ae-item__main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.ae-item__event {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font: 700 14px/1.25 var(--font-sans);
  color: var(--color-text);
}

.ae-item__who,
.ae-item__tech {
  font-size: 12px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.ae-item__grade { display: flex; align-items: center; gap: 8px; }
.ae-item__grade-n { font: 500 11px/1 var(--font-mono); color: var(--color-text-secondary); }

.ae-grade { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.ae-grade__bar { display: block; width: 5px; border-radius: 2px; background: var(--color-border); }
.ae-grade__bar:nth-child(1) { height: 6px; }
.ae-grade__bar:nth-child(2) { height: 8px; }
.ae-grade__bar:nth-child(3) { height: 11px; }
.ae-grade__bar:nth-child(4) { height: 13px; }
.ae-grade__bar:nth-child(5) { height: 16px; }
.ae-grade__bar--on { background: var(--viz-8); }

.ae-item__sev { justify-self: start; }
.ae-sev--danger { background: var(--danger-soft); color: var(--danger); }
.ae-sev--warn { background: var(--warn-soft); color: var(--warn); }
.ae-sev--accent { background: var(--accent-soft); color: var(--accent); }
.ae-sev--neutral { background: var(--surface-2); color: var(--color-text-secondary); }
.ae-item__chev { color: var(--color-text-secondary); display: inline-flex; }

/* ---------- Indicadores-chave ---------- */
.ki-summary {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  margin-bottom: 18px;
  border-radius: 16px;
  color: #eef1fa;
  background:
    radial-gradient(120% 140% at 85% 0%, rgba(116, 132, 255, .28) 0%, rgba(116, 132, 255, 0) 55%),
    linear-gradient(180deg, #0b1636 0%, #0d1a42 100%);
}

.ki-summary__count { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.ki-summary__n { font: 700 40px/1 var(--font-sans); letter-spacing: -.02em; color: #fff; }
.ki-summary__label { font: 600 12px/1.3 var(--font-sans); color: #a9b4d6; }

.ki-summary__hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  border-left: 1px solid rgba(255, 255, 255, .14);
  font-size: 13px;
  line-height: 1.45;
  color: #c9d0ea;
}

.ki-summary__hint strong { color: #fff; }
.ki-summary__hint .ms { color: #9fb0ff; flex-shrink: 0; margin-top: 1px; }

.ki-group { margin-bottom: 18px; }

.ki-group__title {
  margin: 0 0 10px;
  font: 600 11px/1 var(--font-sans);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.ki-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.ki-tile {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 44px 14px 14px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
  cursor: pointer;
  min-width: 0;
  transition: border-color 120ms ease, background 120ms ease;
}

.ki-tile:hover { border-color: var(--accent-mid); }
.ki-tile--static { cursor: default; }

/* A caixa nativa fica acessível (teclado/leitor) mas invisível; o cartão é o alvo. */
.ki-tile__input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.ki-tile:has(.ki-tile__input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.ki-tile:has(.ki-tile__input:checked),
.ki-tile--on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--color-surface));
}

.ki-tile__icon,
.goal-item__icon {
  --tile-tone: var(--accent);
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--tile-tone);
  background: color-mix(in srgb, var(--tile-tone) 15%, transparent);
}

.ki-tile__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ki-tile__name { font: 700 14px/1.3 var(--font-sans); color: var(--color-text); }
.ki-tile__desc { font-size: 12px; line-height: 1.4; color: var(--color-text-secondary); }
.ki-tile__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ki-tile__tags:empty { display: none; }

.ki-tile__check {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid var(--color-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
}

.ki-tile:has(.ki-tile__input:checked) .ki-tile__check,
.ki-tile--on .ki-tile__check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Barras de ação presas ao rodapé (indicadores-chave, meta, widgets). */
.ki-actions,
.wd-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
  box-shadow: 0 -8px 24px -18px rgba(8, 16, 40, .35);
}

.ki-actions__text,
.wd-actions__text {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* ---------- Metas: lista ---------- */
.goal-list {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
}

.goal-list__head,
.goal-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1.3fr) minmax(0, 1.4fr) 170px 170px 20px;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
}

.goal-list__head {
  padding-top: 10px;
  padding-bottom: 10px;
  background: var(--surface-2);
  font: 600 11px/1 var(--font-sans);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.goal-item { position: relative; border-top: 1px solid var(--color-border); }
.goal-list__head + .goal-item { border-top: 0; }
.goal-item:hover { background: var(--surface-2); }
.goal-item__link { position: absolute; inset: 0; z-index: 0; }

.goal-item__name { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.goal-item__title { font: 700 14px/1.25 var(--font-sans); color: var(--color-text); }
.goal-item__metric { font-size: 12px; color: var(--color-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.goal-item__progress { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.goal-item__nums { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.goal-item__current { font: 700 18px/1 var(--font-sans); color: var(--color-text); font-variant-numeric: tabular-nums; }
.goal-item__target { font: 500 12px/1 var(--font-mono); color: var(--color-text-secondary); white-space: nowrap; }

.goal-item__status { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.goal-item__dir { font-size: 11px; color: var(--color-text-secondary); }
.goal-item__when { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-text-secondary); }
.goal-item__chev { color: var(--color-text-secondary); display: inline-flex; }

.goal-status--ok { background: var(--ok-soft); color: var(--ok); }
.goal-status--danger { background: var(--danger-soft); color: var(--danger); }
.goal-status--neutral { background: var(--surface-2); color: var(--color-text-secondary); }

/* Barra do valor atual com o marcador da meta. */
.goal-bar {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--color-border);
}

.goal-bar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  max-width: 100%;
  border-radius: 4px;
  background: var(--color-text-secondary);
}

.goal-bar--ok .goal-bar__fill { background: var(--ok); }
.goal-bar--danger .goal-bar__fill { background: var(--danger); }

.goal-bar__mark {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--color-text);
}

.goal-bar--lg { height: 12px; border-radius: 6px; }
.goal-bar--lg .goal-bar__fill { border-radius: 6px; }

.goal-empty,
.wd-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 20px;
  text-align: center;
}

.goal-empty__icon,
.wd-empty__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--accent-soft);
}

.goal-empty__title,
.wd-empty__title { margin: 6px 0 0; font: 700 16px/1.3 var(--font-sans); color: var(--color-text); }
.goal-empty__text,
.wd-empty__text { margin: 0 0 8px; max-width: 460px; font-size: 13px; line-height: 1.5; color: var(--color-text-secondary); }

.wd-empty {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
}

/* ---------- Metas: detalhe ---------- */
.goal-show {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.goal-hero {
  --tile-tone: var(--accent);
  padding: 20px 24px;
  border-radius: 16px;
  color: #eef1fa;
  background:
    radial-gradient(120% 140% at 85% 0%, rgba(116, 132, 255, .28) 0%, rgba(116, 132, 255, 0) 55%),
    linear-gradient(180deg, #0b1636 0%, #0d1a42 100%);
}

.goal-hero__head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.goal-hero__head > div { flex: 1; min-width: 0; }

.goal-hero__icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #c3cafb;
  background: rgba(255, 255, 255, .1);
}

.goal-hero__title { margin: 0; font: 700 16px/1.25 var(--font-sans); color: #fff; }
.goal-hero__sub { margin: 3px 0 0; font-size: 12px; color: #a9b4d6; }

.goal-hero__nums { display: flex; align-items: center; gap: 24px; margin-bottom: 18px; }
.goal-hero__nums > div { display: flex; flex-direction: column; gap: 6px; }
.goal-hero__k { font: 600 11px/1 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: #a9b4d6; }
.goal-hero__value { font: 700 40px/1 var(--font-sans); letter-spacing: -.02em; color: #fff; font-variant-numeric: tabular-nums; }
.goal-hero__value--target { color: #9fb0ff; }
.goal-hero__vs { color: #8e9ac0; }

.goal-hero .goal-bar { background: rgba(255, 255, 255, .1); box-shadow: none; }
.goal-hero .goal-bar__mark { background: #fff; }
.goal-hero .goal-bar--neutral .goal-bar__fill { background: #8e9ac0; }
.goal-hero .goal-status--neutral { background: rgba(255, 255, 255, .1); color: #c9d0ea; }

.goal-hero__note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 0; font-size: 13px; color: #a9b4d6; }
.goal-hero__note a { display: inline-flex; align-items: center; gap: 4px; color: #9fb0ff; font-weight: 600; }

/* ---------- Metas: formulário ---------- */
.goal-form__card { margin: 0; }
.goal-form__card .form-group { min-width: 0; }
.goal-form__card .form-input { min-width: 0; max-width: 100%; }
.goal-form__card > :last-child { margin-bottom: 0; }
.goal-form__target { max-width: 240px; font-family: var(--font-mono); }
.goal-form__dir { border: 0; padding: 0; margin: 0; }

.goal-dir { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.goal-dir__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  font: 600 13px/1.2 var(--font-sans);
  color: var(--color-text);
}

.goal-dir__opt .ms { color: var(--color-text-secondary); }
.goal-dir__input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.goal-dir__opt:has(.goal-dir__input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.goal-dir__opt:has(.goal-dir__input:checked) .ms { color: var(--accent); }
.goal-form__dates .form-input { width: 100%; }

/* ---------- Benchmarking ---------- */
.bm-table {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
}

.bm-table__head { padding: 16px 20px 12px; }
.bm-table__title { margin: 0; font: 700 15px/1.25 var(--font-sans); color: var(--color-text); }

.bm-single {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  border-radius: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.bm-single__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  background: var(--accent-soft);
}

.bm-single__text { flex: 1; min-width: 0; }
.bm-single__title { margin: 0 0 4px; font: 700 16px/1.3 var(--font-sans); color: var(--color-text); }
.bm-single__text p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--color-text-secondary); }

/* ---------- Widgets ---------- */
.wd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  grid-template-areas: "config preview" "actions actions";
  gap: 16px;
  align-items: start;
}

.wd-config {
  grid-area: config;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
  min-width: 0;
}

.wd-config__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.wd-config__title { margin: 0; font: 700 15px/1.25 var(--font-sans); color: var(--color-text); }
.wd-config__count { font-size: 12px; color: var(--color-text-secondary); }

.wd-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  grid-template-areas: "pos name switch" "pos types types";
  align-items: center;
  gap: 10px 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--color-border);
}

.wd-item__pos { grid-area: pos; display: flex; flex-direction: column; gap: 4px; align-self: start; }
.wd-item__k {
  padding: 0;
  font: 600 10px/1 var(--font-sans);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.wd-item__pos-input { width: 100%; min-width: 0; height: 44px; text-align: center; font-family: var(--font-mono); }
.wd-item__name { grid-area: name; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wd-item__title { font: 700 14px/1.25 var(--font-sans); color: var(--color-text); }
.wd-item__name .fx-code { align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.wd-item__types { grid-area: types; border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.wd-types { flex-wrap: wrap; }
.wd-type { position: relative; }
.wd-type__input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.wd-type:has(.wd-type__input:checked) { background: var(--pill); color: var(--on-pill); }
.wd-type:has(.wd-type__input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.wd-switch { grid-area: switch; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 44px; }
.wd-switch__input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }

.wd-switch__track {
  position: relative;
  width: 40px;
  height: 24px;
  border-radius: 12px;
  background: var(--color-border);
  transition: background 120ms ease;
}

.wd-switch__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(8, 16, 40, .3);
  transition: transform 120ms ease;
}

.wd-switch__input:checked + .wd-switch__track { background: var(--accent); }
.wd-switch__input:checked + .wd-switch__track::after { transform: translateX(16px); }
.wd-switch__input:focus-visible + .wd-switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.wd-switch__label { font: 600 12px/1 var(--font-sans); color: var(--color-text-secondary); }

.wd-preview {
  grid-area: preview;
  position: sticky;
  top: 84px;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--color-border);
  min-width: 0;
}

.wd-preview__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }

.wd-preview__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--accent-soft);
}

.wd-preview__title { margin: 0; font: 700 15px/1.25 var(--font-sans); color: var(--color-text); }
.wd-preview__sub { margin: 2px 0 0; font-size: 12px; color: var(--color-text-secondary); }
.wd-preview__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wd-preview__empty { grid-column: 1 / -1; margin: 0; padding: 20px; text-align: center; font-size: 13px; color: var(--color-text-secondary); }

.wd-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "icon name" "icon type" "art art";
  gap: 2px 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  min-width: 0;
}

.wd-tile[hidden] { display: none; }

.wd-tile__icon {
  grid-area: icon;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--accent-soft);
}

.wd-tile__name { grid-area: name; font: 700 13px/1.2 var(--font-sans); color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-tile__type { grid-area: type; font-size: 11px; color: var(--color-text-secondary); }

/* Esboço do gráfico (decorativo): barras que mudam de forma conforme o tipo. */
.wd-tile__art { grid-area: art; display: flex; align-items: flex-end; gap: 4px; height: 36px; margin-top: 10px; }
.wd-tile__art i { flex: 1; border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.wd-tile__art i:nth-child(1) { height: 40%; }
.wd-tile__art i:nth-child(2) { height: 70%; }
.wd-tile__art i:nth-child(3) { height: 55%; }
.wd-tile__art i:nth-child(4) { height: 90%; }
.wd-tile__art i:nth-child(5) { height: 65%; }
.wd-tile--line .wd-tile__art i { height: 3px !important; border-radius: 2px; align-self: center; }
.wd-tile--pie .wd-tile__art { justify-content: center; }
.wd-tile--pie .wd-tile__art i { display: none; }
.wd-tile--pie .wd-tile__art::before {
  content: ''; width: 36px; height: 36px; border-radius: 50%;
  background: conic-gradient(var(--viz-1) 0 45%, var(--viz-2) 0 70%, var(--viz-3) 0 100%);
}
.wd-tile--table .wd-tile__art { flex-direction: column; align-items: stretch; gap: 5px; }
.wd-tile--table .wd-tile__art i { flex: 0 0 4px; height: 4px !important; border-radius: 2px; background: var(--color-border); }
.wd-tile--number .wd-tile__art i { display: none; }
.wd-tile--number .wd-tile__art::before { content: '128'; font: 700 26px/1 var(--font-sans); color: var(--color-text); }

.wd-actions { grid-area: actions; margin: 0; }

/* ---------- Celular ---------- */
@media (max-width: 1100px) {
  .ae-item { grid-template-columns: 56px minmax(0, 1fr) 120px 150px 24px; }
  .ae-item__tech { display: none; }
  .goal-list__head,
  .goal-item { grid-template-columns: 38px minmax(0, 1fr) minmax(0, 1.2fr) 150px 20px; }
  .goal-item__when { display: none; }
  .goal-list__head > :nth-child(5) { display: none; }
}

@media (max-width: 900px) {
  .ind-pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -14px; margin-right: -14px; padding: 0 14px; }
  .ind-pills::-webkit-scrollbar { display: none; }
  .ind-pill { flex-shrink: 0; min-height: 44px; }

  .ind-hist__stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .ind-hist__stat--main { grid-column: 1 / -1; }
  .ind-hist .viz-card__head { flex-wrap: wrap; }
  .ind-hist .viz-card__titles { flex: 1 1 calc(100% - 60px); }
  .ind-hist .ind-trend { order: 3; margin-left: 46px; }

  .ae-list__head { padding: 14px 16px; }
  .ae-list__head .seg { width: 100%; flex-wrap: wrap; overflow: visible; }
  .ae-item {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    grid-template-areas: "date main main" "date sev grade";
    gap: 8px 12px;
    padding: 14px 16px;
  }
  .ae-item__date { grid-area: date; align-self: start; }
  .ae-item__main { grid-area: main; }
  .ae-item__sev { grid-area: sev; }
  .ae-item__grade { grid-area: grade; justify-self: end; }
  .ae-item__chev { display: none; }

  .ki-summary { flex-direction: column; align-items: flex-start; gap: 12px; }
  .ki-summary__hint { padding: 12px 0 0; border-left: 0; border-top: 1px solid rgba(255, 255, 255, .14); }
  .ki-grid { grid-template-columns: minmax(0, 1fr); }

  .ki-actions,
  .wd-actions {
    margin-left: -14px;
    margin-right: -14px;
    border-radius: 0;
    border-width: 1px 0 0;
    bottom: 72px;
    padding: 12px 14px;
  }
  .ki-actions .btn,
  .wd-actions .btn { flex: 1 1 auto; justify-content: center; min-height: 44px; }
  .ki-actions__text,
  .wd-actions__text { flex-basis: 100%; }

  .goal-list__head { display: none; }
  .goal-item {
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-areas: "icon name" "progress progress" "status status";
    gap: 10px 12px;
    padding: 14px 16px;
  }
  .goal-item__icon { grid-area: icon; }
  .goal-item__name { grid-area: name; }
  .goal-item__progress { grid-area: progress; }
  .goal-item__status { grid-area: status; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .goal-item__chev,
  .goal-item__when { display: none; }

  .goal-show { grid-template-columns: minmax(0, 1fr); }
  .goal-hero { padding: 16px; }
  .goal-hero__head { flex-wrap: wrap; }
  .goal-hero__nums { gap: 14px; }
  .goal-hero__value { font-size: 30px; }
  .goal-dir { grid-template-columns: minmax(0, 1fr); }
  .goal-form__target { max-width: none; }

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

  .wd-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "preview" "config" "actions"; }
  .wd-preview { position: static; }
  .wd-item { grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "pos name" "switch switch" "types types"; padding: 14px 16px; }
  .seg.wd-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .wd-type { justify-content: center; padding: 0 6px; height: 40px; }
}

@media (max-width: 380px) {
  .wd-type__label { display: none; }
  .seg.wd-types { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ind-hist__stats { grid-template-columns: minmax(0, 1fr); }
}
