/*
 * Tema B «Mostrador»: carbón, gris claro y acento lima, con modo normal y oscuro.
 * Se carga después de styles.css y no lo modifica. El modo lo pone tema.js en
 * <html data-theme="light|dark">. Este archivo lo arma zona_fit_tema_gen.py: la parte
 * de arriba y la de abajo se escriben a mano; la del medio se genera.
 */

/* ---------- Tokens, modo normal ---------- */
:root {
  --color-text: #0e1116;
  --color-text-muted: #55606e;
  --color-text-subtle: #55606e;
  --color-border: #d5d9e0;
  --color-border-strong: #7b8594;
  --color-surface: #ffffff;
  --color-surface-subtle: #f6f7f9;
  --color-background: #eef0f3;
  /* La marca configurable no cambia el fondo ni las superficies del tema. */
  --brand-surface: #ffffff !important;
  --brand-background: #eef0f3 !important;
  --color-navigation: #0e1116;
  --color-navigation-active: #1b212b;
  --color-disabled-text: #55606e;
  --font-family-display: "Space Grotesk", Inter, "Segoe UI", Roboto, Arial, sans-serif;
  --b-lime: #b6f23c;
  --b-lime-ink: #0e1116;
  --b-solid: #0e1116;
  --b-solid-hover: #2a313b;
  --b-solid-ink: #ffffff;
  --b-region: #0e1116;
  --b-region-line: #0e1116;
  --b-region-ink: #ffffff;
  --b-region-muted: #b4bbc6;
  --b-region-soft: #1b212b;
  --b-control-line: #66707f;
}

