* { box-sizing: border-box; }
.hidden { display: none !important; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 50% 0%, #241d12 0%, #14110c 55%, #0b0905 100%);
  background-attachment: fixed;
  min-height: 100vh; color: #2b2b2b; margin: 0;
  position: relative;
}
body::after {
  content: ""; position: fixed; right: -60px; bottom: -40px; width: 300px; height: 590px;
  background-image: url('/assets/images/geppetto-full.png'); background-size: contain; background-repeat: no-repeat;
  opacity: 0.16; pointer-events: none; z-index: 0;
}
@media (max-width: 600px) { body::after { width: 180px; height: 354px; right: -40px; bottom: -20px; opacity: 0.12; } }
.wrap { max-width: 720px; margin: 0 auto; padding: 24px 18px 80px; position: relative; z-index: 1; }
.wrap.narrow { max-width: 480px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.brand { display:flex; align-items:center; gap:8px; font-weight:700; }
.brand .dot { display:none; }
.brand img.logo-sm { width: 26px; height: 26px; border-radius: 50%; }
.brand strong { color: #f2ede3; }
.brand .brandtag { color: #8a8378; font-weight: 500; font-size: 12px; }
.back { color: #d9b158; text-decoration: none; font-size: 14px; font-weight: 600; }
.logout { color: #cfc8b8; text-decoration: none; font-size: 13px; }
h1 { font-size: 22px; margin: 0 0 4px; color: #f2ede3; }
.sub { color: #b9b2a2; font-size: 14px; margin-bottom: 24px; }
h2 { font-size: 16px; margin: 28px 0 12px; padding-bottom: 6px; border-bottom: 2px solid #3a3226; color: #d9b158; }
label.fldlabel { display: block; font-size: 14px; margin: 14px 0 6px; font-weight: 600; }
.fld { width: 100%; padding: 11px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 15px; background: #fff; font-family: inherit; }
textarea.fld { min-height: 60px; resize: vertical; }
select.fld { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23b8892b' d='M7 10l5 5 5-5z'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checks label { font-weight: 400; display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; }
.checks input { width: auto; }
.conditional { margin-top: 8px; display: none; }
.conditional.show { display: block; }
button.submit, button.btn, a.btn { padding: 13px 18px; background: #b8892b; color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; }
button.submit { width: 100%; margin-top: 30px; padding: 15px; }
button.btn.secondary { background: #fff; color: #b8892b; border: 1px solid #b8892b; }
button.submit:disabled, button.btn:disabled { background: #ccc; color:#fff; cursor: default; }
.msg { margin-top: 16px; padding: 12px; border-radius: 8px; font-size: 14px; }
.msg.ok { background: #e2f5e9; color: #1b7a45; }
.msg.err { background: #fbe2e2; color: #a33; }
.req { color: #b8892b; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
@media (max-width: 480px) { .cards { grid-template-columns: 1fr; } }
.card { display:block; background:#fff; border-radius:14px; padding:20px; text-decoration:none; color:#2b2b2b; border: 1px solid #eee; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.card .icon { font-size: 26px; margin-bottom: 10px; display:block; }
.card .title { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.card .desc { font-size: 13px; color: #888; }

.list-item { background:#fff; border:1px solid #eee; border-radius:12px; padding:14px 16px; margin-bottom:10px; display:flex; justify-content:space-between; align-items:center; gap:10px; }
.list-item .name { font-weight:600; }
.list-item .meta { font-size: 13px; color: #888; }
.pill { display:inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight:600; }
.pill.low { background:#fbe2e2; color:#a33; }
.pill.ok { background:#e2f5e9; color:#1b7a45; }

.promo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
@media (max-width: 480px) { .promo-grid { grid-template-columns: 1fr; } }
.promo-card { position: relative; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 230px; border-radius: 16px; overflow: hidden; text-decoration: none; color: #fff; }
.promo-card img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; transition: transform 0.4s ease; }
.promo-card:hover img.bg { transform: scale(1.05); }
.promo-card .overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,14,16,0.35) 0%, rgba(20,14,16,0.65) 100%); z-index: 1; }
.promo-card .content { position: relative; z-index: 2; padding: 20px; }
.promo-card h3 { font-family: Georgia, 'Times New Roman', serif; font-size: 21px; letter-spacing: 1.5px; margin: 0 0 6px; text-transform: uppercase; line-height: 1.3; }
.promo-card .desc2 { font-size: 12px; opacity: 0.85; margin-bottom: 14px; letter-spacing: 0.3px; }
.promo-card .pill { display: inline-block; padding: 9px 20px; border: 1.5px solid #fff; border-radius: 999px; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }

.compare-wrap { position: relative; width: 100%; aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; background: #eee; }
.compare-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-tag { position: absolute; top: 8px; background: rgba(0,0,0,0.6); color: #fff; font-size: 11px; padding: 3px 9px; border-radius: 6px; z-index: 3; }
.compare-slider { width: 100%; margin-top: 10px; accent-color: #b8892b; }
.money-row { display:flex; gap:14px; font-size:13px; color:#666; margin-top:4px; }
.money-row .gain { color:#1b7a45; font-weight:600; }
.money-row .gain.neg { color:#a33; }

.empty { text-align:center; color:#999; padding: 40px 0; font-size: 14px; }
img.thumb { width:56px; height:56px; border-radius:8px; object-fit:cover; background:#eee; }
.grid-photos { display:grid; grid-template-columns: repeat(3,1fr); gap:8px; margin-top:10px; }
.grid-photos img { width:100%; aspect-ratio:1; object-fit:cover; border-radius:8px; }

/* Resumen con números (inicio) */
.stats-strip { display:grid; grid-template-columns: repeat(4,1fr); gap:8px; margin-bottom:24px; }
@media (max-width: 600px) { .stats-strip { grid-template-columns: repeat(2,1fr); } }
.stat-box { background:#fff; border:1px solid #eee; border-radius:14px; padding:14px 8px; text-align:center; }
.stat-box .num { font-size:19px; font-weight:800; color:#b8892b; }
.stat-box .lbl { font-size:10.5px; color:#888; margin-top:3px; text-transform:uppercase; letter-spacing:0.3px; }

/* Semáforo de inventario sobre la tarjeta del inicio */
.promo-card .badge-low { position:absolute; top:10px; right:10px; z-index:3; background:#e23c3c; color:#fff; font-size:11px; font-weight:700; padding:4px 10px; border-radius:999px; }

/* Línea de tiempo de visitas en la ficha */
.timeline { position:relative; margin-left:6px; padding-left:22px; border-left:2px solid #f0e2c0; }
.timeline-item { position:relative; margin-bottom:20px; }
.timeline-item::before { content:''; position:absolute; left:-29px; top:5px; width:11px; height:11px; border-radius:50%; background:#b8892b; border:2px solid #fff; box-shadow:0 0 0 2px #f0e2c0; }
.timeline-item .tdate { font-weight:700; font-size:14px; }
.timeline-item .tprod { display:inline-block; font-size:11px; background:#f6ecd2; color:#b8892b; padding:2px 8px; border-radius:999px; margin-top:4px; margin-right:4px; }

/* Banner tipo Zanori en páginas internas */
.hero-banner { position:relative; display:flex; align-items:flex-end; min-height:140px; border-radius:16px; overflow:hidden; color:#fff; margin-bottom:22px; }
.hero-banner img.bg { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.hero-banner .overlay { position:absolute; inset:0; background:linear-gradient(180deg, rgba(20,14,16,0.15) 0%, rgba(20,14,16,0.78) 100%); }
.hero-banner .content { position:relative; z-index:2; padding:18px 20px; }
.hero-banner h1 { font-family: Georgia, 'Times New Roman', serif; letter-spacing:1px; margin:0 0 4px; text-transform:uppercase; font-size:21px; color:#fff; }
.hero-banner .sub2 { font-size:13px; opacity:0.9; }

/* Vitrina de resultados */
.resultado-card { background:#fff; border:1px solid #eee; border-radius:14px; padding:16px; margin-bottom:16px; }
.resultado-card .rnombre { font-weight:700; margin-bottom:10px; }

/* Barras de categorías (gastos / ventas por categoría) */
.bar-chart { margin: 6px 0 10px; }
.bar-row { margin-bottom: 14px; cursor: default; }
.bar-row .bar-label { display:flex; justify-content:space-between; font-size:13px; font-weight:600; margin-bottom:5px; }
.bar-row .bar-label .cat { color:#333; }
.bar-row .bar-label .val { color:#b8892b; font-weight:700; }
.bar-track { background:#f2e9d6; border-radius:999px; height:14px; overflow:hidden; }
.bar-fill { height:100%; border-radius:999px; background:linear-gradient(90deg, #d9b158 0%, #8a6510 100%); width:0%; transition: width 0.9s cubic-bezier(.2,.8,.2,1); position:relative; }
.bar-row:hover .bar-fill { filter: brightness(1.08); }
.bar-mes { font-size:12px; color:#9a8f7a; margin: -4px 0 16px; }

/* Ganancia de un día específico */
.dia-buscador { display:flex; align-items:center; gap:8px; margin: 6px 0 14px; flex-wrap:wrap; }
.dia-buscador input[type="date"] { padding:9px 12px; border-radius:10px; border:1px solid #ddd; font-size:14px; color:#333; background:#fff; }
.btn-chip { padding:9px 14px; border-radius:10px; border:1px solid #ddd; background:#fff; font-size:13px; color:#555; cursor:pointer; }
.btn-chip:hover { background:#f7f2e8; border-color:#d9b158; color:#7a4a2f; }
.ganancia-dia-box { background:#fff; border:1px solid #eee; border-radius:14px; padding:18px; margin-bottom:24px; }
.gd-num { font-size:32px; font-weight:800; color:#7a4a2f; text-align:center; margin-bottom:14px; }
.gd-desglose { display:flex; flex-direction:column; gap:8px; border-top:1px solid #f1ebe0; padding-top:12px; }
.gd-desglose div { display:flex; justify-content:space-between; font-size:13.5px; color:#555; }
.gd-desglose b { color:#333; font-weight:700; }
.gd-nota { margin-top:12px; font-size:11.5px; color:#999; line-height:1.4; }

/* Sección Clientes (por día) */
.cliente-item { background:#fff; border:1px solid #eee; border-radius:12px; margin-bottom:8px; overflow:hidden; }
.cliente-head { display:flex; justify-content:space-between; align-items:center; padding:14px 16px; cursor:pointer; gap:10px; }
.cliente-head .cn { font-weight:700; font-size:14.5px; }
.cliente-head .cf { font-size:12px; color:#999; margin-top:2px; }
.cliente-head .cv { display:flex; align-items:center; gap:8px; }
.cliente-head .ct { font-weight:700; color:#b8892b; }
.cliente-head .chev { transition: transform 0.2s ease; color:#bbb; }
.cliente-item.open .chev { transform: rotate(180deg); }
.cliente-body { display:none; padding: 0 16px 14px; border-top:1px solid #f4f0e8; }
.cliente-item.open .cliente-body { display:block; }
.cliente-line { display:flex; justify-content:space-between; font-size:13px; padding:8px 0; border-bottom:1px dashed #f0ece2; }
.cliente-line:last-child { border-bottom:none; }
.cliente-line .cp { color:#444; }
.cliente-line .cq { color:#999; font-size:12px; }

/* ---------- Chat "Habla con Geppetto" ---------- */
body.chat-open { overflow: hidden; }
.chat-pane { position: fixed; inset: 0; z-index: 100; background: #0a0908; color: #fff; display: flex; flex-direction: column; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; max-width: 560px; margin: 0 auto; }
.chat-top { display: flex; align-items: center; gap: 12px; padding: 46px 16px 12px; border-bottom: 1px solid rgba(255,255,255,.07); background: rgba(10,9,8,.9); }
.chat-top button { background: none; border: 0; color: #d9b158; font-size: 34px; line-height: 1; padding: 0 6px 4px 0; cursor: pointer; }
.chat-top img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: #1a1a1e; }
.chat-top b { font-size: 16px; font-weight: 600; display: block; } .chat-top small { font-size: 12px; color: rgba(255,255,255,.5); }
.chat-list { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.cm { max-width: 86%; padding: 11px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.42; white-space: pre-line; word-break: break-word; }
.cm.me { align-self: flex-end; background: #8a6420; border-bottom-right-radius: 6px; }
.cm.ge { align-self: flex-start; background: rgba(255,255,255,.08); border-bottom-left-radius: 6px; box-shadow: inset 0 1px 1px rgba(255,255,255,.1); }
.cm.wait { color: rgba(255,255,255,.55); font-style: italic; }
.cm-note { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 4px; }
.cm-plan { margin-top: 8px; background: rgba(0,0,0,.35); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; line-height: 1.45; color: rgba(255,255,255,.9); }
.cm-plan strong { display: block; font-size: 14px; margin-bottom: 4px; }
.cm-plan em { display: block; font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .14em; color: #d9b158; margin-top: 8px; }
.cm-sub { font-size: 12.5px; color: rgba(255,255,255,.65); }
.cm-acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cm-btn { border: 0; border-radius: 12px; padding: 9px 13px; font: 700 13px inherit; color: #fff; cursor: pointer; }
.cm-btn.ok { background: #25a244; } .cm-btn.no { background: rgba(255,255,255,.12); }
.cm-btn:disabled { opacity: .5; }
.chat-hint { margin: 0; text-align: center; font-size: 11px; color: rgba(255,255,255,.4); padding: 4px 16px; }
.chat-attach { margin: 0; text-align: center; font-size: 12px; color: #d9b158; padding: 0 16px 8px; }
.chat-bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px 22px; }
.chat-bar input[type=text] { flex: 1; min-width: 0; background: rgba(255,255,255,.08); border: 0; border-radius: 999px; padding: 12px 16px; color: #fff; font-size: 15px; outline: none; }
.chat-bar input::placeholder { color: rgba(255,255,255,.4); }
.chat-ic { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: #fff; font-size: 18px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.chat-ic.rec { background: #d33; animation: pulso-chat 1s infinite; }
.chat-send { width: 42px; height: 42px; border-radius: 50%; border: 0; background: #b8892b; color: #fff; font-size: 18px; cursor: pointer; flex: none; }
.chat-send:disabled { opacity: .5; }
@keyframes pulso-chat { 50% { opacity: .55; } }
.chat-entry { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #1c160c, #14110c); border: 1px solid #3a3226; border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; cursor: pointer; }
.chat-entry img { width: 42px; height: 42px; border-radius: 50%; flex: none; }
.chat-entry .t { font-weight: 700; color: #f2ede3; font-size: 15px; }
.chat-entry .s { font-size: 12.5px; color: #b9b2a2; }
@media (min-width: 640px) { .chat-pane { max-width: 820px; } .chat-list { padding: 20px 28px; } .cm { max-width: 72%; } }
