/*
  DG_CONTRASTE_CLARO_GLOBAL_V2
  Aplicação: Dashboard completo e TV da Produção.
  O tema escuro não é alterado.
*/

html[data-dg-theme="light"] {
  --dg-text: #102235;
  --dg-text-muted: #52677b;
  --dg-border: #c6d3df;
  --dg-surface: #ffffff;
  --dg-surface-secondary: #edf3f7;
  --dg-table-header: #e3ebf2;
  --dg-input: #ffffff;
}

/* Estrutura principal */

html[data-dg-theme="light"] body,
html[data-dg-theme="light"] main,
html[data-dg-theme="light"] header,
html[data-dg-theme="light"] aside,
html[data-dg-theme="light"] nav,
html[data-dg-theme="light"] section,
html[data-dg-theme="light"] form {
  color: #102235 !important;
}

/* Títulos e valores principais */

html[data-dg-theme="light"]
:is(
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  legend,
  .title,
  .page-title,
  .section-title,
  .card-title,
  .panel-title,
  .screen-title,
  .tv-title,
  .sector-name,
  .setor-nome,
  .timer,
  .clock,
  .countdown,
  .progress-value,
  .progress-number
) {
  color: #102235 !important;
}

/* Textos auxiliares */

html[data-dg-theme="light"]
:is(
  p,
  small,
  .subtitle,
  .description,
  .muted,
  .hint,
  .timestamp,
  .updated-at,
  .screen-subtitle,
  .tv-subtitle
) {
  color: #52677b !important;
}

/* Cabeçalho */

html[data-dg-theme="light"]
header
:is(
  span,
  p,
  small,
  strong,
  label,
  a
) {
  color: #243b52 !important;
}

/* Sidebar e menus */

html[data-dg-theme="light"]
:is(
  aside,
  .sidebar,
  .side-menu,
  #menu
)
:is(
  a,
  button,
  span,
  strong,
  small
) {
  color: #486078 !important;
}

html[data-dg-theme="light"]
:is(
  aside,
  .sidebar,
  .side-menu,
  #menu
)
:is(
  .active,
  [aria-current="page"]
) {
  color: #102235 !important;
  font-weight: 800 !important;
}

/* Cards, painéis, tabelas e modais do Dashboard */

html[data-dg-theme="light"]
:is(
  .card,
  .panel,
  .tile,
  .summary-card,
  .stat,
  .modal-content,
  .modal-box,
  .dropdown-menu,
  .table-container,
  .table-wrapper
) {
  color: #102235 !important;
  background: #ffffff !important;
  border-color: #c6d3df !important;
}

html[data-dg-theme="light"]
:is(
  .card,
  .panel,
  .tile,
  .summary-card,
  .stat,
  .modal-content,
  .modal-box,
  .dropdown-menu,
  .table-container,
  .table-wrapper
)
:is(
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  strong,
  label,
  .title,
  .value,
  .number,
  .name
) {
  color: #102235 !important;
}

html[data-dg-theme="light"]
:is(
  .card,
  .panel,
  .tile,
  .summary-card,
  .stat,
  .modal-content,
  .modal-box,
  .dropdown-menu,
  .table-container,
  .table-wrapper
)
:is(
  p,
  small,
  .subtitle,
  .description,
  .muted,
  .meta
) {
  color: #52677b !important;
}

/* Formulários */

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

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

html[data-dg-theme="light"]
:is(
  label,
  legend
) {
  color: #243b52 !important;
}

/* Tabelas */

html[data-dg-theme="light"] table {
  color: #102235 !important;
  background: #ffffff !important;
}

html[data-dg-theme="light"] th {
  color: #102235 !important;
  background: #e3ebf2 !important;
}

html[data-dg-theme="light"] td {
  color: #243b52 !important;
}

/* Paginação, filtros e abas */

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

/* TV — cards dos setores e ranking */

