/* =========================================================
   PC Planet POS · Estilos
   ========================================================= */
:root {
  --navy: #0a1a3a; --navy-2: #12285a; --primary: #1d4ed8; --primary-dark: #1e3a8a; --primary-soft: #e8efff;
  --verde: #16a34a; --verde-soft: #dcfce7; --naranja: #ea580c; --naranja-soft: #ffedd5; --amarillo: #d97706; --amarillo-soft: #fef3c7;
  --rojo: #dc2626; --rojo-soft: #fee2e2; --morado: #7c3aed; --morado-soft: #ede9fe; --turquesa: #0d9488; --turquesa-soft: #ccfbf1;
  --text: #0f172a; --muted: #5b6478; --line: #e3e8f0; --soft: #f3f6fb; --white: #fff;
  --radius: 14px; --shadow: 0 1px 2px rgba(15,23,42,.05), 0 6px 20px rgba(15,23,42,.06);
  --hdr-h: 64px; --drawer-w: 290px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--soft); line-height: 1.5; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
a { color: var(--primary); }
[hidden] { display: none !important; }

/* ---------- Barra superior ---------- */
.hdr {
  position: fixed; inset: 0 0 auto 0; z-index: 70; height: var(--hdr-h);
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: linear-gradient(110deg, var(--navy) 0%, var(--navy-2) 55%, var(--primary) 100%); color: #fff;
}
.hdr__menu { width: 42px; height: 42px; border: 0; border-radius: 10px; background: rgba(255,255,255,.1); color: #fff; font-size: 1.35rem; flex-shrink: 0; }
.hdr__comedor { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1px solid rgba(255,255,255,.35); border-radius: 12px; background: rgba(255,255,255,.1); color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; }
.hdr__comedor:hover { background: rgba(255,255,255,.2); }
.hdr__neg { margin-left: auto; display: grid; text-align: right; line-height: 1.2; min-width: 0; }
.hdr__neg b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.hdr__neg a { color: rgba(255,255,255,.8); font-size: .8rem; text-decoration: underline dotted; }
.hdr__caja { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid rgba(255,255,255,.35); border-radius: 99px; background: rgba(255,255,255,.08); color: #fff; font-weight: 700; white-space: nowrap; }
.punto { width: 12px; height: 12px; border-radius: 50%; }
.punto.on { background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.3); }
.punto.off { background: #f87171; box-shadow: 0 0 0 3px rgba(248,113,113,.3); }

/* ---------- Menú lateral ---------- */
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 80; width: var(--drawer-w); overflow-y: auto;
  display: flex; flex-direction: column; background: #eef3fb; border-right: 1px solid var(--line);
  transform: translateX(-100%); transition: transform .25s ease;
}
body.menu-abierto .drawer { transform: none; }
.drawer__fondo { display: none; }
.drawer__logo { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: var(--primary); border-bottom: 1px solid var(--line); background: #fff; }
.drawer__logo svg { width: 40px; height: 40px; }
.drawer__logo b { font-size: 1.25rem; color: var(--navy); }
.drawer__logo small { display: block; color: var(--muted); font-size: .75rem; }
.drawer__user { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.drawer__user div { display: grid; line-height: 1.25; min-width: 0; }
.drawer__user small { color: var(--muted); font-size: .76rem; }
.drawer__volver { margin: 10px 18px 0; padding: 0; border: 0; background: none; color: var(--primary); font-size: .85rem; text-align: left; text-decoration: underline; }
.drawer__buscar { padding: 12px 14px 6px; }
.drawer__buscar input { width: 100%; padding: 10px 12px; border: 1px solid #cfd7e4; border-radius: 10px; background: #fff; font-size: 16px; }
.drawer__nav { padding: 4px 10px 10px; display: grid; gap: 2px; }
.drawer__sec { margin: 14px 8px 4px; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.item-menu, .grupo__btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; border-radius: 12px; background: none; color: var(--text); text-decoration: none; text-align: left; font-size: .95rem; }
.item-menu:hover, .grupo__btn:hover { background: rgba(29,78,216,.08); }
.item-menu.active { background: var(--primary-soft); color: var(--primary); }
.grupo__ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #fff; box-shadow: var(--shadow); font-size: 1.15rem; flex-shrink: 0; }
.grupo__btn b { flex: 1; font-weight: 600; text-transform: uppercase; font-size: .86rem; letter-spacing: .02em; }
.grupo__btn i { font-style: normal; color: var(--muted); transition: transform .2s; }
.grupo.abierto .grupo__btn { background: var(--primary-soft); color: var(--primary); }
.grupo.abierto .grupo__btn i { transform: rotate(-90deg); }
.grupo.activo .grupo__btn b { color: var(--primary); }
.grupo__items { display: none; padding: 2px 0 8px 58px; }
.grupo.abierto .grupo__items { display: grid; }
.grupo__items a { padding: 7px 8px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.grupo__items a:hover { color: var(--primary); background: rgba(29,78,216,.06); }
.grupo__items a.active { color: var(--primary); font-weight: 700; }
.grupo__items em { margin-left: 4px; padding: 1px 7px; border-radius: 99px; background: var(--amarillo-soft); color: #92400e; font-style: normal; font-size: .68rem; font-weight: 700; }
.drawer__salir { margin: auto 14px 16px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 600; color: var(--rojo); }

/* ---------- Contenido ---------- */
.main { padding-top: var(--hdr-h); min-height: 100vh; transition: margin-left .25s ease; }
body.menu-abierto .main { margin-left: var(--drawer-w); }
body.menu-abierto .hdr { left: var(--drawer-w); }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 26px 0; }
.pagehead h1 { font-size: 1.4rem; line-height: 1.2; color: var(--navy); }
.pagehead p { color: var(--muted); font-size: .85rem; text-transform: capitalize; }
.reloj { font-weight: 700; color: var(--navy); font-size: 1.1rem; }
.view { padding: 16px 26px 40px; }

/* ---------- Elementos comunes ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border: 0; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 600; text-decoration: none; transition: filter .15s, transform .15s; }
.btn:not(:disabled):hover { filter: brightness(1.08); }
.btn:not(:disabled):active { transform: scale(.98); }
.btn--sm { padding: 6px 12px; font-size: .85rem; }
.btn--block { width: 100%; }
.btn--verde { background: var(--verde); } .btn--rojo { background: var(--rojo); } .btn--naranja { background: var(--naranja); }
.btn--azul { background: var(--primary); } .btn--gris { background: #e5e9f0; color: var(--text); }
.btn--light { background: #fff; color: var(--navy); }
.btn--ghost { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.3); }
.icon-btn { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: #fff; flex-shrink: 0; }
.icon-btn--rojo { color: var(--rojo); }
.acciones { display: inline-flex; gap: 6px; }
.link { border: 0; background: none; color: var(--primary); font-size: .88rem; font-weight: 600; padding: 4px 0; text-decoration: none; }
.link--rojo { color: var(--rojo); }
.h2 { margin: 24px 0 12px; font-size: 1.05rem; color: var(--navy); }
.h2 small { color: var(--muted); font-weight: 500; }
.vacio { padding: 18px; text-align: center; color: var(--muted); font-size: .92rem; }
.card { padding: 18px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.card h3 { font-size: 1rem; margin-bottom: 10px; }
.form-card { max-width: 620px; }
.barra { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-bottom: 12px; }
.barra--entre { justify-content: space-between; align-items: center; }
.barra--fin { margin-top: 30px; justify-content: center; }
.buscar { flex: 1; min-width: 180px; max-width: 380px; padding: 10px 12px; border: 1px solid #cfd7e4; border-radius: 10px; background: #fff; font-size: 16px; }
.nota-pie { margin-top: 18px; color: var(--muted); font-size: .85rem; text-align: center; }
.ayuda { color: var(--muted); font-size: .82rem; }
.ok { color: var(--verde); } .mal { color: var(--rojo); } .aviso { color: var(--amarillo); }
.filtros { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.filtros--scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip { flex-shrink: 0; padding: 8px 15px; border: 1px solid var(--line); border-radius: 99px; background: #fff; font-weight: 600; font-size: .88rem; color: var(--muted); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.estado { display: inline-block; padding: 4px 11px; border: 0; border-radius: 99px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.estado--on { background: var(--verde-soft); color: #15803d; } .estado--off { background: var(--rojo-soft); color: #b91c1c; }
.estado--aviso { background: var(--amarillo-soft); color: #92400e; } .estado--ocupada { background: var(--rojo); color: #fff; }
.tag { padding: 2px 8px; border-radius: 99px; font-size: .7rem; font-weight: 700; text-transform: uppercase; background: var(--soft); color: var(--muted); }
.tag--cocina { background: var(--naranja-soft); color: #9a3412; } .tag--bar { background: var(--morado-soft); color: var(--morado); }
.tag--compra { background: var(--verde-soft); color: #15803d; } .tag--venta { background: var(--primary-soft); color: var(--primary); } .tag--ajuste { background: var(--amarillo-soft); color: #92400e; }

/* Formularios */
.form { display: grid; gap: 8px; }
.form h3 { margin-top: 6px; }
.form label, .modal label { font-weight: 600; font-size: .86rem; }
.form input:not([type=radio]):not([type=checkbox]):not([type=file]), .form select, .fechas input { width: 100%; padding: 10px 12px; border: 1px solid #cfd7e4; border-radius: 10px; background: #fff; font-size: 16px; }
.form .btn { justify-self: start; margin-top: 6px; }
.form .dos .btn { justify-self: stretch; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500 !important; }
.sub { font-size: .95rem; margin-top: 10px; color: var(--navy); }
.error { padding: 8px 12px; border-radius: 8px; background: var(--rojo-soft); color: #991b1b; font-size: .86rem; }
.fechas { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-bottom: 12px; }
.fechas label { display: grid; gap: 2px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.fechas input { width: auto; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Tablas */
.tabla-wrap { overflow-x: auto; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.tabla { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabla th { padding: 11px 14px; background: #f8fafd; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.tabla td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tr:hover td { background: #fafcff; }

/* ---------- Indicadores y accesos ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { padding: 16px 18px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); border-left: 5px solid var(--primary); }
.kpi small { display: block; color: var(--muted); font-weight: 600; font-size: .8rem; }
.kpi b { display: block; font-size: 1.6rem; line-height: 1.25; color: var(--navy); }
.kpi span { color: var(--muted); font-size: .8rem; }
.kpi--verde { border-color: var(--verde); } .kpi--naranja { border-color: var(--naranja); } .kpi--morado { border-color: var(--morado); }
.acciones-rapidas { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-top: 16px; }
.tile { display: grid; gap: 2px; justify-items: start; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--text); text-align: left; text-decoration: none; transition: border-color .15s, transform .15s; }
.tile:hover { border-color: var(--primary); transform: translateY(-2px); }
.tile span { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 8px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-size: 1.3rem; }
.tile small { color: var(--muted); }
.lista { display: grid; gap: 8px; }
.fila { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 14px; width: 100%; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); text-align: left; text-decoration: none; }
.fila b { grid-column: 1; }
.fila span { grid-column: 1; color: var(--muted); font-size: .85rem; }
.fila strong { grid-column: 2; grid-row: 1 / span 2; }
a.fila:hover { border-color: var(--primary); }
.fila--prod { grid-template-columns: auto 1fr auto auto auto; }
.fila--prod > div { display: grid; }
.fila--prod strong, .fila--prod .estado, .fila--prod .icon-btn { grid-row: auto; grid-column: auto; }
.fila__emoji { font-size: 1.7rem; }
.fila2 { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.fila2:last-of-type { border-bottom: 0; }
.fila2 span { color: var(--muted); }
.dos-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; }

/* Banner del resumen */
.banner { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 16px; padding: 26px 30px; border-radius: 18px; overflow: hidden; color: #fff; background: radial-gradient(ellipse at 90% 20%, rgba(124,196,255,.35), transparent 55%), linear-gradient(120deg, var(--navy) 0%, var(--primary) 100%); box-shadow: var(--shadow); }
.banner small { color: rgba(255,255,255,.8); }
.banner h2 { font-size: 1.7rem; line-height: 1.2; margin: 4px 0; }
.banner p { color: rgba(255,255,255,.8); margin-bottom: 14px; }
.banner__logo svg { width: 120px; height: 120px; color: rgba(255,255,255,.9); }

/* Menú Comedor */
.comedor-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.comedor-top .btn--naranja { margin-left: auto; }
.pildoras { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 18px; }
.pildoras span { padding: 8px 16px; border: 1px solid var(--line); border-radius: 99px; background: #fff; box-shadow: var(--shadow); font-size: .92rem; }
.pildoras b { font-size: 1.15rem; color: var(--navy); }
.hubs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.hub { position: relative; display: grid; justify-items: center; gap: 10px; padding: 26px 12px 20px; border-radius: 20px; background: #fff; color: var(--text); text-decoration: none; box-shadow: var(--shadow); border-top: 5px solid var(--c); transition: transform .15s, box-shadow .15s; }
.hub:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(15,23,42,.12); }
.hub__ic { display: grid; place-items: center; width: 78px; height: 78px; border-radius: 22px; background: var(--c); color: #fff; font-size: 2.1rem; box-shadow: 0 8px 18px rgba(0,0,0,.12); }
.hub b { font-size: 1.1rem; }
.hub__badge { position: absolute; top: 10px; right: 10px; padding: 2px 10px; border-radius: 99px; background: var(--cs); color: var(--c); font-size: .76rem; font-weight: 700; }
.h-naranja { --c: #f97316; --cs: #ffedd5; } .h-amarillo { --c: #f59e0b; --cs: #fef3c7; } .h-turquesa { --c: #14b8a6; --cs: #ccfbf1; } .h-verde { --c: #16a34a; --cs: #dcfce7; }
.h-azul { --c: #2563eb; --cs: #dbeafe; } .h-rojo { --c: #ef4444; --cs: #fee2e2; } .h-morado { --c: #8b5cf6; --cs: #ede9fe; } .h-gris { --c: #64748b; --cs: #e2e8f0; }

/* Órdenes (tarjetas) */
.tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.tarjeta { display: grid; gap: 2px; padding: 16px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); border-top: 4px solid var(--rojo); }
.tarjeta__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.tarjeta .dos { margin-top: 10px; }

/* ---------- Mesas ---------- */
.mesas { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.mesa { position: relative; display: grid; gap: 2px; justify-items: start; align-content: start; min-height: 130px; padding: 14px; border: 2px solid transparent; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); text-align: left; transition: transform .15s; }
.mesa:hover { transform: translateY(-2px); }
.mesa__num { font-size: 2rem; font-weight: 800; line-height: 1; }
.mesa__info { color: var(--muted); font-size: .78rem; }
.mesa__estado { margin-top: auto; padding: 3px 10px; border-radius: 99px; background: var(--verde-soft); color: #15803d; font-size: .78rem; font-weight: 700; }
.mesa__total { margin-top: 6px; font-size: 1.15rem; font-weight: 800; color: var(--navy); }
.mesa__min { color: var(--muted); font-size: .78rem; }
.mesa--libre { border-color: #bbf7d0; }
.mesa--ocupada { border-color: #fecaca; background: linear-gradient(180deg, #fff 0%, #fff5f5 100%); }
.mesa--ocupada .mesa__num { color: var(--rojo); }
.mesa__listo { position: absolute; top: 10px; right: 10px; padding: 2px 8px; border-radius: 99px; background: var(--morado-soft); color: var(--morado); font-size: .72rem; font-weight: 700; }

/* ---------- Pedido ---------- */
.pedido { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 20px; align-items: start; }
.pedido__menu { min-width: 0; }
.productos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.prod { display: grid; gap: 4px; justify-items: center; align-content: start; padding: 14px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-align: center; transition: border-color .15s, transform .1s; }
.prod:hover { border-color: var(--primary); }
.prod:active { transform: scale(.97); }
.prod__emoji { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--primary-soft); font-size: 2rem; }
.prod b { font-size: .9rem; line-height: 1.25; }
.prod > span:nth-of-type(2) { color: var(--verde); font-weight: 800; }
.prod--off { background: #fafafa; }
.prod--off .prod__emoji { filter: grayscale(1); opacity: .6; }
.prod--off > span:nth-of-type(2) { color: var(--rojo); }
.prod__falta { padding: 2px 8px; border: 1px solid #fed7aa; border-radius: 99px; color: #9a3412; font-size: .72rem; }
.pedido__panel { position: sticky; top: calc(var(--hdr-h) + 14px); display: flex; flex-direction: column; max-height: calc(100vh - var(--hdr-h) - 28px); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.panel__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.items { flex: 1; overflow-y: auto; list-style: none; padding: 4px 16px; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.item__txt { display: grid; }
.item__txt b { font-size: .92rem; }
.item__nota { color: var(--naranja); }
.item__ok { color: var(--verde); font-size: .75rem; }
.item__ctrl { display: flex; align-items: center; gap: 6px; }
.item__ctrl button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 700; }
.item__ctrl strong { min-width: 62px; text-align: right; }
.cant { min-width: 22px; text-align: center; font-weight: 700; }
.item .link { justify-self: start; }
.panel__foot { display: grid; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--soft); }
.total { display: flex; justify-content: space-between; align-items: baseline; }
.total b { font-size: 1.6rem; color: var(--navy); }
.barra-pedido { display: none; }

/* ---------- KDS ---------- */
.kds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.kds__col, .display__col { padding: 12px; border-radius: var(--radius); background: #fff; border-top: 5px solid var(--primary); box-shadow: var(--shadow); min-height: 200px; }
.kds__col h3, .display__col h3 { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: .95rem; text-transform: uppercase; letter-spacing: .03em; }
.kds__col h3 span, .display__col h3 span { min-width: 26px; padding: 0 8px; border-radius: 99px; background: var(--soft); text-align: center; }
.kds__col--naranja { border-color: var(--naranja); } .kds__col--verde { border-color: var(--verde); }
.comanda { display: grid; gap: 6px; margin-bottom: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.comanda--tarde { border-color: var(--rojo); background: #fff5f5; }
.comanda__head { display: flex; justify-content: space-between; align-items: center; }
.comanda small { color: var(--muted); }
.comanda ul { list-style: none; display: grid; gap: 4px; }
.comanda li em { display: block; color: var(--naranja); font-style: normal; font-size: .85rem; }
.display { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; align-items: start; }
.display__col { border-top-color: var(--verde); }
.display__col .comanda { font-size: 1.1rem; }
.display__col--prep { border-top-color: var(--naranja); }
.mini { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.mini span { font-size: .88rem; }
.mini em { color: var(--muted); font-style: normal; font-size: .78rem; }

/* ---------- Caja ---------- */
.caja-estado { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; padding: 16px 18px; border-radius: var(--radius); }
.caja-estado div { display: grid; }
.caja-estado span { font-size: .88rem; }
.caja-estado.on { background: var(--verde-soft); color: #14532d; }
.caja-estado.off { background: var(--rojo-soft); color: #7f1d1d; }

/* Recetas y compras */
.receta-fila { display: grid; grid-template-columns: 1fr 110px auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.compra-fila { grid-template-columns: 1fr 100px 110px auto; }
.compra-head { display: grid; grid-template-columns: 1fr 100px 110px 36px; gap: 8px; color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.receta-fila select, .receta-fila input { width: 100%; padding: 9px 10px; border: 1px solid #cfd7e4; border-radius: 9px; background: #fff; font-size: 15px; }

/* Próximamente */
.pronto { max-width: 560px; margin: 30px auto; padding: 34px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.pronto span { font-size: 3rem; }
.pronto h2 { margin: 8px 0; color: var(--navy); }
.pronto p { margin-bottom: 10px; }

/* ---------- Ventanas ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(10,26,58,.55); }
.modal__box { width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px; border-radius: 16px; background: #fff; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.modal__box--ancho { max-width: 680px; }
.modal h2 { font-size: 1.2rem; margin-bottom: 14px; }
.modal .dos { margin-top: 10px; }
.cobro__total { display: grid; justify-items: center; margin-bottom: 14px; padding: 14px; border-radius: 12px; background: var(--soft); }
.cobro__total b { font-size: 2.2rem; color: var(--navy); line-height: 1.1; }
.cobro__total small, .cobro__total span { color: var(--muted); font-size: .85rem; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.seg label { display: block; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 10px 6px; border: 1px solid var(--line); border-radius: 10px; text-align: center; font-size: .85rem; font-weight: 600; cursor: pointer; }
.seg input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.rapidos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cambio b { color: var(--verde); }
#bloqueCliente { display: grid; gap: 8px; }
#bloqueCliente input { width: 100%; padding: 10px 12px; border: 1px solid #cfd7e4; border-radius: 10px; font-size: 16px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 200; max-width: 90vw; padding: 11px 18px; border-radius: 10px; background: var(--navy); color: #fff; font-weight: 500; opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Inicio de sesión ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at 20% 0%, #1d4ed8 0%, transparent 55%), linear-gradient(160deg, var(--navy), var(--navy-2)); }
.login__box { display: grid; gap: 8px; width: 100%; max-width: 380px; padding: 28px; border-radius: 18px; background: #fff; box-shadow: 0 30px 70px rgba(0,0,0,.35); }
.login__logo { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; color: var(--navy); line-height: 1.15; }
.login__logo svg { width: 40px; height: 40px; color: var(--primary); }
.login__logo b { font-size: 1.2rem; }
.login__logo small { display: block; color: var(--muted); font-size: .78rem; }
.login h1 { font-size: 1.3rem; margin-bottom: 6px; }
.login label { font-weight: 600; font-size: .86rem; }
.login input { width: 100%; padding: 12px; border: 1px solid #cfd7e4; border-radius: 10px; font-size: 16px; }
.login .btn { margin-top: 8px; padding: 13px; }
.login__demo { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--soft); font-size: .82rem; color: var(--muted); }
.login__demo summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.login__demo p { margin-top: 6px; }

/* ---------- Panel de administración PC Planet ---------- */
.adm { min-height: 100vh; background: var(--soft); }
.adm__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 26px; background: linear-gradient(120deg, var(--navy), var(--primary)); color: #fff; }
.adm__brand { display: flex; align-items: center; gap: 12px; line-height: 1.2; }
.adm__brand svg { width: 42px; height: 42px; color: #7cc4ff; }
.adm__brand b { font-size: 1.2rem; }
.adm__brand small { display: block; color: rgba(255,255,255,.75); }
.adm__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.adm__body { max-width: 1180px; margin: 0 auto; padding: 22px 20px 40px; }
.adm__tools { display: flex; gap: 10px; margin: 20px 0 14px; }
.adm__tools input { flex: 1; min-width: 0; padding: 11px 14px; border: 1px solid #cfd7e4; border-radius: 10px; font-size: 16px; }
.clientes { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.cliente { display: grid; gap: 10px; padding: 18px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); border-top: 4px solid var(--primary); }
.cliente--off { border-top-color: var(--rojo); opacity: .85; }
.cliente__top { display: flex; align-items: center; gap: 12px; }
.cliente__top > div { flex: 1; min-width: 0; display: grid; }
.cliente__top b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cliente__top small { color: var(--muted); font-size: .8rem; }
.cliente__ini { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--primary); color: #fff; font-weight: 800; font-size: 1.2rem; flex-shrink: 0; }
.cliente__info { color: var(--muted); font-size: .84rem; }
.cliente__btns { display: flex; flex-wrap: wrap; gap: 6px; }
.bitacora { max-height: 360px; overflow-y: auto; }
.bitacora .fila2 span { color: var(--text); }
.bitacora .fila2 b { color: var(--muted); font-weight: 500; white-space: nowrap; font-size: .82rem; }

/* Usuarios */
.fila--usr { grid-template-columns: 1fr auto auto; }
.fila--usr > div:first-child { display: grid; }
.fila--usr .estado, .fila__btns { grid-row: auto; grid-column: auto; }
.fila__btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.nuevo-usr { display: grid; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.nuevo-usr__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nuevo-usr input, .nuevo-usr select { width: 100%; padding: 10px 12px; border: 1px solid #cfd7e4; border-radius: 10px; font-size: 16px; }
.nuevo-usr .btn { justify-self: start; }
.modal input:not([type=radio]):not([type=checkbox]), .modal select { width: 100%; padding: 10px 12px; border: 1px solid #cfd7e4; border-radius: 10px; font-size: 16px; }

/* ---------- Ticket (solo al imprimir) ---------- */
.ticket { display: none; }
@media print {
  body { background: #fff; }
  .app, .adm, .login, .modal, .toast { display: none !important; }
  .ticket { display: block; width: 72mm; font-family: "Courier New", monospace; font-size: 11px; color: #000; line-height: 1.35; }
  .ticket hr { border: 0; border-top: 1px dashed #000; margin: 4px 0; }
  .ticket div { margin-bottom: 4px; }
  .t-c { text-align: center; }
  .t-row { display: flex; justify-content: space-between; gap: 6px; margin: 0 !important; }
  .t-total { font-weight: 700; font-size: 13px; margin: 3px 0 !important; }
  .ticket--a4 { width: auto; font-family: "Inter", Arial, sans-serif; font-size: 12px; }
  .ticket--a4 div { margin-bottom: 0; }
  .ticket--a4 .doc { box-shadow: none; padding: 0; }
}

/* ---------- Logo ---------- */
.login__logo { display: grid !important; justify-items: center; gap: 6px; text-align: center; margin-bottom: 14px !important; }
.login__logo img { width: 230px; max-width: 80%; height: auto; }
.login__logo small { color: var(--muted); font-size: .8rem; }
.login h1 { text-align: center; }
.drawer__logo { justify-content: center; padding: 14px 18px !important; }
.drawer__logo img { width: 190px; height: auto; display: block; }
.logo-pill { display: inline-grid; place-items: center; padding: 6px 12px; border-radius: 12px; background: #fff; }
.logo-pill img { height: 40px; width: auto; display: block; }
.banner__logo { display: grid; place-items: center; padding: 16px 20px; border-radius: 16px; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.banner__logo img { width: 210px; height: auto; display: block; }
.logo-cfg { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 12px; border: 1px dashed #cfd7e4; border-radius: 12px; }
.logo-cfg__prev { display: grid; place-items: center; width: 180px; height: 90px; border-radius: 10px; background: var(--soft); overflow: hidden; }
.logo-cfg__prev img { max-width: 100%; max-height: 100%; }
.logo-cfg__prev span { color: var(--muted); font-size: .85rem; }
.logo-cfg__btns { display: grid; gap: 6px; flex: 1; min-width: 200px; }
.doc__emp { display: flex; align-items: center; gap: 14px; }
.doc__logo { max-height: 72px; max-width: 170px; object-fit: contain; }
.t-logo { max-width: 48mm; max-height: 22mm; }

/* ---------- Documento A4 (proformas) ---------- */
.doc { display: grid; gap: 14px; color: var(--text); }
.doc__head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 3px solid var(--primary); font-size: .88rem; color: var(--muted); }
.doc__head h2 { margin: 0 0 4px; color: var(--navy); font-size: 1.3rem; }
.doc__num { display: grid; justify-items: end; text-align: right; }
.doc__num b { color: var(--primary); letter-spacing: .1em; }
.doc__num span { font-size: 1.4rem; font-weight: 800; color: var(--navy); }
.doc__cli { padding: 10px 12px; border-radius: 8px; background: var(--soft); font-size: .9rem; }
.doc__tabla { width: 100%; border-collapse: collapse; font-size: .9rem; }
.doc__tabla th { padding: 8px; background: var(--navy); color: #fff; text-align: left; }
.doc__tabla td { padding: 8px; border-bottom: 1px solid var(--line); }
.doc__tabla th:nth-child(n+3), .doc__tabla td:nth-child(n+3) { text-align: right; }
.doc__tot { justify-self: end; width: 280px; max-width: 100%; }
.doc__obs { font-size: .88rem; }
.doc__pie { color: var(--muted); font-size: .78rem; text-align: center; border-top: 1px solid var(--line); padding-top: 8px; }
.modal__box--doc { max-width: 820px; }
.pf-fila { grid-template-columns: 1fr 100px 110px auto; }
.pf-totales { justify-self: end; width: 300px; max-width: 100%; margin-top: 6px; }
.estado--azul { background: var(--primary-soft); color: var(--primary); }
.estado--gris { background: #e2e8f0; color: #475569; }

/* ---------- Pantallas medianas: el menú se superpone ---------- */
.solo-movil { display: none; }
@media (max-width: 1099px) {
  body.menu-abierto .main { margin-left: 0; }
  body.menu-abierto .hdr { left: 0; }
  body.menu-abierto .drawer { box-shadow: 0 0 50px rgba(0,0,0,.3); }
  body.menu-abierto .drawer__fondo { display: block; position: fixed; inset: 0; z-index: 75; background: rgba(10,26,58,.45); }
  .hubs { grid-template-columns: repeat(2, 1fr); }
  .pedido { grid-template-columns: minmax(0, 1fr) 320px; }
  .kds { grid-template-columns: 1fr 1fr; }
  .display { grid-template-columns: 1fr; }
}

/* ---------- Celular ---------- */
@media (max-width: 760px) {
  :root { --hdr-h: 58px; }
  .hdr { gap: 8px; padding: 0 10px; }
  .hdr__comedor { padding: 8px 10px; font-size: .9rem; }
  .hdr__comedor { gap: 5px; }
  .hdr__comedor .largo { display: none; }
  .hdr__neg a { display: none; }
  .hdr__neg b { font-size: .88rem; max-width: 34vw; }
  .hdr__caja { padding: 6px 10px; font-size: .82rem; }
  .pagehead { padding: 14px 14px 0; }
  .pagehead h1 { font-size: 1.15rem; }
  .reloj { display: none; }
  .view { padding: 12px 12px 30px; }
  .banner { padding: 20px; }
  .banner h2 { font-size: 1.3rem; }
  .banner { flex-direction: column-reverse; align-items: stretch; }
  .banner__logo { padding: 10px; }
  .banner__logo img { width: 160px; }
  .doc__emp { flex-direction: column; align-items: flex-start; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi b { font-size: 1.25rem; }
  .acciones-rapidas { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hubs { gap: 12px; }
  .hub { padding: 22px 8px 16px; }
  .hub__ic { width: 64px; height: 64px; font-size: 1.7rem; border-radius: 18px; }
  .hub b { font-size: 1rem; }
  .pildoras span { font-size: .82rem; padding: 6px 12px; }
  .mesas { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
  .mesa { min-height: 112px; padding: 10px; }
  .pedido { grid-template-columns: minmax(0, 1fr); }
  .productos { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding-bottom: 70px; }
  .solo-movil { display: inline-flex; }
  .pedido__panel { position: fixed; inset: auto 0 0 0; z-index: 60; max-height: 88vh; max-height: 88dvh; border-radius: 18px 18px 0 0; transform: translateY(105%); visibility: hidden; transition: transform .3s, visibility .3s; }
  .pedido__panel.open { transform: none; visibility: visible; }
  .barra-pedido { position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 45; display: flex; align-items: center; gap: 10px; padding: 13px 16px; border: 0; border-radius: 14px; background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 10px 25px rgba(29,78,216,.4); }
  .barra-pedido b { margin-left: auto; }
  .burbuja { display: grid; place-items: center; min-width: 26px; height: 26px; border-radius: 99px; background: #fff; color: var(--primary); font-weight: 800; }
  .kds { grid-template-columns: 1fr; }
  .fila--prod { grid-template-columns: auto 1fr auto; }
  .fila--prod .estado { grid-column: 2; justify-self: start; }
  .fila--prod .icon-btn { grid-column: 3; grid-row: 1 / span 2; }
  .toast { bottom: 90px; }
  .adm__head { padding: 14px 16px; }
  .adm__tools { flex-direction: column; }
  .clientes { grid-template-columns: 1fr; }
  .nuevo-usr__grid { grid-template-columns: 1fr; }
  .fila--usr { grid-template-columns: 1fr auto; }
  .fila--usr .fila__btns { grid-column: 1 / -1; justify-content: flex-start; }
  .compra-head { display: none; }
  .compra-fila, .pf-fila { grid-template-columns: 1fr 1fr auto; }
  .compra-fila select, .pf-fila select { grid-column: 1 / -1; }
  .doc__head { flex-direction: column; }
  .doc__num { justify-items: start; text-align: left; }
  .doc__tabla { font-size: .8rem; }
  .buscar { max-width: none; }
}
