/* Base compartilhada dos paineis analiticos (Remessa, Licitacoes, LCC).
   Estrutura comum: cards, KPIs, filtros de drilldown, grafico, tabela de registros, modal de detalhe. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Acessibilidade: foco visível em todo elemento interativo ── */
button:focus-visible,
input:focus-visible,
a:focus-visible,
tr.data-row:focus-visible,
.modal-tab:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #2b6cb0;
  outline-offset: 2px;
}
:root[data-theme="dark"] button:focus-visible,
:root[data-theme="dark"] input:focus-visible,
:root[data-theme="dark"] a:focus-visible,
:root[data-theme="dark"] tr.data-row:focus-visible,
:root[data-theme="dark"] .modal-tab:focus-visible,
:root[data-theme="dark"] [tabindex]:focus-visible {
  outline-color: #7fb1ee;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
html, body { max-width: 100%; overflow-x: hidden; }
body {
      font-family: 'Segoe UI', system-ui, sans-serif;
      background: #f0f2f5;
      color: #1a1a2e;
      min-height: 100vh;
    }
main { max-width: 1500px; margin: 1.5rem auto; padding: 0 1rem 2rem; }
.card { background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.1); padding: 1.25rem 1.4rem; margin-bottom: 1.1rem; min-width: 0; }
/* ── Filtros ativos (drilldown) ── */
.filter-bar {
      display: none;
      align-items: center;
      gap: .5rem;
      flex-wrap: wrap;
      margin-bottom: 1rem;
      padding: .6rem .9rem;
      background: #ebf4ff;
      border: 1px solid #bee3f8;
      border-radius: 10px;
    }
