/*
  DG_CORES_GLOBAIS_V3
  Dashboard, Visão Geral, Ordens, Clientes, Produção,
  Colaboradores, Metas, Terceiros, Produtos,
  Portal de Listagens e Painel SaaS.
  Somente cores do tema claro.
*/

html[data-dg-theme="light"] {
  color-scheme: light;

  --dg-v3-bg: #f3f7f3;
  --dg-v3-surface: #ffffff;
  --dg-v3-surface-soft: #eaf1ed;
  --dg-v3-surface-hover: #e1ebe5;

  --dg-v3-text: #102235;
  --dg-v3-text-2: #334b63;
  --dg-v3-muted: #52677b;
  --dg-v3-border: #c3d1dc;

  --dg-v3-green: #8ce000;
  --dg-v3-green-dark: #287d1a;
  --dg-v3-green-text: #102a14;

  --dg-v3-danger: #b91c1c;
  --dg-v3-warning: #d97706;
}

/* Página e estrutura */

html[data-dg-theme="light"] body {
  background: var(--dg-v3-bg) !important;
  color: var(--dg-v3-text) !important;
}

html[data-dg-theme="light"]
:is(
  main,
  .main,
  .content,
  .app,
  .app-area,
  .page,
  .page-content,
  .dg-admin40-shell
) {
  color: var(--dg-v3-text) !important;
}

/* Cabeçalho */

html[data-dg-theme="light"]
:is(
  header,
  .header,
  .app-header,
  .topbar,
  .dg-v5-header
) {
  color: var(--dg-v3-text) !important;
  border-color: var(--dg-v3-border) !important;
}

html[data-dg-theme="light"]
:is(
  header,
  .header,
  .app-header,
  .topbar,
  .dg-v5-header
)
:is(
  h1,
  h2,
  h3,
  strong,
  span,
  label,
  a
) {
  color: var(--dg-v3-text) !important;
}

/* Marca oficial */

html[data-dg-theme="light"]
.dg-global-brand {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  padding: 7px 12px !important;

  background:
    linear-gradient(
      135deg,
      #071828 0%,
      #0b2238 100%
    ) !important;

  border:
    1px solid
    rgba(140, 224, 0, .42) !important;

  border-radius: 12px !important;

  box-shadow:
    0 7px 18px
    rgba(7, 24, 40, .18) !important;
}

html[data-dg-theme="light"]
.dg-global-brand img {
  display: block !important;

  padding: 0 !important;
  margin: 0 !important;

  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;

  opacity: 1 !important;

  filter:
    drop-shadow(
      0 2px 3px
      rgba(0, 0, 0, .25)
    ) !important;

  box-shadow: none !important;
}

/* Login */

html[data-dg-theme="light"]
:is(
  .login-box,
  .login-card,
  .login-panel
) {
  background: var(--dg-v3-surface) !important;
  color: var(--dg-v3-text) !important;
  border: 1px solid var(--dg-v3-border) !important;
}

html[data-dg-theme="light"]
:is(
  .dg-powered-by,
  .subtitle
) {
  color: var(--dg-v3-muted) !important;
}

/* Menu lateral */

html[data-dg-theme="light"]
:is(
  #menu,
  aside,
  .sidebar,
  .side-menu
) {
  color: var(--dg-v3-text-2) !important;
  border-color: var(--dg-v3-border) !important;
}

html[data-dg-theme="light"]
:is(
  #menu,
  aside,
  .sidebar,
  .side-menu
)
:is(
  button,
  a,
  .menu-item,
  .nav-link,
  .dg-v5-monitor-button
) {
  color: #3b536b !important;
  opacity: 1 !important;
}

html[data-dg-theme="light"]
:is(
  #menu,
  aside,
  .sidebar,
  .side-menu
)
:is(
  button,
  a,
  .menu-item,
  .nav-link,
  .dg-v5-monitor-button
)
* {
  color: inherit !important;
  opacity: 1 !important;
}

html[data-dg-theme="light"]
:is(
  #menu,
  aside,
  .sidebar,
  .side-menu
)
:is(
  button:hover,
  a:hover,
  .menu-item:hover,
  .nav-link:hover
) {
  color: var(--dg-v3-text) !important;
  background: rgba(140, 224, 0, .10) !important;
}

