/* ==========================================================
   DUOVOX THEME SYSTEM V2
   Corrección transversal del tema claro
   El 24 de las 500 TEST
   ========================================================== */


/* ----------------------------------------------------------
   ENCABEZADO SUPERIOR
   ---------------------------------------------------------- */

html[data-theme="light"] .topbar,
html[data-theme="light"] .topbar.duovox-business-header{
  background:
    radial-gradient(
      circle at 94% 0%,
      rgba(124,58,237,.12),
      transparent 34%
    ),
    linear-gradient(
      135deg,
      #ffffff 0%,
      #f8f9ff 58%,
      #eeeaff 100%
    ) !important;

  border-color:#d8deea !important;
  color:#172033 !important;

  box-shadow:
    0 18px 44px rgba(15,23,42,.09)
    !important;
}

html[data-theme="light"] .topbar *,
html[data-theme="light"]
.topbar.duovox-business-header *{
  text-shadow:none !important;
}

html[data-theme="light"] .topbar
:is(
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  strong,
  b,
  .fw-bold,
  [class*="title"],
  [class*="value"],
  [class*="user"],
  [class*="date"],
  [class*="time"]
){
  color:#172033 !important;
  opacity:1 !important;
}

html[data-theme="light"] .topbar
:is(
  small,
  .small,
  .text-muted,
  .text-muted-2,
  [class*="subtitle"],
  [class*="label"],
  [class*="meta"],
  [class*="caption"]
){
  color:#526077 !important;
  opacity:1 !important;
}

html[data-theme="light"]
.duovox-active-branch-header{
  background:
    linear-gradient(
      135deg,
      #dcfce7,
      #ecfdf5
    ) !important;

  border-color:#86efac !important;
  color:#166534 !important;
  opacity:1 !important;
}

html[data-theme="light"]
.duovox-active-branch-header *{
  color:#166534 !important;
  opacity:1 !important;
}


/* ----------------------------------------------------------
   TEXTOS SECUNDARIOS Y ESTADOS VACÍOS
   ---------------------------------------------------------- */

html[data-theme="light"]
:is(
  .empty-state,
  [class*="empty-state"],
  [class*="empty-message"],
  [class*="no-results"],
  [class*="no-data"]
){
  color:#475569 !important;
  opacity:1 !important;
}

html[data-theme="light"]
:is(
  .empty-state,
  [class*="empty-state"],
  [class*="empty-message"],
  [class*="no-results"],
  [class*="no-data"]
)
:is(
  p,
  small,
  span,
  strong
){
  color:#475569 !important;
  opacity:1 !important;
}

html[data-theme="light"]
:is(
  .form-text,
  .text-muted,
  .text-muted-2,
  .muted,
  [class*="help"],
  [class*="hint"],
  [class*="description"],
  [class*="subtitle"]
){
  opacity:1 !important;
}


/* ----------------------------------------------------------
   SUPERFICIES OSCURAS DETECTADAS AUTOMÁTICAMENTE
   ---------------------------------------------------------- */

html[data-theme="light"]
.duovox-v2-auto-surface{
  background:
    linear-gradient(
      180deg,
      #ffffff,
      #fbfdff
    ) !important;

  color:#172033 !important;
  border-color:#dce3ed !important;

  box-shadow:
    0 14px 34px rgba(15,23,42,.075)
    !important;

  text-shadow:none !important;
}

html[data-theme="light"]
.duovox-v2-auto-surface
.duovox-v2-auto-surface{
  background:#f8fafc !important;
  box-shadow:none !important;
}

html[data-theme="light"]
.duovox-v2-auto-surface::before,
html[data-theme="light"]
.duovox-v2-auto-surface::after{
  opacity:.08 !important;
}

html[data-theme="light"]
.duovox-v2-auto-surface
:is(
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  strong,
  b,
  label,
  .fw-bold,
  [class*="title"],
  [class*="value"],
  [class*="amount"],
  [class*="total"],
  [class*="name"]
):not(.btn):not(.badge):not([class*="btn"]):not([class*="badge"]){
  color:#172033 !important;
  text-shadow:none !important;
  opacity:1 !important;
}

html[data-theme="light"]
.duovox-v2-auto-surface
:is(
  p,
  small,
  .small,
  .text-muted,
  .text-muted-2,
  .muted,
  .form-text,
  [class*="subtitle"],
  [class*="description"],
  [class*="meta"],
  [class*="label"]
):not(.btn):not(.badge):not([class*="btn"]):not([class*="badge"]){
  color:#64748b !important;
  opacity:1 !important;
}

html[data-theme="light"]
.duovox-v2-auto-surface
:is(
  .form-control,
  .form-select,
  input,
  textarea,
  select
){
  background:#ffffff !important;
  color:#172033 !important;
  border-color:#cbd5e1 !important;
}

