    ::-webkit-scrollbar { width: 6px; height: 6px; }
    ::-webkit-scrollbar-track { background: #f3ecdc; }
    ::-webkit-scrollbar-thumb { background: #d3c8b0; border-radius: 4px; }
    ::-webkit-scrollbar-thumb:hover { background: #a39a86; }

    /* ===== TEMA: DÍA (crema, descansa la vista) / NOCHE ===== */
    .bg-white { background-color: #fffcf4; }
    .focus\:bg-white:focus { background-color: #fffcf4; }
    .bg-\[\#f4f5f8\] { background-color: #f1eadb; }
    html[data-theme="noche"] { filter: invert(1) hue-rotate(180deg); background-color: #e9e4d8; }
    html[data-theme="noche"] .bg-white { background-color: #e2dccd; }
    html[data-theme="noche"] .bg-slate-50 { background-color: #ebe5d6; }
    html[data-theme="noche"] .bg-slate-100 { background-color: #ddd6c5; }
    html[data-theme="noche"] body { background-color: #e9e4d8; }
    html[data-theme="noche"] img, html[data-theme="noche"] video, html[data-theme="noche"] .tk,
    html[data-theme="noche"] .theme-toggle { filter: invert(1) hue-rotate(180deg); }
    html[data-theme="noche"] .tk img { filter: grayscale(1) !important; }
    html[data-theme="noche"] .tk img.tk-logo { filter: grayscale(1) !important; }
    html[data-theme="noche"] ::-webkit-scrollbar-track { background: #ddd6c5; }
    html[data-theme="noche"] ::-webkit-scrollbar-thumb { background: #b8af98; }
    @media print { html[data-theme="noche"] { filter: none !important; } html[data-theme="noche"] .tk { filter: none !important; } }

    .theme-toggle { position: relative; width: 56px; height: 28px; border-radius: 999px; border: 1px solid #e3c98a; padding: 0; cursor: pointer; flex-shrink: 0;
      background: linear-gradient(180deg, #ffe9b0, #fbd07a); transition: background .35s, border-color .35s; overflow: hidden; }
    .theme-toggle .tt-stars { position: absolute; inset: 0; opacity: 0; transition: opacity .35s;
      background-image: radial-gradient(1.2px 1.2px at 12px 8px, #fff 99%, transparent), radial-gradient(1px 1px at 22px 19px, #fff 99%, transparent), radial-gradient(1px 1px at 33px 7px, #fff 99%, transparent); }
    .theme-toggle .tt-knob { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff7d6; box-shadow: 0 1px 4px rgba(0,0,0,.3);
      transition: transform .35s cubic-bezier(.4,1.4,.5,1), background .35s; display: flex; align-items: center; justify-content: center; }
    .theme-toggle .tt-sun, .theme-toggle .tt-moon { position: absolute; width: 14px; height: 14px; transition: opacity .25s, transform .35s; }
    .theme-toggle .tt-sun { color: #f59e0b; opacity: 1; }
    .theme-toggle .tt-moon { color: #475569; opacity: 0; transform: rotate(-40deg); }
    html[data-theme="noche"] .theme-toggle { background: linear-gradient(180deg, #1e293b, #0f172a); border-color: #334155; }
    html[data-theme="noche"] .theme-toggle .tt-stars { opacity: 1; }
    html[data-theme="noche"] .theme-toggle .tt-knob { transform: translateX(28px); background: #e2e8f0; }
    html[data-theme="noche"] .theme-toggle .tt-sun { opacity: 0; transform: rotate(60deg); }
    html[data-theme="noche"] .theme-toggle .tt-moon { opacity: 1; transform: rotate(0); }
    .tabular-numbers { font-variant-numeric: tabular-numbers; }
    .btn-tactile:active { transform: scale(0.985); }
    .receipt-paper {
      background: #ffffff;
      color: #0f172a;
      box-shadow: 0 10px 30px -10px rgba(0,0,0,0.25);
      font-family: 'JetBrains Mono', monospace;
    }

    .legal-texto h4 { font-weight: 700; color: #1f1b16; margin: 14px 0 4px; font-size: 12px; }
    .legal-texto h4:first-child { margin-top: 0; }
    .legal-texto p { margin: 0 0 6px; }
    /* ===== CELULAR Y TABLET VERTICAL (hasta 900px). Escritorio y tablet no cambian ===== */
    #posMobileBar { display: none !important; }
    @media (max-width: 767px), (min-width: 768px) and (max-width: 900px) and (orientation: portrait) {
      html, body { overscroll-behavior: none; }
      input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea { font-size: 16px !important; }
      #mainAppFooter { display: none !important; }

      /* Cabecera en dos filas */
      #mainAppHeader:not(.hidden) { height: auto !important; flex-wrap: wrap; padding: 8px 12px; row-gap: 8px; column-gap: 8px; }
      #hdrLeft { order: 1; flex: 1 1 0%; min-width: 0; gap: 8px; flex-wrap: nowrap; }
      #hdrSep1, #hdrSep2, #headerRoleBadge, #headerConnectionText, #liveClock { display: none !important; }
      #hdrNames { min-width: 0; gap: 6px; }
      #headerLocalName { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
      #headerConnectionBadge { padding: 3px 5px; }
      #hdrRight { display: contents; }
      #hdrRight > .theme-toggle { order: 2; }
      #hdrUser { order: 3; }
      #roleNav { order: 4; width: 100%; overflow-x: auto; }
      #roleNav > button { flex: 1 1 0%; text-align: center; padding-left: 8px; padding-right: 8px; }
      #masterRestaurantSelectorWrap { max-width: 46vw; }
      #masterRestaurantSelect { max-width: 34vw; text-overflow: ellipsis; }

      /* Punto de venta por secciones */
      #view-pos:not(.hidden) { display: flex !important; flex-direction: column; }
      #view-pos > aside, #view-pos > section { grid-column: auto; width: 100%; flex: 1 1 0%; min-height: 0; }
      #view-pos[data-mp="lado"] > #posCatalogSection, #view-pos[data-mp="lado"] > #posTicketAside,
      #view-pos[data-mp="catalogo"] > #posTablesAside, #view-pos[data-mp="catalogo"] > #posSellerAside, #view-pos[data-mp="catalogo"] > #posTicketAside,
      #view-pos[data-mp="ticket"] > #posTablesAside, #view-pos[data-mp="ticket"] > #posSellerAside, #view-pos[data-mp="ticket"] > #posCatalogSection { display: none !important; }
      #view-pos:not(.hidden) #posMobileBar { display: grid !important; grid-template-columns: 1fr 1fr 1.4fr; gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
      .mb-btn { height: 42px; border-radius: 12px; font-size: 12px; font-weight: 700; color: #5a5345; background: #f3ecdc; border: 1px solid #e7decb; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
      .mb-btn.mb-activo { background: #1f1c17; color: #fff; border-color: #1f1c17; }
      .mb-btn-main { background: #ea580c; color: #fff; border-color: #ea580c; }
      .mb-btn-main.mb-activo { background: #c2410c; border-color: #c2410c; }
      .mb-info { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; opacity: .95; }
      #tablesGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      #productsGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      #productsGrid > .col-span-3 { grid-column: 1 / -1; }
      #productSearchInput + span { display: none; }
      #ticketItemsBody button { min-width: 30px; min-height: 30px; }
      #posSellerAside, #posTablesAside { border-right: 0; }

      /* Cocina */
      #view-kds > div:first-child { height: auto; flex-wrap: wrap; padding: 8px 12px; row-gap: 8px; }
      #view-kds > div:first-child p { display: none; }
      #view-kds > div:first-child > div:last-child { width: 100%; }
      #view-kds > div:first-child > div:last-child > div { flex-wrap: wrap; gap: 6px; }
      #view-kds > div.p-6 { padding: 12px; gap: 12px; }

      /* Administración */
      #view-admin > div:first-child { padding: 0 8px; }
      #view-admin > div:first-child > div:last-child { display: none; }
      #adminTabContent { padding: 12px; }
      #adminTabContent .p-8 { padding: 16px; }
      #adminTabContent .p-6 { padding: 14px; }
      #adminTabContent .p-5 { padding: 14px; }
      #adminTabContent .flex.justify-between { flex-wrap: wrap; row-gap: 8px; }
      #adminTabContent table { display: block; max-width: 100%; overflow-x: auto; }
      #view-master > div:first-child { height: auto; flex-wrap: wrap; padding: 8px 12px; row-gap: 6px; }

      /* Ventanas emergentes */
      #modalCobro .grid.grid-cols-2 { grid-template-columns: minmax(0, 1fr); }
      #modalPrecuenta > div { overflow: hidden !important; max-height: 94vh; }
      #modalPrecuenta > div > div:first-child { min-height: 0; flex: 1 1 auto; }
      .fixed.inset-0 { padding: 10px; }
      .fixed.inset-0 > div { max-height: 94vh; overflow-y: auto; }
      .fixed.inset-0 > div.p-6, .fixed.inset-0 > div.p-8 { padding: 16px; }
    }
    .bg-pattern {
      background-color: #0c1527;
      background-image: radial-gradient(#1e293b 1px, transparent 1px);
      background-size: 20px 20px;
    }
    @keyframes marqueeContinuous {
      0% { transform: translateX(0%); }
      100% { transform: translateX(-50%); }
    }
    .marquee-track-continuous {
      display: inline-flex;
      width: max-content;
      animation: marqueeContinuous 12s linear infinite;
    }
    .marquee-track-continuous:hover { animation-play-state: paused; }

    /* ===== BOLETA / TICKET TÉRMICO (estilo recibo de venta) ===== */
    .tk { background:#fff; color:#111; font-family:'JetBrains Mono', ui-monospace, monospace; font-size:11px; line-height:1.35; padding:14px 12px; margin:0 auto; }
    .tk-w80 { width:302px; }
    .tk-w58 { width:219px; font-size:10px; }
    .tk-center { text-align:center; }
    .tk-logo { max-height:56px; max-width:70%; margin:0 auto 6px; display:block; object-fit:contain; filter:grayscale(1); }
    .tk-name { font-size:1.35em; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
    .tk-muted { color:#333; }
    .tk-small { font-size:.88em; }
    .tk-hr { border:0; border-top:1px dashed #111; margin:7px 0; }
    .tk-hr-solid { border:0; border-top:1.5px solid #111; margin:6px 0; }
    .tk-title { font-weight:800; letter-spacing:.12em; text-transform:uppercase; }
    .tk-row { display:flex; justify-content:space-between; gap:8px; }
    .tk-row > span:last-child { text-align:right; }
    .tk-items { width:100%; border-collapse:collapse; }
    .tk-items th { font-weight:600; text-align:right; padding:0 0 3px; font-size:.9em; }
    .tk-items th:first-child { text-align:left; }
    .tk-items td { text-align:right; padding:0; vertical-align:top; white-space:nowrap; }
    .tk-items td.tk-iname { text-align:left; font-weight:800; text-transform:uppercase; white-space:normal; padding-top:4px; }
    .tk-items tr.tk-nums td { padding-bottom:3px; border-bottom:1px solid #ddd; }
    .tk-inote { font-weight:400; text-transform:none; font-size:.9em; display:block; }
    .tk-total { font-size:1.3em; font-weight:800; }

    .tk-page { margin-top:12px; padding-top:12px; border-top:2px dashed #94a3b8; }
    #printArea { display:none; }
    @media print {
      @page { margin: 0; }
      html, body { height:auto !important; overflow:visible !important; background:#fff !important; }
      body > *:not(#printArea) { display:none !important; }
      #printArea { display:block !important; }
      #printArea .tk { box-shadow:none; padding:4px 6px; }
      #printArea .tk-w80 { width:80mm; }
      #printArea .tk-w58 { width:58mm; }
      #printArea .tk-page { margin:0; padding:0; border:0; page-break-after:always; break-after:page; }
      #printArea .tk-page:last-child { page-break-after:auto; break-after:auto; }
    }


/* ===== Plano de mesas (pestaña Mesas) ===== */
#view-mesas { background: #efe6d3; }
.pm-root { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 10px; color: #2f2619; font-size: 13px; }
.pm-root button, .pm-root input, .pm-root select { font: inherit; color: inherit; }
.pm-root button { cursor: pointer; }
.pm-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.pm-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 3px; background: #e4d8bf; border: 1px solid #d3c3a1; border-radius: 12px; max-width: 100%; }
.pm-tab { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-weight: 700; color: #6d5d41; white-space: nowrap; }
.pm-tab i { font-style: normal; display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: #c0572b; color: #fffaf0; font-size: 11px; line-height: 18px; text-align: center; vertical-align: 1px; }
.pm-tab.on { background: #fffaf0; color: #2f2619; box-shadow: 0 1px 3px rgba(80,55,20,.25); }
.pm-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-right: auto; }
.pm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #fffaf0; border: 1px solid #dccfb3; font-weight: 600; font-size: 12px; }
.pm-chip .d { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.pm-chip .d.free { background: #3f7d4e; } .pm-chip .d.busy { background: #b4432a; } .pm-chip .d.bill { background: #a86a0c; }
.pm-chip .d.take { border: 2px dashed #ea580c; }
.pm-edit { border: 1px solid #c9b88f; background: #fffaf0; padding: 7px 14px; border-radius: 10px; font-weight: 700; }
.pm-edit.pm-edit-on { background: #ea580c; border-color: #ea580c; color: #fff; }
.pm-tools, .pm-presets, .pm-inspector { background: #fffaf0; border: 1px solid #dccfb3; border-radius: 14px; padding: 8px; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.pm-tool { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; background: transparent; padding: 7px 11px; border-radius: 10px; font-weight: 600; }
.pm-tool svg { width: 16px; height: 16px; }
.pm-tool:hover { background: #f3ead6; }
.pm-tool.on { background: #ffedd5; border-color: #ea580c; color: #c2410c; }
.pm-sep { width: 1px; align-self: stretch; background: #dccfb3; margin-inline: 4px; }
.pm-lbl { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #8a7a5b; }
.pm-suelos { display: inline-flex; gap: 6px; }
.pm-suelo { width: 30px; height: 30px; border-radius: 9px; border: 2px solid #d3c3a1; padding: 0; }
.pm-suelo.on { border-color: #ea580c; box-shadow: 0 0 0 2px #fed7aa; }
.pm-suelo.s-crema { background: #f6eedc; } .pm-suelo.s-madera { background: repeating-linear-gradient(0deg, #d9b98a 0 8px, #c9a775 8px 9px); }
.pm-suelo.s-baldosa { background: conic-gradient(#e3d6bb 25%, #efe6d2 0 50%, #e3d6bb 0 75%, #efe6d2 0) 0 0/14px 14px; }
.pm-suelo.s-piedra { background: #d8d2c5; } .pm-suelo.s-pasto { background: #bfd49b; } .pm-suelo.s-oscuro { background: #4a4238; }
.pm-ghostbtn { border: 1px solid #c9b88f; background: #fffaf0; padding: 7px 12px; border-radius: 10px; font-weight: 600; }
.pm-ghostbtn:disabled { opacity: .45; cursor: default; }
.pm-danger { border: 1px solid #b4432a; color: #b4432a; background: transparent; padding: 7px 12px; border-radius: 10px; font-weight: 700; }
.pm-hint { color: #7a6a4b; font-size: 12px; margin-left: auto; flex-basis: 100%; }
.pm-presets { gap: 8px; }
.pm-preset { display: grid; justify-items: center; gap: 1px; border: 1px solid #dccfb3; background: #fff; border-radius: 12px; padding: 6px 10px 7px; min-width: 92px; }
.pm-preset svg { width: 56px; height: 38px; fill: #c8965a; stroke: #8a5a2b; stroke-width: 2; }
.pm-preset b { font-size: 12px; } .pm-preset small { color: #8a7a5b; font-size: 11px; }
.pm-preset.on { border-color: #ea580c; background: #fff4e5; box-shadow: 0 0 0 2px #fed7aa; }
.pm-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.pm-planwrap { background: #cdb88f; border: 1px solid #b8a173; border-radius: 18px; padding: 8px; min-width: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 18px rgba(70,45,10,.18); }
.pm-svg { width: 100%; height: auto; display: block; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: 12px; }
.pm-wall { stroke: #6b4a2b; stroke-width: 10; stroke-linecap: round; fill: none; }
.pm-wall.sel { stroke: #ea580c; }
.pm-wall-hit { stroke: transparent; stroke-width: 24; stroke-linecap: round; fill: none; }
.pm-ghost { stroke: #ea580c; stroke-width: 10; stroke-linecap: round; opacity: .55; }
.pm-guide { stroke: #ea580c; stroke-width: 1.3; stroke-dasharray: 5 4; }
.pm-measure { font-family: ui-monospace, Menlo, monospace; font-size: 12px; fill: #c2410c; font-weight: 700; paint-order: stroke; stroke: #fffaf0; stroke-width: 4px; text-anchor: middle; }
.pm-handle { fill: #fff; stroke: #ea580c; stroke-width: 3; cursor: grab; }
.pm-handle.ctl { fill: #ea580c; stroke: #fff; }
.pm-chair { fill: #8b6238; stroke: #5e3f1f; stroke-width: 1; }
.pm-body { fill: #c8965a; stroke: #8a5a2b; stroke-width: 2.5; }
.pm-inner { fill: #d9ac72; stroke: none; opacity: .9; }
.pm-tbl { cursor: pointer; outline: none; }
.pm-svg.edit .pm-tbl { cursor: grab; }
.pm-svg.tool-pared, .pm-svg.tool-curva, .pm-svg.tool-mesa { cursor: crosshair; }
.pm-svg.tool-borrar { cursor: not-allowed; }
.pm-tbl:hover .pm-body, .pm-tbl:focus-visible .pm-body { stroke: #ea580c; }
.pm-tbl.t-free .pm-body { fill: #c8965a; } .pm-tbl.t-free .pm-inner { fill: #dcb27a; }
.pm-tbl.t-take .pm-body { stroke: #ea580c; stroke-dasharray: 7 4; }
.pm-tbl.t-busy .pm-body { fill: #c4573a; stroke: #7c2a16; } .pm-tbl.t-busy .pm-inner { fill: #d4704f; }
.pm-tbl.t-busy .pm-chair { fill: #8d3d28; }
.pm-tbl.t-bill .pm-body { fill: #d6a02f; stroke: #8a5d0a; } .pm-tbl.t-bill .pm-inner { fill: #e4b650; }
.pm-tbl.t-bill .pm-chair { fill: #92661a; }
.pm-tbl.t-sel .pm-body { stroke: #ea580c; stroke-width: 4; }
.pm-tlabel { font-weight: 800; font-size: 16px; fill: #3b2410; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.pm-tbl.t-busy .pm-tlabel, .pm-tbl.t-busy .pm-tsub, .pm-tbl.t-busy .pm-tsub2 { fill: #fff; }
.pm-tsub, .pm-tsub2 { font-family: ui-monospace, Menlo, monospace; font-size: 14px; font-weight: 700; fill: #3b2410; text-anchor: middle; pointer-events: none; }
.pm-tsub2 { font-size: 12px; opacity: .85; }
.pm-inspector { align-items: end; gap: 10px 14px; }
.pm-inspector label { display: grid; gap: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #8a7a5b; }
.pm-inspector input, .pm-inspector select { height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid #c9b88f; background: #fff; min-width: 90px; }
.pm-step { display: inline-flex; gap: 4px; align-items: center; }
.pm-step input { width: 66px; min-width: 0; text-align: center; }
.pm-step button { width: 32px; height: 36px; border-radius: 9px; border: 1px solid #c9b88f; background: #fffaf0; font-weight: 800; }
.pm-ititle { font-size: 14px; } .pm-vacio { color: #8a7a5b; }
/* ventana de pedido */
.pm-veil { position: fixed; inset: 0; background: rgba(40,28,12,.5); display: grid; place-items: center; padding: 16px; z-index: 40; }
.pm-veil.hidden { display: none; }
.pm-sheet { width: min(980px, 100%); height: min(660px, calc(100% - 8px)); background: #fffaf0; border-radius: 22px; box-shadow: 0 18px 50px rgba(45,30,10,.38); display: flex; flex-direction: column; overflow: hidden; border: 1px solid #dccfb3; color: #2f2619; }
.pm-sheet button, .pm-sheet input { font: inherit; color: inherit; cursor: pointer; }
.pm-sh-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #e7dcc4; flex-wrap: wrap; }
.pm-sh-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.pm-meta { color: #7a6a4b; font-size: 12px; }
.pm-state { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.pm-state.free { background: #e3efdf; color: #3f7d4e; } .pm-state.busy { background: #f6ddd3; color: #b4432a; }
.pm-state.bill { background: #f8e7bf; color: #a86a0c; } .pm-state.take { background: #ffedd5; color: #c2410c; }
.pm-x { margin-left: auto; border: 1px solid #c9b88f; background: #f3ead6; width: 36px; height: 36px; border-radius: 10px; font-size: 20px; line-height: 1; }
.pm-tabs2 { display: none; }
.pm-sh-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); }
.pm-menu { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid #e7dcc4; }
.pm-menu-top { padding: 10px 14px; display: grid; gap: 8px; }
.pm-menu-top input { height: 38px; border-radius: 10px; border: 1px solid #c9b88f; background: #fff; padding: 0 12px; width: 100%; cursor: text; }
.pm-cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.pm-cat { border: 1px solid #c9b88f; background: #fffaf0; padding: 6px 12px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.pm-cat[aria-pressed="true"] { background: #2f2619; color: #fffaf0; border-color: #2f2619; }
.pm-prods { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 14px 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; align-content: start; }
.pm-prod { text-align: left; border: 1px solid #e7dcc4; background: #fff; border-radius: 12px; padding: 10px; display: grid; gap: 6px; min-height: 78px; align-content: space-between; position: relative; }
.pm-prod:hover { border-color: #c9b88f; background: #fbf5e8; }
.pm-prod:active { transform: scale(.98); }
.pm-prod b { font-weight: 700; line-height: 1.2; display: block; }
.pm-prod small { display: block; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #8a7a5b; }
.pm-prod .pr { color: #c2410c; font-weight: 700; }
.pm-prod.ag { opacity: .55; }
.pm-prod i { position: absolute; right: 8px; top: 8px; font-style: normal; font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 6px; }
.pm-prod i.ag { background: #f6ddd3; color: #b4432a; } .pm-prod i.low { background: #f8e7bf; color: #a86a0c; }
.pm-prod u { text-decoration: none; position: absolute; right: 8px; bottom: 8px; min-width: 22px; height: 22px; border-radius: 11px; background: #ea580c; color: #fff; font-weight: 800; font-size: 11px; display: grid; place-items: center; padding-inline: 6px; }
.pm-ticket { display: flex; flex-direction: column; min-height: 0; background: #f6eedc; }
.pm-ticket h3 { margin: 0; padding: 12px 16px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: #8a7a5b; font-weight: 800; }
.pm-lines { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px; display: grid; gap: 6px; align-content: start; }
.pm-line { background: #fffaf0; border: 1px solid #e7dcc4; border-radius: 12px; padding: 8px 10px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
.pm-line .nm { font-weight: 700; }
.pm-line .sub { grid-column: 1; font-size: 11px; color: #7a6a4b; }
.pm-line .sub em { display: block; font-style: italic; }
.pm-line .sent { color: #3f7d4e; font-weight: 700; } .pm-line .new { color: #c2410c; font-weight: 700; }
.pm-line .amt { text-align: right; font-weight: 700; grid-column: 2; grid-row: 2; }
.pm-nota { border: 0; background: transparent; text-decoration: underline; color: #7a6a4b; font-size: 11px; padding: 0 4px; }
.pm-qty { display: inline-flex; align-items: center; gap: 2px; justify-self: end; }
.pm-qty button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid #c9b88f; background: #f3ead6; font-weight: 800; }
.pm-qty b { min-width: 24px; text-align: center; }
.pm-none { text-align: center; color: #8a7a5b; padding: 30px 14px; }
.pm-foot { border-top: 1px solid #e7dcc4; padding: 10px 14px 14px; display: grid; gap: 8px; }
.pm-tot { display: flex; justify-content: space-between; color: #7a6a4b; }
.pm-tot.big { color: #2f2619; font-size: 20px; font-weight: 800; }
.pm-send { height: 46px; border-radius: 12px; border: 0; background: #ea580c; color: #fff; font-weight: 800; }
.pm-send:disabled { opacity: .45; cursor: default; }
.pm-link { border: 0; background: transparent; color: #7a6a4b; text-decoration: underline; font-size: 12px; }
@media (max-width: 760px) {
  .pm-root { padding: 8px 10px 12px; }
  .pm-sheet { height: calc(100% - 8px); border-radius: 18px; }
  .pm-sh-body { grid-template-columns: minmax(0, 1fr); }
  .pm-tabs2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 8px 12px; border-bottom: 1px solid #e7dcc4; }
  .pm-tabs2 button { height: 36px; border: 1px solid #c9b88f; background: #fffaf0; border-radius: 10px; font-weight: 700; }
  .pm-tabs2 button[aria-pressed="true"] { background: #2f2619; color: #fffaf0; }
  .pm-sheet[data-pane="menu"] .pm-ticket, .pm-sheet[data-pane="ticket"] .pm-menu { display: none; }
  .pm-menu { border-right: 0; }
  .pm-tool span { display: none; }
}
@media (prefers-reduced-motion: no-preference) { .pm-sheet { animation: pmUp .18s ease-out; } }
@keyframes pmUp { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.pm-root .hidden { display: none !important; }
.pm-planwrap { display: flex; justify-content: center; }
.pm-svg { max-height: calc(100vh - 200px); min-height: 280px; }
#view-resumen { background: #f4f5f8; }
.mc-root { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px 24px; }
.pm-planwrap { overflow: auto; max-height: calc(100vh - 190px); }
.pm-planwrap .pm-svg { max-height: none; min-height: 0; }
.pm-planwrap:not(.pm-zoomed) .pm-svg { max-height: calc(100vh - 210px); }
.pm-zoom { display: inline-flex; align-items: center; gap: 2px; background: #fffaf0; border: 1px solid #dccfb3; border-radius: 10px; padding: 2px; }
.pm-zoom button { width: 30px; height: 30px; border: 0; background: transparent; border-radius: 8px; font-weight: 800; font-size: 16px; }
.pm-zoom button:hover { background: #f3ead6; }
.pm-zoom span { min-width: 54px; text-align: center; font-size: 12px; font-weight: 700; color: #6d5d41; }
.pm-tamanos { display: inline-flex; gap: 4px; }
.pm-tam { border: 1px solid #c9b88f; background: #fffaf0; padding: 6px 10px; border-radius: 9px; font-weight: 600; font-size: 12px; }
.pm-tam.on { background: #ffedd5; border-color: #ea580c; color: #c2410c; }
.pm-ghostbtn.pm-on { background: #ffedd5; border-color: #ea580c; color: #c2410c; }

/* Reservas: la mesa reservada se ve azul */
.pm-tbl.t-res .pm-body { fill: #3b82c4; stroke: #1d4f8a; } .pm-tbl.t-res .pm-inner { fill: #6aa6dc; }
.pm-tbl.t-res .pm-chair { fill: #2a5f9e; }
.pm-tbl.t-res .pm-tlabel, .pm-tbl.t-res .pm-tsub { fill: #fff; }
.pm-chip .d.res { background: #3b82c4; }
.pm-state.res { background: #dbeafe; color: #1d4f8a; }
.pm-res { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 14px 10px; padding: 9px 12px; border-radius: 12px; background: #dbeafe; border: 1px solid #9cc3ea; color: #1d4f8a; font-size: 12px; }
.pm-res.hidden { display: none; }
.pm-res button { padding: 6px 14px; border-radius: 9px; background: #1d4f8a; color: #fff; font-weight: 800; font-size: 12px; cursor: pointer; }
.pm-res-btn { border-color: #9cc3ea; background: #eef5fc; color: #1d4f8a; }

.pm-rdot { fill: #3b82c4; stroke: #fff; stroke-width: 2; }
.pm-rdot-t { fill: #fff; font-size: 11px; font-weight: 800; text-anchor: middle; pointer-events: none; }

.tour-resalte { outline: 3px solid #f2711c; outline-offset: 2px; border-radius: 10px; position: relative; z-index: 96; animation: tourPulso 1.4s ease-in-out infinite; }
@keyframes tourPulso { 50% { outline-color: rgba(242,113,28,.35); } }
@media (prefers-reduced-motion: reduce) { .tour-resalte { animation: none; } }

/* ===== Administración: menú vertical a la izquierda, con scroll propio ===== */
.adm-nav { display: flex; flex-direction: row; gap: 4px; overflow-x: auto; padding: 8px 12px; background: #fff; border-bottom: 1px solid #e2e8f0; flex-shrink: 0; scrollbar-width: thin; }
.adm-local { display: none; }
.adm-grupo { display: none; }
.adm-tab { white-space: nowrap; text-align: left; font-size: 12px; font-weight: 700; color: #475569; padding: 8px 12px; border-radius: 10px; cursor: pointer; border: 0; background: transparent; flex-shrink: 0; }
.adm-tab:hover { background: #f1f5f9; color: #0f172a; }
.adm-tab.adm-tab-on { background: #0f172a; color: #fff; }
.adm-tab.hidden { display: none; }
@media (min-width: 768px) {
  .adm-nav { flex-direction: column; gap: 2px; width: 210px; overflow-x: hidden; overflow-y: auto; padding: 14px 10px 24px; border-bottom: 0; border-right: 1px solid #e2e8f0; min-height: 0; }
  .adm-local { display: block; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #94a3b8; padding: 2px 10px 10px; }
  .adm-local b { display: block; font-size: 13px; letter-spacing: 0; text-transform: none; color: #0f172a; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .adm-grupo { display: block; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #94a3b8; padding: 14px 10px 4px; }
  .adm-grupo.hidden { display: none; }
  .adm-tab { width: 100%; }
}

/* ===== Comandas: subpestañas por área (cocina, bar, las que agregue el administrador) ===== */
.kds-tabs { display: flex; gap: 6px; padding: 8px 12px 0; overflow-x: auto; flex-shrink: 0; }
.kds-tabs.hidden { display: none; }
.kds-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px 10px 0 0; font-size: 12px; font-weight: 800; background: #e2e8f0; color: #475569; border: 0; cursor: pointer; white-space: nowrap; }
.kds-tab i { font-style: normal; font-size: 10px; background: #fff; color: #0f172a; border-radius: 999px; padding: 1px 7px; }
.kds-tab.on { background: #0f172a; color: #fff; }
.kds-tab.on i { background: #f2711c; color: #fff; }

/* ===== Pedido de mesa: foto del producto y botón de renombrar ===== */
.pm-prod.con-foto { grid-template-columns: 46px 1fr; align-items: center; gap: 8px; }
.pm-img { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; background: #f3ead6; }
.pm-ren { border: 1px solid #c9b88f; background: #f3ead6; height: 36px; padding: 0 10px; border-radius: 10px; font-size: 12px; font-weight: 700; margin-left: auto; }
.pm-ren + .pm-x { margin-left: 6px; }
.adm-nav.adm-nav-una { display: none; }

/* Mientras se comprueba si hay una sesión guardada no se muestra el login (evita el parpadeo al recargar) */
html.nx-arranca #view-login { opacity: 0; pointer-events: none; }
#view-login { transition: opacity .12s ease; }

/* Encabezado en pantallas medianas (por debajo de ~1330 px): se ocultan textos para que todo quepa sin tocar PC grande */
@media (min-width: 768px) and (max-width: 1329px) {
  #mainAppHeader { padding-left: 10px; padding-right: 10px; }
  #hdrLeft { gap: 8px; min-width: 0; flex: 1 1 auto; }
  #hdrRight { gap: 8px; flex-shrink: 0; }
  #hdrNames { gap: 6px; min-width: 0; }
  #hdrSep1, #hdrSep2, #headerRoleBadge, #headerConnectionText { display: none !important; }
  #headerLocalName { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
  #headerConnectionBadge { padding: 3px 6px; }
  #roleNav button { padding-left: 9px; padding-right: 9px; }
  #masterRestaurantSelectorWrap { padding: 2px 8px; }
  #masterRestaurantSelectorWrap > span { display: none; }
  #masterRestaurantSelect { max-width: 150px; }
}
@media (min-width: 768px) and (max-width: 1100px) {
  #liveClock { display: none; }
  #hdrUser { gap: 6px; }
  #roleNav button { padding-left: 7px; padding-right: 7px; }
}

/* Punto de Venta en pantallas de ~900 a 1100 px: columnas más anchas a los lados y nada cortado */
@media (min-width: 901px) and (max-width: 1100px), (min-width: 768px) and (max-width: 900px) and (orientation: landscape) {
  #view-pos { grid-template-columns: 210px minmax(0, 1fr) 350px; }
  #view-pos > aside, #view-pos > section { grid-column: auto !important; }
  #sectorTabsContainer button { font-size: 11px; padding-left: 4px; padding-right: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #posTablesAside > div:nth-child(2) { flex-wrap: wrap; justify-content: flex-start; gap: 2px 10px; }
  #posTicketAside > div:first-child { flex-wrap: wrap; gap: 8px; }
  #posTicketAside > div:first-child > div:last-child { flex-wrap: wrap; }
  #ticketTableTitle { white-space: nowrap; }
  #posTicketAside button { white-space: nowrap; }
}
@media (min-width: 768px) and (max-width: 1100px) { #footTerminal { display: none; } }

/* Modales del Panel Maestro: mismo tema oscuro del panel */
#modalResetDueno > div,
#modalNuevoRestaurante > div,
#modalEditarRestaurante > div { background: #0f172a; border-color: #334155; color: #e2e8f0; }
#modalResetDueno .text-slate-900, .text-slate-800, .text-slate-700,
#modalNuevoRestaurante .text-slate-900, .text-slate-800, .text-slate-700,
#modalEditarRestaurante .text-slate-900, .text-slate-800, .text-slate-700 { color: #f1f5f9; }
#modalResetDueno .text-slate-600, .text-slate-500, .text-slate-400,
#modalNuevoRestaurante .text-slate-600, .text-slate-500, .text-slate-400,
#modalEditarRestaurante .text-slate-600, .text-slate-500, .text-slate-400 { color: #94a3b8; }
#modalResetDueno input, select, textarea,
#modalNuevoRestaurante input, select, textarea,
#modalEditarRestaurante input, select, textarea { background: #020617; border-color: #334155; color: #f1f5f9; }
#modalResetDueno .bg-slate-50, .bg-slate-100,
#modalNuevoRestaurante .bg-slate-50, .bg-slate-100,
#modalEditarRestaurante .bg-slate-50, .bg-slate-100 { background: #1e293b; }
#modalResetDueno .border-slate-100, .border-slate-200, .border-slate-300,
#modalNuevoRestaurante .border-slate-100, .border-slate-200, .border-slate-300,
#modalEditarRestaurante .border-slate-100, .border-slate-200, .border-slate-300 { border-color: #334155; }
#modalResetDueno button.bg-slate-100,
#modalNuevoRestaurante button.bg-slate-100,
#modalEditarRestaurante button.bg-slate-100 { color: #e2e8f0; }
.pm-line .nm small.opc { display: block; font-size: 11px; font-weight: 600; color: #6d5d41; line-height: 1.2; margin-top: 2px; }

/* Pantalla de ingreso: queda fija, sin barra de desplazamiento. Se compacta sola en pantallas bajas. */
#view-login > div:first-child { overflow: hidden; }
#view-login > div:first-child > div:first-child { margin-block: auto; padding-block: 0; }
@media (max-height: 780px) {
  #view-login > div:first-child { padding-block: 20px; }
  #view-login > div:first-child > div:first-child > div:first-child { margin-bottom: 18px; }
  #view-login form { row-gap: 12px; }
  #view-login form > div > label { margin-bottom: 4px; }
}
@media (max-height: 640px) {
  #view-login > div:first-child { padding-block: 10px; }
  #view-login > div:first-child > div:first-child > div:first-child { margin-bottom: 10px; }
  #view-login > div:first-child > div:first-child > div:nth-child(2) { padding: 16px; }
  #view-login form { row-gap: 8px; }
  #view-login form input[type="text"], #view-login form input[type="password"] { height: 38px; }
}
@media (max-height: 470px) { #view-login > div:first-child { overflow-y: auto; } }

/* Mesas: estilo plano (vista desde arriba, sin bisel ni sombra). El color queda para el estado de la mesa */
.pm-planwrap { padding: 0; overflow: hidden; background: #f6eedc; border-color: #d9cdb2; box-shadow: none; }
.pm-planwrap[data-suelo="madera"] { background: #d4b283; } .pm-planwrap[data-suelo="baldosa"] { background: #e9dfc6; }
.pm-planwrap[data-suelo="piedra"] { background: #d8d2c5; } .pm-planwrap[data-suelo="pasto"] { background: #bfd49b; }
.pm-planwrap[data-suelo="oscuro"] { background: #4a4238; }
.pm-svg { border-radius: 0; }
.pm-svg g[filter] { filter: none; }
.pm-wall { stroke: #34302a; stroke-width: 6; stroke-linecap: square; }
.pm-svg.fl-oscuro .pm-wall { stroke: #d9d1c0; }
.pm-svg.fl-pasto .pm-wall { stroke: #4b4a3a; }
.pm-wall.sel { stroke: #ea580c !important; }
.pm-limite { fill: none; stroke: #ea580c; stroke-width: 1.5; stroke-dasharray: 8 6; opacity: .45; pointer-events: none; }
.pm-chair { fill: #ebe4d3; stroke: #8d846f; stroke-width: 1; }
.pm-chair.pm-back { fill: #cfc6b1; }
.pm-svg.fl-oscuro .pm-chair { fill: #6d6556; stroke: #2c2822; } .pm-svg.fl-oscuro .pm-chair.pm-back { fill: #857c6a; }
.pm-body { fill: #fffdf8; stroke: #34302a; stroke-width: 1.8; }
.pm-tbl:hover .pm-body, .pm-tbl:focus-visible .pm-body { stroke: #ea580c; }
.pm-tbl.t-free .pm-body { fill: #fffdf8; }
.pm-tbl.t-take .pm-body { fill: #fff1e2; stroke: #ea580c; stroke-width: 2; stroke-dasharray: 6 4; }
.pm-tbl.t-busy .pm-body { fill: #b4432a; stroke: #7c2a16; }
.pm-tbl.t-busy .pm-chair { fill: #dfa595; stroke: #8d3d28; } .pm-tbl.t-busy .pm-chair.pm-back { fill: #c9806d; }
.pm-tbl.t-bill .pm-body { fill: #e0aa3a; stroke: #8a5d0a; }
.pm-tbl.t-bill .pm-chair { fill: #f0d598; stroke: #92661a; } .pm-tbl.t-bill .pm-chair.pm-back { fill: #deba68; }
.pm-tbl.t-res .pm-body { fill: #dbe8f7; stroke: #2a5f9e; stroke-width: 2; }
.pm-tbl.t-res .pm-chair { fill: #c3d8ef; stroke: #2a5f9e; } .pm-tbl.t-res .pm-chair.pm-back { fill: #9fc0e4; }
.pm-tbl.t-res .pm-tlabel, .pm-tbl.t-res .pm-tsub { fill: #1d3f6e; }
.pm-tbl.t-sel .pm-body { stroke: #ea580c; stroke-width: 3; }
.pm-tlabel { fill: #2b2620; font-size: 15px; }
.pm-tsub, .pm-tsub2 { fill: #5d564a; }
.pm-tbl.t-bill .pm-tlabel, .pm-tbl.t-bill .pm-tsub, .pm-tbl.t-bill .pm-tsub2 { fill: #2b2008; }
.pm-preset svg { fill: #fffdf8; stroke: #34302a; stroke-width: 1.8; }
.pm-planwrap.pm-zoomed { overflow: auto; justify-content: flex-start; }
.pm-zoom button { display: inline-flex; align-items: center; justify-content: center; color: #4a4033; cursor: pointer; }
.pm-zoom button:disabled { opacity: .35; cursor: default; }
.pm-zoom .pm-zoom-pct { width: auto; min-width: 50px; padding: 0 6px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
