/* =========================================================
   Impulsa PYME — estructura del panel (vendedor y comprador)
   Requiere assets/styles.css
   ========================================================= */
body { font-size: 14px; }
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

/* ---------- Barra lateral ---------- */
.sb { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: rgba(5, 7, 6, 0.78); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.sb-top { padding: 18px 16px 12px; display: grid; gap: 14px; }
.store-switch { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.02); text-align: left; width: 100%; }
.store-switch:hover { border-color: var(--line-2); }
.store-switch .avatar { width: 34px; height: 34px; border-radius: 10px; box-shadow: none; }
.store-switch b { font-weight: 500; font-size: 13.5px; display: block; line-height: 1.3; }
.store-switch span { font-size: 11.5px; color: var(--dim); }
.store-switch > svg { width: 16px; height: 16px; color: var(--dim); margin-left: auto; }
.sb-nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.sb-group { margin-top: 6px; }
.sb-group summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 10px 10px 6px; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .09em; color: var(--dim); }
.sb-group summary::-webkit-details-marker { display: none; }
.sb-group summary svg { width: 13px; height: 13px; transition: transform .2s; }
.sb-group[open] summary svg { transform: rotate(180deg); }
.sb-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: var(--muted); font-size: 13.5px; transition: background .15s, color .15s; position: relative; }
.sb-link svg { width: 17px; height: 17px; flex: none; }
.sb-link:hover { background: rgba(255,255,255,.04); color: var(--text); }
.sb-link[aria-current="page"] { background: rgba(var(--accent-rgb), .09); color: var(--accent); }
.sb-link[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.sb-link[aria-current="page"] svg { color: var(--accent); }
.sb-link .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 600; display: grid; place-items: center; background: var(--lime); color: var(--ink); }
.sb-link .count.soft { background: rgba(255,255,255,.08); color: var(--muted); }
.sb-link .ai { margin-left: auto; color: var(--accent); width: 14px; height: 14px; }
.sb-foot { padding: 14px 16px 18px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.ai-meter { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.02); display: grid; gap: 10px; }
.ai-meter .row-between { font-size: 12.5px; color: var(--muted); }
.ai-meter b { color: var(--text); font-weight: 500; }
.bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--jade), var(--accent)); }

/* ---------- Contenido ---------- */
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 clamp(16px, 3vw, 32px); border-bottom: 1px solid var(--line); background: rgba(2, 3, 2, 0.7); backdrop-filter: blur(16px); }
.cmdk { flex: 1; min-width: 0; max-width: 460px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--dim); font-size: 13.5px; text-align: left; }
.cmdk:hover { border-color: var(--line-2); color: var(--muted); }
.cmdk svg { width: 16px; height: 16px; flex: none; }
.cmdk span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk kbd { margin-left: auto; font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); }
.topbar .spacer { flex: 1; }
.sb-toggle { display: none; }

