/* GEMBA LEAN · componentes das telas: filtros compactos, Visão Geral e gráficos. */

/* ---------------------------------------------------------------- filtros */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-toggle {
  gap: 7px;
}
.filter-toggle.open {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px var(--ring-soft);
}
.filter-count {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 11px;
  font-weight: 700;
}
.filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.filter-chip {
  gap: 5px;
  padding: 4px 6px 4px 10px;
  border-color: var(--accent-border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-soft-fg);
  font-size: 12.5px;
}
.filter-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.filter-chip .icon {
  width: 13px;
  height: 13px;
}
.filter-search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(320px, 100%);
}
.filter-search > .icon {
  position: absolute;
  left: 11px;
  color: var(--muted-foreground);
  pointer-events: none;
}
.filter-search input {
  padding-left: 34px;
}
.filter-panel {
  margin: -4px 0 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.filter-grid > .date-field {
  min-width: 0;
}

/* ---------------------------------------------------------------- Visão Geral */

.heading.slim .actions button.primary .icon,
.heading.slim .actions button .icon {
  width: 15px;
  height: 15px;
}
.overview-top {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}
.overview-top .panel {
  margin-bottom: 0;
}
.today-panel .panel-head {
  margin-bottom: 10px;
}
.action-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 330px;
  overflow-y: auto;
}
.action-item {
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}
.action-item:hover {
  background: var(--muted);
}
.action-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--muted);
  color: var(--muted-foreground);
}
.action-item.critical .action-icon {
  background: color-mix(in srgb, var(--status-critical) 14%, transparent);
  color: var(--status-critical);
}
.action-item.serious .action-icon {
  background: color-mix(in srgb, var(--status-serious) 16%, transparent);
  color: var(--status-serious);
}
.action-item.warning .action-icon {
  background: color-mix(in srgb, var(--status-warning) 18%, transparent);
  color: color-mix(in srgb, var(--status-warning) 70%, var(--foreground));
}
.action-item.info .action-icon {
  background: var(--accent-soft);
  color: var(--accent);
}
.action-text {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}
.action-text b {
  font-size: 13.5px;
  font-weight: 600;
}
.action-text small {
  overflow: hidden;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted-foreground);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.action-go {
  color: var(--faint);
}
.action-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 34px 12px;
  text-align: center;
}
.action-empty .icon {
  width: 28px;
  height: 28px;
  margin-bottom: 4px;
  color: var(--status-good);
}
.action-empty small {
  color: var(--muted-foreground);
}
.kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.kpi {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.kpi small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}
.kpi-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}
.kpi strong {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}
.kpi-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted-foreground);
}
.spark {
  width: 96px;
  height: 30px;
  flex-shrink: 0;
}
.spark path {
  fill: none;
  stroke: var(--series-1);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.spark circle {
  fill: var(--series-1);
  stroke: var(--card);
  stroke-width: 2;
}
.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px 1px 5px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.delta .icon {
  width: 13px;
  height: 13px;
}
.delta.good {
  background: var(--success-soft);
  color: var(--success-soft-fg);
}
.delta.bad {
  background: var(--danger-soft);
  color: var(--danger-soft-fg);
}
.delta.flat {
  background: var(--muted);
  color: var(--muted-foreground);
}
.split.even {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
@media (max-width: 1100px) {
  .overview-top,
  .split.even {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 520px) {
  .kpis {
    grid-template-columns: minmax(0, 1fr);
  }
  .donut-wrap {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------------------------------------------------------------- Heijunka / Kanban */

.postit {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
  padding: 10px 11px;
  -webkit-touch-callout: none;
  user-select: none;
}
.postit .code {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0.02em;
}
.postit .code span:last-child {
  font-weight: 600;
  opacity: 0.65;
}
.postit .description {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 13.5px;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.postit .flags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.postit .flag {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgb(255 255 255 / 65%);
  font-size: 11px;
  font-weight: 600;
}
.postit .flag.prio {
  background: #ffe1e4;
  color: #a62130;
}
.postit .flag.done {
  background: #dbf3e4;
  color: #1d6b3f;
}
.postit-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
}
.mini-avatar {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgb(33 50 61 / 80%);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
}
.postit .age {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}
.postit .age::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-good);
}
.postit .age.aging::before {
  background: var(--status-warning);
}
.postit .age.old::before {
  background: var(--status-critical);
}
.postit .due {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}
.postit .due .icon {
  width: 12px;
  height: 12px;
}
.postit .due.late {
  color: #b42332;
  font-weight: 700;
}
.postit.dragging {
  opacity: 0.35;
}
.drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 400;
  margin: 0;
  box-shadow: 0 16px 40px rgb(0 0 0 / 28%);
  pointer-events: none;
}
.board {
  min-width: 2160px;
}
.board th .lane-name,
.board th .lane-date {
  display: block;
}
.board thead th {
  position: sticky;
  top: 0;
  padding: 10px 12px;
}
.board th .lane-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}
.board th .lane-date {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted-foreground);
}
.board th .lane-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.board th .lane-count {
  flex-shrink: 0;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
}
.board th.today {
  box-shadow: inset 0 -2px 0 var(--accent);
}
.board th.today .lane-name,
.board th.today .lane-date {
  color: var(--accent);
  font-weight: 600;
}
.board td.today {
  background: color-mix(in srgb, var(--accent-soft) 45%, transparent);
}
.board th.has-late .lane-count {
  border-color: transparent;
  background: var(--status-critical);
  color: #fff;
}
.board td {
  height: 150px;
}

/* ---------------------------------------------------------------- Rotina MC */

.routine-table th:first-child {
  position: relative;
  min-width: 260px;
  padding-right: 40px;
}
.routine-title {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--foreground);
}
.routine-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted-foreground);
}
.routine-meta .icon {
  width: 13px;
  height: 13px;
}
.routine-edit {
  position: absolute;
  top: 8px;
  right: 6px;
  width: 28px;
  height: 28px;
}
.routine-table thead th .lane-name,
.routine-table thead th .lane-date,
.schedule-table thead th .lane-date,
.schedule-table thead th .day-num {
  display: block;
}
.routine-table thead th .lane-date {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted-foreground);
}
.routine-table th.today,
.schedule-table th.today {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.routine-table th.today .lane-date,
.schedule-table th.today .lane-date {
  color: var(--accent);
  font-weight: 600;
}
.routine-table td,
.schedule-table td {
  vertical-align: middle;
}
.routine-table td.today,
.schedule-table td.today {
  background: color-mix(in srgb, var(--accent-soft) 45%, transparent);
}
.routine-chip {
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
}
.routine-chip .icon {
  width: 14px;
  height: 14px;
}
.routine-chip.planned {
  border-style: dashed;
  background: transparent;
  color: var(--muted-foreground);
}
.routine-chip.done {
  border-color: var(--success-border);
  background: var(--success-soft);
  color: var(--success-soft-fg);
}
/* Pendente (passou sem registro) fica discreto: contorno tracejado, sem fundo. Assim
   Realizada e Não realizada se destacam na grade. */
.routine-chip.pending {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--status-warning) 40%, transparent);
  background: transparent;
  color: color-mix(in srgb, var(--status-warning) 45%, var(--muted-foreground));
  font-weight: 500;
}
/* Totais da grade: coluna "Semana" por atividade e linha "Feitas no dia". */
.routine-table .routine-sum {
  text-align: center;
  white-space: nowrap;
}
.routine-table .routine-sum b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}
.routine-table thead th.routine-sum,
.routine-table td.routine-week-sum {
  border-left: 1px solid var(--border);
}
.routine-table td.routine-week-sum {
  background: var(--surface);
}
.routine-table tfoot th,
.routine-table tfoot td {
  border-top: 2px solid var(--border);
  background: var(--surface);
}
.routine-table tfoot th {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted-foreground);
}
.adh {
  font-size: 11.5px;
  font-weight: 600;
}
.adh.good {
  color: var(--success);
}
.adh.mid {
  color: color-mix(in srgb, var(--status-warning) 70%, var(--foreground));
}
.adh.low {
  color: var(--red);
}
.routine-chip.missed {
  border-color: color-mix(in srgb, var(--status-critical) 35%, transparent);
  background: var(--danger-soft);
  color: var(--danger-soft-fg);
}
.routine-chip.moved {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent-soft-fg);
}
.routine-note {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted-foreground);
}
.routine-off {
  color: var(--faint);
}
/* Minha rotina (Colaborador MC): lista do dia com Fiz / Não fiz. */
.my-routine {
  display: grid;
  gap: 8px;
}
.my-routine-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 10px;
  background: var(--card);
}
.my-routine-item.is-done {
  border-left-color: var(--success);
}
.my-routine-item.is-missed {
  border-left-color: var(--red);
}
.my-routine-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.my-routine-day {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
  text-transform: uppercase;
}
.my-routine-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}
.my-routine-btn {
  min-width: 96px;
  font-weight: 600;
}
.my-routine-btn .icon {
  width: 15px;
  height: 15px;
}
.my-routine-btn.done.is-on {
  border-color: var(--success-border);
  background: var(--success-soft);
  color: var(--success-soft-fg);
}
.my-routine-btn.missed.is-on {
  border-color: color-mix(in srgb, var(--status-critical) 35%, transparent);
  background: var(--danger-soft);
  color: var(--danger-soft-fg);
}
@media (max-width: 760px) {
  .my-routine-item {
    flex-direction: column;
    align-items: stretch;
  }
  .my-routine-actions > * {
    flex: 1;
  }
}

/* ---------------------------------------------------------------- Chamada Gemba */

.schedule-table th {
  font-size: 12px;
}
.schedule-table thead th .day-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--foreground);
}
.schedule-cell {
  position: relative;
  width: 100%;
  min-width: 52px;
  min-height: 34px;
  padding: 4px 6px;
  border: 1px dashed transparent;
  border-radius: 8px;
  background: transparent;
  font-size: 11.5px;
  font-weight: 700;
}
.schedule-cell:hover {
  border-color: var(--input);
  background: var(--muted);
}
.schedule-cell.filled {
  border: 1px solid color-mix(in srgb, var(--route) 55%, transparent);
  background: color-mix(in srgb, var(--route) 16%, transparent);
  color: color-mix(in srgb, var(--route) 65%, var(--foreground));
}
.presence {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 2px solid var(--card);
  border-radius: 50%;
  color: #fff;
}
.presence .icon {
  width: 10px;
  height: 10px;
  stroke-width: 3;
}
.presence.ok {
  background: var(--status-good);
}
.presence.no {
  background: var(--status-critical);
}
.presence.just {
  background: var(--status-warning);
}
.outside-month {
  background: var(--surface) !important;
}

/* ---------------------------------------------------------------- tour guiado (tour.js) */

