/* Identidade do módulo Almox UbiSafe. Carregar após os estilos operacionais. */
body.almox-theme {
  --ui-nav: #112d45;
  --ui-accent-solid: #0c626b;
  --ui-accent-hover: #094e55;
  --ui-accent-text: #0c626b;
  --ui-accent-soft: #e3f2f2;
  --bg-color: #f2f5f8;
  --bg-accent: #e8eef3;
  --text-color: #172b3f;
  --muted-text: #55677a;
  --primary-color: #112d45;
  --primary-hover: #1c4563;
  --card-bg: #fff;
  --card-bg-solid: #fff;
  --table-header: #edf2f6;
  --border-color: #d7e1ea;
  --accent-color: #0c626b;
  --accent-soft: #e3f2f2;
  --status-online-bg: #e4f5ec;
  --status-online-text: #166345;
  --status-warning-bg: #fff2d5;
  --status-warning-text: #795400;
  --status-error-bg: #fdecef;
  --status-error-text: #a52a38;
  --shadow-soft: 0 2px 8px rgba(17, 45, 69, .05);
  --shadow-panel: 0 8px 24px rgba(17, 45, 69, .1);
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
  color-scheme: light;
}
body.almox-theme.dark-mode {
  --ui-accent-text: #91dcd7;
  --ui-accent-soft: #173c43;
  --bg-color: #0c1723;
  --bg-accent: #1b3042;
  --text-color: #e7eff5;
  --muted-text: #a4b6c8;
  --card-bg: #152738;
  --card-bg-solid: #152738;
  --table-header: #1c3246;
  --border-color: #32495c;
  --accent-color: #91dcd7;
  --accent-soft: #173c43;
  --status-online-bg: #173b2f;
  --status-online-text: #9ae0bc;
  --status-warning-bg: #463719;
  --status-warning-text: #ffd787;
  --status-error-bg: #472934;
  --status-error-text: #ffb5be;
  color-scheme: dark;
}

