/* Mostrador · Estilo 4 "Cristal lateral": look Cristal con la estructura del estilo 1 (sidebar) */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--link); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 12px; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.1rem; }
h3 { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-top: 16px; }
button, input, select { font: inherit; color: inherit; }
button { min-height: 46px; padding: 8px 16px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--btn); color: var(--ink); cursor: pointer; font-weight: 600; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
button:hover { border-color: var(--accent); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
kbd { font-family: var(--mono); font-size: 11px; font-weight: 500; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--kbd-bg); color: var(--muted); line-height: 1.5; white-space: nowrap; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; font-weight: 500; }
.marca { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
.sub, small, .cero { color: var(--muted); }
.sub { margin: 2px 0 0; }

/* Shell */
.shell { min-height: 100vh; }
.side { color: var(--side-ink); }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; font-size: 20px; color: var(--mark-ink); background: var(--mark-bg); box-shadow: var(--mark-shadow); flex: none; }
.side .marca { font-size: 1.05rem; font-weight: 800; color: var(--side-strong); }
.side .sub { font-size: .76rem; color: var(--side-muted); }
.menu-toggle { display: none; width: 46px; padding: 0; flex-direction: column; justify-content: center; align-items: center; gap: 5px; background: transparent; border-color: var(--side-line); }
.menu-toggle span { width: 20px; height: 2px; border-radius: 2px; background: var(--side-strong); transition: transform .2s, opacity .2s; }
.menu-abierto .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-abierto .menu-toggle span:nth-child(2) { opacity: 0; }
.menu-abierto .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav { display: flex; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--side-ink); border-radius: var(--r-sm); padding: 0 12px; min-height: 42px; font-weight: 500; font-size: .92rem; white-space: nowrap; }
.nav a:hover { background: var(--nav-hover); text-decoration: none; }
.nav a.is-on { background: var(--nav-on-bg); color: var(--nav-on-ink); box-shadow: var(--nav-on-shadow); }
.nav .ico { width: 18px; text-align: center; opacity: .85; }
.nav .key { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--side-muted); }
.nav-label { color: var(--side-muted); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.side-estado { font-size: .78rem; color: var(--side-muted); }
.side-estado strong { display: flex; align-items: center; gap: 8px; color: var(--ok); }
.side-estado.cerrada strong { color: var(--warn); }
.punto { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 20%, transparent); }
.workspace { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 68px; padding: 12px 32px; }
.top .marca { font-size: 1.1rem; }
.top .sub { font-size: .8rem; }
main { padding: 24px 32px 40px; width: 100%; }
.workspace > .ok, .workspace > .error { margin: 16px 32px 0; }
.quien { display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: .9rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink-soft); display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; }
.link { border: 0; background: transparent; color: var(--muted); min-height: 0; padding: 6px 10px; font-weight: 500; }
.link:hover { color: var(--danger); }

/* Superficies */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.bloque { margin-top: 20px; }
.grilla { display: grid; gap: 18px; }
.grande { font-family: var(--mono); font-size: 2rem; font-weight: 700; margin: 8px 0 4px; letter-spacing: -0.03em; color: var(--ink-strong); }
.emp-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.emp-head h1, .emp-head h2 { margin: 0; }
.emp-head > a { background: var(--accent); color: var(--accent-ink); padding: 0 18px; min-height: 46px; display: inline-flex; align-items: center; border-radius: var(--r-sm); }
.emp-head > a:hover { text-decoration: none; filter: brightness(1.08); }
.emp-head p { display: flex; gap: 12px; align-items: baseline; margin: 0; }
.emp-head p span:first-child { color: var(--muted); font-size: .85rem; }
.emp-head p .num { font-size: 1.25rem; font-weight: 700; }

