:root {
    --bg: #110e0c;
    --bg-2: #1b1613;
    --bg-3: #261f1a;
    --ink: #f6efe6;
    --muted: #b7a89a;
    --line: rgba(245, 165, 36, 0.22);
    --gold: #f5a524;
    --gold-2: #ffd27a;
    --tomato: #ff6b4a;
    --ok: #3dd68c;
    --danger: #ff5d73;
    --info: #8eb6ff;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    --sidebar: 272px;
    --serif: "Fraunces", Georgia, serif;
    --sans: "Manrope", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: var(--sans);
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(245, 165, 36, 0.16), transparent 55%),
        radial-gradient(900px 400px at 100% 0%, rgba(255, 107, 74, 0.12), transparent 50%),
        var(--bg);
    color: var(--ink);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }

.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar);
    flex: 0 0 var(--sidebar);
    background: rgba(18, 14, 12, 0.92);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 22px 18px 14px;
    text-decoration: none;
}
.brand img { width: 42px; height: 42px; }
.brand strong { font-family: var(--serif); font-size: 1.35rem; letter-spacing: -0.03em; }
.brand strong span { color: var(--gold); }
.brand small { display: block; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.65rem; }
/* Tarjeta de usuario en sidebar */
.who-card {
    margin: 0 12px 14px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    display: flex;
    align-items: center;
    gap: 11px;
}
.who-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--gold), #ff6b4a);
    color: #1a1005;
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(245,165,36,0.25);
}
.who-info { min-width: 0; flex: 1; }
.who-info b {
    display: block;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.who-role {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.74rem;
}
.who-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 6px var(--ok);
    display: inline-block;
}

/* Navegación del sidebar */
.nav {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb { background: rgba(245, 165, 36, 0.2); border-radius: 4px; }

/* Enlace directo (Salón) */
.nav-direct {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 650;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.nav-direct:hover {
    background: rgba(245, 165, 36, 0.1);
    color: var(--gold-2);
    border-color: rgba(245, 165, 36, 0.2);
}
.nav-direct.is-active {
    background: linear-gradient(90deg, rgba(245, 165, 36, 0.18), rgba(245, 165, 36, 0.05));
    color: var(--gold-2);
    border: 1px solid rgba(245, 165, 36, 0.35);
    box-shadow: 0 2px 10px rgba(245, 165, 36, 0.1);
}

/* Grupos desplegables */
.nav-group {
    margin-bottom: 2px;
}
.nav-group-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    color: #cfc2b4;
    font-size: 0.86rem;
    font-weight: 600;
    transition: all 0.18s ease;
    user-select: none;
}
.nav-group-summary::-webkit-details-marker { display: none; }
.nav-group-summary:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink);
}
.nav-group.is-group-active > .nav-group-summary {
    color: var(--gold-2);
}
.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    flex-shrink: 0;
    opacity: 0.85;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-group-summary:hover .nav-icon,
.nav-direct:hover .nav-icon {
    opacity: 1;
    transform: scale(1.08);
}
.nav-group-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-chevron {
    color: var(--muted);
    opacity: 0.6;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}
.nav-group[open] > .nav-group-summary .nav-chevron {
    transform: rotate(90deg);
    opacity: 0.9;
    color: var(--gold);
}