.tour-dim,
.tour-spot,
.tour-card {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: visible;
}
/* Escurece tudo; o recorte (clip-path) deixa o elemento destacado à mostra e clicável. */
.tour-dim {
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  background: rgb(9 9 11 / 62%);
  pointer-events: none;
}
.tour-spot {
  border-radius: 10px;
  background: transparent;
  box-shadow: 0 0 0 3px var(--ring);
  pointer-events: none;
  transition:
    left 0.2s ease,
    top 0.2s ease,
    width 0.2s ease,
    height 0.2s ease;
}
.tour-spot.none {
  display: none;
}
.tour-card {
  width: min(340px, calc(100vw - 24px));
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 20px 50px rgb(0 0 0 / 30%);
}
.tour-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted-foreground);
}
.tour-card h3 {
  margin: 8px 0 6px;
  font-size: 16px;
}
.tour-card p {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted-foreground);
}
.tour-card p b {
  color: var(--foreground);
}
.tour-bar {
  height: 4px;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--muted);
}
.tour-bar i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 0.25s;
}
.tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tour-wait {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-soft-fg);
  font-size: 12.5px;
  font-weight: 600;
  animation: tour-pulse 1.6s ease-in-out infinite;
}
@keyframes tour-pulse {
  50% {
    box-shadow: 0 0 0 4px var(--ring-soft);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tour-spot,
  .tour-bar i {
    transition: none;
  }
  .tour-wait {
    animation: none;
  }
}

/* Painel de Ajuda */
.help-block {
  margin-bottom: 26px;
}
.help-block h3 {
  margin: 0 0 10px;
}
.help-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.help-head span {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-foreground);
}
.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.task.done {
  background: var(--surface);
}
.task-check {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 2px solid var(--input);
  border-radius: 50%;
  color: #fff;
}
.task.done .task-check {
  border-color: var(--status-good);
  background: var(--status-good);
}
.task-check .icon {
  width: 14px;
  height: 14px;
}
.task-text {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}
.task-text b {
  font-size: 14px;
}
.task.done .task-text b {
  color: var(--muted-foreground);
}
.task-text small {
  font-size: 12.5px;
  color: var(--muted-foreground);
}
.task button {
  flex-shrink: 0;
}
.glossary {
  display: grid;
  gap: 8px;
  margin: 0;
}
.glossary div {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
}
.glossary dt {
  font-weight: 700;
}
.glossary dd {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted-foreground);
}
.news {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.news li {
  display: flex;
  flex-direction: column;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}
.news span {
  font-size: 13px;
  color: var(--muted-foreground);
}
@media (max-width: 520px) {
  .task {
    flex-wrap: wrap;
  }
  .task button {
    width: 100%;
  }
}

/* ---------------------------------------------------------------- painel lateral (detalhes) */

dialog.drawer {
  width: min(760px, 100vw);
  height: 100vh;
  max-height: 100vh;
  margin: 0 0 0 auto;
  border-width: 0 0 0 1px;
  border-radius: 0;
  animation: drawer-in 0.18s ease-out;
}
dialog.drawer #modal-form {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
dialog.drawer .modal-body {
  flex: 1;
}
dialog.drawer::backdrop {
  background: rgb(9 9 11 / 35%);
  backdrop-filter: none;
}
@keyframes drawer-in {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  dialog.drawer {
    animation: none;
  }
}

/* ---------------------------------------------------------------- etapas */

.stepper {
  display: flex;
  gap: 4px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.stepper li {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  text-align: center;
}
.stepper li + li::before {
  content: '';
  position: absolute;
  top: 13px;
  right: calc(50% + 16px);
  left: calc(-50% + 16px);
  height: 2px;
  border-radius: 2px;
  background: var(--border);
}
.stepper li.done::before,
.stepper li.current::before {
  background: var(--accent);
}
.step-dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 700;
}
.step-dot .icon {
  width: 14px;
  height: 14px;
}
.stepper li.done .step-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--primary-fg);
}
.stepper li.current .step-dot {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring-soft);
}
.stepper li.current.late .step-dot {
  border-color: var(--status-critical);
  color: var(--status-critical);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--status-critical) 18%, transparent);
}
.stepper li.current.paused .step-dot {
  border-color: var(--status-warning);
  color: color-mix(in srgb, var(--status-warning) 70%, var(--foreground));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--status-warning) 20%, transparent);
}
.step-label {
  overflow: hidden;
  max-width: 100%;
  font-size: 12px;
  color: var(--muted-foreground);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.stepper li.current .step-label {
  color: var(--foreground);
  font-weight: 600;
}
.stepper.compact {
  margin: 0;
}
.stepper.compact .step-dot {
  width: 12px;
  height: 12px;
  border-width: 2px;
  font-size: 0;
}
.stepper.compact .step-dot .icon {
  display: none;
}
.stepper.compact li + li::before {
  top: 5px;
  right: calc(50% + 8px);
  left: calc(-50% + 8px);
}
.stepper.compact .step-label {
  display: none;
}
.stepper.compact li.current .step-dot {
  box-shadow: 0 0 0 3px var(--ring-soft);
}

/* Formulário em etapas */
.wizard-steps {
  display: flex;
  gap: 6px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}
.wizard-steps li {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted-foreground);
  cursor: pointer;
}
.wizard-steps li .step-dot {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  font-size: 11px;
}
.wizard-steps li.current {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-soft-fg);
}
.wizard-steps li.current .step-dot,
.wizard-steps li.done .step-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--primary-fg);
}
.wizard-steps li .step-label {
  color: inherit;
  font-weight: 600;
}
dialog.stepped {
  width: min(720px, 94vw);
}
dialog.stepped .modal-foot [data-close] {
  order: -1;
  margin-right: auto;
}
@media (max-width: 760px) {
  dialog.stepped,
  dialog.drawer {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  dialog.stepped #modal-form {
    display: flex;
    flex-direction: column;
    min-height: 100%;
  }
  dialog.stepped .modal-body {
    flex: 1;
  }
  .wizard-steps li .step-label {
    display: none;
  }
  .wizard-steps li {
    flex: 0 0 auto;
    padding: 6px;
  }
  .wizard-steps li.current {
    flex: 1;
  }
  .wizard-steps li.current .step-label {
    display: block;
  }
}

/* Percentual com controle deslizante */
.range-field {
  grid-column: 1 / -1;
}
.range-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.range-row input[type='range'] {
  flex: 1;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--primary);
}
.range-row input[type='range'].unset {
  opacity: 0.4;
}
.range-value {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 104px;
}
.range-value input {
  text-align: right;
  font-weight: 600;
}
.gemba-sector-review,
.gemba-problem {
  margin-top: 14px;
  padding: 18px;
}
.gemba-sector-review:first-child,
.gemba-problem:first-child {
  margin-top: 0;
}
.percent-input {
  display: flex;
  align-items: center;
  gap: 8px;
}
.percent-input input {
  text-align: right;
  font-weight: 600;
}

/* ---------------------------------------------------------------- A3 */

.ring {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}
.ring svg {
  position: absolute;
  inset: 0;
}
.ring circle {
  fill: none;
  stroke-width: 5;
}
.ring-track {
  stroke: var(--muted);
}
.ring-fill {
  stroke: var(--accent);
  stroke-linecap: round;
}
.ring b {
  position: relative;
  font-size: 11.5px;
  font-weight: 700;
}
.hours-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}
.hours-track {
  position: relative;
  display: block;
  height: 6px;
  border-radius: 6px;
  background: var(--muted);
}
.hours-track i {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: var(--series-1);
}
.hours-bar.over .hours-track i {
  background: var(--status-critical);
}
.hours-track em {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 12px;
  border-radius: 2px;
  background: var(--foreground);
  transform: translateX(-1px);
}
.hours-bar small {
  font-size: 11.5px;
  color: var(--muted-foreground);
}
.a3-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.a3-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.a3-card:hover {
  border-color: var(--input);
  box-shadow: var(--shadow-md);
}
.a3-card.late {
  border-left: 3px solid var(--status-critical);
}
.card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  border-radius: inherit;
  background: transparent;
}
.card-link:hover {
  background: transparent;
}
.a3-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.a3-code {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
}
.a3-title {
  font-family: var(--font-heading);
  font-size: 15px;
  line-height: 1.3;
}
.a3-where {
  margin-top: -6px;
  font-size: 12.5px;
  color: var(--muted-foreground);
}
.a3-card .stepper.compact {
  margin: 4px 0 2px;
}
.a3-card-foot {
  display: flex;
  align-items: center;
  gap: 14px;
}
.a3-card-foot .hours-bar {
  flex: 1;
}
.a3-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted-foreground);
}
.a3-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.a3-meta .icon {
  width: 14px;
  height: 14px;
}
.a3-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.a3-summary > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}
.a3-summary small {
  color: var(--muted-foreground);
}

/* ---------------------------------------------------------------- gráficos */

.chart-card .chart-head {
  margin-bottom: 14px;
}
.chart-card .chart-head h2 {
  margin: 0 0 4px;
}
.chart-card .chart-head .sub {
  margin: 0;
  font-size: 13px;
}
.chart-card .chart-head .sub b {
  color: var(--foreground);
}
.chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart .grid {
  stroke: var(--chart-grid);
  stroke-width: 1;
}
.chart .axis {
  stroke: var(--chart-axis);
  stroke-width: 1;
}
.chart .tick {
  fill: var(--muted-foreground);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.chart .value {
  fill: var(--foreground);
  font-size: 11.5px;
  font-weight: 600;
}
.chart .s1 {
  fill: var(--series-1);
}
.chart .s2 {
  fill: var(--series-2);
}
.chart .hit {
  fill: transparent;
  cursor: default;
}
.chart .hit:hover,
.chart .hit:focus-visible {
  fill: var(--muted);
  fill-opacity: 0.5;
  outline: none;
}
.chart-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: var(--muted-foreground);
}
.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.k {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 3px;
  vertical-align: -1px;
}
.k.s1 {
  background: var(--series-1);
}
.k.s2 {
  background: var(--series-2);
}
.chart-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted-foreground);
}
.chart-table {
  margin-top: 12px;
  font-size: 13px;
}
.chart-table summary {
  width: max-content;
  color: var(--muted-foreground);
  cursor: pointer;
}
.chart-table summary:hover {
  color: var(--foreground);
}
.chart-table table {
  margin-top: 8px;
}
.chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 12px;
  border: 1px dashed var(--input);
  border-radius: 10px;
  color: var(--muted-foreground);
  font-size: 13.5px;
  text-align: center;
}
.chart-empty .icon {
  width: 22px;
  height: 22px;
  color: var(--faint);
}
.chart-tip {
  position: fixed;
  z-index: 200;
  max-width: 260px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-md);
  font-size: 12.5px;
  line-height: 1.5;
  pointer-events: none;
}

