/* Estilo adaptado de los zips AIDOH_Customer_WhatsApp y AIDOH_Owner_Dashboard (2026-10-27).
   Los colores y tipografías de la marca llegan desde la ficha como variables. */
:root {
  --brand: #333; --accent: #c58a4a; --surface: #efe7dd; --paper: #fffbf7; --ink: #2b211e;
  --font-body: system-ui, sans-serif; --font-display: Georgia, serif;
  --bubble-bot: #ffffff; --bubble-user: #dcf8c6; --muted: #667781; --line: #f0e6dc;
  --demo-bg: #fff3b0; --demo-border: #e6c200; --demo-ink: #6b5900;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
.display { font-family: var(--font-display); font-weight: 600; }
.muted { color: var(--muted); }
small { display: block; }

.demo { display: inline-block; background: var(--demo-bg); border: 1px solid var(--demo-border); color: var(--demo-ink); font-weight: 700; font-size: 11px; padding: 4px 9px; border-radius: 999px; }
.demo.block { display: block; border-radius: 8px; margin: 8px 0; padding: 6px 8px; }

/* Cabecera tipo chat */
.head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--brand); color: #fff; }
.head .logo { width: 40px; height: 40px; border-radius: 50%; background: #fff; flex: none; }
.head-text b { display: block; font-size: 16px; }
.head-text small { opacity: .85; font-size: 12px; }
.head .demo { margin-left: auto; }

/* Cliente QR: teléfono con chat */
body[data-view="cliente-qr"] { background: #111b21; }
.phone { max-width: 430px; margin: 0 auto; min-height: 100vh; background: var(--surface); display: flex; flex-direction: column; }
.chat { flex: 1; display: flex; flex-direction: column; padding: 10px 0 90px; }
.bubble { max-width: 82%; padding: 10px 12px; border-radius: 12px; margin: 5px 12px; font-size: 14px; line-height: 1.4; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.bot { background: var(--bubble-bot); align-self: flex-start; border-top-left-radius: 2px; }
.user { background: var(--bubble-user); align-self: flex-end; border-top-right-radius: 2px; }
.bubble.wide { max-width: calc(100% - 24px); width: calc(100% - 24px); }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 8px 0; padding-bottom: 2px; }
.tab { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 6px 12px; white-space: nowrap; font-size: 13px; }
.tab.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.product { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.product .photo { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: var(--surface); }
.product .info p { margin: 2px 0; font-size: 12px; color: var(--muted); }
.product .info strong { font-size: 14px; }
.product.off .photo { filter: grayscale(1); opacity: .6; }
.product .unavailable { color: #a33a1f; }
.credits { margin-top: 6px; font-size: 11px; }
.credits a { color: var(--muted); }
.sold-out { font-size: 11px; font-weight: 700; color: #a33a1f; text-align: right; max-width: 70px; }
.qty { display: flex; align-items: center; gap: 6px; }
.round { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 18px; line-height: 1; padding: 0; }
.round.add { background: var(--brand); border-color: var(--brand); color: #fff; }
.action { display: block; width: 100%; margin-top: 8px; padding: 10px; border: 0; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 700; }
.action.ghost { background: #fff; color: var(--ink); border: 1px solid #d1d7db; font-weight: 500; }
.action.on { background: var(--accent); color: #fff; }
.line-extras { border-top: 1px solid var(--line); padding: 8px 0; margin-top: 6px; }
fieldset { border: 0; margin: 4px 0; padding: 0; }
legend { font-size: 12px; color: var(--muted); padding: 0; margin-bottom: 2px; }
.chip { display: inline-flex; align-items: center; gap: 4px; margin: 3px 6px 3px 0; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; background: #fff; }
.chip input { margin: 0; accent-color: var(--brand); }
textarea { width: 100%; min-height: 60px; margin-top: 6px; padding: 8px; border: 1px solid #d1d7db; border-radius: 8px; }
.ticket-lines { list-style: none; padding: 0; margin: 8px 0; }
.ticket-lines li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; }
.ticket-lines small { color: var(--muted); font-size: 12px; }
.total { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 6px; font-size: 15px; }
.timeline { list-style: none; padding: 0; margin: 8px 0; font-size: 13px; color: var(--muted); }
.timeline li::before { content: "○ "; }
.timeline li.done { color: var(--ink); }
.timeline li.done::before { content: "● "; color: var(--accent); }
.cartbar, .inputbar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: #f0f0f0; font-size: 14px; }
.cartbar .action { width: auto; margin: 0; padding: 10px 18px; }
.inputbar span { flex: 1; background: #fff; color: var(--muted); border-radius: 999px; padding: 10px 14px; }

/* Dueño y barra */
.dashboard { max-width: 1200px; margin: 0 auto; padding: 20px; }
.dashboard h1 { font-size: clamp(20px, 3vw, 28px); margin: 6px 0 18px; }
.label { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.cols { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 16px; align-items: start; }
.card { display: block; width: 100%; text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; box-shadow: 0 2px 12px rgba(0,0,0,.04); }
.card small { font-size: 12px; margin-top: 4px; }
.order.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.attention { background: #fff1ed; border-left: 4px solid #c65d2e; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill { display: inline-block; font-size: 11px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.tag { display: inline-block; font-size: 11px; padding: 4px 8px; border-radius: 6px; background: var(--surface); margin: 6px 6px 0 0; }
.tag.dashed { border: 1px dashed #5a7d5a; background: #eef4ee; }
code { display: block; margin-top: 8px; background: var(--surface); border: 1px dashed #d8cab9; border-radius: 6px; padding: 6px 8px; font-size: 12px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(200px, 1fr)); gap: 12px; }
.col { background: var(--surface); border-radius: 16px; padding: 12px; min-height: 300px; }
.col h2 { font-size: 16px; margin: 0 0 10px; display: flex; justify-content: space-between; }
.count { background: #fff; border-radius: 999px; padding: 0 8px; font-size: 13px; }
.ticket { background: #fff; border-radius: 14px; border-top: 5px solid var(--accent); padding: 12px; margin-bottom: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.ticket-head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.ticket ul { list-style: none; padding: 0; margin: 8px 0; }
.ticket li { margin-bottom: 4px; font-size: 15px; }
.ticket li small { color: var(--muted); font-size: 12px; }
.cash { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-weight: 700; }
.note { background: var(--demo-bg); border-radius: 6px; padding: 4px 8px; font-size: 13px; margin: 6px 0; }
.big { display: block; width: 100%; min-height: 52px; margin-top: 10px; border: 0; border-radius: 12px; background: var(--brand); color: #fff; font-size: 17px; font-weight: 700; }

@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .board { grid-template-columns: 1fr; } .dashboard { padding: 12px; } }

/* Demo: clientes frecuentes (saludo inteligente) */
.who { background: #fff; padding: 8px 12px 2px; border-bottom: 1px solid var(--line); }
.who .label { margin: 0; }
.who .tabs { margin: 4px 0; }
.why { margin: 8px 12px 0; font-weight: 500; line-height: 1.35; }
.ready { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface); }
.ready small { font-size: 13px; margin-top: 2px; }
.ready .timeline { margin: 6px 0 0; }

/* Promociones tipo paquete y opciones agotadas */
.promo { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: center; padding: 10px; margin-bottom: 10px; border: 2px dashed var(--accent); border-radius: 12px; background: #fffaf3; }
.promo-photos { grid-column: 1 / -1; display: flex; gap: 6px; }
.promo .thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--surface); }
.promo .info p { margin: 2px 0; font-size: 12px; color: var(--muted); }
.promo .info strong { font-size: 16px; color: var(--ink); }
.chip.off { opacity: .55; text-decoration: line-through; }

/* Entrega a domicilio */
.addr { display: block; margin-bottom: 8px; }
.addr input { display: block; width: 100%; margin-top: 6px; padding: 8px; border: 1px solid #d1d7db; border-radius: 8px; font: inherit; }

/* Etapa 3: pedidos reales en la base de prueba */
.error { color: #8a1f11; background: #fdecea; border: 1px solid #f5c2bb; border-radius: 8px; padding: 6px 8px; margin: 8px 0; font-size: 14px; }
.live-note { display: block; margin: 6px 0; font-size: 12px; color: #1d5f3a; }
.pin { max-width: 360px; margin: 24px auto; display: grid; gap: 10px; }
.pin label { display: grid; gap: 6px; }
.pin input { padding: 10px; font: inherit; font-size: 18px; letter-spacing: .2em; border: 1px solid var(--line); border-radius: 8px; }
.waiting { display: block; margin-top: 8px; font-style: italic; }

/* Mis clientes (panel del dueño) */
.owner-tabs { margin: 0 0 16px; }
.clients { display: grid; gap: 18px; max-width: 980px; }
.alert { border-left: 5px solid var(--accent); }
.alert.ausencia { border-left-color: #c0573e; }
.alert.logro { border-left-color: #3f8f5a; }
.alert b { display: block; font-size: 16px; margin-bottom: 4px; }
.alert .tag { display: block; width: fit-content; max-width: 100%; }
.idea { margin: 10px 0 6px; font-weight: 600; }
.draft { margin: 8px 0; padding: 10px 12px; background: #e7f6e7; border-radius: 10px; font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.tile b { display: block; font-size: 22px; }
.tile small { color: var(--muted); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.person .habits { margin: 8px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }
@media (max-width: 640px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* «Mi día»: inventario del día, lo que se acabó ayer y hora pico */
.alert.inventario { border-left-color: #c0573e; }
.alert.pico { border-left-color: #b8862b; }
.alert.agotado-ayer { border-left-color: #6b6f80; }
.watch { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 6px; }
.stock small { display: block; margin-top: 4px; }
.meter { height: 10px; border-radius: 6px; background: var(--line); margin: 8px 0 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }
.stock.short .meter i { background: #c0573e; }
.stock .warn { color: #a3402b; font-weight: 700; }
.stock .ok { color: #2f7a48; font-weight: 700; }
.bars { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 140px; margin-bottom: 26px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.bar i { display: block; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar.over i { background: #c0573e; }
.bar.past i { opacity: .45; }
.bar small { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }
.cap { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--ink); opacity: .6; pointer-events: none; }
/* Cargo por servicio */
.service-fee span { color: var(--muted); }
.fee-banner { margin-bottom: 16px; }
.fee-banner small { display: block; margin-top: 4px; }
/* Lealtad: tarjeta de sellos, regalos, hora de recogida */
.bubble.loyalty { background: #fff8e6; border: 1px solid #ecd9a6; }
.bubble.surprise { background: #eaf6ee; border-color: #b9dcc4; }
.stamps { letter-spacing: 2px; color: var(--accent); white-space: nowrap; }
.slots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.slots .action { flex: 1 1 40%; margin: 0; }
.gift small { display: block; color: var(--muted); font-size: 11px; }
.fee-why { display: block; margin: 8px 0; padding: 8px 10px; border-radius: 10px; background: #fff8e6; font-size: 13px; font-weight: 600; }
.vip-price { display: block; margin-top: 4px; color: var(--brand); }
.pickup { margin: 6px 0; }
.receipt li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.receipt li small { display: block; color: var(--muted); }
.receipt .sum { font-size: 20px; }
.fees { margin-bottom: 12px; }
.fees small { display: block; margin-top: 4px; }
.verdict { margin: 10px 0 0; padding: 10px; border-radius: 10px; background: #eaf6ee; }
.fee-note { display: block; font-size: 11px; opacity: .85; }
.benefits ul { list-style: none; padding: 0; margin: 8px 0; }
.benefits li { padding: 3px 0; }
.benefits small { display: block; color: var(--muted); }
/* Versión C del mes: enamorar al dueño */
.growth .wow, .verdict .wow { display: block; font-size: 30px; line-height: 1.1; margin: 6px 0; }
.verdict .wow { font-size: 22px; }
.growth p, .reason p, .verdict p, .soon p { margin: 6px 0; }
.growth-bar { display: flex; height: 18px; border-radius: 9px; overflow: hidden; background: var(--line); margin: 10px 0 4px; }
.growth-bar i { display: block; background: #c9c3b8; }
.growth-bar i.up { background: #2f9e5b; }
.growth-legend { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.up { color: #1f7a43; }
.reason { margin-top: 10px; }
.reason-head { display: flex; justify-content: space-between; gap: 12px; }
.reason details summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.reason ul { list-style: none; padding: 0; margin: 6px 0 0; }
.reason li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.reason li small { display: block; color: var(--muted); }
[data-receipt] .total { display: flex; justify-content: space-between; margin: 12px 0; font-weight: 600; }
.verdict { background: #eaf6ee; margin: 12px 0; }
.verdict .loss { font-weight: 600; }
.soon { margin-top: 12px; border-style: dashed; }
.soon b { display: block; }
