:root {
    --color-bg: #ffffff;
    --color-surface: #ffffff;
    --color-surface-2: #f5f5f5;

    --color-primary: #111111;
    --color-primary-dark: #2b2b2b;
    --color-accent: #111111;

    --color-text: #111111;
    --color-text-muted: #666666;

    --color-danger: #c62828;
    --color-success: #2e7d32;

    /* Botones: contraste normal/hover (sobrescritos por ThemeRepository) */
    --theme-button: var(--color-primary);
    --theme-button-text: #ffffff;
    --theme-button-hover: var(--color-primary-dark);
    --theme-button-hover-text: #ffffff;
    --theme-button-active: var(--color-primary-dark);
    --theme-button-active-text: #ffffff;
    --theme-button-secondary: var(--color-surface-2);
    --theme-button-secondary-text: var(--color-text);
    --theme-button-secondary-hover: #e8e4dc;
    --theme-button-secondary-hover-text: #1a1a1a;
    --theme-button-danger: var(--color-danger);
    --theme-button-danger-text: #ffffff;
    --theme-button-danger-hover: #9a1f1f;
    --theme-button-danger-hover-text: #ffffff;

    --color-artemisa-navy: #111111;
    --color-artemisa-navy-deep: #1f1f1f;
    --color-logo-navy: #ffffff;

    --color-border: rgba(0, 0, 0, 0.14);

    --color-interaction: #39D353;
    --color-interaction-soft: #f5fff6;
    --color-interaction-shadow: rgba(57, 211, 83, 0.16);

    --badge-color-nuevo: #39D353;
    --badge-color-oferta: #c62828;
    --badge-color-recomendado: #1e88e5;
    --badge-color-mas-vendido: #ef6c00;
    --badge-color-premium: #111111;
    --badge-color-temporada: #7b1fa2;
    --badge-color-agotado: #757575;
    --badge-color-proximamente: #f5c518;

    --badge-radius: 999px;
    --badge-padding: 2px 7px;
    --badge-font-size: 0.62rem;
    --badge-font-weight: 700;
    --badge-letter-spacing: 0.04em;
    --badge-border: 1px solid rgba(255, 255, 255, 0.22);
    --badge-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);

    --radius: 12px;
    --radius-sm: 8px;

    --shadow: 0 4px 18px rgba(0, 0, 0, 0.08);

    --header-h: auto;
    --cart-h: 64px;
    --cart-item-row-h: 5.25rem;
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100dvh;
    padding-bottom: calc(var(--cart-h) + var(--safe-bottom) + 16px);
    line-height: 1.5;
}

.install-banner {
    background: var(--color-primary);
    color: #ffffff;
    padding: 12px 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.app-header {
    position: relative;
    z-index: 10;
    background: var(--pos-header, var(--theme-header, var(--color-surface)));
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    overflow: visible;
    flex: 0 0 auto;
}

.header-hero {
    position: relative;
    width: 100%;
    min-height: 0;
    padding: 0.35rem 0.75rem 0.4rem;
    overflow: visible;
    background-color: var(--pos-header, var(--color-logo-navy));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

/* Una sola fila: MENÚ | Logo | (equilibrio) */
.pos-brand-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 10px;
    width: 100%;
    min-width: 0;
    padding: 0.1rem 0;
}

.pos-brand-side {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 44px;
}

.pos-brand-side-left {
    justify-content: flex-start;
    justify-self: start;
}

.pos-brand-side-right {
    justify-content: flex-end;
    justify-self: end;
    min-width: 72px;
}

.pos-header-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: 100%;
    padding: 0;
}

.header-logo-central {
    display: block;
    width: auto;
    max-width: min(48vw, 220px);
    height: auto;
    max-height: clamp(56px, 16vw, 96px);
    object-fit: contain;
    object-position: center center;
    margin: 0 auto;
}

.pos-header-actions,
.pos-header-top {
    display: contents;
}

.pos-app-menu-wrap {
    position: relative;
    z-index: 20;
}

.pos-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0.35rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    cursor: pointer;
    white-space: nowrap;
}

.pos-menu-toggle-bars {
    display: block;
    width: 14px;
    height: 10px;
    border-top: 2px solid #fff;
    border-bottom: 2px solid #fff;
    background: linear-gradient(#fff, #fff) center / 100% 2px no-repeat;
}

.pos-menu-toggle.is-open,
.pos-menu-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.22);
}

.pos-app-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: auto;
    z-index: 50;
    min-width: 220px;
    width: max-content;
    max-width: min(280px, calc(100vw - 24px));
    max-height: min(70vh, 420px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0.35rem;
    border-radius: 12px;
    background: #161616;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

@media (max-width: 640px) {
    .pos-app-menu {
        width: min(280px, calc(100vw - 24px));
        min-width: 0;
    }
}

.pos-app-menu[hidden] {
    display: none !important;
}

.pos-app-menu-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    min-height: 44px;
    padding: 0.45rem 0.7rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 650;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.pos-app-menu-item:hover,
.pos-app-menu-item:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    outline: none;
}

.pos-app-menu-ico {
    width: 1.4rem;
    text-align: center;
    flex: 0 0 auto;
}

.pos-app-menu-item-exit {
    margin-top: 0.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0 0 8px 8px;
}

.pos-header-top .btn-icon,
.pos-brand-side .btn-icon,
.pos-menu-toggle {
    color: #ffffff;
}

/* Compat: selectores antiguos apuntan a las nuevas filas */
.header-actions,
.header-hero-front {
    display: contents;
}

.order-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: clamp(10px, 2vw, 18px);
    margin-top: auto;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    width: 100%;
}

.order-meta-field {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin: 0;
}

.order-meta-mesa {
    flex: 0 0 auto;
}

.order-meta-mesero {
    flex: 1 1 auto;
    min-width: 0;
}

.order-meta-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-artemisa-navy);
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
    letter-spacing: 0.02em;
}

.order-meta input {
    height: 28px;
    padding: 0 8px;
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    background: #ffffff;
    color: #111111;
    font-size: 0.82rem;
    line-height: 28px;
    box-sizing: border-box;
}

.order-meta input:focus {
    outline: none;
    border-color: #111111;
    background: #ffffff;
}

.order-meta-mesa input {
    width: 48px;
    min-width: 48px;
    text-align: center;
    padding: 0 4px;
}

.order-meta-mesero input {
    flex: 1;
    width: 100%;
    min-width: 0;
}

/* Barra resumen sesión (sobre categorías, sin tapar logo) */
.order-session-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    padding: 4px 12px;
    background: var(--color-surface-2);
    border-bottom: 1px solid var(--color-border);
    position: relative;
    z-index: 3;
    min-height: 36px;
}

.order-session-bar .btn-sm {
    flex-shrink: 0;
    padding: 4px 8px;
    font-size: 0.72rem;
}

.order-session-bar[hidden] {
    display: none !important;
}

.order-session-summary {
    flex: 1;
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.25;
    color: var(--color-text);
    min-width: 0;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
}

/* Modal bienvenida / tipo de pedido */
body.session-locked .app-header,
body.session-locked .pos-subhead,
body.session-locked .pos-attach-bar,
body.session-locked .menu-grid,
body.session-locked .cart-panel {
    filter: blur(7px);
    pointer-events: none;
    user-select: none;
}

.session-modal {
    max-width: 440px;
    width: calc(100% - 24px);
    border: 1px solid var(--color-border);
}

.session-modal::backdrop {
    background: rgba(10, 22, 40, 0.5);
    backdrop-filter: blur(10px);
}

.session-form {
    padding: 24px 20px 20px;
}

.session-modal-brand {
    text-align: center;
    margin-bottom: 20px;
}

.session-modal-logo {
    display: block;
    width: min(100px, 28vw);
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    object-position: center;
    margin: 0 auto 12px;
    border-radius: 0;
    filter: none;
}

.session-modal-title {
    margin: 0 0 6px;
    font-size: 1.15rem;
    color: var(--color-accent);
    line-height: 1.25;
}

.session-modal-welcome {
    margin: 0;
    font-size: 0.88rem;
    color: var(--color-text-muted);
}

.order-type-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
    padding: 0;
    border: none;
}