.page { padding: clamp(20px, 3vw, 32px); display: grid; gap: 20px; max-width: 1400px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); letter-spacing: -.035em; }
.page-head p { color: var(--muted); margin-top: 6px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.onboard { padding: 18px 20px; display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; }
.ring { width: 52px; height: 52px; }
.onboard-steps { display: flex; gap: 8px; flex-wrap: wrap; }
.onboard-steps span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.onboard-steps span.done { color: var(--dim); text-decoration: line-through; text-decoration-color: rgba(255,255,255,.2); }
.onboard-steps span.done svg { color: var(--accent); }
.onboard-steps span.next { border-color: var(--accent-line); color: var(--text); background: var(--accent-soft); }
.onboard-steps svg { width: 13px; height: 13px; }
@media (max-width: 760px) { .onboard { grid-template-columns: auto 1fr; } .onboard > .btn { grid-column: 1 / -1; } }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { padding: 18px 20px; display: grid; gap: 6px; }
.kpi .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.kpi .label svg { width: 16px; height: 16px; color: var(--accent); }
.kpi .value { font-size: 28px; font-weight: 600; letter-spacing: -.035em; line-height: 1.15; }
.kpi .sub { font-size: 12.5px; color: var(--dim); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 500; color: var(--ok); }
.delta svg { width: 13px; height: 13px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: 1fr 1fr; } }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 1180px) { .grid-2 { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .grid-3 { grid-template-columns: 1fr; } }
.box { padding: 20px; }
.box-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.box-head h2 { font-size: 15.5px; letter-spacing: -.015em; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.box-head h2 svg { width: 17px; height: 17px; color: var(--accent); }
.box-head a { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.box-head a:hover { color: var(--text); }
.box-head a svg { width: 13px; height: 13px; }

/* Gráfico de barras */
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.chart-head .big { font-size: 26px; font-weight: 600; letter-spacing: -.03em; }
.chart { position: relative; height: 230px; display: grid; grid-template-columns: 44px 1fr; }
.y-axis { position: relative; font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.y-axis span { position: absolute; right: 10px; transform: translateY(50%); }
.plot { position: relative; border-bottom: 1px solid var(--line-2); }
.gridline { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); }
.bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 3px; }
.bars button { flex: 1; height: 100%; display: flex; align-items: flex-end; padding: 0; position: relative; }
.bars button i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: rgba(var(--jade-rgb), .5); transition: background .15s, box-shadow .15s; }
.bars button.today i { background: var(--accent); box-shadow: 0 0 18px -2px rgba(var(--accent-rgb), .7); }
.bars button:hover i, .bars button:focus-visible i { background: #e4fbb0; box-shadow: 0 0 18px -2px rgba(var(--jade-rgb), .8); }
.x-axis { display: flex; justify-content: space-between; padding: 8px 0 0 44px; font-size: 11px; color: var(--dim); }
.tip { position: absolute; z-index: 5; pointer-events: none; padding: 8px 11px; border-radius: 10px; background: #101411; border: 1px solid var(--line-2); box-shadow: 0 12px 30px -10px rgba(0,0,0,.8); font-size: 12px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .12s; }
.tip b { display: block; font-size: 14px; font-weight: 600; }
.tip span { color: var(--muted); }
.tip.show { opacity: 1; }

/* Alertas */
.alerts { display: grid; gap: 8px; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.25); }
.alert > svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert b { font-weight: 500; display: block; font-size: 13.5px; }
.alert span { font-size: 12.5px; color: var(--muted); }
.alert .btn { margin-left: auto; flex: none; }
.alert.danger > svg { color: var(--danger); }
.alert.warn > svg { color: var(--warn); }
.alert.info > svg { color: var(--info); }

/* Tabla de pedidos */
.table-wrap { overflow-x: auto; margin: 0 -20px; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 680px; }
.tbl th { text-align: left; font-weight: 500; font-size: 11.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 13px 20px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; white-space: nowrap; }
.tbl tbody tr { cursor: pointer; transition: background .15s; }
.tbl tbody tr:hover { background: rgba(255,255,255,.025); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .mono { font-size: 12.5px; color: var(--muted); }
.tbl .cust { display: flex; align-items: center; gap: 10px; }
.tbl .cust .avatar { width: 28px; height: 28px; font-size: 10.5px; box-shadow: none; }
.tbl .cust b { font-weight: 500; display: block; line-height: 1.3; }
.tbl .cust span { font-size: 12px; color: var(--dim); }
.tbl .num { text-align: right; font-weight: 500; }
.filters-row { display: flex; gap: 6px; flex-wrap: wrap; }
.filters-row .chip { height: 30px; font-size: 12.5px; padding: 0 12px; }

/* Asistente */
.assistant { background: linear-gradient(180deg, rgba(var(--accent-rgb),.07), rgba(255,255,255,.01) 50%); border-color: var(--accent-line); }
.todo { display: grid; gap: 8px; }
.todo label { display: flex; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.25); cursor: pointer; align-items: flex-start; transition: opacity .2s; }
.todo label:has(input:checked) { opacity: .45; }
.todo label:has(input:checked) b { text-decoration: line-through; }
.todo input { appearance: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: none; margin: 1px 0 0; display: grid; place-items: center; }
.todo input:checked { background: var(--accent); border-color: var(--accent); }
.todo input:checked::after { content: ""; width: 8px; height: 4px; border: 2px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.todo b { font-weight: 500; display: block; font-size: 13.5px; }
.todo span { font-size: 12.5px; color: var(--muted); }
.todo .why { font-size: 11.5px; color: var(--accent); margin-top: 4px; display: block; }
.ask { display: flex; gap: 8px; margin-top: 14px; }
.ask .input { height: 42px; font-size: 13.5px; }

/* Códigos */
.codes { display: grid; gap: 8px; }
.code-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.25); }
.code-row .mono { font-size: 13px; letter-spacing: .04em; }
.code-row .meta { font-size: 11.5px; color: var(--dim); }
.code-row .switch { margin-left: auto; }
.code-row.off .mono { color: var(--dim); text-decoration: line-through; }

.top-products { display: grid; gap: 10px; }
.tp { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; }
.tp .p-thumb { border-radius: 10px; }
.tp b { font-weight: 500; font-size: 13.5px; display: block; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp .bar { margin-top: 6px; height: 4px; }
.tp .num { font-size: 13px; text-align: right; }
.tp .num span { display: block; font-size: 11px; color: var(--dim); }

.ads { display: grid; gap: 10px; }
.ads-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ads-kpis div { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.25); display: grid; gap: 1px; }
.ads-kpis span { font-size: 11px; color: var(--dim); }
.ads-kpis b { font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.ad-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.ad-row b { color: var(--text); font-weight: 500; }
.ad-row .tag { margin-left: auto; }

/* Detalle de pedido */
.od-body { display: grid; gap: 18px; padding: 18px 0; }
.timeline { display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 22px 1fr; gap: 12px; position: relative; padding-bottom: 16px; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 1px; background: var(--line-2); }
.tl-item.done:not(:last-child)::before { background: var(--accent-line); }
.tl-dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; background: var(--bg-2); }
.tl-item.done .tl-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tl-item.now .tl-dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-dot svg { width: 12px; height: 12px; stroke-width: 2.6; }
.tl-item b { font-weight: 500; display: block; }
.tl-item span { font-size: 12.5px; color: var(--muted); }
.od-lines { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.od-lines div { display: flex; justify-content: space-between; padding: 11px 14px; font-size: 13.5px; }
.od-lines div + div { border-top: 1px solid var(--line); }
.od-lines .total { background: rgba(255,255,255,.03); font-weight: 600; }
.voucher-box { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; border: 1px solid var(--line); }
.voucher-box.ok { border-color: var(--accent-line); background: var(--accent-soft); }
.voucher-doc { width: 44px; height: 56px; border-radius: 8px; background: linear-gradient(170deg, #e9ecef, #bfc6c1); position: relative; flex: none; }
.voucher-doc::before { content: ""; position: absolute; inset: 10px 8px auto; height: 3px; border-radius: 2px; background: #7d55c7; box-shadow: 0 8px 0 #9aa19c, 0 15px 0 #9aa19c, 0 22px 0 #b5bbb7; }
.print-opts { display: flex; gap: 8px; flex-wrap: wrap; }

/* Paleta de comandos */
.cmd { position: fixed; inset: 0; z-index: 95; display: none; place-items: start center; padding-top: 12vh; background: rgba(0,0,0,.5); backdrop-filter: blur(3px); }
.cmd.open { display: grid; }
.cmd-box { width: min(560px, calc(100% - 32px)); border-radius: 18px; background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: 0 40px 100px -20px rgba(0,0,0,.9); overflow: hidden; }
.cmd-box .input-icon .input { height: 54px; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); background: transparent; box-shadow: none; }
.cmd-list { max-height: 360px; overflow-y: auto; padding: 8px; }
.cmd-list a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); }
.cmd-list a:hover, .cmd-list a.sel { background: rgba(255,255,255,.05); color: var(--text); }
.cmd-list a svg { width: 17px; height: 17px; }
.cmd-list .grp { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; padding: 10px 12px 4px; }

.sb-scrim { display: none; }
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sb { position: fixed; z-index: 70; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .4s var(--ease); }
  .sb.open { transform: none; box-shadow: 30px 0 80px rgba(0,0,0,.7); }
  .sb-toggle { display: inline-grid; }
  .sb-scrim { position: fixed; inset: 0; z-index: 65; background: rgba(0,0,0,.5); display: none; }
  .sb.open + .sb-scrim { display: block; }
  .hide-sm { display: none !important; }
}

/* =========================================================
   Componentes de las secciones internas
   ========================================================= */
.crumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--dim); margin-bottom: 8px; }
.crumb svg { width: 12px; height: 12px; }
.crumb a:hover { color: var(--text); }

/* Barra de herramientas sobre listas */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .input-icon { flex: 1; min-width: 200px; }
.toolbar .input { height: 42px; }
.toolbar select.input { width: auto; }
.toolbar .chip { height: 34px; }