html[data-dg-theme="light"]
:is(
  #menu,
  aside,
  .sidebar,
  .side-menu
)
:is(
  .active,
  [aria-current="page"]
) {
  color: var(--dg-v3-text) !important;
  background: rgba(140, 224, 0, .14) !important;
  border-color: #70bd16 !important;
  font-weight: 800 !important;
}

html[data-dg-theme="light"]
:is(
  #menu,
  aside,
  .sidebar,
  .side-menu
)
:is(
  .active,
  [aria-current="page"]
)
* {
  color: var(--dg-v3-text) !important;
  opacity: 1 !important;
}

html[data-dg-theme="light"]
:is(
  .dg-v5-menu-label,
  .dg-v5-monitor-title,
  .menu-title,
  .section-title,
  .group-title
) {
  color: #536a81 !important;
  opacity: 1 !important;
}

/* Títulos e textos */

html[data-dg-theme="light"]
:is(
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  legend,
  .title,
  .page-title,
  .section-title,
  .card-title,
  .panel-title,
  .name,
  .value,
  .number
) {
  color: var(--dg-v3-text) !important;
}

html[data-dg-theme="light"]
:is(
  p,
  small,
  .muted,
  .subtitle,
  .description,
  .hint,
  .empty,
  .meta,
  .timestamp,
  .order-client
) {
  color: var(--dg-v3-muted) !important;
  opacity: 1 !important;
}

/* Cards e painéis gerais */

html[data-dg-theme="light"]
:is(
  .card,
  .panel,
  .tile,
  .column,
  .order,
  .stat,
  .summary-card,
  .table-container,
  .table-wrapper,
  .modal,
  .modal-content,
  .modal-box,
  .dropdown-menu,
  .drawer,
  .history-item,
  .dg-v5-date-card,
  .dg-v5-status,
  .dg-v5-side-panel,
  .dg-v5-quick-action,
  .dg-admin40-card,
  .dg-admin40-panel,
  .dg-ps-card,
  .dg-ps-panel,
  .dg-ps-modal,
  .dg-pl-card,
  .dg-pl-panel,
  .dg-pl-modal
) {
  background: var(--dg-v3-surface) !important;
  color: var(--dg-v3-text) !important;
  border-color: var(--dg-v3-border) !important;
}

html[data-dg-theme="light"]
:is(
  .card,
  .panel,
  .tile,
  .column,
  .order,
  .stat,
  .summary-card,
  .modal,
  .modal-content,
  .modal-box,
  .dg-v5-side-panel,
  .dg-v5-quick-action,
  .dg-admin40-card,
  .dg-admin40-panel,
  .dg-ps-card,
  .dg-ps-panel,
  .dg-ps-modal,
  .dg-pl-card,
  .dg-pl-panel,
  .dg-pl-modal
)
:is(
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  strong,
  label,
  .title,
  .name,
  .value,
  .number
) {
  color: var(--dg-v3-text) !important;
}

html[data-dg-theme="light"]
:is(
  .card,
  .panel,
  .tile,
  .column,
  .order,
  .stat,
  .summary-card,
  .modal,
  .modal-content,
  .modal-box,
  .dg-v5-side-panel,
  .dg-v5-quick-action,
  .dg-admin40-card,
  .dg-admin40-panel,
  .dg-ps-card,
  .dg-ps-panel,
  .dg-ps-modal,
  .dg-pl-card,
  .dg-pl-panel,
  .dg-pl-modal
)
:is(
  p,
  small,
  .muted,
  .subtitle,
  .description,
  .meta,
  .empty
) {
  color: var(--dg-v3-muted) !important;
}

/* Formulários e cadastro de clientes */

html[data-dg-theme="light"]
:is(
  label,
  legend,
  .form-label,
  .field-label
) {
  color: var(--dg-v3-text-2) !important;
  opacity: 1 !important;
}

html[data-dg-theme="light"]
:is(
  input,
  select,
  textarea
) {
  background: #ffffff !important;
  color: var(--dg-v3-text) !important;
  border-color: #9fb1c2 !important;
  caret-color: var(--dg-v3-text) !important;
}

html[data-dg-theme="light"]
:is(
  input,
  textarea
)::placeholder {
  color: #667b91 !important;
  opacity: 1 !important;
}

html[data-dg-theme="light"]
:is(
  input,
  select,
  textarea
):focus {
  color: var(--dg-v3-text) !important;
  background: #ffffff !important;
  border-color: var(--dg-v3-green-dark) !important;

  outline:
    3px solid
    rgba(40, 125, 26, .16) !important;
}

