/* Telas de módulo e fichas — mesmo sistema visual do Dashboard v2.
   Carregado depois de enterprise.css e dashboard.css. Só apresentação:
   nenhum markup, classe ou data-* muda. Escopo: telas de módulo
   (.view sem .dashboard-v2) e as fichas no #modal-root. */
:root {
  --ui-surface: #FFFFFF;
  --ui-ink: #0F1F24;
  --ui-ink-2: #5A6B70;
  --ui-ink-3: #8A9A9E;
  --ui-line: #E3EAEC;
  --ui-soft: #F6F9F9;
  --ui-tint: #E7F4EF;
  --ui-brand: #146B55;
  --ui-radius: 16px;
  --ui-radius-sm: 12px;
  --ui-shadow: 0 2px 12px rgba(13, 66, 73, .06), 0 1px 3px rgba(13, 66, 73, .04);
  --ui-shadow-hover: 0 8px 28px rgba(13, 66, 73, .13), 0 2px 6px rgba(13, 66, 73, .06);
}

/* ═════════ Telas de módulo ═════════ */
.app-shell .view:not(.dashboard-v2) { display: grid; gap: 20px; container: module / inline-size; }

/* Títulos de seção em caixa de frase (sem CAPS). */
.app-shell .view:not(.dashboard-v2) .dashboard-section-title {
  margin: 4px 0 -8px !important; font-size: 1.0625rem !important; font-weight: 700 !important;
  color: var(--ui-ink) !important; text-transform: none !important; letter-spacing: 0 !important;
}

/* Cartões de indicador: ícone em tom suave + rótulo + contexto + valor. */
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid.primary, .weight-kpis) {
  display: grid !important; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  gap: 16px !important; background: none !important; padding: 0 !important; box-shadow: none !important;
}
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid, .weight-kpis) .metric-card.metric-card.metric-card {
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-areas: "icon title" "icon value" "icon footer";
  column-gap: 14px !important; row-gap: 2px !important; align-content: start;
  padding: 18px !important; min-height: 0 !important;
  background: var(--ui-surface) !important; background-image: none !important;
  border: 1px solid var(--ui-line) !important; border-radius: var(--ui-radius) !important;
  box-shadow: var(--ui-shadow) !important;
}
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid, .weight-kpis) .metric-card::before,
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid, .weight-kpis) .metric-card::after { display: none !important; }
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid, .weight-kpis) .metric-card:hover { box-shadow: var(--ui-shadow-hover) !important; }
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid, .weight-kpis) .metric-head { display: contents !important; }
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid, .weight-kpis) .metric-icon {
  grid-area: icon; align-self: start; margin: 0 !important;
  width: 48px !important; height: 48px !important; border-radius: 14px !important;
  display: grid !important; place-items: center;
  background: var(--ui-tint) !important; color: var(--ui-brand) !important;
}
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid, .weight-kpis) .metric-icon svg { width: 24px !important; height: 24px !important; }
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid, .weight-kpis) .metric-icon.warning { background: #FFF4DC !important; color: #8A5A00 !important; }
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid, .weight-kpis) .metric-icon.error { background: #FDECEA !important; color: #B42318 !important; }
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid, .weight-kpis) .metric-icon.info { background: #E8F0FA !important; color: #24569A !important; }
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid, .weight-kpis) .metric-title { grid-area: title; min-width: 0; text-align: left !important; display: grid; gap: 1px; }
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid, .weight-kpis) .metric-label {
  font-size: 13px !important; font-weight: 600 !important; color: var(--ui-ink-2) !important;
  text-transform: none !important; letter-spacing: 0 !important; text-align: left !important;
}
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid, .weight-kpis) .metric-meta {
  font-size: 12px !important; color: var(--ui-ink-3) !important; line-height: 1.35 !important; text-align: left !important;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid, .weight-kpis) .metric-value {
  grid-area: value; margin-top: 4px;
  font-size: 1.75rem !important; font-weight: 800 !important; line-height: 1.1 !important;
  letter-spacing: -.02em; color: var(--ui-ink) !important; font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid, .weight-kpis) .metric-footer {
  grid-area: footer; margin-top: 6px; border: 0 !important; padding: 0 !important; justify-content: flex-start !important;
}
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid, .weight-kpis) .metric-footer > span:empty { display: none; }
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid, .weight-kpis) .metric-action.metric-action {
  border: 0 !important; padding: 0 !important; background: none !important; width: auto !important;
  color: var(--ui-brand) !important; font-size: 12.5px !important; font-weight: 600 !important; text-align: left !important;
}
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid, .weight-kpis) .metric-action::after { content: none !important; }

