* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
    --bg: #0D0F14;
    --bg2: #13161E;
    --bg3: #1A1E2A;
    --card: #1E2330;
    --border: #2A3045;
    --border2: #364060;
    --teal: #00C9A7;
    --tdim: rgba(0, 201, 167, .12);
    --gold: #FFB830;
    --gdim: rgba(255, 184, 48, .12);
    --rose: #FF5E7D;
    --rdim: rgba(255, 94, 125, .12);
    --blue: #4D8DFF;
    --bdim: rgba(77, 141, 255, .12);
    --text: #E8EAF2;
    --t2: #8892A8;
    --t3: #545E76;
    --r: 14px;
    --rs: 8px;
    --font: 'Sora', sans-serif;
    --mono: 'JetBrains Mono', monospace
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden
}

/* ── SIDEBAR — columna vertical colapsable ── */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 220px;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width .3s ease, box-shadow .3s ease;
    overflow: visible
}

.sidebar.collapsed {
    width: 54px
}

/* Hover-to-expand cuando está colapsado */
.sidebar.collapsed:hover {
    width: 220px;
    box-shadow: 4px 0 28px rgba(0,0,0,.45)
}

/* Botón toggle — pegado al borde derecho del sidebar */
.sidebar-toggle {
    position: absolute;
    right: -17px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 48px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 101;
    color: var(--t2);
    font-size: .7rem;
    transition: background .15s, color .15s
}

.sidebar-toggle:hover {
    background: var(--bg3);
    color: var(--teal)
}

/* Logo */
.sidebar .logo {
    padding: 18px 14px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center
}

.sidebar.collapsed .logo {
    padding: 12px 6px
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed #logoRnc {
    display: none
}

/* Nav section — scrollbar fino */
.nav-section {
    flex: 1;
    padding: 6px 6px 8px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent
}
.nav-section::-webkit-scrollbar { width: 4px }
.nav-section::-webkit-scrollbar-track { background: transparent }
.nav-section::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px }
.nav-section::-webkit-scrollbar-thumb:hover { background: var(--teal) }

/* ── NAV GROUPS (secciones colapsables) ── */
.nav-group { flex-shrink: 0 }

.nav-group-hdr {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px 7px 10px;
    border-radius: var(--rs);
    cursor: pointer;
    font-size: .70rem;
    font-weight: 800;
    color: var(--t3);
    text-transform: uppercase;
    letter-spacing: .07em;
    transition: background .15s, color .15s;
    user-select: none;
    white-space: nowrap
}
.nav-group-hdr:hover { background: var(--bg3); color: var(--t2) }
.nav-group-ico { font-size: .9rem; flex-shrink: 0 }
.nav-group-title { flex: 1 }
.nav-group-arrow {
    font-size: .65rem;
    transition: transform .2s;
    flex-shrink: 0
}
.nav-group.collapsed .nav-group-arrow { transform: rotate(-90deg) }
.nav-group.collapsed .nav-group-items { display: none }

.nav-group-items {
    padding-left: 8px;
    display: flex;
    flex-direction: column;
    gap: 1px
}

/* Nav items */
.nav-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: var(--rs);
    cursor: pointer;
    font-size: .78rem;
    font-weight: 600;
    color: var(--t2);
    transition: background .15s, color .15s;
    white-space: nowrap;
    position: relative;
    flex-shrink: 0
}
.nav-item:hover { background: var(--bg3); color: var(--text) }

/* Barra lateral verde en el item activo */
.nav-item.active {
    background: var(--tdim);
    color: var(--teal);
    font-weight: 700
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: var(--teal);
    border-radius: 0 3px 3px 0
}

.nav-item .ico {
    font-size: .95rem;
    flex-shrink: 0;
    width: 18px;
    text-align: center
}

/* Transiciones para textos del sidebar */
.nav-item .dock-label,
.nav-group-title,
.nav-group-arrow {
    transition: opacity .2s ease, max-width .25s ease;
    overflow: hidden;
    white-space: nowrap
}

/* Colapsado: solo iconos */
.sidebar.collapsed .nav-group-hdr {
    justify-content: center;
    padding: 8px 4px;
    overflow: visible
}
.sidebar.collapsed .nav-group-items { padding-left: 0 }
.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 8px 4px;
    overflow: visible
}
.sidebar.collapsed .nav-item .dock-label,
.sidebar.collapsed .nav-group-title,
.sidebar.collapsed .nav-group-arrow {
    opacity: 0;
    max-width: 0;
    pointer-events: none
}
.sidebar.collapsed .nav-item::before { display: none }

.sidebar.collapsed .nav-item .ico {
    width: auto
}

/* Hover sobre sidebar colapsado — mostrar textos */
.sidebar.collapsed:hover .nav-group-hdr {
    justify-content: flex-start;
    padding: 7px 8px 7px 10px
}
.sidebar.collapsed:hover .nav-group-items { padding-left: 8px }
.sidebar.collapsed:hover .nav-item {
    justify-content: flex-start;
    padding: 7px 8px
}
.sidebar.collapsed:hover .nav-item .dock-label,
.sidebar.collapsed:hover .nav-group-title,
.sidebar.collapsed:hover .nav-group-arrow {
    opacity: 1;
    max-width: 200px;
    pointer-events: auto
}
.sidebar.collapsed:hover .nav-item::before { display: block }
.sidebar.collapsed:hover .nav-item .ico {
    width: 18px
}

/* Footer */
.sidebar-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    flex-shrink: 0
}

.sidebar.collapsed .sidebar-footer {
    padding: 8px 4px
}

.sidebar.collapsed .sidebar-footer .footer-text {
    display: none
}

/* Main content */
.main {
    margin-left: 220px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: margin-left .25s ease
}

.main.expanded {
    margin-left: 54px
}

.date-chip {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--rs);
    padding: 10px 14px;
    font-size: .78rem;
    color: var(--t2)
}

.date-chip strong {
    display: block;
    font-family: var(--mono);
    color: var(--text);
    font-size: .9rem
}

/* main defined in sidebar section */
.topbar {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 700
}

.topbar-sub {
    font-size: .8rem;
    color: var(--t2);
    margin-top: 1px
}

.badge {
    background: var(--tdim);
    color: var(--teal);
    border: 1px solid rgba(0, 201, 167, .25);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: .75rem;
    font-weight: 700
}

.content {
    padding: 16px 20px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden
}

.panel {
    display: none;
    animation: fu .35s ease
}

/* Panels scroll vertically by default */
.panel.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px
}

/* POS panel fills height, no outer scroll */
#p-pos.panel.active {
    overflow: hidden;
    padding-bottom: 0
}

@keyframes fu {
    from {
        opacity: 0;
        transform: translateY(12px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 24px;
    margin-bottom: 20px
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px
}

.ct {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--teal);
    display: inline-block;
    flex-shrink: 0
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px
}

.kpi {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 20px 22px;
    position: relative;
    overflow: hidden
}

.kpi::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px
}

.kpi.t::before {
    background: var(--teal)
}

.kpi.g::before {
    background: var(--gold)
}

.kpi.r::before {
    background: var(--rose)
}

.kpi.b::before {
    background: var(--blue)
}

.kpi-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--t3);
    margin-bottom: 8px
}

.kpi-val {
    font-family: var(--mono);
    font-size: 1.5rem;
    font-weight: 600
}

.kpi.t .kpi-val {
    color: var(--teal)
}

.kpi.g .kpi-val {
    color: var(--gold)
}

.kpi.r .kpi-val {
    color: var(--rose)
}

.kpi.b .kpi-val {
    color: var(--blue)
}

.kpi-ico {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.8rem;
    opacity: .15
}

.fg {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px
}

.fg label {
    display: block;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--t2);
    margin-bottom: 7px
}

.fg input,
.fg select,
.fg textarea {
    width: 100%;
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: var(--rs);
    color: var(--text);
    font-family: var(--mono);
    font-size: .9rem;
    padding: 10px 14px;
    transition: border-color .2s;
    outline: none
}

.fg input:focus,
.fg select:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0, 201, 167, .12)
}

.sw {
    position: relative
}

.sw::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .85rem;
    pointer-events: none;
    z-index: 1
}

.sw input {
    padding-left: 36px !important
}

.btn {
    padding: 10px 20px;
    border-radius: var(--rs);
    font-family: var(--font);
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 7px
}

.bp {
    background: var(--teal);
    color: #0D0F14
}

.bp:hover {
    background: #00e8c1;
    transform: translateY(-1px)
}

.bgold {
    background: var(--gold);
    color: #0D0F14
}

.bgold:hover {
    background: #ffc947;
    transform: translateY(-1px)
}

.brose {
    background: var(--rose);
    color: #fff
}

.brose:hover {
    transform: translateY(-1px)
}

.bblue {
    background: var(--blue);
    color: #fff
}

.bblue:hover {
    transform: translateY(-1px)
}

.bh {
    background: transparent;
    border: 1.5px solid var(--border2);
    color: var(--t2)
}

.bh:hover {
    border-color: var(--teal);
    color: var(--teal);
    background: var(--tdim)
}

.bsm {
    padding: 6px 12px;
    font-size: .78rem
}

.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
    align-items: center
}

.tw {
    overflow-x: auto;
    border-radius: var(--rs);
    border: 1px solid var(--border)
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .855rem
}

thead {
    background: var(--bg3)
}

th {
    padding: 11px 14px;
    text-align: left;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--t3);
    border-bottom: 1px solid var(--border);
    white-space: nowrap
}

td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--t2);
    vertical-align: middle
}

tr:last-child td {
    border-bottom: none
}

tr:hover td {
    background: rgba(255, 255, 255, .02);
    color: var(--text)
}

.mn {
    font-family: var(--mono)
}

.pos {
    color: var(--teal);
    font-family: var(--mono);
    font-weight: 600
}

.neg {
    color: var(--rose);
    font-family: var(--mono);
    font-weight: 600
}

.cg {
    color: var(--gold);
    font-family: var(--mono);
    font-weight: 600
}

.dg {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 12px
}

.db {
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: var(--rs);
    padding: 14px 16px;
    transition: border-color .2s
}

.db:focus-within {
    border-color: var(--teal)
}

.db .dn {
    font-size: .78rem;
    font-weight: 700;
    color: var(--t3);
    margin-bottom: 4px;
    text-transform: uppercase
}

.db .dv {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 10px;
    font-family: var(--mono)
}

.db .ds {
    font-size: .75rem;
    color: var(--teal);
    margin-top: 6px;
    font-family: var(--mono)
}

.sep {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 16px
}

.sep span {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--t3);
    white-space: nowrap
}

.sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border)
}

.pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .73rem;
    font-weight: 700
}

.pg {
    background: rgba(0, 201, 167, .15);
    color: var(--teal)
}

.pr {
    background: var(--rdim);
    color: var(--rose)
}

.py {
    background: var(--gdim);
    color: var(--gold)
}

.pb {
    background: var(--bdim);
    color: var(--blue)
}

.al {
    padding: 14px 18px;
    border-radius: var(--rs);
    font-size: .875rem;
    margin-bottom: 16px;
    display: none;
    align-items: center;
    gap: 10px
}

.al.show {
    display: flex
}

.als {
    background: var(--tdim);
    border: 1px solid rgba(0, 201, 167, .3);
    color: var(--teal)
}

.ale {
    background: var(--rdim);
    border: 1px solid rgba(255, 94, 125, .3);
    color: var(--rose)
}

.empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--t3)
}

.empty .ico {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: .4
}

.stabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap
}

.stab {
    padding: 8px 16px;
    border-radius: var(--rs);
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid var(--border);
    color: var(--t2);
    background: transparent;
    transition: all .2s
}

.stab:hover {
    border-color: var(--teal);
    color: var(--teal)
}

.stab.active {
    background: var(--teal);
    border-color: var(--teal);
    color: #0D0F14
}

.pb-bar {
    background: var(--border);
    border-radius: 4px;
    height: 6px;
    margin-top: 8px;
    overflow: hidden
}

.pb-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--teal);
    transition: width .5s
}

.al-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 0;
    border-bottom: 1px solid var(--border)
}

.al-line:last-child {
    border-bottom: none
}

.al-line .d {
    font-size: .9rem;
    color: var(--t2)
}

.al-line .v {
    font-family: var(--mono);
    font-size: .95rem;
    font-weight: 600
}

.al-tot {
    background: var(--tdim);
    border: 1px solid rgba(0, 201, 167, .3);
    border-radius: var(--rs);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px
}

.al-tot .d {
    font-weight: 700;
    color: var(--teal)
}

.al-tot .v {
    font-family: var(--mono);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--teal)
}

.tgl {
    width: 44px;
    height: 24px;
    background: var(--border2);
    border-radius: 12px;
    position: relative;
    transition: background .2s;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-block
}

.tgl.on {
    background: var(--teal)
}

.tgl::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s
}

.tgl.on::after {
    transform: translateX(20px)
}

.emp-card {
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    padding: 18px 20px;
    margin-bottom: 12px;
    transition: border-color .2s;
    cursor: pointer
}

.emp-card:hover {
    border-color: var(--teal)
}

.emp-card.selected {
    border-color: var(--teal);
    background: var(--tdim)
}

/* PRINT - SOLO muestra el modal, oculta todo lo demas */

/* ═══ LOGIN MODAL ═══ */
#loginOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .95);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    flex-direction: column
}

#loginOverlay.show {
    display: flex
}

.login-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px 40px;
    width: 360px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5)
}

.login-box .l-ico {
    font-size: 2.5rem;
    margin-bottom: 12px
}

.login-box h2 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 4px
}