/* Submenús */
.nav-sub {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0 6px 14px;
    margin: 2px 0 4px 18px;
    border-left: 1.5px solid rgba(245, 165, 36, 0.18);
    animation: navSubSlide 0.2s ease;
}
@keyframes navSubSlide {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.nav-sub a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    font-size: 0.82rem;
    color: #b7a89a;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s ease;
}
.nav-sub a:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink);
    padding-left: 12px;
}
.nav-sub a.is-active {
    background: rgba(245, 165, 36, 0.14);
    color: var(--gold-2);
    font-weight: 650;
    border: 1px solid rgba(245, 165, 36, 0.28);
}
.nav-sub a.is-active span:first-child::before {
    content: "•";
    color: var(--gold);
    margin-right: 6px;
    font-size: 1.1rem;
    line-height: 0;
    vertical-align: middle;
}
.nav-action-tag {
    font-size: 0.68rem;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(245, 165, 36, 0.15);
    color: var(--gold-2);
    border: 1px solid rgba(245, 165, 36, 0.3);
    font-weight: 600;
}
.side-foot { margin-top: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid rgba(255,255,255,0.05); }
.main { flex: 1; min-width: 0; }
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 28px 0; gap: 16px;
}
.caja-pill, .ghost-link {
    border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px;
    text-decoration: none; color: var(--gold-2); background: rgba(245,165,36,0.08);
}
.caja-pill.is-closed { color: var(--tomato); background: rgba(255,107,74,0.08); }
.content { padding: 18px 28px 48px; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 18px; }
.eyebrow { margin: 0 0 4px; color: var(--gold); letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.72rem; }
h1, h2, h3 { font-family: var(--serif); font-weight: 520; letter-spacing: -0.03em; margin: 0; }
h1 { font-size: 2.1rem; }
.sub { color: var(--muted); margin: 6px 0 0; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi, .card, .mesa, .pedido {
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}
.kpi { padding: 16px 18px; }
.kpi span { color: var(--muted); font-size: 0.85rem; }
.kpi strong { display: block; margin-top: 6px; font-family: var(--serif); font-size: 1.7rem; }
.sala { display: grid; grid-template-columns: 1.6fr 0.9fr; gap: 16px; }
.panel { min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.mesas { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.mesa { padding: 14px; text-decoration: none; display: block; min-height: 138px; }
.mesa header { display: flex; justify-content: space-between; align-items: center; }
.mesa .num { font-family: var(--serif); font-size: 1.7rem; }
.mesa footer { margin-top: 18px; display: flex; justify-content: space-between; color: var(--muted); font-size: 0.85rem; }
.mesa.is-ocupada { border-color: rgba(245, 165, 36, 0.7); }
.mesa.is-libre { opacity: 0.82; }
.badge { border-radius: 999px; padding: 3px 8px; font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; }
.badge.libre { background: rgba(255,255,255,0.06); color: var(--muted); }
.badge.ocupada { background: rgba(245,165,36,0.18); color: var(--gold-2); }
.badge.pendiente { background: rgba(255,107,74,0.16); color: #ffb199; }
.badge.aceptado, .badge.ok, .badge.completada, .badge.emitida, .badge.abierta, .badge.recibida { background: rgba(61,214,140,0.15); color: var(--ok); }
.badge.rechazado, .badge.danger, .badge.cerrada { background: rgba(255,93,115,0.15); color: var(--danger); }
.badge.comida { background: rgba(255,107,74,0.14); color: #ffb199; }
.badge.bebida { background: rgba(142,182,255,0.14); color: var(--info); }

.pedidos { display: flex; flex-direction: column; gap: 12px; }
.pedido { padding: 14px; }
.pedido header { display: flex; justify-content: space-between; gap: 8px; }
.pedido ul { margin: 10px 0; padding-left: 18px; color: var(--muted); }
.pedido .acciones { display: flex; gap: 8px; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 18px; }

.btn, button.btn, a.btn {
    border: 0; cursor: pointer; border-radius: 999px; padding: 10px 16px;
    text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1c08; font-weight: 750; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: rgba(255,93,115,0.12); color: #ffd0d6; border: 1px solid rgba(255,93,115,0.35); }
.btn-sm { padding: 7px 12px; font-size: 0.88rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.tabla-wrap, .table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 18px; width: 100%; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: middle; }
th { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 650; }
tr:hover td { background: rgba(255,255,255,0.02); }
.right { text-align: right; }
.low { color: var(--danger); font-weight: 700; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters a { text-decoration: none; color: var(--muted); border: 1px solid transparent; padding: 6px 10px; border-radius: 999px; }
.filters a.is-active, .filters a:hover { border-color: var(--line); color: var(--gold-2); }
.search { display: flex; gap: 8px; }
.search input, .field input, .field select, .field textarea {
    width: 100%; background: #140f0d; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { color: var(--muted); font-size: 0.86rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1.4fr 0.8fr 0.8fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0 14px; color: var(--muted); }
.form-card, .sheet { max-width: 920px; }
.sheet { padding: 22px; }
.alerta {
    background: linear-gradient(135deg, rgba(255,93,115,0.14) 0%, rgba(255,93,115,0.06) 100%);
    color: #ffe0e4;
    border: 1px solid rgba(255,93,115,0.35);
    border-left: 4px solid var(--danger);
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: 0.92rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 18px rgba(255,93,115,0.08);
}
.alerta::before {
    content: "⚠️";
    font-size: 1.15rem;
    line-height: 1;
}
.alerta-exito {
    background: linear-gradient(135deg, rgba(61,214,140,0.14) 0%, rgba(61,214,140,0.06) 100%);
    color: #e2fced;
    border: 1px solid rgba(61,214,140,0.35);
    border-left: 4px solid var(--ok);
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: 0.92rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 18px rgba(61,214,140,0.08);
}
.alerta-exito::before {
    content: "✅";
    font-size: 1.15rem;
    line-height: 1;
}
.nota { color: var(--muted); font-size: 0.9rem; }

.lineas-body { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.linea { display: grid; grid-template-columns: 1.6fr 90px 140px 120px 42px; gap: 8px; align-items: center; }
.linea input, .linea select { width: 100%; background: #140f0d; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.lineas-total { display: flex; justify-content: flex-end; gap: 12px; align-items: baseline; margin-top: 8px; font-size: 1.2rem; }
.persona { margin-bottom: 16px; }
.persona h3 { margin-bottom: 8px; }

.modal-back {
    position: fixed; inset: 0; z-index: 40;
    background: rgba(8, 6, 5, 0.72);
    backdrop-filter: blur(10px);
    display: none; place-items: center; padding: 20px;
}
.modal-back.is-open { display: grid; }
.modal-card {
    width: min(760px, 100%);
    max-height: min(90vh, 940px);
    overflow-y: auto;
    overflow-x: hidden;
    background: linear-gradient(180deg, #251e18, #15110e);
    border: 1px solid rgba(245, 165, 36, 0.45);
    border-radius: 24px;
    box-shadow: 0 35px 90px rgba(0,0,0,.65);
    padding: 8px 12px 20px;
    animation: modalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPop {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes modalShake {
    0%, 100% { transform: scale(1); }
    20%, 60% { transform: scale(1.008) translateX(-5px); }
    40%, 80% { transform: scale(1.008) translateX(5px); }
}
.modal-card.modal-shake {
    animation: modalShake 0.35s ease-in-out !important;
}
.modal-card::-webkit-scrollbar { width: 5px; }
.modal-card::-webkit-scrollbar-thumb { background: rgba(245, 165, 36, 0.25); border-radius: 5px; }
.modal-card.is-wide { 
    width: min(1260px, 98vw); 
    max-height: min(94vh, 940px);
    padding: 6px 12px 14px;
}
.modal-card.is-wide .modal-top {
    padding: 8px 12px 6px;
    margin-bottom: 8px;
}
.modal-card.is-wide .modal-top h2 {
    font-size: 1.25rem;
}
.modal-card.is-wide .modal-body {
    padding: 4px 10px;
}
.modal-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px 6px; border-bottom: 1px solid rgba(245, 165, 36, 0.15); margin-bottom: 10px; }
.modal-top h2 { font-family: var(--serif); font-size: 1.4rem; color: var(--gold-2); margin: 0; }
.modal-body { padding: 8px 14px; }
.modal-body .sheet, .modal-body .card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,0.03); color: var(--ink); cursor: pointer; transition: all 0.2s ease; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.icon-btn:hover { background: rgba(245, 165, 36, 0.15); color: var(--gold-2); border-color: var(--gold); }

.toast {
    position: fixed; right: 18px; bottom: 18px; z-index: 60;
    background: #2a221c; border: 1px solid var(--line); color: var(--ink);
    padding: 12px 14px; border-radius: 14px; box-shadow: var(--shadow); max-width: 360px;
}
.confirm-back { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.45); display: grid; place-items: center; }
.confirm-card { width: min(420px, calc(100% - 32px)); background: #221c18; border: 1px solid var(--line); border-radius: 18px; padding: 18px; }

.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.public-body { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 0; }
.auth-card, .hero {
    width: min(460px, 100%);
    background: rgba(27, 22, 19, 0.9);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 32px 28px;
    box-shadow: var(--shadow);
}
.hero { width: min(680px, calc(100% - 32px)); text-align: center; margin: auto; }
.hero h1 { font-size: 4rem; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.resumen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 18px; }
.resumen div { padding: 12px; border-radius: 14px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); }
.resumen span { display: block; color: var(--muted); font-size: 0.8rem; }
.factura { background: #fffaf3; color: #24180f; border-radius: 18px; padding: 28px; }
.factura table, .factura th, .factura td { color: #24180f; }
.factura .muted { color: #6d5c4e; }
.diff-pos { color: var(--ok); }
.diff-neg { color: var(--danger); }

/* ==========================================
   ESTILOS DE MESA Y MENÚ MÓVIL (CLIENTE QR)
   ========================================== */
.mesa-app {
    width: 100%;
    max-width: 580px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 0 16px 120px;
    display: flex;
    flex-direction: column;
}
.mesa-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(17, 14, 12, 0.92);
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mesa-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mesa-brand strong {
    font-family: var(--serif);
    font-size: 1.15rem;
    display: block;
    line-height: 1.2;
}
.mesa-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gold-2);
    background: rgba(245, 165, 36, 0.15);
    border: 1px solid rgba(245, 165, 36, 0.4);
    padding: 1px 8px;
    border-radius: 999px;
}
.mesa-top-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.btn-top-pill {
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-top-pill:hover {
    border-color: var(--gold);
    color: var(--gold-2);
}
.btn-top-pill.is-person {
    background: rgba(245, 165, 36, 0.08);
    border-color: rgba(245, 165, 36, 0.35);
}

.mesa-welcome-card {
    text-align: center;
    padding: 36px 22px;
    margin-top: 24px;
}
.welcome-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ok);
    background: rgba(61, 214, 140, 0.14);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}
.mesa-welcome-card h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
}
.wifi-welcome-box {
    margin-top: 24px;
    padding: 12px 14px;
    background: var(--bg-3);
    border-radius: 12px;
    border: 1px dashed var(--line);
    font-size: 0.85rem;
}

.mesa-nav-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    background: var(--bg-2);
    padding: 4px;
    border-radius: 16px;
    border: 1px solid var(--line);
}
.tab-btn {
    flex: 1;
    padding: 10px 14px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.tab-btn.is-active {
    background: var(--gold);
    color: #110e0c;
    box-shadow: 0 4px 12px rgba(245, 165, 36, 0.3);
}
.cuenta-badge {
    font-size: 0.72rem;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    padding: 2px 8px;
    border-radius: 999px;
}
.tab-btn.is-active .cuenta-badge {
    background: #110e0c;
    color: var(--gold-2);
}

.mesa-tab-content { display: none; }
.mesa-tab-content.is-active { display: block; }

.mesa-search-box { margin-bottom: 12px; }
.mesa-search-box input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--ink);
    font-size: 0.95rem;
}
.mesa-search-box input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(245, 165, 36, 0.15);
}

.mesa-categories-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.mesa-categories-scroll::-webkit-scrollbar { display: none; }
.cat-pill {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.cat-pill.is-active {
    background: rgba(245, 165, 36, 0.15);
    border-color: var(--gold);
    color: var(--gold-2);
}

.mesa-products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.mesa-products-grid.view-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.prod-card {
    padding: 10px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #19130f 0%, #120e0b 100%);
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.prod-card.in-cart {
    border-color: var(--gold);
    background: linear-gradient(180deg, #241a13 0%, #16100c 100%);
}
.prod-card.is-out-of-stock {
    opacity: 0.45;
}
.prod-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.prod-cat-tag {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}
.prod-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--ink);
}
.prod-desc {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.4;
}
.prod-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.prod-price {
    font-family: var(--serif);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gold-2);
}
.prod-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 8px;
}
.btn-qty-minus, .btn-qty-plus {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.08);
    color: var(--ink);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.15s;
}
.btn-qty-plus {
    background: var(--gold);
    color: #110e0c;
}
.btn-qty-minus:active, .btn-qty-plus:active {
    transform: scale(0.92);
}
.prod-qty {
    min-width: 20px;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.mesa-cart-bar {
    position: fixed;
    bottom: 16px;
    left: 14px;
    right: 14px;
    max-width: 552px;
    margin: 0 auto;
    z-index: 50;
    background: linear-gradient(135deg, #2b1f14, #1c1511);
    border: 1px solid var(--gold);
    border-radius: 20px;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 12px 36px rgba(0,0,0,0.6), 0 0 20px rgba(245, 165, 36, 0.25);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.cart-bar-info {
    display: flex;
    flex-direction: column;
}
.cart-bar-count {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.cart-bar-total {
    font-family: var(--serif);
    font-size: 1.35rem;
    color: var(--gold-2);
}

.cart-drawer-back {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(0,0,0,0.68);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.cart-drawer-back.is-open { display: flex; }
.cart-drawer-card {
    width: min(580px, 100%);
    max-height: 85vh;
    overflow-y: auto;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 24px 24px 0 0;
    padding: 20px 20px 36px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.6);
    animation: sheetUp 0.25s ease-out;
}
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.drawer-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
    max-height: 42vh;
    overflow-y: auto;
}
.drawer-item-row {
    display: grid;
    grid-template-columns: 1.4fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.drawer-item-info strong {
    display: block;
    font-size: 0.95rem;
}
.drawer-item-info span {
    font-size: 0.8rem;
    color: var(--muted);
}
.drawer-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-3);
    border-radius: 999px;
    padding: 3px 8px;
}
.btn-drawer-minus, .btn-drawer-plus {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.1);
    color: var(--ink);
    cursor: pointer;
}
.drawer-item-subtotal {
    font-family: var(--serif);
    font-size: 1rem;
    color: var(--gold-2);
    text-align: right;
}
.drawer-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 1.1rem;
    margin: 18px 0;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
}
.drawer-total-row strong {
    font-family: var(--serif);
    font-size: 1.6rem;
    color: var(--gold);
}

.mesa-resumen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    margin-bottom: 18px;
}
.resumen-gran-total {
    text-align: right;
}
.resumen-gran-total span {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
}
.resumen-gran-total strong {
    font-family: var(--serif);
    font-size: 1.6rem;
    color: var(--gold);
}

.seccion-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gold);
    display: inline-block;
}
.live-dot.pulse {
    box-shadow: 0 0 0 0 rgba(245, 165, 36, 0.7);
    animation: pulse 1.8s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 165, 36, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(245, 165, 36, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 165, 36, 0); }
}

