/* EntreAtos: profundidade e acabamento comuns aos módulos. */
html[data-ea-skin] {
  --depth-surface: linear-gradient(155deg,#fff 8%,#f7faff 100%);
  --depth-outline: #d3dff1;
  --depth-edge: #dce6f5;
  --depth-light: #ffffffc9;
  --depth-shade: #223e7326;
  --depth-field: linear-gradient(#edf3fc,#f9fbff);
  --depth-heading: linear-gradient(112deg,#112647,#1b3c73 66%,#255199);
  --depth-focus: #4264d6;
  --depth-raise: inset 0 1px 0 var(--depth-light),0 3px 0 var(--depth-edge),0 8px 18px var(--depth-shade);
  --depth-inset: inset 0 2px 4px var(--depth-shade),0 1px 0 var(--depth-light);
}

html[data-ea-skin][data-theme="dark"],
html:is([data-ea-skin="bi"],[data-ea-skin="global-bi"]):not([data-theme="light"]),
html[data-ea-skin="stage"] {
  --depth-surface: linear-gradient(148deg,#1e2c46,#111b30);
  --depth-outline: #344868;
  --depth-edge: #0b1325;
  --depth-light: #ffffff1a;
  --depth-shade: #0005;
  --depth-field: linear-gradient(#101a2d,#1c2a44);
  --depth-focus: #a9bdff;
}

/* Painéis principais e componentes criados a partir dos dados. */
[data-ea-skin] :is(
  .panel,.bi-card,.surface,.settings-card,.login-card,.login,
  .ministry-card,.equipment-card,.equip-card,.backup-card,.kpi-card,
  .operation-card,.insight-card,.product-card,
  .purchase-order-card,.transfer-card,.category-row,.supplier-card,
  .variant-row,.purchase-unit-row,.my-roster-card,.roster-role-card,
  .propresenter-card,.replicate-scale-panel,.live-board-card,
  .programming-card,.schedule-card,.copy-source-card,.bi-kpi,.bi-filter
) {
  background-image: var(--depth-surface);
  border-color: var(--depth-outline);
  box-shadow: var(--depth-raise);
}

/* Preservar as cores funcionais do roteiro e das mensagens de palco. */
[data-ea-skin="audiovisual"] :is(.agenda-card,.home-workspace > .card,.live-current-panel),
[data-ea-skin="stage"] :is(.next-card,.total-card,.timer-panel) {
  box-shadow: var(--depth-raise);
}
[data-ea-skin="stage"] :is(.next-card,.total-card) {
  background-image: var(--depth-surface);
  border-color: var(--depth-outline);
}

[data-ea-skin] :is(.welcome-hero,.ministry-hero,.bi-header,.portal-hero),
[data-ea-skin="audiovisual"] #roteiro .hero,
[data-ea-skin="equipment"] .hero {
  box-shadow: inset 0 1px 0 #ffffff28,0 3px 0 #10234429,0 12px 24px #142b5230;
}

/* Composição dos modais existentes, sem alterar rolagem ou dimensões. */
[data-ea-skin] dialog:not(.urgent-notice,.product-dialog),
[data-ea-skin] #ea-chat-panel {
  border-color: var(--depth-outline);
  box-shadow: inset 0 1px 0 var(--depth-light),0 4px 0 var(--depth-edge),0 25px 68px #0b1d4960;
}
[data-ea-skin] dialog:not(.urgent-notice,.live-view-dialog)::backdrop {
  background: #0a173a8f;
}
[data-ea-skin] dialog:not(.product-dialog,.urgent-notice,.live-view-dialog)
:is(.dialog-head,.dialog-heading,.heading) {
  border-radius: 12px;
  padding: 12px 15px;
  background-image: var(--depth-heading);
  color: #fff;
  box-shadow: inset 0 1px 0 #ffffff32,0 3px 0 #11254742;
}
[data-ea-skin] dialog:not(.product-dialog,.urgent-notice,.live-view-dialog)
:is(.dialog-head,.dialog-heading,.heading) :is(h2,h3,p,.eyebrow,.muted) {
  color: #edf4ff;
}
[data-ea-skin] dialog:not(.product-dialog,.urgent-notice,.live-view-dialog)
:is(.dialog-head,.dialog-heading,.heading) :is(.dialog-close,.icon-button,[data-close],[data-expand]) {
  background: #ffffff18;
  color: #fff;
  border-color: #ffffff49;
}
[data-ea-skin] dialog:not(.product-dialog,.urgent-notice,.live-view-dialog)
:is(.dialog-head,.dialog-heading,.heading) :is(.dialog-close,.icon-button,[data-close],[data-expand]):hover {
  background: #ffffff31;
}
[data-ea-skin] #ea-chat-panel .ea-chat-head {
  background-image: var(--depth-heading);
  box-shadow: inset 0 1px 0 #ffffff2b,0 3px 0 #12264e52;
}
[data-ea-skin] #ea-chat-panel .ea-chat-msg {
  box-shadow: inset 0 1px 0 #fff9,0 2px 0 #c3d3ec70,0 5px 12px #233e7320;
}

[data-ea-skin="equipment"] :is(.items > .item,.metrics > article),
[data-ea-skin="standard"] :is(.list > article,.cards > article),
[data-ea-skin="portal"] :is(.cards > article,.permission-group),
[data-ea-skin="global-bi"] .summary {
  background-image: var(--depth-surface);
  border-color: var(--depth-outline);
  box-shadow: var(--depth-raise);
}
[data-ea-skin="commerce"] :is(.pos-catalog-panel,.pos-cart-panel,.pos-sales-panel,.production-panel),
[data-ea-skin="audiovisual"] :is(.live-view-header,.live-board-card),
[data-ea-skin] :is(.commerce-nav,.ministry-side) button[aria-current="page"] {
  box-shadow: var(--depth-raise);
}
[data-ea-skin="stage"] .top {
  box-shadow: inset 0 -1px 0 #6786ba30,0 8px 15px #0003;
}

/* Usar relevo no controle sem sobrescrever o fundo de estados e permissões. */
[data-ea-skin] :is(.btn.pri,.button-primary,button.primary,#ea-chat-launch):not(:disabled) {
  box-shadow: inset 0 1px 0 #ffffff55,0 3px 0 #142b6755,0 6px 12px var(--depth-shade);
}
[data-ea-skin] :is(.btn.pri,.button-primary,button.primary):active:not(:disabled) {
  box-shadow: inset 0 2px 5px #0a1a4566;
}
[data-ea-skin]:not([data-ea-skin="stage"])
:is(input:not([type]),input[type="text"],input[type="search"],input[type="number"],
    input[type="date"],input[type="time"],input[type="email"],input[type="password"],select,textarea) {
  box-shadow: var(--depth-inset);
}
[data-ea-skin] :is(button,a,input,select,textarea,summary):focus-visible {
  outline: 2px solid var(--depth-focus);
  outline-offset: 2px;
}
[data-ea-skin] :is(.commerce-side,.ministry-side,.sidebar) :is(button,a):focus-visible,
[data-ea-skin] :is(.dialog-close,.ea-chat-head button):focus-visible {
  outline-color: #a9bdff;
}
@media (max-width: 640px) {
  [data-ea-skin] #ea-chat-panel { box-shadow: none; }
}

/* Cabeçalhos de escala e cópia mantêm o fundo junto ao texto claro. */
[data-ea-skin="audiovisual"] #assignments-dialog.roster-workspace-dialog > .dialog-head,
[data-ea-skin="audiovisual"] #copy-service-dialog .dialog-head {
  background: var(--depth-heading);
  color: #fff;
}

/* Legibilidade dos textos auxiliares sobre as superfícies do Audiovisual. */
html[data-ea-skin="audiovisual"] :is(#drag-hint, #dp .empty, #roster-person-help, #roster-person-mode, .groups-overview, #stage-dialog .stage-config > label) {
  color: #526077;
}
html[data-ea-skin="audiovisual"] .operations-status:not(.ao-vivo) {
  color: #526077;
}
html[data-ea-skin="audiovisual"][data-theme="dark"] :is(#drag-hint, #dp .empty, #roster-person-help, #roster-person-mode, .groups-overview, #stage-dialog .stage-config > label, .operations-status:not(.ao-vivo)) {
  color: #c1cde0;
}
html[data-ea-skin="audiovisual"] #drag-hint {
  font-size: 12px;
  line-height: 1.4;
}
html[data-ea-skin="audiovisual"] .operations-status {
  font-size: 11px;
}
