/* Respuestas ML — estilos con el sistema de diseño de CUATICO (Manual de marca 2025) */
/* Tipografías del manual de marca (Sora y Quicksand, licencia OFL), incluidas localmente */
@font-face { font-family: 'Sora'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/sora-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Sora'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/sora-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Sora'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/sora-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Sora'; font-weight: 800; font-style: normal; font-display: swap; src: url('fonts/sora-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Quicksand'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/quicksand-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Quicksand'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/quicksand-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Quicksand'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/quicksand-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Quicksand'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/quicksand-latin-700-normal.woff2') format('woff2'); }

:root {
  --c-green-600: #009c5c; --c-green-400: #6ab880; --c-green-200: #b1d6b9; --c-green-050: #e6f3ec;
  --c-blue-600: #057ab4; --c-blue-400: #469ed7; --c-blue-200: #aed4e7; --c-blue-050: #eaf4fa;
  --c-black: #1a1a1a; --c-white: #fff; --c-gray-700: #4a4a4a; --c-gray-500: #7a7a7a; --c-gray-300: #d4dcd7; --c-gray-100: #f2f5f3;
  --c-orange-500: #ee8443; --c-orange-050: #fbe9dd;
  --c-red-500: #e5484d; --c-red-050: #fdecec; /* solo para alertas de tiempo, como en Mercado Libre */

  --text-heading: var(--c-black); --text-body: var(--c-gray-700); --text-muted: var(--c-gray-500);
  --brand: var(--c-green-600); --brand-2: var(--c-blue-400); --link: var(--c-blue-600);
  --surface-page: #f7faf8; --surface-card: var(--c-white); --surface-muted: var(--c-gray-100);
  --border: var(--c-gray-300); --border-w: 1.5px;
  --shadow-sm: 0 1px 2px rgba(26,26,26,.06); --shadow-md: 0 6px 18px rgba(26,26,26,.08); --shadow-lg: 0 16px 40px rgba(26,26,26,.10);
  --shadow-brand: 0 12px 28px rgba(0,156,92,.18);
  --r-xs: 6px; --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-pill: 999px;
  --ease: cubic-bezier(.16,1,.3,1); --fast: 120ms; --med: 220ms;
  --font-display: 'Sora', system-ui, sans-serif; --font-body: 'Quicksand', system-ui, sans-serif;
  --gradient-brand: linear-gradient(120deg, #009c5c 0%, #469ed7 100%);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 500 15px/1.5 var(--font-body); background: var(--surface-page); color: var(--text-body); }
h2, h3 { font-family: var(--font-display); color: var(--text-heading); letter-spacing: -0.02em; }
h2 { font-size: 20px; font-weight: 700; margin: 0; }
h3 { font-size: 15px; font-weight: 600; margin: 16px 0 8px; }
strong, b { color: var(--text-heading); font-weight: 700; }
.muted { color: var(--text-muted); } .small { font-size: 12.5px; }
.spacer { flex: 1; }
a { color: var(--link); } a:hover { color: var(--brand); }
code { background: var(--c-green-050); color: var(--c-green-600); padding: 1px 6px; border-radius: var(--r-xs); font-size: 12.5px; }

/* encabezado */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 20px; padding: 10px 24px 13px;
  background: var(--c-white); box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--gradient-brand); }
.brand { display: flex; align-items: center; gap: 12px; order: 0; }
.brand img { height: 34px; width: auto; display: block; }
.brand .app { font-family: var(--font-display); font-weight: 700; color: var(--text-heading); font-size: 15px; padding-left: 12px; border-left: var(--border-w) solid var(--border); }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; order: 3; width: 100%; margin-top: 2px; }
.tabs button { border: 0; background: none; color: var(--text-body); padding: 7px 13px; border-radius: var(--r-pill); cursor: pointer;
  font: 600 13.5px var(--font-display); transition: background var(--fast) var(--ease), color var(--fast); }