.pedido-pendiente-card {
    background: rgba(245, 165, 36, 0.08);
    border: 1px solid rgba(245, 165, 36, 0.4);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.pedido-pendiente-card header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.pedido-pendiente-card ul {
    list-style: none;
    padding: 0;
    margin: 8px 0;
    font-size: 0.9rem;
}
.pedido-pendiente-card li { padding: 2px 0; }
.pedido-pendiente-card footer {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(245, 165, 36, 0.25);
}

.grupo-persona-card {
    padding: 16px;
    margin-bottom: 12px;
}
.persona-header {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
    color: var(--gold-2);
}
.tabla-consumos {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.tabla-consumos td {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.personas-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chip-persona {
    background: var(--bg-3);
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
}
.chip-persona:hover {
    border-color: var(--gold);
    color: var(--gold-2);
}
.btn-block {
    width: 100%;
    display: block;
    text-align: center;
}
.btn-lg {
    padding: 14px 20px;
    font-size: 1.05rem;
}
@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes sheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@media (max-width: 980px) {
    .sidebar { position: fixed; z-index: 30; transform: translateX(-105%); transition: 0.2s ease; }
    .sidebar.is-open { transform: none; }
    .kpis, .sala, .grid-2, .grid-3, .resumen { grid-template-columns: 1fr; }
    .linea { grid-template-columns: 1fr; }
    .content, .topbar { padding-left: 16px; padding-right: 16px; }
    .menu-btn { display: inline-flex; }
}
.menu-btn { display: none; }

@media print {
    body * { visibility: hidden; }
    .factura, .factura * { visibility: visible; }
    .factura { position: absolute; inset: 0; box-shadow: none; }
    .no-print { display: none !important; }
}

/* ========================================================
   DATATABLE NATIVO - ESTILOS PROFESIONALES
   ======================================================== */
.dt-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
    width: 100%;
}
.dt-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px 14px;
}
.dt-group-left, .dt-group-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.dt-length-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--muted);
}
.dt-select {
    background: #140f0d;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 6px 10px;
    color: var(--ink);
    font-size: 0.85rem;
    cursor: pointer;
}
.dt-export-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.dt-btn {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--ink);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.dt-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.dt-btn-excel {
    background: rgba(61, 214, 140, 0.08);
    border-color: rgba(61, 214, 140, 0.35);
    color: #4eed9f;
}
.dt-btn-excel:hover {
    background: rgba(61, 214, 140, 0.18);
    border-color: #3dd68c;
}
.dt-btn-csv {
    background: rgba(142, 182, 255, 0.08);
    border-color: rgba(142, 182, 255, 0.35);
    color: #a8caff;
}
.dt-btn-csv:hover {
    background: rgba(142, 182, 255, 0.18);
    border-color: #8eb6ff;
}
.dt-btn-pdf {
    background: rgba(255, 107, 74, 0.08);
    border-color: rgba(255, 107, 74, 0.35);
    color: #ff9b84;
}
.dt-btn-pdf:hover {
    background: rgba(255, 107, 74, 0.18);
    border-color: #ff6b4a;
}
.dt-search-box {
    position: relative;
    display: flex;
    align-items: center;
}
.dt-search-box svg {
    position: absolute;
    left: 11px;
    color: var(--muted);
    pointer-events: none;
}
.dt-search-input {
    background: #140f0d;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 12px 8px 34px;
    color: var(--ink);
    font-size: 0.86rem;
    min-width: 220px;
    transition: all 0.2s ease;
}
.dt-search-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(245, 165, 36, 0.2);
}