/* Roscas */
.donut-wrap {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.donut-chart {
  display: grid;
  place-items: center;
}
.donut-chart svg {
  width: min(100%, 220px);
  height: auto;
  overflow: visible;
}
.donut-hole {
  fill: var(--card);
}
.donut-total {
  fill: var(--foreground);
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.donut-label {
  fill: var(--muted-foreground);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.donut-hit {
  cursor: default;
}
.donut-hit:hover,
.donut-hit:focus-visible {
  outline: none;
  stroke: color-mix(in srgb, var(--foreground) 10%, transparent);
}
.donut-legend {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.donut-legend span {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  font-size: 13px;
}
.donut-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.donut-legend b {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.donut-legend small {
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Pareto */
.pareto {
  max-height: 420px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pareto-row {
  display: grid;
  grid-template-columns: minmax(90px, 40%) minmax(0, 1fr) 108px;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
  border-radius: 8px;
}
.pareto-row:hover,
.pareto-row:focus-visible {
  background: var(--muted);
  outline: none;
}
.pareto-label {
  overflow: hidden;
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pareto-track {
  display: block;
  min-width: 0;
  overflow: hidden;
  border-radius: 0 4px 4px 0;
}
.pareto-track i {
  display: block;
  height: 14px;
  border-radius: 0 4px 4px 0;
  background: var(--chart-muted);
}
.pareto-row.vital .pareto-track i {
  background: var(--series-1);
}
.pareto-row.vital .pareto-label {
  font-weight: 600;
}
.pareto-value {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pareto-value small {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted-foreground);
}

/* Mapa de saúde das BUs */
.heatmap {
  border-collapse: separate;
  border-spacing: 3px;
}
.heatmap th,
.heatmap td {
  border: 0;
}
.heatmap thead th {
  padding: 4px 8px;
  background: transparent;
  font-size: 12px;
  text-align: center;
}
.heatmap thead th:first-child {
  text-align: left;
}
.heatmap tbody th {
  padding: 6px 8px 6px 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.heatmap tbody th small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted-foreground);
  text-overflow: ellipsis;
}
.heatmap {
  width: 100%;
  table-layout: fixed;
}
.heatmap thead th:first-child,
.heatmap tbody th {
  width: 30%;
}
.heatmap .hm-action {
  width: 34px;
}
.heatmap tr.idle th {
  opacity: 0.6;
}
.heatmap .hm {
  padding: 9px 4px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hm-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--faint);
  vertical-align: 1px;
}
.hm.good {
  background: color-mix(in srgb, var(--status-good) 13%, transparent);
}
.hm.warning {
  background: color-mix(in srgb, var(--status-warning) 18%, transparent);
}
.hm.serious {
  background: color-mix(in srgb, var(--status-serious) 18%, transparent);
}
.hm.critical {
  background: color-mix(in srgb, var(--status-critical) 16%, transparent);
}
.hm.none {
  background: var(--muted);
  color: var(--muted-foreground);
  font-weight: 400;
}
.hm.good .hm-dot,
.hm-dot.good {
  background: var(--status-good);
}
.hm.warning .hm-dot,
.hm-dot.warning {
  background: var(--status-warning);
}
.hm.serious .hm-dot,
.hm-dot.serious {
  background: var(--status-serious);
}
.hm.critical .hm-dot,
.hm-dot.critical {
  background: var(--status-critical);
}
.hm-action {
  width: 36px;
  padding: 0 !important;
  background: transparent !important;
}
.chart-legend.status {
  gap: 12px;
}
.chart-legend.status .hm-dot {
  margin-right: 0;
}

/* ---------------------------------------------------------------- Heijunka (visual leve) */

/* Linha de controles: BU, semana, Hoje, tipo de quadro e registrar. */
.hj-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.hj-bu {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-foreground);
}
.hj-bu select {
  min-width: 0;
  max-width: 340px;
  border-color: transparent;
  background-color: transparent;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--foreground);
}
.hj-bu select:hover {
  background-color: var(--muted);
}
.hj-sep {
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: var(--border);
}
.hj-week {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.hj-week .icon-btn {
  font-size: 18px;
}
.hj-week .date-field {
  min-width: 0;
}
.hj-week .date-display,
.hj-week input[type='date'] {
  min-height: 32px;
  border-color: transparent;
  background: transparent;
  font-weight: 600;
}
.hj-week .date-display:hover {
  background: var(--muted);
}
.hj-today {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 600;
}
.hj-today:hover {
  background: var(--accent-soft);
}
.hj-today:disabled {
  color: var(--faint);
  background: transparent;
  cursor: default;
}
.hj-grow {
  flex: 1;
}
.hj-toggle {
  display: inline-flex;
  padding: 2px;
  border-radius: 9px;
  background: var(--muted);
}
.hj-toggle button {
  min-height: 30px;
  padding: 4px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 600;
}
.hj-toggle button.on {
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}

/* Indicadores como frase. */
.hj-summary {
  margin: 4px 0 16px 2px;
  font-size: 13.5px;
  color: var(--muted-foreground);
}
.hj-summary b {
  font-weight: 700;
  color: var(--foreground);
}
.hj-summary span + span::before {
  content: '·';
  margin: 0 9px;
  color: var(--faint);
}
.hj-summary .late,
.hj-summary .late b {
  color: var(--red);
}

/* Backlog na lateral e quadro sem moldura. */
.hj-stage {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.hj-tray {
  position: sticky;
  top: 76px;
}
.hj-tray h3,
.hj-below h4 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 10px;
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.hj-tray-list {
  display: grid;
  gap: 8px;
  min-height: 60px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  padding: 2px;
  border-radius: 10px;
}
.hj-empty {
  margin: 0;
  font-size: 12.5px;
  color: var(--faint);
}
.hj-hint {
  margin: 8px 2px 0;
  font-size: 12px;
  color: var(--faint);
}
.hj-frame {
  max-height: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow-x: auto;
}
.hj-board {
  width: 100%;
  min-width: 928px; /* setor 136 + 5 dias de 120 + 4 semanas de 48: cabe inteiro a partir de ~1440px */
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
.hj-board th,
.hj-board td {
  border: 0;
  background: transparent;
}
.hj-board thead th {
  padding: 4px 10px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: bottom;
}
.hj-board .hj-corner {
  width: 136px;
}
.hj-d {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}
.hj-d em {
  margin-left: 4px;
  font-style: normal;
  font-weight: 500;
  color: var(--faint);
}
.hj-n {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted-foreground);
}
.hj-n.warn {
  color: var(--red);
  font-weight: 600;
}
.hj-day.past .hj-d {
  color: var(--muted-foreground);
}
.hj-day.today {
  box-shadow: inset 0 2px 0 var(--accent);
}
.hj-day.today .hj-d,
.hj-day.today .hj-d em {
  color: var(--accent);
}
.hj-board .hj-wkh {
  width: 48px;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
}
.hj-board .hj-wkh.first,
.hj-board td.hj-wk.first {
  border-left: 1px solid var(--border);
}
.hj-board .hj-sector {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
  text-align: left;
  vertical-align: top;
}
.hj-board td.hj-cell {
  min-width: 140px;
  height: auto;
  min-height: 96px;
  padding: 8px 6px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.hj-board td.hj-cell.today {
  background: color-mix(in srgb, var(--accent-soft) 35%, transparent);
}
.hj-board td.hj-cell.past {
  background: color-mix(in srgb, var(--muted) 25%, transparent);
}
.hj-board td.hj-wk {
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: center;
}
.hj-board td.drop,
.hj-board .drop {
  min-height: 0;
}

/* Post-it limpo (Heijunka) e miniatura. */
.postit.clean {
  margin: 0 0 6px;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  box-shadow: 0 1px 0 rgb(0 0 0 / 22%);
  font-size: 12.5px;
}
.postit.clean .code {
  margin-bottom: 2px;
  font-size: 10.5px;
  opacity: 0.65;
}
.postit.clean .description {
  display: -webkit-box;
  margin-bottom: 4px;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.3;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.postit.clean .postit-foot {
  gap: 8px;
  font-size: 10.5px;
}
.postit.clean .due {
  margin-left: 0;
}
.postit.clean.overdue {
  border: 0;
  box-shadow:
    inset 3px 0 0 #d03b3b,
    0 1px 0 rgb(0 0 0 / 22%);
}
.postit.chip {
  white-space: nowrap;
  display: inline-block;
  width: auto;
  margin: 0 0 4px;
  padding: 2px 6px;
  border: 0;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  box-shadow: 0 1px 0 rgb(0 0 0 / 22%);
}
.postit.chip.overdue {
  border: 0;
  box-shadow:
    inset 2px 0 0 #d03b3b,
    0 1px 0 rgb(0 0 0 / 22%);
}

/* Embaixo: atrasadas de semanas anteriores, encerradas, acionamentos. */
.hj-below {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.hj-lane {
  min-width: 160px;
  min-height: 0;
  padding: 4px;
  border-radius: 10px;
}
.hj-lane.late {
  flex: 1;
}
.hj-lane.late h4 {
  color: var(--red);
}
.hj-lane-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}
.hj-lane-list .postit.clean {
  width: 200px;
  margin: 0;
}
.hj-more {
  font-size: 12px;
  color: var(--faint);
}
.hj-help {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 12px;
  color: var(--faint);
  cursor: help;
}
@media (max-width: 760px) {
  .hj-sep,
  .hj-grow {
    display: none;
  }
  .hj-bu {
    flex-basis: 100%;
  }
}
/* Post-it limpo em coluna estreita: código, tipo e rodapé numa linha só. */
.postit.clean .code {
  gap: 6px;
}
.postit.clean .code span {
  white-space: nowrap;
}
.postit.clean .code span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.postit.clean .postit-foot {
  flex-wrap: nowrap;
  white-space: nowrap;
}
.hj-board td.hj-cell {
  padding: 6px 5px;
}

/* ---------------------------------------------------------------- filtros em modal */

.filter-toggle.has-active {
  border-color: var(--accent-border);
  color: var(--accent);
}
/* No Heijunka, filtros e busca ficam na mesma linha dos controles. */
.hj-bar .filter-bar {
  flex: 1;
  justify-content: flex-end;
  flex-wrap: nowrap;
  min-width: 0;
  margin: 0;
}
.hj-bar .filter-chips {
  flex: 0 1 auto;
  justify-content: flex-end;
}
.hj-bar .filter-search {
  width: 250px;
  flex-shrink: 1;
}
dialog.filter-dialog {
  width: min(680px, calc(100vw - 32px));
}
.filter-modal {
  display: grid;
  gap: 4px;
}
.fm-group {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.fm-group:first-child {
  padding-top: 4px;
}
.fm-group:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.fm-group h3 {
  margin: 2px 0 2px;
  font-size: 14px;
}
.fm-group header p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--muted-foreground);
}
.fm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.fm-grid .field {
  margin: 0;
}
.fm-grid .date-field {
  min-width: 0;
}
.modal-foot .fm-reset {
  margin-right: auto;
  font-size: 13.5px;
}
@media (max-width: 760px) {
  .hj-bar .filter-bar {
    flex-basis: 100%;
    flex-wrap: wrap;
  }
  .hj-bar .filter-search {
    width: 100%;
  }
  .fm-group {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
}
@media (max-width: 480px) {
  .fm-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* Divisórias entre os grupos da barra do Heijunka. */
.hj-bar {
  gap: 8px;
}
.hj-bar .hj-sep {
  flex-shrink: 0;
  height: 24px;
  margin: 0 8px;
  background: var(--border);
}
.hj-bar .filter-bar {
  gap: 10px;
}
/* A busca não encolhe até sumir: sem espaço, o grupo de filtros desce de linha. */
.hj-bar .filter-search {
  min-width: 220px;
}
.hj-bar .filter-bar {
  flex: 1 1 auto;
}
/* Quando a barra quebra em duas linhas, o modo do quadro e o Registrar ficam à direita. */
.hj-bar .hj-toggle {
  margin-left: auto;
}

/* ---------------------------------------------------------------- Kanban */

.kb-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  border-radius: 12px;
}
.kb-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
}
.kb-head h3 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kb-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
}
.kb-dot.blue {
  background: var(--series-1);
}
.kb-dot.amber {
  background: var(--status-warning);
}
.kb-dot.purple {
  background: #a78bfa;
}
.kb-dot.red {
  background: var(--status-critical);
}
.kb-dot.green {
  background: var(--status-good);
}
.kb-dot.teal {
  background: var(--accent);
}
.kb-count {
  flex-shrink: 0;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 11.5px;
  font-weight: 600;
}
.kb-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 70px;
  padding: 10px;
}
.kb-list .postit.clean {
  margin: 0;
}
.kb-empty {
  margin: 0;
  padding: 16px 8px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--faint);
  text-align: center;
}
.postit.clean .sector {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.75;
}
/* Computador: colunas lado a lado, do tamanho da tela, cada uma com rolagem própria. */
@media (min-width: 761px) {
  .kanban.kb {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(210px, 1fr);
    align-items: stretch;
    gap: 12px;
    overflow-x: auto;
    padding: 2px 2px 12px;
  }
  .kb-col {
    height: calc(100vh - 250px);
    min-height: 320px;
  }
  .kb-list {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}
/* Modo do quadro e Registrar andam juntos: se a barra quebra, descem juntos, à direita. */
.hj-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}
.hj-bar .hj-actions .hj-toggle {
  margin-left: 0;
}
/* Setores com nomes reais (ex.: "Recebimento / Suprimentos"): quebra por palavra, em até
   duas linhas, e a coluna fica fixa ao rolar o quadro para o lado. */
.hj-board .hj-sector,
.hj-board .hj-corner {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--background);
}
.hj-board .hj-sector {
  font-size: 12.5px;
  line-height: 1.3;
  overflow-wrap: break-word;
  hyphens: manual;
  box-shadow: inset -1px 0 0 var(--line);
}
/* Telas médias (até 1439px): o backlog vira uma faixa horizontal acima do quadro, para o
   quadro ganhar a largura toda. */
@media (min-width: 761px) and (max-width: 1439px) {
  .hj-stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .hj-tray {
    position: static;
  }
  .hj-tray-list {
    display: flex;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
  }
  .hj-tray-list .postit.clean {
    flex: 0 0 210px;
    margin: 0;
  }
  .hj-hint {
    display: none;
  }
}
/* As divisórias entre filtros, modo do quadro e Registrar só aparecem quando a barra cabe
   numa linha; quebrando, ficariam soltas no fim da linha. */
@media (max-width: 1599px) {
  .hj-bar .filter-bar + .hj-sep,
  .hj-bar .hj-actions .hj-sep {
    display: none;
  }
}
/* Kanban: a lista tem a largura da coluna (antes crescia até o rodapé mais largo e o
   post-it era cortado). No rodapé, o setor encolhe com reticências; idade e prazo, não. */
.kb-list {
  grid-template-columns: minmax(0, 1fr);
}
.kb-list > .postit {
  min-width: 0;
}
.postit.clean .postit-foot {
  min-width: 0;
}
.postit.clean .postit-foot .age,
.postit.clean .postit-foot .due {
  flex-shrink: 0;
}
.postit.clean .postit-foot .sector {
  flex: 0 1 auto;
}

/* ---------------------------------------------------------------- Gemba (lista de visitas) */

/* Sem seletor de BU: filtros e busca ocupam a barra e o Registrar fica à direita. */
.gv-bar .filter-bar {
  justify-content: flex-start;
}
.gv-bar .filter-search {
  margin-left: auto;
}
.gv-group {
  margin-bottom: 22px;
}
.gv-group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.gv-group h3 span {
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0;
}
.gv-list {
  display: grid;
  gap: 8px;
  container-type: inline-size;
}
/* Uma visita por linha; o card inteiro abre o detalhe. */
.gv-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 150px 112px 112px 104px 124px;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 0;
  padding: 14px 18px 14px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-weight: 400;
  text-align: left;
  white-space: normal;
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.gv-item:hover {
  border-color: var(--accent-border);
  background: var(--card);
  box-shadow: var(--shadow-md);
}
.gv-item:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.gv-item.cancelled {
  opacity: 0.6;
}
.gv-item small {
  display: block;
  margin-bottom: 3px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted-foreground);
}
.gv-date {
  display: grid;
  justify-items: center;
  padding: 6px 0;
  border-radius: 10px;
  background: var(--muted);
}
.gv-date b {
  font-family: var(--font-heading);
  font-size: 20px;
  line-height: 1.1;
}
.gv-date small {
  margin: 2px 0 0;
  font-size: 11px;
  white-space: nowrap;
}
.gv-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.gv-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.gv-title b {
  font-family: var(--font-heading);
  font-size: 14.5px;
}
.gv-title span {
  font-size: 12.5px;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gv-bu {
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gv-sectors {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.gv-sectors span {
  max-width: 100%;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--muted);
  font-size: 11.5px;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* No desktop os números entram direto na grade do card. */
.gv-facts {
  display: contents;
}
.gv-owner,
.gv-posts {
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.gv-metric b {
  display: block;
  font-family: var(--font-heading);
  font-size: 15px;
}
.none,
.gv-metric b.none {
  color: var(--faint);
}
.gv-meter {
  display: block;
  height: 4px;
  margin-top: 5px;
  border-radius: 99px;
  background: var(--muted);
  overflow: hidden;
}
.gv-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}
.gv-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-self: start;
  padding: 4px 10px 4px 9px;
  border-radius: 99px;
  background: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* As larguras seguem a da lista (a barra lateral muda o espaço disponível).
   Lista média: o condutor sai da linha e os números ficam mais estreitos. */
@container (max-width: 1039px) {
  .gv-item {
    grid-template-columns: 58px minmax(0, 1fr) 96px 96px 96px 118px;
    gap: 14px;
  }
  .gv-owner {
    display: none;
  }
}
@media (max-width: 760px) {
  .gv-bar .filter-search {
    margin-left: 0;
  }
}
/* Lista estreita: data e título em cima, números numa segunda linha. */
@container (max-width: 779px) {
  .gv-item {
    grid-template-columns: 60px minmax(0, 1fr);
    grid-template-areas:
      'date main'
      'facts facts';
    gap: 12px;
    padding: 12px;
  }
  .gv-date {
    grid-area: date;
    align-self: start;
  }
  .gv-main {
    grid-area: main;
  }
  .gv-facts {
    grid-area: facts;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 22px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .gv-metric {
    min-width: 72px;
  }
  .gv-status {
    margin-left: auto;
  }
}

/* Detalhe da visita: blocos pequenos com os números e a ficha da visita. */
.gd-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 14px;
}
.gd-tile {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.gd-tile small {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--muted-foreground);
}
.gd-tile b {
  display: block;
  font-family: var(--font-heading);
  font-size: 19px;
  line-height: 1.2;
}
.gd-tile > span {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted-foreground);
}
.gd-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin: 0 0 8px;
}
.gd-info > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.gd-info dt {
  font-size: 12.5px;
  color: var(--muted-foreground);
}
.gd-info dd {
  margin: 0;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}
.gd-info dd .gv-status {
  padding: 2px 9px 2px 8px;
}
@media (max-width: 760px) {
  .gd-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gd-info {
    grid-template-columns: minmax(0, 1fr);
  }
  .gd-info > div {
    grid-template-columns: 100px minmax(0, 1fr);
  }
}

/* ---------------------------------------------------------------- A3 (lista de projetos) */

/* Mesmo card das visitas do Gemba, com o anel de avanço e a etapa. */
.a3-row {
  position: relative;
  grid-template-columns: 46px minmax(0, 1fr) 150px 150px 130px 96px 132px;
}
.a3-row.late {
  border-left: 3px solid var(--status-critical);
}
.a3-row .card-link:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.a3-row-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.a3-row .gv-bu {
  font-size: 12.5px;
  color: var(--muted-foreground);
}
.a3-stage .stepper {
  margin: 0;
}
.a3-hours .hours-bar {
  min-width: 0;
}
.a3-hours,
.a3-deadline {
  min-width: 0;
}
.a3-deadline b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}
.a3-deadline b.late,
.gd-tile .late,
.hj-summary b.late {
  color: var(--red);
}
.a3-deadline b.none {
  font-weight: 400;
}
.a3-section {
  margin: 30px 0 12px 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.a3-hours-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.a3-hours-head h2 {
  margin: 0;
}
.a3-hours-head .sub {
  margin: 4px 0 0;
}
.a3-hours-head .sub b {
  color: var(--foreground);
}
/* Filtros das horas lado a lado, com largura fixa. */
.a3-hours-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.a3-hours-filters > input,
.a3-hours-filters > select,
.a3-hours-filters > .date-field {
  flex: 0 0 220px;
  width: 220px;
  min-width: 0;
}
.a3-hours-filters > select {
  white-space: nowrap;
  text-overflow: ellipsis;
}
/* Horas por projeto, pessoa, BU e mês: quatro listas com barra, lado a lado quando cabem. */
.hg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.hg-card {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.hg-card h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.hg-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hg-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 12px;
}
.hg-label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.hg-list b {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.hg-bar {
  grid-column: 1 / -1;
  display: block;
  height: 5px;
  border-radius: 99px;
  background: var(--muted);
  overflow: hidden;
}
.hg-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--series-1);
}
@media (max-width: 520px) {
  .a3-hours-filters,
  .a3-hours-filters > input,
  .a3-hours-filters > select,
  .a3-hours-filters > .date-field {
    flex: 1 1 100%;
    width: 100%;
  }
}
/* Textos do detalhe do A3: rótulo pequeno e o texto completo abaixo. */
.gd-text {
  display: grid;
  gap: 10px;
  margin: 0 0 8px;
}
.gd-text dt {
  font-size: 12px;
  color: var(--muted-foreground);
}
.gd-text dd {
  margin: 2px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
@container (max-width: 1039px) {
  .a3-row {
    grid-template-columns: 46px minmax(0, 1fr) 140px 96px 128px;
  }
  .a3-stage {
    display: none;
  }
}
@container (max-width: 779px) {
  .a3-row {
    grid-template-columns: 46px minmax(0, 1fr);
    grid-template-areas:
      'ring main'
      'facts facts';
  }
  .a3-ring {
    grid-area: ring;
    align-self: start;
  }
  .a3-row .gv-owner {
    display: block;
  }
  .a3-hours {
    flex: 1 1 150px;
  }
}
/* Horas acima do planejado: a barra fica vermelha. */
.gv-meter.over i {
  background: var(--status-critical);
}

/* ---------------------------------------------------------------- Melhorias (banco) */

/* Ganhos somados: três blocos logo abaixo da frase. */
.mv-gains {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 22px;
}
.mv-gains .gd-tile b {
  overflow-wrap: anywhere;
}
.mv-row {
  grid-template-columns: minmax(0, 1fr) 190px 120px 160px;
  align-items: start;
  padding: 14px 18px;
}
.mv-row .gv-main {
  gap: 4px;
}
.mv-desc {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mv-solution {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted-foreground);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mv-row .gv-sectors .where {
  background: transparent;
  padding-left: 0;
}
.mv-row .gv-sectors .cat {
  background: var(--accent-soft);
  color: var(--accent-soft-fg);
}
.mv-gain,
.mv-origin {
  min-width: 0;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.mv-row .gv-status {
  align-self: start;
}
@container (max-width: 1039px) {
  .mv-row {
    grid-template-columns: minmax(0, 1fr) 170px 150px;
  }
  .mv-origin {
    display: none;
  }
}
@container (max-width: 779px) {
  .mv-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'main'
      'facts';
  }
  .mv-row .mv-origin {
    display: block;
  }
}
/* O código nunca quebra; o texto ao lado é que encolhe. */
.gv-title b {
  flex-shrink: 0;
  white-space: nowrap;
}
/* No celular os ganhos viram três linhas compactas: rótulo à esquerda, valor à direita. */
@media (max-width: 760px) {
  .mv-gains {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .mv-gains .gd-tile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 0 10px;
    padding: 9px 12px;
  }
  .mv-gains .gd-tile small {
    margin: 0;
  }
  .mv-gains .gd-tile b {
    font-size: 15px;
    text-align: right;
  }
  .mv-gains .gd-tile > span {
    grid-column: 2;
    margin-top: 1px;
    text-align: right;
  }
}

/* ---------------------------------------------------------------- Rotina MC */

/* Barra: semana, Hoje, analista e a nova atividade numa linha. */
.rt-owner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-foreground);
}
.rt-owner select {
  min-width: 0;
  max-width: 260px;
  border-color: transparent;
  background-color: transparent;
  font-weight: 600;
  color: var(--foreground);
}
.rt-owner select:hover {
  background-color: var(--muted);
}
.rt-bar .hj-week input[type='date'],
.rt-bar .hj-week .date-display {
  min-height: 32px;
  border-color: transparent;
  background: transparent;
  font-weight: 600;
}
.adh-good {
  color: var(--success) !important;
}
.adh-mid {
  color: color-mix(in srgb, var(--status-warning) 70%, var(--foreground)) !important;
}
.adh-low {
  color: var(--red) !important;
}
/* Atividade inativa: a linha fica apagada, mas continua editável. */
.routine-table tr.inactive th .routine-title,
.routine-table tr.inactive td {
  opacity: 0.55;
}
/* Aderência do mês por analista: lista com barra no tom da aderência. */
.rt-month-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.rt-month-head h2 {
  margin: 0;
}
.rt-analysts {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px 28px;
}
.rt-analysts small {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--muted-foreground);
}
.rt-tone-good i {
  background: var(--success);
}
.rt-tone-mid i {
  background: var(--status-warning);
}
.rt-tone-low i {
  background: var(--status-critical);
}
@media (max-width: 760px) {
  .routine-table.has-weekend tr {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
  .rt-bar .hj-grow {
    display: none;
  }
  .rt-bar .primary {
    margin-left: auto;
  }
}

/* ---------------------------------------------------------------- Chamada Gemba */

.ch-month {
  min-width: 132px;
  padding: 0 6px;
  font-weight: 600;
  text-align: center;
}
.ch-list {
  margin-bottom: 20px;
}
.ch-row {
  grid-template-columns: 58px minmax(0, 1fr) 190px 96px;
}
.ch-missing {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted-foreground);
}
.ch-absent {
  color: var(--red);
}
.ch-all {
  color: var(--success);
}
.ch-meter,
.ch-count {
  min-width: 0;
  font-size: 13px;
}
.ch-meter b {
  display: block;
  font-family: var(--font-heading);
  font-size: 15px;
}
/* Barra empilhada: presentes (verde), justificados (amarelo) e ausentes (vermelho). */
.ch-stack {
  display: flex;
  height: 5px;
  margin-top: 5px;
  border-radius: 99px;
  background: var(--muted);
  overflow: hidden;
}
.ch-stack i {
  display: block;
  height: 100%;
}
.ch-stack .p {
  background: var(--success);
}
.ch-stack .j {
  background: var(--status-warning);
}
.ch-stack .a {
  background: var(--status-critical);
}
@container (max-width: 779px) {
  .ch-row {
    grid-template-columns: 60px minmax(0, 1fr);
  }
  .ch-meter {
    flex: 1 1 160px;
  }
}

/* Formulário da chamada: um setor por linha com as quatro opções em botões. */
.call-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.call-head h3 {
  margin: 0 0 4px;
}
.call-head .sub {
  margin: 0;
}
.call-bulk {
  display: flex;
  gap: 14px;
}
.call-tally {
  margin: 10px 0 8px;
  font-size: 13px;
  color: var(--muted-foreground);
}
.call-tally b {
  color: var(--foreground);
}
.call-list {
  display: grid;
  border-top: 1px solid var(--border);
}
.call-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) auto minmax(160px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.call-sector {
  min-width: 0;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}
.call-opts {
  display: inline-flex;
  padding: 2px;
  border-radius: 9px;
  background: var(--muted);
}
.call-opt {
  position: relative;
  margin: 0;
  cursor: pointer;
}
.call-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.call-opt span {
  display: block;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted-foreground);
  white-space: nowrap;
}
.call-opt input:focus-visible + span {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}
.call-opt input:checked + span {
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}
.call-opt.presente input:checked + span {
  background: var(--success-soft);
  color: var(--success-soft-fg);
}
.call-opt.ausente input:checked + span {
  background: var(--danger-soft);
  color: var(--danger-soft-fg);
}
.call-opt.justificado input:checked + span {
  background: var(--amber-soft);
  color: var(--amber-soft-fg);
}
.call-note {
  min-width: 0;
  min-height: 34px;
}
@media (max-width: 760px) {
  .call-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 10px 0;
  }
  .call-opts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .call-opt span {
    padding: 6px 4px;
    text-align: center;
    font-size: 12px;
  }
}

