/* CSS de todo o site logado: login, dashboard (as 4 abas) e o gráfico SVG da Visão. */
:root {
  --bg: #0a0c10;
  --bg-alt: #12151c;
  --bg-elevated: #171b24;
  --text: #eef0f4;
  --muted: #8b93a3;
  --muted-2: #5f6675;
  --accent: #6ea8fe;
  --accent-strong: #8fbcff;
  --accent-dim: rgba(110, 168, 254, 0.12);
  --accent-ink: #06090d;
  --border: #232833;
  --border-soft: #1a1e27;
  --success: hsl(140, 60%, 55%);
  --danger: hsl(0, 70%, 62%);
  --radius-sm: 5px;
  --radius-md: 7px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.3);
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

::selection {
  background: var(--accent-dim);
  color: var(--text);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.muted { color: var(--muted); }

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 1.25rem;
}

h3 { letter-spacing: -0.005em; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 480px;
  margin-top: 1.5rem;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.contact-form input,
.contact-form textarea {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.contact-form button {
  align-self: flex-start;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.contact-form button:hover { background: var(--accent-strong); }
.contact-form button:active { transform: translateY(1px); }

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.login-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.login-icon {
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.login-card h1 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  text-align: center;
}

.login-card .contact-form {
  margin-top: 1rem;
  max-width: none;
}

.login-card button {
  width: 100%;
}

#login-feedback:not(:empty) {
  color: var(--danger);
  font-size: 0.85rem;
  margin: 0;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

.sidebar {
  width: 196px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: flex-start;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 1.25rem 1.1rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-soft);
}

.sidebar-brand img { display: block; flex-shrink: 0; }

.sidebar-brand span {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0.75rem;
}

.sidebar-logout {
  margin: 0 0.75rem 0.75rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.sidebar-logout:hover { color: var(--text); }

.sidebar-footer {
  margin: auto 0.75rem 0.35rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
  color: var(--muted-2);
  font-size: 0.72rem;
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: 2rem 2rem 3rem;
}

/* Bleed até a borda do main-content (cancela o padding do pai) pra virar uma
   barra de verdade encostada no topo, sempre visível — altura fixa (44px),
   o "top" do .tab-sticky logo abaixo depende desse valor bater certo. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
  margin: -2rem -2rem 1.25rem;
  padding: 0 2rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.user-badge-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tab-sticky {
  position: sticky;
  top: 44px;
  z-index: 15;
  background: var(--bg);
  padding-top: 0.5rem;
}

@media (max-width: 760px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0.75rem;
    overflow-x: auto;
  }
  .sidebar-brand { padding: 0 0.75rem 0 0; }
  .sidebar-nav { flex-direction: row; }
  .sidebar-logout { margin: 0 0 0 auto; padding-top: 0; border-top: none; white-space: nowrap; }
  .sidebar-footer { display: none; } /* cabe mal na barra horizontal do mobile; a data segue disponível na própria aba IA */
  .main-content { padding: 1.25rem 1rem 2rem; }
  /* Sidebar já vira barra sticky no topo (linha acima) — empilhar mais 2
     barras sticky (topbar + tab-sticky) por cima ficaria confuso em tela
     estreita, então essas 2 voltam a rolar normal no mobile. */
  .topbar, .tab-sticky { position: static; margin: 0; }
  .topbar { justify-content: flex-start; height: auto; padding: 0.5rem 0; }
}

.chart-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem 0.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.chart-card h3 {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--text);
}

.chart-wrap {
  position: relative;
  width: 100%;
}

.bar-mark {
  transition: filter 0.15s;
  cursor: pointer;
}

.bar-mark:hover, .bar-mark:focus {
  filter: brightness(1.18);
  outline: none;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  font-size: 0.8rem;
  white-space: nowrap;
  text-align: left;
  line-height: 1.5;
  transform: translate(-50%, -100%);
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 10;
  box-shadow: var(--shadow-md);
}

.chart-tooltip.visible {
  opacity: 1;
}

.chart-tooltip .tt-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.chart-tooltip .tt-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
}

