/* Marketdelnortedeltolima — sistema visual */
:root {
  --primary: #208AEC; --primary-600: #1673cc; --primary-700: #115ea8; --primary-50: #eaf4fe; --primary-100: #d3e8fc;
  --accent: #27AE60; --accent-600: #1f9150; --accent-50: #e8f7ee;
  --ink: #12213a; --ink-2: #2c3b55; --muted: #5d6c83; --muted-2: #8795aa;
  --line: #e2e8f0; --line-2: #eef2f7; --bg: #f4f7fb; --card: #ffffff;
  --warn: #e8a317; --warn-50: #fff6e0; --danger: #d64545; --danger-50: #fdecec; --violet: #7b5bd6; --violet-50: #f1edfc;
  --radius: 14px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(18,33,58,.06), 0 4px 16px rgba(18,33,58,.06);
  --shadow-lg: 0 10px 40px rgba(18,33,58,.16);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: var(--primary-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--primary-100); outline-offset: 2px; }

/* ---------- Header ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 1.05rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), var(--accent)); display: grid; place-items: center; color: #fff; font-weight: 800; }
.brand small { display: block; font-size: .68rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.brand .b1 { color: var(--primary-700); } .brand .b2 { color: var(--accent-600); }
.searchbar { flex: 1; display: flex; max-width: 620px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.searchbar input { flex: 1; border: 0; background: transparent; padding: 10px 16px; font: inherit; min-width: 0; outline: none; }
.searchbar button { border: 0; background: var(--primary); color: #fff; padding: 0 18px; font-weight: 700; cursor: pointer; font: inherit; font-weight: 700; }
.nav-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; color: var(--ink-2); border: 0; background: transparent; cursor: pointer; font-size: 1.2rem; }
.icon-btn:hover { background: var(--bg); text-decoration: none; }
.icon-btn .dot { position: absolute; top: 5px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; }
.icon-btn .dot.red { background: var(--danger); }
.user-menu { position: relative; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-100); color: var(--primary-700); display: inline-grid; place-items: center; font-weight: 800; font-size: .85rem; overflow: hidden; flex-shrink: 0; object-fit: cover; }
.avatar.lg { width: 72px; height: 72px; font-size: 1.5rem; }
.avatar.xl { width: 96px; height: 96px; font-size: 2rem; }
.dropdown { position: absolute; right: 0; top: 48px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 240px; padding: 8px; display: none; z-index: 60; }
.dropdown.open { display: block; }
.dropdown a, .dropdown button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 12px; border-radius: 8px; color: var(--ink); border: 0; background: none; font: inherit; cursor: pointer; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--bg); text-decoration: none; }
.dropdown hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.dropdown .who { padding: 8px 12px 10px; }
.role-tag { display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--primary-50); color: var(--primary-700); text-transform: uppercase; letter-spacing: .04em; }
.role-tag.seller { background: var(--accent-50); color: var(--accent-600); } .role-tag.admin { background: var(--violet-50); color: var(--violet); }
.subnav { background: #fff; border-bottom: 1px solid var(--line); }
.subnav .wrap { display: flex; gap: 6px; overflow-x: auto; padding-top: 8px; padding-bottom: 8px; scrollbar-width: none; }
.subnav a { white-space: nowrap; padding: 6px 12px; border-radius: 999px; color: var(--ink-2); font-size: .88rem; font-weight: 600; }
.subnav a:hover { background: var(--bg); text-decoration: none; }

/* ---------- Botones y formularios ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 700; cursor: pointer; background: var(--primary); color: #fff; transition: background .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: var(--primary-600); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.accent { background: var(--accent); } .btn.accent:hover { background: var(--accent-600); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); } .btn.ghost:hover { background: var(--bg); }
.btn.danger { background: var(--danger); } .btn.danger:hover { background: #b93838; }
.btn.warn { background: var(--warn); color: #3a2a00; }
.btn.link { background: none; color: var(--primary-600); padding: 4px 6px; } .btn.link:hover { text-decoration: underline; }
.btn.sm { padding: 6px 12px; font-size: .85rem; border-radius: 8px; }
.btn.lg { padding: 13px 22px; font-size: 1.02rem; }
.btn.block { width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; font-size: .86rem; color: var(--ink-2); }
.field .hint { font-size: .8rem; color: var(--muted); }
input:where(:not([type=checkbox], [type=radio], [type=range], [type=file], [type=hidden])), select, textarea {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); width: 100%; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--primary); }
.radio-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.radio-card { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; background: #fff; }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.radio-card input { accent-color: var(--primary); margin-top: 3px; }

/* ---------- Tarjetas y layout ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card.flat { box-shadow: none; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h2, .card-h h3 { margin: 0; }
.page { padding-top: 24px; padding-bottom: 64px; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-h h1 { margin: 0; }
.page-h p { margin: 4px 0 0; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.stack > * + * { margin-top: 12px; }
.flex { display: flex; gap: 10px; align-items: center; } .flex.wrapx { flex-wrap: wrap; } .between { justify-content: space-between; }
.spacer { flex: 1; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .big { font-size: 2.6rem; margin-bottom: 8px; }
.notice { border-radius: 12px; padding: 12px 16px; background: var(--primary-50); color: var(--primary-700); border: 1px solid var(--primary-100); font-size: .92rem; }
.notice.warn { background: var(--warn-50); color: #7a5300; border-color: #f6dfa2; }
.notice.ok { background: var(--accent-50); color: var(--accent-600); border-color: #c4ebd3; }
.notice.danger { background: var(--danger-50); color: #9b2c2c; border-color: #f5c6c6; }

/* ---------- Pills, badges, estrellas ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pill.blue { background: var(--primary-50); color: var(--primary-700); } .pill.green { background: var(--accent-50); color: var(--accent-600); }
.pill.amber { background: var(--warn-50); color: #8a5d00; } .pill.red { background: var(--danger-50); color: #b23131; } .pill.violet { background: var(--violet-50); color: var(--violet); }
.verified { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-600); font-weight: 700; font-size: .8rem; }
.verified::before { content: '✓'; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .65rem; }
.stars { color: #f2b01e; letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: #d7dde6; }
.rating { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; }
.rating b { color: var(--ink); }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-input input { display: none; }
.star-input label { font-size: 1.9rem; color: #d7dde6; cursor: pointer; line-height: 1; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #f2b01e; }

/* ---------- Home ---------- */
.hero { background: linear-gradient(120deg, #0f4f8f 0%, var(--primary) 55%, #2fa3e0 100%); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -120px; bottom: -160px; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(39,174,96,.55), transparent 65%); }
.hero .wrap { position: relative; z-index: 1; padding-top: 44px; padding-bottom: 48px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center; }
.hero h1 { font-size: 2.35rem; margin-bottom: 12px; }
.hero p.lead { font-size: 1.08rem; opacity: .92; max-width: 560px; }
.hero .searchbar { background: #fff; max-width: 560px; border: 0; margin: 20px 0 14px; box-shadow: var(--shadow-lg); }
.hero .searchbar input { padding: 14px 18px; }
.hero .searchbar button { background: var(--accent); padding: 0 22px; }
.hero-stats { display: flex; gap: 28px; margin-top: 18px; flex-wrap: wrap; }
.hero-stats b { display: block; font-size: 1.5rem; }
.hero-stats span { opacity: .85; font-size: .86rem; }
.trust-card { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); border-radius: 18px; padding: 22px; backdrop-filter: blur(6px); }
.trust-card li { margin-bottom: 10px; }
.trust-card ul { padding-left: 0; list-style: none; margin: 0; }
.trust-card li::before { content: '✓'; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); margin-right: 10px; font-size: .75rem; font-weight: 800; }
.section { margin-top: 36px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.section-h h2 { margin: 0; }
.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cat-tile { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 132px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 16px; box-shadow: var(--shadow); }
.cat-tile:hover { text-decoration: none; transform: translateY(-2px); transition: transform .15s; }
.cat-tile .ic { position: absolute; right: 12px; top: 8px; font-size: 3rem; opacity: .9; }
.cat-tile b { font-size: 1.05rem; } .cat-tile span { font-size: .82rem; opacity: .9; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: s; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: relative; }
.step::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-50); color: var(--primary-700); font-weight: 800; margin-bottom: 10px; }

