/* GestMan365 — Etapa 01: padronização visual do conteúdo.
   O cabeçalho e o menu principal são deliberadamente excluídos deste arquivo. */

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace,
#genericModal,
.platform-dialog {
  --gm01-primary: #0b6fce;
  --gm01-primary-hover: #095dad;
  --gm01-primary-soft: rgba(11, 111, 206, .13);
  --gm01-accent-text: #61b7ff;
  --gm01-success: #18a66a;
  --gm01-warning: #d99216;
  --gm01-danger: #dc4455;
  --gm01-info: #1683e8;
  --gm01-radius-control: 8px;
  --gm01-radius-card: 12px;
  --gm01-radius-modal: 16px;
  --gm01-radius-pill: 999px;
  --gm01-space-1: 4px;
  --gm01-space-2: 8px;
  --gm01-space-3: 12px;
  --gm01-space-4: 16px;
  --gm01-space-5: 24px;
  --gm01-space-6: 32px;
  --gm01-space-7: 40px;
  --gm01-bg: #07131f;
  --gm01-surface: #0b1a2a;
  --gm01-surface-raised: #102238;
  --gm01-surface-soft: #0d1e30;
  --gm01-text: #eef6ff;
  --gm01-text-secondary: #b5c5d6;
  --gm01-muted: #8298ae;
  --gm01-border: #243b53;
  --gm01-border-strong: #34516d;
  --gm01-shadow-card: 0 8px 22px rgba(0, 0, 0, .18);
  --gm01-shadow-modal: 0 28px 80px rgba(0, 0, 0, .45);
  --gm01-focus: 0 0 0 3px rgba(11, 111, 206, .28);
}

body.theme-light:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace,
body.theme-light #genericModal,
body.theme-light .platform-dialog {
  --gm01-accent-text: #0b6fce;
  --gm01-bg: #edf3f8;
  --gm01-surface: #ffffff;
  --gm01-surface-raised: #f8fbfd;
  --gm01-surface-soft: #f1f6fa;
  --gm01-text: #10263d;
  --gm01-text-secondary: #405a73;
  --gm01-muted: #637b91;
  --gm01-border: #cad8e5;
  --gm01-border-strong: #abc0d3;
  --gm01-shadow-card: 0 7px 20px rgba(24, 51, 77, .08);
  --gm01-shadow-modal: 0 28px 80px rgba(24, 51, 77, .22);
  --gm01-focus: 0 0 0 3px rgba(11, 111, 206, .22);
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace {
  color: var(--gm01-text) !important;
  background: var(--gm01-bg) !important;
  padding: var(--gm01-space-5) var(--gm01-space-5) var(--gm01-space-6) !important;
  overflow-x: clip !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace > .view.active {
  width: 100%;
  max-width: 1920px;
  min-width: 0;
  margin-inline: auto;
  color: var(--gm01-text);
}

/* Cabeçalhos estruturais das páginas */
body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace .gm01-page-header,
body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .assets-page-head,
  .orders-page-head,
  .preventive-page-head,
  .checklist-page-head,
  .materials-page-head,
  .stage14-page-head,
  .stage15-page-head,
  .stage16-page-head,
  .stage17-page-head,
  .stage18-page-head,
  .stage19-page-head,
  .stage20-page-head,
  .industrial-dashboard-heading
) {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: var(--gm01-space-5) !important;
  min-width: 0;
  margin: 0 0 var(--gm01-space-4) !important;
  padding: var(--gm01-space-5) !important;
  color: var(--gm01-text) !important;
  background: var(--gm01-surface) !important;
  border: 1px solid var(--gm01-border) !important;
  border-radius: var(--gm01-radius-card) !important;
  box-shadow: var(--gm01-shadow-card) !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace .gm01-page-header > div:first-child,
body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace [class$="-page-head"] > div:first-child {
  min-width: 0;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(.gm01-page-header,[class$="-page-head"],.industrial-dashboard-heading) h1 {
  margin: var(--gm01-space-1) 0 !important;
  color: var(--gm01-text) !important;
  font-size: clamp(1.55rem, 2vw, 2rem) !important;
  line-height: 1.18 !important;
  letter-spacing: -.025em !important;
  text-wrap: balance;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(.gm01-page-header,[class$="-page-head"],.industrial-dashboard-heading) p {
  max-width: 76ch;
  margin: 0 !important;
  color: var(--gm01-text-secondary) !important;
  line-height: 1.55 !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .gm01-eyebrow,
  [class$="-eyebrow"],
  .d2-dashboard-welcome > span:first-child
) {
  color: var(--gm01-accent-text) !important;
  font-size: .72rem !important;
  font-weight: 800 !important;
  letter-spacing: .14em !important;
  text-transform: uppercase !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace .gm01-page-actions,
body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace [class$="-head-actions"],
body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace [class$="-page-actions"] {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--gm01-space-2);
}

/* Controles e ações */
body:not(.auth-required):not(.auth-loading) .workspace :is(.btn,button,[role="button"]):not(.tab):not(.calendar-event),
#genericModal :is(.btn,button,[role="button"]),
.platform-dialog :is(.platform-btn,button,[role="button"]) {
  min-height: 44px;
  border-radius: var(--gm01-radius-control) !important;
}

body:not(.auth-required):not(.auth-loading) .workspace .btn,
#genericModal .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gm01-space-2);
  padding: 9px 14px !important;
  color: var(--gm01-text) !important;
  background: var(--gm01-surface-raised) !important;
  border: 1px solid var(--gm01-border-strong) !important;
  box-shadow: none !important;
  font-weight: 700 !important;
  line-height: 1.2;
}

body:not(.auth-required):not(.auth-loading) .workspace .btn:hover:not(:disabled),
#genericModal .btn:hover:not(:disabled) {
  color: var(--gm01-text) !important;
  background: color-mix(in srgb, var(--gm01-primary) 10%, var(--gm01-surface-raised)) !important;
  border-color: color-mix(in srgb, var(--gm01-primary) 58%, var(--gm01-border-strong)) !important;
}

body:not(.auth-required):not(.auth-loading) .workspace .btn.primary,
body:not(.auth-required):not(.auth-loading) .workspace #orders #createOrderBtn.btn.primary,
#genericModal .btn.primary,
.platform-dialog .platform-btn.primary {
  color: #fff !important;
  background: var(--gm01-primary) !important;
  border-color: var(--gm01-primary) !important;
  box-shadow: 0 5px 14px rgba(11, 111, 206, .22) !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) #assistant #aiRefreshBtn.btn {
  color: var(--gm01-text) !important;
  background: var(--gm01-surface-raised) !important;
  border-color: var(--gm01-border-strong) !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) #calendar .stage19-filter-count {
  color: #fff !important;
  background: var(--gm01-primary) !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) #calendar .stage19-calendar-empty {
  color: var(--gm01-muted) !important;
}