/* ---------- Tokens, modo oscuro ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --color-text: #f2f4f7;
  --color-text-muted: #9aa3af;
  --color-text-subtle: #9aa3af;
  --color-border: #2a313b;
  --color-border-strong: #66707f;
  --color-surface: #161a21;
  --color-surface-subtle: #1b2028;
  --color-background: #0b0d11;
  --brand-surface: #161a21 !important;
  --brand-background: #0b0d11 !important;
  --brand-primary: #5bd0a0 !important;
  --brand-accent: #8fbcf0 !important;
  --color-navigation: #12161c;
  --color-navigation-active: #222832;
  --color-primary: #5bd0a0;
  --color-primary-hover: #7addb5;
  --color-accent: #8fbcf0;
  --color-success: #6fd3a4;
  --color-success-surface: #10261d;
  --color-success-border: #1f5a41;
  --color-warning: #ffd88a;
  --color-warning-surface: #3a2a05;
  --color-warning-border: #6b5210;
  --color-danger: #ffb4ab;
  --color-danger-surface: #3a1518;
  --color-danger-border: #7a2f35;
  --color-info: #a9cdf5;
  --color-info-surface: #10202f;
  --color-info-border: #27507a;
  --color-disabled-text: #8a93a0;
  --color-disabled-surface: #1b2028;
  --color-disabled-border: #2a313b;
  --yellow: #f4c95d;
  --teal: #4fd1c5;
  --orange: #f0a35e;
  --shadow-sm: 0 8px 18px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.55);
  --focus-ring: 0 0 0 3px rgba(182, 242, 60, 0.55);
  --b-solid: #f2f4f7;
  --b-solid-hover: #ffffff;
  --b-solid-ink: #0e1116;
  --b-region: #12161c;
  --b-region-line: #2a313b;
  --b-region-soft: #222832;
}

/* Modo oscuro generado desde styles.css por zona_fit_tema_gen.py. No editar a mano. */
:root[data-theme="dark"] .auth-gate img { background: #d2d4d6; }
:root[data-theme="dark"] .authorization-notice { border: 1px solid #a67619; color: #ffd182; background: #231d0e; }
:root[data-theme="dark"] .side-admin { border: 1px solid rgba(28, 30, 34,.12); background: rgba(28, 30, 34,.04); }
:root[data-theme="dark"] .admin-toggle { color: #1c1e22; }
:root[data-theme="dark"] .admin-toggle:hover { background: rgba(28, 30, 34,.08); }
:root[data-theme="dark"] .admin-toggle strong { color: #313e54; }
:root[data-theme="dark"] .side-button { border-color: rgba(28, 30, 34,.14); background: rgba(28, 30, 34,.08); color: #0f1a24; }
:root[data-theme="dark"] .side-button:hover { background: rgba(28, 30, 34,.14); }
:root[data-theme="dark"] .danger-side { color: #1e0c0e; border-color: rgba(151, 0, 17,.34); background: rgba(195, 65, 76,.18); }
:root[data-theme="dark"] .storage-status { border: 1px solid #22533d; color: #94f0cf; }
:root[data-theme="dark"] .storage-status span, :root[data-theme="dark"] .storage-status small, :root[data-theme="dark"] .storage-status em { color: #97a2b4; }
:root[data-theme="dark"] .storage-status.warning { border-color: #836011; background: #241e0f; color: #ffcf6f; }
:root[data-theme="dark"] .storage-status.danger { border-color: #62141f; background: #271013; color: #e15b6a; }
:root[data-theme="dark"] .auth-status { border: 1px solid #1a2d3f; background: #111c28; }
:root[data-theme="dark"] .auth-status.loading { border-color: #1a2d3f; background: #111c28; }
:root[data-theme="dark"] .auth-status.authenticated { border-color: #22533d; color: #94f0cf; }
:root[data-theme="dark"] .auth-status.warning { border-color: #836011; background: #241e0f; color: #ffcf6f; }
:root[data-theme="dark"] .period-control { background: #1c1e22; }
:root[data-theme="dark"] .backup-select { background: rgba(28, 30, 34,.1); border-color: rgba(28, 30, 34,.18); color: #1c1e22; }
:root[data-theme="dark"] .backup-control { color: #313e54; }
:root[data-theme="dark"] .external-backup-control { border: 1px solid rgba(28, 30, 34,.15); background: rgba(28, 30, 34,.05); }
:root[data-theme="dark"] .external-backup-control small { color: #313e54; }
:root[data-theme="dark"] .external-backup-control span { color: #1c1e22; }
:root[data-theme="dark"] button { background: #1c1e22; }
:root[data-theme="dark"] .primary { color: #1c1e22; }
:root[data-theme="dark"] .secondary { border-color: #1f3046; background: #101a28; }
:root[data-theme="dark"] .secondary:hover:not(:disabled) { background: #0f1925; border-color: #384c69; }
:root[data-theme="dark"] .ghost { background: #1c1e22; }
:root[data-theme="dark"] .danger:hover:not(:disabled) { border-color: #792934; background: #271013; }
:root[data-theme="dark"] .warning:hover:not(:disabled) { border-color: #a5781b; background: #1e190c; }
:root[data-theme="dark"] .info:hover:not(:disabled) { border-color: #003786; background: #0e1723; }
:root[data-theme="dark"] .icon { background: #1c1e22; }
:root[data-theme="dark"] .chart-panel canvas { background: #1c1e22; border: 1px solid #101822; }
:root[data-theme="dark"] .chart-stat { border: 1px solid #101821; background: #111c28; }
:root[data-theme="dark"] .bar-row { border-bottom: 1px solid #101821; }
:root[data-theme="dark"] .bar { background: #101821; }
:root[data-theme="dark"] .ui-listing-table th { color: #a8b2c0; }
:root[data-theme="dark"] .ui-listing-table tbody tr:hover { background-color: #111c28; }
:root[data-theme="dark"] .filters.catalog-filters { border: 1px solid #101821; background: #111e2a; }
:root[data-theme="dark"] .catalog-note { border: 1px solid #1a2d3f; background: #111c28; }
:root[data-theme="dark"] .catalog-note.danger { border-color: #1b0b0d; background: #271012; }
:root[data-theme="dark"] .catalog-note.success { border-color: #1f4b2e; background: #102616; }
:root[data-theme="dark"] .catalog-table th { background: #111c28; color: #aabcd8; }
:root[data-theme="dark"] .catalog-thumb { background: #111c28; }
:root[data-theme="dark"] .catalog-thumb.empty { background: linear-gradient(180deg, #111c28 0%, #0f1b24 100%); color: #718198; }
:root[data-theme="dark"] .icon-text-button span[aria-hidden="true"] { background: rgba(112, 233, 186, .12); }
:root[data-theme="dark"] .primary.icon-text-button span[aria-hidden="true"] { background: rgba(28, 30, 34, .18); color: #1c1e22; }
:root[data-theme="dark"] .entry-product-picker { background: #111c28; }
:root[data-theme="dark"] .inventory-product-suggestions { background: #1c1e22; }
:root[data-theme="dark"] .inventory-product-suggestion { border-bottom: 1px solid #101821; background: #1c1e22; }
:root[data-theme="dark"] .inventory-product-suggestion:hover, :root[data-theme="dark"] .inventory-product-suggestion:focus-visible { background: #0f241a; }
:root[data-theme="dark"] .inventory-product-suggestion-empty { background: #11192a; }
:root[data-theme="dark"] #pos label { color: #b7cae2; }
:root[data-theme="dark"] .pos-search-clear { border: 1px solid #1f3046; background: #101a27; color: #8593a7; }
:root[data-theme="dark"] button.pos-search-clear:hover:not(:disabled), :root[data-theme="dark"] button.pos-search-clear:focus-visible { border-color: #3b4f68; background: #0e1722; color: #c6d1eb; }
:root[data-theme="dark"] .pos-product-search-grid > label:not(.pos-product-main-field) { color: #c6d1eb; }
:root[data-theme="dark"] .pos-product-suggestions { border-color: #1f3046; background: #1c1e22; }
:root[data-theme="dark"] .pos-product-suggestions .inventory-product-suggestion { background: #1c1e22; }
:root[data-theme="dark"] .pos-product-suggestions .inventory-product-suggestion:hover, :root[data-theme="dark"] .pos-product-suggestions .inventory-product-suggestion.is-active { background: #0e2318; }
:root[data-theme="dark"] .pos-product-suggestions .inventory-product-suggestion.is-out-of-stock { background: #1c1e22; }
:root[data-theme="dark"] .pos-product-suggestions .inventory-product-suggestion.is-out-of-stock.is-active, :root[data-theme="dark"] .pos-product-suggestions .inventory-product-suggestion.is-out-of-stock:hover { background: #261c0f; }
:root[data-theme="dark"] .pos-cart-wrap { scrollbar-color: #4a586f #101822; }
:root[data-theme="dark"] .pos-cart-wrap::-webkit-scrollbar-thumb { background: #4a586f; }
:root[data-theme="dark"] .pos-cart-table th, :root[data-theme="dark"] .pos-cart-table td { border-bottom-color: #0f1924; }
:root[data-theme="dark"] .pos-cart-table thead th { background: #111c28; }
:root[data-theme="dark"] .pos-cart-table td:first-child strong { color: #c6d1eb; }
:root[data-theme="dark"] .pos-cart-table td:first-child small { color: #718198; }
:root[data-theme="dark"] .pos-cart-table tbody tr:hover td { background: #111b29; }
:root[data-theme="dark"] .pos-cart-empty-row td { color: #718198; background: #111e2a; }
:root[data-theme="dark"] .pos-money-prefix { color: #8593a7; }
:root[data-theme="dark"] .pos-actions-panel { border-color: #1f3046; background: linear-gradient(180deg, #1c1e22 0%, #111e2a 100%); }
:root[data-theme="dark"] .pos-payment-total { border: 1px solid #2b5740; background: #0f241a; }
:root[data-theme="dark"] .pos-payment-total span { color: #96e8c2; }
:root[data-theme="dark"] .pos-payment-total strong { color: #baf4dc; }
:root[data-theme="dark"] .pos-payment-total small { color: #95c5ae; }
:root[data-theme="dark"] #pos button:disabled { border-color: #1d2a3b; background: #101926; }
:root[data-theme="dark"] .filters.sales-report-filters { border: 1px solid #101821; background: #111e2a; }
:root[data-theme="dark"] .sales-report-filters label { color: #b3c4da; }
:root[data-theme="dark"] .sales-report-payment-card { border: 1px solid #0d1620; background: #111c28; }
:root[data-theme="dark"] .sales-report-table th { background: #111c28; color: #aabcd8; }
:root[data-theme="dark"] .sales-report-table td small { color: #728197; }
:root[data-theme="dark"] .sales-report-row.sale-voided { background: #291114; }
:root[data-theme="dark"] .sales-report-row.payment-partial { background: #25210f; }
:root[data-theme="dark"] .sales-report-row.payment-paid:not(.sale-voided) { background: #102818; }
:root[data-theme="dark"] .status-pill.pending { background: #261c0f; color: #f69042; }
:root[data-theme="dark"] .sales-report-detail-table th { background: #111c28; color: #aabcd8; }
:root[data-theme="dark"] .sales-report-detail-table td small { color: #728197; }
:root[data-theme="dark"] .inventory-entry-items-wrap { background: #1c1e22; }
:root[data-theme="dark"] .inventory-entry-items-table th { background: #111c28; color: #aabcd8; }
:root[data-theme="dark"] .inventory-purchase-detail-wrap { background: #1c1e22; }
:root[data-theme="dark"] .inventory-kardex-detail-grid div { background: #111c28; }
:root[data-theme="dark"] .accounts-payable-detail-grid div { background: #111c28; }
:root[data-theme="dark"] .mixed-payment-line { background: #111c28; }
:root[data-theme="dark"] .muted-row { color: #778396; background: #1a1c1f; }
:root[data-theme="dark"] .warn-text { color: #ffc858; }
:root[data-theme="dark"] .movement-technical-reference summary { color: #8795a8; }
:root[data-theme="dark"] th { background: #101a28; color: #96a1b3; }
:root[data-theme="dark"] tbody tr:hover { background: #11192a; }
:root[data-theme="dark"] .addi-table th:not(:last-child)::after { background: #232e3d; }
:root[data-theme="dark"] .subtabs { background: #111c28; }
:root[data-theme="dark"] .subtab.active { border-color: #22533d; background: #1c1e22; }
:root[data-theme="dark"] .close-date-bar { border: 1px solid #22533d; background: #0f251b; }
:root[data-theme="dark"] .close-date-bar input { background: #1c1e22; }
:root[data-theme="dark"] .filter-summary div { border: 1px solid #101821; background: #111c28; }
:root[data-theme="dark"] .legacy-technical-reference summary { color: #8795a8; }
:root[data-theme="dark"] .filter-summary .filter-net { border-color: #22533d; }
:root[data-theme="dark"] .operational-report-metrics > div { border: 1px solid #101821; background: #111c28; }
:root[data-theme="dark"] .authorization-audit-more-filters { background: #11192a; }
:root[data-theme="dark"] .authorization-audit-detail-grid div { background: #11192a; }
:root[data-theme="dark"] .authorization-audit-json { color: #0e141b; background: #bdd2ea; }
:root[data-theme="dark"] #pendingDashboardBadge { color: #87eec8; }
:root[data-theme="dark"] #pendingDashboardBadge.warn { background: #1e1a0c; color: #ffcb67; }
:root[data-theme="dark"] #pendingDashboardBadge.danger { background: #281010; }
:root[data-theme="dark"] .pending-dashboard .pending-card.warn { background: #25210f; border-color: #705303; }
:root[data-theme="dark"] .pending-dashboard .pending-card.danger { background: #281010; border-color: #451c22; }
:root[data-theme="dark"] .pending-dashboard .pending-card.ok { border-color: #22533d; }
:root[data-theme="dark"] .traceability-panel { background: #1c1e22; }
:root[data-theme="dark"] .diagnostic-panel { background: #11192a; }
:root[data-theme="dark"] .manual-load-panel { background: #1c1e22; }
:root[data-theme="dark"] .reconciliation-live-card { background: #1c1e22; }
:root[data-theme="dark"] .reconciliation-live-values > div { background: #111c28; }
:root[data-theme="dark"] .bank-import-file-field { border: 1px solid #0d141a; background: #111c28; }
:root[data-theme="dark"] .bank-import-grid input[type="file"] { background: #1c1e22; }
:root[data-theme="dark"] .bank-import-grid input[type="file"]::file-selector-button { border: 1px solid #344052; background: #101a22; }
:root[data-theme="dark"] .bank-import-grid input[type="file"]::file-selector-button:hover { background: #0e161d; }
:root[data-theme="dark"] .diagnostic-item { border: 1px solid #855c0a; background: #241e0f; }
:root[data-theme="dark"] .diagnostic-item.alta { border-color: #6d0f0f; background: #271010; }
:root[data-theme="dark"] #credits .receivables-authority-tag { color: #8795a8; background: #101a25; }
:root[data-theme="dark"] .receivables-empty-state { border: 1px dashed #314154; color: #94a0b2; background: #111c28; }
:root[data-theme="dark"] .receivables-empty-state strong { color: #bfcae2; }
:root[data-theme="dark"] .credit-products-editor { background: #111c28; }
:root[data-theme="dark"] .credit-products-wrap { background: #1c1e22; }
:root[data-theme="dark"] .credit-products-table { background: #1c1e22; }
:root[data-theme="dark"] .credit-products-table th { background: #101a25; }
:root[data-theme="dark"] .credit-products-total { background: #111c28; }
:root[data-theme="dark"] #formFields input[name="amountDisplay"][readonly] { background: #112017; color: #bef8dd; }
:root[data-theme="dark"] .initial-layaway-deposit { border: 1px solid #225a36; background: #0f2518; }
:root[data-theme="dark"] .acquirer-empty-state { background: #111c28; }
:root[data-theme="dark"] .settings-preview { background: #111c28; }
:root[data-theme="dark"] .admin-card { background: #1c1e22; }
:root[data-theme="dark"] .admin-card button { border-color: #25344b; background: #101a28; color: #bfcae2; }
:root[data-theme="dark"] .admin-card button:hover { background: #0f1925; border-color: #384c69; }
:root[data-theme="dark"] .admin-card button.primary { color: #1c1e22; }
:root[data-theme="dark"] .admin-card button.danger { border-color: #631d27; background: #281013; }
:root[data-theme="dark"] .secondary { background: #101a28; }
:root[data-theme="dark"] .muted-card { background: #111c28; }
:root[data-theme="dark"] .admin-card .backup-select { background: #1c1e22; }
:root[data-theme="dark"] .admin-card .external-backup-control { background: #111c28; }
:root[data-theme="dark"] .profitability-badge { color: #87eec8; }
:root[data-theme="dark"] .profitability-disclaimer { border: 1px solid #855e0f; background: #231d0e; color: #ffd07b; }
:root[data-theme="dark"] .profitability-summary > div, :root[data-theme="dark"] .profitability-main { background: #111c28; }
:root[data-theme="dark"] .profitability-main { background: linear-gradient(135deg, #bfeaef, #6ee8be); color: #1c1e22; }
:root[data-theme="dark"] .profitability-main.negative { background: linear-gradient(135deg, #e9b5c7, #db455f); }
:root[data-theme="dark"] .profitability-main span, :root[data-theme="dark"] .profitability-main small { color: rgba(28, 30, 34, .78); }
:root[data-theme="dark"] .profitability-break-even { border-color: #1c2d46 !important; background: #101a28 !important; }
:root[data-theme="dark"] .rule-card { background: #11192a; }
:root[data-theme="dark"] .payroll-canonical-form { background: #111c28; }
:root[data-theme="dark"] .bonus-section { background: #1c1e22; }
:root[data-theme="dark"] .bonus-section h3 { background: #13171d; color: #a0c9b6; }
:root[data-theme="dark"] .bonus-grid-head { background: #101a27; color: #a8b2c0; }
:root[data-theme="dark"] .bonus-vendor-row { background: #11192a; }
:root[data-theme="dark"] .bonus-person-row { background: #11261a; }
:root[data-theme="dark"] .bonus-prior-section h3 { background: #1e1a0c; color: #ffcf76; }
:root[data-theme="dark"] .bonus-prior-row { background: #272210; }
:root[data-theme="dark"] .month-close-hero { color: #1c1e22; }
:root[data-theme="dark"] .month-close-continuity div, :root[data-theme="dark"] .method-balance-card { border: 1px solid #0b141c; background: #1c1e22; }
:root[data-theme="dark"] .method-balance-card { background: #111c28; }
:root[data-theme="dark"] .month-close-group { background: #1c1e22; }
:root[data-theme="dark"] .month-close-group h3 { color: #cad6eb; }
:root[data-theme="dark"] .month-close-item { border: 1px solid #101821; background: #111c28; }
:root[data-theme="dark"] .month-close-item.strong { border-color: #22533d; }
:root[data-theme="dark"] .month-close-source-list { border: 1px solid #101821; background: #111c28; }
:root[data-theme="dark"] .month-close-context-grid > div { border: 1px solid #0d141a; background: #111c28; }
:root[data-theme="dark"] .month-close-technical-reference { border: 1px solid #0d141a; background: #111c28; }
:root[data-theme="dark"] .month-close-technical-reference summary { color: #8795a8; }
:root[data-theme="dark"] .method-detail-card { background: #1c1e22; }
:root[data-theme="dark"] .method-detail-card summary { background: #111c28; }
:root[data-theme="dark"] .single-method-breakdown > div { border-top: 1px solid #101821; }
:root[data-theme="dark"] .single-method-breakdown > div.strong { background: #111c28; }
:root[data-theme="dark"] .reconciliation-head { background: #111a26; }
:root[data-theme="dark"] .reconciliation-row { border-top: 1px solid #101821; background: #1c1e22; }
:root[data-theme="dark"] .month-close-item.danger { border-color: #5d141d; background: #291113; }
:root[data-theme="dark"] .month-close-warning { border: 1px solid #7d4500; background: #241d0f; color: #ffca76; }
:root[data-theme="dark"] .month-close-warning span, :root[data-theme="dark"] .month-close-warning small { color: #ffca76; }
:root[data-theme="dark"] .month-close-info { border: 1px solid #1d3048; background: #101a26; color: #84b7e6; }
:root[data-theme="dark"] .month-close-info span, :root[data-theme="dark"] .month-close-info small { color: #84b7e6; }
:root[data-theme="dark"] .month-close-empty { background: #11192a; }
:root[data-theme="dark"] .reconciliation-case { background: #1c1e22; }
:root[data-theme="dark"] .cash-row { border-bottom: 1px solid #101821; }
:root[data-theme="dark"] .cash-head { background: #111a26; }
:root[data-theme="dark"] .cash-totals div { border: 1px solid #101821; background: #111c28; }
:root[data-theme="dark"] .cash-grand-total { border-color: #22533d !important; }
:root[data-theme="dark"] .cash-count-card { border-bottom: 1px solid #101821; }
:root[data-theme="dark"] .cash-expected-card { border: 1px solid #101821; background: #111c28; }
:root[data-theme="dark"] .cash-expected-card.wide { border-color: #22533d; }
:root[data-theme="dark"] .skeleton { background: #10161e; }
:root[data-theme="dark"] .credit-entry-dialog menu { background: linear-gradient(180deg, rgba(28, 30, 34,.86), #1c1e22 28%); }
:root[data-theme="dark"] .app-action-card { background: #111c28; }
:root[data-theme="dark"] .app-action-warning { border: 1px solid #9d690b; background: #231e0e; color: #ffd485; }
:root[data-theme="dark"] .app-action-danger { border-color: #4d1f27; background: #281013; color: #e36a7e; }
:root[data-theme="dark"] .app-action-success { border-color: #22533d; color: #91f7d6; }
:root[data-theme="dark"] .critical-authorization-identity { border: 1px solid #1a2b3d; background: #111c28; }
:root[data-theme="dark"] .critical-authorization-identity.authenticated { border-color: #22533d; color: #91f7d6; }
:root[data-theme="dark"] .critical-authorization-identity.no-session { border-color: #9d690b; background: #231e0e; color: #ffd485; }
:root[data-theme="dark"] .critical-authorization-hint { border: 1px solid #9d690b; background: #231e0e; color: #ffd485; }
:root[data-theme="dark"] #inventoryPurchaseDetailSummary { background: linear-gradient(180deg, #111c28, #1c1e22); }
:root[data-theme="dark"] #inventoryPurchaseDetailSummary div { border: 1px solid #101821; background: #1c1e22; }
:root[data-theme="dark"] #productLotsForm menu { background: linear-gradient(180deg, rgba(28, 30, 34, .88), #1c1e22 34%); }
:root[data-theme="dark"] .product-lot-editor { background: #1c1e22; }
:root[data-theme="dark"] .confirm-summary { background: #111c28; }
:root[data-theme="dark"] .modal-warning { border: 1px solid #9d690b; background: #231e0e; color: #ffd485; }
:root[data-theme="dark"] .modal-group { background: #111c28; }
:root[data-theme="dark"] .modal-note { border: 1px solid #22533d; color: #9fedc9; }
:root[data-theme="dark"] .payroll-area-row td { background: #102218; color: #9fedc9; }
:root[data-theme="dark"] .not-applicable { background: #111c28; }
:root[data-theme="dark"] .calc-preview { background: #101a28; }
:root[data-theme="dark"] .status-pill { background: #1e1a0c; color: #ffcb67; }
:root[data-theme="dark"] .status-pill.danger { background: #271012; color: #ec3a65; }
:root[data-theme="dark"] .tag { color: #87eec8; }
@media (max-width: 1120px) {
  :root[data-theme="dark"] .collaborator-table tbody, :root[data-theme="dark"] .provider-table tbody, :root[data-theme="dark"] .credit-table tbody, :root[data-theme="dark"] .addi-table tbody, :root[data-theme="dark"] .movements-table tbody, :root[data-theme="dark"] .recent-table tbody, :root[data-theme="dark"] .client-table tbody, :root[data-theme="dark"] .sales-report-table tbody, :root[data-theme="dark"] .sales-report-detail-table tbody { background: #111c28; }
  :root[data-theme="dark"] .collaborator-table tr, :root[data-theme="dark"] .provider-table tr, :root[data-theme="dark"] .credit-table tr, :root[data-theme="dark"] .addi-table tr, :root[data-theme="dark"] .movements-table tr, :root[data-theme="dark"] .recent-table tr, :root[data-theme="dark"] .client-table tr, :root[data-theme="dark"] .sales-report-table tr, :root[data-theme="dark"] .sales-report-detail-table tr { background: #1c1e22; }
  :root[data-theme="dark"] .collaborator-table td, :root[data-theme="dark"] .provider-table td, :root[data-theme="dark"] .credit-table td, :root[data-theme="dark"] .addi-table td, :root[data-theme="dark"] .movements-table td, :root[data-theme="dark"] .recent-table td, :root[data-theme="dark"] .client-table td, :root[data-theme="dark"] .sales-report-table td, :root[data-theme="dark"] .sales-report-detail-table td { border-bottom: 1px solid #101821; }
}
@media (max-width: 600px) {
  :root[data-theme="dark"] .catalog-table tbody, :root[data-theme="dark"] .inventory-entry-items-table tbody, :root[data-theme="dark"] .inventory-entry-history-table tbody, :root[data-theme="dark"] .pos-cart-table tbody { background: #111c28; }
  :root[data-theme="dark"] .catalog-table tr, :root[data-theme="dark"] .inventory-entry-items-table tr, :root[data-theme="dark"] .inventory-entry-history-table tr, :root[data-theme="dark"] .pos-cart-table tr { background: #1c1e22; }
  :root[data-theme="dark"] .catalog-table td, :root[data-theme="dark"] .inventory-entry-items-table td, :root[data-theme="dark"] .inventory-entry-history-table td, :root[data-theme="dark"] .pos-cart-table td { border-bottom: 1px solid #101821; }
}
@media screen and (max-width: 760px) {
  :root[data-theme="dark"] .ui-listing-table[data-mobile-strategy="cards"] tr, :root[data-theme="dark"] .ui-listing-table[data-mobile-strategy="priority-detail"] tr, :root[data-theme="dark"] .ui-listing-table[data-mobile-strategy="compact-list"] tr { background: #1c1e22; }
  :root[data-theme="dark"] .ui-listing-table[data-mobile-strategy="cards"] td, :root[data-theme="dark"] .ui-listing-table[data-mobile-strategy="priority-detail"] td, :root[data-theme="dark"] .ui-listing-table[data-mobile-strategy="compact-list"] td { border-bottom: 1px solid #101821; }
}
@media screen {
  :root[data-theme="dark"] .uxui7-module-view { --uxui7-surface: #101e28; --uxui7-border: #1b2c3d; }
  :root[data-theme="dark"] .uxui7-module-view .panel-head:not(.compact) { border-bottom: 1px solid #0e161f; }
  :root[data-theme="dark"] .uxui7-module-view .ui-listing-table tbody tr:not(.ui-table-state-row):hover td { background: #111f29; }
  :root[data-theme="dark"] .uxui7-dashboard .profitability-badge, :root[data-theme="dark"] .uxui7-dashboard #pendingDashboardBadge { color: #88e6c4; background: #0d2017; }
  :root[data-theme="dark"] .uxui7-filter-label, :root[data-theme="dark"] .inventory-kardex-filters .uxui7-filter-label { color: #97a2b4; }
  :root[data-theme="dark"] .uxui7-filter-label input, :root[data-theme="dark"] .uxui7-filter-label select { background: #1c1e22; }
  :root[data-theme="dark"] .uxui7-primary-search input { border-color: #354860; }
  :root[data-theme="dark"] .ui-table-state-row td { background: #1c1e22; }
  :root[data-theme="dark"] .ui-table-state-content { color: #94a0b2; background: #11192a; }
  :root[data-theme="dark"] .ui-table-state-content::before { background: #414f65; }
  :root[data-theme="dark"] .ui-table-state-content strong { color: #bfcae2; }
  :root[data-theme="dark"] .ui-table-state-error .ui-table-state-content { background: #291111; }
  :root[data-theme="dark"] .movement-event-id { color: #718198; }
  :root[data-theme="dark"] .uxui7-operation-step { background: #1c1e22; }
  :root[data-theme="dark"] .uxui7-step-heading { background: #12221a; }
  :root[data-theme="dark"] .uxui7-step-number { color: #1c1e22; }
  :root[data-theme="dark"] .uxui7-critical-panel > .panel-head { border-left: 4px solid #d29f28; }
  :root[data-theme="dark"] #reconciliation .bank-import-panel { background: #111c28; }
  :root[data-theme="dark"] #reconciliation .bank-import-panel .bank-import-grid { border: 1px solid #0e161d; background: #1c1e22; }
  :root[data-theme="dark"] .uxui7-form-surface { background: #111c28; }
  :root[data-theme="dark"] .uxui7-form-surface .calc-preview { background: #1c1e22; }
  :root[data-theme="dark"] .uxui7-secondary-form { border: 1px dashed #354152; background: #1c1e22; }
  :root[data-theme="dark"] #inventoryEntryForm > .form-grid { background: #111c28; }
  :root[data-theme="dark"] #inventoryEntryForm .entry-product-picker { background: #1c1e22; }
  :root[data-theme="dark"] #inventoryEntryForm .entry-total-line { border: 1px solid #2a5642; }
  :root[data-theme="dark"] #inventoryEntryForm .entry-total-line span { color: #97a2b4; }
  :root[data-theme="dark"] #credits .credit-panel, :root[data-theme="dark"] .uxui7-history-panel { border-top: 3px solid #324354; }
  :root[data-theme="dark"] #audit .audit-section { background: #11192a; }
  :root[data-theme="dark"] .uxui7-admin-card { border-top: 4px solid #67768e; }
  :root[data-theme="dark"] .uxui7-admin-card[data-admin-surface="diagnostic"] { border-top-color: #d2a646; }
  :root[data-theme="dark"] .uxui7-admin-card .external-backup-control { border: 1px solid #0e141b; background: #111c28; }
}
@media screen and (min-width: 1180px) {
  :root[data-theme="dark"] .catalog-table-wrap:not(:focus-within), :root[data-theme="dark"] .inventory-kardex-wrap:not(:focus-within), :root[data-theme="dark"] .accounts-payable-wrap:not(:focus-within) { scrollbar-color: #384456 transparent; }
}
:root[data-theme="dark"] #pos .pos-cart-wrap.is-empty { background: linear-gradient(180deg, #1c1e22 0%, #111f29 100%); }
:root[data-theme="dark"] #pos .pos-actions-panel.is-stage-products #posResetSale.ghost { border-color: #592329; background: #2a1111; color: #d75965; }
:root[data-theme="dark"] #pos .pos-discount-reason.has-error input, :root[data-theme="dark"] #pos #posDiscountReason[aria-invalid="true"] { border-color: #c93244; background: #291114; }
:root[data-theme="dark"] #pos .pos-sale-options[open] { border: 1px solid #20303f; background: #111c28; }
:root[data-theme="dark"] #pos .pos-sale-options[open] summary { color: #a8c0d9; }
:root[data-theme="dark"] .pos-context-strip { border: 1px solid #253547; background: #111c28; }
:root[data-theme="dark"] .pos-context-item { border-right: 1px solid #1c2b3c; }
:root[data-theme="dark"] .pos-context-item span, :root[data-theme="dark"] .pos-context-item small { color: #7c8ba0; }
:root[data-theme="dark"] .pos-context-item strong { color: #bccee6; }
:root[data-theme="dark"] #pos .mini-panel-head h3 { color: #b8cae3; }
:root[data-theme="dark"] #pos .mini-panel-head small { color: #75859b; }
:root[data-theme="dark"] .pos-search-hint { color: #718198; }
:root[data-theme="dark"] .pos-line-options, :root[data-theme="dark"] .pos-sale-options, :root[data-theme="dark"] .pos-payment-options { border-top: 1px solid #0e141b; color: #9fb2c9; }
:root[data-theme="dark"] .pos-line-options summary, :root[data-theme="dark"] .pos-sale-options summary, :root[data-theme="dark"] .pos-payment-options summary { color: #97a2b4; }
:root[data-theme="dark"] .pos-actions-panel.is-payment-ready .pos-payment-total { border-color: #468667; }
@media screen and (max-width: 760px) {
  :root[data-theme="dark"] .pos-context-item:nth-child(3) { border-top: 1px solid #1c2b3c; }
}
@media screen and (max-width: 420px) {
  :root[data-theme="dark"] .pos-context-item, :root[data-theme="dark"] .pos-context-item:nth-child(2), :root[data-theme="dark"] .pos-context-item:nth-child(3) { border-top: 1px solid #1c2b3c; }
}
:root[data-theme="dark"] #pos .pos-cart-panel .mini-panel-head { border-bottom: 1px solid #0e141b; }
:root[data-theme="dark"] .pos-stage-badge { border: 1px solid #253547; background: #111c28; color: #8593a7; }
:root[data-theme="dark"] .pos-stage-badge[data-state="confirm"] { border-color: #1c3555; background: #0f1926; color: #62a3df; }
:root[data-theme="dark"] .pos-stage-badge[data-state="payment"], :root[data-theme="dark"] .pos-stage-badge[data-state="paid"] { border-color: #2e6248; background: #0e2318; color: #90ebc3; }
:root[data-theme="dark"] .pos-stage-badge[data-state="voided"] { border-color: #5d151d; background: #271012; color: #e15666; }
:root[data-theme="dark"] .pos-line-state { background: #0f1926; color: #67a1d9; }
:root[data-theme="dark"] .pos-flow-steps li { border: 1px solid #1e2d3d; background: #111c28; color: #718198; }
:root[data-theme="dark"] .pos-flow-steps li span { background: #0e141b; color: #939fb1; }
:root[data-theme="dark"] .pos-flow-steps li.is-active { border-color: #438a66; background: #0f241a; color: #94eec7; }
:root[data-theme="dark"] .pos-flow-steps li.is-active span, :root[data-theme="dark"] .pos-flow-steps li.is-complete span { color: #1c1e22; }
:root[data-theme="dark"] .pos-flow-steps li.is-complete { border-color: #28533d; color: #94d3b6; }
:root[data-theme="dark"] .pos-flow-steps li.is-stopped { border-color: #5d151d; background: #271012; color: #d75965; }
:root[data-theme="dark"] .pos-payment-field { color: #b7cae2; }
:root[data-theme="dark"] .pos-payment-field > small, :root[data-theme="dark"] .pos-payment-amount-field > small { color: #718198; }
:root[data-theme="dark"] .pos-payment-preview { border: 1px solid #1b2c3d; background: #111c28; }
:root[data-theme="dark"] .pos-payment-preview span { color: #718198; }
:root[data-theme="dark"] .pos-payment-preview strong { color: #b8cae3; }
:root[data-theme="dark"] .pos-payment-preview #posPaymentPreviewChangeRow strong { color: #87eec2; }
:root[data-theme="dark"] .pos-payment-lines-head strong { color: #b8cae3; }
:root[data-theme="dark"] .pos-payment-lines-head small { color: #718198; }
:root[data-theme="dark"] .pos-payment-line { border: 1px solid #1d2d3d; background: #11192a; }
:root[data-theme="dark"] .pos-payment-line legend { color: #9eb1ca; }
:root[data-theme="dark"] #pos .pos-payment-line legend .pos-remove-payment-line { color: #d75965; }
:root[data-theme="dark"] #pos .pos-checkout-dock { border-top: 1px solid #1f3046; background: #1c1e22; }
:root[data-theme="dark"] #pos #posEditDraft { border-color: #2e4d6d; color: #5ea1de; background: #101b27; }
:root[data-theme="dark"] #posToggleFocusMode[aria-pressed="true"] { border-color: #576985; background: #0e2318; color: #90ebc3; }
:root[data-theme="dark"] #pos .pos-panel, :root[data-theme="dark"] #pos .pos-actions-panel { border-color: #243547; }
:root[data-theme="dark"] #pos .pos-product-search-control input { border-color: #36485c; background: #1c1e22; }
:root[data-theme="dark"] #pos .pos-product-search-control input:focus { border-color: #6ce7b7; }
:root[data-theme="dark"] #pos .pos-search-clear { color: #8390a5; }
:root[data-theme="dark"] #pos .pos-search-clear:hover, :root[data-theme="dark"] #pos .pos-search-clear:focus-visible { background: #0f1922; color: #b4cae4; }
:root[data-theme="dark"] #pos .pos-product-suggestions { border-color: #36485c; }
:root[data-theme="dark"] #pos .pos-suggestion-thumb, :root[data-theme="dark"] #pos .pos-cart-thumb { border: 1px solid #213040; background: #121d22; color: #86e5c0; }
:root[data-theme="dark"] #pos .pos-suggestion-name { color: #b7cce5; }
:root[data-theme="dark"] #pos .pos-suggestion-meta { color: #75859b; }
:root[data-theme="dark"] #pos .pos-suggestion-details { color: #8db0ca; }
:root[data-theme="dark"] #pos .pos-suggestion-details span:last-child { color: #90ebc3; }
:root[data-theme="dark"] #pos .pos-product-suggestion.is-active { border-color: #468164; background: #0e2318; }
:root[data-theme="dark"] #pos .pos-product-suggestion.is-out-of-stock .pos-suggestion-details span:first-child { color: #d3535f; }
:root[data-theme="dark"] #pos .pos-cart-wrap { border-color: #1f3040; background: #1c1e22; }
:root[data-theme="dark"] #pos .pos-cart-product-copy strong { color: #b9cde6; }
:root[data-theme="dark"] #pos .pos-cart-product-copy small { color: #8491a6; }
:root[data-theme="dark"] #pos .pos-qty-button, :root[data-theme="dark"] #pos .pos-remove-cart-item { border: 1px solid #2a3a49; background: #131c25; color: #a6c0da; }
:root[data-theme="dark"] #pos .pos-qty-button:hover:not(:disabled), :root[data-theme="dark"] #pos .pos-qty-button:focus-visible, :root[data-theme="dark"] #pos .pos-remove-cart-item:hover:not(:disabled), :root[data-theme="dark"] #pos .pos-remove-cart-item:focus-visible { border-color: #4c6b89; background: #0e1a23; }
:root[data-theme="dark"] #pos .pos-remove-cart-item { color: #d75562; }
:root[data-theme="dark"] #pos .pos-cart-undo { border: 1px solid #3e4b5e; border-left: 4px solid #6ce7b7; background: #0f2318; color: #a5e4cb; }
:root[data-theme="dark"] #pos .pos-cart-empty-row strong { color: #a5b9d0; }
:root[data-theme="dark"] #pos .pos-cart-empty-row small { color: #8491a6; }
:root[data-theme="dark"] #pos .pos-payment-shortcuts { border: 1px solid #1e2e3e; background: #131c25; }
:root[data-theme="dark"] #pos .pos-payment-shortcuts > span { color: #919daf; }
:root[data-theme="dark"] #pos .pos-payment-shortcut { border: 1px solid #2a3a48; background: #1c1e22; color: #9fb7cf; }
:root[data-theme="dark"] #pos .pos-payment-shortcut:hover:not(:disabled), :root[data-theme="dark"] #pos .pos-payment-shortcut:focus-visible, :root[data-theme="dark"] #pos .pos-payment-shortcut[aria-pressed="true"] { border-color: #51906e; background: #0e2217; color: #92edc6; }
:root[data-theme="dark"] #pos .pos-payment-line { border-color: #243546; background: #1c1e22; }
:root[data-theme="dark"] #pos .pos-checkout-dock { background: rgba(28, 30, 34, .98); }
:root[data-theme="dark"] #pos .pos-checkout-dock .pos-payment-preview { border-color: #263847; background: #131c25; }
:root[data-theme="dark"] #pos .pos-line-state { background: #0f1b24; color: #5ea1de; }
:root[data-theme="dark"] #pos small { color: #8491a6; }

/* ---------- Componentes del tema B (valen para los dos modos) ---------- */

/* Barra lateral: carbón, con marca lima en el módulo activo. */
.sidebar {
  background: var(--b-region);
  border-right: 1px solid var(--b-region-line);
  color: var(--b-region-ink);
}

.tab {
  color: var(--b-region-muted);
}

.tab.active,
.tab:hover,
.tab:focus-visible {
  background: var(--b-region-soft);
  color: var(--b-region-ink);
}

.tab.active {
  box-shadow: inset 3px 0 0 var(--b-lime);
  font-weight: 700;
}

/* Portada del Panel: bloque carbón liso en lugar del degradado verde. */
.dashboard-hero {
  background: var(--b-region);
  border: 1px solid var(--b-region-line);
  box-shadow: none;
  color: var(--b-region-ink);
}

/* Botón principal: sólido carbón en modo normal, claro en modo oscuro. */
.primary {
  background: var(--b-solid) !important;
  border-color: var(--b-solid) !important;
  color: var(--b-solid-ink) !important;
}

.primary:hover:not(:disabled) {
  background: var(--b-solid-hover) !important;
  border-color: var(--b-solid-hover) !important;
}

.primary:disabled {
  background: var(--color-disabled-surface) !important;
  border-color: var(--color-disabled-border) !important;
  color: var(--color-disabled-text) !important;
}

.primary > span {
  color: inherit;
}

/* Cobrar: la acción más importante de la tienda va en lima. */
.pos-payment-submit button,
.pos-payment-submit button:hover:not(:disabled) {
  background: var(--b-lime) !important;
  border-color: var(--b-lime) !important;
  color: var(--b-lime-ink) !important;
  font-family: var(--font-family-display);
  font-weight: 700;
}

.pos-payment-submit button:disabled {
  background: var(--color-disabled-surface) !important;
  border-color: var(--color-disabled-border) !important;
  color: var(--color-disabled-text) !important;
}

/* Textos sobre las zonas carbón. */
.brand span,
.side-note small {
  color: var(--b-region-muted);
}

.dashboard-hero .eyebrow {
  color: var(--b-lime);
}

.dashboard-technical-reference summary {
  color: var(--b-region-muted);
}

.topbar-brand {
  color: var(--color-success);
}

/* Paso activo del cobro: insignia lima. */
.pos-flow-steps li.is-active span,
.pos-flow-steps li.is-complete span {
  background: var(--b-lime) !important;
  color: var(--b-lime-ink) !important;
}

/* Ajustes puntuales del modo oscuro. */
:root[data-theme="dark"] .pos-flow-steps li:not(.is-active):not(.is-complete) {
  color: var(--color-text-muted);
}

:root[data-theme="dark"] .external-backup-control small {
  color: var(--color-text-muted);
}

:root[data-theme="dark"] .external-backup-control span {
  color: var(--color-text);
}

/* Cifras y títulos con la letra de mostrador. */
h1,
h2,
.metric strong,
.pos-payment-total strong {
  font-family: var(--font-family-display);
  letter-spacing: -0.01em;
}

/* Interruptor de modo normal / oscuro (lo inserta tema.js). */
.tema-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--touch-target);
  padding: 0 12px;
  width: 100%;
  justify-content: center;
  flex: none;
  border: 1px solid var(--b-control-line);
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--b-region-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.tema-toggle svg {
  flex: none;
}

.tema-toggle:hover,
.tema-toggle:focus-visible {
  background: var(--b-region-soft);
}

/* En celular el interruptor vive dentro del menú, para no gastar pantalla. */
@media (max-width: 600px) {
  body:not(.mobile-nav-open) .tema-toggle {
    display: none;
  }
}