/* Formularios */
.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-weight: 600; font-size: .88rem; }
input, select { background: var(--input); border: 1px solid var(--line-2); border-radius: var(--r-sm); min-height: 48px; padding: 8px 14px; width: 100%; font-weight: 500; font-size: 16px; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: var(--muted); opacity: .7; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
input[type="number"] { font-family: var(--mono); }
input[type="file"] { padding: 18px; border: 2px dashed var(--accent); background: var(--accent-soft); cursor: pointer; }
fieldset { border: 0; margin: 0 0 14px; padding: 0; min-width: 0; }
legend { margin-bottom: 8px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; font-weight: 500; min-height: 44px; }
.check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); }
fieldset .check { display: inline-flex; margin-right: 8px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: var(--r-sm); cursor: pointer; }
fieldset .check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink-soft); }
.form { max-width: 560px; }
.buscar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; max-width: none; margin-bottom: 16px; }
.buscar .campo { flex: 1; min-width: 200px; margin: 0; }
.confirmar, a.confirmar { background: var(--cta); color: var(--accent-ink); border: 0; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; box-shadow: var(--cta-shadow); }
.confirmar:hover, a.confirmar:hover { filter: brightness(1.08); text-decoration: none; }
.confirmar kbd { background: rgba(255,255,255,.2); color: inherit; border-color: rgba(255,255,255,.35); }
.enlace { padding: 0 20px; min-height: 48px; border-radius: var(--r-sm); }
.aviso { color: var(--warn); background: var(--warn-soft); border-radius: 10px; padding: 8px 12px; font-size: .85rem; }
.error { color: var(--danger); background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); border-radius: var(--r-sm); padding: 10px 14px; margin: 0 0 12px; font-weight: 500; }
.error p { margin: 0; }
.ok { color: var(--ok); background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); border-radius: var(--r-sm); padding: 10px 14px; margin: 0 0 12px; font-weight: 600; }