body:not(.auth-required):not(.auth-loading) .workspace .btn.primary:hover:not(:disabled),
#genericModal .btn.primary:hover:not(:disabled) {
  background: var(--gm01-primary-hover) !important;
  border-color: var(--gm01-primary-hover) !important;
}

body:not(.auth-required):not(.auth-loading) .workspace :is(.btn.danger,.danger.btn),
#genericModal :is(.btn.danger,.danger.btn) {
  color: #fff !important;
  background: var(--gm01-danger) !important;
  border-color: var(--gm01-danger) !important;
}

body:not(.auth-required):not(.auth-loading) .workspace :is(.btn,button,[role="button"]):focus-visible,
body:not(.auth-required):not(.auth-loading) .workspace :is(input,select,textarea,summary,[tabindex]):focus-visible,
#genericModal :is(.btn,button,input,select,textarea,summary,[tabindex]):focus-visible,
.platform-dialog :is(button,input,select,textarea,[tabindex]):focus-visible {
  outline: 2px solid var(--gm01-primary) !important;
  outline-offset: 2px !important;
  box-shadow: var(--gm01-focus) !important;
}

body:not(.auth-required):not(.auth-loading) .workspace :is(input,select,textarea,.field),
#genericModal :is(input,select,textarea,.field),
.platform-dialog :is(input,select,textarea) {
  width: 100%;
  min-height: 44px;
  min-width: 0;
  padding: 10px 12px !important;
  color: var(--gm01-text) !important;
  background: var(--gm01-surface-raised) !important;
  border: 1px solid var(--gm01-border-strong) !important;
  border-radius: var(--gm01-radius-control) !important;
  box-shadow: none !important;
}

body:not(.auth-required):not(.auth-loading) .workspace textarea,
#genericModal textarea,
.platform-dialog textarea {
  min-height: 96px;
  resize: vertical;
}

body:not(.auth-required):not(.auth-loading) .workspace :is(input,textarea)::placeholder,
#genericModal :is(input,textarea)::placeholder {
  color: var(--gm01-muted) !important;
  opacity: 1;
}

body:not(.auth-required):not(.auth-loading) .workspace form label,
#genericModal form label,
.platform-dialog form label {
  color: var(--gm01-text-secondary) !important;
  font-weight: 700;
  line-height: 1.35;
}

/* Painéis, cards e indicadores */
body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .panel,
  .industrial-card,
  .side-box,
  .materials-list-panel,
  .materials-alert-panel,
  .asset-list-panel,
  .preventive-list-panel,
  .checklist-list-panel,
  .stage14-panel,
  .stage15-panel,
  .stage16-panel,
  .stage17-panel,
  .stage18-panel,
  .stage19-panel,
  .stage20-panel
) {
  min-width: 0;
  color: var(--gm01-text) !important;
  background: var(--gm01-surface) !important;
  border: 1px solid var(--gm01-border) !important;
  border-radius: var(--gm01-radius-card) !important;
  box-shadow: var(--gm01-shadow-card) !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(.panel-head,.industrial-card-head,[class$="-list-head"]) {
  min-height: 58px;
  padding: var(--gm01-space-3) var(--gm01-space-4) !important;
  color: var(--gm01-text) !important;
  background: var(--gm01-surface) !important;
  border-bottom: 1px solid var(--gm01-border) !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(.panel-title,[class$="-list-title"]) {
  color: var(--gm01-text) !important;
  font-size: 1rem !important;
  font-weight: 800 !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .asset-metric,
  .materials-metric,
  .preventive-metric,
  .checklist-metric,
  .stage14-metric,
  .stage15-metric,
  .stage16-metric,
  .stage17-metric,
  .stage18-metric,
  .stage19-metric,
  .stage20-metric,
  .professional-kpi-card
) {
  min-height: 86px;
  padding: var(--gm01-space-3) var(--gm01-space-4) !important;
  color: var(--gm01-text) !important;
  background: var(--gm01-surface) !important;
  border: 1px solid var(--gm01-border) !important;
  border-radius: var(--gm01-radius-card) !important;
  box-shadow: var(--gm01-shadow-card) !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .asset-metric,.materials-metric,.preventive-metric,.checklist-metric,
  .stage14-metric,.stage15-metric,.stage16-metric,.stage17-metric,
  .stage18-metric,.stage19-metric,.stage20-metric,.professional-kpi-card
) :is(strong,h2,h3) {
  color: var(--gm01-text) !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .asset-metric,.materials-metric,.preventive-metric,.checklist-metric,
  .stage14-metric,.stage15-metric,.stage16-metric,.stage17-metric,
  .stage18-metric,.stage19-metric,.stage20-metric,.professional-kpi-card
) :is(span,small,p) {
  color: var(--gm01-muted) !important;
}

/* Barras de busca, filtros e abas */
body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .toolbar,
  [class$="-toolbar"],
  [class$="-filter-panel"],
  .materials-tabs,
  .checklist-tabs,
  .stage15-tabs,
  .calendar-mode-group,
  .detail-tabs
) {
  min-width: 0;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  [class$="-filter-panel"],
  .materials-toolbar,
  .stage14-toolbar,
  .stage15-toolbar,
  .stage16-toolbar,
  .stage17-toolbar,
  .stage18-toolbar,
  .stage19-toolbar,
  .stage20-toolbar
) {
  gap: var(--gm01-space-2) !important;
  padding: var(--gm01-space-3) !important;
  background: var(--gm01-surface) !important;
  border: 1px solid var(--gm01-border) !important;
  border-radius: var(--gm01-radius-card) !important;
  box-shadow: var(--gm01-shadow-card) !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .materials-tabs,.checklist-tabs,.stage15-tabs,.calendar-mode-group,.detail-tabs,
  .asset-tabs,.preventive-tabs,.stage14-tabs,.stage17-tabs,.stage18-tabs,.stage19-tabs
) {
  gap: var(--gm01-space-1) !important;
  padding: var(--gm01-space-1) !important;
  background: var(--gm01-surface-soft) !important;
  border: 1px solid var(--gm01-border) !important;
  border-radius: var(--gm01-radius-control) !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .materials-tabs,.checklist-tabs,.stage15-tabs,.calendar-mode-group,.detail-tabs,
  .asset-tabs,.preventive-tabs,.stage14-tabs,.stage17-tabs,.stage18-tabs,.stage19-tabs
) button {
  min-height: 38px !important;
  padding: 8px 12px !important;
  color: var(--gm01-text-secondary) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .materials-tabs,.checklist-tabs,.stage15-tabs,.calendar-mode-group,.detail-tabs,
  .asset-tabs,.preventive-tabs,.stage14-tabs,.stage17-tabs,.stage18-tabs,.stage19-tabs
) button:is(.active,[aria-selected="true"]) {
  color: #fff !important;
  background: var(--gm01-primary) !important;
  border-color: var(--gm01-primary) !important;
}

/* Tabelas */
body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(.table-wrap,[class$="-table-wrap"]) {
  max-width: 100%;
  overflow: auto !important;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
  border-radius: 0 0 var(--gm01-radius-card) var(--gm01-radius-card);
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace table {
  width: 100%;
  color: var(--gm01-text-secondary) !important;
  border-collapse: separate;
  border-spacing: 0;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 14px !important;
  color: var(--gm01-text-secondary) !important;
  background: var(--gm01-surface-soft) !important;
  border-bottom: 1px solid var(--gm01-border-strong) !important;
  font-size: .72rem !important;
  font-weight: 800 !important;
  letter-spacing: .055em !important;
  text-transform: uppercase !important;
  white-space: nowrap;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace tbody td {
  padding: 12px 14px !important;
  color: var(--gm01-text-secondary) !important;
  background: var(--gm01-surface) !important;
  border-bottom: 1px solid var(--gm01-border) !important;
  vertical-align: middle;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace tbody tr:hover td {
  background: color-mix(in srgb, var(--gm01-primary) 6%, var(--gm01-surface)) !important;
}

/* Estados, badges e paginação */
body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .tag,.badge,[class$="-status"],[class$="-badge"],[class$="-chip"]
) {
  border-radius: var(--gm01-radius-pill) !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .materials-pagination,.asset-pagination,.preventive-pagination,.checklist-pagination,
  .stage14-pagination,.stage15-pagination,.stage16-pagination,.stage17-pagination,
  .stage18-pagination,.stage19-pagination,.stage20-pagination,.pagination
) {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--gm01-space-1) !important;
  padding: var(--gm01-space-3) var(--gm01-space-4) !important;
  background: var(--gm01-surface) !important;
  border-top: 1px solid var(--gm01-border) !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .materials-pagination,.asset-pagination,.preventive-pagination,.checklist-pagination,
  .stage14-pagination,.stage15-pagination,.stage16-pagination,.stage17-pagination,
  .stage18-pagination,.stage19-pagination,.stage20-pagination,.pagination
) button {
  min-width: 38px;
  min-height: 38px;
  color: var(--gm01-text-secondary) !important;
  background: var(--gm01-surface-raised) !important;
  border: 1px solid var(--gm01-border-strong) !important;
  border-radius: var(--gm01-radius-control) !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .materials-pagination,.asset-pagination,.preventive-pagination,.checklist-pagination,
  .stage14-pagination,.stage15-pagination,.stage16-pagination,.stage17-pagination,
  .stage18-pagination,.stage19-pagination,.stage20-pagination,.pagination
) button:is(.active,[aria-current="page"]) {
  color: #fff !important;
  background: var(--gm01-primary) !important;
  border-color: var(--gm01-primary) !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .empty,.asset-empty,.materials-empty,.preventive-empty,.checklist-empty,
  .stage14-empty,.stage15-empty,.stage16-empty,.stage17-empty,.stage18-empty,
  .stage19-empty,.stage20-empty,.gm-system-state
) {
  min-height: 150px;
  padding: var(--gm01-space-6) !important;
  color: var(--gm01-muted) !important;
  background: var(--gm01-surface-soft) !important;
  border: 1px dashed var(--gm01-border-strong) !important;
  border-radius: var(--gm01-radius-card) !important;
  text-align: center;
}

/* Dashboard */
body:not(.auth-required):not(.auth-loading):not(.panel-mode) #dashboard .industrial-dashboard-widget-grid {
  align-items: start !important;
  gap: var(--gm01-space-3) !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) #dashboard .dashboard-widget {
  align-self: start !important;
  height: auto !important;
  min-height: 0;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) #dashboard .dashboard-visible-body {
  max-height: 520px;
  overflow: auto;
  overscroll-behavior: contain;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) #dashboard :is(.industrial-quick-actions,.professional-kpi-strip) {
  gap: var(--gm01-space-3) !important;
}

