/* Ajustes visuais de 21/11/2026: somente tela; medidas e fluxos preservados. */
@media screen {
  html:has(body[data-access]:not(.auth-page)) {
    background-color: #e3e8ed;
  }

  body[data-access]:not(.auth-page) {
    --sgs-canvas: #e3e8ed;
    --sgs-surface: #edf1f5;
    --sgs-field: #f5f7f9;
    --sgs-header: #dce4ec;
    --sgs-stripe: #e6ecf2;
    --line: #c7d0d9;
    --selected: #dae4ee;
    background-color: var(--sgs-canvas);
  }

  body[data-access]:not(.auth-page):has(.panorama) {
    background-color: var(--sgs-canvas);
  }

  body[data-access]:not(.auth-page) :is(
    .titlebar, #navigation, #statusbar, .panel, .panorama-bottom .panel, .tabbody,
    fieldset, .panorama-filters fieldset, .cl-card, .cl-filter,
    .co-sort, .co-address-editor, .co-billing, .co-notes, .co-contacts,
    .co-company-edit, .co-division-edit, .co-contacts fieldset,
    .cw-panel, .tr-panel, .fu-filters, .fu-columns .panel,
    .fu-grid, .fu-note, .auth-box, dialog, #quote-picker, #quote-discount,
    #quote-company-confirm, #cw-context-menu
  ) {
    background-color: var(--sgs-surface);
  }

  body[data-access]:not(.auth-page) :is(
    .panorama-grid, .panorama-subgrid, .grid-wrap, .co-grid,
    .cl-grid, .cl-tech-grid, .quote-grid, .os-table, .os-calendar,
    .cw-grid, .tr-grid, .cr-table, #browser-body
  ) {
    background-color: var(--sgs-surface);
  }

  body[data-access]:not(.auth-page) :is(#toolbar, dialog header, .os-title, .contactline, .cr-counts) {
    background-color: var(--sgs-header);
  }

  body[data-access]:not(.auth-page) .cr-parameter-summary {
    background-color: #e7edf3;
  }

  body[data-access]:not(.auth-page) button {
    background-color: #eef2f6;
  }

  body[data-access]:not(.auth-page) :is(input, select, textarea):not([type=checkbox]):not([type=radio]) {
    background-color: var(--sgs-field);
  }

  body[data-access]:not(.auth-page) :is(input[readonly], textarea[readonly], select:disabled):not([type=checkbox]):not([type=radio]) {
    background-color: #e7edf3;
  }

  body[data-access]:not(.auth-page) th,
  body[data-access]:not(.auth-page) :is(.panorama-grid, .co-grid, .quote-grid, .cw-grid, .tr-grid, .cr-table) th {
    background-color: var(--sgs-header);
  }

  body[data-access]:not(.auth-page) tbody tr,
  body[data-access]:not(.auth-page) :is(.panorama-grid, .quote-grid) tbody tr {
    background-color: var(--sgs-surface) !important;
  }

  body[data-access]:not(.auth-page) tbody tr:nth-child(even),
  body[data-access]:not(.auth-page) :is(.panorama-grid, .quote-grid) tbody tr:nth-child(even) {
    background-color: var(--sgs-stripe) !important;
  }

  body[data-access]:not(.auth-page) tbody tr:hover,
  body[data-access]:not(.auth-page) :is(.panorama-grid, .quote-grid) tbody tr:hover {
    background-color: #dde7f0 !important;
  }

  body[data-access]:not(.auth-page) tbody tr.selected,
  body[data-access]:not(.auth-page) tbody tr.selected:hover,
  body[data-access]:not(.auth-page) :is(.panorama-grid, .quote-grid) tbody tr.selected {
    background-color: var(--selected) !important;
  }

  /* A classe attached já é calculada pelos anexos da categoria na O.S. */
  body[data-access]:not(.auth-page) button[data-action="files"].attached {
    color: #ae2121;
    background-color: #f4e2db;
    border-color: #bc7b6e;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  body[data-access]:not(.auth-page) button[data-action="files"].attached:hover:not(:disabled) {
    color: #941b1b;
    background-color: #edcfc5;
    border-color: #a35d4e;
  }

  body[data-access]:not(.auth-page) button[data-action="os-calibration"]:not(:disabled) {
    color: #14558a;
    background-color: #dfeaf4;
    border-color: #8daac3;
    font-weight: 700;
  }

  body[data-access]:not(.auth-page) button[data-action="os-calibration"]:hover:not(:disabled) {
    color: #104773;
    background-color: #ccdeed;
    border-color: #6a91b0;
  }

  body[data-access]:not(.auth-page) button[data-cr="generate"] {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 8px 18px;
    font-size: 15px;
    font-weight: 600;
  }

  body[data-access]:not(.auth-page) button[data-cr="generate"]::before {
    content: "";
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    background: currentColor;
    mask: url('/theme-icons/icon-da979e89cca9.svg') center / contain no-repeat;
    -webkit-mask: url('/theme-icons/icon-da979e89cca9.svg') center / contain no-repeat;
  }

  body[data-access]:not(.auth-page) button[data-cr="document-release"] {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    font-weight: 600;
  }

  body[data-access]:not(.auth-page) button[data-cr="document-release"]:not(:disabled) {
    color: #245e31;
    background-color: #e0ecd9;
    border-color: #93af86;
  }

  body[data-access]:not(.auth-page) button[data-cr="document-release"]:hover:not(:disabled) {
    color: #1b4e26;
    background-color: #d0e2c5;
    border-color: #779b68;
  }

  body[data-access]:not(.auth-page) button[data-cr="document-release"]::before {
    content: "✓";
    color: #23723b;
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
  }

  body[data-access]:not(.auth-page) button[data-cr="document-release"]:disabled::before {
    color: #929b8c;
  }
}