html[data-theme="light"]
.duovox-v2-auto-surface
.table-responsive{
  background:#ffffff !important;
  border-color:#dce3ed !important;
}

html[data-theme="light"]
.duovox-v2-auto-surface
.table{
  --bs-table-bg:transparent !important;
  --bs-table-color:#243047 !important;
  --bs-table-striped-bg:#f8fafc !important;
  --bs-table-hover-bg:#f4f1ff !important;

  color:#243047 !important;
}

html[data-theme="light"]
.duovox-v2-auto-surface
.table > :not(caption) > * > *{
  background:transparent !important;
  color:#243047 !important;
  border-bottom-color:#e5eaf1 !important;
}

html[data-theme="light"]
.duovox-v2-auto-surface
.table thead th{
  background:#f4f6fa !important;
  color:#526077 !important;
}


/* Restaurar colores semánticos */

html[data-theme="light"]
.duovox-v2-auto-surface
:is(.text-success,[class*="success"],[class*="open"]){
  color:#15803d !important;
}

html[data-theme="light"]
.duovox-v2-auto-surface
:is(.text-danger,[class*="danger"],[class*="closed"]){
  color:#dc2626 !important;
}

html[data-theme="light"]
.duovox-v2-auto-surface
:is(.text-warning,[class*="warning"]){
  color:#b45309 !important;
}

html[data-theme="light"]
.duovox-v2-auto-surface
:is(.text-info,[class*="info"]){
  color:#0369a1 !important;
}


/* ----------------------------------------------------------
   CAJA
   ---------------------------------------------------------- */

html[data-theme="light"]
[data-duovox-page="cash"]
.content{
  color:#172033 !important;
}

html[data-theme="light"]
[data-duovox-page="cash"]
:is(
  .cash-page,
  .cash-shell,
  .cash-panel,
  .cash-card,
  .cash-box,
  .cash-summary,
  .cash-history,
  [class*="cash-card"],
  [class*="cash-panel"],
  [class*="cash-summary"],
  [class*="cash-history"]
){
  background:#ffffff !important;
  color:#172033 !important;
  border-color:#dce3ed !important;
}

html[data-theme="light"]
[data-duovox-page="cash"]
:is(
  .cash-page,
  .cash-shell,
  .cash-panel,
  .cash-card,
  .cash-box,
  .cash-summary,
  .cash-history
)
:is(h1,h2,h3,h4,h5,h6,strong){
  color:#172033 !important;
}

html[data-theme="light"]
[data-duovox-page="cash"]
:is(
  .btn-danger,
  [class*="close-cash"],
  [class*="cash-close"]
){
  color:#ffffff !important;
}


/* ----------------------------------------------------------
   DETALLE DE VENTA
   ---------------------------------------------------------- */

html[data-theme="light"]
[data-duovox-page="sale-detail"]
.content
:is(
  [class*="hero"],
  [class*="sale-header"],
  [class*="detail-header"]
).duovox-v2-auto-surface{
  background:
    linear-gradient(
      135deg,
      #eef2ff,
      #e0f2fe
    ) !important;

  border-color:#bfdbfe !important;
}

html[data-theme="light"]
[data-duovox-page="sale-detail"]
.content
:is(
  [class*="hero"],
  [class*="sale-header"],
  [class*="detail-header"]
)
:is(h1,h2,h3,strong,[class*="total"]){
  color:#172033 !important;
}

html[data-theme="light"]
[data-duovox-page="sale-detail"]
.content
:is(
  [class*="critical"],
  [class*="cancel"],
  [class*="danger"]
).duovox-v2-auto-surface{
  background:#fff7f7 !important;
  border-color:#fecaca !important;
}


/* ----------------------------------------------------------
   BACKUPS
   ---------------------------------------------------------- */

html[data-theme="light"]
[data-duovox-page="backups"]
.content
.duovox-v2-auto-surface{
  background:#ffffff !important;
  color:#172033 !important;
  border-color:#dce3ed !important;
}

html[data-theme="light"]
[data-duovox-page="backups"]
.content
:is(.btn-primary,.btn-success,[class*="download"]){
  color:#ffffff !important;
}


/* ----------------------------------------------------------
   RESUMEN DE SUCURSALES
   ---------------------------------------------------------- */

html[data-theme="light"]
[data-duovox-page="branch-summary"]
.content
.duovox-v2-auto-surface{
  background:#ffffff !important;
  color:#172033 !important;
  border-color:#dce3ed !important;
}

html[data-theme="light"]
[data-duovox-page="branch-summary"]
.content
:is(
  [class*="branch-card"],
  [class*="summary-card"],
  [class*="branch-summary"]
){
  background:#ffffff !important;
  color:#172033 !important;
  border-color:#dce3ed !important;
}


