/* INTEIRE: stronger hierarchy at the point of action, quiet at rest. */
:root {
  --depth-floating: #fffdf9;
  --depth-floating-line: #d8cfc1;
  --depth-floating-shadow: 0 14px 38px -12px rgb(36 35 31 / 22%), 0 2px 5px rgb(36 35 31 / 7%);
  --depth-warning: #80601f;
}
[data-theme=dark] {
  --depth-floating: #39362f;
  --depth-floating-line: #625a4e;
  --depth-floating-shadow: 0 18px 42px -10px rgb(0 0 0 / 48%), 0 2px 5px rgb(0 0 0 / 20%);
  --depth-warning: #dcc28b;
}
.pcrm-picker-menu, .agenda-popover {
  background: var(--depth-floating);
  border-color: var(--depth-floating-line);
  box-shadow: var(--depth-floating-shadow);
}
.pcrm-picker-menu { max-height: min(440px, 65dvh); overflow-y: auto; scrollbar-width: thin; }
.pcrm-picker-menu button { min-height: 40px; transition: background-color 120ms, color 120ms; }
.pcrm-picker-menu button:hover, .pcrm-picker-menu button:focus-visible {
  background: color-mix(in srgb, var(--accent) 9%, var(--depth-floating));
}
.pcrm-picker-menu button[aria-checked=true] { font-weight: 600; }
.pcrm-picker-menu button:focus-visible { outline-offset: -2px; }
.agenda-team-option:has(input:checked) { background: color-mix(in srgb, var(--accent) 8%, var(--depth-floating)); }
.agenda-team-option:hover { background: color-mix(in srgb, var(--ink) 7%, var(--depth-floating)); }
.agenda-popover[inert] { pointer-events: none; }