.login-box p {
    font-size: .8rem;
    color: var(--t2);
    margin-bottom: 24px
}

.login-box input {
    width: 100%;
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: var(--rs);
    color: var(--text);
    font-family: var(--mono);
    font-size: .95rem;
    padding: 11px 14px;
    outline: none;
    margin-bottom: 10px;
    transition: border-color .2s;
    text-align: center
}

.login-box input:focus {
    border-color: var(--teal)
}

.login-box input[type=password] {
    letter-spacing: .15em
}

.login-err {
    color: var(--rose);
    font-size: .78rem;
    margin-bottom: 10px;
    min-height: 18px
}

.login-btn {
    width: 100%;
    padding: 12px;
    border-radius: var(--rs);
    background: var(--teal);
    color: #0d0f14;
    font-family: var(--font);
    font-size: .9rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: all .2s
}

.login-btn:hover {
    background: #00e8c1;
    transform: translateY(-1px)
}

.user-chip {
    position: fixed;
    bottom: 16px;
    right: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 7px 14px;
    font-size: .78rem;
    font-weight: 700;
    color: var(--t2);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .3)
}

.user-chip .u-rol {
    color: var(--teal)
}

/* ═══ PIN MODAL ═══ */
#pinOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .92);
    z-index: 99998;
    align-items: center;
    justify-content: center
}

#pinOverlay.show {
    display: flex
}

.pin-box {
    background: var(--card);
    border: 1px solid var(--border2);
    border-radius: 16px;
    padding: 30px 36px;
    width: 320px;
    text-align: center
}

.pin-box h3 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 6px
}

.pin-box p {
    font-size: .78rem;
    color: var(--t2);
    margin-bottom: 16px
}

.pin-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border2);
    background: transparent;
    transition: all .2s
}

.pin-dot.filled {
    background: var(--teal);
    border-color: var(--teal)
}

.pin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px
}

.pin-key {
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s
}

.pin-key:hover {
    border-color: var(--teal);
    color: var(--teal);
    background: var(--tdim)
}

.pin-err {
    color: var(--rose);
    font-size: .78rem;
    min-height: 18px
}

/* ═══ APERTURA CAJA ═══ */
#aperturaOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .92);
    z-index: 99997;
    align-items: center;
    justify-content: center
}

#aperturaOverlay.show {
    display: flex
}

.apertura-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px 36px;
    width: 380px;
    text-align: center
}

.apertura-box h2 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 6px
}

.apertura-box p {
    font-size: .8rem;
    color: var(--t2);
    margin-bottom: 20px
}

/* ═══ CUADRE SUPERVISOR MODAL ═══ */
#cuadreOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .92);
    z-index: 99996;
    overflow-y: auto;
    padding: 20px
}

#cuadreOverlay.show {
    display: block
}

#cierreCajeroOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .92);
    z-index: 1200;
    overflow-y: auto;
    padding: 20px
}

#cierreCajeroOverlay.show {
    display: block
}

.cuadre-box {
    max-width: 680px;
    margin: 0 auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden
}

.cuadre-top {
    background: var(--bg2);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between
}

.cuadre-body {
    padding: 22px
}

.cuadre-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: var(--bg3);
    border-radius: var(--rs);
    padding: 14px;
    margin-bottom: 16px;
    font-size: .83rem
}

.ci-row {
    display: flex;
    justify-content: space-between
}

.ci-row .lbl {
    color: var(--t2)
}

.ci-row .val {
    font-family: var(--mono);
    font-weight: 700;
    color: var(--text)
}

.dg2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin-bottom: 8px
}

.db2 {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--rs);
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 6px
}

.db2 .dn2 {
    font-size: .68rem;
    color: var(--t3);
    text-transform: uppercase;
    font-weight: 700
}

.db2 .dv2 {
    font-size: .78rem;
    color: var(--gold);
    font-weight: 700
}

.db2 input {
    background: var(--bg);
    border: 1px solid var(--border2);
    border-radius: 5px;
    color: var(--text);
    font-family: var(--mono);
    font-size: .88rem;
    padding: 5px 8px;
    outline: none;
    width: 60px;
    text-align: center;
    transition: border-color .2s
}

.db2 input:focus {
    border-color: var(--teal)
}

.cuadre-totrow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--rs);
    margin: 6px 0;
    font-size: .85rem
}

.cuadre-diff-ok {
    background: var(--tdim);
    border: 1px solid rgba(0, 201, 167, .3)
}

.cuadre-diff-bad {
    background: var(--rdim);
    border: 1px solid rgba(255, 94, 125, .3)
}

.sup-pass-row {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border)
}

/* ═══ SYSTEM LOCK - PANTALLA DE INICIO ═══ */
#systemLock {
    display: flex;
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0D0F14 0%, #13161E 50%, #1A1E2A 100%);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#systemLock.hidden {
    display: none
}

.lock-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 44px 48px;
    width: 400px;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
    animation: slideUp .4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.lock-logo {
    font-size: 3rem;
    margin-bottom: 12px
}

.lock-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px
}

.lock-sub {
    font-size: .82rem;
    color: var(--t2);
    margin-bottom: 30px
}

.lock-field {
    margin-bottom: 12px;
    text-align: left
}

.lock-field label {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--t2);
    margin-bottom: 6px
}

.lock-field input {
    width: 100%;
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: var(--rs);
    color: var(--text);
    font-family: var(--mono);
    font-size: .95rem;
    padding: 12px 14px;
    outline: none;
    transition: border-color .2s;
}

.lock-field input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0, 201, 167, .1)
}

.lock-err {
    color: var(--rose);
    font-size: .78rem;
    margin-bottom: 12px;
    min-height: 20px;
    text-align: center
}

.lock-btn {
    width: 100%;
    padding: 13px;
    border-radius: var(--rs);
    background: linear-gradient(135deg, var(--teal), #00a388);
    color: #0d0f14;
    font-family: var(--font);
    font-size: .95rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: all .2s;
    margin-top: 4px;
    box-shadow: 0 4px 14px rgba(0, 201, 167, .3);
}

.lock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 201, 167, .4)
}

.lock-btn:active {
    transform: translateY(0)
}

.lock-version {
    font-size: .68rem;
    color: var(--t3);
    margin-top: 20px
}

.lock-roles {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px
}

.lock-role-chip {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: .7rem;
    color: var(--t3);
}

/* ═══ FACTURA PREVIEW MODAL ═══ */
#facturaPreview {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    z-index: 99995;
    overflow-y: auto;
    padding: 20px;
    align-items: flex-start;
    justify-content: center
}

#facturaPreview.show {
    display: flex
}

.fp-box {
    background: #fff;
    color: #111;
    width: 100%;
    max-width: 420px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    margin: auto;
    font-family: 'Sora', sans-serif
}

.fp-toolbar {
    background: #1E2330;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px
}

.fp-toolbar span {
    color: #E8EAF2;
    font-size: .78rem;
    font-weight: 700
}

.fp-toolbar-btns {
    display: flex;
    gap: 6px
}

.fp-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 700;
    transition: all .2s
}

.fp-btn-print {
    background: #00C9A7;
    color: #0d0f14
}

.fp-btn-print:hover {
    background: #00e8c1
}

.fp-btn-close {
    background: rgba(255, 94, 125, .2);
    color: #FF5E7D;
    border: 1px solid rgba(255, 94, 125, .3)
}

.fp-btn-close:hover {
    background: rgba(255, 94, 125, .35)
}

.fp-content {
    padding: 24px 22px;
    background: #fff
}

/* Keyboard hints */
.kbd-hint {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: .7rem;
    color: var(--t3)
}

.kbd {
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: var(--mono);
    font-size: .68rem;
    color: var(--t2)
}

/* ═══ POS / RESTAURANTE STYLES ═══ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden
}

.sidebar.collapsed~.main,
.main.expanded {
    margin-left: 54px
}

.nav-section {
    flex: 1;
    padding: 8px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden
}

.nav-label {
    font-size: .58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--t3);
    padding: 10px 10px 4px;
    white-space: nowrap;
    flex-shrink: 0
}

.nav-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border-radius: var(--rs);
    cursor: pointer;
    font-size: .82rem;
    font-weight: 600;
    color: var(--t2);
    transition: background .18s, color .18s;
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 1px;
    flex-shrink: 0
}

.nav-item:hover {
    background: var(--bg3);
    color: var(--text)
}

.nav-item.active {
    background: var(--tdim);
    color: var(--teal)
}

.nav-item .ico {
    font-size: 1rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center
}

.sidebar-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    flex-shrink: 0
}

.date-chip {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--rs);
    padding: 10px 14px;
    font-size: .75rem;
    color: var(--t2)
}

.date-chip strong {
    display: block;
    font-family: var(--mono);
    color: var(--text);
    font-size: .88rem
}

.main {
    margin-left: 220px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: margin-left .25s ease
}

.topbar {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50
}

.topbar-title {
    font-size: 1.2rem;
    font-weight: 700
}

.topbar-sub {
    font-size: .78rem;
    color: var(--t2);
    margin-top: 1px
}

.badge {
    background: var(--tdim);
    color: var(--teal);
    border: 1px solid rgba(0, 201, 167, .25);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: .73rem;
    font-weight: 700
}

.content {
    padding: 16px 20px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden
}

.panel {
    display: none;
    animation: fu .3s ease
}

.panel.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px
}

#p-pos.panel.active {
    overflow: hidden;
    padding-bottom: 0
}

@keyframes fu {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 20px;
    margin-bottom: 16px
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px
}

.ct {
    font-size: .95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--teal);
    display: inline-block;
    flex-shrink: 0
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 18px
}

.kpi {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 18px 20px;
    position: relative;
    overflow: hidden
}

.kpi::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px
}

.kpi.t::before {
    background: var(--teal)
}

.kpi.g::before {
    background: var(--gold)
}

.kpi.r::before {
    background: var(--rose)
}

.kpi.b::before {
    background: var(--blue)
}

.kpi.p::before {
    background: var(--purple)
}

.kpi-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--t3);
    margin-bottom: 7px
}

.kpi-val {
    font-family: var(--mono);
    font-size: 1.4rem;
    font-weight: 600
}

.kpi.t .kpi-val {
    color: var(--teal)
}

.kpi.g .kpi-val {
    color: var(--gold)
}

.kpi.r .kpi-val {
    color: var(--rose)
}

.kpi.b .kpi-val {
    color: var(--blue)
}

.kpi.p .kpi-val {
    color: var(--purple)
}

.kpi-ico {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.7rem;
    opacity: .12
}

.fg {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px
}

.fg label {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--t2);
    margin-bottom: 6px
}

.fg input,
.fg select,
.fg textarea {
    width: 100%;
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: var(--rs);
    color: var(--text);
    font-family: var(--mono);
    font-size: .88rem;
    padding: 9px 13px;
    transition: border-color .2s;
    outline: none
}

.fg input:focus,
.fg select:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0, 201, 167, .1)
}

.fg select option {
    background: var(--bg3)
}

.btn {
    padding: 9px 18px;
    border-radius: var(--rs);
    font-family: var(--font);
    font-size: .83rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap
}

.bp {
    background: var(--teal);
    color: #0D0F14
}

.bp:hover {
    background: #00e8c1;
    transform: translateY(-1px)
}

.bgold {
    background: var(--gold);
    color: #0D0F14
}

.bgold:hover {
    background: #ffc947;
    transform: translateY(-1px)
}

.brose {
    background: var(--rose);
    color: #fff
}

.brose:hover {
    transform: translateY(-1px)
}

.bblue {
    background: var(--blue);
    color: #fff
}

.bblue:hover {
    transform: translateY(-1px)
}

.bpurp {
    background: var(--purple);
    color: #fff
}

.bpurp:hover {
    transform: translateY(-1px)
}

.bh {
    background: transparent;
    border: 1.5px solid var(--border2);
    color: var(--t2)
}

.bh:hover {
    border-color: var(--teal);
    color: var(--teal);
    background: var(--tdim)
}

.bsm {
    padding: 5px 11px;
    font-size: .76rem
}

.btn-row {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
    align-items: center
}

.tw {
    overflow-x: auto;
    border-radius: var(--rs);
    border: 1px solid var(--border)
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .83rem
}

thead {
    background: var(--bg3)
}

th {
    padding: 10px 13px;
    text-align: left;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--t3);
    border-bottom: 1px solid var(--border);
    white-space: nowrap
}

td {
    padding: 10px 13px;
    border-bottom: 1px solid var(--border);
    color: var(--t2);
    vertical-align: middle
}

tr:last-child td {
    border-bottom: none
}

tr:hover td {
    background: rgba(255, 255, 255, .02);
    color: var(--text)
}

.mn {
    font-family: var(--mono)
}

.pos {
    color: var(--teal);
    font-family: var(--mono);
    font-weight: 600
}

.neg {
    color: var(--rose);
    font-family: var(--mono);
    font-weight: 600
}

.cg {
    color: var(--gold);
    font-family: var(--mono);
    font-weight: 600
}

.pill {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: .71rem;
    font-weight: 700
}

.pg {
    background: rgba(0, 201, 167, .15);
    color: var(--teal)
}

.pr {
    background: var(--rdim);
    color: var(--rose)
}

.py {
    background: var(--gdim);
    color: var(--gold)
}

.pb {
    background: var(--bdim);
    color: var(--blue)
}

.pp {
    background: var(--pdim);
    color: var(--purple)
}

.al {
    padding: 12px 16px;
    border-radius: var(--rs);
    font-size: .85rem;
    margin-bottom: 14px;
    display: none;
    align-items: center;
    gap: 10px
}

.al.show {
    display: flex
}

.als {
    background: var(--tdim);
    border: 1px solid rgba(0, 201, 167, .3);
    color: var(--teal)
}

.ale {
    background: var(--rdim);
    border: 1px solid rgba(255, 94, 125, .3);
    color: var(--rose)
}

.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--t3)
}

.empty .ico {
    font-size: 2.2rem;
    margin-bottom: 10px;
    opacity: .4
}

.stabs {
    display: flex;
    gap: 5px;
    margin-bottom: 18px;
    flex-wrap: wrap
}

.stab {
    padding: 7px 15px;
    border-radius: var(--rs);
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid var(--border);
    color: var(--t2);
    background: transparent;
    transition: all .2s
}

.stab:hover {
    border-color: var(--teal);
    color: var(--teal)
}

.stab.active {
    background: var(--teal);
    border-color: var(--teal);
    color: #0D0F14
}

.sep {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0 14px
}

.sep span {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--t3);
    white-space: nowrap
}

.sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border)
}

.pb-bar {
    background: var(--border);
    border-radius: 4px;
    height: 5px;
    margin-top: 6px;
    overflow: hidden
}

.pb-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--teal);
    transition: width .4s
}

/* POS Layout — flexbox para que el resize funcione sin media queries */
.pos-layout {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex: 1;
    min-height: 0;
    overflow: hidden
}

