/* Celebra portal — modo oscuro. El crema de siempre queda; esto solo pinta cuando data-theme=dark. */
html[data-theme="dark"] { color-scheme: dark; }

html[data-theme="dark"] body {
  background: #14110f !important;
  color: #f0ebe6 !important;
}

/* Superficies: header, menú, tarjetas, nav, modales */
html[data-theme="dark"] .app-header,
html[data-theme="dark"] .page-header,
html[data-theme="dark"] .top-bar,
html[data-theme="dark"] .bottom-nav,
html[data-theme="dark"] header,
html[data-theme="dark"] nav,
html[data-theme="dark"] .ham-drawer,
html[data-theme="dark"] .tool-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .period-btn,
html[data-theme="dark"] .btn-export,
html[data-theme="dark"] .info-i,
html[data-theme="dark"] .combo-list,
html[data-theme="dark"] .btn-modal-cancel,
html[data-theme="dark"] .user-card,
html[data-theme="dark"] .mail-card,
html[data-theme="dark"] .prod,
html[data-theme="dark"] .product-card,
html[data-theme="dark"] .tabs,
html[data-theme="dark"] .catalog-toggle,
html[data-theme="dark"] .analytics-stat-box,
html[data-theme="dark"] .stat-pill,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .print-modal,
html[data-theme="dark"] .del-modal,
html[data-theme="dark"] .print-preview-box,
html[data-theme="dark"] .ac-dropdown,
html[data-theme="dark"] .sheet,
html[data-theme="dark"] .cart,
html[data-theme="dark"] .co,
html[data-theme="dark"] .receipt,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .search-wrap,
html[data-theme="dark"] .chips-wrap,
html[data-theme="dark"] .hits-grid .card,
html[data-theme="dark"] .envio-panel .datos {
  background: #1c1916 !important;
  border-color: #3a342e !important;
  color: #f0ebe6 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .app-header-title,
html[data-theme="dark"] .header-title,
html[data-theme="dark"] .tool-name,
html[data-theme="dark"] .user-name,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .page-title,
html[data-theme="dark"] .prod-t,
html[data-theme="dark"] .ham-user-name,
html[data-theme="dark"] .delivery-label {
  color: #f0ebe6 !important;
}

html[data-theme="dark"] .tool-desc,
html[data-theme="dark"] .user-email,
html[data-theme="dark"] .ham-user-email,
html[data-theme="dark"] .page-sub,
html[data-theme="dark"] .prod-stock,
html[data-theme="dark"] .nav-item,
html[data-theme="dark"] .ham-nav-item,
html[data-theme="dark"] label,
html[data-theme="dark"] .otp-hint,
html[data-theme="dark"] .reset-link,
html[data-theme="dark"] .back-link {
  color: #a89f94 !important;
}

html[data-theme="dark"] .nav-item.active,
html[data-theme="dark"] .ham-nav-item.active { color: #e0a050 !important; }

html[data-theme="dark"] .ham-nav-item.active,
html[data-theme="dark"] .ham-nav-item:active,
html[data-theme="dark"] .delivery-option.selected,
html[data-theme="dark"] .pm.active,
html[data-theme="dark"] .badge-admin,
html[data-theme="dark"] .loading-pill,
html[data-theme="dark"] .mail-icon,
html[data-theme="dark"] .catch-note,
html[data-theme="dark"] tbody tr:hover,
html[data-theme="dark"] .ac-item:hover,
html[data-theme="dark"] .ac-item:active,
html[data-theme="dark"] .product-card:active,
html[data-theme="dark"] .chip-clear:hover {
  background: #2a2218 !important;
  color: #e0a050 !important;
  border-color: #5a4630 !important;
}

html[data-theme="dark"] .ham-divider,
html[data-theme="dark"] .divider::before,
html[data-theme="dark"] .divider::after { background: #3a342e !important; }

html[data-theme="dark"] .ham-btn span { background: #c4bbb0 !important; }
html[data-theme="dark"] .hb,
html[data-theme="dark"] .ham-close { color: #c4bbb0 !important; }

html[data-theme="dark"] .ham-logout {
  border-color: #3a342e !important;
  color: #a89f94 !important;
}

/* Campos */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-input,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .search-box,
html[data-theme="dark"] .ais-SearchBox-input,
html[data-theme="dark"] .delivery-option,
html[data-theme="dark"] .scan-result,
html[data-theme="dark"] .current-desc,
html[data-theme="dark"] .page-btn,
html[data-theme="dark"] .sheet-close,
html[data-theme="dark"] .qty button,
html[data-theme="dark"] .pm,
html[data-theme="dark"] .co-cancel,
html[data-theme="dark"] .r-view,
html[data-theme="dark"] .filter-tab,
html[data-theme="dark"] .chip,
html[data-theme="dark"] .sz-btn,
html[data-theme="dark"] .ais-RefinementList-labelText,
html[data-theme="dark"] .ais-Pagination-link,
html[data-theme="dark"] .search-cs-btn {
  background: #14110f !important;
  color: #f0ebe6 !important;
  border-color: #3a342e !important;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] .form-input:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] .ais-SearchBox-input:focus {
  background: #1c1916 !important;
  border-color: #c97a2d !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #7a7268 !important; }

html[data-theme="dark"] table { color: #f0ebe6 !important; }
html[data-theme="dark"] th { color: #a89f94 !important; border-color: #3a342e !important; }
html[data-theme="dark"] td { border-color: #3a342e !important; }

html[data-theme="dark"] .msg.err { background: #3a1a22 !important; border-color: #7a3040 !important; color: #f5c2c7 !important; }
html[data-theme="dark"] .msg.info { background: #1a2e1c !important; border-color: #2e5a32 !important; color: #b7e0b8 !important; }

html[data-theme="dark"] .estado-no,
html[data-theme="dark"] .warn-dest,
html[data-theme="dark"] .desc-badge.no {
  background: #2a2218 !important;
  color: #e0a050 !important;
  border-color: #5a4630 !important;
}

html[data-theme="dark"] .card-img,
html[data-theme="dark"] .no-img,
html[data-theme="dark"] .prod-img { background: #1c1916 !important; }

html[data-theme="dark"] .modal-head { background: #1c1916 !important; border-color: #3a342e !important; }
html[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,0.65) !important; }
html[data-theme="dark"] .ham-overlay { background: rgba(0,0,0,0.55) !important; }

html[data-theme="dark"] .ctag { background: #2a2622 !important; color: #c4bbb0 !important; }

html[data-theme="dark"] .totrow.grand,
html[data-theme="dark"] .stat-val,
html[data-theme="dark"] .stat-pill strong,
html[data-theme="dark"] .staff-name,
html[data-theme="dark"] .col-bruto,
html[data-theme="dark"] .page-title,
html[data-theme="dark"] .del-name,
html[data-theme="dark"] .resumen b,
html[data-theme="dark"] .qa-title,
html[data-theme="dark"] .scan-result-body,
html[data-theme="dark"] .ac-sku,
html[data-theme="dark"] .recent-sku,
html[data-theme="dark"] .catalog-toggle-label,
html[data-theme="dark"] .photo-thumb-info strong,
html[data-theme="dark"] .detail-table td.d-order,
html[data-theme="dark"] .detail-table td.d-bruto {
  color: #f0ebe6 !important;
}
html[data-theme="dark"] .td-upc,
html[data-theme="dark"] .recent-upc,
html[data-theme="dark"] .perm-item,
html[data-theme="dark"] .detail-table td,
html[data-theme="dark"] .totrow { color: #c4bbb0 !important; }
html[data-theme="dark"] .btn-pay:disabled {
  background: #5a4630 !important;
  color: #c4bbb0 !important;
}
html[data-theme="dark"] .view-tab.active,
html[data-theme="dark"] .chip.active,
html[data-theme="dark"] .period-btn.active {
  background: #c97a2d !important;
  border-color: #c97a2d !important;
  color: #fff !important;
}

/* El oro de la marca se queda. Botones de acento no se tocan. */

/* Toggle del header */
.theme-btn {
  width: 38px; height: 38px; border: 0; background: none; color: #888;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; flex-shrink: 0; -webkit-tap-highlight-color: transparent;
  padding: 0;
}
.theme-btn:hover { color: #c97a2d; }
.theme-btn svg { width: 20px; height: 20px; }
html[data-theme="dark"] .theme-btn { color: #c4bbb0; }
html[data-theme="dark"] .theme-btn:hover { color: #e0a050; }

.theme-btn.theme-float {
  position: fixed; top: 12px; right: 12px; z-index: 40;
  background: #fff; border: 1px solid #ece7e2; box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
html[data-theme="dark"] .theme-btn.theme-float {
  background: #1c1916; border-color: #3a342e;
}

.theme-row { margin: 8px 0 14px; }
.theme-row-lab {
  font-size: 0.72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #888; margin-bottom: 8px;
}
html[data-theme="dark"] .theme-row-lab { color: #a89f94; }
.theme-chips { display: flex; gap: 6px; }
.theme-chip {
  flex: 1; border: 1px solid #ece7e2; background: #f8f3f0; color: #555;
  border-radius: 8px; padding: 8px 0; font-size: 0.78rem; font-weight: 700;
  font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.theme-chip.on { background: #c97a2d; border-color: #c97a2d; color: #fff; }
html[data-theme="dark"] .theme-chip {
  background: #14110f; border-color: #3a342e; color: #c4bbb0;
}
html[data-theme="dark"] .theme-chip.on {
  background: #c97a2d; border-color: #c97a2d; color: #fff;
}

html[data-theme="dark"] .cli,
html[data-theme="dark"] .row,
html[data-theme="dark"] .sheet-box,
html[data-theme="dark"] .search,
html[data-theme="dark"] .docs a { background: #1c1916 !important; border-color: #3a342e !important; color: #f0ebe6 !important; }
html[data-theme="dark"] #solBox input,
html[data-theme="dark"] #solText,
html[data-theme="dark"] .sheet-box input,
html[data-theme="dark"] .sheet-box textarea { background: #14110f !important; color: #f0ebe6 !important; border-color: #3a342e !important; }

@media (min-width: 768px) {
  html[data-theme="dark"] .ham-drawer { box-shadow: 1px 0 0 #3a342e !important; }
}