html[data-dg-theme="light"]
:is(
  .tv-card,
  .screen-card,
  .sector-card,
  .setor-card,
  .ranking-item,
  .ranking-row,
  .slide-card
) {
  color: #102235 !important;
  background: #ffffff !important;
  border-color: #c6d3df !important;
}

html[data-dg-theme="light"]
:is(
  .tv-card,
  .screen-card,
  .sector-card,
  .setor-card,
  .ranking-item,
  .ranking-row,
  .slide-card
)
:is(
  h1,
  h2,
  h3,
  h4,
  strong,
  .title,
  .name,
  .value,
  .number,
  .percentage,
  .percentual,
  .sector-name,
  .setor-nome
) {
  color: #102235 !important;
}

html[data-dg-theme="light"]
:is(
  .tv-card,
  .screen-card,
  .sector-card,
  .setor-card,
  .ranking-item,
  .ranking-row,
  .slide-card
)
:is(
  p,
  small,
  .subtitle,
  .description,
  .meta,
  .quantity,
  .quantidade
) {
  color: #52677b !important;
}

/* TV — cabeçalho, rodapé, relógio e informações */

html[data-dg-theme="light"]
:is(
  .tv-header,
  .screen-header,
  .topbar,
  .tv-footer,
  .screen-footer
) {
  color: #102235 !important;
}

html[data-dg-theme="light"]
:is(
  .tv-header,
  .screen-header,
  .topbar,
  .tv-footer,
  .screen-footer
)
:is(
  h1,
  h2,
  h3,
  strong,
  span,
  p,
  small
) {
  color: #102235 !important;
}

/* Visão Geral oficial:
   seus cards continuam azul-escuros,
   mas os textos ficam claros e legíveis. */

html[data-dg-theme="light"]
#dg-overview-oficial
:is(
  .dg-vg-card,
  .dg-vg-panel
) {
  color: #f7fbff !important;
  background:
    linear-gradient(
      135deg,
      #102541 0%,
      #0b1c34 100%
    ) !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
) {
  color: #f7fbff !important;
  background:
    rgba(255, 255, 255, .07) !important;
  border-color:
    rgba(255, 255, 255, .14) !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;
}

/* Mantém cores semânticas de alertas */

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

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

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

/* DG_LOGO_TEMA_CLARO_V1 */

/*
  Preserva integralmente a logomarca oficial.
  No tema claro, cria apenas uma base de contraste.
*/

/* Logo no cabeçalho do Dashboard */