.pos-left {
    flex: 1 1 0;
    min-width: 0;
    overflow-y: auto;
    padding-right: 2px
}

.pos-right {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    /* Ancho controlado por JS resize — NO usar width fijo */
    flex: 0 0 320px;
    width: 320px;
    min-width: 280px;
    max-width: 500px;
    min-height: 0
}

/* ══════════════════════════════════════════
   POS CHECKOUT PANEL — NUEVO DISEÑO
   ══════════════════════════════════════════ */

/* Barra superior */
.prc-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    gap: 4px;
}
.prc-user {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .72rem;
    color: var(--t2);
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
}
.prc-user span#posUserNom {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 110px;
    font-size: .68rem;
}
.prc-count {
    background: var(--teal);
    color: #0d0f14;
    border-radius: 20px;
    padding: 1px 7px;
    font-size: .68rem;
    font-weight: 800;
    flex-shrink: 0;
}
.prc-actions {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}
.prc-btn {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--t2);
    font-size: .68rem;
    padding: 3px 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    transition: border-color .15s;
}
.prc-btn:hover { border-color: var(--teal); color: var(--text); }
.prc-btn-primary { background: rgba(99,102,241,.15); border-color: rgba(99,102,241,.4); color: #a5b4fc; font-weight: 800; }
.prc-btn-gold    { background: rgba(255,184,48,.12); border-color: rgba(255,184,48,.35); color: var(--gold); font-weight: 800; }
.prc-btn-danger  { background: var(--rdim); border-color: rgba(255,94,125,.3); color: var(--rose); }

/* Mesa popup */
.mesa-popup {
    display: none;
    position: absolute;
    top: 110%;
    right: 0;
    background: var(--card);
    border: 1.5px solid var(--teal);
    border-radius: 10px;
    padding: 10px;
    z-index: 500;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.mesa-popup-title {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--t3);
    margin-bottom: 8px;
}

/* Sección cliente */
.prc-cliente-section {
    padding: 6px 8px 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}
.prc-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: var(--rs);
    color: var(--text);
    font-size: .72rem;
    padding: 6px 9px;
    outline: none;
    transition: border-color .2s;
    font-family: var(--mono);
}
.prc-input:focus { border-color: var(--teal); }
.prc-input-cli { font-size: .73rem; }
.prc-select {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: var(--rs);
    color: var(--text);
    font-size: .70rem;
    padding: 5px 8px;
    outline: none;
}
.cli-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card);
    border: 1.5px solid var(--teal);
    border-radius: var(--rs);
    max-height: 160px;
    overflow-y: auto;
    z-index: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
}

/* Checkout section */
.prc-checkout {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
    background: var(--bg2);
    border-top: 1px solid var(--border);
}

/* Totales */
.prc-totals {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
}
.prc-tot-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .75rem;
    padding: 2px 0;
    color: var(--t2);
}
.prc-tot-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.15rem;
    font-weight: 900;
    color: #00c9a7;
    padding-top: 5px;
    margin-top: 3px;
    border-top: 1px solid var(--border);
    font-family: var(--mono);
}

/* Payment method tabs */
.prc-pay-tabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
}
.prc-pay-tab {
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 7px;
    color: var(--t2);
    font-size: .60rem;
    font-weight: 700;
    padding: 6px 2px;
    cursor: pointer;
    text-align: center;
    transition: all .15s;
    line-height: 1.2;
}
.prc-pay-tab:hover { border-color: var(--teal); color: var(--text); }
.prc-pay-tab.active {
    background: rgba(0,201,167,.15);
    border-color: var(--teal);
    color: var(--teal);
}

/* Pay fields */
.prc-pay-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
}
.prc-pay-label {
    display: block;
    font-size: .63rem;
    color: var(--t3);
    margin-bottom: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.prc-pay-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-size: .88rem;
    font-weight: 700;
    font-family: var(--mono);
    padding: 7px 10px;
    outline: none;
    transition: border-color .2s;
}
.prc-pay-input:focus { border-color: var(--teal); }
.prc-devuelta {
    background: rgba(0,201,167,.12);
    border: 1.5px solid rgba(0,201,167,.35);
    border-radius: 7px;
    padding: 7px 10px;
    font-size: .88rem;
    font-weight: 800;
    color: var(--teal);
    font-family: var(--mono);
    text-align: right;
}
.prc-cred-info {
    background: var(--rdim);
    border-color: rgba(255,94,125,.3);
    color: var(--rose);
    font-size: .75rem;
}
.prc-cred-abono {
    border-color: rgba(0,201,167,.4);
    background: rgba(0,201,167,.05);
}

/* FACTURAR button */
.prc-facturar {
    width: 100%;
    background: linear-gradient(135deg, #00c9a7, #00a085);
    border: none;
    border-radius: 10px;
    color: #0d0f14;
    font-size: 1.05rem;
    font-weight: 900;
    padding: 13px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: .03em;
    box-shadow: 0 4px 14px rgba(0,201,167,.3);
    transition: transform .1s, box-shadow .1s;
}
.prc-facturar:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,201,167,.4); }
.prc-facturar:active { transform: translateY(0); }
.prc-f12 {
    font-size: .65rem;
    opacity: .7;
    font-weight: 700;
    background: rgba(0,0,0,.2);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Secondary buttons */
.prc-sec-btns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 4px;
}
.prc-sec-btn {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--t2);
    font-size: .68rem;
    font-weight: 700;
    padding: 7px 4px;
    cursor: pointer;
    text-align: center;
    transition: all .15s;
}
.prc-sec-btn:hover { border-color: var(--teal); color: var(--text); }
.prc-sec-purple { background: rgba(124,58,237,.12); border-color: rgba(124,58,237,.3); color: #c4b5fd; }
.prc-sec-gold   { background: rgba(255,184,48,.10); border-color: rgba(255,184,48,.3); color: var(--gold); }
.prc-sec-blue   { background: rgba(59,130,246,.10); border-color: rgba(59,130,246,.3); color: #93c5fd; }

/* ── Resize handle del panel de facturación ── */
.pos-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    cursor: ew-resize;
    z-index: 100;
    background: transparent;
    transition: background .2s;
}
.pos-resize-handle::after {
    content: '';
    position: absolute;
    top: 0;
    left: 2px;
    width: 2px;
    height: 100%;
    background: var(--border);
    transition: background .2s, box-shadow .2s;
}
.pos-resize-handle:hover::after,
.pos-resize-handle.dragging::after {
    background: var(--teal);
    box-shadow: 0 0 8px rgba(0, 201, 167, .5);
}
#posRight {
    position: relative;
}

/* sidebar colapsado → el pos-left crece automáticamente con flex:1 */
.main.expanded .pos-layout {
    gap: 8px
}

.pos-search {
    padding: 8px 10px 6px;
    border-bottom: 1px solid var(--border)
}

.search-box {
    position: relative
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .8rem;
    pointer-events: none;
    z-index: 1;
    transition: transform .2s ease
}

.search-box:focus-within::before {
    transform: translateY(-50%) scale(1.15)
}

.search-box input {
    width: 100%;
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: var(--rs);
    color: var(--text);
    font-family: var(--mono);
    font-size: .88rem;
    padding: 9px 70px 9px 36px;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s
}

.search-box input:focus {
    border-color: var(--teal);
    background: rgba(0,201,167,.04);
    box-shadow: 0 0 0 3px rgba(0,201,167,.12), 0 2px 8px rgba(0,0,0,.2)
}

/* Atajo de teclado visible en el search */
.search-box::after {
    content: 'F3';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .62rem;
    font-weight: 700;
    color: var(--t3);
    background: var(--bg);
    border: 1px solid var(--border2);
    border-radius: 4px;
    padding: 2px 6px;
    pointer-events: none;
    font-family: var(--mono);
    letter-spacing: .02em;
    transition: opacity .2s
}
.search-box:focus-within::after { opacity: 0; }

/* ─── CAT TABS — pills con conteo y glow ─── */
.cat-tabs {
    display: flex;
    gap: 5px;
    padding: 8px 10px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
    -ms-overflow-style: none;
    align-items: center
}
.cat-tabs::-webkit-scrollbar { display: none }

.cat-tab {
    padding: 5px 12px;
    border-radius: 16px;
    font-size: .68rem;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid var(--border);
    color: var(--t2);
    white-space: nowrap;
    background: transparent;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    position: relative
}

.cat-tab:hover {
    border-color: var(--teal);
    color: var(--teal);
    background: var(--tdim)
}

.cat-tab.active {
    background: linear-gradient(135deg, var(--teal), #00a085);
    border-color: var(--teal);
    color: #0D0F14;
    box-shadow: 0 2px 12px rgba(0,201,167,.35);
    transform: translateY(-1px)
}

/* Badge de conteo en cat tab */
.cat-count {
    background: rgba(0,0,0,.2);
    color: inherit;
    border-radius: 8px;
    padding: 0 5px;
    font-size: .58rem;
    font-weight: 800;
    line-height: 1.6;
    min-width: 16px;
    text-align: center
}
.cat-tab:not(.active) .cat-count {
    background: var(--bg);
    color: var(--t3);
    border: 1px solid var(--border2)
}

.prod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 5px;
    padding: 8px
}

.prod-card {
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 10px 7px 7px;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 3px
}

/* Línea top coloreada al hover */
.prod-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--teal);
    transform: scaleX(0);
    transition: transform .2s ease;
    transform-origin: left
}
.prod-card:hover::after { transform: scaleX(1); }

.prod-card:hover {
    border-color: rgba(0,201,167,.45);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.35), 0 0 0 1px rgba(0,201,167,.15);
    background: rgba(0,201,167,.06)
}
.prod-card:active {
    transform: scale(.94) translateY(0);
    background: rgba(0,201,167,.12);
    border-color: var(--teal);
    transition: transform .07s, background .07s
}

.prod-card.out {
    opacity: .38;
    cursor: not-allowed
}
.prod-card.out::after { display: none; }

.prod-card.low-stock {
    border-color: rgba(255,94,125,.3)
}
.prod-card.low-stock::after { background: var(--rose); }

.prod-card .p-ico {
    font-size: 1.5rem;
    margin-bottom: 2px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
    transition: transform .2s ease;
}
.prod-card:hover .p-ico { transform: scale(1.1); }

.prod-card .p-name {
    font-size: .70rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    word-break: break-word;
    hyphens: auto
}

.prod-card .p-price {
    font-family: var(--mono);
    font-size: .80rem;
    color: var(--teal);
    font-weight: 800;
    margin-top: auto
}

.prod-card .p-cat {
    display: none
}

/* Stock badge — esquina sup derecha */
.prod-card .p-stock {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: .57rem;
    font-weight: 800;
    background: var(--gdim);
    color: var(--gold);
    border-radius: 8px;
    padding: 1px 5px
}
.prod-card.low-stock .p-stock {
    background: var(--rdim);
    color: var(--rose)
}
.prod-card.out .p-stock {
    background: rgba(255,94,125,.2);
    color: var(--rose)
}

/* Barra de stock al fondo de la tarjeta */
.prod-card .p-stock-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: var(--border);
    border-radius: 0 0 8px 8px;
    overflow: hidden
}
.prod-card .p-stock-fill {
    height: 100%;
    border-radius: 0 0 8px 8px;
    background: var(--teal);
    transition: width .4s ease
}
.prod-card.low-stock .p-stock-fill { background: var(--rose); }
.prod-card.out .p-stock-fill { background: var(--border2); width: 0 !important; }

/* Feedback visual al agregar al carrito */
@keyframes prodAdded {
    0%   { transform: scale(1); }
    40%  { transform: scale(.90); background: rgba(0,201,167,.2); border-color: var(--teal); }
    100% { transform: scale(1); }
}
.prod-card.prod-added {
    animation: prodAdded .28s ease forwards
}

/* ── CARRITO — POS billing panel (supermarket style) ── */
.cart-header {
    padding: 5px 8px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: var(--bg2)
}

.cart-title {
    font-weight: 700;
    font-size: .75rem;
    display: flex;
    align-items: center;
    gap: 5px
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 6px;
    min-height: 0;
    scroll-behavior: smooth
}

.cart-items::-webkit-scrollbar {
    width: 4px
}

.cart-items::-webkit-scrollbar-track {
    background: transparent
}

.cart-items::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 4px
}