/* Insights e alertas do módulo: linhas compactas num único cartão
   (padrão "Acesso rápido" do Dashboard). Detalhes ficam recolhidos. */
.app-shell .view .module-insight-section, #modal-root .module-insight-section { margin: 0 !important; display: grid; gap: 8px; }
.app-shell .view .module-insight-title, #modal-root .module-insight-title {
  font-size: 14px !important; font-weight: 700 !important; color: var(--ui-ink) !important;
  text-transform: none !important; letter-spacing: 0 !important; margin: 0 !important;
}
.app-shell .view .module-insight-list, #modal-root .module-insight-list,
.app-shell .view .module-insight-section > .module-insight, #modal-root .module-insight-section > .module-insight {
  background: var(--ui-surface) !important; background-image: none !important;
  border: 1px solid var(--ui-line) !important; border-radius: var(--ui-radius-sm) !important; box-shadow: none !important;
}
.app-shell .view .module-insight-list, #modal-root .module-insight-list { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 0 !important; overflow: hidden; }
.app-shell .view .module-insight, #modal-root .module-insight {
  display: grid !important; grid-template-columns: 28px minmax(0, 1fr); align-items: center; column-gap: 12px;
  padding: 9px 14px !important; margin: 0 !important; min-height: 0 !important;
}
.app-shell .view .module-insight-list > .module-insight, #modal-root .module-insight-list > .module-insight {
  background: transparent !important; background-image: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
}
.app-shell .view .module-insight-list > .module-insight + .module-insight, #modal-root .module-insight-list > .module-insight + .module-insight { border-top: 1px solid var(--ui-line) !important; }
.app-shell .view .module-insight-list > .module-insight:hover, #modal-root .module-insight-list > .module-insight:hover { background: var(--ui-soft) !important; }
/* Detalhe aberto: o ícone fica na altura do título, não no meio do bloco. */
.app-shell .view .module-insight:has(.module-insight-context[open]), #modal-root .module-insight:has(.module-insight-context[open]) { align-items: start !important; }
.app-shell .view .module-insight .metric-icon, #modal-root .module-insight .metric-icon {
  width: 28px !important; height: 28px !important; min-width: 0 !important; border-radius: 8px !important; margin: 0 !important; padding: 0 !important;
  display: grid !important; place-items: center; background: var(--ui-tint) !important; color: var(--ui-brand) !important; box-shadow: none !important;
}
.app-shell .view .module-insight .metric-icon svg, #modal-root .module-insight .metric-icon svg { width: 15px !important; height: 15px !important; }
.app-shell .view .module-insight .metric-icon.warning, #modal-root .module-insight .metric-icon.warning { background: #FFF4DC !important; color: #8A5A00 !important; }
.app-shell .view .module-insight .metric-icon.error, #modal-root .module-insight .metric-icon.error { background: #FDECEA !important; color: #B42318 !important; }
.app-shell .view .module-insight .metric-icon.info, #modal-root .module-insight .metric-icon.info { background: #E8F0FA !important; color: #24569A !important; }
.app-shell .view .module-insight-body, #modal-root .module-insight-body {
  display: flex !important; flex-wrap: wrap; align-items: center; gap: 2px 14px; min-width: 0; margin: 0 !important; padding: 0 !important;
}
.app-shell .view .module-insight-heading, #modal-root .module-insight-heading {
  flex: 1 1 260px; min-width: 0; margin: 0 !important;
  font-size: 13px !important; line-height: 1.35 !important; font-weight: 600 !important; color: var(--ui-ink) !important;
}
.app-shell .view .module-insight-context, #modal-root .module-insight-context { order: 3; margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; }
.app-shell .view .module-insight-context > summary, #modal-root .module-insight-context > summary {
  font-size: 12px !important; font-weight: 500 !important; color: var(--ui-ink-2) !important; cursor: pointer; list-style: none; padding: 0 !important;
}
.app-shell .view .module-insight-context > summary::-webkit-details-marker, #modal-root .module-insight-context > summary::-webkit-details-marker { display: none; }
.app-shell .view .module-insight-context > summary::after, #modal-root .module-insight-context > summary::after { content: " \25BE"; font-size: 10px; }
.app-shell .view .module-insight-context[open], #modal-root .module-insight-context[open] { order: 9; flex: 1 1 100%; padding: 6px 0 2px !important; }
.app-shell .view .module-insight-context[open] > summary::after, #modal-root .module-insight-context[open] > summary::after { content: " \25B4"; }
.app-shell .view .module-insight-context :is(.module-insight-message, .module-insight-metric, .module-insight-period, .module-insight-source), #modal-root .module-insight-context :is(.module-insight-message, .module-insight-metric, .module-insight-period, .module-insight-source) {
  font-size: 12px !important; color: var(--ui-ink-2) !important; margin: 4px 0 0 !important;
}
.app-shell .view .module-insight-body > .button, #modal-root .module-insight-body > .button {
  order: 4; height: auto !important; min-height: 0 !important; padding: 2px 0 !important;
  border: 0 !important; background: none !important; box-shadow: none !important;
  font-size: 12.5px !important; font-weight: 600 !important; color: var(--ui-brand) !important; text-decoration: none !important;
}
.app-shell .view .module-insight-body > .button:hover, #modal-root .module-insight-body > .button:hover { text-decoration: underline !important; }