/* ---------------------------------------------------------------- Cabeçalho das páginas */

/* Indicadores em destaque e, embaixo ou ao lado, a barra de filtros e ações. */
.pg-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 2px 0 20px;
}
.pg-head .hj-bar {
  margin: 0;
}
/* Barra curta (Gemba, A3, Melhorias): tudo na mesma linha quando cabe. */
.pg-head.inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
}
.pg-head.inline .hj-bar {
  flex: 0 1 auto;
  justify-content: flex-end;
  margin-left: auto;
}
.pg-head.inline .filter-bar {
  flex: 0 1 auto;
}
.pg-head.inline .filter-search {
  width: 200px;
  min-width: 180px;
  margin-left: 0;
}
.pg-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
}
.pg-kpi {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
}
.pg-kpi b {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.pg-kpi b.late {
  color: var(--red);
}
.pg-kpi span {
  font-size: 12.5px;
  color: var(--muted-foreground);
  white-space: nowrap;
}
.pg-kpi small {
  display: block;
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--faint);
}
@media (max-width: 760px) {
  .pg-head.inline .hj-bar {
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-left: 0;
  }
  .pg-head.inline .filter-search {
    width: 100%;
  }
  .pg-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 12px;
  }
  .pg-kpi b {
    font-size: 20px;
  }
  .pg-kpi span {
    white-space: normal;
  }
}