/* Pestañas subrayadas */
.tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabbar::-webkit-scrollbar { display: none; }
.tabbar button, .tabbar a { padding: 11px 14px; color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.tabbar button:hover, .tabbar a:hover { color: var(--text); }
.tabbar [aria-selected="true"], .tabbar [aria-current="page"] { color: var(--text); border-color: var(--accent); }
.tabbar .tag { font-size: 10.5px; padding: 0 6px; }

/* Tabla genérica: celdas */
.tbl .prod { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.tbl .prod .p-thumb { width: 44px; border-radius: 10px; flex: none; }
.tbl .prod b { font-weight: 500; display: block; line-height: 1.3; white-space: normal; }
.tbl .prod span { font-size: 12px; color: var(--dim); }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl td.c, .tbl th.c { text-align: center; }
.tbl .muted-row td { opacity: .55; }
.tbl tbody tr.static { cursor: default; }
.tbl input[type="checkbox"] { margin: 0; }
.row-actions { display: inline-flex; gap: 4px; }
.row-actions .icon-btn { width: 32px; height: 32px; border-radius: 10px; }
.row-actions .icon-btn svg { width: 15px; height: 15px; }

/* Listas de filas */
.list { display: grid; }
.li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li:first-child { padding-top: 0; }
.li .grow { flex: 1; min-width: 0; display: grid; gap: 2px; }
.li b { font-weight: 500; }
.li .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.li .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.04); border: 1px solid var(--line-2); color: var(--accent); flex: none; }
.li .ic svg { width: 18px; height: 18px; }

/* Mini estadísticas */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.25); display: grid; gap: 2px; }
.stat span { font-size: 12px; color: var(--dim); }
.stat b { font-size: 20px; font-weight: 600; letter-spacing: -.03em; }
.stat small { font-size: 11.5px; color: var(--muted); }

/* Formularios */
.form { display: grid; gap: 16px; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .form-2 { grid-template-columns: 1fr; } }
textarea.input { height: auto; min-height: 104px; padding: 12px 14px; resize: vertical; line-height: 1.55; }
.hint { font-size: 12px; color: var(--dim); }
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--dim); font-size: 14px; pointer-events: none; }
.input-prefix .input { padding-left: 38px; }

/* Ajustes: fila etiqueta / control */
.settings { display: grid; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); align-items: start; }
.set-row:first-child { padding-top: 4px; }
.set-row:last-child { border-bottom: 0; }
.set-row > div:first-child b { font-weight: 500; display: block; }
.set-row > div:first-child span { font-size: 13px; color: var(--muted); }
@media (max-width: 760px) { .set-row { grid-template-columns: 1fr; gap: 12px; } }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.toggle-row + .toggle-row { border-top: 1px solid var(--line); }
.toggle-row b { font-weight: 500; display: block; font-size: 14px; }
.toggle-row span { font-size: 12.5px; color: var(--muted); }

/* Zona para subir archivos */
.dropzone { border: 1.5px dashed var(--line-2); border-radius: 16px; padding: 26px 18px; display: grid; justify-items: center; gap: 8px; text-align: center; color: var(--muted); font-size: 13.5px; cursor: pointer; transition: border-color .2s, background .2s; position: relative; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent-line); background: var(--accent-soft); }
.dropzone > svg { width: 26px; height: 26px; color: var(--accent); }
.dropzone b { color: var(--text); font-weight: 500; }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Pasos horizontales */
.hsteps { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 8px; }
.hsteps div { display: grid; gap: 8px; font-size: 12.5px; color: var(--dim); }
.hsteps i { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); display: block; }
.hsteps .done { color: var(--text); }
.hsteps .done i { background: linear-gradient(90deg, var(--jade), var(--accent)); }
.hsteps .now { color: var(--text); }
.hsteps .now i { background: linear-gradient(90deg, var(--accent) 50%, rgba(255,255,255,.08) 50%); }

/* Mensajería */
.chat-app { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - 64px - 150px); min-height: 520px; padding: 0; overflow: hidden; }
.chat-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat-list .head { padding: 14px; border-bottom: 1px solid var(--line); }
.chat-list .head .input { height: 40px; }
.threads { overflow-y: auto; flex: 1; }
.thread { display: flex; gap: 12px; padding: 14px; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; width: 100%; align-items: flex-start; transition: background .15s; }
.thread:hover { background: rgba(255,255,255,.025); }
.thread[aria-selected="true"] { background: rgba(255,255,255,.05); box-shadow: inset 3px 0 0 var(--accent); }
.thread .grow { flex: 1; min-width: 0; display: grid; gap: 2px; }
.thread b { font-weight: 500; font-size: 14px; }
.thread p { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread .when { font-size: 11px; color: var(--dim); white-space: nowrap; }
.thread .unread { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: none; }
.conv { display: flex; flex-direction: column; min-height: 0; }
.conv-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.conv-head b { font-weight: 500; display: block; }
.conv-body { flex: 1; overflow-y: auto; padding: 20px 18px; display: grid; gap: 10px; align-content: start; }
.conv-foot { padding: 12px 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.conv-foot form { display: flex; gap: 8px; }
.quick { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.quick button { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; flex: none; }
.quick button svg { width: 14px; height: 14px; flex: none; }
.quick button:hover { color: var(--text); border-color: rgba(255,255,255,.22); }
.msg { max-width: 76%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; }
.msg.them { background: rgba(255,255,255,.06); border-bottom-left-radius: 6px; justify-self: start; }
.msg.me { justify-self: end; background: var(--lime); color: var(--ink); border-bottom-right-radius: 6px; }
.msg time { display: block; font-size: 10.5px; opacity: .6; margin-top: 3px; }
.msg-note { justify-self: center; font-size: 11.5px; color: var(--dim); display: flex; gap: 6px; align-items: center; text-align: center; max-width: 90%; }
.msg-note svg { width: 13px; height: 13px; flex: none; }
.msg-note.warn { color: var(--warn); }
.msg-card { justify-self: end; max-width: 76%; display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); font-size: 13px; }
.msg-card.them { justify-self: start; }
.msg-card .p-thumb { width: 44px; border-radius: 10px; flex: none; }
.conv-empty { margin: auto; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 10px; padding: 40px; }
.conv-empty svg { width: 36px; height: 36px; color: var(--dim); }
.back-btn { display: none !important; }
@media (max-width: 860px) {
  .chat-app { grid-template-columns: 1fr; height: calc(100vh - 64px - 130px); }
  .chat-app .conv { display: none; }
  .chat-app.reading .chat-list { display: none; }
  .chat-app.reading .conv { display: flex; }
  .back-btn { display: inline-grid !important; }
}

/* Tarjetas de contenido (novedades, foro, lecciones) */
.feed { display: grid; gap: 14px; }
.post { padding: 20px; display: grid; gap: 12px; }
.post-head { display: flex; gap: 12px; align-items: center; }
.post-head b { font-weight: 500; display: flex; align-items: center; gap: 6px; }
.post-head span { font-size: 12px; color: var(--dim); }
.post p { color: var(--muted); }
.post .media { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.post .media .p-thumb { aspect-ratio: 4/3; border-radius: 12px; }
.post .media .p-thumb .p-icon { width: 30%; height: 40%; }
.post-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.post-actions button, .post-actions a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); }
.post-actions button:hover, .post-actions a:hover { color: var(--text); border-color: var(--line-2); }
.post-actions button svg, .post-actions a svg { width: 14px; height: 14px; }
.post-actions button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.post-actions button[aria-pressed="true"] svg { fill: currentColor; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tile { padding: 20px; display: grid; gap: 12px; align-content: start; }
.b-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.05); border: 1px solid var(--line-2); color: var(--accent); flex: none; }
.b-ico svg { width: 19px; height: 19px; }
.tile h3 { font-size: 15.5px; }
.tile p { color: var(--muted); font-size: 13.5px; }

