/* Theme, mobile photo capture and purchase-order module. */
.theme-toggle{width:42px;height:38px;display:grid;place-items:center;padding:0;font-size:20px;line-height:1}
.connection-status{position:fixed;z-index:20;left:50%;top:12px;transform:translateX(-50%);width:min(680px,calc(100% - 28px));padding:11px 16px;border-radius:10px;border:1px solid rgba(245,158,11,.5);background:#3b2a08;color:#ffe8a3;text-align:center;font-weight:850;box-shadow:0 14px 36px rgba(0,0,0,.3)}
button:disabled{cursor:not-allowed;opacity:.56;filter:grayscale(.25)}
.cash-sale-guard{margin:10px 0;padding:10px 12px;border-radius:9px;border:1px solid var(--line);font-size:13px;font-weight:800}
.cash-sale-guard.ready{color:#b9f6cf;background:rgba(34,197,94,.1);border-color:rgba(34,197,94,.28)}
.cash-sale-guard.blocked{color:#ffe8a3;background:rgba(245,158,11,.1);border-color:rgba(245,158,11,.3)}
.cash-register-columns{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(290px,.8fr);gap:14px;margin:14px 0}
.cash-register-summary{margin-bottom:14px}
.cash-open-card{max-width:760px;margin:0 auto 18px}
.cash-close-card{height:max-content}
.compact-form{grid-template-columns:140px 150px minmax(220px,1fr) auto}
.return-sale-items{display:grid;gap:10px;margin:14px 0}
.return-sale-row{display:grid!important;grid-template-columns:auto minmax(0,1fr) 140px;align-items:center;gap:12px;padding:13px 14px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.045);cursor:pointer}
.return-sale-row>input[type="checkbox"]{width:22px;height:22px;min-height:0;accent-color:var(--red)}
.return-sale-row span{display:grid;gap:3px;color:var(--text)}
.return-sale-row small{color:var(--muted)}

.purchase-order-list,.purchase-order-items{display:grid;gap:12px;margin-top:14px}
.purchase-order-card,.purchase-order-item,.empty-state{border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.045);padding:16px}
.purchase-order-card{display:grid;gap:13px}
.purchase-order-card>header{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}
.purchase-order-card .eyebrow{margin-bottom:4px}
.order-status{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:7px 11px;font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.04em}
.status-pending{color:#ffe8a3;background:rgba(245,158,11,.14);border:1px solid rgba(245,158,11,.35)}
.status-received{color:#b9f6cf;background:rgba(34,197,94,.14);border:1px solid rgba(34,197,94,.35)}
.status-cancelled{color:#d9dde4;background:rgba(148,163,184,.14);border:1px solid rgba(148,163,184,.32)}
.order-meta{display:flex;flex-wrap:wrap;gap:10px 22px;color:var(--muted)}
.order-meta b{color:var(--text)}
.order-items{display:grid;gap:7px;padding:12px;border-radius:10px;background:rgba(0,0,0,.15)}
.order-items>div{display:grid;gap:2px;padding-bottom:7px;border-bottom:1px solid var(--line)}
.order-items>div:last-child{padding-bottom:0;border-bottom:0}
.order-items small{color:var(--muted)}
.order-notes{margin:0;color:var(--muted)}
.order-actions{justify-content:flex-start}
.order-actions form{margin:0}
.order-help{margin-bottom:14px}
.purchase-order-item{position:relative;display:grid;gap:12px}
.purchase-order-item .remove-order-item{justify-self:end}
.order-price-summary{display:block;padding:10px 12px;border:1px solid rgba(34,197,94,.28);border-radius:9px;background:rgba(34,197,94,.08);color:#b9f6cf;font-weight:700;line-height:1.45}
.order-form-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-top:14px;border-top:1px solid var(--line);font-size:18px}
.order-form-footer b{font-size:22px}
.empty-state{text-align:center;color:var(--muted);padding:34px 18px}
.barcode-catalog-filters{display:grid;grid-template-columns:minmax(240px,1fr) 220px auto;gap:12px;align-items:end}
.barcode-catalog-results{display:grid;gap:9px;margin-top:14px;max-height:48vh;overflow:auto;padding-right:3px}
.barcode-catalog-row{display:grid;grid-template-columns:minmax(125px,auto) minmax(220px,1fr) auto auto;align-items:center;gap:14px;padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.045)}
.barcode-code{display:grid;gap:2px;font-variant-numeric:tabular-nums}
.barcode-code small{color:var(--muted);text-transform:uppercase;font-size:10px;font-weight:800}
.barcode-code b{font-size:15px;letter-spacing:.03em}
.catalog-source{border-radius:999px;padding:6px 9px;font-size:11px;font-weight:900;white-space:nowrap}
.source-local{color:#b9f6cf;background:rgba(34,197,94,.14);border:1px solid rgba(34,197,94,.3)}
.source-reference{color:#d9e8ff;background:rgba(59,130,246,.14);border:1px solid rgba(59,130,246,.3)}
.barcode-pagination{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:14px}
.catalog-attribution{margin:14px 0 0;color:var(--muted);font-size:12px;line-height:1.5}
.catalog-attribution a{color:inherit;font-weight:800}
.inventory-filters{grid-template-columns:repeat(auto-fit,minmax(175px,1fr))!important;align-items:end}
.inventory-summary{grid-template-columns:repeat(auto-fit,minmax(155px,1fr))!important}
.inventory-alert-card{border-color:rgba(245,158,11,.34)!important}
.product-data-flags{display:flex;flex-wrap:wrap;gap:5px;margin-top:4px}
.data-flag{display:inline-flex;width:max-content;border-radius:999px;padding:3px 7px;font-size:10px;font-style:normal;font-weight:900;line-height:1.2;text-transform:uppercase;letter-spacing:.02em}
.data-flag.warning{color:#fde68a;background:rgba(245,158,11,.16);border:1px solid rgba(245,158,11,.3)}
.data-flag.danger{color:#fecaca;background:rgba(239,68,68,.15);border:1px solid rgba(239,68,68,.3)}
.data-flag.neutral{color:#dbeafe;background:rgba(59,130,246,.14);border:1px solid rgba(59,130,246,.3)}
.barcode-choice{display:flex!important;align-items:center;gap:12px;padding:13px 14px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.045);cursor:pointer}
.barcode-choice input{width:21px!important;height:21px!important;min-height:0!important;flex:0 0 auto;accent-color:var(--red)}
.barcode-choice span{display:grid;gap:3px}
.barcode-choice small{color:var(--muted);font-weight:500;line-height:1.35}

:root[data-theme="light"]{
  --red:#bd1724;
  --red2:#7d1620;
  --dark:#f4f5f7;
  --panel:rgba(255,255,255,.94);
  --line:rgba(37,43,54,.15);
  --text:#20242c;
  --muted:#626a78;
}

/* Productos del día: inventario efímero separado del almacén. */
.daily-products-layout{display:grid;grid-template-columns:minmax(330px,.9fr) minmax(520px,1.35fr);gap:18px;align-items:start}
.daily-product-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;position:sticky;top:14px}
.daily-product-form .section-title,.daily-product-form>.hint,.daily-product-form>.form-span{grid-column:1/-1}
.daily-product-form label{display:grid;gap:7px;color:var(--text,#20242c);font-weight:650}
.daily-product-form label small{color:var(--muted,#667085);font-weight:500;line-height:1.45}
.daily-new-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.daily-summary{margin-bottom:18px}
.daily-summary article{position:relative;overflow:hidden}
.daily-summary article:after{content:"";position:absolute;right:-18px;bottom:-24px;width:72px;height:72px;border-radius:50%;background:rgba(211,29,49,.08)}
.daily-cost-warning{padding:13px 15px;border:1px solid rgba(211,29,49,.22);border-radius:12px;background:rgba(211,29,49,.06);color:var(--text,#20242c);line-height:1.45;font-weight:650}
.daily-cost-warning.positive{border-color:rgba(22,163,74,.3);background:rgba(22,163,74,.08)}
.daily-cost-warning.neutral{border-color:rgba(59,130,246,.25);background:rgba(59,130,246,.07)}
.daily-cost-warning.danger{border-color:rgba(211,29,49,.35);background:rgba(211,29,49,.09)}
.daily-batches-card{min-width:0}
.daily-list-title{display:flex;align-items:end;justify-content:space-between;gap:14px;margin-bottom:12px}
.daily-list-title select{width:auto;min-width:150px}
.daily-neutral-note{padding:12px 14px;margin-bottom:14px;border-left:4px solid #d31d31;border-radius:8px;background:rgba(211,29,49,.06);color:var(--muted,#667085);line-height:1.45}
.daily-batch-list{display:grid;gap:10px;max-height:620px;overflow:auto;padding-right:4px}
.daily-batch-card{display:grid;grid-template-columns:minmax(180px,1.2fr) minmax(280px,1fr) auto;gap:16px;align-items:center;padding:15px;border:1px solid var(--line,#d8dde5);border-radius:14px;background:var(--surface,#fff);box-shadow:0 7px 20px rgba(16,24,40,.04)}
.daily-batch-card.closed{opacity:.74}
.daily-batch-main h4{margin:6px 0 3px;font-size:1rem;color:var(--text,#20242c)}
.daily-batch-main small{color:var(--muted,#667085)}
.daily-kind{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:.72rem;font-weight:850;letter-spacing:.02em;color:#8f1020;background:rgba(211,29,49,.1)}
.daily-kind.free{color:#166534;background:rgba(22,163,74,.11)}
.daily-batch-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 12px;color:var(--muted,#667085);font-size:.88rem}
.daily-batch-metrics b{color:var(--text,#20242c)}
.daily-closed-label{display:inline-flex;padding:7px 10px;border-radius:9px;background:rgba(100,116,139,.12);color:var(--muted,#667085);font-size:.8rem;font-weight:800}
html[data-theme="dark"] .daily-product-form label,html[data-theme="dark"] .daily-cost-warning,html[data-theme="dark"] .daily-batch-main h4,html[data-theme="dark"] .daily-batch-metrics b{color:#f5f6fa}
html[data-theme="dark"] .daily-cost-warning,html[data-theme="dark"] .daily-neutral-note{background:rgba(211,29,49,.1)}
html[data-theme="dark"] .daily-batch-card{background:rgba(18,20,26,.86);border-color:rgba(255,255,255,.12);box-shadow:none}
@media(max-width:1050px){.daily-products-layout{grid-template-columns:1fr}.daily-product-form{position:static}.daily-batch-list{max-height:none}}
@media(max-width:700px){.daily-product-form,.daily-new-fields{grid-template-columns:1fr}.daily-product-form>label,.daily-product-form>.btn{grid-column:1/-1}.daily-batch-card{grid-template-columns:1fr}.daily-batch-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.daily-batch-action .btn{width:100%}.daily-list-title{align-items:stretch;flex-direction:column}.daily-list-title select{width:100%}}
html[data-theme="light"] body{background:radial-gradient(circle at 50% 0,#ffffff 0,#f1f3f6 44%,#e4e7eb 100%);color:var(--text)}
#particles{pointer-events:none;opacity:.82;transition:opacity .28s ease}
html[data-theme="light"] #particles{opacity:1}
html[data-theme="dark"] #particles{opacity:.88}
.login-mode .login-card{position:relative;overflow:hidden;isolation:isolate}
.login-mode .login-card::before{
  content:"";
  position:absolute;
  z-index:-1;
  width:220px;
  height:220px;
  right:-118px;
  top:-118px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(189,23,36,.10),transparent 68%);
  pointer-events:none;
}
html[data-theme="dark"] .login-mode .login-card::before{background:radial-gradient(circle,rgba(236,72,89,.13),transparent 68%)}
@media(prefers-reduced-motion:reduce){#particles{transition:none}}
html[data-theme="light"] .login-card{
  background:rgba(255,255,255,.95);
  border-color:rgba(189,23,36,.24);
  box-shadow:0 24px 70px rgba(28,35,48,.16),inset 0 0 0 1px rgba(255,255,255,.85);
}
html[data-theme="light"] .login-card h1,
html[data-theme="light"] .login-card label,
html[data-theme="light"] .recovery-modal h3{color:#20242c}
html[data-theme="light"] .login-card p,
html[data-theme="light"] .recovery-modal .hint,
html[data-theme="light"] .muted-link{color:#626a78}
html[data-theme="light"] .login-banner.success{color:#146c38;background:#e7f8ed;border-color:rgba(20,108,56,.24)}
html[data-theme="light"] .connection-status{color:#805b00;background:#fff7dc;box-shadow:0 14px 36px rgba(28,35,48,.16)}
html[data-theme="light"] .cash-sale-guard.ready{color:#146c38;background:#e7f8ed}
html[data-theme="light"] .cash-sale-guard.blocked{color:#805b00;background:#fff7dc}
html[data-theme="light"] .return-sale-row{background:#fff;color:#20242c}
html[data-theme="light"] .topbar,
html[data-theme="light"] .footerbar{background:rgba(255,255,255,.93);box-shadow:0 14px 38px rgba(28,35,48,.12),inset 0 0 0 1px rgba(255,255,255,.8)}
html[data-theme="light"] .panel{background:rgba(255,255,255,.9);box-shadow:0 20px 55px rgba(28,35,48,.12),inset 0 0 0 1px rgba(255,255,255,.75)}
html[data-theme="light"] .modal-box{background:#fafbfc;box-shadow:0 24px 70px rgba(28,35,48,.22)}
html[data-theme="light"] .brand strong,
html[data-theme="light"] .operator b,
html[data-theme="light"] .panel h2,
html[data-theme="light"] .panel h3,
html[data-theme="light"] .panel h4,
html[data-theme="light"] .product-preview-card h4,
html[data-theme="light"] .inventory-summary b,
html[data-theme="light"] .balance-grid b,
html[data-theme="light"] .brand-preview b,
html[data-theme="light"] .order-form-footer b{color:#20242c}
html[data-theme="light"] .eyebrow{color:#8f1520}
html[data-theme="light"] input,
html[data-theme="light"] select{background:#fff;color:#20242c;border-color:rgba(37,43,54,.2)}
html[data-theme="light"] input::placeholder{color:#8a919d}
html[data-theme="light"] .mini-link,
html[data-theme="light"] .back-btn,
html[data-theme="light"] .btn.ghost,
html[data-theme="light"] .page-btn,
html[data-theme="light"] .balance-tab,
html[data-theme="light"] #venta .qty-change{background:#fff;color:#252a33;border-color:rgba(37,43,54,.2)}
html[data-theme="light"] .btn:not(.ghost){color:#fff}
html[data-theme="light"] .module-card{color:#252a33;border-color:rgba(189,23,36,.28);background:linear-gradient(145deg,#fff,#f8ecee 56%,#eceff3);box-shadow:0 16px 38px rgba(28,35,48,.12),inset 0 0 0 1px rgba(255,255,255,.9)}
html[data-theme="light"] .module-card:hover{border-color:#bd1724;box-shadow:0 18px 45px rgba(189,23,36,.18),0 18px 45px rgba(28,35,48,.1)}
html[data-theme="light"] .workspace-card,
html[data-theme="light"] .summary,
html[data-theme="light"] .product-card,
html[data-theme="light"] .user-card,
html[data-theme="light"] .timeline article,
html[data-theme="light"] .data-row,
html[data-theme="light"] .inventory-summary article,
html[data-theme="light"] .balance-grid-card,
html[data-theme="light"] .hint-box,
html[data-theme="light"] .brand-preview,
html[data-theme="light"] .purchase-order-card,
html[data-theme="light"] .purchase-order-item,
html[data-theme="light"] .barcode-catalog-row,
html[data-theme="light"] .empty-state{background:#fff;box-shadow:0 8px 24px rgba(28,35,48,.06)}
html[data-theme="light"] .order-items,
html[data-theme="light"] .module-picker,
html[data-theme="light"] .module-picker label,
html[data-theme="light"] .statement-row,
html[data-theme="light"] .receipt-canvas{background:#f5f6f8}
html[data-theme="light"] .module-picker label{color:#252a33;border-color:rgba(37,43,54,.13)}
html[data-theme="light"] th{color:#59616e}
html[data-theme="light"] .scan-status,
html[data-theme="light"] .scan-help,
html[data-theme="light"] .danger-text{color:#525a67}
html[data-theme="light"] .close{color:#252a33}
html[data-theme="light"] .drop-zone{background:linear-gradient(135deg,rgba(189,23,36,.07),#fff)}
html[data-theme="light"] .drop-zone span{color:#252a33}
html[data-theme="light"] .row-media{background:#f2e5e7;border-color:rgba(189,23,36,.12)}
html[data-theme="light"] .receipt-preview{background:#fff;color:#111;box-shadow:0 8px 24px rgba(28,35,48,.12)}
html[data-theme="light"] .status-pending{color:#805b00;background:#fff7dc}
html[data-theme="light"] .status-received{color:#146c38;background:#e7f8ed}
html[data-theme="light"] .status-cancelled{color:#59616e;background:#eef0f3}
html[data-theme="light"] .source-local{color:#146c38;background:#e7f8ed}
html[data-theme="light"] .source-reference{color:#245da8;background:#eaf2ff}
html[data-theme="light"] .data-flag.warning{color:#805b00;background:#fff7dc}
html[data-theme="light"] .data-flag.danger{color:#a51d2a;background:#fff0f1}
html[data-theme="light"] .data-flag.neutral{color:#245da8;background:#eaf2ff}
html[data-theme="light"] .barcode-choice{background:#fff}
html[data-theme="light"] .order-price-summary{color:#146c38;background:#eefaf2;border-color:rgba(20,108,56,.22)}

/* Complete light-theme contrast pass. Dark-theme colors remain untouched. */
html[data-theme="light"] #productList .product-metrics span{
  color:#252a33;
  background:#f1f3f5;
  border-color:rgba(37,43,54,.14);
}
html[data-theme="light"] #productList .product-metrics b,
html[data-theme="light"] .balance-grid b,
html[data-theme="light"] .statement-row b,
html[data-theme="light"] .profit-stock-summary b,
html[data-theme="light"] .recovery-options b,
html[data-theme="light"] .product-preview-main h4,
html[data-theme="light"] .product-preview-list b,
html[data-theme="light"] .module-summary b,
html[data-theme="light"] .brand-preview b,
html[data-theme="light"] .row-main b,
html[data-theme="light"] .total{
  color:#20242c;
}
html[data-theme="light"] .stock-dot.low,
html[data-theme="light"] .category-list span,
html[data-theme="light"] .module-picker span,
html[data-theme="light"] .trust-check,
html[data-theme="light"] .check-line,
html[data-theme="light"] .detail-link,
html[data-theme="light"] .cart-wholesale-toggle,
html[data-theme="light"] .choice-card{
  color:#252a33;
}
html[data-theme="light"] .stock-dot.low{
  background:#e7e9ed;
  box-shadow:0 0 0 3px rgba(189,23,36,.08);
}
html[data-theme="light"] .category-list span{background:color-mix(in srgb,var(--cat) 12%,#fff)}
html[data-theme="light"] .scan-help{
  color:#343a45;
  background:#fff4f5;
}
html[data-theme="light"] .form-error{color:#a51d2a}
html[data-theme="light"] .module-picker span,
html[data-theme="light"] .responsive-table td::before,
html[data-theme="light"] #cartRows td::before{color:#59616e}
html[data-theme="light"] .statement-row,
html[data-theme="light"] .profit-stock-summary div,
html[data-theme="light"] .profit-progress-card,
html[data-theme="light"] .package-profit-row span,
html[data-theme="light"] .package-profit-row small,
html[data-theme="light"] .profit-bars-grid span,
html[data-theme="light"] .profit-progress-meta span,
html[data-theme="light"] .check-line,
html[data-theme="light"] .choice-card,
html[data-theme="light"] .product-preview-card{
  color:#252a33;
  background:#f5f6f8;
  border-color:rgba(37,43,54,.13);
}
html[data-theme="light"] .package-profit-row span,
html[data-theme="light"] .package-profit-row small{color:#343a45}
html[data-theme="light"] .profit-progress-head strong{color:#805b00}
html[data-theme="light"] .forgot-link,
html[data-theme="light"] .cart-product small{color:#9f1824}
html[data-theme="light"] .product-detail-fallback{
  color:#252a33;
  background:#e5e7eb;
}
html[data-theme="light"] .detail-link{background:#fff4f5}
html[data-theme="light"] .choice-card:hover{color:#20242c;background:#fff0f1}
html[data-theme="light"] .cart-wholesale-toggle input{border-color:rgba(37,43,54,.25);background:#dfe3e8}
html[data-theme="light"] .cart-wholesale-toggle input::before{background:#fff;box-shadow:0 1px 3px rgba(28,35,48,.24)}

@media(max-width:700px){
  .cash-register-columns,.compact-form{grid-template-columns:1fr}
  .return-sale-row{grid-template-columns:auto minmax(0,1fr)}
  .return-sale-row>[data-return-quantity]{grid-column:1/-1}
  .purchase-order-card>header,.order-form-footer{align-items:stretch;flex-direction:column}
  .order-status{align-self:flex-start}
  .order-form-footer .btn{width:100%}
  .purchase-order-item .remove-order-item{justify-self:stretch;width:100%}
  .barcode-catalog-filters,.barcode-catalog-row{grid-template-columns:1fr}
  .barcode-catalog-row .btn{width:100%}
  .catalog-source{justify-self:start}
}

/* Daily financial report and reliable multipage printing. */
.daily-report-actions{display:flex;gap:8px;flex-wrap:wrap}
.daily-report-summary{grid-template-columns:repeat(6,minmax(0,1fr))}
.daily-report-table td small{display:block;margin-top:4px;line-height:1.35;color:var(--muted)}
.daily-report-table .positive-value{color:#16803d;font-weight:900}
.daily-report-table .negative-value{color:#b91c1c;font-weight:900}

@media(max-width:900px){.daily-report-summary{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:640px){
  .daily-report-summary{grid-template-columns:1fr 1fr}
  .daily-report-actions .btn{flex:1 1 calc(50% - 8px)}
}

@media print{
  body[data-print-panel]{background:#fff!important;color:#111!important}
  body[data-print-panel] .panel.active .panel-head{display:none!important}
  body[data-print-panel] .panel.active .balance-pane.active{display:block!important}
  body[data-print-panel] .panel.active .workspace-card,
  body[data-print-panel] .panel.active .balance-grid,
  body[data-print-panel] .panel.active .timeline,
  body[data-print-panel] .panel.active .data-list,
  body[data-print-panel] .panel.active .executive-card{break-inside:auto!important;page-break-inside:auto!important}
  body[data-print-panel] .panel.active .balance-grid article,
  body[data-print-panel] .panel.active .data-row,
  body[data-print-panel] .panel.active .profit-progress-card,
  body[data-print-panel] .panel.active .statement-row,
  body[data-print-panel] .panel.active table tr{break-inside:avoid!important;page-break-inside:avoid!important}
  body[data-print-panel] .panel.active .table-wrap{overflow:visible!important;border:0!important;padding:0!important}
  body[data-print-panel] .panel.active table{width:100%!important;min-width:0!important;font-size:10px;border-collapse:collapse}
  body[data-print-panel] .panel.active table thead{display:table-header-group}
  body[data-print-panel] .panel.active table th,
  body[data-print-panel] .panel.active table td{color:#111!important;background:#fff!important;border:1px solid #ccc!important;padding:6px!important}
  body[data-print-panel] .panel.active .pagination-hidden:not([hidden]){display:revert!important}
  body[data-print-panel] .daily-report-actions{display:none!important}
  body[data-print-panel] .daily-report-summary{grid-template-columns:repeat(3,minmax(0,1fr))!important;margin-bottom:12px}
  body[data-print-panel] .print-report-header{break-after:avoid;page-break-after:avoid}
}

/* Servicios por comisión: recargas y operaciones sin stock físico. */
.daily-services-section{display:grid;gap:10px;margin:14px 0 18px;padding:14px;border:1px solid var(--line,#d8dde5);border-radius:14px;background:rgba(211,29,49,.035)}
.daily-service-list{display:grid;gap:9px}
.daily-service-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;align-items:center;padding:13px 14px;border:1px solid var(--line,#d8dde5);border-radius:12px;background:var(--surface,#fff)}
.daily-service-card h4{margin:6px 0 2px;color:var(--text,#20242c)}
.daily-service-card small{color:var(--muted,#667085)}
.daily-kind.service{color:#1d4ed8;background:rgba(37,99,235,.11)}
.service-sale-form label{display:grid;gap:7px;color:var(--text,#20242c);font-weight:750}
.service-sale-form label small{color:var(--muted,#667085);font-weight:500;line-height:1.35}
.service-sale-summary{display:grid;grid-template-columns:1fr auto;gap:5px 16px;align-items:center;padding:16px;border:1px solid rgba(22,128,61,.24);border-radius:12px;background:rgba(22,163,74,.08)}
.service-sale-summary>b{font-size:1.45rem;color:#166534}
.service-sale-summary>small{grid-column:1/-1;color:#166534;font-weight:800}
.service-cart-breakdown{display:grid;gap:3px;min-width:145px}
.service-cart-breakdown span,.service-cart-breakdown small{color:var(--muted,#667085);font-size:.76rem}
.service-cart-breakdown b{color:#166534;font-size:.85rem}
html[data-theme="dark"] .daily-services-section{background:rgba(211,29,49,.07);border-color:rgba(255,255,255,.12)}
html[data-theme="dark"] .daily-service-card{background:rgba(18,20,26,.86);border-color:rgba(255,255,255,.12)}
html[data-theme="dark"] .daily-service-card h4,html[data-theme="dark"] .service-sale-form label{color:#f5f6fa}
html[data-theme="dark"] .service-sale-summary{background:rgba(22,163,74,.1);border-color:rgba(74,222,128,.25)}
html[data-theme="dark"] .service-sale-summary>b,html[data-theme="dark"] .service-sale-summary>small,html[data-theme="dark"] .service-cart-breakdown b{color:#86efac}
@media(max-width:700px){.daily-service-card{grid-template-columns:1fr}.daily-service-card .btn{width:100%}.service-sale-form{grid-template-columns:1fr!important}.service-cart-breakdown{text-align:right}}

/* Auditoría WCAG del modo oscuro: contraste consistente en toda la interfaz. */
@media screen{
  html[data-theme="dark"]{
    --text:#f8fafc;
    --muted:#cbd5e1;
    --line:rgba(226,232,240,.24);
    color-scheme:dark;
  }
  html[data-theme="dark"] body{color:#f8fafc}
  html[data-theme="dark"] .topbar,
  html[data-theme="dark"] .footerbar,
  html[data-theme="dark"] .panel,
  html[data-theme="dark"] .modal-box,
  html[data-theme="dark"] .login-card{color:#f8fafc}
  html[data-theme="dark"] .brand strong,
  html[data-theme="dark"] .operator b,
  html[data-theme="dark"] .panel h2,
  html[data-theme="dark"] .panel h3,
  html[data-theme="dark"] .panel h4,
  html[data-theme="dark"] .login-card h1,
  html[data-theme="dark"] .row-main b,
  html[data-theme="dark"] .inventory-summary b,
  html[data-theme="dark"] .balance-grid b,
  html[data-theme="dark"] .order-form-footer b,
  html[data-theme="dark"] .product-preview-main h4,
  html[data-theme="dark"] .product-preview-list b,
  html[data-theme="dark"] .module-summary b,
  html[data-theme="dark"] .brand-preview b,
  html[data-theme="dark"] .statement-row b,
  html[data-theme="dark"] .profit-stock-summary b{color:#f8fafc}
  html[data-theme="dark"] .brand span,
  html[data-theme="dark"] .operator span,
  html[data-theme="dark"] .hint,
  html[data-theme="dark"] small,
  html[data-theme="dark"] label,
  html[data-theme="dark"] .empty-state,
  html[data-theme="dark"] .order-meta,
  html[data-theme="dark"] .order-notes,
  html[data-theme="dark"] .daily-neutral-note{color:#cbd5e1}

  html[data-theme="dark"] input,
  html[data-theme="dark"] select,
  html[data-theme="dark"] textarea{
    color:#f8fafc;
    background:#0f1218;
    border-color:#596474;
    caret-color:#fff;
    opacity:1;
  }
  html[data-theme="dark"] input::placeholder,
  html[data-theme="dark"] textarea::placeholder{color:#b8c1ce;opacity:1}
  html[data-theme="dark"] select option{color:#f8fafc;background:#11151c}
  html[data-theme="dark"] input:disabled,
  html[data-theme="dark"] select:disabled,
  html[data-theme="dark"] textarea:disabled{color:#dbe2ec;background:#252b34;border-color:#667181;opacity:1}

  html[data-theme="dark"] .btn{
    color:#fff!important;
    background:linear-gradient(135deg,#667181,#39414d);
    border:1px solid #7b8798;
    text-shadow:0 1px 1px rgba(0,0,0,.35);
  }
  html[data-theme="dark"] .btn.danger{color:#fff!important;background:linear-gradient(135deg,#9f2636,#681724);border-color:#c94b5c}
  html[data-theme="dark"] .btn.ghost{color:#f8fafc!important;background:#202630;border-color:#667181;text-shadow:none}
  html[data-theme="dark"] .btn:hover:not(:disabled),
  html[data-theme="dark"] .btn.ghost:hover:not(:disabled){color:#fff!important;border-color:#aeb8c6;filter:brightness(1.12)}
  html[data-theme="dark"] button:disabled,
  html[data-theme="dark"] .btn:disabled,
  html[data-theme="dark"] .btn.ghost:disabled,
  html[data-theme="dark"] .page-btn:disabled{
    color:#e2e8f0!important;
    background:#303641!important;
    border:1px solid #6b7686!important;
    opacity:1!important;
    filter:none!important;
    box-shadow:none!important;
    text-shadow:none!important;
  }
  html[data-theme="dark"] .mini-link,
  html[data-theme="dark"] .back-btn,
  html[data-theme="dark"] .page-btn,
  html[data-theme="dark"] .balance-tab,
  html[data-theme="dark"] .choice-card,
  html[data-theme="dark"] .detail-link,
  html[data-theme="dark"] #venta .qty-change{color:#f8fafc;background:#202630;border-color:#667181}
  html[data-theme="dark"] .module-card{color:#fff;border-color:#788394;background:linear-gradient(145deg,#39414d,#202630 55%,#11151c)}
  html[data-theme="dark"] .module-card:hover{border-color:#e2e8f0;background:linear-gradient(145deg,#4b5563,#29313b 55%,#171b22)}
  html[data-theme="dark"] .profile-avatar{color:#fff;background:linear-gradient(135deg,#667181,#39414d)}

  html[data-theme="dark"] button:focus-visible,
  html[data-theme="dark"] a:focus-visible,
  html[data-theme="dark"] input:focus-visible,
  html[data-theme="dark"] select:focus-visible,
  html[data-theme="dark"] textarea:focus-visible{
    outline:3px solid #fbbf24;
    outline-offset:3px;
    box-shadow:0 0 0 5px rgba(251,191,36,.2);
  }

  html[data-theme="dark"] .daily-batch-card.closed{opacity:1;border-style:dashed;background:#171c24}
  html[data-theme="dark"] .daily-kind{color:#fecdd3;background:#3a1720;border:1px solid #8f3545}
  html[data-theme="dark"] .daily-kind.free{color:#bbf7d0;background:#14271e;border-color:#34764d}
  html[data-theme="dark"] .daily-kind.service{color:#bfdbfe;background:#152238;border-color:#3f679c}
  html[data-theme="dark"] .daily-closed-label{color:#e2e8f0;background:#303641;border:1px solid #6b7686}
  html[data-theme="dark"] .daily-report-table .positive-value{color:#86efac}
  html[data-theme="dark"] .daily-report-table .negative-value{color:#fca5a5}
  html[data-theme="dark"] .danger-text,
  html[data-theme="dark"] .form-error{color:#fecaca}
  html[data-theme="dark"] .scan-status,
  html[data-theme="dark"] th,
  html[data-theme="dark"] .responsive-table td::before,
  html[data-theme="dark"] #cartRows td::before{color:#e2e8f0}
  html[data-theme="dark"] .stock-dot{color:#dbeafe;background:#293442}
  html[data-theme="dark"] .forgot-link,
  html[data-theme="dark"] .catalog-attribution a{color:#fda4af}
}