.filter-bar.show { display: flex; }
.filter-bar-label { font-size: .78rem; font-weight: 700; color: #2b6cb0; margin-right: .2rem; }
.filter-chip {
      display: inline-flex;
      align-items: center;
      gap: .35rem;
      background: #fff;
      border: 1px solid #90cdf4;
      color: #2b6cb0;
      border-radius: 99px;
      padding: .3rem .5rem .3rem .8rem;
      font-size: .76rem;
      font-weight: 600;
    }
.filter-chip button {
      background: #bee3f8;
      border: none;
      color: #2a4a7f;
      width: 18px; height: 18px;
      border-radius: 50%;
      cursor: pointer;
      font-size: .7rem;
      line-height: 1;
      display: flex; align-items: center; justify-content: center;
    }
.filter-chip button:hover { background: #90cdf4; }
.filter-clear-all {
      display: inline-flex;
      align-items: center;
      gap: .35rem;
      background: #fff;
      border: 1px solid #bee3f8;
      color: #2b6cb0;
      font-size: .78rem;
      font-weight: 600;
      border-radius: 7px;
      padding: .45rem .9rem;
      cursor: pointer;
      transition: background .15s ease, border-color .15s ease, transform .08s ease;
    }
.filter-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.filter-goto-consulta {
      display: inline-flex;
      align-items: center;
      gap: .35rem;
      background: #2b6cb0;
      border: 1px solid #2b6cb0;
      color: #fff;
      font-size: .78rem;
      font-weight: 600;
      border-radius: 7px;
      padding: .45rem .9rem;
      cursor: pointer;
      white-space: nowrap;
      transition: background .15s ease, transform .08s ease;
    }
.filter-goto-consulta:hover { background: #235a94; }
.filter-goto-consulta:active { transform: scale(.97); }
.filter-clear-all:hover { background: #ebf4ff; border-color: #90cdf4; }
.filter-clear-all:active { transform: scale(.97); }
/* ── KPI row ── */
.kpi-row {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
      gap: .9rem;
      margin-bottom: 1.25rem;
    }
.kpi-tile {
      background: #fff;
      border-radius: 12px;
      box-shadow: 0 1px 4px rgba(0,0,0,.1);
      padding: 1rem 1.1rem;
      border-top: 3px solid #2a78d6;
      transition: transform .15s ease, box-shadow .15s ease;
    }
.kpi-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(26,58,108,.12); }
.kpi-tile.warn { border-top-color: #fab219; }
.kpi-tile.critical { border-top-color: #d03b3b; }
.kpi-tile.good { border-top-color: #0ca30c; }
.kpi-label {
      font-size: .68rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .05em;
      color: #898781;
      margin-bottom: .4rem;
    }
.kpi-value { font-size: 1.5rem; font-weight: 700; color: #1a3a6c; line-height: 1.2; }
.kpi-sub { font-size: .74rem; color: #718096; margin-top: .3rem; }
.delta-badge { font-weight: 700; white-space: nowrap; }
.delta-up { color: #197a45; }
.delta-down { color: #b23328; }
/* ── Chart cards ── */
.charts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; align-items: start; }
@media (max-width: 980px) { .charts-grid { grid-template-columns: 1fr; } }
.card h2 { font-size: .92rem; font-weight: 700; color: #1a3a6c; margin-bottom: .2rem; }
.card .card-desc { font-size: .76rem; color: #a0aec0; margin-bottom: .1rem; }
.card .card-hint { font-size: .7rem; color: #2b6cb0; margin-bottom: .6rem; }
.chart-box { width: 100%; height: 320px; position: relative; }
.chart-box.short { height: 190px; }
.chart-box.tall { height: 420px; }
.chart-box.bullet { height: 110px; }
.chart-empty {
      position: absolute; inset: 0;
      display: flex; align-items: center; justify-content: center;
      color: #a0aec0; font-size: .82rem; text-align: center; padding: 1rem;
    }
/* ── Cards de gráfico: minimizar/maximizar ── */
.charts-grid > .card { padding-bottom: 1.4rem; transition: padding .2s ease; }
.charts-grid > .card.collapsed { padding-bottom: .5rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.card-head h2 { margin-bottom: 0; }
.card-collapse-btn {
      background: #f7f9fc;
      border: 1px solid #e2e8f0;
      color: #4a5568;
      width: 28px; height: 28px;
      border-radius: 8px;
      cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
      transition: background .15s ease, border-color .15s ease;
    }
.card-collapse-btn:hover { background: #edf2f7; border-color: #cbd5e0; }
.card-collapse-btn .chevron { display: inline-block; font-size: .72rem; line-height: 1; transition: transform .2s ease; }
.card.collapsed .card-collapse-btn .chevron { transform: rotate(-90deg); }
.card-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .22s ease; margin-top: .35rem; }
.card.collapsed .card-body { grid-template-rows: 0fr; margin-top: 0; }
.card-body-inner { overflow: hidden; min-height: 0; }
.section-title { font-size: 1.05rem; font-weight: 700; color: #1a3a6c; margin: 1.75rem 0 .9rem; display: flex; align-items: center; gap: .5rem; }
.spinner-lg {
      display: inline-block; width: 22px; height: 22px;
      border: 3px solid #e2e8f0; border-top-color: #1a3a6c;
      border-radius: 50%; animation: spin .7s linear infinite;
    }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { display: flex; align-items: center; justify-content: center; padding: 3rem; color: #a0aec0; font-size: .875rem; gap: .6rem; }
/* ── Registros: busca + tabela + paginação ── */
.records-toolbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .9rem; }
.records-search { position: relative; flex: 1; min-width: 240px; }
.records-search input {
      width: 100%;
      padding: .6rem .9rem .6rem 2.2rem;
      font-size: .875rem;
      border: 1px solid #dde3ee;
      border-radius: 8px;
      outline: none;
      transition: border-color .2s, box-shadow .2s;
    }
.records-search input:focus { border-color: #4a90d9; box-shadow: 0 0 0 3px rgba(74,144,217,.15); }
.records-search .icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: #a0aec0; font-size: .9rem; pointer-events: none; }
.records-count { font-size: .78rem; color: #718096; white-space: nowrap; }
.records-count b { color: #1a3a6c; }
.btn-export {
      display: inline-flex; align-items: center; gap: .35rem;
      background: #fff; border: 1px solid #dde3ee; color: #2d3748;
      border-radius: 8px; padding: .55rem .85rem; font-size: .8rem; font-weight: 600;
      cursor: pointer; white-space: nowrap;
      transition: background .15s ease, border-color .15s ease, transform .1s ease, box-shadow .15s ease;
    }
.btn-export:hover { background: #f7f9fc; border-color: #c8d3e2; box-shadow: 0 2px 8px rgba(26,58,108,.08); }
.btn-export:active { transform: translateY(1px); box-shadow: none; }
.btn-export:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
.export-group { display: flex; gap: .4rem; }

/* ── Botões de ação dentro de abas do modal (Editar/Confirmar/Extrair/Salvar) ──
   Variante de .btn-export: mesma base, com um tom "primário" sólido para a
   ação principal esperada em cada linha/formulário. */
.btn-export.btn-primary {
      background: #1a3a6c; border-color: #1a3a6c; color: #fff;
    }
.btn-export.btn-primary:hover { background: #234a86; border-color: #234a86; box-shadow: 0 4px 12px rgba(26,58,108,.28); }
.btn-export.btn-sm { padding: .35rem .65rem; font-size: .76rem; border-radius: 6px; }
.btn-export + .btn-export { margin-left: .4rem; }

/* ── Formulário inline (cadastro/edição manual dentro de uma aba do modal) ── */
.inline-form {
      margin-top: .9rem; padding: .9rem 1rem; background: #f7f9fc;
      border: 1px solid #edf2f7; border-left: 3px solid #2b6cb0; border-radius: 10px;
      display: flex; flex-direction: column; gap: .75rem;
    }
.inline-form .form-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.inline-form .form-field { display: flex; flex-direction: column; gap: .3rem; font-size: .76rem; font-weight: 600; color: #4a5568; }
.inline-form .form-field.grow { flex: 1; min-width: 220px; }
.inline-form .form-field input {
      padding: .5rem .65rem; font-size: .84rem; font-weight: 400; color: #1a1a2e;
      border: 1px solid #dde3ee; border-radius: 7px; outline: none; font-family: inherit;
      transition: border-color .15s ease, box-shadow .15s ease;
    }
.inline-form .form-field input:focus { border-color: #4a90d9; box-shadow: 0 0 0 3px rgba(74,144,217,.15); }
.inline-form .form-actions { display: flex; gap: .5rem; }

/* ── Linhas de tabelas inline dentro do modal (leve destaque ao passar o mouse) ── */
table.modal-inline-table tbody tr:hover td { background: #f7fafc; }
.tbl-wrap { overflow-x: auto; position: relative; min-height: 120px; transition: opacity .15s ease; }
.tbl-wrap.is-loading { opacity: .45; pointer-events: none; }
table.records-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
table.records-table th {
      text-align: left; padding: .6rem .7rem; font-weight: 600; color: #4a5568;
      border-bottom: 2px solid #e2e8f0; white-space: nowrap; background: #f7f9fc;
      position: sticky; top: 0; z-index: 1;
    }
table.records-table td { padding: .6rem .7rem; border-bottom: 1px solid #edf2f7; vertical-align: middle; }
table.records-table tr:last-child td { border-bottom: none; }
table.records-table tr.data-row { cursor: pointer; transition: background .12s; }
table.records-table tr.data-row:hover td { background: #f7fafc; }
table.records-table tr.data-row:active td { background: #edf2f7; }
.col-truncate { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-valor { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.col-num { white-space: nowrap; font-weight: 600; color: #1a3a6c; }
.risk-badge { cursor: help; margin-left: .35rem; font-size: .85em; }
.badge { display: inline-block; padding: .2rem .55rem; border-radius: 99px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.badge-green  { background: #c6f6d5; color: #276749; }
.badge-red    { background: #fed7d7; color: #9b2c2c; }
.badge-orange { background: #feebc8; color: #7b341e; }
.badge-gray   { background: #e2e8f0; color: #4a5568; }
.badge-blue   { background: #bee3f8; color: #2a4a7f; }
.no-data, .loading-row { text-align: center; color: #a0aec0; padding: 2.5rem; font-size: .875rem; }
.pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; flex-wrap: wrap; gap: .6rem; }
.pagination .info { font-size: .8rem; color: #718096; }
.pagination .controls { display: flex; gap: .5rem; align-items: center; }
.pagination button {
      background: #fff; border: 1px solid #dde3ee; color: #2d3748;
      border-radius: 6px; padding: .4rem .8rem; font-size: .8rem; font-weight: 600; cursor: pointer;
    }
.pagination button:hover:not(:disabled) { background: #f7f9fc; }
.pagination button:disabled { opacity: .45; cursor: not-allowed; }
.pagination .page-label { font-size: .8rem; color: #4a5568; font-weight: 600; white-space: nowrap; }
/* ── Tooltip flutuante ── */
.app-tooltip {
      position: fixed; z-index: 500; background: #1a202c; color: #f7fafc;
      font-size: .74rem; line-height: 1.5; padding: .5rem .7rem; border-radius: 7px;
      max-width: 340px; white-space: pre-line; box-shadow: 0 6px 20px rgba(0,0,0,.28);
      pointer-events: none; opacity: 0; transform: translateY(4px);
      transition: opacity .12s ease, transform .12s ease;
    }
.app-tooltip.show { opacity: 1; transform: none; }
/* ── Modal de detalhes ── */
.modal-backdrop {
      display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 400;
      align-items: center; justify-content: center; animation: fadein .2s ease; padding: 1rem;
    }
.modal-backdrop.open { display: flex; }
.modal {
      background: #fff; border-radius: 14px; box-shadow: 0 8px 32px rgba(0,0,0,.22);
      width: 100%; max-width: 1020px; max-height: 88vh; animation: modalIn .2s ease;
      display: flex; flex-direction: column; overflow: hidden;
    }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(-8px); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.4rem 1.75rem 1rem; flex-shrink: 0; }
.modal-header h3 { font-size: 1.1rem; font-weight: 700; color: #1a1a2e; }
.modal-header .modal-sub { font-size: .82rem; color: #718096; margin-top: .35rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.modal-close {
      background: #f7f9fc; border: none; font-size: 1.05rem; cursor: pointer; color: #718096;
      width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; transition: background .15s, color .15s;
    }
.modal-close:hover { background: #edf2f7; color: #2d3748; }
.modal-stats { padding: 0 1.75rem 1.1rem; flex-shrink: 0; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .65rem; }
@media (max-width: 640px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
.stat-tile {
      background: linear-gradient(160deg, #f7f9fc, #eef2f9); border: 1px solid #e5eaf3; border-radius: 10px;
      padding: .6rem .8rem; transition: transform .15s ease, box-shadow .15s ease;
    }
.stat-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(26,58,108,.1); }
.stat-tile-label { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #8895ab; margin-bottom: .3rem; }
.stat-tile-value { font-size: 1rem; font-weight: 700; color: #1a3a6c; line-height: 1.25; }
.modal-tabs { display: flex; flex-wrap: wrap; gap: .15rem; padding: 0 1.4rem; border-bottom: 1px solid #edf2f7; flex-shrink: 0; }
.modal-tab {
      background: none; border: none; border-radius: 7px 7px 0 0; padding: .6rem .7rem; font-size: .8rem;
      font-weight: 600; color: #8895ab; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
      white-space: nowrap; transition: color .15s ease, background .15s ease, border-color .15s ease;
    }
.modal-tab:hover { color: #4a5568; background: #f7f9fc; }
.modal-tab.active { color: #1a3a6c; border-bottom-color: #1a3a6c; background: none; }
.modal-tab .tab-count { display: inline-block; background: #edf2f7; color: #4a5568; font-size: .68rem; font-weight: 700; padding: .05rem .4rem; border-radius: 99px; margin-left: .25rem; }
.modal-tab.active .tab-count { background: #dbeafe; color: #1a3a6c; }
.modal-body-scroll { padding: 1.25rem 1.75rem 1.75rem; overflow-y: auto; flex: 1; }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadein .15s ease; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .7rem 1.2rem; }
.detail-field dt { font-size: .68rem; color: #a0aec0; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .15rem; }
.detail-field dd { font-size: .875rem; color: #1a1a2e; word-break: break-word; }
.detail-field.full { grid-column: 1 / -1; }
.detail-field dd.objeto-text { display: block; background: #f7f9fc; border: 1px solid #edf2f7; border-radius: 8px; padding: .7rem .85rem; line-height: 1.55; }
.modal-inline-table th { position: static; }
.side-empty { text-align: center; color: #a0aec0; font-size: .85rem; padding: 2.5rem 1rem; line-height: 1.6; }

/* ── Anotações internas ── */
.notes-list { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1.1rem; }
.note-item { background: #f7f9fc; border: 1px solid #edf2f7; border-radius: 10px; padding: .65rem .85rem; }
.note-meta { display: flex; align-items: center; gap: .5rem; font-size: .74rem; color: #718096; margin-bottom: .3rem; }
.note-meta strong { color: #1a3a6c; }
.note-meta .note-delete {
  margin-left: auto; background: none; border: none; color: #a0aec0; cursor: pointer;
  width: 20px; height: 20px; border-radius: 50%; font-size: .7rem; flex-shrink: 0;
}
.note-meta .note-delete:hover { background: #fed7d7; color: #9b2c2c; }
.note-text { font-size: .86rem; color: #1a1a2e; line-height: 1.55; white-space: pre-wrap; }
.note-form { display: flex; flex-direction: column; gap: .5rem; }
.note-form .note-autor, .note-form .note-texto {
  padding: .55rem .75rem; font-size: .84rem; border: 1px solid #dde3ee; border-radius: 8px;
  outline: none; font-family: inherit; resize: vertical;
}
.note-form .note-autor:focus, .note-form .note-texto:focus { border-color: #4a90d9; box-shadow: 0 0 0 3px rgba(74,144,217,.15); }
.note-form button { align-self: flex-end; }
/* ── Aviso de novos dados (auto-refresh) ── */
#toast {
      position: fixed; bottom: 1.5rem; right: 1.5rem; background: #1a3a6c; color: #fff;
      padding: .8rem 1.2rem; border-radius: 8px; font-size: .875rem; font-weight: 500;
      box-shadow: 0 4px 12px rgba(0,0,0,.25); display: none; z-index: 600; max-width: 340px;
      align-items: center; gap: .7rem;
    }
#toast.show { display: flex; animation: fadein .25s ease; }
#toast button {
      background: #fff; color: #1a3a6c; border: none; border-radius: 6px;
      padding: .3rem .7rem; font-size: .8rem; font-weight: 700; cursor: pointer; white-space: nowrap;
    }

/* ── Modo escuro (ativado via [data-theme="dark"] em <html>, alternado pelo botão
   no menu — ver templates/_nav.html) ── Bloco de sobreposição, não uma reescrita
   com variáveis — feito assim de propósito para não arriscar nenhuma regressão
   visual no tema claro já testado. */
:root[data-theme="dark"] body { background: #0e131e; color: #dde3ef; }
:root[data-theme="dark"] .delta-up { color: #57c793; }
:root[data-theme="dark"] .delta-down { color: #e6796c; }
:root[data-theme="dark"] .note-item { background: #1b2333; border-color: #232b3d; }
:root[data-theme="dark"] .note-meta { color: #8b93a6; }
:root[data-theme="dark"] .note-meta strong { color: #dde3ef; }
:root[data-theme="dark"] .note-meta .note-delete { color: #6d7690; }
:root[data-theme="dark"] .note-meta .note-delete:hover { background: #33201d; color: #e6796c; }
:root[data-theme="dark"] .note-text { color: #c5cbda; }
:root[data-theme="dark"] .note-form .note-autor,
:root[data-theme="dark"] .note-form .note-texto { background: #10151f; border-color: #2a3244; color: #dde3ef; }
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .kpi-tile,
:root[data-theme="dark"] .filter-chip,
:root[data-theme="dark"] .filter-clear-all,
:root[data-theme="dark"] .modal,
:root[data-theme="dark"] .btn-export,
:root[data-theme="dark"] .pagination button,
:root[data-theme="dark"] #toast button {
    background: #161d2c;
    color: #dde3ef;
  }
:root[data-theme="dark"] .filter-chip,
:root[data-theme="dark"] .filter-clear-all,
:root[data-theme="dark"] .btn-export,
:root[data-theme="dark"] .pagination button {
    border-color: #2a3244;
  }
:root[data-theme="dark"] .filter-bar { background: #16233d; border-color: #2a4a73; }
:root[data-theme="dark"] .filter-bar-label,
:root[data-theme="dark"] .card .card-hint { color: #7fb1ee; }
:root[data-theme="dark"] .filter-chip { color: #7fb1ee; border-color: #2f5a8c; }
:root[data-theme="dark"] .filter-chip button { background: #2a4a73; color: #cfe3fb; }
:root[data-theme="dark"] .filter-chip button:hover { background: #386ba8; }
:root[data-theme="dark"] .filter-clear-all:hover { background: #1c2a42; border-color: #386ba8; }
:root[data-theme="dark"] .kpi-tile:hover { box-shadow: 0 6px 16px rgba(0,0,0,.4); }
:root[data-theme="dark"] .kpi-label { color: #8b93a6; }
:root[data-theme="dark"] .kpi-value,
:root[data-theme="dark"] .card h2,
:root[data-theme="dark"] .section-title,
:root[data-theme="dark"] .records-count b,
:root[data-theme="dark"] .col-num,
:root[data-theme="dark"] .modal-header h3,
:root[data-theme="dark"] .stat-tile-value,
:root[data-theme="dark"] .modal-tab.active,
:root[data-theme="dark"] .spinner-lg {
    color: #dde3ef;
  }
:root[data-theme="dark"] .spinner-lg { border-color: #2a3244; border-top-color: #dde3ef; }
:root[data-theme="dark"] .kpi-sub,
:root[data-theme="dark"] .card .card-desc,
:root[data-theme="dark"] .chart-empty,
:root[data-theme="dark"] .records-count,
:root[data-theme="dark"] .pagination .info,
:root[data-theme="dark"] .no-data,
:root[data-theme="dark"] .loading-row,
:root[data-theme="dark"] .loading-overlay,
:root[data-theme="dark"] .detail-field dt,
:root[data-theme="dark"] .detail-field dd,
:root[data-theme="dark"] .side-empty,
:root[data-theme="dark"] .modal-header .modal-sub,
:root[data-theme="dark"] .modal-tab {
    color: #8b93a6;
  }
:root[data-theme="dark"] .detail-field dd { color: #c5cbda; }
:root[data-theme="dark"] .card-collapse-btn { background: #1b2333; border-color: #2a3244; color: #a7b0c2; }
:root[data-theme="dark"] .card-collapse-btn:hover { background: #232c40; border-color: #3a4256; }
:root[data-theme="dark"] .records-search input { background: #10151f; border-color: #2a3244; color: #dde3ef; }
:root[data-theme="dark"] .records-search .icon { color: #6d7690; }
:root[data-theme="dark"] table.records-table th { background: #1b2333; color: #a7b0c2; border-bottom-color: #2a3244; }
:root[data-theme="dark"] table.records-table td { border-bottom-color: #232b3d; }
:root[data-theme="dark"] table.records-table tr.data-row:hover td { background: #1c2436; }
:root[data-theme="dark"] table.records-table tr.data-row:active td { background: #232c40; }
:root[data-theme="dark"] .badge-green { background: #123024; color: #6fd6a4; }
:root[data-theme="dark"] .badge-red { background: #33201d; color: #ec9186; }
:root[data-theme="dark"] .badge-orange { background: #3a2a12; color: #e8bb70; }
:root[data-theme="dark"] .badge-gray { background: #232b3d; color: #a7b0c2; }
:root[data-theme="dark"] .badge-blue { background: #1e2a42; color: #86b0f4; }
:root[data-theme="dark"] .modal-close { background: #1b2333; color: #8b93a6; }
:root[data-theme="dark"] .modal-close:hover { background: #232c40; color: #dde3ef; }
:root[data-theme="dark"] .stat-tile { background: linear-gradient(160deg, #1b2333, #171e2c); border-color: #2a3244; }
:root[data-theme="dark"] .stat-tile:hover { box-shadow: 0 6px 14px rgba(0,0,0,.35); }
:root[data-theme="dark"] .stat-tile-label { color: #8b93a6; }
:root[data-theme="dark"] .modal-tabs { border-bottom-color: #232b3d; }
:root[data-theme="dark"] .modal-tab:hover { color: #c5cbda; background: #1b2333; }
:root[data-theme="dark"] .modal-tab.active { border-bottom-color: #7fb1ee; }
:root[data-theme="dark"] .modal-tab .tab-count { background: #232c40; color: #a7b0c2; }
:root[data-theme="dark"] .modal-tab.active .tab-count { background: #1e2a42; color: #86b0f4; }
:root[data-theme="dark"] .detail-field dd.objeto-text { background: #1b2333; border-color: #232b3d; }
:root[data-theme="dark"] .modal-backdrop { background: rgba(0,0,0,.6); }
:root[data-theme="dark"] .card-collapse-btn:hover,
:root[data-theme="dark"] .btn-export:hover,
:root[data-theme="dark"] .pagination button:hover:not(:disabled) {
    background: #1c2436;
  }
:root[data-theme="dark"] .btn-export.btn-primary,
:root[data-theme="dark"] .btn-export.btn-primary:hover {
    background: #2a4a73; border-color: #2a4a73; color: #fff;
  }
:root[data-theme="dark"] .btn-export.btn-primary:hover { background: #386ba8; border-color: #386ba8; }
:root[data-theme="dark"] .inline-form { background: #161d2c; border-color: #232b3d; border-left-color: #7fb1ee; }
:root[data-theme="dark"] .inline-form .form-field { color: #a7b0c2; }
:root[data-theme="dark"] .inline-form .form-field input { background: #10151f; border-color: #2a3244; color: #dde3ef; }
:root[data-theme="dark"] table.modal-inline-table tbody tr:hover td { background: #1c2436; }