/* Visão Geral: saudação como título da página. */
.ov-hello h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.ov-hello p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted-foreground);
}
.pg-head.inline .hj-bar > button {
  flex-shrink: 0;
}

/* ---------------------------------------------------------------- Dashboard */

.dash-title .dash-crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 12.5px;
  color: var(--muted-foreground);
}
.dash-crumbs .link-btn {
  font-size: 12.5px;
}
.dash-range {
  display: inline-flex;
  padding: 2px;
  border-radius: 9px;
  background: var(--muted);
}
.dash-chip {
  min-height: 30px;
  padding: 4px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.dash-chip.on {
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}
/* Seis indicadores: seis em linha nas telas largas, três ou dois nas menores. */
.dash-kpis {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 8px;
}
/* Blocos numerados, cada um responde a uma pergunta. */
.dash-sec {
  margin-top: 26px;
}
.dash-sec > header {
  margin: 0 0 12px 2px;
}
.dash-sec > header h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 15px;
}
.dash-sec > header h3 span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-soft-fg);
  font-size: 12px;
}
.dash-sec > header p {
  margin: 3px 0 0 31px;
  font-size: 13px;
  color: var(--muted-foreground);
}
.dash-sec .panel {
  margin-bottom: 0;
}
.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.dash-grid.wide {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}
.dash-grid.three {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
}
.dash-grid.one {
  grid-template-columns: minmax(0, 1fr);
}
@media (max-width: 1280px) {
  .dash-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-grid.three > :first-child {
    grid-column: 1 / -1;
  }
}
@media (max-width: 1100px) {
  .dash-grid,
  .dash-grid.wide,
  .dash-grid.three {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Linhas dos gráficos (tendência e backlog) e a meta. */
.chart .ln {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart .ln.s1 {
  stroke: var(--series-1);
}
.chart .ln.s2 {
  stroke: var(--series-2);
  stroke-dasharray: 6 4;
}
.chart .dot {
  stroke: var(--card);
  stroke-width: 2;
}
.chart .dot.s1 {
  fill: var(--series-1);
}
.chart .dot.s2 {
  fill: var(--series-2);
}
.chart .goal {
  stroke: var(--status-good);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}
.k.goal {
  height: 2px;
  border-radius: 0;
  background: var(--status-good);
  vertical-align: 3px;
}

/* Idade dos abertos: barra empilhada do verde ao vermelho. */
.ag-bar {
  display: flex;
  gap: 2px;
  height: 26px;
  margin: 4px 0 16px;
  border-radius: 8px;
  overflow: hidden;
}
.ag-bar i {
  display: block;
  min-width: 4px;
}
.ag-0 {
  background: var(--status-good);
}
.ag-1 {
  background: color-mix(in srgb, var(--status-good) 45%, var(--status-warning));
}
.ag-2 {
  background: var(--status-warning);
}
.ag-3 {
  background: var(--status-serious);
}
.ag-4 {
  background: var(--status-critical);
}
.ag-legend {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 12px;
  font-size: 13px;
}
.ag-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-foreground);
}
.ag-legend span i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.ag-legend b {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.ag-legend b.late {
  color: var(--red);
}

/* Mapa de calor setor × mês. */
.hmap {
  display: grid;
  grid-template-columns: minmax(110px, 1.4fr) repeat(var(--cols), minmax(30px, 1fr));
  gap: 3px;
  font-size: 12px;
}
.hmap-col {
  padding-bottom: 4px;
  text-align: center;
  color: var(--muted-foreground);
}
.hmap-row {
  overflow: hidden;
  align-self: center;
  padding-right: 6px;
  font-size: 12.5px;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
}
button.hmap-row {
  display: block;
  min-height: 0;
  padding: 0 6px 0 0;
  color: var(--foreground);
  text-align: left;
}
.hmap-cell {
  display: grid;
  place-items: center;
  min-height: 28px;
  border-radius: 5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.hmap-cell.zero {
  background: var(--muted);
}
.hmap-cell.dark {
  color: #fff;
}

/* Ranking em barras com a cor da faixa. */
.rank {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rank-row {
  display: grid;
  grid-template-columns: minmax(110px, 34%) minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
  border-radius: 8px;
}
.rank-row:hover,
.rank-row:focus-visible {
  background: var(--muted);
  outline: none;
}
.rank-label {
  overflow: hidden;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
}
button.rank-label {
  display: block;
  min-height: 0;
  padding: 0;
  color: var(--foreground);
  text-align: left;
}
.rank-track {
  display: block;
  height: 12px;
  border-radius: 99px;
  background: var(--muted);
  overflow: hidden;
}
.rank-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}
.rank-value {
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.b-good {
  background: var(--status-good);
}
.b-warning {
  background: var(--status-warning);
}
.b-serious {
  background: var(--status-serious);
}
.b-critical {
  background: var(--status-critical);
}

/* Anéis de feito ÷ planejado. */
.rings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  text-align: center;
}
.ring-item {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: 10px;
}
.ring-item:hover,
.ring-item:focus-visible {
  background: var(--muted);
  outline: none;
}
.ring-item svg {
  width: min(100%, 104px);
  height: auto;
}
.ring-item circle {
  fill: none;
  stroke-width: 9;
}
.ring-item .ring-bg {
  stroke: var(--muted);
}
.ring-item .ring-val {
  stroke-linecap: round;
  background: none;
}
.ring-item .ring-val.b-good {
  stroke: var(--status-good);
}
.ring-item .ring-val.b-warning {
  stroke: var(--status-warning);
}
.ring-item .ring-val.b-serious {
  stroke: var(--status-serious);
}
.ring-item .ring-val.b-critical {
  stroke: var(--status-critical);
}
.ring-item text {
  fill: var(--foreground);
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
}
.ring-item b {
  font-size: 13px;
}
.ring-item small {
  font-size: 12px;
  color: var(--muted-foreground);
}

/* Colunas empilhadas pelo resultado da melhoria. */
.chart .st-good {
  fill: var(--status-good);
}
.chart .st-warning {
  fill: var(--status-warning);
}
.chart .st-critical {
  fill: var(--status-critical);
}
.k.st-good {
  background: var(--status-good);
}
.k.st-warning {
  background: var(--status-warning);
}
.k.st-critical {
  background: var(--status-critical);
}

/* A3 em andamento: avanço e a marca de quanto do prazo já passou. */
.a3p {
  display: grid;
  gap: 6px;
}
.a3p-row {
  display: grid;
  justify-content: stretch;
  justify-items: stretch;
  gap: 5px;
  width: 100%;
  min-height: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-weight: 400;
  text-align: left;
}
.a3p-row:hover {
  background: var(--muted);
}
.a3p-title {
  overflow: hidden;
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.a3p-track {
  position: relative;
  display: block;
  height: 8px;
  border-radius: 99px;
  background: var(--muted);
}
.a3p-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}
.a3p-track em {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 16px;
  border-radius: 2px;
  background: var(--foreground);
  transform: translateX(-1px);
}
.a3p-row small {
  font-size: 12px;
  color: var(--muted-foreground);
}
.a3p-row small.late {
  color: var(--red);
}
@media (max-width: 760px) {
  .dash-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-sec > header p {
    margin-left: 0;
  }
  .rank-row {
    grid-template-columns: minmax(90px, 38%) minmax(0, 1fr) 42px;
  }
}
/* No Dashboard a lista das mais antigas mostra tudo, sem rolagem interna. */
.dash-sec .action-list {
  max-height: none;
  overflow: visible;
}
/* Nos indicadores do Dashboard a mini-linha encolhe para o número caber. */
.dash-kpis .kpi {
  min-width: 0;
}
.dash-kpis .kpi strong {
  font-size: 26px;
  white-space: nowrap;
}
.dash-kpis .spark {
  flex: 0 1 96px;
  min-width: 36px;
}

/* Período personalizado do Dashboard: De e Até ao lado dos botões. */
.dash-dates {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted-foreground);
}
.dash-dates .date-field,
.dash-dates input[type="date"] {
  width: 150px;
  min-width: 0;
}

/* ---------------------------------------------------------------- Relatórios */

select.rep-nav-mobile {
  display: none;
  margin-bottom: 14px;
}
.rep-day {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted-foreground);
}
.rep-day .date-field,
.rep-day input[type='date'] {
  width: 160px;
}
.rep-snapshot {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-foreground);
}
.rep-tabs {
  margin: -6px 0 14px;
}
.rep-print-head {
  display: none;
}