/* Cabeceras de tabla ordenables */
th.dt-sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease, color 0.15s ease;
}
th.dt-sortable:hover {
    background: rgba(245, 165, 36, 0.08);
    color: var(--gold-2);
}
.dt-th-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.dt-sort-icon {
    font-size: 0.72rem;
    opacity: 0.45;
    transition: all 0.15s ease;
    margin-left: 4px;
}
th.dt-sort-asc .dt-sort-icon,
th.dt-sort-desc .dt-sort-icon {
    opacity: 1;
    color: var(--gold);
    font-size: 0.85rem;
}

/* Pie de DataTable (Info + Paginación) */
.dt-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 4px 14px;
}
.dt-info {
    color: var(--muted);
    font-size: 0.85rem;
}
.dt-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}
.dt-page-btn {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    color: var(--ink);
    border-radius: 8px;
    padding: 6px 11px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.dt-page-btn:hover:not(:disabled) {
    background: rgba(245, 165, 36, 0.12);
    color: var(--gold-2);
    border-color: var(--gold);
}
.dt-page-btn.is-active {
    background: linear-gradient(180deg, var(--gold-2), var(--gold));
    color: #2a1c08;
    font-weight: 750;
    border-color: var(--gold-2);
}
.dt-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.dt-ellipsis {
    color: var(--muted);
    padding: 0 4px;
}
.dt-empty {
    text-align: center;
    padding: 36px !important;
    color: var(--muted);
    font-style: italic;
}

/* Acciones unificadas en tablas */
.acciones-tabla {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    white-space: nowrap;
}
.acciones-tabla .btn {
    padding: 5px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    line-height: 1.2;
}
.acciones-tabla form {
    margin: 0;
    display: inline-block;
}

/* ==========================================================================
   Módulo de Facturación Legal & Cobros (SET / DNIT)
   Aestética: Chocolate oscuro, ámbar, dorado y marrón cálido
   ========================================================================== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 8px;
}
.breadcrumb a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s ease;
}
.breadcrumb a:hover {
    color: var(--gold);
}
.breadcrumb .sep {
    opacity: 0.4;
}
.breadcrumb .current {
    color: var(--ink);
    font-weight: 600;
}

.facturas-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.page-head-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 4 KPI Cards */
.factura-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}
@media (max-width: 1024px) {
    .factura-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .factura-kpis { grid-template-columns: 1fr; }
}
.kpi-card {
    background: #1b1613;
    border: 1px solid rgba(245, 165, 36, 0.22);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(245, 165, 36, 0.4);
}
.kpi-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.kpi-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}
.kpi-monto {
    font-size: 1.38rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}
.kpi-monto small {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted);
}
.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kpi-icon.icon-gold {
    background: rgba(245, 165, 36, 0.16);
    color: var(--gold);
    border: 1px solid rgba(245, 165, 36, 0.3);
}
.kpi-icon.icon-green {
    background: rgba(61, 214, 140, 0.16);
    color: #3dd68c;
    border: 1px solid rgba(61, 214, 140, 0.3);
}
.kpi-icon.icon-red {
    background: rgba(255, 93, 115, 0.16);
    color: #ff5d73;
    border: 1px solid rgba(255, 93, 115, 0.3);
}
.kpi-icon.icon-blue {
    background: rgba(142, 182, 255, 0.16);
    color: #8eb6ff;
    border: 1px solid rgba(142, 182, 255, 0.3);
}

/* Tarjeta de Filtros de Fecha (Default Hoy) */
.factura-filter-card {
    background: #1b1613;
    border: 1px solid rgba(245, 165, 36, 0.24);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 16px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.factura-filter-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.filter-group label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}
.filter-group input[type="date"] {
    background: #261f1a;
    border: 1px solid rgba(245, 165, 36, 0.25);
    color: var(--ink);
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s ease;
    color-scheme: dark;
}
.filter-group input[type="date"]:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(245, 165, 36, 0.2);
}
.presets-fechas {
    display: flex;
    gap: 6px;
    margin-left: auto;
}
@media (max-width: 768px) {
    .presets-fechas { margin-left: 0; width: 100%; }
}
.btn-preset {
    background: #261f1a;
    border: 1px solid rgba(245, 165, 36, 0.2);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-preset:hover {
    background: rgba(245, 165, 36, 0.15);
    color: var(--gold-2);
    border-color: var(--gold);
}
.btn-preset.is-active {
    background: var(--gold);
    color: #110e0c;
    border-color: var(--gold);
    font-weight: 700;
}
.factura-filter-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.76rem;
    color: var(--muted);
    line-height: 1.35;
}
.note-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 8px var(--gold);
    flex-shrink: 0;
}