.chart-tooltip .tt-row strong {
  color: var(--text);
  font-weight: 700;
}

.chart-tooltip .tt-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s;
}

.chart-legend-item:hover {
  color: var(--text);
}

.chart-legend-item.hidden {
  opacity: 0.4;
  text-decoration: line-through;
}

.chart-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.chart-legend-line {
  width: 14px;
  height: 2px;
  display: inline-block;
  background-image: linear-gradient(to right, currentColor 60%, transparent 0%);
  background-size: 5px 2px;
}

.line-mark {
  cursor: pointer;
  transition: filter 0.15s;
}

.line-mark:hover, .line-mark:focus {
  filter: brightness(1.25);
  outline: none;
}

.delta-mark {
  cursor: pointer;
}

#v-compare-table th {
  background: var(--bg-elevated);
  text-align: right;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 600;
}

#v-compare-table td {
  text-align: right;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  font-variant-numeric: tabular-nums;
}

#v-compare-table th:first-child, #v-compare-table td:first-child {
  text-align: left;
}

.diff-negative {
  color: var(--danger);
  font-weight: 600;
}

.diff-positive {
  color: var(--success);
  font-weight: 600;
}

.heatmap-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.heatmap-block h4 {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: center;
}

@media (max-width: 900px) {
  .heatmap-split { grid-template-columns: 1fr; }
}

.heatmap-table th, .heatmap-table td {
  text-align: center;
  padding: 0.55rem 0.7rem;
  font-variant-numeric: tabular-nums;
}

.heatmap-table th:first-child, .heatmap-table td:first-child {
  text-align: left;
  font-weight: 600;
}

.heatmap-table td:not(:first-child) {
  color: #f2f4f8;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-align: left;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.tab-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.tab-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }

.tab-btn.active {
  color: var(--text);
  background: var(--bg-elevated);
  border-left-color: var(--accent);
  font-weight: 600;
}

@media (max-width: 760px) {
  .tab-btn {
    width: auto;
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
    border-radius: var(--radius-sm);
  }
  .tab-btn.active { border-left-color: transparent; border-bottom-color: var(--accent); }
}

.checkbox-label {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  padding: 0.1rem 0;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* Sem "width" fixo no elemento table: com table-layout:fixed e toda coluna já
   com largura própria (nth-child abaixo), o total vira a soma das colunas —
   se o filtro "Mês de/até" encolher quantas colunas aparecem, a tabela
   encolhe/rola sozinha, sem sobrar espaço vazio nem esticar coluna nenhuma. */
.mensal-table {
  table-layout: fixed;
}

/* Alocação tem só 3 colunas de cabeçalho (Proposta/Cliente/Squad) contra as 4
   da Divisão Mensal (Nome/Cliente/Proposta/Status) — não dá pra reaproveitar
   os nth-child genéricos do .mensal-table sem embaralhar as colunas de mês. */
#alocacao-dev-table th:nth-child(1), #alocacao-dev-table td:nth-child(1),
#alocacao-consultor-table th:nth-child(1), #alocacao-consultor-table td:nth-child(1) {
  text-align: left;
  width: 110px;
}
#alocacao-dev-table th:nth-child(2), #alocacao-dev-table td:nth-child(2),
#alocacao-consultor-table th:nth-child(2), #alocacao-consultor-table td:nth-child(2) {
  text-align: left;
  width: 220px;
  white-space: normal;
}
#alocacao-dev-table th:nth-child(3), #alocacao-dev-table td:nth-child(3),
#alocacao-consultor-table th:nth-child(3), #alocacao-consultor-table td:nth-child(3) {
  text-align: left;
  width: 100px;
}
#alocacao-dev-table th:nth-child(n+4), #alocacao-dev-table td:nth-child(n+4),
#alocacao-consultor-table th:nth-child(n+4), #alocacao-consultor-table td:nth-child(n+4) {
  text-align: right;
  width: 85px;
  font-variant-numeric: tabular-nums;
}
#alocacao-dev-table th:last-child, #alocacao-dev-table td:last-child,
#alocacao-consultor-table th:last-child, #alocacao-consultor-table td:last-child {
  width: 120px;
  font-weight: 600;
}

