:root {
    /* Monochromatic Gray & Industrial Slate Palette */
    --bg-main: #121316;
    --surface-panel: #1a1b20;
    --surface-card: #22242b;
    --surface-hover: #2c2e37;
    --surface-active: #363843;
    
    --border-subtle: #2d3039;
    --border-strong: #444754;
    --border-focus: #717588;

    --text-main: #f1f3f9;
    --text-muted: #8b8f9e;
    --text-dim: #5c6070;

    /* Refined Minimalist Status Indicators */
    --status-cuenta: #d97706;
    --status-cuenta-bg: rgba(217, 119, 6, 0.12);
    --status-cuenta-border: rgba(217, 119, 6, 0.4);

    --status-libre: #059669;
    --status-libre-bg: rgba(5, 150, 105, 0.12);
    --status-libre-border: rgba(5, 150, 105, 0.4);

    --status-ocupada: #e11d48;
    --status-ocupada-bg: rgba(225, 29, 72, 0.12);
    --status-ocupada-border: rgba(225, 29, 72, 0.4);

    --font-mono: 'JetBrains Mono', monospace;
    --radius-main: 12px;
    --radius-btn: 10px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
}

.app-container {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    background: var(--surface-panel);
    border: none;
    border-radius: 0;
    padding: 1.25rem 1.75rem;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Header Layout - Altura Fija y Estabilidad Rigurosa */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    gap: 1rem;
    height: 68px;
    min-height: 68px;
    max-height: 68px;
    flex-shrink: 0;
}

/* Topbar Navigation Bar */
.topbar-nav {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.55rem;
    height: 100%;
    align-items: center;
}

.topbar-btn {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-btn);
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    white-space: nowrap;
}

.topbar-btn i {
    font-size: 0.92rem;
    color: var(--text-dim);
    transition: color 0.15s ease-in-out;
}

.topbar-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--text-main);
}

.topbar-btn:hover i {
    color: var(--text-main);
}

.topbar-btn.active {
    background: var(--surface-active);
    border-color: var(--border-focus);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.topbar-btn.active i {
    color: #ffffff;
}

/* Status Console Display - Posición de Bloques Rigurosamente Fija */
.console-display {
    display: grid;
    grid-template-columns: 155px 1fr;
    align-items: center;
    gap: 1.5rem;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-main);
    padding: 0 1.4rem;
    height: 52px;
    min-height: 52px;
    max-height: 52px;
    width: 430px;
    min-width: 430px;
    max-width: 430px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.console-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.console-label {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    line-height: 1;
    white-space: nowrap;
    margin-bottom: 5px;
}

.console-value {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-dim);
    flex-shrink: 0;
}

/* Contenedor Principal de Vistas */
.layout-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

.view-panel {
    display: none;
    flex: 1;
    height: 100%;
    min-height: 0;
}

.view-panel.active {
    display: flex;
    flex-direction: column;
}

.mesas-grid, .corte-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.25rem;
    min-height: 0;
    height: 100%;
}

/* 8 Columns - Numpad Section */
.numpad-grid {
    grid-column: span 8;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 0.85rem;
    height: 100%;
}

.table-btn {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-btn);
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    outline: none;
}

.table-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}

.table-btn:active {
    background: var(--surface-active);
}