/* Mapa industrial: menos ruído visual, sem alterar posições ou arraste */
body:not(.auth-required):not(.auth-loading):not(.panel-mode) #map :is(.map-shell,.map-canvas,.map-region,.map-location,.machine-card) {
  box-shadow: none !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) #map .map-shell {
  border-radius: var(--gm01-radius-card) !important;
}

/* IA */
body:not(.auth-required):not(.auth-loading):not(.panel-mode) #assistant .ai-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, .7fr) !important;
  gap: var(--gm01-space-4) !important;
  padding: var(--gm01-space-4) !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) #assistant .ai-answer {
  min-height: 260px;
  padding: var(--gm01-space-4) !important;
  color: var(--gm01-text-secondary) !important;
  background: var(--gm01-surface-soft) !important;
  border: 1px solid var(--gm01-border) !important;
  border-radius: var(--gm01-radius-card) !important;
  line-height: 1.65;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) #assistant .ai-form {
  align-content: start;
  padding: var(--gm01-space-4) !important;
  background: var(--gm01-surface-soft) !important;
  border: 1px solid var(--gm01-border) !important;
  border-radius: var(--gm01-radius-card) !important;
}

/* Modal único e drawers sem conteúdo coberto */
#genericModal,
.platform-dialog {
  padding: var(--gm01-space-4) !important;
  background: rgba(2, 9, 17, .72) !important;
  backdrop-filter: blur(5px);
}

#genericModalBox,
.platform-dialog-card {
  display: flex !important;
  flex-direction: column !important;
  width: min(920px, calc(100vw - 32px)) !important;
  max-height: calc(100dvh - 32px) !important;
  overflow: hidden !important;
  color: var(--gm01-text) !important;
  background: var(--gm01-surface) !important;
  border: 1px solid var(--gm01-border-strong) !important;
  border-radius: var(--gm01-radius-modal) !important;
  box-shadow: var(--gm01-shadow-modal) !important;
}

#genericModalBox.large {
  width: min(1180px, calc(100vw - 32px)) !important;
}

#genericModalBox > .modal-head,
.platform-dialog-head {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 62px;
  padding: var(--gm01-space-3) var(--gm01-space-4) !important;
  color: var(--gm01-text) !important;
  background: var(--gm01-surface) !important;
  border-bottom: 1px solid var(--gm01-border) !important;
}

#genericModalBox > .modal-body,
.platform-dialog-body {
  min-height: 0;
  padding: var(--gm01-space-4) !important;
  overflow: auto !important;
  overscroll-behavior: contain;
}

#genericModal :is(.os-create-actions,.modal-actions,.modal-foot,.materials-form-actions,.stage14-form-actions,.stage15-form-actions,.tenant-user-editor-foot),
.platform-dialog-actions.is-sticky {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 6 !important;
  margin: var(--gm01-space-4) calc(var(--gm01-space-4) * -1) calc(var(--gm01-space-4) * -1) !important;
  padding: var(--gm01-space-3) var(--gm01-space-4) !important;
  background: var(--gm01-surface) !important;
  border-top: 1px solid var(--gm01-border) !important;
  box-shadow: 0 -10px 24px color-mix(in srgb, var(--gm01-bg) 72%, transparent) !important;
}

