/* KAIROS 1.2.6 - Modo oscuro. Se activa con html[data-theme="dark"].
   Se carga al final para ganar sobre los estilos de cada pantalla.
   Las impresiones (tickets, facturas, etiquetas) se generan aparte y no usan este archivo. */
html[data-theme="dark"]{
  --bg:#0f1115;--panel:#181b20;--panel-2:#1f232a;--ink:#e6e8eb;--muted:#9aa3ae;--line:#2b3038;
  --shadow:0 8px 28px rgba(0,0,0,.45);color-scheme:dark;
}
html[data-theme="dark"] body{background:var(--bg);color:var(--ink)}
html[data-theme="dark"] .test-mode-banner{background:#2a1a0c;color:#fdba74;border-bottom-color:#7c2d12}
html[data-theme="dark"] .topbar{background:var(--panel)!important;border-bottom:1px solid var(--line);color:var(--ink)}
html[data-theme="dark"] #page-title{color:#fff}
html[data-theme="dark"] #page-subtitle,html[data-theme="dark"] .small-muted,html[data-theme="dark"] .kpi-label,html[data-theme="dark"] .kpi-meta,html[data-theme="dark"] .list-sub{color:var(--muted)!important}
html[data-theme="dark"] .card,html[data-theme="dark"] .modal,html[data-theme="dark"] .nav-flyout,html[data-theme="dark"] .product-context-menu,
html[data-theme="dark"] .cm-toolbar,html[data-theme="dark"] .catalog-table-panel,html[data-theme="dark"] .catalog-filters,html[data-theme="dark"] .catalog-summary,
html[data-theme="dark"] .sp-filter-card,html[data-theme="dark"] .visual-card,html[data-theme="dark"] .product-tile,html[data-theme="dark"] .update-banner,
html[data-theme="dark"] .pos-workspace,html[data-theme="dark"] .pos-rail,html[data-theme="dark"] .pos-top-box,html[data-theme="dark"] .pos-clientbar,html[data-theme="dark"] .pos-search-zone,
html[data-theme="dark"] .pos-bottom-grid,html[data-theme="dark"] .pos-shortcuts,html[data-theme="dark"] .pos-search-results,html[data-theme="dark"] .pos-result,html[data-theme="dark"] .pos-media-strip,
html[data-theme="dark"] .pos-user,html[data-theme="dark"] .pos-avatar,html[data-theme="dark"] .payment-body,html[data-theme="dark"] .payment-footer,html[data-theme="dark"] .payment-methods,
html[data-theme="dark"] .product-editor,html[data-theme="dark"] .pe-section,html[data-theme="dark"] .receive-editor-card,html[data-theme="dark"] .receiving-body,html[data-theme="dark"] .receiving-footer,
html[data-theme="dark"] .profit-box,html[data-theme="dark"] .line-empty,html[data-theme="dark"] .workshop-total{background:var(--panel)!important;color:var(--ink);border-color:var(--line)!important}
html[data-theme="dark"] .card-header,html[data-theme="dark"] .modal-header,html[data-theme="dark"] .modal-footer{border-color:var(--line)!important;background:transparent}
html[data-theme="dark"] .card-header h3,html[data-theme="dark"] .modal-header h3,html[data-theme="dark"] .kpi-value,html[data-theme="dark"] .list-title,html[data-theme="dark"] strong,html[data-theme="dark"] b{color:#f3f4f6}
html[data-theme="dark"] .kpi{border-top-color:var(--brand)}
html[data-theme="dark"] .kpi-icon{background:#262a31!important}
html[data-theme="dark"] table th,html[data-theme="dark"] .cm-table th,html[data-theme="dark"] thead th{background:#1d2127!important;color:#9aa3ae!important;border-color:var(--line)!important}
html[data-theme="dark"] table td,html[data-theme="dark"] .cm-table td,html[data-theme="dark"] .pos-cart-table td{background:transparent!important;color:var(--ink)!important;border-color:#242830!important}
html[data-theme="dark"] tbody tr:hover td,html[data-theme="dark"] .cm-table tbody tr:hover td{background:#221c16!important}
html[data-theme="dark"] .cm-table td small,html[data-theme="dark"] td .small-muted{color:var(--muted)!important}
html[data-theme="dark"] .te-table tfoot td{background:#221a12!important;border-top-color:#7c2d12!important}
html[data-theme="dark"] .te-table .te-pay{color:#fb923c}
html[data-theme="dark"] .control,html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea,html[data-theme="dark"] .pos-select,html[data-theme="dark"] .pos-search-box,html[data-theme="dark"] .pos-search-box input{
  background:#12151a!important;color:var(--ink)!important;border-color:#333944!important}
html[data-theme="dark"] .control::placeholder,html[data-theme="dark"] input::placeholder{color:#6b7480}
html[data-theme="dark"] .btn.secondary,html[data-theme="dark"] .cm-btn,html[data-theme="dark"] .te-chip,html[data-theme="dark"] .pos-command,html[data-theme="dark"] .pos-rail-btn{background:#20242b!important;color:var(--ink)!important;border-color:#353b45!important}
html[data-theme="dark"] .cm-btn.primary,html[data-theme="dark"] .btn.primary{background:var(--brand)!important;color:#fff!important;border-color:var(--brand)!important}
html[data-theme="dark"] .cm-btn.danger{background:#2a1515!important;color:#fca5a5!important;border-color:#5b2323!important}
html[data-theme="dark"] .te-chip.active{background:#f05a1a!important;border-color:#f05a1a!important;color:#fff!important}
html[data-theme="dark"] .cm-avatar.initials{background:#2b3038;color:#fdba74}
html[data-theme="dark"] .badge.success{background:#0f2e22;color:#6ee7b7}
html[data-theme="dark"] .badge.warning{background:#33240b;color:#fcd34d}
html[data-theme="dark"] .badge.neutral{background:#262a31;color:#cbd5e1}
html[data-theme="dark"] .badge.info{background:#132440;color:#93c5fd}
html[data-theme="dark"] .cm-hint{background:#15181d!important;color:var(--muted)!important;border-color:var(--line)!important}
html[data-theme="dark"] .modal-backdrop{background:rgba(0,0,0,.65)}
html[data-theme="dark"] .list-item{border-color:var(--line)!important}
html[data-theme="dark"] .login-card,html[data-theme="dark"] .login-panel{background:var(--panel)!important;color:var(--ink)}
html[data-theme="dark"] a:not(.btn){color:#fb923c}
html[data-theme="dark"] .catalog-table tr,html[data-theme="dark"] .catalog-table tbody,html[data-theme="dark"] .catalog-table-wrap,html[data-theme="dark"] .catalog-preview,
html[data-theme="dark"] .catalog-actions-v98,html[data-theme="dark"] .catalog-summary>div,html[data-theme="dark"] .catalog-scroll-help,html[data-theme="dark"] .preview-thumb,html[data-theme="dark"] .product-preview-main{background:var(--panel)!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-theme="dark"] .catalog-row.selected td{background:#3a2412!important;box-shadow:inset 0 1px #7c2d12,inset 0 -1px #7c2d12!important;color:#fff!important}
html[data-theme="dark"] .catalog-actions-v98 .cat-btn.neutral{background:#20242b!important;color:var(--ink)!important;border-color:#353b45!important}
html[data-theme="dark"] .catalog-action-group{border-color:var(--line)!important}
html[data-theme="dark"] .catalog-action-group>span{color:#8b95a1!important}
html[data-theme="dark"] .pos-terminal{background:#0f1115!important}
html[data-theme="dark"] .pos-cart-area{background:#14171c!important}
html[data-theme="dark"] .pos-shortcuts button{background:#20242b!important;color:var(--ink)!important;border-color:#353b45!important}
html[data-theme="dark"] .pos-shortcuts button.generic{background:#33240b!important;color:#fcd34d!important;border-color:#7c5a12!important}
html[data-theme="dark"] .pos-top-box,html[data-theme="dark"] .pos-top-box *{color:var(--ink)}

/* Selector Claro / Oscuro / Auto */
.theme-toggle{display:inline-flex;align-items:center;border:1px solid #d6dde5;border-radius:999px;background:#fff;padding:3px;height:42px;flex:0 0 auto}
.theme-toggle button{border:0;background:transparent;border-radius:999px;padding:0 12px;height:34px;font-weight:800;font-size:12.5px;color:#475569;display:flex;align-items:center;gap:6px;white-space:nowrap}
.theme-toggle button:hover{color:#c2410c}
.theme-toggle button.active{background:#1f2937;color:#fdba74}
.theme-toggle .ti{font-size:14px;line-height:1}
body.products-page .theme-toggle,body.sold-products-page .theme-toggle{height:36px}
body.products-page .theme-toggle button,body.sold-products-page .theme-toggle button{height:28px;padding:0 9px}
body.products-page .theme-toggle .tl,body.sold-products-page .theme-toggle .tl{display:none}
@media(max-width:1280px){.theme-toggle .tl{display:none}.theme-toggle button{padding:0 10px}}
html[data-theme="dark"] .theme-toggle{background:#12151a;border-color:#333944}
html[data-theme="dark"] .theme-toggle button{color:#9aa3ae}
html[data-theme="dark"] .theme-toggle button.active{background:#f05a1a;color:#fff}
.pos-theme-button{border:1px solid #d6dde5;background:#fff;color:#1f2937;border-radius:10px;width:40px;height:36px;font-size:17px;margin-right:8px;cursor:pointer}
html[data-theme="dark"] .pos-theme-button{background:#20242b;color:#fdba74;border-color:#353b45}

/* ---- Ajustes por pantalla ---- */
html[data-theme="dark"] .pos-command-row{background:#171a1f!important;border-color:var(--line)!important}
html[data-theme="dark"] .catalog-search,html[data-theme="dark"] .sp-search-box{background:#12151a!important;border-color:#3a414c!important}
html[data-theme="dark"] .preview-emoji{background:#1d2127!important}
html[data-theme="dark"] .visual-card-head{background:linear-gradient(90deg,#2b1c10,#1d1a17)!important}
html[data-theme="dark"] .visual-price-row,html[data-theme="dark"] .visual-limit-note{background:#241a10!important;border-color:#5a3413!important;color:#fdba74!important}
html[data-theme="dark"] .visual-image-wrap{background:#1d2127!important}
html[data-theme="dark"] .count-safety{background:linear-gradient(135deg,#122033,#15181d)!important;border-color:#1e3a5f!important;color:var(--ink)!important}
html[data-theme="dark"] .company-tabs{background:#15181d!important;border-color:var(--line)!important}
html[data-theme="dark"] .company-tabs button{background:#20242b!important;color:var(--ink)!important;border-color:#353b45!important}
html[data-theme="dark"] .company-tabs button.active{background:#f05a1a!important;color:#fff!important;border-color:#f05a1a!important}
html[data-theme="dark"] .company-save{background:var(--panel)!important;border-color:var(--line)!important}
html[data-theme="dark"] .btn.danger{background:#d64545!important;color:#fff!important;border-color:#d64545!important}
/* Reportes ejecutivos */
html[data-theme="dark"] .er-app{background:#0f1115!important;color:var(--ink)!important}
html[data-theme="dark"] .er-panel,html[data-theme="dark"] .er-kpi{background:var(--panel)!important;border-color:var(--line)!important;color:var(--ink)!important}
html[data-theme="dark"] .er-app h1,html[data-theme="dark"] .er-app h2,html[data-theme="dark"] .er-app h3,html[data-theme="dark"] .er-app strong,html[data-theme="dark"] .er-app b{color:#f3f4f6!important}
html[data-theme="dark"] .er-range{background:#241a10!important;border-color:#5a3413!important}
html[data-theme="dark"] .er-footer{background:#15181d!important;border-color:var(--line)!important}
html[data-theme="dark"] .er-outline{background:transparent!important}
html[data-theme="dark"] .er-alert{background:#33240b!important;color:#fcd34d!important}
html[data-theme="dark"] .er-user>div,html[data-theme="dark"] .er-export>div,html[data-theme="dark"] .er-user button,html[data-theme="dark"] .er-export button{background:var(--panel)!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-theme="dark"] .er-app svg text{fill:#cbd5e1}
/* Textos y etiquetas */
html[data-theme="dark"] label,html[data-theme="dark"] .catalog-check{color:#aab3bf!important}
html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3,html[data-theme="dark"] h4{color:#f3f4f6}
/* Inicio de sesión */
html[data-theme="dark"] .login-screen{background:radial-gradient(circle at 18% 18%,rgba(249,115,22,.16),transparent 34%),linear-gradient(135deg,#0b0d10,#15181d)!important}
html[data-theme="dark"] .login-card{background:rgba(24,27,32,.97)!important;border-color:#2b3038!important;box-shadow:0 28px 80px rgba(0,0,0,.55)!important}
html[data-theme="dark"] .login-brand-name,html[data-theme="dark"] .login-heading h1{color:#f3f4f6!important}
html[data-theme="dark"] .login-brand-subtitle,html[data-theme="dark"] .login-heading p{color:#9aa3ae!important}
html[data-theme="dark"] .login-form label{color:#cbd5e1!important}
html[data-theme="dark"] .login-control{background:#12151a!important;color:#e6e8eb!important;border-color:#333944!important}
html[data-theme="dark"] .login-eye:hover{background:#262a31}
/* Caja: totales por forma de pago */
html[data-theme="dark"] .shift-payment-grid>div,html[data-theme="dark"] .shift-report-grid>div{background:#1d2127!important;border-color:var(--line)!important}
html[data-theme="dark"] .shift-payment-grid span,html[data-theme="dark"] .shift-report-grid span{color:#9aa3ae!important}
html[data-theme="dark"] .shift-payment-grid b,html[data-theme="dark"] .shift-report-grid b{color:#f3f4f6!important}
/* Punto de venta */
html[data-theme="dark"] #pos-search-focus,html[data-theme="dark"] .pos-search-box button{background:#20242b!important;color:#fdba74!important;border-color:#353b45!important}
html[data-theme="dark"] .pos-search-zone label,html[data-theme="dark"] .pos-search-zone span,html[data-theme="dark"] .pos-footer label,html[data-theme="dark"] .pos-bottom-grid label{color:#aab3bf!important}
html[data-theme="dark"] .barcode{color:#8b95a1!important}
/* Reportes */
html[data-theme="dark"] .er-app label,html[data-theme="dark"] .er-app span{color:#aab3bf}
html[data-theme="dark"] .er-app button:not(.er-primary):not(.active){background:#20242b!important;color:#e6e8eb!important;border-color:#353b45!important}
html[data-theme="dark"] .er-donut{background-color:#262a31!important}
html[data-theme="dark"] .pos-search-zone span[style],html[data-theme="dark"] .pos-media-empty span{color:#fb923c!important}
html[data-theme="dark"] .pos-media-placeholder span{color:#fb923c!important}
/* Cierre de turno */
html[data-theme="dark"] .close-summary>div{background:#1d2127!important;border-color:var(--line)!important;color:var(--ink)!important}
html[data-theme="dark"] .close-summary>div *{color:inherit}
html[data-theme="dark"] .big-cash-input{background:#221a12!important;border-color:#5a3413!important;color:#fdba74!important}
html[data-theme="dark"] .big-cash-input input{background:#0f1115!important;color:#fff!important}
/* Cobro */
html[data-theme="dark"] .payment-method{background:#1d2127!important;border-color:var(--line)!important;color:var(--ink)!important}
html[data-theme="dark"] .payment-method.active{background:#2d1f13!important;border-color:#f05a1a!important;box-shadow:inset 0 -3px #f05a1a!important}
html[data-theme="dark"] .payment-method small,html[data-theme="dark"] .payment-method span{color:#aab3bf!important}
html[data-theme="dark"] .payment-amount-card{background:#1d2127!important;border-color:var(--line)!important;color:var(--ink)!important}
html[data-theme="dark"] .payment-total small{background:#fff!important;color:#c2410c!important}
html[data-theme="dark"] .pos-media-image{background:#fff!important}
/* 1.2.7 pagos a técnicos */
html[data-theme="dark"] .te-alert{background:#241a10!important;border-color:#5a3413!important;color:#fdba74!important}
html[data-theme="dark"] .te-info{background:#122033!important;border-color:#1e3a5f!important;color:#93c5fd!important}
html[data-theme="dark"] .te-pay-total{background:#0f1115;border:1px solid #353b45}
html[data-theme="dark"] .te-ok{color:#6ee7b7}
/* 1.2.8 corte de caja */
html[data-theme="dark"] .cut-body{background:#0f1115!important}
html[data-theme="dark"] .cut-summary,html[data-theme="dark"] .cut-tabs-box,html[data-theme="dark"] .cut-card,html[data-theme="dark"] .cut-sellers,html[data-theme="dark"] .cut-footer{background:var(--panel)!important;border-color:var(--line)!important}
html[data-theme="dark"] .cut-row:nth-child(odd),html[data-theme="dark"] .cut-line:nth-of-type(even){background:#1d2127!important}
html[data-theme="dark"] .cut-row.pos b,html[data-theme="dark"] .cut-line b,html[data-theme="dark"] .cut-big{color:#4ade80!important}
html[data-theme="dark"] .cut-row.neg b,html[data-theme="dark"] .cut-line.neg b{color:#f87171!important}
html[data-theme="dark"] .cut-line.muted b,html[data-theme="dark"] .cut-line.muted span{color:#93c5fd!important}
html[data-theme="dark"] .cut-total{background:#0f2e22!important;border-color:#14532d!important}
html[data-theme="dark"] .cut-total b{color:#4ade80!important}html[data-theme="dark"] .cut-total small{color:#9aa3ae!important}
html[data-theme="dark"] .cut-tabs,html[data-theme="dark"] .cut-sellers h4{background:#15181d!important;border-color:var(--line)!important}
html[data-theme="dark"] .cut-tabs button{background:#1d2127!important;border-color:#353b45!important;color:#9aa3ae!important}
html[data-theme="dark"] .cut-tabs button.active{background:var(--panel)!important;color:#fdba74!important;border-color:#7c2d12!important}
html[data-theme="dark"] .cut-line.total{border-top-color:#9aa3ae}
html[data-theme="dark"] .cut-profit{background:#241a10!important;border-color:#5a3413!important}html[data-theme="dark"] .cut-profit b{color:#fdba74!important}
html[data-theme="dark"] .cut-field,html[data-theme="dark"] .cut-noncash,html[data-theme="dark"] .cut-report-head div{background:#1d2127!important;border-color:var(--line)!important;color:var(--ink)!important}
html[data-theme="dark"] .cut-cash-input input{background:#241a10!important;color:#fff!important}
html[data-theme="dark"] .cut-expect span,html[data-theme="dark"] .cut-count-grid>label{color:#aab3bf!important}
html[data-theme="dark"] .cut-status.wait{background:#1d2127!important;color:#9aa3ae!important}
html[data-theme="dark"] .cut-expect b.ok{color:#4ade80!important}html[data-theme="dark"] .cut-expect b.bad{color:#f87171!important}html[data-theme="dark"] .cut-expect b.warn{color:#fbbf24!important}
html[data-theme="dark"] .badge.danger{background:#3a1616!important;color:#fca5a5!important}
html[data-theme="dark"] .logo-setting{background:#15181d!important;border-color:var(--line)!important}
html[data-theme="dark"] .logo-setting-preview{background:#fff!important}

/* 1.3.4 Arranque definitivo */
html[data-theme="dark"] .golive-alert{background:#2a1a0c;color:#fed7aa;border-color:#f97316}
html[data-theme="dark"] .golive-box{border-color:#334155}
html[data-theme="dark"] .golive-status.work{background:#0c1a2e;border-color:#1d4ed8}
html[data-theme="dark"] .golive-status.ok{background:#052e1f;border-color:#10b981}
html[data-theme="dark"] .golive-status.bad{background:#2d0b0b;border-color:#ef4444;color:#fecaca}

/* 1.4.0 Nube */
html[data-theme="dark"] .cloud-pick{background:#111827;border-color:#334155}
html[data-theme="dark"] .cloud-pick:hover{background:#1f150c;border-color:#f97316}
html[data-theme="dark"] .cloud-pick-own,html[data-theme="dark"] .cloud-card.muted{background:#0b1220}
html[data-theme="dark"] .cloud-card{border-color:#334155}
html[data-theme="dark"] .cloud-card.hub{background:#0b1a2a;border-color:#0369a1}
html[data-theme="dark"] .cloud-error{background:#2d0b0b;border-color:#ef4444;color:#fecaca}
html[data-theme="dark"] .cloud-ok{color:#4ade80}
