/* CTIGROUP · Ecommerce Hub — identidad CTI: Navy #0B1B4B, Lima #C4E000, Poppins. Mobile-first. */
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("/fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("/fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("/fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("/fonts/poppins-700.woff2") format("woff2"); }

:root {
  --navy: #0b1b4b;
  --navy-2: #13286b;
  --navy-soft: #e8ecf6;
  --lima: #c4e000;
  --lima-soft: #f3f9cc;
  --ink: #0f1830;
  --muted: #5b6480;
  --line: #dfe3ee;
  --bg: #f5f7fb;
  --white: #fff;
  --ok: #1b8a5a;
  --warn: #b26b00;
  --bad: #c0322b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 27, 75, 0.06), 0 6px 20px rgba(11, 27, 75, 0.06);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--navy-2); }
button, input, select, textarea { font: inherit; }
.app { min-height: 100vh; display: flex; flex-direction: column; }

/* Marca */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; }
.brand-plate { display: inline-flex; align-items: center; background: var(--white); border-radius: 10px; padding: 5px 9px; flex: none; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.brand-logo { display: block; height: 26px; width: auto; }
.brand-auth .brand-plate { padding: 8px 12px; border-radius: 12px; }
.brand-auth .brand-logo { height: 38px; }
.brand-bar .brand-product { font-size: 12.5px; white-space: nowrap; padding-left: 8px; }
.brand-bar { gap: 8px; }
.brand-bar .brand-logo { height: 22px; }
.brand-product { font-weight: 500; font-size: 15px; line-height: 1.1; color: var(--white); border-left: 1px solid rgba(255, 255, 255, 0.28); padding-left: 10px; }

/* Pantallas públicas (entrar / invitación) */
.auth { flex: 1; display: flex; flex-direction: column; background: var(--navy); color: var(--white); }
.auth-top { padding: 28px 22px 8px; }
.auth-hero { padding: 18px 22px 26px; }
.auth-hero h1 { font-size: 26px; line-height: 1.2; margin: 0 0 8px; font-weight: 600; }
.auth-hero h1 span { color: var(--lima); }
.auth-hero p { margin: 0; color: #c9d1ea; font-size: 14px; }
.auth-card { background: var(--white); color: var(--ink); border-radius: 22px 22px 0 0; padding: 26px 22px 34px; flex: 1; }
.auth-card h2 { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.auth-card .sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.auth-foot { margin-top: 22px; font-size: 12.5px; color: var(--muted); text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { font-size: 12px; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); color: #e6ebf8; }
.chip b { color: var(--lima); font-weight: 600; }

/* Formularios */
label { display: block; font-size: 13px; font-weight: 500; margin: 14px 0 6px; color: var(--ink); }
input, select, textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(19, 40, 107, 0.12); }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:active { background: var(--navy-2); }
.btn-lima { background: var(--lima); color: var(--navy); }
.btn-ghost { background: var(--navy-soft); color: var(--navy); }
.btn-danger { background: #fdecea; color: var(--bad); }
.btn-block { width: 100%; margin-top: 20px; padding: 14px; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.error { background: #fdecea; color: var(--bad); padding: 10px 12px; border-radius: 10px; font-size: 13.5px; margin-top: 14px; }
.success { background: #e7f6ee; color: var(--ok); padding: 10px 12px; border-radius: 10px; font-size: 13.5px; margin-top: 14px; word-break: break-all; }

/* App con sesión */
.main { flex: 1; padding: 16px 16px 96px; width: 100%; max-width: 980px; margin: 0 auto; }
.page-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 6px 0 14px; }
.page-title h1 { font-size: 21px; margin: 0; font-weight: 600; }
.page-title .meta { font-size: 12.5px; color: var(--muted); }

.banner { display: flex; gap: 12px; align-items: flex-start; background: var(--lima-soft); border: 1px solid #e2ef99; color: #3d4700; border-radius: var(--radius); padding: 12px 14px; font-size: 13.5px; margin-bottom: 14px; }
.banner .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--lima); margin-top: 5px; flex: none; box-shadow: 0 0 0 3px rgba(196, 224, 0, 0.3); }
.banner b { color: var(--navy); }

.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 16px; margin: 0 0 10px; font-weight: 600; }
.card h2 small { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.kpi .n { font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.kpi .l { font-size: 12.5px; color: var(--muted); }
.kpi.alert .n { color: var(--bad); }
.kpi.hero { grid-column: span 2; background: var(--navy); color: var(--white); display: flex; justify-content: space-between; align-items: center; }
.kpi.hero .n { color: var(--lima); }
.kpi.hero .l { color: #c9d1ea; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .t { font-weight: 500; }
.list .s { font-size: 12.5px; color: var(--muted); }
.list .grow { flex: 1; min-width: 0; }
.list .grow .t, .list .grow .s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--navy-soft); color: var(--navy); display: grid; place-items: center; font-weight: 600; flex: none; }
.ch-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.ch-ml { background: #fff3b0; color: #2d3277; }
.ch-walmart { background: #e3efff; color: #0a53be; }
.ch-coppel { background: #fff0cc; color: #9a6a00; }
.ch-bind { background: var(--navy-soft); color: var(--navy); }

.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--navy-soft); color: var(--navy); white-space: nowrap; }
.badge.lima { background: var(--lima); color: var(--navy); }
.badge.ok { background: #e7f6ee; color: var(--ok); }
.badge.warn { background: #fff4e0; color: var(--warn); }
.badge.bad { background: #fdecea; color: var(--bad); }
.badge.owner { background: var(--navy); color: var(--lima); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; }
.search { margin-bottom: 12px; }
.empty { text-align: center; color: var(--muted); padding: 22px 8px; font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt { margin-top: 12px; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.neg { color: var(--bad); }
.hidden { display: none !important; }


@media (min-width: 760px) {
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .kpi.hero { grid-column: span 2; }
  .auth { flex-direction: row; }
  .auth-side { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 40px; }
  .auth-card { border-radius: 0; max-width: 480px; display: flex; flex-direction: column; justify-content: center; padding: 48px; }
}
.roleSel { width: auto; flex: none; max-width: 46%; padding: 7px 28px 7px 10px; font-size: 13px; border-radius: 10px; }
.capture .main { padding-bottom: 16px; }

/* Integraciones */
.back { display: inline-block; margin: 2px 0 6px; font-size: 13px; font-weight: 500; text-decoration: none; color: var(--navy-2); }
.lead { margin: -6px 0 14px; }
.list.integ li { padding: 0; }
.integ-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; text-decoration: none; color: inherit; }
.integ-link .chev { color: var(--muted); font-size: 22px; line-height: 1; margin-left: 2px; }
.ch-ns { background: #eef1f6; color: #3b4a66; }
.step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--navy-soft); color: var(--navy); font-size: 12px; font-weight: 700; margin-right: 6px; vertical-align: 1px; }
.step.done { background: var(--lima); }
.mapSel { width: auto; max-width: 52%; flex: none; padding: 8px 10px; font-size: 13px; border-radius: 10px; }
.row .btn { flex: 1; }

/* Logos de plataformas */
.logo-ico { width: 38px; height: 38px; border-radius: 10px; object-fit: contain; flex: none; background: var(--white); box-shadow: 0 0 0 1px var(--line); }
.logo-head { width: 26px; height: 26px; border-radius: 7px; object-fit: contain; flex: none; box-shadow: 0 0 0 1px var(--line); }
.logo-mini { width: 22px; height: 22px; border-radius: 6px; object-fit: contain; box-shadow: 0 0 0 1px var(--line); background: var(--white); }
.logo-row { display: inline-flex; gap: 6px; }
.logo-word { height: 40px; width: auto; display: block; }
.h-logo { display: flex; align-items: center; gap: 10px; }
.card h2.h-logo small { margin-left: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.page-title.page-title-logo { align-items: center; }
.card h2.h-logo { flex-wrap: wrap; row-gap: 2px; }

/* ---------- Búsqueda y filtros (Productos, Publicaciones, Stock) ---------- */
a.kpi { text-decoration: none; color: inherit; display: block; }
a.kpi:active { transform: scale(0.98); }
.kpi.warn .n { color: var(--warn); }
.fbar { position: sticky; top: 56px; z-index: 4; background: var(--bg, #f4f6fb); padding: 4px 0 10px; margin-bottom: 4px; }
.fsearch { position: relative; display: block; margin: 0; }
.fsearch svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.fsearch input { padding-left: 38px; margin: 0; font-size: 16px; border-radius: 12px; background: var(--white); }
.fselects { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.fselects::-webkit-scrollbar { display: none; }
.fsel { flex: none; width: auto; max-width: 70vw; margin: 0; padding: 7px 30px 7px 12px; font: 500 13px/1.2 Poppins, system-ui, sans-serif; border-radius: 999px; border: 1px solid #cfd6e8; background-color: var(--white); color: var(--navy); appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b1b4b' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; }
.fsel.on { background-color: var(--navy); color: var(--white); border-color: var(--navy);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c4e000' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fchips:not(:empty) { padding-top: 8px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; font: 600 12.5px/1 Poppins, system-ui, sans-serif; padding: 7px 8px 7px 11px; border-radius: 999px; background: var(--lima); color: var(--navy); max-width: 100%; }
.fchip span { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--navy); color: var(--lima); font-size: 13px; }
.fclear { border: 0; background: none; cursor: pointer; font: 600 13px/1 Poppins, system-ui, sans-serif; color: var(--navy-2); text-decoration: underline; padding: 7px 4px; }
#fResults.loading { opacity: 0.55; transition: opacity 0.15s; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 16px; }
.pager .btn[disabled] { opacity: 0.4; }
@media (min-width: 760px) { .fselects { flex-wrap: wrap; overflow: visible; } }


/* Selector compacto dentro de una lista (p. ej. modo del canal) */
.list li select.sel-auto { width: auto; flex: 0 0 auto; min-width: 130px; }

/* Recuperar contraseña: enlace bajo «Entrar» */
.auth-link { display: block; text-align: center; margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.auth-link:focus-visible { outline: 3px solid var(--lima); outline-offset: 3px; border-radius: 6px; }
.auth-card .success { word-break: normal; overflow-wrap: anywhere; }
/* Aviso de versión nueva (deploy mientras la pestaña seguía abierta). */
.update-bar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--navy); color: var(--white); box-shadow: var(--shadow); font-size: 14px; }
.update-bar .btn { flex: none; }

/* Canales · Desconectar cuenta (confirmación en la misma fila, mobile-first) */
.acc-row { flex-wrap: wrap; }
.acc-row .grow { min-width: 0; flex: 1 1 160px; }
.acc-row .s { overflow-wrap: anywhere; }
.acc-row .acc-err { color: var(--bad); white-space: normal; }
.acc-side { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.btn-danger-solid { background: var(--bad); color: var(--white); }
.btn-danger-solid:disabled, .btn:disabled { opacity: 0.55; cursor: not-allowed; }
.list li.off-row { display: block; }
.off-box { border: 1px solid #f3c4c0; background: #fff8f7; border-radius: var(--radius); padding: 14px; }
.off-head { display: flex; align-items: center; gap: 12px; }
.off-head .grow { min-width: 0; }
.off-head .s { overflow-wrap: anywhere; }
.off-list { margin: 12px 0 4px; padding-left: 18px; font-size: 13.5px; color: var(--ink); line-height: 1.5; }
.off-list li { display: list-item; border: 0; padding: 3px 0; }
.off-check { margin: 10px 0 2px; gap: 8px; align-items: center; color: var(--navy); }
.off-actions { display: flex; gap: 10px; margin-top: 14px; }
.off-actions .btn { flex: 1; }
.list .acc-row .grow .s, .list .off-head .grow .t, .list .off-head .grow .s { white-space: normal; text-overflow: clip; overflow-wrap: anywhere; }
label.off-check { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 10px; font-size: 13.5px; font-weight: 500; margin: 12px 0 2px; }
label.off-check input { width: 20px; height: 20px; flex: 0 0 20px; margin: 1px 0 0; padding: 0; accent-color: var(--navy); }
.off-actions .btn { padding: 12px 10px; white-space: nowrap; }
.success.flash-ok { word-break: normal; overflow-wrap: anywhere; margin: 0 0 14px; }

/* Envío de stock · almacenes que alimentan cada cuenta (Canales) */
.list li.push-wh { flex-wrap: wrap; align-items: flex-start; row-gap: 8px; }
.push-wh .grow { flex: 1 1 260px; min-width: 0; }
.list li.push-wh .grow .t, .list li.push-wh .grow .s { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.push-wh .push-wh-opts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; }
.push-wh .push-wh-opts label { display: inline-flex; align-items: center; gap: 6px; width: auto; margin: 0; }
.push-wh .push-wh-opts input { width: auto; margin: 0; flex: none; }
.push-wh .push-wh-warn { color: #b45309; font-weight: 600; }