html[data-dg-theme="light"]
:is(
  header,
  .header,
  .topbar,
  .app-header
)
:is(
  .logo,
  .brand,
  .brand-logo,
  .header-logo,
  .logo-container
) {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 7px 12px;

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

  border:
    1px solid
    rgba(86, 229, 45, .28) !important;

  border-radius: 12px;

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

/* Imagem oficial dentro do cabeçalho */

html[data-dg-theme="light"]
:is(
  header,
  .header,
  .topbar,
  .app-header
)
:is(
  .logo img,
  .brand img,
  .brand-logo img,
  .header-logo img,
  .logo-container img,
  img[alt*="DG SPORTS"],
  img[alt*="DG Sports"],
  img[src*="logo"]
) {
  opacity: 1 !important;

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

/* Logo no cabeçalho da TV */

html[data-dg-theme="light"]
:is(
  .tv-header,
  .screen-header,
  .tv-topbar,
  .screen-topbar
)
:is(
  .logo,
  .brand,
  .brand-logo,
  .tv-logo,
  .logo-container
) {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 8px 14px;

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

  border:
    1px solid
    rgba(86, 229, 45, .30) !important;

  border-radius: 13px;

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

html[data-dg-theme="light"]
:is(
  .tv-header,
  .screen-header,
  .tv-topbar,
  .screen-topbar
)
:is(
  .logo img,
  .brand img,
  .brand-logo img,
  .tv-logo img,
  .logo-container img,
  img[alt*="DG SPORTS"],
  img[alt*="DG Sports"],
  img[src*="logo"]
) {
  opacity: 1 !important;

  filter:
    drop-shadow(
      0 2px 4px
      rgba(0, 0, 0, .30)
    ) !important;
}

/*
  Segurança adicional para páginas cuja logo
  seja uma imagem direta no cabeçalho.
*/

html[data-dg-theme="light"]
header > img[src*="logo"],
html[data-dg-theme="light"]
.tv-header > img[src*="logo"],
html[data-dg-theme="light"]
.screen-header > img[src*="logo"] {
  box-sizing: content-box;

  padding: 7px 12px;

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

  border:
    1px solid
    rgba(86, 229, 45, .28) !important;

  border-radius: 12px;

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

  opacity: 1 !important;

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

/* Não modificar o selo laranja DG SPORTS da TV */

html[data-dg-theme="light"]
:is(
  .company-badge,
  .empresa-badge,
  .dg-sports-badge,
  .badge-company
) {
  background: #ff9700 !important;
  color: #ffffff !important;
  filter: none !important;
}

/* DG_FIX_FINAL_CLARO_LOGO_MENU_V1 */

/*
  LOGOMARCA OFICIAL
  A imagem não é invertida, recolorida ou redesenhada.
  Apenas recebe uma base escura no tema claro.
*/

html[data-dg-theme="light"]
header img:first-of-type,
html[data-dg-theme="light"]
header img[src*="logo"],
html[data-dg-theme="light"]
header img[alt*="DG"],
html[data-dg-theme="light"]
:is(
  .logo,
  .brand,
  .brand-logo,
  .header-logo,
  .tv-logo
) img {
  box-sizing: content-box !important;

  padding: 8px 13px !important;

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

  border:
    1px solid
    rgba(103, 240, 55, .32) !important;

  border-radius: 12px !important;

  opacity: 1 !important;

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

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

/*
  Quando a logo estiver dentro de um contêiner próprio,
  a base é aplicada também ao contêiner.
*/

html[data-dg-theme="light"]
header
:is(
  .logo,
  .brand,
  .brand-logo,
  .header-logo,
  .logo-container,
  .tv-logo
) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

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

  border:
    1px solid
    rgba(103, 240, 55, .32) !important;

  border-radius: 12px !important;

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

/*
  Evita aplicação dupla de espaço quando
  o contêiner já recebeu a base.
*/

html[data-dg-theme="light"]
header
:is(
  .logo,
  .brand,
  .brand-logo,
  .header-logo,
  .logo-container,
  .tv-logo
)
img {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* MENU LATERAL — maior contraste no tema claro */

html[data-dg-theme="light"]
:is(
  aside,
  .sidebar,
  .side-menu,
  #menu
)
:is(
  a,
  button,
  span,
  strong
) {
  color: #425a72 !important;
  opacity: 1 !important;
}

html[data-dg-theme="light"]
:is(
  aside,
  .sidebar,
  .side-menu,
  #menu
)
:is(
  a:hover,
  button:hover
) {
  color: #102235 !important;
}

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

/* Títulos dos grupos do menu */

html[data-dg-theme="light"]
:is(
  aside,
  .sidebar,
  .side-menu,
  #menu
)
:is(
  .section-title,
  .menu-title,
  .group-title,
  small
) {
  color: #586d84 !important;
  opacity: 1 !important;
}

/* Mantém os ícones verdes */

html[data-dg-theme="light"]
:is(
  aside,
  .sidebar,
  .side-menu,
  #menu
)
:is(
  svg,
  i,
  .icon
) {
  color: #70df19 !important;
  opacity: 1 !important;
}

/* Não alterar o selo laranja DG SPORTS da TV */

html[data-dg-theme="light"]
:is(
  .company-badge,
  .empresa-badge,
  .dg-sports-badge,
  .badge-company
) {
  background: #ff9700 !important;
  color: #ffffff !important;
  filter: none !important;
}