/* Pila clave / valor */
.kv { display: grid; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.kv div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 14px; font-size: 13.5px; }
.kv div + div { border-top: 1px solid var(--line); }
.kv span { color: var(--muted); }
.kv b { font-weight: 500; text-align: right; }

/* Bloque IA */
.ai-box { border-color: var(--accent-line); background: linear-gradient(180deg, rgba(var(--accent-rgb),.07), rgba(255,255,255,.01) 60%); }
.ai-out { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.3); display: grid; gap: 10px; font-size: 14px; color: var(--muted); }
.ai-out b { color: var(--text); font-weight: 500; }
.ai-out ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.thinking { display: inline-flex; gap: 4px; align-items: center; }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: think 1s infinite ease-in-out; }
.thinking i:nth-child(2) { animation-delay: .15s; }
.thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes think { 50% { opacity: .2; transform: translateY(-3px); } }

.inline-tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* Barras horizontales simples (una serie) */
.hbars { display: grid; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 70px; gap: 12px; align-items: center; font-size: 13px; color: var(--muted); }
.hbar .bar { height: 8px; }
.hbar .num { text-align: right; color: var(--text); }

/* Drawer genérico del panel */
.pd-body { display: grid; gap: 18px; padding: 18px 0; }
.drawer-panel.wide { width: min(560px, 100%); }

/* Encabezado de sección con ícono */
.sec-title { display: flex; align-items: center; gap: 14px; }
.sec-title .b-ico { width: 44px; height: 44px; border-radius: 14px; }
@media (max-width: 420px) { .topbar { gap: 8px; } }