.tabs button:hover { background: var(--c-green-050); color: var(--brand); }
.tabs button.active { background: var(--brand); color: var(--c-white); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 2px; border-radius: var(--r-pill); background: var(--c-orange-500); color: #fff; font: 700 11.5px/18px var(--font-display); text-align: center; }
.tabs button.active .badge { background: var(--c-white); color: var(--brand); }
.badge.soft, .badge.zero { background: var(--surface-muted); color: var(--text-muted); }
.status { margin-left: auto; order: 1; font-size: 12px; color: var(--text-muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.status .pill { padding: 3px 10px; border-radius: var(--r-pill); background: var(--surface-muted); font-weight: 600; }
.status .pill.ok { background: var(--c-green-050); color: var(--c-green-600); }
.status .pill.ok::before, .status .pill.bad::before { content: "●"; margin-right: 5px; }
.status .pill.bad { background: var(--c-orange-050); color: #b85a1f; }

#banner .note { margin: 14px 24px 0; padding: 10px 16px; border-radius: var(--r-sm); background: var(--c-blue-050); color: var(--c-blue-600); border: var(--border-w) solid var(--c-blue-200); font-weight: 600; }

main { padding: 20px 24px 64px; max-width: 1240px; margin: 0 auto; }
.tab { display: none; } .tab.active { display: block; animation: fade var(--med) var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }

/* botones: píldora, Sora */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: var(--border-w) solid var(--brand); background: var(--c-white); color: var(--brand);
  padding: 8px 18px; border-radius: var(--r-pill); cursor: pointer; font: 600 13.5px/1.2 var(--font-display);
  transition: filter var(--fast), transform var(--fast), box-shadow var(--med), background var(--fast); }
.btn:hover { background: var(--c-green-050); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand); color: #fff; border-color: transparent; box-shadow: var(--shadow-brand); }
.btn.primary:hover { filter: brightness(.94); }
.btn.ghost { border-color: transparent; background: none; color: var(--text-muted); box-shadow: none; }
.btn.ghost:hover { color: var(--brand); background: var(--c-green-050); }
.btn:disabled { opacity: .55; cursor: wait; }
.switch { font-size: 13px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; font-weight: 600; }
.switch input { accent-color: var(--brand); width: auto; }

input, textarea, select { font: 500 14.5px/1.45 var(--font-body); color: var(--text-heading); background: var(--c-white); border: var(--border-w) solid var(--border);
  border-radius: var(--r-sm); padding: 9px 12px; width: 100%; transition: border-color var(--fast), box-shadow var(--fast); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,156,92,.15); }
textarea { resize: vertical; }
label { display: block; font: 600 12.5px var(--font-display); color: var(--text-heading); margin: 10px 0; }
label input, label textarea, label select { margin-top: 5px; }

/* tarjetas */
.cards { display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--surface-card); border-radius: var(--r-md); padding: 18px 22px; box-shadow: var(--shadow-md); position: relative; overflow: visible; }
.card.sending { opacity: .6; }
.item { display: flex; gap: 14px; align-items: center; padding-bottom: 12px; border-bottom: var(--border-w) solid var(--surface-muted); margin-bottom: 12px; }
.item img, .item .ph { width: 54px; height: 54px; border-radius: var(--r-sm); object-fit: contain; background: var(--c-green-050); flex: none; }
.item .ph { background: var(--c-green-050) url('img/isologo.png') center / 26px no-repeat; }
.item .t { font: 600 15px var(--font-display); }
.item .t a { color: var(--text-heading); text-decoration: none; } .item .t a:hover { color: var(--brand); }
.item .meta { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.item .meta b.nostock { color: #b85a1f; }
.who { font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; display: flex; gap: 10px; flex-wrap: wrap; font-weight: 600; }
.who strong { font-family: var(--font-display); }
.who .age.late { color: var(--c-red-500); }
.q { font-size: 15.5px; color: var(--text-heading); background: var(--c-blue-050); padding: 12px 16px; border-radius: 4px var(--r-md) var(--r-md) var(--r-md); margin-bottom: 12px; white-space: pre-wrap; font-weight: 600; }
.prev { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; border-left: 3px solid var(--c-blue-200); padding-left: 12px; }
.prev div { margin: 3px 0; }
.draft-head { display: flex; gap: 8px; align-items: center; font-size: 12.5px; margin-bottom: 6px; flex-wrap: wrap; }
.draft-head strong { font-family: var(--font-display); }
.conf { padding: 2px 10px; border-radius: var(--r-pill); font: 700 11px/1.6 var(--font-display); text-transform: uppercase; letter-spacing: .04em; cursor: help; }
.conf.alta { background: var(--c-green-050); color: var(--c-green-600); }
.conf.media { background: var(--c-blue-050); color: var(--c-blue-600); }
.conf.baja { background: var(--c-orange-050); color: #b85a1f; }
.missing { font-size: 13px; color: #b85a1f; margin: 4px 0 6px; font-weight: 600; }
.warning { font-size: 13px; color: var(--c-red-500); margin: 4px 0; font-weight: 600; }
.err { font-size: 13px; color: var(--c-red-500); font-weight: 600; }
.count { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.count.over { color: var(--c-red-500); }
.actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: var(--border-w) solid var(--c-blue-200); background: var(--c-blue-050); color: var(--c-blue-600); border-radius: var(--r-pill); padding: 3px 12px;
  font: 600 12px/1.6 var(--font-display); cursor: pointer; transition: background var(--fast); }
.chip:hover { background: var(--c-blue-200); }
.regen { display: flex; gap: 6px; flex: 1; min-width: 240px; }
.regen input { padding: 7px 14px; border-radius: var(--r-pill); }
.empty { color: var(--text-muted); text-align: center; padding: 44px; background: var(--c-white); border-radius: var(--r-md); box-shadow: var(--shadow-sm); font-weight: 600; }
.loading { color: var(--brand); font-style: italic; font-size: 13px; font-weight: 600; }

/* mensajes */
.split { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; }
.conv-list { display: flex; flex-direction: column; gap: 8px; }
.conv { background: var(--c-white); border: var(--border-w) solid transparent; border-radius: var(--r-md); padding: 12px 14px; cursor: pointer; box-shadow: var(--shadow-sm); transition: box-shadow var(--med); }
.conv:hover { box-shadow: var(--shadow-md); }
.conv.active { border-color: var(--brand); }
.conv .n { font: 600 14px var(--font-display); color: var(--text-heading); } .conv .p { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-detail { background: var(--c-white); border-radius: var(--r-md); padding: 18px 22px; min-height: 300px; box-shadow: var(--shadow-md); }
.conv-detail .card { box-shadow: none; }
.thread { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; padding: 4px 2px 12px; }
.msg { max-width: 78%; padding: 9px 14px; white-space: pre-wrap; color: var(--text-heading); }
.msg.buyer { background: var(--c-blue-050); align-self: flex-start; border-radius: 4px var(--r-md) var(--r-md) var(--r-md); }
.msg.seller { background: var(--c-green-050); align-self: flex-end; border-radius: var(--r-md) 4px var(--r-md) var(--r-md); }
.msg .d { font-size: 11px; color: var(--text-muted); margin-top: 3px; font-weight: 600; }

/* conocimiento */
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.panel { background: var(--c-white); border-radius: var(--r-md); padding: 8px 22px 20px; box-shadow: var(--shadow-md); min-width: 0; }
.drop { border: 2px dashed var(--c-green-200); border-radius: var(--r-md); padding: 20px; text-align: center; margin: 10px 0; background: var(--c-green-050); }
.drop.over { border-color: var(--brand); background: #d6eedf; }
.link { color: var(--link); cursor: pointer; display: inline; font: inherit; margin: 0; }
details { margin: 10px 0; } summary { cursor: pointer; color: var(--c-blue-600); font: 600 13px var(--font-display); }
.doc { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-top: var(--border-w) solid var(--surface-muted); }
.doc .info { flex: 1; min-width: 0; } .doc .t { font: 600 14px var(--font-display); color: var(--text-heading); }
.doc .pv { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-form { width: min(760px, 92vw); }
dialog { border: 0; border-radius: var(--r-lg); background: var(--c-white); color: var(--text-body); box-shadow: var(--shadow-lg); padding: 8px 26px 22px; }
dialog::backdrop { background: rgba(26,26,26,.35); }
.row { display: flex; gap: 8px; margin-top: 12px; }
.seg { display: inline-flex; background: var(--surface-muted); border-radius: var(--r-pill); padding: 3px; }
.seg button { border: 0; background: none; color: var(--text-body); padding: 6px 14px; cursor: pointer; font: 600 13px var(--font-display); border-radius: var(--r-pill); }
.seg button.active { background: var(--c-white); color: var(--brand); box-shadow: var(--shadow-sm); }
#h-search { width: 240px; border-radius: var(--r-pill); }
.hist { background: var(--c-white); border-radius: var(--r-md); padding: 12px 18px; margin-bottom: 10px; box-shadow: var(--shadow-sm); color: var(--text-heading); }
.hist .a { margin-top: 6px; padding-left: 12px; border-left: 3px solid var(--brand); color: var(--text-body); }
.tag { font: 700 10.5px/1.7 var(--font-display); padding: 1px 9px; border-radius: var(--r-pill); background: var(--c-green-050); color: var(--c-green-600); text-transform: uppercase; letter-spacing: .04em; }
table.log { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--c-white); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-sm); }
table.log td { border-bottom: var(--border-w) solid var(--surface-muted); padding: 7px 12px; vertical-align: top; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--c-black); color: #fff; padding: 10px 20px; border-radius: var(--r-pill); opacity: 0;
  transition: opacity var(--med); pointer-events: none; max-width: 90vw; font-weight: 600; }
#toast.show { opacity: 1; }

/* login */
body.login { display: grid; place-items: center; min-height: 100vh; background: var(--c-green-050); }
.login-box { background: var(--c-white); border-radius: var(--r-lg); padding: 32px; width: min(360px, 90vw); display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-lg); text-align: center; }
.login-box img { height: 54px; width: auto; margin: 0 auto 4px; }
.login-box .app { font: 700 17px var(--font-display); color: var(--text-heading); }
.login-box textarea.copy-box { width: 100%; text-align: left; font-size: 12.5px; word-break: break-all; user-select: all; }
.login-box .error { color: var(--c-red-500); margin: 0; font-weight: 600; }

/* usuario, catálogo, administración */
.usermenu { position: relative; order: 2; }
.usermenu .menu[hidden] { display: none; }
.usermenu .btn { padding: 6px 12px; font-size: 12.5px; }
.usermenu .menu { position: absolute; right: 0; top: 110%; background: var(--c-white); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); padding: 6px; min-width: 200px; z-index: 30; display: flex; flex-direction: column; }
.usermenu .menu a { padding: 8px 12px; border-radius: var(--r-xs); text-decoration: none; color: var(--text-heading); font-weight: 600; }
.usermenu .menu a:hover { background: var(--c-green-050); color: var(--brand); }
.panel.wide { margin-bottom: 16px; }
.cat-list { max-height: 420px; overflow: auto; }
.cat { display: grid; grid-template-columns: 44px minmax(0, 1fr) 110px 80px 90px auto; gap: 12px; align-items: center; padding: 8px 0; border-top: var(--border-w) solid var(--surface-muted); }
.cat img, .cat .ph { width: 44px; height: 44px; border-radius: var(--r-xs); object-fit: contain; background: var(--c-green-050) url('img/isologo.png') center / 20px no-repeat; }
.cat .t { font: 600 13.5px var(--font-display); color: var(--text-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat .t a { color: inherit; text-decoration: none; } .cat .t a:hover { color: var(--brand); }
.cat .n { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat .num { font: 600 13px var(--font-display); color: var(--text-heading); text-align: right; font-variant-numeric: tabular-nums; }
.st { font: 700 10.5px/1.7 var(--font-display); padding: 1px 9px; border-radius: var(--r-pill); text-transform: uppercase; letter-spacing: .04em; justify-self: start; }
.st.active { background: var(--c-green-050); color: var(--c-green-600); } .st.paused { background: var(--c-orange-050); color: #b85a1f; } .st.closed, .st.prueba { background: var(--surface-muted); color: var(--text-muted); }
.tag.test { background: var(--c-orange-050); color: #b85a1f; }
.grid2.tight { gap: 0 12px; }
.urow { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: var(--border-w) solid var(--surface-muted); flex-wrap: wrap; }
.urow .info { flex: 1; min-width: 160px; }
.urow .info .n { font: 600 14px var(--font-display); color: var(--text-heading); }
.urow select { width: auto; padding: 5px 10px; border-radius: var(--r-pill); font-size: 13px; }
.trow { padding: 8px 0; border-top: var(--border-w) solid var(--surface-muted); }
.trow .q2 { color: var(--text-heading); font-weight: 600; }

.steps { background: var(--c-blue-050); border-radius: var(--r-sm); padding: 4px 14px 14px; margin: 12px 0; }
.steps p { margin: 10px 0 8px; font-size: 13.5px; }
.switch.big { font-size: 13.5px; color: var(--text-heading); margin: 14px 0 6px; font-family: var(--font-body); }
.mlcard .src { font: 700 10.5px/1.7 var(--font-display); padding: 1px 9px; border-radius: var(--r-pill); background: #fff159; color: #2d3277; text-transform: uppercase; letter-spacing: .04em; margin-left: 8px; vertical-align: 2px; }

/* fuentes del borrador */
.sources { margin: 6px 0 2px; font-size: 12.5px; }
.sources summary { font: 600 12.5px var(--font-display); color: var(--c-blue-600); }
.sources ul { margin: 6px 0 0; padding-left: 18px; }
.sources li { margin: 4px 0; color: var(--text-body); }
.sources li b { color: var(--text-heading); font-family: var(--font-display); font-weight: 600; }

/* ventas */
.sales-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.sales-top .panel { padding: 14px 22px 20px; }
label.dl { margin: 0; flex: 1; min-width: 140px; }
.cal-wrap { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 8px; }
.cal { display: grid; grid-template-columns: repeat(7, 46px); gap: 6px; }
.cal .dow { font: 600 11px var(--font-display); color: var(--text-muted); text-align: center; }
.cal .d { height: 46px; border-radius: var(--r-xs); display: grid; place-items: center; font: 600 15px var(--font-display); color: #fff; cursor: pointer; border: 2px solid transparent; transition: transform var(--fast); }
.cal .d:hover { transform: scale(1.05); }
.cal .d.sel { border-color: var(--c-green-600); box-shadow: 0 0 0 2px #fff inset; }
.cal .d.future { opacity: .45; cursor: default; }
.c0 { background: #d4d4d4; } .c1 { background: var(--c-blue-200); } .c2 { background: var(--c-blue-400); } .c3 { background: var(--c-blue-600); }
.cal-legend { display: flex; flex-direction: column; gap: 10px; justify-content: center; font-weight: 600; color: var(--text-body); font-size: 14px; }
.cal-legend b { display: inline-block; width: 16px; height: 16px; border-radius: 3px; margin-right: 8px; vertical-align: -3px; }
.sales-kpis .range { font: 400 24px var(--font-display); color: var(--text-muted); margin: 18px 0 26px; letter-spacing: -0.01em; }
.kgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 12px; text-align: center; }
.kgrid .wide { grid-column: 1 / -1; }
.kgrid .big { font: 700 40px/1.1 var(--font-display); color: var(--text-heading); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kgrid .big sup, .stable sup { font-size: .5em; vertical-align: super; margin-left: 2px; }
.kgrid .big .cur { font-size: .55em; font-weight: 600; vertical-align: 0; margin-right: 2px; }
.kgrid .lbl { font-weight: 600; color: var(--text-heading); margin-top: 2px; }
.stable { width: 100%; border-collapse: collapse; }
.stable th { text-align: left; font: 600 14px var(--font-display); color: var(--text-muted); padding: 14px 12px; }
.stable td { padding: 12px; border-top: var(--border-w) solid var(--surface-muted); vertical-align: middle; color: var(--text-heading); }
.stable tr:nth-child(even) td { background: #fafbfa; }
.stable .img { width: 64px; height: 64px; border-radius: var(--r-xs); object-fit: contain; background: var(--c-green-050) url('img/isologo.png') center / 24px no-repeat; display: block; border: 1px solid var(--surface-muted); }
.stable .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.stable th.num { text-align: right; }
.stable .ttl { font-weight: 600; }
.stable .ttl a { color: inherit; text-decoration: none; } .stable .ttl a:hover { color: var(--brand); }
.lt { font: 700 11px/1.7 var(--font-display); padding: 2px 9px; border-radius: var(--r-xs); background: #5fc8b0; color: #fff; white-space: nowrap; }
.lt.Premium { background: var(--c-blue-600); }
.stable tfoot td { font-weight: 700; border-top: 2px solid var(--border); background: #fff !important; }
@media (max-width: 900px) { .sales-top { grid-template-columns: 1fr; } .cal { grid-template-columns: repeat(7, 38px); } .cal .d { height: 38px; } .kgrid .big { font-size: 30px; } .stable .hide-m { display: none; } }

/* indicadores */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--c-white); border-radius: var(--r-md); padding: 12px 16px; box-shadow: var(--shadow-sm); border-top: 4px solid var(--c-green-200); }
.kpi .l { font: 600 12px var(--font-display); color: var(--text-muted); }
.kpi .v { font: 800 24px/1.3 var(--font-display); color: var(--text-heading); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi .s { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.kpi.bad { border-top-color: var(--c-red-500); } .kpi.bad .v { color: var(--c-red-500); }
.kpi.ok { border-top-color: var(--brand); } .kpi.ok .v { color: var(--brand); }
.mblock { background: var(--c-white); border-radius: var(--r-md); padding: 8px 22px 20px; margin-bottom: 18px; box-shadow: var(--shadow-md); }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 18px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bars .b i { display: block; width: 100%; max-width: 34px; background: var(--brand); border-radius: 6px 6px 0 0; min-height: 2px; }
.bars .b.slow i { background: var(--c-red-500); }
.bars .b.none i { background: var(--border); }
.bars .b span { font-size: 10.5px; color: var(--text-muted); margin-top: 4px; white-space: nowrap; font-weight: 600; }
.bars .b em { font-style: normal; font-size: 10px; color: var(--text-muted); margin-bottom: 2px; white-space: nowrap; font-weight: 700; }
.dist { display: flex; height: 12px; border-radius: var(--r-pill); overflow: hidden; margin: 8px 0 6px; background: var(--border); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.legend b { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* tarjeta tipo Mercado Libre */
.mlcard { background: var(--c-white); border-radius: var(--r-md); box-shadow: var(--shadow-md); margin-bottom: 18px; overflow: hidden; }
.mlcard .head { display: flex; gap: 12px; align-items: center; padding: 16px 22px 6px; }
.mlcard .ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 2px solid; font: 700 14px var(--font-display); }
.mlcard.bad .ico { color: var(--c-red-500); border-color: var(--c-red-500); }
.mlcard.ok .ico { color: var(--brand); border-color: var(--brand); }
.mlcard .title { font: 700 17px var(--font-display); color: var(--text-heading); letter-spacing: -0.01em; }
.mlcard .sub { padding: 0 22px 12px 62px; font-weight: 600; color: var(--text-body); }
.mlcard .body { display: grid; grid-template-columns: 240px minmax(0, 1fr); border-top: var(--border-w) solid var(--surface-muted); }
.mlcard .side { padding: 18px 22px; display: flex; align-items: center; font-weight: 600; color: var(--text-heading); border-right: var(--border-w) solid var(--surface-muted); }
.mlcard .rows { padding: 16px 22px 12px; }
.mlrow { display: grid; grid-template-columns: 210px minmax(0, 1fr) 90px; align-items: center; gap: 14px; margin: 8px 0; }
.mlrow .lb { font-weight: 600; color: var(--text-heading); }
.mlrow .track { position: relative; height: 10px; background: var(--surface-muted); border-radius: var(--r-pill); }
.mlrow .track::after { content: ""; position: absolute; left: 66.66%; top: -6px; bottom: -6px; width: 1.5px; background: var(--border); }
.mlrow .fill { height: 100%; border-radius: var(--r-pill); background: var(--brand); }
.mlrow .fill.slow { background: var(--c-red-500); }
.mlrow .val { font: 700 13px var(--font-display); color: var(--text-heading); text-align: right; font-variant-numeric: tabular-nums; }
.mlrow .val small { display: block; font: 600 11px var(--font-body); color: var(--text-muted); }
.mlaxis { display: grid; grid-template-columns: 210px minmax(0, 1fr) 90px; gap: 14px; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.mlaxis div:nth-child(2) { position: relative; height: 16px; }
.mlaxis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.mlaxis span:first-child { transform: none; } .mlaxis span:last-child { transform: translateX(-100%); }
.mllegend { display: flex; justify-content: flex-end; gap: 18px; padding: 4px 22px 16px; font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.mllegend b { display: inline-block; width: 22px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: 3px; }

/* respuestas rápidas */
.qr-wrap { position: relative; }
.qr-pop { position: absolute; z-index: 20; bottom: 115%; left: 0; width: min(440px, 85vw); max-height: 340px; overflow: auto; background: var(--c-white); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 10px; }
.qr-pop input { margin-bottom: 6px; border-radius: var(--r-pill); }
.qr-opt { padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; }
.qr-opt:hover { background: var(--c-green-050); }
.qr-opt .t { font: 600 13.5px var(--font-display); color: var(--text-heading); } .qr-opt .p { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr-item { background: var(--c-white); border-radius: var(--r-md); padding: 12px 18px; margin-bottom: 10px; display: flex; gap: 12px; align-items: flex-start; box-shadow: var(--shadow-sm); color: var(--text-heading); }
.qr-item .info { flex: 1; min-width: 0; }

@media (max-width: 900px) {
  .cat { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .cat .num, .cat .st { display: none; }
  .split, .grid2, .mlcard .body { grid-template-columns: 1fr; }
  .mlcard .side { border-right: 0; padding-bottom: 0; }
  .mlrow, .mlaxis { grid-template-columns: 110px minmax(0, 1fr) 70px; gap: 8px; }
  .mlcard .sub { padding-left: 22px; }
  main { padding: 14px 14px 60px; }
  .top { padding: 10px 14px 13px; gap: 10px; }
  .brand .app { display: none; }
  .status { margin-left: 0; }
}