.cart-items::-webkit-scrollbar-thumb:hover {
    background: var(--teal)
}

/* ─── CART ITEMS — rediseño v2 ─── */
@keyframes cartItemIn {
    from { opacity: 0; transform: translateX(-12px) scale(.97); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

.cart-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0 8px;
    padding: 7px 8px;
    background: var(--bg3);
    border-radius: 9px;
    margin-bottom: 4px;
    border: 1px solid var(--border);
    transition: border-color .2s, background .15s;
    animation: cartItemIn .22s ease both;
    position: relative;
    overflow: hidden
}

/* Barra izquierda teal */
.cart-item::before {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 2px;
    background: var(--teal);
    border-radius: 0 2px 2px 0;
    opacity: .5
}

.cart-item:hover {
    border-color: var(--border2);
    background: var(--card)
}

/* Emoji del producto */
.cart-item .ci-ico {
    font-size: 1.35rem;
    line-height: 1;
    align-self: center;
    width: 26px;
    text-align: center;
    grid-row: 1 / 3;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.3))
}

.cart-item .ci-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px
}

.cart-item .ci-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px
}

.cart-item .ci-name {
    font-size: .72rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0
}

.cart-item .ci-sub {
    font-size: .60rem;
    color: var(--t3)
}

.ci-qty {
    display: flex;
    align-items: center;
    gap: 3px
}

.ci-qty button {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    border: 1.5px solid var(--border2);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    font-size: .8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    font-weight: 700
}

.ci-qty button:hover {
    border-color: var(--teal);
    color: var(--teal);
    background: var(--tdim)
}
.ci-qty button:active {
    transform: scale(.88)
}

.ci-qty .qty-num {
    font-family: var(--mono);
    font-size: .78rem;
    font-weight: 800;
    width: 24px;
    text-align: center;
    color: var(--text)
}

.ci-del {
    background: none;
    border: none;
    color: var(--t3);
    cursor: pointer;
    font-size: .78rem;
    padding: 2px;
    border-radius: 4px;
    transition: all .15s;
    line-height: 1;
    flex-shrink: 0
}
.ci-del:hover {
    color: var(--rose);
    background: var(--rdim)
}

.ci-total {
    font-family: var(--mono);
    font-size: .78rem;
    font-weight: 700;
    color: var(--teal);
    white-space: nowrap
}

.ci-del {
    cursor: pointer;
    color: var(--t3);
    font-size: .8rem;
    transition: color .2s;
    background: none;
    border: none;
    padding: 1px
}

.ci-del:hover {
    color: var(--rose)
}

/* Cart footer — always pinned at bottom */
.cart-footer {
    border-top: 2px solid var(--border);
    padding: 7px 10px;
    flex-shrink: 0;
    background: var(--bg2)
}

.cart-line {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: .70rem
}

.cart-line .l {
    color: var(--t2)
}

.cart-line .v {
    font-family: var(--mono);
    font-weight: 600
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--tdim);
    border: 1px solid rgba(0, 201, 167, .3);
    border-radius: var(--rs);
    padding: 6px 10px;
    margin: 5px 0
}

.cart-total .l {
    font-weight: 700;
    font-size: .80rem;
    color: var(--text);
    letter-spacing: .04em;
    text-transform: uppercase
}

.cart-total .v {
    font-family: var(--mono);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--teal)
}

.cart-cliente {
    margin-bottom: 6px
}

.cart-cliente select,
.cart-cliente input {
    width: 100%;
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: var(--rs);
    color: var(--text);
    font-family: var(--mono);
    font-size: .70rem;
    padding: 5px 7px;
    outline: none;
    margin-bottom: 3px;
    transition: border-color .2s
}

.cart-cliente select:focus,
.cart-cliente input:focus {
    border-color: var(--teal)
}

/* Mesa badge */
.mesa-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--pdim);
    border: 1px solid rgba(168, 85, 247, .3);
    color: var(--purple);
    border-radius: var(--rs);
    padding: 4px 10px;
    font-size: .75rem;
    font-weight: 700
}

/* Mesas grid */
.mesas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px
}

.mesa-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--r);
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    padding: 18px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    position: relative
}

.mesa-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.35)
}

.mesa-card.libre {
    border-color: var(--teal);
    box-shadow: 0 2px 8px rgba(0,0,0,.25), 0 0 14px rgba(0,201,167,.12)
}
.mesa-card.libre .m-ico { filter: drop-shadow(0 0 6px rgba(0,201,167,.4)); }

.mesa-card.ocupada {
    border-color: var(--gold);
    background: rgba(255,184,48,.04);
    box-shadow: 0 2px 8px rgba(0,0,0,.25), 0 0 16px rgba(255,184,48,.15)
}
.mesa-card.ocupada .m-ico { filter: drop-shadow(0 0 8px rgba(255,184,48,.5)); }

.mesa-card.reservada {
    border-color: var(--blue);
    background: rgba(77,141,255,.04);
    box-shadow: 0 2px 8px rgba(0,0,0,.25), 0 0 14px rgba(77,141,255,.12)
}

.mesa-card .m-ico {
    font-size: 2rem;
    margin-bottom: 8px
}

.mesa-card .m-num {
    font-weight: 800;
    font-size: 1.1rem
}

.mesa-card .m-status {
    font-size: .72rem;
    font-weight: 700;
    margin-top: 4px
}

.mesa-card.libre .m-status {
    color: var(--teal)
}

.mesa-card.ocupada .m-status {
    color: var(--gold)
}

.mesa-card.reservada .m-status {
    color: var(--blue)
}

.mesa-card .m-total {
    font-family: var(--mono);
    font-size: .8rem;
    color: var(--gold);
    margin-top: 5px
}

/* Historial */
.hist-card {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--rs);
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color .2s
}

.hist-card:hover {
    border-color: var(--teal)
}

.hist-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px
}

.hist-num {
    font-family: var(--mono);
    font-size: .82rem;
    font-weight: 700;
    color: var(--teal)
}

.hist-date {
    font-size: .75rem;
    color: var(--t3)
}

.hist-client {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text)
}

.hist-total {
    font-family: var(--mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold)
}

/* Modal */
#mo {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    z-index: 9999;
    overflow-y: auto;
    padding: 30px 20px
}

#mb {
    max-width: 680px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    overflow: hidden
}

#mbar {
    background: #1E2330;
    padding: 13px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between
}

#mc {
    padding: 28px;
    color: #111;
    font-family: 'Sora', sans-serif
}

/* Stock alerts */
.stock-alert {
    background: var(--rdim);
    border: 1px solid rgba(255, 94, 125, .3);
    border-radius: var(--rs);
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: .83rem;
    color: var(--rose);
    display: flex;
    align-items: center;
    gap: 8px
}

/* Config section */
.config-section {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 20px;
    margin-bottom: 16px
}

.config-section h3 {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px
}

/* PRINT */

/* ══════════════════════════════════════════════════════
   RESPONSIVE — Sistema Integral
   Breakpoints:
   • Móvil    ≤ 600px
   • Tablet   601–900px  
   • Laptop   901–1200px
   • Desktop  1201–1400px
   • Wide     1401px+
═══════════════════════════════════════════════════════ */

/* ─── DESKTOP GRANDE (1401px+) ─── */
@media(min-width:1401px) {
    .pos-right { flex-basis: 340px; width: 340px }

    .kpi-grid {
        grid-template-columns: repeat(4, 1fr)
    }

    .prod-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
        padding: 12px
    }
}

/* ─── DESKTOP NORMAL (1201–1400px) ─── */
@media(max-width:1400px) {
    .pos-layout { gap: 9px }

    .kpi-grid {
        gap: 9px;
        margin-bottom: 14px
    }

    .prod-grid {
        grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
        gap: 8px;
        padding: 10px
    }

    .content {
        padding: 18px 20px
    }
}

/* ─── LAPTOP PEQUEÑO (901–1200px) ─── */
@media(max-width:1200px) {
    .pos-layout { gap: 8px }

    .content {
        padding: 14px 16px
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 12px
    }

    .kpi {
        padding: 12px
    }

    .kpi-val {
        font-size: 1.1rem
    }

    .prod-grid {
        grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
        gap: 7px;
        padding: 8px
    }

    .topbar {
        padding: 10px 16px
    }

    .topbar-title {
        font-size: .95rem
    }

    .card {
        padding: 14px
    }

    .tw {
        overflow-x: auto
    }

    table {
        font-size: .78rem
    }
}

/* ─── TABLET (601–900px) — sidebar icon-only ─── */
/* ── Hamburger menu button (mobile) ── */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-right: 10px;
    z-index: 160;
    flex-shrink: 0
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: var(--t2);
    border-radius: 2px;
    transition: all .3s ease;
    margin: 4px 0
}

.hamburger-btn:hover span {
    background: var(--teal)
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
    background: var(--teal)
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
    background: var(--teal)
}

/* ── Sidebar overlay backdrop ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 199;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity .3s ease
}

.sidebar-overlay.show {
    display: block;
    opacity: 1
}

@media(max-width:900px) {
    .sidebar {
        width: 54px
    }

    .sidebar .nav-label,
    .sidebar .dock-label,
    .sidebar .logo-text,
    .sidebar #logoRnc,
    .sidebar .footer-text {
        display: none !important
    }

    .sidebar .nav-item {
        justify-content: center;
        padding: 10px 6px
    }

    .sidebar .nav-item .ico {
        width: auto
    }

    .sidebar .logo {
        padding: 12px 6px
    }

    .sidebar .sidebar-footer {
        padding: 8px 4px;
        justify-content: center
    }

    .sidebar-toggle {
        display: none
    }

    .main {
        margin-left: 54px
    }

    /* POS en tablet: productos arriba, carrito abajo */
    .pos-layout {
        flex-direction: column;
        gap: 10px
    }
    .pos-right {
        flex: 0 0 auto;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    .pos-resize-handle { display: none }

    .pos-left {
        overflow-y: auto;
        min-height: 0;
        flex: 1
    }

    .pos-right {
        max-height: 45vh
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px
    }

    .content {
        padding: 12px
    }

    .topbar {
        padding: 8px 12px
    }

    .topbar-title {
        font-size: .9rem
    }

    .topbar-sub {
        display: none
    }

    .fg {
        grid-template-columns: 1fr 1fr
    }

    .dg {
        grid-template-columns: repeat(2, 1fr)
    }

    .tw {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch
    }

    table th,
    table td {
        padding: 5px 7px;
        font-size: .75rem
    }

    .btn-row {
        flex-wrap: wrap;
        gap: 6px
    }

    .btn {
        font-size: .78rem;
        padding: 8px 12px
    }

    .card {
        padding: 12px
    }
}

/* ─── MOBILE (≤768px) — sidebar completely hidden, hamburger visible ─── */
@media(max-width:768px) {
    .hamburger-btn {
        display: block
    }

    .sidebar-toggle {
        display: none !important
    }

    .sidebar {
        transform: translateX(-100%);
        width: 220px;
        z-index: 200;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.6)
    }

    .sidebar.open {
        transform: translateX(0)
    }

    /* Restore labels when sidebar is open on mobile */
    .sidebar.open .nav-label,
    .sidebar.open .dock-label,
    .sidebar.open .logo-text,
    .sidebar.open #logoRnc,
    .sidebar.open .footer-text {
        display: block !important
    }

    .sidebar.open .nav-item {
        justify-content: flex-start;
        padding: 9px 10px
    }

    .sidebar.open .nav-item .ico {
        width: 20px
    }

    .sidebar.open .logo {
        padding: 18px 14px 14px
    }

    .sidebar.open .sidebar-footer {
        padding: 10px 12px
    }

    .main {
        margin-left: 0 !important;
        height: 100dvh
    }

    /* Eliminar overflow horizontal global */
    html,
    body,
    .main,
    .content {
        overflow-x: hidden;
        max-width: 100vw
    }

    /* Content: padding mínimo */
    .content {
        padding: 5px 5px 0
    }

    /* Topbar compacto */
    .topbar {
        padding: 7px 10px
    }

    .topbar-sub {
        display: none
    }

    /* ── POS Layout: columna flex pura ── */
    .pos-layout {
        flex-direction: column;
        gap: 0
    }
    .pos-right {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 0 0 auto;
    }
    .pos-resize-handle { display: none }

    /* Productos: scroll vertical, ocupa el espacio libre */
    .pos-left {
        flex: 1;
        min-height: 100px;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid var(--border)
    }

    .pos-search {
        padding: 7px 10px
    }

    .cat-tabs {
        padding: 0 8px 7px;
        gap: 4px
    }

    .prod-grid {
        grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
        gap: 5px;
        padding: 5px
    }

    .prod-card {
        padding: 8px 6px
    }

    .prod-name {
        font-size: .68rem
    }

    .prod-price {
        font-size: .72rem
    }

    /* ── Carrito: altura fija, footer siempre visible ── */
    .pos-right {
        flex: 0 0 auto;
        min-height: 310px;
        max-height: 56vh;
        overflow: hidden;
        border-radius: 10px 10px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        border-top: 2px solid var(--border)
    }

    /* Sección cliente: más compacta */
    .cart-cliente {
        margin-bottom: 2px
    }

    .cart-cliente select,
    .cart-cliente input {
        font-size: .66rem;
        padding: 4px 6px;
        margin-bottom: 2px
    }

    /* Líneas de resumen */
    .cart-line {
        padding: 1px 0;
        font-size: .67rem
    }

    /* Total: compacto */
    .cart-total {
        padding: 5px 8px;
        margin: 3px 0
    }

    .cart-total .l {
        font-size: .75rem
    }

    .cart-total .v {
        font-size: .92rem
    }

    /* Footer del carrito: compacto */
    .cart-footer {
        padding: 5px 8px
    }

    /* Override divs de botones (grid inline) → columna */
    .cart-footer>div[style*="grid-template-columns"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 3px !important;
        margin-bottom: 3px !important
    }

    /* Todos los botones de acción: ancho completo */
    .cart-footer .btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 7px 6px !important;
        font-size: .70rem !important
    }

    /* Select método de pago */
    #cartMetodo {
        font-size: .67rem !important;
        padding: 4px 7px !important;
        margin-bottom: 4px !important
    }

    /* Scrollbar del carrito: ultra-slim */
    .cart-items::-webkit-scrollbar {
        width: 3px
    }

    /* KPIs en 2 columnas */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        margin-bottom: 10px
    }

    .kpi {
        padding: 10px
    }

    .kpi-val {
        font-size: 1rem
    }

    .kpi-label {
        font-size: .65rem
    }

    /* Tablas: scroll horizontal */
    .tw {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch
    }

    table {
        font-size: .72rem
    }

    table th,
    table td {
        padding: 5px 6px
    }

    /* Formularios: columna única */
    .fg {
        grid-template-columns: 1fr
    }

    /* Botones generales: ancho completo */
    .btn-row {
        flex-direction: column;
        gap: 6px
    }

    .btn-row .btn {
        width: 100%;
        justify-content: center
    }
}