/* Tabs de Estado de Facturas */
.factura-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.tab-pill {
    background: #1b1613;
    border: 1px solid rgba(245, 165, 36, 0.18);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
}
.tab-pill:hover {
    background: #261f1a;
    color: var(--ink);
    border-color: rgba(245, 165, 36, 0.35);
}
.tab-pill.is-active {
    background: rgba(245, 165, 36, 0.18);
    border-color: var(--gold);
    color: var(--gold-2);
    font-weight: 700;
    box-shadow: 0 0 12px rgba(245, 165, 36, 0.15);
}
.tab-badge {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
}
.pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.dot-ok { background: #3dd68c; box-shadow: 0 0 6px #3dd68c; }
.dot-warn { background: #ff6b4a; box-shadow: 0 0 6px #ff6b4a; }
.dot-danger { background: #ff5d73; box-shadow: 0 0 6px #ff5d73; }

/* Elementos de la Tabla de Facturas */
.factura-num-link {
    color: var(--gold-2);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
}
.factura-num-link:hover {
    text-decoration: underline;
    color: #fff;
}
.factura-timb-sub {
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    display: block;
    margin-top: 2px;
}
.cliente-nombre-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.badge-sub {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.04em;
    display: inline-block;
    width: fit-content;
}
.badge-sub-ok {
    background: rgba(61, 214, 140, 0.15);
    color: #3dd68c;
    border: 1px solid rgba(61, 214, 140, 0.25);
}
.badge-sub-warn {
    background: rgba(255, 107, 74, 0.15);
    color: #ff6b4a;
    border: 1px solid rgba(255, 107, 74, 0.25);
}
.badge-sub-danger {
    background: rgba(255, 93, 115, 0.15);
    color: #ff5d73;
    border: 1px solid rgba(255, 93, 115, 0.25);
}
.badge-condicion {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}
.badge-condicion.contado {
    background: rgba(245, 165, 36, 0.15);
    color: var(--gold-2);
    border: 1px solid rgba(245, 165, 36, 0.25);
}
.badge-condicion.credito {
    background: rgba(255, 107, 74, 0.18);
    color: #ff8b70;
    border: 1px solid rgba(255, 107, 74, 0.3);
}
.badge-condicion.tarjeta, .badge-condicion.qr, .badge-condicion.transferencia {
    background: rgba(142, 182, 255, 0.15);
    color: #8eb6ff;
    border: 1px solid rgba(142, 182, 255, 0.25);
}
.vendedor-pill {
    font-size: 0.75rem;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid rgba(245, 165, 36, 0.12);
}
.fecha-emision-pill {
    font-size: 0.8rem;
    color: var(--muted);
}
.is-row-anulada {
    opacity: 0.6;
}
.factura-total-text.tachado {
    text-decoration: line-through;
    opacity: 0.6;
}

/* ==========================================================================
   Modal de Emisión de Facturas (2 Columnas - Look RolferStore)
   ========================================================================== */

.factura-modal-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.factura-punto-badge {
    background: #1b1613;
    border: 1px solid var(--gold);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gold-2);
    box-shadow: 0 0 14px rgba(245, 165, 36, 0.12);
}
.factura-punto-badge strong {
    color: #fff;
}
.factura-punto-badge .sep-dot {
    opacity: 0.5;
}

.factura-form-grid {
    display: grid;
    grid-template-columns: 1fr 295px;
    gap: 12px;
    align-items: start;
}
@media (max-width: 960px) {
    .factura-form-grid { grid-template-columns: 1fr; }
}

.factura-left-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.factura-section-card {
    background: #1a1512;
    border: 1px solid rgba(245, 165, 36, 0.2);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}
.factura-section-header {
    background: linear-gradient(180deg, #251d18 0%, #1e1713 100%);
    border-bottom: 1px solid rgba(245, 165, 36, 0.16);
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.factura-section-header.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gold-2);
}
.section-body {
    padding: 10px 12px;
}
.section-body.p-0 {
    padding: 0;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}
@media (max-width: 600px) {
    .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
}

/* Tabla de ítems en modal */
.factura-items-table-wrap {
    overflow-x: auto;
}
.factura-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.factura-items-table th {
    background: #201813;
    padding: 5px 8px;
    text-align: left;
    font-size: 0.69rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid rgba(245, 165, 36, 0.15);
}
.factura-items-table td {
    padding: 4px 6px;
    border-bottom: 1px solid rgba(245, 165, 36, 0.08);
    vertical-align: middle;
}
.prod-selector-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.prod-selector-group select,
.prod-selector-group input {
    background: #1c1511;
    border: 1px solid rgba(245, 165, 36, 0.22);
    color: var(--ink);
    padding: 3px 6px;
    border-radius: 5px;
    font-size: 0.78rem;
    width: 100%;
}
.factura-items-table input,
.factura-items-table select {
    background: #1c1511;
    border: 1px solid rgba(245, 165, 36, 0.22);
    color: var(--ink);
    padding: 3px 6px;
    border-radius: 5px;
    font-size: 0.8rem;
    width: 100%;
    outline: none;
}
.factura-items-table input:focus,
.factura-items-table select:focus {
    border-color: var(--gold);
}
.btn-remove-row {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 1.15rem;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s ease;
}
.btn-remove-row:hover {
    color: #ff5d73;
    background: rgba(255, 93, 115, 0.15);
}

/* Columna Derecha: Tarjeta de Resumen */
.factura-right-col {
    position: sticky;
    top: 10px;
}
.factura-summary-card {
    background: #1a1512;
    border: 1px solid var(--gold);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.summary-header {
    background: linear-gradient(135deg, #271f19, #1a1512);
    border-bottom: 1px solid rgba(245, 165, 36, 0.22);
    padding: 7px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gold-2);
}
.summary-header h3 {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
}
.summary-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    padding: 1px 0;
}
.summary-label {
    color: var(--muted);
}
.summary-val {
    font-weight: 700;
    color: var(--ink);
}
.summary-divider {
    border-top: 1px dashed rgba(245, 165, 36, 0.25);
    margin: 4px 0;
}
.summary-total-box {
    background: rgba(245, 165, 36, 0.09);
    border: 1px solid rgba(245, 165, 36, 0.35);
    border-radius: 8px;
    padding: 7px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: center;
}
.total-caption {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gold-2);
}
.total-big-amount {
    font-size: 1.45rem;
    font-weight: 900;
    color: var(--gold-2);
}
.summary-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}
.btn-block {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}
.btn-lg {
    padding: 12px 18px;
    font-size: 0.95rem;
    font-weight: 800;
}

/* ==========================================================================
   Vista de Factura Legal (Formato A4 y Print)
   ========================================================================== */

