/* AdsSpaceHub Sprint 3-19.1 - Theme Final Override
   Este archivo se carga al final para forzar consistencia visual en modo claro/oscuro. */
:root{
  --ash-ui-bg:#f6f7fb;
  --ash-ui-surface:#ffffff;
  --ash-ui-surface-2:#f8fafc;
  --ash-ui-surface-3:#eef2ff;
  --ash-ui-border:rgba(148,163,184,.28);
  --ash-ui-text:#0f172a;
  --ash-ui-muted:#64748b;
  --ash-ui-shadow:0 18px 55px rgba(15,23,42,.10);
}
html[data-theme="dark"]{
  --ash-ui-bg:#050816;
  --ash-ui-surface:#0b1020;
  --ash-ui-surface-2:#111827;
  --ash-ui-surface-3:#172033;
  --ash-ui-border:rgba(148,163,184,.18);
  --ash-ui-text:#f8fafc;
  --ash-ui-muted:#a9b4c7;
  --ash-ui-shadow:0 22px 70px rgba(0,0,0,.38);
}
html[data-theme="dark"] body,
html[data-theme="dark"] .dash-body,
html[data-theme="dark"] .dash-main{background:var(--ash-ui-bg)!important;color:var(--ash-ui-text)!important;}
html[data-theme="dark"] .dash-main{background:linear-gradient(180deg,#050816 0%,#080d1c 100%)!important;}

/* Superficies generales */
html[data-theme="dark"] .ash-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .workflow-card,
html[data-theme="dark"] .package-card,
html[data-theme="dark"] .package-rule-grid .rule,
html[data-theme="dark"] .space-picker,
html[data-theme="dark"] .space-picker-item,
html[data-theme="dark"] .commercial-panel,
html[data-theme="dark"] .inventory-card,
html[data-theme="dark"] .inventory-rule,
html[data-theme="dark"] .service-card,
html[data-theme="dark"] .client-card,
html[data-theme="dark"] .mini-stat,
html[data-theme="dark"] .report-card,
html[data-theme="dark"] .muted-box,
html[data-theme="dark"] .quote-card,
html[data-theme="dark"] .quote-step,
html[data-theme="dark"] .material-card,
html[data-theme="dark"] .evidence-card,
html[data-theme="dark"] .profile-card,
html[data-theme="dark"] .detail-panel,
html[data-theme="dark"] .booking-card,
html[data-theme="dark"] .owner-kpi,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] [class*="-card"]:not(.btn):not(.badge),
html[data-theme="dark"] [class*="-panel"]:not(.btn):not(.badge),
html[data-theme="dark"] [class*="-box"]:not(.btn):not(.badge){
  background:var(--ash-ui-surface)!important;
  color:var(--ash-ui-text)!important;
  border-color:var(--ash-ui-border)!important;
  box-shadow:var(--ash-ui-shadow)!important;
}

/* Contenedores de formularios/filtros */
html[data-theme="dark"] .workflow-card form,
html[data-theme="dark"] .ash-card form,
html[data-theme="dark"] .commercial-panel,
html[data-theme="dark"] .upload-zone{
  background:transparent!important;
  color:var(--ash-ui-text)!important;
}
html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .table-light,
html[data-theme="dark"] .text-bg-light,
html[data-theme="dark"] .filter-chip,
html[data-theme="dark"] .package-space-pill{
  background:var(--ash-ui-surface-2)!important;
  color:var(--ash-ui-text)!important;
  border-color:var(--ash-ui-border)!important;
}
html[data-theme="dark"] .border,
html[data-theme="dark"] .border-top,
html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-start,
html[data-theme="dark"] .border-end{border-color:var(--ash-ui-border)!important;}

/* Textos */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] strong,
html[data-theme="dark"] b,
html[data-theme="dark"] .fw-bold,
html[data-theme="dark"] .ash-section-title,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .kpi-value,
html[data-theme="dark"] .report-kpi,
html[data-theme="dark"] .rule strong{color:var(--ash-ui-text)!important;}
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .small,
html[data-theme="dark"] small,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .form-help,
html[data-theme="dark"] .report-label,
html[data-theme="dark"] .rule small{color:var(--ash-ui-muted)!important;}

