/* Working screens use neutral surfaces; Home retains its module palette. */
body .app-shell:not(.home-shell) { --erp-template-canvas: #f5f7fa; --erp-template-radius: 6px; }
body .app-shell:not(.home-shell) .panel:not(.danger-panel):not(.warning-panel):not(.success-panel) {
 background: #fff; border-color: #d9e1e9; border-radius: 6px; box-shadow: none !important;
}
body .app-shell:not(.home-shell) .erp-mobile-record { box-shadow: none !important; --erp-mobile-card-header-bg: #fff !important; }
body .app-shell:not(.home-shell) .list-page > .page-header { background: transparent !important; box-shadow: none; }
body .app-shell:not(.home-shell) .erp-responsive-actions > .erp-responsive-actions-toggle {
 background: #fff !important; border-color: #d0dae5 !important; color: #1764a5 !important;
}
body .app-shell:not(.home-shell) .erp-responsive-actions > .erp-responsive-actions-toggle[aria-expanded="true"] {
 background: #edf4ff !important; border-color: #a9c3df !important;
}
.app-shell .pedidos-title-count { display: none; }
.app-shell .erp-responsive-actions-summary { font-size: .8rem; font-weight: 400; color: #52677d; }
.app-shell .erp-responsive-actions-desktop-summary { margin-inline-start: auto; font-size: .8rem; color: #52677d; }
@media (max-width: 720px) {
 .app-shell .erp-responsive-actions-desktop-summary { display: none; }
 body .app-shell:not(.home-shell) .erp-ribbon-panel { padding: 0 !important; border: 0 !important; background: transparent !important; }
 body .app-shell:not(.home-shell) .erp-ribbon-panel > .erp-ribbon { gap: 0 !important; }
 body .app-shell:not(.home-shell) .erp-ribbon-panel .erp-responsive-actions-toggle {
  min-height: 44px !important; padding: 8px 10px !important; font-size: .9rem !important;
 }
 body .app-shell:not(.home-shell) .erp-responsive-actions-summary { margin-inline-start: auto; }
 body .app-shell .pedidos-list-page > .page-header { margin-bottom: 10px !important; gap: 8px; }
 body .app-shell .pedidos-list-page > .page-header .pedidos-page-hint,
 body .app-shell .pedidos-list-page > .page-header .erp-list-result-count { display: none; }
 body .app-shell .pedidos-list-page .pedidos-title-count { display: inline; font-size: .75em; font-weight: 400; color: #52677d; }
 body .app-shell .pedidos-list-page > .page-header .header-actions { margin: 4px 0 0 !important; gap: 8px; }
 body .app-shell .pedidos-list-page > .page-header .header-actions > .erp-responsive-actions { width: 100%; max-width: none; }
 body .app-shell .pedidos-list-page .list-toolbar-panel { padding: 10px !important; }
 body .app-shell .pedidos-list-page .pedidos-search-toolbar,
 body .app-shell .pedidos-list-page .pedidos-search-row,
 body .app-shell .pedidos-list-page .pedidos-search-actions { gap: 8px !important; }
 body .app-shell .pedidos-list-page .pedidos-search-field > label { margin: 0 0 4px; }
 body .app-shell .pedidos-list-page .grid-panel .order-series-tabs-panel {
  padding: 0 !important; margin: 0 !important; border: 0 !important; border-radius: 0;
  background: transparent !important;
 }
 body .app-shell .pedidos-list-page .order-series-tabs { gap: 6px; }
 body .app-shell .pedidos-list-page .order-series-tab {
  min-height: 44px; padding: 6px 10px; border: 1px solid #d0dae5; border-radius: 6px 6px 0 0; background: #fff;
 }
 body .app-shell .pedidos-list-page .order-series-tab.active { color: #1764a5; border-color: #a9c3df; background: #edf4ff; }
}
@media (max-width: 600px) {
 body .shell.app-shell .erp-shell-header { padding: 8px 12px 0; gap: 6px; }
 body .shell.app-shell .erp-shell-header .erp-home-mobile-logo img { width: 160px; }
 body .shell.app-shell .erp-shell-header .erp-topline { gap: 8px; margin: 0 0 6px; }
 body .shell.app-shell .erp-shell-header .erp-company-switcher > label { font-size: .75rem; }
 body .shell.app-shell .erp-shell-header .erp-company-switcher { gap: 6px; align-items: center; }
 body .shell.app-shell .erp-shell-header .erp-workspace-tabs { margin: 0 -12px; padding: 4px 12px 0; }
 body .shell.app-shell .erp-shell-header .erp-workspace-tab-link { padding: 0 10px; }
 body .app-shell:not(.home-shell) > .content > .erp-page { padding: 12px !important; }
 body .app-shell:not(.home-shell) .document-mobile-overview,
 body .app-shell:not(.home-shell) .document-mobile-line { border-radius: 6px; box-shadow: none; }
 body .app-shell:not(.home-shell) .document-mobile-overview .document-overview-party {
  background: #fff; border-left: 3px solid #1764a5; border-bottom: 1px solid #e0e6ed;
 }
 body .app-shell:not(.home-shell) .document-mobile-overview .document-overview-outstanding { background: #fff; color: #52677d; }
 body .app-shell:not(.home-shell) .document-mobile-overview .document-overview-total { background: #edf4ff; color: #123f65; }
 body .app-shell:not(.home-shell) .document-mobile-overview .document-state-label {
  display: inline-block; padding: 4px 8px; border-radius: 4px; background: #eef2f6; color: #475569; font-size: .9rem;
 }
 body .app-shell:not(.home-shell) .document-mobile-overview .document-state-label.is-success { background: #eaf7f0; color: #177c59; }
 body .app-shell:not(.home-shell) .document-mobile-overview .document-state-label.is-pending { background: #fff3ea; color: #a34712; }
 body .app-shell:not(.home-shell) .document-mobile-overview .document-state-label.is-danger { background: #ffecec; color: #b42318; }
}

/* Desktop document toolbars use the approved mobile action colors. */
@media (min-width: 721px) {
 .app-shell :is(.pedido-actionbar, .commercial-ficha-header) .erp-responsive-actions-content .erp-desktop-action-caption { display: none; }
 .app-shell :is(.pedido-actionbar, .commercial-ficha-header) .erp-responsive-actions-content .erp-icon { width: 20px; height: 20px; }
 body .app-shell:not(.home-shell) :is(.pedidos-list-page .pedido-actionbar, .commercial-ficha-header .header-actions, .commercial-bottom-actions) .erp-responsive-actions-content :is(.erp-ribbon-button, .erp-action-button):not(.erp-action-primary) {
  background: #fff !important; color: #182d40 !important; border: 1px solid #d7e0e8 !important;
  box-shadow: none !important;
 }
 body .app-shell:not(.home-shell) :is(.pedidos-list-page .pedido-actionbar, .commercial-ficha-header .header-actions, .commercial-bottom-actions) .erp-responsive-actions-content :is(.erp-ribbon-button, .erp-action-button) .erp-icon { color: #1764a5; }
 body .app-shell:not(.home-shell) :is(.pedidos-list-page .pedido-actionbar, .commercial-ficha-header .header-actions, .commercial-bottom-actions) .erp-responsive-actions-content :is(.erp-ribbon-danger, .commercial-delete-action):not(.erp-action-primary),
 body .app-shell:not(.home-shell) :is(.pedidos-list-page .pedido-actionbar, .commercial-ficha-header .header-actions, .commercial-bottom-actions) .erp-responsive-actions-content :is(.erp-ribbon-danger, .commercial-delete-action) .erp-icon { color: #ac3542 !important; }
 body .app-shell:not(.home-shell) :is(.pedidos-list-page .pedido-actionbar, .commercial-ficha-header .header-actions, .commercial-bottom-actions) .erp-responsive-actions-content :is(.erp-ribbon-button, .erp-action-button):disabled { opacity: .4; }
}

/* Approved mobile working layout (proposal 383). Home keeps its own palette. */
.commercial-ficha-heading { display: flex; align-items: center; gap: 10px; }
.commercial-title-block { min-width: 0; }
body .app-shell .commercial-heading-back { width: 44px; min-width: 44px; padding: 0; }
@media (max-width: 720px) {
 body .app-shell:not(.home-shell) :is(.pedidos-list-page > .page-header .header-actions, .commercial-ficha-header .header-actions, .commercial-bottom-actions) {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
 }
 body .app-shell:not(.home-shell) .erp-responsive-actions-with-primary > .erp-action-primary {
  width: 100% !important; margin: 0 !important; align-self: stretch; justify-self: stretch;
 }
 body .app-shell:not(.home-shell) :is(.pedidos-list-page .header-actions, .pedidos-list-page .erp-ribbon-panel, .commercial-ficha-header .header-actions, .commercial-bottom-actions) :is(.erp-action-button, .erp-ribbon-button) {
  height: auto !important; min-height: 44px !important; border-radius: 6px !important;
  padding: 4px 10px !important; font-size: clamp(14px, 4.3vw, 17px) !important;
  font-weight: 400 !important; line-height: 1.15;
 }
 body .app-shell:not(.home-shell) .erp-ribbon-panel .erp-responsive-actions-toggle {
  justify-content: flex-start; background: #fff !important; font-weight: 400;
 }
 body .app-shell .pedidos-list-page .pedido-action-panel { margin-top: 12px !important; margin-bottom: 10px !important; }
 body .app-shell:not(.home-shell) .erp-responsive-actions-content.is-expanded {
  margin: 0; padding: 10px; border: 1px solid #d7e0e8; border-radius: 6px;
  background: #fff; gap: 8px;
 }
 body .app-shell:not(.home-shell) .erp-responsive-actions-content :is(.erp-ribbon-button, .erp-action-button):not(.erp-action-primary) {
  background: #fff !important; color: #182d40 !important; border: 1px solid #d7e0e8 !important;
  box-shadow: none !important; justify-content: flex-start;
 }
 body .app-shell:not(.home-shell) .erp-responsive-actions-content :is(.erp-ribbon-button, .erp-action-button) .erp-icon { color: #1764a5; width: 20px; height: 20px; }
 body .app-shell:not(.home-shell) .erp-responsive-actions-content :is(.erp-ribbon-danger, .commercial-delete-action):not(.erp-action-primary),
 body .app-shell:not(.home-shell) .erp-responsive-actions-content :is(.erp-ribbon-danger, .commercial-delete-action) .erp-icon { color: #ac3542 !important; }
 body .app-shell:not(.home-shell) .erp-responsive-actions-content :is(.erp-ribbon-button, .erp-action-button):disabled { opacity: .4; }
 body .app-shell .erp-action-section-label {
  display: block; grid-column: 1 / -1; margin: 0; color: #657485; font-size: .75rem;
  font-weight: 400; text-transform: uppercase; letter-spacing: .04em;
 }
 body .app-shell .erp-action-section-divider { margin-top: 4px; padding-top: 10px; border-top: 1px solid #e7edf3; }
}
@media (max-width: 600px) {
 /* Only each record owns a border. Removing the vendor frame fixes the doubled corners. */
 body .app-shell:not(.home-shell) .pedidos-list-page .grid-panel {
  background: transparent !important; border: 0 !important; padding: 0 !important;
 }
 body .app-shell .pedidos-list-page .erp-mobile-list.is-cards :is(.dxbl-grid, .dxbl-grid-container, .dxbl-grid-table, .erp-native-mobile-table) {
  border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important;
 }
 body .app-shell .pedidos-list-page .erp-mobile-list.is-cards tr.erp-mobile-record {
  border: 1px solid #d7e0e8 !important; border-radius: 6px !important; overflow: hidden;
  background: #fff !important; margin-bottom: 10px; padding-inline: 8px; gap: 4px 6px;
 }
 body .app-shell .pedidos-list-page .erp-mobile-list.is-cards tr.erp-mobile-record::before { content: none; }
 body .app-shell .pedidos-list-page .erp-mobile-list.is-cards tr.erp-mobile-record > td[data-mobile-role="identity"] { --erp-mobile-card-header-ink: #1764a5; font-size: 20px !important; font-weight: 400; }
 body .app-shell .pedidos-list-page .erp-mobile-list.is-cards table:is(.dxbl-grid-table, .erp-native-mobile-table) tr.erp-mobile-record > td.erp-mobile-title {
  --erp-mobile-card-header-ink: #1764a5;
  font-size: 18px !important; line-height: 1.25 !important; color: #193c5a !important;
  background: transparent !important; padding: 4px 0 !important;
 }
 body .app-shell .pedidos-list-page .erp-mobile-list.is-cards table:is(.dxbl-grid-table, .erp-native-mobile-table) tr.erp-mobile-record > td.erp-mobile-amount {
  background: #fff !important; border-radius: 0 !important; border-top: 1px solid #edf0f4 !important;
  flex-direction: row; align-items: baseline; justify-content: space-between;
  font-size: 26px !important; font-weight: 400; padding: 10px 0 4px !important;
 }
 body .app-shell .pedidos-list-page .erp-mobile-list.is-cards .erp-mobile-amount::before { font-weight: 400; }
 body .app-shell .pedidos-list-page .erp-mobile-list.is-cards table:is(.dxbl-grid-table, .erp-native-mobile-table) tr.erp-mobile-record > td.erp-mobile-row-actions {
  margin: 0 -4px; padding: 6px 0 0 !important; border-top: 1px solid #e7edf3 !important;
  width: calc(100% + 8px) !important; max-width: calc(100% + 8px) !important;
 }
 /* Keep every visible order action in a single row, even on narrow cards. */
 body .app-shell .pedidos-list-page .erp-mobile-list.is-cards .erp-mobile-row-actions .erp-grid-actions {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 44px);
  gap: 4px;
  justify-content: end !important;
 }
 body .app-shell .pedidos-list-page .erp-mobile-list.is-cards .erp-mobile-row-actions .erp-grid-actions > .erp-row-icon-btn {
  width: 100% !important;
  min-width: 0 !important;
  padding-inline: 0 !important;
 }
 body .app-shell:not(.home-shell) .document-mobile-overview .document-overview-total {
  grid-column: 1 / -1; display: flex; flex-direction: row; align-items: center; justify-content: space-between;
  border-top: 1px solid #dae5ee;
 }
 body .app-shell:not(.home-shell) .document-mobile-overview .document-overview-outstanding { border-radius: 0; }
 body .app-shell:not(.home-shell) .document-mobile-overview span { font-size: 14px; font-weight: 400; color: #657485; }
 body .app-shell:not(.home-shell) .document-mobile-overview strong { font-size: 18px; font-weight: 400; }
 body .app-shell:not(.home-shell) .document-mobile-overview .document-overview-party strong { font-size: 21px; }
 body .app-shell:not(.home-shell) .document-mobile-overview .document-overview-total strong { font-size: 30px; }
 body .app-shell:not(.home-shell) .document-mobile-overview .document-overview-outstanding { text-align: left; }
 body .app-shell:not(.home-shell) .document-mobile-overview .document-state-label { padding: 0; background: transparent; font-size: inherit; }
}

@media (max-width: 600px) {
 body .app-shell .pedidos-list-page .erp-mobile-list.is-cards tr.erp-mobile-record:has(.erp-grid-check:checked) > td {
  background-color: transparent !important;
 }
 body .app-shell .pedidos-list-page .erp-mobile-list.is-cards .erp-grid-check:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='14' fill='%231764a5'/%3E%3Cpath d='m7 14 5 5 9-10' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
 }
 body .app-shell .pedidos-list-page .erp-mobile-list.is-cards tr.erp-mobile-record:has(.erp-grid-check:checked) {
  border-color: #1764a5 !important;
  outline: 0;
  position: relative;
 }
 body .app-shell .pedidos-list-page .erp-mobile-list.is-cards tr.erp-mobile-record:has(.erp-grid-check:checked)::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: #1764a5;
  z-index: 1;
  pointer-events: none;
 }
 body .app-shell .pedidos-list-page .pedido-action-panel .erp-responsive-actions > .erp-responsive-actions-toggle {
  min-height: 48px !important;
  background: #fff !important;
  color: #1764a5 !important;
 }
}
