
        * { box-sizing: border-box; }

        input[type=number]::-webkit-outer-spin-button,
        input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
        input[type=number] { -moz-appearance: textfield; appearance: textfield; }

        /* Scrollbar oscura — completa el dark theme en Chromium */
        ::-webkit-scrollbar { width: 6px; height: 6px; }
        ::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); border-radius: 999px; }
        ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 999px; }
        ::-webkit-scrollbar-thumb:hover { background: rgba(59,130,246,0.45); }
        :root { color-scheme: dark; }

        body {
            font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
            background: var(--paper);
            margin: 0;
            display: flex;
            flex-direction: row;
            height: 100vh;
            overflow: hidden;
            user-select: auto;
            color: var(--ink-900);
            padding-top: 32px;
        }

        /* Deshabilitar selección solo en elementos de UI, no en datos */
        nav, button, .btn, .nav-btn, .nav-sub-item, .modal-header, .card h3, .abm-form h3, label {
            user-select: none;
        }

        /* Orbes de fondo: sutiles, azul/violeta — igual que login.html */
        body::before {
            content: '';
            position: fixed;
            inset: -20%;
            pointer-events: none;
            background:
                radial-gradient(circle at 75% 20%, rgba(26, 86, 219, 0.08) 0, transparent 35%),
                radial-gradient(circle at 15% 70%, rgba(126, 58, 242, 0.06) 0, transparent 33%);
            z-index: 0;
        }

        /* Barra superior window chrome */
        .window-chrome {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 32px;
            background: linear-gradient(180deg, rgba(10, 20, 34, 0.95) 0%, rgba(6, 11, 20, 0.95) 100%);
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            display: flex;
            align-items: center;
            justify-content: flex-end;
            padding: 0 8px;
            gap: 4px;
            z-index: 10000;
            backdrop-filter: blur(2px);
        }

        .window-btn-small {
            width: 28px;
            height: 28px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            background: rgba(255, 255, 255, 0.05);
            color: var(--ink-600);
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.9rem;
            font-weight: 600;
            line-height: 1;
            transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
        }

        .window-btn-small:hover {
            background: rgba(255, 255, 255, 0.12);
            color: var(--ink-800);
            border-color: rgba(255, 255, 255, 0.2);
        }

        .window-btn-small:active {
            background: rgba(255, 255, 255, 0.08);
            transform: scale(0.92);
        }

        nav {
            width: 248px;
            background: linear-gradient(180deg, #0a1422 0%, #060b14 100%);
            color: var(--ink-900);
            padding: 20px 14px;
            display: flex;
            flex-direction: column;
            gap: 6px;
            max-height: calc(100vh - 32px);
            overflow-y: auto;
            /* Sombra más pronunciada + línea de acento azul sutil en el borde derecho */
            box-shadow: 2px 0 20px rgba(0, 0, 0, 0.6), 0 0 0 0.5px rgba(26, 86, 219, 0.2);
            border-right: 1px solid rgba(255, 255, 255, 0.06);
            position: relative;
            z-index: 2;
        }

        nav h3 {
            font-family: 'Outfit', sans-serif;
            text-align: center;
            letter-spacing: 1px;
            font-size: 1.05rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            /* Reemplazamos el border-bottom sólido por un pseudo-element
               con gradiente azul→violeta, más acorde al design system */
            border-bottom: none;
            padding: 0 0 12px;
            margin: 0 0 8px;
            color: var(--ink-900);
        }

        nav h3 img {
            width: 26px;
            height: 26px;
            object-fit: contain;
            flex: 0 0 auto;
            filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.28));
        }

        nav h3 span {
            display: inline-block;
            line-height: 1;
        }

        /* Separador decorativo bajo el título de la nav,
           con gradiente que refleja el design system */
        nav h3::after {
            content: '';
            display: block;
            height: 1px;
            background: linear-gradient(
                90deg,
                transparent,
                rgba(26, 86, 219, 0.5),
                rgba(126, 58, 242, 0.5),
                transparent
            );
            margin-top: 12px;
        }

        .nav-btn {
            cursor: pointer;
            padding: 10px 12px;
            border-radius: 10px;
            transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
            font-size: 0.87rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            min-height: 42px;
            color: var(--ink-700);
            border: 1px solid transparent;
            /* reset de estilos nativos de <button> */
            background: none;
            text-align: left;
            width: 100%;
            font-family: inherit;
        }

        button.nav-btn:focus-visible,
        button.nav-sub-item:focus-visible {
            outline: 2px solid rgba(255, 255, 255, 0.6);
            outline-offset: -2px;
        }

        .nav-btn:hover {
            background: rgba(255, 255, 255, 0.07);
            transform: translateX(4px);
            color: var(--ink-900);
        }

        .nav-btn.active {
            background: var(--grad-primary);
            color: #ffffff;
            border-color: rgba(255, 255, 255, 0.15);
            box-shadow: 0 8px 20px rgba(26, 86, 219, 0.35);
        }

        .btn-logout { margin-top: auto; background: rgba(96,149,248,0.12); color: #7baff8; border: 1px solid rgba(96,149,248,0.35); }
        .btn-logout:hover { background: rgba(96,149,248,0.18); color: #a5c4fc; border-color: rgba(96,149,248,0.5); }

        .nav-sep {
            height: 1px;
            margin: 5px 10px;
            background: rgba(255, 255, 255, 0.10);
            border: none;
            flex-shrink: 0;
        }

        /* Separador vertical entre tabs del ABM clientes */
        .cli-tab-vsep {
            display: inline-block;
            width: 1px;
            height: 18px;
            background: rgba(255, 255, 255, 0.12);
            align-self: center;
            flex-shrink: 0;
        }
        .btn-salir { background: rgba(239,68,68,0.10); color: #f87171; border: 1px solid rgba(239,68,68,0.30); margin-top: 8px; }
        .btn-salir:hover { background: rgba(239,68,68,0.18); color: #fca5a5; border-color: rgba(239,68,68,0.5); }
        .btn-min { background: rgba(26, 86, 219, 0.25); color: var(--ink-700); margin-top: 4px; }
        .btn-min:hover { background: rgba(26, 86, 219, 0.4); color: var(--ink-900); }
        .hidden-role { display: none !important; }

        .nav-btn-group { position: relative; }
        .nav-btn-group .nav-subbmenu {
            display: none;
            position: fixed;
            background: #0d1825;
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 10px;
            min-width: 180px;
            z-index: 99999;
            overflow: hidden;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
        }
        .nav-btn-group .nav-subbmenu.open { display: block; }
        .nav-subbmenu .nav-sub-item {
            padding: 10px 16px;
            cursor: pointer;
            font-size: 0.87rem;
            font-weight: 600;
            color: var(--ink-700);
            white-space: nowrap;
            transition: background 0.15s;
            /* reset de estilos nativos de <button> */
            background: none;
            border: none;
            text-align: left;
            width: 100%;
            font-family: inherit;
            display: block;
        }
        .nav-subbmenu .nav-sub-item:hover {
            background: rgba(255, 255, 255, 0.08);
            color: var(--ink-900);
        }

        /* ============================================
           Sistema de Botones Universal
        ============================================ */
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 7px;
            padding: 12px 24px;
            border-radius: 8px;
            border: none;
            font-family: inherit;
            font-size: 0.88rem;
            font-weight: 600;
            letter-spacing: 0.02em;
            cursor: pointer;
            white-space: nowrap;
            transition: box-shadow 0.2s ease, transform 0.15s ease, background 0.2s ease, opacity 0.2s ease;
            user-select: none;
            color: #ffffff;
        }
        .btn:active { transform: scale(0.98); }
        .btn:disabled, .btn.disabled {
            opacity: 0.4;
            cursor: not-allowed;
            pointer-events: none;
        }

        /* Tamaños */
        .btn-sm { padding: 8px 16px; font-size: 0.8rem; }
        .btn-lg { padding: 14px 32px; min-width: 200px; font-size: 0.95rem; }
        .btn-wide { min-width: 160px; }

        /* Variantes */
        .btn-primary {
            background: var(--grad-primary);
            box-shadow: 0 2px 10px rgba(26, 86, 219, 0.25);
        }
        .btn-primary:hover {
            opacity: 0.88;
            box-shadow: 0 6px 20px rgba(26, 86, 219, 0.45);
        }

        .btn-ok {
            background: var(--grad-ok);
            box-shadow: 0 2px 10px rgba(31, 157, 85, 0.25);
        }
        .btn-ok:hover {
            opacity: 0.88;
            box-shadow: 0 6px 20px rgba(31, 157, 85, 0.40);
        }

        .btn-danger {
            background: var(--grad-danger);
            box-shadow: 0 2px 10px rgba(176, 57, 47, 0.25);
        }
        .btn-danger:hover {
            opacity: 0.88;
            box-shadow: 0 6px 20px rgba(176, 57, 47, 0.40);
        }

        .btn-warn {
            background: var(--grad-warn);
            box-shadow: 0 2px 10px rgba(211, 138, 29, 0.25);
        }
        .btn-warn:hover {
            opacity: 0.88;
            box-shadow: 0 6px 20px rgba(211, 138, 29, 0.40);
        }

        .btn-secondary {
            background: var(--grad-secondary);
            box-shadow: 0 2px 10px rgba(53, 82, 137, 0.25);
        }
        .btn-secondary:hover {
            opacity: 0.88;
            box-shadow: 0 6px 20px rgba(53, 82, 137, 0.40);
        }

        .btn-ghost {
            background: var(--surface-soft-2);
            color: var(--ink-700);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        }
        .btn-ghost:hover {
            background: rgba(255, 255, 255, 0.11);
            color: var(--ink-900);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
        }

        /* Stats accordion */
        .stats-accordion-section {
            border: 1px solid #dbe5ee;
            border-radius: 12px;
            overflow: hidden;
            margin-bottom: 10px;
        }
        .stats-accordion-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            background: #f4f7fb;
            cursor: pointer;
            user-select: none;
            border: none;
            width: 100%;
            font-family: inherit;
            font-size: 0.95rem;
            font-weight: 600;
            color: var(--ink-900);
            text-align: left;
            transition: background 0.15s;
        }
        .stats-accordion-header:hover { background: #e8eef8; }
        .stats-accordion-header.open {
            background: linear-gradient(135deg, rgba(26,86,219,0.07), rgba(126,58,242,0.07));
            border-bottom: 1px solid #dbe5ee;
            color: #1a56db;
        }
        .stats-accordion-arrow { font-size: 0.72rem; transition: transform 0.22s; margin-left: 8px; }
        .stats-accordion-header.open .stats-accordion-arrow { transform: rotate(180deg); }
        .stats-accordion-body { display: none; padding: 16px; }
        .stats-accordion-body.open { display: block; }

        main {
            flex: 1;
            padding: 20px 24px;
            overflow-y: auto;
            position: relative;
            z-index: 1;
        }

        .header-status {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
            background: #0a1426;
            backdrop-filter: none;
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 14px;
            padding: 10px 14px;
            box-shadow: var(--elev-1);
            position: sticky;
            top: 0;
            z-index: 20;
        }

        .header-tools {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-left: auto;
        }

        #page-title {
            display: none;
        }

        .badge-licencia {
            background: rgba(211, 138, 29, 0.15);
            border: 1px solid rgba(211, 138, 29, 0.35);
            color: #ecaa3c;
            border-radius: 999px;
            padding: 6px 12px;
            font-size: 0.82rem;
            font-weight: 700;
        }

        .view-section { display: none; animation: fadeInUp 0.3s ease; }
        .view-section.active { display: block; }
        /* Mesas view: toolbar fijo + solo el plano/grilla scrollea */
        .mesas-view-container { display: flex; flex-direction: column; overflow: hidden; height: calc(100vh - 110px); min-height: 300px; margin-bottom: 0; }
        .mesas-toolbar { flex: 0 0 auto; padding: 0 0 10px 0; border-bottom: 1px solid rgba(148,163,184,0.15); }
        .mesas-scroll-area { flex: 1; overflow-y: auto; min-height: 0; padding-top: 12px; }