.order-type-option {
    flex: 1 1 calc(50% - 6px);
    min-width: 140px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface-2);
    cursor: pointer;
    font-size: 0.9rem;
    transition: border-color 0.15s, background 0.15s;
}

.order-type-option:has(input:checked) {
    border-color: var(--color-primary);
    background: rgba(201, 162, 39, 0.12);
}

.order-type-option input {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    flex-shrink: 0;
}

.session-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin-bottom: 16px;
}

.session-fields-llevar {
    flex-direction: column;
    align-items: stretch;
}

.session-inline-field {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.session-field-mesa {
    flex: 0 0 auto;
}

.session-field-mesa input {
    width: 52px;
    min-width: 52px;
    text-align: center;
}

.session-field-staff {
    flex: 1 1 160px;
    min-width: 0;
}

.session-field-staff-full {
    width: 100%;
}

.session-field-staff-full input {
    flex: 1;
    min-width: 0;
}

.session-field-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-artemisa-navy);
    white-space: nowrap;
    filter: brightness(1.35);
}

.session-fields input {
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface-2);
    color: var(--color-text);
    font-size: 0.88rem;
    box-sizing: border-box;
    flex: 1;
    min-width: 0;
}

.session-fields input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.session-error {
    margin: 0 0 12px;
    padding: 8px 10px;
    font-size: 0.82rem;
    color: var(--color-danger);
    background: rgba(214, 69, 69, 0.12);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(214, 69, 69, 0.35);
}

.session-error[hidden] {
    display: none !important;
}

.session-submit {
    font-size: 1rem;
    letter-spacing: 0.04em;
    padding: 14px;
}

.session-client-group {
    margin-bottom: 16px;
}

.session-client-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

.session-client-group input {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface-2);
    color: var(--color-text);
    font-size: 0.88rem;
    box-sizing: border-box;
}

/* Modal buscar / reimprimir comandas */
.reprint-modal {
    max-width: 640px;
    width: calc(100% - 20px);
    max-height: 90dvh;
}

.reprint-modal-inner {
    display: flex;
    flex-direction: column;
    max-height: 90dvh;
    padding: 16px 18px 18px;
}

.reprint-search {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.reprint-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.reprint-search input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface-2);
    color: var(--color-text);
    font-size: 0.9rem;
}

.reprint-list-wrap {
    flex: 1;
    min-height: 200px;
    max-height: min(52dvh, 480px);
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
}

.reprint-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.reprint-item {
    border-bottom: 1px solid var(--color-border);
}

.reprint-item:last-child {
    border-bottom: none;
}

