:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --line: #d5deea;
  --text: #0f172a;
  --muted: #475569;
  --brand: #1d4ed8;
}
html, body { max-width: 100%; overflow-x: hidden; }
body { font-family: Arial, sans-serif; margin: 0; padding: 8px; background: var(--bg); color: var(--text); line-height: 1.25; font-size: 13px; box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }
.hidden { display: none !important; }
.app-header { margin-bottom: 6px; }
.app-header h1 { margin: 0; font-size: 20px; }
.app-header-subtitle { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
.app-header-signature { margin: 3px 0 0; font-size: 10px; color: #334155; line-height: 1.25; }
.bloque { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 8px; margin-bottom: 7px; box-shadow: 0 1px 1px rgba(15,23,42,.04); }
h2 { margin: 0 0 6px; font-size: 15px; }
h3 { margin: 8px 0 4px; font-size: 13px; }
p { margin: 4px 0; }
input, button, select, summary { font-size: 12px; padding: 5px 7px; margin: 2px 0; border-radius: 6px; border: 1px solid #cbd5e1; }
input, select { min-height: 30px; background: #fff; }
button { cursor: pointer; background: #f8fafc; }
button:hover { background: #eef2ff; }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }
.lista { border: 1px solid #e2e8f0; border-radius: 8px; max-height: 220px; overflow: auto; background: #fff; }
.item { padding: 6px 8px; border-bottom: 1px solid #eef2f7; }
.item:last-child { border-bottom: 0; }
.item-seleccionado { background: #e8f3ff; }
table { width: 100%; border-collapse: collapse; margin-bottom: 4px; font-size: 12px; }
th, td { border-bottom: 1px solid #e2e8f0; padding: 4px 5px; text-align: left; }
th { background: #f8fafc; position: sticky; top: 0; }
.total-grande { font-size: 17px; font-weight: bold; }
.estado-monto { padding: 1px 6px; border-radius: 4px; }
.estado-deuda { color: #b91c1c; background: #fee2e2; }
.estado-cero { color: #166534; background: #dcfce7; }
.item-movimiento { display: grid; grid-template-columns: 120px 50px 85px 1fr; gap: 6px; align-items: center; }
.mov-debe { color: #b91c1c; }
.mov-haber { color: #166534; }
.campo-producto { margin: 0; }
.campo-producto label { display:block; font-weight:600; margin-bottom:3px; font-size: 12px; }
.campo-producto input, .campo-producto select { width: 100%; max-width: 100%; }
#msg { padding: 8px 10px; border-radius: 8px; font-weight: 700; position: sticky; top: 0; z-index: 20; margin: 0 0 8px; box-shadow: 0 1px 2px rgba(15,23,42,.08); }
.msg-info { background: #dbeafe; color: #1e3a8a; }
.msg-success { background: #dcfce7; color: #166534; }
.msg-error { background: #fee2e2; color: #b91c1c; }
.menu-principal { display:flex; gap:6px; flex-wrap:wrap; margin:6px 0 8px; position: sticky; top: 0; z-index: 10; background: var(--bg); padding: 3px 0; }
.menu-principal a, .menu-principal button { text-decoration:none; padding:5px 8px; background:#eef2ff; border-radius:6px; color:#1e3a8a; font-weight:600; border: 1px solid #c7d2fe; }
.dashboard-home { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.dashboard-home h2 { margin: 0; font-size: 16px; }
.dashboard-subtitle { margin: 3px 0 8px; color: #475569; font-size: 12px; }
.dashboard-grid { display: grid; gap: 7px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.dashboard-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.dashboard-card h3 { margin: 0; font-size: 13px; }
.dashboard-card p { margin: 0; color: #475569; font-size: 11px; }
.dashboard-card button { width: fit-content; background: #1d4ed8; color: #fff; border: none; border-radius: 6px; padding: 5px 8px; font-size: 12px; }
.pre-cultivo-group { margin: 0 0 14px; border: 1px solid #dbe3ee; border-radius: 8px; background: #fff; padding: 10px; }
.pre-cultivo-group h3 { margin: 0 0 8px; font-size: 14px; color: #0f172a; display: flex; align-items: baseline; gap: 8px; }
.pre-cultivo-group h3 small { color: #64748b; font-weight: 500; }
.pre-table-wrap { overflow-x: auto; }
.pre-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pre-table th, .pre-table td { border-bottom: 1px solid #e2e8f0; padding: 7px 6px; text-align: left; vertical-align: top; }
.pre-table th { color: #334155; background: #f8fafc; }
.pre-actions { min-width: 290px; }
.pre-actions button { margin: 0 4px 4px 0; }
.pre-toggle {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: 0 4px 4px 0;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  padding: 4px 8px 4px 6px;
  min-width: 122px;
}
.pre-toggle-track {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #94a3b8;
  position: relative;
  transition: background-color .18s ease;
}
.pre-toggle-thumb {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  top: 3px;
  left: 3px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
  transition: left .18s ease;
}
.pre-toggle.is-on .pre-toggle-track { background: #16a34a; }
.pre-toggle.is-on .pre-toggle-thumb { left: 21px; }
.pre-toggle-label { font-size: 12px; font-weight: 700; color: #0f172a; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 600; }
.pill.ok { background: #dcfce7; color: #166534; }
.pill.off { background: #fee2e2; color: #991b1b; }
.mostrador-ux { background: #f7fafc; border-color: #e6edf5; box-shadow: none; overflow-x: hidden; align-content: start; }
.mostrador-ux .input-grande { font-size: 14px; padding: 6px; width: 100%; min-width: 0; }
.mostrador-flow-card { min-width: 0; background: #fff; border-radius: 18px; padding: 12px; box-shadow: 0 10px 28px rgba(15, 23, 42, .06); overflow: visible; }
.product-search-card { border: 1px solid #dbeafe; background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%); }
.section-kicker { color: #2563eb; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.product-search-card h2, .cliente-compacto h2 { font-size: 18px; margin: 1px 0 6px; }
.mostrador-search-main { font-size: 21px !important; padding: 13px 16px !important; border-radius: 16px; border: 2px solid #93c5fd; background: #fff; box-shadow: 0 0 0 4px rgba(147, 197, 253, .18); }
.mostrador-search-main:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 5px rgba(37, 99, 235, .18); }
.mostrador-toolbar { display:flex; gap:10px; flex-wrap:wrap; align-items:end; margin-bottom: 8px; }
.mostrador-toolbar label { min-width: min(170px, 100%); }
.mostrador-categorias-chips { display:flex; gap:8px; flex-wrap:wrap; overflow: visible; padding: 8px 0 8px; }
.mostrador-chip { border:0; background:#eef6ff; border-radius:999px; padding:8px 12px; font-weight:800; cursor:pointer; white-space:nowrap; color:#0f3f76; box-shadow: inset 0 0 0 1px #dbeafe; }
.mostrador-chip:hover { background:#dbeafe; }
.mostrador-chip.is-active { box-shadow: inset 0 0 0 2px #22c55e; background:#dcfce7; color:#166534; }
.mostrador-ux .lista { max-height: none; overflow: visible; }
.productos-resultados-pos.lista { border: 0; max-height: clamp(260px, calc(100vh - 360px), 58vh); background: transparent; display: grid; gap: 8px; padding: 2px; overflow-y: auto; overflow-x: hidden; }
.btn-grande { font-size: 12px; padding: 6px 8px; }
.cliente-compacto { grid-column: 1 / -1; margin-top: 0; background: #fbfdff; box-shadow: none; border: 1px solid #edf2f7; overflow: visible; }
.cliente-compacto .helper-text { margin: 0 0 6px; color: #475569; }
.cliente-buscador-row { display:grid; gap:6px; grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(110px,1fr)); align-items:center; }
.cliente-buscador-row > * { min-width: 0; }
.cliente-resultados-compactos.lista { max-height: none; overflow: visible; }
.cliente-resumen-compacto { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; color: #334155; }
#alta-rapida-panel { margin-top:6px; border:0; border-radius:12px; padding:8px; background:#f1f7ff; }
.action-row { display:flex; gap:6px; flex-wrap:wrap; margin: 4px 0; }
.compact-form { display: grid; gap: 6px; }
.compact-form label { font-weight: 600; font-size: 12px; display: flex; flex-direction: column; gap: 2px; }
.workbench-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(340px, 390px); gap: 10px; align-items: start; min-width: 0; overflow: visible; }
.workbench-main, .workbench-side { display: grid; gap: 10px; min-width: 0; }
.side-card { border: 0; border-radius: 16px; padding: 10px; background: #fff; box-shadow: 0 10px 28px rgba(15,23,42,.07); overflow: visible; }
.sticky-summary { position: sticky; top: 44px; align-self: start; }
.inline-control { display:flex; gap:4px; align-items:center; }
.inline-control input { flex:1; }
.productos-modulo #panel-editar-productos, .productos-modulo #productos-admin { max-width: 100%; }
.ventas-workbench .workbench-grid { grid-template-columns: minmax(0, 1fr) minmax(360px, 420px); gap: 12px; }
.ventas-workbench .workbench-main,
.presupuestos-workbench .workbench-main { gap: 8px; }
.ventas-workbench .workbench-main > h2,
.presupuestos-workbench .workbench-main > h2 { margin-top: 2px; }
.ventas-side-panel .carrito-card { display: flex; flex-direction: column; overflow: visible; }
.side-card-heading { display:flex; justify-content:space-between; align-items:flex-start; gap: 10px; margin-bottom: 6px; }
.side-card-heading h3, .cobro-card h3 { font-size: 18px; margin: 1px 0 0; }
.cart-count-pill { background:#dcfce7; color:#166534; border-radius:999px; padding:6px 10px; white-space:nowrap; }
.venta-resumen-box, .cobro-opciones-box { background:#f8fafc; border-radius:14px; padding:8px 10px; margin-top: 6px; }
.venta-resumen-box h4, .cobro-opciones-box h4 { margin:0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing:.06em; color:#64748b; }
.venta-resumen-box p { display:flex; justify-content:space-between; gap:12px; font-size: 14px; margin: 4px 0; }
.ventas-side-panel .total-grande { font-size: 24px; line-height: 1.15; margin: 8px 0 0; padding: 9px 10px; border-radius: 12px; background: #eaf2ff; }
.cliente-en-carrito { color:#475569; margin-top: 8px; }
.ventas-side-panel #btn-cerrar { width: 100%; font-size: 17px; padding: 11px; margin-top: 7px; border-radius: 12px; }
.ventas-side-panel .action-row button { flex: 1; min-width: 80px; }
.compact-cierre-grid { display:grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap:6px; }
.cobro-card.sin-productos .cobro-avanzado { display: none !important; }
.cobro-card:not(.sin-productos) #cobro-carrito-vacio { display: none !important; }
.compact-redondeo { margin-top: 6px; }
.descuento-helper { border-radius: 12px; padding: 9px 10px; font-weight: 800; }
.cobro-metodos-visual { display:flex; flex-wrap:wrap; gap:5px; margin-bottom: 6px; }
.cobro-metodos-visual span { background:#eef2ff; color:#1e3a8a; border-radius:999px; padding:5px 8px; font-weight: 800; font-size: 11px; }

.mostrador-cart-list { display: grid; gap: 6px; margin-bottom: 6px; overflow: visible; padding-right: 0; }
.mostrador-cart-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; padding: 8px; border: 0; border-radius: 14px; background: #f8fafc; box-shadow: inset 0 0 0 1px #edf2f7; }
.mostrador-cart-name { font-size: 13px; font-weight: 800; color: #0f172a; line-height: 1.2; }
.mostrador-cart-row { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; align-items: center; }
.mostrador-cart-field { display: grid; gap: 2px; min-width: 0; }
.mostrador-cart-field > span { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: #64748b; }
.mostrador-cart-field > strong { font-size: 13px; color: #0f172a; }
.mostrador-cart-quantity { display: inline-flex; align-items: center; gap: 5px; }
.mostrador-cart-quantity button { width: 24px; height: 24px; min-height: 24px; padding: 0; border-radius: 999px; font-weight: 800; line-height: 1; }
.mostrador-cart-quantity strong { min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.mostrador-cart-subtotal strong { color: #166534; font-size: 14px; }
.mostrador-cart-remove { grid-column: 2; grid-row: 1; justify-self: end; align-self: start; padding: 4px 8px; border-color: #fecaca; background: #fff1f2; color: #991b1b; }
.mostrador-cart-empty { padding: 16px; border: 0; border-radius: 12px; color: #64748b; text-align: center; background: #f8fafc; }

.item-discount-control { display:inline-flex; align-items:center; gap:4px; padding:2px; border:1px solid #cbd5e1; border-radius:999px; background:#f8fafc; white-space:nowrap; }
.item-discount-control button { width:24px; height:24px; min-height:24px; padding:0; border-radius:999px; font-weight:800; line-height:1; }
.item-discount-value { min-width:42px; text-align:center; font-weight:800; font-variant-numeric: tabular-nums; }

.presupuestos-workbench .workbench-grid { grid-template-columns: minmax(0, 1.55fr) minmax(390px, 1fr); gap: 12px; }
.presupuesto-side-panel { gap: 8px; }
.presupuesto-side-panel > p { font-size: 13px; }
.presupuesto-side-panel #pres-total { display:inline-block; font-size: 24px; background:#eaf2ff; padding: 4px 8px; border-radius: 8px; }
.presupuesto-side-panel #pres-guardar { width: 100%; font-size: 16px; padding: 10px; }
.presupuesto-side-panel #pres-lista { min-height: 180px; max-height: 290px; }

.caja-workbench { display: grid; gap: 10px; }
.caja-workbench .caja-header { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.caja-workbench .caja-toolbar { font-size: 14px; color: var(--muted); }
.caja-workbench .caja-cierre-panel { position: sticky; top: 0; z-index: 5; display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px; border:1px solid #c9d8ec; border-radius:10px; background:#f1f7ff; }
.caja-workbench .caja-cierre-label { margin:0; font-weight:700; font-size:16px; }
.caja-workbench .caja-cierre-meta { margin:2px 0 0; font-size:12px; color:var(--muted); }
.caja-workbench .btn-cierre-principal { min-height: 48px; min-width: 180px; font-size: 20px; font-weight: 800; }
.caja-workbench .caja-una-columna { display:grid; gap:10px; }
.caja-workbench .pendientes-stack { display:grid; grid-template-columns: 1fr; gap:8px; max-height: calc(100vh - 300px); overflow: auto; padding-right: 2px; }
.caja-workbench #pendientes .item { border:1px solid #d5deea; border-radius:10px; margin:0; padding: 9px; background:#fbfdff; box-shadow: 0 1px 1px rgba(15,23,42,.04); }
.caja-workbench #pendientes .item p { margin: 2px 0; }
.caja-workbench #pendientes .item label { font-size: 12px; font-weight: 600; display: grid; gap: 3px; margin-top: 6px; }
.caja-workbench #pendientes .item select { min-height: 34px; font-size: 13px; }
.caja-workbench #pendientes .item button { width: 100%; margin-top: 6px; min-height: 36px; font-weight: 700; }
.caja-workbench .item-error { border-color:#fecaca; background:#fff1f2; color:#7f1d1d; }
.caja-workbench .item-error button { background:#fee2e2; border-color:#fca5a5; color:#7f1d1d; }
.modal-cierre-caja { border: 0; border-radius: 12px; padding: 0; width: min(560px, 92vw); }
.modal-cierre-caja article { padding: 16px; }
.modal-cierre-caja::backdrop { background: rgba(15, 23, 42, 0.45); }
.modal-ticket-venta { width: min(900px, 96vw); }

.ticket-sb-logo { text-align:center; margin-bottom:8px; }
.ticket-sb-marca { font-size:30px; font-weight:900; letter-spacing:1.2px; color:#d4a106; -webkit-text-stroke:1px #111; line-height:1; }
.ticket-sb-sub { font-size:10px; font-weight:700; letter-spacing:1px; color:#444; margin-top:2px; }
.ticket-venta-contenido table { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: 10px; }
.ticket-venta-contenido th, .ticket-venta-contenido td { border-bottom: 1px solid #ddd; padding: 6px 4px; vertical-align: top; }
.ticket-venta-contenido .col-producto { width: 38%; text-align: left; overflow-wrap: anywhere; word-break: normal; }
.ticket-venta-contenido .col-cantidad { width: 12%; text-align: center; white-space: nowrap; }
.ticket-venta-contenido .col-precio { width: 18%; text-align: right; white-space: nowrap; }
.ticket-venta-contenido .col-descuento { width: 14%; text-align: right; white-space: nowrap; }
.ticket-venta-contenido .col-subtotal { width: 18%; text-align: right; white-space: nowrap; }
.resumen-cierre-lista { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-bottom: 12px; }
.resumen-cierre-lista p { margin: 0; }

details { font-size: 12px; }
details[open] { display: grid; gap: 5px; }
@media (max-width: 1100px) { .workbench-grid { grid-template-columns: 1fr; } .sticky-summary { position: static; } }
.senasa-tabs button.activo { background: #1d4ed8; color: #fff; border-color: #1d4ed8; box-shadow: 0 6px 16px rgba(29, 78, 216, 0.22); }
.senasa-tab-contenedor section[hidden] { display: none !important; }
.senasa-btn-grande { width: 100%; margin: 6px 0 12px; padding: 12px 14px; border-radius: 12px; background: #15803d; color: #fff; font-weight: 800; }
.senasa-alerta-estructural { margin: 12px 0; padding: 12px 14px; border-radius: 12px; font-weight: 800; line-height: 1.35; }
.senasa-alerta-plan { border: 1px solid #bfdbfe; background: #eff6ff; color: #1e3a8a; }
.senasa-alerta-real { border: 1px solid #fed7aa; background: #fff7ed; color: #9a3412; }
.senasa-lista-card { border-radius: 12px; border: 1px solid #e2e8f0; background: #fbfdff; }
@media (max-width: 900px) {
  .bloque table { display:block; overflow:auto; }
  .cliente-buscador-row { grid-template-columns: 1fr; }
  .menu-principal { position: static; }
  .caja-workbench .pendientes-stack { max-height: none; overflow: visible; }
  .caja-workbench .btn-cierre-principal { width: 100%; min-width: 0; }
  .caja-workbench .caja-cierre-panel { position: static; display:grid; }
}

.active-user-row { display:flex; justify-content:space-between; gap:8px; align-items:center; margin-bottom:8px; }
.role-grid .dashboard-card button { width: 100%; }

.proveedores-workbench { display:grid; grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.6fr); gap: 8px; align-items:start; }
.proveedores-col-lista, .proveedores-col-detalle { display:grid; gap: 6px; }
.proveedores-col-lista #proveedores-lista { max-height: 42vh; }
.proveedores-col-detalle #proveedor-productos { max-height: 46vh; }
.proveedor-row { display:flex; justify-content:space-between; gap:6px; align-items:center; }
.proveedor-row small { color: var(--muted); }
.proveedor-meta { display:grid; gap:2px; }
.proveedor-id { font-size: 12px; color: #1e3a8a; font-weight: 700; }
.senasa-tabs button.activo { background: #1d4ed8; color: #fff; border-color: #1d4ed8; box-shadow: 0 6px 16px rgba(29, 78, 216, 0.22); }
.senasa-tab-contenedor section[hidden] { display: none !important; }
.senasa-btn-grande { width: 100%; margin: 6px 0 12px; padding: 12px 14px; border-radius: 12px; background: #15803d; color: #fff; font-weight: 800; }
.senasa-alerta-estructural { margin: 12px 0; padding: 12px 14px; border-radius: 12px; font-weight: 800; line-height: 1.35; }
.senasa-alerta-plan { border: 1px solid #bfdbfe; background: #eff6ff; color: #1e3a8a; }
.senasa-alerta-real { border: 1px solid #fed7aa; background: #fff7ed; color: #9a3412; }
.senasa-lista-card { border-radius: 12px; border: 1px solid #e2e8f0; background: #fbfdff; }
@media (max-width: 900px) { .proveedores-workbench { grid-template-columns: 1fr; } }

.producto-card { display: grid; grid-template-columns: 88px minmax(0,1fr) minmax(120px, auto); gap: 12px; align-items: center; padding: 12px; border: 0; border-radius: 16px; background: #fff; box-shadow: 0 8px 22px rgba(15, 23, 42, .06); max-width: 100%; overflow: hidden; }
.producto-media { width: 88px; height: 88px; border: 0; border-radius: 14px; overflow: hidden; background: #f1f5f9; display:flex; align-items:center; justify-content:center; }
.producto-card-img { width: 100%; height: 100%; object-fit: cover; display:block; }
.producto-card-placeholder { font-size: 12px; color: #64748b; text-align: center; padding: 8px; }
.producto-info { display:grid; gap: 3px; min-width: 0; }
.producto-titulo { font-size: 17px; font-weight: 800; line-height: 1.2; }
.producto-meta { font-size: 13px; color: #1e293b; }
.producto-acciones { display:grid; gap: 6px; align-self: stretch; min-width: 0; }
.btn-accion-agregar, .btn-accion-editar, .btn-accion-precio { font-size: 13px; font-weight: 700; min-height: 34px; }
.btn-accion-agregar { width: 100%; background: #16a34a; border-color: #15803d; color: #fff; font-size: 16px; padding: 10px 16px; border-radius: 10px; }
.btn-accion-editar { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.btn-accion-precio { background: #fef3c7; border-color: #fcd34d; color: #92400e; }

.estado-sistema-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  max-height: none;
  border: 0;
  background: transparent;
  padding: 2px;
}
.estado-sistema-card {
  border: 1px solid #d1dbe8;
  border-radius: 12px;
  padding: 12px;
  background: #f8fbff;
  display: grid;
  gap: 6px;
  min-height: 92px;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.05);
  transition: transform .15s ease, box-shadow .15s ease;
}
.estado-sistema-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 16px rgba(15, 23, 42, 0.08);
}
.estado-sistema-label {
  margin: 0;
  font-size: 12px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 7px;
}
.estado-sistema-icono {
  font-size: 18px;
}
.estado-sistema-value {
  font-size: 25px;
  color: #0f172a;
  line-height: 1;
}
.estado-sistema-card.estado-verde {
  border-color: #86efac;
  background: #f0fdf4;
}
.estado-sistema-card.estado-amarillo {
  border-color: #fcd34d;
  background: #fefce8;
}
.estado-sistema-card.estado-rojo {
  border-color: #fca5a5;
  background: #fef2f2;
}

.senasa-tabs button.activo { background: #1d4ed8; color: #fff; border-color: #1d4ed8; box-shadow: 0 6px 16px rgba(29, 78, 216, 0.22); }
.senasa-tab-contenedor section[hidden] { display: none !important; }
.senasa-btn-grande { width: 100%; margin: 6px 0 12px; padding: 12px 14px; border-radius: 12px; background: #15803d; color: #fff; font-weight: 800; }
.senasa-alerta-estructural { margin: 12px 0; padding: 12px 14px; border-radius: 12px; font-weight: 800; line-height: 1.35; }
.senasa-alerta-plan { border: 1px solid #bfdbfe; background: #eff6ff; color: #1e3a8a; }
.senasa-alerta-real { border: 1px solid #fed7aa; background: #fff7ed; color: #9a3412; }
.senasa-lista-card { border-radius: 12px; border: 1px solid #e2e8f0; background: #fbfdff; }
@media (max-width: 1199px) {
  .ventas-workbench .workbench-grid, .workbench-grid { grid-template-columns: minmax(0, 1fr); }
  .ventas-workbench .workbench-main { order: 1; }
  .ventas-workbench .ventas-side-panel { order: 2; }
  .ventas-workbench .cliente-compacto { order: 3; grid-column: auto; }
  .sticky-summary { position: static; }
  .ventas-side-panel .carrito-card { overflow: visible; }
  .mostrador-cart-list { overflow: visible; }
  .productos-resultados-pos.lista { max-height: clamp(240px, 44vh, 520px); }
  .cliente-buscador-row, .cliente-resumen-compacto { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .compact-cierre-grid { grid-template-columns: 1fr; }
  .mostrador-cart-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .producto-card { grid-template-columns: 70px minmax(0,1fr); }
  .producto-media { width: 70px; height: 70px; }
  .producto-acciones { grid-column: 1 / -1; grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .mostrador-flow-card, .side-card { padding: 9px; border-radius: 14px; }
  .mostrador-search-main { font-size: 18px !important; padding: 11px 12px !important; }
  .mostrador-categorias-chips { gap: 6px; }
  .mostrador-chip { padding: 7px 10px; }
  .productos-resultados-pos.lista { max-height: 50vh; }
  .mostrador-cart-item { grid-template-columns: minmax(0, 1fr); }
  .mostrador-cart-remove { grid-column: 1; grid-row: auto; justify-self: stretch; }
}

.catalogo-acordeon {
  display: grid;
  gap: 10px;
}
.categoria-acordeon {
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #fff;
  padding: 6px 10px;
}
.categoria-acordeon summary {
  cursor: pointer;
  font-weight: 700;
}
.badge-alerta {
  background: #ffe3e3;
  color: #9b1c1c;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
}
.badge-ok {
  background: #e6ffed;
  color: #0f5132;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
}
.categoria-auditoria-meta {
  margin: 8px 0;
  font-size: 13px;
}
.auditoria-item-alerta {
  border-left: 4px solid #e03131;
}

.productos-precampania-workbench{padding:10px;min-height:78vh}
.pre-headline{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:8px}
.pre-headline h2{font-size:23px;margin:0}
.pre-search-main{width:100%;font-size:16px;padding:10px 12px;border-radius:10px;margin-bottom:8px}
.pre-chip-row{display:flex;gap:7px;overflow:auto;padding-bottom:6px;margin-bottom:8px}
.pre-chip{border:1px solid #cbd5e1;background:#fff;border-radius:999px;padding:6px 12px;font-weight:700;cursor:pointer;white-space:nowrap}
.pre-chip.is-active{background:#dbeafe;border-color:#93c5fd;color:#1d4ed8}
.pre-lista-workbench{display:grid;gap:12px}
.pre-cultivo-block{border:1px solid #d8e1ee;background:#fff;border-radius:10px;padding:8px}
.pre-cultivo-title{font-size:20px;font-weight:800;margin:0 0 6px;border-bottom:1px solid #e2e8f0;padding-bottom:4px}
.pre-semillero-block{padding:4px 0 0}
.pre-semillero-title{margin:0 0 6px;font-size:14px;font-weight:800;color:#1e3a8a;text-transform:uppercase;letter-spacing:.02em}
.pre-variedad-block{border-left:2px solid #e2e8f0;padding-left:8px;margin:0 0 8px}
.pre-variedad-title{margin:0 0 4px;font-size:15px;font-weight:800;color:#0f172a}
.pre-presentaciones-list{display:grid;gap:4px}
.pre-presentacion-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:start;padding:5px 6px;border:1px solid #e2e8f0;border-radius:8px;background:#fcfdfd}
.pre-presentacion-nombre{font-size:13px;font-weight:700;color:#0f172a}
.pre-presentacion-detalle{font-size:12px;color:#334155;line-height:1.2}
.pre-producto-actions{display:flex;gap:6px;align-items:center}
.pre-icon-btn{padding:4px 6px;min-height:26px}
.pre-toggle{min-width:auto;padding:2px;border:none;background:transparent;margin:0}
.pre-toggle-label{display:none}
.pre-drawer-overlay{position:fixed;inset:0;background:rgba(15,23,42,.35);z-index:50}
.pre-drawer{position:fixed;top:0;right:0;height:100vh;width:min(680px,98vw);background:#fff;border-left:1px solid #dbe3ef;padding:10px;overflow:auto;z-index:51}
.pre-drawer-header{display:flex;justify-content:space-between;align-items:center;position:sticky;top:0;background:#fff;padding-bottom:8px}
.pre-editor-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:10px}
.pre-editor-tab{border:1px solid #cbd5e1;background:#f8fafc;border-radius:10px;padding:8px;font-size:12px;font-weight:700;cursor:pointer}
.pre-editor-tab.is-active{background:#0f172a;color:#fff;border-color:#0f172a}
.pre-editor-panel{display:grid;gap:6px}
.pre-toggle-line{display:flex !important;justify-content:space-between;align-items:center;padding:8px 10px;border:1px solid #e2e8f0;border-radius:8px}
.pre-aux-filters{display:grid;grid-template-columns:180px 220px 1fr;gap:6px;margin-bottom:8px}
@media (max-width:900px){.pre-aux-filters{grid-template-columns:1fr}.pre-presentacion-item{grid-template-columns:1fr}}

/* SENASA / MIP */
.senasa-modulo { background: #f3f6f9; color: #1f2937; }
.senasa-header { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 12px; padding: 18px; border: 1px solid #d8e0ea; border-radius: 16px; background: linear-gradient(135deg, #ffffff 0%, #eef6ff 100%); }
.senasa-header h2 { color: #243b53; margin-bottom: 4px; }
.senasa-header p { color: #64748b; margin: 0; }
.senasa-tabs, .senasa-acciones-documento { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.senasa-tabs { margin: 0 0 14px; padding: 8px; border: 1px solid #dbe5ef; border-radius: 14px; background: #fff; box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05); }
.senasa-tabs button { background: #eef6ff; color: #1e3a5f; border: 1px solid #cfe0f3; border-radius: 999px; }
.senasa-tabs button:hover { background: #dbeafe; }
.senasa-acciones-documento { justify-content: flex-end; }
.senasa-acciones-documento button { background: #1d4ed8; border-radius: 10px; }
.senasa-acciones-documento .btn-primary, .senasa-acciones-documento button.btn-primary { background: #15803d; }
.senasa-acciones-inferiores { justify-content: flex-start; margin-top: 14px; padding-top: 12px; border-top: 1px solid #e2e8f0; }
.senasa-layout { display: grid; grid-template-columns: minmax(280px, 390px) 1fr; gap: 16px; align-items: start; }
.senasa-panel { background: #fff; border: 1px solid #d8dee4; border-radius: 14px; padding: 16px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06); }
.senasa-panel h3 { color: #334155; margin-top: 14px; }
.senasa-grid-dos, .senasa-grid-tres { display: grid; gap: 10px; margin: 10px 0; align-items: start; }
.senasa-grid-dos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.senasa-grid-tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.senasa-modulo label { display: flex; flex-direction: column; gap: 5px; font-size: 0.9rem; font-weight: 700; color: #334155; }
.senasa-modulo input, .senasa-modulo select, .senasa-modulo textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 9px; padding: 8px 10px; font: inherit; background: #fff; }
.senasa-modulo input:focus, .senasa-modulo select:focus, .senasa-modulo textarea:focus { outline: 2px solid #bfdbfe; border-color: #3b82f6; }
.senasa-card { margin: 12px 0; border: 1px solid #dbe4ee; border-radius: 14px; background: #fff; overflow: hidden; }
.senasa-card summary { cursor: pointer; padding: 12px 14px; color: #243b53; background: #f8fafc; font-weight: 800; border-bottom: 1px solid #e5edf5; }
.senasa-card-body { padding: 12px 14px; }
#senasa-form h4 { margin: 16px 0 8px; color: #334155; padding: 10px 12px; border-left: 4px solid #3b82f6; border-radius: 8px; background: #f8fafc; }
.senasa-producto-selector { grid-column: span 2; padding: 10px; border: 1px solid #dbeafe; border-radius: 12px; background: #f8fbff; }
.senasa-producto-buscar { margin-bottom: 6px; }
.senasa-producto-resumen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-height: 112px; margin-top: 10px; padding: 10px; border: 1px solid #bbf7d0; border-radius: 12px; background: #f0fdf4; }
.senasa-producto-resumen-vacio { border-color: #cbd5e1; background: #f8fafc; }
.senasa-producto-resumen div { display: flex; flex-direction: column; gap: 2px; }
.senasa-producto-resumen span { color: #64748b; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; }
.senasa-producto-resumen strong { color: #14532d; font-size: 0.9rem; }
.senasa-table-wrap { overflow: auto; }
.senasa-productos-table { width: 100%; border-collapse: collapse; min-width: 760px; font-size: 0.82rem; }
.senasa-productos-table th, .senasa-productos-table td { border: 1px solid #e2e8f0; padding: 8px; text-align: left; vertical-align: top; }
.senasa-productos-table th { background: #eef6ff; color: #334155; }
.senasa-productos-table input { width: 100%; min-width: 120px; padding: 6px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; }
.senasa-edit-table { width: 100%; border-collapse: collapse; margin: 8px 0 10px; font-size: 0.85rem; }
.senasa-edit-table th, .senasa-edit-table td { border: 1px solid #cbd5e1; padding: 5px; vertical-align: top; }
.senasa-edit-table th { background: #f1f5f9; }
.senasa-edit-table input, .senasa-edit-table select { min-width: 70px; padding: 5px; border-radius: 4px; }
.senasa-producto-tecnico { margin: 16px 0; padding: 12px; border: 1px solid #b7d6ba; border-radius: 10px; background: #f2fbf3; }
.senasa-documento-formal { width: min(100%, 820px); margin: 22px auto; background: white; color: #050505; padding: 44px 54px; border: 1px solid #c5cbd3; box-shadow: 0 14px 40px rgba(15, 23, 42, 0.12); font-family: Arial, Helvetica, sans-serif; line-height: 1.45; }
.senasa-documento-formal h2, .senasa-documento-formal h3 { margin: 0 0 6px; text-align: center; }
.senasa-documento-formal h4 { margin: 18px 0 8px; font-size: 0.95rem; text-transform: uppercase; }
.senasa-documento-formal h5 { margin: 0 0 6px; font-size: 0.9rem; }
.senasa-doc-title { text-align: center; margin-bottom: 22px; }
.senasa-fecha { text-align: right; }
.senasa-box { border: 1px solid #111; padding: 8px; margin: 8px 0 16px; }
.senasa-box p { margin: 6px 0; }
.senasa-producto-doc { background: #fafafa; }
.senasa-documento-formal table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.senasa-documento-formal th, .senasa-documento-formal td { border: 1px solid #111; padding: 5px; min-height: 22px; }
.senasa-firmas { display: flex; justify-content: space-between; margin-top: 70px; font-weight: 700; }
.senasa-firmas span::before { content: ''; display: block; border-top: 1px dotted #111; width: 240px; margin-bottom: 8px; }
.senasa-tabs button.activo { background: #1d4ed8; color: #fff; border-color: #1d4ed8; box-shadow: 0 6px 16px rgba(29, 78, 216, 0.22); }
.senasa-tab-contenedor section[hidden] { display: none !important; }
.senasa-btn-grande { width: 100%; margin: 6px 0 12px; padding: 12px 14px; border-radius: 12px; background: #15803d; color: #fff; font-weight: 800; }
.senasa-alerta-estructural { margin: 12px 0; padding: 12px 14px; border-radius: 12px; font-weight: 800; line-height: 1.35; }
.senasa-alerta-plan { border: 1px solid #bfdbfe; background: #eff6ff; color: #1e3a8a; }
.senasa-alerta-real { border: 1px solid #fed7aa; background: #fff7ed; color: #9a3412; }
.senasa-lista-card { border-radius: 12px; border: 1px solid #e2e8f0; background: #fbfdff; }
@media (max-width: 900px) { .senasa-layout, .senasa-grid-dos, .senasa-grid-tres, .senasa-producto-resumen { grid-template-columns: 1fr; } .senasa-header { flex-direction: column; } .senasa-producto-selector { grid-column: span 1; } }
@media print {
  @page { size: A4 portrait; margin: 6mm; }
  html, body { width: 210mm; min-height: 297mm; background: #fff !important; }
  body * { visibility: hidden !important; }
  #senasa-preview, #senasa-preview * { visibility: visible !important; }
  #senasa-preview {
    position: absolute;
    inset: 0 auto auto 0;
    box-sizing: border-box;
    width: 198mm;
    margin: 0;
    padding: 5mm 6mm;
    border: 0;
    box-shadow: none;
    font-size: 8.5pt;
    line-height: 1.22;
  }
  #senasa-preview .senasa-doc-title { margin-bottom: 6mm; }
  #senasa-preview.senasa-documento-formal h2 { font-size: 14pt; }
  #senasa-preview.senasa-documento-formal h3 { font-size: 10pt; }
  #senasa-preview.senasa-documento-formal h4 { margin: 3mm 0 1.5mm; font-size: 8.5pt; }
  #senasa-preview .senasa-box { margin: 1.5mm 0 3mm; padding: 2mm; }
  #senasa-preview .senasa-box p { margin: 1mm 0; }
  #senasa-preview.senasa-documento-formal table { font-size: 7pt; page-break-inside: avoid; }
  #senasa-preview.senasa-documento-formal th,
  #senasa-preview.senasa-documento-formal td { padding: 1.2mm; }
  #senasa-preview .senasa-firmas { margin-top: 10mm; }
  #senasa-preview .senasa-firmas span::before { width: 58mm; }
  #senasa-preview h4,
  #senasa-preview .senasa-box,
  #senasa-preview table,
  #senasa-preview .senasa-firmas { break-inside: avoid; page-break-inside: avoid; }
  .no-print { display: none !important; }
}
.pill.senasa { background: #dbeafe; color: #1d4ed8; margin-left: 6px; vertical-align: middle; }

.senasa-wizard-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  margin: 0 0 14px;
  border: 1px solid #dbe4ee;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.96);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.senasa-wizard-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font-weight: 800;
  cursor: pointer;
}
.senasa-wizard-step span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
}
.senasa-wizard-step.activo {
  border-color: #1d4ed8;
  background: linear-gradient(135deg, #2563eb, #0f766e);
  color: #fff;
}
.senasa-wizard-step.activo span { background: rgba(255, 255, 255, 0.22); color: #fff; }
.senasa-wizard-panel {
  min-height: 560px;
  padding: 18px;
  border: 1px solid #dbe4ee;
  border-radius: 18px;
  background: #fff;
}
.senasa-wizard-panel > h3 { margin-top: 0; color: #1e3a8a; }
.senasa-step-grid { grid-auto-rows: minmax(78px, auto); }
.senasa-productos-asistente,
.senasa-pdf-preview-card { min-height: 430px; }
.senasa-productos-asistente { display: flex; flex-direction: column; gap: 12px; }
.senasa-producto-add-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #eff6ff;
}
.senasa-sector-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.senasa-sector-card {
  min-height: 210px;
  padding: 14px;
  border: 1px solid #dbe4ee;
  border-radius: 14px;
  background: #f8fafc;
}
.senasa-sector-card h4 { margin-top: 0 !important; }
.senasa-wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}
.senasa-empty-box,
.senasa-validation-error,
.senasa-validation-ok {
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 800;
}
.senasa-empty-box { border: 1px dashed #94a3b8; background: #f8fafc; color: #475569; }
.senasa-validation-error { border: 1px solid #fecaca; background: #fef2f2; color: #991b1b; }
.senasa-validation-ok { border: 1px solid #bbf7d0; background: #f0fdf4; color: #166534; }
.senasa-resumen-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
@media (max-width: 900px) {
  .senasa-wizard-nav { position: static; grid-template-columns: 1fr; }
  .senasa-producto-add-card,
  .senasa-sector-cards,
  .senasa-resumen-grid { grid-template-columns: 1fr; }
}
.senasa-label-row { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; width: 100%; }
.senasa-recomendado { display: inline-flex; align-items: center; width: max-content; padding: 2px 8px; border-radius: 999px; background: #e0f2fe; color: #075985; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; }
.senasa-ayuda-bloque { margin: 6px 0 12px; padding: 10px 12px; border: 1px solid #bfdbfe; border-left: 4px solid #2563eb; border-radius: 10px; background: #eff6ff; color: #1e3a8a; font-size: 0.9rem; line-height: 1.35; }
.senasa-mini-card-grid { display: grid; gap: 12px; margin: 10px 0; }
.senasa-mini-card { padding: 12px; border: 1px solid #dbe4ee; border-radius: 14px; background: #fbfdff; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04); }
.senasa-mini-card-head { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.senasa-mini-card h5 { margin: 0; color: #1e3a5f; font-size: 0.95rem; }
.senasa-mini-card p { margin: 0; color: #64748b; font-size: 0.84rem; line-height: 1.35; }
.senasa-paso-indicador { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 10px; }
.senasa-paso-indicador span { padding: 4px 10px; border-radius: 999px; background: #1d4ed8; color: #fff; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; }
.senasa-paso-indicador strong { color: #243b53; font-size: 0.95rem; }
@media (min-width: 1180px) { .senasa-mini-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .senasa-original-edit-block .senasa-mini-card-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .senasa-label-row { align-items: flex-start; } }
