:root {
  --bg: #f4f5f7; --card: #fff; --ink: #1d2330; --muted: #6b7280; --line: #e3e6eb;
  --accent: #e85d2a; --accent-ink: #fff; --low: #c2410c;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.45 "Segoe UI", system-ui, Arial, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--accent); }

/* Cabecera: nombre y usuario arriba; pestañas en una sola fila (se desplaza de lado en pantallas angostas) */
header { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 5; }
.barra-sup { display: flex; align-items: center; gap: 12px; padding: 10px 20px 4px; max-width: 1300px; margin: 0 auto; }
.brand { font-weight: 800; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
nav { display: flex; gap: 2px; padding: 6px 14px 0; max-width: 1300px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
nav button { flex: none; background: transparent; color: #b8c0cf; border: 0; padding: 9px 14px 10px; border-radius: 10px 10px 0 0; white-space: nowrap; font-size: 14px; }
nav button:hover { color: #fff; background: rgba(255,255,255,.07); }
nav button.active { background: var(--bg); color: var(--ink); font-weight: 600; }
.ptitulo { max-width: 1300px; margin: 0 auto; padding: 18px 20px 2px; }
.ptitulo h1 { margin: 0; font-size: 22px; }
.ptitulo p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
main { padding: 14px 20px 24px; max-width: 1300px; margin: 0 auto; }
h2 { font-size: 16px; margin: 0 0 12px; }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 7px 12px; border-radius: 8px; }
button:hover { border-color: #b9bfca; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.danger { color: #b91c1c; border-color: #f3c5c5; }
button.big { width: 100%; padding: 12px; font-size: 16px; margin-top: 8px; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%; color: var(--ink); }
input[type=color] { height: 40px; padding: 4px; cursor: pointer; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
label > input, label > select, label > textarea { margin-top: 4px; color: var(--ink); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
label small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.low { color: var(--low); font-weight: 600; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
.split { display: grid; grid-template-columns: 1fr 400px; gap: 16px; align-items: start; }
.split.promo { grid-template-columns: 1fr 1fr; }
.search { font-size: 16px; padding: 11px 14px; margin-bottom: 12px; }
/* Barra de herramientas sobre las listas: buscador a la izquierda y acciones a la derecha, todo a la misma altura */
.bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.bar .search { flex: 1; min-width: 220px; margin: 0; }
.bar button, .bar select { padding: 10px 14px; white-space: nowrap; width: auto; }
.bar > select { min-width: 180px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.sp { flex: 1; }

.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.prod { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 10px; border-radius: 12px; }
.prod:hover { border-color: var(--accent); }
.prod .th { width: 100%; height: 90px; }
.pn { font-weight: 600; font-size: 14px; }
.pp { font-weight: 700; color: var(--accent); }
.ps { font-size: 12px; color: var(--muted); }
.th { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #fde7dc; color: var(--accent); font-weight: 800; }

.cart { position: sticky; top: 110px; }
.line { display: grid; grid-template-columns: 1fr auto 80px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ln b { display: block; font-size: 14px; }
.ln small { color: var(--muted); }
.qty { display: flex; align-items: center; }
.qty button { padding: 4px 10px; }
.qty input { width: 54px; text-align: center; padding: 5px; margin: 0 4px; }
.lt { text-align: right; font-weight: 600; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 20px; margin-top: 8px; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; padding-top: 4px; }
.tbl tbody tr:hover td { background: #fafbfc; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl button { padding: 5px 10px; font-size: 13px; }
.tbl td.nowrap { text-align: right; }
.tbl td.nowrap button + button, .tbl td.nowrap a + button { margin-left: 4px; }
/* Tarjetas de cifras arriba de cada pantalla */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 2px; }
.stats .card { padding: 14px 16px; }
.stats small { display: block; }
.stats .card > small:first-child { text-transform: uppercase; letter-spacing: .03em; font-size: 11px; font-weight: 600; }
.stats strong { display: block; font-size: 24px; margin: 2px 0; }

/* Configuración: menú de secciones a la izquierda, una sección a la vez */
.cfg { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.cfg-nav { position: sticky; top: 110px; display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.cfg-nav button { border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 8px; color: var(--ink); }
.cfg-nav button span { display: inline-block; width: 22px; }
.cfg-nav button:hover { background: var(--bg); }
.cfg-nav button.on { background: #fff1ea; color: var(--accent); font-weight: 600; }
.cfg > * { min-width: 0; }
.cfg-main { max-width: 820px; }
.cfg-sec { display: none; }
.cfg-sec.on { display: block; }
.cfg-sec h2 { font-size: 18px; margin-bottom: 4px; }
.cfg-desc { margin: 0 0 14px; font-size: 14px; }
.cfg-sub { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 20px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.cfg-guardar { position: sticky; bottom: 0; display: flex; gap: 12px; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; box-shadow: 0 -4px 16px rgba(16,24,40,.06); }
.cfg-guardar.oculto { display: none; }
.cfg-guardar span { font-size: 13px; }
.logo-prev { display: flex; align-items: center; gap: 12px; margin: -2px 0 6px; }
.logo-prev .prev { max-height: 64px; border: 1px solid var(--line); padding: 4px; background: #fff; }
.st { width: auto; padding: 4px 8px; }
.st-pendiente { background: #fff7d6; } .st-entregado { background: #dff1ff; } .st-pagado { background: #dcf7e3; } .st-cancelado { background: #f1f1f1; color: #888; }

dialog { border: 0; border-radius: 14px; padding: 20px; max-width: 560px; width: calc(100% - 32px); max-height: calc(100% - 32px); }
dialog::backdrop { background: rgba(15, 20, 30, .5); }
.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.prev { max-height: 120px; border-radius: 8px; }

.ticket { font-family: "Courier New", monospace; font-size: 13px; background: #fff; border: 1px dashed #bbb; padding: 14px; max-width: 320px; margin: 0 auto; color: #000; }
.ticket .c { text-align: center; } .ticket .b { font-weight: 700; font-size: 16px; }
.ticket hr { border: 0; border-top: 1px dashed #000; }
.ticket table { width: 100%; border-collapse: collapse; }
.ticket .r { text-align: right; }
.ticket .tt { display: flex; justify-content: space-between; font-weight: 700; font-size: 16px; }
.ticket .tt.n { font-weight: 400; font-size: 13px; }
.medios { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
.medios button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.fotobtn { padding: 0; border: 0; background: none; border-radius: 8px; }
.fotobtn:hover { outline: 2px solid var(--accent); }
.saldo { color: #b91c1c; font-weight: 700; }
.tlogo { display: block; max-height: 60px; margin: 0 auto 6px; }

.grp { margin-bottom: 14px; }
.gh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.gh button { padding: 3px 10px; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.chip small { color: var(--muted); margin-left: 4px; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip.on small { color: #fff; }
.preview { width: 100%; height: auto; border-radius: 10px; display: block; background: #ddd; }
.promo-canvas { position: sticky; top: 110px; }

header .user { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: 13px; color: #cfd5e1; }
header .user select { width: auto; max-width: 180px; padding: 5px 8px; background: #2b3242; color: #fff; border-color: #3a4256; }
header .user button { background: transparent; color: #cfd5e1; border-color: #3a4256; padding: 5px 12px; }
header .user button:hover { color: #fff; border-color: #6b7488; }
header .quien { display: flex; flex-direction: column; line-height: 1.15; text-align: right; }
header .quien b { color: #fff; font-weight: 600; }
header .quien small { color: #9aa3b5; font-size: 11px; }
header .lnk { color: #cfd5e1; text-decoration: none; white-space: nowrap; }
header .lnk:hover { color: #fff; }
.badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; margin-left: 4px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #eef2ff; color: #3730a3; }
.tag.web { background: #e0f2fe; color: #075985; }
.login { max-width: 380px; margin: 10vh auto; }
.login h1 { font-size: 22px; margin: 0 0 4px; }
.err { background: #fde8e8; color: #9b1c1c; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.toast { position: fixed; bottom: 16px; right: 16px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 12px; }
.checks label { display: flex; gap: 6px; align-items: center; margin: 0; color: var(--ink); font-size: 14px; }
.checks input { width: auto; margin: 0; }
.st-confirmado { background: #ede9fe; }
#dvres { margin-top: 6px; }
#dvres .tt { display: flex; justify-content: space-between; padding: 4px 0; font-size: 16px; }
/* Editor de fotos */
dialog.editor { max-width: 860px; }
.ed { display: grid; grid-template-columns: 400px 1fr; gap: 20px; }
.ed-vista { display: flex; flex-direction: column; gap: 8px; }
.ed-vista canvas { width: 100%; height: auto; aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); touch-action: none; cursor: grab; background: #fff; }
.ed-orig { user-select: none; -webkit-user-select: none; }
.ed-ayuda { color: var(--muted); font-size: 12px; text-align: center; }
.ed-ctrl h2 { margin-top: 0; }
.ed-auto { width: 100%; padding: 11px; margin-bottom: 12px; }
.ed-auto.on { background: #15803d; border-color: #15803d; }
.ed-fila { display: flex; gap: 8px; margin-bottom: 12px; }
.ed-fila select { flex: 1; }
.ed-r { display: grid; grid-template-columns: 1fr 52px; align-items: center; column-gap: 8px; margin-bottom: 8px; }
.ed-r input { grid-column: 1; margin: 2px 0 0; padding: 0; accent-color: var(--accent); }
.ed-r output { grid-column: 2; grid-row: 1 / span 2; text-align: right; font-size: 12px; color: var(--ink); }
.ed-nota { font-size: 12px; margin: -4px 0 10px; }
.foto-acc { display: flex; gap: 8px; align-items: center; margin: 4px 0 12px; }
.tag.fecha { background: #ecfdf5; color: #065f46; margin-top: 2px; }
.tag.pend { background: #fff7d6; color: #8a5a00; }
.tag.rech { background: #fde8e8; color: #9b1c1c; }
.card.solic { border-color: #f5c35b; background: #fffbeb; }
.opciones { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 12px; }
.opciones label { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-size: 14px; cursor: pointer; }
.opciones label:has(input:checked) { border-color: var(--accent); background: #fff8f4; }
.opciones input { width: auto; margin-top: 3px; }
.opciones small { color: var(--muted); }
.loading { opacity: .6; pointer-events: none; }
.mapa { height: 320px; border-radius: 10px; border: 1px solid var(--line); z-index: 0; }
.mapa-acc { display: flex; gap: 6px; margin-top: 6px; }
.mapa-acc button { flex: 1; }
.mapa-msg { font-size: 13px; color: var(--muted); margin: 6px 0; }
.geo { font-size: 12px; text-decoration: none; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); background: #fff; white-space: nowrap; }
.geo:hover { border-color: var(--accent); }
.dirs { margin: -4px 0 12px; }
.dirs div { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }
.stats.stats-6 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.repbar { flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.repbar button, .repbar input { padding: 8px 12px; width: auto; }
.split.rep2 { grid-template-columns: 1fr 1fr; }
.barra { display: inline-block; height: 10px; background: var(--accent); border-radius: 4px; min-width: 2px; }
.tbl tfoot th { border-top: 2px solid var(--ink); }
.desp { display: flex; gap: 12px; padding: 12px 14px; margin-bottom: 10px; }
.dn { flex: none; width: 32px; height: 32px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.dc { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 14px; min-width: 0; }
.dh { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.dh span { color: var(--muted); font-size: 13px; }
.df { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.pin-num span { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.pin-num b { color: #fff; font-size: 13px; transform: rotate(45deg); }
.okmsg { background: #e3f7e8; color: #1c6b33; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.pin-num { background: none; border: 0; }
#print-area { display: none; }
@media print {
  body.imprimir-hoja #print-area { width: auto; }
  @page hoja { size: A4; margin: 12mm; }
  .hoja { page: hoja; font-size: 12px; } .hoja h2 { font-size: 15px; }
  @page { size: 80mm auto; margin: 0; }
  body { background: #fff; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; width: 72mm; margin: 0 auto; }
  #print-area .ticket { border: 0; padding: 0; max-width: none; }
}
@media (max-width: 860px) {
  .split, .split.promo, .split.rep2 { grid-template-columns: 1fr; }
  .cart, .promo-canvas { position: static; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stats strong { font-size: 20px; }
  .tbl { font-size: 13px; }
  .card { overflow-x: auto; padding: 14px; }
  .barra-sup { padding: 8px 12px 2px; }
  header .quien, header .lnk { display: none; }
  nav { padding: 4px 8px 0; }
  .ptitulo { padding: 14px 12px 0; }
  .ptitulo h1 { font-size: 19px; }
  main { padding: 12px 12px 20px; }
  .cfg { grid-template-columns: 1fr; gap: 10px; }
  .cfg-nav { position: static; flex-direction: row; overflow-x: auto; padding: 6px; }
  .cfg-nav button { flex: none; white-space: nowrap; }
  .row { flex-direction: column; gap: 0; }
  .ed { grid-template-columns: 1fr; gap: 12px; }
}

/* Herramientas: lector de códigos, cámara, etiquetas, catálogo, fotos en lote */
.buscar { display: flex; gap: 6px; align-items: stretch; flex: 1; min-width: 220px; }
.buscar .search, .buscar input { flex: 1; min-width: 0; margin: 0; }
section > .buscar { margin-bottom: 12px; }
.scan { flex: none; font-size: 18px; padding: 0 12px; }
.bar.herram { margin-top: -4px; }
.bar.herram button.alerta, .badge.alerta { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
.badge.alerta { background: #f59e0b; color: #fff; }
dialog.camara { max-width: 520px; padding: 14px; }
.cam-cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cam-vista { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; }
.cam-vista.cuadro { aspect-ratio: 1; }
.cam-vista video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-linea { position: absolute; left: 10%; right: 10%; top: 50%; height: 2px; background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.cam-marco { position: absolute; inset: 9%; border: 3px dashed rgba(255, 255, 255, .9); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .25); }
.cam-tips { margin: 10px 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.cam-ult { margin: 8px 0; text-align: center; }
.cam-manual { display: flex; gap: 6px; margin-top: 10px; }
.cam-manual input { flex: 1; }
.aviso { background: #fef3c7; color: #78350f; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.acciones-col { display: grid; gap: 8px; margin: 12px 0; }
.afiche-prev { text-align: center; margin: 10px 0; }
.afiche-prev canvas { max-width: 100%; max-height: 50vh; border: 1px solid var(--line); border-radius: 6px; }
.afiche-cta { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.cat-prev { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 10px 0; max-height: 45vh; overflow: auto; }
.cat-pag { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.lote-bar { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.lote { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 40vh; overflow: auto; }
.lote-it { position: relative; display: grid; gap: 4px; font-size: 11px; text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px; margin: 0; }
.lote-it input { position: absolute; top: 6px; left: 6px; width: auto; }
.lote-it img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.lote-it span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lote-it button { position: absolute; top: 4px; right: 4px; padding: 2px 6px; font-size: 12px; }
.lote-ej { display: inline-flex; align-items: center; gap: 6px; }
.lote-ej img { width: 90px; height: 90px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

/* Pantallas de acceso */
body:has(.auth) { background: #fff; }
body:has(.auth) main { max-width: none; padding: 0; margin: 0; }
.auth { display: grid; grid-template-columns: minmax(340px, 46%) 1fr; min-height: 100vh; }
.auth-marca { position: relative; overflow: hidden; color: #fff; padding: 44px 48px; display: flex; flex-direction: column; gap: 34px;
  background: radial-gradient(circle at 85% 12%, rgba(255,255,255,.16) 0 120px, transparent 121px), radial-gradient(circle at 8% 92%, rgba(255,255,255,.1) 0 160px, transparent 161px), linear-gradient(150deg, #f07a3d 0%, #e85d2a 45%, #b9401a 100%); }
.auth-logo { font-size: 20px; font-weight: 700; letter-spacing: .2px; display: flex; align-items: center; gap: 10px; }
.auth-logo span { background: #fff; border-radius: 12px; width: 42px; height: 42px; display: grid; place-items: center; font-size: 22px; box-shadow: 0 6px 18px rgba(0,0,0,.15); }
.auth-logo em { font-style: normal; }
.auth-logo b { opacity: .75; font-weight: 600; }
.auth-hero h2 { font-size: 34px; line-height: 1.15; margin: 0 0 12px; max-width: 420px; }
.auth-hero p { font-size: 16px; opacity: .9; margin: 0; max-width: 400px; line-height: 1.5; }
.auth-puntos { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-width: 430px; }
.auth-puntos li { display: flex; gap: 14px; align-items: flex-start; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); border-radius: 14px; padding: 12px 14px; backdrop-filter: blur(2px); }
.auth-puntos .ai { flex: none; width: 36px; height: 36px; border-radius: 10px; background: #fff; display: grid; place-items: center; font-size: 18px; }
.auth-puntos b { display: block; font-size: 15px; }
.auth-puntos small { display: block; opacity: .88; font-size: 13px; line-height: 1.4; margin-top: 2px; }
.auth-pie { margin: auto 0 0; font-size: 13px; opacity: .8; }
.auth-form { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 24px; background: var(--bg); }
.auth-caja { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; padding: 34px 32px; box-shadow: 0 1px 2px rgba(16,24,40,.05), 0 12px 32px rgba(16,24,40,.08); }
.auth-caja h1 { font-size: 26px; margin: 0 0 4px; }
.auth-caja > .muted { margin: 0 0 22px; }
.auth-caja label { font-weight: 600; font-size: 13px; }
.auth-caja input { padding: 12px 14px; font-size: 16px; border-radius: 10px; }
.auth-caja .big { width: 100%; margin-top: 6px; padding: 13px; font-size: 16px; border-radius: 10px; }
.clave { position: relative; display: block; }
.clave input { padding-right: 46px; }
.ojo { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; font-size: 17px; padding: 4px 8px; cursor: pointer; }
.auth-olv { text-align: right; margin: -4px 0 14px; font-size: 13px; }
.auth-olv.centro { text-align: center; margin: 16px 0 0; }
.auth-nota { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); text-align: center; }
.auth-links { display: flex; gap: 18px; margin: 22px 0 0; font-size: 13px; }
.auth-links a { color: var(--muted); }
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-marca { padding: 26px 20px 30px; gap: 14px; }
  .auth-hero h2 { font-size: 24px; }
  .auth-hero p { font-size: 14px; }
  .auth-puntos, .auth-pie { display: none; }
  .auth-form { justify-content: flex-start; padding: 0 16px 28px; }
  .auth-caja { margin-top: -16px; padding: 26px 20px; }
}

/* Registro y plan */
.tachado { text-decoration: line-through; opacity: .7; }
.slug { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.slug > span { padding: 12px 0 12px 12px; color: var(--muted); font-size: 15px; white-space: nowrap; background: #f6f7f9; padding-right: 6px; }
.slug input { border: 0 !important; border-radius: 0 !important; min-width: 0; flex: 1; }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.auth-caja label.acepto { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 13px; }
.auth-caja label.acepto input { width: auto; margin-top: 2px; }
.plan-aviso { max-width: 1300px; margin: 0 auto 10px; padding: 10px 14px; border-radius: 12px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: #fff7ed; border: 1px solid #fdba74; color: #7c2d12; font-size: 14px; width: calc(100% - 40px); }
.plan-aviso.suave { background: #f0f9ff; border-color: #bae6fd; color: #0c4a6e; }
.plan-aviso.vencida, .plan-aviso.suspendida { background: #fef2f2; border-color: #fca5a5; color: #7f1d1d; }
.plan-aviso button { flex: none; }
.plan-card { display: flex; gap: 20px; justify-content: space-between; align-items: center; flex-wrap: wrap; background: var(--bg); border-radius: 14px; padding: 16px 18px; margin-bottom: 8px; }
.plan-card h3 { margin: 6px 0 4px; font-size: 18px; }
.plan-card p { margin: 0; }
.plan-precio { text-align: right; display: grid; }
.plan-precio b { font-size: 30px; color: var(--accent); line-height: 1.1; }
.plan-precio b span { font-size: 14px; color: var(--muted); font-weight: 400; }
.plan-precio small { color: var(--muted); }
.plan-datos { background: var(--bg); border-radius: 10px; padding: 12px; font: inherit; white-space: pre-wrap; margin: 0 0 8px; }
.tag.plan-prueba { background: #e0f2fe; color: #075985; } .tag.plan-activa, .tag.plan-sin_plazo { background: #dcfce7; color: #166534; }
.tag.plan-por_vencer { background: #fef3c7; color: #92400e; } .tag.plan-vencida, .tag.plan-suspendida { background: #fee2e2; color: #991b1b; }
.subs-res { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-bottom: 10px; font-size: 14px; }
@media (max-width: 820px) { .plan-aviso { width: calc(100% - 32px); } .plan-precio { text-align: left; } }

/* Ruta de despacho */
.ruta-opt { display: grid; gap: 8px; }
.ro-mod { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; width: fit-content; }
.ro-mod button { border: 0; border-radius: 0; background: #fff; }
.ro-mod button.on { background: var(--accent); color: var(--accent-ink); }
.ro-dat { display: flex; gap: 6px 14px; align-items: baseline; flex-wrap: wrap; }
.ro-dat b { font-size: 22px; }
.ro-ahorro { background: #dcfce7; color: #166534; border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.ro-opc { display: flex; gap: 8px 18px; align-items: center; flex-wrap: wrap; }
.ro-opc label { display: flex; gap: 6px; align-items: center; margin: 0; }
.ro-opc input { width: auto; }
.pin-origen span { background: #1d2330 !important; }

/* Venta manual por cobrar */
.cobrar-ent { display: flex; gap: 8px; align-items: flex-start; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 8px 10px; margin: 8px 0; font-weight: 400; }
.cobrar-ent input { width: auto; margin-top: 3px; }
.deuda-ant { background: #fef2f2; color: #7f1d1d; border-radius: 8px; padding: 6px 10px; font-size: 14px; }

/* Exclusivos e invitaciones */
.tag.excl { background: #1d2330; color: #fff; }
.inv-link { background: var(--bg); border-radius: 12px; padding: 12px; margin-top: 10px; display: grid; gap: 8px; }
.inv-link input { font-size: 13px; }
.aviso-panel { background: #fef3c7; color: #78350f; border-radius: 10px; padding: 8px 12px; font-size: 14px; }

/* Monitoreo de la plataforma */
.mon-cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.mon-luces { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.mon-luz { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.mon-luz b { display: block; font-size: 14px; } .mon-luz small { color: var(--muted); font-size: 12px; }
.mon-pt { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; background: #22c55e; box-shadow: 0 0 0 4px #dcfce7; }
.mon-luz.alerta .mon-pt { background: #f59e0b; box-shadow: 0 0 0 4px #fef3c7; } .mon-luz.error .mon-pt { background: #ef4444; box-shadow: 0 0 0 4px #fee2e2; }
.mon-luz.error { border-color: #fca5a5; }
.mon-avisos { margin: 12px 0 0; display: grid; gap: 6px; }
.mon-aviso { margin: 0; padding: 8px 12px; border-radius: 10px; font-size: 14px; background: #f0f9ff; color: #0c4a6e; }
.mon-aviso.medio { background: #fef3c7; color: #78350f; } .mon-aviso.alto { background: #fee2e2; color: #7f1d1d; }
.mon-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 14px 0; }
.mon-kpis > div { background: var(--bg); border-radius: 12px; padding: 10px 12px; display: grid; }
.mon-kpis small { color: var(--muted); font-size: 12px; } .mon-kpis b { font-size: 24px; } .mon-kpis span { font-size: 12px; color: var(--muted); }
.mon-graf { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding: 6px 0 0; border-bottom: 1px solid var(--line); }
.mon-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.mon-bar i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; }
.mon-bar:hover i { opacity: 1; } .mon-bar small { font-size: 9px; color: var(--muted); margin-top: 2px; }