/* Listas */
.lineas, .coincidencias, .lista { list-style: none; margin: 0; padding: 0; }
.lista { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.panel .lista, dialog .lista { border: 0; box-shadow: none; border-radius: 0; background: transparent; backdrop-filter: none; }
.lista li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); }
.panel .lista li, dialog .lista li { padding: 12px 0; }
.lista li:first-child { border-top: 0; }
.lista li:hover { background: var(--row-hover); }
.lista li > a { display: flex; justify-content: space-between; gap: 12px; width: 100%; align-items: center; color: var(--ink); font-weight: 600; }
.lista small { display: block; font-size: .78rem; margin-top: 2px; }
.lista .num a { margin-left: 14px; font-family: var(--font); }
.lineas li span:first-child, .lista li span:first-child, .lista li div:first-child { flex: 1; min-width: 0; }
.coincidencias:not(:empty) { border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); background: var(--surface-solid); padding: 6px; margin: -6px 0 12px; }
.coincidencias button { width: 100%; text-align: left; border: 0; border-radius: 10px; font-weight: 500; background: transparent; }
.coincidencias button:hover, .coincidencias button:focus-visible { background: var(--accent-soft); }
.fila { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.fila.head { border-top: 0; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; padding-top: 0; }
.fila small { display: block; font-size: .78rem; }
.fila .num { font-size: 1.02rem; font-weight: 700; }
.fila .num.cero { font-weight: 500; }
.empleado { margin-top: 16px; }
.arqueo { margin: 18px 0 0; padding: 14px 18px; background: var(--inset); border-radius: var(--r-sm); }
.arqueo div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.arqueo div:first-child { border-top: 0; }
.arqueo dt { color: var(--muted); } .arqueo dd { font-weight: 700; }
.arqueo dt, .arqueo dd { margin: 0; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; color: var(--muted); flex-wrap: wrap; }
.pager a { padding: 10px 16px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.acciones { display: flex; gap: 14px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.cierre-head { margin-bottom: 8px; }
.cierre-head .marca { font-size: 1.5rem; }

/* Login */
main.login { padding: 0; }
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-hero { position: relative; overflow: hidden; padding: 56px; display: flex; flex-direction: column; }
.login-hero > * { position: relative; z-index: 1; }
.login-hero h2 { margin-top: auto; font-size: 2.8rem; line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; }
.login-form { display: grid; place-items: center; padding: 24px; }
.login .panel > .marca { font-size: 2rem; font-weight: 800; }
.login .panel > .sub { margin-bottom: 26px; }
.login input { min-height: 56px; }
.login .confirmar { width: 100%; min-height: 56px; font-size: 1.05rem; margin-top: 10px; }

/* Venta */
.venta { display: grid; gap: 22px; }
.ticket { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-height: 480px; }
.ticket > .campo { margin: 0; padding: 18px 20px; border-bottom: 1px solid var(--line); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent-ink-soft); }
#codigo { min-height: 66px; font-family: var(--mono); font-size: 1.6rem; font-weight: 700; border: 2px solid var(--accent); box-shadow: 0 0 0 6px var(--ring); }
.scan-hint { display: flex; gap: 12px; flex-wrap: wrap; font-size: .74rem; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 500; }
.scan-hint .vivo { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 700; }
.scan-hint .vivo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulso 1.6s infinite; }
@keyframes pulso { 50% { opacity: .3; } }
.ticket > .coincidencias { margin: 8px 20px; }
.lineas { flex: 1; }
.lineas li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); min-height: 66px; flex-wrap: wrap; }
.lineas li:first-child { border-top: 0; }
.lineas li span:first-child { font-weight: 600; }
.lineas li button { min-height: 44px; width: 44px; padding: 0; color: var(--muted); border-color: transparent; background: transparent; }
.lineas li button:hover { color: var(--danger); background: var(--danger-soft); }
.lineas:empty::before { content: "Escaneá un producto para empezar"; display: grid; place-items: center; min-height: 240px; color: var(--muted); }
.qty { width: 84px; } .precio { width: 116px; } .qty, .precio { min-height: 44px; text-align: center; font-weight: 700; }
.subtotal { display: flex; justify-content: space-between; margin: 0; padding: 18px 20px; border-top: 1px solid var(--line); background: var(--inset); font-weight: 700; font-size: 1.1rem; }
.cobro { display: flex; flex-direction: column; gap: 6px; }
.opciones { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.opciones button { min-height: 80px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; text-align: left; border-radius: var(--r-sm); font-size: .95rem; }
.opciones button[aria-pressed="true"] { background: var(--pay-on-bg); border-color: transparent; color: var(--pay-on-ink); box-shadow: var(--pay-on-shadow); }
.opciones button[aria-pressed="true"] kbd { background: rgba(255,255,255,.18); color: inherit; border-color: rgba(255,255,255,.3); }
.opciones.dos { grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--inset); border-radius: calc(var(--r-sm) + 4px); }
.opciones.dos button { min-height: 50px; align-items: center; border: 0; background: transparent; color: var(--muted); }
.opciones.dos button[aria-pressed="true"] { background: var(--surface-solid); color: var(--ink); box-shadow: var(--shadow); }
#resultado { background: var(--total-bg); color: var(--total-muted); border-radius: var(--r) var(--r) 0 0; padding: 20px 22px 8px; margin-top: 10px; }
#resultado p { display: flex; justify-content: space-between; margin: 0 0 10px; }
#resultado p:first-child { color: var(--total-accent); }
#resultado .cargo { margin: 12px 0 0; padding-top: 14px; border-top: 1px solid var(--total-line); color: var(--total-ink); flex-direction: column; gap: 2px; }
#resultado .cargo span:first-child { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--total-muted); font-weight: 600; }
#resultado .cargo output { font-size: 2.6rem; font-weight: 700; text-align: left; letter-spacing: -0.03em; }
.cobro > .confirmar { min-height: 66px; font-size: 1.15rem; border-radius: 0 0 var(--r) var(--r); margin: 0; }
#resultado[hidden] ~ .confirmar { border-radius: var(--r); }
.cargo { font-weight: 700; font-size: 1.15rem; display: flex; justify-content: space-between; }
#cliente-campo { padding: 14px; background: var(--inset); border-radius: var(--r-sm); margin-bottom: 8px; }
dialog { border: 0; padding: 0; background: transparent; width: min(480px, calc(100vw - 24px)); color: var(--ink); }
dialog::backdrop { background: rgba(5, 10, 20, .55); backdrop-filter: blur(4px); }
dialog .panel { margin: 0; padding: 26px; box-shadow: var(--shadow-lg); background: var(--surface-solid); }
dialog .panel > .marca { font-size: 1.3rem; margin-bottom: 10px; }
dialog .cargo { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 1.4rem; }
.dialog-acciones { display: flex; gap: 10px; margin-top: 20px; }
.dialog-acciones button { flex: 1; min-height: 54px; }