/* ----------------------------------------------------------
   PROMOCIONES
   ---------------------------------------------------------- */

html[data-theme="light"]
[data-duovox-page="promotions"]
.content
:is(
  [class*="product-list"],
  [class*="products-list"],
  [class*="product-results"],
  [class*="selection-list"],
  [class*="options-list"]
){
  background:#ffffff !important;
  color:#172033 !important;
  border-color:#cbd5e1 !important;
}

html[data-theme="light"]
[data-duovox-page="promotions"]
.content
:is(
  [class*="product-list"],
  [class*="products-list"],
  [class*="product-results"],
  [class*="selection-list"],
  [class*="options-list"]
)
*{
  color:#334155;
}


/* ----------------------------------------------------------
   EDITAR PRODUCTO Y STOCK
   ---------------------------------------------------------- */

html[data-theme="light"]
[data-duovox-page="product-edit"]
.content
:is(
  [class*="stock-card"],
  [class*="branch-stock"],
  [class*="stock-summary"],
  [class*="stock-total"]
){
  background:
    linear-gradient(
      135deg,
      #ffffff,
      #f5f3ff
    ) !important;

  color:#172033 !important;
  border-color:#c4b5fd !important;
}

html[data-theme="light"]
[data-duovox-page="product-edit"]
.content
:is(
  [class*="stock-card"],
  [class*="branch-stock"],
  [class*="stock-summary"],
  [class*="stock-total"]
)
*{
  color:#334155 !important;
}


/* ----------------------------------------------------------
   CONFIGURACIÓN CRM
   ---------------------------------------------------------- */

html[data-theme="light"]
[data-duovox-page="crm-config"]
.content
:is(
  [class*="critical-actions"],
  [class*="danger-zone"],
  [class*="reset-zone"]
).duovox-v2-auto-surface{
  background:#fff7f7 !important;
  border-color:#fecaca !important;
}

html[data-theme="light"]
[data-duovox-page="crm-config"]
.content
:is(
  [class*="login-preview"],
  [id*="login-preview"],
  [class*="preview-login"]
){
  background:
    linear-gradient(
      135deg,
      #15345b,
      #234f7c
    ) !important;

  color:#ffffff !important;
}

html[data-theme="light"]
[data-duovox-page="crm-config"]
.content
:is(
  [class*="login-preview"],
  [id*="login-preview"],
  [class*="preview-login"]
)
*{
  color:inherit;
}


/* ----------------------------------------------------------
   NUEVA VENTA / POS
   ---------------------------------------------------------- */

html[data-theme="light"]
[data-duovox-page="sales-new-v3-clean"]
.content
button:not(.btn-primary)
:not(.btn-success)
:not(.btn-warning)
:not(.btn-danger)
:not(.v3-submit)
:not(.v3-payment-selected)
:not(.active)
:not(.is-active)
:not([aria-pressed="true"])
:not([aria-selected="true"])
:not([class*="primary"])
:not([class*="success"])
:not([class*="warning"])
:not([class*="danger"])
:not([class*="mixed"])
:not([class*="submit"])
:not([class*="selected"]){
  background:#f8fafc !important;
  color:#334155 !important;
  border-color:#cbd5e1 !important;
  box-shadow:none !important;
}

html[data-theme="light"]
[data-duovox-page="sales-new-v3-clean"]
.content
button:is(
  .active,
  .is-active,
  .v3-payment-selected,
  [aria-pressed="true"],
  [aria-selected="true"]
){
  color:#ffffff !important;

  background:
    linear-gradient(
      135deg,
      #2563eb,
      #7c3aed
    ) !important;

  border-color:transparent !important;
}

html[data-theme="light"]
[data-duovox-page="sales-new-v3-clean"]
.content
:is(
  [class*="customer-option"],
  [class*="client-option"],
  [class*="sale-tab"],
  [class*="counter-tab"],
  [class*="open-sale"]
){
  background:#f8fafc !important;
  color:#334155 !important;
  border-color:#cbd5e1 !important;
}


/* ----------------------------------------------------------
   SCROLL, SELECCIÓN Y FORMULARIOS
   ---------------------------------------------------------- */

html[data-theme="light"] ::selection{
  background:rgba(124,58,237,.20);
  color:#172033;
}

html[data-theme="light"]
.content ::-webkit-scrollbar-thumb{
  background:#cbd5e1;
  border-radius:999px;
}

html[data-theme="light"]
.content ::-webkit-scrollbar-track{
  background:#f1f5f9;
}


/* Mantener oculto en impresión */

@media print{
  .duovox-theme-switch{
    display:none !important;
  }
}
