/* iTaula Carta — misma estética que app.itaula.es (tokens de recursos/css/output.css,
   login de vistas/camarero/login.php y menú lateral de js/camarero/menu.js). */
:root {
    --taula-dark: #2b394b;
    --taula-medium: #517081;
    --taula-light: #c2d3e0;
    --taula-cream: #f2ede8;
    --taula-icon-bg: #3e546a;
    --fondo: #f3f4f6;
    --borde: #e5e7eb;
    --texto: #1f2937;
    --gris: #6b7280;
    --ok: #15803d;
    --error: #dc2626;
    --radius-md: .5rem;
    --radius-xl: .75rem;
}
* { box-sizing: border-box; }
html { line-height: 1.5; -webkit-text-size-adjust: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
body { margin: 0; color: var(--texto); background: var(--fondo); }
a { color: var(--taula-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
.oculto { display: none !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── Botones (btn-taula-primary y el botón contorneado de la barra de carta.php) ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid transparent; border-radius: var(--radius-md); padding: .625rem 1.25rem; font-weight: 600; font-size: .9375rem; cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s, color .15s; white-space: nowrap; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primario { background: var(--taula-dark); color: #fff; }
.btn-primario:hover:not(:disabled) { background: var(--taula-medium); }
.btn-secundario { background: #fff; color: var(--taula-dark); border-color: var(--taula-light); }
.btn-secundario:hover:not(:disabled) { background: rgba(194, 211, 224, .4); }
.btn-peligro { background: #fff; color: var(--error); border-color: #fecaca; }
.btn-peligro:hover { background: #fef2f2; }
.btn-texto { background: none; color: var(--taula-medium); padding: .5rem .75rem; }
.btn-texto:hover { color: var(--taula-dark); }
.btn-bloque { width: 100%; }
.btn-peq { padding: .45rem .8rem; font-size: .875rem; }
.btn-xl { border-radius: var(--radius-xl); padding: .8rem 1.25rem; }
.btn svg { width: 1rem; height: 1rem; flex-shrink: 0; }

/* ── Formularios (como el login: rounded-xl, borde taula-light, etiqueta taula-medium) ── */
.campo { margin-bottom: 1.1rem; }
.campo > label, .etiqueta { display: block; font-size: .875rem; font-weight: 500; color: var(--taula-medium); margin-bottom: .3rem; }
.opc { color: #9ca3af; font-weight: 400; }
.entrada { width: 100%; background: #fff; border: 1px solid var(--taula-light); border-radius: var(--radius-xl); padding: .75rem 1rem; font-size: 16px; color: var(--texto); transition: border-color .15s; }
.entrada:focus { outline: 2px solid var(--taula-medium); outline-offset: 2px; }
textarea.entrada { min-height: 5.5rem; resize: vertical; }
select.entrada { appearance: auto; }
.fila2 { display: grid; grid-template-columns: 1fr; gap: 0 .9rem; }
@media (min-width: 560px) { .fila2 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .875rem; color: var(--gris); margin: .3rem 0 .8rem; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; margin-top: .1rem; accent-color: var(--taula-dark); flex-shrink: 0; }
.aviso { font-size: .875rem; border-radius: var(--radius-md); padding: .5rem .75rem; margin-bottom: 1rem; }
.aviso-error { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; }
.aviso-ok { color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; }
.ayuda { font-size: .8125rem; color: var(--gris); margin: -.1rem 0 .6rem; }
.nota { font-size: .8125rem; color: var(--gris); text-align: center; margin-top: .9rem; }

/* ── Acceso: réplica del login de app.itaula.es ── */
body.acceso-body { background: #1c2531; }
.acceso { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; }
.acceso-wrap { width: 100%; max-width: 940px; }
.acceso-card { background: #fff; border-radius: 1.25rem; overflow: hidden; box-shadow: 0 20px 45px -12px rgba(43, 57, 75, .35); display: flex; flex-direction: column; }
.acceso-marca { background: linear-gradient(160deg, #35475e 0%, var(--taula-dark) 65%); color: #fff; padding: 2rem 1.75rem; text-align: center; }
.acceso-logo { height: 2.5rem; width: auto; margin: 0 auto .75rem; display: block; filter: brightness(0) invert(1); }
.acceso-marca h2 { font-size: 1.35rem; font-weight: 700; margin: 0 0 .4rem; line-height: 1.25; }
.acceso-marca p { color: rgba(255, 255, 255, .8); font-size: .95rem; line-height: 1.6; }
.acceso-lista { display: none; }
.acceso-panel { padding: 2rem 1.75rem; }
.acceso-panel h1 { font-size: 1.4rem; font-weight: 700; color: var(--taula-dark); margin: 0 0 .25rem; }
.acceso-sub { font-size: .9rem; color: var(--taula-medium); margin: 0 0 1.5rem; }
.acceso-enlace { color: var(--taula-medium); font-weight: 600; text-decoration: none; }
.acceso-enlace:hover { color: var(--taula-dark); text-decoration: underline; }
.acceso-pie-card { text-align: center; font-size: .875rem; color: var(--gris); margin-top: 1.1rem; }
.acceso-pie { color: rgba(255, 255, 255, .8); text-align: center; font-size: .85rem; margin-top: 1.25rem; }
.acceso-pie a { color: #fff; }
@media (min-width: 768px) {
    .acceso-card { flex-direction: row; }
    .acceso-marca { flex: 1 1 44%; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; text-align: left; padding: 2.75rem 2.25rem; }
    .acceso-logo { margin: 0 0 1.5rem; height: 2.6rem; }
    .acceso-marca h2 { font-size: 1.7rem; margin-bottom: .75rem; }
    .acceso-lista { display: block; margin: 1.5rem 0 0; padding: 0; list-style: none; }
    .acceso-lista li { display: flex; align-items: center; gap: .6rem; color: rgba(255, 255, 255, .85); font-size: .9rem; margin-bottom: .55rem; }
    .acceso-lista svg { width: 1.05rem; height: 1.05rem; flex-shrink: 0; color: var(--taula-light); }
    .acceso-panel { flex: 1 1 56%; padding: 2.75rem 2.25rem; display: flex; flex-direction: column; justify-content: center; }
}
@media (min-width: 1024px) {
    .acceso-marca { padding: 3.25rem 3rem; }
    .acceso-logo { height: 2.75rem; }
    .acceso-marca h2 { font-size: 1.85rem; }
    .acceso-panel { padding: 3.25rem 3rem; }
}

/* ── Panel: menú lateral como el de app.itaula.es ── */
.lateral { position: fixed; top: 0; left: 0; bottom: 0; width: 200px; background: var(--taula-dark); color: #fff; display: flex; flex-direction: column; z-index: 50; }
.lateral-cab { display: flex; align-items: center; gap: .6rem; padding: 1rem .9rem .75rem; border-bottom: 1px solid rgba(255, 255, 255, .10); min-height: 56px; }
.lateral-avatar { width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--taula-icon-bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; color: rgba(255, 255, 255, .85); }
.lateral-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lateral-avatar svg { width: 1.1rem; height: 1.1rem; }
.lateral-info { min-width: 0; }
.lateral-info b { display: block; font-size: .875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lateral-info span { display: block; font-size: .75rem; color: rgba(255, 255, 255, .6); }
.lateral-nav { flex: 1; overflow-y: auto; padding: .35rem .5rem; display: flex; flex-direction: column; gap: 2px; }
.lateral-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: .375rem; color: rgba(255, 255, 255, .86); text-decoration: none; font-size: .9375rem; font-weight: 500; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
.lateral-item svg { width: 1.25rem; height: 1.25rem; color: rgba(255, 255, 255, .72); flex-shrink: 0; }
.lateral-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.lateral-item:hover svg { color: #fff; }
.lateral-item.activo { background: rgba(255, 255, 255, .14); color: #fff; }
.lateral-item.activo svg { color: #fff; }
.lateral-pie { border-top: 1px solid rgba(255, 255, 255, .10); padding: 6px .5rem calc(8px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 2px; }
.upsell { margin: .5rem .6rem .6rem; padding: .8rem; border-radius: .75rem; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.upsell b { display: block; font-size: .8125rem; color: #fff; line-height: 1.3; }
.upsell p { font-size: .75rem; color: rgba(255, 255, 255, .72); line-height: 1.45; margin: .25rem 0 .6rem; }
.upsell a { display: block; padding: .45rem .6rem; border-radius: 999px; background: #fff; color: var(--taula-dark); font-size: .78rem; font-weight: 700; text-align: center; text-decoration: none; }
.principal { margin-left: 200px; min-height: 100vh; }
.cabecera { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.5rem .5rem; }
.cabecera h1 { font-size: 1.25rem; font-weight: 700; color: var(--taula-dark); flex: 1; min-width: 0; }
.hamburguesa { display: none; width: 2.5rem; height: 2.5rem; border-radius: .5rem; border: 0; background: var(--taula-dark); color: #fff; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.hamburguesa svg { width: 1.3rem; height: 1.3rem; }
.contenido { padding: .5rem 1.5rem 7rem; max-width: 1100px; }
.velo { display: none; }
@media (max-width: 768px) {
    .lateral { width: 280px; transform: translateX(-100%); transition: transform .3s ease-in-out; z-index: 300; }
    .lateral.abierto { transform: translateX(0); }
    .lateral-item { padding: 11px 12px; font-size: 1rem; }
    .velo.visible { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 290; }
    .principal { margin-left: 0; }
    .hamburguesa { display: inline-flex; }
    .cabecera { padding: 1rem 1rem .5rem; position: sticky; top: 0; z-index: 40; background: var(--fondo); }
    .contenido { padding: .5rem 1rem 7rem; }
}

/* ── Tarjetas y listas del panel ── */
.panel-blanco { background: #fff; border-radius: var(--radius-xl); border: 1px solid var(--borde); box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.barra-acciones { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: flex-end; }
.tarjeta { background: #fff; border: 1px solid var(--borde); border-radius: var(--radius-xl); margin-bottom: 1rem; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.cat-cab { display: flex; align-items: center; gap: .35rem; padding: .7rem .75rem .7rem 1rem; background: var(--taula-dark); color: #fff; }
.cat-cab h3 { flex: 1; min-width: 0; font-size: 1rem; font-weight: 700; }
.cat-cab h3 small { font-weight: 400; color: rgba(255, 255, 255, .65); font-size: .8125rem; }
.cat-cab .icono-btn { color: rgba(255, 255, 255, .72); }
.cat-cab .icono-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.subcat-tit { display: flex; justify-content: space-between; align-items: center; padding: .6rem .75rem .35rem 1rem; font-size: .75rem; font-weight: 700; color: var(--taula-medium); text-transform: uppercase; letter-spacing: .05em; background: #f9fafb; border-top: 1px solid var(--borde); }
.plato { display: flex; align-items: center; gap: .8rem; padding: .7rem .75rem .7rem 1rem; border-top: 1px solid #f1f2f4; cursor: pointer; }
.plato:first-of-type { border-top: 0; }
.plato:hover { background: #f9fafb; }
.plato-foto { width: 3.25rem; height: 3.25rem; border-radius: .5rem; object-fit: cover; background: var(--taula-cream); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #b4aa9e; }
.plato-foto svg { width: 1.3rem; height: 1.3rem; }
.plato-info { flex: 1; min-width: 0; }
.plato-info b { display: block; font-weight: 600; color: var(--taula-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plato-info span { font-size: .8125rem; color: var(--gris); }
.plato-precio { font-weight: 700; color: var(--taula-dark); white-space: nowrap; }
.plato.apagado .plato-info, .plato.apagado .plato-precio, .plato.apagado .plato-foto { opacity: .45; }
.pildora { display: inline-block; font-size: .6875rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: rgba(194, 211, 224, .5); color: var(--taula-dark); margin-left: .35rem; vertical-align: .1rem; }
.icono-btn { width: 2.1rem; height: 2.1rem; border-radius: .5rem; border: 0; background: none; color: var(--gris); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.icono-btn:hover { background: #f3f4f6; color: var(--taula-dark); }
.icono-btn svg { width: 1.1rem; height: 1.1rem; }
.anadir-plato { width: 100%; border: 0; border-top: 1px solid #f1f2f4; background: none; padding: .7rem 1rem; text-align: left; color: var(--taula-medium); font-weight: 600; font-size: .9rem; cursor: pointer; }
.anadir-plato:hover { background: #f9fafb; color: var(--taula-dark); }
.vacio { text-align: center; padding: 2.5rem 1.25rem; color: var(--gris); }
.vacio h3 { color: var(--taula-dark); font-size: 1.15rem; margin: .5rem 0 .4rem; }
.flotante { position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 45; box-shadow: 0 10px 20px -5px rgba(43, 57, 75, .45); border-radius: var(--radius-xl); padding: .8rem 1.2rem; }
@media (min-width: 769px) { .flotante { display: none; } }

/* ── Modal (centrado como los de la app; hoja inferior en móvil) ── */
.hoja-fondo { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 400; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 700px) { .hoja-fondo { align-items: center; padding: 1.25rem; } }
.hoja { background: #fff; width: 100%; max-width: 640px; max-height: 92vh; border-radius: 1rem 1rem 0 0; display: flex; flex-direction: column; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25); }
@media (min-width: 700px) { .hoja { border-radius: var(--radius-xl); } }
.hoja-cab { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1rem .85rem 1.5rem; border-bottom: 1px solid var(--borde); }
.hoja-cab h3 { font-size: 1.125rem; font-weight: 700; color: var(--taula-dark); }
.hoja-cuerpo { padding: 1.25rem 1.5rem; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.hoja-pie { display: flex; gap: .6rem; padding: .85rem 1.5rem calc(.85rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--borde); background: #f9fafb; border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.hoja-pie .btn-primario { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { border: 1px solid var(--taula-light); background: #fff; color: var(--taula-dark); border-radius: 999px; padding: .35rem .8rem; font-size: .875rem; font-weight: 500; cursor: pointer; user-select: none; }
.chip:hover { background: rgba(194, 211, 224, .35); }
.chip.activo { background: var(--taula-dark); border-color: var(--taula-dark); color: #fff; }
.foto-caja { display: flex; gap: .9rem; align-items: center; }
.foto-prev { width: 5.5rem; height: 5.5rem; border-radius: var(--radius-xl); background: var(--taula-cream); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #b4aa9e; overflow: hidden; border: 1px solid var(--borde); }
.foto-prev img { width: 100%; height: 100%; object-fit: cover; }
.foto-prev svg { width: 1.6rem; height: 1.6rem; }
.bloque { border: 1px solid var(--borde); border-radius: var(--radius-xl); padding: .75rem; margin-bottom: .6rem; background: #f9fafb; }
.bloque-fila { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.bloque-fila .entrada { padding: .55rem .75rem; font-size: 15px; border-radius: var(--radius-md); }
.w-precio { max-width: 6.5rem; }
.separador { border: 0; border-top: 1px solid var(--borde); margin: 1.1rem 0; }

/* ── Apariencia y QR ── */
.paletas { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .6rem; }
.paleta { border: 2px solid var(--borde); border-radius: var(--radius-xl); padding: .55rem; background: #fff; cursor: pointer; text-align: left; }
.paleta.activa { border-color: var(--taula-dark); }
.paleta-muestra { display: flex; height: 2rem; border-radius: .4rem; overflow: hidden; margin-bottom: .35rem; }
.paleta-muestra span { flex: 1; }
.paleta b { font-size: .8125rem; color: var(--taula-dark); }
.rejilla-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 900px) { .rejilla-2 { grid-template-columns: 1fr 1fr; align-items: start; } }
.caja-pad { padding: 1.25rem 1.5rem; }
.caja-tit { font-size: 1rem; font-weight: 700; color: var(--taula-dark); margin-bottom: .25rem; }
.qr-caja { text-align: center; }
.qr-caja #qr { display: inline-flex; padding: .9rem; background: #fff; border-radius: var(--radius-xl); border: 1px solid var(--borde); margin-top: .75rem; }
.qr-url { font-size: .95rem; font-weight: 600; word-break: break-all; margin: .8rem 0 1.1rem; color: var(--taula-dark); }
.qr-botones { display: flex; flex-direction: column; gap: .5rem; max-width: 320px; margin: 0 auto; }

/* ── Avisos ── */
.toast { position: fixed; left: 50%; bottom: calc(1.4rem + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--taula-dark); color: #fff; padding: .65rem 1.1rem; border-radius: var(--radius-md); font-size: .875rem; font-weight: 600; z-index: 500; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, .3); max-width: calc(100% - 2rem); text-align: center; }
.toast.error { background: var(--error); }
