/* =========================================================
   AutoFullRD — estilos. Identidad propia: azul noche + naranja.
   ========================================================= */
:root {
  --bg: #f4f6fb; --card: #ffffff; --ink: #0f172a; --muted: #64748b; --line: #e2e8f0;
  --navy: #0f172a; --navy-2: #1e293b; --accent: #ff6a13; --accent-dark: #e35a0a; --accent-soft: #fff1e8;
  --ok: #16a34a; --warn: #b45309; --danger: #dc2626; --soft: #eef2ff;
  --radius: 16px; --shadow: 0 10px 30px -14px rgba(15, 23, 42, .25);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
svg.lucide { width: 1.05em; height: 1.05em; vertical-align: -0.18em; display: inline-block; flex: none; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .7rem 1.1rem;
  border-radius: 12px; border: 1px solid transparent; font-weight: 600; cursor: pointer; background: var(--navy); color: #fff;
  transition: transform .15s, box-shadow .15s, background .15s; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -8px rgba(255, 106, 19, .7); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #cbd5e1; }
.btn-danger { background: #fff; color: var(--danger); border-color: #fecaca; }
.btn-wa { background: #25d366; color: #fff; }
.btn-wa:hover { background: #1fb457; }
.btn-block { width: 100%; }
.btn-lg { padding: .9rem 1.3rem; font-size: 1.05rem; }
.btn-sm { padding: .45rem .75rem; font-size: .88rem; border-radius: 10px; }
.btn-link { background: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; color: #fff; padding: .5rem .6rem; border-radius: 10px; font-weight: 500; }
.btn-link:hover { background: rgba(255,255,255,.1); }
.btn-icon { background: #fff; border: 1px solid var(--line); border-radius: 999px; width: 40px; height: 40px; display: inline-grid; place-items: center; cursor: pointer; color: var(--ink); }
.btn-icon.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Cabecera ---------- */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50; }
.topbar-in { display: flex; align-items: center; gap: 1rem; height: 66px; }
.logo { display: flex; align-items: center; gap: .55rem; }
.logo-mark { width: 38px; height: 38px; border-radius: 11px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.logo-mark svg { width: 22px; height: 22px; }
.logo-text { font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; }
.logo-text b { color: var(--accent); }
.logo-text span { font-weight: 600; opacity: .85; }
.logo-text.small { font-size: 1.1rem; color: var(--ink); }
.mainnav { display: flex; gap: .25rem; margin-left: .5rem; }
.mainnav a { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .7rem; border-radius: 10px; color: rgba(255,255,255,.85); font-weight: 500; }
.mainnav a:hover, .mainnav a.active { background: rgba(255,255,255,.1); color: #fff; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.auth-only, .admin-only, .staff-only { display: none; }
body.logged .auth-only { display: inline-flex; }
body.admin .admin-only { display: inline-flex; }
body.staff .staff-only { display: inline-flex; }

/* ---------- Portada ---------- */
.hero { margin-top: 1.5rem; background: linear-gradient(135deg, var(--navy) 0%, #1e3a8a 100%); color: #fff; border-radius: 22px; padding: 2.4rem 2rem 2rem; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(255,106,19,.45), transparent 65%); }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); position: relative; }
.hero p { color: rgba(255,255,255,.8); margin-top: .5rem; position: relative; }
.hero-count { display: inline-block; margin-top: .6rem; background: rgba(255,255,255,.12); padding: .3rem .8rem; border-radius: 999px; font-size: .9rem; position: relative; }
.searchbox { background: #fff; color: var(--ink); border-radius: 16px; padding: 1rem; margin-top: 1.4rem; display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr auto; gap: .6rem; position: relative; box-shadow: var(--shadow); }
.searchbox .field { margin: 0; }
.searchbox-more { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

.section { margin-top: 2.2rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.section-head h2 { font-size: 1.35rem; }
.section-head a { color: var(--accent); font-weight: 600; }
.body-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; }
.body-tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; display: flex; align-items: center; gap: .8rem; transition: transform .15s, box-shadow .15s; }
.body-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.body-tile svg { width: 30px; height: 30px; color: var(--accent); }
.body-tile b { display: block; }
.make-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .9rem; font-weight: 600; font-size: .9rem; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip small { color: var(--muted); font-weight: 500; margin-left: .3rem; }
.sell-banner { background: var(--accent-soft); border: 1px solid #ffd4b8; border-radius: 18px; padding: 1.6rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.sell-banner h2 { font-size: 1.3rem; }
.safe-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.safe-item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; display: flex; gap: .7rem; }
.safe-item svg { color: var(--ok); width: 22px; height: 22px; flex: none; margin-top: .1rem; }

/* ---------- Tarjetas de anuncio ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; position: relative; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-img { aspect-ratio: 4 / 3; background: #e2e8f0 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.3'><path d='M5 17h14M6 11l1.5-4.5A2 2 0 0 1 9.4 5h5.2a2 2 0 0 1 1.9 1.5L18 11M4 11h16v6H4zM7 17v2M17 17v2'/></svg>") center/40% no-repeat; position: relative; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-badge { position: absolute; left: .6rem; top: .6rem; background: rgba(15,23,42,.85); color: #fff; font-size: .72rem; font-weight: 700; padding: .2rem .5rem; border-radius: 6px; text-transform: uppercase; letter-spacing: .03em; }
.card-badge.sold { background: var(--danger); }
.card-photos { position: absolute; right: .6rem; bottom: .6rem; background: rgba(15,23,42,.7); color: #fff; font-size: .72rem; padding: .15rem .45rem; border-radius: 6px; display: inline-flex; gap: .25rem; align-items: center; }
.card-fav { position: absolute; right: .5rem; top: .5rem; width: 34px; height: 34px; }
.card-body { padding: .8rem .9rem .9rem; display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.card-title { font-weight: 700; font-size: 1rem; line-height: 1.25; }
.card-title small { color: var(--muted); font-weight: 500; display: block; font-size: .82rem; }
.card-price { font-weight: 800; font-size: 1.15rem; color: var(--navy); margin-top: .2rem; }
.card-price small { font-weight: 600; color: var(--accent); font-size: .75rem; margin-left: .35rem; }
.card-meta { color: var(--muted); font-size: .82rem; display: flex; flex-wrap: wrap; gap: .25rem .6rem; }
.card-foot { margin-top: auto; padding-top: .5rem; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .8rem; }
.tag { display: inline-flex; align-items: center; gap: .25rem; border-radius: 6px; padding: .1rem .45rem; font-size: .75rem; font-weight: 600; background: var(--soft); color: #3730a3; }
.tag.dealer { background: #ecfdf5; color: #047857; }

/* ---------- Búsqueda ---------- */
.search-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1.2rem; margin-top: 1.5rem; align-items: start; }
.filters { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; position: sticky; top: 82px; }
.filters h3 { font-size: 1rem; margin-bottom: .6rem; display: flex; justify-content: space-between; align-items: center; }
.filters .field { margin-bottom: .7rem; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: .25rem; }
.field input, .field select, .field textarea { width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,106,19,.15); }
.field textarea { resize: vertical; min-height: 120px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .9rem; flex-wrap: wrap; }
.results-head h1 { font-size: 1.25rem; }
.results-head select { padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.results .cards { grid-template-columns: repeat(3, 1fr); }
.pager { display: flex; justify-content: center; align-items: center; gap: .8rem; margin: 1.5rem 0; }
.empty { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.filters-toggle { display: none; }
.check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- Ficha ---------- */
.detail { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.2rem; margin-top: 1.5rem; align-items: start; }
.gallery { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery-main { aspect-ratio: 4 / 3; background: #0f172a; position: relative; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); cursor: pointer; display: grid; place-items: center; }
.gallery-nav.prev { left: .6rem; } .gallery-nav.next { right: .6rem; }
.gallery-count { position: absolute; right: .7rem; bottom: .7rem; background: rgba(15,23,42,.75); color: #fff; font-size: .8rem; padding: .2rem .55rem; border-radius: 6px; }
.gallery-thumbs { display: flex; gap: .4rem; padding: .6rem; overflow-x: auto; }
.gallery-thumbs img { width: 84px; height: 63px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; flex: none; }
.gallery-thumbs img.on { border-color: var(--accent); }
.gallery-empty { display: grid; place-items: center; color: #94a3b8; height: 100%; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.panel + .panel { margin-top: 1rem; }
.detail-title { font-size: 1.5rem; }
.detail-sub { color: var(--muted); margin-top: .2rem; }
.detail-price { font-size: 2rem; font-weight: 800; color: var(--navy); margin: .8rem 0 .2rem; }
.detail-price small { font-size: .85rem; color: var(--accent); font-weight: 600; margin-left: .4rem; }
.detail-actions { display: grid; gap: .5rem; margin-top: 1rem; }
.contact-line { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-top: .9rem; padding: .6rem .8rem; background: var(--bg); border-radius: 10px; font-size: .95rem; }
.contact-line b { letter-spacing: .04em; }
.contact-line .link { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.lock-badge { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 0 auto .8rem; }
.lock-badge svg { width: 26px; height: 26px; }
.detail-actions .row2 { gap: .5rem; }
.seller-box { display: flex; gap: .8rem; align-items: center; }
.seller-avatar { width: 46px; height: 46px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; color: #3730a3; flex: none; }
.seller-box b { display: block; }
.specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.spec { background: var(--bg); border-radius: 10px; padding: .6rem .7rem; }
.spec small { display: block; color: var(--muted); font-size: .75rem; }
.spec b { font-size: .95rem; }
.desc { white-space: pre-line; line-height: 1.6; }
.safety { background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: .8rem 1rem; display: flex; gap: .6rem; color: #92400e; font-size: .9rem; }
.safety svg { flex: none; margin-top: .15rem; }
.owner-bar { background: var(--soft); border-radius: 12px; padding: .7rem 1rem; display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; gap: 1rem; }
.sold-banner { background: #fee2e2; color: #991b1b; border-radius: 12px; padding: .7rem 1rem; font-weight: 600; margin-bottom: 1rem; }

/* ---------- Formularios de página ---------- */
.page { margin-top: 1.5rem; }
.page-head { margin-bottom: 1.2rem; }
.page-head h1 { font-size: 1.6rem; }
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; max-width: 780px; }
.form-card h2 { font-size: 1.05rem; margin: 1.2rem 0 .7rem; display: flex; align-items: center; gap: .5rem; }
.form-card h2:first-child { margin-top: 0; }
.form-card h2 .num { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-grid; place-items: center; font-size: .85rem; }
.field { margin-bottom: .9rem; }
.form-err { background: #fee2e2; color: #991b1b; border-radius: 10px; padding: .6rem .8rem; margin: .6rem 0; }
.form-ok { background: #dcfce7; color: #166534; border-radius: 10px; padding: .6rem .8rem; margin: .6rem 0; }
.form-foot { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1.2rem; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: .82rem; margin-top: .25rem; }
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin: .8rem 0; }
.photo-item { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #f1f5f9; }
.photo-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-item .cover { position: absolute; left: .4rem; top: .4rem; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; padding: .15rem .45rem; border-radius: 6px; }
.photo-tools { position: absolute; right: .3rem; bottom: .3rem; display: flex; gap: .25rem; }
.photo-tools button { width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(255,255,255,.95); cursor: pointer; display: grid; place-items: center; }
.dropzone { border: 2px dashed #cbd5e1; border-radius: 14px; padding: 1.4rem; text-align: center; color: var(--muted); cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { display: none; }

/* ---------- Auth ---------- */
.auth-card { max-width: 440px; margin: 2rem auto; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 1.8rem; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.4rem; margin-bottom: .3rem; }
.auth-card .lead { color: var(--muted); margin-bottom: 1.2rem; }
.auth-card .btn-block { margin-top: .4rem; }
.auth-alt { text-align: center; margin-top: .9rem; font-size: .9rem; }
.auth-alt a, .link { color: var(--accent); font-weight: 600; cursor: pointer; background: none; border: 0; padding: 0; }
.code-input { text-align: center; font-size: 1.6rem; letter-spacing: .5em; font-weight: 700; }

/* ---------- Listas propias / admin ---------- */
.list-rows { display: grid; gap: .7rem; }
.list-row { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .8rem; display: grid; grid-template-columns: 120px 1fr auto; gap: .9rem; align-items: center; }
.list-row img, .list-row .noimg { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; background: #e2e8f0; }
.list-row .actions { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }
.pill { display: inline-block; border-radius: 999px; padding: .15rem .6rem; font-size: .75rem; font-weight: 700; }
.pill.activo { background: #dcfce7; color: #166534; } .pill.pausado { background: #fef3c7; color: #92400e; }
.pill.vendido { background: #e0e7ff; color: #3730a3; } .pill.retirado { background: #fee2e2; color: #991b1b; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin-bottom: 1.2rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; }
.stat .val { font-size: 1.6rem; font-weight: 800; }
.stat .lbl { color: var(--muted); font-size: .8rem; }
.tabs { display: flex; gap: .4rem; margin-bottom: 1rem; }
.tabs button { background: #fff; border: 1px solid var(--line); padding: .5rem .9rem; border-radius: 999px; cursor: pointer; font-weight: 600; }
.tabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
table.grid { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.grid th, table.grid td { padding: .6rem .7rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid th { background: var(--bg); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* ---------- Modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: grid; place-items: center; z-index: 100; padding: 1rem; }
.modal-bg[hidden], .toast[hidden], [hidden] { display: none !important; }
.modal { background: #fff; border-radius: 18px; padding: 1.6rem; width: min(480px, 100%); position: relative; max-height: 90vh; overflow: auto; }
.modal h2 { font-size: 1.2rem; margin-bottom: .6rem; }
.modal-x { position: absolute; right: .8rem; top: .8rem; background: var(--bg); border: 0; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.toast { position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%); background: var(--navy); color: #fff; padding: .7rem 1.1rem; border-radius: 12px; z-index: 200; font-weight: 500; box-shadow: var(--shadow); max-width: 90vw; }
.toast.err { background: var(--danger); } .toast.ok { background: var(--ok); }

/* ---------- Ayuda ---------- */
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.help-grid ul { margin: .5rem 0 0; padding-left: 1.2rem; line-height: 1.7; }

/* ---------- Footer ---------- */
.footer { margin-top: 3rem; padding: 2rem 0; border-top: 1px solid var(--line); background: #fff; }
.footer-in { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
.footer-links { display: flex; gap: 1.2rem; font-weight: 600; }

/* ---------- Recorrido de bienvenida ---------- */
#tourWrap { position: fixed; inset: 0; z-index: 3000; }
#tourHole { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .6); pointer-events: none; transition: all .25s; }
#tourCard { position: fixed; width: min(340px, calc(100vw - 24px)); background: #fff; border-radius: 16px; padding: 16px 18px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
#tourCard h3 { margin: 2px 0 6px; font-size: 16px; }
#tourCard p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.tour-step { font-size: 11px; font-weight: 700; letter-spacing: .4px; color: var(--accent); }
.tour-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.tour-foot .spacer { flex: 1; }
.tour-foot .btn { padding: 7px 12px; font-size: 13px; }
#tourWrap.center { background: rgba(15, 23, 42, .6); }

/* ---------- Aviso "Instala la app" ---------- */
.install-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 1rem; z-index: 90;
  width: min(520px, calc(100% - 24px)); background: var(--navy); color: #fff; border-radius: 16px;
  padding: .7rem .8rem; display: flex; align-items: center; gap: .7rem; box-shadow: 0 16px 40px -12px rgba(15,23,42,.6);
}
.install-bar img { border-radius: 11px; flex: none; }
.install-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.install-txt span { font-size: .82rem; color: rgba(255,255,255,.75); }
.install-x { background: none; border: 0; color: rgba(255,255,255,.7); cursor: pointer; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; flex: none; }
.install-x:hover { background: rgba(255,255,255,.1); }
.ios-steps { counter-reset: paso; list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .8rem; }
.ios-steps li { counter-increment: paso; display: flex; gap: .7rem; align-items: flex-start; line-height: 1.5; }
.ios-steps li::before { content: counter(paso); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: .85rem; }
.ios-share { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--soft); color: #2563eb; vertical-align: middle; }
.admin-entry { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--navy); color: #fff; border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1rem; max-width: 780px; }
.admin-entry b { display: flex; align-items: center; gap: .5rem; }
.adm-tools { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .8rem; }
.adm-tools input, .adm-tools select { padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.adm-tools input { flex: 1; min-width: 220px; }

/* ---------- Barra inferior (móvil) ---------- */
.bottomnav { display: none; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); z-index: 60; padding: .35rem .3rem calc(.35rem + env(safe-area-inset-bottom)); }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .1rem; font-size: .68rem; color: var(--muted); padding: .2rem 0; }
.bottomnav a.active { color: var(--accent); }
.bottomnav a svg { width: 22px; height: 22px; }
.bottomnav a.sell svg { width: 38px; height: 38px; padding: 8px; border-radius: 50%; background: var(--accent); color: #fff; margin-top: -14px; box-shadow: 0 6px 14px -4px rgba(255,106,19,.7); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .cards, .results .cards { grid-template-columns: repeat(3, 1fr); }
  .body-grid { grid-template-columns: repeat(2, 1fr); }
  .searchbox { grid-template-columns: 1fr 1fr; }
  .searchbox .btn { grid-column: 1 / -1; }
  .detail { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .mainnav { display: none; }
  .search-layout { grid-template-columns: 1fr; }
  .filters { position: static; display: none; }
  .filters.open { display: block; }
  .filters-toggle { display: inline-flex; }
  .cards, .results .cards { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .safe-grid, .help-grid { grid-template-columns: 1fr; }
  .sell-banner { flex-direction: column; align-items: flex-start; }
  .specs { grid-template-columns: repeat(2, 1fr); }
  .list-row { grid-template-columns: 90px 1fr; }
  .list-row .actions { grid-column: 1 / -1; justify-content: flex-start; }
  .list-row img, .list-row .noimg { width: 90px; height: 68px; }
  #navSell, #navAccount { display: none; }
  #btnLang span { display: none; }
  .hero { padding: 1.6rem 1.2rem; }
  .bottomnav { display: flex; }
  body { padding-bottom: 68px; }
  .install-bar { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
/* Ya instalada: la barra del sistema no existe, se respeta la zona segura del notch */
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); }
}
@media (max-width: 520px) {
  .cards, .results .cards { grid-template-columns: 1fr; }
  .body-grid { grid-template-columns: 1fr 1fr; }
  .searchbox { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .row3 { grid-template-columns: 1fr; }
}

/* =========================================================
   Equipo: tareas del empleado, ficha del comercio y panel
   ========================================================= */
.lpill { display: inline-block; border-radius: 999px; padding: .15rem .6rem; font-size: .75rem; font-weight: 700; background: var(--bg); color: var(--muted); white-space: nowrap; }
.lpill.st-nuevo { background: #e0f2fe; color: #075985; }
.lpill.st-aviso { background: #fef3c7; color: #92400e; }
.lpill.st-accent { background: var(--accent-soft); color: var(--accent-dark); }
.lpill.st-azul { background: #e0e7ff; color: #3730a3; }
.lpill.st-ok { background: #dcfce7; color: #166534; }
.lpill.st-ok2 { background: #166534; color: #fff; }
.lpill.st-rojo { background: #fee2e2; color: #991b1b; }
.tag.warn { background: #fef3c7; color: #92400e; }
.late { color: var(--danger); font-weight: 600; }
.pre { white-space: pre-wrap; }
.warn-box, .ok-box { border-radius: 10px; padding: .6rem .8rem; font-size: .92rem; }
.warn-box { background: #fef3c7; color: #78350f; }
.ok-box { background: #dcfce7; color: #14532d; }

/* Mis tareas */
.task-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin-bottom: 1rem; }
.task-group { margin: 1.4rem 0 .4rem; }
.task-group h2 { font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; margin-bottom: .3rem; }
.task-group h2 .count { background: var(--navy); color: #fff; border-radius: 999px; font-size: .75rem; padding: .05rem .5rem; }
details.task-group summary { cursor: pointer; list-style: none; }
details.task-group summary::-webkit-details-marker { display: none; }
.task-list { display: grid; gap: .5rem; margin-top: .5rem; }
.task-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .85rem 1rem; transition: border-color .15s, transform .15s; }
.task-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.task-card .tc-main { display: flex; flex-direction: column; min-width: 0; }
.task-card .tc-main b { overflow: hidden; text-overflow: ellipsis; }
.task-card .tc-side { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; text-align: right; flex: none; }

/* Ficha del comercio */
.lead-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; }
.lead-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.2rem; align-items: start; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: .8rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.step h3 { font-size: 1.02rem; margin: .3rem 0 .6rem; }
.step-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--bg); color: var(--muted); }
.step.current { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,106,19,.12); }
.step.current .step-num { background: var(--accent); color: #fff; }
.step.done .step-num { background: #dcfce7; color: var(--ok); }
.step.locked { opacity: .6; }
.step-body { min-width: 0; }
.call-btns { display: flex; gap: .5rem; flex-wrap: wrap; }
.say { background: var(--accent-soft); border-radius: 10px; padding: .55rem .8rem; margin-bottom: .6rem; }
.script { white-space: pre-wrap; background: #f8fafc; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: .8rem 1rem; line-height: 1.6; font-size: .98rem; }
.outcomes { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.outcomes .btn { white-space: normal; text-align: center; }
.when-box { margin-top: .7rem; }
.step textarea, .side-card textarea { min-height: 64px; }
.bottomnav a.staff-only { display: none; }
body.staff .bottomnav a.staff-only { display: flex; }
body.staff .bottomnav a.not-staff { display: none; }
.when-box .adm-tools { margin: .3rem 0 0; }
.mini-steps { margin: 0 0 .8rem; padding-left: 1.2rem; font-size: .92rem; display: grid; gap: .35rem; }
.err-list { margin: .4rem 0 0; padding-left: 1.2rem; font-size: .88rem; color: #7f1d1d; max-height: 220px; overflow: auto; }
.side-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.side-card h2 { font-size: 1rem; margin-bottom: .6rem; }
.side-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.side-head h2 { margin: 0; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: .5rem; padding: .35rem 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.kv:last-child { border-bottom: 0; }
.kv > span { color: var(--muted); font-size: .8rem; padding-top: .1rem; }
.kv > div { min-width: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: .8rem 0 0; padding: 0; display: grid; gap: .7rem; max-height: 520px; overflow: auto; }
.timeline li { display: grid; grid-template-columns: 20px 1fr; gap: .5rem; font-size: .88rem; }
.timeline li > svg { color: var(--accent); margin-top: .15rem; }
.timeline li > div { min-width: 0; overflow-wrap: anywhere; }

/* Panel: comercios, usuarios, ajustes */
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .8rem; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .35rem .75rem; cursor: pointer; font-size: .85rem; }
.chip b { margin-left: .2rem; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.bulk-bar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; background: var(--navy); color: #fff; border-radius: 12px; padding: .6rem .8rem; margin-bottom: .8rem; }
.bulk-bar select { padding: .45rem .6rem; border-radius: 10px; border: 0; color: var(--ink); }
.user-actions { display: flex; gap: .4rem; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.settings-wrap { display: block; }
table.grid td input[type="checkbox"], table.grid th input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

@media (max-width: 1024px) {
  .lead-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .task-sum { grid-template-columns: repeat(2, 1fr); }
  .outcomes { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .task-card { flex-direction: column; align-items: flex-start; }
  .task-card .tc-side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem; text-align: left; }
  .step { grid-template-columns: 1fr; padding: .9rem; }
  .step-num { width: 30px; height: 30px; }
  .call-btns .btn { flex: 1 1 100%; }
  .kv { grid-template-columns: 1fr; gap: .1rem; }
}
.field input:disabled, .field select:disabled, .field textarea:disabled { background: var(--bg); color: var(--muted); cursor: not-allowed; }