.anulada-banner {
    background: rgba(255, 93, 115, 0.15);
    border: 1px solid #ff5d73;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: #ff8b99;
}
.anulada-banner strong {
    font-size: 0.95rem;
    color: #ff5d73;
    letter-spacing: 0.05em;
}

.factura-legal-sheet {
    background: #fff;
    color: #111;
    border-radius: 10px;
    padding: 24px 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    position: relative;
}
.factura-legal-sheet.is-anulada::after {
    content: "ANULADA";
    position: absolute;
    top: 40%;
    left: 20%;
    font-size: 5rem;
    font-weight: 900;
    color: rgba(255, 93, 115, 0.22);
    transform: rotate(-30deg);
    pointer-events: none;
    letter-spacing: 12px;
}
.factura-legal-head {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    border-bottom: 2px solid #222;
    padding-bottom: 16px;
    margin-bottom: 14px;
}
.factura-empresa-nombre {
    font-size: 1.45rem;
    font-weight: 800;
    margin: 0 0 4px;
    color: #000;
}
.factura-empresa-desc {
    font-size: 0.8rem;
    color: #444;
    margin: 0 0 6px;
}
.factura-empresa-datos {
    font-size: 0.8rem;
    color: #222;
    line-height: 1.35;
    margin: 0;
}
.factura-timbrado-box {
    border: 2px solid #222;
    border-radius: 6px;
    padding: 10px 14px;
    text-align: center;
}
.timb-item {
    font-size: 0.8rem;
    margin-bottom: 2px;
}
.timb-lbl { color: #555; }
.timb-val { font-weight: 800; color: #000; }
.timb-ruc-box {
    font-weight: 800;
    font-size: 0.85rem;
    margin: 4px 0;
    padding: 2px 0;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
}
.factura-num-grande {
    display: flex;
    flex-direction: column;
    margin-top: 4px;
}
.factura-num-grande span {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: #444;
}
.factura-num-grande strong {
    font-size: 1.15rem;
    font-weight: 900;
    color: #000;
}

.factura-receptor-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 14px;
}
.rec-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.rec-field.col-span-2 {
    grid-column: span 2;
}
.rec-lbl {
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
}
.rec-val {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
}

.factura-detalles-wrap {
    margin-bottom: 14px;
}
.factura-print-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #222;
    font-size: 0.82rem;
}
.factura-print-table th, .factura-print-table td {
    border: 1px solid #ccc;
    padding: 6px 8px;
}
.factura-print-table th {
    background: #f1f5f9;
    color: #000;
    font-weight: 700;
    font-size: 0.74rem;
    border-color: #999;
}
.factura-print-table tbody tr:nth-child(even) {
    background: #fafafa;
}
.tfoot-totales td {
    background: #f8fafc;
    font-weight: 700;
    border-top: 2px solid #222;
}
.tfoot-total-general td {
    background: #e2e8f0;
    padding: 10px 12px;
}
.total-letras {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
}
.total-monto-print {
    font-size: 1.25rem;
    font-weight: 900;
    color: #000;
}
.factura-print-foot {
    border-top: 1px solid #ccc;
    padding-top: 10px;
    font-size: 0.8rem;
    color: #222;
}
.iva-liquidacion-box {
    display: flex;
    gap: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    border-radius: 6px;
    flex-wrap: wrap;
}
.factura-obs-print {
    margin-top: 8px;
    color: #475569;
}