/* ---------- Tarjetas de producto ---------- */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.lcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; color: var(--ink); transition: box-shadow .15s, transform .15s; }
.lcard:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; }
.lcard .ph { aspect-ratio: 4/3; background: var(--line-2); position: relative; }
.lcard .ph img { width: 100%; height: 100%; object-fit: cover; }
.lcard .ph .tag { position: absolute; left: 10px; top: 10px; }
.lcard .bd { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.lcard .t { font-weight: 700; font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.lcard .p { font-weight: 800; font-size: 1.12rem; color: var(--ink); }
.lcard .p small { font-weight: 600; font-size: .75rem; }
.lcard .meta { display: flex; justify-content: space-between; gap: 6px; font-size: .8rem; color: var(--muted); margin-top: auto; padding-top: 6px; }
.price { font-weight: 800; }

/* ---------- Búsqueda ---------- */
.search-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 20px; align-items: start; }
.filters { position: sticky; top: 84px; }
.filters h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 8px; }
.filters h4:first-child { margin-top: 0; }
.cat-list a { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); font-size: .9rem; }
.cat-list a:hover, .cat-list a.on { background: var(--primary-50); color: var(--primary-700); text-decoration: none; }
.cat-list a.sub { padding-left: 24px; font-size: .85rem; }
.results-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.results-bar select { width: auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; background: #fff; border: 1px solid var(--line); border-radius: 999px; font-size: .82rem; cursor: pointer; color: var(--ink-2); }
.chip:hover { border-color: var(--primary); }
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
#results-map, .map { height: 380px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 1; }
.map.sm { height: 220px; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }

/* ---------- Detalle de producto ---------- */
.gallery .main { aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; background: var(--line-2); }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 10px; }
.gallery .thumbs button { width: 74px; height: 56px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: none; }
.gallery .thumbs button.on { border-color: var(--primary); }
.gallery .thumbs img { width: 100%; height: 100%; object-fit: cover; }
.buybox .p { font-size: 1.9rem; font-weight: 800; }
.qty { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 38px; border: 0; background: var(--bg); font-size: 1.1rem; cursor: pointer; }
.qty input { width: 64px; border: 0; text-align: center; border-radius: 0; }
.seller-mini { display: flex; gap: 12px; align-items: center; }
.desc { white-space: pre-line; }
.review { padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.review:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: .92rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; word-break: break-word; }