/* Resumo: números à esquerda, gráfico pequeno à direita. */
.rep-summary {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
  margin-bottom: 16px;
}
.rep-summary.solo {
  grid-template-columns: minmax(0, 1fr);
}
.rep-summary .panel {
  margin-bottom: 0;
}
.rep-kpis .pg-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}
.rep-summary.solo .rep-kpis .pg-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.rep-kpis .pg-kpi span {
  white-space: normal;
}
.rep-chart .chart-table {
  display: none;
}
.rep-chart .panel {
  height: 100%;
}

/* Tabelas: título, números à direita, cabeçalho que ordena e linha de total. */
.rep-table {
  margin-bottom: 18px;
  padding: 14px 16px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.rep-table > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.rep-table > header h3 {
  margin: 0;
  font-size: 15px;
}
.rep-table > header p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted-foreground);
}
.rep-table .table-wrap {
  max-height: 560px;
  overflow: auto;
}
.rep-table table {
  font-variant-numeric: tabular-nums;
}
.rep-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card);
}
.rep-table th.num,
.rep-table td.num {
  text-align: right;
}
.rep-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
}
.rep-sort .icon {
  width: 13px;
  height: 13px;
  opacity: 0.45;
}
th[aria-sort='ascending'] .rep-sort,
th[aria-sort='descending'] .rep-sort {
  color: var(--foreground);
}
th[aria-sort='ascending'] .rep-sort .icon,
th[aria-sort='descending'] .rep-sort .icon {
  opacity: 1;
  color: var(--accent);
}
.rep-table tfoot td {
  border-top: 2px solid var(--border);
  font-weight: 700;
}
.rep-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.rep-bad {
  color: var(--red);
  font-weight: 600;
}
.rep-empty {
  padding: 18px 8px !important;
  text-align: center;
  color: var(--muted-foreground);
}
.report-output .daily-report-bu .pg-kpis {
  margin: 4px 0 14px;
}
.report-output .daily-report-bu .rep-table {
  padding: 10px 12px 4px;
}

/* Barras empilhadas por linha (ex.: atrasados e no prazo por BU). */
.rank-track.stack {
  background: transparent;
}
.rank-track.stack > span {
  display: flex;
  gap: 2px;
  height: 100%;
}
.rank-track.stack i {
  display: block;
  height: 100%;
  border-radius: 3px;
}
.b-blue,
.k.b-blue {
  background: var(--series-1);
}
.k.b-critical {
  background: var(--status-critical);
}

@media (max-width: 760px) {
  select.rep-nav-mobile {
    display: flex;
    width: 100%;
  }
}
@media (max-width: 760px) {
  .rep-summary.solo .rep-kpis .pg-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rep-kpis .pg-kpis {
    display: grid;
  }
}

/* ---------------------------------------------------------------- Cabeçalho de Dashboard e Relatórios */

/* Linha 1: título e ações. Linha 2: faixa com o período à esquerda e os filtros à direita. */
.ind-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin: 2px 0 14px;
}
.ind-actions {
  display: flex;
  gap: 8px;
}
.ind-toolbar {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.ind-toolbar .dash-range {
  flex-shrink: 0;
}
.ind-toolbar .dash-dates {
  flex-wrap: nowrap;
}
.ind-filters {
  display: flex;
  min-width: 0;
  margin-left: auto;
}
.ind-filters .filter-bar {
  flex-wrap: nowrap;
  margin: 0;
}
.ind-filters .filter-chips {
  flex: 0 1 auto;
}
.ind-filters .filter-search {
  width: 230px;
  min-width: 160px;
}
@media (max-width: 760px) {
  .ind-filters {
    width: 100%;
    margin-left: 0;
  }
  .ind-filters .filter-bar {
    flex-wrap: wrap;
    width: 100%;
  }
  .ind-filters .filter-search {
    width: 100%;
  }
  .ind-toolbar .dash-range {
    width: 100%;
  }
  .ind-toolbar .dash-range .dash-chip {
    flex: 1;
  }
  .ind-toolbar .dash-dates {
    width: 100%;
  }
  .ind-toolbar .dash-dates .date-field,
  .ind-toolbar .dash-dates input[type='date'] {
    flex: 1;
    width: auto;
  }
}

/* Resumo dos relatórios: duas colunas só quando a área do relatório tem espaço. */
.rep-summary,
.rep-summary.solo {
  grid-template-columns: minmax(0, 1fr);
}
@container (min-width: 820px) {
  .rep-summary {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  }
}
@container (max-width: 560px) {
  .rep-summary.solo .rep-kpis .pg-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Rosca em cartões estreitos: o gráfico em cima e a legenda inteira embaixo. */
.chart-card {
  container-type: inline-size;
}
@container (max-width: 520px) {
  .donut-wrap {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }
  .donut-chart svg {
    width: min(100%, 180px);
  }
  .donut-legend {
    width: 100%;
  }
}

/* Tabelas: rolam para o lado em vez de espremer; códigos e datas não quebram. */
.rep-table table {
  min-width: 640px;
}
.rep-table td:first-child,
.rep-table td.num {
  white-space: nowrap;
}

/* ---------------------------------------------------------------- Cadastros */

.reg-search {
  width: 240px;
}
.reg-bu[hidden],
.reg-row[hidden],
.reg-cat[hidden],
.reg-event[hidden] {
  display: none !important;
}

/* BUs em cartões. */
.reg-bus {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.reg-bu {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.reg-bu.muted {
  background: var(--surface);
}
.reg-bu > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.reg-bu > header > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.reg-bu > header b {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 15px;
}
.reg-bu > header span {
  font-size: 13.5px;
}
.reg-bu > header small {
  font-size: 12px;
  color: var(--muted-foreground);
}
.reg-bu .actions {
  flex-shrink: 0;
}
.reg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.reg-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--muted);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  white-space: nowrap;
}
.reg-pill.good {
  background: var(--success-soft);
  color: var(--success-soft-fg);
}
.reg-pill.accent {
  background: var(--accent-soft);
  color: var(--accent-soft-fg);
}
.reg-pill.warn {
  background: var(--amber-soft);
  color: var(--amber-soft-fg);
}
.reg-warn {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: var(--amber-soft-fg);
  font-size: 12.5px;
}
.reg-warn .icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.reg-label {
  margin: 0;
  font-size: 12px;
  color: var(--muted-foreground);
}
.reg-tags,
.reg-tags details {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.reg-tags span {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--muted);
  font-size: 12px;
}
.reg-tags details {
  display: contents;
}
.reg-tags summary {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-soft-fg);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.reg-tags summary::-webkit-details-marker {
  display: none;
}
.reg-tags details[open] summary {
  display: none;
}
.reg-desc {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted-foreground);
}

/* Listas (usuários, participantes, rotas). */
.reg-list {
  display: grid;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}
.reg-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.reg-row:first-child {
  border-top: 0;
}
.reg-main {
  display: grid;
  gap: 1px;
  flex: 1 1 180px;
  min-width: 0;
}
.reg-main b {
  font-size: 14px;
}
.reg-main small {
  font-size: 12.5px;
  color: var(--muted-foreground);
}
.reg-meta {
  font-size: 12.5px;
  color: var(--muted-foreground);
  white-space: nowrap;
}
.reg-row .actions {
  margin-left: auto;
}
.reg-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Categorias com quantas melhorias usam cada uma. */
.reg-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.reg-cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.reg-cat b {
  font-size: 13.5px;
}
.reg-cat small {
  font-size: 12px;
  color: var(--muted-foreground);
}
.reg-cat .category-remove {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-height: 0;
  padding: 0;
  border-radius: 6px;
}
.reg-cat .category-remove .icon {
  width: 13px;
  height: 13px;
}

/* Histórico em frases. */
.reg-hist-filter {
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.reg-events {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.reg-event {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.reg-event:first-child {
  border-top: 0;
}
.reg-event-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--muted);
  color: var(--muted-foreground);
}
.reg-event-icon.new {
  background: var(--success-soft);
  color: var(--success-soft-fg);
}
.reg-event-icon.del {
  background: var(--danger-soft);
  color: var(--danger-soft-fg);
}
.reg-event-icon .icon {
  width: 15px;
  height: 15px;
}
.reg-event p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
}
.reg-change {
  color: var(--muted-foreground);
}
.reg-event small {
  font-size: 12px;
  color: var(--faint);
}
.reg-event details {
  margin-top: 2px;
  font-size: 12px;
}
.reg-event summary {
  width: max-content;
  color: var(--muted-foreground);
  cursor: pointer;
}
.reg-event pre {
  max-height: 260px;
  overflow: auto;
  font-size: 11.5px;
}
.reg-more {
  margin-top: 10px;
}

/* Formulário da BU: setores em etiquetas. */
.chip-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 6px 8px;
  border: 1px solid var(--input);
  border-radius: 10px;
  background: var(--card);
  cursor: text;
}
.chip-input:focus-within {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px var(--ring-soft);
}
.chip-input input {
  flex: 1 1 180px;
  min-width: 120px;
  min-height: 28px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.chip-input input:focus {
  outline: none;
  box-shadow: none;
}
.chip-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 10px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-soft-fg);
  font-size: 13px;
  font-weight: 600;
}
.chip-tag button {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
}
.chip-tag button:hover {
  background: color-mix(in srgb, currentColor 15%, transparent);
}
.chip-tag .icon {
  width: 13px;
  height: 13px;
}
.chip-hint {
  min-height: 0;
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--amber-soft-fg);
}
.chip-hint:empty {
  display: none;
}
@media (max-width: 760px) {
  .reg-search {
    width: 100%;
  }
  .ind-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .reg-row .actions {
    margin-left: 0;
  }
}