/* Cadastro e histórico de clientes */

html[data-dg-theme="light"]
:is(
  .top-actions,
  .client-card,
  .cliente-card,
  .form-card,
  .customer-form,
  .history-list,
  .historico-lista
) {
  color: var(--dg-v3-text) !important;
}

html[data-dg-theme="light"]
.badge-active {
  background: #dcfce7 !important;
  color: #14532d !important;
  border-color: #86d89f !important;
}

html[data-dg-theme="light"]
.badge-inactive {
  background: #fee2e2 !important;
  color: #7f1d1d !important;
  border-color: #f3a5a5 !important;
}

/* Tabelas */

html[data-dg-theme="light"] table {
  background: var(--dg-v3-surface) !important;
  color: var(--dg-v3-text) !important;
  border-color: var(--dg-v3-border) !important;
}

html[data-dg-theme="light"] thead,
html[data-dg-theme="light"] th {
  background: #e3ebf2 !important;
  color: #243b52 !important;
  border-color: var(--dg-v3-border) !important;
}

html[data-dg-theme="light"] tbody,
html[data-dg-theme="light"] td {
  color: var(--dg-v3-text-2) !important;
  border-color: #d4dfe7 !important;
}

html[data-dg-theme="light"]
tbody tr:hover {
  background: #edf3ef !important;
}

/* Botões */

html[data-dg-theme="light"]
:is(
  .primary,
  .btn-primary,
  .dg-btn-primary,
  button[type="submit"]
) {
  background: var(--dg-v3-green) !important;
  color: var(--dg-v3-green-text) !important;
  border-color: #6ebd12 !important;
  font-weight: 800 !important;
}

html[data-dg-theme="light"]
:is(
  .primary,
  .btn-primary,
  .dg-btn-primary,
  button[type="submit"]
)
* {
  color: inherit !important;
}

html[data-dg-theme="light"]
:is(
  .primary,
  .btn-primary,
  .dg-btn-primary,
  button[type="submit"]
):hover {
  background: #76c91a !important;
  color: #0d2511 !important;
}

html[data-dg-theme="light"]
:is(
  .secondary,
  .btn-secondary,
  .dg-btn-secondary
) {
  background: #e4ebf1 !important;
  color: #243b52 !important;
  border-color: #9fb1c2 !important;
}

html[data-dg-theme="light"]
:is(
  .danger,
  .btn-danger,
  .dg-btn-danger
) {
  background: var(--dg-v3-danger) !important;
  color: #ffffff !important;
  border-color: #991b1b !important;
}

html[data-dg-theme="light"]
:is(
  .warning,
  .btn-warning,
  .dg-btn-warning
) {
  background: #f59e0b !important;
  color: #2b1b00 !important;
  border-color: #c66b05 !important;
}

html[data-dg-theme="light"]
button:disabled,
html[data-dg-theme="light"]
:is(
  .disabled,
  [aria-disabled="true"]
) {
  background: #d9e0e6 !important;
  color: #657487 !important;
  border-color: #c2ccd5 !important;
  opacity: 1 !important;
}

/* Abas, filtros e paginação */

html[data-dg-theme="light"]
:is(
  .tab,
  .tabs,
  .toolbar,
  .filter,
  .filters,
  .pagination,
  .breadcrumb
)
:is(
  a,
  button,
  span,
  strong
) {
  color: #334b63 !important;
  opacity: 1 !important;
}

/* Barras de progresso */

html[data-dg-theme="light"]
:is(
  .progress,
  .progress-track,
  .dg2-track
) {
  background: #dbe3e9 !important;
}

html[data-dg-theme="light"]
:is(
  .progress-fill,
  .dg2-fill
) {
  background: var(--dg-v3-green-dark) !important;
}

/* Produtos e Serviços */

html[data-dg-theme="light"]
:is(
  #produtos-servicos,
  .dg-ps-root,
  .dg-ps-view,
  .dg-ps-list,
  .dg-ps-form
) {
  color: var(--dg-v3-text) !important;
}

html[data-dg-theme="light"]
:is(
  .dg-ps-header,
  .dg-ps-toolbar,
  .dg-ps-filters,
  .dg-ps-modal-header
) {
  color: var(--dg-v3-text) !important;
  border-color: var(--dg-v3-border) !important;
}

