/* =====================================================
   BDI — Marketplace Operations Hub
   Sistema visual basado en el brand spec de Blue Diamond Innovation
   ===================================================== */
:root {
  --bg:        oklch(18% 0.04 265);
  --bg-2:      oklch(24% 0.06 265);
  --surface:   oklch(100% 0 0);
  --panel:     #f4f6fb;
  --fg:        oklch(20% 0.01 260);
  --muted:     oklch(45% 0.01 260);
  --border:    oklch(88% 0.01 260);
  --accent:    oklch(55% 0.18 260);
  --accent-d:  oklch(40% 0.16 263);
  --accent-tint: color-mix(in oklch, var(--accent) 7%, white);
  --ok:        oklch(58% 0.15 155);
  --ok-soft:   color-mix(in oklch, var(--ok) 12%, white);
  --warn:      oklch(72% 0.15 75);
  --warn-soft: color-mix(in oklch, var(--warn) 16%, white);
  --danger:    oklch(55% 0.20 27);
  --danger-soft: color-mix(in oklch, var(--danger) 10%, white);

  --font: 'Muli', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 16px rgba(15,23,42,.05);
  --shadow-lg: 0 8px 40px rgba(15,23,42,.14);
  --side-w: 248px;
}

* , *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: #eef0f4;
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }

.icon { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2;
        fill: none; stroke-linecap: round; stroke-linejoin: round; display: block; flex: 0 0 auto; }

/* ===================== APP SHELL ===================== */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }

/* ----- Sidebar ----- */
.sidebar {
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  color: #fff; padding: 22px 16px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 6px; }
.brand .mark { width: 40px; height: 40px; flex: 0 0 auto; }
.brand .bdi { font-size: 24px; font-weight: 800; letter-spacing: -.01em; line-height: 1; }
.brand .full { font-size: 7.5px; letter-spacing: .22em; font-weight: 700;
               color: #9db8ff; margin-top: 4px; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase;
             color: rgba(255,255,255,.42); font-weight: 800; margin: 6px 10px 4px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; color: rgba(255,255,255,.82); transition: background .15s, color .15s;
}
.nav a .icon { width: 18px; height: 18px; stroke: #9db8ff; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(37,99,235,.35); }
.nav a.active .icon { stroke: #fff; }
.side-card {
  margin-top: auto; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px; padding: 14px;
}
.side-card .sc-t { font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
                   color: #9db8ff; font-weight: 800; margin-bottom: 6px; }
.side-card .sc-v { font-size: 12px; line-height: 1.4; color: rgba(255,255,255,.86); }

/* ----- Main column ----- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 16px 30px; display: flex; align-items: center; gap: 18px;
  position: sticky; top: 0; z-index: 20;
}
.topbar .pt { flex: 1; min-width: 0; }
.topbar h1 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; color: var(--bg); margin: 0; }
.topbar .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.topbar .meta { display: flex; align-items: center; gap: 14px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; background: var(--accent-tint);
  color: var(--accent-d); border: 1px solid color-mix(in oklch, var(--accent) 16%, white);
  font-size: 11.5px; font-weight: 700; padding: 7px 13px; border-radius: 999px;
}
.pill .icon { width: 15px; height: 15px; stroke: var(--accent); }
.pill.live::before { content:""; width:7px; height:7px; border-radius:50%; background: var(--ok);
                     box-shadow: 0 0 0 0 color-mix(in oklch, var(--ok) 60%, transparent); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 color-mix(in oklch,var(--ok) 55%,transparent);} 70%{box-shadow:0 0 0 7px transparent;} 100%{box-shadow:0 0 0 0 transparent;} }
.who { text-align: right; }
.who .n { font-size: 12.5px; font-weight: 800; color: var(--fg); }
.who .r { font-size: 10.5px; color: var(--muted); }
.avatar { width: 38px; height: 38px; border-radius: 11px; background: var(--accent);
          color:#fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }

.content { padding: 26px 30px 40px; }

/* ===================== PRIMITIVES ===================== */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px;
}
.card.tight { padding: 14px 16px; }
.section-h { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.section-h .hc { width: 34px; height: 34px; border-radius: 9px; background: var(--accent);
                 color:#fff; display: grid; place-items: center; flex: 0 0 auto; }
.section-h .hc .icon { width: 18px; height: 18px; stroke:#fff; }
.section-h .hc.navy { background: var(--bg); }
.section-h .hc.ok   { background: var(--ok); }
.section-h .hc.danger { background: var(--danger); }
.section-h h2 { font-size: 14px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
                color: var(--bg); margin: 0; line-height: 1.15; }
.section-h .sh-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.grid { display: grid; gap: 16px; }

/* ----- KPI cards ----- */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
       box-shadow: var(--shadow); padding: 15px 16px; position: relative; overflow: hidden; }
.kpi .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
           background: var(--accent-tint); color: var(--accent); margin-bottom: 10px; }
.kpi .ic .icon { width: 18px; height: 18px; }
.kpi .v { font-family: var(--mono); font-size: 26px; font-weight: 700; letter-spacing: -.02em;
          color: var(--bg); line-height: 1; }
.kpi .l { font-size: 11px; color: var(--muted); margin-top: 6px; font-weight: 600; line-height: 1.3; }
.kpi .d { font-size: 10.5px; font-weight: 800; margin-top: 7px; display: inline-flex; align-items: center; gap: 4px; }
.kpi .d.up { color: var(--ok); } .kpi .d.flat { color: var(--muted); }
.kpi.feat { background: linear-gradient(160deg, var(--accent-d), var(--bg)); border-color: transparent; }
.kpi.feat .v, .kpi.feat .l { color: #fff; }
.kpi.feat .l { color: rgba(255,255,255,.75); }
.kpi.feat .ic { background: rgba(255,255,255,.14); color: #fff; }

/* ----- Funnel / pipeline ----- */
.funnel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.fstep { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--panel);
         position: relative; }
.fstep .fn { font-family: var(--mono); font-size: 24px; font-weight: 700; color: var(--bg); line-height: 1; }
.fstep .fl { font-size: 11px; color: var(--muted); margin-top: 6px; font-weight: 600; }
.fstep .bar { height: 5px; border-radius: 4px; background: color-mix(in oklch, var(--accent) 22%, white);
              margin-top: 11px; overflow: hidden; }
.fstep .bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.fstep.done { background: var(--ok-soft); border-color: color-mix(in oklch, var(--ok) 25%, white); }
.fstep.done .bar { background: color-mix(in oklch, var(--ok) 22%, white); }
.fstep.done .bar i { background: var(--ok); }
.fstep .arrow { position: absolute; right: -16px; top: 50%; transform: translateY(-50%); z-index: 2;
                color: #c3c9d6; }
.fstep:last-child .arrow { display: none; }

/* ----- Tables ----- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th { text-align: left; font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
                color: var(--muted); font-weight: 800; padding: 0 14px 11px; border-bottom: 1px solid var(--border); }
table.data td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--fg); }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--accent-tint); }
.mono { font-family: var(--mono); }
.fol { font-family: var(--mono); font-weight: 700; color: var(--bg); }
.muted { color: var(--muted); }
.prod { font-weight: 700; }
.prod small { display: block; font-weight: 600; color: var(--muted); font-family: var(--mono); font-size: 10.5px; margin-top: 2px; }

/* ----- Badges ----- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 800;
         padding: 5px 10px; border-radius: 999px; letter-spacing: .02em; white-space: nowrap; }
.badge::before { content:""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-recibido    { background: #eef1f6; color: #5b657c; }
.st-recoleccion { background: var(--warn-soft); color: oklch(48% 0.13 70); }
.st-empaque     { background: var(--accent-tint); color: var(--accent-d); }
.st-agencia     { background: color-mix(in oklch, var(--accent) 14%, white); color: var(--accent-d); }
.st-entregado   { background: var(--ok-soft); color: oklch(42% 0.13 155); }
.tag-mp { background: #eef1f6; color: #5b657c; font-weight: 700; }
.tag-mp::before { display: none; }

/* progress mini */
.prog { display: flex; align-items: center; gap: 9px; }
.prog .track { width: 92px; height: 6px; border-radius: 4px; background: #e7eaf1; overflow: hidden; }
.prog .track i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .5s; }
.prog .track.full i { background: var(--ok); }
.prog .pc { font-family: var(--mono); font-size: 11px; color: var(--muted); width: 34px; }

/* ----- Layout helpers ----- */
.row { display: grid; gap: 16px; }
.row.k6 { grid-template-columns: repeat(6,1fr); }
.row.c2 { grid-template-columns: 1.6fr 1fr; }
.row.c2e { grid-template-columns: 1fr 1fr; }
.row.c3 { grid-template-columns: repeat(3,1fr); }
.mb { margin-bottom: 16px; }
.right { text-align: right; }

/* ----- Value list ----- */
.vlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.vlist li { display: flex; gap: 12px; align-items: flex-start; }
.vlist .chip { width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
               background: var(--accent-tint); color: var(--accent); border: 1px solid color-mix(in oklch,var(--accent) 16%,white); }
.vlist .chip .icon { width: 18px; height: 18px; }
.vlist .vt { font-size: 13px; font-weight: 800; display: block; line-height: 1.2; margin-bottom: 2px; }
.vlist .vd { font-size: 11.5px; line-height: 1.42; color: var(--muted); }

/* ----- Check / x list ----- */
.clist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.clist li { display: flex; gap: 11px; align-items: flex-start; font-size: 12.5px; line-height: 1.35; }
.clist .mk { width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; color: #fff; }
.clist .mk.ok { background: var(--ok); } .clist .mk.no { background: var(--danger); }
.clist .mk .icon { width: 13px; height: 13px; stroke-width: 3; }

/* ----- Driver / route card ----- */
.driver { display: flex; flex-direction: column; gap: 0; }
.driver .dhead { display: flex; align-items: center; gap: 13px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.driver .dav { width: 48px; height: 48px; border-radius: 12px; background: var(--bg); color:#fff;
               display: grid; place-items: center; font-weight: 800; }
.driver .dn { font-size: 14px; font-weight: 800; } .driver .du { font-size: 11.5px; color: var(--muted); }
.kv { display: flex; flex-direction: column; gap: 11px; padding-top: 14px; }
.kv .r { display: flex; align-items: center; gap: 11px; font-size: 12px; }
.kv .r .icon { width: 17px; height: 17px; stroke: var(--accent); }
.kv .r b { font-weight: 800; } .kv .r span { color: var(--muted); }

/* ----- Buttons ----- */
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: #fff;
       border: none; font-family: var(--font); font-size: 12px; font-weight: 800; letter-spacing: .03em;
       padding: 10px 16px; border-radius: 10px; cursor: pointer; box-shadow: 0 4px 14px rgba(37,99,235,.3);
       transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37,99,235,.4); }
.btn .icon { width: 15px; height: 15px; stroke: #fff; }
.btn.ghost { background: var(--surface); color: var(--accent-d); border: 1px solid var(--border); box-shadow: none; }
.btn.ghost .icon { stroke: var(--accent); }

/* ----- Filter chips ----- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips a { font-size: 12px; font-weight: 700; padding: 8px 14px; border-radius: 999px;
           border: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.chips a.on { background: var(--bg); color: #fff; border-color: var(--bg); }

/* ----- Pricing ----- */
.plans { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.plan { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
        box-shadow: var(--shadow); padding: 22px; position: relative; display: flex; flex-direction: column; }
.plan.pop { border-color: var(--accent); box-shadow: 0 10px 30px rgba(37,99,235,.18); }
.plan .pop-tag { position: absolute; top: -11px; left: 22px; background: var(--accent); color: #fff;
                 font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
                 padding: 5px 11px; border-radius: 999px; }
.plan .pn { font-size: 15px; font-weight: 800; color: var(--bg); }
.plan .pp { margin: 12px 0 4px; } .plan .pp .amt { font-family: var(--mono); font-size: 34px; font-weight: 700; color: var(--bg); }
.plan .pp .per { font-size: 12px; color: var(--muted); font-weight: 700; }
.plan .pincl { font-size: 11.5px; color: var(--muted); margin-bottom: 16px; }
.plan ul { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.plan ul li { display: flex; gap: 9px; font-size: 12px; line-height: 1.35; }
.plan ul li .icon { width: 15px; height: 15px; stroke: var(--ok); stroke-width: 3; margin-top: 1px; }
.plan .btn { margin-top: auto; justify-content: center; }
.plan.pop .btn { } .plan:not(.pop) .btn { background: var(--bg); box-shadow: none; }

/* ----- Compare table ----- */
.cmp td.n { font-family: var(--mono); text-align: right; font-weight: 700; }
.cmp .tot td { border-top: 2px solid var(--border); font-weight: 800; font-size: 13.5px; }
.cmp .tot td.n { font-size: 15px; }
.save-banner { background: linear-gradient(120deg, var(--bg), var(--bg-2)); color: #fff; border-radius: var(--radius);
               padding: 22px 26px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.save-banner .big { font-family: var(--mono); font-size: 38px; font-weight: 700; line-height: 1; color: #9dffc0; }
.save-banner .lab { font-size: 12px; color: rgba(255,255,255,.8); margin-top: 6px; }

/* ----- Hint / callout ----- */
.callout { display: flex; gap: 13px; align-items: flex-start; background: var(--accent-tint);
           border: 1px solid color-mix(in oklch,var(--accent) 16%,white); border-radius: var(--radius); padding: 16px 18px; }
.callout .chip { width: 40px; height: 40px; border-radius: 50%; background:#fff; color: var(--accent);
                 display: grid; place-items: center; flex: 0 0 auto; }
.callout h3 { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
              color: var(--accent-d); margin: 2px 0 6px; }
.callout p { font-size: 12px; line-height: 1.5; margin: 0; }

/* ----- Forms (portal del partner) ----- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.field input, .field select {
  font-family: var(--font); font-size: 13px; padding: 10px 12px; width: 100%;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--fg);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.file-drop {
  border: 1.5px dashed color-mix(in oklch, var(--accent) 35%, white); border-radius: 12px;
  padding: 20px; text-align: center; background: var(--accent-tint); color: var(--accent-d);
  font-size: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.file-drop:hover { border-color: var(--accent); }
.file-drop input[type=file] { display: none; }
.file-drop .icon { width: 26px; height: 26px; stroke: var(--accent); }
.file-drop b { color: var(--accent-d); }
.file-name { font-family: var(--mono); font-size: 11px; color: var(--fg); font-weight: 700; }
.alert {
  display: flex; gap: 11px; align-items: center; border-radius: 12px; padding: 13px 16px;
  font-size: 13px; font-weight: 700; margin-bottom: 16px;
  background: var(--ok-soft); border: 1px solid color-mix(in oklch, var(--ok) 30%, white); color: oklch(40% 0.12 155);
}
.alert .icon { stroke: var(--ok); }
.alert.warn { background: var(--warn-soft); border-color: color-mix(in oklch, var(--warn) 32%, white); color: oklch(45% 0.13 70); }
.alert.warn .icon { stroke: var(--warn); }

.link-guia { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--accent-d); }
.link-guia .icon { width: 14px; height: 14px; stroke: var(--accent); }

.foot-note { text-align: center; color: var(--muted); font-size: 11px; margin-top: 30px; }

@media (max-width: 1100px) {
  .kpis, .row.k6 { grid-template-columns: repeat(3,1fr); }
  .row.c2, .row.c2e, .row.c3, .plans { grid-template-columns: 1fr; }
  .funnel { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nav { flex-direction: row; flex-wrap: wrap; } .nav-label, .side-card { display: none; }
  .kpis, .row.k6 { grid-template-columns: repeat(2,1fr); }
}