@media screen {
  body.almox-theme .top-header,
  body.almox-theme .menu-lateral,
  body.almox-theme .menu-lateral__submenu,
  body.almox-theme .workspace-hero__aside {
    background: var(--ui-nav);
    color: #fff;
  }
  body.almox-theme .top-header__brand {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }
  .almox-brand-mark { flex: 0 0 auto; display: block; }
  .almox-brand-copy { min-width: 0; }
  body.almox-theme .top-header { flex-wrap: wrap; }
  body.almox-theme .top-header__eyebrow {
    background: none; color: #abc8d8; padding: 0;
    font-size: 10px; letter-spacing: .09em;
  }
  body.almox-theme .top-header__brand h1 { letter-spacing: -.035em; line-height: 1.2; }
  body.almox-theme .top-header__brand p { color: #c9d9e5; font-size: 13px; }
  body.almox-theme .top-header__context,
  body.almox-theme .top-header__badge { background: #1b3b54; border-color: #36556c; }
  body.almox-theme .top-header__context-label { color: #bdd0de; }
  body.almox-theme .top-header__context select {
    background: #26475f; color: #fff; border-color: #4a667c;
    opacity: 1; -webkit-text-fill-color: #fff;
  }
  body.almox-theme .top-header__badge { gap: 8px; font-weight: 600; }
  body.almox-theme .top-header__badge::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%;
    background: currentColor; flex: 0 0 auto;
  }
  body.almox-theme .top-header__badge[data-state="online"] { background: #173b2f; color: #9ae0bc; border-color: #34614d; }
  body.almox-theme .top-header__badge[data-state="pending"],
  body.almox-theme .top-header__badge[data-state="offline"] { background: #463719; color: #ffd787; border-color: #766032; }
  body.almox-theme .top-header__badge[data-state="error"] { background: #472934; color: #ffb5be; border-color: #7d4956; }

  body.almox-theme :is(.workspace-hero__content, .overview-card, .app-section,
    .filtros, form, .admin-tools__card, .painel-conexao, .modal-content,
    .analytics-card, .analytics-kpi, .loss-recovery-dashboard, .stock-intelligence) {
    background: var(--card-bg-solid); border-color: var(--border-color);
    border-radius: 12px; box-shadow: var(--shadow-soft); backdrop-filter: none;
  }
  body.almox-theme .workspace-hero__content::after { content: none; }
  body.almox-theme .overview-card { border-top: 3px solid var(--border-color); }
  body.almox-theme .overview-card--primary { border-top-color: var(--ui-accent-text); color: var(--text-color); }
  body.almox-theme .overview-card__label,
  body.almox-theme .overview-card p { color: var(--muted-text); }
  body.almox-theme .overview-card--alert,
  body.almox-theme .analytics-kpi--alert {
    background: var(--status-error-bg); border-color: var(--status-error-text);
  }
  body.almox-theme .overview-card--alert strong { color: var(--status-error-text); }
  body.almox-theme :is(.overview-card strong, .discard-totals strong, .discard-card__quantity, td) { font-variant-numeric: tabular-nums; }
  body.almox-theme :is(.section-header__eyebrow, .workspace-hero__eyebrow) {
    color: var(--ui-accent-text); background: var(--ui-accent-soft);
    border-radius: 6px; letter-spacing: .05em;
  }
  body.almox-theme :is(.modal-content h2, .analytics-kpi strong) { color: var(--text-color); }
  body.almox-theme :is(input, select, textarea) {
    font-family: inherit; background: var(--card-bg-solid); color: var(--text-color);
    border: 1px solid var(--border-color); border-radius: 8px; box-shadow: none;
  }
  body.almox-theme :is(input, textarea)::placeholder { color: var(--muted-text); opacity: 1; }
  body.almox-theme :is(input, select, textarea)[aria-invalid="true"] { border-color: var(--status-error-text); }
  body.almox-theme .field-error { color: var(--status-error-text); }
  body.almox-theme button {
    font-family: inherit; border-radius: 8px; box-shadow: none;
    background: var(--ui-accent-solid); color: #fff;
    transition: background-color .15s ease, border-color .15s ease;
  }
  body.almox-theme button:hover { transform: none; background: var(--ui-accent-hover); box-shadow: none; }
  body.almox-theme button:disabled { cursor: not-allowed; opacity: .6; transform: none; }
  body.almox-theme .analytics-collapsible__toggle .analytics-card__header h3 {
    color: #fff;
  }
  body.almox-theme .analytics-collapsible__toggle .analytics-collapsible__summary {
    color: #e3f2f2;
  }
  body.almox-theme .analytics-collapsible__toggle :is(.analytics-card__tag, .analytics-collapsible__icon) {
    background: #e3f2f2;
    color: #112d45;
  }
  body.almox-theme .modal-buttons button { background: var(--ui-accent-solid); color: #fff; }
  body.almox-theme .modal-buttons button:hover { background: var(--ui-accent-hover); box-shadow: none; }
  body.almox-theme :is(.btn-secondary, .workspace-hero__action--ghost, .workspace-hero__action--secondary),
  body.almox-theme #app-dialog-cancel,
  body.almox-theme #btn-fechar-mensagem-modal {
    background: var(--card-bg-solid); color: var(--ui-accent-text); border: 1px solid var(--border-color);
  }
  body.almox-theme :is(.btn-secondary, .workspace-hero__action--ghost, .workspace-hero__action--secondary):hover,
  body.almox-theme #app-dialog-cancel:hover,
  body.almox-theme #btn-fechar-mensagem-modal:hover { background: var(--ui-accent-soft); border-color: var(--ui-accent-text); }
  body.almox-theme .top-header__logout { background: transparent; color: #e6eff5; border: 1px solid #527086; }
  body.almox-theme .top-header__logout:hover { background: #26475f; }
  body.almox-theme :is(.menu-lateral__toggle, .menu-lateral a) {
    background: transparent; color: #dce8f0; border-radius: 8px; border: 1px solid transparent;
  }
  body.almox-theme :is(.menu-lateral__toggle, .menu-lateral a):is(:hover, :focus-visible),
  body.almox-theme .menu-lateral__grupo.is-open .menu-lateral__toggle,
  body.almox-theme .menu-lateral__toggle.active,
  body.almox-theme .menu-lateral a.active {
    background: #25495d; color: #fff; border-color: #66bdb8; transform: none;
  }
  body.almox-theme .menu-lateral__submenu { border-color: #36556c; border-radius: 10px; }
  body.almox-theme :is(.btn-inline-action--excluir, .btn-inline-action--dar-baixa) {
    background: var(--status-error-bg); color: var(--status-error-text); border: 1px solid currentColor;
  }
  body.almox-theme .btn-inline-action--entrada { background: #166345; color: #fff; }
  body.almox-theme .btn-inline-action--saida { background: #205479; color: #fff; }
  body.almox-theme :is(.btn-inline-action--marcar-baixa, .btn-conferencia-ok) {
    background: var(--card-bg-solid); color: var(--ui-accent-text); border: 1px solid currentColor;
  }
  body.almox-theme :is(.btn-inline-action--marcar-baixa, .btn-conferencia-ok).is-checked {
    background: var(--status-online-bg); color: var(--status-online-text);
  }
  body.almox-theme #tabela-estoque .btn-inline-action--excluir { background: var(--status-error-bg); color: var(--status-error-text); }
  body.almox-theme :is(.tag-critico, .tag-atencao, .tag-ok) { border-radius: 6px; font-weight: 600; }
  body.almox-theme .tag-critico { background: var(--status-error-bg); color: var(--status-error-text); }
  body.almox-theme .tag-atencao { background: var(--status-warning-bg); color: var(--status-warning-text); }
  body.almox-theme .tag-ok { background: var(--status-online-bg); color: var(--status-online-text); }
  body.almox-theme table { border-radius: 10px; box-shadow: none; }
  body.almox-theme th { letter-spacing: .035em; font-size: 12px; color: var(--muted-text); }
  body.almox-theme :is(th, td) { border-right: none; }
  body.almox-theme .table-wrapper { border-radius: 10px; border: 1px solid var(--border-color); }
  body.almox-theme tbody tr:hover { background-color: var(--ui-accent-soft); }
  body.almox-theme .discard-card { background: var(--card-bg-solid); border-left-color: var(--status-warning-text); }
  body.almox-theme .discard-totals article { border-radius: 8px; }
  body.almox-theme .sync-recovery { background: var(--status-warning-bg); color: var(--status-warning-text); border-color: var(--status-warning-text); }
  body.almox-theme #btn-dark-mode { background: var(--ui-nav); border: 1px solid #527086; border-radius: 12px; }
  body.almox-theme .android-bottom-nav { background: var(--card-bg-solid); border-color: var(--border-color); }
  body.almox-theme .android-bottom-nav .android-bottom-nav__item { background: transparent; color: var(--muted-text); }
  body.almox-theme .android-bottom-nav .android-bottom-nav__item.active,
  body.almox-theme.dark-mode .android-bottom-nav .android-bottom-nav__item.active { background: var(--ui-accent-soft); color: var(--ui-accent-text); }
  body.almox-theme :is(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--ui-accent-text); outline-offset: 3px;
  }
  body.almox-theme .top-header :focus-visible,
  body.almox-theme .menu-lateral :focus-visible { outline-color: #91dcd7; }
}
@media screen and (max-width: 900px) {
  .almox-brand-mark { width: 36px; height: 36px; }
  body.almox-theme .top-header__brand { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  body.almox-theme *, body.almox-theme *::before, body.almox-theme *::after {
    animation: none !important; transition: none !important; scroll-behavior: auto !important;
  }
}
@media print { .almox-brand-mark { display: none; } }