/* Portal de Listagens */

html[data-dg-theme="light"]
:is(
  #portal-listagens,
  .dg-pl-root,
  .dg-pl-view,
  .dg-pl-detail,
  .dg-pl-reference-grid
) {
  color: var(--dg-v3-text) !important;
}

html[data-dg-theme="light"]
:is(
  #portal-listagens .dg-pl-header,
  #portal-listagens .dg-pl-filters,
  .dg-pl-modal-header,
  .dg-pl-detail-top
) {
  color: var(--dg-v3-text) !important;
  background: var(--dg-v3-surface) !important;
  border-color: var(--dg-v3-border) !important;
}

/* Produção */

html[data-dg-theme="light"]
:is(
  .dg-admin40-shell,
  .dg-admin40-top,
  .dg-admin40-overview,
  .dg-admin40-viewport,
  .dg-admin40-toolbar-wrap
) {
  color: var(--dg-v3-text) !important;
}

html[data-dg-theme="light"]
:is(
  .dg-admin40-card,
  .dg-admin40-panel
)
:is(
  h1,
  h2,
  h3,
  h4,
  strong,
  span,
  p,
  small
) {
  color: inherit !important;
  opacity: 1 !important;
}

/* Mensagens semânticas */

html[data-dg-theme="light"]
:is(
  .success,
  .completed,
  .concluido,
  .badge-success
) {
  color: #166534 !important;
}

html[data-dg-theme="light"]
:is(
  .error,
  .danger-text,
  .atrasado,
  .badge-danger
) {
  color: #991b1b !important;
}

html[data-dg-theme="light"]
:is(
  .attention,
  .warning-text,
  .badge-warning
) {
  color: #854d0e !important;
}

/*
  Visão Geral aprovada:
  mantém os cards azul-marinho no tema claro.
*/

html[data-dg-theme="light"]
#dg-overview-oficial
:is(
  .dg-vg-card,
  .dg-vg-panel
) {
  background:
    linear-gradient(
      135deg,
      #102541 0%,
      #0b1c34 100%
    ) !important;

  color: #f7fbff !important;

  border-color:
    rgba(255, 255, 255, .14) !important;
}

html[data-dg-theme="light"]
#dg-overview-oficial
:is(
  .dg-vg-card,
  .dg-vg-panel
)
:is(
  h1,
  h2,
  h3,
  h4,
  strong,
  .title,
  .value,
  .number
) {
  color: #ffffff !important;
}

html[data-dg-theme="light"]
#dg-overview-oficial
:is(
  .dg-vg-card,
  .dg-vg-panel
)
:is(
  p,
  span,
  small,
  .subtitle,
  .description,
  .muted,
  .dg-vg-note
) {
  color: #d2e0ee !important;
}

html[data-dg-theme="light"]
#dg-overview-oficial
:is(
  .dg-vg-kpis > div,
  .dg-vg-activity
) {
  background:
    rgba(255, 255, 255, .08) !important;

  color: #f7fbff !important;

  border-color:
    rgba(255, 255, 255, .16) !important;
}

html[data-dg-theme="light"]
#dg-overview-oficial
:is(
  .dg-vg-kpis > div,
  .dg-vg-activity
)
:is(
  strong,
  span
) {
  color: #ffffff !important;
}

html[data-dg-theme="light"]
#dg-overview-oficial
:is(
  .dg-vg-kpis > div,
  .dg-vg-activity
)
small {
  color: #bed0e1 !important;
}

/* DG_BOTOES_ESCUROS_TEXTO_BRANCO_V1 */

html[data-dg-theme="light"]
.dg-v3-dark-button {
  color: #ffffff !important;
  opacity: 1 !important;
}

html[data-dg-theme="light"]
.dg-v3-dark-button
:is(
  span,
  strong,
  small,
  label,
  i,
  b,
  em
) {
  color: #ffffff !important;
  opacity: 1 !important;
}

html[data-dg-theme="light"]
.dg-v3-dark-button
:is(
  svg,
  svg *,
  path,
  circle,
  rect,
  line,
  polyline,
  polygon
) {
  color: #ffffff !important;
  fill: currentColor !important;
  stroke: currentColor !important;
  opacity: 1 !important;
}

/* Classes conhecidas de botões escuros */

