:root {
    --green: #0f9f6e;
    --green-soft: #e8fff5;
    --red: #ef4444;
    --red-soft: #fff0f0;
    --amber: #f59e0b;
    --amber-soft: #fff8e8;
    --blue: #2563eb;
    --blue-soft: #eef4ff;
    --ink: #101827;
    --muted: #687386;
    --line: #e6eaf0;
    --panel: #ffffff;
    --bg: #f8fafc;
    --shadow: 0 18px 45px rgba(16, 24, 39, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: #fff;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; background: var(--bg); }
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    background: #fff;
    border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 20px; }
.brand img { width: 42px; height: 42px; filter: drop-shadow(0 8px 18px rgba(15, 159, 110, .24)); }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 8px;
    color: #334155;
    font-weight: 700;
    font-size: 14px;
    transition: .2s ease;
}
.sidebar nav a:hover { background: var(--green-soft); color: var(--green); transform: translateX(3px); }
.nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    position: relative;
    background: var(--blue-soft);
}
.nav-icon::after { content: ""; width: 13px; height: 13px; display: block; background: var(--blue); mask-size: contain; mask-repeat: no-repeat; mask-position: center; }
.nav-icon.home::after { mask-image: linear-gradient(#000, #000); border-radius: 3px 3px 2px 2px; transform: rotate(45deg); }
.nav-icon.ball { background: #f7f7f8; }
.nav-icon.ball::after { width: 18px; height: 18px; border-radius: 50%; background: #111827; mask-image: none; box-shadow: inset 0 0 0 5px #fff; }
.nav-icon.receipt { background: var(--amber-soft); }
.nav-icon.receipt::after { background: var(--amber); mask-image: linear-gradient(#000, #000); border-radius: 2px; }
.nav-icon.box { background: #fff6ed; }
.nav-icon.box::after { background: #ea580c; mask-image: linear-gradient(#000, #000); clip-path: polygon(50% 0, 100% 22%, 100% 78%, 50% 100%, 0 78%, 0 22%); }
.nav-icon.cash { background: var(--green-soft); }
.nav-icon.cash::after { background: var(--green); mask-image: linear-gradient(#000, #000); border-radius: 50%; }
.nav-icon.chart { background: var(--blue-soft); }
.nav-icon.chart::after { background: var(--blue); mask-image: linear-gradient(#000, #000); clip-path: polygon(0 100%, 0 45%, 22% 45%, 22% 100%, 38% 100%, 38% 18%, 60% 18%, 60% 100%, 76% 100%, 76% 0, 100% 0, 100% 100%); }
.nav-icon.gear { background: var(--red-soft); }
.nav-icon.gear::after { background: var(--red); mask-image: linear-gradient(#000, #000); border-radius: 50%; box-shadow: 0 0 0 4px var(--red); transform: scale(.45); }
.sidebar-user { margin-top: auto; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fafafa; display: grid; gap: 3px; }
.sidebar-user span { color: var(--muted); font-size: 13px; }
.sidebar-user a { margin-top: 8px; color: var(--red); font-weight: 800; }
.content { padding: 22px; max-width: 1500px; width: 100%; }

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 18% 15%, rgba(15,159,110,.08), transparent 28%),
        radial-gradient(circle at 82% 88%, rgba(37,99,235,.08), transparent 26%),
        #fff;
}
.auth-card { width: min(920px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 34px; }
.auth-logo { width: 96px; height: auto; display: block; margin-bottom: 18px; }

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(24px, 3vw, 36px); margin-bottom: 6px; }
h2 { font-size: 18px; margin-bottom: 12px; }
.muted { color: var(--muted); }
.eyebrow { color: var(--green); font-weight: 900; text-transform: uppercase; font-size: 12px; margin-bottom: 8px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.hero-panel {
    display: grid;
    grid-template-columns: 1fr minmax(240px, 380px);
    align-items: center;
    gap: 22px;
    padding: 28px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    margin-bottom: 22px;
    overflow: hidden;
}
.hero-panel img { width: 100%; animation: floatCue 5s ease-in-out infinite; }

.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.metric { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid; gap: 6px; box-shadow: 0 10px 28px rgba(16,24,39,.05); }
.metric span { width: 34px; height: 34px; border-radius: 50%; display: block; position: relative; }
.metric span::after { content: ""; position: absolute; inset: 9px; background: #fff; border-radius: 50%; }
.metric strong { font-size: 22px; }
.metric small { color: var(--muted); font-weight: 800; }
.metric.green span { background: var(--green); }
.metric.red span { background: var(--red); }
.metric.amber span { background: var(--amber); }
.metric.blue span { background: var(--blue); }
.metric.black span { background: #111827; }

.split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr); gap: 18px; margin-bottom: 22px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel, .list-panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px rgba(16,24,39,.05); padding: 18px; }
.list-row { display: flex; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row small { display: block; color: var(--muted); }

.btn {
    border: 0;
    border-radius: 8px;
    padding: 9px 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 900;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(16,24,39,.12); }
.btn.primary { background: var(--green); color: #fff; }
.btn.success { background: #111827; color: #fff; }
.btn.danger { background: var(--red); color: #fff; }
.btn.amber { background: var(--amber); color: #111827; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.wide { width: 100%; }
.btn.mini { padding: 8px 10px; font-size: 13px; }
.icon-btn { border: 0; background: var(--red-soft); color: var(--red); width: 28px; height: 28px; border-radius: 50%; font-size: 18px; cursor: pointer; }

.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 14px; }
.table-grid.compact { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.pool-card {
    position: relative;
    display: grid;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    min-height: 0;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(16,24,39,.06);
    transition: .2s ease;
}
.pool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pool-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--green); }
.pool-card.occupied::before { background: var(--red); }
.pool-card.pending_payment::before { background: var(--amber); }
.pool-card-top { display: flex; justify-content: space-between; gap: 12px; position: relative; z-index: 1; }
.pool-card-top strong { display: block; font-size: 17px; }
.pool-card-top span { color: var(--muted); font-size: 13px; font-weight: 800; }
.status-pill { padding: 6px 10px; background: #f1f5f9; border-radius: 999px; text-transform: capitalize; }
.pool-visual {
    min-height: 88px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.22), transparent),
        linear-gradient(145deg, #15805a, #0f9f6e);
    border: 8px solid #7a4a28;
    position: relative;
    overflow: hidden;
}
.pool-visual::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(255,255,255,.28); border-radius: 6px; }
.ball {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #111827;
    font-size: 12px;
    font-weight: 1000;
    position: absolute;
    box-shadow: inset -5px -5px 10px rgba(0,0,0,.18), 0 7px 12px rgba(0,0,0,.18);
}
.ball::before { content: ""; position: absolute; width: 15px; height: 15px; background: #fff; border-radius: 50%; z-index: 0; }
.ball-1 { background: #facc15; left: 25%; top: 24px; }
.ball-2 { background: #2563eb; color: #fff; left: 45%; top: 40px; }
.ball-8 { background: #111827; color: #fff; right: 24%; top: 30px; }
.cue-line { position: absolute; width: 112px; height: 4px; background: #ead2a7; left: 12px; bottom: 18px; transform: rotate(-14deg); transform-origin: left center; border-radius: 99px; }
.timer { font-size: 26px; font-weight: 1000; padding: 10px; background: var(--red-soft); color: var(--red); border-radius: 8px; text-align: center; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
.calc-box { display: flex; justify-content: space-between; align-items: center; padding: 14px; background: var(--amber-soft); border-radius: 8px; }
.calc-box strong { font-size: 24px; }

.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 18px; align-items: start; }
.category-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 14px; cursor: pointer; font-weight: 900; color: #334155; }
.chip.active, .chip:hover { background: var(--chip, var(--green)); color: #fff; border-color: transparent; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.product-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid; gap: 8px; box-shadow: 0 10px 26px rgba(16,24,39,.05); transition: .18s ease; }
.product-card:hover { transform: translateY(-2px); }
.product-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, white); color: var(--accent); font-weight: 1000; }
.product-card span, .product-card small { color: var(--muted); font-size: 12px; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stock-low { color: var(--red) !important; font-weight: 900; animation: blinkSoft 1.8s ease-in-out infinite; }
.qty { width: 72px; }
.cart-panel { position: sticky; top: 18px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; box-shadow: var(--shadow); }
.cart-items { display: grid; gap: 10px; max-height: 50vh; overflow: auto; padding-right: 4px; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px; background: #f8fafc; border-radius: 8px; }
.cart-item small { color: var(--muted); display: block; margin-top: 3px; }
.cart-item > div:last-child { text-align: right; display: grid; gap: 6px; justify-items: end; }
.totals { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 8px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 22px; color: var(--green); }
.charge-form { display: grid; gap: 12px; margin-top: 16px; }

label { display: grid; gap: 6px; color: #334155; font-weight: 850; }
input, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
    color: var(--ink);
    outline: none;
}
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(15,159,110,.12); }
.stack-form, .form-grid { display: grid; gap: 14px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid section { display: grid; gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.rate-row { display: grid; grid-template-columns: 1fr 130px 58px auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.inline-filter { display: flex; gap: 8px; align-items: center; }

.data-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: #475569; font-size: 13px; text-transform: uppercase; }
.row-alert { background: #fff7f7; }
.dot { width: 10px; height: 10px; background: var(--dot); border-radius: 50%; display: inline-block; margin-right: 8px; }
.flash-stack { display: grid; gap: 8px; margin-bottom: 16px; }
.flash { border-radius: 8px; padding: 12px 14px; font-weight: 850; border: 1px solid var(--line); background: #fff; }
.flash.success { background: var(--green-soft); border-color: #a8efd2; color: #06704d; }
.flash.error { background: var(--red-soft); border-color: #fecaca; color: #b91c1c; }
.success-panel { background: var(--green-soft); }

.ticket-body { background: #fff; }
.ticket { width: 320px; margin: 20px auto; color: #111; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ticket-head { text-align: center; border-bottom: 1px dashed #111; padding-bottom: 10px; }
.ticket-head img { width: 78px; max-height: 64px; object-fit: contain; }
.ticket-head h1 { font-size: 18px; margin: 5px 0; }
.ticket-meta { display: grid; gap: 3px; padding: 9px 0; font-size: 12px; border-bottom: 1px dashed #111; }
.ticket table th, .ticket table td { font-size: 12px; padding: 6px 0; white-space: normal; }
.ticket table th, .ticket table td:first-child { font-weight: 900; }
.ticket-meta strong { font-weight: 900; }
.ticket-total { padding: 8px 0; border-top: 1px dashed #111; display: grid; gap: 4px; }
.ticket-total div { display: flex; justify-content: space-between; }
.thanks { text-align: center; font-weight: 900; margin-top: 12px; }
.ticket-actions { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }

@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.22); } 50% { box-shadow: 0 0 0 9px rgba(239,68,68,0); } }
@keyframes floatCue { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-8px) rotate(1deg); } }
@keyframes blinkSoft { 0%,100% { opacity: 1; } 50% { opacity: .58; } }

@media (max-width: 1050px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; }
    .sidebar nav { grid-template-columns: repeat(3, 1fr); }
    .pos-layout, .split, .hero-panel { grid-template-columns: 1fr; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cart-panel { position: static; }
}

@media (max-width: 650px) {
    .content { padding: 16px; }
    .sidebar { padding: 16px; }
    .sidebar nav { grid-template-columns: 1fr; }
    .page-head, .inline-filter { align-items: stretch; flex-direction: column; }
    .form-grid { grid-template-columns: 1fr; }
    .metric-grid { grid-template-columns: 1fr; }
    .rate-row { grid-template-columns: 1fr; }
    .hero-panel { padding: 18px; }
}

@media print {
    body { background: #fff; }
    .no-print { display: none !important; }
    .ticket { margin: 0; width: 72mm; }
}


/* Ajustes visuales V1.1: imagenes optimizadas, menu con bolas y vista compacta */
body { font-size: 14px; }
.nav-ball {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: inline-block;
    flex: 0 0 28px;
    filter: drop-shadow(0 4px 7px rgba(16,24,39,.16));
}
.hero-table-img {
    max-height: 260px;
    object-fit: contain;
}
.pool-card p { margin-bottom: 0; font-size: 13px; color: var(--muted); font-weight: 700; }
.pool-visual.pool-visual-image {
    min-height: 112px;
    aspect-ratio: 16 / 8.8;
    border: 0;
    background: #0b1118;
    display: block;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(16,24,39,.08);
}
.table-grid.compact .pool-visual.pool-visual-image { min-height: 82px; }
.pool-visual.pool-visual-image::before { display: none; }
.pool-visual.pool-visual-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.pool-visual.pool-visual-image.tejo img { object-fit: contain; }
.status-pill { padding: 5px 8px; font-size: 12px; font-weight: 800; }
.page-head { margin-bottom: 16px; }
.panel, .list-panel, .cart-panel { padding: 14px; }
.list-row { padding: 10px 0; }
.product-card { padding: 12px; gap: 6px; }
.product-grid { gap: 12px; }
.category-strip { gap: 8px; margin-bottom: 12px; }
.chip { padding: 8px 12px; }
th, td { padding: 10px; }

@media (max-width: 1050px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { height: auto; }
}
.hero-panel { padding: 22px; gap: 18px; margin-bottom: 16px; }
.metric-grid { margin-bottom: 16px; }
.split { gap: 14px; }
.sidebar-user { padding: 12px; }

/* Ajustes V2: inicio operativo, meseras, productos con imagen y vista más compacta */
.hero-panel.hero-compact {
    grid-template-columns: 1fr minmax(180px, 300px);
    padding: 14px 18px;
    gap: 14px;
    margin-bottom: 14px;
}
.hero-panel.hero-compact h1 { font-size: clamp(24px, 2.4vw, 32px); margin-bottom: 4px; }
.hero-panel.hero-compact .eyebrow { margin-bottom: 5px; }
.hero-panel.hero-compact .muted { margin-bottom: 0; }
.hero-table-img {
    max-height: 150px;
    object-fit: contain;
    background: transparent;
    animation: none !important;
}
.dashboard-tables .pool-card { padding: 11px; gap: 8px; }
.dashboard-tables .pool-card-top strong { font-size: 15px; }
.dashboard-tables .pool-card-top span { font-size: 12px; }
.dashboard-tables .timer { font-size: 20px; padding: 8px; }
.pool-visual.pool-visual-image {
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
}
.pool-visual.pool-visual-image img {
    object-fit: contain;
    background: transparent;
}
button.pool-visual { width: 100%; appearance: none; }
.action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.action-row form { margin: 0; }
.action-row .btn { width: 100%; }
.compact-calc { padding: 10px; }
.compact-calc strong { font-size: 18px; }
.waitress-card {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}
.waitress-card.small { padding: 6px; }
.waitress-card img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    border: 1px solid var(--line);
}
.waitress-card small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}
.waitress-card strong { display: block; font-size: 14px; }
.waitress-card span { color: var(--muted); font-size: 12px; }
.waitress-list { display: grid; gap: 8px; margin-bottom: 14px; }
.settings-waitress { justify-content: space-between; }
.settings-waitress > div { flex: 1; }
.settings-waitress.inactive { opacity: .6; }
.modal-backdrop[hidden] { display: none; }
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, .54);
}
.modal-card {
    width: min(420px, 100%);
    position: relative;
    background: #fff;
    border-radius: 10px;
    border: 1px solid var(--line);
    box-shadow: 0 24px 60px rgba(15, 23, 42, .24);
    padding: 20px;
}
.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: var(--red-soft);
    color: var(--red);
    font-size: 20px;
    cursor: pointer;
}
.product-photo {
    width: 100%;
    height: 78px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.table-thumb {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--line);
    background: #fff;
    display: inline-grid;
    place-items: center;
    font-weight: 900;
    color: var(--green);
}
.table-thumb.placeholder { background: var(--green-soft); }
.compact-form { margin-top: 14px; }

@media (max-width: 1050px) {
    .hero-panel.hero-compact { grid-template-columns: 1fr; }
    .hero-table-img { max-height: 130px; }
}
@media (max-width: 650px) {
    .action-row { grid-template-columns: 1fr; }
}

/* Ajustes V3: mesas completas, temporizador robusto y edición desde configuración */
.hero-panel.hero-compact {
    grid-template-columns: 1fr minmax(170px, 260px);
    padding: 12px 16px;
}
.hero-panel.hero-compact .hero-table-img {
    max-height: 118px;
    width: 100%;
    object-fit: contain;
}
.pool-visual.pool-visual-image {
    aspect-ratio: 5 / 3;
    min-height: 116px;
    background: transparent !important;
    display: grid;
    place-items: center;
}
.table-grid.compact .pool-visual.pool-visual-image {
    min-height: 104px;
}
.pool-visual.pool-visual-image img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    background: transparent !important;
}
.manager-list,
.settings-products {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}
.settings-products {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}
.manager-card {
    display: grid;
    grid-template-columns: 54px 1fr auto;
    gap: 10px;
    align-items: start;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}
.manager-card > img,
.manager-card > .table-thumb {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    object-fit: cover;
    background: #fff;
    border: 1px solid var(--line);
}
.manager-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.product-manager-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.manager-form label { font-size: 12px; }
.manager-form input,
.manager-form select {
    padding: 8px 9px;
    border-radius: 7px;
}
.manager-actions,
.manager-form .btn,
.product-manager-form .btn {
    align-self: end;
}
.delete-form {
    display: grid;
    align-self: end;
}
.compact-table th,
.compact-table td { padding: 8px 10px; }
h3 {
    font-size: 15px;
    margin: 12px 0 10px;
}
@media (max-width: 760px) {
    .settings-products { grid-template-columns: 1fr; }
    .manager-card { grid-template-columns: 44px 1fr; }
    .delete-form { grid-column: 1 / -1; }
    .manager-form,
    .product-manager-form { grid-template-columns: 1fr; }
}

/* Ajustes V4: estados notorios, configuración por submenús y reportes en vivo */
.brand span { font-size: 19px; }
.nav-submenu {
    display: grid;
    gap: 2px;
    padding: 0 0 6px 46px;
}
.sidebar nav .nav-submenu a {
    padding: 5px 8px;
    font-size: 12px;
    font-weight: 800;
    color: #64748b;
    border-radius: 7px;
}
.sidebar nav .nav-submenu a:hover {
    background: #f1f5f9;
    color: var(--green);
    transform: none;
}
.pool-card.available {
    background: linear-gradient(180deg, #f0fff8 0%, #ffffff 62%);
    border-color: #9be7c4;
}
.pool-card.occupied {
    background: linear-gradient(180deg, #fff1f1 0%, #ffffff 62%);
    border-color: #f9aaa9;
}
.pool-card.pending_payment {
    background: linear-gradient(180deg, #fff8e8 0%, #ffffff 62%);
    border-color: #f7cc75;
}
.status-pill.available {
    background: #dcfce7;
    color: #047857 !important;
    border: 1px solid #7dd3a8;
    font-weight: 1000;
}
.status-pill.occupied {
    background: #fee2e2;
    color: #dc2626 !important;
    border: 1px solid #fca5a5;
    font-weight: 1000;
}
.status-pill.pending_payment {
    background: #fef3c7;
    color: #b45309 !important;
    border: 1px solid #f5c350;
    font-weight: 1000;
}
.action-row .btn {
    min-height: 52px;
    height: 100%;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
}
.dashboard-tables .action-row .btn {
    min-height: 48px;
}
.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}
.settings-tabs a {
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-weight: 900;
    color: #334155;
}
.settings-tabs a.active,
.settings-tabs a:hover {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}
.compact-head { margin-bottom: 10px; }
.logo-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}
.logo-preview img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
}
.user-manager-card,
.rate-manager-card,
.table-manager-card,
.category-manager-card {
    grid-template-columns: 46px 1fr auto;
}
.user-form,
.rate-manager-form,
.table-manager-form,
.category-manager-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.live-note {
    margin: 2px 0 0;
    font-size: 12px;
    font-weight: 700;
}
@media (max-width: 760px) {
    .nav-submenu { padding-left: 36px; }
    .user-manager-card,
    .rate-manager-card,
    .table-manager-card,
    .category-manager-card { grid-template-columns: 44px 1fr; }
    .user-form,
    .rate-manager-form,
    .table-manager-form,
    .category-manager-form { grid-template-columns: 1fr; }
}

/* Ajustes V5: estados más estéticos, formularios proporcionales y productos en configuración */
.pool-card.available {
    background: linear-gradient(180deg, #dcfce7 0%, #ecfdf5 54%, #ffffff 100%);
    border-color: #34d399;
}
.pool-card.occupied {
    background: linear-gradient(180deg, #fee2e2 0%, #fff0f0 54%, #ffffff 100%);
    border-color: #f87171;
}
.pool-card.pending_payment {
    background: linear-gradient(180deg, #fef3c7 0%, #fff8e8 54%, #ffffff 100%);
    border-color: #f59e0b;
}
.pool-card-top {
    align-items: flex-start;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    min-width: 94px;
    max-width: 118px;
    min-height: 28px;
    padding: 6px 10px;
    border-radius: 8px;
    line-height: 1;
    white-space: nowrap;
    letter-spacing: .01em;
    box-shadow: 0 6px 14px rgba(15, 23, 42, .07);
}
.status-pill.available {
    background: #16a34a;
    color: #fff !important;
    border-color: #12803c;
}
.status-pill.occupied {
    background: #dc2626;
    color: #fff !important;
    border-color: #b91c1c;
}
.status-pill.pending_payment {
    background: #f59e0b;
    color: #111827 !important;
    border-color: #d97706;
}
.pool-card-top > div {
    min-width: 0;
}
.pool-card-top > div span {
    display: block;
    line-height: 1.35;
}
.action-row {
    align-items: stretch;
}
.action-row form {
    display: grid;
}
.action-row .btn {
    min-height: 52px;
    height: 100%;
    padding: 10px 12px;
}
.manager-card,
.user-manager-card,
.rate-manager-card,
.table-manager-card,
.category-manager-card,
.product-manager-card {
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}
.manager-card > img,
.manager-card > .table-thumb {
    align-self: center;
    justify-self: center;
}
.manager-form,
.user-form,
.rate-manager-form,
.table-manager-form,
.category-manager-form,
.product-manager-form {
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    align-items: end;
}
.manager-form label,
.form-grid label,
.stack-form label {
    min-width: 0;
}
.manager-form input,
.manager-form select,
.form-grid input,
.form-grid select,
.stack-form input,
.stack-form select {
    min-width: 0;
    width: 100%;
    font-weight: 700;
    text-align: left;
}
.manager-form .btn,
.product-manager-form .btn,
.delete-form .btn {
    min-height: 40px;
    padding-inline: 14px;
}
.delete-form {
    grid-column: 2;
    justify-self: end;
    align-self: center;
    width: min(160px, 100%);
}
.delete-form .btn {
    width: 100%;
}
.settings-products {
    grid-template-columns: 1fr;
}
.settings-products .product-manager-card .product-manager-form {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.compact-form {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
}
.stock-entry-form {
    margin-top: 0;
}
.panel .section-title + .stock-entry-form {
    margin-top: 4px;
}
@media (min-width: 1200px) {
    .settings-products .product-manager-card .product-manager-form {
        grid-template-columns: repeat(4, minmax(150px, 1fr));
    }
}
@media (max-width: 760px) {
    .manager-card,
    .user-manager-card,
    .rate-manager-card,
    .table-manager-card,
    .category-manager-card,
    .product-manager-card {
        grid-template-columns: 44px minmax(0, 1fr);
    }
    .delete-form {
        grid-column: 1 / -1;
        justify-self: stretch;
        width: 100%;
    }
    .manager-form,
    .user-form,
    .rate-manager-form,
    .table-manager-form,
    .category-manager-form,
    .product-manager-form,
    .compact-form {
        grid-template-columns: 1fr;
    }
}

/* Ajustes V7: login demo profesional y protección visual de usuarios */
.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
    background:
        radial-gradient(circle at 18% 15%, rgba(15,159,110,.18), transparent 28%),
        radial-gradient(circle at 82% 88%, rgba(246,195,68,.13), transparent 26%),
        linear-gradient(135deg, #07130f, #0f172a 72%);
}
.auth-card {
    width: min(430px, calc(100vw - 32px));
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(255,255,255,.6);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(0,0,0,.28);
    padding: 26px;
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f8fafc;
    margin-bottom: 18px;
}
.auth-logo {
    width: 58px;
    height: 44px;
    object-fit: contain;
    margin: 0;
}
.auth-brand strong {
    font-size: 18px;
    letter-spacing: -.03em;
}
.login-copy { margin-bottom: 16px; }
.login-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green);
    font-size: 11px;
    font-weight: 1000;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 10px;
}
.login-copy h1 {
    font-size: 25px;
    line-height: 1.05;
    margin-bottom: 7px;
}
.login-form { gap: 12px; }
.login-form input {
    min-height: 46px;
    border-radius: 12px;
    background: #fff;
    font-weight: 800;
}
.login-form .btn {
    min-height: 48px;
    border-radius: 12px;
}
.demo-credentials {
    display: grid;
    gap: 4px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid #fde68a;
    border-radius: 14px;
    background: #fffbeb;
    color: #78350f;
    font-size: 13px;
}
.demo-credentials strong { color: #92400e; }
.auth-back {
    display: block;
    margin-top: 14px;
    text-align: center;
    color: var(--green);
    font-weight: 900;
}
.demo-lock {
    margin: 10px 0 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #78350f;
    font-weight: 850;
}
.demo-lock small {
    display: block;
    margin-top: 4px;
    color: #92400e;
    font-weight: 700;
}
.demo-disabled,
.demo-disabled input,
.demo-disabled select,
.demo-disabled button {
    opacity: .76;
    cursor: not-allowed;
}
.demo-disabled button { pointer-events: none; }

/* Ajustes V8: panel móvil operativo y permisos por Super Administrador */
.mobile-menu-toggle,
.mobile-menu-backdrop {
    display: none;
}
.permission-lock {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #78350f;
    font-weight: 850;
}
button:disabled,
input:disabled,
select:disabled {
    opacity: .68;
    cursor: not-allowed;
}

@media (max-width: 760px) {
    body {
        background: var(--bg);
        overflow-x: hidden;
    }
    .mobile-menu-toggle {
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1200;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        border: 0;
        border-radius: 999px;
        padding: 10px 13px;
        background: #111827;
        color: #fff;
        font-weight: 1000;
        box-shadow: 0 14px 32px rgba(15, 23, 42, .25);
    }
    .mobile-menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1050;
        display: block;
        background: rgba(15, 23, 42, .48);
    }
    .mobile-menu-backdrop[hidden] {
        display: none;
    }
    .app-shell {
        display: block;
        min-height: 100vh;
    }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1100;
        width: min(86vw, 320px);
        height: 100vh;
        padding: 62px 14px 14px;
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: 24px 0 60px rgba(15, 23, 42, .24);
    }
    body.mobile-menu-open .sidebar {
        transform: translateX(0);
    }
    .brand {
        font-size: 17px;
    }
    .brand img {
        width: 36px;
        height: 36px;
    }
    .sidebar nav {
        grid-template-columns: 1fr !important;
        gap: 7px;
    }
    .sidebar nav a {
        min-height: 42px;
        padding: 10px 11px;
        font-size: 14px;
    }
    .nav-submenu {
        padding-left: 22px;
    }
    .sidebar-user {
        margin-top: 12px;
    }
    .content {
        max-width: 100%;
        padding: 64px 10px 16px;
    }
    .page-head,
    .section-title {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }
    .page-head h1 {
        font-size: 24px;
        line-height: 1.1;
    }
    .panel,
    .list-panel,
    .cart-panel,
    .pool-card {
        border-radius: 12px;
        padding: 12px;
    }
    .hero-panel,
    .hero-panel.hero-compact,
    .split,
    .pos-layout {
        grid-template-columns: 1fr !important;
    }
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .metric {
        padding: 10px;
    }
    .metric strong {
        font-size: 18px;
    }
    .table-grid,
    .table-grid.compact {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .pool-card-top {
        gap: 8px;
    }
    .status-pill {
        min-width: 88px;
        max-width: 105px;
        font-size: 11px;
    }
    .pool-visual.pool-visual-image,
    .table-grid.compact .pool-visual.pool-visual-image {
        min-height: 88px;
        aspect-ratio: 5 / 2.6;
    }
    .action-row {
        grid-template-columns: 1fr 1fr;
        gap: 7px;
    }
    .action-row .btn,
    .dashboard-tables .action-row .btn {
        min-height: 44px;
        padding: 9px 8px;
        font-size: 13px;
    }
    .timer {
        font-size: 20px;
        padding: 8px;
    }
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }
    .product-card {
        padding: 10px;
    }
    .product-photo {
        height: 64px;
    }
    .product-foot {
        display: grid;
        grid-template-columns: 1fr;
    }
    .qty {
        width: 100%;
    }
    .cart-panel {
        position: static;
    }
    .cart-items {
        max-height: none;
    }
    .cart-item {
        grid-template-columns: 1fr;
    }
    .cart-item > div:last-child {
        text-align: left;
        justify-items: stretch;
    }
    .settings-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 7px;
    }
    .settings-tabs a {
        padding: 9px 8px;
        text-align: center;
        font-size: 12px;
    }
    .manager-card,
    .user-manager-card,
    .rate-manager-card,
    .table-manager-card,
    .category-manager-card,
    .product-manager-card {
        grid-template-columns: 42px minmax(0, 1fr);
        padding: 10px;
        gap: 9px;
    }
    .manager-form,
    .user-form,
    .rate-manager-form,
    .table-manager-form,
    .category-manager-form,
    .product-manager-form,
    .compact-form,
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 9px;
    }
    .delete-form {
        grid-column: 1 / -1;
        width: 100%;
    }
    .data-table {
        overflow: visible;
    }
    .data-table table,
    .data-table thead,
    .data-table tbody,
    .data-table th,
    .data-table td,
    .data-table tr {
        display: block;
        width: 100%;
    }
    .data-table thead {
        display: none;
    }
    .data-table tr {
        margin-bottom: 10px;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 8px 20px rgba(16,24,39,.05);
    }
    .data-table td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 7px 0;
        border-bottom: 1px solid #eef2f7;
        white-space: normal;
    }
    .data-table td:last-child {
        border-bottom: 0;
    }
    .modal-card {
        max-height: calc(100vh - 30px);
        overflow-y: auto;
    }
}

@media (max-width: 420px) {
    .metric-grid,
    .product-grid,
    .settings-tabs,
    .action-row {
        grid-template-columns: 1fr;
    }
}

/* Super Administrador - Fase 1 personalizada */
.role-super_admin {
    --green: #7c3aed;
    --green-soft: #f3e8ff;
    --blue: #b45309;
    --blue-soft: #fff7ed;
    --amber: #f59e0b;
    --ink: #0f172a;
    --bg: #f8f5ff;
}
.role-super_admin .sidebar {
    background: linear-gradient(180deg, #1e1b4b 0%, #3b0764 100%);
    border-right: 0;
    color: #fff;
}
.role-super_admin .brand,
.role-super_admin .sidebar nav a,
.role-super_admin .sidebar-user,
.role-super_admin .sidebar-user span { color: #fff; }
.role-super_admin .sidebar nav a:hover { background: rgba(255,255,255,.12); color: #fef3c7; }
.role-super_admin .sidebar-user { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); }
.role-super_admin .eyebrow { color: #7c3aed; }
.pool-visual.pool-visual-image.tejo img { object-fit: contain; padding: 10px; background: #111827; }
.btn.disabled { opacity: .55; cursor: not-allowed; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

.touch-body {
    background: #0f172a;
    color: #e5e7eb;
    min-height: 100vh;
}
.touch-shell {
    padding: 20px;
    max-width: 1800px;
    margin: 0 auto;
}
.touch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 16px;
    background: rgba(255,255,255,.06);
    box-shadow: 0 18px 45px rgba(0,0,0,.20);
}
.touch-header h1 { color: #fff; font-size: clamp(28px, 4vw, 48px); }
.touch-header .muted { color: #cbd5e1; }
.touch-table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}
.touch-table-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
    background: #fff;
    color: #0f172a;
    box-shadow: 0 18px 45px rgba(0,0,0,.28);
    min-height: 360px;
}
.touch-table-card.occupied { border: 4px solid #ef4444; }
.touch-table-card.pending_payment { border: 4px solid #f59e0b; }
.touch-table-card.available { opacity: .72; }
.touch-table-img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 14px;
    background: #f8fafc;
}
.touch-open,
.touch-table-card .btn,
.touch-product-card .btn,
.touch-cart-panel .btn {
    min-height: 56px;
    font-size: 18px;
}
.touch-timer {
    font-size: clamp(26px, 4vw, 44px);
    text-align: center;
}
.sticky-touch-head {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
}
.touch-pos-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
    gap: 18px;
    align-items: start;
}
.touch-products-zone,
.touch-cart-panel {
    background: #fff;
    color: #0f172a;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 18px 45px rgba(0,0,0,.25);
}
.touch-category-strip {
    position: sticky;
    top: 114px;
    z-index: 10;
    background: #fff;
    padding-bottom: 12px;
}
.touch-product-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.touch-product-card {
    border-radius: 16px;
    min-height: 250px;
}
.touch-product-card strong { font-size: 17px; }
.touch-qty { min-height: 50px; font-size: 18px; }
.touch-cart-panel { position: sticky; top: 114px; }
.touch-cart-panel .cart-items { max-height: 44vh; }
.touch-stop-form { margin-bottom: 12px; }
.touch-alert-panel { background: #fff; color: #0f172a; }
.touch-flashes { position: sticky; top: 10px; z-index: 100; }

@media (max-width: 980px) {
    .touch-pos-layout { grid-template-columns: 1fr; }
    .touch-cart-panel, .touch-category-strip, .sticky-touch-head { position: static; }
}

@media (max-width: 640px) {
    .touch-shell { padding: 10px; }
    .touch-header { align-items: stretch; flex-direction: column; }
    .touch-table-grid, .touch-product-grid { grid-template-columns: 1fr; }
    .touch-table-card { min-height: auto; }
}

/* Billares Colombia Fase 2: menú fijo usable, panel táctil y nómina */
.sidebar {
    overflow: hidden;
    gap: 10px;
}
.sidebar nav {
    overflow-y: auto;
    min-height: 0;
    padding-right: 4px;
}
.sidebar-user {
    flex-shrink: 0;
}
.sidebar-user a {
    display: inline-flex;
    justify-content: center;
    padding: 9px 10px;
    border-radius: 8px;
    background: #fee2e2;
    color: #b91c1c;
}
.role-super_admin .sidebar-user a {
    background: rgba(255,255,255,.14);
    color: #fff;
}
.small-metrics {
    margin-bottom: 0;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
}
.live-payroll-panel {
    margin-bottom: 22px;
    border-color: #c4b5fd;
    background: linear-gradient(180deg, #ffffff 0%, #faf5ff 100%);
}
.touch-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}
.touch-waitress-large,
.waitress-banner {
    border: 2px solid #22c55e;
    background: #ecfdf5;
    color: #064e3b;
}
.touch-waitress-large strong {
    font-size: 24px;
    line-height: 1;
}
.touch-waitress-large small,
.waitress-banner span {
    display: block;
    font-size: 12px;
    font-weight: 1000;
    color: #047857;
    letter-spacing: .08em;
}
.waitress-banner {
    display: inline-grid;
    gap: 2px;
    padding: 10px 14px;
    border-radius: 14px;
    margin: 4px 0 8px;
}
.waitress-banner strong {
    font-size: clamp(22px, 3vw, 38px);
    color: #052e16;
}
.touch-live-amount {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #7c2d12;
    text-align: center;
}
.touch-live-amount span {
    font-size: 13px;
    font-weight: 1000;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.touch-live-amount strong {
    font-size: clamp(24px, 4vw, 42px);
    color: #9a3412;
}
.touch-live-amount.big {
    margin-bottom: 12px;
}
.touch-help {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 800;
}
.touch-product-card {
    cursor: pointer;
    user-select: none;
}
.touch-product-card:active {
    transform: scale(.985);
}
.touch-qty-controls {
    display: grid;
    grid-template-columns: 58px minmax(72px, 1fr) 58px;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.touch-qty-controls button {
    height: 58px;
    border: 0;
    border-radius: 16px;
    background: #111827;
    color: #fff;
    font-size: 30px;
    line-height: 1;
    font-weight: 1000;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(15,23,42,.16);
}
.touch-qty-controls input {
    height: 58px;
    border-radius: 14px;
    border: 2px solid #cbd5e1;
    text-align: center;
    font-size: 26px;
    font-weight: 1000;
}
.touch-table-img[src$="rana-control.webp"],
.pool-visual.pool-visual-image.tejo img {
    object-fit: contain;
    background: #0b0b0b;
}
@media (max-width: 760px) {
    .sidebar {
        overflow-y: auto;
    }
    .sidebar nav {
        overflow: visible;
    }
    .small-metrics {
        grid-template-columns: 1fr;
    }
    .touch-header-actions {
        justify-content: stretch;
    }
    .touch-header-actions .btn,
    .touch-header-actions form {
        width: 100%;
    }
}

/* Billares Colombia Fase 2B: panel táctil compacto y ordenado */
.touch-shell {
    padding: 14px;
    max-width: 1840px;
}
.touch-header-compact {
    align-items: center;
    margin-bottom: 14px;
    padding: 14px 16px;
    min-height: auto;
}
.touch-title-block {
    min-width: 0;
}
.touch-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.touch-title-row h1 {
    margin: 0;
    font-size: clamp(30px, 3.2vw, 48px);
    line-height: 1;
    letter-spacing: -.035em;
}
.touch-rate-line {
    margin: 8px 0 0;
    font-size: 14px;
}
.waitress-banner.waitress-banner-compact {
    display: inline-grid;
    gap: 1px;
    margin: 0;
    padding: 6px 10px;
    border-radius: 12px;
    border-width: 1px;
    min-width: 128px;
    background: linear-gradient(180deg, #ecfdf5 0%, #f8fffc 100%);
    box-shadow: 0 8px 20px rgba(34, 197, 94, .10);
}
.waitress-banner.waitress-banner-compact span {
    font-size: 9px;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.waitress-banner.waitress-banner-compact strong {
    font-size: clamp(15px, 1.45vw, 22px);
    line-height: 1.05;
    letter-spacing: -.02em;
}
.waitress-banner.waitress-banner-compact.no-waitress {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #7c2d12;
}
.touch-back-btn {
    min-height: 44px !important;
    padding-inline: 16px;
    white-space: nowrap;
}
.touch-pos-layout {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 410px);
    gap: 14px;
    align-items: start;
}
.touch-products-zone,
.touch-cart-panel {
    border-radius: 16px;
    padding: 14px;
}
.touch-category-strip {
    top: 92px;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
}
.touch-category-strip .chip {
    padding: 8px 13px;
    font-size: 14px;
    box-shadow: none;
}
.touch-help {
    margin-bottom: 10px;
    padding: 9px 12px;
    font-size: 14px;
}
.touch-product-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}
.touch-product-card {
    min-width: 0;
    min-height: 0;
    border-radius: 14px;
    padding: 9px;
    gap: 5px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .07);
    border-color: #e5e7eb;
    width: 100%;
}
.touch-product-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(15, 23, 42, .10);
}
.touch-product-card .product-photo {
    width: 100%;
    height: 82px;
    border-radius: 10px;
    object-fit: contain;
    padding: 4px;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}
.touch-product-card .product-icon {
    width: 82px;
    height: 82px;
    margin-inline: auto;
}
.touch-product-card strong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 32px;
    font-size: 13px;
    line-height: 1.12;
}
.touch-product-card b {
    font-size: 13px;
    line-height: 1;
}
.touch-product-card small {
    font-size: 11px;
    line-height: 1.1;
}
.touch-qty-controls {
    grid-template-columns: 32px minmax(38px, 1fr) 32px;
    gap: 5px;
    margin-top: 2px;
}
.touch-qty-controls button {
    height: 34px;
    border-radius: 10px;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, .12);
}
.touch-qty-controls input,
.touch-qty {
    height: 34px;
    min-height: 34px;
    padding: 4px;
    border-radius: 10px;
    font-size: 18px;
}
.touch-product-card .btn,
.touch-cart-panel .btn {
    min-height: 40px;
    font-size: 14px;
    border-radius: 12px;
    padding: 7px 8px;
}
.touch-product-card .btn.wide {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.touch-cart-panel {
    top: 92px;
}
.touch-cart-panel h2 {
    margin-bottom: 10px;
}
.touch-timer {
    font-size: clamp(28px, 3vw, 40px);
    padding: 10px;
    border-radius: 12px;
}
.touch-live-amount {
    padding: 10px;
    border-radius: 12px;
}
.touch-live-amount strong {
    font-size: clamp(24px, 3vw, 38px);
}
.touch-cart-panel .cart-items {
    max-height: 38vh;
}
.touch-cart-panel .cart-item {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}
.touch-cart-panel .totals {
    margin-top: 12px;
    padding-top: 12px;
}
.touch-cart-panel .totals .grand {
    font-size: 20px;
}
.touch-cart-panel .charge-form {
    margin-top: 12px;
    gap: 10px;
}

@media (min-width: 1500px) {
    .touch-product-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
@media (max-width: 1280px) {
    .touch-product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
@media (max-width: 1100px) {
    .touch-pos-layout {
        grid-template-columns: 1fr;
    }
    .touch-cart-panel,
    .touch-category-strip,
    .sticky-touch-head {
        position: static;
    }
}
@media (max-width: 700px) {
    .touch-shell { padding: 10px; }
    .touch-header-compact {
        align-items: stretch;
        flex-direction: column;
    }
    .touch-title-row {
        align-items: stretch;
        gap: 10px;
    }
    .waitress-banner.waitress-banner-compact {
        width: 100%;
    }
    .touch-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 440px) {
    .touch-product-grid {
        grid-template-columns: 1fr;
    }
}


/* Fase 2D: móvil tipo APK sin afectar escritorio */
@media (max-width: 760px) {
    .content {
        max-width: 100%;
        padding: 62px 12px 18px;
    }
    .hero-panel,
    .hero-panel.hero-compact {
        padding: 12px 14px;
        border-radius: 14px;
    }
    .hero-panel.hero-compact .hero-table-img {
        max-height: 92px;
    }
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 14px;
    }
    .metric {
        display: grid;
        grid-template-columns: 34px minmax(0, 1fr);
        grid-template-rows: auto auto;
        align-items: center;
        column-gap: 10px;
        row-gap: 2px;
        min-height: 88px;
        padding: 10px 12px;
        border-radius: 14px;
    }
    .metric span {
        grid-column: 1;
        grid-row: 1 / span 2;
        width: 34px;
        height: 34px;
        align-self: center;
    }
    .metric span::after {
        inset: 8px;
    }
    .metric strong,
    .metric small {
        grid-column: 2;
        min-width: 0;
    }
    .metric strong {
        font-size: 20px;
        line-height: 1.05;
        letter-spacing: -.03em;
    }
    .metric small {
        font-size: 12px;
        line-height: 1.15;
        font-weight: 800;
    }
    .small-metrics .metric strong {
        font-size: 18px;
    }
    .split {
        gap: 12px;
    }
    .table-grid,
    .table-grid.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .dashboard-tables .pool-card {
        padding: 10px;
        gap: 7px;
        border-radius: 14px;
    }
    .dashboard-tables .pool-card-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .dashboard-tables .pool-card-top strong {
        font-size: 14px;
    }
    .dashboard-tables .pool-card-top span {
        font-size: 11px;
    }
    .status-pill {
        min-width: 0;
        max-width: none;
        min-height: 24px;
        padding: 5px 8px;
        font-size: 10px;
    }
    .pool-visual.pool-visual-image,
    .table-grid.compact .pool-visual.pool-visual-image {
        min-height: 78px;
        aspect-ratio: 4.8 / 2.8;
    }
    .waitress-card.small {
        padding: 5px 6px;
        gap: 6px;
    }
    .waitress-card img {
        width: 30px;
        height: 30px;
    }
    .waitress-card strong {
        font-size: 12px;
    }
    .waitress-card small,
    .waitress-card span {
        font-size: 10px;
    }
    .dashboard-tables .timer,
    .timer {
        font-size: 18px;
        padding: 7px;
    }
    .compact-calc {
        padding: 8px;
    }
    .compact-calc strong {
        font-size: 16px;
    }
    .compact-calc span {
        font-size: 13px;
        font-weight: 900;
    }
    .action-row,
    .dashboard-tables .action-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .action-row .btn,
    .dashboard-tables .action-row .btn,
    .btn.wide {
        min-height: 40px;
        font-size: 12px;
        padding: 8px 8px;
    }
    .section-title .btn,
    .page-head .btn {
        width: 100%;
    }
    .list-row {
        padding: 8px 0;
    }
}

@media (max-width: 560px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .metric {
        min-height: 78px;
        padding: 9px 10px;
        column-gap: 8px;
    }
    .metric strong {
        font-size: 18px;
    }
    .metric small {
        font-size: 11px;
    }
    .table-grid,
    .table-grid.compact {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .metric {
        min-height: 76px;
        padding: 8px 9px;
    }
    .metric span {
        width: 30px;
        height: 30px;
    }
    .metric strong {
        font-size: 17px;
    }
    .metric small {
        font-size: 10px;
    }
    .action-row,
    .product-grid,
    .settings-tabs {
        grid-template-columns: 1fr;
    }
}

/* Fase 3A: sistema táctil por botones para SA y Administrador */
.app-shell {
    grid-template-columns: 318px minmax(0, 1fr);
}
.sidebar {
    padding: 16px;
    gap: 12px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.brand {
    min-height: 58px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255,255,255,.88);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}
.role-super_admin .brand {
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.16);
}
.brand span {
    line-height: 1.08;
}
.touch-button-nav {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px !important;
    align-content: start;
}
.sidebar nav a.touch-nav-button,
.touch-nav-button {
    min-width: 0;
    min-height: 66px;
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 9px !important;
    padding: 10px 11px !important;
    border: 1px solid #dfe5ed;
    border-radius: 16px !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: #102033 !important;
    font-weight: 950 !important;
    font-size: 13px !important;
    line-height: 1.08;
    box-shadow: 0 10px 24px rgba(15,23,42,.06);
    touch-action: manipulation;
    user-select: none;
}
.sidebar nav a.touch-nav-button:hover,
.touch-nav-button:hover {
    transform: translateY(-2px) !important;
    background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 100%) !important;
    border-color: #a7f3d0;
    color: #047857 !important;
    box-shadow: 0 16px 32px rgba(15,23,42,.10);
}
.touch-nav-button .nav-ball {
    width: 32px;
    height: 32px;
}
.touch-nav-button span {
    min-width: 0;
    overflow-wrap: anywhere;
}
.touch-nav-group {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
    padding: 9px;
    border: 1px solid #dfe5ed;
    border-radius: 18px;
    background: rgba(255,255,255,.72);
    box-shadow: 0 12px 28px rgba(15,23,42,.06);
}
.touch-nav-group .touch-nav-button-main {
    grid-column: 1 / -1;
    min-height: 58px;
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%) !important;
    border-color: #111827;
    color: #fff !important;
}
.touch-nav-group .touch-nav-button-main:hover {
    color: #fff !important;
    background: linear-gradient(135deg, #0f9f6e 0%, #047857 100%) !important;
}
.touch-nav-subgrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}
.sidebar nav .touch-nav-subgrid a.touch-nav-subbutton,
.touch-nav-subbutton {
    min-height: 44px;
    display: grid !important;
    place-items: center;
    padding: 8px 7px !important;
    border: 1px solid #e5e7eb;
    border-radius: 12px !important;
    background: #ffffff;
    color: #334155 !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    line-height: 1.1;
    text-align: center;
    box-shadow: 0 8px 18px rgba(15,23,42,.045);
    touch-action: manipulation;
}
.sidebar nav .touch-nav-subgrid a.touch-nav-subbutton:hover,
.touch-nav-subbutton:hover {
    transform: translateY(-1px) !important;
    background: #eff6ff !important;
    border-color: #bfdbfe;
    color: #1d4ed8 !important;
}
.sidebar-user {
    border-radius: 16px;
    padding: 12px;
}
.sidebar-user a {
    display: grid;
    place-items: center;
    min-height: 44px;
    margin-top: 9px;
    border-radius: 12px;
    background: #fee2e2;
    color: #b91c1c !important;
    font-weight: 950;
}
.role-super_admin .touch-nav-group,
.role-super_admin .touch-nav-button {
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.16);
    color: #fff !important;
    box-shadow: 0 12px 28px rgba(0,0,0,.12);
}
.role-super_admin .sidebar nav a.touch-nav-button:hover,
.role-super_admin .touch-nav-button:hover {
    background: rgba(255,255,255,.18) !important;
    color: #fef3c7 !important;
    border-color: rgba(255,255,255,.28);
}
.role-super_admin .touch-nav-subbutton {
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.16);
    color: #fff !important;
}
.role-super_admin .touch-nav-subbutton:hover {
    background: rgba(255,255,255,.20) !important;
    color: #fef3c7 !important;
    border-color: rgba(255,255,255,.28);
}
.role-super_admin .sidebar-user a {
    background: rgba(254,226,226,.92);
    color: #991b1b !important;
}
.content .btn,
.panel .btn,
.list-panel .btn,
.cart-panel .btn {
    min-height: 44px;
    border-radius: 12px;
    touch-action: manipulation;
}
.settings-tabs a {
    min-height: 46px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    touch-action: manipulation;
}
.manager-form .btn,
.product-manager-form .btn,
.delete-form .btn,
.compact-form .btn,
.stack-form .btn {
    min-height: 44px;
    border-radius: 12px;
}
input,
select {
    min-height: 44px;
}

@media (min-width: 761px) and (max-width: 1180px) {
    .app-shell {
        grid-template-columns: 292px minmax(0, 1fr);
    }
    .sidebar {
        padding: 14px;
    }
    .sidebar nav a.touch-nav-button,
    .touch-nav-button {
        min-height: 60px;
        grid-template-columns: 30px minmax(0, 1fr);
        gap: 7px !important;
        padding: 9px !important;
        font-size: 12px !important;
    }
    .touch-nav-button .nav-ball {
        width: 29px;
        height: 29px;
    }
    .touch-nav-subgrid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 760px) {
    .app-shell {
        display: block;
    }
    .sidebar {
        width: min(92vw, 360px);
        padding: 62px 14px 14px;
    }
    .touch-button-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }
    .sidebar nav a.touch-nav-button,
    .touch-nav-button {
        min-height: 58px;
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 7px !important;
        padding: 8px 9px !important;
        font-size: 12px !important;
        border-radius: 14px !important;
    }
    .touch-nav-button .nav-ball {
        width: 28px;
        height: 28px;
    }
    .touch-nav-group {
        padding: 8px;
        border-radius: 16px;
    }
    .touch-nav-subgrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }
    .sidebar nav .touch-nav-subgrid a.touch-nav-subbutton,
    .touch-nav-subbutton {
        min-height: 40px;
        font-size: 11px !important;
        padding: 7px 5px !important;
    }
    .sidebar-user a {
        min-height: 42px;
    }
}

@media (max-width: 380px) {
    .touch-button-nav,
    .touch-nav-subgrid {
        grid-template-columns: 1fr !important;
    }
}


/* Fase 4A Diana: dashboard táctil, menú elegante y sincronización visual */
.app-shell {
    grid-template-columns: 372px minmax(0, 1fr);
}
.content {
    max-width: 1560px;
}
.hero-panel.hero-compact {
    display: none !important;
}
.sidebar {
    padding: 18px 14px;
    gap: 14px;
}
.touch-button-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px !important;
}
.sidebar nav a.touch-nav-button,
.touch-nav-button,
.touch-nav-toggle {
    min-height: 74px;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px !important;
    padding: 12px 13px !important;
    border-radius: 18px !important;
    font-size: 15px !important;
    letter-spacing: -.015em;
    overflow: hidden;
    border-color: rgba(226,232,240,.95);
}
.touch-nav-button span,
.touch-nav-toggle span {
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}
.touch-nav-button .nav-ball,
.touch-nav-toggle .nav-ball {
    width: 40px;
    height: 40px;
}
.touch-nav-toggle {
    width: 100%;
    border: 1px solid #dfe5ed;
    cursor: pointer;
    text-align: left;
}
.touch-nav-group {
    padding: 10px;
    gap: 10px;
    border-radius: 20px;
}
.touch-nav-group .touch-nav-button-main {
    color: #fff !important;
    grid-template-columns: 42px minmax(0, 1fr) 18px;
}
.touch-nav-group .touch-nav-button-main span {
    color: #fff !important;
}
.toggle-caret {
    display: grid;
    place-items: center;
    color: currentColor;
    transition: transform .18s ease;
}
.touch-nav-toggle.is-open .toggle-caret {
    transform: rotate(180deg);
}
.touch-nav-subgrid[hidden] {
    display: none !important;
}
.touch-nav-subgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.sidebar nav .touch-nav-subgrid a.touch-nav-subbutton,
.touch-nav-subbutton {
    min-height: 50px;
    padding: 9px 8px !important;
    font-size: 13px !important;
    border-radius: 14px !important;
}
.sidebar-user {
    text-align: center;
    display: grid;
    justify-items: center;
    gap: 5px;
}
.sidebar-user strong,
.sidebar-user span {
    width: 100%;
    text-align: center;
}
.sidebar-user a,
.fullscreen-button {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 14px;
    font-weight: 950;
    cursor: pointer;
}
.fullscreen-button {
    margin-top: 8px;
    background: rgba(255,255,255,.14);
    color: #fff;
    border: 1px solid rgba(255,255,255,.20);
}
body:not(.role-super_admin) .fullscreen-button {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}
.role-super_admin .touch-nav-group .touch-nav-button-main {
    background: rgba(255,255,255,.14) !important;
    border-color: rgba(255,255,255,.28);
}
.role-super_admin .touch-nav-group .touch-nav-button-main span,
.role-super_admin .touch-nav-group .touch-nav-button-main .toggle-caret {
    color: #fff !important;
}
.dashboard-metrics {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
}
.metric.inventory-alert {
    color: var(--ink);
    text-decoration: none;
}
.inventory-alert-icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50%;
    display: grid !important;
    place-items: center;
    font-size: 19px;
    background: #dcfce7 !important;
    color: #15803d;
}
.metric.inventory-alert.has-alert .inventory-alert-icon {
    background: #fef3c7 !important;
    color: #b45309;
    animation: bellShake 1s ease-in-out infinite;
}
.metric.inventory-alert.has-alert strong {
    color: #b45309;
}
.metric.inventory-alert.ok strong {
    color: #15803d;
}
@keyframes bellShake {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-14deg); }
    40% { transform: rotate(12deg); }
    60% { transform: rotate(-8deg); }
    80% { transform: rotate(6deg); }
}
.dashboard-tables-section {
    margin-bottom: 16px;
}
.dashboard-tables-section .table-grid.compact,
.dashboard-tables {
    grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
}
.dashboard-bottom-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 22px;
}
.dashboard-bottom-grid.with-payroll {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
}
.dashboard-bottom-grid .panel {
    height: 100%;
}
.embedded-list {
    box-shadow: none;
    border: 0;
    padding: 0;
}
.live-payroll-panel .small-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 0;
}
.touch-fullscreen-button {
    position: fixed;
    right: 16px;
    top: 14px;
    z-index: 1400;
    min-height: 42px;
    padding: 9px 13px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    background: rgba(15, 23, 42, .86);
    color: #fff;
    font-weight: 950;
    box-shadow: 0 14px 34px rgba(0,0,0,.24);
}
@media (min-width: 761px) and (max-width: 1180px) {
    .app-shell {
        grid-template-columns: 372px minmax(0, 1fr);
    }
    .sidebar nav a.touch-nav-button,
    .touch-nav-button,
    .touch-nav-toggle {
        min-height: 70px;
        font-size: 14px !important;
        grid-template-columns: 38px minmax(0, 1fr);
    }
    .touch-nav-button .nav-ball,
    .touch-nav-toggle .nav-ball {
        width: 36px;
        height: 36px;
    }
    .dashboard-metrics {
        grid-template-columns: repeat(5, minmax(120px, 1fr));
        gap: 10px;
    }
    .dashboard-metrics .metric {
        padding: 10px;
    }
    .dashboard-metrics .metric strong {
        font-size: 18px;
    }
    .dashboard-metrics .metric small {
        font-size: 11px;
    }
    .dashboard-bottom-grid.with-payroll {
        grid-template-columns: 1fr 1fr;
    }
    .live-payroll-panel .small-metrics {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 900px) {
    .dashboard-bottom-grid.with-payroll {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 760px) {
    .app-shell {
        display: block;
    }
    .sidebar {
        width: min(94vw, 380px);
    }
    .dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dashboard-tables-section .table-grid.compact,
    .dashboard-tables {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .live-payroll-panel .small-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 560px) {
    .dashboard-tables-section .table-grid.compact,
    .dashboard-tables {
        grid-template-columns: 1fr;
    }
    .live-payroll-panel .small-metrics {
        grid-template-columns: 1fr;
    }
}

/* Fase 4B: acceso por perfiles, menú cerrado por defecto, POS compacto */
.access-menu {
    width: min(1040px, calc(100vw - 28px));
    display: grid;
    gap: 18px;
}
.access-title {
    text-align: center;
    color: #fff;
}
.access-title h1 {
    font-size: clamp(28px, 4vw, 46px);
    color: #fff;
    margin-bottom: 8px;
}
.access-title .muted { color: #dbe7f3; }
.access-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.access-card {
    min-height: 230px;
    display: grid;
    align-content: center;
    gap: 12px;
    padding: 24px;
    border-radius: 26px;
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(255,255,255,.68);
    box-shadow: 0 24px 70px rgba(0,0,0,.26);
    transition: transform .18s ease, box-shadow .18s ease;
}
.access-card:hover { transform: translateY(-4px); box-shadow: 0 34px 90px rgba(0,0,0,.32); }
.access-card > span {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: var(--green-soft);
    color: var(--green);
    font-weight: 1000;
    font-size: 18px;
}
.access-card strong {
    font-size: clamp(23px, 2.4vw, 34px);
    line-height: 1;
    letter-spacing: -.04em;
}
.access-card small {
    color: var(--muted);
    font-weight: 800;
    line-height: 1.35;
}
.access-card.super > span { background: #f3e8ff; color: #7c3aed; }
.access-card.admin > span { background: #ecfdf5; color: #059669; }
.access-card.mesas > span { background: #eff6ff; color: #2563eb; }
.shortcut-panel {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(255,255,255,.7);
    text-align: center;
}
.shortcut-panel p { margin: 6px 0 12px; }
.shortcut-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pin-form input[name="pin"] {
    text-align: center;
    font-size: 30px;
    letter-spacing: .35em;
    font-weight: 1000;
}

/* Menú táctil cerrado por defecto en escritorio y móvil */
.mobile-menu-toggle.global-menu-toggle,
.mobile-menu-backdrop { display: block; }
.mobile-menu-toggle.global-menu-toggle {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1200;
    min-height: 46px;
    padding: 10px 15px;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    border: 0;
    font-weight: 1000;
    box-shadow: 0 14px 32px rgba(15, 23, 42, .25);
}
.quick-exit-button {
    position: fixed;
    top: 12px;
    right: 14px;
    z-index: 1000;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-weight: 1000;
    box-shadow: 0 14px 32px rgba(239, 68, 68, .22);
}
.app-shell { display: block !important; min-height: 100vh; }
.sidebar {
    position: fixed !important;
    inset: 0 auto 0 0;
    z-index: 1100;
    width: min(92vw, 390px);
    height: 100vh !important;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 24px 0 60px rgba(15, 23, 42, .24);
}
body.mobile-menu-open .sidebar { transform: translateX(0); }
.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(15, 23, 42, .48);
}
.mobile-menu-backdrop[hidden] { display: none; }
.content {
    max-width: 100% !important;
    width: 100%;
    padding: 72px 22px 22px !important;
}
.touch-button-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
}
.touch-nav-button {
    min-width: 0;
    min-height: 78px;
    padding: 12px 10px !important;
    border-radius: 18px !important;
    text-align: left;
}
.touch-nav-button span {
    color: inherit;
    font-size: 16px;
    line-height: 1.1;
    overflow-wrap: anywhere;
    word-break: normal;
}
.touch-nav-group {
    grid-column: 1 / -1;
}
.touch-nav-group .touch-nav-button-main {
    width: 100%;
    color: #fff !important;
    background: rgba(15, 23, 42, .92) !important;
    border: 1px solid rgba(255,255,255,.75) !important;
}
.touch-nav-group .touch-nav-button-main span { color: #fff !important; }
.touch-nav-subgrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 10px;
}
.touch-nav-subbutton {
    min-height: 54px;
    padding: 10px;
    border-radius: 14px;
    background: #fff;
    color: #172033 !important;
    font-weight: 1000;
    display: grid;
    place-items: center;
    text-align: center;
}
.sidebar-user {
    text-align: center;
    justify-items: center;
}
.sidebar-user a {
    width: 100%;
    display: grid;
    place-items: center;
    min-height: 48px;
    border-radius: 14px;
    background: #fee2e2;
    color: #991b1b !important;
}
.fullscreen-button,
.touch-fullscreen-button { display: none !important; }

/* POS compacto */
.pos-page-head { margin-bottom: 12px; }
.pos-layout-compact {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
    gap: 14px;
}
.pos-product-zone,
.pos-cart-panel {
    border-radius: 16px;
}
.pos-search-box {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}
.pos-search-box label { gap: 5px; font-size: 13px; }
.pos-search-box input { min-height: 42px; border-radius: 12px; font-size: 14px; }
.compact-category-strip { margin-bottom: 10px; gap: 8px; }
.compact-category-strip .chip { padding: 8px 12px; font-size: 13px; }
.pos-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
    gap: 10px;
}
.pos-product-card {
    padding: 9px;
    gap: 5px;
    border-radius: 14px;
    overflow: hidden;
}
.pos-product-card .product-photo,
.pos-product-card .product-icon {
    height: 70px;
    width: 100%;
    border-radius: 10px;
    object-fit: contain;
}
.pos-product-card .product-icon { width: 70px; margin-inline: auto; }
.pos-product-card strong {
    min-height: 30px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.12;
}
.pos-product-card b { font-size: 13px; }
.pos-product-card small { font-size: 10px; }
.pos-add-row {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 6px;
    align-items: center;
}
.pos-add-row .qty { width: 100%; height: 36px; min-height: 36px; padding: 5px; text-align: center; font-weight: 900; }
.pos-add-row .btn { min-height: 36px; padding: 7px; font-size: 12px; }
.pos-cart-panel { padding: 14px; }
.pos-cart-panel h2 { margin-bottom: 10px; }
.pos-cart-panel .cart-items { max-height: 42vh; }
.pos-cart-panel .cart-item { padding: 9px; }
.pos-cart-panel .cart-item strong { font-size: 13px; }
.pos-cart-panel .cart-item small { font-size: 11px; }
.pos-cart-panel .totals { margin-top: 12px; padding-top: 12px; }
.pos-cart-panel .totals .grand { font-size: 19px; }
.pos-cart-panel .charge-form { margin-top: 12px; gap: 9px; }

@media (max-width: 1024px) {
    .content { padding: 68px 14px 18px !important; }
    .pos-layout-compact { grid-template-columns: 1fr; }
    .pos-cart-panel { position: static; }
    .pos-product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .access-grid { grid-template-columns: 1fr; }
    .access-card { min-height: 170px; }
    .sidebar { width: min(92vw, 380px) !important; }
    .content { padding: 66px 10px 16px !important; }
    .quick-exit-button { min-height: 42px; padding: 0 15px; }
    .pos-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 430px) {
    .touch-button-nav { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .touch-nav-button { min-height: 70px; }
    .touch-nav-button span { font-size: 14px; }
    .pos-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Fase 4C: escritorio Chrome, PIN táctil, métricas con iconos y productos por toque */
.mobile-menu-toggle.global-menu-toggle {
    width: 52px;
    min-width: 52px;
    height: 52px;
    padding: 0 !important;
    font-size: 24px;
    line-height: 1;
    top: 14px;
    left: 16px;
}
.content {
    padding-top: 82px !important;
}
.quick-exit-button {
    top: 14px;
}

.metric-icon-grid .metric,
.metric-with-icon {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 10px;
    align-items: center;
}
.metric-with-icon > span { display: none !important; }
.metric-icon {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 48px;
    height: 48px;
    object-fit: contain;
    justify-self: center;
    align-self: center;
    filter: drop-shadow(0 8px 12px rgba(15,23,42,.14));
}
.metric-with-icon strong,
.metric-with-icon small {
    grid-column: 2;
    min-width: 0;
}
.metric-with-icon.has-alert .inventory-status-icon {
    animation: bellShake 1s ease-in-out infinite;
}

.pin-form input[name="pin"] {
    caret-color: transparent;
    user-select: none;
}
.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}
.pin-keypad button {
    min-height: 54px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    font-size: 20px;
    font-weight: 1000;
    box-shadow: 0 8px 18px rgba(16,24,39,.06);
    cursor: pointer;
}
.pin-keypad button:hover,
.pin-keypad button:active {
    background: var(--green);
    color: #fff;
}
.pin-keypad [data-pin-clear],
.pin-keypad [data-pin-delete] {
    font-size: 14px;
    background: #f8fafc;
}

.pos-product-card,
.touch-product-card {
    cursor: pointer;
}
.pos-touch-add-row {
    grid-template-columns: 58px minmax(0, 1fr);
}
.pos-touch-add-row .touch-qty,
.touch-qty-display .touch-qty {
    pointer-events: none;
    background: #f8fafc;
}
.touch-qty-display {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 58px;
    gap: 6px;
    align-items: center;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
}
.touch-qty-display span {
    font-size: 11px;
    font-weight: 900;
    color: var(--muted);
}
.touch-qty-display input {
    height: 34px;
    min-height: 34px;
    padding: 4px;
    border-radius: 10px;
    font-size: 17px;
    text-align: center;
    font-weight: 1000;
}
.touch-product-card strong,
.pos-product-card strong {
    font-size: 12.5px !important;
    line-height: 1.1;
}
.touch-product-card b,
.pos-product-card b {
    font-size: 12.5px !important;
}
.touch-product-card small,
.pos-product-card small {
    font-size: 10px !important;
}
.touch-product-card .btn,
.pos-product-card .btn {
    font-size: 12px !important;
    min-height: 38px !important;
}
.touch-charge-warning {
    margin: 8px 0;
    padding: 9px 10px;
    border-radius: 12px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 12px;
    font-weight: 900;
    border: 1px solid #fed7aa;
}

@media (max-width: 1180px) {
    .content { padding-top: 78px !important; }
    .metric-icon { width: 42px; height: 42px; }
    .metric-icon-grid .metric,
    .metric-with-icon { grid-template-columns: 42px minmax(0, 1fr); }
}
@media (max-width: 760px) {
    .mobile-menu-toggle.global-menu-toggle {
        width: 48px;
        min-width: 48px;
        height: 48px;
        top: 10px;
        left: 10px;
    }
    .content { padding-top: 66px !important; }
    .metric-icon { width: 34px; height: 34px; }
    .metric-icon-grid .metric,
    .metric-with-icon { grid-template-columns: 34px minmax(0, 1fr); }
    .pin-keypad button { min-height: 50px; }
}


/* Fase 5 XAMPP: acceso producción, login compacto, inventario rápido */
.access-body {
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 15%, rgba(16,185,129,.28), transparent 24%),
        radial-gradient(circle at 82% 18%, rgba(124,58,237,.22), transparent 25%),
        radial-gradient(circle at 50% 100%, rgba(245,158,11,.18), transparent 28%),
        linear-gradient(135deg, #06130f 0%, #0f172a 58%, #111827 100%);
}
.access-body::before,
.access-body::after {
    content: "";
    position: fixed;
    width: 260px;
    height: 260px;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(10px);
    opacity: .35;
    animation: accessOrb 8s ease-in-out infinite alternate;
}
.access-body::before { left: -70px; top: 12%; background: rgba(15,159,110,.32); }
.access-body::after { right: -90px; bottom: 8%; background: rgba(37,99,235,.30); animation-delay: -3s; }
@keyframes accessOrb { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(24px,-18px,0) scale(1.12); } }
.access-menu-production {
    width: min(1060px, calc(100vw - 34px));
    position: relative;
    z-index: 1;
}
.access-title-production h1 {
    font-size: clamp(30px, 4vw, 54px);
    letter-spacing: -.05em;
    text-shadow: 0 18px 38px rgba(0,0,0,.32);
}
.access-title-production .muted {
    margin: 0;
    font-weight: 800;
}
.access-grid-production .access-card {
    position: relative;
    min-height: 250px;
    padding: 22px;
    align-content: end;
    isolation: isolate;
    overflow: hidden;
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(255,255,255,.78);
    transform: translateY(0);
    animation: cardEnter .6s ease both;
}
.access-grid-production .access-card:nth-child(2) { animation-delay: .08s; }
.access-grid-production .access-card:nth-child(3) { animation-delay: .16s; }
@keyframes cardEnter { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.access-grid-production .access-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(15,23,42,.08));
    z-index: -1;
}
.access-grid-production .access-card:hover,
.access-grid-production .access-card:active {
    transform: translateY(-6px) scale(1.015);
}
.access-grid-production .access-card img {
    width: 116px;
    height: 116px;
    object-fit: contain;
    margin: 0 auto 8px;
    filter: drop-shadow(0 18px 22px rgba(15,23,42,.20));
    animation: accessIconFloat 3.8s ease-in-out infinite;
}
.access-grid-production .access-card:nth-child(2) img { animation-delay: -.8s; }
.access-grid-production .access-card:nth-child(3) img { animation-delay: -1.5s; }
@keyframes accessIconFloat { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-7px) rotate(1deg); } }
.access-grid-production .access-card > span { display: none; }
.access-grid-production .access-card strong {
    text-align: center;
    font-size: clamp(22px, 2.3vw, 34px);
}
.access-grid-production .access-card small {
    text-align: center;
    font-size: 14px;
}
.access-footer {
    text-align: center;
    color: rgba(255,255,255,.76);
    font-size: 12px;
    font-weight: 800;
}
.access-footer a { color: #86efac; text-decoration: underline; text-underline-offset: 3px; }

.auth-card {
    padding: 18px 20px;
}
.auth-brand {
    margin-bottom: 10px;
    padding: 8px;
}
.auth-logo { width: 48px; height: 38px; }
.compact-login-copy { margin-bottom: 10px; }
.compact-login-copy h1 { font-size: 22px; margin-bottom: 0; }
.compact-pin-form { gap: 8px; }
.login-form input { min-height: 40px; }
.pin-form input[name="pin"],
.pin-form input[name="password"] {
    text-align: center;
    font-size: 26px;
    letter-spacing: .28em;
    font-weight: 1000;
    caret-color: transparent;
    user-select: none;
}
.compact-keypad { gap: 7px; }
.compact-keypad button,
.pin-keypad.compact-keypad button {
    min-height: 42px;
    border-radius: 12px;
    font-size: 18px;
}
.compact-keypad [data-pin-clear],
.compact-keypad [data-pin-delete] { font-size: 12px; }
.login-form .btn { min-height: 42px; }
.auth-back { margin-top: 10px; }

.auto-color-note {
    align-self: end;
    padding: 10px 12px;
    border: 1px dashed #bfdbfe;
    border-radius: 12px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 900;
    font-size: 12px;
}
.settings-product-search { margin-bottom: 12px; }
.settings-products-accordion { display: grid; gap: 9px; }
.settings-product-detail {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(16,24,39,.04);
}
.settings-product-detail[hidden] { display: none !important; }
.settings-product-detail summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 12px 14px;
    font-weight: 1000;
}
.settings-product-detail summary::-webkit-details-marker { display: none; }
.settings-product-detail summary::after {
    content: "▾";
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green);
    transition: transform .18s ease;
}
.settings-product-detail[open] summary::after { transform: rotate(180deg); }
.product-summary-name { font-size: 15px; }
.product-summary-meta {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}
.accordion-product-card {
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
}

.reports-summary-grid.metric-grid,
.reports-commission-grid.metric-grid {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 9px;
}
.reports-summary-grid .metric,
.reports-commission-grid .metric {
    padding: 9px 10px;
    min-height: 78px;
    grid-template-columns: 30px 1fr;
    display: grid;
    align-items: center;
    column-gap: 8px;
}
.reports-summary-grid .metric span,
.reports-commission-grid .metric span {
    grid-row: 1 / span 2;
    width: 30px;
    height: 30px;
}
.reports-summary-grid .metric span::after,
.reports-commission-grid .metric span::after { inset: 7px; }
.reports-summary-grid .metric strong,
.reports-commission-grid .metric strong { font-size: 17px; line-height: 1.05; }
.reports-summary-grid .metric small,
.reports-commission-grid .metric small { font-size: 10.5px; line-height: 1.1; }

@media (max-height: 760px) {
    .auth-body { padding: 10px; }
    .auth-card { padding: 14px 16px; }
    .auth-brand { margin-bottom: 8px; }
    .compact-login-copy h1 { font-size: 20px; }
    .pin-form input[name="pin"],
    .pin-form input[name="password"] { font-size: 23px; min-height: 38px; }
    .compact-keypad button,
    .pin-keypad.compact-keypad button { min-height: 38px; }
}
@media (max-width: 760px) {
    .access-body { overflow-y: auto; }
    .access-menu-production { padding: 12px 0; }
    .access-grid-production { grid-template-columns: 1fr; }
    .access-grid-production .access-card { min-height: 162px; grid-template-columns: 86px 1fr; align-items: center; align-content: center; text-align: left; }
    .access-grid-production .access-card img { width: 82px; height: 82px; margin: 0; }
    .access-grid-production .access-card strong,
    .access-grid-production .access-card small { text-align: left; }
    .reports-summary-grid.metric-grid,
    .reports-commission-grid.metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .product-summary-meta { display: none; }
}


/* Fase 6 Billares Colombia */
.access-main-logo {
    width: min(220px, 38vw);
    max-height: 150px;
    object-fit: contain;
    display: block;
    margin: 0 auto 6px;
    filter: drop-shadow(0 20px 28px rgba(0,0,0,.32));
    animation: accessIconFloat 4.2s ease-in-out infinite;
}
.top-action-buttons {
    position: fixed;
    top: 12px;
    right: 14px;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.top-action-buttons form { margin: 0; }
.quick-exit-button,
.quick-close-day-button {
    position: static !important;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 999px;
    color: #fff;
    font-weight: 1000;
    border: 0;
    cursor: pointer;
    box-shadow: 0 14px 32px rgba(15, 23, 42, .20);
}
.quick-exit-button { background: #ef4444; }
.quick-close-day-button { background: #0f9f6e; }
.ticket-head p { margin: 2px 0; }
@media print {
    .ticket-head img { width: 76px; max-height: 62px; }
    .ticket { font-size: 12px; }
}
@media (max-width: 760px) {
    .top-action-buttons { right: 8px; top: 10px; gap: 6px; }
    .quick-exit-button,
    .quick-close-day-button { min-height: 42px; padding: 0 12px; font-size: 12px; }
    .access-main-logo { width: 170px; max-height: 118px; }
}


/* Fase 7 - QR, soporte y control de energía local */
.sidebar-user .support-link {
    margin-top: 10px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 42px;
    border-radius: 14px;
    background: #dcfce7;
    color: #047857 !important;
    font-weight: 1000;
    border: 1px solid #86efac;
}
.role-super_admin .sidebar-user .support-link {
    background: rgba(255,255,255,.14);
    color: #fff !important;
    border-color: rgba(255,255,255,.28);
}
.access-power-panel {
    width: min(720px, 100%);
    margin: 16px auto 8px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.access-power-panel form { margin: 0; }
.access-power-button {
    width: 100%;
    min-height: 54px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 18px;
    cursor: pointer;
    color: #fff;
    font-weight: 1000;
    font-size: 16px;
    box-shadow: 0 18px 40px rgba(0,0,0,.18);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.access-power-button:hover { transform: translateY(-2px); box-shadow: 0 22px 48px rgba(0,0,0,.24); filter: brightness(1.04); }
.access-power-button.shutdown { background: linear-gradient(135deg, #991b1b, #ef4444); }
.access-power-button.restart { background: linear-gradient(135deg, #1d4ed8, #06b6d4); }
.touch-table-image-link {
    display: block;
    border-radius: 16px;
    overflow: hidden;
    transition: transform .18s ease, filter .18s ease;
}
.touch-table-image-link:hover,
.touch-table-image-link:active {
    transform: scale(1.015);
    filter: brightness(1.06);
}
.qr-pay-button {
    margin-top: 10px;
    background: linear-gradient(135deg, #0f9f6e, #2563eb) !important;
    color: #fff !important;
    border: 0 !important;
}
.qr-modal-backdrop[hidden] { display: none; }
.qr-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(2, 6, 23, .72);
    backdrop-filter: blur(8px);
}
.qr-modal-card {
    position: relative;
    width: min(430px, calc(100vw - 30px));
    padding: 22px;
    border-radius: 26px;
    background: radial-gradient(circle at top, #ffffff 0%, #f8fafc 56%, #e0f2fe 100%);
    border: 1px solid rgba(255,255,255,.72);
    box-shadow: 0 35px 90px rgba(0,0,0,.42);
    text-align: center;
    color: #0f172a;
}
.qr-modal-card .qr-close {
    top: 12px;
    right: 12px;
}
.qr-frame {
    position: relative;
    margin: 18px auto 14px;
    width: min(300px, 78vw);
    padding: 15px;
    border-radius: 24px;
    background: linear-gradient(135deg, #0f172a, #1d4ed8 48%, #0f9f6e);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.24), 0 24px 50px rgba(37,99,235,.25);
}
.qr-frame::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 18px;
    border: 1px dashed rgba(255,255,255,.42);
    pointer-events: none;
}
.qr-frame img {
    position: relative;
    z-index: 1;
    width: 100%;
    display: block;
    border-radius: 14px;
    background: #fff;
    padding: 7px;
}
.qr-badge {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: -14px;
    transform: translateX(-50%);
    padding: 7px 13px;
    border-radius: 999px;
    background: #facc15;
    color: #111827;
    font-size: 12px;
    font-weight: 1000;
    box-shadow: 0 10px 22px rgba(0,0,0,.22);
    white-space: nowrap;
}
.qr-modal-card strong {
    display: block;
    margin-top: 4px;
    font-size: 22px;
}
.qr-modal-card p {
    margin: 6px auto 0;
    max-width: 310px;
    color: #475569;
    font-weight: 800;
}
@media (max-width: 620px) {
    .access-power-panel { grid-template-columns: 1fr; }
    .access-power-button { min-height: 50px; font-size: 15px; }
    .qr-modal-card { padding: 18px; border-radius: 22px; }
}


/* Fase 8 - reloj táctil, QR y soporte modal */
.sidebar-user .support-link.support-popup-button {
    width: 100%;
    border: 1px solid #86efac;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
}
.support-modal-backdrop[hidden] { display: none; }
.support-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 5200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(2, 6, 23, .70);
    backdrop-filter: blur(8px);
}
.support-modal-card {
    position: relative;
    width: min(390px, calc(100vw - 30px));
    padding: 24px;
    border-radius: 26px;
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
    border: 1px solid rgba(255,255,255,.74);
    box-shadow: 0 32px 88px rgba(0,0,0,.38);
    text-align: center;
    color: #0f172a;
}
.support-modal-icon {
    width: 88px;
    height: 88px;
    object-fit: contain;
    display: block;
    margin: 0 auto 10px;
    filter: drop-shadow(0 16px 24px rgba(34,197,94,.28));
}
.support-modal-card h2 {
    margin: 0 0 8px;
    font-size: 24px;
}
.support-number {
    margin: 0 0 14px;
    color: #334155;
    font-weight: 900;
}
.support-whatsapp-link {
    background: #25d366 !important;
    color: #052e16 !important;
}
.support-close {
    top: 12px;
    right: 12px;
}
.access-power-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.access-power-button img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex: 0 0 auto;
}
.qr-confirm-charge-form {
    margin-top: 16px;
}
.qr-confirm-charge-form .btn {
    min-height: 48px;
    border-radius: 16px;
}
@media (max-width: 620px) {
    .support-modal-card { padding: 20px; border-radius: 22px; }
    .support-modal-icon { width: 74px; height: 74px; }
    .access-power-button img { width: 28px; height: 28px; }
}


/* Fase 9 - reloj por usuario, ticket más legible y conexión remota */
.system-clock-badge {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1250;
    min-width: 96px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .88);
    color: #fff;
    border: 1px solid rgba(255,255,255,.16);
    box-shadow: 0 10px 28px rgba(15,23,42,.20);
    font-weight: 1000;
    font-size: 14px;
    letter-spacing: .04em;
    text-align: center;
    pointer-events: none;
    backdrop-filter: blur(10px);
}
.role-super_admin .system-clock-badge {
    background: rgba(76, 29, 149, .90);
}
.touch-clock {
    top: 10px;
    background: rgba(2, 6, 23, .86);
}
.access-clock {
    top: 10px;
}
.remote-support-form {
    margin: 10px 0 0;
}
.remote-support-button {
    background: linear-gradient(135deg, #2563eb, #0f9f6e) !important;
    color: #fff !important;
}
.support-hint {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-weight: 800;
}
.ticket {
    font-size: 13px;
    line-height: 1.24;
}
.ticket-head h1 {
    font-size: 20px;
}
.ticket-meta {
    font-size: 13px;
    gap: 4px;
}
.ticket table th,
.ticket table td {
    font-size: 13px;
    padding: 7px 0;
}
.ticket-total {
    font-size: 13px;
}
.ticket-total .grand,
.ticket-total div:last-child {
    font-size: 14px;
}
@media print {
    .ticket {
        width: 72mm;
        font-size: 13px !important;
        line-height: 1.24;
    }
    .ticket-head h1 { font-size: 20px !important; }
    .ticket-meta { font-size: 13px !important; }
    .ticket table th,
    .ticket table td { font-size: 13px !important; padding: 7px 0 !important; }
}
@media (max-width: 760px) {
    .system-clock-badge {
        top: 11px;
        min-width: 84px;
        padding: 6px 10px;
        font-size: 12px;
    }
    .top-action-buttons {
        top: 49px;
    }
    .content {
        padding-top: 92px;
    }
    .touch-shell {
        padding-top: 50px;
    }
}

/* Fase 10 - Billares Colombia, gastos y reloj AM/PM */
.system-clock-badge {
    min-width: 128px;
}
.finance-summary-grid .metric.red span { background: var(--red); }
.finance-balance-box {
    display: grid;
    gap: 8px;
    align-content: center;
    min-height: 190px;
    padding: 24px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #f8fafc;
    text-align: center;
}
.finance-balance-box strong {
    font-size: 18px;
    color: var(--muted);
}
.finance-balance-box span {
    display: block;
    font-size: clamp(32px, 4vw, 54px);
    font-weight: 1000;
    letter-spacing: -.05em;
}
.finance-balance-box.positive span { color: var(--green); }
.finance-balance-box.negative span { color: var(--red); }
.block-note {
    display: block;
    margin-top: 3px;
}
@media (max-width: 760px) {
    .system-clock-badge {
        min-width: 108px;
    }
}

/* Fase 11: gastos morado tenue y Excel masivo de productos */
.expense-entry-panel {
    background: linear-gradient(180deg, #f3e8ff 0%, #faf5ff 100%) !important;
    color: #111827;
    border-color: #d8b4fe !important;
}
.expense-entry-panel h2,
.expense-entry-panel label,
.expense-entry-panel input,
.expense-entry-panel select {
    color: #111827;
}
.expense-entry-panel input,
.expense-entry-panel select {
    background: #fff;
    border-color: #c084fc;
}
.excel-products-box {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
    display: grid;
    gap: 12px;
}
.excel-products-box h3 {
    margin: 0 0 6px;
    font-size: 16px;
}
.excel-products-box p {
    margin: 0;
    line-height: 1.35;
}
.excel-products-actions,
.excel-import-form {
    display: grid;
    gap: 10px;
}
.excel-import-form input[type="file"] {
    min-height: 44px;
}
@media (min-width: 980px) {
    .excel-products-box {
        grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
        align-items: start;
    }
}

/* Fase 12: cobro por Chicos, tiempo informativo */
.chico-panel-admin,
.touch-chico-form {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
    border: 1px solid rgba(15, 159, 110, .28);
    background: linear-gradient(135deg, #ecfdf5, #ffffff);
}
.chico-panel-admin {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
    align-items: center;
}
.chico-button {
    min-height: 56px;
    font-size: 18px;
    border-radius: 14px;
}
.chico-cart-item {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
}
.touch-info-only strong {
    color: #0f172a;
    font-size: clamp(20px, 2.2vw, 30px) !important;
}
.single-action-row {
    grid-template-columns: 1fr !important;
}
.reports-chico-grid {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
}
@media (max-width: 760px) {
    .chico-panel-admin {
        grid-template-columns: 1fr;
    }
    .chico-button {
        min-height: 48px;
        font-size: 15px;
    }
}


/* Fase 13: stock visible en ventas */
.product-stock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    max-width: 100%;
    padding: 4px 8px;
    border-radius: 999px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e !important;
    font-weight: 1000;
    letter-spacing: .01em;
    box-shadow: 0 4px 12px rgba(245, 158, 11, .16);
}
.product-stock-badge.stock-low {
    background: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c !important;
}
.touch-product-card .product-stock-badge,
.pos-product-card .product-stock-badge {
    font-size: 10px;
    line-height: 1.05;
}

/* Fase 15: botón Agregar compacto y stock resaltado en amarillo */

/* Fase 16: QR por encima del panel táctil y ajuste visual */
.qr-modal-backdrop {
    z-index: 2147483000 !important;
    isolation: isolate;
}
.qr-modal-card {
    z-index: 2147483001 !important;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.qr-frame {
    max-width: 340px;
}
.qr-frame img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
}
.touch-category-strip {
    z-index: 5;
}

/* Fase 18: venta directa de meseras y mesas siempre operables */
.touch-table-card.available {
    opacity: 1 !important;
}
.touch-table-image-link {
    cursor: pointer;
}
.direct-sale-card {
    background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 68%) !important;
    border: 4px solid #10b981 !important;
}
.direct-sale-card::before {
    background: #10b981 !important;
}
.direct-sale-img {
    object-fit: contain !important;
    padding: 8px;
    background: #ffffff;
}
.touch-table-card .status-pill.available,
.direct-sale-card .status-pill.available {
    background: #16a34a;
    color: #fff !important;
}
.touch-pos-layout .btn:disabled,
.touch-cart-panel .btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    filter: grayscale(.2);
}

/* Fase 21 - Configuración profesional, gastos, registros y reportes SA */
.quick-sales-button {
    min-height: 42px;
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(91,33,182,.24);
}
.settings-page-head,
.settings-tabs,
.settings-system-panel,
.settings-users-panel,
.compact-settings-panel,
.payroll-professional-panel {
    font-family: "Segoe UI", Arial, sans-serif;
}
.settings-page-head { justify-content: center; text-align: center; margin-bottom: 12px; }
.settings-page-head h1 { font-size: 26px; }
.professional-tabs {
    justify-content: center;
    padding: 8px;
    border-radius: 15px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 10px 25px rgba(15,23,42,.05);
}
.professional-tabs a { min-width: 110px; font-size: 13px; }
.settings-system-panel,
.settings-users-panel,
.compact-settings-panel,
.payroll-professional-panel { max-width: 1180px; margin: 0 auto 14px; }
.settings-centered-title { text-align: center; margin-bottom: 14px; }
.settings-centered-title h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.settings-system-form { max-width: 880px; margin: 0 auto; gap: 10px; }
.settings-system-form label,
.compact-professional-form label,
.waitress-professional-form label,
.expense-professional-form label,
.payroll-payment-card label {
    color: #6d28d9;
    font-weight: 800;
    font-size: 13px;
}
.settings-system-form input,
.settings-system-form select,
.compact-professional-form input,
.compact-professional-form select,
.waitress-professional-form input,
.expense-professional-form input,
.expense-professional-form select,
.expense-professional-form textarea,
.payroll-payment-card input,
.payroll-payment-card select {
    color: #111827;
    font-weight: 600;
    border-radius: 10px;
    min-height: 40px;
    padding: 9px 11px;
}
.professional-accordion,
.waitress-slot-list { display: grid; gap: 8px; }
.professional-detail {
    border: 1px solid #e4e7ec;
    border-radius: 13px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 7px 18px rgba(15,23,42,.04);
}
.professional-detail summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 15px;
    user-select: none;
}
.professional-detail summary::-webkit-details-marker { display: none; }
.professional-detail summary::after { content: "▾"; color: #7c3aed; font-weight: 900; transition: transform .2s; }
.professional-detail[open] summary::after { transform: rotate(180deg); }
.professional-detail summary span { color: #64748b; font-size: 12px; font-weight: 700; }
.professional-detail summary strong { color: #111827; font-size: 14px; margin-left: auto; }
.professional-detail[open] summary { background: #f5f3ff; border-bottom: 1px solid #ede9fe; }
.detail-content { padding: 13px; }
.compact-professional-form { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 9px; align-items: end; }
.manager-inline-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.manager-inline-actions .btn { min-width: 105px; min-height: 36px; font-size: 12px; padding: 7px 10px; }
.create-detail { margin-top: 10px; border-style: dashed; }
.compact-type-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 10px; }
.compact-type-card { display: grid; gap: 8px; padding: 11px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fafafa; }
.compact-type-card label { color: #6d28d9; font-weight: 800; font-size: 13px; }
.compact-type-card input { min-height: 38px; padding: 8px 10px; }
.compact-type-card.create-card { background: #f5f3ff; border-color: #ddd6fe; }
.waitress-professional-form { display: grid; grid-template-columns: repeat(4,minmax(140px,1fr)); gap: 9px; align-items: end; }
.waitress-delete-form { display: flex; justify-content: flex-end; margin-top: 8px; }
.waitress-delete-form .btn,
.waitress-professional-form .btn { width: 110px; min-height: 36px; }
.excel-products-professional {
    margin-top: 14px;
    display: grid;
    grid-template-columns: minmax(220px,.7fr) minmax(420px,1.3fr);
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid #ddd6fe;
    border-radius: 14px;
    background: #faf8ff;
}
.excel-products-professional .excel-import-form { display: grid; grid-template-columns: minmax(220px,1fr) auto; gap: 9px; align-items: center; }
.excel-products-professional input[type=file] { width: 100%; min-width: 0; padding: 8px; border: 1px solid #d8dee8; border-radius: 10px; background: #fff; }
.settings-product-search { max-width: 520px; margin: 0 auto 12px; }
.settings-product-search input { width: 100%; }
.product-edit-content { display: grid; grid-template-columns: 90px 1fr; gap: 12px; align-items: start; }
.product-edit-image { width: 90px; height: 90px; object-fit: contain; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; }
.payroll-compact-metrics { grid-template-columns: repeat(4,minmax(150px,1fr)); gap: 9px; }
.payroll-compact-metrics .metric { min-height: 84px; padding: 11px; text-align: center; }
.payroll-compact-metrics .metric strong { font-size: 20px; }
.payroll-two-column { display: grid; grid-template-columns: 1.25fr .75fr; gap: 12px; margin-top: 12px; }
.payroll-payment-card,
.payroll-rule-card { padding: 14px; border: 1px solid #e5e7eb; border-radius: 13px; background: #fafafa; }
.payroll-payment-card { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; align-items: end; }
.payroll-payment-card .btn { grid-column: 1/-1; }
.payroll-rule-card { display: grid; place-content: center; text-align: center; gap: 7px; min-height: 150px; background: #f5f3ff; border-color: #ddd6fe; }
.payroll-rule-card h3 { margin: 0; color: #6d28d9; }
.payroll-rule-card strong { font-size: 17px; }
.payroll-rule-card span { font-size: 25px; color: #7c3aed; font-weight: 900; }

.expense-filter-panel { margin-bottom: 12px; }
.professional-filter { justify-content: center; flex-wrap: wrap; }
.expense-summary-grid { grid-template-columns: repeat(4,minmax(150px,1fr)); }
.expense-summary-grid .metric { text-align: center; min-height: 86px; }
.expense-forms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.general-expense-panel { background: #fff7bf !important; border-color: #f6d84c !important; color: #111827; }
.supplier-expense-panel { background: #f4efff !important; border-color: #c4b5fd !important; color: #111827; }
.expense-professional-form { gap: 9px; }
.expense-professional-form textarea { resize: vertical; min-height: 58px; }
.finance-balance-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.finance-balance-grid > div { padding: 15px; border-radius: 12px; background: #f8fafc; text-align: center; border: 1px solid #e5e7eb; }
.finance-balance-grid span { display: block; color: #64748b; font-weight: 800; margin-bottom: 6px; }
.finance-balance-grid strong { font-size: 22px; }
.finance-balance-grid .positive { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.finance-balance-grid .negative { background: #fff1f2; color: #be123c; border-color: #fecdd3; }

.records-summary-grid { grid-template-columns: repeat(4,minmax(150px,1fr)); }
.activity-timeline { display: grid; gap: 8px; }
.activity-entry { display: flex; justify-content: space-between; gap: 14px; padding: 11px 13px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fafafa; }
.activity-entry > div { display: grid; gap: 3px; }
.activity-entry > div:last-child { text-align: right; }
.activity-entry span,.activity-entry time { color: #64748b; font-size: 12px; }
.activity-entry a { color: #6d28d9; font-weight: 900; }
.direct-activity { border-left: 5px solid #16a34a; }

.live-sales-panel { margin-bottom: 14px; }
.sa-live-metrics { grid-template-columns: repeat(7,minmax(120px,1fr)); gap: 8px; margin-bottom: 0; }
.sa-live-metrics .metric { min-height: 82px; padding: 10px; text-align: center; }
.sa-live-metrics .metric strong { font-size: 18px; }
.worker-tab-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.worker-tab-button { border: 1px solid #ddd6fe; background: #fff; color: #5b21b6; border-radius: 999px; padding: 9px 14px; font-weight: 900; cursor: pointer; }
.worker-tab-button.active { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.worker-tab-panel[hidden] { display: none; }
.ticket-report-link { color: #5b21b6; text-decoration: underline; font-weight: 900; }
.direct-sale-row { background: #f0fdf4; }
.direct-sale-badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: #dcfce7; color: #15803d; font-weight: 900; }
.report-lower-split { grid-template-columns: 1fr 1fr; }
.report-grand-total { display: flex; justify-content: space-between; padding: 12px; margin-top: 10px; background: #f5f3ff; border-radius: 10px; color: #5b21b6; font-weight: 900; }
.payment-balance-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.payment-balance-cards > div { min-height: 120px; display: grid; place-content: center; text-align: center; padding: 14px; border-radius: 13px; background: #f8fafc; border: 1px solid #e5e7eb; }
.payment-balance-cards span { color: #64748b; font-weight: 800; }
.payment-balance-cards strong { font-size: 25px; margin-top: 6px; }
.report-updated { text-align: right; }

.ticket-items-table { display: table !important; width: 100% !important; table-layout: fixed; color: #000 !important; }
.ticket-items-table thead { display: table-header-group !important; }
.ticket-items-table tbody { display: table-row-group !important; }
.ticket-items-table tr { display: table-row !important; }
.ticket-items-table th,.ticket-items-table td { display: table-cell !important; visibility: visible !important; color: #000 !important; opacity: 1 !important; }
.ticket-items-table th:first-child,.ticket-items-table td:first-child { width: 58%; text-align: left; }
.ticket-items-table th:nth-child(2),.ticket-items-table td:nth-child(2) { width: 17%; text-align: center; }
.ticket-items-table th:last-child,.ticket-items-table td:last-child { width: 25%; text-align: right; }
.ticket-items-table td small { display: block; font-size: 10px; font-weight: 500; }

@media print {
    .ticket-items-table,.ticket-items-table thead,.ticket-items-table tbody,.ticket-items-table tr,.ticket-items-table th,.ticket-items-table td { visibility: visible !important; color: #000 !important; }
    .ticket-items-table th,.ticket-items-table td { font-size: 13px !important; padding: 7px 2px !important; }
}

@media (max-width: 1150px) {
    .sa-live-metrics { grid-template-columns: repeat(4,minmax(130px,1fr)); }
    .waitress-professional-form { grid-template-columns: repeat(2,minmax(140px,1fr)); }
}
@media (max-width: 760px) {
    .excel-products-professional,
    .excel-products-professional .excel-import-form,
    .payroll-two-column,
    .expense-forms-grid,
    .report-lower-split,
    .finance-balance-grid,
    .product-edit-content { grid-template-columns: 1fr; }
    .payroll-compact-metrics,
    .expense-summary-grid,
    .records-summary-grid,
    .sa-live-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .payroll-payment-card,
    .waitress-professional-form { grid-template-columns: 1fr; }
    .activity-entry { flex-direction: column; }
    .activity-entry > div:last-child { text-align: left; }
    .product-edit-image { margin: 0 auto; }
}
.expense-range-result {
    max-width: 620px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    gap: 7px;
    padding: 16px;
    text-align: center;
    border-color: #fecaca;
    background: #fff7f7;
}
.expense-range-result span { color: #64748b; font-weight: 800; }
.expense-range-result strong { color: #b91c1c; font-size: 27px; }


/* Fase 22 - Asignación manual y exclusiva de mesas por mesera */
.waitress-assignment-panel .settings-centered-title p { margin: 6px 0 0; color: #64748b; font-size: 13px; font-weight: 650; }
.waitress-assignment-form { grid-template-columns: repeat(4, minmax(145px, 1fr)); }
.waitress-assignment-form .wide { grid-column: 1 / -1; }
.waitress-table-picker { margin: 4px 0 0; padding: 12px; border: 1px solid #ddd6fe; border-radius: 13px; background: linear-gradient(180deg, #faf8ff 0%, #ffffff 100%); }
.waitress-table-picker legend { padding: 0 8px; color: #6d28d9; font-size: 13px; font-weight: 900; }
.waitress-table-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.waitress-table-option { display: flex !important; align-items: center; gap: 10px; min-height: 58px; padding: 9px 11px; border: 1px solid #e5e7eb; border-radius: 11px; background: #fff; color: #111827 !important; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.waitress-table-option:hover { border-color: #a78bfa; background: #f5f3ff; transform: translateY(-1px); }
.waitress-table-option:has(input:checked) { border-color: #7c3aed; background: #ede9fe; box-shadow: 0 7px 16px rgba(124,58,237,.10); }
.waitress-table-option input { width: 21px; height: 21px; min-height: 21px; flex: 0 0 21px; accent-color: #7c3aed; }
.waitress-table-option span { min-width: 0; display: grid; gap: 2px; }
.waitress-table-option strong { color: #111827; font-size: 13px; line-height: 1.15; }
.waitress-table-option small { color: #64748b; font-size: 11px; font-weight: 700; }
.assignment-empty { margin: 0; padding: 10px 12px; border-radius: 10px; background: #f8fafc; color: #64748b; font-size: 12px; font-weight: 700; }
.waitress-assignment-form .manager-inline-actions .btn { width: auto; min-width: 180px; }
@media (max-width: 1050px) { .waitress-assignment-form { grid-template-columns: repeat(2, minmax(145px, 1fr)); } }
@media (max-width: 700px) { .waitress-assignment-form { grid-template-columns: 1fr; } .waitress-table-options { grid-template-columns: 1fr; } .waitress-assignment-form .manager-inline-actions .btn { width: 100%; } }

/* Fase 23 - Turno operativo 8:00 a. m. / liquidación y reabastecimiento desde proveedores */
.workday-rule-note {
    margin: 10px 0 0;
    text-align: center;
    color: #475569;
    font-size: 12px;
}
.shift-period-label {
    margin: 5px 0 0;
    font-size: 12px;
    font-weight: 700;
}
.worker-shift-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 10px;
    padding: 10px 12px;
    border-radius: 11px;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
}
.worker-shift-header strong {
    display: block;
    color: #4c1d95;
    font-size: 15px;
}
.worker-shift-header span {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}
.worker-shift-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(135px, 1fr));
    gap: 9px;
    margin-bottom: 12px;
}
.worker-shift-summary article {
    min-height: 84px;
    display: grid;
    place-content: center;
    gap: 6px;
    padding: 10px;
    text-align: center;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f8fafc;
}
.worker-shift-summary article span {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}
.worker-shift-summary article strong {
    color: #111827;
    font-size: 19px;
    line-height: 1.05;
}
.worker-shift-summary .worker-total-due {
    background: #fde68a;
    border-color: #f59e0b;
}
.worker-shift-summary .worker-total-due span,
.worker-shift-summary .worker-total-due strong {
    color: #111827;
}
.supplier-restock-form .supplier-product-field {
    min-width: 0;
}
.supplier-restock-form select {
    width: 100%;
}
.supplier-expense-panel .settings-centered-title p {
    margin: 5px auto 0;
    max-width: 520px;
    color: #374151;
    font-size: 12px;
}

@media (max-width: 1200px) {
    .worker-shift-summary { grid-template-columns: repeat(3, minmax(135px, 1fr)); }
}
@media (max-width: 760px) {
    .worker-shift-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .worker-shift-summary .worker-total-due { grid-column: 1 / -1; }
}


/* Fase 24 - Selector de día laboral en Ventas Generales */
.worker-day-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 340px);
    align-items: center;
    gap: 14px;
    margin: 2px 0 14px;
    padding: 13px;
    border: 1px solid #ddd6fe;
    border-radius: 14px;
    background: linear-gradient(135deg, #faf5ff 0%, #ffffff 65%);
    box-shadow: 0 8px 20px rgba(91, 33, 182, .06);
}
.worker-day-highlight {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.worker-day-highlight > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 11px;
    border-radius: 999px;
    background: #7c3aed;
    color: #fff;
    font-size: 12px;
    font-weight: 1000;
    letter-spacing: .05em;
}
.worker-day-highlight > strong {
    color: #111827;
    font-size: 19px;
    line-height: 1.15;
}
.worker-day-highlight > small {
    flex-basis: 100%;
    color: #64748b;
    font-size: 11px;
    font-weight: 750;
}
.worker-day-selector-form {
    margin: 0;
}
.worker-day-selector-form label {
    gap: 5px;
    color: #5b21b6;
    font-size: 12px;
    font-weight: 900;
}
.worker-day-selector-form select {
    min-height: 42px;
    border-color: #c4b5fd;
    background: #fff;
    color: #111827;
    font-weight: 850;
}
@media (max-width: 760px) {
    .worker-day-toolbar { grid-template-columns: 1fr; }
    .worker-day-highlight > strong { font-size: 17px; }
}

/* Fase 26 - Nómina histórica y gastos clasificados sin alterar datos reales */
.payroll-history-panel .settings-centered-title p,
.expense-day-panel .settings-centered-title p {
    margin: 5px auto 0;
    max-width: 680px;
    font-size: 12px;
}
.payroll-day-selector,
.expense-day-selector {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 9px;
    flex-wrap: wrap;
    margin: 0 auto 12px;
}
.payroll-day-selector label,
.expense-day-selector label {
    min-width: 210px;
    color: #6d28d9;
    font-weight: 900;
}
.payroll-selected-day-label {
    display: grid;
    place-items: center;
    gap: 3px;
    max-width: 560px;
    margin: 0 auto 12px;
    padding: 11px 14px;
    border: 1px solid #ddd6fe;
    border-radius: 13px;
    background: #faf5ff;
    text-align: center;
}
.payroll-selected-day-label span { color: #6d28d9; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; }
.payroll-selected-day-label strong { color: #111827; font-size: 20px; }
.payroll-selected-day-label small { color: #64748b; font-weight: 750; }
.payroll-day-metrics { margin-bottom: 12px; }
.payroll-total-due-card {
    background: #fde68a !important;
    border-color: #f59e0b !important;
}
.payroll-total-due-card strong,
.payroll-total-due-card small { color: #111827 !important; }
.payroll-products-and-payment {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr);
    gap: 12px;
    margin-bottom: 12px;
}
.payroll-products-card,
.payroll-payment-status-card {
    min-width: 0;
    padding: 13px;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    background: #fff;
}
.payroll-products-card h3,
.payroll-payment-status-card h3 { margin: 0 0 9px; text-align: center; color: #4c1d95; }
.payroll-products-table { max-height: 320px; overflow: auto; }
.payroll-paid-day-amount { display: block; margin: 7px 0 11px; text-align: center; font-size: 27px; color: #047857; }
.payroll-payment-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 10px;
    padding: 9px 0;
    border-top: 1px solid #e5e7eb;
}
.payroll-payment-line span { color: #64748b; font-size: 11px; font-weight: 750; }
.payroll-payment-line b { color: #111827; }
.payroll-payment-line small { grid-column: 1 / -1; color: #64748b; }
.payroll-paid-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
.payroll-paid-summary-grid article {
    min-height: 112px;
    display: grid;
    place-content: center;
    gap: 5px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 9px 22px rgba(15,23,42,.06);
}
.payroll-paid-summary-grid span { color: #111827; font-weight: 900; }
.payroll-paid-summary-grid strong { color: #111827; font-size: 27px; }
.payroll-paid-summary-grid small { color: #374151; font-weight: 700; }
.payroll-paid-all-card { background: #fbcfe8; border-color: #f9a8d4 !important; }
.payroll-paid-month-card { background: #fed7aa; border-color: #fdba74 !important; }

.expense-type-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px;
    margin-bottom: 14px;
}
.expense-summary-card {
    min-height: 120px;
    display: grid;
    place-content: center;
    gap: 5px;
    padding: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(15,23,42,.06);
}
.expense-summary-card span { font-weight: 900; color: #111827; }
.expense-summary-card strong { font-size: 25px; color: #111827; }
.expense-summary-card small { color: #475569; font-weight: 700; line-height: 1.3; }
.supplier-summary-card { background: #ede9fe; border-color: #c4b5fd; }
.general-summary-card { background: #fef3c7; border-color: #fcd34d; }
.total-summary-card { background: #e0f2fe; border-color: #7dd3fc; }
.expense-day-panel { margin-bottom: 14px; }
.expense-day-totals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 8px;
    margin: 0 0 11px;
}
.expense-day-totals > div {
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 11px;
    background: #f8fafc;
    text-align: center;
}
.expense-day-totals span { color: #64748b; font-size: 11px; font-weight: 850; }
.expense-day-totals strong { color: #111827; font-size: 18px; }
.expense-day-table { max-height: 380px; overflow: auto; }

@media (max-width: 900px) {
    .payroll-products-and-payment,
    .expense-type-summary-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
    .payroll-paid-summary-grid,
    .expense-day-totals { grid-template-columns: 1fr; }
    .payroll-day-selector,
    .expense-day-selector { align-items: stretch; }
    .payroll-day-selector > *,
    .expense-day-selector > * { width: 100%; }
}

/* Fase 27: cálculo histórico real de la nómina del administrador */
.payroll-calculation-note {
    margin: -4px 0 10px;
    text-align: center;
    font-weight: 800;
    color: #475569;
}

/* Fase 28: nómina semanal miércoles-miércoles, rango personalizado y resumen de Chicos */
.payroll-paid-summary-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.payroll-paid-week-card {
    background: #dcfce7;
    border-color: #86efac !important;
}
.payroll-range-panel,
.payroll-chicos-panel {
    max-width: 1180px;
    margin: 0 auto 14px;
}
.payroll-range-selector {
    display: grid;
    grid-template-columns: repeat(2, minmax(190px, 1fr)) auto;
    align-items: end;
    gap: 10px;
    max-width: 760px;
    margin: 0 auto 13px;
}
.payroll-range-selector label {
    display: grid;
    gap: 5px;
    color: #6d28d9;
    font-weight: 900;
}
.payroll-range-selector input {
    width: 100%;
}
.payroll-range-results,
.payroll-chicos-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px;
}
.payroll-range-results article,
.payroll-chicos-grid article {
    min-height: 118px;
    display: grid;
    place-content: center;
    gap: 5px;
    padding: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
    text-align: center;
    box-shadow: 0 8px 20px rgba(15,23,42,.06);
}
.payroll-range-results span,
.payroll-chicos-grid span {
    color: #111827;
    font-weight: 900;
}
.payroll-range-results strong,
.payroll-chicos-grid strong {
    color: #111827;
    font-size: 26px;
}
.payroll-range-results small,
.payroll-chicos-grid small {
    color: #475569;
    font-weight: 700;
    line-height: 1.35;
}
.payroll-range-total-card {
    background: #fde68a !important;
    border-color: #f59e0b !important;
}
.payroll-chicos-all-card {
    background: #ede9fe !important;
    border-color: #c4b5fd !important;
}
.payroll-chicos-week-card {
    background: #fef3c7 !important;
    border-color: #f59e0b !important;
}
.payroll-chicos-week-card b {
    margin-top: 4px;
    color: #111827;
    font-size: 17px;
}
.payroll-chicos-month-card {
    background: #dbeafe !important;
    border-color: #93c5fd !important;
}

@media (max-width: 950px) {
    .payroll-paid-summary-grid-three,
    .payroll-range-results,
    .payroll-chicos-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 700px) {
    .payroll-range-selector {
        grid-template-columns: 1fr;
    }
    .payroll-range-selector > * {
        width: 100%;
    }
}

/* Fase 29: gastos clasificados y cuadros interactivos */
.expense-summary-card {
    width: 100%;
    font: inherit;
    cursor: pointer;
    color: inherit;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.expense-summary-card:hover,
.expense-summary-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(15,23,42,.12);
    outline: none;
}
.expense-summary-card.active {
    border-color: #7c3aed !important;
    box-shadow: 0 0 0 3px rgba(124,58,237,.16), 0 12px 26px rgba(15,23,42,.12);
}
.expense-summary-card b {
    color: #5b21b6;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .025em;
}
.employee-summary-card {
    background: #fce7f3;
    border-color: #f9a8d4;
}
.expense-category-detail-panel {
    margin: -2px 0 14px;
    border-color: #c4b5fd;
    box-shadow: 0 12px 28px rgba(76,29,149,.09);
}
.expense-category-detail-panel[hidden],
.expense-category-detail-panel [hidden] {
    display: none !important;
}
.expense-category-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}
.expense-category-detail-head h2 { margin: 0 0 3px; }
.expense-category-detail-head p { margin: 0; }
.expense-detail-total-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    margin-bottom: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 11px;
    background: #f8fafc;
}
.expense-detail-total-line span { font-weight: 900; color: #374151; }
.expense-detail-total-line strong { font-size: 21px; color: #111827; }
.expense-category-table { max-height: 420px; overflow: auto; }
.expense-day-totals-four { grid-template-columns: repeat(4, minmax(0,1fr)); }

@media (max-width: 850px) {
    .expense-day-totals-four { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .expense-category-detail-head { align-items: stretch; flex-direction: column; }
}
@media (max-width: 520px) {
    .expense-day-totals-four { grid-template-columns: 1fr; }
}

/* Fase 31: historial verificable de reabastecimientos */
.restock-history-heading { align-items: flex-start; }
.restock-history-summary {
    min-width: 145px;
    padding: 12px 16px;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    background: #f0fdf4;
    text-align: center;
}
.restock-history-summary strong { display: block; color: #15803d; font-size: 24px; }
.restock-history-summary span { display: block; color: #64748b; font-size: 12px; font-weight: 850; }
.restock-history-summary.warning { background: #fff7ed; border-color: #fed7aa; }
.restock-history-summary.warning strong { color: #c2410c; }
.restock-origin {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    white-space: normal;
}
.restock-origin.linked { background: #dcfce7; color: #166534; }
.restock-origin.manual { background: #e0f2fe; color: #075985; }
.restock-origin.unresolved { background: #ffedd5; color: #9a3412; }
.restock-block { display: block; margin-top: 4px; }
.restock-detail-cell { min-width: 280px; white-space: normal; }
.unlinked-purchases-panel { border-color: #fed7aa; background: #fffdf8; }
.unlinked-purchase-row { background: #fffaf0; }
@media (max-width: 760px) {
    .restock-history-summary { width: 100%; }
}

/* Fase 32: devoluciones y reporte de utilidad */
.returns-nav-button {
    background: linear-gradient(135deg, rgba(124,58,237,.12), rgba(14,165,233,.12));
    border-color: rgba(124,58,237,.28) !important;
}
.returns-hero,
.profit-report-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 24px 28px;
    overflow: hidden;
    background:
        radial-gradient(circle at 95% 10%, rgba(59,130,246,.18), transparent 34%),
        linear-gradient(135deg, #ffffff, #f7fbff);
    border-color: #bfdbfe;
}
.returns-hero h1,
.profit-report-hero h1 { margin: 2px 0 7px; font-size: clamp(27px, 3vw, 38px); color: #0f2740; }
.returns-hero p,
.profit-report-hero p { margin: 0; }
.returns-hero-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
    padding: 15px 18px;
    border: 1px solid #c4b5fd;
    border-radius: 18px;
    background: rgba(255,255,255,.86);
    box-shadow: 0 16px 34px rgba(76,29,149,.10);
}
.returns-hero-badge img { width: 62px; height: 62px; object-fit: contain; }
.returns-hero-badge span { color: #475569; font-size: 13px; line-height: 1.4; }
.returns-hero-badge strong { color: #5b21b6; font-size: 15px; }
.returns-summary-grid { grid-template-columns: repeat(4, minmax(0,1fr)); margin: 16px 0; }
.return-option-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 16px;
    margin-bottom: 18px;
}
.return-option-card {
    position: relative;
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 14px;
    min-height: 178px;
    padding: 20px;
    border: 1px solid #dbe4ee;
    border-radius: 20px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(15,23,42,.07);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.return-option-card:hover,
.return-option-card.active { transform: translateY(-3px); box-shadow: 0 19px 40px rgba(15,23,42,.13); }
.return-option-card.exchange:hover,
.return-option-card.exchange.active { border-color: #60a5fa; }
.return-option-card.customer:hover,
.return-option-card.customer.active { border-color: #34d399; }
.return-option-card.waitress:hover,
.return-option-card.waitress.active { border-color: #a78bfa; }
.return-card-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 17px;
    font-size: 30px;
    font-weight: 950;
    color: #fff;
}
.exchange .return-card-icon { background: linear-gradient(135deg,#2563eb,#06b6d4); }
.customer .return-card-icon { background: linear-gradient(135deg,#059669,#22c55e); }
.waitress .return-card-icon { background: linear-gradient(135deg,#7c3aed,#ec4899); }
.return-card-copy { display: flex; flex-direction: column; gap: 8px; }
.return-card-copy strong { color: #0f172a; font-size: 19px; line-height: 1.18; }
.return-card-copy small { color: #64748b; font-size: 13px; line-height: 1.5; }
.return-card-action {
    position: absolute;
    left: 20px;
    bottom: 16px;
    padding: 6px 11px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 12px;
    font-weight: 900;
}
.return-workspace { margin-bottom: 18px; padding: 0; overflow: hidden; border-color: #cbd5e1; }
.return-workspace[hidden] { display: none !important; }
.return-workspace-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding: 20px 24px;
    color: #fff;
}
.return-workspace-head.exchange { background: linear-gradient(135deg,#1d4ed8,#0891b2); }
.return-workspace-head.customer { background: linear-gradient(135deg,#047857,#16a34a); }
.return-workspace-head.waitress { background: linear-gradient(135deg,#6d28d9,#db2777); }
.return-workspace-head span { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; opacity: .82; }
.return-workspace-head h2 { margin: 0 0 5px; font-size: 25px; }
.return-workspace-head p { margin: 0; opacity: .88; }
.return-workspace-head .btn { background: rgba(255,255,255,.17); color: #fff; border-color: rgba(255,255,255,.35); }
.return-form { padding: 22px 24px 24px; }
.return-step-grid {
    display: grid;
    grid-template-columns: minmax(0,1fr) 50px minmax(0,1fr);
    align-items: center;
    gap: 14px;
}
.return-step-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 20px;
    border: 1px solid #dbe4ee;
    border-radius: 17px;
    background: #f8fafc;
}
.return-step-card strong { color: #0f172a; font-size: 17px; }
.return-step-card small { color: #64748b; font-weight: 650; }
.return-step-card select { margin-top: 7px; background: #fff; }
.return-step-number {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #0f2740;
    color: #fff;
    font-size: 13px;
    font-weight: 950;
}
.return-flow-arrow { text-align: center; color: #2563eb; font-size: 34px; font-weight: 950; }
.return-form-grid {
    display: grid;
    grid-template-columns: minmax(140px,.6fr) minmax(220px,1fr) minmax(280px,1.6fr);
    gap: 14px;
    margin-top: 16px;
}
.return-form-grid label { font-weight: 850; color: #334155; }
.return-form-grid label small { font-weight: 600; color: #94a3b8; }
.return-note-field textarea { min-height: 72px; resize: vertical; }
.return-live-summary {
    margin: 17px 0;
    padding: 15px 18px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: #eff6ff;
    color: #1e3a5f;
    line-height: 1.55;
}
.return-live-summary strong { color: #0f172a; }
.return-live-summary.warning { border-color: #fdba74; background: #fff7ed; color: #9a3412; }
.return-submit-button { min-height: 50px; font-size: 16px; }
.return-refund-layout {
    display: grid;
    grid-template-columns: minmax(0,1.7fr) minmax(210px,.7fr);
    gap: 16px;
    align-items: stretch;
}
.return-workspace[data-return-panel="waitress_refund"] .return-refund-layout { grid-template-columns: repeat(2,minmax(0,1fr)) minmax(210px,.75fr); }
.return-money-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 155px;
    padding: 20px;
    border-radius: 18px;
    color: #fff;
    text-align: center;
    box-shadow: inset 0 1px rgba(255,255,255,.25);
}
.return-money-card.customer { background: linear-gradient(145deg,#047857,#22c55e); }
.return-money-card.waitress { background: linear-gradient(145deg,#6d28d9,#ec4899); }
.return-money-card span { font-size: 13px; font-weight: 850; opacity: .88; }
.return-money-card strong { font-size: 32px; }
.return-money-card small { opacity: .82; }
.returns-history-panel { margin-top: 18px; }
.return-history-count,
.profit-coverage {
    padding: 7px 11px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 12px;
    font-weight: 900;
}
.returns-history-table { max-height: 610px; overflow: auto; }
.return-type-badge,
.return-result {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}
.return-type-badge.exchange { color: #1d4ed8; background: #dbeafe; }
.return-type-badge.customer_refund { color: #047857; background: #d1fae5; }
.return-type-badge.waitress_refund { color: #7e22ce; background: #f3e8ff; }
.return-result.stock { color: #0369a1; background: #e0f2fe; }
.return-result.money { color: #166534; background: #dcfce7; }
.dashboard-product-report-callout {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    align-items: center;
    gap: 18px;
    margin: 16px 0;
    border-color: #c4b5fd;
    background: linear-gradient(135deg,#faf5ff,#eff6ff);
}
.dashboard-report-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg,#6d28d9,#2563eb);
    color: #fff;
    font-size: 32px;
    font-weight: 950;
}
.dashboard-product-report-callout h2 { margin: 2px 0 4px; }
.dashboard-product-report-callout p { margin: 0; }
.dashboard-report-button { white-space: normal; text-align: center; max-width: 280px; }
.profit-download-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.profit-kpi-grid { grid-template-columns: repeat(4,minmax(0,1fr)); margin: 16px 0; }
.profit-difference-panel { border-color: #bfdbfe; }
.profit-equation {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr)) 34px 34px;
    grid-template-areas: "sale minus purchases equals result";
    align-items: center;
    gap: 12px;
    margin: 14px 0;
}
.profit-equation > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    border: 1px solid #dbe4ee;
    border-radius: 14px;
    background: #f8fafc;
}
.profit-equation > b { text-align: center; font-size: 25px; color: #64748b; }
.profit-equation span { color: #64748b; font-size: 12px; font-weight: 850; }
.profit-equation strong { color: #0f172a; font-size: 22px; }
.profit-equation .positive { border-color: #86efac; background: #f0fdf4; }
.profit-equation .negative { border-color: #fdba74; background: #fff7ed; }
.profit-equation .positive strong { color: #15803d; }
.profit-equation .negative strong { color: #c2410c; }
.profit-product-table { max-height: 680px; overflow: auto; }
.profit-positive { color: #15803d; font-weight: 900; }
.profit-negative { color: #b91c1c; font-weight: 900; }
.profit-note-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.profit-note-grid article { padding: 14px 16px; border: 1px solid #e2e8f0; border-radius: 13px; background: #f8fafc; color: #475569; line-height: 1.5; }

@media (max-width: 1100px) {
    .return-option-grid { grid-template-columns: 1fr; }
    .return-option-card { min-height: 140px; }
    .return-workspace[data-return-panel="waitress_refund"] .return-refund-layout { grid-template-columns: 1fr 1fr; }
    .return-workspace[data-return-panel="waitress_refund"] .return-money-card { grid-column: 1 / -1; min-height: 115px; }
    .profit-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 820px) {
    .returns-hero,
    .profit-report-hero { align-items: stretch; flex-direction: column; }
    .returns-hero-badge { width: 100%; min-width: 0; }
    .returns-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .return-step-grid { grid-template-columns: 1fr; }
    .return-flow-arrow { transform: rotate(90deg); }
    .return-form-grid,
    .return-refund-layout,
    .return-workspace[data-return-panel="waitress_refund"] .return-refund-layout { grid-template-columns: 1fr; }
    .return-workspace[data-return-panel="waitress_refund"] .return-money-card { grid-column: auto; }
    .dashboard-product-report-callout { grid-template-columns: 54px 1fr; }
    .dashboard-report-icon { width: 54px; height: 54px; }
    .dashboard-report-button { grid-column: 1 / -1; max-width: none; }
    .profit-equation { grid-template-columns: 1fr; }
    .profit-note-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .returns-summary-grid,
    .profit-kpi-grid { grid-template-columns: 1fr; }
    .return-option-card { grid-template-columns: 48px 1fr; padding: 16px; }
    .return-card-icon { width: 48px; height: 48px; font-size: 25px; }
    .return-form { padding: 16px; }
    .return-workspace-head { padding: 17px; flex-direction: column; }
    .profit-download-actions .btn { width: 100%; }
}

/* Fase 32.1: informe de utilidad compacto y sin desbordamiento horizontal */
.profit-report-hero,
.profit-difference-panel,
.profit-kpi-grid,
.profit-product-table,
.profit-notes-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.profit-report-hero {
    gap: 16px;
    padding: 18px 22px;
}

.profit-report-hero > div:first-child {
    min-width: 0;
}

.profit-report-hero h1 {
    margin: 1px 0 5px;
    font-size: clamp(24px, 2.35vw, 34px);
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.profit-report-hero .muted {
    font-size: 13px;
    line-height: 1.35;
}

.profit-download-actions {
    flex: 0 0 auto;
    gap: 8px;
}

.profit-download-actions .btn {
    min-height: 42px;
    padding: 10px 14px;
    font-size: 14px;
    white-space: nowrap;
}

.profit-kpi-grid {
    gap: 10px;
    margin: 12px 0;
}

.profit-kpi-grid .metric {
    min-width: 0;
    padding: 11px 13px;
    gap: 4px;
}

.profit-kpi-grid .metric strong {
    min-width: 0;
    font-size: clamp(19px, 1.55vw, 25px);
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.profit-kpi-grid .metric small {
    font-size: 12px;
    line-height: 1.25;
}

.profit-difference-panel {
    padding: 15px 17px;
    overflow: hidden;
}

.profit-difference-panel .section-title {
    margin-bottom: 4px;
}

.profit-difference-panel .section-title h2 {
    margin-top: 2px;
    font-size: 21px;
}

.profit-equation {
    grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr) 28px minmax(180px, .82fr);
    grid-template-areas: "sale minus purchases equals result";
    gap: 8px;
    margin: 10px 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.profit-equation > div:nth-of-type(1) { grid-area: sale; }
.profit-equation > b:nth-of-type(1) { grid-area: minus; }
.profit-equation > div:nth-of-type(2) { grid-area: purchases; }
.profit-equation > b:nth-of-type(2) { grid-area: equals; }
.profit-equation > div:nth-of-type(3) { grid-area: result; }

.profit-equation > div {
    min-width: 0;
    padding: 12px 14px;
    border-radius: 12px;
}

.profit-equation > b {
    font-size: 22px;
}

.profit-equation strong {
    min-width: 0;
    font-size: clamp(18px, 1.45vw, 22px);
    overflow-wrap: anywhere;
}

.profit-equation span {
    font-size: 11px;
}

.profit-difference-panel > .muted {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.35;
}

.profit-product-table {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.profit-product-table table {
    width: 100%;
    min-width: 850px;
}

.profit-product-table th,
.profit-product-table td {
    padding: 9px 10px;
    font-size: 12px;
}

.profit-note-grid {
    gap: 9px;
}

.profit-note-grid article {
    padding: 11px 13px;
    font-size: 12px;
    line-height: 1.4;
}

@media (max-width: 1280px) {
    .profit-report-hero {
        align-items: flex-start;
    }

    .profit-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profit-equation {
        grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
        grid-template-areas:
            "sale minus purchases"
            "result result result";
    }

    .profit-equation > b:nth-of-type(2) {
        display: none;
    }

    .profit-equation > div:nth-of-type(3) {
        margin-top: 2px;
    }
}

@media (max-width: 820px) {
    .profit-report-hero {
        padding: 16px;
    }

    .profit-download-actions {
        width: 100%;
    }

    .profit-download-actions .btn {
        flex: 1 1 150px;
        white-space: normal;
    }

    .profit-equation {
        grid-template-columns: 1fr;
        grid-template-areas:
            "sale"
            "minus"
            "purchases"
            "equals"
            "result";
    }

    .profit-equation > b:nth-of-type(2) {
        display: block;
    }

    .profit-equation > b {
        line-height: 1;
    }
}

@media (max-width: 560px) {
    .profit-kpi-grid {
        grid-template-columns: 1fr;
    }

    .profit-report-hero h1 {
        font-size: 23px;
    }
}

/* Fase 32.2: centro seguro para guardar y restaurar la base de datos */
.backup-center {
    margin: 16px 0;
    padding: 20px;
    border-color: #cbd5e1;
    background:
        radial-gradient(circle at top right, rgba(124,58,237,.09), transparent 34%),
        linear-gradient(145deg, #ffffff, #f8fafc);
    overflow: hidden;
}

.backup-center-title {
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 15px;
}

.backup-center-title h2 {
    margin: 1px 0 5px;
}

.backup-center-title .muted {
    margin: 0;
    max-width: 760px;
}

.backup-security-badge,
.backup-valid-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.backup-security-badge {
    color: #5b21b6;
    background: #ede9fe;
    border: 1px solid #c4b5fd;
}

.backup-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.backup-action-card {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 15px;
    min-width: 0;
    padding: 17px;
    border: 1px solid #dbe4ee;
    border-radius: 18px;
    background: rgba(255,255,255,.93);
    box-shadow: 0 12px 28px rgba(15,23,42,.07);
}

.backup-action-card.save { border-left: 5px solid #16a34a; }
.backup-action-card.open { border-left: 5px solid #7c3aed; }

.backup-action-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 17px;
    color: #fff;
    font-size: 31px;
    font-weight: 950;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
}

.backup-action-card.save .backup-action-icon { background: linear-gradient(145deg, #047857, #22c55e); }
.backup-action-card.open .backup-action-icon { background: linear-gradient(145deg, #6d28d9, #a855f7); }

.backup-action-copy {
    min-width: 0;
}

.backup-action-copy strong {
    display: block;
    margin-bottom: 4px;
    color: #0f172a;
    font-size: 18px;
}

.backup-action-copy p,
.backup-action-copy small {
    display: block;
    margin: 0;
    color: #64748b;
    line-height: 1.38;
}

.backup-action-copy p { font-size: 13px; }
.backup-action-copy small { margin-top: 5px; font-size: 11px; }
.backup-action-copy code { color: #5b21b6; font-weight: 900; }

.backup-action-button {
    min-width: 148px;
    min-height: 44px;
    padding: 10px 14px;
    white-space: nowrap;
}

.backup-open-form {
    display: grid;
    gap: 8px;
    min-width: 180px;
}

.backup-file-picker {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    max-width: 210px;
    padding: 8px 12px;
    border: 1px dashed #8b5cf6;
    border-radius: 11px;
    color: #6d28d9;
    background: #f5f3ff;
    font-size: 12px;
    font-weight: 850;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
}

.backup-file-picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.backup-file-picker span {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.backup-restore-preview {
    margin-top: 16px;
    padding: 17px;
    border: 1px solid #86efac;
    border-radius: 18px;
    background: linear-gradient(145deg, #f0fdf4, #ffffff);
    scroll-margin-top: 90px;
}

.backup-preview-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 13px;
}

.backup-preview-heading h3 {
    margin: 1px 0 4px;
    color: #14532d;
    font-size: 21px;
}

.backup-preview-heading p {
    margin: 0;
    color: #4b5563;
}

.backup-valid-badge {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #86efac;
}

.backup-preview-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 9px;
}

.backup-preview-grid article {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #d1fae5;
    border-radius: 12px;
    background: #fff;
}

.backup-preview-grid small,
.backup-preview-grid strong {
    display: block;
}

.backup-preview-grid small {
    margin-bottom: 4px;
    color: #64748b;
    font-size: 11px;
    font-weight: 750;
}

.backup-preview-grid strong {
    color: #0f172a;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.backup-danger-notice {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid #fdba74;
    border-radius: 12px;
    color: #9a3412;
    background: #fff7ed;
}

.backup-danger-notice strong,
.backup-danger-notice p {
    display: block;
    margin: 0;
}

.backup-danger-notice p {
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.4;
}

.backup-preview-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 13px;
}

.backup-confirm-form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.backup-confirm-check {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 430px;
    color: #334155;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
}

.backup-confirm-check input {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
}

@media (max-width: 1250px) {
    .backup-action-card {
        grid-template-columns: 52px minmax(0, 1fr);
    }
    .backup-action-button,
    .backup-open-form {
        grid-column: 1 / -1;
        width: 100%;
        max-width: none;
    }
    .backup-file-picker {
        max-width: none;
    }
    .backup-preview-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .backup-center { padding: 16px; }
    .backup-center-title,
    .backup-preview-heading {
        flex-direction: column;
        align-items: stretch;
    }
    .backup-security-badge,
    .backup-valid-badge { width: fit-content; }
    .backup-action-grid { grid-template-columns: 1fr; }
    .backup-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .backup-preview-actions,
    .backup-confirm-form {
        align-items: stretch;
        flex-direction: column;
    }
    .backup-preview-actions form,
    .backup-preview-actions .btn { width: 100%; }
    .backup-confirm-check { max-width: none; }
}

@media (max-width: 520px) {
    .backup-action-card {
        grid-template-columns: 46px minmax(0, 1fr);
        padding: 14px;
    }
    .backup-action-icon {
        width: 46px;
        height: 46px;
        border-radius: 13px;
        font-size: 25px;
    }
    .backup-preview-grid { grid-template-columns: 1fr; }
}

/* Fase 33: acceso y escritorio más compactos */
.access-menu-production {
    width: min(1080px, calc(100vw - 28px));
    gap: 10px;
    padding: 10px 0;
}
.access-title-production h1 {
    margin: 4px 0 0;
    font-size: clamp(28px, 3.2vw, 43px);
}
.access-title-production .login-eyebrow {
    font-size: 11px;
}
.access-main-logo {
    width: min(170px, 30vw);
    max-height: 108px;
    margin-bottom: 2px;
}
.access-grid-production {
    gap: 12px;
}
.access-grid-production .access-card {
    min-height: 215px;
    padding: 12px 18px 14px;
    gap: 4px;
}
.access-grid-production .access-card img {
    width: 142px;
    height: 138px;
    margin: 0 auto 2px;
    object-fit: contain;
    object-position: center bottom;
}
.access-grid-production .access-card strong {
    font-size: clamp(20px, 2vw, 29px);
}
.access-grid-production .access-card small {
    font-size: 12px;
}
.access-power-panel {
    margin: 6px auto 2px;
    gap: 8px;
}
.access-power-button {
    min-height: 44px;
    font-size: 13px;
}
body.access-body .demo-credentials {
    width: min(920px, 100%);
    margin: 5px auto 2px;
    padding: 7px 12px;
    gap: 3px 12px;
    font-size: 11px;
}
.access-footer {
    font-size: 11px;
}

@media (min-width: 761px) {
    body.access-body .demo-credentials {
        grid-template-columns: auto repeat(3, minmax(0, 1fr));
        align-items: center;
    }
}

@media (min-width: 761px) and (max-height: 700px) {
    .access-menu-production { gap: 7px; padding: 6px 0; }
    .access-main-logo { width: 138px; max-height: 84px; }
    .access-title-production h1 { font-size: clamp(27px, 3vw, 38px); }
    .access-grid-production .access-card { min-height: 188px; padding: 8px 15px 11px; }
    .access-grid-production .access-card img { width: 118px; height: 112px; }
    .access-grid-production .access-card strong { font-size: clamp(19px, 1.9vw, 26px); }
    .access-power-button { min-height: 38px; }
    body.access-body .demo-credentials { margin-top: 3px; padding: 5px 10px; }
}

@media (max-width: 760px) {
    .access-menu-production { gap: 10px; padding: 10px 0; }
    .access-main-logo { width: 132px; max-height: 84px; }
    .access-grid-production .access-card {
        min-height: 132px;
        grid-template-columns: 84px minmax(0, 1fr);
        padding: 10px 14px;
    }
    .access-grid-production .access-card img {
        width: 78px;
        height: 106px;
        margin: 0;
        grid-row: 1 / span 2;
    }
}

/* Taco Loco fase 1: desktop density and collapsible configuration/report panels. */
body.access-body .access-menu-production { width: min(790px, calc(100vw - 24px)); gap: 7px; }
body.access-body .access-main-logo { width: 118px; max-height: 88px; }
body.access-body .access-title-production h1 { font-size: clamp(23px, 2.4vw, 31px); }
body.access-body .access-grid-production { gap: 9px; }
body.access-body .access-grid-production .access-card { min-height: 154px; padding: 8px 12px; }
body.access-body .access-grid-production .access-card img { width: 94px; height: 91px; }
body.access-body .access-grid-production .access-card strong { font-size: 18px; }
body.access-body .access-grid-production .access-card small { font-size: 11px; }
body.access-body .access-footer { display: grid; gap: 3px; text-align: center; font-size: 12px; }
.auth-body .pin-keypad { display: none; }
.auth-body .auth-card { max-width: 390px; padding: 20px; }
.auth-body [data-pin-input] { font-size: 16px; letter-spacing: .1em; }
.content .phase1-collapsible-panel { padding: 0 !important; overflow: hidden; }
.phase1-collapse > summary { list-style: none; cursor: pointer; padding: 10px 14px; font-weight: 800; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.phase1-collapse > summary::-webkit-details-marker { display: none; }
.phase1-collapse > summary::after { content: '▾'; font-size: 15px; }
.phase1-collapse[open] > summary::after { transform: rotate(180deg); }
.phase1-collapse-body { padding: 0 13px 12px; }
.phase1-collapse-body > .settings-centered-title { display: none; }
.settings-tabs.professional-tabs { gap: 5px; margin-bottom: 9px; padding: 4px; }
.settings-tabs.professional-tabs a { min-height: 31px; padding: 5px 9px; font-size: 12px; }
.settings-page-head { margin-bottom: 7px; }
.content .form-grid, .content .compact-professional-form { gap: 8px; }
.content input:not([type=checkbox]):not([type=radio]), .content select, .content textarea { min-height: 32px; padding: 5px 8px; font-size: 13px; }
.content label { font-size: 12px; }
.content .btn { min-height: 30px; padding: 5px 10px; font-size: 12px; }
.content .page-head { margin-bottom: 8px; }
.content .panel { margin-bottom: 9px; }
.content .metric { min-height: 69px; padding: 8px; }
.content .metric strong { font-size: 18px; }
.dashboard-tables-section .table-grid.compact { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.dashboard-tables-section .pool-card { padding: 8px; gap: 5px; }
.dashboard-tables-section .pool-visual { height: 90px; min-height: 90px; }
.dashboard-tables-section .pool-visual img { max-height: 85px; }
.dashboard-tables-section .waitress-card { padding: 5px; }
.inventory-page .panel, .expenses-page .panel, .returns-page .panel { padding: 10px; }
.compact-type-grid { grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 7px; }
.compact-type-card { padding: 8px; }
@media (max-width: 760px) {
  body.access-body .access-grid-production .access-card { min-height: 104px; }
  body.access-body .access-grid-production .access-card img { width: 65px; height: 80px; }
  .settings-tabs.professional-tabs { overflow-x: auto; flex-wrap: nowrap; }
}

/* Compact waitress workspace on mouse and keyboard screens. */
.touch-body { font-size: 13px; }
.touch-shell { max-width: 1180px; padding: 12px; }
.touch-header { gap: 10px; margin-bottom: 9px; }
.touch-header h1 { font-size: clamp(20px, 2vw, 27px); }
.touch-table-grid { grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 9px; }
.touch-table-card { min-height: 0; padding: 10px; gap: 6px; }
.touch-table-image-link { min-height: 100px; }
.touch-table-img { max-height: 100px; }
.touch-waitress-large { padding: 6px; }
.touch-body .btn { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.touch-body input:not([type=checkbox]):not([type=radio]),
.touch-body select, .touch-body textarea { min-height: 33px; padding: 5px 8px; font-size: 13px; }
.touch-product-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 8px; }
.touch-product-card { min-height: 0; padding: 8px; }
.touch-product-card .product-photo { max-height: 88px; }
@media (max-width: 600px) {
  .touch-table-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .touch-table-card { padding: 7px; }
}

/* Ajustes finales de densidad para PC. */
.settings-tabs.professional-tabs a { min-width: 0; }
.expense-summary-card { min-height: 85px; padding: 10px 12px; gap: 4px; }
.expense-summary-card strong { font-size: 18px; }
.expense-summary-card small { font-size: 11px; }
.expense-range-result { min-height: 0; padding: 9px 12px; }
.expense-range-result strong { font-size: 19px; }
.expense-day-panel, .expense-filter-panel { padding: 10px; margin-bottom: 8px; }
.returns-hero { padding: 10px 14px; gap: 10px; }
.returns-hero h1 { font-size: 24px; }
.returns-hero-badge { min-width: 0; padding: 6px 9px; gap: 7px; }
.returns-hero-badge img { width: 35px; height: 35px; }
.returns-summary-grid { gap: 7px; margin: 8px 0; }
.return-option-grid { gap: 8px; margin-bottom: 9px; }
.return-option-card { min-height: 104px; padding: 9px; grid-template-columns: 38px 1fr; gap: 8px; border-radius: 11px; }
.return-card-icon { width: 38px; height: 38px; border-radius: 9px; font-size: 20px; }
.return-card-copy strong { font-size: 14px; }
.return-card-copy small { font-size: 11px; line-height: 1.2; }
.return-card-action { position: static; width: fit-content; padding: 3px 7px; font-size: 10px; }
.return-workspace-head { padding: 10px 12px; }
.return-workspace-head h2 { font-size: 18px; }
.backup-action-grid { gap: 8px; }
.backup-action-card { min-height: 0; padding: 10px; gap: 9px; }
.backup-action-icon { width: 40px; height: 40px; font-size: 21px; }
@media (max-width: 760px) {
  .return-option-grid { grid-template-columns: 1fr; }
  .returns-hero-badge { display: none; }
}
