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

:root {
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --success: #16a34a;
    --success-light: #22c55e;
    --danger: #dc2626;
    --warning: #d97706;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --white: #ffffff;
    --sidebar-w: 240px;
    --header-h: 60px;
}

html, body { height: 100%; font-family: 'Inter', sans-serif; background: var(--gray-100); color: var(--gray-800); }
#app { height: 100%; }

/* ===== PANTALLA DE CARGA ===== */
.boot-screen { display: flex; align-items: center; justify-content: center; height: 100vh; background: var(--gray-50); }
.boot-box { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.boot-logo { font-size: 3.5rem; }
.boot-name { font-size: 1.6rem; font-weight: 800; color: var(--primary-dark); letter-spacing: -0.02em; }
.boot-msg { font-size: 0.9rem; color: var(--gray-400); }
.boot-spinner {
    width: 36px; height: 36px; border-radius: 50%;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-light);
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* LAYOUT */
.app-layout { display: flex; height: 100vh; overflow: hidden; }

/* SIDEBAR */
.sidebar {
    width: 190px;
    background: var(--primary-dark);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-nav { padding: 8px 0; flex: 1; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    color: #bfdbfe;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.nav-item.active { background: rgba(255,255,255,0.14); color: var(--white); border-left-color: #60a5fa; }
.nav-fkey {
    font-size: 0.62rem; font-weight: 700; background: rgba(255,255,255,0.12);
    color: #93c5fd; padding: 2px 5px; border-radius: 4px; min-width: 26px;
    text-align: center; font-family: monospace; flex-shrink: 0;
}
.nav-item.active .nav-fkey { background: #3b82f6; color: var(--white); }
.nav-icon { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* MAIN CONTENT */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
    height: var(--header-h);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}
.topbar-title { font-size: 1.1rem; font-weight: 600; color: var(--gray-800); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.page-content { flex: 1; overflow-y: auto; padding: 24px; }

/* CARDS */
.card {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    padding: 20px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-title { font-size: 1rem; font-weight: 600; color: var(--gray-800); }

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn-primary { background: var(--primary-light); color: var(--white); }
.btn-primary:hover { background: var(--primary); }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #b91c1c; }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-icon { padding: 8px; border-radius: 8px; }

/* INPUTS */
.input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    color: var(--gray-800);
    background: var(--white);
    transition: border-color 0.15s;
    outline: none;
}
.input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.input-group { position: relative; }
.input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-400); }
.input-with-icon { padding-left: 38px; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }

/* TABLES */
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th { text-align: left; padding: 10px 14px; font-weight: 600; color: var(--gray-500); border-bottom: 1px solid var(--gray-200); background: var(--gray-50); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }
.table tr:hover td { background: var(--gray-50); }

/* BADGES */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 100px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: #dcfce7; color: #16a34a; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    padding: 20px;
}
.stat-label { font-size: 0.8rem; color: var(--gray-500); font-weight: 500; margin-bottom: 8px; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--gray-800); }
.stat-sub { font-size: 0.8rem; color: var(--gray-400); margin-top: 4px; }
.stat-icon { font-size: 2rem; margin-bottom: 8px; }

/* POS */
.pos-layout { display: grid; grid-template-columns: 1fr 380px; gap: 20px; height: calc(100vh - var(--header-h) - 48px); }
.pos-products { overflow-y: auto; }
.pos-cart { display: flex; flex-direction: column; background: var(--white); border-radius: 12px; border: 1px solid var(--gray-200); overflow: hidden; }
.pos-cart-header { padding: 16px 20px; border-bottom: 1px solid var(--gray-200); font-weight: 600; font-size: 1rem; }
.pos-cart-items { flex: 1; overflow-y: auto; padding: 12px; }
.pos-cart-footer { border-top: 1px solid var(--gray-200); padding: 16px 20px; }
.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
}
.cart-item-name { flex: 1; font-size: 0.875rem; font-weight: 500; }
.cart-item-price { font-size: 0.875rem; color: var(--gray-600); }
.cart-qty { display: flex; align-items: center; gap: 6px; }
.qty-btn { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--gray-200); background: var(--white); cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--gray-600); }
.qty-btn:hover { background: var(--gray-100); }
.qty-num { min-width: 24px; text-align: center; font-weight: 600; font-size: 0.875rem; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.2rem; font-weight: 700; margin-bottom: 12px; }
.cart-total span:last-child { color: var(--primary); }

.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding-bottom: 16px; }
.product-tile {
    background: var(--white);
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    padding: 14px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.product-tile:hover { border-color: var(--primary-light); box-shadow: 0 4px 12px rgba(59,130,246,0.15); transform: translateY(-1px); }
.product-tile:active { transform: translateY(0); }
.product-tile-icon { font-size: 2rem; margin-bottom: 8px; }
.product-tile-name { font-size: 0.8rem; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; line-height: 1.3; }
.product-tile-price { font-size: 0.9rem; font-weight: 700; color: var(--primary); }
.product-tile-stock { font-size: 0.7rem; color: var(--gray-400); margin-top: 2px; }
.product-tile.low-stock { border-color: #fde68a; }
.product-tile.out-stock { opacity: 0.5; cursor: not-allowed; }

/* MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal {
    background: var(--white);
    border-radius: 16px;
    padding: 28px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; color: var(--gray-800); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* TOAST */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
    background: var(--gray-800);
    color: var(--white);
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    min-width: 250px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* RECEIPT */
.receipt { font-family: 'Courier New', monospace; font-size: 0.8rem; max-width: 300px; margin: 0 auto; padding: 20px; border: 1px dashed var(--gray-300); }
.receipt-header { text-align: center; margin-bottom: 16px; }
.receipt-divider { border: none; border-top: 1px dashed var(--gray-300); margin: 10px 0; }
.receipt-row { display: flex; justify-content: space-between; margin-bottom: 4px; }
.receipt-total { font-weight: 700; font-size: 1rem; }

/* UTILS */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.text-sm { font-size: 0.875rem; }
.text-muted { color: var(--gray-500); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary-light); }

/* SCANNER */
.scanner-area { border: 2px dashed var(--gray-300); border-radius: 12px; padding: 30px; text-align: center; cursor: pointer; transition: all 0.2s; }
.scanner-area:hover { border-color: var(--primary-light); background: #eff6ff; }
.scanner-icon { font-size: 3rem; margin-bottom: 12px; }

/* VOICE */
.voice-btn { width: 72px; height: 72px; border-radius: 50%; background: var(--primary-light); color: var(--white); border: none; cursor: pointer; font-size: 1.9rem; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.voice-btn.listening { background: var(--danger); animation: pulse 1s infinite; }
.voice-btn:hover { transform: scale(1.05); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.4); } 50% { box-shadow: 0 0 0 12px rgba(220,38,38,0); } }

/* DELIVERY STATUS */
.delivery-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.delivery-col { background: var(--gray-50); border-radius: 10px; padding: 14px; }
.delivery-col-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-500); margin-bottom: 12px; }
.delivery-card { background: var(--white); border-radius: 8px; padding: 12px; margin-bottom: 8px; border: 1px solid var(--gray-200); font-size: 0.875rem; cursor: pointer; transition: box-shadow 0.15s; }
.delivery-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-300); }