/* Usuários em colunas fixas: perfil, módulos e situação alinhados entre as linhas. */
@media (min-width: 761px) {
  .reg-list.users .reg-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 150px 140px 200px auto;
  }
  .reg-list.users .reg-row .actions {
    margin-left: 0;
  }
}
.reg-state {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------------------------------------------------------------- Segunda barra (Relatórios e Cadastros) */

/* Mesma estrutura das Configurações: a barra do topo some no computador e a segunda barra
   lateral vai do topo ao fim da tela, fixa ao rolar. */
@media (min-width: 761px) {
  body[data-page='reports'] .topbar,
  body[data-page='registry'] .topbar {
    display: none;
  }
}
body[data-page='reports'] .workspace,
body[data-page='registry'] .workspace {
  padding: 0;
}
.settings-nav .nav-group {
  margin: 14px 12px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
}
.settings-nav .nav-group:first-child {
  margin-top: 4px;
}
.settings-head.split {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
}
.settings-body.wide {
  max-width: none;
  padding: 22px 28px 48px;
  container-type: inline-size;
}
@media (max-width: 760px) {
  .settings-body.wide {
    padding: 16px 16px 32px;
  }
  .settings-nav .nav-group {
    display: none;
  }
  /* Nos Relatórios (11 itens) o celular usa o seletor no topo, não a grade de botões. */
  body[data-page='reports'] .sub-nav {
    display: none;
  }
}

/* ---------------------------------------------------------------- Configurações únicas */

/* Seções do Gemba TWI na barra: links com o mesmo desenho dos botões e o ícone de saída. */
.settings-nav nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0 0 2px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--muted-foreground);
  text-decoration: none;
}
.settings-nav nav a:hover {
  background: var(--sidebar-hover);
}
.settings-nav nav a span {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.settings-nav .cfg-ext {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--faint);
}
.settings-card .cfg-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--foreground);
  font-weight: 500;
  text-decoration: none;
}
.settings-card .cfg-open:hover {
  background: var(--muted);
}
.cfg-open .cfg-ext {
  width: 14px;
  height: 14px;
}

/* Usuários e perfis: o que cada perfil pode fazer no Daily e no TWI. */
.profiles-table {
  display: grid;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}
.pt-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.pt-row:first-child {
  border-top: 0;
}
.pt-head {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  background: var(--surface);
}
@media (max-width: 760px) {
  .settings-nav nav a {
    margin: 0;
    padding: 9px 10px;
    gap: 8px;
  }
  .settings-nav nav a small {
    display: none;
  }
  .pt-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .pt-head {
    display: none;
  }
}

/* Cartão da BU: linhas e equipamentos de cada setor (dados do Gemba TWI, editados aqui). */
.reg-lines {
  display: grid;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}