/* Paleta do SGS legado. Apenas cores de tela; fontes, medidas e ações preservadas. */
@media screen {
  html:has(body[data-access]:not(.auth-page)) { background-color: #eeeedc; }
  body[data-access]:not(.auth-page) {
    --ink: #174b8b;
    --text: #29313c;
    --muted: #626976;
    --olive: #254f89;
    --sgs-canvas: #eeeedc;
    --sgs-surface: #efefed;
    --sgs-field: #fcfcf5;
    --sgs-header: #c0c6d7;
    --sgs-grid: #f6f6e3;
    --sgs-stripe: #eeeeda;
    --line: #bfc1c3;
    --selected: #086bb9;
    color: var(--text);
  }
  body[data-access]:not(.auth-page) :is(
    .quote-header, .quote-equipment, .quote-price-panel, .price-master,
    .rc-panel, .ob-preview, .cr-parameter-summary, .cw-calibration-header,
    .cw-certificate-line, .cw-permanent
  ) { background-color: var(--sgs-surface); }
  body[data-access]:not(.auth-page) :is(
    .panorama-grid, .panorama-subgrid, .grid-wrap, .co-grid, .cl-grid,
    .cl-tech-grid, .quote-grid, .os-table, .os-calendar, .cw-grid, .tr-grid,
    .cr-table, #browser-body, .fu-grid, .equipment-total, .quote-totals,
    .fu-total, .overview-record-info
  ) { background-color: var(--sgs-grid); border-color: var(--line); }
  body[data-access]:not(.auth-page) :is(#navigation, #toolbar, .co-bar, .cl-tech-actions, .fu-strip) {
    background-color: #bbc2d5;
    border-color: #929fb7;
  }
  body[data-access]:not(.auth-page) :is(.titlebar, #statusbar) { border-color: var(--line); }
  body[data-access]:not(.auth-page) .titlebar > strong::after,
  body[data-access]:not(.auth-page) .titlebar > span,
  body[data-access]:not(.auth-page) #statusbar { color: #4a5668; }
  body[data-access]:not(.auth-page) .titlebar > span > span { color: #23446e; background-color: #e5e7eb; border-color: #bec5d0; }
  body[data-access]:not(.auth-page) button { color: #183d76; background-color: #ededeb; border-color: #9aa7bc; }
  body[data-access]:not(.auth-page) button:hover:not(:disabled) { color: #14376c; background-color: #dde5ef; border-color: #6985b0; }
  body[data-access]:not(.auth-page) button:disabled { color: #7b8087; background-color: #e8e8e5; border-color: #c4c6c8; }
  body[data-access]:not(.auth-page) :is(#navigation button, .co-bar button, .cl-tech-actions button) {
    color: #173461; background-color: transparent;
  }
  body[data-access]:not(.auth-page) #navigation button:hover:not(.active) { color: #123a75; background-color: #dce1ec; border-color: #a6b3ca; }
  body[data-access]:not(.auth-page) #navigation button.active { color: #fff; background-color: #174b8b; border-color: #174b8b; }
  body[data-access]:not(.auth-page) .department-modes button[aria-pressed=true] { color: #fff; background-color: #174b8b; border-color: #174b8b; }
  body[data-access]:not(.auth-page) :is(.panorama-actions button:first-child, .cw-actions .primary) { color: #fff; background-color: #174b8b; border-color: #174b8b; }
  body[data-access]:not(.auth-page) :is(.panorama-actions button:first-child, .cw-actions .primary):hover:not(:disabled) { color: #fff; background-color: #123c71; border-color: #123c71; }
  body[data-access]:not(.auth-page) :is(.tabs button, .co-tabs button) { color: #243c66; background-color: #e7e8eb; border-color: #b1bacb; }
  body[data-access]:not(.auth-page) :is(.tabs button.active, .co-tabs button.active, .panorama-toolbar button[aria-pressed=true]) {
    color: #103c7b; background-color: #d2dcec; border-color: #839dc2;
  }
  body[data-access]:not(.auth-page) :is(input, select, textarea):not([type=checkbox]):not([type=radio]) { color: #26364e; border-color: #b7bcc3; }
  body[data-access]:not(.auth-page) :is(input[readonly], textarea[readonly], select:disabled):not([type=checkbox]):not([type=radio]) {
    color: #293d63; background-color: #f4f4df; border-color: #c3c5ba;
  }
  body[data-access]:not(.auth-page) :is(input, select, textarea):focus,
  body[data-access]:not(.auth-page) button:focus-visible { outline-color: #3e75b3; }
  body[data-access]:not(.auth-page) :is(input[type=checkbox], input[type=radio]) { accent-color: #2065a6; }
  body[data-access]:not(.auth-page) :is(legend, .os-title, .quote-title, .co-title,
    .section-title, .native-links strong, .quote-panel-heading strong,
    .panorama-toolbar h1, .panorama-bottom h2, .co-screen h2, .cl-card h2,
    .cl-filter strong, .cw-panel h2, .tr-panel h2, .cr-workflow h3,
    .price-master-heading h1, .rc-panel h1, .fu-screen h2, .fu-screen h3,
    .quote-item-form h2, #quote-print-form h2, #quote-discount h2,
    #quote-company-detail h3, .contactline
  ) { color: #153d89; border-color: var(--line); }
  body[data-access]:not(.auth-page) :is(.os-title, .quote-title) { background-color: #e7e7e3; }
  body[data-access]:not(.auth-page) :is(.quote-header .field label, .quote-numbers .field label,
    .co-field, .cl-field label, .panorama-filters label, .cl-filter label
  ) { color: #3b4350; }
  body[data-access]:not(.auth-page) :is(.co-search label, .co-block-state, .co-shortcuts button,
    .quote-panel-heading button, .quote-bottom-actions button, .price-master-heading > button,
    .equipment-total, .quote-totals, .fu-total, .native-links button
  ) { color: #18458a; }
  body[data-access]:not(.auth-page) :is(.quote-zoom button, .linklike, .blue) { color: #18458a !important; }
  body[data-access]:not(.auth-page) :is(.panorama-filters button[type=submit], .co-billing > button) {
    color: #24487c; background-color: #e6e9ef; border-color: #a9b6ca;
  }
  body[data-access]:not(.auth-page) th,
  body[data-access]:not(.auth-page) :is(.panorama-grid, .co-grid, .quote-grid, .cw-grid, .tr-grid, .cr-table) th {
    color: #283442; background-color: #dfdfdc; border-color: #bcbfc3;
  }
  body[data-access]:not(.auth-page) td,
  body[data-access]:not(.auth-page) :is(.panorama-grid, .co-grid, .quote-grid, .panorama-subgrid) td {
    color: #173c85; border-color: #d5d6c8;
  }
  body[data-access]:not(.auth-page) .panorama-grid :is(td.date-column, .row-indicator),
  body[data-access]:not(.auth-page) :is(td[data-column=OS], td[data-column=ORC]) { color: #173c85; }
  body[data-access]:not(.auth-page) tbody tr,
  body[data-access]:not(.auth-page) :is(.panorama-grid, .quote-grid) tbody tr { background-color: var(--sgs-grid) !important; }
  body[data-access]:not(.auth-page) tbody tr:nth-child(even),
  body[data-access]:not(.auth-page) :is(.panorama-grid, .quote-grid) tbody tr:nth-child(even) { background-color: var(--sgs-stripe) !important; }
  body[data-access]:not(.auth-page) tbody tr:hover,
  body[data-access]:not(.auth-page) :is(.panorama-grid, .quote-grid) tbody tr:hover { background-color: #e0e8f2 !important; }
  body[data-access]:not(.auth-page) tbody tr.selected,
  body[data-access]:not(.auth-page) tbody tr.selected:hover,
  body[data-access]:not(.auth-page) :is(.panorama-grid, .quote-grid) tbody tr.selected { background-color: var(--selected) !important; }
  body[data-access]:not(.auth-page) tbody tr.selected:not(.cr-alert-row) td:not(.cu-alert):not(.fu-overdue):not(.fu-today) {
    color: #fff !important; background-color: transparent !important; border-bottom-color: #8aa9c5;
  }
  body[data-access]:not(.auth-page) tbody tr.selected td.fu-overdue { background-color: #fff0eb !important; }
  body[data-access]:not(.auth-page) tbody tr.selected td.fu-today { background-color: #fff7e5 !important; }
  body[data-access]:not(.auth-page) tbody tr.selected td:first-child { box-shadow: inset 3px 0 #164677; }
  body[data-access]:not(.auth-page) tbody tr.selected:not(.cr-alert-row) td:not(.cu-alert) :is(input, select) { color: #fff; }
  body[data-access]:not(.auth-page) tbody tr.selected:not(.cr-alert-row) td:not(.cu-alert) :is(input, select):focus {
    color: #26364e !important; background-color: #fcfcf5 !important;
  }
  body[data-access]:not(.auth-page) tbody tr.selected select option { color: #26364e; background-color: #fcfcf5; }
  body[data-access]:not(.auth-page) .panorama-grid tr:focus-visible { outline-color: #3e75b3; }
  body[data-access]:not(.auth-page) :is(.panorama-grid, .panorama-subgrid, .grid-wrap, .co-grid, .cl-grid, .cl-tech-grid, .quote-grid) {
    scrollbar-color: #a5aab4 #eeeeda;
  }
  body[data-access]:not(.auth-page) dialog { border-color: #aab3c0; }
  body[data-access]:not(.auth-page) dialog header { color: #173d7a; border-color: #9daac1; }
  body[data-access]:not(.auth-page) dialog::backdrop { background-color: #222d4170; }
  body[data-access]:not(.auth-page) #statusbar button { color: #304e7b; background-color: #ecece7; border-color: #b8bdc5; }
  body[data-access]:not(.auth-page) #toast { background-color: #233b5b; }
  /* Cores funcionais aprovadas: anexos, calibração e conclusão documental. */
  body[data-access]:not(.auth-page) button[data-action="files"].attached { color: #ae2121; background-color: #f4e2db; border-color: #bc7b6e; }
  body[data-access]:not(.auth-page) button[data-action="files"].attached:hover:not(:disabled) { color: #941b1b; background-color: #edcfc5; border-color: #a35d4e; }
  body[data-access]:not(.auth-page) button[data-action="os-calibration"]:not(:disabled) { color: #14558a; background-color: #dfeaf4; border-color: #8daac3; }
  body[data-access]:not(.auth-page) button[data-cr="document-release"]:not(:disabled) { color: #245e31; background-color: #e0ecd9; border-color: #93af86; }
  body[data-access]:not(.auth-page) button[data-cr="document-release"]:hover:not(:disabled) { color: #1b4e26; background-color: #d0e2c5; border-color: #779b68; }
}
