/* panel.css — estructura del panel de Deliver (menú lateral, barras, tarjetas). Paleta: violeta → rosa. */
:root { --sb-w: 240px; --sb-mini: 72px; --top: 56px; --mq1: #7c3aed; --mq2: #ec4899; --mq-grad: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%); }
body { padding-top: var(--bar); }
@media (min-width: 992px) { body { padding-left: var(--sb-w); transition: padding-left .2s; } html.sb-mini body { padding-left: var(--sb-mini); } .topbar { display: none !important; } }
@media (max-width: 991.98px) { body { padding-top: calc(var(--top) + var(--bar)); } }
.main { padding: 28px 28px 60px; max-width: 1280px; }
@media (max-width: 575px) { .main { padding: 18px 14px 50px; } }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 1.55rem; margin: 0; }
.page-head p { margin: 2px 0 0; color: #94a3b8; font-size: .9rem; }

/* Menú lateral */
.sb { position: fixed; top: var(--bar); left: 0; bottom: 0; width: var(--sb-w); z-index: 1045; display: flex; flex-direction: column; background: #0f172a;
      border-right: 1px solid rgba(148,163,184,.12); transition: width .2s, transform .25s; overflow: hidden; font-size: .9rem; }
.sb-head { display: flex; align-items: center; gap: .6rem; padding: 1rem; border-bottom: 1px solid rgba(148,163,184,.12); min-height: 64px; }
.sb-logo { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 1.1rem; text-decoration: none; background: var(--mq-grad); }
.sb-brand { font-weight: 700; font-size: 1.12rem; white-space: nowrap; text-decoration: none; background: linear-gradient(135deg,#c4b5fd,#f9a8d4);
            -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.sb-gym { padding: .7rem 1rem; border-bottom: 1px solid rgba(148,163,184,.12); color: #94a3b8; font-size: .78rem; white-space: nowrap; }
.sb-gym strong { display: block; color: #f8fafc; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; }
.sb-nav { flex: 1; overflow-y: auto; padding: .75rem .6rem; scrollbar-width: none; -ms-overflow-style: none; }
.sb-nav::-webkit-scrollbar { display: none; }
.sb-link { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; margin-bottom: 2px; border-radius: .55rem; color: #94a3b8; text-decoration: none; white-space: nowrap; }
.sb-link i { flex: 0 0 22px; font-size: 1.15rem; text-align: center; }
.sb-link:hover { background: rgba(148,163,184,.08); color: #f8fafc; }
.sb-link.active { background: rgba(124,58,237,.18); color: #ddd6fe; box-shadow: inset 3px 0 0 var(--mq2); }
.sb-foot { border-top: 1px solid rgba(148,163,184,.12); padding: .6rem; display: flex; gap: .35rem; }
.sb-foot .sb-link { flex: 1; justify-content: center; margin: 0; padding: .5rem; }
.sb-foot .sb-link span { font-size: .8rem; }
.sb-foot button.sb-link { background: none; border: 0; flex: 0 0 auto; }
@media (min-width: 992px) {
    html.sb-mini .sb:is(:not(:hover), .nohover) { width: var(--sb-mini); }
    html.sb-mini .sb:is(:not(:hover), .nohover) .hide { display: none !important; }
    html.sb-mini .sb:is(:not(:hover), .nohover) .sb-link, html.sb-mini .sb:is(:not(:hover), .nohover) .sb-head { justify-content: center; padding-left: .5rem; padding-right: .5rem; }
    html.sb-mini .sb:is(:not(:hover), .nohover) .sb-foot { flex-direction: column; }
    html.sb-mini .sb:hover:not(.nohover) { box-shadow: 12px 0 32px rgba(0,0,0,.45); }
    html.sb-mini .sb-collapse i { display: inline-block; transform: rotate(180deg); }
}
.topbar { position: fixed; top: var(--bar); left: 0; right: 0; height: var(--top); z-index: 1040; display: flex; align-items: center; gap: .75rem; padding: 0 .9rem;
          background: #0f172a; border-bottom: 1px solid rgba(148,163,184,.12); }
.burger { background: none; border: 1px solid rgba(148,163,184,.22); color: #f8fafc; border-radius: .5rem; width: 40px; height: 38px; font-size: 1.3rem; }
.backdrop { position: fixed; inset: 0; background: rgba(2,6,23,.6); z-index: 1044; opacity: 0; pointer-events: none; transition: opacity .2s; }
@media (max-width: 991.98px) { .sb { transform: translateX(-100%); width: 270px; } html.sb-open .sb { transform: none; } html.sb-open .backdrop { opacity: 1; pointer-events: auto; } .sb-collapse { display: none !important; } }

/* Barras de demo / soporte */
.demo-bar { position: fixed; top: 0; left: 0; right: 0; height: 34px; z-index: 1060; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 1rem;
            background: var(--mq-grad); color: #fff; font-size: .84rem; font-weight: 500; white-space: nowrap; overflow: hidden; }
.demo-bar.soporte { background: linear-gradient(90deg,#b45309,#dc2626); }
.demo-bar a { color: #fff; background: rgba(2,6,23,.3); padding: .15rem .75rem; border-radius: 999px; text-decoration: none; font-weight: 600; }
@media (max-width: 700px) { .demo-full { display: none; } }

/* Botones con la paleta de Deliver */
.btn-primary { --bs-btn-bg: #7c3aed; --bs-btn-border-color: #7c3aed; --bs-btn-hover-bg: #6d28d9; --bs-btn-hover-border-color: #6d28d9;
               --bs-btn-active-bg: #5b21b6; --bs-btn-active-border-color: #5b21b6; --bs-btn-disabled-bg: #7c3aed; --bs-btn-disabled-border-color: #7c3aed; }
.btn-grad { background: var(--mq-grad); border: 0; color: #fff; font-weight: 600; }
.btn-grad:hover, .btn-grad:focus { color: #fff; filter: brightness(1.08); }
.form-check-input:checked { background-color: #7c3aed; border-color: #7c3aed; }
.form-control:focus, .form-select:focus { border-color: #a78bfa; box-shadow: 0 0 0 3px rgba(167,139,250,.15); }

/* Tarjetas y KPIs */
.kpi { padding: 18px 20px; border-radius: .85rem; background: #1e293b; border: 1px solid rgba(148,163,184,.12); height: 100%; }
.kpi .lbl { color: #94a3b8; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.kpi .val { font-size: 1.8rem; font-weight: 700; margin-top: 4px; line-height: 1.1; }
.kpi .sub { color: #94a3b8; font-size: .8rem; margin-top: 4px; }
.panel { background: #1e293b; border: 1px solid rgba(148,163,184,.12); border-radius: .85rem; padding: 20px; }
.panel h2 { font-size: 1.02rem; margin: 0 0 14px; }
.muted { color: #94a3b8; }
.table td, .table th { vertical-align: middle; }

/* Gráfico de visitas (barras CSS) */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 18px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.chart .bar { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: var(--mq-grad); min-height: 3px; position: relative; }
.chart .bar span { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: .68rem; color: #cbd5e1; white-space: nowrap; }
@media (max-width: 575px) { .chart { gap: 3px; } .chart .bar span { font-size: .56rem; top: -15px; } }
.chart .d { font-size: .66rem; color: #64748b; margin-top: 6px; text-align: center; line-height: 1.2; }
.chart .hoy .bar { box-shadow: 0 0 0 2px rgba(236,72,153,.45); }

/* Checklist */
.check { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; font-size: .9rem; }
.check i { font-size: 1.1rem; }
.check.ok i { color: #10b981; } .check.no i { color: #475569; }
.check a { margin-left: auto; font-size: .8rem; }

/* Carta (administración) */
.cat-card { background: #1e293b; border: 1px solid rgba(148,163,184,.12); border-radius: .85rem; margin-bottom: 16px; overflow: hidden; }
.cat-card.inactiva { opacity: .6; }
.cat-head { display: flex; align-items: center; gap: .5rem; padding: 12px 14px; background: #172033; border-bottom: 1px solid rgba(148,163,184,.12); }
.cat-head h2 { font-size: 1rem; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item { display: flex; align-items: center; gap: .75rem; padding: 10px 14px; border-bottom: 1px solid rgba(148,163,184,.08); }
.item:last-child { border-bottom: 0; }
.item.oculto-carta { opacity: .5; }
.item-foto { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: 0 0 52px; background: #0f172a; display: grid; place-items: center; color: #475569; font-size: 1.3rem; }
.item-body { flex: 1; min-width: 0; }
.item-nombre { font-weight: 600; font-size: .93rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { font-size: .78rem; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-precio { font-weight: 700; white-space: nowrap; color: #f9a8d4; font-size: .93rem; }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; border-radius: .5rem; }
.acciones { display: flex; gap: 4px; flex: 0 0 auto; }
@media (max-width: 575px) { .acciones .solo-pc { display: none; } .item { flex-wrap: wrap; } .item .acciones { width: 100%; justify-content: flex-end; } }
.chip-etq { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; padding: .3rem .65rem; border-radius: 999px; border: 1px solid rgba(148,163,184,.25); cursor: pointer; user-select: none; margin: 0 .3rem .4rem 0; }
.chip-etq input { display: none; }
.chip-etq:has(input:checked) { background: rgba(124,58,237,.25); border-color: #a78bfa; color: #ede9fe; }
.foto-prev { width: 100%; max-height: 180px; object-fit: cover; border-radius: .6rem; background: #0f172a; }

/* Vista previa en celular (Diseño) */
.phone { width: 100%; max-width: 360px; margin: 0 auto; border: 10px solid #020617; border-radius: 34px; overflow: hidden; background: #020617; box-shadow: 0 24px 50px -18px rgba(0,0,0,.7); position: relative; }
.phone::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 110px; height: 18px; background: #020617; border-radius: 0 0 12px 12px; z-index: 2; }
.phone iframe { width: 100%; height: 640px; border: 0; display: block; }
.swatch { width: 44px; height: 38px; padding: 3px; border-radius: .5rem; }

/* QR */
.qr-box { background: #fff; border-radius: 1rem; padding: 18px; max-width: 320px; margin: 0 auto; }
.qr-box img, .qr-box canvas, .qr-box svg { width: 100%; height: auto; display: block; }
.estilo { border: 2px solid rgba(148,163,184,.2); border-radius: .8rem; padding: 8px; text-align: center; cursor: pointer; background: #fff; }
.estilo img { width: 100%; display: block; }
.estilo span { display: block; color: #1e293b; font-size: .78rem; font-weight: 600; margin-top: 4px; }
.estilo:has(input:checked) { border-color: #ec4899; box-shadow: 0 0 0 3px rgba(236,72,153,.35); }
.estilo input { display: none; }

/* ── Pedidos (Deliver) ───────────────────────────────────────────────────── */
.sb-link { position: relative; }
.sb-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #ef4444; color: #fff; font-size: .72rem; font-weight: 700; display: inline-grid; place-items: center; animation: latido 1.2s ease-in-out infinite; }
.sb-badge.top { position: absolute; top: -8px; right: -8px; margin: 0; }
html.sb-mini .sb:is(:not(:hover), .nohover) .sb-badge { position: absolute; top: 2px; right: 6px; min-width: 18px; height: 18px; font-size: .64rem; }
@keyframes latido { 50% { transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .sb-badge, .ped.nuevo, .aviso-nuevos { animation: none !important; } }
.aviso-nuevos { display: block; margin-bottom: 16px; padding: 12px 16px; border-radius: .75rem; background: linear-gradient(90deg, #dc2626, #ec4899); color: #fff; font-weight: 600; text-decoration: none; animation: latido-suave 1.6s ease-in-out infinite; }
.aviso-nuevos:hover { color: #fff; filter: brightness(1.08); }
@keyframes latido-suave { 50% { box-shadow: 0 0 0 6px rgba(239,68,68,.25); } }
.punto { width: 10px; height: 10px; border-radius: 50%; background: #64748b; display: inline-block; flex: 0 0 10px; }
.punto.on { background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.2); } .punto.pausa { background: #f59e0b; } .punto.off { background: #ef4444; }
.tablero { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.columna { background: #0f172a; border: 1px solid rgba(148,163,184,.12); border-radius: .85rem; padding: 10px; min-height: 220px; }
.columna h2 { font-size: .9rem; margin: 2px 4px 10px; display: flex; align-items: center; color: #cbd5e1; }
.columna h2 .cuenta { margin-left: auto; background: #1e293b; border-radius: 999px; padding: 1px 9px; font-size: .78rem; }
.columna[data-col="nuevo"] { border-color: rgba(239,68,68,.35); }
.vacia { color: #64748b; font-size: .82rem; text-align: center; padding: 18px 8px; margin: 0; }
.ped { background: #1e293b; border: 1px solid rgba(148,163,184,.14); border-radius: .7rem; padding: 10px 12px; margin-bottom: 9px; cursor: pointer; transition: transform .1s, border-color .15s; }
.ped:hover { border-color: #a78bfa; } .ped:active { transform: scale(.99); }
.ped.nuevo { border-color: #ef4444; box-shadow: 0 0 0 0 rgba(239,68,68,.5); animation: pulso 1.6s infinite; }
@keyframes pulso { 70% { box-shadow: 0 0 0 8px rgba(239,68,68,0); } 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } }
.ped.recien { animation: aparece .6s ease; } @keyframes aparece { from { opacity: 0; transform: translateY(-6px); } }
.ped.entregado, .ped.rechazado, .ped.cancelado { opacity: .75; }
.ped-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ped-top strong { font-size: 1.05rem; } .ped-top .tot { font-weight: 700; color: #f9a8d4; }
.ped-cli { font-weight: 600; margin-top: 4px; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ped-sub { display: flex; justify-content: space-between; gap: 8px; color: #94a3b8; font-size: .78rem; margin-top: 3px; }
.tipo, .prog { font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.tipo.delivery { background: rgba(124,58,237,.25); color: #ddd6fe; } .tipo.retiro { background: rgba(16,185,129,.18); color: #a7f3d0; }
.prog { background: rgba(245,158,11,.18); color: #fde68a; }
#terminados summary { cursor: pointer; } #terminados .lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 9px; } #terminados .ped { margin: 0; }
.tabs-estado { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.tabs-estado button { flex: 1 0 auto; border: 1px solid rgba(148,163,184,.2); background: #0f172a; color: #cbd5e1; border-radius: 999px; padding: 7px 12px; font-size: .84rem; white-space: nowrap; }
.tabs-estado button.active { background: var(--mq-grad); border-color: transparent; color: #fff; font-weight: 600; }
.tabs-estado button b { margin-left: 4px; } .tabs-estado button.alerta:not(.active) { border-color: #ef4444; color: #fca5a5; }
@media (max-width: 991.98px) { .tablero { grid-template-columns: 1fr; } .columna { display: none; } .columna.activa { display: block; } }
.capa-sonido { position: fixed; inset: 0; z-index: 1080; background: rgba(2,6,23,.88); display: grid; place-items: center; text-align: center; cursor: pointer; padding: 24px; }
.capa-sonido i { font-size: 3.4rem; display: inline-grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; background: var(--mq-grad); color: #fff; margin-bottom: 14px; }
.capa-sonido h2 { font-size: 1.5rem; } .capa-sonido p { color: #94a3b8; }
.demoras { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; } .demoras .btn { font-weight: 700; padding: 10px 4px; }
.rechazo summary { list-style: none; cursor: pointer; } .rechazo summary::-webkit-details-marker { display: none; }
.cli { background: #0f172a; border-radius: .6rem; padding: 10px 12px; }
/* Reparto (celular) */
.entrega { background: #1e293b; border: 1px solid rgba(148,163,184,.14); border-radius: .85rem; padding: 14px; margin-bottom: 12px; }
.entrega.en_camino { border-color: #7c3aed; } .entrega.entregado { opacity: .7; }
.entrega .dir { font-size: 1.05rem; font-weight: 600; }
.entrega .btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; } .entrega .btns .btn { padding: 10px 4px; }
/* Opciones / zonas / horarios */
.fila-edit { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(148,163,184,.08); }
.fila-edit:last-child { border-bottom: 0; }
.grupo-op { background: #0f172a; border: 1px solid rgba(148,163,184,.12); border-radius: .7rem; padding: 12px; margin-bottom: 10px; }
.chip-grupo { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; padding: .3rem .7rem; border-radius: 999px; border: 1px solid rgba(148,163,184,.25); cursor: pointer; margin: 0 .3rem .4rem 0; user-select: none; }
.chip-grupo input { display: none; } .chip-grupo:has(input:checked) { background: rgba(124,58,237,.25); border-color: #a78bfa; color: #ede9fe; }