.mensal-subtotal-row td {
  font-weight: 700;
  background: var(--bg-elevated);
  border-bottom: 2px solid var(--border);
}

.mensal-table th, .mensal-table td {
  text-align: right;
  width: 85px;
  font-variant-numeric: tabular-nums;
}

.mensal-table thead th:nth-child(1), .mensal-table tbody td:nth-child(1) {
  text-align: left;
  width: 190px;
  white-space: normal;
}

.mensal-table thead th:nth-child(2), .mensal-table tbody td:nth-child(2) {
  text-align: left;
  width: 140px;
  white-space: normal;
}

.mensal-table thead th:nth-child(3), .mensal-table tbody td:nth-child(3) {
  text-align: left;
  width: 130px;
  font-variant-numeric: tabular-nums;
}

.mensal-table thead th:nth-child(4), .mensal-table tbody td:nth-child(4) {
  text-align: left;
  width: 110px;
  white-space: normal;
}

.mensal-table th:last-child, .mensal-table td:last-child {
  width: 120px;
  font-weight: 600;
}

.mensal-table .mensal-foot-label {
  text-align: left;
}

.mensal-table td.zero {
  color: var(--muted-2);
}

.month-cell {
  cursor: pointer;
  transition: background 0.12s;
  border-radius: 4px;
}

.month-cell:hover {
  background: var(--accent-dim);
}

.month-cell.overridden {
  color: var(--accent);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--accent);
  border-radius: 4px;
}

.month-cell-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--text);
  font: inherit;
  text-align: right;
  padding: 0.2rem 0.3rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.25rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.filters input,
.filters select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  color: var(--text);
  font: inherit;
  min-width: 160px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.filters input:focus,
.filters select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.filters button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.55rem 1rem;
  cursor: pointer;
  font: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.filters button:hover {
  background: var(--bg-elevated);
  border-color: var(--muted-2);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

table {
  border-collapse: collapse;
  font-size: 0.9rem;
  width: 100%;
}

th, td {
  text-align: left;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Célula de mês do resumo de reforço pode ficar com texto longo ("falta 45h
   — contratar 2" ou "sobra 12h (viraria 166h c/ reforço)") — deixa quebrar
   linha em vez de truncar ou estourar a largura da tabela. */
#v-hiring-table td {
  white-space: normal;
  min-width: 130px;
}

#v-deviation-table td {
  white-space: normal;
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

/* table-layout:fixed + largura explícita (não min-width) por coluna: o total
   passa da largura do container de propósito, pra .table-wrap rolar de verdade. */
#deals-table {
  table-layout: fixed;
  width: 1680px;
}
#deals-table th:nth-child(1), #deals-table td:nth-child(1) { width: 36px; }
#deals-table th:nth-child(2), #deals-table td:nth-child(2) { width: 330px; white-space: normal; }
#deals-table th:nth-child(3), #deals-table td:nth-child(3) {
  width: 130px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  font-variant-numeric: tabular-nums;
}
#deals-table th:nth-child(4), #deals-table td:nth-child(4) { width: 220px; white-space: normal; }
#deals-table th:nth-child(5), #deals-table td:nth-child(5) { width: 150px; }
#deals-table th:nth-child(6), #deals-table td:nth-child(6) { width: 170px; }
#deals-table th:nth-child(7), #deals-table td:nth-child(7) { width: 150px; }
#deals-table th:nth-child(8), #deals-table td:nth-child(8) { width: 90px; }
#deals-table th:nth-child(9), #deals-table td:nth-child(9),
#deals-table th:nth-child(10), #deals-table td:nth-child(10),
#deals-table th:nth-child(11), #deals-table td:nth-child(11) { width: 130px; }

thead th {
  background: var(--bg-elevated);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 600;
}

