:root {
  --bg: #F3F6F4; --card: #FFFFFF; --ink: #0E1A1F; --muted: #5B6B68; --line: #DDE5E2; --soft: #F3F6F4;
  --primary: #0E5E47; --primary-2: #0A4A38; --blue: #0E7A5C; --blue-soft: #E0F5EC; --grad: linear-gradient(135deg, #0E1A1F 0%, #0E5E47 55%, #0E7A5C 100%); --dorado: #F2B632;
  --green: #12803F; --green-soft: #E3F7EB; --teal: #3CCB9A;
  --amber: #A45A00; --amber-bar: #EBB45C; --amber-soft: #FFF3DC;
  --red: #B42318; --red-soft: #FDECEA; --gray-soft: #EEF1F4;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,34,48,.05);
  --texto-nav: #3C4B57; --muted-2: #8796A2; --borde-card: #E3EAE7; --borde: #CED8DF; --borde-fuerte: #C7D3DC; --fila-hover: #F7FAF8;
  --burbuja-cliente: #EEF2F5; --texto-suave: #4F5F6B; --azul-texto: #1F5E97; --borde-peligro: #EFC1BC; --titulo: var(--primary); --lateral: #FFFFFF;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.45 "Plus Jakarta Sans", system-ui, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
.hidden { display: none !important; }
h1, h2, h3 { margin: 0; color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
code, .mono { font-family: "JetBrains Mono", Consolas, monospace; font-size: 13px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(60,203,154,.35) 0, transparent 42%),
    radial-gradient(circle at 85% 90%, rgba(242,182,50,.16) 0, transparent 38%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23F3F6F4' stroke-opacity='.06' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 20h6l4 18h18l4-12H22'/%3E%3Ccircle cx='27' cy='44' r='2'/%3E%3Ccircle cx='39' cy='44' r='2'/%3E%3Cpath d='M80 14c-7 0-12 5-12 12 0 9 12 24 12 24s12-15 12-24c0-7-5-12-12-12z'/%3E%3Cpath d='M76 26l3 3 6-6'/%3E%3Crect x='16' y='74' width='26' height='32' rx='3'/%3E%3Cpath d='M21 84h16M21 92h12'/%3E%3Cpath d='M74 80h28v22H74zM74 88h28'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, #0E7A5C 0%, #0E1A1F 62%); }
@media (min-width: 1040px) {
  .login { grid-template-columns: minmax(0, 1fr) 420px; gap: clamp(32px, 5vw, 80px); padding: 40px clamp(32px, 6vw, 96px); place-items: center stretch; }
  .login-card { justify-self: end; }
}
.login-escena { display: none; color: #F3F6F4; max-width: 680px; }
@media (min-width: 1040px) { .login-escena { display: block; } }
.escena-lema { display: inline-block; margin: 0 0 14px; padding: 5px 12px; border-radius: 999px; background: rgba(242,182,50,.16); color: #F2B632; font-weight: 800; font-size: 14px; letter-spacing: .02em; }
.escena-titulo { margin: 0 0 12px; font-size: clamp(28px, 2.6vw, 40px); line-height: 1.12; font-weight: 800; color: #F3F6F4; }
.escena-texto { margin: 0 0 22px; color: #CFE3DB; font-size: 16px; line-height: 1.55; max-width: 560px; }
.escena-dibujo { position: relative; }
.escena-dibujo img { width: 100%; height: auto; display: block; filter: drop-shadow(0 18px 30px rgba(0,0,0,.35)); }
.nota-flotante { position: absolute; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; background: #fff; color: #0E1A1F;
  border-radius: 14px; padding: 9px 13px; font-size: 13px; box-shadow: 0 10px 28px rgba(0,0,0,.28); animation: flotar 6s ease-in-out infinite; white-space: nowrap; }
.nota-flotante b { grid-column: 2; font-size: 13px; }
.nota-flotante small { grid-column: 2; color: #5B6B70; font-size: 11.5px; }
.nota-flotante { grid-template-rows: auto auto; }
.nota-flotante::first-letter { font-size: 18px; }
.n1 { top: 4%; left: -2%; }
.n2 { top: 2%; right: 0; animation-delay: -1.5s; }
.n3 { bottom: -3%; left: 36%; animation-delay: -3s; }
.n4 { bottom: 16%; right: -3%; animation-delay: -4.5s; }
@keyframes flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .nota-flotante { animation: none; } }
.login-card { width: min(420px, 100%); background: var(--card); border-radius: 20px; padding: 32px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-marca { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.login-marca img { border-radius: 14px; }
.marca-nombre { font-size: 22px; font-weight: 800; color: var(--primary); }
.marca-nombre span { font-size: 12px; background: var(--grad); color: #fff; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.marca-sub { font-size: 13px; color: var(--muted); }
.login h1 { font-size: 20px; margin-bottom: 12px; }
.login label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 12px 0 4px; }
.login-pie { font-size: 12px; color: var(--muted); margin: 16px 0 0; text-align: center; }
.error { color: var(--red); font-size: 13px; min-height: 18px; margin: 8px 0; }

/* ---------- barra superior ---------- */
.topbar { height: 76px; background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 24px; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.marca img { border-radius: 9px; }
.marca-texto { display: flex; flex-direction: column; line-height: 1.1; }
.marca-texto b { color: var(--primary); font-size: 17px; }
.marca-texto small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .3px; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--texto-nav); font-weight: 600; white-space: nowrap; font-size: 15px; }
.nav a:hover { background: var(--soft); }
.nav a.activo { color: var(--primary); background: var(--blue-soft); font-weight: 800; }
.nav .badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--amber-bar); color: #3A2400; font-size: 11px; font-weight: 800; text-align: center; }
.topbar-der { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.pill-bot { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-weight: 800; font-size: 13px; }
.pill-bot .punto { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.pill-bot.off { background: var(--red-soft); color: var(--red); }
.pill-bot.off .punto { background: var(--red); }
.usuario { display: flex; align-items: center; gap: 10px; }
.usuario-datos { display: flex; flex-direction: column; text-align: right; line-height: 1.2; }
.usuario-datos small { color: var(--muted); font-size: 12px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.subbar { display: flex; align-items: center; gap: 16px; padding: 10px 28px; border-bottom: 1px solid var(--line); background: var(--card); }
.progreso { display: flex; gap: 4px; }
.progreso span { width: 62px; height: 3px; border-radius: 2px; background: var(--line); }
.progreso span.on { background: var(--primary); }
.seccion { font-size: 12px; font-weight: 800; letter-spacing: 1.2px; color: var(--muted-2); text-transform: uppercase; flex: 1; }
.link-salir { background: none; border: 0; color: var(--muted-2); font-weight: 700; cursor: pointer; font-size: 13px; }

/* ---------- layout ---------- */
.vista { padding: 28px; max-width: 1440px; margin: 0 auto; outline: none; }
.cabecera { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.cabecera h1 { font-size: 24px; }
.cabecera p { margin: 4px 0 0; color: var(--muted); }
.acciones { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 18px; }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (max-width: 1100px) { .g-main, .g-2 { grid-template-columns: 1fr; } .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border: 1px solid var(--borde-card); min-width: 0; }
.card h2 { font-size: 17px; margin-bottom: 14px; color: var(--ink); }
.card-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.card-cab h2 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }

/* ---------- botones y formularios ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--borde); background: var(--card); color: var(--ink); font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--borde-fuerte); }
.btn.primario { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primario:hover { background: var(--primary-2); }
.btn.peligro { color: var(--red); border-color: var(--borde-peligro); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.ancho { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; color: var(--primary); font-weight: 800; cursor: pointer; padding: 0; font-size: 14px; text-decoration: none; }
.icono { background: none; border: 0; cursor: pointer; font-size: 18px; color: var(--muted); width: 36px; height: 36px; border-radius: 8px; }
.icono:hover { background: var(--soft); }
input, select, textarea { width: 100%; height: 42px; border: 1px solid var(--borde); border-radius: 10px; padding: 0 12px; background: var(--card); }
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.campo { display: flex; flex-direction: column; gap: 4px; }
.campo label { font-size: 12px; font-weight: 800; color: var(--muted); }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.buscador { width: 260px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.check input { width: 18px; height: 18px; }

/* ---------- etiquetas ---------- */
.tag { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; white-space: nowrap; }
.t-verde { background: var(--green-soft); color: var(--green); }
.t-ambar { background: var(--amber-soft); color: var(--amber); }
.t-azul { background: var(--blue-soft); color: var(--azul-texto); }
.t-rojo { background: var(--red-soft); color: var(--red); }
.t-gris { background: var(--gray-soft); color: var(--texto-suave); }

/* ---------- KPI ---------- */
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .lab { font-size: 12px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--muted-2); }
.kpi .num { font-size: 30px; font-weight: 800; color: var(--ink); line-height: 1.15; }
.kpi .det { font-size: 13px; font-weight: 700; }
.bien { color: var(--green); } .alerta { color: var(--amber); } .mal { color: var(--red); }
.hero { background: var(--grad); color: #fff; border-radius: var(--radius); padding: 26px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 28px; }
.hero .lab { color: #D9F3E8; font-size: 12px; font-weight: 800; letter-spacing: 1px; }
.hero .grande { font-size: 60px; font-weight: 800; line-height: 1; }
.hero .grande small { font-size: 18px; color: #D9FBE8; margin-left: 6px; }
.hero p { color: #E6F5EF; margin: 8px 0 0; font-size: 14px; }
.barra { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.barra .fila { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.barra .riel { height: 9px; border-radius: 5px; background: rgba(255,255,255,.14); overflow: hidden; }
.barra .riel i { display: block; height: 100%; border-radius: 5px; }
.riel-claro { height: 8px; border-radius: 4px; background: var(--gray-soft); overflow: hidden; }
.riel-claro i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; } }

/* gráfico de barras */
.grafico { display: flex; align-items: flex-end; gap: 14px; height: 220px; padding-top: 10px; border-bottom: 1px solid var(--line); }
.grafico .dia { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 2px; min-width: 0; }
.grafico .seg { border-radius: 6px 6px 0 0; min-height: 2px; }
.grafico .seg.b { background: #0E7A5C; }
.grafico .seg.d { background: #F2B632; border-radius: 0; }
.ejes { display: flex; gap: 14px; }
.ejes span { flex: 1; text-align: center; font-size: 12px; font-weight: 800; color: var(--muted-2); padding-top: 8px; }
.leyenda { display: flex; gap: 18px; font-size: 13px; color: var(--muted); margin-top: 12px; }
.leyenda i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mini-kpis div { background: var(--soft); border-radius: 12px; padding: 14px; }
.ranking { display: flex; flex-direction: column; gap: 12px; }
.ranking .item { display: grid; grid-template-columns: 30px minmax(0, 1fr) 48px; gap: 8px; align-items: center; }
.ranking .n { color: var(--muted-2); font-size: 12px; font-weight: 800; }
.ranking .v { text-align: right; font-weight: 800; }
.lista-simple { display: flex; flex-direction: column; }
.lista-simple .item { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--soft); }
.aviso { background: var(--amber-soft); color: var(--amber); border-radius: 10px; padding: 10px 14px; font-size: 13px; font-weight: 700; margin-top: 12px; }
.aviso.azul { background: var(--blue-soft); color: var(--azul-texto); }

/* ---------- tablas ---------- */
.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: left; font-size: 12px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--muted-2); padding: 14px 18px; background: var(--soft); }
.tabla td { padding: 14px 18px; border-top: 1px solid var(--line); vertical-align: middle; }
.tabla tr.click { cursor: pointer; }
.tabla tr.click:hover td { background: var(--fila-hover); }
.tabla .sub { display: block; font-size: 12px; color: var(--muted); }
.tabla-card { padding: 0; overflow: hidden; }
.tabla-card .scroll { overflow-x: auto; }

/* ---------- bandeja ---------- */
.bandeja { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .bandeja { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.columna-cab { display: flex; justify-content: space-between; align-items: center; font-weight: 800; margin-bottom: 10px; font-size: 14px; }
.columna-cab .cuadro { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 8px; }
.columna-cab .cnt { color: var(--muted-2); }
.columna { display: flex; flex-direction: column; gap: 12px; }
.tarjeta { background: var(--card); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); border: 1px solid var(--borde-card); border-top: 3px solid var(--c, var(--blue)); cursor: pointer; }
.tarjeta:hover { border-color: var(--borde-fuerte); border-top-color: var(--c, var(--blue)); }
.tarjeta .fila { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.tarjeta b { font-size: 15px; }
.tarjeta .hora { font-size: 12px; color: var(--muted-2); font-weight: 800; }
.tarjeta .espera { font-size: 12px; color: var(--amber); font-weight: 800; }
.tarjeta p { margin: 6px 0 10px; color: var(--texto-nav); font-size: 14px; }
.tarjeta .pie-t { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tarjeta .agente { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--texto-nav); }
.tarjeta .dos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.canal { font-size: 11px; font-weight: 800; color: var(--muted-2); text-transform: uppercase; letter-spacing: .5px; }
.vacia { border: 1px dashed var(--borde); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted-2); font-size: 13px; }

/* ---------- chat (panel) ---------- */
.panel { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.panel-fondo { position: absolute; inset: 0; background: rgba(12,26,36,.35); opacity: 0; transition: opacity .2s; }
.panel-cuerpo { position: absolute; top: 0; right: 0; bottom: 0; width: min(720px, 100%); background: var(--bg); transform: translateX(100%); transition: transform .22s; display: flex; flex-direction: column; box-shadow: -20px 0 50px rgba(0,0,0,.15); }
.panel.abierto { pointer-events: auto; }
.panel.abierto .panel-fondo { opacity: 1; }
.panel.abierto .panel-cuerpo { transform: none; }
.panel-cab { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.panel-cab h2 { font-size: 18px; }
.panel-contenido { flex: 1; overflow: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.chat { display: flex; flex-direction: column; gap: 8px; background: var(--card); border-radius: 12px; padding: 16px; min-height: 260px; max-height: 52vh; overflow-y: auto; border: 1px solid var(--borde-card); }
.burbuja { max-width: 78%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; font-size: 14px; }
.burbuja.cliente { background: var(--burbuja-cliente); align-self: flex-start; border-bottom-left-radius: 4px; }
.burbuja.bot { background: var(--blue-soft); align-self: flex-end; border-bottom-right-radius: 4px; }
.burbuja.agente { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.burbuja .meta { display: block; font-size: 11px; opacity: .7; margin-top: 4px; font-weight: 700; }
.burbuja .ops { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.burbuja .ops span { font-size: 12px; background: rgba(255,255,255,.7); border: 1px solid #BFE3D2; border-radius: 6px; padding: 1px 7px; }
.sistema { align-self: center; font-size: 12px; color: var(--muted-2); font-weight: 700; background: var(--soft); border-radius: 999px; padding: 3px 12px; }
.responder { display: flex; gap: 8px; }
.responder textarea { min-height: 48px; height: 48px; }
.info-paciente { background: var(--card); border-radius: 12px; padding: 14px 16px; border: 1px solid var(--borde-card); font-size: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }

/* ---------- chatbot ---------- */
.pasos { display: flex; flex-direction: column; gap: 0; }
.paso { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; position: relative; padding-bottom: 20px; }
.paso:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 0; width: 2px; background: var(--line); }
.paso .num { width: 28px; height: 28px; border-radius: 7px; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.paso h3 { font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.paso p { margin: 0; color: var(--texto-nav); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chips span { background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 3px 9px; font-size: 12px; font-weight: 700; color: var(--texto-suave); }
.faq { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--soft); border-radius: 12px; padding: 14px 16px; cursor: pointer; border: 1px solid transparent; }
.faq:hover { border-color: var(--borde-fuerte); }
.faq.borrador { background: transparent; border: 1px dashed var(--borde); }
.faq b { display: block; font-size: 15px; }
.faq small { color: var(--muted); }
.faqs { display: flex; flex-direction: column; gap: 10px; }

/* ---------- plantillas ---------- */
.wa-preview { background: #E9E2D8; border-radius: 12px; padding: 18px; }
.wa-burbuja { background: #fff; border-radius: 10px 10px 10px 2px; padding: 10px 12px; max-width: 320px; font-size: 14px; white-space: pre-wrap; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.wa-botones { max-width: 320px; display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.wa-botones span { background: #fff; border-radius: 8px; text-align: center; padding: 8px; color: #0A7CFF; font-weight: 700; font-size: 14px; }

/* ---------- modal, toast, pie ---------- */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(640px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(12,26,36,.45); }
#modal-contenido { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
#modal-contenido h2 { font-size: 19px; }
.modal-acciones { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 700; opacity: 0; pointer-events: none; transition: .2s; z-index: 90; }
.toast.ver { opacity: 1; transform: translateX(-50%); }
.toast.error { background: var(--red); }
.pie { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 18px; color: var(--muted-2); font-size: 12px; }
.pie img { border-radius: 5px; }
.cargando { padding: 40px; text-align: center; color: var(--muted); }
.estado-int { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--soft); }

/* ---------- Apuntao ---------- */
.selector-negocio { width: auto; min-width: 220px; height: 40px; font-weight: 700; border-color: var(--blue); color: var(--primary); }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pedido { background: var(--card); border-radius: 12px; padding: 14px 16px; border: 1px solid var(--borde-card); border-top: 3px solid var(--c, var(--blue)); box-shadow: var(--shadow); }
.pedido .items { font-size: 13px; color: var(--texto-nav); margin: 6px 0 8px; }
.pedido .fila { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.codigo { font-family: "JetBrains Mono", Consolas, monospace; font-weight: 700; letter-spacing: .5px; }
.billetera-card { background: var(--grad); color: #fff; border-radius: 18px; padding: 24px; position: relative; overflow: hidden; }
.billetera-card::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; right: -60px; top: -90px; background: rgba(255,255,255,.12); }
.billetera-card .lab { font-size: 12px; font-weight: 800; letter-spacing: 1px; opacity: .85; }
.billetera-card .num { font-size: 42px; font-weight: 800; line-height: 1.1; margin: 4px 0 8px; }
.cobro { display: flex; align-items: center; gap: 16px; }
.cobro .qr { width: 120px; height: 120px; border-radius: 12px; background: #fff; padding: 8px; }
.cobro .codigo { font-size: 28px; }
.estrella { color: #F59E0B; font-weight: 800; }
.mas { color: var(--green); font-weight: 800; }
.dia-agenda { font-size: 12px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--muted-2); }
.tabs-crm { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs-crm button { height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--borde); background: var(--card); font-weight: 700; cursor: pointer; }
.tabs-crm button.activo { background: var(--primary); color: #fff; border-color: var(--primary); }
.logo-neg { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 18px; background: var(--blue-soft); flex-shrink: 0; }

/* planes (Básico, Plus, Platinum) */
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g-3 { grid-template-columns: 1fr; } }
.banner-plan { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 24px 0;
  padding: 10px 16px; border-radius: 12px; background: var(--amber-soft); color: var(--amber); font-size: 14px; font-weight: 600; }
.login-registro { text-align: center; margin: 14px 0 0; font-size: 14px; }
/* ver la contraseña mientras se escribe, y recuperar la contraseña */
.clave { position: relative; display: block; }
.clave input { width: 100%; padding-right: 48px; }
.ojo { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 6px 8px;
  cursor: pointer; color: var(--muted); border-radius: 8px; line-height: 0; }
.ojo:hover { background: rgba(0,0,0,.06); }
.ojo svg { width: 20px; height: 20px; }
.enlace { background: none; border: 0; padding: 0; color: var(--primary, #1F5E46); font: inherit; font-weight: 700; cursor: pointer; }
.enlace:hover { text-decoration: underline; }
.login-olvido { text-align: right; margin: 6px 0 0; font-size: 13px; }
.login-texto { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.aviso-login { font-size: 14px; color: var(--green, #0E7A5C); min-height: 1.2em; }

/* términos y condiciones (firma electrónica, Ley 126-02) */
dialog.ancho { width: min(860px, calc(100vw - 32px)); }
.acuerdo-ventana { display: flex; flex-direction: column; gap: 10px; }
.acuerdo-texto { max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--soft);
  font-size: 13.5px; line-height: 1.55; }
.acuerdo-texto h3 { font-size: 15px; margin: 0 0 6px; color: var(--blue); }
.acuerdo-texto h4 { font-size: 13.5px; margin: 12px 0 2px; }
.acuerdo-texto p { margin: 0 0 6px; }
.acuerdo-campos { display: flex; flex-direction: column; gap: 8px; }
.acuerdo-campos .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .acuerdo-campos .form-grid { grid-template-columns: 1fr; } }
.acuerdo-campos .acepto { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; }
.acuerdo-campos .acepto input { width: auto; margin-top: 3px; flex: none; }
.acuerdo-resumen { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; margin: 12px 0 6px;
  border: 1.5px dashed var(--line); border-radius: 12px; background: var(--soft); }
.acuerdo-resumen > div { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.acuerdo-resumen.firmado { border-style: solid; border-color: var(--blue); background: var(--blue-soft); }
.acuerdo-resumen.firmado #r-acuerdo-estado { color: var(--blue); font-weight: 700; }
.acuerdo-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.acuerdo-cab .idiomas { display: flex; gap: 6px; }

/* punto de venta (caja, inventario, compras) */
.tabs-pos { display: flex; gap: 6px; flex-wrap: wrap; }
.pos-productos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; max-height: 60vh; overflow: auto; }
.pos-prod { display: flex; flex-direction: column; gap: 4px; text-align: left; border: 1px solid var(--line); border-radius: 12px; padding: 10px;
  background: var(--card); cursor: pointer; font: inherit; color: inherit; }
.pos-prod:hover { border-color: var(--blue); box-shadow: 0 2px 8px rgba(14,122,92,.12); }
.tabla.compacta td, .tabla.compacta th { padding: 6px 8px; }
.tabla.compacta input { height: 32px; padding: 4px 6px; }
.pos-totales { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.pos-totales div { display: flex; justify-content: space-between; padding: 2px 0; }
.pos-totales .grande { font-size: 20px; color: var(--blue); }
.pos-cambio { font-size: 20px; text-align: center; margin: 12px 0 0; }
.g-pos { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
@media (max-width: 1100px) { .g-pos { grid-template-columns: 1fr; } }
.aviso.rojo { background: var(--red-soft); color: var(--red); }
.aviso.verde { background: var(--green-soft); color: var(--green); }
.enlace { background: none; border: 0; padding: 4px; color: var(--blue); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.enlace:hover { text-decoration: underline; }
.kpi.click { cursor: pointer; transition: border-color .15s, transform .15s; }
.kpi.click:hover { border-color: var(--green); transform: translateY(-1px); }
.kpi .num.mal { color: var(--red); } .kpi .num.alerta { color: var(--amber); } .kpi .num.bien { color: var(--green); }
.con-boton { display: flex; gap: 6px; align-items: stretch; }
.con-boton select, .con-boton input { flex: 1; min-width: 0; }
.caja-suave { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.cm-lineas { display: flex; flex-direction: column; gap: 10px; }
.cm-linea { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.cm-linea .campo.ancho { grid-column: 1 / -1; }
.cm-pie { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.grid-den { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.den { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); font-size: 13px; }
.den span { font-weight: 800; }
.den b { font-size: 12px; color: var(--muted); text-align: right; }
.chips .chip.apagado { opacity: .5; text-decoration: line-through; }
.timbrado { display: grid; grid-template-columns: 180px 1fr; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--soft); }
.timbrado-vista { height: 90px; border: 1px dashed var(--line); border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #fff; overflow: hidden; }
.timbrado-vista img { max-width: 100%; max-height: 100%; object-fit: contain; }
@media (max-width: 640px) { .timbrado { grid-template-columns: 1fr; } }
.contador { display: inline-block; min-width: 22px; padding: 1px 7px; margin-left: 6px; border-radius: 11px; background: var(--amber-bar); color: #3A2400; font-size: 12px; font-weight: 800; text-align: center; vertical-align: middle; }
.tabla tr.nueva td { background: color-mix(in srgb, var(--amber-bar) 22%, transparent); }
.tabla tr.nueva td:first-child { box-shadow: inset 3px 0 0 var(--amber-bar); }

/* idioma del CRM (español, inglés, francés) */
.login-idioma { display: flex; justify-content: flex-end; gap: 4px; margin: -12px -12px 8px 0; }
.login-idioma button { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.login-idioma button.on { border-color: var(--blue); background: var(--blue-soft); }
.idioma-app { margin: 0 0 0 auto; }
img.bandera { width: 20px; height: 14px; border-radius: 2px; vertical-align: -2px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.login-idioma img.bandera { margin-right: 2px; }

/* =============================================================== tema oscuro (Preferencias › Apariencia) */
html[data-tema="oscuro"] {
  color-scheme: dark;
  --bg: #0D1714; --card: #14211D; --ink: #E3EEEA; --muted: #93A8A1; --line: #24352F; --soft: #1A2925;
  --primary: #3CCB9A; --primary-2: #2FAF84; --blue: #4FD1A5; --blue-soft: #173A2F;
  --green: #4CC596; --green-soft: #163A2D; --amber: #F2B65E; --amber-bar: #EBB45C; --amber-soft: #3A2C12;
  --red: #F2867A; --red-soft: #3F1F1B; --gray-soft: #22302C; --shadow: 0 1px 2px rgba(0,0,0,.4);
  --texto-nav: #B9CCC5; --muted-2: #8FA59D; --borde-card: #22332D; --borde: #33463F; --borde-fuerte: #47605A; --fila-hover: #1A2925;
  --burbuja-cliente: #22302C; --texto-suave: #B3C4BE; --azul-texto: #7FC4F0; --borde-peligro: #6B2E28; --titulo: #E3EEEA; --lateral: #101C18;
}
h1, h2, h3, .marca-texto b, .marca-nombre { color: var(--titulo); }
html[data-tema="oscuro"] a { color: var(--blue); }
html[data-tema="oscuro"] .pos-prod, html[data-tema="oscuro"] .wa-burbuja { background: var(--card); }
html[data-tema="oscuro"] .timbrado-vista, html[data-tema="oscuro"] .cobro .qr { background: #fff; }
html[data-tema="oscuro"] .burbuja .ops span { background: rgba(255,255,255,.08); border-color: var(--line); }
html[data-tema="oscuro"] .btn.primario { color: #08231A; }
html[data-tema="oscuro"] .marca-nombre span { color: #fff; }

/* =============================================================== menú lateral por grupos (Preferencias › Menú) */
.app { min-height: 100vh; }
.app.lateral { display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.app.lateral.compacto { grid-template-columns: 72px minmax(0, 1fr); }
.app.hidden { display: none !important; }
.principal { min-width: 0; }
.lateral-menu { display: none; }
.app.lateral .lateral-menu { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--lateral); border-right: 1px solid var(--line); padding: 16px 12px; gap: 2px; z-index: 25; }
.lateral-menu .marca { padding: 4px 6px 10px; }
.lateral-grupo { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--ink); padding: 11px 10px;
  display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; cursor: pointer; border-radius: 10px; text-align: left; font-family: inherit; }
.lateral-grupo:hover { background: var(--soft); }
.lateral-grupo > span:first-child { flex: 1; }
.lateral-grupo i { font-style: normal; font-size: 18px; line-height: 1; transition: transform .15s; }
.lateral-bloque.abierto .lateral-grupo i { transform: rotate(90deg); }
.lateral-bloque.abierto .lateral-grupo { color: var(--muted); }
.lateral-grupo .badge { margin-left: 0 !important; letter-spacing: 0; flex: none; }
.lateral-items { display: none; flex-direction: column; gap: 2px; padding-bottom: 6px; }
.lateral-bloque.abierto .lateral-items { display: flex; }
.app.compacto .lateral-items { display: flex; }
.app.compacto .lateral-grupo i, .app.compacto .lateral-grupo .badge { display: none; }
.lateral-menu nav a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--texto-nav);
  font-weight: 650; font-size: 14.5px; white-space: nowrap; position: relative; }
.lateral-menu nav a:hover { background: var(--soft); }
.lateral-menu nav a.activo { background: var(--blue-soft); color: var(--titulo); font-weight: 800; }
.lateral-menu nav a.sub { margin-left: 19px; padding: 7px 8px 7px 12px; border-left: 2px solid var(--line); border-radius: 0 10px 10px 0;
  font-size: 13px; gap: 9px; line-height: 1.25; }
.lateral-menu nav a.sub span { white-space: normal; }
.lateral-menu nav a.sub svg { width: 16px; height: 16px; }
.app.compacto .lateral-menu nav a.sub { margin-left: 0; border-left: 0; border-radius: 10px; padding: 10px 0; }
.lateral-menu nav a svg, .lateral-pie svg { width: 19px; height: 19px; flex-shrink: 0; }
.lateral-menu nav .badge { margin-left: auto; display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--amber-bar);
  color: #3A2400; font-size: 11px; font-weight: 800; text-align: center; }
.lateral-pie { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.lateral-pie button { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; border: 0; background: none; color: var(--texto-nav);
  font: inherit; font-weight: 650; cursor: pointer; text-align: left; }
.lateral-pie button:hover { background: var(--soft); }
.app.compacto .lateral-menu .marca-texto, .app.compacto .lateral-grupo span, .app.compacto .lateral-menu nav a span,
.app.compacto .lateral-pie button span { display: none; }
.app.compacto .lateral-menu nav a, .app.compacto .lateral-pie button { justify-content: center; padding: 10px 0; }
.app.compacto .lateral-menu nav .badge { position: absolute; top: 2px; right: 6px; margin: 0; }
.app.compacto .lateral-grupo { border-top: 1px solid var(--line); padding: 0; margin: 8px 6px; }
.app.compacto .lateral-menu .marca { justify-content: center; }
.app.lateral .topbar .marca, .app.lateral .topbar .nav { display: none; }
.app.lateral .topbar { height: 64px; }
.topbar .titulo-seccion { font-size: 18px; font-weight: 800; color: var(--titulo); flex: 1; display: none; }
.app.lateral .topbar .titulo-seccion { display: block; }
.app.lateral .subbar { display: none; }
.btn-menu { display: none; background: none; border: 0; padding: 8px; border-radius: 10px; color: var(--ink); cursor: pointer; }
.btn-menu svg { width: 22px; height: 22px; }

/* menú de preferencias del usuario (al tocar su nombre) */
.usuario { position: relative; cursor: pointer; border-radius: 12px; padding: 4px 6px; }
.usuario:hover { background: var(--soft); }
.preferencias { position: absolute; right: 0; top: calc(100% + 8px); width: 290px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.22); padding: 12px; z-index: 40; cursor: default; }
.preferencias h4 { margin: 8px 4px 6px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.opciones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.opciones.dos { grid-template-columns: repeat(2, 1fr); }
.opciones button { border: 1px solid var(--borde); background: var(--card); color: var(--ink); border-radius: 10px; padding: 8px 4px; font: inherit;
  font-weight: 700; font-size: 12.5px; cursor: pointer; }
.opciones button.on { border-color: var(--blue); background: var(--blue-soft); color: var(--titulo); }
.preferencias .salir { width: 100%; margin-top: 12px; }

@media (max-width: 900px) {
  .app.lateral, .app.lateral.compacto { grid-template-columns: minmax(0, 1fr); }
  .app.lateral .lateral-menu { position: fixed; left: 0; top: 0; width: 270px; transform: translateX(-105%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .app.lateral.menu-abierto .lateral-menu { transform: none; }
  .app.compacto .lateral-menu .marca-texto, .app.compacto .lateral-grupo span, .app.compacto .lateral-menu nav a span { display: revert; }
  .app.compacto .lateral-menu nav a { justify-content: flex-start; padding: 9px 10px; }
  .app.lateral .btn-menu { display: inline-flex; }
  .usuario-datos { display: none; }
}

/* factura electrónica (DGII) */
.pasos-ecf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.pasos-ecf li { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; font-weight: 600; }
.pasos-ecf li span { font-weight: 800; color: var(--muted); }
.pasos-ecf li.ok { border-color: var(--green); background: var(--green-soft); }
.pasos-ecf li.ok span { color: var(--green); }
.tabs-sub { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }

/* cierre por inactividad */
.aviso-inactividad { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px;
  background: rgba(14, 26, 31, .55); }
.aviso-inactividad .card { max-width: 380px; width: 100%; text-align: center; }
.aviso-inactividad .dos { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }

/* tablas: el título de cada columna ordena (▲ de A a Z, ▼ de Z a A) */
.tabla thead th:not(:empty) { cursor: pointer; user-select: none; white-space: nowrap; }
.tabla thead th:not(:empty):hover { color: var(--texto, #10212B); }
.tabla thead th:not(:empty)::after { content: " ↕"; opacity: .35; font-size: 11px; }
.tabla thead th[data-orden="asc"]::after { content: " ▲"; opacity: 1; }
.tabla thead th[data-orden="desc"]::after { content: " ▼"; opacity: 1; }

/* conexiones: bandera y país */
.pais { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.paises { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: 13px; }
.fila-alerta td { background: #FFF7E6; }

/* aviso (toast) en la capa superior: por encima de las ventanas abiertas */
.toast[popover] { inset: 18px auto auto 50%; margin: 0; border: 0; overflow: visible; max-width: min(92vw, 560px); box-shadow: 0 12px 34px rgba(0,0,0,.28); }
.toast[popover]:not(.ver) { transform: translateX(-50%) translateY(-20px); }

/* escanear códigos con la cámara */
dialog.camara { width: min(520px, 94vw); }
#camara-contenido { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
#camara-contenido h2 { font-size: 19px; }
/* en el teléfono, las cifras de dinero grandes (RD$1,569,130.95) no se salen de la tarjeta */
@media (max-width: 600px) { .g-4 { grid-template-columns: 1fr; } .kpi .num { overflow-wrap: anywhere; } }
.camara-caja { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.camara-caja video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camara-mira { position: absolute; left: 12%; right: 12%; top: 34%; bottom: 34%; border: 3px solid rgba(255, 255, 255, .9);
  border-radius: 10px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .28); pointer-events: none; }

/* ---------- programa de aliados (despacho del contador externo) ---------- */
.al-empresas { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.al-empresa { border: 1px solid var(--borde-card); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; background: var(--card); }
.al-empresa-cab { display: flex; gap: 10px; align-items: center; }
.al-empresa-cab .tag { margin-left: auto; }
.al-icono { font-size: 24px; width: 40px; height: 40px; display: grid; place-items: center; background: var(--blue-soft); border-radius: 10px; flex: none; }
.al-cifras { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.al-cifras div { display: flex; flex-direction: column; background: var(--soft); border-radius: 8px; padding: 6px 8px; }
.al-alertas, .al-calendario { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.al-alertas li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--amber-soft); cursor: pointer; font-size: 14px; }
.al-alertas li:hover { filter: brightness(.97); }
.al-calendario li { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.al-calendario li:last-child { border-bottom: 0; }
.al-calendario li > b { display: flex; flex-direction: column; align-items: center; background: var(--blue-soft); color: var(--primary); border-radius: 10px; padding: 4px 0; font-size: 18px; line-height: 1.1; }
.al-calendario li > b small { font-size: 11px; text-transform: uppercase; }
.al-calendario li em { font-style: normal; font-size: 12px; font-weight: 800; color: var(--muted); }
.al-calendario li.pronto em { color: var(--amber); }
.al-calendario li.urgente em { color: var(--red); }
.al-calendario li.urgente > b { background: var(--red-soft); color: var(--red); }
.al-enlace { display: flex; gap: 6px; }
.al-enlace input { flex: 1; min-width: 0; font-size: 12.5px; }

/* ---------- modo caja: teclado, táctil y cobro rápido (caja.js) ---------- */
.kbd { display: inline-block; min-width: 20px; padding: 0 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
  background: var(--card); color: inherit; font: 600 11px/18px ui-monospace, Consolas, monospace; text-align: center; vertical-align: middle; }
.btn.primario .kbd { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.45); color: #fff; }
.caja-barra { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.segmentado { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.segmentado button { border: 0; background: none; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; color: inherit; }
.segmentado button + button { border-left: 1px solid var(--line); }
.segmentado button.activo { background: var(--blue); color: #fff; font-weight: 700; }
.caja-pie { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); font-size: 12px; color: var(--muted); }
.tabla tr.sel td { background: rgba(14,122,92,.10); }
.tabla tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
.caja-mm { width: 26px; height: 26px; padding: 0; font-weight: 800; }
.pos-cats { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 8px; }
.pos-cats:empty { display: none; }
.pos-cats button { flex: none; border: 1px solid var(--line); border-radius: 999px; background: var(--card); padding: 8px 14px; font: inherit; cursor: pointer; color: inherit; }
.pos-cats button.activo { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 700; }
.caja-billetes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.caja-billetes .btn { min-width: 64px; font-weight: 700; }
.caja-numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; max-width: 320px; }
.caja-numpad button { height: 52px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font: 700 20px/1 inherit; cursor: pointer; color: inherit; }
.caja-numpad button:active { background: rgba(14,122,92,.15); }
.caja-display { width: 100%; max-width: 320px; font-size: 28px; font-weight: 700; text-align: right; }
.caja-devuelta { font-size: 30px; color: var(--blue); }
/* táctil: todo más grande para el dedo */
.pos-tactil .pos-productos { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-height: 64vh; }
.pos-tactil .pos-prod { min-height: 96px; padding: 14px; font-size: 16px; border-radius: 14px; }
.pos-tactil #pos-cuerpo .btn { min-height: 46px; }
.pos-tactil .caja-mm { width: 40px; height: 40px; font-size: 20px; }
.pos-tactil .tabla.compacta input { height: 42px; font-size: 16px; }
.pos-tactil .pos-totales .grande { font-size: 26px; }
.pos-tactil .caja-billetes .btn { min-height: 52px; min-width: 84px; font-size: 18px; }
@media (max-width: 600px) { .caja-pie { display: none; } }