/* The field retains its help while the error explains the correction. */
.field-error { display: block; color: var(--danger, #a13b31); font-size: 12px; font-weight: 450; line-height: 1.5; margin-top: 4px; }
[data-theme=dark] .field-error { color: #f2a397; }
.field-error:empty { display: none; }
:is(input,select,textarea)[aria-invalid=true] { border-color: var(--danger, #a13b31); }
[data-theme=dark] :is(input,select,textarea)[aria-invalid=true] { border-color: #f2a397; }
.op-field-help, .op-form-context { font-size: 13px; line-height: 1.6; color: var(--muted); }
.op-field-help { margin-top: -9px; }
.op-form [hidden] { display: none !important; }
.sales-period { align-items: flex-start; }
.sales-period .button { align-self: flex-start; margin-top: 21px; }
.sales-period .field-error { max-width: 190px; }
.sales-period input[aria-invalid=true] { width: 190px; }
.sales-period > span { margin-top: 31px; }

/* Reserve emphasis for decisions and exceptional quantities. */
.stock-available { font-size: 15px; font-weight: 550; font-variant-numeric: tabular-nums; }
.stock-available.low, .stock-low-label { color: var(--depth-warning); }
.data-table .stock-low-label { display: block; white-space: nowrap; font-size: 11px; color: var(--depth-warning); margin-top: 4px; }
.quote-delivered, .quote-unit { color: var(--ink); font-weight: 620; }
[data-route=compras] .data-table th { white-space: normal; min-width: 78px; line-height: 1.5; }
[data-route=compras] .data-table th:nth-child(6), [data-route=compras] .data-table th:nth-child(7) { min-width: 105px; }
[data-route=compras] .data-table td:nth-child(6), [data-route=compras] .data-table td:nth-child(7) { background: color-mix(in srgb, var(--finish-hover) 42%, transparent); }
.op-statement > .op-subtotal { border-top: 0; padding-top: 18px; padding-bottom: 18px; font-weight: 550; }
.op-statement > .op-result { border-top: 3px double var(--muted) !important; border-bottom: 0; padding-top: 20px !important; margin-top: 12px; }
.op-statement > .op-result strong { font-size: 23px; font-weight: 620; }
.op-statement > .op-result .text-button { font-weight: 600; }
.op-order-note { margin-top: 6px; margin-bottom: 10px; line-height: 1.5; }
.current-actor-label { color: var(--muted); font-size: 12px; }
.work-credit-caption { display: block; font-size: 11px; font-weight: 450; letter-spacing: .01em; color: var(--muted); margin-bottom: 3px; }
.sales-legend, .sales-metrics small, .sales-coverage, .sales-mix-meta, .sales-record-main > small { font-size: 12px; }
.sales-chart-values summary { font-size: 13px; }
.sales-scope, .sales-position small { font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .pcrm-picker-menu button { transition: none; } }
[data-motion=reduced] .pcrm-picker-menu button { transition: none; }
@media (max-width:720px) {
  .sales-period { flex-wrap: wrap; }
  .sales-period input, .sales-period input[aria-invalid=true] { width: min(139px, 31vw); }
  .sales-period .field-error { max-width: 140px; }
  .sales-period .button { margin-top: 21px; }
}

.pcrm-field > label { font-size: 12px; color: var(--muted); }
.cx-proposal-row > .field { min-width: 0; display: grid; gap: 6px; align-content: start; }
.agent-credit-line a { display: block; text-align: right; }
.agent-credit-line a > strong { font-size: 18px; }

#pane-estoque-inventarios > .panel { margin-top: 24px; }
.op-dl > div:has(+ .op-total) { border-bottom: 0; }
#pane-financeiro-conciliacao td:nth-child(3) .text-button { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 30%, transparent); text-underline-offset: 4px; }
.closure-sections { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(250px,1fr); gap: 36px; margin: 24px 0; }
.closure-sections h3 { font-size: 14px; font-weight: 600; margin-bottom: 15px; }
.closure-facts { margin: 0; }
.closure-facts > div { padding: 12px 0; border-top: 1px solid var(--line); }
.closure-facts dt { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.closure-facts dd { margin: 0; font-size: 14px; line-height: 1.6; }
.closure-facts small { display: block; color: var(--muted); font-size: 12px; }
.closure-facts .button { display: inline-flex; font-size: 12px; padding: 0 0 0 10px; min-height: 28px; }
.closure-limits { border-left: 1px solid var(--line); padding-left: 28px; }
.closure-limits > p { display: flex; gap: 10px; font-size: 13px; line-height: 1.65; margin: 0 0 16px; }
.closure-limits > p > span:first-child { color: var(--depth-warning); font-size: 17px; }
.closure-limits strong { color: var(--ink); font-weight: 550; }
.closure-limits > p:last-child { font-size: 12px; color: var(--muted); }
@media (max-width:850px) { .closure-sections { grid-template-columns: 1fr; gap: 20px; } .closure-limits { border-left: 0; border-top: 1px solid var(--line); padding: 20px 0 0; } }

.op-statement > div:has(+ .op-result) { border-bottom: 0; }
.menu-chevron { flex: none; transition: transform 150ms cubic-bezier(.2,0,0,1); }
.pcrm-picker[open] .menu-chevron { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .menu-chevron { transition: none; } }
[data-motion=reduced] .menu-chevron { transition: none; }

/* Comparison tables keep their dimensions; cues follow real overflow. */
.table-mobile-hint[hidden] { display: none !important; }
.table-wrap[data-overflow=true] + .table-mobile-hint { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 14px; line-height: 1.6; }
@media(max-width:520px) {
 .sales-view .sales-period { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; width: 100%; }
 .sales-view .sales-period > span { display: none; }
 .sales-view .sales-period > label { min-width: 0; }
 .sales-view .sales-period input, .sales-view .sales-period input[aria-invalid=true] { width: 100%; min-width: 0; box-sizing: border-box; }
 .sales-view .sales-period .button { grid-column: 1 / -1; margin: 0; }
 .sales-view .sales-period .field-error { max-width: none; }
 #pane-equipe-audit .cx-filterbar { flex-wrap: wrap; }
 #pane-equipe-audit .cx-filter { flex: 1 0 100%; width: 100%; min-width: 0; }
 #pane-equipe-audit .cx-filterbar > :not(select) { flex-basis: 100%; }
 .op-domain .account-overview table { min-width: 0; table-layout: fixed; }
 .account-overview th:first-child { width: 42%; }
 .account-overview :is(th,td) { padding-left: 5px; padding-right: 5px; }
 .account-overview .sort-column { white-space: normal; gap: 3px; font-size: 11px; }
 .account-overview td .text-button { text-align: left; white-space: normal; overflow-wrap: anywhere; font-size: 12px; }
 .account-overview .op-money { font-size: 12px; }
}
/* Keep date navigation together when the desktop preview is narrow. */
@media (min-width:721px) and (max-width:1100px) {
 .agenda-toolbar { align-items: flex-start; }
 .agenda-period-controls .agenda-button.period-trigger { width: 100%; min-height: 44px; font-size: 14px; justify-content: flex-start; }
 .agenda-period-controls { gap: 4px 8px; }
}