/* ---------- Pedidos / línea de tiempo ---------- */
.order-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.order-row:hover { text-decoration: none; background: #fbfcfe; }
.order-row:last-child { border-bottom: 0; }
.thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--line-2); }
.thumb.sm { width: 44px; height: 44px; border-radius: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 34px; }
.timeline li::before { content: ''; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dotc { position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: .7rem; font-weight: 800; }
.timeline .dotc.todo { background: #fff; border: 2px solid var(--line); color: var(--muted-2); }
.timeline .dotc.bad { background: var(--danger); } .timeline .dotc.warn { background: var(--warn); }
.progress-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 6px 0 18px; }
.progress-steps div { text-align: center; font-size: .74rem; color: var(--muted); font-weight: 600; }
.progress-steps div::before { content: ''; display: block; height: 6px; border-radius: 3px; background: var(--line); margin-bottom: 6px; }
.progress-steps div.done::before { background: var(--accent); } .progress-steps div.done { color: var(--accent-600); }
.contact-card { border: 1.5px solid #c4ebd3; background: linear-gradient(180deg, var(--accent-50), #fff 60%); }

/* ---------- Mensajes ---------- */
.chat { display: grid; grid-template-columns: 330px minmax(0, 1fr); height: calc(100vh - 160px); min-height: 480px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.conv-list { border-right: 1px solid var(--line); overflow-y: auto; }
.conv-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink); align-items: center; }
.conv-item:hover { background: var(--bg); text-decoration: none; }
.conv-item.on { background: var(--primary-50); }
.conv-item .txt { min-width: 0; flex: 1; }
.conv-item .txt b, .conv-item .txt span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item .txt span { font-size: .82rem; color: var(--muted); }
.conv-item .unread { background: var(--accent); color: #fff; border-radius: 999px; font-size: .72rem; font-weight: 800; padding: 1px 7px; }
.thread { display: flex; flex-direction: column; min-width: 0; }
.thread-h { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #f8fafd; }
.msg { max-width: 72%; padding: 9px 13px; border-radius: 14px; background: #fff; border: 1px solid var(--line); white-space: pre-line; word-wrap: break-word; }
.msg.me { align-self: flex-end; background: var(--primary); color: #fff; border-color: var(--primary); border-bottom-right-radius: 4px; }
.msg.them { align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.sys { align-self: center; background: var(--accent-50); border-color: #c4ebd3; color: var(--ink-2); font-size: .86rem; max-width: 88%; }
.msg time { display: block; font-size: .7rem; opacity: .7; margin-top: 3px; }
.compose { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.compose textarea { min-height: 44px; height: 44px; }

/* ---------- Paneles (vendedor / admin) ---------- */
.dash { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 24px; align-items: start; }
.side { position: sticky; top: 84px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.side .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); padding: 10px 12px 6px; font-weight: 700; }
.side a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: var(--ink-2); font-weight: 600; font-size: .92rem; }
.side a:hover { background: var(--bg); text-decoration: none; }
.side a.on { background: var(--primary-50); color: var(--primary-700); }
.side a .n { margin-left: auto; background: var(--danger); color: #fff; font-size: .7rem; border-radius: 999px; padding: 1px 7px; font-weight: 800; }
.side.admin a.on { background: var(--violet-50); color: var(--violet); }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi .l { font-size: .8rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.kpi .v { font-size: 1.65rem; font-weight: 800; margin: 4px 0 2px; letter-spacing: -.02em; }
.kpi .d { font-size: .8rem; font-weight: 700; }
.up { color: var(--accent-600); } .down { color: var(--danger); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 10px; }
.bars .b { flex: 1; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; opacity: .85; }
.bars .b:hover { opacity: 1; }
.bars .b:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: .72rem; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 5; }
.hbar { display: grid; grid-template-columns: 150px minmax(0, 1fr) 110px; gap: 10px; align-items: center; font-size: .88rem; margin-bottom: 8px; }
.hbar .track { height: 10px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--accent); border-radius: 5px; }
.hbar .val { text-align: right; font-weight: 700; }
.queue-tile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); color: var(--ink); }
.queue-tile:hover { border-color: var(--primary); text-decoration: none; }
.queue-tile .num { font-size: 1.6rem; font-weight: 800; min-width: 36px; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr:hover td { background: #fafcff; }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; border: 0; background: none; font: inherit; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs a.on, .tabs button.on { color: var(--primary-700); border-bottom-color: var(--primary); }
.tabs a:hover { text-decoration: none; color: var(--ink); }

/* ---------- Fotos del vendedor ---------- */
.photo-slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.slot { aspect-ratio: 1; border-radius: 12px; border: 2px dashed var(--line); background: var(--bg); display: grid; place-items: center; position: relative; overflow: hidden; color: var(--muted); font-size: .8rem; text-align: center; }
.slot img { width: 100%; height: 100%; object-fit: cover; }
.slot.filled { border-style: solid; border-color: var(--line); }
.slot.add { cursor: pointer; border-color: var(--primary-100); color: var(--primary-700); font-weight: 700; }
.slot.add:hover { background: var(--primary-50); }
.slot .cover { position: absolute; left: 6px; top: 6px; }
.slot .ops { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; padding: 6px; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.slot .ops button { border: 0; background: rgba(255,255,255,.92); border-radius: 6px; padding: 3px 7px; cursor: pointer; font-size: .75rem; font-weight: 700; }
.dropzone.drag { outline: 3px dashed var(--primary); outline-offset: 4px; border-radius: 12px; }

/* ---------- Modal y toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(12,22,40,.5); display: grid; place-items: center; z-index: 200; padding: 16px; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal.wide { max-width: 760px; }
.modal-h { padding: 18px 22px 0; display: flex; justify-content: space-between; align-items: center; }
.modal-h h3 { margin: 0; }
.modal-b { padding: 16px 22px; }
.modal-f { padding: 0 22px 20px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; width: calc(100% - 32px); max-width: 460px; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; animation: pop .2s ease-out; }
.toast.ok { background: var(--accent-600); } .toast.err { background: var(--danger); }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }
.loading { padding: 60px; text-align: center; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Auth ---------- */
.auth { max-width: 460px; margin: 40px auto; }
.auth .card { padding: 28px; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.demo-box { margin-top: 18px; font-size: .86rem; }
.demo-box button { margin: 4px 4px 0 0; }

footer.site { background: #0f1d33; color: #b9c4d6; padding: 36px 0; margin-top: 40px; font-size: .9rem; }
footer.site .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
footer.site a { color: #dfe7f3; display: block; margin-bottom: 6px; }
footer.site h4 { color: #fff; }

/* ---------- Responsivo ---------- */
@media (max-width: 1024px) {
  .cols { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .hero .wrap { grid-template-columns: 1fr; }
  .dash { grid-template-columns: 1fr; }
  .side { position: static; display: flex; overflow-x: auto; gap: 4px; padding: 6px; }
  .side .lbl { display: none; }
  .side a { white-space: nowrap; }
}
@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .topbar .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 10px; }
  .searchbar { order: 3; flex-basis: 100%; max-width: none; }
  .brand small { display: none; }
  .search-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .filters.collapsed { display: none; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.7rem; }
  .chat { grid-template-columns: 1fr; height: calc(100vh - 190px); }
  .chat.has-thread .conv-list { display: none; }
  .chat:not(.has-thread) .thread { display: none; }
  .photo-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kv { grid-template-columns: 1fr; gap: 0 0; } .kv dd { margin-bottom: 8px; }
  .hbar { grid-template-columns: 100px minmax(0, 1fr) 80px; }
  footer.site .wrap { grid-template-columns: 1fr; }
  .msg { max-width: 88%; }
  .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lcard .bd { padding: 10px; }
  .lcard .p { font-size: 1rem; }
}
@media (min-width: 761px) { .only-mobile { display: none !important; } }
.searchbar input:focus, .qty input:focus { box-shadow: none; border-color: transparent; }
.searchbar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