.table-btn .num {
    font-family: var(--font-mono);
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

.table-btn .tag {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-top: 6px;
    transition: color 0.15s ease;
}

.table-btn:hover .tag {
    color: var(--text-muted);
}

.table-btn.selected {
    outline: 3px solid #ffffff !important;
    outline-offset: -3px;
    z-index: 2;
}

.table-btn.state-libre {
    background: #059669;
    border-color: #10b981;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4);
}
.table-btn.state-libre .num { color: #ffffff; }
.table-btn.state-libre .tag { color: #d1fae5; font-weight: 700; }
.table-btn.state-libre:hover { background: #047857; border-color: #34d199; }

.table-btn.state-ocupada {
    background: #e11d48;
    border-color: #f43f5e;
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.4);
}
.table-btn.state-ocupada .num { color: #ffffff; }
.table-btn.state-ocupada .tag { color: #ffe4e6; font-weight: 700; }
.table-btn.state-ocupada:hover { background: #be123c; border-color: #fb7185; }

.table-btn.state-cuenta {
    background: #d97706;
    border-color: #f59e0b;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.4);
}
.table-btn.state-cuenta .num { color: #ffffff; }
.table-btn.state-cuenta .tag { color: #fef3c7; font-weight: 700; }
.table-btn.state-cuenta:hover { background: #b45309; border-color: #fbbf24; }

/* 4 Columns - Action Sidebar */
.actions-sidebar {
    grid-column: span 4;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.action-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-main);
    padding: 1.25rem 1.4rem;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--border-strong);
    transition: background 0.15s ease;
}

.action-card:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}

.action-card:active {
    background: var(--surface-active);
}

.action-card.active-mode {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.35), 0 6px 20px rgba(0, 0, 0, 0.4) !important;
    background: var(--surface-hover) !important;
}

.action-card.active-mode::after {
    content: 'ACTIVO';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    font-weight: 800;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.action-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: var(--text-main);
    flex-shrink: 0;
}

.action-info h3 {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-main);
    text-transform: uppercase;
}

.action-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.card-cuenta::before { background: var(--status-cuenta); }
.card-cuenta:hover .action-icon { color: var(--status-cuenta); border-color: var(--status-cuenta-border); }

.card-libre::before { background: var(--status-libre); }
.card-libre:hover .action-icon { color: var(--status-libre); border-color: var(--status-libre-border); }

.card-ocupada::before { background: var(--status-ocupada); }
.card-ocupada:hover .action-icon { color: var(--status-ocupada); border-color: var(--status-ocupada-border); }

/* --- VISTA TOMA DE COMANDA / PEDIDO --- */
.comanda-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 140px 1.8fr 1.6fr 1.5fr;
    gap: 0.85rem;
    height: 100%;
    min-height: 0;
}

/* Columna 1: Sidebar Acciones Izquierda */
.comanda-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    height: 100%;
    overflow-y: auto;
}

.btn-side-op {
    border: none;
    border-radius: var(--radius-btn);
    padding: 0.6rem 0.4rem;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.2rem;
    transition: opacity 0.15s ease, filter 0.15s ease;
    flex: 1;
    min-height: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-side-op:hover { filter: brightness(1.1); }

.btn-side-gray { background: #333842; color: #ffffff; }
.btn-side-red { background: #e60000; color: #ffffff; }
.btn-side-yellow { background: #ffd500; color: #000000; font-weight: 900; }
.btn-side-green { background: #4a9e32; color: #ffffff; }
.btn-side-pink { background: #ff5577; color: #ffffff; }
.btn-side-cyan { background: #0099e6; color: #ffffff; }
.btn-side-orange { background: #ff8800; color: #ffffff; }
.btn-side-darkred { background: #990000; color: #ffffff; }

/* Columna 2: Ticket de Pedido */
.comanda-ticket-section {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-main);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 0.75rem;
}

.ticket-header {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 0.5rem;
}

.ticket-info-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-table-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
}

.ticket-status-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: #10b981;
}

.ticket-items-container {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.4rem;
}

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

.ticket-table th {
    text-align: left;
    font-size: 0.68rem;
    color: var(--text-dim);
    padding: 0.35rem 0.4rem;
    border-bottom: 1px solid var(--border-subtle);
}

.th-cant { width: 45px; text-align: center; }
.th-precio { text-align: right; width: 75px; }
.th-total { text-align: right; width: 85px; }

.ticket-table td {
    padding: 0.45rem 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.ticket-row-selected {
    background: rgba(255, 255, 255, 0.12) !important;
}

.separator-row {
    background: rgba(0, 153, 230, 0.18) !important;
    border-top: 2px dashed #0099e6;
    border-bottom: 2px dashed #0099e6;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.separator-row:hover {
    background: rgba(0, 153, 230, 0.35) !important;
}

.separator-row.selected-row,
.separator-row.ticket-row-selected {
    background: rgba(0, 153, 230, 0.5) !important;
    outline: 2px solid #00bfff;
}

.separator-cell {
    text-align: center !important;
    padding: 0.55rem 0.5rem !important;
    color: #ffffff !important;
    background: transparent !important;
}

.separator-cell .sep-text {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: #66d9ff;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
}

/* Drag and Drop Reordering */
.ticket-table tbody tr {
    cursor: grab;
    user-select: none;
    transition: background-color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.ticket-table tbody tr:active {
    cursor: grabbing;
}

.ticket-table tbody tr.dragging {
    opacity: 0.35;
    background: rgba(0, 153, 230, 0.3) !important;
    transform: scale(0.98);
}

.ticket-table tbody tr.drag-over {
    border-top: 2px solid #00bfff !important;
    background: rgba(0, 191, 255, 0.18) !important;
}

.drag-handle-icon {
    margin-right: 0.4rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.72rem;
    cursor: grab;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.ticket-table tbody tr:hover .drag-handle-icon {
    color: #00bfff;
    opacity: 1;
}

.td-cant {
    text-align: center;
    font-family: var(--font-mono);
    font-weight: 700;
}

.td-desc {
    font-weight: 600;
}

.td-precio, .td-total {
    text-align: right;
    font-family: var(--font-mono);
    font-weight: 700;
}

.ticket-bar-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    background: #0099e6;
    border-radius: var(--radius-btn);
    margin-top: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ticket-bar-info strong {
    font-family: var(--font-mono);
    color: #ffffff;
}

.ticket-main-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.btn-cmd {
    border: none;
    border-radius: var(--radius-btn);
    padding: 0.95rem 0.5rem;
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: filter 0.15s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-cmd:hover { filter: brightness(1.1); }

.btn-cmd-cobrar { background: #6fa231; color: #ffffff; }
.btn-cmd-comanda { background: #e60000; color: #ffffff; }
.btn-cmd-volver { background: #b8c0cc; color: #000000; font-weight: 900; }
.btn-cmd-separador { background: #0099e6; color: #ffffff; }

/* Columna 3: Rejilla de Categorías */
.comanda-categories-section {
    height: 100%;
    min-height: 0;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: minmax(75px, 1fr);
    gap: 0.6rem;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px;
}

.btn-category, .cat-btn {
    background: #ffd500;
    color: #000000;
    border: 1px solid #e6b800;
    border-radius: var(--radius-btn);
    font-size: 0.95rem;
    font-weight: 900;
    text-transform: uppercase;
    padding: 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.1s ease, filter 0.15s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-category:hover, .cat-btn:hover {
    filter: brightness(1.08);
}

.btn-category.active, .cat-btn.active {
    background: #ffea00;
    box-shadow: inset 0 0 0 3px #ffffff, 0 2px 6px rgba(0,0,0,0.4);
}

.cat-btn .star {
    color: #ffffff;
    font-size: 1.5rem;
    margin-right: 0.3rem;
    text-shadow: 0 0 2px #000;
    line-height: 1;
}

/* Columna 4: Productos y Numpad */
.comanda-products-numpad-section {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    height: 100%;
    min-height: 0;
}

.products-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: calc((100% - 0.6rem) / 2);
    gap: 0.6rem;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px;
    padding-right: 6px;
    min-height: 0;
}

.categories-grid.has-1-item,
.products-grid.has-1-item {
    grid-template-rows: 1fr;
    grid-auto-rows: 1fr;
}

.categories-grid.has-1-item .btn-category,
.categories-grid.has-1-item .cat-btn,
.products-grid.has-1-item .btn-product,
.products-grid.has-1-item .prod-btn {
    grid-column: span 2;
    grid-row: span 2;
    height: 100%;
    width: 100%;
    font-size: 1.15rem;
}

.products-grid.has-1-item .prod-title {
    font-size: 1.3rem;
}

.products-grid.has-1-item .prod-price {
    font-size: 1.2rem;
}

.categories-grid.has-2-items,
.products-grid.has-2-items {
    grid-template-rows: 1fr;
    grid-auto-rows: 1fr;
}

.categories-grid.has-2-items .btn-category,
.categories-grid.has-2-items .cat-btn,
.products-grid.has-2-items .btn-product,
.products-grid.has-2-items .prod-btn {
    height: 100%;
}

.categories-grid.has-3-items > *:nth-child(3),
.products-grid.has-3-items > *:nth-child(3) {
    grid-column: span 2;
}

.products-grid::-webkit-scrollbar {
    width: 6px;
}
.products-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}
.products-grid::-webkit-scrollbar-thumb {
    background: #ffd500;
    border-radius: 4px;
}
.products-grid::-webkit-scrollbar-thumb:hover {
    background: #ffea00;
}

.btn-product, .prod-btn {
    background: #000000;
    border: 1px solid #333333;
    border-radius: var(--radius-btn);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 900;
    text-transform: uppercase;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.3rem;
    transition: border-color 0.15s ease, background 0.15s ease, filter 0.15s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.btn-product:hover, .prod-btn:hover {
    background: #181818;
    border-color: #ffffff;
    filter: brightness(1.2);
}

.btn-product .prod-title, .prod-btn .prod-title {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1.25;
}

.btn-product .prod-price, .prod-btn .prod-price {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: #10b981;
}

/* POS Numpad */
.pos-numpad {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-main);
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.numpad-top-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
}

.numpad-input-val {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    text-align: right;
}

.btn-num-op {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-num-check { background: #16a34a; }
.btn-num-clear { background: #dc2626; }

.numpad-keys-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
}

.key-num {
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 700;
    padding: 0.5rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.key-num:hover {
    background: var(--surface-active);
}

/* --- VISTA CORTE DE CAJA --- */
.corte-main {
    grid-column: span 8;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
    min-height: 0;
}

.denom-header {
    display: grid;
    grid-template-columns: 2.2fr 1.4fr 1.2fr;
    padding: 0.65rem 1.2rem;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-btn);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-dim);
}

.text-center { text-align: center; }
.text-right { text-align: right; }

.denom-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding-right: 0.3rem;
    min-height: 0;
}

.denom-list::-webkit-scrollbar {
    width: 6px;
}
.denom-list::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-radius: 4px;
}
.denom-list::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
}

.denom-row {
    display: grid;
    grid-template-columns: 2.2fr 1.4fr 1.2fr;
    align-items: center;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-btn);
    padding: 0.5rem 1.2rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.denom-row:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}

.denom-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.denom-label i {
    color: var(--text-dim);
    font-size: 1rem;
}

.denom-qty-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-qty {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.btn-qty:hover {
    background: var(--surface-active);
    border-color: var(--border-focus);
}

.input-qty {
    width: 68px;
    height: 32px;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    outline: none;
}

.input-qty:focus {
    border-color: var(--border-focus);
}

/* Remove Arrows, Spinners & Controls from ALL Input Number elements globally */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button,
.swal2-input[type="number"]::-webkit-outer-spin-button,
.swal2-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    appearance: none !important;
    margin: 0 !important;
}

input[type="number"],
.swal2-input[type="number"] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

.denom-subtotal {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: right;
}

/* Corte Ops Grid (Estructura de 2 Filas de la Tabla) */
.corte-ops-grid {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.ops-row-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.ops-row-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.65rem;
}

.btn-op {
    border-radius: var(--radius-btn);
    border: none;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    transition: opacity 0.15s ease, background-color 0.15s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    outline: none;
}

.btn-op:hover {
    opacity: 0.92;
}

.btn-op:active {
    opacity: 1;
    transform: scale(0.99);
}

.btn-op-lg {
    padding: 0.95rem 1rem;
    font-size: 1rem;
}

.btn-op-gastos {
    background-color: #ea580c;
    color: #ffffff;
}

.btn-op-depositos {
    background-color: #65a30d;
    color: #ffffff;
}

.btn-op-reset {
    background-color: #dc2626;
    color: #ffffff;
    padding: 0.65rem 0.5rem;
    font-size: 0.82rem;
}

.btn-op-cajon {
    background-color: #059669;
    color: #ffffff;
    padding: 0.65rem 0.5rem;
    font-size: 0.82rem;
}

/* Card Inline Total Contado en Fila 2 - Fondo Amarillo Dorado Destacado */
.card-total-contado-inline {
    background: #eab308;
    border-radius: var(--radius-btn);
    padding: 0.4rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.total-label-sm {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #000000;
    line-height: 1.1;
    margin-bottom: 2px;
}

.total-amount-sm {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 800;
    color: #000000;
    line-height: 1.1;
}

/* Corte Sidebar (4 Cols) */
.corte-sidebar {
    grid-column: span 4;
    height: 100%;
}

.report-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-main);
    padding: 1.25rem 1.4rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.report-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.folio-tag {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.folio-tag strong {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-main);
}

.report-summary {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.summary-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.summary-item strong {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--text-main);
}

.summary-item.total-item {
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-subtle);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.summary-item.total-item strong {
    font-size: 1.25rem;
}

.cut-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.85rem 0;
}

.btn-cut {
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius-btn);
    border: none;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.btn-precorte {
    background: #d97706;
    color: #ffffff;
}

.btn-precorte:hover {
    background: #b45309;
}

.btn-corte-final {
    background: #e11d48;
    color: #ffffff;
}

.btn-corte-final:hover {
    background: #be123c;
}

.balance-block {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-btn);
    padding: 0.85rem 1rem;
}

.balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.balance-row strong {
    font-family: var(--font-mono);
    font-size: 1.05rem;
}

.balance-expected strong { color: #10b981; }
.balance-diff strong { color: #f43f5e; }
.balance-fondo strong { color: var(--text-main); }

/* Empty View Placeholder */
.empty-view-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-main);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.empty-view-card i {
    font-size: 2.5rem;
    color: var(--text-dim);
}

.empty-view-card h2 {
    font-size: 1.2rem;
    color: var(--text-main);
}

/* Footer Activity Log */
.footer-log {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.log-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.log-terminal {
    font-family: var(--font-mono);
    color: var(--text-main);
}

/* Adaptación y Reescalado Proporcional para Tablets (601px - 1180px) */
@media (min-width: 601px) and (max-width: 1180px) {
    .app-container {
        padding: 0.75rem 1rem;
    }

    .header {
        height: auto;
        min-height: 54px;
        max-height: none;
        margin-bottom: 0.85rem;
        padding-bottom: 0.75rem;
        gap: 0.75rem;
    }

    .console-display {
        width: auto;
        min-width: 0;
        max-width: 320px;
        grid-template-columns: 110px 1fr;
        gap: 0.75rem;
        padding: 0 0.85rem;
        height: 46px;
        min-height: 46px;
    }

    .console-label {
        font-size: 0.55rem;
    }

    .console-value {
        font-size: 0.85rem;
    }

    .topbar-btn {
        height: 42px;
        min-height: 42px;
        max-height: 42px;
        font-size: 0.72rem;
        padding: 0 0.25rem;
        gap: 0.3rem;
    }

    .topbar-btn i {
        font-size: 0.82rem;
    }

    .mesas-grid, .corte-grid {
        gap: 0.75rem;
    }

    .table-number {
        font-size: 1.25rem;
    }

    .table-status {
        font-size: 0.65rem;
    }

    .action-btn {
        padding: 0.65rem 0.85rem;
        font-size: 0.82rem;
    }
}

/* Optimización para Pantallas Cuadradas o de Menor Altura (ej. 768x768 iPad/Tablets) */
@media (max-height: 800px) {
    .app-container {
        padding: 0.6rem 0.85rem;
    }

    .header {
        height: 52px;
        min-height: 52px;
        max-height: 52px;
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }

    .topbar-btn {
        height: 38px;
        min-height: 38px;
        max-height: 38px;
        font-size: 0.7rem;
    }

    .console-display {
        height: 42px;
        min-height: 42px;
        max-height: 42px;
    }

    /* Modal PIN compacto para pantallas cuadradas */
    .pin-card {
        padding: 1.25rem 1.5rem 1rem;
        max-width: 320px;
    }

    .pin-logo {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }

    .pin-header {
        margin-bottom: 0.85rem;
    }

    .pin-header h2 {
        font-size: 1.15rem;
    }

    .pin-display-container {
        margin-bottom: 1rem;
        min-height: 36px;
    }

    .pin-btn {
        height: 44px;
        font-size: 1.2rem;
    }

    .pin-keypad {
        gap: 0.6rem;
    }

    .pin-footer {
        margin-top: 0.85rem;
    }
}

/* Estilos Menú Hamburguesa & Sidebar Lateral Deslizable */
.menu-toggle-btn {
    display: none;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-btn);
    color: var(--text-main);
    font-size: 1.2rem;
    padding: 0.6rem 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    align-items: center;
    justify-content: center;
}

.menu-toggle-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}

.sidebar-header {
    display: none;
}

.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 900px) {
    .menu-toggle-btn {
        display: flex;
    }

    .topbar-nav {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        background: var(--surface-card);
        border-right: 1px solid var(--border-strong);
        padding: 1.25rem 1rem;
        gap: 0.75rem;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
        z-index: 99999;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .topbar-nav.open {
        transform: translateX(0);
    }

    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 1rem;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid var(--border-subtle);
    }

    .sidebar-title {
        font-size: 1rem;
        font-weight: 800;
        color: var(--text-main);
        display: flex;
        align-items: center;
        gap: 0.5rem;
        letter-spacing: 0.05em;
    }

    .sidebar-close-btn {
        background: transparent;
        border: none;
        color: var(--text-muted);
        font-size: 1.2rem;
        cursor: pointer;
        padding: 0.2rem 0.5rem;
        border-radius: var(--radius-btn);
        transition: color 0.15s ease, background 0.15s ease;
    }

    .sidebar-close-btn:hover {
        color: var(--text-main);
        background: var(--surface-hover);
    }

    .topbar-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 0 1.25rem;
        font-size: 0.9rem;
        height: 48px;
        min-height: 48px;
    }
}

/* Adaptación del Módulo de Comanda para Tablets (1024px o menos) */
@media (max-width: 1024px) {
    .comanda-grid {
        grid-template-columns: 110px 1.5fr 1.2fr 1.2fr;
        gap: 0.5rem;
    }

    .btn-side-op {
        padding: 0.45rem 0.25rem;
        font-size: 0.68rem;
    }

    .ticket-table {
        font-size: 0.75rem;
    }

    .btn-cmd {
        padding: 0.7rem 0.3rem;
        font-size: 0.88rem;
    }

    .btn-category, .cat-btn {
        font-size: 0.8rem;
        padding: 0.4rem;
    }

    .pos-numpad {
        gap: 0.3rem;
    }

    .key-num {
        height: 38px;
        font-size: 1.1rem;
    }
}

/* Responsive Móviles para Toma de Comanda */
@media (max-width: 600px) {
    .layout-grid { flex-direction: column; }
    .mesas-grid, .corte-grid { grid-template-columns: 1fr; }
    .numpad-grid, .corte-main { grid-column: span 12; }
    .actions-sidebar, .corte-sidebar { grid-column: span 12; }
    .numpad-grid { grid-template-columns: repeat(3, 1fr); }
    .actions-sidebar { flex-direction: column; }
    .header { align-items: center; gap: 0.75rem; }
    .corte-ops-bar { grid-template-columns: repeat(2, 1fr); }

    /* Módulo Comanda en Celular (Scroll vertical fluído de secciones) */
    .comanda-grid {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        height: auto;
        overflow-y: auto;
    }

    .comanda-sidebar-actions {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.4rem;
        height: auto;
    }

    .btn-side-op {
        min-height: 48px;
        font-size: 0.65rem;
    }

    .comanda-ticket-section {
        min-height: 320px;
        max-height: 420px;
    }

    .comanda-categories-section {
        height: auto;
    }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 55px;
    }

    .comanda-products-numpad-section {
        height: auto;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 65px;
    }
}

/* SweetAlert2 Custom Styling for MarSale Dark Industrial System */
.swal2-container {
    z-index: 99999 !important;
}

.swal2-container.swal2-center {
    backdrop-filter: blur(4px);
}

.swal2-popup {
    background: var(--surface-card) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-main) !important;
    color: var(--text-main) !important;
    font-family: var(--font-sans) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
}

.swal2-title {
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    color: var(--text-main) !important;
    letter-spacing: -0.01em !important;
}

.swal2-html-container {
    font-size: 0.95rem !important;
    color: var(--text-muted) !important;
    line-height: 1.5 !important;
}

.swal2-input {
    background: var(--bg-main) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-btn) !important;
    color: var(--text-main) !important;
    font-family: var(--font-mono) !important;
    font-size: 1.1rem !important;
    box-shadow: none !important;
}

.swal2-input:focus {
    border-color: var(--border-focus) !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2) !important;
}

.swal2-styled.swal2-confirm {
    background-color: #10b981 !important;
    border-radius: var(--radius-btn) !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    padding: 0.6rem 1.4rem !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

.swal2-styled.swal2-cancel {
    background-color: #ef4444 !important;
    border-radius: var(--radius-btn) !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    padding: 0.6rem 1.4rem !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* ==========================================
   MODAL DE COBRO (SambaPOS / POS Style)
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 12, 18, 0.88);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
    animation: fadeInModal 0.2s ease-out;
}

@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.modal-cobro-container {
    width: 100%;
    max-width: 1240px;
    height: 92vh;
    max-height: 760px;
    background: #181b22;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #f3f4f6;
}

/* Header Modal */
.modal-cobro-header {
    height: 52px;
    background: #111318;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    flex-shrink: 0;
}

.modal-cobro-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cobro-badge-mesa {
    background: #e11d48;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    letter-spacing: 0.03em;
}

.cobro-badge-ticket {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
}

.modal-cobro-header-title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #ffffff;
}

.btn-cobro-close-top {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s ease;
}

.btn-cobro-close-top:hover {
    color: #ef4444;
}

/* Modal Body (3 Columnas) */
.modal-cobro-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: #14161d;
}

/* --- COLUMNA 1: LISTA DE PRODUCTOS (IZQUIERDA) --- */
.cobro-col-left {
    width: 320px;
    flex-shrink: 0;
    background: #111318;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
}

.cobro-products-table-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.cobro-products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.cobro-products-table th {
    text-align: left;
    padding: 0.5rem 0.4rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cobro-products-table th.th-cant { width: 42px; text-align: center; }
.cobro-products-table th.th-total { text-align: right; }

.cobro-products-table td {
    padding: 0.55rem 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #e5e7eb;
}

.cobro-products-table td.td-cant {
    font-weight: 800;
    text-align: center;
    color: #ffffff;
}

.cobro-products-table td.td-name {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.82rem;
    word-break: break-word;
}

.cobro-products-table td.td-total {
    text-align: right;
    font-family: var(--font-mono);
    font-weight: 700;
    color: #ffffff;
}

.cobro-left-footer {
    padding: 0.75rem 1rem;
    background: #0d0e12;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.cobro-left-footer strong {
    color: #ffffff;
    font-size: 1.05rem;
    font-family: var(--font-mono);
}

/* --- COLUMNA 2: CENTRO (DISPLAY, NUMPAD, ACCIONES) --- */
.cobro-col-middle {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    gap: 1rem;
    background: #181b22;
    overflow-y: auto;
}

/* Display Superior (Total, Recibido, Cambio en filas separadas) */
.cobro-display-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: #0f1116;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.75rem 1rem;
}

.cobro-total-row, .cobro-recibido-row, .cobro-cambio-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.85rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 6px;
}

.cobro-display-label {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cobro-display-total {
    font-size: 2rem;
    font-weight: 900;
    font-family: var(--font-mono);
    color: #ffffff;
    line-height: 1;
}

.cobro-display-recibido {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: #38bdf8;
    line-height: 1;
}

.cobro-display-cambio {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: #34d399;
    line-height: 1;
}


/* Numpad Container (Presets + Teclado) */
.cobro-numpad-container {
    flex: 1;
    display: flex;
    gap: 0.85rem;
    min-height: 280px;
}

/* Presets Rápidos (Izquierda) */
.cobro-presets-column {
    width: 100px;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.cobro-btn-preset {
    flex: 1;
    background: #252834;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 800;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cobro-btn-preset:hover {
    background: #323646;
    border-color: rgba(255, 255, 255, 0.25);
}

.cobro-btn-preset:active {
    transform: scale(0.97);
}

/* Numpad Keys Grid (4 Columnas) */
.cobro-numpad-keys {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 0.65rem;
}

.cobro-key {
    background: #232733;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s ease, transform 0.1s ease;
    outline: none;
}

.cobro-key:hover {
    background: #2f3444;
    border-color: rgba(255, 255, 255, 0.2);
}

.cobro-key:active {
    transform: scale(0.96);
    background: #3b4154;
}

.cobro-key-side {
    background: #2d3345;
    color: #e2e8f0;
    font-size: 0.95rem;
    font-weight: 700;
}

.cobro-key-side:hover {
    background: #384056;
    color: #ffffff;
}

.cobro-key-del {
    background: #3f2228;
    color: #f87171;
}

.cobro-key-del:hover {
    background: #542932;
    color: #fca5a5;
}

/* Botones Acción Inferiores */
.cobro-bottom-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
    margin-top: auto;
}

.cobro-btn-sub {
    background: #1f232f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
    color: #9ca3af;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.cobro-btn-sub:hover {
    background: #2b3040;
    color: #ffffff;
}

.cobro-btn-sub-highlight {
    background: #991b1b;
    color: #ffffff;
    border-color: #b91c1c;
}

.cobro-btn-sub-highlight:hover {
    background: #b91c1c;
}

/* --- COLUMNA 3: OPICIONES DE PAGO Y CERRAR (DERECHA) --- */
.cobro-col-right {
    width: 250px;
    flex-shrink: 0;
    background: #111318;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.btn-pay-option {
    flex: 1;
    border: none;
    border-radius: 10px;
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.btn-pay-option:hover {
    filter: brightness(1.12);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.btn-pay-option:active {
    transform: scale(0.97);
}

/* Botón EFECTIVO (Verde) */
.btn-pay-efectivo {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    border: 1px solid #4caf50;
}

/* Botón TARJETA CREDITO (Azul) */
.btn-pay-tarjeta {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
    border: 1px solid #42a5f5;
}

/* Botón TRANSFERENCIA (Púrpura/Rosa) */
.btn-pay-transfer {
    background: linear-gradient(135deg, #ab47bc 0%, #7b1fa2 100%);
    border: 1px solid #ce93d8;
}

/* Botón Cerrar (Gris Oscuro / Rojo suave) */
.btn-pay-cerrar {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border: 1px solid #4b5563;
    color: #d1d5db;
}

.btn-pay-cerrar:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    color: #ffffff;
}

/* Responsive Modal */
@media (max-width: 1024px) {
    .modal-cobro-container {
        height: 96vh;
    }
    .cobro-col-left {
        width: 260px;
    }
    .cobro-col-right {
        width: 200px;
    }
    .btn-pay-option {
        font-size: 1rem;
    }
    .cobro-display-total {
        font-size: 1.9rem;
    }
    .cobro-display-recibido, .cobro-display-cambio {
        font-size: 1.4rem;
    }
}

/* ==========================================
   ESTILOS MÓDULO DE GASTOS (SambaPOS Style)
   ========================================== */
#view-gastos {
    width: 100%;
    height: 100%;
}

.gastos-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    gap: 0.75rem;
}

/* Header Banner Rojo / Naranja */
.gastos-header-banner {
    background: linear-gradient(135deg, #e63946 0%, #d62828 100%);
    color: #ffffff;
    border-radius: var(--radius-btn);
    padding: 0.6rem 1.2rem;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    box-shadow: 0 4px 12px rgba(214, 40, 40, 0.3);
    flex-shrink: 0;
}

/* Grid Principal de Gastos */
.gastos-main-grid {
    display: flex;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

/* Sección de Botones (Izquierda) */
.gastos-buttons-section {
    flex: 1.8;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    min-height: 0;
}

.gastos-col {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

/* Botón de Categoría de Gasto */
.btn-gasto-cat {
    flex: 1;
    background: linear-gradient(180deg, #e64a19 0%, #bf360c 100%);
    color: #ffffff;
    border: 1px solid #ff6d00;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease, filter 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.4rem;
    line-height: 1.15;
}

.btn-gasto-cat:hover {
    filter: brightness(1.15);
    box-shadow: 0 5px 12px rgba(230, 81, 0, 0.4);
    transform: translateY(-1px);
}

.btn-gasto-cat:active {
    transform: translateY(1px);
    filter: brightness(0.95);
}

/* Tarjeta de Total de Gastos (Amarillo Cálido) */
.gastos-total-card {
    flex: 2;
    background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%);
    border: 1px solid #ffd54f;
    border-radius: 10px;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(255, 143, 0, 0.35);
}

.gastos-total-label {
    font-size: 0.95rem;
    font-weight: 900;
    color: #000000;
    letter-spacing: 0.05em;
}

.gastos-total-val {
    font-size: 1.8rem;
    font-weight: 900;
    color: #000000;
    font-family: var(--font-mono);
    margin-top: 0.2rem;
}

/* Sección Lateral (Derecha: Tablas y Botones) */
.gastos-sidebar-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
}

.gastos-table-wrapper {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-main);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gastos-summary-table-wrap {
    max-height: 160px;
    overflow-y: auto;
}

.gastos-detail-table-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.gastos-table-title {
    background: #111827;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

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

.gastos-table th {
    text-align: left;
    color: var(--text-dim);
    font-size: 0.68rem;
    padding: 0.35rem 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
}

.gastos-table td {
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.gastos-action-buttons {
    display: flex;
    gap: 0.6rem;
    flex-shrink: 0;
}

.btn-gastos-action {
    flex: 1;
    height: 46px;
    border-radius: 8px;
    font-weight: 900;
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    border: none;
    color: #ffffff;
    transition: filter 0.15s ease, transform 0.1s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.btn-gastos-action:hover {
    filter: brightness(1.15);
}

.btn-gastos-action:active {
    transform: translateY(1px);
}

.btn-gastos-imprimir {
    background: linear-gradient(135deg, #c62828 0%, #8e0000 100%);
    border: 1px solid #ef5350;
}

.btn-gastos-abrir {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    border: 1px solid #f44336;
    font-size: 1rem;
}

/* ==========================================
   ESTILOS MODAL GASTO (Estilo Teclado Cobro de Cuenta)
   ========================================== */
.modal-gasto-dialog {
    width: 540px !important;
    max-width: 95vw !important;
    height: auto !important;
    max-height: 92vh !important;
}

.modal-gasto-body-panel {
    border-radius: 0 0 16px 16px;
}

.gasto-display-frame {
    gap: 0.65rem !important;
}

.gasto-input-field {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #38bdf8 !important;
    font-family: var(--font-mono) !important;
    font-size: 1.8rem !important;
    font-weight: 900 !important;
    text-align: right !important;
    width: 65% !important;
}

.gasto-desc-row {
    background: rgba(255, 255, 255, 0.03) !important;
}

.gasto-desc-field {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #f3f4f6 !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    text-align: right !important;
    width: 70% !important;
}

.gasto-key-clear {
    background: #374151 !important;
    color: #fbbf24 !important;
    font-size: 0.85rem !important;
}

/* ==========================================
   ESTILOS LOGIN CON PIN (LOCK SCREEN)
   ========================================== */
.header-right-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.btn-lock-icon {
    background: rgba(225, 29, 72, 0.12);
    border: 1px solid rgba(225, 29, 72, 0.35);
    color: #f43f5e;
    width: 48px;
    height: 52px;
    border-radius: var(--radius-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    flex-shrink: 0;
    box-sizing: border-box;
}

.btn-lock-icon:hover {
    background: #e11d48;
    color: #ffffff;
    border-color: #e11d48;
    box-shadow: 0 0 14px rgba(225, 29, 72, 0.5);
    transform: translateY(-1px);
}

.btn-lock-icon:active {
    transform: scale(0.95);
}

.pin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, rgba(26, 27, 32, 0.94) 0%, rgba(18, 19, 22, 0.98) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pin-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.pin-card {
    background: var(--surface-card);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    padding: 2.2rem 2rem 1.8rem;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 0 1px var(--border-subtle);
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pin-overlay.active .pin-card {
    transform: scale(1);
}

.pin-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.pin-logo {
    width: 58px;
    height: 58px;
    background: var(--surface-hover);
    border: 1px solid var(--border-focus);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.85rem;
    color: var(--text-main);
    font-size: 1.6rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.pin-header h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 0.08em;
    margin: 0;
}

.pin-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.pin-display-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.6rem;
    min-height: 48px;
}

.pin-dots {
    display: flex;
    gap: 1.1rem;
    align-items: center;
    justify-content: center;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: var(--bg-main);
    transition: all 0.15s ease;
}

.pin-dot.filled {
    background: var(--text-main);
    border-color: var(--text-main);
    box-shadow: 0 0 12px rgba(241, 243, 249, 0.4);
    transform: scale(1.15);
}

.pin-dot.error {
    background: var(--status-ocupada);
    border-color: var(--status-ocupada);
    box-shadow: 0 0 12px rgba(225, 29, 72, 0.6);
}

.pin-dot.success {
    background: var(--status-libre);
    border-color: var(--status-libre);
    box-shadow: 0 0 16px rgba(5, 150, 105, 0.7);
    transform: scale(1.25);
}

.pin-error-msg {
    font-size: 0.78rem;
    color: var(--status-ocupada);
    font-weight: 700;
    margin-top: 8px;
    height: 18px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pin-error-msg.visible {
    opacity: 1;
}

/* Keypad Grid 3x4 */
.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    width: 100%;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.pin-keypad.disabled {
    opacity: 0.35;
    pointer-events: none;
    filter: grayscale(1);
}

.pin-btn {
    height: 56px;
    border-radius: var(--radius-btn);
    background: var(--surface-panel);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    font-size: 1.45rem;
    font-weight: 700;
    font-family: var(--font-mono);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
    user-select: none;
    outline: none;
}

.pin-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--text-main);
    transform: translateY(-1px);
}

.pin-btn:active {
    transform: scale(0.94);
    background: var(--surface-active);
    border-color: var(--border-focus);
}

.pin-action-btn {
    background: var(--bg-main);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.pin-action-btn:hover {
    color: var(--text-main);
    background: var(--surface-hover);
    border-color: var(--border-strong);
}

.pin-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.pin-hint {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pin-hint strong {
    color: var(--text-main);
    font-family: var(--font-mono);
}

/* Animación Shake en Error */
@keyframes pinShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.pin-card.shake {
    animation: pinShake 0.4s ease-in-out;
}