@media (min-width: 1000px) {
    .venta { grid-template-columns: minmax(0, 1.5fr) minmax(360px, 1fr); align-items: start; }
    .cobro { position: sticky; top: var(--sticky-top); }
    .grilla { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 640px) and (max-width: 999px) { .grilla { grid-template-columns: 1fr 1fr; } }

/* Móvil */
@media (max-width: 860px) {
    .shell { display: block; }
    .side { position: sticky !important; top: 0; z-index: 30; height: auto !important; width: auto !important; padding: 10px 14px !important; display: block !important; border-radius: 0 !important; margin: 0 !important; }
    .menu-toggle { display: inline-flex; }
    .side .nav, .side .side-estado { display: none !important; }
    .menu-abierto .side .nav { display: flex !important; flex-direction: column; gap: 2px; margin-top: 10px; max-height: calc(100vh - 80px); overflow-y: auto; padding-bottom: 8px; }
    .menu-abierto .side .side-estado { display: block !important; margin-top: 8px; }
    .menu-abierto .side .nav-label { display: block !important; margin: 12px 12px 4px; }
    .nav a { min-height: 50px; font-size: 1rem; }
    .top { position: static !important; padding: 12px 16px; min-height: 0; flex-wrap: wrap; }
    .quien { border: 0 !important; padding: 0 !important; }
    main { padding: 16px 14px 32px; }
    .workspace > .ok, .workspace > .error { margin: 12px 14px 0; }
    .panel { padding: 16px; }
    /* Listas anchas → tarjetas */
    .lista { background: transparent; border: 0; box-shadow: none; backdrop-filter: none; display: grid; gap: 10px; overflow: visible; }
    .lista > li { flex-wrap: wrap; align-items: flex-start; background: var(--surface-solid); border: 1px solid var(--line) !important; border-radius: var(--r-sm); padding: 14px 16px; box-shadow: var(--shadow); }
    .lista > li .num { text-align: left; }
    .lista > li > a { flex-wrap: wrap; }
    .panel .lista > li, dialog .lista > li { box-shadow: none; }
    .emp-head > a, .buscar button { width: 100%; justify-content: center; }
    .buscar .campo { min-width: 100%; }
    .form { max-width: none; }
    .opciones { grid-template-columns: 1fr; }
    .opciones button { min-height: 64px; flex-direction: row; align-items: center; justify-content: space-between; font-size: 1.05rem; padding: 0 20px; }
    .ticket { min-height: 0; }
    .lineas:empty::before { min-height: 120px; }
    #codigo { font-size: 1.25rem; min-height: 60px; }
    .scan-hint span:not(.vivo) { display: none; }
    #resultado .cargo output { font-size: 2.2rem; }
    .cobro > .confirmar { min-height: 72px; }
    .login { grid-template-columns: 1fr; }
    .login-hero { padding: 28px 22px; min-height: 0; }
    .login-hero h2 { font-size: 1.8rem; margin-top: 28px; }
    .login-hero p { display: none; }
    .login-form { place-items: start center; padding: 28px 20px; }
    .dialog-acciones { flex-direction: column-reverse; }
}
@media print {
    .side, .quien form, form, .link, .top .quien, .menu-toggle { display: none !important; }
    .shell { display: block; }
    body, .workspace, .panel { background: #fff !important; color: #000; box-shadow: none; }
}

/* ---- Tema ---- */
:root {
    color-scheme: light;
    --font: "Manrope", system-ui, "Segoe UI", Roboto, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
    --bg: #eef4fb; --ink: #0f2a3d; --ink-strong: #0b2233; --muted: #5b7186;
    --surface: rgba(255, 255, 255, .62); --surface-solid: #ffffff; --input: rgba(255, 255, 255, .85); --btn: rgba(255, 255, 255, .7); --inset: rgba(232, 242, 250, .7); --kbd-bg: rgba(255,255,255,.8);
    --line: rgba(15, 42, 61, .08); --line-2: rgba(15, 42, 61, .16); --row-hover: rgba(255, 255, 255, .55);
    --accent: #0891b2; --accent-ink: #ffffff; --accent-soft: rgba(8, 145, 178, .1); --accent-ink-soft: #0e7490; --link: #0e7490;
    --ring: rgba(6, 182, 212, .22);
    --cta: linear-gradient(135deg, #06b6d4, #3b82f6); --cta-shadow: 0 12px 24px -10px rgba(59, 130, 246, .6);
    --ok: #0f766e; --ok-soft: rgba(20, 184, 166, .12); --warn: #b45309; --warn-soft: rgba(251, 191, 36, .15); --danger: #e11d48; --danger-soft: rgba(244, 63, 94, .1);
    --r: 22px; --r-sm: 14px;
    --shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 8px 30px -12px rgba(15, 42, 61, .18);
    --shadow-lg: 0 30px 60px -20px rgba(15, 42, 61, .35);
    --blur: blur(18px) saturate(160%);
    --side-ink: #335066; --side-strong: #0f2a3d; --side-muted: #7b90a3; --side-line: rgba(15,42,61,.14);
    --nav-hover: rgba(255,255,255,.6); --nav-on-bg: #ffffff; --nav-on-ink: #0e7490; --nav-on-shadow: 0 4px 14px -6px rgba(8,145,178,.45);
    --mark-bg: linear-gradient(135deg, #22d3ee, #3b82f6); --mark-ink: #fff; --mark-shadow: 0 8px 20px -8px rgba(59,130,246,.7);
    --pay-on-bg: linear-gradient(135deg, #06b6d4, #3b82f6); --pay-on-ink: #fff; --pay-on-shadow: 0 10px 24px -10px rgba(59,130,246,.7);
    --total-bg: linear-gradient(160deg, rgba(255,255,255,.9), rgba(224,242,254,.9)); --total-ink: #0b2233; --total-muted: #5b7186; --total-accent: #0e7490; --total-line: rgba(15,42,61,.1);
    --sticky-top: 96px;
}
body { background:
    radial-gradient(900px 600px at -10% -10%, rgba(103, 232, 249, .45), transparent 60%),
    radial-gradient(800px 600px at 110% 10%, rgba(147, 197, 253, .5), transparent 60%),
    radial-gradient(700px 500px at 50% 120%, rgba(153, 246, 228, .45), transparent 60%), var(--bg);
    background-attachment: fixed; }
/* Sidebar de vidrio (estructura del estilo 1) */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.side { position: sticky; top: 0; height: 100vh; z-index: 20; display: flex; flex-direction: column; padding: 22px 14px; overflow-y: auto; background: rgba(255,255,255,.55); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-right: 1px solid rgba(255,255,255,.8); box-shadow: 8px 0 30px -20px rgba(15,42,61,.3); }
.side-head { padding: 0 4px; }
.side .nav { flex-direction: column; margin-top: 10px; }
.nav-label { margin: 18px 12px 6px; }
.nav a.is-on .ico { color: #0891b2; }
.side-estado { margin-top: auto; padding: 12px; border-radius: 16px; background: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.9); box-shadow: var(--shadow); }
.side-estado strong { margin-bottom: 2px; }
.top { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.45); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-bottom: 1px solid rgba(255,255,255,.7); }
.top .marca { font-size: 1.2rem; font-weight: 800; }
.quien { padding-left: 16px; border-left: 1px solid var(--line); }
.panel { border-color: rgba(255,255,255,.75); }
.grilla .panel { border-top: 3px solid transparent; background-image: linear-gradient(var(--surface), var(--surface)), linear-gradient(90deg, #22d3ee, #3b82f6); background-origin: border-box; background-clip: padding-box, border-box; }
.grande { background: linear-gradient(135deg, #0e7490, #2563eb); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ticket > .campo { background: linear-gradient(180deg, rgba(207, 250, 254, .5), transparent); }
#resultado { border: 1px solid rgba(255,255,255,.9); border-bottom: 0; }
.fila:not(.head) > span:first-child { font-weight: 600; }
/* Login */
.login { background: transparent; }
.login-hero { margin: 20px; border-radius: 28px; background: linear-gradient(150deg, rgba(34,211,238,.85), rgba(59,130,246,.9)); color: #fff; box-shadow: 0 30px 60px -30px rgba(37,99,235,.7); }
.login-hero::after { content: ""; position: absolute; inset: auto -120px -120px auto; width: 380px; height: 380px; border-radius: 50%; background: rgba(255,255,255,.18); }
.login-hero .marca, .login-hero .sub { color: #fff; }
.login-hero .brand-mark { background: rgba(255,255,255,.25); box-shadow: none; }
.login-hero h2 span { color: #cffafe; }
.login-hero p { color: rgba(255,255,255,.85); max-width: 420px; }
.login .panel { width: min(420px, 100%); padding: 34px; }
@media (max-width: 860px) {
    .shell { display: block; }
    .side { background: rgba(255,255,255,.85); border-right: 0; border-bottom: 1px solid rgba(255,255,255,.8); }
    .top { position: static; background: transparent; border: 0; }
    .top .marca { font-size: 1.3rem; }
    .login-hero { margin: 12px; border-radius: 22px; }
    .login .panel { padding: 22px; }
}
@media (max-width: 860px) {
    .lineas li > span:first-child { flex: 1 1 100%; }
    .lineas li { gap: 10px; }
    .login-hero .brand p { display: block; }
}

/* Barra lateral contraíble (solo escritorio) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rail-toggle { width: 34px; min-height: 34px; padding: 0; border-radius: 10px; flex: none; background: rgba(255,255,255,.7); border-color: var(--line-2); color: var(--accent-ink-soft); font-size: 1rem; line-height: 1; transition: transform .25s ease; }
@media (min-width: 861px) {
    .shell { transition: grid-template-columns .25s ease; }
    .side, .nav a, .brand, .side-estado { transition: padding .25s ease, width .25s ease, opacity .2s ease; }
    .side-rail .shell { grid-template-columns: 76px minmax(0, 1fr); }
    .side-rail .side { padding: 18px 10px; overflow: visible; }
    .side-rail .side-head { flex-direction: column; gap: 12px; padding: 0; }
    .side-rail .brand > div, .side-rail .nav .txt, .side-rail .nav .key { display: none; }
    .side-rail .rail-toggle { transform: rotate(180deg); }
    .side-rail .nav-label { font-size: 0; margin: 12px 0 6px; height: 1px; background: var(--line-2); }
    .side-rail .nav a { justify-content: center; padding: 0; position: relative; }
    .side-rail .nav .ico { width: auto; font-size: 1.1rem; }
    .side-rail .nav a::after { content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translate(-4px, -50%); opacity: 0; pointer-events: none; white-space: nowrap; padding: 6px 12px; border-radius: 10px; font-size: .82rem; font-weight: 600; color: #fff; background: linear-gradient(135deg, #0891b2, #2563eb); box-shadow: var(--shadow-lg); transition: opacity .15s, transform .15s; z-index: 50; }
    .side-rail .nav a:hover::after, .side-rail .nav a:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
    .side-rail .side-estado { padding: 10px 0; display: grid; place-items: center; }
    .side-rail .side-estado > span, .side-rail .side-estado strong { font-size: 0; gap: 0; }
    .side-rail .side-estado .punto { width: 10px; height: 10px; }
}
@media (max-width: 860px) { .rail-toggle { display: none; } }

/* Venta realizada */
dialog.exito { width: min(400px, calc(100vw - 24px)); }
dialog.exito .panel { text-align: center; padding: 32px 28px 22px; background: rgba(255,255,255,.82); backdrop-filter: blur(22px) saturate(170%); -webkit-backdrop-filter: blur(22px) saturate(170%); border: 1px solid rgba(255,255,255,.95); animation: exito-in .35s cubic-bezier(.2,1.3,.4,1); }
dialog.exito::backdrop { background: rgba(14, 116, 144, .18); backdrop-filter: blur(6px); }
.exito-check { width: 76px; height: 76px; display: block; margin: 0 auto 14px; filter: drop-shadow(0 10px 18px rgba(37,99,235,.35)); }
.exito-check circle { fill: #0891b2; stroke: none; transform-origin: center; animation: exito-pop .45s ease-out both; }
.exito-check path { fill: none; stroke: #fff; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: exito-trazo .4s .3s ease-out forwards; }
dialog.exito .marca { font-size: 1.4rem; font-weight: 800; }
.exito-total { text-align: center; font-size: 2.6rem; font-weight: 700; margin: 10px 0 4px; background: linear-gradient(135deg, #0e7490, #2563eb); -webkit-background-clip: text; background-clip: text; color: transparent; }
dialog.exito .arqueo { text-align: left; }
.exito-barra { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 18px 0 10px; }
.exito-barra span { display: block; height: 100%; background: linear-gradient(90deg, #22d3ee, #3b82f6); transform-origin: left; }
dialog.exito[open] .exito-barra span { animation: exito-cuenta 30s linear forwards; }
.exito-ayuda { font-size: .8rem; }
@keyframes exito-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes exito-pop { from { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); } }
@keyframes exito-trazo { to { stroke-dashoffset: 0; } }
@keyframes exito-cuenta { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { dialog.exito .panel, .exito-check circle, .exito-check path { animation: none; stroke-dashoffset: 0; } }

/* Empleados */
.emp-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.emp-buscar input { min-width: 300px; padding-left: 40px; background: rgba(255,255,255,.8) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%235b7186' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='M13 13l4 4'/%3E%3C/svg%3E") no-repeat 14px center; }
.emp-tools .confirmar { min-height: 48px; padding: 0 20px; }
.tabla-emp { padding: 0; overflow: hidden; }
.tabla-emp-head, .tabla-emp-fila { display: grid; grid-template-columns: minmax(200px, 1.6fr) 1fr 120px 120px minmax(250px, auto); gap: 14px; align-items: center; padding: 0 22px; }
.tabla-emp-head { min-height: 46px; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--inset); border-bottom: 1px solid var(--line); }
.tabla-emp-fila { min-height: 66px; border-top: 1px solid var(--line); transition: background .15s; }
.tabla-emp-head + .tabla-emp-fila { border-top: 0; }
.tabla-emp-fila:hover { background: var(--row-hover); }
.tabla-emp .der { text-align: right; }
.emp-nombre { display: flex; align-items: center; gap: 12px; min-width: 0; }
.emp-nombre strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-usuario { font-family: var(--mono); font-size: .88rem; color: var(--muted); }
.emp-acciones { display: flex; gap: 8px; justify-content: flex-end; }
.emp-acciones button { min-height: 40px; padding: 0 14px; font-size: .85rem; background: rgba(255,255,255,.75); }
.tabla-emp-vacia { padding: 22px; }
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-dueno { color: #4338ca; background: rgba(99,102,241,.12); }
.badge-cajero { color: #0e7490; background: rgba(8,145,178,.12); }
.badge-ok { color: #0f766e; background: rgba(20,184,166,.14); }
.badge-off { color: #64748b; background: rgba(100,116,139,.14); }
dialog.cristal { width: min(500px, calc(100vw - 24px)); }
dialog.cristal::backdrop { background: rgba(14, 116, 144, .18); backdrop-filter: blur(6px); }
dialog.cristal .panel { background: rgba(255,255,255,.85); backdrop-filter: blur(22px) saturate(170%); -webkit-backdrop-filter: blur(22px) saturate(170%); border: 1px solid rgba(255,255,255,.95); animation: exito-in .3s cubic-bezier(.2,1.2,.4,1); }
dialog.cristal .marca { font-size: 1.3rem; font-weight: 800; margin-bottom: 14px; }
dialog.cristal .marca + .sub { margin: -8px 0 16px; }
.dos-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.solo-lectura { background: var(--inset); color: var(--muted); font-family: var(--mono); cursor: not-allowed; }
.interruptor { gap: 12px; }
@media (max-width: 860px) {
    .emp-tools, .emp-buscar { width: 100%; }
    .emp-buscar input { min-width: 0; }
    .emp-tools .confirmar { width: 100%; }
    .tabla-emp { background: transparent; border: 0; box-shadow: none; backdrop-filter: none; display: grid; gap: 12px; overflow: visible; }
    .tabla-emp-head { display: none; }
    .tabla-emp-fila { grid-template-columns: 1fr auto; gap: 10px 12px; padding: 16px; min-height: 0; border: 1px solid rgba(255,255,255,.85) !important; border-radius: var(--r-sm); background: var(--surface-solid); box-shadow: var(--shadow); }
    .tabla-emp-fila[hidden] { display: none; }
    .emp-nombre { grid-column: 1 / -1; }
    .emp-usuario { grid-column: 1 / -1; padding-left: 48px; margin-top: -8px; }
    .tabla-emp-fila > [data-label="Rol"] { padding-left: 48px; }
    .emp-acciones { grid-column: 1 / -1; justify-content: stretch; }
    .emp-acciones button { flex: 1; min-height: 48px; font-size: .92rem; }
    .dos-col { grid-template-columns: 1fr; gap: 0; }
}

/* Clientes */
.tabla-cli .tabla-emp-head, .tabla-cli .tabla-emp-fila { grid-template-columns: minmax(190px, 1.5fr) 120px 140px minmax(170px, 1fr) 100px minmax(190px, auto); }
.cli-saldo { display: flex; flex-direction: column; gap: 6px; }
.cli-saldo-num { display: flex; align-items: baseline; gap: 8px; }
.cli-saldo-num .num { text-align: left; font-weight: 700; }
.cli-debe { color: #b45309; }
.cli-barra { display: block; height: 5px; border-radius: 5px; background: var(--line); overflow: hidden; max-width: 160px; }
.cli-barra span { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #22d3ee, #3b82f6); }
.cli-barra.alta span { background: linear-gradient(90deg, #f59e0b, #e11d48); }
.emp-acciones button:disabled { opacity: .45; }
main > .aviso { margin: 0 0 14px; }
@media (max-width: 860px) {
    .tabla-cli .tabla-emp-fila { grid-template-columns: 1fr auto; }
    .tabla-cli .emp-usuario { grid-column: auto; padding-left: 48px; margin-top: -8px; }
    .tabla-cli .emp-usuario[data-label="Teléfono"] { padding-left: 0; text-align: right; }
    .tabla-cli .cli-saldo { padding-left: 48px; }
    .tabla-cli .tabla-emp-fila > [data-label="Rol"] { padding-left: 0; }
}