/* Barra de busca, filtros e ações em uma linha só. */
.app-shell .view:not(.dashboard-v2) .view-toolbar {
  display: flex !important; flex-wrap: wrap; align-items: center; gap: 12px !important;
  padding: 12px !important; margin: 0 !important;
  background: var(--ui-surface) !important; border: 1px solid var(--ui-line) !important;
  border-radius: var(--ui-radius) !important; box-shadow: var(--ui-shadow) !important;
}
.app-shell .view:not(.dashboard-v2) .view-toolbar .toolbar-left {
  flex: 1 1 420px; min-width: 0; display: flex !important; flex-wrap: wrap; align-items: center; gap: 10px !important;
}
.app-shell .view:not(.dashboard-v2) .view-toolbar .toolbar-left > :first-child { flex: 1 1 260px; min-width: 0; }
.app-shell .view:not(.dashboard-v2) .view-toolbar .toolbar-right { display: flex !important; flex-wrap: wrap; gap: 8px !important; margin-left: auto; }
/* Só a COR de fundo: o ícone de lupa é a imagem de fundo do próprio campo. */
.app-shell .view:not(.dashboard-v2) .view-toolbar :is(input[type="search"], .search-input) {
  height: 40px !important; border-radius: 10px !important; border: 1px solid var(--ui-line) !important;
  background-color: var(--ui-soft) !important; box-shadow: none !important;
}
.app-shell .view:not(.dashboard-v2) .view-toolbar .search-wrap { flex: 1 1 260px; min-width: 0; }
/* Filtros ficam na mesma linha da busca; só quebram quando o painel abre. */
.app-shell .view:not(.dashboard-v2) .view-toolbar .toolbar-left { flex-wrap: nowrap !important; }
.app-shell .view:not(.dashboard-v2) .view-toolbar .toolbar-left:has(.module-filter-panel[open]) { flex-wrap: wrap !important; }
.app-shell .view:not(.dashboard-v2) .module-filter-panel {
  /* styles.css dá width:100% ao painel; fechado, ele só deve ocupar o botão. */
  flex: 0 0 auto; width: auto !important; margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important;
}
.app-shell .view:not(.dashboard-v2) .module-filter-panel[open] { flex: 1 1 100%; width: 100% !important; }
.app-shell .view:not(.dashboard-v2) .module-filter-panel > summary {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px;
  border: 1px solid var(--ui-line); border-radius: 10px; background: var(--ui-surface);
  font-size: 13px; font-weight: 600; color: var(--ui-ink); cursor: pointer; list-style: none;
}
.app-shell .view:not(.dashboard-v2) .module-filter-panel > summary::-webkit-details-marker { display: none; }
.app-shell .view:not(.dashboard-v2) .module-filter-panel > summary::before {
  content: ""; width: 14px; height: 14px; flex: none;
  background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M3 5h18M6 12h12M10 19h4'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M3 5h18M6 12h12M10 19h4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.app-shell .view:not(.dashboard-v2) .module-filter-panel[open] > summary { border-color: #9FD3C2; background: #F6FBF9; }
.app-shell .view:not(.dashboard-v2) .module-filter-fields { margin-top: 10px; }
/* Alternância de visualização (Lotes: Blocos/Lista): o modo atual fica marcado. */
.app-shell .view:not(.dashboard-v2) .view-toolbar .button.secondary.accent {
  border-color: #9FD3C2 !important; background: #E3F4EC !important; color: #146B55 !important; box-shadow: none !important;
}

/* Tabelas */
.app-shell .view:not(.dashboard-v2) .table-panel {
  padding: 0 !important; overflow: hidden;
  background: var(--ui-surface) !important; border: 1px solid var(--ui-line) !important;
  border-radius: var(--ui-radius) !important; box-shadow: var(--ui-shadow) !important;
}
.app-shell .view:not(.dashboard-v2) .table-panel .table-scroll th {
  background: var(--ui-soft) !important; color: var(--ui-ink-2) !important;
  font-size: 12px !important; font-weight: 600 !important; text-transform: none !important; letter-spacing: 0 !important;
  height: 44px !important; border-bottom: 1px solid var(--ui-line) !important;
}
.app-shell .view:not(.dashboard-v2) .table-panel .table-scroll td {
  height: 52px !important; font-size: 13px !important; color: var(--ui-ink) !important;
  border-bottom: 1px solid #EEF3F4 !important;
}
.app-shell .view:not(.dashboard-v2) .table-panel .table-scroll tbody tr:nth-child(even) { background: var(--ui-surface) !important; }
.app-shell .view:not(.dashboard-v2) .table-panel .table-scroll tbody tr:hover { background: #F6FBF9 !important; }
.app-shell .view:not(.dashboard-v2) .table-panel .table-scroll td:first-child { font-weight: 700; }
.app-shell .view:not(.dashboard-v2) .table-panel :is(.chip, .status-chip, .badge) {
  border: 0 !important; border-radius: 999px !important; padding: 3px 10px !important;
  font-size: 12px !important; font-weight: 600 !important; background: #EEF3F4 !important; color: var(--ui-ink-2) !important;
}
/* Valor ausente (ex.: lote sem categoria) não vira pílula vazia. */
.app-shell .view:not(.dashboard-v2) .table-panel :is(.chip, .status-chip, .badge):empty { display: none !important; }
.app-shell .view:not(.dashboard-v2) .table-panel :is(.chip, .status-chip, .badge):is(.success) { background: #E3F4EC !important; color: #146B55 !important; }
.app-shell .view:not(.dashboard-v2) .table-panel :is(.chip, .status-chip, .badge):is(.warning) { background: #FFF4DC !important; color: #8A5A00 !important; }
.app-shell .view:not(.dashboard-v2) .table-panel :is(.chip, .status-chip, .badge):is(.error, .danger) { background: #FDECEA !important; color: #B42318 !important; }
.app-shell .view:not(.dashboard-v2) .table-panel :is(.chip, .status-chip, .badge):is(.info) { background: #E8F0FA !important; color: #24569A !important; }
.app-shell .view:not(.dashboard-v2) .table-actions .button.icon-only {
  width: 32px !important; height: 32px !important; min-height: 0 !important; border-radius: 8px !important;
}
.app-shell .view:not(.dashboard-v2) .pagination {
  padding: 12px 16px !important; border: 0 !important; border-top: 1px solid var(--ui-line) !important;
  background: var(--ui-surface) !important; border-radius: 0 !important; font-size: 12.5px; color: var(--ui-ink-2);
}

/* Lotes em blocos (kanban): só fases com lotes viram coluna; cada
   coluna tem a altura do próprio conteúdo; fases vazias numa faixa. */
.app-shell .view:not(.dashboard-v2) .kanban-board {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important; gap: 14px !important;
  align-items: start !important; overflow: visible !important; padding: 0 !important;
}
.app-shell .view:not(.dashboard-v2) .kanban-column {
  min-width: 0 !important; padding: 10px !important; gap: 10px !important;
  background: var(--ui-soft) !important; border: 1px solid var(--ui-line) !important; border-radius: var(--ui-radius) !important; box-shadow: none !important;
}
.app-shell .view:not(.dashboard-v2) .kanban-title { padding: 2px 4px 0; }
.app-shell .view:not(.dashboard-v2) .kanban-title strong { font-size: 13.5px; font-weight: 700; color: var(--ui-ink); }
.app-shell .view:not(.dashboard-v2) .kanban-title .badge {
  display: inline-grid !important; place-items: center; min-width: 22px; height: 22px; padding: 0 7px !important;
  border: 0 !important; border-radius: 999px !important; background: var(--ui-tint) !important; color: var(--ui-brand) !important;
  font-size: 12px !important; font-weight: 700 !important; box-shadow: none !important;
}
.app-shell .view:not(.dashboard-v2) .kanban-stack { gap: 8px !important; }
.app-shell .view:not(.dashboard-v2) .lot-card {
  padding: 12px 14px !important; gap: 9px !important; min-height: 0 !important;
  background: var(--ui-surface) !important; border: 1px solid var(--ui-line) !important; border-top-width: 1px !important;
  border-radius: var(--ui-radius-sm) !important; box-shadow: none !important; background-image: none !important;
}
.app-shell .view:not(.dashboard-v2) .lot-card:hover { box-shadow: var(--ui-shadow-hover) !important; }
.app-shell .view:not(.dashboard-v2) .lot-card::before, .app-shell .view:not(.dashboard-v2) .lot-card::after { content: none !important; }
.app-shell .view:not(.dashboard-v2) .lot-card-head { align-items: flex-start; }
.app-shell .view:not(.dashboard-v2) .lot-card-head strong { font-size: 14px !important; color: var(--ui-ink) !important; }
.app-shell .view:not(.dashboard-v2) .lot-card-head span { font-size: 12px; font-weight: 500; color: var(--ui-ink-2); }
.app-shell .view:not(.dashboard-v2) .lot-card-head .chip { flex: none; height: 22px !important; padding: 0 8px !important; min-height: 0 !important; display: inline-flex !important; align-items: center; }
.app-shell .view:not(.dashboard-v2) .lot-meter { height: 6px !important; }
.app-shell .view:not(.dashboard-v2) .lot-stats { gap: 4px 12px !important; }
.app-shell .view:not(.dashboard-v2) .lot-stats span { font-size: 12px; font-weight: 600; color: var(--ui-ink-2); }
.app-shell .view:not(.dashboard-v2) .lot-actions { flex-wrap: nowrap !important; gap: 6px !important; }
.app-shell .view:not(.dashboard-v2) .lot-actions .button {
  height: 32px !important; min-height: 0 !important; padding: 0 12px !important; border-radius: 8px !important; font-size: 12.5px !important;
}
.app-shell .view:not(.dashboard-v2) .lot-actions .button.icon-only { width: 32px !important; padding: 0 !important; flex: none; }
.app-shell .view:not(.dashboard-v2) .lot-actions .button:not(.icon-only) { flex: 1 1 0; }
.app-shell .view:not(.dashboard-v2) .lot-actions .button svg { width: 15px !important; height: 15px !important; }
.app-shell .view:not(.dashboard-v2) .kanban-empty-phases {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 0 !important;
  font-size: 12.5px; color: var(--ui-ink-2);
}
.app-shell .view:not(.dashboard-v2) .kanban-empty-phase {
  padding: 3px 10px; border: 1px dashed var(--ui-line); border-radius: 999px; background: var(--ui-surface); font-weight: 600;
}

@container module (max-width: 720px) {
  .app-shell .view:not(.dashboard-v2) .dashboard-grid.primary { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@container module (max-width: 440px) {
  .app-shell .view:not(.dashboard-v2) .dashboard-grid.primary { grid-template-columns: minmax(0, 1fr) !important; }
}

/* ═════════ Fichas (modais) ═════════ */
#modal-root .modal.animal-profile-modal,
#modal-root .modal.has-tabs {
  width: min(1120px, 94vw) !important; max-width: none !important;
  border: 0 !important; border-radius: 20px !important; box-shadow: 0 24px 64px rgba(13, 66, 73, .24) !important;
}
#modal-root :is(.animal-profile-modal, .has-tabs) .modal-header { padding: 16px 24px !important; border-bottom: 1px solid var(--ui-line) !important; }
#modal-root :is(.animal-profile-modal, .has-tabs) .modal-body { padding: 20px 24px !important; background: var(--ui-soft) !important; }
#modal-root :is(.animal-profile-modal, .has-tabs) .modal-footer { padding: 12px 24px !important; border-top: 1px solid var(--ui-line) !important; }

/* Ficha do animal */
#modal-root .animal-profile { display: grid; gap: 16px; }
#modal-root .animal-profile-hero {
  display: grid !important; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 18px 20px !important; background: var(--ui-surface) !important; border: 1px solid var(--ui-line) !important;
  border-radius: var(--ui-radius) !important; box-shadow: var(--ui-shadow) !important;
}
#modal-root .animal-profile-icon {
  width: 56px !important; height: 56px !important; border-radius: 16px !important; display: grid !important; place-items: center;
  background: var(--ui-tint) !important; color: var(--ui-brand) !important;
}
#modal-root .animal-profile-icon svg { width: 28px !important; height: 28px !important; }
#modal-root .animal-profile-title > span { font-size: 12px !important; font-weight: 600 !important; color: var(--ui-ink-2) !important; text-transform: none !important; letter-spacing: 0 !important; }
#modal-root .animal-profile-title h2 { margin: 2px 0 4px !important; font-size: 1.5rem !important; font-weight: 800 !important; letter-spacing: -.02em; color: var(--ui-ink) !important; }
#modal-root .animal-profile-identities { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--ui-ink-2); }
#modal-root .animal-profile-identities span { padding: 2px 10px; border-radius: 999px; background: var(--ui-soft); border: 1px solid var(--ui-line); }
#modal-root .animal-profile-current-state {
  display: grid !important; gap: 2px; padding: 10px 16px !important; min-width: 170px;
  border-radius: var(--ui-radius-sm) !important; background: var(--ui-tint) !important; border: 0 !important;
}
#modal-root .animal-profile-current-state span { font-size: 12px !important; color: #146B55 !important; font-weight: 600; }
#modal-root .animal-profile-current-state strong { font-size: 1.125rem !important; color: var(--ui-ink) !important; }
#modal-root .animal-profile-current-state small { font-size: 11.5px !important; color: var(--ui-ink-2) !important; }

#modal-root .animal-profile-metrics {
  display: grid !important; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important; gap: 12px !important;
}
#modal-root .animal-profile-metric {
  display: grid !important; gap: 4px; align-content: start; min-height: 0 !important;
  padding: 14px 16px !important; background: var(--ui-surface) !important; background-image: none !important;
  border: 1px solid var(--ui-line) !important; border-top: 3px solid var(--ui-line) !important;
  border-radius: var(--ui-radius-sm) !important; box-shadow: none !important;
}
#modal-root .animal-profile-metric.green { border-top-color: #1A9475 !important; }
#modal-root .animal-profile-metric.blue { border-top-color: #3270BB !important; }
#modal-root .animal-profile-metric.purple { border-top-color: #7A5BC7 !important; }
#modal-root .animal-profile-metric.orange { border-top-color: #E0703A !important; }
#modal-root .animal-profile-metric.teal { border-top-color: #2BA39A !important; }
#modal-root .animal-profile-metric span { font-size: 12px !important; font-weight: 600 !important; color: var(--ui-ink-2) !important; text-transform: none !important; letter-spacing: 0 !important; }
#modal-root .animal-profile-metric strong {
  font-size: 1.25rem !important; font-weight: 800 !important; line-height: 1.2 !important; color: var(--ui-ink) !important;
  word-break: normal !important; overflow-wrap: normal !important; hyphens: none !important; text-wrap: balance;
}
#modal-root .animal-profile-metric small { font-size: 12px !important; color: var(--ui-ink-3) !important; }

#modal-root .animal-profile-actions {
  display: flex !important; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 12px 16px !important; background: var(--ui-surface) !important; border: 1px solid var(--ui-line) !important;
  border-radius: var(--ui-radius) !important;
}
#modal-root .animal-profile-actions > div:first-child strong { font-size: 13px; color: var(--ui-ink); }
#modal-root .animal-profile-actions .table-actions { display: flex !important; flex-wrap: wrap; gap: 8px !important; }
#modal-root .animal-profile-actions .button {
  height: 34px !important; min-height: 0 !important; padding: 0 14px !important; border-radius: 999px !important;
  border: 1px solid var(--ui-line) !important; background: var(--ui-soft) !important; color: var(--ui-ink) !important;
  font-size: 12.5px !important; font-weight: 600 !important;
}
#modal-root .animal-profile-actions .button:hover:not(:disabled) { border-color: #9FD3C2 !important; background: #F6FBF9 !important; color: #146B55 !important; }