/* Adjuntos y cotizaciones en el chat */
.conv-foot form { align-items: center; }
.attach:hover { color: var(--accent); border-color: var(--accent-line); }
.msg-media { margin: 0; max-width: min(320px, 76%); display: grid; gap: 4px; }
.msg-media.me { justify-self: end; }
.msg-media.them { justify-self: start; }
.msg-media button { padding: 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--line-2); }
.msg-media img { width: 100%; max-height: 320px; object-fit: cover; display: block; }
.msg-media video { width: 100%; max-height: 320px; border-radius: 16px; background: #000; border: 1px solid var(--line-2); }
.msg-media figcaption { font-size: 11.5px; color: var(--dim); }
.msg-media time, .msg-file time, .quote-card time { font-size: 10.5px; color: var(--dim); }
.msg-media.me time { text-align: right; }
.msg-file { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; max-width: min(360px, 80%); padding: 10px 12px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); }
.msg-file.me { justify-self: end; border-color: var(--accent-line); background: var(--accent-soft); }
.msg-file.them { justify-self: start; }
.msg-file b { font-weight: 500; font-size: 13.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-file span { font-size: 12px; color: var(--muted); }
.msg-file time { grid-column: 1 / -1; }
.quote-card { display: grid; gap: 10px; width: min(380px, 86%); padding: 14px; border-radius: 18px; border: 1px solid var(--accent-line); background: linear-gradient(180deg, rgba(var(--accent-rgb), .07), rgba(255,255,255,.015)); }
.quote-card.me { justify-self: end; }
.quote-card.them { justify-self: start; }
.qc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.qc-head b { font-weight: 500; }
.qc-lines { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.qc-lines div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; font-size: 13px; }
.qc-lines div + div { border-top: 1px solid var(--line); }
.qc-total { display: flex; justify-content: space-between; align-items: baseline; }
.qc-total b { font-size: 18px; color: var(--accent); }
.qc-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.qb-head, .qb-row { display: grid; grid-template-columns: minmax(0, 1fr) 84px 120px 38px; gap: 8px; align-items: center; }
.qb-row .input { height: 42px; }
@media (max-width: 520px) { .qb-head { display: none; } .qb-row { grid-template-columns: 1fr 1fr; } .qb-row select { grid-column: 1 / -1; } }

/* Tablas en tarjetas sin relleno inferior: no se recorta la última fila */
.box > .table-wrap { margin-bottom: 0; }   /* nunca se sale de la tarjeta (antes dependía del atributo style) */
.box > .table-wrap:last-of-type { padding-bottom: 6px; }
/* Producto vinculado en una novedad */
.post .media .post-prod { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); transition: border-color .2s; }
.post .media .post-prod:hover { border-color: var(--accent-line); }
.post .media .post-prod .p-thumb { width: 56px; aspect-ratio: 1; border-radius: 10px; overflow: hidden; }
.post .media .post-prod .p-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post .media .post-prod b { font-weight: 500; font-size: 13.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post .media .post-prod span { display: grid; min-width: 0; }
.post-head b a:hover { text-decoration: underline; }
.geo-slot { min-height: 0; }
.geo-empty { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; border: 1px dashed var(--line-2); color: var(--dim); font-size: 13px; }
.geo-empty svg { width: 18px; height: 18px; color: var(--accent); }
/* Interruptor Vendedor / Comprador */
.mode-sw { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin: 12px 0 10px; border-radius: 14px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); isolation: isolate; }
.mode-sw a { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px; border-radius: 10px; font-size: 12.5px; color: var(--muted); transition: color .25s; }
.mode-sw a[aria-current="page"] { color: #0a0a0a; font-weight: 600; }
.mode-sw i { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 10px; background: var(--accent); transition: transform .35s var(--ease); }
.mode-sw a:nth-child(2)[aria-current="page"] ~ i { transform: translateX(100%); }
.topbar .back-btn { margin-right: -4px; }
/* Tablas dentro de tarjetas: nunca se cortan abajo */
.box > .table-wrap:last-child { margin-bottom: 0; padding-bottom: 8px; }
.tbl tr.static td .empty { border: 0; background: transparent; }
/* Plan vencido: pausa del panel (solo quedan Mi plan y Mis datos) */
body.plan-locked .main > .page { filter: blur(3px); pointer-events: none; user-select: none; }
.plan-lock { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .55); }
.pl-card { width: min(460px, 100%); display: grid; justify-items: center; gap: 10px; text-align: center; padding: 30px 26px; border-radius: 24px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); animation: ieUp .35s var(--ease) both; }
.pl-card h2 { font-size: 21px; letter-spacing: -.02em; }
.pl-card p { margin: 0; color: var(--muted); }
.pl-ic { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: rgba(242, 113, 107, .12); color: var(--danger, #f2716b); }
.pl-ic svg { width: 26px; height: 26px; }
.pl-acts { display: grid; gap: 8px; width: 100%; margin-top: 8px; }
.plan-warn { margin-bottom: 18px; align-items: center; }
.plan-warn .btn { margin-left: auto; flex: none; }
.seg-ai { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); justify-self: start; }
.seg-ai button { padding: 7px 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; transition: background .2s, color .2s; }
.seg-ai button[aria-pressed="true"] { background: var(--accent); color: #0a0a0a; font-weight: 600; }
.goal { display: grid; gap: 6px; margin-top: 6px; max-width: 420px; } .goal b { font-weight: 500; }
/* Celular: nada se sale de su tarjeta */
.box-head { flex-wrap: wrap; row-gap: 4px; }
.stat > span, .stat > small, .kpi .label, .kpi .sub { overflow-wrap: anywhere; min-width: 0; }
.li { min-width: 0; } .li .grow { min-width: 0; overflow-wrap: anywhere; }
.seg-ai { display: flex; flex-wrap: wrap; max-width: 100%; }
@media (max-width: 520px) { .seg-ai button { flex: 1 1 auto; } }
/* Celular: las cuadrículas de 2 o 3 columnas pasan a una sola (aunque la página les haya fijado columnas) */
@media (max-width: 760px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr) !important; }
  .form .field, .form-2 > * { min-width: 0; }
}
/* Detalle del pedido: secciones que se abren y cierran, datos en mosaico */
.od-sec { border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .015); overflow: hidden; }
.od-sec > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; font-weight: 500; font-size: 14px; }
.od-sec > summary::-webkit-details-marker { display: none; }
.od-sec > summary > svg { width: 17px; height: 17px; color: var(--accent); }
.od-chev { margin-left: auto; display: grid; transition: transform .25s var(--ease); color: var(--dim); }
.od-chev svg { width: 16px; height: 16px; }
.od-sec[open] .od-chev { transform: rotate(180deg); }
.od-sec > :not(summary) { margin: 0 14px 14px; }
.od-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; animation: pmIn .3s var(--ease) both; }
.od-tiles > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); min-width: 0; }
.od-tiles span { font-size: 11.5px; color: var(--dim); }
.od-tiles b { font-weight: 500; font-size: 13.5px; overflow-wrap: anywhere; }
.od-print { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.od-pbtn { display: grid; justify-items: start; gap: 2px; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .25); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color .2s, transform .2s; }
.od-pbtn:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.od-pbtn svg { width: 18px; height: 18px; color: var(--accent); margin-bottom: 4px; }
.od-pbtn b { font-weight: 500; font-size: 13.5px; }
.od-pbtn span { font-size: 11.5px; color: var(--dim); }
@media (max-width: 420px) { .od-tiles, .od-print { grid-template-columns: 1fr; } }
/* Datos dentro de los paneles laterales (pedido del comprador, envíos…): mosaico ordenado en vez de lista larga */
.drawer-body .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border: 0; border-radius: 0; overflow: visible; }
.drawer-body .kv > div { display: grid; gap: 2px; align-content: start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line) !important; background: rgba(0, 0, 0, .25); }
.drawer-body .kv > div + div { border-top: 1px solid var(--line); }
.drawer-body .kv span { font-size: 11.5px; color: var(--dim); }
.drawer-body .kv b { text-align: left; overflow-wrap: anywhere; }
@media (max-width: 420px) { .drawer-body .kv { grid-template-columns: 1fr; } }
/* "?" que explica cada término en palabras simples */
.qtip { position: relative; display: inline-grid; place-items: center; width: 17px; height: 17px; margin-left: 4px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); color: var(--muted); font: 600 10.5px/1 var(--font, system-ui); cursor: help; vertical-align: middle; text-transform: none; letter-spacing: 0; }
.qtip:hover, .qtip:focus-visible, .qtip.show { border-color: var(--accent); color: var(--accent); }
.tip-pop { position: fixed; z-index: 4000; max-width: 260px; padding: 10px 12px; border-radius: 12px; background: #151a17; border: 1px solid var(--line-2); color: var(--text); font-size: 12.5px; line-height: 1.45; box-shadow: 0 14px 34px rgba(0,0,0,.6); pointer-events: none; animation: pmIn .18s ease both; }
/* Hashtags y mejor hora (Crear contenido) */
.grow-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; }
.htags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.htag { padding: 6px 11px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; transition: all .2s; }
.htag i { font-style: normal; font-size: 11px; color: #f2716b; }
.htag:hover { color: var(--text); border-color: var(--accent-line); }
.htag.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.best { display: grid; gap: 8px; margin-top: 8px; }
.best-t { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); }
.best-t b { font-size: 18px; font-weight: 600; color: var(--accent); text-transform: capitalize; }
.best-t span { font-size: 12.5px; color: var(--muted); }
@media (max-width: 760px) { .grow-grid { grid-template-columns: 1fr; } }
/* Conexiones: redes y canales */
.ch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ch { display: flex; gap: 12px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); transition: border-color .2s; }
.ch.on { border-color: var(--accent-line); }
.ch .grow { display: grid; gap: 6px; min-width: 0; flex: 1; }
.ch b { font-weight: 500; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ch .input { height: 40px; font-size: 13.5px; }
.ch-ic { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.ch-ic svg { width: 18px; height: 18px; }
.ch-more { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ch-more a { display: grid; gap: 3px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); transition: border-color .2s, transform .2s; }
.ch-more a:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.ch-more svg { width: 18px; height: 18px; color: var(--accent); margin-bottom: 4px; }
.ch-more b { font-weight: 500; font-size: 13.5px; }
.ch-more span { font-size: 12px; color: var(--dim); }
.feed-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.feed-steps > div { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); }
.feed-steps ol { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
@media (max-width: 860px) { .ch-grid, .feed-steps { grid-template-columns: 1fr; } .ch-more { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Costos: tendencia, recomendaciones y simulador */
.cg-row { margin-top: 0; align-items: stretch !important; }
.cg-row > .card { height: 100%; }
.cg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin: 0 4px 0 10px; vertical-align: middle; }
.cg-dot.s { background: rgba(255, 255, 255, .25); } .cg-dot.g { background: var(--accent); }
.cg-chart { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: end; height: 190px; padding: 8px 4px 0; }
.cg-col { display: grid; grid-template-rows: 1fr auto auto; gap: 4px; height: 100%; text-align: center; }
.cg-bars { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 4px; }
.cg-bars i { width: 34%; max-width: 22px; border-radius: 6px 6px 2px 2px; animation: cgUp .9s var(--ease) both; }
.cg-bars i.s { background: rgba(255, 255, 255, .16); }
.cg-bars i.g { background: linear-gradient(180deg, var(--accent), #6fae3c); }
.cg-col.now .cg-bars i.s { background: rgba(255, 255, 255, .28); }
@keyframes cgUp { from { height: 0 !important; } }
.cg-col span { font-size: 11.5px; color: var(--dim); }
.cg-col b { font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-col.now span { color: var(--accent); }
.cg-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.cg-facts > div { display: grid; gap: 2px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .22); min-width: 0; }
.cg-facts span { font-size: 12px; color: var(--dim); }
.cg-facts b { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.cg-facts small { font-size: 11.5px; color: var(--muted); }
.cg-recs { display: grid; gap: 8px; }
.cg-recs > div { display: flex; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .22); animation: pmIn .4s var(--ease) both; }
.cg-recs span { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.cg-recs span svg { width: 16px; height: 16px; }
.cg-recs p { margin: 0; display: grid; gap: 2px; }
.cg-recs b { font-weight: 500; font-size: 13.5px; }
.cg-recs small { font-size: 12.5px; color: var(--muted); }
.sim { display: grid; gap: 14px; }
.sim-out { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 620px) { .cg-facts, .sim-out { grid-template-columns: 1fr; } .cg-chart { height: 160px; } }
/* Formas de cobro: Mercado Pago */
.mp-box { display: grid; gap: 16px; margin-bottom: 16px; border-color: rgba(0, 158, 227, .35); background: linear-gradient(135deg, rgba(0, 158, 227, .08), rgba(255, 255, 255, .01) 55%); }
.mp-head { display: flex; gap: 14px; align-items: flex-start; }
.mp-head h2 { font-size: 16px; font-weight: 600; }
.mp-head .grow { flex: 1; min-width: 0; display: grid; gap: 4px; }
.mp-logo { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; background: #009ee3; color: #fff; }
.mp-logo svg { width: 22px; height: 22px; }
.mp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mp-grid > div { display: grid; gap: 3px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); }
.mp-grid span { font-size: 12px; color: var(--dim); }
.mp-grid b { font-weight: 500; font-size: 13.5px; }
.mp-grid small { font-size: 12px; color: var(--muted); }
@media (max-width: 760px) { .mp-grid { grid-template-columns: 1fr; } }
.com-edit summary { cursor: pointer; list-style: none; margin-top: 6px; } .com-edit summary::-webkit-details-marker { display: none; } .com-edit summary .sub b { color: var(--accent); font-weight: 500; }

/* ---------- Compra de nuevo (panel del comprador) ---------- */
.again { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.again-card { display: grid; gap: 12px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, .015); transition: border-color .2s; }
.again-card:hover { border-color: var(--accent-line); }
.again-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.again-top b { display: block; font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.again-card .thumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.again-card .thumbs .p-thumb { width: 40px; border-radius: 10px; }
.again-card .thumbs .p-thumb img { width: 100%; height: 100%; object-fit: cover; }
.again-card .thumbs .p-icon { width: 55%; height: 55%; filter: none; }

/* ---------- Avisos en el celular ---------- */
.push-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 18px; border-color: var(--accent-line); background: radial-gradient(80% 140% at 0% 0%, rgba(var(--accent-rgb), .1), transparent 60%), var(--card, rgba(255,255,255,.02)); }
.push-card b { display: block; font-weight: 500; }
.push-card span { font-size: 13px; color: var(--muted); }
.push-ico { width: 42px; height: 42px; flex: none; border-radius: 13px; display: grid; place-items: center; color: var(--accent); background: rgba(var(--accent-rgb), .1); border: 1px solid var(--accent-line); }
.push-ico svg { width: 20px; height: 20px; }
@media (max-width: 560px) { .push-card { flex-wrap: wrap; } .push-card .btn { flex: 1; } }

/* ---------- Despacho por agencia ---------- */
.dispatch { display: grid; gap: 12px; padding: 16px; border-radius: 16px; border: 1px solid var(--accent-line); background: linear-gradient(160deg, rgba(var(--accent-rgb), .06), transparent 70%); }
.dispatch h4 { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.dispatch h4 svg { width: 16px; height: 16px; color: var(--accent); }
.dispatch .ag-photo { padding: 14px; }

/* =========================================================
   Pulido general del panel: más aire, jerarquía clara y cajas con presencia
   ========================================================= */
.page { gap: 24px; max-width: 1320px; }
.page-head { padding-bottom: 4px; }
.page-head p { max-width: 720px; line-height: 1.55; }
.box { padding: 22px; border-radius: 22px; }
.box-head { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.box-head h2 { gap: 11px; font-size: 15px; }
.box-head h2 svg { width: 32px; height: 32px; padding: 7.5px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--accent-line); box-sizing: border-box; flex: none; }
.box > .box-head + .table-wrap { margin-top: -18px; }
.kpis { gap: 16px; }
.kpi { padding: 20px 22px; gap: 10px; border-radius: 22px; }
.kpi .label svg { width: 28px; height: 28px; padding: 6px; border-radius: 9px; background: var(--accent-soft); border: 1px solid var(--accent-line); box-sizing: border-box; }
.kpi .value { font-size: 30px; }
.tbl th { background: rgba(255, 255, 255, .018); padding-top: 12px; padding-bottom: 12px; }
.tbl td { padding-top: 15px; padding-bottom: 15px; }
.tbl tbody tr:hover { background: rgba(var(--accent-rgb), .035); }
/* Primeros pasos: solo lo que falta (lo hecho lo cuenta el círculo) */
.onboard-steps span.done { display: none; }
.onboard { border-color: var(--accent-line); background: radial-gradient(90% 140% at 0% 0%, rgba(var(--accent-rgb), .08), transparent 60%), linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01)); }
/* Lo urgente: filas más limpias */
.alerts { gap: 10px; }
.alerts .alert { padding: 13px 14px; border-radius: 16px; background: rgba(255, 255, 255, .02); align-items: center; }
.alerts .alert > svg { width: 34px; height: 34px; padding: 8px; border-radius: 11px; background: rgba(255, 255, 255, .05); box-sizing: border-box; margin-top: 0; }
.alerts .alert.danger > svg { background: rgba(242, 113, 107, .12); }
.alerts .alert.warn > svg { background: rgba(242, 201, 76, .12); }
.alerts .alert.info > svg { background: var(--accent-soft); }
.alerts .alert b { font-size: 13.5px; }
.alerts .alert span { display: block; margin-top: 2px; }
/* Pestañas de sección: más aire y una línea clara */
.subnav, .tabbar { gap: 6px; }
/* Formularios dentro de cajas */
.box .form-2 { gap: 14px; }
.field label { font-size: 13px; }
@media (max-width: 620px) { .page { gap: 18px; } .box { padding: 18px; border-radius: 20px; } .box > .table-wrap { margin-left: -18px; margin-right: -18px; } }
.tbl th, .tbl td { padding-left: 14px; padding-right: 14px; }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 20px; }
.tbl .cust b, .tbl .cust span { white-space: normal; }

/* =========================================================
   Movimiento del panel: entradas suaves y claras (cortas, y se apagan si el
   celular pide "reducir movimiento")
   ========================================================= */
@media (prefers-reduced-motion: no-preference) {
  .page > * { animation: pgIn .45s var(--ease) both; }
  .page > *:nth-child(2) { animation-delay: .04s; } .page > *:nth-child(3) { animation-delay: .08s; } .page > *:nth-child(4) { animation-delay: .12s; }
  .page > *:nth-child(5) { animation-delay: .16s; } .page > *:nth-child(6) { animation-delay: .2s; } .page > *:nth-child(n+7) { animation-delay: .24s; }
  .kpis > *, .stats > * { animation: pgIn .5s var(--ease) both; }
  .kpis > *:nth-child(2), .stats > *:nth-child(2) { animation-delay: .06s; } .kpis > *:nth-child(3), .stats > *:nth-child(3) { animation-delay: .12s; } .kpis > *:nth-child(4), .stats > *:nth-child(4) { animation-delay: .18s; } .stats > *:nth-child(n+5) { animation-delay: .22s; }
  .tbl tbody tr:nth-child(-n+14) { animation: rowIn .4s var(--ease) both; }
  .tbl tbody tr:nth-child(2) { animation-delay: .03s; } .tbl tbody tr:nth-child(3) { animation-delay: .06s; } .tbl tbody tr:nth-child(4) { animation-delay: .09s; } .tbl tbody tr:nth-child(5) { animation-delay: .12s; }
  .tbl tbody tr:nth-child(6) { animation-delay: .15s; } .tbl tbody tr:nth-child(n+7) { animation-delay: .18s; }
  #pDrawer.open .pd-body > * { animation: pgIn .4s var(--ease) both; }
  #pDrawer.open .pd-body > *:nth-child(2) { animation-delay: .05s; } #pDrawer.open .pd-body > *:nth-child(3) { animation-delay: .1s; } #pDrawer.open .pd-body > *:nth-child(n+4) { animation-delay: .14s; }
  .bar > i { animation: barIn 1s var(--ease) both; }
  .empty > svg, .empty > .ico { animation: floaty 3.6s ease-in-out infinite; }
  .btn { transition: transform .15s var(--ease), background .2s, border-color .2s, color .2s, box-shadow .25s; }
  .btn:active { transform: scale(.97); }
  .status.s-nuevo::before, .status.s-nuevo > span::before { animation: dotPulse 1.8s ease-in-out infinite; }
  .howto .hs { animation: pgIn .45s var(--ease) both; }
  .howto .hs:nth-child(2) { animation-delay: .08s; } .howto .hs:nth-child(3) { animation-delay: .16s; } .howto .hs:nth-child(4) { animation-delay: .24s; }
}
@keyframes pgIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes rowIn { from { opacity: 0; transform: translateX(-6px); } }
@keyframes barIn { from { width: 0; } }
@keyframes floaty { 50% { transform: translateY(-5px); } }
@keyframes dotPulse { 50% { opacity: .35; } }

/* Cómo funciona: pasos cortos al inicio de las secciones principales */
.howto { position: relative; display: grid; gap: 12px; padding: 16px 18px; border-radius: 20px; border: 1px solid var(--accent-line); background: radial-gradient(80% 140% at 0% 0%, rgba(var(--accent-rgb), .08), transparent 60%), rgba(255,255,255,.015); }
.howto-head { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.howto-head b { font-weight: 500; }
.howto-head svg { width: 18px; height: 18px; color: var(--accent); }
.howto-head .icon-btn { margin-left: auto; width: 32px; height: 32px; }
.howto-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.howto .hs { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; background: rgba(0,0,0,.25); border: 1px solid var(--line); }
.howto .hs i { font-style: normal; width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #0a0a0a; font-family: var(--mono); font-size: 12px; font-weight: 600; }
.howto .hs b { display: block; font-weight: 500; font-size: 13.5px; }
.howto .hs span { font-size: 12.5px; color: var(--muted); }
.howto-open { justify-self: start; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--dim); }
.howto-open:hover { color: var(--accent); }
.howto-open svg { width: 14px; height: 14px; }

/* =========================================================
   Estilo minimalista del panel: menos bordes, menos brillo y más aire.
   (Va al final: manda sobre lo anterior)
   ========================================================= */
.page { gap: 28px; }
.app .card { border-color: rgba(255, 255, 255, .06); box-shadow: none; background: rgba(255, 255, 255, .022); }
.app .card.card-glow::before { display: none; }
.app .card:hover { box-shadow: none; }
.box { padding: 24px; }
.box-head { border-bottom: 0; padding-bottom: 0; margin-bottom: 18px; }
.box-head h2 { font-size: 15px; gap: 9px; }
.box-head h2 svg { width: 17px; height: 17px; padding: 0; border: 0; background: none; border-radius: 0; }
.box > .box-head + .table-wrap { margin-top: 0; }
.kpi { padding: 20px 22px; gap: 8px; }
.kpi .label { font-size: 12.5px; color: var(--dim); }
.kpi .label svg { width: 15px; height: 15px; padding: 0; border: 0; background: none; }
.kpi .value { font-size: 30px; font-weight: 600; }
.app .btn-primary { box-shadow: none; }
.app .btn-primary:hover { box-shadow: 0 8px 24px -10px rgba(var(--accent-rgb), .6); }
.tbl th { background: none; color: var(--dim); }
.tbl td { border-bottom-color: rgba(255, 255, 255, .05); }
/* Primeros pasos: una franja sobria */
.onboard { background: rgba(255, 255, 255, .022); border-color: rgba(255, 255, 255, .06); padding: 16px 20px; }
/* Lo urgente: lista limpia con separadores, sin cajas dentro de cajas */
.alerts { gap: 0; }
.alerts .alert { border: 0; border-radius: 0; background: none; padding: 14px 0; }
.alerts .alert + .alert { border-top: 1px solid rgba(255, 255, 255, .06); }
.alerts .alert > svg { width: 32px; height: 32px; padding: 7px; border-radius: 10px; }
/* Cómo funciona: una sola línea con los pasos (la explicación aparece al pasar el mouse o tocar) */
.howto { display: flex; align-items: center; gap: 16px; padding: 12px 14px 12px 18px; border-color: rgba(255, 255, 255, .06); background: rgba(255, 255, 255, .02); }
.howto-t { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.howto-t svg { width: 16px; height: 16px; color: var(--accent); }
.howto-steps { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.howto .hs { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; cursor: help; }
.howto .hs i { width: 20px; height: 20px; font-size: 10.5px; }
.howto .hs b { font-size: 13px; font-weight: 400; color: var(--muted); }
.howto .hs + .hs::before { content: ""; width: 14px; height: 1px; background: var(--line-2); margin-right: 8px; }
.howto #howtoX { width: 30px; height: 30px; flex: none; }
@media (max-width: 720px) { .howto { align-items: flex-start; } .howto-t { display: none; } .howto .hs + .hs::before { display: none; } }
/* Menú "Más" para acciones secundarias */
.more-menu { position: relative; }
.more-menu > summary { list-style: none; cursor: pointer; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 210px; display: grid; gap: 2px; padding: 6px; border-radius: 14px; border: 1px solid var(--line-2); background: #0d120f; box-shadow: 0 20px 50px -15px rgba(0, 0, 0, .7); animation: pgIn .2s var(--ease) both; }
.more-menu .menu .btn { justify-content: flex-start; border: 0; background: none; width: 100%; --h: 40px; }
.more-menu .menu .btn:hover { background: rgba(255, 255, 255, .05); }
/* Tablas: las acciones de cada fila aparecen al pasar el mouse (en celular siempre se ven) */
@media (hover: hover) and (min-width: 900px) {
  .tbl .row-actions { opacity: .25; transition: opacity .2s; }
  .tbl tbody tr:hover .row-actions, .tbl tbody tr:focus-within .row-actions { opacity: 1; }
}
.tbl .row-actions .icon-btn { width: 32px; height: 32px; border-color: transparent; background: rgba(255, 255, 255, .04); }
.vis-cell .vis-txt { font-size: 12px; }

/* Caja de hoy (inicio del vendedor) */
.cash { display: grid; gap: 18px; }
.cash-top { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid rgba(255,255,255,.06); border-radius: 18px; overflow: hidden; }
.cash-top div { padding: 16px 18px; display: grid; gap: 4px; }
.cash-top div + div { border-left: 1px solid rgba(255,255,255,.06); }
.cash-top span { font-size: 12px; color: var(--dim); }
.cash-top b { font-size: 24px; font-weight: 600; letter-spacing: -.03em; }
.cash-top small { font-size: 12px; color: var(--muted); }
.cash-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 22px; }
.cash-list { display: grid; }
.cash-list > a { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 11px 4px; border-top: 1px solid rgba(255,255,255,.05); font-size: 13.5px; }
.cash-list > a:first-child { border-top: 0; }
.cash-list > a:hover { background: rgba(255,255,255,.02); }
.cash-list .t { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.cash-list b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cash-pay { display: grid; gap: 10px; }
.cash-pay div { display: grid; gap: 5px; font-size: 13px; }
.cash-pay .row-between span { color: var(--muted); }
.cash-pay .bar { height: 6px; }
.cash-per { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cash-per div { padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.02); display: grid; gap: 2px; }
.cash-per span { font-size: 11.5px; color: var(--dim); }
.cash-per b { font-size: 16px; font-weight: 600; }
.cash-per small { font-size: 11.5px; color: var(--muted); }
@media (max-width: 900px) { .cash-grid { grid-template-columns: 1fr; } .cash-top, .cash-per { grid-template-columns: 1fr 1fr; } .cash-top div:nth-child(3) { border-left: 0; } .cash-top div:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.06); } }

.cash-empty { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 150px; padding: 18px; border-radius: 16px; border: 1px dashed rgba(255,255,255,.08); text-align: center; }
.cash-empty > svg { width: 22px; height: 22px; color: var(--accent); margin-bottom: 2px; }
.cash-empty b { font-weight: 500; font-size: 14px; }
.cash-empty span { font-size: 12.5px; color: var(--muted); max-width: 300px; }
.cash-empty .btn { margin-top: 6px; }
/* Tarjetas de "Configurar tienda": la etiqueta nunca se sale */
.tile .row-between { gap: 10px; align-items: flex-start; min-width: 0; }
.tile .row-between .tag { min-width: 0; max-width: calc(100% - 50px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; }

/* Ventanas laterales: el contenido nunca se sale de la pantalla */
.drawer-body { overflow-x: hidden; }
.pd-body, .pd-body > *, .pd-body .stack > *, .pd-body .row > * { min-width: 0; }
.pd-body .row.wrap, .pd-body .row { flex-wrap: wrap; }
.gen-link { min-width: 0; max-width: 100%; }
.gen-link .btn { flex: none; }
.pd-body .toggle-row { gap: 14px; }
.pd-body .toggle-row > div { min-width: 0; }
.pd-body .toggle-row .switch { flex: none; }

/* Enlace para copiar (catálogos, Facebook y Google…): el texto nunca se monta sobre los botones */
.gen-link { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 14px; border: 1px solid var(--accent-line); background: var(--accent-soft); min-width: 0; max-width: 100%; }
.gen-link .mono { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-link .btn { flex: none; }
@media (max-width: 560px) { .gen-link { flex-wrap: wrap; } .gen-link .mono { flex-basis: 100%; } }

/* Entradas del panel más cortas (se sienten más rápidas) */
@media (prefers-reduced-motion: no-preference) {
  .page > * { animation-duration: .28s; }
  .page > *:nth-child(2) { animation-delay: .02s; } .page > *:nth-child(3) { animation-delay: .04s; } .page > *:nth-child(4) { animation-delay: .06s; }
  .page > *:nth-child(5) { animation-delay: .08s; } .page > *:nth-child(6) { animation-delay: .1s; } .page > *:nth-child(n+7) { animation-delay: .12s; }
  .kpis > *, .stats > * { animation-duration: .3s; }
  .tbl tbody tr:nth-child(-n+14) { animation-duration: .25s; }
  .tbl tbody tr:nth-child(n+7) { animation-delay: .08s; }
}