html[data-dg-theme="light"]
:is(
  .btn-dark,
  .button-dark,
  .dark-button,
  [data-variant="dark"],
  [data-color="dark"]
) {
  color: #ffffff !important;
}

html[data-dg-theme="light"]
:is(
  .btn-dark,
  .button-dark,
  .dark-button,
  [data-variant="dark"],
  [data-color="dark"]
)
* {
  color: #ffffff !important;
  opacity: 1 !important;
}

/* DG_TERCEIROS_CONTRASTE_CLARO_V1 */

html[data-dg-theme="light"]
:is(
  #terceiros,
  [data-view="terceiros"],
  .terceiros-view,
  .third-party-view,
  .controle-terceiros
) {
  color: #102235 !important;
}

/* Título e subtítulo */

html[data-dg-theme="light"]
:is(
  #terceiros,
  [data-view="terceiros"],
  .terceiros-view,
  .third-party-view,
  .controle-terceiros
)
:is(
  h1,
  h2,
  h3,
  h4,
  .title,
  .page-title,
  .section-title
) {
  color: #102235 !important;
  opacity: 1 !important;
}

html[data-dg-theme="light"]
:is(
  #terceiros,
  [data-view="terceiros"],
  .terceiros-view,
  .third-party-view,
  .controle-terceiros
)
:is(
  p,
  small,
  .subtitle,
  .description,
  .muted
) {
  color: #334b63 !important;
  opacity: 1 !important;
}

/* Cards do topo */

html[data-dg-theme="light"]
:is(
  #terceiros,
  [data-view="terceiros"],
  .terceiros-view,
  .third-party-view,
  .controle-terceiros
)
:is(
  .card,
  .summary-card,
  .stat-card,
  .kpi-card,
  .metric-card
) {
  color: #f8fbff !important;
}

html[data-dg-theme="light"]
:is(
  #terceiros,
  [data-view="terceiros"],
  .terceiros-view,
  .third-party-view,
  .controle-terceiros
)
:is(
  .card,
  .summary-card,
  .stat-card,
  .kpi-card,
  .metric-card
)
:is(
  h3,
  h4,
  h5,
  .label,
  .title,
  .card-title,
  .metric-label
) {
  color: #b8cbe0 !important;
  opacity: 1 !important;
}

html[data-dg-theme="light"]
:is(
  #terceiros,
  [data-view="terceiros"],
  .terceiros-view,
  .third-party-view,
  .controle-terceiros
)
:is(
  .card,
  .summary-card,
  .stat-card,
  .kpi-card,
  .metric-card
)
:is(
  .value,
  .number,
  .total,
  strong
) {
  color: #ffffff !important;
  opacity: 1 !important;
}

/* Botão escuro cadastrar terceiro */

html[data-dg-theme="light"]
:is(
  #terceiros,
  [data-view="terceiros"],
  .terceiros-view,
  .third-party-view,
  .controle-terceiros
)
:is(
  .btn-dark,
  .button-dark,
  .btn-secondary,
  .secondary-action,
  .terceiros-add-button,
  button[disabled],
  button:disabled
) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: .90 !important;
}

html[data-dg-theme="light"]
:is(
  #terceiros,
  [data-view="terceiros"],
  .terceiros-view,
  .third-party-view,
  .controle-terceiros
)
:is(
  .btn-dark,
  .button-dark,
  .btn-secondary,
  .secondary-action,
  .terceiros-add-button,
  button[disabled],
  button:disabled
)
* {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}

/* Tabela */

html[data-dg-theme="light"]
:is(
  #terceiros,
  [data-view="terceiros"],
  .terceiros-view,
  .third-party-view,
  .controle-terceiros
)
table {
  color: #102235 !important;
}

html[data-dg-theme="light"]
:is(
  #terceiros,
  [data-view="terceiros"],
  .terceiros-view,
  .third-party-view,
  .controle-terceiros
)
thead th {
  color: #17324d !important;
  background: #dbe5ee !important;
}

html[data-dg-theme="light"]
:is(
  #terceiros,
  [data-view="terceiros"],
  .terceiros-view,
  .third-party-view,
  .controle-terceiros
)
tbody td {
  color: #26415d !important;
  opacity: 1 !important;
}

html[data-dg-theme="light"]
:is(
  #terceiros,
  [data-view="terceiros"],
  .terceiros-view,
  .third-party-view,
  .controle-terceiros
)
tbody td strong {
  color: #102235 !important;
}