/* ===== SIDEBAR BRAND ===== */
.sidebar-brand {
    display: flex; align-items: center; gap: 10px; padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.brand-icon { font-size: 1.6rem; flex-shrink: 0; }
.brand-text { min-width: 0; }
.brand-name { font-size: 1rem; font-weight: 700; color: var(--white); }
.brand-store { font-size: 0.68rem; color: #93c5fd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock { font-size: 0.82rem; color: #93c5fd; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.kbd-hint { font-size: 0.65rem; color: #475569; }
.connection-status { font-size: 0.7rem; padding: 4px 8px; border-radius: 20px; margin-bottom: 6px; font-weight: 500; text-align: center; transition: background 0.3s, color 0.3s; }
.connection-status.online  { background: rgba(34,197,94,0.15); color: #86efac; }
.connection-status.offline { background: rgba(239,68,68,0.15);  color: #fca5a5; }

/* ===== MODULE LAYOUT ===== */
.module-layout { padding: 24px; height: 100%; overflow-y: auto; }
.module-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.module-header h1 { font-size: 1.4rem; font-weight: 700; color: var(--gray-800); }
.header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ===== POS LAYOUT ===== */
.pos-layout { display: grid; grid-template-columns: 1fr 270px; gap: 0; height: 100%; overflow: hidden; }
.pos-left { display: flex; flex-direction: column; overflow: hidden; padding: 12px 10px 0 14px; background: var(--white); }
.pos-right { background: var(--white); border-left: 1px solid var(--gray-200); display: flex; flex-direction: column; overflow: hidden; }

/* Toolbar — buscador + acciones integradas */
.pos-toolbar { margin-bottom: 10px; position: relative; }
.search-box-wrap {
    position: relative; display: flex; align-items: center;
    border: 2px solid var(--gray-200); border-radius: 10px;
    background: var(--white); transition: border-color 0.15s;
}
.search-box-wrap:focus-within { border-color: var(--primary-light); }
.search-box-wrap input {
    flex: 1; padding: 10px 8px 10px 34px;
    border: none; background: transparent;
    font-size: 0.88rem; outline: none;
}
.search-icon { position: absolute; left: 10px; font-size: 0.95rem; color: var(--gray-400); pointer-events: none; }
.search-btns { display: flex; gap: 4px; padding-right: 6px; flex-shrink: 0; align-items: center; }
.search-scan-btn {
    background: var(--primary-light); color: var(--white);
    border: none; border-radius: 6px; padding: 5px 8px;
    font-size: 0.95rem; cursor: pointer; line-height: 1;
}
.search-scan-btn:hover { background: var(--primary); }
.search-voice-btn {
    background: var(--gray-100); color: var(--gray-700);
    border: 1px solid var(--gray-200); border-radius: 6px;
    padding: 5px 8px; font-size: 0.95rem; cursor: pointer; line-height: 1;
}
.search-voice-btn:hover { background: var(--gray-200); }
.search-voice-btn.listening { background: var(--danger); border-color: var(--danger); color: var(--white); animation: pulse 1s infinite; }
.search-action-btn {
    background: none; color: var(--gray-500);
    border: 1px solid var(--gray-200); border-radius: 6px;
    padding: 5px 7px; font-size: 0.88rem; cursor: pointer; line-height: 1;
}
.search-action-btn:hover { background: var(--gray-100); color: var(--gray-700); }
.voice-status { display: block; font-size: 0.76rem; color: var(--primary); padding: 2px 2px 0; min-height: 0; }

.categories-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cat-btn { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--gray-200); background: var(--white); font-size: 0.8rem; cursor: pointer; font-weight: 500; color: var(--gray-600); }
.cat-btn.active { background: var(--primary); color: var(--white); border-color: var(--primary); }
.cat-btn:hover:not(.active) { background: var(--gray-100); }
.product-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; padding-bottom: 8px; }

/* ===== INVOICE TABLE (POS left panel) ===== */
.invoice-wrap { flex: 1; overflow-y: auto; }
.invoice-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.invoice-table thead { position: sticky; top: 0; z-index: 1; }
.invoice-table th {
    background: var(--primary-dark); color: var(--white);
    padding: 9px 10px; text-align: left; font-size: 0.75rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    white-space: nowrap;
}
.invoice-table td { padding: 8px 10px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.invoice-table tr:hover td { background: #f0f7ff; }
.col-cant { width: 72px; }
.col-code { width: 100px; font-family: monospace; font-size: 0.78rem; color: var(--gray-500); }
.col-name { }
.col-price { width: 100px; text-align: right; white-space: nowrap; }
.col-total { width: 110px; text-align: right; white-space: nowrap; }
.col-del { width: 32px; }
.qty-input {
    width: 64px; padding: 5px 6px; border: 1px solid var(--gray-200);
    border-radius: 6px; font-size: 0.875rem; text-align: center;
    font-weight: 600; color: var(--primary);
}
.qty-input:focus { outline: none; border-color: var(--primary-light); background: #eff6ff; }
.invoice-row.row-selected td { background: #dbeafe !important; }
.invoice-row { cursor: pointer; }
.btn-del-row {
    background: none; border: none; cursor: pointer; color: var(--gray-300);
    font-size: 0.8rem; padding: 4px; border-radius: 4px; line-height: 1;
}
.btn-del-row:hover { background: #fee2e2; color: var(--danger); }
.invoice-footer { border-top: 2px solid var(--gray-200); padding: 12px 14px; background: var(--white); }
.invoice-empty-msg { text-align: center; color: var(--gray-400); font-size: 0.875rem; padding: 20px 0; }
.invoice-totals { display: flex; flex-direction: column; gap: 4px; max-width: 360px; margin-left: auto; }
.inv-total-row { display: flex; justify-content: space-between; font-size: 0.875rem; color: var(--gray-600); }
.inv-grand-total { font-size: 1.2rem; font-weight: 800; color: var(--gray-900); padding-top: 6px; border-top: 2px solid var(--gray-300); margin-top: 2px; }

/* Search dropdown */
.search-dropdown {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: 0 0 10px 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    max-height: 280px; overflow-y: auto;
}
.dropdown-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    cursor: pointer; border-bottom: 1px solid var(--gray-100);
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: #eff6ff; }
.drop-name { flex: 1; font-weight: 500; font-size: 0.875rem; }
.drop-code { font-family: monospace; font-size: 0.75rem; color: var(--gray-400); }
.drop-price { font-weight: 700; color: var(--primary); white-space: nowrap; }

/* Payment summary panel */
.payment-summary {
    padding: 16px; background: var(--primary-dark); color: var(--white); text-align: center;
}
.summary-items-count { font-size: 0.8rem; color: #93c5fd; margin-bottom: 4px; }
.summary-total { font-size: 2rem; font-weight: 800; }

/* Receipt table for printing */
.receipt-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; margin-bottom: 8px; }
.receipt-table th { border-bottom: 1px solid #000; padding: 3px 4px; text-align: left; font-size: 0.72rem; }
.receipt-th-name { width: 40%; }
.receipt-table td { padding: 3px 4px; vertical-align: top; }
.receipt-store-name { font-size: 1rem; font-weight: 700; }
.receipt-grand-total { font-weight: 800; font-size: 1rem; border-top: 1px solid #000; padding-top: 4px; margin-top: 4px; }

/* Voice bar at bottom of cart */
.cart-voice-bar {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 16px; border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}
.btn-voice-big {
    width: 68px; height: 68px; border-radius: 50%;
    background: var(--primary-light); color: var(--white);
    border: none; cursor: pointer; font-size: 1.6rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(59,130,246,0.35);
}
.btn-voice-big:hover { background: var(--primary); transform: scale(1.06); }
.btn-voice-big.listening { background: var(--danger); animation: pulse 1s infinite; }
.voice-hint { font-size: 0.8rem; color: var(--gray-500); }

/* ===== BARRA INFERIOR POS (tickets + limpiar) ===== */
.pos-bottom-bar {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 10px; border-top: 2px solid var(--gray-200);
    background: var(--gray-50); flex-shrink: 0; min-height: 46px;
}
.pos-bottom-bar .ticket-tabs { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; }

/* ===== PANEL DERECHO POS ===== */
.pos-right-content { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.pos-voice-area {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 16px 14px; border-top: 1px solid var(--gray-200);
}
.pos-voice-area .voice-status { font-size: 0.75rem; color: var(--gray-500); text-align: center; }
.pos-right > .btn-today-sales {
    border-radius: 0; border-top: 1px solid var(--gray-200);
    width: 100%; padding: 11px; font-size: 0.8rem;
    background: var(--gray-50); color: var(--gray-600);
}
.pos-right > .btn-today-sales:hover { background: var(--gray-100); color: var(--primary); }
.ticket-tab {
    display: flex; align-items: center; gap: 5px;
    padding: 5px 10px; border-radius: 8px; cursor: pointer;
    background: var(--white); border: 1.5px solid var(--gray-300);
    font-size: 0.78rem; font-weight: 500; color: var(--gray-600);
    transition: all 0.15s; user-select: none;
}
.ticket-tab:hover { border-color: var(--primary-light); color: var(--primary); }
.ticket-tab.active {
    background: var(--primary); border-color: var(--primary);
    color: var(--white); font-weight: 600;
}
.ticket-tab-label { pointer-events: none; }
.ticket-tab-close {
    background: none; border: none; cursor: pointer;
    font-size: 0.95rem; line-height: 1; padding: 0 2px;
    color: inherit; opacity: 0.7; pointer-events: all;
}
.ticket-tab-close:hover { opacity: 1; }
.btn-new-ticket {
    width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
    background: var(--primary-light); color: var(--white);
    border: none; font-size: 1.3rem; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.btn-new-ticket:hover { background: var(--primary); }

.btn-voice-product { padding: 10px 20px; background: var(--primary-light); color: var(--white); border: none; border-radius: 8px; cursor: pointer; font-size: 1rem; font-weight: 600; }
.btn-voice-product:hover { background: var(--primary); }
.btn-voice-product:disabled { opacity: 0.6; cursor: not-allowed; }
.voice-product-hint { padding: 6px 16px; background: #eff6ff; border-bottom: 1px solid #bfdbfe; font-size: 0.78rem; color: var(--primary); }
.product-tile { background: var(--white); border-radius: 10px; border: 2px solid var(--gray-200); padding: 12px 8px; cursor: pointer; text-align: center; transition: all 0.15s; position: relative; }
.product-tile:hover:not(.out-of-stock) { border-color: var(--primary-light); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(59,130,246,0.15); }
.product-tile.in-cart { border-color: var(--success); background: #f0fdf4; }
.product-tile.out-of-stock { opacity: 0.45; cursor: not-allowed; }
.product-emoji { font-size: 2rem; margin-bottom: 6px; }
.product-tile-name { font-size: 0.75rem; font-weight: 600; color: var(--gray-700); line-height: 1.3; margin-bottom: 4px; }
.product-tile-price { font-size: 0.85rem; font-weight: 700; color: var(--primary); }
.product-stock { font-size: 0.68rem; margin-top: 2px; color: var(--gray-400); }
.stock-zero { color: var(--danger) !important; }
.cart-badge { position: absolute; top: -6px; right: -6px; background: var(--success); color: var(--white); width: 20px; height: 20px; border-radius: 50%; font-size: 0.7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* CART */
.cart-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--gray-200); }
.cart-header h2 { font-size: 1rem; font-weight: 700; }
.btn-clear-cart { background: none; border: none; cursor: pointer; font-size: 0.8rem; color: var(--gray-400); padding: 4px 8px; border-radius: 6px; }
.btn-clear-cart:hover { background: var(--gray-100); color: var(--danger); }
.cart-items { flex: 1; overflow-y: auto; padding: 10px; }
.cart-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--gray-50); border-radius: 8px; margin-bottom: 6px; border: 1px solid var(--gray-100); }
.cart-item-emoji { font-size: 1.2rem; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 0.72rem; color: var(--gray-500); }
.cart-item-controls { display: flex; align-items: center; gap: 4px; }
.qty-btn { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--gray-200); background: var(--white); cursor: pointer; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.qty-btn:hover { background: var(--gray-100); }
.qty-value { min-width: 22px; text-align: center; font-weight: 700; font-size: 0.85rem; }
.cart-item-subtotal { font-size: 0.8rem; font-weight: 700; color: var(--primary); flex-shrink: 0; }
.btn-remove-item { background: none; border: none; cursor: pointer; color: var(--gray-300); font-size: 0.75rem; padding: 2px; line-height: 1; flex-shrink: 0; }
.btn-remove-item:hover { color: var(--danger); }
.cart-empty { text-align: center; padding: 40px 16px; color: var(--gray-400); }
.cart-totals { padding: 12px 16px; border-top: 1px solid var(--gray-100); }
.total-row { display: flex; justify-content: space-between; font-size: 0.875rem; margin-bottom: 4px; color: var(--gray-600); }
.total-final { font-size: 1.1rem; font-weight: 700; color: var(--gray-800); padding-top: 8px; border-top: 2px solid var(--gray-200); margin-top: 4px; }
.cart-actions { padding: 12px 16px; border-top: 1px solid var(--gray-200); }
.payment-method label { font-size: 0.8rem; font-weight: 600; color: var(--gray-600); display: block; margin-bottom: 6px; }
.payment-buttons { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.pay-btn { width: 100%; padding: 9px 10px; border-radius: 8px; border: 2px solid var(--gray-200); background: var(--white); font-size: 0.82rem; cursor: pointer; font-weight: 600; color: var(--gray-600); text-align: left; }
.pay-btn.active { border-color: var(--primary-light); background: #eff6ff; color: var(--primary); }
.cash-input-wrap { margin-bottom: 10px; }
.cash-input-wrap label { font-size: 0.8rem; font-weight: 600; color: var(--gray-600); display: block; margin-bottom: 4px; }
.cash-input-wrap input { width: 100%; padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 0.875rem; }
.change-display { font-size: 0.85rem; font-weight: 600; margin-top: 4px; }
.btn-checkout { width: 100%; padding: 14px; background: var(--success); color: var(--white); border: none; border-radius: 10px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: all 0.15s; }
.btn-checkout:hover:not(:disabled) { background: #15803d; }
.btn-checkout:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-scan { padding: 10px 12px; background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: 8px; cursor: pointer; font-size: 0.8rem; font-weight: 600; color: var(--gray-700); white-space: nowrap; }
.btn-voice { padding: 13px 18px; background: var(--primary-light); color: var(--white); border: none; border-radius: 8px; cursor: pointer; font-size: 1.1rem; font-weight: 600; }
.btn-voice.listening { background: var(--danger); animation: pulse 1s infinite; }

/* ===== MODAL CANTIDAD AL DETAL ===== */
.qty-modal-box { max-width: 340px; }
.qty-modal-body { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px 24px; }
.qty-product-name { font-size: 1rem; font-weight: 700; color: var(--gray-800); text-align: center; }
.qty-stock-hint { font-size: 0.78rem; color: var(--gray-400); min-height: 16px; }
.qty-input-wrap { display: flex; align-items: center; gap: 10px; width: 100%; }
.qty-input-wrap input {
    flex: 1; padding: 12px 14px; font-size: 1.6rem; font-weight: 700; text-align: center;
    border: 2px solid var(--gray-200); border-radius: 10px; outline: none;
    transition: border-color 0.15s;
}
.qty-input-wrap input:focus { border-color: var(--primary-light); }
.qty-unit { font-size: 0.85rem; color: var(--gray-500); font-weight: 600; white-space: nowrap; }
.qty-shortcuts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.qty-short {
    padding: 7px 14px; border-radius: 8px; border: 1px solid var(--gray-200);
    background: var(--gray-50); font-size: 0.9rem; font-weight: 600;
    cursor: pointer; color: var(--gray-700); transition: all 0.12s;
}
.qty-short:hover { background: var(--primary-light); color: var(--white); border-color: var(--primary-light); }
.qty-ok-btn { width: 100%; padding: 12px; font-size: 1rem; }

/* ===== SCANNER ===== */
#scanner-video, #inv-scanner-video { width: 100%; border-radius: 8px; max-height: 300px; object-fit: cover; }
#scanner-area, #inv-scanner-area { position: relative; }
.scan-line { position: absolute; top: 50%; left: 0; right: 0; height: 2px; background: var(--danger); animation: scanMove 2s ease-in-out infinite; opacity: 0.7; }
@keyframes scanMove { 0%, 100% { top: 30%; } 50% { top: 70%; } }
.scan-tip { text-align: center; font-size: 0.8rem; color: var(--gray-500); margin-top: 10px; }

/* ===== MODALS ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--white); border-radius: 16px; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; }
.modal-lg { max-width: 800px; }
.modal-sm { max-width: 420px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--gray-200); }
.modal-header h3 { font-size: 1.05rem; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 1.1rem; color: var(--gray-400); padding: 4px; border-radius: 6px; }
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--gray-200); }
form { padding: 20px 24px; }

/* ===== RECEIPT ===== */
.receipt { font-family: 'Courier New', monospace; font-size: 0.82rem; max-width: 280px; margin: 0 auto; padding: 20px; border: 1px dashed var(--gray-300); border-radius: 4px; }
.receipt-header { text-align: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--gray-300); }
.receipt-header h3 { font-size: 1rem; font-weight: 700; }
.receipt-items { margin-bottom: 12px; border-bottom: 1px dashed var(--gray-300); padding-bottom: 8px; }
.receipt-item { display: flex; justify-content: space-between; margin-bottom: 4px; }
.receipt-totals { margin-bottom: 12px; }
.receipt-row { display: flex; justify-content: space-between; margin-bottom: 3px; }
.receipt-total { font-weight: 700; font-size: 1rem; border-top: 1px dashed var(--gray-300); padding-top: 6px; margin-top: 4px; }
.receipt-footer { text-align: center; font-size: 0.78rem; color: var(--gray-500); padding-top: 10px; border-top: 1px dashed var(--gray-300); }

/* ===== TOAST ===== */
.toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 20px; border-radius: 10px; font-size: 0.875rem; font-weight: 600; color: var(--white); background: var(--gray-800); transform: translateX(120%); transition: transform 0.3s ease; z-index: 9999; box-shadow: 0 8px 24px rgba(0,0,0,0.15); min-width: 220px; }
.toast.show { transform: translateX(0); }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }

/* ===== FORMS ===== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group-full { grid-column: 1 / -1; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--gray-600); margin-bottom: 5px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--gray-200); border-radius: 8px;
    font-size: 0.875rem; font-family: 'Inter', sans-serif; color: var(--gray-800); background: var(--white);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; cursor: pointer; }
.checkbox-label input[type=checkbox] { width: auto; accent-color: var(--primary); }
.input-with-btn { display: flex; gap: 6px; }
.input-with-btn input { flex: 1; }
.btn-inline-scan { padding: 9px 12px; background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: 8px; cursor: pointer; }
.field-hint { display: block; font-size: 0.75rem; color: var(--gray-400); margin-top: 4px; }

/* ===== INVENTORY MODULE ===== */
.filter-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.filter-bar select { padding: 7px 10px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 0.82rem; }
.search-box { position: relative; display: flex; align-items: center; flex: 1; min-width: 180px; }
.search-box .search-icon { position: absolute; left: 9px; font-size: 0.9rem; color: var(--gray-400); pointer-events: none; }
.search-box input { width: 100%; padding: 7px 10px 7px 30px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 0.82rem; outline: none; transition: border-color 0.15s; }
.search-box input:focus { border-color: var(--primary-light); }
.btn-voice-inv { padding: 9px 18px !important; font-size: 1rem !important; }
.inventory-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.stat-card { background: var(--white); border-radius: 10px; border: 1px solid var(--gray-200); padding: 8px 12px; }
.stat-card.warning { border-color: #fde68a; background: #fffbeb; }
.stat-card.danger { border-color: #fca5a5; background: #fef2f2; }
.stat-card.success { border-color: #86efac; background: #f0fdf4; }
.stat-card .stat-value { font-size: 1.1rem; font-weight: 700; color: var(--gray-800); }
.stat-card .stat-label { font-size: 0.7rem; color: var(--gray-500); margin-top: 1px; }
.table-container { background: var(--white); border-radius: 12px; border: 1px solid var(--gray-200); overflow: hidden; }


/* ===== FORMULARIO PRODUCTO COMPACTO (una sola pantalla) ===== */
.modal-product { max-width: 680px; max-height: 96vh; overflow: hidden; display: flex; flex-direction: column; }
.pf-header { padding: 12px 16px; flex-shrink: 0; }
.pf-header h3 { font-size: 0.95rem; }
.pf-form { display: flex; flex-direction: column; gap: 0; flex: 1; overflow-y: auto; padding: 0; }
.pf-row { display: grid; gap: 8px; padding: 8px 16px 0; }
.pf-row-1 { grid-template-columns: 2fr 1fr; }
.pf-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.pf-group { display: flex; flex-direction: column; gap: 3px; }
.pf-group label { font-size: 0.72rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.03em; }
.pf-group input, .pf-group select {
    padding: 6px 9px; border: 1px solid var(--gray-200); border-radius: 7px;
    font-size: 0.85rem; width: 100%; outline: none; transition: border-color 0.15s;
    background: var(--white); color: var(--gray-800);
}
.pf-group input:focus, .pf-group select:focus { border-color: var(--primary-light); box-shadow: 0 0 0 2px rgba(59,130,246,0.1); }
.pf-span2 { grid-column: span 2; }
.pf-emoji input { text-align: center; font-size: 1.2rem; }
.pf-checks {
    display: flex; gap: 20px; padding: 8px 16px;
    background: var(--gray-50); margin-top: 8px; border-top: 1px solid var(--gray-100);
}
.pf-checks .checkbox-label { font-size: 0.82rem; white-space: nowrap; }
.pf-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 10px 16px; border-top: 1px solid var(--gray-200); flex-shrink: 0;
}
.pf-footer .btn { padding: 7px 18px; font-size: 0.85rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.data-table th { padding: 7px 12px; text-align: left; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-500); background: var(--gray-50); border-bottom: 1px solid var(--gray-200); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.data-table td { padding: 7px 12px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.data-table tr:hover td { background: var(--gray-50); }
.data-table tr:last-child td { border-bottom: none; }
.row-inactive td { opacity: 0.5; }
.product-cell { display: flex; align-items: center; gap: 10px; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.code-chip { font-family: monospace; background: var(--gray-100); padding: 2px 8px; border-radius: 4px; font-size: 0.78rem; color: var(--gray-600); }
.stock-badge { display: inline-block; padding: 2px 10px; border-radius: 100px; font-size: 0.78rem; font-weight: 600; background: #dcfce7; color: #16a34a; }
.stock-badge.stock-zero { background: #fee2e2; color: #dc2626; }
.stock-badge.stock-low { background: #fef3c7; color: #d97706; }
.action-buttons { display: flex; gap: 4px; }
.btn-icon { padding: 6px 8px; background: var(--gray-100); border: none; border-radius: 6px; cursor: pointer; font-size: 0.85rem; }
.btn-icon:hover { background: var(--gray-200); }
.btn-icon.btn-danger:hover { background: #fee2e2; }
.text-right { text-align: right; }

/* OCR INVOICE */
.ocr-area { padding: 20px 24px; }
.upload-zone { border: 2px dashed var(--gray-300); border-radius: 12px; padding: 40px 20px; text-align: center; }
.ocr-product-row { background: var(--gray-50); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--gray-200); }
.ocr-product-details { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.8rem; color: var(--gray-600); margin-top: 4px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--gray-200); border-top-color: var(--primary-light); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== ORDERS / KANBAN ===== */
.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kanban-col { background: var(--gray-50); border-radius: 10px; padding: 12px; min-height: 400px; }
.kanban-col-header { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 10px; border-radius: 8px; margin-bottom: 12px; text-align: center; }
.kanban-col-header.pending { background: #dbeafe; color: #1d4ed8; }
.kanban-col-header.preparing { background: #fef3c7; color: #d97706; }
.kanban-col-header.ready { background: #dcfce7; color: #16a34a; }
.kanban-col-header.delivered { background: var(--gray-200); color: var(--gray-600); }
.kanban-card { background: var(--white); border-radius: 8px; padding: 12px; margin-bottom: 8px; border: 1px solid var(--gray-200); cursor: pointer; transition: box-shadow 0.15s; }
.kanban-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.kanban-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.kanban-card-items { font-size: 0.78rem; color: var(--gray-500); margin-bottom: 8px; }
.kanban-card-footer { display: flex; justify-content: space-between; align-items: center; }
.kanban-actions { display: flex; gap: 4px; }
.kanban-empty { text-align: center; color: var(--gray-400); font-size: 0.82rem; padding: 20px; }
.time-chip { font-size: 0.72rem; background: var(--gray-100); padding: 2px 8px; border-radius: 100px; color: var(--gray-500); }
.btn-whatsapp { background: #25d366; color: var(--white); }
.btn-whatsapp:hover { background: #1da851; }
.btn-sm { padding: 5px 10px; font-size: 0.75rem; border-radius: 6px; border: none; cursor: pointer; font-weight: 600; }

/* Order form */
.order-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; height: 500px; overflow: hidden; }
.order-products-panel { padding: 16px; border-right: 1px solid var(--gray-200); overflow-y: auto; }
.order-details-panel { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.order-product-list { display: flex; flex-direction: column; gap: 4px; }
.order-product-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: var(--gray-50); border-radius: 8px; border: 1px solid var(--gray-200); font-size: 0.85rem; }
.order-cart { background: var(--gray-50); border-radius: 8px; padding: 10px; border: 1px solid var(--gray-200); flex: 1; overflow-y: auto; min-height: 100px; }
.order-total-bar { background: var(--primary); color: var(--white); border-radius: 8px; padding: 10px 14px; }

/* ===== DELIVERY MODULE ===== */
.delivery-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.delivery-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.delivery-section h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--gray-200); }
.delivery-card { background: var(--white); border-radius: 10px; border: 1px solid var(--gray-200); padding: 14px; margin-bottom: 10px; }
.delivery-card-top { display: flex; justify-content: space-between; margin-bottom: 8px; }
.delivery-items { font-size: 0.8rem; color: var(--gray-500); margin-bottom: 8px; }
.delivery-notes { font-size: 0.78rem; color: var(--gray-500); background: #fffbeb; border-radius: 6px; padding: 6px 8px; margin-bottom: 8px; }
.delivery-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== REPORTS MODULE ===== */
.report-tabs { display: flex; gap: 4px; margin-bottom: 20px; background: var(--gray-100); padding: 4px; border-radius: 10px; width: fit-content; }
.report-tab { padding: 8px 18px; border-radius: 8px; border: none; background: none; cursor: pointer; font-size: 0.875rem; font-weight: 500; color: var(--gray-600); }
.report-tab.active { background: var(--white); color: var(--gray-800); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.report-content { }
.report-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.summary-card { background: var(--white); border-radius: 12px; border: 1px solid var(--gray-200); padding: 20px; text-align: center; }
.summary-card.primary { border-color: #93c5fd; background: #eff6ff; }
.summary-card.success { border-color: #86efac; background: #f0fdf4; }
.summary-icon { font-size: 2rem; margin-bottom: 8px; }
.summary-value { font-size: 1.4rem; font-weight: 700; color: var(--gray-800); margin-bottom: 4px; }
.summary-label { font-size: 0.78rem; color: var(--gray-500); }
.report-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.report-card { background: var(--white); border-radius: 12px; border: 1px solid var(--gray-200); padding: 20px; }
.report-card h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 16px; color: var(--gray-700); }
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 160px; overflow-x: auto; padding: 0 4px; }
.bar-group { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 36px; }
.bar-fill { background: var(--primary-light); border-radius: 4px 4px 0 0; width: 28px; transition: height 0.4s ease; min-height: 2px; cursor: pointer; }
.bar-fill:hover { background: var(--primary); }
.bar-label { font-size: 0.62rem; color: var(--gray-400); text-align: center; white-space: nowrap; }
.payment-breakdown { display: flex; flex-direction: column; gap: 12px; }
.breakdown-row { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }
.breakdown-row > span:first-child { width: 130px; flex-shrink: 0; }
.breakdown-bar-wrap { flex: 1; background: var(--gray-100); border-radius: 100px; height: 8px; }
.breakdown-bar { background: var(--primary-light); border-radius: 100px; height: 8px; transition: width 0.4s ease; }
.rank-badge { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-size: 0.75rem; font-weight: 700; background: var(--gray-200); color: var(--gray-600); }
.rank-badge.rank-1 { background: #fbbf24; color: var(--white); }
.rank-badge.rank-2 { background: var(--gray-400); color: var(--white); }
.rank-badge.rank-3 { background: #d97706; color: var(--white); }
.pay-chip { font-size: 0.78rem; background: var(--gray-100); padding: 2px 8px; border-radius: 100px; }
.inv-report-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.inv-values { border-top: 1px solid var(--gray-200); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.inv-value-row { display: flex; justify-content: space-between; font-size: 0.875rem; }
.alert-list { display: flex; flex-direction: column; gap: 6px; }
.alert-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 8px; font-size: 0.875rem; }
.alert-item.danger { background: #fee2e2; }
.alert-item.warning { background: #fef3c7; }

/* ===== LOGIN SCREEN ===== */
.login-screen { min-height: 100vh; background: var(--primary-dark); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { background: var(--white); border-radius: 20px; padding: 36px 32px; width: 100%; max-width: 480px; text-align: center; box-shadow: 0 24px 64px rgba(0,0,0,0.3); }
.login-logo { font-size: 3.5rem; margin-bottom: 8px; }
.login-store { font-size: 1.3rem; font-weight: 700; color: var(--gray-800); margin-bottom: 4px; }
.login-title { font-size: 0.9rem; color: var(--gray-500); margin-bottom: 24px; }
.cashier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.cashier-card { background: var(--gray-50); border: 2px solid var(--gray-200); border-radius: 12px; padding: 16px 10px; cursor: pointer; transition: all 0.15s; }
.cashier-card:hover { border-color: var(--primary-light); background: #eff6ff; transform: translateY(-2px); }
.cashier-card-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--primary-light); color: var(--white); font-size: 1.4rem; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; }
.cashier-card-name { font-weight: 600; font-size: 0.875rem; color: var(--gray-800); }
.cashier-card-role { font-size: 0.72rem; color: var(--gray-500); margin-top: 2px; }
.pin-section { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pin-user { font-size: 1rem; font-weight: 600; color: var(--gray-700); }
.pin-dots { display: flex; gap: 12px; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--gray-300); transition: all 0.15s; }
.pin-dots span.filled { background: var(--primary-light); border-color: var(--primary-light); }
.pin-error { color: var(--danger); font-size: 0.82rem; font-weight: 600; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 220px; }
.pin-key { padding: 16px; border-radius: 10px; border: 1px solid var(--gray-200); background: var(--white); font-size: 1.2rem; font-weight: 600; cursor: pointer; transition: all 0.12s; color: var(--gray-800); }
.pin-key:hover { background: var(--gray-100); }
.pin-key:active { transform: scale(0.95); }
.pin-key-ok { background: var(--success); color: var(--white); border-color: var(--success); }
.pin-key-ok:hover { background: #15803d; }
.pin-key-del { color: var(--danger); }
.btn-back-login { background: none; border: none; color: var(--gray-400); cursor: pointer; font-size: 0.82rem; padding: 4px 8px; }
.btn-back-login:hover { color: var(--gray-700); }
.login-subtitle { font-size: 0.82rem; color: var(--gray-400); margin-bottom: 24px; line-height: 1.5; }

/* ===== ADMIN SETUP (primera vez) ===== */
.setup-box { max-width: 420px; animation: fadeSlideUp 0.4s ease; }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.setup-header { margin-bottom: 28px; }
.setup-step { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.setup-label { font-size: 0.82rem; font-weight: 600; color: var(--gray-600); text-align: center; align-self: flex-start; }
.setup-input {
    width: 100%; padding: 12px 16px;
    border: 2px solid var(--gray-200); border-radius: 10px;
    font-size: 1rem; font-family: 'Inter', sans-serif;
    color: var(--gray-800); background: var(--white);
    transition: border-color 0.15s, box-shadow 0.15s;
    text-align: center;
}
.setup-input:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
.setup-input.input-error { border-color: var(--danger); animation: shake 0.3s ease; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }


/* ===== CAJERO EN SIDEBAR ===== */
.cashier-chip { display: flex; align-items: center; gap: 7px; padding: 7px 10px; background: rgba(255,255,255,0.08); border-radius: 8px; margin-bottom: 8px; }
.cashier-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--primary-light); color: var(--white); font-size: 0.78rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cashier-name { flex: 1; font-size: 0.78rem; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-logout { background: none; border: none; color: #93c5fd; cursor: pointer; font-size: 1rem; padding: 2px; line-height: 1; flex-shrink: 0; }
.btn-logout:hover { color: var(--white); }

/* ===== CAJEROS EN SETTINGS ===== */
.settings-card-full { grid-column: 1 / -1; }
.cashier-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px; background: var(--gray-50); border-radius: 10px; border: 1px solid var(--gray-200); margin-bottom: 8px; }
.cashier-row-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-light); color: var(--white); font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cashier-perms { font-size: 0.72rem; color: var(--gray-400); margin-top: 3px; }

/* ===== SETTINGS ===== */
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.settings-card { background: var(--white); border-radius: 12px; border: 1px solid var(--gray-200); padding: 24px; }
.settings-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 16px; color: var(--gray-800); }
.settings-card form { padding: 0; }
.data-actions { display: flex; flex-direction: column; gap: 12px; }
.data-action-item { display: flex; align-items: center; justify-content: space-between; padding: 12px; background: var(--gray-50); border-radius: 8px; border: 1px solid var(--gray-200); gap: 12px; }
.data-action-item.danger-zone { border-color: #fca5a5; background: #fef2f2; }
.about-info { text-align: center; padding: 20px 0; }
.app-logo-big { font-size: 4rem; margin-bottom: 10px; }
.version-chip { display: inline-block; background: var(--gray-100); color: var(--gray-600); padding: 4px 12px; border-radius: 100px; font-size: 0.8rem; font-weight: 600; margin: 8px 0 16px; }
.about-features { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; text-align: left; max-width: 280px; margin: 0 auto; }
.feature-item { font-size: 0.82rem; color: var(--gray-700); }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray-400); }
.empty-state p { margin-top: 8px; }

/* ===== UTILS ===== */
.hidden { display: none !important; }
.text-sm { font-size: 0.875rem; }
.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.text-center { text-align: center; }

/* ===== REPRINT BUTTON (sidebar) ===== */
.btn-reprint {
    display: block; width: 100%; padding: 7px 10px; margin-bottom: 8px;
    background: rgba(255,255,255,0.08); color: #93c5fd;
    border: 1px solid rgba(255,255,255,0.15); border-radius: 8px;
    font-size: 0.78rem; font-weight: 600; cursor: pointer; text-align: left;
    transition: all 0.15s;
}
.btn-reprint:hover { background: rgba(255,255,255,0.15); color: var(--white); }

/* ===== CIERRE DE CAJA BUTTON (sidebar) ===== */
.btn-cierre {
    display: block; width: 100%; padding: 7px 10px; margin-bottom: 8px;
    background: rgba(220,38,38,0.18); color: #fca5a5;
    border: 1px solid rgba(220,38,38,0.35); border-radius: 8px;
    font-size: 0.78rem; font-weight: 600; cursor: pointer; text-align: left;
    transition: all 0.15s;
}
.btn-cierre:hover { background: rgba(220,38,38,0.32); color: var(--white); }

/* ===== APERTURA DE CAJA ===== */
.login-subtitle { font-size: 0.88rem; color: var(--gray-500); margin-bottom: 4px; }
.opening-form { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; margin-top: 8px; }
.opening-label { font-size: 0.9rem; color: var(--gray-600); text-align: center; max-width: 280px; line-height: 1.4; }
.opening-input {
    width: 200px; padding: 14px 16px; font-size: 1.5rem; text-align: center; font-weight: 700;
    border: 2px solid var(--gray-200); border-radius: 12px; outline: none;
    transition: border-color 0.15s;
}
.opening-input:focus { border-color: var(--primary-light); }
.btn-opening-ok {
    padding: 12px 32px; background: var(--success); color: var(--white);
    border: none; border-radius: 10px; font-size: 1rem; font-weight: 700; cursor: pointer;
    transition: all 0.15s;
}
.btn-opening-ok:hover { background: #15803d; transform: translateY(-1px); }

/* ===== MODAL CIERRE DE CAJA ===== */
.cierre-overlay { z-index: 2000; }
.cierre-modal {
    max-width: 560px; width: 95%; max-height: 90vh; overflow-y: auto;
    padding: 0; border-radius: 16px;
}
.cierre-header {
    background: var(--primary-dark); color: var(--white);
    padding: 20px 24px; border-radius: 16px 16px 0 0;
}
.cierre-header h2 { font-size: 1.2rem; margin-bottom: 4px; }
.cierre-date { font-size: 0.82rem; color: #93c5fd; text-transform: capitalize; }
.cierre-cashier { font-size: 0.85rem; color: #bfdbfe; margin-top: 2px; }
.cierre-section { padding: 16px 24px; border-bottom: 1px solid var(--gray-100); }
.cierre-section h3 { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-500); margin-bottom: 10px; }
.cierre-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.cierre-table th { padding: 5px 8px; text-align: left; border-bottom: 2px solid var(--gray-200); color: var(--gray-600); font-weight: 600; font-size: 0.78rem; }
.cierre-table td { padding: 5px 8px; border-bottom: 1px solid var(--gray-100); }
.cierre-table .right { text-align: right; font-variant-numeric: tabular-nums; }
.cierre-table tr:last-child td { border-bottom: none; }
.cierre-empty { color: var(--gray-400); font-size: 0.85rem; text-align: center; padding: 8px 0; }
.cierre-balance { background: var(--gray-50); }
.cierre-balance-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: 0.9rem; color: var(--gray-700); }
.cierre-grand { font-weight: 700; font-size: 1.1rem; color: var(--primary-dark); }
.cierre-expected { font-weight: 700; color: var(--success); font-size: 0.95rem; margin-top: 4px; padding-top: 8px; border-top: 2px solid var(--gray-200); }
.cierre-actions { display: flex; gap: 10px; padding: 16px 24px; justify-content: flex-end; }

/* ===== POS QUICK BUTTONS ===== */
.pos-quick-btns { display: flex; gap: 8px; margin-bottom: 10px; }
.btn-quick {
    flex: 1; padding: 8px 12px; background: var(--white);
    border: 1.5px solid var(--gray-200); border-radius: 8px;
    font-size: 0.82rem; font-weight: 600; color: var(--gray-700);
    cursor: pointer; transition: all 0.15s; text-align: center;
}
.btn-quick:hover { border-color: var(--primary-light); color: var(--primary); background: #eff6ff; }

/* ===== TODAY SALES BUTTON (cart header) ===== */
.btn-today-sales {
    padding: 5px 10px; background: var(--primary-light); color: var(--white);
    border: none; border-radius: 7px; font-size: 0.85rem; cursor: pointer;
    font-weight: 600; transition: background 0.15s;
}
.btn-today-sales:hover { background: var(--primary); }

/* ===== SALE LIST ITEMS (ventas del día) ===== */
.sale-list-item {
    padding: 10px 14px; background: var(--white);
    border: 1px solid var(--gray-200); border-radius: 8px;
    cursor: pointer; transition: all 0.15s;
}
.sale-list-item:hover { border-color: var(--primary-light); background: #f0f7ff; }
.sale-annulled {
    opacity: 0.55; cursor: default;
    border-color: var(--gray-200) !important; background: var(--gray-50) !important;
    text-decoration: line-through;
}
.sale-annulled:hover { border-color: var(--gray-200) !important; background: var(--gray-50) !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .pos-layout { grid-template-columns: 1fr; grid-template-rows: auto auto; }
    .pos-right { max-height: 340px; border-left: none; border-top: 2px solid var(--gray-200); }
    .kanban-board { grid-template-columns: repeat(2, 1fr); }
    .inventory-stats { grid-template-columns: repeat(2, 1fr); }
    .settings-grid { grid-template-columns: 1fr; }
    .delivery-board { grid-template-columns: 1fr; }
    .report-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .report-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .sidebar { width: 52px; }
    .brand-text, .nav-label, .kbd-hint { display: none; }
    .nav-fkey { min-width: 20px; font-size: 0.58rem; }
    .nav-item { padding: 12px 8px; justify-content: center; }
    .module-layout { padding: 12px; }
    .module-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .kanban-board { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .inventory-stats { grid-template-columns: 1fr 1fr; }
    .report-summary-grid { grid-template-columns: 1fr 1fr; }
    .delivery-stats { grid-template-columns: 1fr 1fr; }
    .pos-layout { grid-template-columns: 1fr; }

    /* Inventario: ocultar columnas secundarias en móvil */
    .data-table th:nth-child(2),
    .data-table td:nth-child(2),
    .data-table th:nth-child(3),
    .data-table td:nth-child(3),
    .data-table th:nth-child(4),
    .data-table td:nth-child(4),
    .data-table th:nth-child(7),
    .data-table td:nth-child(7) { display: none; }

    /* Fila toca para editar */
    .data-table tbody tr { cursor: pointer; }
    .data-table tbody tr:active td { background: #dbeafe; }

    /* Botones de acción más grandes para touch */
    .action-buttons { gap: 8px; }
    .btn-icon { padding: 10px 12px; font-size: 1rem; }

    /* Formulario producto en móvil: una columna */
    .pf-row-1, .pf-row-3 { grid-template-columns: 1fr; }
    .pf-span2 { grid-column: span 1; }
    .pf-checks { flex-wrap: wrap; gap: 12px; }
}