#genericModal .order-start-footer {
  position: static !important;
  display: flex;
  justify-content: flex-end;
  padding: 16px 0;
  clear: both;
}

#genericModal .order-start-footer .btn {
  position: static !important;
  min-height: 48px;
}

body:not(.auth-required):not(.auth-loading) #assets .asset-form-panel {
  top: var(--gm-app-top-offset, 136px) !important;
  bottom: 0 !important;
  width: min(760px, 96vw) !important;
  max-height: calc(100dvh - var(--gm-app-top-offset, 136px)) !important;
  color: var(--gm01-text) !important;
  background: var(--gm01-surface) !important;
  border: 1px solid var(--gm01-border-strong) !important;
  border-radius: var(--gm01-radius-modal) 0 0 0 !important;
  box-shadow: var(--gm01-shadow-modal) !important;
  overscroll-behavior: contain;
}

body:not(.auth-required):not(.auth-loading) #assets .asset-form-head,
body:not(.auth-required):not(.auth-loading) #assets .asset-form-actions {
  color: var(--gm01-text) !important;
  background: var(--gm01-surface) !important;
  border-color: var(--gm01-border) !important;
}

#genericModal .tenant-user-editor {
  max-width: none !important;
  margin: 0 !important;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#genericModal .tenant-user-editor-head {
  padding: 0 0 var(--gm01-space-3) !important;
  background: transparent !important;
  border-bottom: 1px solid var(--gm01-border) !important;
}

#genericModal .tenant-user-body {
  padding: var(--gm01-space-4) 0 0 !important;
}

#genericModal .stage20-custom-row {
  grid-template-columns: 44px minmax(0, 1fr) auto !important;
  gap: var(--gm01-space-3) !important;
  padding: var(--gm01-space-3) !important;
  color: var(--gm01-text) !important;
  background: var(--gm01-surface-soft) !important;
  border-color: var(--gm01-border) !important;
  border-radius: var(--gm01-radius-control) !important;
}

#genericModal .stage20-custom-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Correções de tema claro em componentes legados com cores fixas */
body.theme-light:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .asset-detail-head,.asset-info-card,.asset-content-card,.asset-mini-kpi,.asset-section-row,
  .preventive-detail-head,.checklist-detail-head,.stage14-card,.stage15-card,
  .stage16-card,.stage17-card,.stage18-card,.stage19-card,.stage20-shortcut,
  .tenant-user-editor,.tenant-access-details,.tenant-more-details,.permission-item,
  .calendar-app,.calendar-main,.calendar-grid,.calendar-day,.map-side
) {
  color: var(--gm01-text) !important;
  background: var(--gm01-surface) !important;
  border-color: var(--gm01-border) !important;
  box-shadow: var(--gm01-shadow-card) !important;
}

body.theme-light:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .asset-detail-head,.asset-info-card,.asset-content-card,.asset-mini-kpi,.asset-section-row,
  .preventive-detail-head,.checklist-detail-head,.stage14-card,.stage15-card,
  .stage16-card,.stage17-card,.stage18-card,.stage19-card,.stage20-shortcut,
  .tenant-user-editor,.tenant-access-details,.tenant-more-details,.permission-item,
  .calendar-app,.calendar-main,.calendar-grid,.calendar-day,.map-side
) :is(h1,h2,h3,h4,strong) {
  color: var(--gm01-text) !important;
}

body.theme-light:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .asset-detail-head,.asset-info-card,.asset-content-card,.asset-mini-kpi,.asset-section-row,
  .preventive-detail-head,.checklist-detail-head,.stage14-card,.stage15-card,
  .stage16-card,.stage17-card,.stage18-card,.stage19-card,.stage20-shortcut,
  .tenant-user-editor,.tenant-access-details,.tenant-more-details,.permission-item,
  .calendar-app,.calendar-main,.calendar-grid,.calendar-day,.map-side
) :is(p,span,small,label) {
  color: var(--gm01-text-secondary) !important;
}

/* Indicadores de carregamento e erro */
body:not(.auth-required):not(.auth-loading):not(.panel-mode) #maintenanceIndicators :is(.gm-loading-skeleton,[aria-busy="true"]) {
  border-radius: var(--gm01-radius-card) !important;
}