/* Tablas */
html[data-theme="dark"] .table,
html[data-theme="dark"] table{
  --bs-table-bg:transparent!important;
  --bs-table-color:var(--ash-ui-text)!important;
  --bs-table-border-color:var(--ash-ui-border)!important;
  color:var(--ash-ui-text)!important;
  border-color:var(--ash-ui-border)!important;
}
html[data-theme="dark"] .table thead,
html[data-theme="dark"] .table thead tr,
html[data-theme="dark"] .table thead th,
html[data-theme="dark"] table thead th{
  background:var(--ash-ui-surface-2)!important;
  color:#dbeafe!important;
  border-color:var(--ash-ui-border)!important;
}
html[data-theme="dark"] .table tbody tr,
html[data-theme="dark"] .table tbody td,
html[data-theme="dark"] .table tbody th{
  background:transparent!important;
  color:var(--ash-ui-text)!important;
  border-color:var(--ash-ui-border)!important;
}
html[data-theme="dark"] .table-hover tbody tr:hover>*{background:rgba(124,58,237,.12)!important;color:#fff!important;}

/* Inputs */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{
  background-color:#0f172a!important;
  color:var(--ash-ui-text)!important;
  border-color:rgba(148,163,184,.30)!important;
}
html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] textarea::placeholder{color:#7b879a!important;}
html[data-theme="dark"] .input-group-text{background:var(--ash-ui-surface-2)!important;color:var(--ash-ui-muted)!important;border-color:rgba(148,163,184,.30)!important;}
html[data-theme="dark"] label,
html[data-theme="dark"] .form-label{color:#dbeafe!important;}

/* Imágenes/placeholders */
html[data-theme="dark"] .space-admin-table img,
html[data-theme="dark"] img[src^="data:image/svg"]{background:#111827!important;border-color:var(--ash-ui-border)!important;}

/* Estados workflow */
html[data-theme="dark"] .workflow-status{border:1px solid rgba(148,163,184,.22)!important;}
html[data-theme="dark"] .rs-pending,
html[data-theme="dark"] .cs-pending{background:rgba(245,158,11,.16)!important;color:#fcd34d!important;}
html[data-theme="dark"] .rs-accepted,
html[data-theme="dark"] .rs-active,
html[data-theme="dark"] .rs-completed,
html[data-theme="dark"] .cs-approved,
html[data-theme="dark"] .cs-active,
html[data-theme="dark"] .cs-finished{background:rgba(16,185,129,.15)!important;color:#86efac!important;}
html[data-theme="dark"] .rs-cancelled,
html[data-theme="dark"] .rs-rejected,
html[data-theme="dark"] .cs-cancelled{background:rgba(239,68,68,.15)!important;color:#fca5a5!important;}
html[data-theme="dark"] .cs-review{background:rgba(59,130,246,.15)!important;color:#bfdbfe!important;}

/* Reportes y gráficos */
html[data-theme="dark"] .report-bar{background:#1f2937!important;}
html[data-theme="dark"] .report-list-item{border-color:var(--ash-ui-border)!important;}
html[data-theme="dark"] .metric-chip,
html[data-theme="dark"] .price-chip{background:rgba(124,58,237,.18)!important;color:#c4b5fd!important;border:1px solid rgba(167,139,250,.25)!important;}

/* Light normalization */
html[data-theme="light"] .workflow-card,
html[data-theme="light"] .package-card,
html[data-theme="light"] .inventory-card,
html[data-theme="light"] .ash-card,
html[data-theme="light"] .card{background:#fff!important;color:#0f172a!important;}


/* AdsSpaceHub Sprint 3-20 - Admin Theme Engine hardening
   Capa final para módulos administrativos con CSS heredado. */
html[data-theme="dark"] body.dash-body .dash-main,
html[data-theme="dark"] body.dash-body .dash-main *{
  scrollbar-color: rgba(148,163,184,.35) #050816;
}

html[data-theme="dark"] body.dash-body .ash-card,
html[data-theme="dark"] body.dash-body .card,
html[data-theme="dark"] body.dash-body .quick-action,
html[data-theme="dark"] body.dash-body .inventory-card,
html[data-theme="dark"] body.dash-body .package-card,
html[data-theme="dark"] body.dash-body .workflow-card,
html[data-theme="dark"] body.dash-body .quote-card,
html[data-theme="dark"] body.dash-body .report-card,
html[data-theme="dark"] body.dash-body .service-card,
html[data-theme="dark"] body.dash-body .client-card,
html[data-theme="dark"] body.dash-body .material-card,
html[data-theme="dark"] body.dash-body .evidence-card,
html[data-theme="dark"] body.dash-body .profile-card,
html[data-theme="dark"] body.dash-body .ash-form-section,
html[data-theme="dark"] body.dash-body .space-picker,
html[data-theme="dark"] body.dash-body .space-picker-item,
html[data-theme="dark"] body.dash-body .commercial-panel,
html[data-theme="dark"] body.dash-body .upload-zone,
html[data-theme="dark"] body.dash-body .ash-upload-panel,
html[data-theme="dark"] body.dash-body .mini-stat,
html[data-theme="dark"] body.dash-body .muted-box,
html[data-theme="dark"] body.dash-body .list-group-item,
html[data-theme="dark"] body.dash-body .dropdown-menu,
html[data-theme="dark"] body.dash-body .modal-content{
  background: var(--ash-ui-surface) !important;
  background-color: var(--ash-ui-surface) !important;
  color: var(--ash-ui-text) !important;
  border-color: var(--ash-ui-border) !important;
  box-shadow: var(--ash-ui-shadow) !important;
}

html[data-theme="dark"] body.dash-body .quick-action{
  text-decoration:none!important;
  border:1px solid var(--ash-ui-border)!important;
  transition:transform .18s ease, border-color .18s ease, background .18s ease!important;
}
html[data-theme="dark"] body.dash-body .quick-action:hover{
  background:linear-gradient(135deg,rgba(124,58,237,.18),rgba(59,130,246,.10))!important;
  border-color:rgba(167,139,250,.45)!important;
  transform:translateY(-1px);
}
html[data-theme="dark"] body.dash-body .quick-action span,
html[data-theme="dark"] body.dash-body .quick-action i{color:var(--ash-ui-text)!important;}
html[data-theme="dark"] body.dash-body .quick-action i{color:#a78bfa!important;}

html[data-theme="dark"] body.dash-body .table,
html[data-theme="dark"] body.dash-body table,
html[data-theme="dark"] body.dash-body .table-responsive{
  background:transparent!important;
  color:var(--ash-ui-text)!important;
}
html[data-theme="dark"] body.dash-body .table>:not(caption)>*>*,
html[data-theme="dark"] body.dash-body table td,
html[data-theme="dark"] body.dash-body table th{
  background-color:transparent!important;
  color:var(--ash-ui-text)!important;
  border-color:var(--ash-ui-border)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] body.dash-body .table thead th,
html[data-theme="dark"] body.dash-body table thead th{
  background-color:var(--ash-ui-surface-2)!important;
  color:#dbeafe!important;
}
html[data-theme="dark"] body.dash-body .table-hover>tbody>tr:hover>*{
  background-color:rgba(124,58,237,.13)!important;
  color:#fff!important;
}

html[data-theme="dark"] body.dash-body .package-rule-grid .rule,
html[data-theme="dark"] body.dash-body .ash-feature,
html[data-theme="dark"] body.dash-body .filter-chip,
html[data-theme="dark"] body.dash-body .package-space-pill,
html[data-theme="dark"] body.dash-body .badge.text-bg-light,
html[data-theme="dark"] body.dash-body .text-bg-light,
html[data-theme="dark"] body.dash-body .bg-white,
html[data-theme="dark"] body.dash-body .bg-light,
html[data-theme="dark"] body.dash-body .table-light,
html[data-theme="dark"] body.dash-body .package-badge{
  background:var(--ash-ui-surface-2)!important;
  background-color:var(--ash-ui-surface-2)!important;
  color:var(--ash-ui-text)!important;
  border-color:var(--ash-ui-border)!important;
}
html[data-theme="dark"] body.dash-body .package-badge,
html[data-theme="dark"] body.dash-body .badge-purple,
html[data-theme="dark"] body.dash-body .badge-ash{
  background:linear-gradient(135deg,rgba(124,58,237,.95),rgba(79,70,229,.95))!important;
  color:#fff!important;
}

html[data-theme="dark"] body.dash-body .btn-outline-secondary,
html[data-theme="dark"] body.dash-body .btn-outline-primary,
html[data-theme="dark"] body.dash-body .btn-outline-danger,
html[data-theme="dark"] body.dash-body .btn-outline-warning,
html[data-theme="dark"] body.dash-body .btn-outline-success{
  background:transparent!important;
  color:#e5e7eb!important;
  border-color:rgba(148,163,184,.38)!important;
}
html[data-theme="dark"] body.dash-body .btn-outline-primary:hover,
html[data-theme="dark"] body.dash-body .btn-outline-secondary:hover,
html[data-theme="dark"] body.dash-body .btn-outline-danger:hover,
html[data-theme="dark"] body.dash-body .btn-outline-warning:hover,
html[data-theme="dark"] body.dash-body .btn-outline-success:hover{
  background:rgba(124,58,237,.18)!important;
  color:#fff!important;
  border-color:rgba(167,139,250,.55)!important;
}

html[data-theme="dark"] body.dash-body .form-control,
html[data-theme="dark"] body.dash-body .form-select,
html[data-theme="dark"] body.dash-body input,
html[data-theme="dark"] body.dash-body select,
html[data-theme="dark"] body.dash-body textarea{
  background:#0f172a!important;
  color:var(--ash-ui-text)!important;
  border-color:rgba(148,163,184,.35)!important;
}

html[data-theme="dark"] body.dash-body .space-admin-table img,
html[data-theme="dark"] body.dash-body .ash-thumb,
html[data-theme="dark"] body.dash-body .ash-map-picker,
html[data-theme="dark"] body.dash-body .map-mini{
  background:#111827!important;
  border-color:var(--ash-ui-border)!important;
}

/* Normalización light para que el motor no afecte el modo claro */
html[data-theme="light"] body.dash-body .quick-action{
  background:#fff!important;
  color:#0f172a!important;
  border-color:rgba(226,232,240,.95)!important;
}
