/* Gamecell: identidade compartilhada pelo PDV e pedido do cliente.
   Carregado depois dos módulos. Cores de status configuradas pelo usuário
   continuam sob responsabilidade de --status-* e dos controles da paleta. */
:root {
  font-family: "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
  color: #182238;
  background: #f4f6fb;
  --ink: #182238;
  --muted: #5d687b;
  --line: #dde3ed;
  --teal: #086b83;
  --deep: #101625;
  --light: #e7f6fb;
  --surface-soft: #f7f9fc;
  --focus-ring: #087b9c;
  --brand-cyan: #2dd5e8;
  --brand-violet: #9756f4;
  --brand-accent: #7042ca;
  --surface-shadow: 0 3px 16px #15234406;
}
body { font-size: 1rem; line-height: 1.55; color: var(--ink); background: #f4f6fb; }
button, input, select, textarea { font-family: inherit; }
h1 { font-size: clamp(1.75rem, 2.5vw, 2.125rem); font-weight: 750; line-height: 1.2; letter-spacing: -.045em; }
h2 { font-size: 1.125rem; font-weight: 700; line-height: 1.4; letter-spacing: -.02em; }
h3 { font-size: 1rem; font-weight: 650; line-height: 1.45; }
h1, h2, h3, .page-heading p { overflow-wrap: anywhere; }
.eyebrow { font-size: .75rem; color: #657088; font-weight: 750; letter-spacing: .13em; }
.muted { color: var(--muted); }
.layout { grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { width: 248px; height: 100dvh; padding: 20px 16px; background: #0c101b; border-right: 1px solid #242d43; }
.brand { display: flex; flex-direction: column; gap: 8px; margin: 0 0 26px; padding: 0; flex-shrink: 0; }
.brand-logo-frame { display: block; position: relative; width: 100%; aspect-ratio: 1.65; overflow: hidden; background: #050506; border-radius: 12px; }
.brand-logo-frame img { display: block; position: absolute; width: 100%; height: auto; top: 50%; left: 0; transform: translateY(-50%); }
.brand-caption { color: #a8b4cb; font-size: .75rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.nav-label { font-size: .75rem; font-weight: 650; color: #8c9bb5; padding-left: 13px; letter-spacing: .12em; margin-bottom: 12px; }
.sidebar .nav { gap: 5px; padding-bottom: 18px; scrollbar-width: thin; scrollbar-color: #33415d transparent; }
.nav button { font-size: .875rem; font-weight: 550; min-height: 44px; padding: 11px 13px; border-radius: 10px; color: #b9c4d8; gap: 12px; }
.nav button .icon { width: 19px; height: 19px; }
.nav button:hover { background: #1b2336; color: #fff; border-color: #303c55; }
.nav button.active { background: #172d40; border-color: #295166; color: #b3f7ff; box-shadow: inset 3px 0 0 var(--brand-cyan); }
.nav [data-action="new-sale"] { background: #2dd5e8; color: #08232e; border-color: #51e0ed; font-weight: 750; margin: 0 0 8px; box-shadow: 0 4px 16px #2dd5e818; }
.nav [data-action="new-sale"]:hover, .nav [data-action="new-sale"].active { background: #66e5f0; color: #08232e; border-color: #88eef5; box-shadow: inset 3px 0 0 #fff; }
.nav .nav-parent.section-active { background: #181f34; color: #d8c8fc; }
.nav .nav-submenu { border-color: #39415a; margin-left: 22px; }
.nav .nav-child { font-size: .875rem; min-height: 40px; }
.sidebar-bottom { padding: 18px 10px 0; border-color: #283147; color: #9eacc4; }
.sidebar-bottom p, .sidebar-bottom button { font-size: .75rem; color: #a7b5cd; }
.sidebar-bottom strong { color: #edf1ff; }
.local-dot { background: var(--brand-cyan); }
.main { min-width: 0; }
.topbar { min-height: 76px; height: auto; padding: 0; background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 1600px; gap: 20px; padding: 17px 34px; margin-inline: auto; }
.breadcrumbs { font-size: .875rem; min-width: 0; overflow-wrap: anywhere; }
.breadcrumbs b { color: var(--ink); font-weight: 650; }
.user { font-size: .875rem; min-width: 0; }
.user small { font-size: .75rem; }
.avatar { width: 38px; height: 38px; color: #6135ac; background: #eee8fb; border: 1px solid #dfd4f6; font-size: .875rem; }
.content { width: 100%; max-width: 1600px; margin-inline: auto; padding: 32px 34px 52px; }
.version-banner { font-size: .75rem; padding: 10px 14px; border: 1px solid #e0dcf0; border-left: 3px solid #9070cc; background: #f0eef7; color: #615376; border-radius: 8px; margin-bottom: 26px; }
.page-heading { gap: 20px; margin-bottom: 26px; align-items: center; }
.page-heading>div:first-child { min-width: 0; }
.page-heading p { font-size: .9375rem; line-height: 1.6; margin-top: 8px; max-width: 770px; }
button, .button { min-height: 44px; padding: 10px 16px; font-size: .875rem; font-weight: 650; border-radius: 10px; border-color: #d6deea; color: var(--ink); box-shadow: 0 1px 3px #18223805; }
button:hover, .button:hover { background: #f3f6fb; border-color: #b8c8dc; box-shadow: none; }
.primary, .button.primary { background: #086b83; border-color: #08637a; color: #fff; box-shadow: 0 4px 12px #086b8318; }
.primary:hover, .button.primary:hover { background: #07566c; border-color: #07566c; color: #fff; }
.small { min-height: 38px; padding: 8px 12px; font-size: .875rem; }
.subtle { background: transparent; color: #53617a; border-color: transparent; box-shadow: none; }
.subtle:hover { color: #273b58; background: #edf2f8; border-color: transparent; }
.danger, .negative { color: #ac393c; }
.danger:hover { background: #fff0f0; color: #98252b; }
.link-button { font-size: .875rem; font-weight: 650; color: #086b83; padding: 6px 0; min-height: 36px; background: transparent; box-shadow: none; }
.link-button:hover { color: #5f35b0; background: transparent; }
:where(button, .button, a, input, select, textarea, summary):focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.actions { gap: 10px; align-items: center; }
.panel { border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--surface-shadow); margin-bottom: 22px; }
.panel-header { padding: 20px 24px; border-color: #e8ecf3; background: #fff; gap: 16px; }
.panel-header p, .section-title p { font-size: .875rem; line-height: 1.55; color: var(--muted); margin-top: 6px; }
.panel-body { padding: 24px; }
.metric-grid { gap: 18px; margin-bottom: 26px; }
.metric { min-width: 0; min-height: 154px; padding: 23px; border-radius: 16px; border-color: var(--line); box-shadow: var(--surface-shadow); }
.metric-label { font-size: .875rem; line-height: 1.4; font-weight: 600; color: var(--muted); gap: 12px; }
.metric-label .icon { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: #eaf6fa; color: #15718b; flex-shrink: 0; }
.metric-value { font-size: clamp(1.65rem, 2.25vw, 2.125rem); font-weight: 750; line-height: 1.2; letter-spacing: -.04em; margin: 16px 0 10px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.metric-foot { font-size: .8125rem; color: var(--muted); line-height: 1.5; }
.metric.featured { background: linear-gradient(120deg, #121d30, #292044); border-color: #31354f; color: #fff; box-shadow: 0 6px 18px #171c3210; }
.metric.featured .metric-label, .metric.featured .metric-foot { color: #c0cce2; }
.metric.featured .metric-label .icon { background: #343151; color: #b9abff; }
.detail-grid .metric-value { font-size: 1.65rem; }
.table-wrap { max-width: 100%; scrollbar-width: thin; scrollbar-color: #becbdf #f6f8fb; }
.table-wrap[tabindex]:focus-visible { outline-color: var(--focus-ring); }
th { font-size: .75rem; font-weight: 750; letter-spacing: .065em; color: #58657e; background: #f5f7fb; padding: 14px 20px; border-color: #e1e7f0; }
td, .expense-table td, .expense-history-table td, .expense-category-table td { font-size: .875rem; line-height: 1.55; padding: 17px 20px; border-color: #ebeff5; }
.expense-table th { font-size: .75rem; }
td strong, td.strong { font-weight: 650; }
td small, .sale-identity small, .expense-table td small { font-size: .8125rem; line-height: 1.5; color: var(--muted); margin-top: 5px; }
tbody tr:hover { background: #f7faff; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { font-size: .8125rem; min-height: 28px; line-height: 1.4; border-radius: 8px; padding: 5px 9px; font-weight: 650; color: #52617b; background: #edf1f8; white-space: normal; }
.badge.good { color: #176144; background: #e7f5ee; }
.badge.warn { color: #87551c; background: #fff3dd; }
.badge.bad { color: #a0343a; background: #ffedf0; }
.operational-badge, .select-control.is-status .select-trigger, .status-select { font-size: .875rem; font-weight: 650; min-height: 36px; }
.sale-state-field { border-color: var(--line); border-radius: 12px; }
.sale-state-field>span:first-child { font-size: .75rem; }
.fields { gap: 20px; align-items: start; }
.field, .item-row .field, .payment-row .field, .machine-brand-bar .field, .expense-bulk-fields .field { font-size: .875rem; font-weight: 650; line-height: 1.5; color: #35435d; gap: 8px; min-width: 0; }
.field input, .field select, .field textarea, input.input, select.input,
.item-row input, .item-row select, .payment-row input, .payment-row select,
.finance-search>input { min-height: 46px; font-size: 1rem; border: 1px solid #ced8e7; border-radius: 10px; padding: 11px 13px; line-height: 1.4; color: var(--ink); background: #fff; box-shadow: 0 1px 2px #17223a03; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #a7bbd1; }
.field input:focus, .field select:focus, .field textarea:focus, .finance-search>input:focus { outline: 0; border-color: #1683a1; box-shadow: 0 0 0 3px #1683a11a; }
.field input:disabled, .field select:disabled { background: #f1f4f9; color: #65718a; border-color: #e0e5ee; }
.field input::placeholder, .field textarea::placeholder, .finance-search>input::placeholder { color: #758197; font-weight: 400; }
.field input[type="checkbox"], .field input[type="radio"] { min-height: 0; }
.field small, .footer-note, .payment-hint, .card-rate-note, .stat-note, .finance-columns .stat-note { font-size: .8125rem; line-height: 1.65; color: var(--muted); }
input[type="checkbox"], input[type="radio"] { accent-color: #7042ca; }
.select-trigger, .filters .select-trigger { min-height: 46px; padding: 11px 13px; font-size: 1rem; font-weight: 500; border-color: #ced8e7; border-radius: 10px; color: var(--ink); }
.select-trigger:hover { border-color: #a7bbd1; background: #fff; }
.select-trigger:focus-visible, .select-trigger[aria-expanded="true"] { border-color: #1683a1; box-shadow: 0 0 0 3px #1683a11a; }
.select-chevron, .date-filter summary::after { color: #74839b; }
.select-trigger[aria-expanded="true"] .select-chevron { color: #087b9c; }
.select-control.is-status .select-trigger[aria-expanded="true"] .select-chevron { color: currentColor; }
.select-popover { border-color: #cfd9e8; border-radius: 12px; padding: 7px; background: #fff; box-shadow: 0 14px 44px #18244224; }
.select-search { min-height: 42px; font-size: .875rem; border-color: var(--line); background: #f5f7fb; }
.select-search:focus { border-color: #1683a1; box-shadow: 0 0 0 2px #1683a11a; }
.select-option { min-height: 42px; font-size: .875rem; font-weight: 500; padding: 10px 12px; color: #35435d; border-radius: 8px; }
.select-option[aria-selected="true"] { background: #e6f5fb; color: #085c77; font-weight: 700; }
.select-option-check { color: #086b83; }
.select-option:hover, .select-option.is-highlighted { background: #f0f3fa; color: #253c5c; }
.select-option[aria-selected="true"]:hover, .select-option[aria-selected="true"].is-highlighted { background: #d7eff8; color: #075770; }
.select-option:focus-visible { border-color: #1683a1; }
.select-empty { font-size: .875rem; color: var(--muted); }
.filters, .finance-period { padding: 16px; background: #edf1f8; border: 1px solid #e0e6f0; border-radius: 14px; gap: 12px; margin-bottom: 24px; }
.filters>button, .finance-period button { min-height: 46px; }
.filters>.select-control { min-width: 175px; flex-basis: 175px; max-width: none; }
.date-filter summary { min-height: 46px; font-size: .875rem; padding: 11px 36px 11px 14px; border-color: #ced8e7; border-radius: 10px; }
.date-filter summary strong { font-size: .9375rem; }
.date-filter[open] summary { border-color: #1683a1; box-shadow: 0 0 0 3px #1683a11a; }
.date-filter-fields { border-color: #ced8e7; border-radius: 12px; padding: 18px; box-shadow: 0 12px 30px #1824421a; }
.date-filter-fields label, .filters .date-filter-fields label { font-size: .875rem; color: #35435d; }
.filters .date-filter-fields input { min-height: 46px; font-size: 1rem; border-color: #ced8e7; }
.finance-period>span { font-size: .875rem; }
.section-title { align-items: center; margin-bottom: 22px; }
.step { width: 30px; height: 30px; font-size: .875rem; background: #eae5fa; color: #6237b4; border-radius: 9px; }
.item-row, .payment-row { padding: 20px 0; gap: 12px; border-color: #e4eaf3; }
.item-row { grid-template-columns: minmax(150px, 1.5fr) 76px minmax(104px, 1fr) minmax(104px, 1fr) 38px; }
.item-row .delete, .payment-row .delete { min-width: 38px; min-height: 42px; padding: 8px; }
.payment-row { grid-template-columns: 120px minmax(140px, 1fr) 130px 38px; }
.payment-row:has(.card-payment-fields) { grid-template-columns: 120px minmax(140px,1fr) 38px; }
.expense-row { grid-template-columns: minmax(140px,1fr) 150px 38px; }
.summary .panel-header { background: #f7f6fc; }
.summary .panel-body { padding: 24px; }
.summary-total .metric-value { font-size: 2.125rem; color: #25345b; }
.summary-actions { gap: 12px; }
.summary-actions button { white-space: normal; }
.row-stat, .finance-columns .row-stat { font-size: .875rem; gap: 16px; line-height: 1.55; border-color: #e5eaf2; }
.row-stat>strong { text-align: right; font-variant-numeric: tabular-nums; }
.alert, .error, .check-field, .permission-grid label, .finance-confirm { font-size: .875rem; line-height: 1.6; }
.alert { padding: 15px 17px; border-radius: 12px; }
.permission-grid label { align-items: start; padding: 12px; border-radius: 10px; background: #f5f7fb; }
.permission-grid input { margin-top: 4px; width: 18px; height: 18px; }
.empty { padding: 42px 24px; }
.empty h3 { font-size: 1rem; }
.empty p { font-size: .875rem; max-width: 520px; margin-inline: auto; }
.empty .icon { color: #8660c4; width: 34px; height: 34px; }
dialog { width: min(640px, calc(100vw - 32px)); max-width: 640px; max-height: calc(100dvh - 32px); border-color: #d9e1ed; border-radius: 18px; box-shadow: 0 25px 100px #080f3040; }
dialog::backdrop { background: #090e207d; backdrop-filter: blur(5px); }
.modal-header, .machine-modal .modal-header { padding: 21px 24px; background: #f5f6fb; border-bottom: 1px solid #e2e6f0; }
.modal-header h2, .machine-modal .modal-header h2 { font-size: 1.25rem; line-height: 1.4; }
.modal-content, .machine-modal .modal-content { padding: 24px; }
.modal-content>.actions { border-color: #e2e6f0; padding-top: 20px; gap: 12px; }
#toast { background: #17233b; border-color: #415078; color: #fff; font-size: .875rem; padding: 14px 20px; border-radius: 12px; box-shadow: 0 8px 28px #0a14332c; }
.machine-card, .brand-rate-editor { border-color: var(--line); border-radius: 14px; }
.machine-identity h3 { font-size: 1rem; }
.machine-identity small { font-size: .8125rem; }
.machine-identity>.icon { background: #e8f3fb; color: #176f92; }
.machine-brand-bar { max-width: 420px; }
.debit-summary { max-width: 420px; font-size: .875rem; background: #eaf7fb; border-color: #cbe7f1; }
.debit-summary strong { font-size: 1rem; color: #075b78; }
.compact-rate-heading, .compact-rate-grid>div, .rate-edit-cell { font-size: .875rem; }
.compact-rate-heading span, .rate-edit-cell>span:last-child { font-size: .8125rem; }
.compact-rate-grid>div { border-color: #e0e6f0; padding: 11px 12px; background: #f5f7fb; }
.brand-rate-editor { background: #f6f8fc; }
.rate-edit-cell input { font-size: 1rem; min-height: 46px; border-color: #ced8e7; padding-right: 25px; }
.extra-installments summary, .machine-discard, .palette-guidance, .native-color-label { font-size: .875rem; }
.status-palette legend { font-size: .9375rem; }
.color-swatch { min-height: 40px; }
.native-color-label small, .status-preview-row>span:first-child { font-size: .8125rem; }
.status-preview-row { background: #f4f6fb; border-color: var(--line); }
.finance-result { background: #f0ecfa; color: #483477; border-radius: 10px; }
.finance-result .negative { color: #ac393c; }
.finance-modal-summary { background: #19243a; border-left: 3px solid var(--brand-cyan); }
.finance-explainer, .finance-footnote, .finance-status { font-size: .875rem; }
.expense-type-card { border-top: 3px solid #2cbad1; }
.expense-type-card:last-child { border-top-color: #9756f4; }
.expense-type-card h2 .icon { color: #086b83; }
.expense-type-card:last-child h2 .icon { color: #7542bd; }
.expense-type-details span, .expense-type-total>span { font-size: .8125rem; }
.expense-type-total>strong { font-size: 1.875rem; }
.expense-bulk-row { background: #f7f9fd; border-color: var(--line); border-radius: 14px; padding: 18px; }
.expense-bulk-row legend { font-size: .9375rem; }
.bulk-extra summary, .bulk-footer { font-size: .875rem; }
.reminder-item { font-size: .875rem; padding: 18px 0; }
.reminder-item>div>span, .reminder-item>.badge { font-size: .875rem; }
.auth { background: #f4f6fb; }
.auth-presentation { padding: clamp(32px, 5vw, 80px); background: radial-gradient(ellipse at 15% 0%, #073346, transparent 65%), radial-gradient(ellipse at 100% 100%, #322049, transparent 60%), #0c101b; }
.auth-presentation .brand { width: min(360px, 100%); margin: 0 0 38px; }
.auth-presentation h1 { font-size: clamp(2rem, 3.3vw, 3.25rem); max-width: 540px; line-height: 1.12; letter-spacing: -.045em; }
.auth-presentation p { font-size: 1rem; color: #b9c5dc; line-height: 1.75; }
.auth-tags span { font-size: .8125rem; color: #bfcae2; border-color: #3b4263; background: #151b2c; }
.auth-panel { padding: 48px; background: transparent; }
.auth-card { max-width: 460px; padding: 34px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 12px 48px #16254408; }
.auth-card h2 { font-size: 1.75rem; }
.auth-card>p, .auth-toggle, .auth-toggle button { font-size: .9375rem; }
.auth-card .field { margin-top: 20px; }
.auth-card .primary { min-height: 48px; }
.auth-hint { font-size: .75rem; border-color: var(--line); }
.loading { color: #526482; font-size: 1rem; }

/* Pedido público: mesma marca, somente informações comerciais. */
.receipt-page { background: #edf1f8; padding: 32px 20px; }
.receipt { width: 100%; max-width: 960px; margin: 0 auto; padding: 0; border: 1px solid #d8e0ee; border-radius: 20px; box-shadow: 0 12px 42px #182a4910; overflow: hidden; }
.receipt-head { margin: 0; padding: 26px 34px; align-items: center; background: #0c101b; color: #fff; border-bottom: 3px solid #7042ca; gap: 24px; }
.receipt-brand { width: 225px; max-width: 48%; flex-shrink: 0; }
.receipt-brand .brand-logo-frame { border-radius: 10px; }
.receipt-heading { text-align: right; min-width: 0; }
.receipt-heading .eyebrow { color: #a4dfe9; }
.receipt-heading h1 { font-size: 1.75rem; color: #fff; }
.receipt-heading p { color: #bac5dc; font-size: .875rem; margin-top: 8px; }
.receipt-content { padding: 32px 34px; }
.receipt-store { color: #6b3abb; font-size: 1rem; font-weight: 700; margin-bottom: 22px; }
.receipt-parties { padding: 20px; background: #f4f6fb; border: 1px solid #e2e7f0; border-radius: 12px; margin-bottom: 18px; }
.receipt h2 { font-size: 1.125rem; margin: 28px 0 14px; }
.receipt h3 { font-size: 1rem; overflow-wrap: anywhere; }
.receipt .table-wrap { border: 1px solid #e0e6f0; border-radius: 12px; }
.receipt table { white-space: normal; }
.receipt th, .receipt td { padding: 15px 16px; }
.receipt td:first-child { overflow-wrap: anywhere; }
.receipt-total { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; padding: 20px; border: 1px solid #d6e8f0; border-radius: 12px; background: #eaf6fb; }
.receipt-total span { font-size: 1rem; font-weight: 650; color: #22475e; }
.receipt-total strong { font-size: 1.875rem; color: #075d79; font-variant-numeric: tabular-nums; letter-spacing: -.035em; overflow-wrap: anywhere; }
.receipt-payments { border-top: 1px solid var(--line); }
.receipt .row-stat { padding: 15px 0; font-size: .9375rem; }
.receipt-footer { font-size: .8125rem; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); line-height: 1.7; }
.receipt .actions { margin-top: 20px; justify-content: flex-end; }
.receipt-message { padding: 32px; }
.share-brand-preview { width: 185px; margin: 0 auto 20px; }
.share-brand-note { font-size: .875rem; text-align: center; margin: 0 0 18px; color: var(--muted); }
.expense-category-catalog { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,260px),1fr)); gap: 16px; padding: 24px; }
.expense-category-card { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #f8faff; }
.expense-category-card>div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.expense-category-card>p { font-size: .875rem; color: var(--muted); margin: 14px 0; }
.field input[type="color"] { padding: 5px; width: 90px; cursor: pointer; }

@media (max-width: 1320px) {
 .layout { grid-template-columns: 228px minmax(0, 1fr); }.sidebar { width: 228px; padding-inline: 13px; }
 .content { padding: 28px 24px 46px; }.topbar-inner { padding-inline: 24px; }
 .sale-editor { grid-template-columns: 1fr; }.summary { position: static; }.summary-actions { flex-direction: row; }.summary-actions>* { flex: 1; }
 .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
 .item-row { grid-template-columns: minmax(130px,1fr) 76px minmax(96px,1fr) 38px; }
 .item-row .item-product { grid-column: 1/-1; }.item-row .item-quantity { grid-column: 1; }
 .item-row>.field:nth-of-type(3) { grid-column: 2/4; }.item-row .item-cost { grid-column: 1/4; max-width: none; }
 .item-row .delete { grid-column: 4; grid-row: 2; }
 .payment-row { grid-template-columns: minmax(100px,1fr) 130px 38px; }
 .payment-row .payment-method { grid-column: 1; }.payment-row .payment-rate { grid-column: 1/-1; grid-row: 2; }
 .payment-row .payment-value { grid-column: 2; grid-row: 1; }.payment-row .delete { grid-column: 3; grid-row: 1; }
 .expense-row { grid-template-columns: minmax(120px,1fr) 130px 38px; }
 .expense-row .payment-rate { grid-column: 1; grid-row: 1; }
 .card-payment-fields { grid-column: 1/-1; }
}
@media (max-width: 800px) {
 .layout { display: block; }.sidebar { position: static; width: 100%; height: auto; padding: 14px 16px; }
 .sidebar .brand { flex-direction: row; width: 100%; gap: 20px; margin-bottom: 14px; }
 .sidebar .brand-logo-frame { width: 148px; flex-shrink: 0; }.brand-caption { font-size: .75rem; }
 .nav-label, .sidebar-bottom { display: none; }.sidebar .nav { gap: 6px; padding-bottom: 4px; }
 .nav button { font-size: .875rem; min-height: 42px; padding: 10px 12px; }.nav .nav-child { font-size: .875rem; }
 .nav .nav-submenu { margin-left: 14px; background: #141c2d; border-color: #39415a; }
 .topbar { min-height: 64px; }.topbar-inner { padding: 14px 18px; gap: 14px; }.content { padding: 24px 18px 40px; }
 .page-heading .primary { font-size: .875rem; }.page-heading { align-items: start; flex-wrap: wrap; }
 .page-heading p { font-size: .9375rem; }.panel-header, .panel-body { padding: 20px; }
 .filters>.select-control { min-width: 0; flex: 1 1 160px; }.date-filter-fields { box-shadow: none; }
 .fields { gap: 18px; }.auth-presentation { padding: 22px 26px; }.auth-presentation .brand { width: 210px; margin: 0 auto; }
 .auth-presentation h1, .auth-presentation p, .auth-tags { display: none; }.auth-panel { padding: 30px 20px; }
 .finance-period .field { min-width: 0; }.receipt-page { padding: 20px 14px; }
}
@media (max-width: 540px) {
 .sidebar { padding: 12px; }.sidebar .brand-logo-frame { width: 132px; }.sidebar .brand-caption { max-width: 120px; }
 .content { padding: 22px 12px 36px; }.topbar-inner { padding: 12px; }.breadcrumbs { max-width: none; font-size: .8125rem; }
 .topbar .user>div, .topbar .avatar { display: none; }.topbar .user { flex-shrink: 0; }
 .metric-grid, .detail-grid { grid-template-columns: 1fr; gap: 14px; }.metric { min-height: 144px; padding: 22px; }.metric-value { font-size: 2rem; }
 .page-heading { display: block; }.page-heading>button, .page-heading>.actions { width: 100%; margin-top: 16px; }.page-heading>.actions button { flex: 1; }
 .panel-header, .panel-body { padding: 18px 16px; }.panel-header { flex-wrap: wrap; }
 .fields { grid-template-columns: 1fr; }.field.full { grid-column: auto; }
 .filters { padding: 12px; }.filters>.select-control { flex-basis: 100%; }.filters>button { flex: 1; }
 .date-filter-fields { grid-template-columns: 1fr; padding: 14px; }
 .item-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr) 38px; }
 .item-row .item-product { grid-column: 1/-1; }.item-row .item-quantity { grid-column: 1; }
 .item-row>.field:nth-of-type(3) { grid-column: 2; }.item-row .item-cost { grid-column: 1/3; }
 .item-row .delete { grid-column: 3; grid-row: 2; }
 .payment-row, .expense-row { grid-template-columns: minmax(0,1fr) 38px; }
 .payment-row .payment-method, .payment-row .payment-rate, .payment-row .payment-value { grid-column: 1; grid-row: auto; }
 .payment-row .delete { grid-column: 2; grid-row: 1; }
 .card-payment-fields, .payment-row:has(.card-payment-fields)>.payment-value { grid-column: 1; grid-row: auto; }
 .payment-row:has(.card-payment-fields) { grid-template-columns: minmax(0,1fr) 38px; }.payment-row:has(.card-payment-fields)>.delete { grid-column: 2; grid-row: 1; }.card-payment-fields { grid-template-columns: 1fr; }
 .summary-actions { flex-direction: column; }.summary .panel-body { padding: 20px; }
 dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); border-radius: 14px; }
 .modal-header, .machine-modal .modal-header { padding: 18px 16px; }.modal-content, .machine-modal .modal-content { padding: 20px 16px; }
 .modal-content>.actions>button { min-height: 44px; white-space: normal; }
 .permission-grid { grid-template-columns: 1fr; }.compact-rate-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .rate-edit-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }.rate-edit-cell input { font-size: .9375rem; }
 .finance-partner-row { grid-template-columns: 1fr; }.finance-partner-row>button { grid-column: auto; }
 .expense-bulk-row { padding: 14px; }.expense-bulk-fields { grid-template-columns: minmax(0,1fr) 38px; }
 .expense-bulk-fields>.field, .expense-bulk-fields>.field:first-child, .expense-bulk-fields>.field:nth-child(4) { grid-column: 1; }
 .expense-bulk-fields>button { grid-column: 2; grid-row: 1; }
 .auth-card { padding: 26px 22px; }.auth-panel { padding: 24px 14px; }
 .receipt-page { padding: 12px 8px; }.receipt { border-radius: 14px; }
 .receipt-head { padding: 18px 16px; gap: 14px; }.receipt-brand { width: 150px; max-width: 48%; }
 .receipt-heading h1 { font-size: 1.25rem; }.receipt-heading .eyebrow { font-size: .75rem; }.receipt-heading p { font-size: .8125rem; }
 .receipt-content { padding: 24px 16px; }.receipt-parties { padding: 16px; }
 .receipt th, .receipt td { padding: 12px 10px; font-size: .8125rem; }.receipt table { min-width: 420px; }
 .receipt-total { padding: 16px; flex-wrap: wrap; }.receipt-total strong { font-size: 1.65rem; margin-left: auto; }
 .receipt .actions>button { width: 100%; }.receipt .row-stat { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print {
 @page { size: A4; margin: 14mm; }
 .receipt-page { padding: 0; background: #fff; }.receipt { max-width: none; border: 0; border-radius: 0; box-shadow: none; margin: 0; overflow: visible; }
 .receipt-head { background: #fff; color: #182238; padding: 0 0 18px; border-bottom: 2px solid #7042ca; break-inside: avoid; }
 .receipt-brand { width: 190px; }.receipt-heading h1 { color: #182238; }.receipt-heading .eyebrow, .receipt-heading p { color: #4a5770; }
 .brand-logo-frame, .receipt-head, .receipt-total { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
 .receipt-content { padding: 22px 0 0; }.receipt .fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .receipt .table-wrap { overflow: visible; border-radius: 0; }.receipt table { min-width: 0; width: 100%; table-layout: fixed; }
 .receipt th:first-child { width: 44%; }.receipt th, .receipt td { font-size: 10pt; padding: 10px 8px; overflow-wrap: anywhere; }
 .receipt-total, .receipt-parties, .receipt-footer, .receipt .row-stat { break-inside: avoid; }
 .receipt h2 { break-after: avoid; }.receipt .actions, .no-print { display: none !important; }
}
/* Cadastros, classificação de despesas e identificação opcional por item. */
.sale-item { border: 1px solid var(--border, #dce3ef); border-radius: 16px; padding: 16px; margin-bottom: 16px; background: #fbfcff; }
.sale-item .item-row { margin-bottom: 10px; padding-bottom: 0; border-bottom: 0; }
.item-details-toggle { color: #55339a; gap: 8px; }
.item-details-toggle .icon { width: 16px; height: 16px; }
.item-details-fields { border-top: 1px solid #dce3ef; margin-top: 14px; padding-top: 16px; }
.item-details-fields[hidden], .sales-period-range[hidden] { display: none; }
.item-details-fields textarea { resize: vertical; min-height: 86px; }
.check-field { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 600; line-height: 1.5; margin-top: 16px; }
.check-field input[type="checkbox"] { flex: 0 0 18px; width: 18px; min-height: 18px; height: 18px; margin-top: 2px; accent-color: #7951c9; }
.sales-period-range { display: flex; flex-wrap: wrap; gap: 12px; }
.filters { align-items: flex-end; }
.filters > .field { margin: 0; min-width: 170px; }
.sales-period-range .field { margin: 0; width: 158px; }
.date-format-hint { color: #647088; font-size: 12px; font-weight: 500; }
[data-date-kind] { font-variant-numeric: tabular-nums; min-width: 130px; }
.expense-classification { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; grid-column: 1 / -1; min-width: 0; }
.expense-classification .field { min-width: 0; }
.subcategory-catalog { border-top: 1px solid #e1e5f0; margin-top: 16px; padding-top: 16px; }
.subcategory-catalog h3 { font-size: 14px; margin: 0 0 10px; }
.subcategory-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #e9edf5; padding: 12px 0; }
.subcategory-row:last-of-type { margin-bottom: 12px; }
.subcategory-row > div { min-width: 0; overflow-wrap: anywhere; }
.subcategory-row small { display: block; font-size: 12px; color: #647088; margin-top: 4px; }
.receipt-page td .preserve { display: block; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; margin-top: 5px; color: #4e5c74; }
/* Eixos comuns: títulos, tabelas e totais usam a mesma margem interna. */
:root { --panel-inset: 24px; }
.panel-header, .panel-body { padding-inline: var(--panel-inset); }
.panel > .table-wrap th:first-child, .panel > .table-wrap td:first-child { padding-left: var(--panel-inset); }
.panel > .table-wrap th:last-child, .panel > .table-wrap td:last-child { padding-right: var(--panel-inset); }
.num, .row-stat strong { font-variant-numeric: tabular-nums; }
.filters > .field { flex: 1 1 160px; min-width: 0; }
.filters .field > span, .finance-period .field > span { line-height: 1.4; min-height: 20px; }
.filters .select-trigger, .filters input, .finance-period input { min-height: 44px; }
.filters .date-format-hint, .finance-period .date-format-hint { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.filters > button { flex-shrink: 0; min-height: 44px; }
.sales-period-range { align-items: flex-end; }
.entry-product-fields { min-width: 0; border: 0; padding: 0; margin: 20px 0; }
.entry-product-fields[hidden] { display: none !important; }
.summary-actions:has([data-action="save-correction"]) { flex-direction: column; align-items: stretch; }
.summary-actions:has([data-action="save-correction"]) > * { flex: auto; width: 100%; }
.summary-actions textarea { resize: vertical; }
.editable-payment { padding: 18px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfe; }
.editable-payment .payment-row { margin: 0; padding: 0; border: 0; align-items: start; }
.editable-payment [data-action="change-saved-card"] { white-space: normal; max-width: 100%; text-align: left; justify-content: flex-start; }
.editable-payment .payment-date { margin-top: 16px; max-width: 230px; }
.payment-original { font-size: .875rem; line-height: 1.6; margin: 0; color: var(--ink); white-space: normal; overflow-wrap: anywhere; }
.editable-payment .payment-rate small { font-size: .8125rem; color: var(--muted); font-weight: 500; }
.item-name-label { margin-top: 10px; color: var(--muted); font-weight: 550; }
.item-entry-costs { padding: 14px 16px; border: 1px solid #d9d1ea; border-radius: 10px; background: #f8f5fc; margin: 14px 0; }
.item-entry-costs summary { cursor: pointer; color: #5b3798; font-size: .875rem; font-weight: 650; }
.item-entry-costs p { font-size: .875rem; line-height: 1.6; color: var(--muted); margin: 14px 0; }
.item-entry-costs .field { margin-top: 12px; }
.item-entry-costs input { max-width: 220px; }
.correction-record + .correction-record { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.correction-record p { margin-top: 6px; color: var(--muted); overflow-wrap: anywhere; }
.entry-product-fields .full-field { grid-column: 1 / -1; margin: 0; }
.stock-entries-table td:first-child { min-width: 220px; max-width: 360px; white-space: normal; overflow-wrap: anywhere; }
.stock-entries-table small { display: block; font-size: .8125rem; line-height: 1.5; margin-top: 5px; color: var(--muted); }
.stock-entries-table .entry-voided { background: #f7f8fb; }
.stock-entries-table .preserve { white-space: pre-wrap; }
.stock-entries-table .row-actions { flex-wrap: nowrap; }
.sales-records { display: grid; gap: 24px; }
.sale-record { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--surface-shadow); overflow: hidden; }
.sale-record-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; padding: 20px var(--panel-inset); border-bottom: 1px solid var(--line); background: linear-gradient(110deg,#f0faff,#f7f4ff); }
.sale-record-title { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 220px; }
.sale-record-title > div { min-width: 0; }
.sale-number { flex-shrink: 0; color: #126278; background: #fff; border: 1px solid #c9e1eb; border-radius: 10px; padding: 9px 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.sale-record-title h2 { font-size: 1.125rem; margin: 0; }
.sale-record-title p { margin: 4px 0 0; color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
.sale-record-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.sale-record-status .status-control { max-width: 230px; }
.sale-record-table { min-width: 760px; }
.sale-record-table th { font-size: .8125rem; text-transform: none; letter-spacing: 0; }
.sale-record-table th:first-child, .sale-record-table td:first-child { padding-left: var(--panel-inset); width: 30%; min-width: 200px; white-space: normal; overflow-wrap: anywhere; }
.sale-record-table th:last-child, .sale-record-table td:last-child { padding-right: var(--panel-inset); }
.sale-record-table td { font-size: .875rem; vertical-align: middle; }
.sale-record-table small { display: block; margin-top: 5px; font-size: .8125rem; color: var(--muted); }
.sale-record-table .preserve { white-space: pre-wrap; }
.provisional-profit { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.4; color: #745515; }
.provisional-profit small { font-size: .75rem; font-weight: 600; color: #745515; margin-top: 2px; }
.sale-record-footer { display: flex; align-items: flex-end; flex-wrap: wrap; justify-content: space-between; gap: 20px; padding: 20px var(--panel-inset); border-top: 1px solid var(--line); }
.sale-record-totals { display: flex; flex-wrap: wrap; gap: 18px 30px; }
.sale-record-totals > div { display: flex; flex-direction: column; justify-content: flex-start; gap: 6px; min-width: 105px; }
.sale-record-totals span { font-size: .8125rem; font-weight: 550; }
.sale-record-totals strong { font-size: 1.125rem; font-variant-numeric: tabular-nums; line-height: 1.4; }
.sale-record-totals .sale-profit-total { padding-left: 24px; border-left: 1px solid #d9d4e8; color: #5e379e; }
.sale-record-totals .provisional-profit { font-size: 1.125rem; font-weight: 700; align-items: flex-start; }
.sale-record-note { padding: 14px var(--panel-inset); margin: 0; font-size: .8125rem; line-height: 1.65; color: var(--muted); border-top: 1px solid #e9edf5; background: #fbfcff; }
.report-sheet { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.report-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; padding: 24px var(--panel-inset); border-bottom: 1px solid var(--line); }
.report-heading p { color: var(--muted); font-size: .875rem; margin-top: 6px; }
.report-heading .report-brand { width: 145px; flex-shrink: 0; }
.report-store { flex: 1 1 200px; min-width: 0; }
.report-summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 20px; padding: 24px var(--panel-inset); background: #f5f9fd; border-bottom: 1px solid var(--line); }
.report-summary > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.report-summary span { font-size: .875rem; color: var(--muted); }
.report-summary strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.report-sheet table { min-width: 720px; }
.report-sheet th:first-child, .report-sheet td:first-child { padding-left: var(--panel-inset); white-space: normal; min-width: 200px; overflow-wrap: anywhere; }
.report-sheet th:last-child, .report-sheet td:last-child { padding-right: var(--panel-inset); }
.report-sheet .footer-note { padding: 20px var(--panel-inset); margin: 0; border-top: 1px solid var(--line); }
@media(max-width: 800px) { :root { --panel-inset: 20px; } }
@media(max-width: 540px) {
 :root { --panel-inset: 16px; }
 .filters > .field { flex-basis: 100%; }.filters .sales-period-range { width: 100%; }
 .sale-record-header { align-items: flex-start; }.sale-record-status { justify-content: flex-start; }
 .sale-record-totals { display: grid; width: 100%; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
 .sale-record-totals > div { min-width: 0; }.sale-record-totals strong { overflow-wrap: anywhere; }
 .sale-record-totals .sale-profit-total { padding-left: 0; border-left: 0; }
 .sale-record-footer > .row-actions { width: 100%; }.sale-record-footer > .row-actions button { flex: 1; }
 .report-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px 14px; }
}
@media print {
 body:has(.stock-report-page) { background: #fff; font-size: 10pt; }
 body:has(.stock-report-page) .sidebar, body:has(.stock-report-page) .topbar, body:has(.stock-report-page) .version-banner, body:has(.stock-report-page) #toast { display: none !important; }
 body:has(.stock-report-page) .layout { display: block; }
 body:has(.stock-report-page) .content { max-width: none; padding: 0; }
 .stock-report-page .page-heading { margin-bottom: 18px; }.stock-report-page h1 { font-size: 20pt; }
 .report-sheet { border: 0; border-radius: 0; overflow: visible; }
 .report-heading, .report-summary { padding: 14px 0; break-inside: avoid; }
 .report-heading .report-brand { width: 110px; }
 .report-summary { grid-template-columns: repeat(4,minmax(0,1fr)); background: #fff; gap: 12px; }
 .report-summary strong { font-size: 13pt; }.report-summary span, .report-heading p { font-size: 9pt; }
 .report-sheet .table-wrap { overflow: visible; }.report-sheet table { min-width: 0; width: 100%; table-layout: fixed; white-space: normal; }
 .report-sheet th, .report-sheet td { padding: 9px 4px; font-size: 8pt; overflow-wrap: anywhere; }
 .report-sheet th:first-child, .report-sheet td:first-child { width: 24%; min-width: 0; padding-left: 0; }
 .report-sheet th:last-child, .report-sheet td:last-child { padding-right: 0; }
 .report-sheet th { letter-spacing: 0; text-transform: none; }.report-sheet tr { break-inside: avoid; }
 .report-sheet thead { display: table-header-group; }.report-sheet small { font-size: 8pt; }
 .report-sheet .footer-note { padding: 16px 0; font-size: 9pt; }
}
@media(max-width: 640px) {
 .expense-classification { grid-template-columns: 1fr; }
 .sale-item { padding: 12px; }
 .sales-period-range { width: 100%; }
 .sales-period-range .field { flex: 1 1 135px; width: auto; }
 .item-details-toggle { flex-wrap: wrap; justify-content: flex-start; }
}
.google-login { padding: 22px 0; border-block: 1px solid var(--line, #d9e2ee); margin: 22px 0; }
.google-login h3 { margin: 0 0 8px; font-size: 1.1rem; }
.google-login p { line-height: 1.6; }
.google-button { min-height: 44px; margin-top: 18px; }
.google-login form { display: grid; gap: 14px; }
.google-login label { display: grid; gap: 8px; font-weight: 650; }
.team-login { margin: 20px 0; }
.team-login summary { cursor: pointer; font-size: .95rem; font-weight: 650; padding: 12px 0; }
.team-login form { padding-top: 18px; }
.google-account { overflow-wrap: anywhere; }