/* Responsividade: conteúdo apenas; navegação permanece intocada */
@media (max-width: 1280px) {
  body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
    .asset-metric-strip,.materials-metrics,.preventive-metrics,.checklist-metrics,
    .stage14-metrics,.stage15-metrics,.stage16-metrics,.stage17-metrics,
    .stage18-metrics,.stage19-metrics,.stage20-metrics,.professional-kpi-strip
  ) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1024px) {
  body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace .gm01-page-header,
  body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is([class$="-page-head"],.industrial-dashboard-heading,.s16-head) {
    align-items: flex-start !important;
    flex-direction: column !important;
  }

  body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace .gm01-page-actions,
  body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace [class$="-head-actions"],
  body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace [class$="-page-actions"] {
    width: 100%;
    justify-content: flex-start;
  }

  body:not(.auth-required):not(.auth-loading):not(.panel-mode) #assistant .ai-layout {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace {
    padding: var(--gm01-space-3) !important;
  }

  body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
    .asset-metric-strip,.materials-metrics,.preventive-metrics,.checklist-metrics,
    .stage14-metrics,.stage15-metrics,.stage16-metrics,.stage17-metrics,
    .stage18-metrics,.stage19-metrics,.stage20-metrics,.professional-kpi-strip
  ) {
    display: flex !important;
    grid-template-columns: none !important;
    max-width: 100%;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
    .asset-metric,.materials-metric,.preventive-metric,.checklist-metric,
    .stage14-metric,.stage15-metric,.stage16-metric,.stage17-metric,
    .stage18-metric,.stage19-metric,.stage20-metric,.professional-kpi-card
  ) {
    flex: 0 0 min(78vw, 260px);
    scroll-snap-align: start;
  }

  body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
    .gm01-page-header,[class$="-page-head"],.industrial-dashboard-heading
  ) {
    padding: var(--gm01-space-4) !important;
  }

  #genericModalBox,
  #genericModalBox.large,
  .platform-dialog-card {
    width: min(100%, calc(100vw - 16px)) !important;
    max-height: calc(100dvh - 16px) !important;
  }

  #genericModal,
  .platform-dialog {
    padding: var(--gm01-space-2) !important;
  }

  #genericModal .stage20-custom-row {
    grid-template-columns: 44px minmax(0, 1fr) !important;
  }

  #genericModal .stage20-custom-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 390px) {
  body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace {
    padding: var(--gm01-space-2) !important;
  }

  body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace {
    padding-inline: var(--gm01-space-2) !important;
  }

  body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace .gm01-page-actions > *,
  body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace [class$="-head-actions"] > *,
  body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace [class$="-page-actions"] > * {
    flex: 1 1 100%;
  }

  body:not(.auth-required):not(.auth-loading) #assets .asset-form-panel {
    inset: var(--gm-app-top-offset, 116px) 0 0 !important;
    width: 100vw !important;
    max-height: calc(100dvh - var(--gm-app-top-offset, 116px)) !important;
    border-radius: 0 !important;
  }

  #genericModalBox > .modal-body,
  .platform-dialog-body {
    padding: var(--gm01-space-3) !important;
  }

  #genericModal :is(.os-create-actions,.order-execution-actions,.modal-actions,.modal-foot,.materials-form-actions,.stage14-form-actions,.stage15-form-actions,.tenant-user-editor-foot) {
    margin: var(--gm01-space-3) calc(var(--gm01-space-3) * -1) calc(var(--gm01-space-3) * -1) !important;
    padding: var(--gm01-space-3) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace *,
  #genericModal *,
  .platform-dialog * {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Refinamento visual profissional: superfícies industriais sóbrias, sem aparência promocional. */
body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace,
#genericModal,
.platform-dialog {
  --gm01-primary: #1769aa;
  --gm01-primary-hover: #12598f;
  --gm01-primary-soft: rgba(23, 105, 170, .12);
  --gm01-accent-text: #52a9d8;
  --gm01-radius-control: 6px;
  --gm01-radius-card: 8px;
  --gm01-radius-modal: 12px;
  --gm01-bg: #09121b;
  --gm01-surface: #101a24;
  --gm01-surface-raised: #15212c;
  --gm01-surface-soft: #0d1720;
  --gm01-text: #e8eef4;
  --gm01-text-secondary: #b1beca;
  --gm01-muted: #7e91a3;
  --gm01-border: #263746;
  --gm01-border-strong: #344b5e;
  --gm01-shadow-card: 0 1px 2px rgba(0, 0, 0, .22);
  --gm01-shadow-modal: 0 22px 56px rgba(0, 0, 0, .42);
}

body.theme-light:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace,
body.theme-light #genericModal,
body.theme-light .platform-dialog {
  --gm01-accent-text: #1769aa;
  --gm01-bg: #f3f6f8;
  --gm01-surface: #ffffff;
  --gm01-surface-raised: #f8fafb;
  --gm01-surface-soft: #f1f4f6;
  --gm01-text: #172b3d;
  --gm01-text-secondary: #405568;
  --gm01-muted: #65798a;
  --gm01-border: #d6dee5;
  --gm01-border-strong: #bcc9d3;
  --gm01-shadow-card: 0 1px 2px rgba(26, 46, 64, .08);
  --gm01-shadow-modal: 0 22px 56px rgba(26, 46, 64, .2);
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace,
#genericModal,
.platform-dialog {
  font-family: Inter, "Segoe UI", Arial, sans-serif !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace .gm01-page-header,
body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .assets-page-head,.orders-page-head,.preventive-page-head,.checklist-page-head,
  .materials-page-head,.stage14-page-head,.stage15-page-head,.stage16-page-head,
  .stage17-page-head,.stage18-page-head,.stage19-page-head,.stage20-page-head,
  .industrial-dashboard-heading
) {
  margin-bottom: 16px !important;
  padding: 4px 0 14px !important;
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-bottom: 1px solid var(--gm01-border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .gm01-page-header,[class$="-page-head"],.industrial-dashboard-heading
) h1 {
  font-weight: 720 !important;
  letter-spacing: -.018em !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .gm01-eyebrow,[class$="-eyebrow"],.d2-dashboard-welcome > span:first-child
) {
  font-weight: 700 !important;
  letter-spacing: .08em !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  .panel,.industrial-card,.side-box,.materials-list-panel,.materials-alert-panel,
  .asset-list-panel,.preventive-list-panel,.checklist-list-panel,.stage14-panel,
  .stage15-panel,.stage16-panel,.stage17-panel,.stage18-panel,.stage19-panel,.stage20-panel,
  .asset-metric,.materials-metric,.preventive-metric,.checklist-metric,.stage14-metric,
  .stage15-metric,.stage16-metric,.stage17-metric,.stage18-metric,.stage19-metric,
  .stage20-metric,.professional-kpi-card
) {
  background-image: none !important;
  box-shadow: var(--gm01-shadow-card) !important;
}

body:not(.auth-required):not(.auth-loading) .workspace .btn.primary,
body:not(.auth-required):not(.auth-loading) .workspace #orders #createOrderBtn.btn.primary,
#genericModal .btn.primary,
.platform-dialog .platform-btn.primary {
  box-shadow: none !important;
}

body:not(.auth-required):not(.auth-loading) .workspace :is(.btn,button,[role="button"]):not(.tab):not(.calendar-event),
#genericModal :is(.btn,button,[role="button"]),
.platform-dialog :is(.platform-btn,button,[role="button"]) {
  transition: background-color .14s ease, border-color .14s ease, color .14s ease !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace :is(
  [class$="-filter-panel"],.materials-toolbar,.stage14-toolbar,.stage15-toolbar,
  .stage16-toolbar,.stage17-toolbar,.stage18-toolbar,.stage19-toolbar,.stage20-toolbar
) {
  background-image: none !important;
  box-shadow: none !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace thead th {
  padding-block: 10px !important;
  letter-spacing: .035em !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace tbody td {
  padding-block: 10px !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace #dashboard .industrial-dashboard-heading {
  min-height: 0 !important;
  padding: 6px 0 16px !important;
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-bottom: 1px solid var(--gm01-border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace #dashboard .industrial-dashboard-heading::before,
body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace #dashboard .industrial-dashboard-heading::after {
  display: none !important;
  content: none !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace #dashboard .d2-dashboard-context {
  margin-top: 9px !important;
  gap: 0 !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace #dashboard .d2-dashboard-context span {
  min-height: 0 !important;
  padding: 0 10px !important;
  color: var(--gm01-muted) !important;
  background: transparent !important;
  border: 0 !important;
  border-left: 1px solid var(--gm01-border) !important;
  border-radius: 0 !important;
  font-size: .68rem !important;
  font-weight: 600 !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace #dashboard .d2-dashboard-context span:first-child {
  padding-left: 0 !important;
  border-left: 0 !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace #dashboard :is(
  .dashboard-config-trigger,.industrial-dashboard-live
) {
  background: var(--gm01-surface) !important;
  background-image: none !important;
  border-color: var(--gm01-border-strong) !important;
  border-radius: var(--gm01-radius-control) !important;
  box-shadow: none !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace #dashboard .industrial-dashboard-live i {
  box-shadow: none !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace #dashboard .professional-kpi-card {
  background: var(--gm01-surface) !important;
  background-image: none !important;
  border-radius: var(--gm01-radius-card) !important;
  box-shadow: var(--gm01-shadow-card) !important;
  transition: border-color .14s ease, background-color .14s ease !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace #dashboard .professional-kpi-card::before {
  box-shadow: none !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace #dashboard .professional-kpi-card:hover {
  background: var(--gm01-surface-raised) !important;
  border-color: var(--gm01-border-strong) !important;
  box-shadow: var(--gm01-shadow-card) !important;
  transform: none !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace #dashboard :is(
  .professional-kpi-copy > span,.industrial-card-head > div > span
) {
  color: var(--gm01-muted) !important;
  letter-spacing: .055em !important;
}

/* Ícones 2D e superfícies neutras: sem relevo, brilho ou gradiente. */
body:not(.auth-required):not(.auth-loading) {
  background: #09121b !important;
  background-image: none !important;
}

body.theme-light:not(.auth-required):not(.auth-loading) {
  background: #f3f6f8 !important;
  background-image: none !important;
}

html.gm-professional-3d .gm-icon-rendered {
  filter: none !important;
}

html.gm-professional-3d .gm-icon-surface {
  color: color-mix(in srgb, var(--gm-icon-accent, #4a9bd1) 76%, #dcebf5) !important;
  background: color-mix(in srgb, var(--gm-icon-accent, #4a9bd1) 10%, #12212d) !important;
  background-image: none !important;
  border-color: color-mix(in srgb, var(--gm-icon-accent, #4a9bd1) 28%, #344b5e) !important;
  box-shadow: none !important;
}

html.gm-professional-3d .gm-icon-surface::before {
  display: none !important;
  content: none !important;
}

html.gm-professional-3d body.theme-light .gm-icon-surface {
  color: color-mix(in srgb, var(--gm-icon-accent, #1769aa) 82%, #17314b) !important;
  background: color-mix(in srgb, var(--gm-icon-accent, #1769aa) 8%, #ffffff) !important;
  border-color: color-mix(in srgb, var(--gm-icon-accent, #1769aa) 24%, #c6d3dd) !important;
}

/* Estados vazios não devem reservar áreas que parecem componentes quebrados. */
body:not(.auth-required):not(.auth-loading) #orders .os-detail-panel:not(.has-order) {
  display: none !important;
}

body:not(.auth-required):not(.auth-loading) #orders .os-content-grid:has(.os-detail-panel:not(.has-order)) {
  grid-template-columns: minmax(0, 1fr) !important;
}

body:not(.auth-required):not(.auth-loading) :is(
  #assetMetricStrip,#osMetricGrid,#preventiveMetricStrip,#preventiveAlertList,
  #materialsMetrics,#materialsAlertPanel
):empty {
  display: none !important;
}

/* Títulos e ordenação de tabelas seguem uma única linguagem visual. */
body:not(.auth-required):not(.auth-loading) #orders .os-title-icon {
  display: none !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace thead th button {
  min-height: auto !important;
  padding: 0 !important;
  color: inherit !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace thead th button .gm-button-icon {
  display: none !important;
}

body:not(.auth-required):not(.auth-loading):not(.panel-mode) .workspace thead th button[onclick*="sort"]::after {
  display: none !important;
  content: none !important;
}

body:not(.auth-required):not(.auth-loading) .workspace #createPreventivePlanBtn.btn.primary {
  color: #fff !important;
  background: var(--gm01-primary) !important;
  border-color: var(--gm01-primary) !important;
  box-shadow: none !important;
}

/* Login por endereço exclusivo da empresa: /nome-da-empresa. */
.auth-company-brand[hidden] {
  display: none !important;
}

html body.auth-link-company form#authLoginForm label.auth-domain-field {
  display: none !important;
}

body.auth-link-company .auth-card-logo-wrap {
  display: none !important;
}

body.auth-link-company .auth-company-brand:not([hidden]) {
  width: 100% !important;
  margin: 2px auto 18px !important;
  display: grid !important;
  justify-items: center !important;
  gap: 7px !important;
  text-align: center !important;
}

.auth-company-logo-frame {
  width: min(190px, 74vw) !important;
  height: 86px !important;
  padding: 10px 14px !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
  background: #fff !important;
  border: 1px solid rgba(148, 163, 184, .38) !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 20px rgba(2, 12, 27, .18) !important;
}

.auth-company-logo {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

.auth-company-logo[hidden],
.auth-company-logo-fallback[hidden] {
  display: none !important;
}

.auth-company-logo-fallback {
  width: 54px !important;
  height: 54px !important;
  display: grid !important;
  place-items: center !important;
  color: #fff !important;
  background: #0d7f8f !important;
  border-radius: 8px !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  letter-spacing: .04em !important;
}

.auth-company-name {
  max-width: 100% !important;
  color: #f8fafc !important;
  font-size: .9rem !important;
  font-weight: 750 !important;
  line-height: 1.25 !important;
  overflow-wrap: anywhere !important;
}

.auth-company-access-label {
  color: #9fb0c5 !important;
  font-size: .72rem !important;
  font-weight: 550 !important;
  line-height: 1.3 !important;
}

.auth-company-brand.is-unavailable .auth-company-logo-frame {
  background: #fff7ed !important;
  border-color: #fdba74 !important;
}

.auth-company-brand.is-unavailable .auth-company-logo-fallback {
  background: #c2410c !important;
}

body.auth-link-company .auth-main {
  min-height: 510px !important;
  padding-top: 24px !important;
}

body.auth-link-company .auth-main h2 {
  margin: 0 0 5px !important;
  color: #f8fafc !important;
  font-size: 1.35rem !important;
  font-weight: 750 !important;
}

body.auth-link-company #authSubtitle {
  display: block !important;
  margin: 0 0 24px !important;
  color: #9fb0c5 !important;
  font-size: .82rem !important;
  line-height: 1.45 !important;
  text-align: center !important;
  white-space: pre-line !important;
}

body.auth-link-company .auth-login-form {
  flex: 0 0 auto !important;
}

@media (max-width: 600px) {
  body.auth-link-company .auth-main {
    min-height: 0 !important;
    padding: 22px 20px 24px !important;
  }

  .auth-company-logo-frame {
    height: 78px !important;
  }
}

.platform-access-field #platformCreatedAccessUrl {
  display: block !important;
  margin-top: 5px !important;
  color: var(--gm01-primary, #1689c9) !important;
  font: 700 var(--font-size-sm, .82rem)/1.45 ui-monospace, SFMono-Regular, Consolas, monospace !important;
  overflow-wrap: anywhere !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
}

/* Painel operacional de O.S.: tela independente, sem navegação do sistema. */
html body.panel-mode.gm-top-navigation #mainNavigation,
html body.panel-mode :is(
  .topbar,
  .reference-topbar,
  .nav,
  .platform-owner-header,
  .mobile-bottom-nav,
  .nav-drawer-backdrop,
  .sidebar-edge-sensor,
  .sidebar-tooltip
) {
  display: none !important;
  visibility: hidden !important;
}

html body.panel-mode {
  --os-panel-bg: #04111e;
  --os-panel-surface: #081c2d;
  --os-panel-surface-raised: #0c2438;
  --os-panel-border: #1b405c;
  --os-panel-border-strong: #28658d;
  --os-panel-text: #f2f7fb;
  --os-panel-muted: #90a8ba;
  --os-panel-accent: #28a9e8;
  --os-panel-success: #26c979;
  --gm-topbar-height: 0px;
  --gm-module-nav-height: 0px;
  overflow: hidden !important;
  background: var(--os-panel-bg) !important;
}

html body.panel-mode .workspace,
html body.panel-mode.gm-top-navigation .workspace {
  width: 100% !important;
  max-width: none !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: var(--os-panel-bg) !important;
}

html body.panel-mode #activeOrders {
  width: 100% !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
}

html body.panel-mode #activeOrders > .gm01-page-header {
  display: none !important;
}

html body.panel-mode #activeOrders > .panel {
  width: 100% !important;
  height: 100dvh !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--os-panel-bg) !important;
  box-shadow: none !important;
}

html body.panel-mode .os-broadcast-head {
  display: grid !important;
  grid-template-columns: minmax(560px, 1fr) auto auto !important;
  align-items: center !important;
  gap: 14px 22px !important;
  padding: 16px 22px 14px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--os-panel-border) !important;
  background: linear-gradient(180deg, #0b2235 0%, #071a2a 100%) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18) !important;
}

html body.panel-mode .os-broadcast-brand {
  min-width: 0 !important;
  display: grid !important;
  align-items: center !important;
  gap: 10px !important;
}

html body.panel-mode .os-broadcast-brands {
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

html body.panel-mode .os-broadcast-system-logo {
  width: 182px !important;
  height: 56px !important;
  flex: 0 0 182px !important;
  display: grid !important;
  place-items: center !important;
  padding: 7px 13px !important;
  border: 1px solid #28658d !important;
  border-radius: 9px !important;
  background: linear-gradient(145deg, #082749, #061a31) !important;
}

html body.panel-mode .os-broadcast-system-logo img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

html body.panel-mode .os-broadcast-brand-divider {
  width: 18px !important;
  height: 1px !important;
  flex: 0 0 18px !important;
  background: #3f7597 !important;
}

html body.panel-mode .os-broadcast-company-brand {
  min-width: 210px !important;
  max-width: 330px !important;
  min-height: 56px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 6px 12px 6px 7px !important;
  border: 1px solid #a9c1d2 !important;
  border-radius: 9px !important;
  background: #fff !important;
  color: #102c45 !important;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .17) !important;
}

html body.panel-mode .os-broadcast-company-mark {
  position: relative !important;
  width: 68px !important;
  height: 42px !important;
  flex: 0 0 68px !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
  border: 1px solid #d3dee7 !important;
  border-radius: 6px !important;
  background: #f7fafc !important;
}

html body.panel-mode .os-broadcast-company-mark img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  padding: 3px !important;
  object-fit: contain !important;
}

html body.panel-mode .os-broadcast-company-mark img[hidden],
html body.panel-mode .os-broadcast-company-mark strong[hidden] {
  display: none !important;
}

html body.panel-mode .os-broadcast-company-mark strong {
  color: #fff !important;
  width: 100% !important;
  height: 100% !important;
  display: grid !important;
  place-items: center !important;
  background: #0d7f8f !important;
  font-size: .88rem !important;
  letter-spacing: .04em !important;
}

html body.panel-mode .os-broadcast-company-brand > span:last-child {
  min-width: 0 !important;
  display: grid !important;
  gap: 2px !important;
}

html body.panel-mode .os-broadcast-company-brand small {
  color: #60778a !important;
  font-size: .58rem !important;
  font-weight: 800 !important;
  letter-spacing: .09em !important;
}

html body.panel-mode .os-broadcast-company-brand > span:last-child > strong {
  overflow: hidden !important;
  color: #102c45 !important;
  font-size: .78rem !important;
  font-weight: 800 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

html body.panel-mode .os-broadcast-title {
  min-width: 0 !important;
  display: grid !important;
  gap: 1px !important;
}

html body.panel-mode .os-broadcast-title > span {
  color: var(--os-panel-accent) !important;
  font-size: .6rem !important;
  font-weight: 850 !important;
  letter-spacing: .12em !important;
}

html body.panel-mode .os-broadcast-title h2 {
  margin: 0 !important;
  color: var(--os-panel-text) !important;
  font-size: 1.28rem !important;
  font-weight: 780 !important;
  line-height: 1.18 !important;
}

html body.panel-mode .os-broadcast-title p {
  margin: 1px 0 0 !important;
  color: var(--os-panel-muted) !important;
  font-size: .68rem !important;
}

html body.panel-mode .os-broadcast-clock {
  min-width: 150px !important;
  padding-right: 2px !important;
}

html body.panel-mode .os-broadcast-clock time {
  font-size: 1.75rem !important;
  font-variant-numeric: tabular-nums !important;
}

html body.panel-mode .os-broadcast-actions {
  flex-wrap: nowrap !important;
}

html body.panel-mode .os-broadcast-actions .btn {
  min-height: 38px !important;
  border-color: #315b78 !important;
  border-radius: 7px !important;
  background: #0b2235 !important;
  color: #dfeef8 !important;
  box-shadow: none !important;
  white-space: nowrap !important;
}

html body.panel-mode .os-panel-filter-toggle {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

html body.panel-mode .os-panel-filter-toggle i {
  width: 8px !important;
  height: 8px !important;
  display: block !important;
  border-right: 2px solid currentColor !important;
  border-bottom: 2px solid currentColor !important;
  transform: rotate(225deg) translate(-1px, -1px) !important;
  transition: transform .16s ease !important;
}

html body.panel-mode .os-panel-filter-toggle[aria-expanded="false"] i {
  transform: rotate(45deg) translate(-1px, -1px) !important;
}

html body.panel-mode .os-broadcast-filters {
  grid-column: 1 / -1 !important;
  display: grid !important;
  grid-template-columns: minmax(260px, 1.55fr) repeat(3, minmax(170px, 1fr)) !important;
  gap: 8px !important;
  padding: 10px !important;
  border: 1px solid var(--os-panel-border) !important;
  border-radius: 10px !important;
  background: #061724 !important;
}

html body.panel-mode .os-broadcast-filters[hidden] {
  display: none !important;
}

html body.panel-mode .os-broadcast-filters label {
  min-width: 0 !important;
  gap: 5px !important;
  padding: 8px 10px !important;
  border: 1px solid #183b55 !important;
  border-radius: 7px !important;
  background: #0a2032 !important;
}

html body.panel-mode .os-broadcast-filters label > span {
  color: #55b7f0 !important;
  font-size: .58rem !important;
}

html body.panel-mode .os-broadcast-filters .field {
  width: 100% !important;
  min-height: 34px !important;
  padding: 5px 7px !important;
  border: 0 !important;
  border-bottom: 1px solid #315a75 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #e7f2fa !important;
  box-shadow: none !important;
}

html body.panel-mode .os-broadcast-metrics {
  grid-column: 1 / -1 !important;
  gap: 8px !important;
}

html body.panel-mode .os-broadcast-metrics > span {
  min-height: 42px !important;
  padding: 8px 11px !important;
  border-color: var(--os-panel-border) !important;
  background: #081c2d !important;
}

html body.panel-mode #activeOrdersPanel {
  min-height: 0 !important;
  padding: 14px 18px 22px !important;
  background: var(--os-panel-bg) !important;
}

html body.panel-mode #activeOrdersPanel .os-live-card {
  border-color: #214a67 !important;
  border-left-width: 4px !important;
  border-radius: 8px !important;
  background: #0a1e2f !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .18) !important;
}

html body.panel-mode #activeOrdersPanel .os-panel-empty {
  min-height: 46vh !important;
  align-content: center !important;
  border: 1px dashed #244a65 !important;
  border-radius: 10px !important;
  background: #071827 !important;
}

html body.panel-mode #activeOrdersPanel .os-panel-empty strong {
  color: #dcebf5 !important;
  font-size: 1rem !important;
}

html body.panel-mode #activeOrdersPanel .os-panel-empty span {
  max-width: 520px !important;
  color: var(--os-panel-muted) !important;
  font-size: .78rem !important;
}

html body.theme-light.panel-mode {
  --os-panel-bg: #eaf1f6;
  --os-panel-surface: #fff;
  --os-panel-surface-raised: #f7fafc;
  --os-panel-border: #bfd1df;
  --os-panel-border-strong: #7da7c3;
  --os-panel-text: #102c45;
  --os-panel-muted: #61798b;
  --os-panel-accent: #087ab8;
}

html body.theme-light.panel-mode .os-broadcast-head {
  background: linear-gradient(180deg, #fff, #f4f8fb) !important;
  box-shadow: 0 8px 22px rgba(31, 66, 94, .10) !important;
}

html body.theme-light.panel-mode .os-broadcast-title h2,
html body.theme-light.panel-mode .os-broadcast-clock time {
  color: var(--os-panel-text) !important;
}

html body.theme-light.panel-mode .os-broadcast-filters {
  background: #edf4f8 !important;
}

html body.theme-light.panel-mode .os-broadcast-filters label,
html body.theme-light.panel-mode .os-broadcast-metrics > span {
  border-color: #c4d5e1 !important;
  background: #fff !important;
}

html body.theme-light.panel-mode .os-broadcast-filters .field {
  border-bottom-color: #9fb8ca !important;
  color: #17324b !important;
}

html body.theme-light.panel-mode .os-broadcast-actions .btn {
  border-color: #aac1d1 !important;
  background: #fff !important;
  color: #17324b !important;
}

html body.theme-light.panel-mode #activeOrdersPanel .os-panel-empty {
  border-color: #a9c2d4 !important;
  background: #fff !important;
}

html body.theme-light.panel-mode #activeOrdersPanel .os-panel-empty strong {
  color: #17324b !important;
}

@media (max-width: 1180px) {
  html body.panel-mode .os-broadcast-head {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  html body.panel-mode .os-broadcast-actions {
    grid-column: auto !important;
  }

  html body.panel-mode .os-broadcast-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  html body.panel-mode {
    overflow: auto !important;
  }

  html body.panel-mode .workspace,
  html body.panel-mode.gm-top-navigation .workspace,
  html body.panel-mode #activeOrders,
  html body.panel-mode #activeOrders > .panel {
    height: auto !important;
    min-height: 100dvh !important;
    overflow: visible !important;
  }

  html body.panel-mode .os-broadcast-head {
    grid-template-columns: 1fr auto !important;
    gap: 12px !important;
    padding: 12px !important;
  }

  html body.panel-mode .os-broadcast-brand {
    grid-column: 1 / -1 !important;
  }

  html body.panel-mode .os-broadcast-brands {
    align-items: stretch !important;
  }

  html body.panel-mode .os-broadcast-system-logo {
    width: 150px !important;
    height: 52px !important;
    flex-basis: 150px !important;
  }

  html body.panel-mode .os-broadcast-company-brand {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  html body.panel-mode .os-broadcast-company-mark {
    width: 52px !important;
    flex-basis: 52px !important;
  }

  html body.panel-mode .os-broadcast-clock {
    min-width: 0 !important;
    justify-items: start !important;
  }

  html body.panel-mode .os-broadcast-actions {
    justify-content: flex-end !important;
  }

  html body.panel-mode .os-broadcast-actions .btn {
    flex: 0 1 auto !important;
  }

  html body.panel-mode .os-broadcast-filters {
    grid-template-columns: 1fr !important;
  }

  html body.panel-mode .os-broadcast-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  html body.panel-mode #activeOrdersPanel {
    padding: 10px 12px 18px !important;
  }
}

@media (max-width: 480px) {
  html body.panel-mode .os-broadcast-brands {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  html body.panel-mode .os-broadcast-system-logo,
  html body.panel-mode .os-broadcast-company-brand {
    width: 100% !important;
    max-width: none !important;
  }

  html body.panel-mode .os-broadcast-brand-divider {
    display: none !important;
  }
}

/* Cenário administrativo e removível para auditoria dos indicadores */
#demoMetricsAuditPanel[hidden] {
  display: none !important;
}

.demo-metrics-audit-panel {
  display: grid;
  gap: 16px;
  margin: 14px auto 0;
  max-width: 1480px;
  padding: 18px;
  border: 1px solid var(--line, #cbd8e6);
  border-radius: 12px;
  background: var(--panel, #fff);
}

.demo-metrics-audit-copy h2 {
  margin: 4px 0 5px;
  font-size: 18px;
}

.demo-metrics-audit-copy p {
  margin: 0;
  max-width: 820px;
  color: var(--muted, #60748a);
}

.demo-metrics-audit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.demo-metrics-audit-grid article {
  display: grid;
  gap: 5px;
  min-height: 76px;
  padding: 13px 14px;
  border: 1px solid var(--line, #cbd8e6);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel, #fff) 88%, var(--accent, #2387ff) 12%);
}

.demo-metrics-audit-grid span,
.demo-metrics-audit-actions small {
  color: var(--muted, #60748a);
  font-size: 12px;
}

.demo-metrics-audit-grid strong {
  align-self: end;
  font-size: 20px;
}

.demo-metrics-audit-actions,
.demo-metrics-audit-actions > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

@media (max-width: 900px) {
  .demo-metrics-audit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .demo-metrics-audit-panel {
    margin-top: 10px;
    padding: 14px;
  }

  .demo-metrics-audit-grid {
    grid-template-columns: 1fr;
  }

  .demo-metrics-audit-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .demo-metrics-audit-actions > div,
  .demo-metrics-audit-actions .btn {
    width: 100%;
  }
}