/* Status tipo "Retornado" */

html[data-dg-theme="light"]
:is(
  #terceiros,
  [data-view="terceiros"],
  .terceiros-view,
  .third-party-view,
  .controle-terceiros
)
:is(
  .status,
  .badge,
  .chip,
  .tag,
  .pill
) {
  color: #ffffff !important;
  background: #425a78 !important;
  border-color: #344a64 !important;
  opacity: 1 !important;
}

html[data-dg-theme="light"]
:is(
  #terceiros,
  [data-view="terceiros"],
  .terceiros-view,
  .third-party-view,
  .controle-terceiros
)
:is(
  .status,
  .badge,
  .chip,
  .tag,
  .pill
)
* {
  color: #ffffff !important;
  opacity: 1 !important;
}

/* DG_CONTRASTE_RESTANTE_CLARO_V1 */

/* ==========================================================
   ORDENS DE SERVIÇO
   ========================================================== */

html[data-dg-theme="light"]
:is(
  #ordens,
  #ordens-servico,
  [data-view="ordens"],
  [data-view="ordens-servico"],
  .ordens-view,
  .orders-view
)
:is(
  input[type="search"],
  input[placeholder*="Buscar"],
  input[placeholder*="OS"],
  input[placeholder*="cliente"]
) {
  background: #0d1d35 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: #2b4666 !important;
}

html[data-dg-theme="light"]
:is(
  #ordens,
  #ordens-servico,
  [data-view="ordens"],
  [data-view="ordens-servico"],
  .ordens-view,
  .orders-view
)
:is(
  input[type="search"],
  input[placeholder*="Buscar"],
  input[placeholder*="OS"],
  input[placeholder*="cliente"]
)::placeholder {
  color: #c3d4e7 !important;
  -webkit-text-fill-color: #c3d4e7 !important;
  opacity: 1 !important;
}

/* Botões escuros habilitados e desabilitados */

html[data-dg-theme="light"]
:is(
  #ordens,
  #ordens-servico,
  [data-view="ordens"],
  [data-view="ordens-servico"],
  .ordens-view,
  .orders-view
)
:is(
  .secondary,
  .btn-secondary,
  .btn-dark,
  .button-dark,
  button:disabled,
  button[disabled]
) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: .88 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25) !important;
}

html[data-dg-theme="light"]
:is(
  #ordens,
  #ordens-servico,
  [data-view="ordens"],
  [data-view="ordens-servico"],
  .ordens-view,
  .orders-view
)
:is(
  .secondary,
  .btn-secondary,
  .btn-dark,
  .button-dark,
  button:disabled,
  button[disabled]
)
* {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}

/* Status das ordens */

html[data-dg-theme="light"]
:is(
  #ordens,
  #ordens-servico,
  [data-view="ordens"],
  [data-view="ordens-servico"],
  .ordens-view,
  .orders-view
)
:is(
  .badge,
  .status,
  .chip,
  .tag,
  .pill
) {
  background: #3d506a !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: #526782 !important;
  opacity: 1 !important;
}

html[data-dg-theme="light"]
:is(
  #ordens,
  #ordens-servico,
  [data-view="ordens"],
  [data-view="ordens-servico"],
  .ordens-view,
  .orders-view
)
:is(
  .badge,
  .status,
  .chip,
  .tag,
  .pill
)
* {
  color: #ffffff !important;
  opacity: 1 !important;
}

/* Botões de histórico */

html[data-dg-theme="light"]
:is(
  #ordens,
  #ordens-servico,
  [data-view="ordens"],
  [data-view="ordens-servico"],
  .ordens-view,
  .orders-view
)
:is(
  .order-actions button,
  .history-button,
  .btn-history
) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* ==========================================================
   METAS
   ========================================================== */

html[data-dg-theme="light"]
:is(
  #metas,
  [data-view="metas"],
  .metas-view,
  .goals-view
)
:is(
  .panel,
  .card,
  .empty,
  .empty-state,
  .no-data,
  .no-results
) {
  color: #e7f0fa !important;
}