/* ─── MÓVIL (≤600px) — extra mobile tweaks ─── */
@media(max-width:600px) {

    .topbar {
        padding: 8px 12px;
        position: sticky;
        top: 0;
        z-index: 150;
        background: var(--bg2);
        border-bottom: 1px solid var(--border)
    }

    .topbar-sub {
        display: none
    }

    .topbar-title {
        font-size: .88rem
    }

    .content {
        padding: 4px 4px 0
    }

    /* POS móvil: misma estructura columna que 768px */
    .pos-layout {
        display: flex;
        flex-direction: column;
        gap: 0;
        flex: 1;
        min-height: 0;
        overflow: hidden
    }

    .pos-left {
        flex: 1;
        min-height: 80px;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid var(--border)
    }

    /* Carrito: altura fija mínima, footer siempre visible */
    .pos-right {
        flex: 0 0 auto;
        min-height: 295px;
        max-height: 54vh;
        overflow: hidden;
        border-radius: 10px 10px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        border-top: 2px solid var(--border)
    }

    .cart-header {
        padding: 5px 8px
    }

    /* cart-items: scrollable via flex:1 interno — NO max-height fijo */

    .prod-grid {
        grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
        gap: 5px;
        padding: 5px
    }

    .prod-card {
        padding: 7px 5px
    }

    .prod-name {
        font-size: .67rem
    }

    .prod-price {
        font-size: .72rem
    }

    /* KPIs en móvil */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        margin-bottom: 10px
    }

    .kpi {
        padding: 10px
    }

    .kpi-val {
        font-size: 1rem
    }

    .kpi-label {
        font-size: .65rem
    }

    .kpi-ico {
        font-size: 1.1rem
    }

    /* Forms */
    .fg {
        grid-template-columns: 1fr
    }

    .dg {
        grid-template-columns: 1fr 1fr
    }

    /* Tables: scroll horizontal */
    .tw {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -10px;
        padding: 0 10px
    }

    table {
        min-width: 500px;
        font-size: .72rem
    }

    table th,
    table td {
        padding: 5px 6px
    }

    /* Buttons */
    .btn-row {
        flex-direction: column;
        gap: 6px
    }

    .btn {
        width: 100%;
        justify-content: center
    }

    .card {
        padding: 10px;
        border-radius: 10px
    }

    .stabs {
        overflow-x: auto;
        white-space: nowrap
    }

    .stab {
        font-size: .72rem;
        padding: 7px 12px
    }

    /* Modals fullscreen en móvil */
    .lock-card {
        width: calc(100vw - 32px);
        padding: 28px 20px;
        border-radius: 16px
    }

    .cuadre-box {
        margin: 10px;
        border-radius: 12px
    }

    .pin-box {
        width: calc(100vw - 40px);
        padding: 20px
    }

    .apertura-box {
        width: calc(100vw - 40px);
        padding: 20px
    }
}

/* ══════════════════════════════════════════════════════
   ROL MESERO — sidebar oculto + bottom nav en móvil/tablet
   ══════════════════════════════════════════════════════ */

/* Bottom nav — oculto por defecto, visible solo en modo mesero */
.mesero-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg2);
    border-top: 2px solid var(--border);
    z-index: 180;
    gap: 0
}

.mbn-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--t3);
    cursor: pointer;
    gap: 3px;
    transition: color .2s, background .2s;
    padding: 8px 0;
    border-radius: 0;
    -webkit-tap-highlight-color: transparent
}

.mbn-btn:active {
    background: var(--bg3)
}

.mbn-btn.active {
    color: var(--teal)
}

.mbn-btn.active .mbn-ico {
    transform: scale(1.15)
}

.mbn-ico {
    font-size: 1.5rem;
    line-height: 1;
    transition: transform .2s
}

.mbn-lbl {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .03em
}

/* En modo mesero en pantallas ≤900px (tablet/móvil):
   - sidebar completamente oculto
   - no hamburger
   - bottom nav visible
   - contenido sin margen izquierdo + padding inferior para el bottom nav */
@media(max-width:900px) {
    body.modo-mesero .sidebar {
        display: none !important
    }

    body.modo-mesero .hamburger-btn {
        display: none !important
    }

    body.modo-mesero .sidebar-overlay {
        display: none !important
    }

    body.modo-mesero .main {
        margin-left: 0 !important
    }

    body.modo-mesero .content {
        padding-bottom: 72px
    }

    body.modo-mesero .mesero-bottom-nav {
        display: flex
    }
}

/* Mesas: tarjetas más grandes y táctiles en móvil */
@media(max-width:768px) {
    .mesas-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px
    }

    .mesa-card {
        min-height: 100px;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer
    }

    .mesa-card .m-ico {
        font-size: 2.2rem
    }
}

@media(max-width:480px) {
    .mesas-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px
    }

    .mesa-card {
        min-height: 90px
    }
}

/* Paneles en móvil: padding apropiado para scroll */
@media(max-width:600px) {
    .panel {
        padding-bottom: 16px
    }

    /* Topbar: ocultar badge de mesa si hay poco espacio */
    .topbar {
        flex-wrap: nowrap;
        gap: 6px
    }

    /* KPIs en móvil: 1 columna si son más de 4 */
    .kpi-grid.kpi-1col {
        grid-template-columns: 1fr
    }
}

/* ─── DASHBOARD ─── */

/* Barra de filtros */
.db-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    margin-bottom: 14px
}

.db-quick {
    display: flex;
    gap: 4px;
    flex-wrap: wrap
}

.db-quick .btn.active {
    background: var(--teal);
    border-color: var(--teal);
    color: #0d0f14
}

.db-dates {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: auto
}

.db-date-inp {
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: var(--rs);
    color: var(--text);
    font-family: var(--mono);
    font-size: .73rem;
    padding: 5px 9px;
    outline: none;
    transition: border-color .2s
}

.db-date-inp:focus {
    border-color: var(--teal)
}

/* KPI stat cards */
.db-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px
}

.db-stat {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 16px 18px;
    position: relative;
    overflow: hidden
}

.db-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px
}

.db-stat.t::before {
    background: var(--teal)
}

.db-stat.g::before {
    background: var(--gold)
}

.db-stat.r::before {
    background: var(--rose)
}

.db-stat.b::before {
    background: var(--blue)
}

.db-stat-label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--t3);
    margin-bottom: 7px
}

.db-stat-val {
    font-family: var(--mono);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 5px
}

.db-stat.t .db-stat-val {
    color: var(--teal)
}

.db-stat.g .db-stat-val {
    color: var(--gold)
}

.db-stat.r .db-stat-val {
    color: var(--rose)
}

.db-stat.b .db-stat-val {
    color: var(--blue)
}

.db-stat-ico {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.7rem;
    opacity: .13;
    pointer-events: none
}

.db-badge-g {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: .63rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px
}

.db-badge-g.up {
    background: rgba(0, 201, 167, .15);
    color: var(--teal)
}

.db-badge-g.down {
    background: rgba(255, 94, 125, .15);
    color: var(--rose)
}

.db-badge-g.neu {
    background: var(--bg3);
    color: var(--t3)
}

/* Main body: left + right */
.db-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 12px;
    align-items: start
}

.db-col {
    display: flex;
    flex-direction: column;
    gap: 12px
}

.db-chart {
    position: relative;
    width: 100%
}

/* POS session badge — teal when a user is logged in */
#posUserNom.session-active {
    color: var(--teal);
    font-weight: 700
}

/* Dashboard tab toggle */
.db-tab {
    font-size: .63rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--t3);
    border: 1px solid var(--border);
    user-select: none
}

.db-tab.active {
    background: var(--teal);
    color: #000;
    border-color: var(--teal)
}

/* Progress bars */
.db-prog-list {
    display: flex;
    flex-direction: column;
    gap: 11px;
    padding: 10px 14px 14px
}

.db-prog-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px
}

.db-prog-name {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text)
}

.db-prog-meta {
    font-family: var(--mono);
    font-size: .66rem;
    color: var(--t2)
}

.db-prog-track {
    height: 6px;
    background: var(--bg3);
    border-radius: 4px;
    overflow: hidden
}

.db-prog-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .9s cubic-bezier(.4, 0, .2, 1)
}

/* Recent invoices table */
.db-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .72rem
}

.db-table th {
    text-align: left;
    padding: 6px 10px;
    color: var(--t3);
    font-size: .62rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid var(--border);
    font-weight: 700
}

.db-table td {
    padding: 7px 10px;
    border-bottom: 1px solid rgba(42, 48, 69, .5);
    vertical-align: middle
}

.db-table tr:last-child td {
    border-bottom: none
}

.db-table tr:hover td {
    background: var(--bg3)
}

.db-table .mn {
    font-family: var(--mono);
    font-weight: 600;
    color: var(--teal)
}

.db-chip {
    display: inline-block;
    font-size: .58rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap
}

.db-chip-t {
    background: rgba(0, 201, 167, .15);
    color: var(--teal)
}

.db-chip-p {
    background: rgba(168, 85, 247, .15);
    color: var(--purple)
}

.db-chip-b {
    background: rgba(59, 130, 246, .15);
    color: var(--blue)
}

.db-chip-g {
    background: rgba(255, 184, 48, .15);
    color: var(--gold)
}

.db-chip-r {
    background: rgba(255, 94, 125, .15);
    color: var(--rose)
}

.db-empty {
    text-align: center;
    padding: 28px 20px;
    color: var(--t3);
    font-size: .78rem
}

.db-empty .ico {
    font-size: 1.8rem;
    margin-bottom: 6px;
    opacity: .4
}

/* Responsive */
@media(max-width:1100px) {
    .db-stats {
        grid-template-columns: repeat(2, 1fr)
    }

    .db-body {
        grid-template-columns: 1fr
    }
}

@media(max-width:768px) {
    .db-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 7px
    }

    .db-stat {
        padding: 12px 14px
    }

    .db-stat-val {
        font-size: 1.05rem
    }

    .db-dates {
        margin-left: 0;
        width: 100%
    }
}

/* ─── FACTURA PRINT responsiva ─── */

/* Proveedores */
.metodo-btn {
    background: var(--bg3);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 10px 6px;
    cursor: pointer;
    color: var(--t2);
    font-size: .75rem;
    font-weight: 700;
    text-align: center;
    transition: all .2s;
    line-height: 1.6
}

.metodo-btn:hover {
    border-color: var(--teal);
    color: var(--teal)
}

.metodo-btn.active {
    border-color: var(--teal);
    background: var(--tdim);
    color: var(--teal)
}

.tipo-btn {
    background: var(--bg3);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 9px 6px;
    cursor: pointer;
    color: var(--t2);
    font-size: .75rem;
    font-weight: 700;
    text-align: center;
    transition: all .2s;
    line-height: 1.6
}

.tipo-btn:hover {
    border-color: var(--gold);
    color: var(--gold)
}

.tipo-btn.active {
    border-color: var(--gold);
    background: rgba(255, 184, 48, .12);
    color: var(--gold)
}

.spv {
    display: none
}

.spv.active {
    display: block
}

.sdg {
    display: none
}

.sdg.active {
    display: block
}

.vence-ok {
    color: var(--teal)
}

.vence-prox {
    color: var(--gold)
}

.vence-hoy {
    color: var(--rose);
    font-weight: 700
}

.vence-vencida {
    color: var(--rose);
    background: rgba(255, 94, 125, .1);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700
}


.pago-per-btn {
    background: var(--bg3);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 10px 6px;
    cursor: pointer;
    color: var(--t2);
    font-size: .72rem;
    font-weight: 700;
    text-align: center;
    transition: all .2s;
    line-height: 1.8;
    width: 100%
}

.pago-per-btn:hover {
    border-color: var(--teal);
    color: var(--text)
}

.pago-per-btn.active {
    border-color: var(--teal);
    background: var(--tdim);
    color: var(--teal)
}

@media print {
    body {
        padding: 0;
        margin: 0;
        background: #fff
    }

    .sidebar,
    .main .topbar,
    .sidebar-toggle,
    #systemLock,
    #loginOverlay,
    #pinOverlay,
    #aperturaOverlay,
    #cuadreOverlay,
    #facturaPreview .fp-toolbar,
    .user-chip,
    .btn,
    .nav-item {
        display: none !important
    }

    .main {
        margin: 0 !important
    }

    .content {
        padding: 0 !important
    }

    .panel {
        display: block !important
    }

    .fp-box {
        box-shadow: none !important;
        max-width: 100% !important
    }
}