.reg-lines-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.reg-lines-head > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
}
.reg-lines-head .link-btn {
  min-height: 0;
  padding: 2px 4px;
  font-size: 12.5px;
}
.reg-lines ul {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.reg-lines li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  color: var(--muted-foreground);
}
.reg-lines li b {
  color: var(--foreground);
  font-weight: 500;
}
.reg-lines p {
  margin: 0;
  font-size: 12px;
  color: var(--faint);
}
.reg-lines li em {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--amber-soft);
  color: var(--amber-soft-fg);
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
}
.reg-line-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.reg-line-actions .link-btn {
  min-height: 0;
  padding: 2px 6px;
  font-size: 12px;
}
.reg-line-actions .icon-btn {
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
}
.reg-line-actions .icon {
  width: 13px;
  height: 13px;
}
.ind-actions .cfg-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--foreground);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.ind-actions .cfg-open:hover {
  background: var(--muted);
}
.ind-actions .cfg-open .cfg-ext {
  width: 14px;
  height: 14px;
}
/* Tempos acumulados por estação do ANDON. */
.andon-bar { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(80px, 3fr) 100px; align-items: center; gap: 12px; margin: 12px 0; }
.andon-bar meter { width: 100%; height: 20px; }
.andon-bar meter::-webkit-meter-optimum-value { background: #d94b5b; }
.andon-bar meter::-moz-meter-bar { background: #d94b5b; }
.andon-dashboard { --andon-loss: #dc495c; --andon-wait: #dc9330; --andon-service: #149baa; --andon-total: #8876e8; }
.andon-heading { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin: 24px 0; }
.andon-heading h2 { font-size: clamp(24px, 2.5vw, 34px); letter-spacing: -.04em; margin: 6px 0 10px; }
.andon-eyebrow { color: var(--accent); letter-spacing: .14em; font-size: 11px; font-weight: 700; }
.andon-heading button { flex-shrink: 0; }
.andon-filters { display: flex; align-items: end; gap: 20px; flex-wrap: wrap; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.andon-periods { display: flex; gap: 5px; padding: 4px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; }
.andon-filters label { display: grid; gap: 6px; color: var(--muted-foreground); font-size: 12px; }
.andon-sync { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted-foreground); font-size: 12px; margin: 20px 0; }
.andon-sync>span:last-child { margin-left: auto; }
.andon-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); margin-right: 5px; }
.andon-sync.is-stale .andon-dot { background: var(--andon-wait); box-shadow: none; }
.andon-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.andon-metric { display: flex; flex-direction: column; gap: 12px; padding: 24px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); }
.andon-metric>span { font-size: 13px; color: var(--muted-foreground); }
.andon-metric strong { font-size: clamp(24px,2.5vw,36px); line-height: 1.1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.andon-metric small { color: var(--muted-foreground); font-size: 11px; line-height: 1.5; }
.andon-metric-loss { background: var(--danger-soft); border-color: color-mix(in srgb,var(--andon-loss) 25%,var(--border)); }
.andon-metric-loss strong { color: var(--danger-soft-fg); }
.andon-metric-live strong { color: var(--andon-wait); }
.andon-insight { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 15px 18px; border-radius: 8px; margin: 20px 0; color: var(--accent-soft-fg); font-size: 13px; }
.andon-chart-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin: 20px 0; }
.andon-chart { min-width: 0; margin: 0; padding: 24px; border-radius: 14px; }
.andon-chart h3 { margin: 0 0 8px; font-size: 16px; }
.andon-chart>.sub { line-height: 1.6; min-height: 36px; margin: 0 0 18px; }
.andon-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.andon-gridline { stroke: var(--border); stroke-width: 1; }
.andon-svg-bar { fill: var(--andon-loss); opacity: .85; }
.andon-svg-bar.is-current { fill: var(--andon-service); opacity: 1; }
.andon-svg-label { fill: var(--muted-foreground); font-size: 12px; font-family: var(--font-body); }
.andon-svg-value { fill: var(--foreground); font-size: 12px; font-family: var(--font-body); font-weight: 600; }
.andon-target { stroke: var(--faint); stroke-dasharray: 4 5; }
.andon-pareto-line { fill: none; stroke: var(--andon-service); stroke-width: 3; }
.andon-pareto-point { fill: var(--andon-service); stroke: var(--card); stroke-width: 2; }
.andon-sector-key { display: flex; flex-wrap: wrap; gap: 8px 28px; padding-left: 20px; font-size: 11px; color: var(--muted-foreground); }
.andon-sector-key li { padding-left: 2px; }
.andon-sector-key b { margin-left: 4px; color: var(--foreground); }
.andon-ranking { display: grid; gap: 14px; }
.andon-rank>div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; margin-bottom: 6px; }
.andon-rank small { display: inline-block; width: 22px; color: var(--faint); }
.andon-rank strong { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.andon-stack { height: 9px; display: flex; overflow: hidden; border-radius: 4px; background: var(--muted); }
.andon-stack span { height: 100%; display: block; }
.andon-wait { background: var(--andon-wait); }
.andon-service { background: var(--andon-service); }
.andon-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; color: var(--muted-foreground); font-size: 11px; }
.andon-legend .wait::before,.andon-legend .service::before,.andon-legend .loss::before,.andon-composition-label::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 7px; }
.andon-legend .wait::before,.andon-composition-label.wait::before { background: var(--andon-wait); }
.andon-legend .service::before,.andon-composition-label.service::before { background: var(--andon-service); }
.andon-legend .loss::before { background: var(--andon-loss); }
.andon-legend .total::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 7px; background: var(--andon-total); }
.andon-wide { grid-column: 1 / -1; }
.andon-heat-scroll,.andon-grouped-scroll { width: 100%; max-width: 100%; overflow-x: auto; padding: 6px 2px 12px; }
.andon-heatmap { display: grid; grid-template-columns: 80px repeat(31,minmax(22px,1fr)); gap: 5px; min-width: 920px; align-items: center; }
.andon-heat-day { font-size: 11px; color: var(--muted-foreground); text-align: center; padding-bottom: 6px; }
.andon-heat-month { font-size: 12px; color: var(--muted-foreground); }
.andon-heatmap .andon-heat-cell { display: flex; justify-content: center; align-items: center; width: 100%; height: 34px; min-height: 0; margin: 0; padding: 0; border: none; border-radius: 5px; font-size: 12px; line-height: 1; color: #143c43; cursor: pointer; box-shadow: none; }
.andon-heatmap .andon-heat-cell:hover,.andon-heatmap .andon-heat-cell:focus-visible { outline: 2px solid var(--foreground); outline-offset: 1px; }
.andon-heatmap .andon-heat-cell.is-selected { outline: 2px solid var(--accent); outline-offset: 1px; }
.andon-heatmap .andon-heat-cell.heat-0,.andon-heat-swatch.heat-0 { background: var(--muted); }
.andon-heat-cell.heat-1,.andon-heat-swatch.heat-1 { background: #d9f0ef; }
.andon-heat-cell.heat-2,.andon-heat-swatch.heat-2 { background: #aee0e1; }
.andon-heat-cell.heat-3,.andon-heat-swatch.heat-3 { background: #6cc8cf; }
.andon-heat-cell.heat-4,.andon-heat-swatch.heat-4 { background: #28a9b7; }
.andon-heatmap .andon-heat-cell.heat-5,.andon-heat-swatch.heat-5 { background: #087f8c; color: #fff; }
.andon-heat-unavailable { display: inline-block; height: 34px; border: 1px dashed var(--border); border-radius: 5px; background: repeating-linear-gradient(135deg,transparent,transparent 4px,var(--muted) 4px,var(--muted) 6px); }
.andon-heat-invalid { height: 34px; }
.andon-heat-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 15px; font-size: 11px; color: var(--muted-foreground); }
.andon-heat-swatch { display: inline-block; width: 17px; height: 17px; border-radius: 3px; }
.andon-heat-legend>.andon-heat-unavailable { width: 17px; height: 17px; margin-left: 10px; }
.andon-grouped-legend { margin: 0 0 18px; }
.andon-grouped-scroll .andon-svg-label,.andon-grouped-scroll .andon-svg-value { font-size: 14px; }
.andon-composition { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 20px; }
.andon-composition>div { display: grid; gap: 10px; }
.andon-composition strong { font-size: 25px; letter-spacing: -.04em; }
.andon-composition-label { font-size: 12px; color: var(--muted-foreground); }
.andon-donut-base,.andon-donut-wait { fill: none; stroke-width: 25; }
.andon-donut-base { stroke: var(--andon-service); }
.andon-donut-wait { stroke: var(--andon-wait); }
.andon-donut-number { fill: var(--foreground); font-family: var(--font-body); font-size: 33px; font-weight: 700; }
.andon-open { border-top: 3px solid var(--andon-loss); }
.andon-open .andon-dot { background: var(--andon-loss); box-shadow: none; }
.andon-duration { color: var(--red); font-weight: 700; font-variant-numeric: tabular-nums; }
.andon-method { line-height: 1.8; font-size: 11px; margin: 20px 0; }
.andon-source { margin-top: 20px; }
.andon-source>summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.andon-source[open]>summary { margin-bottom: 18px; }
@media (max-width: 1100px) { .andon-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); } .andon-chart-grid { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 600px) {
  .andon-heading { align-items: start; gap: 10px; } .andon-heading h2 { font-size: 25px; } .andon-heading button { width: auto; font-size: 12px; }
  .andon-filters { gap: 14px; } .andon-filters>label { flex: 1 1 140px; min-width: 0; } .andon-filters select { width: 100%; }
  .andon-periods { width: 100%; } .andon-periods button { flex: 1; }
  .andon-sync>span:last-child { margin-left: 0; width: 100%; }
  .andon-metrics { gap: 10px; } .andon-metric { padding: 16px 12px; gap: 10px; } .andon-metric strong { font-size: 25px; }
  .andon-chart { padding: 18px 14px; } .andon-composition { gap: 10px; } .andon-composition strong { font-size: 21px; }
  .andon-chart .andon-svg-label,.andon-chart .andon-svg-value { font-size: 22px; }
  .andon-composition { grid-template-columns: 1fr; }
  .andon-composition svg { max-width: 220px; margin: auto; }
  .andon-composition>div { grid-template-columns: minmax(0,1fr) auto; align-items: center; }
  .andon-composition>div p { grid-column: 1 / -1; }
}
@media (max-width: 600px) { .andon-bar { grid-template-columns: 1fr 1fr; } .andon-bar meter { grid-column: 1 / -1; grid-row: 2; } }

/* Análise da carteira A3 orientada às entregas. */
.a3-analysis { display: grid; gap: 18px; }
.a3-analysis h2 { margin-bottom: 8px; }
.a3-analysis .sub { margin: 8px 0 14px; }
.a3-analysis-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.a3-deadline-summary { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.a3-deadline-summary > div { display: flex; gap: 10px; align-items: baseline; border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px; }
.a3-deadline-summary strong { font-size: 24px; }
.a3-analysis .is-late { color: var(--red); }
.a3-analysis .is-warning { color: var(--amber-soft-fg); }
.a3-analysis .is-ok { color: var(--success, #35a998); }
.a3-analysis-table { max-height: 460px; overflow: auto; }
.a3-analysis-table th { position: sticky; top: 0; background: var(--card); z-index: 1; }
.a3-analysis-table td { vertical-align: top; min-width: 150px; }
.a3-analysis-table td:first-child { width: 29%; }
.a3-analysis-table td:last-child { width: 32%; }
.a3-analysis-table td small { display: block; margin-top: 6px; color: var(--muted-foreground); font-size: 12px; }
.a3-analysis-table .link-btn { text-align: left; white-space: normal; }
.a3-delivery-progress { display: flex; gap: 10px; align-items: center; }
.a3-delivery-progress meter { width: 105px; height: 12px; accent-color: var(--primary); }
.a3-delivery-progress meter::-webkit-meter-bar { background: var(--muted); border: 0; border-radius: 5px; }
.a3-delivery-progress meter::-webkit-meter-optimum-value { background: var(--primary); border-radius: 5px; }
.a3-deadline-tag { font-weight: 600; white-space: nowrap; }
.a3-sector-list { max-height: 330px; overflow: auto; }
.a3-sector-item { border-bottom: 1px solid var(--border); }
.a3-sector-item summary { cursor: pointer; padding: 12px 4px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.a3-sector-item summary b { font-size: 12px; text-align: right; }
.a3-sector-item summary span::before { content: '▸ '; color: var(--muted-foreground); }
.a3-sector-item[open] summary span::before { content: '▾ '; }
.a3-sector-item > div { display: grid; gap: 6px; padding: 0 4px 12px; }
.a3-sector-item .link-btn { white-space: normal; text-align: left; }
.a3-deliveries { min-width: 120px; font-size: 12px; }
@media(max-width: 850px) { .a3-analysis-bottom { grid-template-columns: 1fr; } .a3-deadline-summary { gap: 8px; } .a3-deadline-summary > div { padding: 8px 10px; } }
/* Informações dos indicadores: piloto no módulo Melhorias. */
.mv-gains { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mv-indicator-label { display: inline-flex; align-items: center; gap: 5px; }
.mv-info { display: inline-block; position: relative; }
.mv-info > button { display: inline-flex; align-items: center; justify-content: center; padding: 0; width: 18px; height: 18px; min-height: 0; border: 1px solid var(--muted-foreground); border-radius: 50%; color: var(--muted-foreground); background: transparent; font-size: 12px; font-weight: 600; cursor: help; }
.mv-info > button:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
.mv-info-content { display: none; position: absolute; left: -20px; top: 100%; padding: 12px; width: min(280px, 70vw); background: var(--foreground); color: var(--background); border-radius: 8px; box-shadow: var(--shadow-md); z-index: 50; font-size: 12px; font-weight: 400; line-height: 1.6; white-space: normal; text-align: left; }
.mv-info:hover .mv-info-content, .mv-info:focus-within .mv-info-content { display: block; }
@media(max-width: 700px) { .mv-gains { grid-template-columns: 1fr; } .mv-info-content { left: auto; right: -30px; width: min(260px, 70vw); } }
@media(max-width: 700px) { .mv-info-content { position: fixed; top: auto; bottom: 20px; left: 16px; right: 16px; width: auto; } }

/* Cadastro simples de uma melhoria já implementada. */
.improvement-simple-form { display: grid; gap: 24px; }
.improvement-form-intro { margin: 0; line-height: 1.6; }
.improvement-form-section h3 { margin: 0 0 16px; font-size: 15px; }
.improvement-simple-form textarea { min-height: 70px; }
.improvement-simple-form .form-grid { gap: 16px; }
.improvement-simple-form .field { margin: 0; }
.improvement-simple-form input[type="checkbox"] { accent-color: var(--primary); }
.improvement-gain-choices { border: 0; padding: 0; min-width: 0; }
.improvement-gain-choices legend { margin-bottom: 12px; font-weight: 600; font-size: 13px; }
.improvement-gain-choices legend .sub { display: block; margin-top: 4px; font-weight: 400; }
.improvement-gain-choices .check-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.improvement-extra { border: 1px solid var(--border); border-radius: 10px; padding: 0 16px; }
.improvement-extra summary { cursor: pointer; padding: 16px 0; font-weight: 600; font-size: 14px; }
.improvement-extra summary > span { float: right; color: var(--muted-foreground); font-size: 12px; font-weight: 400; }
.improvement-extra > .form-grid { padding: 4px 0 16px; }
.improvement-extra > p { margin-top: 0; }
.improvement-extra .image-html { grid-column: 1 / -1; }
@media(max-width: 600px) { .improvement-gain-choices .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .improvement-extra { padding: 0 12px; } }
.improvement-gain-choices .check-grid { display: grid; }
.improvement-gain-choices .check-grid label { padding: 8px 0; align-items: flex-start; }
.improvement-gain-choices .check-grid label input { margin-top: 3px; }

/* Tempo disponível e dinheiro efetivo são indicadores independentes. */
.mv-gains.mv-gains-separated { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mv-legacy-return { margin: -8px 0 22px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; line-height: 1.6; }
.improvement-capacity-preview { padding: 14px; border: 1px solid var(--border); border-radius: 8px; gap: 8px; }
.improvement-capacity-preview strong { font-size: 17px; color: var(--primary); }
.improvement-capacity-preview small { color: var(--muted-foreground); line-height: 1.6; }
@media(max-width: 700px) { .mv-gains.mv-gains-separated { grid-template-columns: 1fr; } }