#modal-root .animal-profile-support-grid { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important; gap: 16px !important; }
#modal-root .animal-profile :is(.detail-panel, .chart-panel, .table-panel) {
  padding: 16px 18px !important; background: var(--ui-surface) !important; border: 1px solid var(--ui-line) !important;
  border-radius: var(--ui-radius) !important; box-shadow: none !important;
}
#modal-root .animal-profile .panel-title { display: grid !important; gap: 2px; margin: 0 0 10px !important; }
#modal-root .animal-profile .panel-title h3 { margin: 0 !important; font-size: 1rem !important; font-weight: 700 !important; color: var(--ui-ink) !important; }
#modal-root .animal-profile .panel-title p { margin: 0 !important; font-size: 12.5px !important; color: var(--ui-ink-2) !important; }
#modal-root .animal-profile-data dl { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0; }
#modal-root .animal-profile-data dl > div { display: grid; gap: 2px; padding: 0 0 8px; border-bottom: 1px solid #EEF3F4; }
#modal-root .animal-profile-data dt { font-size: 12px !important; color: var(--ui-ink-2) !important; }
#modal-root .animal-profile-data dd { margin: 0 !important; font-size: 13.5px !important; font-weight: 600 !important; color: var(--ui-ink) !important; }

/* Ficha do lote */
#modal-root .has-tabs .lot-tabs {
  display: flex !important; gap: 4px !important; overflow-x: auto; padding: 0 20px !important;
  background: var(--ui-surface) !important; border-bottom: 1px solid var(--ui-line) !important;
}
#modal-root .has-tabs .lot-tab-button {
  border: 0 !important; border-bottom: 2px solid transparent !important; border-radius: 0 !important;
  background: none !important; box-shadow: none !important; padding: 12px 10px !important;
  font-size: 13px !important; font-weight: 600 !important; color: var(--ui-ink-2) !important; white-space: nowrap;
}
#modal-root .has-tabs .lot-tab-button.active { color: #146B55 !important; border-bottom-color: #1A9475 !important; }
#modal-root .has-tabs .lot-tab-panel { display: grid; gap: 16px; }
#modal-root .has-tabs .kpi-row { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important; gap: 12px !important; }
#modal-root .has-tabs .kpi {
  display: flex !important; flex-direction: column-reverse; gap: 4px; padding: 14px 16px !important;
  background: var(--ui-surface) !important; background-image: none !important; border: 1px solid var(--ui-line) !important;
  border-left-width: 1px !important; border-radius: var(--ui-radius-sm) !important; box-shadow: none !important;
}
#modal-root .has-tabs .kpi span { font-size: 12px !important; font-weight: 600 !important; color: var(--ui-ink-2) !important; }
#modal-root .has-tabs .kpi strong { font-size: 1.25rem !important; font-weight: 800 !important; color: var(--ui-ink) !important; font-variant-numeric: tabular-nums; }
#modal-root .has-tabs .lot-tab-panel > p { margin: 0; padding: 10px 14px; border-radius: var(--ui-radius-sm); background: var(--ui-surface); border: 1px solid var(--ui-line); font-size: 13px; }
#modal-root .has-tabs .table-scroll {
  background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-sm); overflow: auto;
}