/* Scanner de código de barras y buscador de productos en Facturación */
.factura-scanner-bar {
    padding: 12px 14px;
    background: linear-gradient(180deg, #241c17 0%, #1a1410 100%);
    border-bottom: 1px solid rgba(245, 165, 36, 0.22);
    position: relative;
}
.scanner-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    position: relative;
}
.scanner-badge-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 165, 36, 0.12);
    border: 1px solid rgba(245, 165, 36, 0.3);
    color: var(--gold, #f5a524);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 7px 11px;
    border-radius: 8px;
    white-space: nowrap;
}
.scanner-search-input {
    flex: 1;
    background: #15100d !important;
    border: 1.5px solid rgba(245, 165, 36, 0.35) !important;
    color: #fff !important;
    padding: 9px 14px !important;
    border-radius: 8px !important;
    font-size: 0.88rem !important;
    outline: none !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
    transition: all 0.2s ease;
}
.scanner-search-input:focus {
    border-color: var(--gold, #f5a524) !important;
    box-shadow: 0 0 0 3px rgba(245, 165, 36, 0.22), inset 0 2px 4px rgba(0,0,0,0.5) !important;
}
.btn-scanner-action {
    height: 40px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    white-space: nowrap;
    border-radius: 8px;
}
.scanner-status-msg {
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    animation: fadeIn 0.2s ease;
}
.scanner-live-dropdown {
    position: absolute;
    top: calc(100% - 2px);
    left: 14px;
    right: 14px;
    background: #1e1713;
    border: 1.5px solid var(--gold, #f5a524);
    border-radius: 8px;
    max-height: 260px;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0 14px 32px rgba(0,0,0,0.7);
}
.scanner-dropdown-item {
    padding: 9px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    border-bottom: 1px solid rgba(245, 165, 36, 0.1);
    transition: background 0.15s ease;
}
.scanner-dropdown-item:last-child {
    border-bottom: none;
}
.scanner-dropdown-item:hover, .scanner-dropdown-item.active {
    background: rgba(245, 165, 36, 0.2);
}
.scanner-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
}
.scanner-item-code {
    background: #2d2119;
    color: var(--gold, #f5a524);
    border: 1px solid rgba(245, 165, 36, 0.35);
    border-radius: 4px;
    font-size: 0.72rem;
    padding: 2px 6px;
    font-weight: 700;
    font-family: monospace;
}
.scanner-item-name {
    font-size: 0.84rem;
    color: #f3eee9;
    font-weight: 600;
}
.scanner-item-price {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--gold, #f5a524);
}
.prod-search-row {
    display: flex;
    gap: 6px;
    margin-bottom: 4px;
}
.prod-search-row .input-row-search {
    flex: 1.2;
    background: #1c1511 !important;
    border: 1px solid rgba(245, 165, 36, 0.28) !important;
    font-size: 0.78rem !important;
}
.prod-search-row .select-prod {
    flex: 1;
    font-size: 0.78rem !important;
}
.row-highlight {
    animation: rowPulse 1s ease;
}
@keyframes rowPulse {
    0% { background: rgba(245, 165, 36, 0.45); }
    100% { background: transparent; }
}

@media print {
    body { background: #fff !important; color: #000 !important; }
    .sidebar, .topbar, .no-print, .breadcrumb, .toast { display: none !important; }
    .content { padding: 0 !important; margin: 0 !important; }
    .factura-legal-sheet {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }
}

/* ========================================================
   SISTEMA ESTÉTICO DE ALERTAS, MODALES Y TOASTS (LODEYOYO)
   ======================================================== */
.lyy-alert-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(8, 6, 4, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.lyy-alert-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}
.lyy-alert-overlay.is-closing {
    opacity: 0;
    pointer-events: none;
}

.lyy-alert-card {
    position: relative;
    width: min(440px, 100%);
    background: linear-gradient(155deg, #241a14 0%, #17110c 100%);
    border: 1px solid rgba(245, 165, 36, 0.35);
    border-radius: 28px;
    padding: 34px 24px 28px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(245, 165, 36, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: scale(0.9) translateY(12px);
    transition: transform 0.26s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
    overflow: hidden;
}
.lyy-alert-overlay.is-visible .lyy-alert-card {
    transform: scale(1) translateY(0);
}
.lyy-alert-overlay.is-closing .lyy-alert-card {
    transform: scale(0.92) translateY(10px);
}

.lyy-card-glow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    height: 120px;
    background: radial-gradient(ellipse at top, rgba(245, 165, 36, 0.28) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}
.lyy-type-danger .lyy-card-glow,
.lyy-type-error .lyy-card-glow {
    background: radial-gradient(ellipse at top, rgba(255, 93, 115, 0.32) 0%, transparent 70%);
}
.lyy-type-warning .lyy-card-glow {
    background: radial-gradient(ellipse at top, rgba(255, 183, 3, 0.3) 0%, transparent 70%);
}

.lyy-icon-container {
    position: relative;
    width: 82px;
    height: 82px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.lyy-icon-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 165, 36, 0.25) 0%, rgba(245, 165, 36, 0.06) 75%);
    border: 2px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.3rem;
    box-shadow: 0 0 24px rgba(245, 165, 36, 0.45);
    position: relative;
    z-index: 2;
}
.lyy-type-danger .lyy-icon-badge,
.lyy-type-error .lyy-icon-badge {
    background: radial-gradient(circle, rgba(255, 93, 115, 0.25) 0%, rgba(255, 93, 115, 0.06) 75%);
    border-color: var(--danger);
    box-shadow: 0 0 24px rgba(255, 93, 115, 0.45);
}
.lyy-type-warning .lyy-icon-badge {
    background: radial-gradient(circle, rgba(255, 183, 3, 0.25) 0%, rgba(255, 183, 3, 0.06) 75%);
    border-color: #ffb703;
    box-shadow: 0 0 24px rgba(255, 183, 3, 0.45);
}

.lyy-icon-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid rgba(245, 165, 36, 0.4);
    animation: lyyPulseRing 2.2s infinite ease-out;
    pointer-events: none;
}
.lyy-type-danger .lyy-icon-ring,
.lyy-type-error .lyy-icon-ring {
    border-color: rgba(255, 93, 115, 0.4);
}
@keyframes lyyPulseRing {
    0% { transform: scale(0.92); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 0.2; }
    100% { transform: scale(1.3); opacity: 0; }
}

.lyy-alert-title {
    font-family: var(--serif, 'Fraunces', Georgia, serif);
    font-size: 1.48rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px;
    line-height: 1.25;
    position: relative;
    z-index: 2;
}
.lyy-alert-message {
    font-size: 1rem;
    color: #e5dacd;
    line-height: 1.55;
    margin: 0 0 10px;
    font-weight: 500;
    position: relative;
    z-index: 2;
}
.lyy-alert-sub {
    font-size: 0.84rem;
    color: #a89889;
    line-height: 1.45;
    margin: 0 0 14px;
    position: relative;
    z-index: 2;
}

.lyy-alert-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    position: relative;
    z-index: 2;
}
.lyy-actions-row {
    display: flex;
    gap: 10px;
    width: 100%;
}
.lyy-actions-row .lyy-btn {
    flex: 1;
}

.lyy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 28px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    border-radius: 999px;
    cursor: pointer;
    border: none;
    outline: none;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}
.lyy-btn-primary {
    background: linear-gradient(135deg, #f5a524 0%, #d48310 100%);
    color: #160e06 !important;
    box-shadow: 0 6px 20px rgba(245, 165, 36, 0.42);
}
.lyy-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(245, 165, 36, 0.6);
}
.lyy-btn-primary:active {
    transform: scale(0.97);
}

.lyy-btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #d6c8b9 !important;
}
.lyy-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.28);
}
.lyy-btn-ghost:active {
    transform: scale(0.97);
}

.lyy-btn-danger {
    background: linear-gradient(135deg, #ff5d73 0%, #c92a42 100%);
    color: #fff !important;
    box-shadow: 0 6px 20px rgba(255, 93, 115, 0.42);
}
.lyy-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(255, 93, 115, 0.6);
}
.lyy-btn-danger:active {
    transform: scale(0.97);
}

/* Notificaciones Toasts Flotantes */
.lyy-toast-container {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100010;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    max-width: 90vw;
}
.lyy-toast-item {
    pointer-events: auto;
    background: rgba(26, 20, 16, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(245, 165, 36, 0.38);
    border-radius: 999px;
    padding: 10px 18px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 0 18px rgba(245, 165, 36, 0.22);
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(-12px) scale(0.94);
    transition: all 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.lyy-toast-item.is-active {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.lyy-toast-item.is-hiding {
    opacity: 0;
    transform: translateY(-10px) scale(0.94);
}
.lyy-toast-item.lyy-toast-danger,
.lyy-toast-item.lyy-toast-error {
    border-color: rgba(255, 93, 115, 0.45);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 0 18px rgba(255, 93, 115, 0.25);
}
.lyy-toast-icon {
    font-size: 1.15rem;
    line-height: 1;
}
.lyy-toast-close {
    background: transparent;
    border: none;
    color: #a89889;
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    padding: 0 0 0 4px;
    margin: 0;
    transition: color 0.15s;
}
.lyy-toast-close:hover {
    color: #fff;
}

/* Chispas / Confeti Gourmet */
@keyframes lyyConfettiFall {
    0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 1; }
    80% { opacity: 0.95; }
    100% { transform: translateY(105vh) translateX(var(--drift, 40px)) rotate(720deg); opacity: 0; }
}

/* ========================================================
   DISEÑO PROFESIONAL REGISTRAR COMPRA (ROLFERSTORE STYLE)
   ======================================================== */
.compra-form-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px 0 16px;
}
.compra-hero-title {
    margin-bottom: 6px;
}
.compra-hero-title h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.compra-hero-title p {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0;
}

.compra-section-card {
    background: #191410;
    border: 1px solid rgba(245, 165, 36, 0.22);
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.compra-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.compra-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gold-2);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.compra-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
@media (max-width: 900px) {
    .compra-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 550px) {
    .compra-grid-4 {
        grid-template-columns: 1fr;
    }
}

.btn-cyan-search {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #fff !important;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 8px 18px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.18s ease;
}
.btn-cyan-search:hover {
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(14, 165, 233, 0.5);
}

.compra-table {
    width: 100%;
    border-collapse: collapse;
}
.compra-table th {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.compra-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}
.compra-table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

.empty-compra-msg {
    text-align: center;
    padding: 42px 20px;
    color: #a89989;
    font-size: 0.95rem;
}

.compra-totales-card {
    background: #140f0c;
    border: 1px solid rgba(245, 165, 36, 0.25);
    border-radius: 14px;
    padding: 16px 20px;
    min-width: 340px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.compra-totales-card .tot-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 8px;
}
.compra-totales-card .tot-line strong {
    color: #fff;
    font-family: var(--sans);
}
.compra-totales-card .tot-divider {
    border-top: 1px solid rgba(245, 165, 36, 0.2);
    margin: 10px 0;
}
.compra-totales-card .tot-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}
.compra-totales-card .tot-total strong {
    font-size: 1.45rem;
    color: var(--gold-2);
}