.reprint-item-toggle {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border: none;
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.reprint-item-toggle:hover {
    background: rgba(255, 255, 255, 0.03);
}

.reprint-item-toggle.open .reprint-toggle-icon {
    transform: rotate(180deg);
}

.reprint-summary-line {
    flex: 1;
    font-size: 0.8rem;
    line-height: 1.4;
    min-width: 0;
    text-align: left;
    word-break: break-word;
}

.reprint-highlight {
    background: #f0d040;
    color: #1a1008;
    padding: 0 2px;
    border-radius: 2px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.reprint-toggle-icon {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    transition: transform 0.15s;
}

.reprint-detail {
    padding: 0 14px 14px;
}

.reprint-receipt {
    margin: 0 0 12px;
    padding: 12px;
    background: #fff;
    color: #111;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    max-height: 320px;
    overflow-y: auto;
}

.reprint-receipt .reprint-highlight {
    background: #fff3a0;
    color: #111;
}

.reprint-detail-loading,
.reprint-detail-error {
    margin: 0 0 10px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.reprint-detail-error {
    color: var(--color-danger);
}

.reprint-btn {
    width: 100%;
}

.reprint-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.reprint-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.reprint-page-info {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 16px 10px;
    margin-top: 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 4;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    background: var(--pos-category, var(--theme-category, transparent));
}

.order-session-bar + .category-tabs {
    padding-top: 12px;
    margin-top: 4px;
    border-top: 1px solid transparent;
}

.category-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
    flex: 0 0 auto;
    padding: 8px 16px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--pos-category-active, var(--theme-category-active, var(--theme-button, #111111)));
    color: var(--pos-category-active-text, var(--theme-category-active-text, var(--theme-button-text, #ffffff)));
    border-color: var(--pos-category-active, var(--theme-category-active, var(--theme-button, #111111)));
}

.tab-btn.active *,
.tab-btn.active svg {
    color: inherit;
}

.tab-btn:hover:not(.active):not(:disabled) {
    background: var(--color-surface-2);
    color: var(--color-text);
    border-color: var(--color-border);
}

.tab-btn:focus-visible {
    outline: 2px solid var(--theme-accent, var(--color-accent));
    outline-offset: 2px;
}

.menu-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: min-content;
    align-content: start;
    gap: 12px;
    padding: 12px 16px 16px;
    width: 100%;
    max-width: 1200px;
    min-width: 0;
    margin: 0 auto;
    align-items: stretch;
    box-sizing: border-box;
    overflow-x: hidden;
}

@media (max-width: 640px) {
    .menu-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        padding: 10px 12px calc(var(--cart-h) + var(--safe-bottom) + 16px);
        overflow-x: hidden;
        overflow-y: auto;
        align-content: start;
        grid-auto-rows: min-content;
    }

    .menu-card {
        height: auto;
        min-height: auto;
        overflow: visible;
        align-self: stretch;
    }
}

@media (min-width: 641px) {
    .menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
        gap: 16px;
        padding: 20px;
        align-content: start;
        grid-auto-rows: min-content;
    }
}

@media (min-width: 900px) {
    .menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    }
}

.menu-card {
    position: relative;
    background: var(--pos-card, var(--theme-card, var(--color-surface)));
    border: 1px solid var(--pos-card-border, var(--theme-border, var(--color-primary)));
    border-radius: var(--radius);
    padding: 10px 12px 12px;
    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        background-color 0.2s ease;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;

    /* Altura por contenido. min-height:0 + height:100% + overflow:hidden
       en un grid flex comprimía todas las filas al alto del viewport. */
    height: auto;
    min-height: auto;
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;

    box-sizing: border-box;
    overflow: visible;

    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Cabecera semántica: título + badges en flujo (sin solapamiento) */
.menu-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}

.menu-card__title,
.menu-card h3 {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.2;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    word-break: break-word;
    color: var(--pos-card-text, var(--theme-text, var(--color-text)));
}

.product-badges {
    position: static;
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    max-width: 45%;
    pointer-events: none;
}

/* Componente único: tamaño, borde, tipografía, sombra y posición compartidos */
.product-badge {
    max-width: 100%;
    padding: var(--badge-padding);
    border: var(--badge-border);
    border-radius: var(--badge-radius);
    background: var(--pos-badge, var(--theme-badge, var(--badge-color-nuevo)));
    color: #ffffff;
    font-family: var(--font);
    font-size: var(--badge-font-size);
    font-weight: var(--badge-font-weight);
    letter-spacing: var(--badge-letter-spacing);
    line-height: 1.35;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: var(--badge-shadow);
}

.product-badge.badge-nuevo {
    background: var(--pos-badge, var(--badge-color-nuevo));
}

.product-badge.badge-oferta {
    background: var(--pos-badge, var(--badge-color-oferta));
}

.product-badge.badge-recomendado {
    background: var(--pos-badge, var(--badge-color-recomendado));
}

.product-badge.badge-mas-vendido {
    background: var(--pos-badge, var(--badge-color-mas-vendido));
}

.product-badge.badge-premium {
    background: var(--pos-badge, var(--badge-color-premium));
}

.product-badge.badge-temporada {
    background: var(--pos-badge, var(--badge-color-temporada));
}

.product-badge.badge-agotado {
    background: var(--pos-badge, var(--badge-color-agotado));
}

.product-badge.badge-proximamente {
    background: var(--pos-badge, var(--badge-color-proximamente));
    color: #111111;
    border-color: rgba(0, 0, 0, 0.1);
}

@media (hover: hover) {
    .menu-card:hover {
        background: var(--color-interaction-soft);
        border-color: var(--color-interaction);
        transform: translateY(-2px);
        box-shadow:
            0 0 0 2px var(--color-interaction),
            0 8px 20px var(--color-interaction-shadow);
    }
}

.menu-card:active {
    background: var(--color-interaction-soft);
    border-color: var(--color-interaction);
    transform: scale(0.985);
    box-shadow:
        0 0 0 2px var(--color-interaction),
        0 4px 14px var(--color-interaction-shadow);
}

.menu-card:focus-visible {
    outline: none;
    border-color: var(--color-interaction);
    box-shadow: 0 0 0 2px var(--color-interaction);
}

.menu-card .description {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.3;
    color: var(--pos-text-muted, var(--theme-text-muted, var(--color-text-muted)));
    flex: 0 0 auto;
    min-height: calc(2 * 1.3 * 0.75rem);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.menu-card .description:empty::before {
    content: '\00a0';
    visibility: hidden;
}

.menu-card .price {
    margin: 6px 0 0;
    padding: 0;
    flex-shrink: 0;
    font-size: clamp(0.85rem, 2.4vw, 1rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--pos-card-price, var(--theme-text-price, var(--color-accent)));
    word-break: break-word;
}

.cart-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding-bottom: var(--safe-bottom);
}

.cart-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--pos-button, var(--theme-button, var(--color-primary)));
    color: var(--pos-button-text, var(--theme-button-text, #ffffff));
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease, color 0.2s ease;
}

.cart-toggle:hover {
    background: var(--theme-button-hover, var(--color-primary-dark));
    color: var(--theme-button-hover-text, var(--theme-button-text, #ffffff));
}

.cart-toggle:focus-visible {
    outline: 2px solid var(--theme-accent, var(--color-accent));
    outline-offset: 2px;
    background: var(--theme-button-hover, var(--color-primary-dark));
    color: var(--theme-button-hover-text, #ffffff);
}

.cart-toggle > * {
    color: inherit;
}

.cart-count {
    background: #ffffff;
    color: #111111;
    min-width: 28px;
    height: 28px;
    border: 1px solid #111111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.cart-label { flex: 1; text-align: left; }

.cart-total { font-size: 1.1rem; }

.cart-content {
    display: none;
    background: var(--pos-cart-bg, var(--color-surface));
    border-top: 1px solid var(--color-border);
    max-height: min(82dvh, calc(100dvh - 120px));
    overflow: hidden;
    flex-direction: column;
}

.cart-panel.open .cart-content {
    display: flex;
}

.cart-panel.open .cart-toggle {
    background: var(--color-surface-2);
    color: var(--color-text);
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.cart-header h2 {
    margin: 0;
    font-size: 1rem;
}

.cart-items-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cart-items {
    list-style: none;
    margin: 0;
    padding: 8px 16px;
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(var(--cart-item-row-h) * 5);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.cart-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

.cart-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
    min-height: var(--cart-item-row-h);
    box-sizing: border-box;
}

.cart-item:last-child { border-bottom: none; }

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.cart-item-name {
    font-weight: 600;
    flex: 1;
}

.cart-item-price {
    color: var(--color-accent);
    font-weight: 600;
    white-space: nowrap;
}

.cart-item-details {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.cart-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.cart-summary {
    padding: 6px 16px 4px;
    border-top: none;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    padding: 2px 0;
    gap: 8px;
}

.tip-row {
    color: var(--color-text-muted);
    font-size: 0.78rem;
}

.tip-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.tip-manual-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
    padding-top: 0;
}

.tip-manual-row label {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.tip-manual-row input {
    width: 88px;
    padding: 5px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface-2);
    color: var(--color-text);
    font-size: 0.85rem;
    text-align: right;
}

.tip-label input {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
}

.total-row {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--pos-total, var(--theme-text-price, var(--color-accent)));
    padding-top: 2px;
    margin-top: 2px;
    border-top: 1px dashed var(--color-border);
}

.cart-actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 8px;
    padding: 8px 16px calc(10px + var(--safe-bottom));
}

.cart-actions .btn {
    padding: 10px 14px;
    font-size: 0.9rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

.btn > span,
.btn > small,
.btn .nav-ico,
.btn svg {
    color: inherit;
}

.btn svg {
    stroke: currentColor;
    fill: none;
}

.btn svg[fill]:not([fill="none"]) {
    fill: currentColor;
}

.btn:disabled,
.btn[disabled],
.btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:focus-visible {
    outline: 2px solid var(--theme-accent, var(--color-accent));
    outline-offset: 2px;
}

.btn-primary {
    background: var(--pos-button, var(--theme-button, var(--color-primary)));
    color: var(--pos-button-text, var(--theme-button-text, #ffffff));
    border: 1px solid transparent;
}

.btn-primary:hover:not(:disabled):not([aria-disabled="true"]) {
    background: var(--theme-button-hover, var(--color-primary-dark));
    color: var(--theme-button-hover-text, var(--theme-button-text, #ffffff));
}

.btn-primary:active:not(:disabled):not([aria-disabled="true"]),
.btn-primary.is-active {
    background: var(--theme-button-active, var(--theme-button-hover, var(--color-primary-dark)));
    color: var(--theme-button-active-text, var(--theme-button-hover-text, #ffffff));
}

.btn-primary:focus-visible {
    background: var(--theme-button-hover, var(--color-primary-dark));
    color: var(--theme-button-hover-text, #ffffff);
}

.btn-secondary {
    background: var(--theme-button-secondary, var(--color-surface-2));
    color: var(--theme-button-secondary-text, var(--color-text));
    border: 1px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled):not([aria-disabled="true"]) {
    background: var(--theme-button-secondary-hover, #e8e4dc);
    color: var(--theme-button-secondary-hover-text, #1a1a1a);
    border-color: var(--theme-button-secondary-hover, #e8e4dc);
}

.btn-secondary:active:not(:disabled):not([aria-disabled="true"]) {
    background: var(--theme-button-secondary-hover, #e8e4dc);
    color: var(--theme-button-secondary-hover-text, #1a1a1a);
}

.btn-secondary:focus-visible {
    background: var(--theme-button-secondary-hover, #e8e4dc);
    color: var(--theme-button-secondary-hover-text, #1a1a1a);
}

.btn-danger {
    background: var(--theme-button-danger, var(--color-danger));
    color: var(--theme-button-danger-text, #ffffff);
    border: 1px solid transparent;
}

.btn-danger:hover:not(:disabled):not([aria-disabled="true"]) {
    background: var(--theme-button-danger-hover, #9a1f1f);
    color: var(--theme-button-danger-hover-text, #ffffff);
}

.btn-danger:active:not(:disabled):not([aria-disabled="true"]),
.btn-danger:focus-visible {
    background: var(--theme-button-danger-hover, #9a1f1f);
    color: var(--theme-button-danger-hover-text, #ffffff);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--color-text);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
}

.btn-icon:hover:not(:disabled) {
    color: var(--theme-accent, var(--color-accent));
    background: var(--color-surface-2);
}

.btn-icon:focus-visible {
    outline: 2px solid var(--theme-accent, var(--color-accent));
    outline-offset: 2px;
    color: var(--theme-accent, var(--color-accent));
}

.modal {
    border: none;
    border-radius: var(--radius);
    padding: 0;
    max-width: 480px;
    width: calc(100% - 32px);
    max-height: 90dvh;
    overflow-y: auto;
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow);
}

.modal::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

.modal form { padding: 20px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-description {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin: 0 0 4px;
}

.modal-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-accent);
    margin: 0 0 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group h3 {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface-2);
    color: var(--color-text);
    font-size: 1rem;
    font-family: inherit;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0;
    max-width: 160px;
}

.qty-btn {
    width: 48px;
    height: 48px;
    border: 1px solid var(--color-border);
    background: var(--color-surface-2);
    color: var(--color-text);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.qty-btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

#itemQuantity {
    width: 64px;
    text-align: center;
    border-radius: 0;
    border-left: none;
    border-right: none;
    -moz-appearance: textfield;
}

#itemQuantity::-webkit-outer-spin-button,
#itemQuantity::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface-2);
    color: var(--color-text);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
    touch-action: manipulation;
}

.chip.selected {
    background: var(--color-danger);
    border-color: var(--color-danger);
    color: white;
}

.chip.extra-selected {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #ffffff;
}

.chip.extra-selected .chip-price {
    color: #ffffff;
    opacity: 0.85;
}

.chip .chip-price {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    opacity: 0.95;
}

.modal-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 1.1rem;
    border-top: 1px solid var(--color-border);
    margin-top: 8px;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.hint {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 8px 0 0;
}

.empty-cart {
    text-align: center;
    color: var(--color-text-muted);
    padding: 20px 12px;
    min-height: auto;
}

/* POS: columna en flujo — el header reserva altura; el contenido scrollea debajo */
body.mesero-page {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    padding-bottom: 0;
}

body.mesero-page .env-test-banner,
body.mesero-page .app-header,
body.mesero-page .pos-attach-bar,
body.mesero-page .pos-subhead {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

body.mesero-page .menu-grid,
body.mesero-page .pos-orders-pane {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    align-content: start;
}

body.mesero-page .cart-panel {
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

body.mesero-page .menu-grid {
    padding-bottom: calc(var(--cart-h) + var(--safe-bottom) + 16px);
}

body.pos-tab-orders .menu-grid {
    padding-bottom: 16px;
}

/* Vista mesero — escritorio: menú + pedido lado a lado */
@media (min-width: 960px) {
    body.mesero-page {
        display: grid;
        grid-template-columns: 1fr min(400px, 34vw);
        grid-template-rows: auto auto auto auto 1fr;
        grid-template-areas:
            "banner banner"
            "header header"
            "attach attach"
            "subhead subhead"
            "menu cart";
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
        padding-bottom: 0;
    }

    body.mesero-page .env-test-banner {
        grid-area: banner;
    }

    body.mesero-page .app-header {
        grid-area: header;
        position: relative;
        z-index: 10;
    }

    body.mesero-page .pos-attach-bar {
        grid-area: attach;
    }

    body.mesero-page .pos-subhead {
        grid-area: subhead;
    }

    body.mesero-page .menu-grid {
        grid-area: menu;
        overflow-y: auto;
        align-content: start;
        max-width: none;
        margin: 0;
        min-height: 0;
        padding-bottom: 16px;
    }

    body.mesero-page .pos-orders-pane {
        grid-area: menu;
        overflow-y: auto;
        min-height: 0;
    }

    body.mesero-page .cart-panel {
        grid-area: cart;
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        display: flex;
        flex-direction: column;
        border-left: 1px solid var(--color-border);
        background: var(--color-surface);
        min-height: 0;
        height: 100%;
    }

    body.mesero-page .cart-toggle {
        display: none;
    }

    body.mesero-page .cart-content {
        display: flex !important;
        flex: 1;
        flex-direction: column;
        max-height: none;
        border-top: none;
    }

    body.mesero-page .cart-close-mobile {
        display: none;
    }

    body.mesero-page .cart-items {
        max-height: none;
        flex: 1;
    }

    body.mesero-page .cart-items-wrap {
        flex: 1;
        min-height: calc(var(--cart-item-row-h) * 3);
    }

    body.mesero-page .cart-items:not(:empty) {
        max-height: calc(var(--cart-item-row-h) * 5);
    }

    body.mesero-page .header-hero {
        padding: 0.4rem 1rem 0.45rem;
        gap: 0;
    }

    body.mesero-page .header-logo-central {
        max-height: clamp(64px, 10vw, 92px);
        max-width: min(36vw, 240px);
    }
}

/* Móvil: una fila compacta MENÚ + logo */
@media (max-width: 640px), (max-height: 480px) and (orientation: landscape) {
    .header-hero {
        flex-direction: column;
        padding: 0.3rem 0.55rem 0.35rem;
        gap: 0;
    }

    .pos-brand-row {
        grid-template-columns: auto 1fr auto;
        column-gap: 8px;
        width: 100%;
        min-width: 0;
    }

    .pos-brand-side-right {
        min-width: 8px;
    }

    .pos-header-brand {
        min-width: 0;
        padding: 0;
    }

    .header-logo-central {
        max-width: min(46vw, 180px);
        max-height: clamp(52px, 15vw, 76px);
    }
}

@media (max-width: 480px) {
    .order-session-summary {
        font-size: 0.68rem;
    }

    .order-type-option {
        flex: 1 1 100%;
    }

    .header-logo-central {
        max-width: min(44vw, 160px);
        max-height: clamp(48px, 14vw, 68px);
    }
}

@media (max-width: 380px) {
    .pos-brand-row {
        column-gap: 6px;
    }

    .header-logo-central {
        max-height: 56px;
        max-width: min(42vw, 140px);
    }

    .pos-menu-toggle {
        padding: 0.3rem 0.55rem;
        font-size: 0.7rem;
    }

    .cart-toggle {
        padding: 12px 14px;
        font-size: 0.9rem;
    }

    .session-form {
        padding: 20px 16px 16px;
    }
}

.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--color-surface-2);
    color: var(--color-text);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    z-index: 180;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success { border-left: 4px solid var(--color-success); }
.toast.error { border-left: 4px solid var(--color-danger); }

/* Impresión */
.print-area { display: none; }

@media print {
    body * { visibility: hidden; }
    .print-area, .print-area * { visibility: visible; }
    .print-area {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 80mm;
        font-family: monospace;
        font-size: 12px;
        color: black;
        background: white;
    }
}

.receipt-print {
    width: 80mm;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    padding: 8px;
}

/* Página de instalación */
.install-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 20px;
    padding-bottom: 20px;
}

.install-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 480px;
    width: 100%;
}

.install-card h1 {
    margin: 0 0 12px;
    color: var(--color-accent);
}

.install-logo {
    display: block;
    width: min(140px, 50vw);
    height: auto;
    margin: 0 auto 16px;
    border-radius: 50%;
}

.install-requirements {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.install-requirements h2 {
    font-size: 1rem;
    margin: 0 0 8px;
}

.install-requirements ul {
    margin: 0;
    padding-left: 20px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
}

.alert-success { background: rgba(76, 175, 122, 0.2); border: 1px solid var(--color-success); }
.alert-error { background: rgba(214, 69, 69, 0.2); border: 1px solid var(--color-danger); }
.alert-info { background: rgba(200, 134, 10, 0.2); border: 1px solid var(--color-primary); }

.loading {
    text-align: center;
    padding: 48px;
    color: var(--color-text-muted);
}

.size-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.size-btn {
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface-2);
    color: var(--color-text);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.size-btn:hover:not(.active) {
    background: var(--theme-button-secondary-hover, #e8e4dc);
    color: var(--theme-button-secondary-hover-text, #1a1a1a);
}

.size-btn.active {
    background: var(--theme-button, var(--color-primary));
    color: var(--theme-button-text, #ffffff);
    border-color: var(--theme-button, var(--color-primary));
    font-weight: 600;
}

.size-btn.active:hover {
    background: var(--theme-button-hover, var(--color-primary-dark));
    color: var(--theme-button-hover-text, #ffffff);
    border-color: var(--theme-button-hover, var(--color-primary-dark));
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Login */
.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100dvh;
    padding: 0 20px 20px;
}

/* Banner DEMO/TEST: fila superior a ancho completo; no compartir eje horizontal con la card */
.login-page .env-test-banner {
    align-self: stretch;
    flex: 0 0 auto;
    margin-inline: -20px;
    width: calc(100% + 40px);
    max-width: none;
    box-sizing: border-box;
}

.login-card {
    width: 100%;
    max-width: 360px;
    margin-block: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 28px 24px;
}

.login-brand {
    text-align: center;
    margin-bottom: 24px;
}

.login-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 8px;
}

.login-brand h1 {
    margin: 0 0 4px;
    font-size: 1.1rem;
    color: var(--color-accent);
}

.login-logo {
    display: block;
    margin: 0 auto 12px;
    max-width: 220px;
    height: auto;
}

.login-logo-circular {
    display: block;
    width: min(200px, 72vw);
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    object-position: center;
    margin: 0 auto 12px;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.login-subtitle {
    margin-top: 4px;
}

.login-brand p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.pin-form input {
    width: 100%;
    padding: 14px;
    text-align: center;
    font-size: 1.25rem;
    letter-spacing: 0.3em;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface-2);
    color: var(--color-text);
    margin-bottom: 12px;
}

.btn-block {
    width: 100%;
}

.pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 20px;
}

.pin-key {
    height: 56px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface-2);
    color: var(--color-text);
    font-size: 1.25rem;
    cursor: pointer;
}

.pin-key.empty {
    visibility: hidden;
    pointer-events: none;
}

.install-form .form-group {
    margin-bottom: 16px;
}

/* Admin */
.admin-page {
    padding-bottom: 40px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.admin-header-brand {
    flex: 1;
    min-width: 0;
}

.admin-header-brand .header-logo-banner {
    display: block;
    width: auto;
    height: 44px;
    max-width: min(300px, 70vw);
    object-fit: contain;
}

.admin-header-sub {
    margin: 6px 0 0;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.admin-header h1 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--color-accent);
}

.admin-header p {
    margin: 4px 0 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.admin-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    gap: 24px;
}

.admin-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
}

.admin-section h2 {
    margin: 0 0 16px;
    font-size: 1.1rem;
}

.admin-section h3 {
    margin: 16px 0 8px;
    font-size: 0.95rem;
}

.admin-form {
    margin-bottom: 16px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-header h2 {
    margin: 0;
}

.admin-menu-list {
    display: grid;
    gap: 16px;
}

.admin-category {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.admin-category.inactive {
    opacity: 0.6;
}

.admin-category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--color-surface-2);
    flex-wrap: wrap;
}

.admin-category-header h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.badge {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.admin-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.admin-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.admin-item.inactive {
    opacity: 0.55;
}

.admin-item strong {
    display: block;
}

.admin-item span {
    color: var(--color-accent);
    font-size: 0.875rem;
}

.admin-item p {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.admin-item-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.admin-danger-zone {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.admin-danger-zone p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 0 0 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

@media (max-width: 500px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.admin-report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.report-preview {
    margin-top: 16px;
    padding: 16px;
    background: var(--color-surface-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.report-preview h3 {
    margin: 0 0 12px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.875rem;
}

.report-table th,
.report-table td {
    padding: 8px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}

.report-table th:last-child,
.report-table td:last-child {
    text-align: right;
}

/* Vista administrador en comandas: grises + selecciones amarillas */
body.admin-comandas-page {
    --color-bg: #ffffff;
    --color-surface: #ffffff;
    --color-surface-2: #f5f5f5;
    --color-artemisa-navy: #111111;
    --color-artemisa-navy-deep: #1f1f1f;
    --color-logo-navy: #ffffff;
    --color-text: #111111;
    --color-text-muted: #666666;
    --color-border: rgba(0, 0, 0, 0.14);
    --color-primary: #111111;
    --color-accent: #111111;
    --color-primary-dark: #2b2b2b;
}

body.admin-comandas-page .header-hero {
    background-color: var(--color-logo-navy);
}

body.admin-comandas-page .header-logo-central {
    filter: grayscale(1);
}

body.admin-comandas-page .header-actions .btn-icon,
body.admin-comandas-page .pos-header-top .btn-icon,
body.admin-comandas-page .pos-brand-side .btn-icon,
body.admin-comandas-page .pos-menu-toggle {
    color: #ffffff;
}

body.admin-comandas-page .app-header {
    background: var(--color-surface);
}

body.admin-comandas-page .tab-btn.active,
body.admin-comandas-page .size-btn.active,
body.admin-comandas-page .chip.selected,
body.admin-comandas-page .chip.extra-selected {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
}

body.admin-comandas-page .menu-card:hover,
body.admin-comandas-page .menu-card:focus-visible {
    background: var(--color-interaction-soft);
    border-color: var(--color-interaction);
    box-shadow:
        0 0 0 2px var(--color-interaction),
        0 8px 20px var(--color-interaction-shadow);
}

body.admin-comandas-page .menu-card:active {
    background: var(--color-interaction-soft);
    border-color: var(--color-interaction);
    box-shadow:
        0 0 0 2px var(--color-interaction),
        0 4px 14px var(--color-interaction-shadow);
}

body.admin-comandas-page .btn-primary {
    background: var(--theme-button, var(--color-primary));
    color: var(--theme-button-text, #ffffff);
}

body.admin-comandas-page .btn-primary:hover:not(:disabled) {
    background: var(--theme-button-hover, var(--color-primary-dark));
    color: var(--theme-button-hover-text, var(--theme-button-text, #ffffff));
}

body.admin-comandas-page .cart-toggle {
    background: var(--color-surface-2);
    border-top-color: var(--color-border);
}

body.admin-comandas-page .cart-count {
    background: var(--color-primary);
    color: var(--theme-button-text, #ffffff);
}

body.admin-comandas-page .menu-card .price {
    color: var(--color-accent);
}

body.admin-comandas-page .modal-price,
body.admin-comandas-page .modal-total strong {
    color: var(--color-accent);
}

/* ---------- Hub SUPERVISORA ---------- */
.hub-page {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: var(--theme-bg, var(--color-bg, #f5f0e8));
    color: var(--theme-text, var(--color-text, #1a1a1a));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    overflow-x: hidden;
}

.hub-page .env-test-banner {
    flex: 0 0 auto;
    width: 100%;
    align-self: stretch;
}

.hub-shell {
    width: min(calc(100% - 2rem), 480px);
    max-width: 520px;
    margin-inline: auto;
    margin-block: auto;
    display: grid;
    gap: 1.5rem;
    justify-items: stretch;
    padding: 1.25rem 0 2rem;
}

.hub-header {
    text-align: center;
}

.hub-logo {
    display: block;
    width: clamp(96px, 26vw, 140px);
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    object-position: center;
    margin: 0 auto 0.75rem;
}

.hub-title {
    margin: 0;
    font-size: clamp(1.35rem, 4.5vw, 1.75rem);
    font-weight: 700;
}

.hub-sub {
    margin: 0.35rem 0 0;
    font-size: 1rem;
}

.hub-role {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: var(--theme-text-muted, var(--color-text-muted, #6b6560));
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hub-actions {
    display: grid;
    gap: 0.85rem;
    width: 100%;
}

.hub-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.85rem;
    row-gap: 0.15rem;
    align-items: center;
    width: 100%;
    padding: 1.1rem 1.15rem;
    border-radius: 16px;
    border: 1px solid var(--theme-border, rgba(0,0,0,0.12));
    background: var(--theme-surface, #fff);
    color: inherit;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    min-height: 88px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.hub-card:hover {
    box-shadow: 0 10px 24px rgba(0,0,0,0.1);
}

.hub-card-primary:hover {
    background: var(--theme-button-hover, var(--color-primary-dark, #2b2b2b));
    color: var(--theme-button-hover-text, var(--theme-button-text, #fff));
}

.hub-card:active {
    transform: scale(0.98);
}

.hub-card-primary {
    background: var(--theme-button, #2c2c2c);
    color: var(--theme-button-text, #fff);
    border-color: transparent;
}

.hub-card-primary .hub-card-hint {
    color: rgba(255,255,255,0.78);
}

.hub-card-danger {
    border-color: rgba(198,40,40,0.35);
}

.hub-card-icon {
    grid-row: 1 / span 2;
    font-size: 1.6rem;
    line-height: 1;
}

.hub-card-label {
    font-size: 1.1rem;
    font-weight: 700;
}

.hub-card-hint {
    font-size: 0.85rem;
    color: var(--theme-text-muted, #6b6560);
}

.session-staff-note {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    color: var(--theme-text-muted, #6b6560);
    grid-column: 1 / -1;
}

@media (min-width: 768px) {
    .hub-actions {
        gap: 1rem;
    }
    .hub-card {
        padding: 1.25rem 1.35rem;
    }
}


/* ——— Pedidos abiertos / cuentas abiertas ——— */
.open-orders-modal {
    width: min(100vw - 0.5rem, 520px);
    max-height: min(96vh, 900px);
    padding: 0;
    border: none;
    border-radius: 14px;
    overflow: hidden;
}
.open-orders-modal::backdrop {
    background: rgba(20, 16, 12, 0.55);
}
.open-orders-inner {
    display: flex;
    flex-direction: column;
    max-height: min(96vh, 900px);
    background: var(--theme-surface, #fff);
    color: var(--theme-text, #1a1a1a);
    position: relative;
}
.open-orders-inner .modal-header {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.oo-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.25rem;
    padding: 0.5rem;
    background: var(--theme-bg, #f5f3ef);
}
.oo-tab {
    border: none;
    border-radius: 10px;
    padding: 0.55rem 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.25;
    background: transparent;
    color: var(--theme-text-muted, #6b6560);
    cursor: pointer;
}
.oo-tab.active {
    background: var(--theme-surface, #fff);
    color: var(--theme-text, #1a1a1a);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.oo-tab span {
    display: inline-block;
    min-width: 1.2rem;
    margin-left: 0.15rem;
    opacity: 0.75;
}
.oo-search {
    padding: 0.5rem 0.75rem;
}
.oo-search input {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.12);
    font-size: 1rem;
}
.oo-list-wrap {
    flex: 1;
    overflow: auto;
    padding: 0.25rem 0.75rem 1rem;
    -webkit-overflow-scrolling: touch;
}
.oo-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.oo-empty {
    text-align: center;
    color: var(--theme-text-muted, #6b6560);
    padding: 1.5rem 0.5rem;
}
.oo-card {
    border-radius: 12px;
    background: var(--theme-bg, #f7f5f1);
    overflow: hidden;
}
.oo-card-main {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 0.85rem 0.9rem;
    cursor: pointer;
    color: inherit;
}
.oo-card-top {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: baseline;
}
.oo-card-title { font-size: 1.05rem; }
.oo-card-total { font-weight: 800; white-space: nowrap; }
.oo-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: var(--theme-text-muted, #6b6560);
}
.oo-card-flags {
    margin-top: 0.45rem;
    font-size: 0.75rem;
    font-weight: 600;
}
.oo-card-flags.oo-paid { color: #2f6b3a; }
.oo-detail {
    position: absolute;
    inset: 0;
    background: var(--theme-surface, #fff);
    z-index: 2;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.oo-detail.open { display: flex; }
.oo-detail-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.oo-detail-header h3 { margin: 0; font-size: 1.05rem; }
.oo-detail-body {
    flex: 1;
    overflow: auto;
    padding: 0.75rem 0.85rem 1.25rem;
    -webkit-overflow-scrolling: touch;
}
.oo-detail-summary p { margin: 0.25rem 0; font-size: 0.9rem; }
.oo-items {
    list-style: none;
    margin: 0.75rem 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.oo-item {
    padding: 0.7rem 0.75rem;
    border-radius: 10px;
    background: var(--theme-bg, #f7f5f1);
}
.oo-item-main {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}
.oo-item-meta { margin-top: 0.25rem; font-size: 0.78rem; }
.oo-item-meta.muted { color: var(--theme-text-muted, #6b6560); }
.oo-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
}
.oo-mini {
    padding: 0.45rem 0.65rem !important;
    font-size: 0.78rem !important;
}
.oo-badge {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    background: rgba(0,0,0,0.08);
    font-size: 0.7rem;
    font-weight: 700;
}
.oo-done {
    font-size: 0.8rem;
    font-weight: 700;
    color: #2f6b3a;
}
.oo-detail-actions {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.oo-detail-actions .btn { width: 100%; }
.oo-danger {
    color: #8b1e1e !important;
    border-color: rgba(139,30,30,0.35) !important;
}
.oo-hint {
    margin: 0.65rem 0 0;
    font-size: 0.78rem;
    color: var(--theme-text-muted, #6b6560);
}
.oo-status-prepared { outline: 2px solid rgba(180, 120, 20, 0.35); }
.oo-status-delivered { opacity: 0.85; }
@media (min-width: 640px) {
    .open-orders-modal { width: min(100vw - 2rem, 560px); }
    .oo-tab { font-size: 0.8rem; }
}


/* PIN provisional / cambio de clave */
.pin-field-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}
.pin-field-row input {
    flex: 1;
    min-width: 0;
    font-size: 1.25rem;
    letter-spacing: 0.12em;
    font-weight: 700;
}
.pin-field-row .btn {
    white-space: nowrap;
    flex-shrink: 0;
}
.provisional-pin-body {
    text-align: center;
}
.provisional-pin-value {
    margin: 0.75rem 0;
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: 0.28em;
    font-variant-numeric: tabular-nums;
}
.change-pass-lead {
    margin: 0.5rem 0 0;
    font-size: 0.95rem;
    line-height: 1.35;
    color: var(--theme-text-muted, #6b6560);
}
.change-pass-hint {
    margin: 0.35rem 0 0.85rem;
    font-size: 0.82rem;
    color: var(--theme-text-muted, #6b6560);
}
.login-footer-link {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
}
.login-footer-link a {
    color: inherit;
    opacity: 0.8;
}


/* Huincha transversal solo TEST (APP_ENV !== production) — flujo normal, no overlay */
.env-test-banner {
    --env-test-banner-bg: #6e5210;
    --env-test-banner-fg: #fff8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    flex: 0 0 auto;
    align-self: stretch;
    position: static;
    z-index: auto;
    background: var(--env-test-banner-bg);
    color: var(--env-test-banner-fg);
    text-align: center;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    padding: 0.22rem 0.75rem;
    line-height: 1.2;
    transform: none;
}

.env-test-banner::before,
.env-test-banner::after {
    content: "";
    flex: 1 1 0;
    min-width: 0;
    height: 1px;
    background: rgba(255, 248, 232, 0.45);
    max-width: 42%;
}

@media (max-width: 430px) {
    .env-test-banner {
        letter-spacing: 0.1em;
        gap: 0.4rem;
        padding-inline: 0.5rem;
        font-size: 0.62rem;
    }
}

@media print {
    .env-test-banner { display: none !important; }
}


.header-oo-btn {
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.02em;
    padding: 0.35rem 0.55rem !important;
    white-space: nowrap;
}
.oo-card-counts {
    display: flex;
    gap: 0.65rem;
    margin-top: 0.45rem;
    font-size: 0.75rem;
    font-weight: 700;
}
@media (max-width: 420px) {
    .header-oo-btn { font-size: 0.65rem !important; padding: 0.3rem 0.4rem !important; }
}


/* UX detalle pedido abierto — acciones táctiles */
.oo-detail-kicker {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
}
.oo-totals-box {
    display: grid;
    gap: 0.35rem;
    margin: 0.65rem 0;
    padding: 0.75rem;
    border-radius: 12px;
    background: var(--theme-bg, #f7f5f1);
}
.oo-totals-box > div {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.95rem;
}
.oo-totals-grand {
    margin-top: 0.25rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 1.05rem !important;
}
.oo-detail-actions {
    display: grid;
    gap: 0.55rem;
    margin: 0.85rem 0;
}
.oo-action {
    width: 100%;
    min-height: 48px;
    font-size: 0.92rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.02em;
}
.oo-action-split {
    white-space: normal;
    line-height: 1.25;
    text-align: center;
    max-width: 100%;
    overflow: visible;
    hyphens: none;
}
.oo-split-btn-label {
    display: inline-block;
    max-width: 100%;
}
.oo-split-btn-rest {
    white-space: nowrap;
}
@media (max-width: 430px) {
    .oo-split-btn-rest {
        display: block;
    }
}
.oo-action-sm {
    min-height: 42px;
    width: 100%;
    font-size: 0.82rem !important;
    font-weight: 800 !important;
}
.oo-detail-actions-close {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 2px solid rgba(0,0,0,0.08);
}
.oo-action-close {
    min-height: 54px;
    font-size: 0.98rem !important;
}
.oo-full-detail-title {
    margin: 0.75rem 0 0.4rem;
    font-size: 0.9rem;
}
.oo-confirm-modal {
    width: min(100vw - 1rem, 420px);
    max-height: 92vh;
    overflow: auto;
}
.oo-confirm-actions {
    display: grid !important;
    gap: 0.5rem;
    padding: 0.75rem 1rem 1rem;
}
.oo-confirm-actions .btn { width: 100%; min-height: 48px; }
.oo-close-label {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
}
.oo-pay-items {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
    border-top: 1px solid #e6ddd2;
}
.oo-pay-items li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid #f0e8dc;
    font-size: 0.92rem;
}
.oo-tip-fieldset {
    border: 1px solid #e6ddd2;
    border-radius: 10px;
    padding: 0.65rem 0.75rem 0.5rem;
    margin: 0.75rem 0;
}
.oo-tip-fieldset legend {
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    padding: 0 0.35rem;
}
.oo-tip-opt {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.4rem 0;
    cursor: pointer;
}
.oo-tip-opt span {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
    flex: 1;
}
.oo-tip-opt em {
    font-style: normal;
    font-weight: 700;
    margin-left: auto;
}
.oo-tip-opt input[type="number"] {
    width: 5.5rem;
    min-height: 36px;
    border: 1px solid #d9d0c4;
    border-radius: 8px;
    padding: 0.25rem 0.4rem;
    font: inherit;
}
.oo-close-label {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
}
@media (max-width: 420px) {
    .open-orders-modal { width: calc(100vw - 0.25rem); }
    .oo-action { font-size: 0.85rem !important; }
}

/* ——— POS main tabs + Pedidos en curso board ——— */
.pos-main-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    padding: 0.45rem 0.55rem 0.35rem;
    background: var(--pos-header, var(--theme-header, #1a1a1a));
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.pos-main-tab {
    border: 1px solid rgba(255,255,255,0.18);
    background: var(--pos-tab, rgba(255,255,255,0.08));
    color: var(--pos-tab-text, #fff);
    border-radius: 12px;
    min-height: 48px;
    padding: 0.55rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
}
.pos-main-tab.active {
    background: var(--pos-tab-active, var(--theme-button, #fff));
    color: var(--pos-tab-active-text, var(--theme-button-text, #1a1a1a));
    border-color: transparent;
}
.pos-tab-count {
    display: inline-block;
    margin-left: 0.25rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(0,0,0,0.18);
    font-variant-numeric: tabular-nums;
}
.pos-main-tab.active .pos-tab-count {
    background: rgba(0,0,0,0.12);
}
.pos-subhead {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    background: var(--pos-header, var(--theme-header, var(--color-surface)));
}

.pos-attach-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    background: var(--theme-accent, #8b7355);
    color: #fff;
    position: relative;
    z-index: auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.pos-attach-bar[hidden] {
    display: none !important;
}

.pos-attach-bar #posAttachCancel {
    min-height: 44px;
    pointer-events: auto;
}
.pos-attach-text {
    display: grid;
    gap: 0.15rem;
    font-size: 0.85rem;
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
}
.pos-attach-text strong { font-size: 0.92rem; }
.pos-orders-pane {
    display: none;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.65rem;
    min-height: 50vh;
    background: var(--theme-bg, #f5f0e8);
}
body.pos-tab-orders .pos-orders-pane {
    display: flex;
}
body.pos-tab-orders .menu-grid,
body.pos-tab-orders .cart-panel,
body.pos-tab-orders .category-tabs {
    display: none !important;
}
.oo-board-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}
.oo-stat {
    background: var(--theme-surface, #fff);
    border: 1px solid var(--theme-border, rgba(0,0,0,0.08));
    border-radius: 12px;
    padding: 0.55rem 0.45rem;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
}
.oo-stat strong {
    display: block;
    font-size: 1.25rem;
    margin-top: 0.15rem;
}
.oo-board-wrap { overflow: visible; }
.oo-board-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    width: 100%;
}
.oo-board-card {
    background: var(--theme-surface, #fff);
    border: 1px solid var(--theme-border, rgba(0,0,0,0.08));
    border-radius: 16px;
    padding: 0.75rem;
    box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}
.oo-board-card.is-expanded {
    border-color: var(--theme-accent, #8b7355);
}
.oo-board-hit {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.85rem;
    align-items: center;
    width: 100%;
    border: none;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    padding: 0.15rem;
}
.oo-bubble {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--pos-oo-bubble, #9a9a9a);
    color: #fff;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    box-shadow: inset 0 0 0 4px rgba(255,255,255,0.18);
}
.oo-bubble-hash {
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.02em;
}
.oo-board-info {
    display: grid;
    gap: 0.15rem;
}
.oo-board-mesa { font-size: 1.05rem; }
.oo-board-total { font-size: 1.15rem; font-weight: 800; color: var(--theme-text-price, var(--theme-accent)); }
.oo-board-staff,
.oo-board-time { font-size: 0.85rem; color: var(--theme-text-muted, #6b6560); }
.oo-board-toggle {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--theme-accent, #8b7355);
}
.oo-expanded {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(0,0,0,0.08);
}
.oo-exp-meta p { margin: 0.2rem 0; font-size: 0.88rem; }
.oo-exp-section { margin: 0.7rem 0; }
.oo-exp-section h4 {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}
.oo-exp-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.25rem;
}
.oo-exp-items li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.9rem;
}
.oo-muted { color: var(--theme-text-muted, #6b6560); font-size: 0.85rem; }

@media (min-width: 480px) {
    .oo-board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .oo-board-card.is-expanded { grid-column: 1 / -1; }
}
@media (min-width: 768px) {
    .pos-main-tab { font-size: 0.88rem; min-height: 52px; }
    .oo-board-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .oo-bubble { width: 104px; height: 104px; }
    .oo-bubble-hash { font-size: 1.2rem; }
}

@media (min-width: 960px) {
    body.mesero-page.pos-tab-orders {
        grid-template-columns: 1fr;
        grid-template-areas:
            "banner"
            "header"
            "attach"
            "subhead"
            "menu";
    }
    body.mesero-page.pos-tab-orders .pos-orders-pane {
        grid-area: menu;
        min-height: 0;
    }
}
@media (min-width: 1100px) {
    .oo-board-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
    .pos-main-tab { font-size: 0.68rem; padding: 0.45rem 0.35rem; }
    .oo-bubble { width: 72px; height: 72px; }
    .oo-board-stats { gap: 0.3rem; }
}

/* ——— ETAPA 2: Separar pedido ——— */
.oo-board-split {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-primary, #333);
}
.oo-split-summary-box {
    margin: 0.6rem 0;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--color-border, #ddd);
    border-radius: 10px;
    background: rgba(0,0,0,0.03);
}
.oo-split-summary-box ul {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
}
.oo-split-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0;
}
.oo-split-overlay[hidden] { display: none !important; }
body.oo-split-open { overflow: hidden; }
.oo-split-shell {
    width: 100%;
    max-width: 1100px;
    height: 100%;
    max-height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.oo-split-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e5e5;
    background: #111;
    color: #fff;
}
.oo-split-top h2 {
    margin: 0;
    font-size: 1rem;
}
.oo-split-top .btn-icon { color: #fff; }
.oo-split-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0.85rem;
}
.oo-split-step { max-width: 920px; margin: 0 auto; }
.oo-split-count-ctrl { margin: 1rem 0; }
.oo-split-resume {
    margin-bottom: 1rem;
    padding: 0.85rem;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fafafa;
}
.oo-split-resume-actions {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.oo-split-layout {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.oo-split-col h3 {
    margin: 0 0 0.5rem;
    font-size: 0.92rem;
}
.oo-split-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.4rem;
    min-height: 44px;
}
.oo-split-item-hit {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    text-align: left;
    font: inherit;
    cursor: pointer;
}
.oo-split-item[draggable="true"] { cursor: grab; }
.oo-split-list.is-drop-target,
.oo-split-person.is-drop-target {
    outline: 2px dashed #333;
    outline-offset: 2px;
}
.oo-split-person {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 0.75rem;
    background: #fbfbfb;
}
.oo-split-person.is-paid { opacity: 0.85; background: #f0f0f0; }
.oo-split-person-head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.oo-split-badge {
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    background: #111;
    color: #fff;
}
.oo-split-name {
    display: grid;
    gap: 0.25rem;
    font-size: 0.82rem;
    margin-bottom: 0.5rem;
}
.oo-split-name input {
    padding: 0.55rem 0.65rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font: inherit;
}
.oo-split-person-actions {
    display: grid;
    gap: 0.4rem;
    margin-top: 0.65rem;
}
.oo-split-footer {
    position: sticky;
    bottom: 0;
    display: grid;
    gap: 0.5rem;
    padding: 0.75rem 0 0.25rem;
    background: linear-gradient(180deg, rgba(255,255,255,0), #fff 28%);
}
.oo-split-assign-targets {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.85rem;
}
@media (min-width: 900px) {
    .oo-split-layout {
        display: grid;
        grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.4fr);
        align-items: start;
        gap: 1rem;
    }
    .oo-split-persons {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 0.75rem;
    }
}

/* Paleta chocolate DEMO — Login (no altera POS/Hub/Admin) */
html:has(body.login-page.demo-chocolate) {
    background: #3A2418;
}

.login-page.demo-chocolate {
    --demo-choco: #3A2418;
    --demo-choco-2: #4A2E1E;
    --demo-choco-3: #5A3A28;
    --demo-gold: #C99A4A;
    --demo-gold-hover: #E0B866;
    --demo-cream: #F6EBDD;
    --demo-warm: #FFF9F2;
    --demo-text: #FFF9F2;
    --demo-text-2: #E8D8C5;
    --demo-gold-text: #D7B98A;
    --demo-border: #8A6742;
    --demo-ink: #3A2418;
    --demo-ph: #7A695A;
    --demo-btn-ink: #2A1A12;
    background: var(--demo-choco);
    color: var(--demo-text);
}

.login-page.demo-chocolate .login-card {
    background: var(--demo-choco-2);
    border-color: var(--demo-border);
}

.login-page.demo-chocolate .login-brand p,
.login-page.demo-chocolate .login-subtitle {
    color: var(--demo-text);
}

.login-page.demo-chocolate .login-brand p.login-powered,
.login-page.demo-chocolate .login-powered {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--demo-gold-text);
}

.login-page.demo-chocolate .login-logo-circular {
    filter: none;
    background: transparent;
}

.login-page.demo-chocolate .login-demo-hint {
    background: var(--demo-choco-2);
    color: var(--demo-text-2);
    border: 1px solid var(--demo-border);
    font-size: 0.85rem;
    text-align: left;
}

.login-page.demo-chocolate .login-demo-hint strong {
    color: var(--demo-text);
}

.login-page.demo-chocolate .alert-error {
    color: var(--demo-warm);
}

.login-page.demo-chocolate .pin-form input {
    background: var(--demo-cream);
    color: var(--demo-ink);
    border-color: var(--demo-border);
}

.login-page.demo-chocolate .pin-form input::placeholder,
.login-page.demo-chocolate .pin-form input::-webkit-input-placeholder {
    color: var(--demo-ph);
    opacity: 1;
}

.login-page.demo-chocolate .pin-form input:focus,
.login-page.demo-chocolate .pin-form input:focus-visible {
    outline: 2px solid var(--demo-gold);
    outline-offset: 1px;
    border-color: var(--demo-gold);
}

.login-page.demo-chocolate .btn-primary {
    background: var(--demo-gold);
    color: var(--demo-btn-ink);
    border-color: transparent;
}

.login-page.demo-chocolate .btn-primary:hover:not(:disabled):not([aria-disabled="true"]),
.login-page.demo-chocolate .btn-primary:focus-visible,
.login-page.demo-chocolate .btn-primary:active:not(:disabled):not([aria-disabled="true"]),
.login-page.demo-chocolate .btn-primary.is-active {
    background: var(--demo-gold-hover);
    color: var(--demo-btn-ink);
}

/* Paleta oficial MEL'C — Login (carta física: petróleo / naranja / salmón) */
html:has(body.login-page.melc-brand) {
    background: var(--melc-petrol-dark, #303F44);
}

.login-page.melc-brand {
    background: var(--melc-petrol-dark, #303F44);
    color: var(--melc-warm, #FFF9F4);
}

.login-page.melc-brand .login-card {
    background: var(--melc-petrol, #3D4B4C);
    border-color: color-mix(in srgb, var(--melc-salmon, #DEBAA4) 42%, transparent);
}

.login-page.melc-brand .login-brand-name {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    color: var(--melc-warm, #FFF9F4);
}

.login-page.melc-brand .login-brand p,
.login-page.melc-brand .login-subtitle {
    color: var(--melc-salmon, #DEBAA4);
}

.login-page.melc-brand .login-logo-circular {
    filter: none !important;
    mix-blend-mode: normal;
    object-fit: contain;
    background: transparent;
}

.login-page.melc-brand .pin-form input {
    background: var(--melc-cream, #F5EEE7);
    color: var(--melc-carbon, #252629);
    border-color: var(--melc-salmon, #DEBAA4);
}

.login-page.melc-brand .pin-form input::placeholder {
    color: color-mix(in srgb, var(--melc-carbon, #252629) 55%, var(--melc-salmon, #DEBAA4));
    opacity: 1;
}

.login-page.melc-brand .pin-form input:focus,
.login-page.melc-brand .pin-form input:focus-visible {
    outline: 2px solid var(--melc-orange, #D75A11);
    outline-offset: 1px;
    border-color: var(--melc-orange, #D75A11);
}

.login-page.melc-brand .btn-primary {
    background: var(--melc-orange, #D75A11);
    color: var(--melc-warm, #FFF9F4);
    border-color: transparent;
}

.login-page.melc-brand .btn-primary:hover:not(:disabled):not([aria-disabled="true"]),
.login-page.melc-brand .btn-primary:focus-visible,
.login-page.melc-brand .btn-primary:active:not(:disabled):not([aria-disabled="true"]) {
    background: var(--melc-orange-hover, #E86A18);
    color: var(--melc-warm, #FFF9F4);
}

.login-page.melc-brand .alert-error {
    color: var(--melc-warm, #FFF9F4);
}

/* Hub + POS MEL'C */
.hub-page.melc-brand,
.mesero-page.melc-brand {
    background: var(--melc-petrol, var(--pos-bg, #3D4B4C));
    color: var(--melc-warm, var(--pos-text, #FFF9F4));
}

.hub-page.melc-brand .hub-logo,
.mesero-page.melc-brand .pos-logo,
.mesero-page.melc-brand img.brand-logo,
.mesero-page.melc-brand .header-logo {
    filter: none !important;
    mix-blend-mode: normal;
    object-fit: contain;
}

.hub-page.melc-brand .hub-title {
    color: var(--melc-warm, #FFF9F4);
}

.hub-page.melc-brand .hub-sub,
.hub-page.melc-brand .hub-role {
    color: var(--melc-salmon, #DEBAA4);
}

.hub-page.melc-brand .hub-card-primary {
    background: var(--melc-orange, #D75A11);
    color: var(--melc-warm, #FFF9F4);
}

.hub-page.melc-brand .hub-card-primary .hub-card-hint {
    color: rgba(255, 249, 244, 0.86);
}

.hub-page.melc-brand .hub-card-primary:hover {
    background: var(--melc-orange-hover, #E86A18);
    color: var(--melc-warm, #FFF9F4);
}

.hub-page.melc-brand .hub-card:not(.hub-card-primary):not(.hub-card-danger) {
    background: var(--melc-salmon, #DEBAA4);
    color: var(--melc-carbon, #252629);
    border-color: transparent;
}

.hub-page.melc-brand .hub-card:not(.hub-card-primary):not(.hub-card-danger) .hub-card-hint {
    color: color-mix(in srgb, var(--melc-carbon, #252629) 72%, transparent);
}

.hub-page.melc-brand .hub-card-danger {
    background: var(--melc-petrol-dark, #303F44);
    color: var(--melc-warm, #FFF9F4);
}

.mesero-page.melc-brand .btn-primary {
    background: var(--theme-button, var(--melc-orange, #D75A11));
    color: var(--theme-button-text, #FFF9F4);
}

.mesero-page.melc-brand .btn-primary:hover:not(:disabled) {
    background: var(--theme-button-hover, var(--melc-orange-hover, #E86A18));
    color: var(--theme-button-hover-text, #FFF9F4);
}

.mesero-page.melc-brand .btn-secondary {
    background: var(--theme-button-secondary, var(--melc-salmon, #DEBAA4));
    color: var(--theme-button-secondary-text, var(--melc-carbon, #252629));
}

.mesero-page.melc-brand .oo-status-prepared {
    outline-color: color-mix(in srgb, var(--theme-success, #2E7D32) 55%, var(--melc-orange, #D75A11));
}

.mesero-page.melc-brand .oo-status-delivered {
    outline: 2px solid color-mix(in srgb, var(--theme-success, #2E7D32) 70%, transparent);
    opacity: 1;
}



