/* ANNA POS - Estilos principales */

/* ── MOBILE SCROLL/ZOOM FIX ─────────────────────────── */
html{scroll-behavior:auto;-webkit-text-size-adjust:100%;text-size-adjust:100%}
.screen{display:none;width:100%;box-sizing:border-box}
.screen.active{display:block;overflow-y:auto;-webkit-overflow-scrolling:touch}

:root{--azul:#0F7BAA;--azul-claro:#E8F4FD;--azul-oscuro:#0A5C82;--naranja:#FF6B35;--naranja-claro:#FFF0E8;--verde:#28A745;--rojo:#DC3545;--gris:#6C757D;--gris-claro:#F8F9FA;--bg:#f0f4f8;--bg-card:#ffffff;--txt:#333;--txt-sec:#6c757d;--borde:#dee2e6;--sidebar-bg:#fff;}
/* ── MODO OSCURO ─────────────────────────────────────────────────────────── */
body.dark{--bg:#0f1117;--bg-card:#1a1d27;--txt:#e2e8f0;--txt-sec:#94a3b8;--borde:#2d3748;--azul-claro:#1a2d3d;--gris-claro:#1e2130;--sidebar-bg:#13151f;}
body.dark .sidebar{background:var(--sidebar-bg)!important;border-right:1px solid var(--borde)}
body.dark .card,body.dark .modal,body.dark .pos-cart,body.dark .pos-item,body.dark .table-wrap{background:var(--bg-card)!important;color:var(--txt)!important;border-color:var(--borde)!important}
body.dark .header{background:var(--bg-card)!important;border-bottom:1px solid var(--borde)}
body.dark input,body.dark select,body.dark textarea{background:#1e2130!important;color:var(--txt)!important;border-color:var(--borde)!important}
body.dark table{color:var(--txt)}body.dark th{background:#1e2130!important}body.dark tr:nth-child(even){background:#1a1d27!important}
body.dark .stat-card{background:var(--bg-card)!important;color:var(--txt)!important}
body.dark .tienda-badge{background:#1a2d3d!important}body.dark .sidebar-item:hover{background:#1a2d3d!important}
.tienda-switcher-panel{display:none;position:absolute;top:52px;left:50%;transform:translateX(-50%);min-width:260px;max-width:340px;background:var(--bg-card,#fff);border:1px solid rgba(0,0,0,.1);border-radius:14px;box-shadow:0 8px 32px rgba(0,0,0,.18);z-index:9999;padding:0;overflow:hidden;pointer-events:auto;touch-action:pan-y}
body.dark .tienda-switcher-panel{background:#1e2030;border-color:rgba(255,255,255,.1)}
.tienda-switcher-panel.open{display:block}
.tsw-header{padding:12px 16px;font-size:13px;font-weight:700;border-bottom:1px solid rgba(0,0,0,.07);color:var(--txt-sec,#888);text-transform:uppercase;letter-spacing:.5px}
body.dark .tsw-header{border-color:rgba(255,255,255,.08)}
.tsw-item{display:flex;align-items:center;gap:12px;padding:11px 16px;cursor:pointer;transition:background .15s;border-bottom:1px solid rgba(0,0,0,.04)}
.tsw-item:last-child{border-bottom:none}
.tsw-item:hover{background:var(--azul-claro,#e8f4fd)}
body.dark .tsw-item:hover{background:#1a2d3d}
.tsw-item.activa{background:var(--azul-claro,#e8f4fd);font-weight:700}
body.dark .tsw-item.activa{background:#1a2d3d}
.tsw-icon{font-size:22px;width:32px;text-align:center}
.tsw-nombre{font-size:14px;font-weight:600}
.tsw-tipo{font-size:11px;color:var(--txt-sec,#888)}
.tienda-badge-btn{background:var(--azul-claro,#e8f4fd);color:var(--azul,#1565c0);border:none;border-radius:20px;padding:5px 14px;font-size:12px;font-weight:700;cursor:pointer;display:flex;align-items:center;gap:6px;white-space:nowrap;min-height:36px;touch-action:manipulation;pointer-events:auto;position:relative;z-index:2}
.tienda-badge-btn:hover{opacity:.85}
.btn-volver-empresa{background:none;border:1px solid rgba(255,255,255,.4);color:white;border-radius:20px;padding:4px 14px;font-size:12px;font-weight:600;cursor:pointer;display:flex;align-items:center;gap:6px}
.btn-volver-empresa:hover{background:rgba(255,255,255,.15)}
.tienda-card{cursor:pointer;transition:transform .15s,box-shadow .15s}
.tienda-card:hover{transform:translateY(-3px);box-shadow:0 6px 24px rgba(0,0,0,.15)}
body.dark .pos-search{background:#1e2130!important;color:var(--txt)!important;border-color:var(--borde)!important}
body.dark .btn-gris{background:#2d3748!important;color:#e2e8f0!important}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:'Segoe UI',-apple-system,sans-serif;background:var(--bg);color:var(--txt);height:100dvh;min-height:100vh;overflow-x:hidden;transition:background .3s,color .3s}
input,select,textarea,button{font-family:inherit;font-size:16px}

/* LOGIN — Premium */
@keyframes bgMove{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}
@keyframes floatOrb{0%,100%{transform:translateY(0) scale(1)}50%{transform:translateY(-30px) scale(1.05)}}
@keyframes fadeUp{from{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}
@keyframes pulse{0%,100%{box-shadow:0 0 0 0 rgba(247,183,49,0.35)}70%{box-shadow:0 0 0 15px rgba(247,183,49,0)}}
@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}
@keyframes shimmer{0%{background-position:-200% center}100%{background-position:200% center}}

#login-screen{
  position:fixed;inset:0;
  background:linear-gradient(-45deg,#030405,#0b1118,#17120a,#2a1b08,#080a0d,#1b1510);
  background-size:400% 400%;
  animation:bgMove 12s ease infinite;
  display:flex;align-items:center;justify-content:center;
  z-index:1000;overflow:hidden;
}

/* Orbes decorativos de fondo */
#login-screen::before{
  content:'';position:absolute;width:500px;height:500px;
  background:radial-gradient(circle,rgba(247,183,49,0.16) 0%,transparent 70%);
  top:-100px;left:-100px;border-radius:50%;
  animation:floatOrb 8s ease-in-out infinite;
}
#login-screen::after{
  content:'';position:absolute;width:400px;height:400px;
  background:radial-gradient(circle,rgba(255,107,53,0.13) 0%,transparent 70%);
  bottom:-80px;right:-80px;border-radius:50%;
  animation:floatOrb 10s ease-in-out infinite reverse;
}

/* Partículas decorativas */
.login-particle{
  position:absolute;border-radius:50%;pointer-events:none;
  background:rgba(247,183,49,0.055);
}

.login-box{
  background:linear-gradient(145deg,rgba(255,255,255,0.075),rgba(247,183,49,0.035));
  backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
  border:1px solid rgba(247,183,49,0.24);
  border-radius:28px;
  padding:48px 40px 44px;
  width:92%;max-width:420px;
  box-shadow:0 30px 80px rgba(0,0,0,0.62),0 0 42px rgba(247,183,49,0.08),0 0 0 1px rgba(255,255,255,0.05) inset;
  animation:fadeUp .7s ease both;
  position:relative;z-index:2;
}

.login-box .logo{text-align:center;margin-bottom:24px;position:relative}
.logo-ring{
  width:90px;height:90px;margin:0 auto 4px;
  border-radius:24px;
  background:linear-gradient(145deg,#15110a,#050608,#2a1b08);
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 8px 32px rgba(247,183,49,0.32),0 0 60px rgba(255,107,53,0.15);
  animation:pulse 2.5s infinite;
  position:relative;
}
.logo-ring::before{
  content:'';position:absolute;inset:-3px;border-radius:26px;
  background:linear-gradient(135deg,#F7B731,transparent,#FF6B35);
  animation:spin 4s linear infinite;z-index:-1;
}
.logo-ring span{font-size:42px;line-height:1}

.login-brand{
  font-size:32px;font-weight:900;letter-spacing:3px;
  background:linear-gradient(90deg,#ffffff,#F7B731,#FF6B35,#ffffff);
  background-size:200% auto;
  -webkit-background-clip:text;-webkit-text-fill-color:transparent;
  background-clip:text;
  animation:shimmer 3s linear infinite;
  margin-bottom:2px;
}
.login-tagline{
  color:rgba(247,183,49,0.72);font-size:12px;letter-spacing:2px;
  text-transform:uppercase;font-weight:600;
}

.login-divider{
  height:1px;background:linear-gradient(90deg,transparent,rgba(247,183,49,0.42),transparent);
  margin:20px 0 24px;
}

.login-box input{
  width:100%;padding:15px 18px;
  background:rgba(255,255,255,0.075);
  border:1px solid rgba(247,183,49,0.20);
  border-radius:12px;margin-bottom:12px;
  color:white;font-size:15px;
  transition:all .3s;box-sizing:border-box;
}
.login-box input::placeholder{color:rgba(255,255,255,0.62)}
.login-box input:focus{
  outline:none;
  border-color:rgba(247,183,49,0.82);
  background:rgba(255,255,255,0.11);
  box-shadow:0 0 0 3px rgba(247,183,49,0.16);
}

.login-box button{
  width:100%;padding:16px;
  background:linear-gradient(135deg,#F7B731,#FF9F1C,#FF6B35);
  background-size:200% auto;
  color:#08090b!important;border:none;border-radius:12px;
  font-weight:800;font-size:16px;letter-spacing:0.5px;
  cursor:pointer;transition:all .3s;margin-top:4px;
  box-shadow:0 6px 24px rgba(247,183,49,0.28);
}
.login-box button:hover{
  background-position:right center;
  box-shadow:0 8px 32px rgba(247,183,49,0.42);
  transform:translateY(-1px);
}
.login-box button:active{transform:translateY(0)}

.login-footer{
  text-align:center;margin-top:20px;
  color:rgba(255,255,255,0.3);font-size:11px;letter-spacing:1px;
}

/* APP */
#app{display:none}

/* HEADER */
.header{background:white;padding:12px 20px;display:flex;align-items:center;justify-content:space-between;box-shadow:0 2px 8px rgba(0,0,0,0.08);position:sticky;top:0;z-index:100}
.header-left{display:flex;align-items:center;gap:12px}
.header-left h2{color:var(--azul);font-size:18px}
.header-left .menu-btn{background:none;border:none;font-size:24px;cursor:pointer;color:var(--azul);padding:4px}
.header-right{display:flex;align-items:center;gap:12px}
.header-right .user-name{font-size:13px;color:var(--gris)}
.header-right .tienda-badge{background:var(--azul-claro);color:var(--azul);padding:4px 12px;border-radius:20px;font-size:12px;font-weight:600}
.header-right .logout-btn{background:none;border:1px solid #ddd;border-radius:8px;padding:6px 14px;cursor:pointer;color:var(--gris);font-size:13px}

/* SIDEBAR */
.sidebar{position:fixed;left:-280px;top:0;bottom:0;width:280px;background:white;z-index:200;box-shadow:2px 0 20px rgba(0,0,0,0.1);transition:left .3s;overflow-y:auto}
.sidebar.open{left:0}
.sidebar-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.4);z-index:199;display:none}
.sidebar-overlay.show{display:block}
.sidebar-header{padding:20px;background:var(--azul);color:white!important}
.sidebar-sep{font-size:9px;font-weight:800;color:#a0aec0;text-transform:uppercase;letter-spacing:1.2px;padding:12px 20px 3px;pointer-events:none}
.sidebar-header h3{font-size:16px}
.sidebar-header p{font-size:12px;opacity:.8}
.sidebar-menu{padding:10px 0}
.sidebar-item{display:flex;align-items:center;gap:14px;padding:14px 20px;cursor:pointer;color:#555;transition:all .15s;border-left:3px solid transparent}
.sidebar-item:hover{background:var(--azul-claro);color:var(--azul)}
.sidebar-item.active{background:var(--azul-claro);color:var(--azul);border-left-color:var(--azul);font-weight:600}
.sidebar-item .icon{font-size:20px;width:28px;text-align:center}

/* MAIN */
.main{padding:16px;max-width:1200px;margin:0 auto;padding-bottom:100px}
.screen{display:none}
.screen.active{display:block}

/* CARDS */
.card{background:white;border-radius:14px;padding:20px;margin-bottom:16px;box-shadow:0 2px 8px rgba(0,0,0,0.06)}
.card-title{font-size:15px;font-weight:600;color:#444;margin-bottom:12px;display:flex;align-items:center;gap:8px}

/* DASHBOARD */
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:20px}
.stat-card{background:white;border-radius:14px;padding:18px;text-align:center;box-shadow:0 2px 8px rgba(0,0,0,0.06)}
.stat-card .stat-value{font-size:28px;font-weight:700;color:var(--azul);margin:6px 0}
.stat-card .stat-label{font-size:12px;color:var(--gris);text-transform:uppercase;letter-spacing:1px}
.stat-card .stat-icon{font-size:32px}
.stat-card.orange .stat-value{color:var(--naranja)}
.stat-card.green .stat-value{color:var(--verde)}
.stat-card.red .stat-value{color:var(--rojo)}
/* MULTI-TIENDA CARDS */
.tiendas-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:14px;margin-bottom:16px;margin-top:4px}
.tienda-card{background:white;border-radius:14px;padding:16px;box-shadow:0 2px 8px rgba(0,0,0,0.07);border-top:4px solid var(--azul);transition:box-shadow .2s}
.tienda-card:hover{box-shadow:0 4px 16px rgba(0,0,0,0.12)}
.tienda-card .tc-nombre{font-size:14px;font-weight:700;color:#1a237e;margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tienda-card .tc-tipo{font-size:11px;color:#888;margin-bottom:10px}
.tienda-card .tc-monto{font-size:22px;font-weight:800;color:#111;line-height:1}
.tienda-card .tc-sub{font-size:11px;color:#666;margin-top:2px;margin-bottom:8px}
.tienda-card .tc-row{display:flex;justify-content:space-between;font-size:12px;color:#555;padding:4px 0;border-top:1px solid #f0f0f0}
.tienda-card .tc-alerta{background:#fff3e0;border-radius:6px;padding:4px 8px;font-size:11px;color:#e65100;margin-top:6px}
.tc-sin-ventas .tc-monto{color:#bbb}
.dash-ver-mas{text-align:center;padding:10px 0}
.dash-empresa-banner{background:linear-gradient(135deg,#1a237e,#283593);color:white;border-radius:12px;padding:12px 20px;margin-bottom:8px;display:flex;flex-wrap:wrap;gap:12px 24px;align-items:center}
.dash-empresa-banner .deb-num{font-size:20px;font-weight:800;line-height:1.1}
.dash-empresa-banner .deb-label{font-size:11px;opacity:.75;text-transform:uppercase;letter-spacing:.5px}
.dash-empresa-banner .deb-item{min-width:90px;flex:1 1 90px}

/* TABLAS */
.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:14px}
th{text-align:left;padding:10px 12px;color:var(--gris);font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.5px;border-bottom:2px solid #eee}
td{padding:10px 12px;border-bottom:1px solid #f0f0f0}
tr:hover td{background:var(--gris-claro)}

/* BUTTONS */
.btn{padding:10px 20px;border:none;border-radius:8px;font-weight:600;font-size:14px;cursor:pointer;transition:all .15s;display:inline-flex;align-items:center;gap:6px}
.btn-primary{background:var(--azul);color:white!important}
.btn-primary:hover{background:var(--azul-oscuro)}
.btn-naranja{background:var(--naranja);color:white}
.btn-naranja:hover{background:#e55a2b}
.btn-verde{background:var(--azul);color:white!important}
.btn-rojo{background:var(--rojo);color:white}
.btn-gris{background:#e9ecef;color:#555}
.btn-sm{padding:6px 12px;font-size:12px}
.btn-lg{padding:14px 28px;font-size:16px}

/* FORMS */
.form-group{margin-bottom:14px}
.form-group label{display:block;font-size:13px;font-weight:600;color:#555;margin-bottom:4px}
.form-group input,.form-group select,.form-group textarea{width:100%;padding:10px 12px;border:2px solid #e0e0e0;border-radius:8px;transition:border .2s;background:white}
.form-group input:focus,.form-group select:focus{border-color:var(--azul);outline:none}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}

/* BADGES */
.badge{padding:3px 10px;border-radius:20px;font-size:11px;font-weight:600}
.badge-verde{background:#d4edda;color:#155724}
.badge-rojo{background:#f8d7da;color:#721c24}
.badge-azul{background:#cce5ff;color:#004085}
.badge-naranja{background:#fde2d3;color:#a64b00}
.badge-amarillo{background:#fff3cd;color:#856404}
.badge-gris{background:#e9ecef;color:#495057}

/* POS */
.pos-layout{display:grid;grid-template-columns:1fr 380px;gap:16px;min-height:calc(100vh - 80px)}

/* ── POS MOBILE: una columna, carrito como panel inferior ── */
@media (max-width: 700px) {
  .pos-layout {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    min-height: unset !important;
    position: relative;
  }
  .pos-products {
    padding-bottom: 70px !important; /* espacio para el botón flotante */
  }
  .pos-grid {
    max-height: calc(100vh - 220px) !important;
  }
  /* Carrito oculto por defecto en mobile — se abre como panel */
  .pos-cart {
    display: none !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 300 !important;
    border-radius: 18px 18px 0 0 !important;
    max-height: 80vh !important;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.18) !important;
    padding: 16px !important;
    overflow-y: auto !important;
  }
  .pos-cart.mobile-open {
    display: flex !important;
    flex-direction: column !important;
  }
  /* Botón flotante para abrir el carrito */
  #pos-carrito-fab {
    display: flex !important;
  }
}
@media (min-width: 701px) {
  #pos-carrito-fab { display: none !important; }
  .pos-cart { display: flex !important; }
}
.pos-products{background:white;border-radius:14px;padding:16px;box-shadow:0 2px 8px rgba(0,0,0,0.06)}
.pos-search{width:100%;padding:12px 16px;border:2px solid #e0e0e0;border-radius:10px;font-size:16px;margin-bottom:12px}
.pos-search:focus{border-color:var(--azul);outline:none}
.pos-grid{display:flex;flex-direction:column;gap:0;max-height:calc(100vh - 180px);overflow-y:auto}
.pos-item{background:white;border:none;border-bottom:1px solid #f0f0f0;border-radius:0;padding:11px 14px;text-align:left;cursor:pointer;transition:background .12s;display:flex;align-items:center;gap:10px}
.pos-item:first-child{border-radius:10px 10px 0 0}
.pos-item:last-child{border-radius:0 0 10px 10px;border-bottom:none}
.pos-item:hover{background:#f0f7ff}
.pos-item .name{font-size:13px;font-weight:600;color:#222;flex:1;line-height:1.3}
.pos-item .price{font-size:13px;font-weight:700;color:var(--naranja);white-space:nowrap}
.pos-item .code{font-size:10px;color:#bbb;white-space:nowrap}
.pos-item-photo{width:42px;height:42px;flex:0 0 42px;border-radius:9px;overflow:hidden;background:#f1f5f9;border:1px solid #e2e8f0;display:grid;place-items:center;font-size:21px;color:#94a3b8}
.pos-item-photo img{width:100%;height:100%;object-fit:cover;display:block}
.producto-lista-foto{width:62px;text-align:center;vertical-align:middle}
.producto-lista-thumb,.producto-lista-placeholder{width:44px;height:44px;border-radius:8px;object-fit:cover;display:inline-grid;place-items:center;background:#f1f5f9;border:1px solid #e2e8f0;color:#94a3b8;font-size:21px;vertical-align:middle}
.pos-cart{background:white;border-radius:14px;padding:16px;box-shadow:0 2px 8px rgba(0,0,0,0.06);display:flex;flex-direction:column;max-height:calc(100vh - 80px)}
.pos-cart-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.pos-cart-header h3{font-size:16px;color:var(--azul)}
.pos-cart-items{flex:1;overflow-y:auto;margin-bottom:12px}
.pos-cart-item{display:flex;justify-content:space-between;align-items:center;padding:8px 0;border-bottom:1px solid #f0f0f0;gap:8px}
.pos-cart-item .info{flex:1}
.pos-cart-item .pos-item-photo{width:38px;height:38px;flex:0 0 38px;font-size:18px}
.pos-cart-item .info .name{font-size:13px;font-weight:600}
.pos-cart-item .info .qty{font-size:11px;color:var(--gris)}
.pos-cart-item .actions{display:flex;align-items:center;gap:6px}
.pos-cart-item .actions button{width:28px;height:28px;border:none;border-radius:6px;cursor:pointer;font-weight:700}
.pos-cart-total{border-top:2px solid #eee;padding-top:12px}
.pos-cart-total .row{display:flex;justify-content:space-between;padding:4px 0;font-size:14px}
.pos-cart-total .row.total{font-size:20px;font-weight:700;color:var(--azul);border-top:1px solid #eee;padding-top:8px;margin-top:4px}
.pos-checkout-btn{width:100%;padding:16px;background:var(--naranja);color:white;border:none;border-radius:10px;font-size:18px;font-weight:700;cursor:pointer;margin-top:12px;transition:background .15s}
.pos-checkout-btn:hover{background:#e55a2b}
.pos-checkout-btn:disabled{background:#ccc;cursor:not-allowed}

/* MODAL */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.5);z-index:500;display:none;align-items:center;justify-content:center;padding:20px}
.modal-overlay.show{display:flex}
/* Weighing receives live serial frames. Keep its variable-height dialog
   anchored so status/preview updates never make it jump around the screen. */
.modal-overlay.anna-pesaje-stable-overlay{align-items:flex-start!important;justify-content:center!important;padding:12px!important;overflow:hidden!important}
.modal-overlay.anna-pesaje-stable-overlay>.modal{margin:0 auto!important;max-height:calc(100vh - 24px)!important;overflow-y:auto!important;transform:none!important}
.anna-pesaje-scale-row{flex:0 0 72px!important}
@media(max-width:480px){.modal-overlay.anna-pesaje-stable-overlay{padding:8px!important}.modal-overlay.anna-pesaje-stable-overlay>.modal{max-height:calc(100vh - 16px)!important}.anna-pesaje-scale-row{flex-basis:72px!important}}
.modal{background:white;border-radius:16px;width:100%;max-width:500px;max-height:90vh;overflow-y:auto;box-shadow:0 20px 60px rgba(0,0,0,0.2)}
.modal-header{padding:16px 20px;border-bottom:1px solid #eee;display:flex;justify-content:space-between;align-items:center}
.modal-header h3{font-size:18px}
.modal-body{padding:20px}
.modal-footer{padding:12px 20px;border-top:1px solid #eee;display:flex;justify-content:flex-end;gap:8px}

/* TOGGLE */
.toggle-wrap{display:flex;align-items:center;gap:10px}
.toggle{width:52px;height:28px;border-radius:14px;border:none;cursor:pointer;position:relative;transition:background .2s;padding:0}
.toggle.on{background:var(--verde)}
.toggle.off{background:#e53935}
.toggle::after{content:'';position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;background:white;transition:transform .2s;box-shadow:0 1px 3px rgba(0,0,0,0.2)}
.toggle.on::after{transform:translateX(24px)}
.toggle-label{font-size:13px;font-weight:600}

/* SEARCH */
.search-bar{display:flex;gap:8px;margin-bottom:16px}
.search-bar input{flex:1;padding:10px 14px;border:2px solid #e0e0e0;border-radius:8px}
.search-bar input:focus{border-color:var(--azul);outline:none}

/* Products search: photo lookup stays beside the input and never overlays the catalog. */
.products-search-bar{display:flex;align-items:center;gap:8px;width:100%;margin-bottom:16px}
.products-search-bar input{flex:1;min-width:0;width:auto}
.products-photo-search{position:static!important;display:inline-flex!important;flex:0 0 auto;align-items:center;justify-content:center;gap:5px;width:auto!important;min-width:46px;height:42px!important;margin:0!important;padding:0 12px!important;border:1px solid #0f7baa!important;border-radius:9px!important;background:#0f7baa!important;color:#fff!important;box-shadow:none!important;transform:none!important;white-space:nowrap;cursor:pointer;font-weight:700;line-height:1}
.products-photo-search:hover{background:#0a5c82!important}
.products-photo-label{display:inline}
@media (max-width:700px){
  .products-search-bar{display:grid!important;grid-template-columns:minmax(0,1fr) 46px;align-items:stretch;gap:6px;width:100%;}
  .products-search-bar input{width:100%!important;min-width:0;height:42px;}
  .products-photo-search{width:46px!important;min-width:46px!important;height:42px!important;padding:0!important;font-size:20px;}
  .products-photo-label{display:none!important}
}

/* RESPONSIVE */
.talla-pos-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:10px}
.talla-pos-btn{display:flex;flex-direction:column;align-items:center;padding:12px 8px;border:2px solid var(--azul);border-radius:10px;cursor:pointer;background:var(--azul-claro);transition:all.15s}
.talla-pos-btn:hover{background:var(--azul);color:white!important;transform:scale(1.05)}
.talla-pos-btn .talla-num{font-size:22px;font-weight:bold;color:var(--azul)}
.talla-pos-btn:hover .talla-num{color:white}
.talla-pos-btn .talla-stock{font-size:11px;color:var(--gris);margin-top:4px}
.talla-pos-btn:hover .talla-stock{color:rgba(255,255,255,.8)}



/* TABS */
.tabs{display:flex;gap:4px;margin-bottom:16px;background:#e9ecef;border-radius:10px;padding:4px;overflow-x:auto}
.tab{padding:8px 16px;border:none;border-radius:8px;cursor:pointer;font-size:13px;font-weight:600;color:var(--gris);background:transparent;white-space:nowrap;transition:all .15s}
.tab.active{background:white;color:var(--azul);box-shadow:0 1px 4px rgba(0,0,0,0.1)}

/* LOADING */
.loading{display:flex;align-items:center;justify-content:center;padding:40px;color:var(--gris)}
.spinner{width:32px;height:32px;border:3px solid #e0e0e0;border-top-color:var(--azul);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* TOAST */
.toast{position:fixed;bottom:20px;right:20px;max-width:min(460px,calc(100vw - 32px));box-sizing:border-box;padding:14px 24px;border-radius:12px;color:#fff;font-weight:700;line-height:1.35;z-index:999;animation:slideUp .3s;box-shadow:0 4px 20px rgba(0,0,0,0.22)}
.toast.success{background:var(--verde)}
.toast.error{background:var(--rojo)}
.toast.info{background:var(--azul)}
.toast.warning{background:#a16207;color:#fff} 
@media(max-width:600px){.toast{left:16px;right:16px;bottom:16px;max-width:none;text-align:center;padding:13px 16px}}
@keyframes slideUp{from{transform:translateY(40px);opacity:0}to{transform:translateY(0);opacity:1}}

/* CALZADO FORM */
.calzado-color-card{border:2px solid #e0e0e0;border-radius:12px;padding:12px;margin-bottom:12px;background:#fafafa}
.calzado-color-card .color-header{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.calzado-color-card .color-preview{width:32px;height:32px;border-radius:50%;border:2px solid #ddd;flex-shrink:0}
.calzado-color-card input[type="text"]{flex:1}
.calzado-color-card .tallas-grid{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.calzado-color-card .talla-btn{width:42px;height:42px;border:2px solid #ddd;border-radius:8px;background:white;font-size:14px;font-weight:600;cursor:pointer;transition:all .15s}
.calzado-color-card .talla-btn.selected{border-color:var(--azul);background:var(--azul);color:white!important}
.calzado-color-card .talla-btn:hover{border-color:var(--azul)}
.calzado-color-card .img-upload{display:flex;align-items:center;gap:8px;margin-top:8px}
.calzado-color-card .img-upload label{padding:6px 14px;background:#e8e8e8;border-radius:6px;cursor:pointer;font-size:13px;transition:background .15s}
.calzado-color-card .img-upload label:hover{background:#ddd}
.calzado-color-card .img-preview{width:60px;height:60px;border-radius:8px;object-fit:cover;border:1px solid #ddd}
.calzado-img-preview-wrap{position:relative;display:inline-block;width:60px;height:60px;margin:2px 0 0 2px}.calzado-img-preview-wrap .img-preview{display:block;width:60px;height:60px;border-radius:8px;object-fit:cover;border:1px solid #ddd}.calzado-img-remove{position:absolute;top:-8px;right:-8px;width:22px;height:22px;padding:0;border:2px solid #fff;border-radius:50%;background:#dc2626;color:#fff;font-size:16px;line-height:16px;font-weight:900;cursor:pointer;box-shadow:0 1px 4px rgba(0,0,0,.35);z-index:2}.calzado-img-remove:hover{background:#b91c1c;transform:scale(1.06)}
.calzado-color-list{list-style:none;padding:0;margin:10px 0}
.calzado-color-list li{display:flex;align-items:center;gap:10px;padding:8px 12px;background:white;border-radius:8px;margin-bottom:6px;border:1px solid #eee}
.calzado-color-list li .mini-preview{width:24px;height:24px;border-radius:50%;border:2px solid #ddd;flex-shrink:0}
.calzado-color-list li .tallas-badge{background:#e8f4fd;color:var(--azul);padding:2px 10px;border-radius:12px;font-size:12px;font-weight:600}
.btn-remove-color{color:var(--rojo);background:none;border:none;cursor:pointer;font-size:18px;padding:4px}
.rango-tallas{display:flex;gap:8px;margin:10px 0}
.rango-tallas button{flex:1;padding:10px;border:2px solid #e0e0e0;border-radius:8px;background:white;font-weight:600;cursor:pointer;transition:all .15s}
.rango-tallas button.active{border-color:var(--azul);background:#e8f4fd;color:var(--azul)}
.rango-tallas button:hover{border-color:var(--azul)}
/* RECEIPT */
.bill-receipt{font-family:'Courier New',monospace;font-size:12px;padding:16px;background:white;max-width:300px;margin:0 auto}
.bill-receipt h3{text-align:center;margin-bottom:8px}
.bill-receipt .line{border-top:1px dashed #333;margin:8px 0}
.bill-receipt .row{display:flex;justify-content:space-between}

.talla-input-group { display: flex; flex-direction: column; align-items: center; border: 1px solid #ddd; padding: 5px; border-radius: 4px; background: #f9f9f9; }
.talla-input-group label { font-weight: bold; font-size: 12px; margin-bottom: 2px; }
.talla-qty-input { width: 45px; text-align: center; border: 1px solid #ccc; border-radius: 3px; padding: 2px; font-size: 14px; }

.tienda-blocker-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(255,255,255,0.95);z-index:9999;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:20px}
.tienda-blocker-overlay .icon{font-size:64px;margin-bottom:16px}
.tienda-blocker-overlay h2{font-size:22px;color:#1e293b;margin:0 0 8px}
.tienda-blocker-overlay p{color:#64748b;margin:0 0 24px;max-width:360px}
.tienda-blocker-overlay .btn{font-size:16px;padding:14px 28px}


/* ── APARTADOS — Tabla responsiva móvil ── */
.apart-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
}
.apart-table-wrap table {
  min-width: 700px;
  width: 100%;
}

/* En móvil: ocultar tabla, mostrar cards */
.apart-card-list { display: none; }



#modal-generic{display:none;position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:9999;align-items:center;justify-content:center;padding:16px}
#modal-generic.show{display:flex}
#modal-generic .modal-box{background:var(--bg-card);border-radius:16px;width:100%;max-width:480px;max-height:90vh;overflow-y:auto;box-shadow:0 20px 60px rgba(0,0,0,.4)}
#modal-generic .modal-header{display:flex;align-items:center;justify-content:space-between;padding:18px 20px;border-bottom:1px solid rgba(255,255,255,.08)}
#modal-generic .modal-title{font-size:17px;font-weight:700;color:var(--txt)}
#modal-generic .modal-close{background:none;border:none;color:var(--txt-sec);font-size:22px;cursor:pointer;padding:0;line-height:1}
#modal-generic .modal-body{padding:20px}
#modal-generic .form-group{margin-bottom:14px}
#modal-generic .form-group label{display:block;font-size:12px;font-weight:600;color:var(--txt-sec);margin-bottom:5px;text-transform:uppercase;letter-spacing:.5px}
#modal-generic .form-group input,#modal-generic .form-group select,#modal-generic .form-group textarea{width:100%;padding:10px 12px;border:1px solid rgba(255,255,255,.12);border-radius:8px;background:var(--bg);color:var(--txt);font-size:14px;box-sizing:border-box}
#modal-generic .form-group input:focus,#modal-generic .form-group select:focus{outline:none;border-color:#2563eb}

/* ═══════════════════════════════════════════════
   HISTORIAL DE VENTAS — Listado de Facturas
   ═══════════════════════════════════════════════ */

/* Encabezado */
.hv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.hv-titulo {
  font-size: 16px;
  font-weight: 700;
  color: var(--azul, #1a73e8);
}
.hv-resumen {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #555;
}
#hv-total-dia-txt {
  font-weight: 700;
  color: #2e7d32;
}

/* Filtros */
.hv-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}
.hv-filtros select,
.hv-filtros input[type="text"],
.hv-filtros input[type="date"] {
  padding: 5px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: #333;
}
.hv-filtros input[type="text"] { min-width: 160px; }
.hv-btn-buscar, .hv-btn-limpiar {
  padding: 5px 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.hv-btn-buscar  { background: #1a73e8; color: #fff; }
.hv-btn-limpiar { background: #e5e7eb; color: #555; }

/* Controles arriba */
.hv-controles {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}
.hv-controles label { color: #555; }
.hv-controles input[type="number"] {
  width: 54px;
  padding: 4px 6px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  text-align: center;
}
.hv-btn-refresh {
  padding: 5px 10px;
  background: #f0f4ff;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #3730a3;
}
.hv-btn-refresh:hover { background: #e0e7ff; }

/* Tabla */
.hv-tabla-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}
.hv-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.hv-tabla thead th {
  background: #7CB342;
  color: #fff;
  font-weight: 600;
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid #558B2F;
}
.hv-tabla thead th:first-child { border-radius: 0; }
.hv-tabla tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s;
}
.hv-tabla tbody tr:hover { background: #f8fafc; }
.hv-tabla tbody tr.cancelada { opacity: 0.55; background: #fef2f2; }
.hv-tabla td {
  padding: 8px 10px;
  vertical-align: middle;
}

/* Número de factura + badge */
.hv-factura-num { font-weight: 700; font-size: 13px; }
.hv-badge {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: #546e7a;
}
.hv-badge.electronica { background: #1565C0; }
.hv-badge.cancelada   { background: #c62828; }

/* Total en rojo */
.hv-total { color: #c62828; font-weight: 700; white-space: nowrap; }
.hv-total.cancelada { text-decoration: line-through; opacity: 0.6; }

/* Productos comprados */
.hv-productos { margin: 0; padding-left: 14px; font-size: 11px; color: #444; }
.hv-productos li { margin-bottom: 2px; }

/* ── ACCIONES ── */
.hv-acciones {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 110px;
}
.hv-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  transition: filter 0.15s;
}
.hv-btn:hover { filter: brightness(0.92); }
.hv-btn-ver    { background: #e3f2fd; color: #1565C0; }
.hv-btn-editar { background: #fff8e1; color: #e65100; }
.hv-btn-anular { background: #fce4ec; color: #b71c1c; }

/* Dropdown */
.hv-dropdown {
  display: none;            /* OCULTO por defecto */
  position: absolute;
  top: 0;
  right: 115px;
  z-index: 9999;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0,0,0,.15);
  min-width: 190px;
  padding: 4px 0;
  flex-direction: column;
}
.hv-dropdown.show { display: flex; }
.hv-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: none;
  border: none;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s;
}
.hv-dropdown-item:hover { background: #f3f4f6; }
.hv-dropdown-item.danger { color: #b71c1c; }
.hv-dropdown-item.danger:hover { background: #fce4ec; }
.hv-dropdown-sep {
  height: 1px;
  background: #e5e7eb;
  margin: 3px 0;
}

/* Paginación */
.hv-paginacion {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 12px;
  justify-content: center;
}
.hv-pag-btn {
  padding: 5px 10px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  color: #333;
  transition: background 0.15s;
}
.hv-pag-btn:hover   { background: #e0e7ff; }
.hv-pag-btn.active  { background: #1a73e8; color: #fff; border-color: #1a73e8; font-weight: 700; }
.hv-pag-btn:disabled { opacity: 0.4; cursor: default; }
.hv-pag-info { font-size: 12px; color: #666; }

/* Modal bill receipt */
.bill-receipt { font-family: monospace; font-size: 13px; line-height: 1.6; }
.bill-receipt .line { border-top: 1px dashed #aaa; margin: 6px 0; }
.bill-receipt .row  { display: flex; justify-content: space-between; padding: 1px 0; }
.bill-receipt .row b { color: #111; }
.bill-receipt .total-row { font-size: 15px; font-weight: 700; color: #c62828; border-top: 2px solid #333; padding-top: 4px; margin-top: 4px; }

/* Responsive */



/* ── AVISO FREEMIUM ─────────────────────────────────────────── */
#banner-freemium {
  display: none;
  /* El aviso comparte el borde superior con el header. Debe quedar debajo
     del header para que "Salir" y los controles de sesión nunca queden
     cubiertos cuando el aviso de vencimiento está visible. */
  position: relative;
  z-index: 90;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
#banner-freemium.visible { display: flex; }
#banner-freemium.suave {
  background: linear-gradient(90deg, #fef3c7, #fde68a);
  color: #92400e;
  border-bottom: 1px solid #f59e0b;
}
#banner-freemium.fuerte {
  background: linear-gradient(90deg, #fee2e2, #fca5a5);
  color: #7f1d1d;
  border-bottom: 2px solid #ef4444;
}
#banner-freemium .bfr-btn {
  background: #0F7BAA;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
#banner-freemium .bfr-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.6;
  margin-left: 4px;
}
#modal-bloqueo {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.75);
  align-items: center;
  justify-content: center;
}
#modal-bloqueo.activo { display: flex; }
.bloqueo-box {
  background: #fff;
  border-radius: 20px;
  padding: 40px 32px;
  max-width: 440px;
  width: 92%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.bloqueo-box h2 { font-size: 22px; color: #1a1a2e; margin-bottom: 10px; }
.bloqueo-box p  { color: #64748b; font-size: 14px; line-height: 1.5; margin-bottom: 24px; }
.bloqueo-planes { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.bloqueo-plan-btn {
  display: block;
  background: #0F7BAA;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background .2s;
}
.bloqueo-plan-btn:hover { background: #0a5478; }
/* ─────────────────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════
   MOBILE LAYOUT FIX — evita pantalla en blanco en celular
   (viewport acumulado, zoom, safe-area iOS/Android)
   ═══════════════════════════════════════════════════════════ */
html, body {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}
body {
  height: 100dvh !important;
  height: -webkit-fill-available !important;
}
#app {
  min-height: 100dvh !important;
  min-height: -webkit-fill-available !important;
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
  flex-direction: column !important;
}
/* #app visible solo cuando el JS le da la clase app-visible —
   evita que el shell autenticado quede visible bajo la pantalla de login. */
#app.app-visible {
  display: flex !important;
}
#main-content {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  min-height: 0 !important;
}
.app-layout, .layout-container {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
}
/* Header no se salga */
.header {
  width: 100% !important;
  max-width: 100vw !important;
  box-sizing: border-box !important;
  position: sticky !important;
  top: 0 !important;
  /* El header debe ganar siempre al aviso de vencimiento. */
  z-index: 1000 !important;
}
#app .header .logout-btn {
  position: relative !important;
  z-index: 1001 !important;
  pointer-events: auto !important;
}
/* Main content ocupa todo el espacio restante */
.main-content, .content-area, #main-content, .main {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}
/* Safe area iOS notch/home indicator */
@supports (padding: env(safe-area-inset-bottom)) {
  body {
    padding-bottom: env(safe-area-inset-bottom) !important;
  }
  .header {
    padding-top: env(safe-area-inset-top) !important;
  }
}



/* ═══════════════════════════════════════
   MODAL PIN SUPERVISOR
   ═══════════════════════════════════════ */
#modal-pin-supervisor {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55); backdrop-filter: blur(3px);
}
#modal-pin-supervisor.show { display: flex; }
.pin-box {
  background: var(--fondo-card, #fff);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  padding: 28px 24px 20px;
  width: 320px; max-width: 94vw;
  text-align: center;
  animation: pinBounce .25s ease;
}
@keyframes pinBounce {
  0%   { transform: scale(.85); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}
.pin-icon { font-size: 38px; margin-bottom: 8px; }
.pin-title { font-size: 17px; font-weight: 700; margin-bottom: 4px; color: var(--txt, #222); }
.pin-subtitle { font-size: 12px; color: var(--txt-sec, #888); margin-bottom: 16px; }
.pin-dots {
  display: flex; justify-content: center; gap: 14px; margin-bottom: 20px;
}
.pin-dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--primario, #0F7BAA);
  background: transparent; transition: background .15s, transform .15s;
}
.pin-dot.filled {
  background: var(--primario, #0F7BAA);
  transform: scale(1.15);
}
.pin-dot.error { border-color: #e74c3c; background: #e74c3c; }
.pin-keypad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 14px;
}
.pin-key {
  padding: 14px 0; border-radius: 12px;
  border: 1.5px solid var(--borde, #e0e0e0);
  background: var(--fondo, #f8f9fa);
  font-size: 20px; font-weight: 700; cursor: pointer;
  transition: background .1s, transform .08s;
  color: var(--txt, #222);
  user-select: none;
}
.pin-key:active { background: var(--primario, #0F7BAA); color: #fff; transform: scale(.93); }
.pin-key.pin-del { font-size: 18px; }
.pin-key.pin-ok  { background: var(--primario, #0F7BAA); color: #fff; border-color: var(--primario, #0F7BAA); }
.pin-key.pin-ok:active { background: #085f84; }
.pin-error-msg { font-size: 12px; color: #e74c3c; min-height: 18px; margin-bottom: 6px; font-weight: 600; }
.pin-btn-cancel { 
  background: none; border: none; color: var(--txt-sec, #888);
  font-size: 13px; cursor: pointer; padding: 4px 12px;
  text-decoration: underline;
}



/* ── LAYOUT DESKTOP (sidebar siempre visible ≥900px) ── */


/* ── LAYOUT DESKTOP (sidebar fijo visible ≥900px) ── */


/* ── LAYOUT DESKTOP v3 (sidebar + header fijos, main con padding) ≥900px ── */


/* ── LAYOUT DESKTOP FINAL (sidebar fijo ≥900px) ── */
@media (min-width: 900px) {
  .sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    height: 100vh !important;
    width: 260px !important;
    z-index: 200 !important;
    transform: none !important;
    transition: none !important;
    box-shadow: 2px 0 10px rgba(0,0,0,0.08) !important;
    overflow-y: auto !important;
  }
  .sidebar-overlay { display: none !important; }
  /* Wrapper del contenido (header + main) desplazado a la derecha del sidebar */
  .header {
    position: fixed !important;
    top: 0 !important;
    left: 260px !important;
    right: 0 !important;
    width: calc(100vw - 260px) !important;
    box-sizing: border-box !important;
    z-index: 150 !important;
  }
  .main, #main-content {
    margin-left: 260px !important;
    padding-top: 72px !important;
    width: calc(100vw - 260px) !important;
    max-width: calc(100vw - 260px) !important;
    box-sizing: border-box !important;
    height: calc(100vh - 60px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  #btn-hamburguesa { display: none !important; }
}

.grafica-card{background:var(--bg-card);border-radius:12px;padding:14px 16px;margin-bottom:12px;box-shadow:0 1px 4px rgba(0,0,0,.08)}
.grafica-title{font-size:12px;font-weight:700;color:#555;text-transform:uppercase;letter-spacing:.6px;margin-bottom:10px;display:flex;align-items:center;gap:8px}
.grafica-leyenda{display:flex;gap:16px;margin-bottom:8px;flex-wrap:wrap}
.grafica-leyenda span{font-size:11px;display:flex;align-items:center;gap:4px}
.grafica-svg-wrap{width:100%;overflow-x:auto}
.grafica-svg-wrap svg{min-width:400px;width:100%}


/* ── Gráfica ventas hoy vs ayer ── */
.graf-wrap{background:#fff;border-radius:12px;padding:14px 16px;margin-bottom:12px;box-shadow:0 1px 4px rgba(0,0,0,.08)}
.graf-titulo{font-size:12px;font-weight:700;color:#444;text-transform:uppercase;letter-spacing:.6px;margin-bottom:10px;display:flex;align-items:center;gap:8px}
.graf-leyenda{display:flex;gap:14px;margin-left:auto}
.graf-leg-item{display:flex;align-items:center;gap:4px;font-size:11px;font-weight:600}
.graf-leg-dot{width:10px;height:10px;border-radius:50%}
.graf-canvas-wrap{position:relative;height:120px;display:flex;align-items:flex-end;gap:2px;padding:0 2px}
.graf-col{display:flex;flex-direction:column;align-items:center;flex:1;gap:2px;cursor:default}
.graf-bars{display:flex;gap:1px;align-items:flex-end;width:100%;height:100px}
.graf-bar-hoy{background:#1a73e8;border-radius:3px 3px 0 0;min-height:2px;transition:height .3s;flex:1}
.graf-bar-ayer{background:#e0e0e0;border-radius:3px 3px 0 0;min-height:2px;transition:height .3s;flex:1}
.graf-col:hover .graf-bar-hoy{background:#1557b0}
.graf-col:hover .graf-bar-ayer{background:#bdbdbd}
.graf-hora{font-size:9px;color:#999;margin-top:2px;text-align:center}
.graf-tooltip{position:fixed;background:rgba(30,30,30,.92);color:#fff;padding:6px 10px;border-radius:8px;font-size:11px;pointer-events:none;z-index:9999;display:none;line-height:1.6}
.graf-empty{text-align:center;color:#bbb;font-size:12px;padding:30px 0}

/* ── Sidebar compacto en pantallas pequeñas (≤900px alto) ── */
@media (max-height: 900px) {
  .sidebar-item {
    padding: 9px 16px !important;
    font-size: 13px !important;
  }
  .sidebar-header {
    padding: 12px 16px !important;
  }
  .sidebar-header h3 {
    font-size: 15px !important;
    margin-bottom: 2px !important;
  }
}
@media (max-height: 768px) {
  .sidebar-item {
    padding: 7px 14px !important;
    font-size: 12px !important;
    gap: 10px !important;
  }
  .sidebar-section-label {
    padding: 4px 14px 2px !important;
    font-size: 9px !important;
  }
  .sidebar-header {
    padding: 8px 14px !important;
  }
  .sidebar-header h3 {
    font-size: 14px !important;
    margin: 0 0 1px !important;
  }
  .sidebar-header p {
    font-size: 10px !important;
    margin: 0 !important;
  }
}

/* Listado de facturas: resumen ejecutivo compacto */
.hv-resumen-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:8px;margin:8px 0 12px}.hv-kpi{display:flex;align-items:center;gap:9px;padding:10px 12px;border:1px solid #e5e7eb;border-radius:10px;background:linear-gradient(135deg,#fff,#f8fafc);min-width:0}.hv-kpi-icon{font-size:20px}.hv-kpi small{display:block;color:#64748b;font-size:10px;text-transform:uppercase;letter-spacing:.4px}.hv-kpi strong{display:block;color:#0f172a;font-size:16px;margin-top:2px;white-space:nowrap}.hv-kpi.money strong{color:#166534}.hv-kpi.danger strong{color:#b91c1c}.hv-table-wrap{overflow:auto;border:1px solid #e5e7eb;border-radius:10px}.hv-table{width:100%;border-collapse:separate;border-spacing:0;font-size:12px;background:#fff}.hv-table th{position:sticky;top:0;background:#f8fafc;color:#475569;font-size:10px;text-transform:uppercase;letter-spacing:.35px;padding:10px 9px;border-bottom:1px solid #e2e8f0;white-space:nowrap}.hv-table td{padding:10px 9px;border-bottom:1px solid #f1f5f9;vertical-align:top}.hv-table tbody tr:hover{background:#f8fbff}.hv-table tbody tr.cancelada{background:#fff7f7}.hv-table .hv-total{font-size:13px}
@media(max-width:700px){.hv-resumen-cards{grid-template-columns:repeat(2,1fr)}.hv-kpi{padding:8px}.hv-kpi strong{font-size:13px}.hv-filtros{display:grid;grid-template-columns:1fr 1fr}.hv-filtros input[type=text]{grid-column:1/-1;width:auto;min-width:0}.hv-table{min-width:900px}}

.inv-intel-strip{display:grid;grid-template-columns:repeat(6,minmax(105px,1fr));gap:8px;margin:0 0 10px}.inv-intel-card{background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:10px 11px;min-width:0}.inv-intel-card b{display:block;font-size:16px;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.inv-intel-card small{display:block;margin-top:3px;color:#64748b;font-size:10px;text-transform:uppercase;letter-spacing:.35px}.inv-intel-card.warn{border-color:#f5cf78;background:#fffbeb}.inv-intel-card.warn b{color:#a16207}.inv-intel-card.danger{border-color:#f3b5b5;background:#fff7f7}.inv-intel-card.danger b{color:#b91c1c}.inv-intel-card.money b{color:#166534;font-size:14px}.inv-complement-note{display:block;margin-top:5px;padding:6px 8px;border-left:3px solid #d97706;border-radius:5px;background:#fffbeb;color:#92400e;font-size:11px;line-height:1.35;max-width:380px}.inv-complement-note span{color:#78350f}.inv-complement-note b{font-weight:700}.badge-naranja{background:#fff3cd;color:#8a5a00;border:1px solid #f0b429}
.inv-transfer-note,.prod-transfer-note{display:block;margin-top:5px;padding:5px 7px;border-left:3px solid #2563eb;border-radius:5px;background:rgba(37,99,235,.08);color:#1d4ed8;font-size:11px;line-height:1.35;max-width:360px}.inv-transfer-note strong,.prod-transfer-note strong{font-weight:700}.inv-transfer-note span,.prod-transfer-note span{color:#475569}.inv-transfer-note code,.prod-transfer-note code{font-size:10px;color:#1e40af}.inv-stock-insightpadding:9px 12px;border-radius:8px;background:#f0f9ff;color:#075985;font-size:12px;margin-bottom:10px;border:1px solid #bae6fd}.inv-talla-vacia{opacity:.55;background:#fef2f2!important;text-decoration:line-through}.inv-talla-vacia small{color:#b91c1c!important}@media(max-width:900px){.inv-intel-strip{grid-template-columns:repeat(3,1fr)}}@media(max-width:520px){.inv-intel-strip{grid-template-columns:repeat(2,1fr)}.inv-intel-card b{font-size:14px}}
.inv-multi-head{display:flex;justify-content:space-between;padding:14px;background:#f0f9ff;border:1px solid #bae6fd;border-radius:10px;margin-bottom:10px}.inv-multi-list{display:grid;gap:7px}.inv-multi-row{display:grid;grid-template-columns:1.2fr 110px 2fr 1fr;align-items:center;gap:10px;padding:12px;border:1px solid #e5e7eb;border-radius:9px;background:#fff}.inv-store-pill{display:inline-block;margin:2px;padding:4px 7px;border-radius:5px;background:#ecfdf5;color:#166534;font-size:11px}@media(max-width:800px){.inv-multi-row{grid-template-columns:1fr 1fr}.inv-multi-row div,.inv-multi-row small{grid-column:1/-1}}
.inv-alert-grid{display:grid;grid-template-columns:repeat(5,minmax(130px,1fr));gap:12px;margin:16px 0}.inv-alert-card{display:flex;gap:10px;align-items:center;padding:14px;border-radius:12px;background:#f6f8fb;border:1px solid #e5e9f0}.inv-alert-card b{display:block;font-size:24px}.inv-alert-card span{display:block;font-size:12px;color:#687386}.inv-alert-card.danger{border-left:4px solid #dc3545}.inv-alert-card.warning{border-left:4px solid #f0ad00}.inv-alert-card.info{border-left:4px solid #2674d9}.inv-alert-icon{font-size:22px}@media(max-width:800px){.inv-alert-grid{grid-template-columns:repeat(2,1fr)}}


/* Cerebro Operativo — acabado visual ejecutivo y móvil */
#dash-cerebro-global{border:0!important;border-radius:20px!important;padding:20px!important;background:linear-gradient(135deg,#f8fbff 0%,#ffffff 55%,#f5f3ff 100%)!important;box-shadow:0 10px 30px rgba(30,64,175,.10)!important;overflow:hidden}
#dash-cerebro-global .card{border:1px solid rgba(148,163,184,.20)!important;border-radius:16px!important;background:rgba(255,255,255,.88)!important;box-shadow:0 5px 18px rgba(15,23,42,.06)!important;padding:16px!important}
#dash-cerebro-global .card-title{font-size:14px;font-weight:800;color:#1e293b;margin-bottom:8px;display:flex;align-items:center;gap:7px}
#dash-cerebro-global .stats-grid{gap:10px!important}
#dash-cerebro-global .stat-card{border:1px solid #dbeafe!important;border-radius:15px!important;background:linear-gradient(145deg,#fff,#eff6ff)!important;box-shadow:none!important;padding:14px!important;min-height:92px}
#dash-cerebro-global .stat-card.orange{background:linear-gradient(145deg,#fff7ed,#ffedd5)!important;border-color:#fed7aa!important}
#dash-cerebro-global .stat-card.red{background:linear-gradient(145deg,#fff1f2,#ffe4e6)!important;border-color:#fecdd3!important}
#dash-cerebro-global .stat-card.green{background:linear-gradient(145deg,#f0fdf4,#dcfce7)!important;border-color:#bbf7d0!important}
#dash-cerebro-global .stat-icon{font-size:22px;margin-bottom:5px}
#dash-cerebro-global .stat-value{font-size:20px;font-weight:850;color:#172554}
#dash-cerebro-global .stat-label{font-size:11px;color:#64748b;font-weight:650}
#dash-cerebro-global .empty-state{padding:16px 4px;color:#64748b;font-size:12px;text-align:center}
#dash-cerebro-global #btn-radar-tendencias{transition:transform .18s,box-shadow .18s;font-weight:700}
#dash-cerebro-global #btn-radar-tendencias:hover{transform:translateY(-1px);box-shadow:0 6px 16px rgba(79,70,229,.18)}
@media(max-width:600px){#dash-cerebro-global{padding:14px!important;border-radius:16px!important;margin:10px 0!important}#dash-cerebro-global .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}#dash-cerebro-global .stat-card{min-height:82px;padding:11px!important}#dash-cerebro-global .stat-value{font-size:17px}#dash-cerebro-global .card{padding:13px!important}}


/* ═══ UPGRADE DE PLAN — límite de tiendas/cajeros ═══ */
#modal-upgrade-plan{
  position:fixed;
  inset:0;
  z-index:10050;
  display:none;
  align-items:center;
  justify-content:center;
  padding:16px;
  background:rgba(15,23,42,.68);
  backdrop-filter:blur(3px);
}
#modal-upgrade-plan.activo{display:flex!important}
#modal-upgrade-plan .upgrade-box{
  position:relative;
  width:min(100%,520px);
  max-height:calc(100vh - 32px);
  overflow-y:auto;
  padding:26px 22px 20px;
  border-radius:20px;
  background:#fff;
  color:#1e293b;
  box-shadow:0 24px 70px rgba(0,0,0,.28);
  text-align:center;
}
#modal-upgrade-plan .upgrade-icon{font-size:44px;line-height:1;margin-bottom:8px}
#modal-upgrade-plan h2{margin:0;color:#172554;font-size:21px;line-height:1.25}
#modal-upgrade-plan .upgrade-sub{margin:9px auto 16px;color:#64748b;font-size:14px;line-height:1.45;max-width:440px}
#modal-upgrade-plan .upgrade-planes{display:grid;gap:10px;text-align:left;margin:0 0 14px}
#modal-upgrade-plan .upgrade-plan-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 15px;
  border:2px solid #e2e8f0;
  border-radius:12px;
  background:#fff;
  color:#1e293b;
  transition:border-color .15s,background .15s,transform .15s,box-shadow .15s;
}
#modal-upgrade-plan .upgrade-plan-item:not(.actual){cursor:pointer}
#modal-upgrade-plan .upgrade-plan-item:not(.actual):hover,
#modal-upgrade-plan .upgrade-plan-item:not(.actual):focus-visible{
  border-color:#6c63ff;
  background:#f5f3ff;
  transform:translateY(-1px);
  box-shadow:0 5px 14px rgba(108,99,255,.14);
  outline:none;
}
#modal-upgrade-plan .upgrade-plan-item.actual{background:#f8fafc;border-color:#cbd5e1;cursor:default}
#modal-upgrade-plan .plan-nombre{font-size:15px;font-weight:800;color:#1e293b;line-height:1.25}
#modal-upgrade-plan .plan-nombre small{font-size:10px;color:#64748b;font-weight:600}
#modal-upgrade-plan .plan-detalle{margin-top:4px;font-size:12px;color:#64748b;line-height:1.35}
#modal-upgrade-plan .plan-precio{font-size:16px;font-weight:850;color:#4f46e5;white-space:nowrap;text-align:right}
#modal-upgrade-plan .plan-accion{display:block;margin-top:4px;font-size:11px;font-weight:700;color:#6c63ff;white-space:nowrap;text-align:right}
#modal-upgrade-plan .upgrade-plan-item.actual .plan-precio{color:#64748b}
#modal-upgrade-plan .upgrade-plan-item.actual .plan-accion{color:#64748b}
#modal-upgrade-plan .upgrade-btn-comprar{
  width:100%;
  border:0;
  border-radius:10px;
  padding:13px 16px;
  background:linear-gradient(135deg,#f97316,#ea580c);
  color:#fff;
  font-size:14px;
  font-weight:800;
  cursor:pointer;
  box-shadow:0 5px 14px rgba(234,88,12,.22);
}
#modal-upgrade-plan .upgrade-btn-comprar:hover{filter:brightness(1.05)}
#modal-upgrade-plan .upgrade-btn-cerrar{
  margin-top:12px;
  padding:9px 18px;
  border:0;
  border-radius:8px;
  background:#f1f5f9;
  color:#475569;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
}
@media(max-width:600px){
  #modal-upgrade-plan{padding:10px}
  #modal-upgrade-plan .upgrade-box{max-height:calc(100vh - 20px);padding:22px 15px 16px;border-radius:16px}
  #modal-upgrade-plan h2{font-size:19px}
  #modal-upgrade-plan .upgrade-plan-item{padding:12px 11px;gap:8px}
  #modal-upgrade-plan .plan-precio{font-size:14px}
}


/* Radar de tendencias: galería visual iniciada por el administrador */
#modal-radar-tendencias{display:none;position:fixed;inset:0;z-index:10050;background:rgba(15,23,42,.60);align-items:center;justify-content:center;padding:16px}
#modal-radar-tendencias.activo{display:flex}
.radar-tendencias-box{width:min(920px,100%);max-height:min(86vh,760px);overflow:auto;background:#fff;border-radius:20px;box-shadow:0 24px 80px rgba(15,23,42,.28);padding:20px}
.radar-tendencias-header{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:16px;color:#172554;font-size:20px;font-weight:850}
.radar-tendencias-header small{display:block;color:#64748b;font-size:12px;font-weight:500;margin-top:4px}
.radar-tendencias-cerrar{border:0;background:#f1f5f9;color:#475569;border-radius:9px;width:34px;height:34px;cursor:pointer;font-size:18px}
.radar-tendencias-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:14px}
.radar-tendencia-card{overflow:hidden;border:1px solid #e2e8f0;border-radius:14px;background:#fff;box-shadow:0 4px 14px rgba(15,23,42,.07);min-width:0}
.radar-tendencia-card img{display:block;width:100%;height:150px;object-fit:cover;background:#f8fafc}
.radar-tendencia-nombre{padding:10px 11px;color:#1e293b;font-size:12px;line-height:1.35;font-weight:700;min-height:48px}
.radar-tendencias-cargando,.radar-tendencias-vacio,.radar-tendencias-error{grid-column:1/-1;text-align:center;padding:54px 20px;color:#475569;display:flex;flex-direction:column;align-items:center;gap:10px}
.radar-tendencias-cargando small{color:#94a3b8;font-size:12px;font-weight:400}
.radar-tendencias-error{color:#b91c1c;background:#fff1f2;border-radius:12px}
.radar-spinner{width:30px;height:30px;border:3px solid #c7d2fe;border-top-color:#4f46e5;border-radius:50%;animation:radarSpin .8s linear infinite}
.radar-tendencias-footer{margin-top:16px;padding-top:12px;border-top:1px solid #e2e8f0;color:#94a3b8;font-size:11px;text-align:center}
.radar-tendencia-card.sin-imagen{display:none}
@keyframes radarSpin{to{transform:rotate(360deg)}}
@media(max-width:600px){#modal-radar-tendencias{padding:8px}.radar-tendencias-box{padding:14px;border-radius:16px;max-height:92vh}.radar-tendencias-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.radar-tendencia-card img{height:135px}}


/* Radar: selección dinámica de tienda y categoría antes de consultar internet */
.radar-selector-wrap{display:flex;flex-direction:column;gap:12px}
.radar-filtro-label{display:flex;flex-direction:column;gap:6px;color:#334155;font-size:12px;font-weight:800}
.radar-tienda-select{width:100%;border:1px solid #cbd5e1;border-radius:10px;padding:10px;background:#fff;color:#1e293b;font-size:14px}
.radar-tienda-activa{padding:11px 13px;border-radius:10px;background:#eff6ff;color:#1e40af;font-size:13px;font-weight:800}
.radar-categorias-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px}
.radar-categoria-btn{display:flex;flex-direction:column;align-items:flex-start;gap:5px;padding:13px;border:1px solid #c7d2fe;border-radius:12px;background:#eef2ff;color:#3730a3;text-align:left;cursor:pointer;font-size:14px;font-weight:800;transition:transform .15s,box-shadow .15s,border-color .15s}
.radar-categoria-btn:hover,.radar-categoria-btn:focus-visible{transform:translateY(-1px);border-color:#6366f1;box-shadow:0 5px 14px rgba(79,70,229,.16);outline:none}
.radar-categoria-btn small{color:#64748b;font-size:11px;font-weight:600}
.radar-filtro-divider{display:flex;align-items:center;gap:10px;color:#94a3b8;font-size:11px;margin:2px 0}.radar-filtro-divider:before,.radar-filtro-divider:after{content:"";height:1px;background:#e2e8f0;flex:1}
.radar-busqueda-libre{display:flex;gap:8px}.radar-busqueda-libre input{flex:1;min-width:0;border:1px solid #cbd5e1;border-radius:10px;padding:11px 12px;font-size:13px}.radar-busqueda-libre input:focus{outline:2px solid #c7d2fe;border-color:#6366f1}
.radar-btn-principal,.radar-btn-secundario{border:0;border-radius:9px;padding:10px 13px;cursor:pointer;font-weight:800;font-size:12px}.radar-btn-principal{background:#4f46e5;color:#fff}.radar-btn-secundario{background:#eef2f7;color:#475569;border:1px solid #cbd5e1}.radar-btn-principal:hover{background:#4338ca}.radar-ayuda-filtro{color:#94a3b8;font-size:11px;line-height:1.4}.radar-tendencias-actions{display:flex;justify-content:center;gap:9px;flex-wrap:wrap;margin-top:14px}
@media(max-width:600px){.radar-busqueda-libre{flex-direction:column}.radar-categorias-grid{grid-template-columns:1fr}.radar-tendencias-actions{flex-direction:column}.radar-btn-principal,.radar-btn-secundario{width:100%}}


/* Parent product units dashboard — universal, not part of the footwear module. */
.units-dashboard{padding:4px 2px 16px;color:#1e293b}.units-dashboard-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;padding:4px 0 14px;border-bottom:1px solid #e2e8f0}.units-kicker{font-size:10px;letter-spacing:.12em;color:#64748b;font-weight:800}.units-dashboard-head h3{margin:3px 0 2px;font-size:22px;color:#0f3d5e}.units-dashboard-head p{margin:0;color:#64748b;font-size:12px}.units-focus-note{margin:12px 0;padding:10px 12px;border-radius:10px;background:#eff6ff;border:1px solid #bfdbfe;color:#1e40af;font-size:12px}.units-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:14px 0}.units-card{padding:13px 14px;border:1px solid #e2e8f0;border-radius:12px;background:#fff;box-shadow:0 2px 8px rgba(15,23,42,.05)}.units-card span{display:block;font-size:11px;color:#64748b;font-weight:700}.units-card strong{display:block;margin-top:5px;color:#0f3d5e;font-size:20px}.units-card small{display:block;margin-top:3px;color:#64748b}.units-card.primary{background:linear-gradient(135deg,#eff6ff,#fff);border-color:#93c5fd}.units-card.danger{background:#fff7ed;border-color:#fed7aa}.units-card.danger strong{color:#c2410c}.units-sources{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:8px 0 14px;font-size:11px;color:#475569}.units-source{padding:4px 8px;border-radius:999px;background:#f1f5f9;border:1px solid #e2e8f0}.units-actions{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;border-radius:12px;background:#f8fafc;border:1px solid #dbeafe}.units-actions h4,.units-section h4{margin:0;color:#0f3d5e}.units-actions p,.units-section-head p{margin:4px 0 0;font-size:11px;color:#64748b}.units-action-buttons{display:flex;gap:7px}.units-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.units-form-grid label{display:block;font-size:11px;font-weight:700;color:#475569}.units-form-grid input{display:block;margin-top:5px;width:100%}.units-section{margin-top:16px;padding-top:12px;border-top:1px solid #e2e8f0}.units-section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:8px}.units-count{white-space:nowrap;padding:5px 9px;border-radius:999px;background:#e0f2fe;color:#075985;font-size:11px;font-weight:800}.units-table{width:100%;border-collapse:collapse;font-size:11px}.units-table th{background:#f8fafc;color:#475569;text-align:left;font-size:10px;text-transform:uppercase;letter-spacing:.04em}.units-table th,.units-table td{padding:8px 7px;border-bottom:1px solid #e2e8f0;vertical-align:top}.units-table td small{color:#64748b}.units-chip{display:inline-block;margin-top:3px;padding:2px 6px;border-radius:999px;background:#fef3c7;color:#92400e;font-size:10px;font-weight:700}.units-history-scroll{max-height:270px;overflow:auto;border:1px solid #e2e8f0;border-radius:9px}.units-dashboard .btn{white-space:nowrap}@media(max-width:760px){.units-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.units-actions{align-items:stretch;flex-direction:column}.units-action-buttons{width:100%}.units-action-buttons .btn{flex:1}.units-form-grid{grid-template-columns:1fr}.units-table{min-width:680px}}


/* Universal scale connector */
.anna-scale-shell{max-width:1080px;color:#1e293b}.anna-scale-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;padding:4px 0 16px;border-bottom:1px solid #e2e8f0}.anna-scale-kicker{font-size:10px;letter-spacing:.14em;font-weight:900;color:#0f7baa}.anna-scale-head h2{margin:3px 0;font-size:24px;color:#0f3d5e}.anna-scale-head p{margin:0;color:#64748b;font-size:13px}.anna-scale-status{display:inline-flex;align-items:center;white-space:nowrap;padding:8px 12px;border-radius:999px;font-weight:800;font-size:12px;background:#f1f5f9;color:#64748b}.anna-scale-status.ok{background:#dcfce7;color:#166534}.anna-scale-status.warn{background:#fef3c7;color:#92400e}.anna-scale-status.error{background:#fee2e2;color:#991b1b}.anna-scale-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;margin-top:14px}.anna-scale-card{padding:16px}.anna-scale-card label{display:block;font-size:12px;font-weight:800;color:#475569;margin:10px 0}.anna-scale-card input,.anna-scale-card select,.anna-scale-card textarea{display:block;box-sizing:border-box;width:100%;margin-top:5px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;padding:9px;font:inherit;color:#1e293b}.anna-scale-card textarea{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px}.anna-scale-check{display:flex!important;align-items:center;gap:8px}.anna-scale-check input{width:auto;margin:0}.anna-scale-connection-info{padding:9px 10px;background:#eff6ff;border:1px solid #bfdbfe;border-radius:8px;font-size:12px;color:#1e40af;font-weight:800;margin:10px 0}.anna-scale-buttons{display:flex;flex-wrap:wrap;gap:7px;margin-top:14px}.anna-scale-help{font-size:11px;line-height:1.4;color:#64748b;margin-top:10px}.anna-scale-reading{font-size:42px;font-weight:900;text-align:center;color:#0f7baa;padding:20px 8px 6px}.anna-scale-stability{text-align:center;font-size:13px;font-weight:800;color:#166534;min-height:22px}.anna-scale-meta{margin-top:14px;padding:10px;border-radius:8px;background:#f8fafc;font-size:11px;color:#475569;line-height:1.7}.anna-scale-raw{min-height:72px;max-height:150px;overflow:auto;margin:10px 0;padding:10px;border-radius:8px;background:#0f172a;color:#d1fae5;font-size:11px;white-space:pre-wrap;word-break:break-all}.anna-scale-profile-actions{display:flex;align-items:center;gap:12px;color:#64748b;font-size:12px}.anna-scale-foot{margin-top:12px;padding:10px 12px;border-radius:8px;background:#f8fafc;color:#64748b;font-size:11px;line-height:1.4}@media(max-width:760px){.anna-scale-grid{grid-template-columns:1fr}.anna-scale-head{flex-direction:column}.anna-scale-reading{font-size:34px}.anna-scale-profile-actions{align-items:flex-start;flex-direction:column}}


/* ═══════════════════════════════════════════════════════════════════════════
   LECTURA CLARA / ACCESIBILIDAD — ANNA
   La información principal no debe depender de una vista perfecta. Estos
   tamaños son una base legible; el botón 👁️ permite ampliarlos aún más.
   ═══════════════════════════════════════════════════════════════════════════ */
html.ui-readable body{font-size:16px;line-height:1.38}
html.ui-readable .header-left h2{font-size:20px!important}
html.ui-readable .header-right .user-name{font-size:14px!important}
html.ui-readable .sidebar-item{font-size:15px!important;padding-top:15px!important;padding-bottom:15px!important}
html.ui-readable .sidebar-item .icon{font-size:21px!important}
html.ui-readable .sidebar-sep{font-size:11px!important}
html.ui-readable .main{padding:20px!important}
html.ui-readable .screen h2{font-size:24px!important;line-height:1.25}
html.ui-readable .screen h3{font-size:20px!important;line-height:1.3}
html.ui-readable .screen h4{font-size:17px!important;line-height:1.35}
html.ui-readable .screen .card-title{font-size:18px!important;font-weight:800!important;color:#163b5a!important}
html.ui-readable .screen .page-header{margin-bottom:18px!important}
html.ui-readable .screen .page-header h2{font-weight:850!important}
html.ui-readable .screen .btn{font-size:15px!important;min-height:42px;padding:10px 16px!important}
html.ui-readable .screen .btn.btn-sm{font-size:13px!important;min-height:36px;padding:8px 13px!important}
html.ui-readable .screen table{font-size:15px!important}
html.ui-readable .screen th{font-size:13px!important;padding:12px 11px!important;font-weight:850!important}
html.ui-readable .screen td{font-size:14px!important;padding:12px 11px!important}
html.ui-readable .screen .form-group label{font-size:15px!important;font-weight:750!important}
html.ui-readable .screen input,html.ui-readable .screen select,html.ui-readable .screen textarea{font-size:16px!important;min-height:42px}
html.ui-readable .screen .empty-state{font-size:15px!important}
html.ui-readable .screen .badge{font-size:13px!important;padding:5px 10px!important;font-weight:800!important}
/* POS: product, weight, total and main actions are intentionally prominent. */
html.ui-readable .pos-search{font-size:19px!important;min-height:48px!important;font-weight:650!important}
html.ui-readable .pos-item .name{font-size:17px!important;font-weight:800!important}
html.ui-readable .pos-item .price{font-size:16px!important;font-weight:850!important}
html.ui-readable .pos-cart-header h3{font-size:20px!important}
html.ui-readable .pos-cart-total .total{font-size:20px!important;font-weight:900!important}
html.ui-readable .pos-checkout-btn{font-size:18px!important;min-height:52px!important;font-weight:900!important}
html.ui-readable #pesaje-qty{font-size:40px!important;font-weight:900!important}
html.ui-readable #pesaje-confirmar-btn{font-size:18px!important;min-height:52px!important}
/* Inventory and labels: the screenshot's small inline helper styles are
   overridden so tab names, search, product rows and primary actions stand out. */
html.ui-readable .inv-wrap .inv-header h2,html.ui-readable .inv-wrap .inv-header h3{font-size:24px!important;font-weight:900!important}
html.ui-readable .inv-wrap .inv-tab{font-size:14px!important;font-weight:800!important;min-height:42px!important;padding:10px 13px!important}
html.ui-readable .inv-wrap .inv-section-header h3,html.ui-readable .inv-wrap .inv-advanced-head h3{font-size:20px!important;font-weight:900!important}
html.ui-readable .inv-wrap .inv-input,html.ui-readable .inv-wrap .inv-select{font-size:16px!important;min-height:44px!important;padding:10px 12px!important}
html.ui-readable .inv-wrap .inv-btn-prim,html.ui-readable .inv-wrap .inv-btn-sec,html.ui-readable .inv-wrap .inv-btn-warn{font-size:15px!important;min-height:42px!important;padding:10px 15px!important;font-weight:850!important}
html.ui-readable .inv-wrap .inv-intel-card b{font-size:20px!important;font-weight:900!important}
html.ui-readable .inv-wrap .inv-intel-card small,html.ui-readable .inv-wrap .inv-subtitle{font-size:13px!important}
html.ui-readable .inv-wrap .inv-tabla{font-size:15px!important}
html.ui-readable .inv-wrap .inv-tabla th{font-size:13px!important;padding:12px 10px!important}
html.ui-readable .inv-wrap .inv-tabla td{font-size:14px!important;padding:11px 10px!important}
html.ui-readable .inv-wrap .etq-config-box h4,html.ui-readable .inv-wrap .etq-preview-box h4{font-size:15px!important;letter-spacing:.3px!important}
html.ui-readable .inv-wrap .etq-cfg-row label,html.ui-readable .inv-wrap .etq-chk{font-size:14px!important;font-weight:700!important}
html.ui-readable .inv-wrap .etq-cfg-row input,html.ui-readable .inv-wrap .etq-cfg-row select{font-size:15px!important;min-height:40px!important}
html.ui-readable .inv-wrap .etq-prod-item{font-size:15px!important;padding:12px 14px!important}
html.ui-readable .inv-wrap .etq-tabla{font-size:14px!important}
html.ui-readable .inv-wrap .etq-tabla th{font-size:13px!important;padding:10px!important}
html.ui-readable .inv-wrap .etq-tabla td{font-size:14px!important;padding:9px!important}
html.ui-readable .inv-wrap .etq-info-zpl{font-size:13px!important;line-height:1.45}
/* Inline 10–12px captions remain readable in operational screens. */
html.ui-readable .inv-wrap [style*="font-size:10px"],html.ui-readable .inv-wrap [style*="font-size:11px"],html.ui-readable .inv-wrap [style*="font-size:12px"]{font-size:14px!important;line-height:1.35!important}
/* High-visibility focus and primary states. */
html.ui-readable button:focus-visible,html.ui-readable input:focus-visible,html.ui-readable select:focus-visible,html.ui-readable textarea:focus-visible{outline:3px solid #f59e0b!important;outline-offset:2px!important}
html.ui-readable .btn-primary,html.ui-readable .inv-btn-prim,html.ui-readable .inv-btn-warn,html.ui-readable .btn-imprimir,html.ui-readable .btn-excel{font-weight:900!important;box-shadow:0 2px 8px rgba(15,123,170,.22)}
@media(max-width:700px){html.ui-readable .sidebar-item{font-size:16px!important}html.ui-readable .screen h2{font-size:22px!important}html.ui-readable .screen .card-title{font-size:17px!important}html.ui-readable .inv-wrap .inv-tab{font-size:13px!important;padding:9px 10px!important}html.ui-readable .main{padding:14px!important}}


/* Dashboard: legible line chart for hourly sales */
.graf-line-legend{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin:4px 0 8px;color:#334155;font-size:13px;font-weight:800}
.graf-line-legend span{display:inline-flex;align-items:center;gap:5px}
.graf-dot-hoy,.graf-dot-ayer{display:inline-block;width:11px;height:11px;border-radius:50%}
.graf-dot-hoy{background:#0f7baa}.graf-dot-ayer{background:#94a3b8}
.graf-line-note{font-size:11px!important;color:#64748b!important;font-weight:600!important}
.anna-line-chart{display:block;width:100%;height:285px;min-height:240px;background:linear-gradient(180deg,#fff,#f8fbfe);border:1px solid #dbe5ef;border-radius:12px;overflow:visible}
@media(max-width:700px){.anna-line-chart{height:240px;min-height:210px}.graf-line-legend{font-size:12px;gap:9px}.graf-line-note{width:100%}}


/* ═══════════════════════════════════════════════════════════════════════════
   ASISTENTE ANNA — Centro de ayuda y operación con alcance por permisos
   ═══════════════════════════════════════════════════════════════════════════ */
#anna-ai-launcher{position:fixed;right:22px;bottom:24px;z-index:10020;width:62px;height:62px;border:0;border-radius:50%;background:linear-gradient(135deg,#0f7baa,#063f5e);color:#fff;font-size:30px;display:none;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 8px 26px rgba(6,63,94,.38);transition:transform .18s,box-shadow .18s}
#anna-ai-launcher:hover{transform:translateY(-3px);box-shadow:0 12px 32px rgba(6,63,94,.5)}
#anna-ai-panel{position:fixed;right:22px;bottom:98px;z-index:10021;width:min(440px,calc(100vw - 28px));height:min(680px,calc(100vh - 124px));display:none;flex-direction:column;overflow:hidden;background:#fff;border:1px solid #bfdbfe;border-radius:18px;box-shadow:0 18px 60px rgba(15,23,42,.28);color:#172033}
.anna-ai-head{display:flex;justify-content:space-between;gap:12px;padding:18px 18px 15px;background:linear-gradient(135deg,#0f3d5e,#0f7baa);color:#fff}
.anna-ai-kicker{font-size:10px;letter-spacing:.16em;font-weight:900;color:#bae6fd}.anna-ai-head h2{font-size:20px;margin:4px 0}.anna-ai-head p{font-size:12px;margin:0;color:#dbeafe}.anna-ai-close{width:34px;height:34px;border:1px solid #ffffff66;border-radius:50%;background:#ffffff1a;color:#fff;font-size:25px;line-height:1;cursor:pointer}
.anna-ai-messages{flex:1;overflow:auto;padding:15px;background:linear-gradient(180deg,#f8fbff,#fff)}
.anna-ai-welcome{display:flex;flex-direction:column;gap:7px;padding:15px;border:1px solid #dbeafe;border-radius:13px;background:#eff6ff;color:#1e3a5f;font-size:14px;line-height:1.45}.anna-ai-welcome b{font-size:17px}.anna-ai-chips,.anna-ai-suggestions{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}.anna-ai-chips button,.anna-ai-suggestions button{border:1px solid #93c5fd;border-radius:20px;padding:7px 10px;background:#fff;color:#075985;font-weight:750;font-size:12px;cursor:pointer}
.anna-ai-msg{max-width:92%;margin:8px 0;padding:11px 13px;border-radius:13px;font-size:14px;line-height:1.45;white-space:pre-wrap}.anna-ai-msg.user{margin-left:auto;background:#0f7baa;color:#fff;border-bottom-right-radius:4px}.anna-ai-msg.assistant{background:#fff;border:1px solid #e2e8f0;color:#172033;border-bottom-left-radius:4px;box-shadow:0 2px 8px #0f172a0b}.anna-ai-msg.loading{color:#64748b;font-style:italic}.anna-ai-answer{font-weight:600}.anna-ai-review-table{width:100%;margin-top:10px;border-collapse:collapse;font-size:12px;background:#f8fafc;border:1px solid #dbe4ee;border-radius:8px;overflow:hidden}.anna-ai-review-table th,.anna-ai-review-table td{padding:6px 7px;border-bottom:1px solid #e2e8f0;text-align:left;vertical-align:top}.anna-ai-review-table th{width:42%;color:#334155;font-weight:850;background:#eef6fa}.anna-ai-review-table tr:last-child th,.anna-ai-review-table tr:last-child td{border-bottom:0}.anna-ai-meta{margin-top:9px;color:#64748b;font-size:11px;line-height:1.35}.anna-ai-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:10px}.anna-ai-action{margin-top:0;border:0;border-radius:8px;padding:9px 12px;background:#0f7baa;color:#fff;font-weight:850;cursor:pointer}.anna-ai-cancel{border:1px solid #cbd5e1;border-radius:8px;padding:8px 12px;background:#fff;color:#475569;font-weight:800;cursor:pointer}.anna-ai-cancel:hover{border-color:#ef4444;color:#b91c1c;background:#fff7f7}.anna-ai-draft-label{font-size:12px;color:#64748b;font-weight:800}.anna-ai-edit-cell{display:flex;width:100%;align-items:center;justify-content:space-between;gap:5px;border:1px dashed transparent;border-radius:5px;padding:4px;background:transparent;color:#172033;text-align:left;font:inherit;cursor:pointer}.anna-ai-edit-cell:hover,.anna-ai-edit-cell:focus-visible{border-color:#60a5fa;background:#eff6ff;outline:0}.anna-ai-edit-cell span{color:#0f7baa;font-size:13px}.anna-ai-compose{padding:12px;border-top:1px solid #e2e8f0;background:#fff;display:flex;gap:8px;align-items:flex-end}.anna-ai-compose textarea{flex:1;resize:none;min-height:44px;max-height:100px;padding:10px 11px;border:2px solid #cbd5e1;border-radius:10px;font-size:15px;font-family:inherit;color:#172033}.anna-ai-compose textarea:focus{border-color:#0f7baa;outline:3px solid #bfdbfe}.anna-ai-compose button{min-height:44px;border:0;border-radius:10px;padding:9px 13px;background:#0f7baa;color:#fff;font-size:14px;font-weight:900;cursor:pointer}.anna-ai-compose button:disabled{opacity:.55;cursor:wait}.anna-ai-compose #anna-ai-clear{background:#f1f5f9;color:#475569;font-size:12px;padding:7px 9px;min-height:36px}.anna-ai-compose #anna-ai-clear:not(:disabled):hover{background:#e2e8f0}
html.ui-readable #anna-ai-panel{width:min(480px,calc(100vw - 24px))}.ui-readable .anna-ai-head h2{font-size:22px}.ui-readable .anna-ai-msg{font-size:15px}.ui-readable .anna-ai-welcome{font-size:15px}.ui-readable .anna-ai-compose textarea{font-size:17px}.ui-readable .anna-ai-compose button{font-size:16px}
@media(max-width:600px){#anna-ai-launcher{right:15px;bottom:18px;width:58px;height:58px}#anna-ai-panel{right:12px;bottom:86px;height:min(680px,calc(100vh - 104px))}}
.anna-ai-feedback{display:flex;align-items:center;gap:5px;margin-top:9px;color:#64748b;font-size:11px}.anna-ai-feedback button{width:28px;height:26px;border:1px solid #cbd5e1;border-radius:7px;background:#fff;cursor:pointer;font-size:14px}.anna-ai-feedback button:hover{background:#eff6ff;border-color:#60a5fa}
/* El asistente no debe tapar el botón flotante del carrito en POS. */
#anna-ai-launcher{left:22px;right:auto}
#anna-ai-panel{left:22px;right:auto}
@media(max-width:600px){#anna-ai-launcher{left:12px;right:auto}#anna-ai-panel{left:12px;right:auto}}
/* El cerebro queda discreto para no competir con el POS; se enfatiza al usarlo. */
#anna-ai-launcher{width:46px;height:46px;font-size:23px;opacity:.52;background:linear-gradient(135deg,#2e8fb3,#0f3d5e);box-shadow:0 4px 14px rgba(6,63,94,.22);transition:opacity .18s,transform .18s,box-shadow .18s}
#anna-ai-launcher:hover,#anna-ai-launcher:focus-visible,#anna-ai-launcher.anna-ai-open{opacity:1;transform:scale(1.08);box-shadow:0 8px 24px rgba(6,63,94,.4)}
@media(max-width:600px){#anna-ai-launcher{width:42px;height:42px;font-size:21px}}
/* Burbuja discreta: avisa a la tienda origen que hay una solicitud POS. */
#anna-transfer-bubble{position:fixed;left:22px;bottom:82px;z-index:10019;width:min(340px,calc(100vw - 30px));padding:14px 15px;border:1px solid #93c5fd;border-left:5px solid #0f7baa;border-radius:13px;background:#fff;box-shadow:0 10px 32px rgba(15,23,42,.18);color:#172033;animation:annaBubbleIn .22s ease-out}
#anna-transfer-bubble .anna-transfer-kicker{font-size:10px;font-weight:900;color:#0f7baa;letter-spacing:.08em;margin-bottom:5px}
#anna-transfer-bubble .anna-transfer-title{font-size:15px;font-weight:900;line-height:1.25}
#anna-transfer-bubble .anna-transfer-detail{font-size:13px;font-weight:750;color:#334155;margin-top:5px}
#anna-transfer-bubble .anna-transfer-note{font-size:12px;color:#64748b;line-height:1.35;margin:8px 0 10px}
#anna-transfer-bubble button{border:0;border-radius:8px;padding:9px 12px;background:#0f7baa;color:#fff;font-size:13px;font-weight:850;cursor:pointer}
@keyframes annaBubbleIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:600px){#anna-transfer-bubble{left:12px;bottom:70px;width:calc(100vw - 24px)}}

/* Tabla de revisión interactiva: cada espacio se puede escribir o dictar. */
.anna-ai-review-table caption{text-align:left;padding:8px 9px;color:#075985;font-size:11px;font-weight:900;background:#e0f2fe;caption-side:top}
.anna-ai-cell-edit{display:flex;align-items:center;gap:5px;width:100%;min-width:0}
.anna-ai-cell-input{flex:1;min-width:0;width:100%;padding:7px 8px;border:1px solid #cbd5e1;border-radius:7px;background:#fff;color:#172033;font:inherit;font-size:12px}
.anna-ai-cell-input:focus{border-color:#0f7baa;outline:3px solid #bfdbfe}
.anna-ai-cell-edit button,.anna-ai-table-open{border:1px solid #93c5fd;border-radius:7px;padding:6px 8px;background:#eff6ff;color:#075985;font-weight:900;cursor:pointer;white-space:nowrap}
.anna-ai-cell-edit button:hover,.anna-ai-table-open:hover{background:#dbeafe;border-color:#0f7baa}
.anna-ai-cell-save{background:#0f7baa!important;color:#fff!important;border-color:#0f7baa!important}
.anna-ai-cell-edit button:disabled{opacity:.55;cursor:wait}
.anna-ai-table-open{font-size:12px}
@media(max-width:600px){.anna-ai-cell-edit{gap:3px}.anna-ai-cell-input{font-size:13px;padding:8px 6px}.anna-ai-cell-edit button{padding:7px 6px}}

/* ── COMPROBANTES EN CELULAR ───────────────────────────────────────
   La tabla original desbordaba el ancho y dejaba Acciones recortado.
   En pantallas táctiles cada comprobante se convierte en una tarjeta
   legible, sin cambiar la información ni los permisos. */
@media (max-width: 700px) {
  #screen-comprobantes .comp-page { padding: 12px !important; }
  #screen-comprobantes .comp-list-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
  }
  #screen-comprobantes .comp-list-header > div:first-child {
    width: 100%;
    min-width: 0;
    align-items: flex-start !important;
  }
  #screen-comprobantes .comp-list-header h2 {
    font-size: 18px !important;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
  #screen-comprobantes .comp-list-header > div:last-child {
    width: 100%;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px !important;
  }
  #screen-comprobantes .comp-list-header button {
    width: 100% !important;
    min-height: 44px;
    padding: 10px 8px !important;
    touch-action: manipulation;
  }
  #screen-comprobantes .comp-filters {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px !important;
    padding: 14px !important;
    align-items: end !important;
  }
  #screen-comprobantes .comp-filters > div { min-width: 0; }
  #screen-comprobantes .comp-filters input {
    width: 100% !important;
    min-height: 44px;
    box-sizing: border-box;
    padding: 8px !important;
  }
  #screen-comprobantes .comp-filters button {
    width: 100%;
    min-height: 44px;
    padding: 9px 8px !important;
    touch-action: manipulation;
  }
  #screen-comprobantes .comp-limit {
    justify-content: flex-start !important;
    margin: 2px 0 8px !important;
  }
  #screen-comprobantes .comp-limit input {
    min-height: 40px;
    box-sizing: border-box;
  }
  #screen-comprobantes .comp-table-wrap {
    overflow: visible !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  #screen-comprobantes .comp-table-wrap table {
    display: block !important;
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 10px !important;
  }
  #screen-comprobantes .comp-table-wrap thead { display: none !important; }
  #screen-comprobantes .comp-table-wrap tbody {
    display: grid !important;
    width: 100%;
    gap: 0;
  }
  #screen-comprobantes .comp-table-wrap tr {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 118px;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    padding: 12px;
    background: var(--bg-card, #fff);
    border: 1px solid rgba(148,163,184,.35) !important;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(15,23,42,.10);
  }
  #screen-comprobantes .comp-table-wrap td {
    display: block !important;
    min-width: 0;
    padding: 0 !important;
    border: 0 !important;
    color: var(--txt, #172033) !important;
    overflow-wrap: anywhere;
  }
  #screen-comprobantes .comp-table-wrap td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    font-size: 14px !important;
    line-height: 1.35;
  }
  #screen-comprobantes .comp-table-wrap td:nth-child(1)::before {
    content: 'FECHA DEL COMPROBANTE';
    display: block;
    margin-bottom: 3px;
    color: var(--txt-sec, #64748b);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .04em;
  }
  #screen-comprobantes .comp-table-wrap td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    padding-top: 8px !important;
    font-size: 14px !important;
    line-height: 1.35;
  }
  #screen-comprobantes .comp-table-wrap td:nth-child(2)::before {
    content: 'COMENTARIO INTERNO';
    display: block;
    margin-bottom: 3px;
    color: var(--txt-sec, #64748b);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .04em;
  }
  #screen-comprobantes .comp-table-wrap td:nth-child(3) {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    text-align: center !important;
    position: relative;
  }
  #screen-comprobantes .comp-table-wrap td:nth-child(3) > div {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    width: 100% !important;
    position: relative;
  }
  #screen-comprobantes .comp-table-wrap td:nth-child(3) button {
    width: 100% !important;
    min-width: 0;
    min-height: 44px;
    box-sizing: border-box;
    padding: 9px 5px !important;
    font-size: 12px !important;
    line-height: 1.15;
    white-space: normal;
    touch-action: manipulation;
  }
  #screen-comprobantes .comp-table-wrap td:nth-child(3) [id^='comp-drop-'] {
    left: auto !important;
    right: 0 !important;
    width: 205px !important;
    min-width: 0 !important;
    max-width: calc(100vw - 28px) !important;
    z-index: 10000 !important;
  }
  #screen-comprobantes .comp-table-wrap td:nth-child(3) [id^='comp-drop-'] button {
    text-align: left !important;
    min-height: 44px;
    white-space: nowrap;
  }
  #screen-comprobantes .comp-table-wrap > div {
    padding: 18px 8px !important;
    background: transparent !important;
  }
}
.sidebar-item, #screen-comprobantes button { touch-action: manipulation; }

/* ANNA help: no generic floating help. The assistant lives in the header and opens only on demand. */
.anna-ai-header-slot{display:inline-flex;align-items:center;min-width:0}
#anna-ai-launcher.anna-ai-header-entry{position:static!important;left:auto!important;right:auto!important;bottom:auto!important;width:auto!important;height:36px!important;min-height:36px!important;padding:7px 11px!important;border:1px solid #b9d7e4!important;border-radius:10px!important;background:transparent!important;color:#0f3d5e!important;opacity:1!important;box-shadow:none!important;transform:none!important;font-size:12px!important;font-weight:850!important;gap:6px!important;white-space:nowrap}
#anna-ai-launcher.anna-ai-header-entry:hover,#anna-ai-launcher.anna-ai-header-entry:focus-visible,#anna-ai-launcher.anna-ai-header-entry.anna-ai-open{background:#eff8fb!important;border-color:#0f7baa!important;color:#075985!important;box-shadow:0 2px 8px rgba(15,123,170,.12)!important;transform:none!important;outline:2px solid #d5eef7!important;outline-offset:1px}
.anna-ai-launcher-label{display:inline}
body.dark #anna-ai-launcher.anna-ai-header-entry{border-color:#36576a!important;color:#dbeafe!important;background:transparent!important}
body.dark #anna-ai-launcher.anna-ai-header-entry:hover,body.dark #anna-ai-launcher.anna-ai-header-entry:focus-visible{background:#1a2d3d!important;border-color:#60a5fa!important;color:#dbeafe!important}
@media(max-width:700px){.anna-ai-launcher-label{display:none}#anna-ai-launcher.anna-ai-header-entry{width:36px!important;padding:7px 8px!important;justify-content:center;font-size:18px!important}.anna-ai-header-slot{margin-right:2px}}

/* ANNA assistant panel follows the header on demand. It is not a permanent floating help bubble. */
#anna-ai-panel{top:72px!important;right:20px!important;left:auto!important;bottom:auto!important;height:min(680px,calc(100dvh - 88px))!important;max-height:calc(100dvh - 88px)!important}
@media(max-width:899px){
  #anna-ai-panel{top:calc(env(safe-area-inset-top,0px) + 82px)!important;left:10px!important;right:10px!important;bottom:10px!important;width:auto!important;height:calc(100dvh - env(safe-area-inset-top,0px) - 102px)!important;max-height:calc(100dvh - env(safe-area-inset-top,0px) - 102px)!important;border-radius:16px!important}
}
@media(max-width:380px){
  #anna-ai-panel{top:calc(env(safe-area-inset-top,0px) + 78px)!important;left:8px!important;right:8px!important;max-height:calc(100dvh - env(safe-area-inset-top,0px) - 96px)!important}
}

/* ANNA composer: the question field must stay readable on touch screens. */
.anna-ai-compose{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:8px!important}
.anna-ai-compose textarea{display:block!important;width:100%!important;min-width:0!important;flex:0 0 auto!important;box-sizing:border-box!important;min-height:56px!important}
.anna-ai-compose-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:6px;width:100%}
#anna-ai-speech-status{width:100%;min-height:0;line-height:1.35}
@media(max-width:600px){
  .anna-ai-compose{padding:10px!important;gap:7px!important}
  .anna-ai-compose textarea{min-height:58px!important;max-height:120px!important;font-size:16px!important}
  .anna-ai-compose-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  .anna-ai-compose-actions button{width:100%;min-width:0!important;padding:8px 5px!important;font-size:12px!important;white-space:nowrap}
  .anna-ai-compose-actions #anna-ai-send{grid-column:1/-1}
}

/* ANNA welcome: examples without exact button vocabulary. */
.anna-ai-welcome-hint{font-size:12px;line-height:1.35;color:#47627a}
body.dark .anna-ai-welcome-hint{color:#a9c4d8}

/* ANNA map: explore the full capability catalog only on demand. */
.anna-ai-map-msg{max-width:96%!important}
.anna-ai-map-title{font-size:16px;font-weight:900;color:#0f3d5e;margin-bottom:5px}
.anna-ai-map-intro{font-size:12px;line-height:1.45;color:#64748b;margin:0 0 10px}
.anna-ai-map-group{border-top:1px solid #e2e8f0;padding:8px 0 0;margin-top:7px}
.anna-ai-map-group summary{cursor:pointer;list-style:none;color:#075985;font-size:12px;font-weight:900;display:flex;align-items:center;justify-content:space-between;gap:8px}
.anna-ai-map-group summary::-webkit-details-marker{display:none}
.anna-ai-map-group summary:before{content:'›';font-size:18px;line-height:12px;transition:transform .15s}
.anna-ai-map-group[open] summary:before{transform:rotate(90deg)}
.anna-ai-map-group summary span{margin-left:auto;padding:2px 7px;border-radius:999px;background:#e0f2fe;color:#075985;font-size:10px}
.anna-ai-map-list{display:flex;flex-wrap:wrap;gap:5px;margin-top:7px;padding-left:17px}
.anna-ai-map-list button{border:1px solid #bfdbfe;border-radius:8px;padding:7px 9px;background:#fff;color:#075985;font-size:11px;font-weight:750;cursor:pointer;text-align:left}
.anna-ai-map-list button:hover,.anna-ai-map-list button:focus{background:#eff6ff;border-color:#0f7baa;outline:2px solid #dbeafe}
.anna-ai-map-empty{font-size:12px;color:#64748b}
body.dark .anna-ai-map-title{color:#dbeafe}body.dark .anna-ai-map-intro{color:#aebdca}body.dark .anna-ai-map-group{border-top-color:#334155}body.dark .anna-ai-map-list button{background:#1e293b;color:#dbeafe;border-color:#36576a}body.dark .anna-ai-map-list button:hover{background:#1a2d3d}
@media(max-width:600px){.anna-ai-map-msg{max-width:100%!important}.anna-ai-map-list{padding-left:0}.anna-ai-map-list button{flex:1 1 calc(50% - 5px);min-width:0}}

/* Resumen de escalamiento de ANNA: visible, copiable y sin envío automático. */
.anna-ai-escalation{margin-top:10px;border:1px solid #fbbf24;border-radius:11px;background:#fffbeb;color:#713f12;overflow:hidden}.anna-ai-escalation summary{padding:9px 10px;cursor:pointer;font-weight:850;color:#92400e}.anna-ai-escalation-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:0 10px 8px}.anna-ai-escalation-facts div{display:flex;flex-direction:column;gap:2px;min-width:0}.anna-ai-escalation-facts b{font-size:10px;text-transform:uppercase;letter-spacing:.03em;color:#a16207}.anna-ai-escalation-facts span{font-size:12px;line-height:1.35;overflow-wrap:anywhere}.anna-ai-escalation pre{margin:0 10px 8px;padding:9px;border:1px solid #fde68a;border-radius:8px;background:#fffef5;color:#422006;white-space:pre-wrap;overflow-wrap:anywhere;font:11px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace}.anna-ai-escalation-copy{margin:0 10px 8px;border:0;border-radius:8px;padding:8px 10px;background:#b45309;color:#fff;font-weight:850;cursor:pointer}.anna-ai-escalation small{display:block;padding:0 10px 10px;color:#92400e;font-size:10px;line-height:1.35}@media(max-width:520px){.anna-ai-escalation-facts{grid-template-columns:1fr}}

.anna-ai-escalation-actions{display:flex;gap:7px;flex-wrap:wrap;margin:0 10px 8px}.anna-ai-escalation-actions .anna-ai-escalation-copy{margin:0}.anna-ai-escalation-secondary{border:1px solid #d97706;border-radius:8px;padding:8px 10px;background:#fff;color:#92400e;font-weight:850;cursor:pointer}.anna-ai-escalation-secondary:hover{background:#fffbeb}

/* Mobile: make every actionable control respond immediately to a tap. */
button, .btn, [role="button"]{
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}


/* ANNA: motivos de comprobantes — modal responsive y accesible */
#comp-modal-motivos .comp-motivos-backdrop{
  position:fixed;inset:0;z-index:10050;display:flex;align-items:center;justify-content:center;
  padding:16px;background:rgba(15,23,42,.58);box-sizing:border-box;
}
#comp-modal-motivos .comp-motivos-dialog{
  display:flex;flex-direction:column;width:min(520px,100%);max-height:min(86vh,720px);
  overflow:hidden;background:#fff!important;color:#26323D!important;border-radius:16px;
  box-shadow:0 20px 60px rgba(0,0,0,.32);box-sizing:border-box;
}
#comp-modal-motivos .comp-motivos-header{
  flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:15px 20px;background:#0F7BAA!important;color:#fff!important;
  border-radius:16px 16px 0 0;box-sizing:border-box;
}
#comp-modal-motivos .comp-motivos-header h3{margin:0;color:#fff!important;font-size:17px;line-height:1.25;font-weight:750;}
#comp-modal-motivos .comp-motivos-close{
  display:inline-flex!important;align-items:center;justify-content:center;width:30px!important;height:30px!important;
  min-height:30px!important;padding:0!important;border:1px solid rgba(255,255,255,.35)!important;
  border-radius:50%!important;background:rgba(255,255,255,.16)!important;color:#fff!important;
  font-size:17px!important;line-height:1!important;cursor:pointer;white-space:nowrap!important;
}
#comp-modal-motivos .comp-motivos-scroll{min-height:0;overflow-y:auto;overflow-x:hidden;}
#comp-modal-motivos .comp-motivos-body{padding:18px 20px 20px;box-sizing:border-box;}
#comp-modal-motivos .comp-motivos-form{
  display:grid;grid-template-columns:minmax(0,1fr) 64px auto;align-items:end;gap:8px;margin-bottom:7px;
}
#comp-modal-motivos .comp-motivos-field{display:block;min-width:0;margin:0;color:#475569!important;font-size:11px!important;font-weight:750!important;}
#comp-modal-motivos .comp-motivos-field>span{display:block;margin:0 0 5px;color:#475569!important;font-size:11px!important;font-weight:750!important;line-height:1.2;}
#comp-modal-motivos .comp-motivos-field input{
  display:block;width:100%!important;min-width:0!important;height:42px!important;min-height:42px!important;
  box-sizing:border-box!important;padding:9px 10px!important;border:1px solid #B8C7D5!important;
  border-radius:8px!important;background:#fff!important;color:#26323D!important;font-size:14px!important;
  outline:none!important;box-shadow:none!important;
}
#comp-modal-motivos .comp-motivos-field input:focus{border-color:#0F7BAA!important;box-shadow:0 0 0 3px rgba(15,123,170,.16)!important;}
#comp-modal-motivos .comp-motivos-field input::placeholder{color:#8795A1!important;opacity:1!important;}
#comp-modal-motivos .comp-motivos-icon-field input{text-align:center;font-size:20px!important;padding:7px 2px!important;}
#comp-modal-motivos .comp-motivos-add{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:4px;
  width:auto!important;min-width:108px!important;height:42px!important;min-height:42px!important;
  box-sizing:border-box!important;padding:0 13px!important;border:0!important;border-radius:8px!important;
  background:#0F7BAA!important;color:#fff!important;font-size:13px!important;font-weight:750!important;
  line-height:1!important;white-space:nowrap!important;cursor:pointer;
}
#comp-modal-motivos .comp-motivos-add:hover{background:#0b668d!important;}
#comp-modal-motivos .comp-motivos-hint{margin:0 0 13px;color:#64748B!important;font-size:11px!important;line-height:1.35;}
#comp-modal-motivos .comp-motivo-row{
  display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 7px;padding:10px 12px;
  min-height:44px;box-sizing:border-box;background:#F8FAFC!important;border:1px solid #E2E8F0!important;
  border-radius:8px;color:#334155!important;font-size:14px!important;
}
#comp-modal-motivos .comp-motivo-name{display:flex;align-items:center;gap:8px;min-width:0;overflow-wrap:anywhere;}
#comp-modal-motivos .comp-motivo-icon{display:inline-flex;align-items:center;justify-content:center;width:22px;flex:0 0 22px;font-size:18px;line-height:1;}
#comp-modal-motivos .comp-motivo-remove{
  flex:0 0 auto;min-height:30px;padding:5px 9px!important;border:1px solid #F5C6CB!important;border-radius:6px!important;
  background:#FFF1F2!important;color:#9F1239!important;font-size:12px!important;line-height:1.1!important;
  white-space:nowrap!important;cursor:pointer;
}
#comp-modal-motivos .comp-motivo-remove:hover{background:#FFE4E6!important;border-color:#E11D48!important;}
#comp-modal-motivos .comp-motivos-empty{text-align:center;margin:20px 0;color:#64748B!important;font-size:13px!important;}
@media (max-width:520px){
  #comp-modal-motivos .comp-motivos-backdrop{padding:10px;}
  #comp-modal-motivos .comp-motivos-dialog{max-height:90vh;}
  #comp-modal-motivos .comp-motivos-form{grid-template-columns:minmax(0,1fr) 60px;}
  #comp-modal-motivos .comp-motivos-add{grid-column:1 / -1;width:100%!important;}
}