html[data-dg-theme="light"]
:is(
  #metas,
  [data-view="metas"],
  .metas-view,
  .goals-view
)
:is(
  .panel,
  .card,
  .empty,
  .empty-state,
  .no-data,
  .no-results
)
:is(
  p,
  span,
  small,
  strong,
  h2,
  h3,
  h4
) {
  color: #e7f0fa !important;
  -webkit-text-fill-color: #e7f0fa !important;
  opacity: 1 !important;
}

/* ==========================================================
   PORTAL DE LISTAGENS
   ========================================================== */

/* Cards de indicadores: Total, Página e Exibido */

html[data-dg-theme="light"]
#portal-listagens
:is(
  .dg-pl-summary,
  .dg-pl-summary-grid,
  .dg-pl-summary-card,
  .dg-pl-stats,
  .dg-pl-stats-grid,
  .dg-pl-stat,
  .dg-pl-stat-card,
  .dg-pl-metrics,
  .dg-pl-metric,
  .dg-pl-metric-card,
  .summary,
  .summary-card,
  .stats,
  .stat,
  .metric
) {
  color: #ffffff !important;
}

html[data-dg-theme="light"]
#portal-listagens
:is(
  .dg-pl-summary,
  .dg-pl-summary-grid,
  .dg-pl-summary-card,
  .dg-pl-stats,
  .dg-pl-stats-grid,
  .dg-pl-stat,
  .dg-pl-stat-card,
  .dg-pl-metrics,
  .dg-pl-metric,
  .dg-pl-metric-card,
  .summary,
  .summary-card,
  .stats,
  .stat,
  .metric
)
:is(
  span,
  small,
  p,
  label,
  .label,
  .title,
  .name
) {
  color: #bcd0e5 !important;
  -webkit-text-fill-color: #bcd0e5 !important;
  opacity: 1 !important;
}

html[data-dg-theme="light"]
#portal-listagens
:is(
  .dg-pl-summary,
  .dg-pl-summary-grid,
  .dg-pl-summary-card,
  .dg-pl-stats,
  .dg-pl-stats-grid,
  .dg-pl-stat,
  .dg-pl-stat-card,
  .dg-pl-metrics,
  .dg-pl-metric,
  .dg-pl-metric-card,
  .summary,
  .summary-card,
  .stats,
  .stat,
  .metric
)
:is(
  strong,
  .value,
  .number,
  .total,
  .count
) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}

/* Paginação do Portal */

html[data-dg-theme="light"]
#portal-listagens
:is(
  .pagination,
  .dg-pl-pagination,
  .pagination-info,
  .dg-pl-pagination-info,
  .page-info
) {
  color: #d7e5f3 !important;
  -webkit-text-fill-color: #d7e5f3 !important;
  opacity: 1 !important;
}

html[data-dg-theme="light"]
#portal-listagens
:is(
  .pagination,
  .dg-pl-pagination
)
:is(
  button,
  a
) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}

/* Inputs escuros do Portal */

html[data-dg-theme="light"]
#portal-listagens
:is(
  input,
  select,
  textarea
) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-dg-theme="light"]
#portal-listagens
input::placeholder {
  color: #bcd0e5 !important;
  -webkit-text-fill-color: #bcd0e5 !important;
  opacity: 1 !important;
}

/* Status do Portal */

html[data-dg-theme="light"]
#portal-listagens
:is(
  .badge,
  .status,
  .chip,
  .tag,
  .pill
) {
  color: #334b63 !important;
  -webkit-text-fill-color: #334b63 !important;
  opacity: 1 !important;
}

/* ==========================================================
   PRESERVAR BOTÕES VERDES
   ========================================================== */

html[data-dg-theme="light"]
:is(
  #ordens,
  #ordens-servico,
  #metas,
  #portal-listagens,
  [data-view="ordens"],
  [data-view="ordens-servico"],
  [data-view="metas"]
)
:is(
  .primary,
  .btn-primary,
  .dg-btn-primary
) {
  color: #17351a !important;
  -webkit-text-fill-color: #17351a !important;
}

html[data-dg-theme="light"]
:is(
  #ordens,
  #ordens-servico,
  #metas,
  #portal-listagens,
  [data-view="ordens"],
  [data-view="ordens-servico"],
  [data-view="metas"]
)
:is(
  .primary,
  .btn-primary,
  .dg-btn-primary
)
* {
  color: #17351a !important;
  -webkit-text-fill-color: #17351a !important;
}

/* DG_BOTOES_CINZA_TEMA_CLARO_V1 */

