/* Every structural surface follows the selected hue; logos keep their artwork. */
html[data-appearance] body .access-story h1,html[data-appearance] body .access-story h2,html[data-appearance] body .access-story p,html[data-appearance] body .access-story .eyebrow,html[data-appearance] body .auth-brand h1,html[data-appearance] body .auth-brand h2{color:#fff!important}
html[data-appearance] body,html[data-appearance] main,html[data-appearance] #content{background:var(--sc-ground)!important;color:var(--sc-text)!important}
html[data-appearance] body #sidebar,html[data-appearance] body aside,html[data-appearance] .v23-hero,html[data-appearance] .reference-hero,html[data-appearance] .welcome-banner,html[data-appearance] .access-story,html[data-appearance] .auth{background:var(--sc-sidebar)!important;background-image:none!important;color:#fff!important}
html[data-appearance] .topbar,html[data-appearance] .card,html[data-appearance] .v23-card,html[data-appearance] .v23-kpis article,html[data-appearance] .modal-card,html[data-appearance] .auth-card,html[data-appearance] .today-card,html[data-appearance] .user-pill{background:var(--sc-paper)!important;color:var(--sc-text)!important;border-color:var(--sc-border)!important}
html[data-appearance] .search-wrap,html[data-appearance] .search-wrap input,html[data-appearance] .btn-secondary,html[data-appearance] .btn-ghost,html[data-appearance] .v23-link,html[data-appearance] .v23-pill,html[data-appearance] .v23-action-row button,html[data-appearance] table th,html[data-appearance] .table th,html[data-appearance] .sc-company-identity,html[data-appearance] .cloud-note,html[data-appearance] .notice{background:var(--sc-soft)!important;color:var(--sc-text)!important;border-color:var(--sc-border)!important}
html[data-appearance] .nav-group-head,html[data-appearance] .nav-children button,html[data-appearance] .sidebar-collapse,html[data-appearance] #sidebarCollapse{background:transparent!important;color:#fff!important;border-color:#ffffff30!important}
html[data-appearance] #sidebar button.active,html[data-appearance] #sidebar button:hover,html[data-appearance] .btn-primary,html[data-appearance] .top-sale,html[data-appearance] .primary,html[data-appearance] .user-avatar,html[data-appearance] .avatar-initials,html[data-appearance] .v23-quick-btn{background:var(--sc-accent)!important;color:#fff!important;border-color:var(--sc-accent)!important;background-image:none!important;box-shadow:none!important}
html[data-appearance] .muted,html[data-appearance] .field small,html[data-appearance] .page-head p{color:var(--sc-muted)!important}
html[data-appearance] h1,html[data-appearance] h2,html[data-appearance] h3,html[data-appearance] label,html[data-appearance] td{color:var(--sc-text)}
html[data-appearance] .cloud-kpis strong,html[data-appearance] .card .value,html[data-appearance] .v23-link{color:var(--sc-accent-readable)!important}
html[data-appearance] .sc-currency-control{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 18px;background:var(--sc-soft);color:var(--sc-text);border-bottom:1px solid var(--sc-border)}.sc-currency-control select{padding:6px 10px;border-radius:8px}.sc-currency-control small{font-size:11px}.label-product-row{display:grid;grid-template-columns:minmax(0,1fr) 85px 40px;gap:10px;align-items:center;margin-bottom:10px}.report-controls{display:flex;gap:12px;flex-wrap:wrap;align-items:end;margin-bottom:20px}.report-controls label{flex:1 1 160px}.report-controls .actions{flex-basis:100%;display:flex;gap:10px;flex-wrap:wrap}.hardware-guide li{margin:12px 0;line-height:1.6}
@media(max-width:600px){.sc-currency-control{padding:8px 12px;font-size:12px}.sc-currency-control small{flex-basis:100%}.label-product-row{grid-template-columns:minmax(0,1fr) 65px 30px;gap:6px}}
html[data-appearance] .catalog-head{background:var(--sc-sidebar)!important;border-color:var(--sc-accent)!important;background-image:none!important}.catalog-head h1,.catalog-head p,.catalog-head a{color:white!important}.catalog-brand img{object-fit:contain;max-height:100px;background:transparent}.catalog-whatsapp{position:fixed;right:20px;bottom:86px;padding:14px 18px;background:#16834a;color:white;border-radius:24px;font-weight:bold;z-index:60;text-decoration:none}.catalog-filter-row label{min-width:150px}.catalog-meta{overflow-wrap:anywhere}@media(max-width:700px){.catalog-meta{display:flex!important;flex-direction:column;gap:8px;width:100%}.catalog-top{align-items:flex-start;flex-direction:column}.catalog-whatsapp{right:14px;bottom:80px;font-size:13px}.catalog-brand img{width:80px;max-height:80px}}
html[data-appearance] body #app .main,html[data-appearance] body #app .shell,html[data-appearance] body #app .content{background:var(--sc-ground)!important;color:var(--sc-text)!important}
html[data-appearance] body #app #content h1,html[data-appearance] body #app #content h2,html[data-appearance] body #app #content h3,html[data-appearance] body #app #content h4,html[data-appearance] body #app #content label,html[data-appearance] body #app #content td,html[data-appearance] body #app #content th{color:var(--sc-text)!important}
html[data-appearance] body #app #content small,html[data-appearance] body #app #content .muted,html[data-appearance] body #app #content .page-head p,html[data-appearance] body #app #content .cloud-kpis small,html[data-appearance] body #app .sc-currency-control small,html[data-appearance] body #app .topbar .user-meta small{color:var(--sc-muted)!important}
html[data-appearance] body #app #sidebar .nav-direct,html[data-appearance] body #app #sidebar .nav-direct svg,html[data-appearance] body #app #sidebar .nav-group-head svg,html[data-appearance] body #app #sidebar .brand small{color:#fff!important}
html[data-appearance] body #app #content .table td,html[data-appearance] body #app #content table td,html[data-appearance] body #app #content tbody tr{background:var(--sc-paper)!important;border-color:var(--sc-border)!important}
html[data-appearance] body #app #content tbody tr:hover td{background:var(--sc-soft)!important}
html[data-appearance] body #app #content .cloud-kpis strong,html[data-appearance] body #app #content .card .value{color:var(--sc-accent-readable)!important}
html[data-appearance] body #app #sidebar .sidebar-footer,html[data-appearance] body #app #sidebar .sidebar-footer *,html[data-appearance] body #app #sidebar #logoutBtn,html[data-appearance] body #app #sidebar .sidebar-status,html[data-appearance] body #app #sidebar .sidebar-status *,html[data-appearance] body #app #sidebar #sidebarUser small{color:#f4eef1!important}html[data-appearance] body #app a:not(.btn){color:var(--sc-accent-readable)!important}
html[data-appearance] .catalog-cart-btn{background:var(--sc-accent)!important;background-image:none!important;box-shadow:0 8px 24px #0002}html[data-appearance] .cart-count,html[data-appearance] .price{color:var(--sc-accent-readable)!important}html[data-appearance] .category-pill,html[data-appearance] .catalog-image-placeholder{background:var(--sc-soft)!important;color:var(--sc-muted)!important}html[data-appearance] .catalog-description{color:var(--sc-muted)!important}.catalog-meta span:empty{display:none}
html[data-appearance] body #app .page-head .actions{background:transparent!important;padding:0!important;box-shadow:none!important;border:0!important}html[data-appearance] body #app #sidebar .cloud-live{background:var(--sc-soft)!important}html[data-appearance] body #app #sidebar .cloud-live b,html[data-appearance] body #app #sidebar .cloud-live small{color:#f4eef1!important}@media(max-width:600px){.page-head .actions{width:100%;display:flex!important}.page-head .actions .btn{width:100%;flex:1}}

/* Foreground colors match the surface, including the light sidebar status. */
html[data-appearance] body #app #sidebar .cloud-live b,html[data-appearance] body #app #sidebar .cloud-live small{color:var(--sc-text)!important}
html[data-appearance] body .access-card,html[data-appearance] body #workspace .stat,html[data-appearance] body #workspace .plan,html[data-appearance] body #workspace>main>header{background:var(--sc-paper)!important;color:var(--sc-text)!important;border-color:var(--sc-border)!important}
html[data-appearance] body #workspace main h1,html[data-appearance] body #workspace main h2,html[data-appearance] body #workspace main h3,html[data-appearance] body #workspace main label{color:var(--sc-text)!important}
html[data-appearance] body #app #content .ops-summary{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:20px 0}
html[data-appearance] body #app #content .ops-summary .mini-stat{display:flex;flex-direction:column;gap:8px;padding:18px;border:1px solid var(--sc-border);border-radius:14px;background:var(--sc-paper)!important;box-shadow:0 3px 12px #00000006}
html[data-appearance] body #app #content .ops-summary b{font-size:28px;line-height:1.2;color:var(--sc-text)!important}html[data-appearance] body #app #content .ops-summary span{font-size:12px;font-weight:700;color:var(--sc-muted)!important}
.ops-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.ops-grid>.card{min-width:0;margin:0!important}@media(max-width:900px){html[data-appearance] body #app #content .ops-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.ops-grid{grid-template-columns:1fr}}@media(max-width:420px){html[data-appearance] body #app #content .ops-summary{gap:10px}.ops-summary .mini-stat{padding:14px!important}}
.ops-card .table{min-width:0!important;width:100%;table-layout:fixed}.ops-card .table td{overflow-wrap:anywhere}.ops-card .section-title{flex-wrap:wrap;gap:8px}
html[data-appearance] body .access-card p,html[data-appearance] body .access-card small,html[data-appearance] body #workspace main p,html[data-appearance] body #workspace main small{color:var(--sc-muted)!important}
html[data-appearance] body input::placeholder,html[data-appearance] body textarea::placeholder{color:var(--sc-muted)!important;opacity:1}
.ops-grid>*{min-width:0}@media(max-width:900px){html[data-appearance] body #app #content .ops-grid{grid-template-columns:minmax(0,1fr)!important}html[data-appearance] body #app #content .ops-grid>*{grid-column:1 / -1!important;grid-row:auto!important}}
html[data-appearance] body #workspace .welcome-banner h2,html[data-appearance] body #workspace .welcome-banner p,html[data-appearance] body #app #content .v23-hero>div:first-child h1,html[data-appearance] body #app #content .v23-hero>div:first-child p,html[data-appearance] body #app #content .v23-hero>div:first-child>span,html[data-appearance] body .login-hero-inner h1,html[data-appearance] body .login-hero-inner p{color:#fff!important}html[data-appearance] body .login-hero{background:var(--sc-sidebar)!important;background-image:none!important}

/* Legibilidad: texto pequeno con contraste minimo 4.5:1 en modo claro. */
html[data-appearance] .v23-favorites button.manage{color:var(--sc-accent-readable)!important}html[data-appearance="light"] .warn-text{color:#8a5600!important}html[data-appearance="light"] .ok-text,html[data-appearance="light"] .v23-goal strong,html[data-appearance="light"] .v23-health-strip .ok b{color:#11703f!important}
html[data-appearance="light"] body{--muted:var(--sc-muted)}html[data-appearance="light"] .sc-breadcrumbs{color:var(--sc-muted)!important}html[data-appearance="light"] .sc-breadcrumbs button{color:var(--sc-accent-readable)!important}html[data-appearance="light"] .sc-breadcrumbs b{color:var(--sc-text)!important}
html[data-appearance="light"] .empty-state p,html[data-appearance="light"] .report-summary-grid span{color:var(--sc-muted)!important}html[data-appearance="light"] .badge.ok{color:#0f6b3c!important}
/* Modo oscuro: el motor de tema oscurece los tonos claros, y algunos se usan como texto. */
html[data-appearance="dark"] .v23-periods button{color:var(--sc-text)!important}html[data-appearance="dark"] .v23-periods button.active{color:#0b2236!important}html[data-appearance="dark"] .report-row b,html[data-appearance="dark"] .report-row span,html[data-appearance="dark"] .v23-card b,html[data-appearance="dark"] .v23-kpis b{color:var(--sc-text)!important}html[data-appearance="dark"] .v23-card span,html[data-appearance="dark"] .v23-kpis span,html[data-appearance="dark"] p,html[data-appearance="dark"] small{color:var(--sc-muted)!important}
html[data-appearance="dark"] body #app :is(.accounting-equation,.cloud-pilot,.grand-total,.report-summary-grid>div,.check-row,.empty-state>div,.filter-search,.input,.select,.textarea,.readonly-correlation,.report-row.total,.segmented,.v23-cash-projection>div,.v23-favorites button,.v23-health-strip>span,.v23-insights p,.v23-metric-list>div,.v23-money-grid>div,.v23-op-status button){background:var(--sc-soft)!important;border-color:var(--sc-border)!important}html[data-appearance="dark"] body #app :is(.v23-prod-tabs button.active,.segmented button.active){background:var(--sc-accent)!important;border-color:var(--sc-accent)!important;color:#fff!important}html[data-appearance="dark"] body .app{background:var(--sc-ground)!important}
html[data-appearance="dark"] body #app .report-block .report-row.total.grand-total,html[data-appearance="dark"] body #app .export-card .accounting-equation.ok,html[data-appearance="dark"] body #app .card .report-summary-grid>div{background:var(--sc-soft)!important;border-color:var(--sc-border)!important}html[data-appearance="dark"] body #app :is(.input,.select,.textarea,.cloud-pilot,.v23-insights p,.readonly-correlation,.segmented button,.report-summary-grid>div b,.grand-total *,.accounting-equation *){color:var(--sc-text)!important}
html[data-appearance="dark"] body>.cloud-pilot.cloud-pilot.cloud-pilot{background:var(--sc-soft)!important;color:var(--sc-text)!important;border-color:var(--sc-border)!important}html[data-appearance="dark"] body #app .report-summary-grid>div span{color:var(--sc-muted)!important}html[data-appearance="light"] body #app .empty-inline{color:var(--sc-muted)!important}html[data-appearance="light"] body #app .accounting-equation.ok *{color:#0f5c34!important}