/* ═══════════════════════════════════════════════════════════════════
   VISUAL UPGRADE v2 — Depth · Motion · Polish
   ═══════════════════════════════════════════════════════════════════ */

/* ─── SOMBRAS: jerarquía de planos ─── */
.card {
    box-shadow: 0 1px 3px rgba(0,0,0,.35), 0 4px 20px rgba(0,0,0,.18);
    transition: box-shadow .25s ease, border-color .25s ease;
}
.card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,.4), 0 8px 28px rgba(0,0,0,.22);
    border-color: var(--border2);
}

.kpi {
    box-shadow: 0 1px 3px rgba(0,0,0,.3), 0 3px 12px rgba(0,0,0,.16);
    transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
.kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 18px rgba(0,0,0,.32);
}
.kpi.t:hover { border-color: rgba(0,201,167,.35); }
.kpi.g:hover { border-color: rgba(255,184,48,.35); }
.kpi.r:hover { border-color: rgba(255,94,125,.35); }
.kpi.b:hover { border-color: rgba(77,141,255,.35); }

.cuadre-box  { box-shadow: 0 4px 28px rgba(0,0,0,.45); }
.apertura-box { box-shadow: 0 4px 28px rgba(0,0,0,.45); }
.pin-box     { box-shadow: 0 4px 24px rgba(0,0,0,.4); }
.login-box   { box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(0,201,167,.08); }

/* ─── KPI VALOR: brillo numérico ─── */
.kpi.t .kpi-val { text-shadow: 0 0 22px rgba(0,201,167,.28); }
.kpi.g .kpi-val { text-shadow: 0 0 22px rgba(255,184,48,.28); }
.kpi.r .kpi-val { text-shadow: 0 0 22px rgba(255,94,125,.28); }
.kpi.b .kpi-val { text-shadow: 0 0 22px rgba(77,141,255,.28); }

/* ─── TOPBAR: efecto vidrio esmerilado ─── */
.topbar {
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(19,22,30,.88) !important;
}

/* ─── SIDEBAR: sombra lateral ─── */
.sidebar {
    box-shadow: 2px 0 20px rgba(0,0,0,.35);
}
.nav-item.active {
    box-shadow: inset 0 0 16px rgba(0,201,167,.07);
}

/* ─── BOTONES: sombras coloreadas ─── */
.bp   { box-shadow: 0 3px 10px rgba(0,201,167,.22); }
.bp:hover { box-shadow: 0 5px 20px rgba(0,201,167,.38), 0 2px 6px rgba(0,0,0,.3); }

.bgold { box-shadow: 0 3px 10px rgba(255,184,48,.2); }
.bgold:hover { box-shadow: 0 5px 20px rgba(255,184,48,.35), 0 2px 6px rgba(0,0,0,.3); }

.brose { box-shadow: 0 3px 10px rgba(255,94,125,.2); }
.brose:hover { box-shadow: 0 5px 20px rgba(255,94,125,.35), 0 2px 6px rgba(0,0,0,.3); }

.bblue { box-shadow: 0 3px 10px rgba(77,141,255,.2); }
.bblue:hover { box-shadow: 0 5px 20px rgba(77,141,255,.35), 0 2px 6px rgba(0,0,0,.3); }

/* ─── TABLA: acento teal en primera columna del header ─── */
thead th:first-child {
    border-left: 2px solid rgba(0,201,167,.4);
}

/* ─── TABLE ROWS: hover más visible ─── */
tr:hover td {
    background: rgba(0,201,167,.04) !important;
}

/* ─── INPUTS: focus ring mejorado ─── */
.fg input:focus, .fg select:focus {
    box-shadow: 0 0 0 3px rgba(0,201,167,.14), 0 1px 4px rgba(0,0,0,.3);
}

/* ─── BOTÓN FACTURAR: pulse al procesar ─── */
@keyframes factPulse {
    0%   { box-shadow: 0 4px 14px rgba(0,201,167,.3); }
    35%  { box-shadow: 0 0 0 7px rgba(0,201,167,.22), 0 6px 22px rgba(0,201,167,.55); transform: scale(1.012); }
    100% { box-shadow: 0 4px 14px rgba(0,201,167,.3); transform: scale(1); }
}
.prc-facturar.procesando {
    animation: factPulse .55s cubic-bezier(.4,0,.2,1);
    pointer-events: none;
}

/* ─── BADGE nav: sombra para visibilidad ─── */
#stockNavBadge {
    box-shadow: 0 0 8px rgba(255,94,125,.5);
}

/* ─── CHIPS y PILLS: sombra sutil ─── */
.badge {
    box-shadow: 0 0 10px rgba(0,201,167,.15);
}

/* ─── STAB (tabs de sección): active con sombra ─── */
.stab.active {
    box-shadow: 0 2px 10px rgba(0,201,167,.3);
}

/* ─── PROD CARD en POS: hover glow ─── */
.prod-card:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,.4), 0 0 0 1px rgba(0,201,167,.2) !important;
}
.prod-card:active {
    transform: scale(.97);
}

/* ─── MESA CARD: hover más dramático ─── */
.mesa-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.4) !important;
}

/* ─── TOTAL POS: glow en el número grande ─── */
.prc-tot-total {
    text-shadow: 0 0 18px rgba(0,201,167,.25);
}

/* ─── OVERLAY MODALS: backdrop más oscuro con vignette ─── */
#loginOverlay, #pinOverlay, #aperturaOverlay, #cuadreOverlay, #cierreCajeroOverlay {
    background: radial-gradient(ellipse at center, rgba(13,15,20,.9) 60%, rgba(0,0,0,.98) 100%) !important;
}

/* ─── PROD CARD: el bloque rediseñado arriba es la regla definitiva ─── */
/* Override del v1 eliminado — sin conflictos */

/* ═══════════════════════════════════════════════════════════════════
   TOAST NOTIFICATION SYSTEM
   ═══════════════════════════════════════════════════════════════════ */
#toastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999990;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
    max-width: 340px;
    min-width: 260px
}
.toast {
    background: var(--card);
    border: 1px solid var(--border2);
    border-left: 3px solid var(--teal);
    border-radius: 12px;
    padding: 13px 16px 16px;
    font-size: .83rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.35);
    pointer-events: all;
    position: relative;
    overflow: hidden;
    animation: toastIn .38s cubic-bezier(.34,1.4,.64,1)
}
.toast.toast-e { border-left-color: var(--rose); }
.toast.toast-w { border-left-color: var(--gold); }
.toast.toast-b { border-left-color: var(--blue); }
.toast.toast-s { border-left-color: var(--teal); }

.toast-ico { font-size: 1.05rem; flex-shrink: 0; margin-top: 1px; line-height: 1.3; }
.toast-msg { flex: 1; line-height: 1.45; font-size: .82rem; }
.toast-close {
    background: none;
    border: none;
    color: var(--t3);
    cursor: pointer;
    font-size: .85rem;
    padding: 0;
    flex-shrink: 0;
    line-height: 1.3;
    transition: color .15s
}
.toast-close:hover { color: var(--text); }

/* Barra de progreso de vida del toast */
.toast-bar {
    position: absolute;
    bottom: 0; left: 0;
    height: 3px;
    background: var(--teal);
    border-radius: 0 0 0 12px;
    animation: toastBar var(--toast-dur, 4s) linear forwards
}
.toast.toast-e .toast-bar { background: var(--rose); }
.toast.toast-w .toast-bar { background: var(--gold); }
.toast.toast-b .toast-bar { background: var(--blue); }

.toast.leaving {
    animation: toastOut .28s ease forwards;
    pointer-events: none
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(64px) scale(.93); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(64px) scale(.88); }
}
@keyframes toastBar {
    from { width: 100%; }
    to   { width: 0; }
}

/* ─── ALERT inline: barra de auto-dismiss ─── */
.al.show { position: relative; overflow: hidden; }
.al.show::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    height: 2px;
    background: currentColor;
    opacity: .4;
    animation: alertBar 3.5s linear forwards
}
@keyframes alertBar {
    from { width: 100%; }
    to   { width: 0; }
}

@media(max-width:600px) {
    #toastContainer {
        bottom: 16px;
        right: 12px;
        left: 12px;
        max-width: 100%
    }
}

/* ═══════════════════════════════════════════════════════════════════
   VISUAL UPGRADE v3 — Counters · Skeletons · Status Colors · Clock
   ═══════════════════════════════════════════════════════════════════ */

/* ─── SKELETON LOADER ─── */
@keyframes skelPulse {
    0%, 100% { opacity: .35; }
    50%       { opacity: .7; }
}
.skel {
    background: var(--bg3);
    border-radius: 6px;
    animation: skelPulse 1.5s ease-in-out infinite
}
.skel-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--border)
}
.skel-row:last-child { border-bottom: none; }
.skel-circle { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.skel-lines { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.skel-line-lg { height: 13px; border-radius: 4px; }
.skel-line-sm { height: 10px; border-radius: 4px; width: 60%; }
.skel-amount { width: 80px; height: 20px; border-radius: 4px; flex-shrink: 0; }

/* ─── HISTORIAL ROWS: color por estado ─── */
.hist-card {
    transition: border-left-color .2s, background .2s
}
.hist-card.hc-credito {
    border-left: 3px solid var(--gold) !important;
    background: rgba(255,184,48,.025)
}
.hist-card.hc-contabilizada {
    border-left: 3px solid #22c55e !important;
    background: rgba(34,197,94,.02)
}
.hist-card.hc-anulada {
    border-left: 3px solid var(--rose) !important
}

/* ─── KPI STAGGER — entrada en cascada ─── */
.kpi-grid .kpi {
    animation: fu .35s ease both
}
.kpi-grid .kpi:nth-child(1) { animation-delay: 0s; }
.kpi-grid .kpi:nth-child(2) { animation-delay: .07s; }
.kpi-grid .kpi:nth-child(3) { animation-delay: .14s; }
.kpi-grid .kpi:nth-child(4) { animation-delay: .21s; }
.kpi-grid .kpi:nth-child(5) { animation-delay: .28s; }
.kpi-grid .kpi:nth-child(6) { animation-delay: .35s; }

/* ─── KPI COUNTER: transición suave en el valor ─── */
.kpi-val {
    transition: color .3s ease
}
.kpi-val.counting {
    opacity: .85
}

/* ─── PANEL CARDS: stagger de entrada ─── */
.panel.active > .card:nth-child(1) { animation: fu .32s ease both 0s; }
.panel.active > .card:nth-child(2) { animation: fu .32s ease both .06s; }
.panel.active > .card:nth-child(3) { animation: fu .32s ease both .12s; }
.panel.active > .card:nth-child(4) { animation: fu .32s ease both .18s; }
.panel.active > .card:nth-child(5) { animation: fu .32s ease both .24s; }

/* ─── TOPBAR CLOCK — pulso de los dos puntos ─── */
@keyframes clockBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: .35; }
}
#topbarClock .clk-sep {
    animation: clockBlink 1s step-start infinite
}

/* ─── HISTORIAL: tabla hover row highlight ─── */
.hist-card:hover {
    background: rgba(255,255,255,.018) !important
}

/* ─── STATUS PILL: texto del metodo en historial ─── */
.hist-met-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: .68rem;
    font-weight: 700
}
.hist-met-ef   { background: rgba(0,201,167,.12); color: var(--teal); }
.hist-met-tar  { background: rgba(77,141,255,.12); color: var(--blue); }
.hist-met-trf  { background: rgba(124,58,237,.12); color: #c4b5fd; }
.hist-met-cred { background: rgba(255,184,48,.12); color: var(--gold); }
.hist-met-mix  { background: rgba(255,255,255,.06); color: var(--t2); }

/* ─── CART ITEM en mobile: ajustar grid ─── */
@media(max-width:900px) {
    .cart-item { grid-template-columns: auto 1fr; }
    .cart-item .ci-ico { font-size: 1.2rem; width: 22px; }
}

/* ─── CAT TAB active: gradient en dark ─── */
.cat-tab.active .cat-count { background: rgba(0,0,0,.25); color: #0d0f14; }

/* ─── MESA ocupada: pulso de borde ─── */
@keyframes mesaOcupPulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,.25), 0 0 16px rgba(255,184,48,.15); }
    50%       { box-shadow: 0 2px 8px rgba(0,0,0,.25), 0 0 24px rgba(255,184,48,.3); }
}
.mesa-card.ocupada {
    animation: mesaOcupPulse 3s ease-in-out infinite
}

/* ─── TOPBAR: separador con punto de estado animado ─── */
.badge-activo-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 0 rgba(0,201,167,.5);
    animation: sonarPulse 2.2s ease-out infinite
}
@keyframes sonarPulse {
    0%   { box-shadow: 0 0 0 0 rgba(0,201,167,.5); }
    70%  { box-shadow: 0 0 0 7px rgba(0,201,167,0); }
    100% { box-shadow: 0 0 0 0 rgba(0,201,167,0); }
}

/* ═══════════════════════════════════════════════════════════════════
   DASHBOARD UPGRADE v2 — Charts · Sparklines · Animations
   ═══════════════════════════════════════════════════════════════════ */