/*
  Padronização global dos botões no Dashboard quando o tema estiver claro.
  Escopo: Dashboard.
  Não altera TV.
*/

html[data-dg-theme="light"] body :is(
  button,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  .btn,
  .dg-btn,
  .action-btn,
  .button,
  [class*="btn-"],
  [class^="btn"],
  [class*=" button"],
  [class^="button"]
):not(.tv-fullscreen-btn):not(.tv-screen-btn):not(.tv-control-btn) {
  background: linear-gradient(135deg, #49566c 0%, #5c6a80 100%) !important;
  color: #ffffff !important;
  border: 1px solid #445066 !important;
  box-shadow: 0 8px 18px rgba(18, 34, 53, 0.16) !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

html[data-dg-theme="light"] body :is(
  button,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  .btn,
  .dg-btn,
  .action-btn,
  .button,
  [class*="btn-"],
  [class^="btn"],
  [class*=" button"],
  [class^="button"]
):not(.tv-fullscreen-btn):not(.tv-screen-btn):not(.tv-control-btn):hover {
  background: linear-gradient(135deg, #55647b 0%, #67778d 100%) !important;
  color: #ffffff !important;
  border-color: #4d5b71 !important;
}

html[data-dg-theme="light"] body :is(
  button,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  .btn,
  .dg-btn,
  .action-btn,
  .button,
  [class*="btn-"],
  [class^="btn"],
  [class*=" button"],
  [class^="button"]
):not(.tv-fullscreen-btn):not(.tv-screen-btn):not(.tv-control-btn):focus,
html[data-dg-theme="light"] body :is(
  button,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  .btn,
  .dg-btn,
  .action-btn,
  .button,
  [class*="btn-"],
  [class^="btn"],
  [class*=" button"],
  [class^="button"]
):not(.tv-fullscreen-btn):not(.tv-screen-btn):not(.tv-control-btn):active {
  background: linear-gradient(135deg, #435066 0%, #56657b 100%) !important;
  color: #ffffff !important;
  border-color: #3e4b60 !important;
  outline: none !important;
}

html[data-dg-theme="light"] body :is(
  button,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  .btn,
  .dg-btn,
  .action-btn,
  .button,
  [class*="btn-"],
  [class^="btn"],
  [class*=" button"],
  [class^="button"]
):not(.tv-fullscreen-btn):not(.tv-screen-btn):not(.tv-control-btn):disabled,
html[data-dg-theme="light"] body :is(
  .disabled,
  [aria-disabled="true"]
) {
  background: linear-gradient(135deg, #8a94a3 0%, #9ca5b1 100%) !important;
  color: #ffffff !important;
  border-color: #7f8998 !important;
  opacity: .78 !important;
}

html[data-dg-theme="light"] body :is(
  button,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  .btn,
  .dg-btn,
  .action-btn,
  .button,
  [class*="btn-"],
  [class^="btn"],
  [class*=" button"],
  [class^="button"]
):not(.tv-fullscreen-btn):not(.tv-screen-btn):not(.tv-control-btn) :is(
  span,
  strong,
  small,
  i,
  svg
) {
  color: #ffffff !important;
  fill: currentColor !important;
  stroke: currentColor !important;
}

/* Garantia extra para textos de botões mais comuns do dashboard */

html[data-dg-theme="light"] body :is(
  .btn-primary,
  .btn-secondary,
  .btn-dark,
  .btn-outline,
  .btn-outline-primary,
  .btn-outline-secondary
) {
  color: #ffffff !important;
}

/* Links estilizados como botão */

html[data-dg-theme="light"] body a.btn,
html[data-dg-theme="light"] body a.button {
  color: #ffffff !important;
}

/* ============================================================
   DG_FASE5_TRACK_ESCURO_NEUTRO_V1
   O trilho permanece neutro; somente o fill representa progresso.
   ============================================================ */

html[data-dg-theme="dark"]
:is(
    .progress-track,
    .dg2-track,
    .dg5-primary-track
) {
    background: rgba(148, 163, 184, 0.22) !important;
    overflow: hidden !important;
}

html[data-dg-theme="dark"]
:is(
    .progress-fill,
    .dg2-fill,
    .dg5-progress-fill
) {
    background: var(--dg-v3-green-dark, #22c55e) !important;
}

/* DG_FASE5_TRACK_ESCURO_NEUTRO_V1 — END */