@media (max-width: 720px) {
  #modal-root .animal-profile-hero { grid-template-columns: 48px minmax(0, 1fr); }
  #modal-root .animal-profile-current-state { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell .view:not(.dashboard-v2) .dashboard-grid .metric-card { transition: none !important; }
}

/* ═════════ Gráficos de peso (ficha individual e Pesagens) ═════════
   Mesmo visual dos gráficos do Dashboard: grade suave, eixo discreto,
   números tabulares, texto sempre em tinta neutra (a cor fica só nas
   marcas). Linhas retas de propósito: ver weightCharts.js. */
.weight-chart .chart-gridline { stroke: #E8EEEC; stroke-width: 1; }
.weight-chart .chart-axis-line { stroke: #D3DCD9; stroke-width: 1; }
.weight-chart .chart-axis-value { font-size: 11px; fill: #7E8E92; font-variant-numeric: tabular-nums; }
.weight-chart .chart-axis-title { font-size: 11px; font-weight: 600; fill: #56686C; letter-spacing: 0.01em; }
.weight-chart .smooth-line-chart-label { font-size: 11px; font-weight: 500; fill: #7E8E92; font-variant-numeric: tabular-nums; }
.weight-chart .chart-reference-line { stroke: #8A989C; stroke-width: 1.25; stroke-dasharray: 2 4; stroke-linecap: round; }
.weight-chart .weight-chart-last-value { font-size: 12px; font-weight: 700; fill: #14282B; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: #FFFFFF; stroke-width: 4px; stroke-linejoin: round; }
.weight-chart .weight-chart-point { cursor: pointer; transition: r 120ms ease; }
.weight-chart .weight-chart-point:hover, .weight-chart .weight-chart-point:focus-visible { r: 6; outline: none; }
.weight-chart + .chart-legend { gap: 6px 18px; margin-top: 10px; font-size: 12.5px; color: #56686C; }
.weight-chart + .chart-legend .chart-legend-item { gap: 8px; }
.weight-chart + .chart-legend .chart-legend-swatch { width: 18px; height: 2.5px; opacity: 1; }
.weight-chart + .chart-legend .chart-legend-swatch.trend { height: 0; background: none !important; border-top: 2px dashed #0F5A44; }
.weight-chart + .chart-legend .chart-legend-swatch.dashed { height: 0; border-top: 2px dotted #8A989C; }
.weight-chart + .chart-legend .chart-legend-swatch.area { width: 14px; height: 10px; border-radius: 3px; opacity: 0.25; }
@media (prefers-reduced-motion: reduce) { .weight-chart .weight-chart-point { transition: none; } }

/* Pesagens: painéis lado a lado sem vão (linhas da grade não esticam até a
   altura do painel vizinho), filtros do gráfico numa linha só e ranking no
   mesmo padrão de lista do "Acesso rápido". */
.app-shell .weight-analysis { display: grid; gap: 20px; }
.app-shell .weight-analysis .chart-panel { align-content: start !important; align-self: start; padding: 20px !important; border-radius: var(--ui-radius) !important; border: 1px solid var(--ui-line) !important; box-shadow: var(--ui-shadow) !important; background: var(--ui-surface) !important; background-image: none !important; }
.app-shell .weight-analysis .chart-panel .panel-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin-bottom: 12px; }
.app-shell .weight-analysis .chart-panel .panel-title h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ui-ink); }
.app-shell .weight-analysis .chart-panel .panel-title p { margin: 0; font-size: 12.5px; color: var(--ui-ink-2); }
.app-shell .weight-analysis .weight-curve-filters { display: flex !important; flex-wrap: wrap; gap: 8px !important; margin-bottom: 8px; }
.app-shell .weight-analysis .weight-curve-filters select {
  width: auto !important; flex: 0 1 220px; min-width: 150px; height: 36px !important; padding: 0 32px 0 12px !important;
  border: 1px solid var(--ui-line) !important; border-radius: 10px !important; background-color: var(--ui-soft) !important;
  background-repeat: no-repeat !important; font-size: 13px !important; color: var(--ui-ink) !important; box-shadow: none !important;
}
.app-shell .weight-analysis .ranking-list { display: grid !important; gap: 0 !important; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-sm); overflow: hidden; }
.app-shell .weight-analysis .ranking-row {
  display: grid !important; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 11px 14px !important; margin: 0 !important; min-height: 0 !important;
  border: 0 !important; border-radius: 0 !important; background: var(--ui-surface) !important; box-shadow: none !important;
}
.app-shell .weight-analysis .ranking-row + .ranking-row { border-top: 1px solid var(--ui-line) !important; }
.app-shell .weight-analysis .ranking-row:hover { background: var(--ui-soft) !important; }
.app-shell .weight-analysis .ranking-row span {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: var(--ui-tint) !important; color: var(--ui-brand) !important; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.app-shell .weight-analysis .ranking-row:first-child span { background: #1A9475 !important; color: #fff !important; }
.app-shell .weight-analysis .ranking-row strong { font-size: 13.5px; font-weight: 600; color: var(--ui-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .weight-analysis .ranking-row em { font-style: normal; font-size: 13.5px; font-weight: 700; color: #146B55; font-variant-numeric: tabular-nums; }
/* Rodapé dos cartões de indicador alinhado à esquerda, como o resto do cartão. */
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid, .weight-kpis) .metric-footer,
.app-shell .view:not(.dashboard-v2) :is(.dashboard-grid, .weight-kpis) .metric-footer > * {
  text-align: left !important; justify-content: flex-start !important; justify-self: start !important;
  font-size: 12.5px !important; font-weight: 600 !important; color: var(--ui-ink-2) !important;
}
/* Eixo Y fixo dos gráficos de peso (ver renderStickyYAxis). */
.weight-chart { position: relative; }
.weight-chart .weight-chart-yaxis { position: absolute; left: 0; top: 0; z-index: 1; pointer-events: none; height: 230px; }