.deal-row {
  cursor: pointer;
  transition: background 0.12s;
}

.deal-row:hover {
  background: var(--accent-dim);
}

.expand-toggle {
  color: var(--accent);
  width: 1.5rem;
}

.col-name {
  min-width: 260px;
  white-space: normal;
}

.col-amount {
  min-width: 140px;
  font-variant-numeric: tabular-nums;
}

.stage-pill {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  color: #0b0d11;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.mensal-table .stage-pill {
  white-space: normal;
  text-align: center;
}

.status-pill {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: filter 0.15s;
}

.status-pill:hover { filter: brightness(1.15); }

.status-pill.ativo {
  background: hsl(140, 55%, 16%);
  color: hsl(140, 65%, 72%);
  box-shadow: inset 0 0 0 1px hsl(140, 55%, 28%);
}

.status-pill.inativo {
  background: hsl(0, 0%, 20%);
  color: hsl(0, 0%, 65%);
  box-shadow: inset 0 0 0 1px hsl(0, 0%, 30%);
}

.team-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.team-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.team-form-grid input, .team-form-grid select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.team-form-grid input:focus, .team-form-grid select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.hours-edit-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.hours-edit-actions button {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
  transition: background 0.15s;
}

.hours-edit-actions button:hover { background: var(--accent-strong); }

#t-form-cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

#t-form-cancel:hover { background: var(--bg-elevated); }

.danger-btn {
  background: transparent;
  border: 1px solid hsl(0, 55%, 40%);
  color: hsl(0, 70%, 68%);
  border-radius: var(--radius-sm);
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  font: inherit;
  transition: background 0.15s;
}

.danger-btn:hover { background: hsl(0, 55%, 16%); }

.person-name-cell {
  cursor: pointer;
  color: var(--text);
}

.person-name-cell:hover {
  color: var(--accent);
  text-decoration: underline;
}

.detail-row td {
  background: var(--bg-elevated);
  white-space: normal;
}

.detail-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-areas:
    "horas items"
    "parcelas parcelas";
  gap: 1.25rem;
  padding: 1rem 0.5rem;
}

.detail-horas { grid-area: horas; }
.detail-items { grid-area: items; }
.detail-parcelas { grid-area: parcelas; }

.deviation-detail-grid {
  grid-template-columns: 1fr 1fr;
  grid-template-areas: none;
  /* Por padrão o grid estica os 2 painéis pra bater a altura do mais alto
     (barras, 320px) — o de linha é bem mais baixo (160px) e ficava boiando
     num painel muito maior que o próprio conteúdo. */
  align-items: start;
}

@media (max-width: 800px) {
  .deviation-detail-grid { grid-template-columns: 1fr; }
}

.detail-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  /* min-width:0 pra sobrescrever o default de item de grid (min-width:auto,
     baseado no conteúdo) — sem isso, um painel com SVG que ainda não tinha
     conteúdo no momento da medição de largura podia ficar espremido. */
  min-width: 0;
}

.detail-panel h4 {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-panel p {
  margin: 0.2rem 0;
  font-size: 0.85rem;
}

.mini-table {
  width: 100%;
  font-size: 0.8rem;
}

.mini-table th, .mini-table td {
  padding: 0.35rem 0.5rem;
  white-space: normal;
}

@media (max-width: 800px) {
  .detail-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "horas"
      "items"
      "parcelas";
  }
}

.ia-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 3rem 1.5rem;
  color: var(--muted);
  text-align: center;
}

.ia-report-meta {
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.ia-stale-banner {
  background: rgba(240, 90, 90, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.ia-report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.ia-report-grid .chart-card { margin-bottom: 0; }

#ia-content .chart-card ul {
  margin: 0;
  padding-left: 1.1rem;
}

#ia-content .chart-card li {
  margin-bottom: 0.4rem;
  line-height: 1.45;
}

#ia-content .chart-card p {
  line-height: 1.5;
  color: var(--text);
}

@media (max-width: 900px) {
  .ia-report-grid { grid-template-columns: 1fr; }
}