.compra-bottom-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.btn-guardar-compra {
    background: linear-gradient(135deg, #a3e635 0%, #84cc16 100%);
    color: #172a04 !important;
    font-weight: 800;
    padding: 12px 28px;
    border-radius: 999px;
    box-shadow: 0 4px 18px rgba(163, 230, 53, 0.35);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}
.btn-guardar-compra:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(163, 230, 53, 0.55);
}

/* Modal Selector Flotante de Productos */
.prod-search-modal {
    position: fixed;
    inset: 0;
    z-index: 100050;
    background: rgba(6, 4, 3, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.prod-search-modal.is-open {
    display: flex;
}
.prod-search-card {
    width: min(720px, 98vw);
    max-height: 82vh;
    background: #1b1612;
    border: 1px solid var(--gold);
    border-radius: 22px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0,0,0,0.9);
}
.prod-search-input-wrap {
    position: relative;
    margin-bottom: 14px;
}
.prod-search-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    background: #120e0b;
    border: 1px solid rgba(245, 165, 36, 0.4);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    box-sizing: border-box;
}
.prod-search-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 14px rgba(245, 165, 36, 0.25);
}
.prod-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.15rem;
    color: var(--gold);
    pointer-events: none;
}
.prod-search-results {
    overflow-y: auto;
    max-height: 52vh;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}
.prod-search-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    transition: all 0.15s ease;
}
.prod-search-row:hover {
    background: rgba(245, 165, 36, 0.12);
    border-color: var(--gold);
    transform: translateX(3px);
}

/* ==========================================================================
   Módulo de Cuentas por Cobrar & Cobranzas de Facturas a Crédito
   ========================================================================== */
.badge-gold-mini {
    background: rgba(245, 165, 36, 0.18);
    border: 1px solid rgba(245, 165, 36, 0.4);
    color: var(--gold-2);
    font-size: 0.68rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}
.btn-shortcut-monto {
    transition: all 0.15s ease;
}
.btn-shortcut-monto:hover {
    background: rgba(245, 165, 36, 0.18) !important;
    color: var(--gold-2) !important;
    border-color: var(--gold) !important;
    transform: translateY(-1px);
}
.credito-progress-bar-wrap {
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}

/* ==========================================================================
   Botones de Acción Unificados para Datatables (Estilo RolferStore Compacto)
   ========================================================================== */
.table-actions, .acciones-tabla {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 4px !important;
    white-space: nowrap !important;
}

.btn-table-action {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    padding: 0 !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.15s ease-in-out !important;
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1.5px solid transparent !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}

/* 1. Botón Cyan (Historial / Ver / Detalle) */
.btn-table-action.btn-action-cyan {
    border-color: #06b6d4 !important;
    color: #22d3ee !important;
    background: rgba(6, 182, 212, 0.08) !important;
}
.btn-table-action.btn-action-cyan:hover {
    background: #06b6d4 !important;
    color: #0b132b !important;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.45) !important;
    transform: translateY(-1px) !important;
}

/* 2. Botón Amarillo/Ámbar (Cobrar / Imputar / Pagar) */
.btn-table-action.btn-action-yellow {
    border-color: #eab308 !important;
    color: #fde047 !important;
    background: rgba(234, 179, 8, 0.08) !important;
}
.btn-table-action.btn-action-yellow:hover {
    background: #eab308 !important;
    color: #0b132b !important;
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.45) !important;
    transform: translateY(-1px) !important;
}

/* 3. Botón Dorado/Naranja (Imprimir / Ticket / PDF) */
.btn-table-action.btn-action-gold {
    border-color: #f59e0b !important;
    color: #fbbf24 !important;
    background: rgba(245, 158, 11, 0.08) !important;
}
.btn-table-action.btn-action-gold:hover {
    background: #f59e0b !important;
    color: #0b132b !important;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.45) !important;
    transform: translateY(-1px) !important;
}

/* 4. Botón Rojo Outline (Anular / Cancelar) */
.btn-table-action.btn-action-red-outline {
    border-color: #ef4444 !important;
    color: #f87171 !important;
    background: rgba(239, 68, 68, 0.08) !important;
}
.btn-table-action.btn-action-red-outline:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    color: #fca5a5 !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4) !important;
    transform: translateY(-1px) !important;
}

/* 5. Botón Rojo Solid (Eliminar / Borrar) */
.btn-table-action.btn-action-red-solid {
    border: 1px solid #ef4444 !important;
    background: #ef4444 !important;
    color: #ffffff !important;
}
.btn-table-action.btn-action-red-solid:hover {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5) !important;
    transform: translateY(-1px) !important;
}

/* Badges de Estado Compactos en 1 Sola Línea */
.badge-status-pago {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 2px 9px !important;
    border-radius: 9999px !important;
    font-size: 0.68rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    white-space: nowrap !important;
    line-height: 1.3 !important;
}
.badge-status-pago .dot-pago {
    width: 6px !important;
    height: 6px !important;
    border-radius: 50% !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
}
.badge-pago-pagada {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
}
.badge-pago-pagada .dot-pago {
    background: #10b981 !important;
    box-shadow: 0 0 6px #10b981 !important;
}
.badge-pago-parcial {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
}
.badge-pago-parcial .dot-pago {
    background: #f59e0b !important;
    box-shadow: 0 0 6px #f59e0b !important;
}
.badge-pago-pendiente {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
}
.badge-pago-pendiente .dot-pago {
    background: #ef4444 !important;
    box-shadow: 0 0 6px #ef4444 !important;
}

/* Ajustes compactos para que las filas entren en 1 sola línea */
.datatable td, .tabla-wrap table td {
    white-space: nowrap;
}