/* KPI card hover lift + color glow */
.db-stat {
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.db-stat:hover { transform: translateY(-3px); }
.db-stat.t:hover { box-shadow: 0 8px 28px rgba(0,201,167,.2); border-color: rgba(0,201,167,.35); }
.db-stat.g:hover { box-shadow: 0 8px 28px rgba(255,184,48,.2); border-color: rgba(255,184,48,.35); }
.db-stat.r:hover { box-shadow: 0 8px 28px rgba(255,94,125,.2); border-color: rgba(255,94,125,.35); }
.db-stat.b:hover { box-shadow: 0 8px 28px rgba(77,141,255,.2); border-color: rgba(77,141,255,.35); }

/* KPI card entry animation */
@keyframes dbStatIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.db-stats .db-stat {
    animation: dbStatIn .45s cubic-bezier(.2,.8,.4,1) both;
}
.db-stats .db-stat:nth-child(1) { animation-delay: .04s; }
.db-stats .db-stat:nth-child(2) { animation-delay: .10s; }
.db-stats .db-stat:nth-child(3) { animation-delay: .16s; }
.db-stats .db-stat:nth-child(4) { animation-delay: .22s; }

/* KPI value glow during animation */
.db-stat-val.counting { filter: brightness(1.3); transition: filter .15s; }

/* Sparkline canvas — bottom of KPI card */
.db-spark {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    width: 100%;
    opacity: .28;
    pointer-events: none;
    border-radius: 0 0 var(--r) var(--r);
}

/* Recent invoices row entry */
@keyframes dbRowIn {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}
.db-table tbody tr {
    animation: dbRowIn .3s ease both;
}

/* Chart container subtle inner shadow */
.db-chart {
    border-radius: 0 0 var(--r) var(--r);
}

/* Growth badge — stronger visual */
.db-badge-g {
    font-weight: 800;
    letter-spacing: .02em;
}
.db-badge-g.up   { box-shadow: 0 0 8px rgba(0,201,167,.2); }
.db-badge-g.down { box-shadow: 0 0 8px rgba(255,94,125,.2); }

/* ═══════════════════════════════════════════════════════════════════
   PACKAGE 2 — Modal Factura Premium + Modales generales
   ═══════════════════════════════════════════════════════════════════ */

/* Backdrop blur en overlay de factura */
#facturaPreview {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(0,0,0,.75);
}

/* Box entrada animada */
@keyframes fpBoxIn {
    from { opacity: 0; transform: scale(.93) translateY(22px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.fp-box {
    animation: fpBoxIn .38s cubic-bezier(.2,.8,.4,1) both;
    box-shadow: 0 32px 80px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.06);
}

/* Toolbar con gradiente y borde teal inferior */
.fp-toolbar {
    background: linear-gradient(135deg, #1A1E2A 0%, #252b40 100%);
    border-bottom: 2px solid rgba(0,201,167,.25);
    padding: 13px 16px;
}

/* Botón imprimir — gradient + lift */
.fp-btn-print {
    background: linear-gradient(135deg, #00C9A7, #00b096);
    box-shadow: 0 3px 12px rgba(0,201,167,.35);
    padding: 7px 16px;
    font-size: .8rem;
}
.fp-btn-print:hover {
    background: linear-gradient(135deg, #00ddb8, #00c9a7);
    box-shadow: 0 6px 20px rgba(0,201,167,.5);
    transform: translateY(-1px);
}

/* Botón cerrar */
.fp-btn-close {
    padding: 7px 14px;
    font-size: .8rem;
}
.fp-btn-close:hover {
    background: rgba(255,94,125,.3);
    border-color: rgba(255,94,125,.5);
}

/* Contenido del recibo — sin padding propio (la factura trae su padding) */
.fp-content {
    padding: 0;
    background: #fafafa;
}

/* Modal genérico (#mo) — también mejora */
#mo {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(0,0,0,.78) !important;
}
#mb {
    animation: fpBoxIn .35s cubic-bezier(.2,.8,.4,1) both;
    box-shadow: 0 28px 70px rgba(0,0,0,.7);
}

/* ═══════════════════════════════════════════════════════════════════
   PACKAGE 3 — Overlays Premium · Inputs · Botones · Card Headers
   ═══════════════════════════════════════════════════════════════════ */

/* ── Todos los overlays: blur backdrop ── */
#loginOverlay, #pinOverlay, #aperturaOverlay {
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

/* ── LOGIN BOX — barra teal + entrada animada ── */
@keyframes loginBoxIn {
    from { opacity: 0; transform: translateY(28px) scale(.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.login-box {
    animation: loginBoxIn .42s cubic-bezier(.2,.8,.4,1) both;
    border-color: rgba(0,201,167,.18);
    box-shadow: 0 28px 70px rgba(0,0,0,.7), 0 0 0 1px rgba(0,201,167,.08), 0 0 40px rgba(0,201,167,.06) !important;
    overflow: hidden;
    position: relative;
    padding-top: 0;
}
/* Barra superior teal en login */
.login-box::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, #00C9A7, #4D8DFF);
    margin: 0 -40px 28px;
}
/* Input glow en login */
.login-box input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0,201,167,.18), inset 0 1px 3px rgba(0,0,0,.2);
    background: rgba(0,201,167,.04);
}
/* Botón login — gradient + press */
.login-btn {
    background: linear-gradient(135deg, #00C9A7, #00a88a);
    box-shadow: 0 4px 16px rgba(0,201,167,.35);
    letter-spacing: .02em;
    position: relative;
    overflow: hidden;
}
.login-btn:hover {
    background: linear-gradient(135deg, #00ddb8, #00c9a7);
    box-shadow: 0 6px 22px rgba(0,201,167,.5);
    transform: translateY(-2px);
}
.login-btn:active {
    transform: translateY(0) scale(.98);
    box-shadow: 0 2px 8px rgba(0,201,167,.3);
}

/* ── PIN BOX — entrada + dot animado + teclas con press ── */
@keyframes pinBoxIn {
    from { opacity: 0; transform: scale(.88); }
    to   { opacity: 1; transform: scale(1); }
}
.pin-box {
    animation: pinBoxIn .35s cubic-bezier(.2,.8,.4,1) both;
    box-shadow: 0 24px 60px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.06);
    overflow: hidden;
    position: relative;
}
.pin-box::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--teal), var(--blue));
    margin: -30px -36px 22px;
}
@keyframes pinDotFill {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.35); box-shadow: 0 0 12px rgba(0,201,167,.6); }
    70%  { transform: scale(.92); }
    100% { transform: scale(1); box-shadow: 0 0 6px rgba(0,201,167,.3); }
}
.pin-dot.filled {
    animation: pinDotFill .3s ease forwards;
    background: var(--teal);
    border-color: var(--teal);
    box-shadow: 0 0 6px rgba(0,201,167,.3);
}
.pin-key {
    transition: all .12s ease;
    position: relative;
}
.pin-key:hover {
    transform: scale(1.06);
    border-color: var(--teal);
    color: var(--teal);
    box-shadow: 0 4px 14px rgba(0,201,167,.15);
}
.pin-key:active {
    transform: scale(.93);
    background: var(--tdim);
}

/* ── APERTURA BOX — entrada animada ── */
@keyframes aperturaBoxIn {
    from { opacity: 0; transform: translateY(24px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.apertura-box {
    animation: aperturaBoxIn .38s cubic-bezier(.2,.8,.4,1) both;
    box-shadow: 0 24px 64px rgba(0,0,0,.65), 0 0 0 1px rgba(0,201,167,.12);
    border-color: rgba(0,201,167,.2);
    overflow: hidden;
    position: relative;
}
.apertura-box::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--teal));
    margin: -32px -36px 24px;
}

/* ── GLOBAL INPUTS: glow en focus (paneles dark) ── */
input[type=text]:focus,
input[type=password]:focus,
input[type=number]:focus,
input[type=email]:focus,
input[type=search]:focus,
input[type=date]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--teal) !important;
    box-shadow: 0 0 0 3px rgba(0,201,167,.14);
    transition: border-color .18s, box-shadow .18s;
}

/* ── BOTONES PRIMARIOS — gradient + press state ── */
.bp {
    background: linear-gradient(135deg, #00C9A7, #00a88a);
    box-shadow: 0 3px 12px rgba(0,201,167,.28);
}
.bp:hover {
    background: linear-gradient(135deg, #00ddb8, #00c9a7);
    box-shadow: 0 5px 18px rgba(0,201,167,.42);
    transform: translateY(-2px);
}
.bp:active { transform: scale(.97) !important; box-shadow: none !important; }

.bgold {
    background: linear-gradient(135deg, #FFB830, #e09f1a);
    box-shadow: 0 3px 12px rgba(255,184,48,.25);
}
.bgold:hover {
    background: linear-gradient(135deg, #ffc947, #FFB830);
    box-shadow: 0 5px 18px rgba(255,184,48,.38);
    transform: translateY(-2px);
}
.bgold:active { transform: scale(.97) !important; }

.brose {
    background: linear-gradient(135deg, #FF5E7D, #e04060);
    box-shadow: 0 3px 12px rgba(255,94,125,.22);
}
.brose:hover { box-shadow: 0 5px 18px rgba(255,94,125,.36); transform: translateY(-2px); }
.brose:active { transform: scale(.97) !important; }

.bblue {
    background: linear-gradient(135deg, #4D8DFF, #2d6de0);
    box-shadow: 0 3px 12px rgba(77,141,255,.22);
}
.bblue:hover { box-shadow: 0 5px 18px rgba(77,141,255,.36); transform: translateY(-2px); }
.bblue:active { transform: scale(.97) !important; }

/* ── CARD HEADER — dot con pulso suave ── */
.dot {
    box-shadow: 0 0 6px currentColor;
    opacity: .9;
}
@keyframes dotGlow {
    0%, 100% { opacity: .85; transform: scale(1); }
    50%       { opacity: 1;   transform: scale(1.15); }
}
.card-header .dot {
    animation: dotGlow 3s ease-in-out infinite;
}

/* ── CARD — borde top accent line al hover ── */
.card {
    transition: box-shadow .25s ease, border-color .25s ease, transform .2s ease;
}
.card:hover {
    border-color: rgba(0,201,167,.2);
}

/* ── ERROR SHAKE — login/PIN ── */
@keyframes shakeX {
    0%, 100% { transform: translateX(0); }
    18%      { transform: translateX(-9px); }
    36%      { transform: translateX(9px); }
    54%      { transform: translateX(-6px); }
    72%      { transform: translateX(6px); }
}
.shake { animation: shakeX .42s cubic-bezier(.36,.07,.19,.97); }

/* ═══════════════════════════════════════════════════════════════════
   PACKAGE 4 — Sidebar · Topbar · POS Checkout · Tables · Stabs
   ═══════════════════════════════════════════════════════════════════ */

/* ── SIDEBAR: gradiente sutil de profundidad ── */
.sidebar {
    background: linear-gradient(180deg, #13161E 0%, rgba(16,19,28,.98) 100%);
}

/* ── NAV ITEM: active state premium con glow ── */
.nav-item.active {
    background: linear-gradient(90deg, rgba(0,201,167,.18) 0%, rgba(0,201,167,.03) 100%);
    color: var(--teal);
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(0,201,167,.1);
}
.nav-item.active::before {
    top: 8%; bottom: 8%;
    background: linear-gradient(180deg, #00C9A7, #4D8DFF);
    box-shadow: 0 0 8px rgba(0,201,167,.5);
}
.nav-item.active .ico {
    filter: drop-shadow(0 0 4px rgba(0,201,167,.55));
    display: inline-block;
    transform: scale(1.12);
    transition: transform .2s ease, filter .2s ease;
}
.nav-item:hover {
    background: rgba(255,255,255,.04);
    color: var(--text);
    transform: translateX(2px);
    transition: all .14s ease;
}

/* ── TOPBAR: glassmorphism completo ── */
.topbar {
    background: rgba(19,22,30,.88);
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    border-bottom: 1px solid rgba(0,201,167,.12);
    box-shadow: 0 1px 20px rgba(0,0,0,.32);
}

/* ── POS TOTAL: más impacto ── */
.prc-tot-total {
    font-size: 1.35rem;
    background: linear-gradient(90deg, rgba(0,201,167,.1), rgba(0,201,167,.02));
    border-radius: 8px;
    padding: 8px 10px;
    margin: 4px -10px 0;
    border-top: 1px solid rgba(0,201,167,.22);
}
.prc-tot-total span:last-child {
    font-size: 1.5rem;
    text-shadow: 0 0 18px rgba(0,201,167,.3);
}

/* ── PAYMENT TABS: active gradient + glow ── */
.prc-pay-tab {
    transition: all .16s ease;
}
.prc-pay-tab.active {
    background: linear-gradient(135deg, rgba(0,201,167,.22), rgba(0,201,167,.06));
    border-color: var(--teal);
    color: var(--teal);
    box-shadow: 0 2px 10px rgba(0,201,167,.15), inset 0 0 0 1px rgba(0,201,167,.15);
}
.prc-pay-tab:hover { transform: translateY(-1px); }
.prc-pay-tab:active { transform: scale(.94); }

/* ── STAB (sub-tabs): gradient active + hover lift ── */
.stab {
    transition: all .18s ease;
}
.stab.active {
    background: linear-gradient(135deg, #00C9A7 0%, #00a08a 100%);
    border-color: #00C9A7;
    color: #0D0F14;
    box-shadow: 0 4px 14px rgba(0,201,167,.28);
    transform: translateY(-1px);
}
.stab:hover {
    border-color: var(--teal);
    color: var(--teal);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,201,167,.12);
}

/* ── DEVUELTA: pulse al aparecer dinero ── */
@keyframes devueltaIn {
    0%   { transform: scale(.95); }
    55%  { transform: scale(1.04); }
    100% { transform: scale(1); }
}
.prc-devuelta.live {
    animation: devueltaIn .28s ease;
    color: #00e8c1;
    box-shadow: 0 0 14px rgba(0,201,167,.22);
}

/* ── TABLES (tw): alternating rows + sticky header ── */
.tw table thead th {
    background: var(--bg2);
    font-size: .61rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--t3);
    font-weight: 800;
    padding: 9px 12px;
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 2px solid var(--border2);
}
.tw table tbody tr:nth-child(even) td {
    background: rgba(255,255,255,.016);
}
.tw table tbody tr {
    transition: background .12s ease;
}
.tw table tbody tr:hover td {
    background: var(--bg3) !important;
}
.tw table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(42,48,69,.38);
    font-size: .82rem;
    vertical-align: middle;
}

/* ── CARD HEADER: borde inferior teal sutil ── */
.card-header {
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(42,48,69,.5);
    margin-bottom: 16px;
}

/* ── HIST FILTER BAR: styled wrapper ── */
#p-histfac .card-header > div:last-child {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--rs);
    padding: 6px 10px;
}
#p-histfac .card-header > div:last-child input,
#p-histfac .card-header > div:last-child select {
    background: var(--bg3) !important;
    border: 1.5px solid var(--border) !important;
    border-radius: 6px !important;
    color: var(--text) !important;
    font-family: var(--mono) !important;
    font-size: .78rem !important;
    padding: 5px 9px !important;
    outline: none !important;
}

/* ═══════════════════════════════════════════════════════════════════
   LIGHT MODE — body.light  (dark es el default, light es el override)
   Paleta: Slate profesional — suave, sin blancos ni negros extremos.
   Inspirado en Linear, Vercel, Notion.
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Variables de color (paleta Slate profesional) ─── */
body.light {
    /* Fondos — paleta warm-slate más oscura, sin blancos cegadores */
    --bg:      #DDE1EA;   /* fondo global: slate medio */
    --bg2:     #D3D8E4;   /* fondos secundarios (panels, sidebar) */
    --bg3:     #C8CED9;   /* hover, inputs, filas alternadas */
    /* Cards — gris claro (no blanco puro) */
    --card:    #E8ECF2;
    /* Bordes — más visibles */
    --border:  #B8C0CE;
    --border2: #A4AEBF;
    /* Textos — slate oscuro para contraste */
    --text:    #1A2235;   /* casi negro slate */
    --t2:      #3D4E6A;   /* secundario */
    --t3:      #6E7F99;   /* muted/placeholder */
    /* Tints de acento (mismo teal/gold/rose/blue del dark) */
    --tdim:    rgba(0, 201, 167, .12);
    --gdim:    rgba(245, 158, 11,  .12);
    --rdim:    rgba(239, 68,  68,  .12);
    --bdim:    rgba(59,  130, 246, .12);
    background: var(--bg);
    color:      var(--text);
    color-scheme: light;
}

/* ─── Scrollbar ─── */
body.light ::-webkit-scrollbar-track { background: var(--bg2); }
body.light ::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
body.light ::-webkit-scrollbar-thumb:hover { background: var(--teal); }

/* ─── Sidebar ─── */
body.light .sidebar {
    background: linear-gradient(180deg, #CBD2DF 0%, #D3D8E4 100%) !important;
    border-right: 1px solid var(--border) !important;
    box-shadow: 2px 0 12px rgba(30,41,59,.06) !important;
}
body.light .sidebar-toggle {
    background: var(--card);
    border-color: var(--border);
    color: var(--t2);
    box-shadow: 0 1px 4px rgba(30,41,59,.08);
}
body.light .sidebar-toggle:hover { color: var(--teal); background: var(--bg3); border-color: var(--teal); }
body.light .nav-group-hdr { color: var(--t3); letter-spacing: .06em; }
body.light .nav-group-hdr:hover { background: var(--bg3); color: var(--t2); }
body.light .nav-item { color: var(--t2); }
body.light .nav-item:hover {
    background: rgba(30,41,59,.05);
    color: var(--text);
}
body.light .nav-item.active {
    background: linear-gradient(90deg, rgba(0,201,167,.16), rgba(0,201,167,.04)) !important;
    color: #00875f !important;
    font-weight: 600;
}
body.light .nav-section::-webkit-scrollbar-thumb { background: var(--border2); }

/* ─── Topbar ─── */
body.light .topbar {
    background: rgba(211,216,228,.97) !important;
    backdrop-filter: blur(20px) saturate(1.4) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.4) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: 0 1px 12px rgba(30,41,59,.06) !important;
}
body.light .topbar-title { color: var(--text); font-weight: 700; }
body.light .topbar-sub   { color: var(--t2); }

/* ─── Cards ─── */
body.light .card {
    background: var(--card);
    border-color: var(--border);
    box-shadow: 0 1px 3px rgba(30,41,59,.06),
                0 4px 16px rgba(30,41,59,.04);
}
body.light .card:hover {
    box-shadow: 0 2px 8px rgba(30,41,59,.08),
                0 8px 24px rgba(30,41,59,.06);
    border-color: rgba(0,201,167,.35);
}
body.light .card-header {
    background: linear-gradient(90deg, var(--bg3), var(--bg2));
    border-bottom-color: var(--border);
    color: var(--text);
}

/* ─── KPI stats ─── */
body.light .kpi {
    background: var(--card);
    border-color: var(--border);
    box-shadow: 0 1px 4px rgba(30,41,59,.07);
}
body.light .db-stat {
    background: var(--card);
    border-color: var(--border);
    box-shadow: 0 1px 4px rgba(30,41,59,.06),
                0 4px 14px rgba(30,41,59,.04);
}

/* ─── Inputs, selects, textareas ─── */
body.light input,
body.light select,
body.light textarea {
    color-scheme: light;
    background: var(--card) !important;
    color: var(--text) !important;
    border-color: var(--border2) !important;
}
body.light input::placeholder,
body.light textarea::placeholder { color: var(--t3) !important; }
body.light input:focus,
body.light select:focus,
body.light textarea:focus {
    border-color: var(--teal) !important;
    box-shadow: 0 0 0 3px rgba(0,201,167,.14) !important;
    background: #E8ECF2 !important;
}
/* Inputs dentro de paneles grises — mantener fondo claro */
body.light .bg-panel input,
body.light .bg-panel select { background: var(--bg2) !important; }

/* ─── Botones ghost ─── */
body.light .bh {
    border-color: var(--border2);
    color: var(--t2);
    background: var(--card);
}
body.light .bh:hover {
    border-color: var(--teal);
    color: var(--teal);
    background: var(--tdim);
}

/* ─── Botones primarios en light — conservan su gradiente teal ─── */
body.light .bp,
body.light .bgold,
body.light .brose,
body.light .bblue { filter: brightness(.95) saturate(1.1); }

/* ─── Tablas ─── */
body.light .tw table th,
body.light table th {
    background: var(--bg2) !important;
    color: var(--t2) !important;
    border-color: var(--border) !important;
    font-weight: 700;
}
body.light .tw table td,
body.light table td {
    color: var(--text) !important;
    border-color: var(--border) !important;
}
body.light .tw table tr:nth-child(even) td,
body.light table tr:nth-child(even) td { background: var(--bg); }
body.light .tw table tr:hover td,
body.light table tr:hover td { background: var(--bg3) !important; }

/* ─── Stabs / Panel tabs ─── */
body.light .stab {
    background: var(--bg2);
    border-color: var(--border);
    color: var(--t2);
}
body.light .stab:hover { background: var(--bg3); color: var(--text); }
body.light .stab.active {
    background: linear-gradient(135deg, var(--teal), #00a882) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 2px 10px rgba(0,201,167,.28);
}

/* ─── Category tabs (POS) ─── */
body.light .cat-tab {
    background: var(--card);
    border-color: var(--border);
    color: var(--t2);
    box-shadow: 0 1px 3px rgba(30,41,59,.06);
}
body.light .cat-tab:hover { background: var(--bg3); color: var(--text); }
body.light .cat-tab.active {
    background: linear-gradient(135deg, var(--teal), #00a882);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(0,201,167,.3);
}

/* ─── Producto cards ─── */
body.light .prod-card {
    background: var(--card);
    border-color: var(--border);
    box-shadow: 0 1px 4px rgba(30,41,59,.06);
    color: var(--text);
}
body.light .prod-card:hover {
    box-shadow: 0 4px 16px rgba(30,41,59,.12);
    border-color: rgba(0,201,167,.4);
}

/* ─── Cart items ─── */
body.light .cart-item {
    background: var(--bg2);
    border-color: var(--border);
    color: var(--text);
}

/* ─── POS checkout panel ─── */
body.light .prc-totals    { background: var(--bg2); border-color: var(--border); }
body.light .prc-pay-box   { background: var(--bg2); border-color: var(--border); }
body.light .prc-pay-input { background: var(--card); border-color: var(--border2); color: var(--text); }
body.light .prc-sec-btn   { background: var(--card); border-color: var(--border); color: var(--t2);
                             box-shadow: 0 1px 3px rgba(30,41,59,.07); }
body.light .prc-sec-btn:hover { border-color: var(--teal); color: var(--teal); background: var(--tdim); }
body.light .prc-pay-tab   { background: var(--bg2); border-color: var(--border); color: var(--t2); }

/* ─── Mesa cards ─── */
body.light .mesa-card {
    background: var(--card);
    border-color: var(--border);
    box-shadow: 0 1px 4px rgba(30,41,59,.07);
    color: var(--text);
}

/* ─── Search boxes ─── */
body.light .search-box input,
body.light input[type="search"] {
    background: var(--card) !important;
    border-color: var(--border2) !important;
    color: var(--text) !important;
}

/* ─── Login / PIN / Apertura overlays ─── */
body.light #loginOverlay,
body.light #pinOverlay,
body.light #aperturaOverlay {
    background: rgba(15,23,42,.55) !important;
    backdrop-filter: blur(14px) saturate(1.3) !important;
    -webkit-backdrop-filter: blur(14px) saturate(1.3) !important;
}
body.light .login-box,
body.light .pin-box,
body.light .apertura-box {
    background: var(--card) !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 20px 60px rgba(15,23,42,.2),
                0 0 0 1px rgba(0,201,167,.1) !important;
}
body.light .pin-key {
    background: var(--bg2);
    border-color: var(--border);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(30,41,59,.08);
}
body.light .pin-key:hover {
    background: var(--tdim);
    border-color: var(--teal);
    color: var(--teal);
}
body.light .login-err { color: #dc2626; }

/* ─── Modal genérico (#mo / #mb) ─── */
body.light #mo {
    background: rgba(15,23,42,.55) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
}
body.light #mb {
    background: var(--card) !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 16px 48px rgba(15,23,42,.18) !important;
}
body.light #mbar {
    background: linear-gradient(90deg, var(--bg2), var(--bg)) !important;
    border-bottom: 1px solid var(--border) !important;
}
body.light #mbar span { color: var(--text) !important; }
body.light #mc { background: var(--card) !important; }

/* ─── Factura Preview ─── */
body.light #facturaPreview {
    background: rgba(15,23,42,.55) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
}
body.light .fp-box {
    background: var(--card) !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 16px 48px rgba(15,23,42,.18) !important;
}
body.light .fp-toolbar {
    background: linear-gradient(90deg, var(--bg2), var(--bg)) !important;
    border-bottom: 1px solid var(--border) !important;
}
body.light .fp-toolbar span { color: var(--text) !important; }

/* ─── Cuadre / Cierre overlays ─── */
body.light #cierreTurnoOverlay,
body.light #cuadreOverlay,
body.light #pagoMixtoOverlay,
body.light #cierreCajeroOverlay {
    background: rgba(15,23,42,.5) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}
body.light #cierreTurnoOverlay > div,
body.light #cuadreOverlay .cuadre-box,
body.light #pagoMixtoOverlay > div,
body.light #cierreCajeroOverlay > div {
    background: var(--card) !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 16px 48px rgba(15,23,42,.16) !important;
}

/* ─── Alertas ─── */
body.light .al-s { background: rgba(0,201,167,.1); border-color: rgba(0,201,167,.3); color: #065f46; }
body.light .al-e { background: rgba(239,68,68,.09); border-color: rgba(239,68,68,.28); color: #991b1b; }
body.light .al-w { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.3); color: #92400e; }

/* ─── Badges / status pills ─── */
body.light .badge { box-shadow: 0 1px 3px rgba(30,41,59,.1); }

/* ─── Hamburger menu icon ─── */
body.light .hamburger-btn span { background: var(--t2); }

/* ─── Theme toggle button ─── */
.theme-toggle-btn {
    background: var(--bg3);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text);
    line-height: 1;
    transition: all .2s;
    flex-shrink: 0;
}
.theme-toggle-btn:hover {
    border-color: var(--teal);
    background: var(--tdim);
    transform: scale(1.08) rotate(-10deg);
}
body.light .theme-toggle-btn {
    background: var(--card);
    border-color: var(--border2);
    color: var(--t2);
    box-shadow: 0 1px 3px rgba(30,41,59,.08);
}

/* ─── Charts: grid color se actualiza via JS (_isLight()) ─── */

/* ─── Smooth theme transition (ampliada) ─── */
body, .sidebar, .topbar, .card, .kpi, .btn,
.nav-item, .stab, .cat-tab, .modal, .pin-box, .login-box,
.apertura-box, .prod-card, .mesa-card, .cart-item,
.db-stat, .prc-totals, .prc-pay-tab, .prc-sec-btn,
input, select, textarea, table, th, td {
    transition: background .25s ease, border-color .25s ease,
                color .18s ease, box-shadow .25s ease;
}