:root {
  --bg: #0a0a14;
  --bg-2: #0f0f1c;
  --bg-3: #16172a;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #e8e8f5;
  --muted: #888a9c;
  --accent: #00e0ff;
  --accent-strong: #28f0ff;
  --purple: #a370ff;
  --success: #2bd97a;
  --warn: #ffb84d;
  --danger: #ff5e7d;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 60px rgba(0, 224, 255, 0.06);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

/* HTML hidden attribute debe ganar sobre cualquier display: grid/flex/etc */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 50% -10%, rgba(0, 224, 255, 0.08), transparent 60%), var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

input, select, textarea, button {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
}

input, select, textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 224, 255, 0.18);
}

label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 14px 0 6px;
}

button {
  cursor: pointer;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-weight: 600;
  transition: transform .08s ease, background .15s ease, color .15s ease;
}
button:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #06060e;
  box-shadow: 0 8px 30px rgba(0, 224, 255, 0.28);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--accent-strong), var(--purple)); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost.danger { color: var(--danger); border-color: rgba(255,94,125,0.3); }
.btn-ghost.danger:hover { background: rgba(255,94,125,0.08); border-color: var(--danger); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.err { color: var(--danger); font-size: 13px; margin-top: 10px; }

/* ───── Login ───── */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow);
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #06060e;
  font-size: 24px;
  font-weight: 800;
}
.brand-mark.sm {
  width: 28px; height: 28px;
  border-radius: 8px;
  font-size: 16px;
}
.brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 44px; }
.pwd-toggle {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 8px;
}
.pwd-toggle:hover { color: var(--accent); }
#login-submit { width: 100%; margin-top: 16px; }

/* ───── App layout ───── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 20, 0.88);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand-small {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 16px 22px 0;
  flex-wrap: wrap;
  max-width: 1400px;
  margin: 0 auto;
  align-items: center;
}
.tab {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 8px 14px;
  font-size: 13px;
}
.tab:hover { color: var(--text); border-color: var(--line-strong); }
.tab.active {
  color: var(--accent);
  border-color: rgba(0, 224, 255, 0.4);
  background: rgba(0, 224, 255, 0.06);
}
.tab-cta {
  margin-left: auto;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #06060e;
  border: 0;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 18px 22px 4px;
  max-width: 1400px;
  margin: 0 auto;
}
.kpi {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-width: 0;
}
.kpi span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}
.kpi strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
  margin-top: 4px;
}
.kpi.accent strong { color: var(--accent); }
.kpi.purple strong { color: var(--purple); }
.kpi.mute strong { color: var(--muted); }

.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 10px;
  padding: 14px 22px;
  max-width: 1400px;
  margin: 0 auto;
}

.card {
  max-width: 1400px;
  margin: 0 auto 30px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.list-head {
  display: flex;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 8px;
}
.list { padding: 0; }
.row {
  display: grid;
  grid-template-columns: 60px 1fr 100px 100px 90px;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .12s ease;
  min-width: 0;
}
.row:hover { background: rgba(255, 255, 255, 0.025); }
.row:last-child { border-bottom: 0; }
.row .thumb {
  width: 50px; height: 50px;
  border-radius: 8px;
  background: var(--bg-3) center/cover no-repeat;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.row .name { min-width: 0; }
.row .name b {
  display: block;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .name span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.row .price { font-weight: 700; }
.row .price small {
  display: block;
  text-decoration: line-through;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}
.badge.disponible { background: rgba(43, 217, 122, 0.14); color: var(--success); }
.badge.vendido { background: rgba(163, 112, 255, 0.16); color: var(--purple); }
.badge.oculto { background: rgba(136, 138, 156, 0.14); color: var(--muted); }

/* ───── Modal ───── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
}
.modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 12, 0.7);
  backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  margin: 20px;
  box-shadow: 0 30px 100px rgba(0,0,0,0.5);
}
.modal-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-card header h2 {
  margin: 0;
  font-size: 17px;
  word-break: break-word;
}
.modal-card .x {
  background: transparent;
  color: var(--muted);
  border: 0;
  font-size: 18px;
  padding: 4px 10px;
}
.modal-card .x:hover { color: var(--danger); }
.modal-body {
  overflow-y: auto;
  padding: 16px 22px 22px;
}
.modal-body .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.modal-body h3 {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.modal-card footer {
  display: flex;
  justify-content: space-between;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 10px;
}
.footer-left, .footer-right { display: flex; gap: 8px; flex-wrap: wrap; }

/* ───── Botón IA + label-row ───── */
.label-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin: 14px 0 6px;
}
.label-row label { margin: 0; }
.btn-ai {
  background: linear-gradient(135deg, rgba(0, 224, 255, 0.18), rgba(163, 112, 255, 0.18));
  border: 1px solid rgba(0, 224, 255, 0.35);
  color: var(--accent);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-ai:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(0, 224, 255, 0.25), rgba(163, 112, 255, 0.25));
}
.btn-ai:disabled { opacity: 0.6; cursor: wait; }
.ai-spark { font-size: 14px; }
.btn-ai.loading .ai-spark {
  display: inline-block;
  animation: ai-spin 0.9s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }

/* ───── Dropzone imágenes ───── */
.dropzone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 18px;
  background: var(--bg-2);
  transition: border-color .15s ease, background .15s ease;
  cursor: pointer;
}
.dropzone:hover { border-color: var(--accent); background: rgba(0, 224, 255, 0.03); }
.dropzone.dragging {
  border-color: var(--accent);
  background: rgba(0, 224, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(0, 224, 255, 0.15);
}
.dropzone-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 0;
  text-align: center;
}
.dropzone-text strong { font-size: 13px; }
.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.img-grid:empty { display: none; }
.img-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--bg-3) center/cover no-repeat;
  border: 1px solid var(--line);
  overflow: hidden;
}
.img-thumb.is-main { border-color: var(--accent); }
.img-thumb .slot-tag {
  position: absolute;
  top: 4px; left: 4px;
  background: rgba(10, 10, 20, 0.85);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.img-thumb.is-main .slot-tag { color: var(--accent); }
.img-thumb .img-del {
  position: absolute;
  top: 4px; right: 4px;
  background: rgba(255, 94, 125, 0.92);
  color: white;
  border: 0;
  width: 22px; height: 22px;
  border-radius: 6px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.img-thumb .img-del:hover { background: var(--danger); }
.img-thumb.uploading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 20, 0.6) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 50 50'><circle cx='25' cy='25' r='20' fill='none' stroke='%2300e0ff' stroke-width='4' stroke-linecap='round' stroke-dasharray='90 30'><animateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='0.9s' repeatCount='indefinite'/></circle></svg>") center no-repeat;
}

/* ───── Toast ───── */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-3);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 14px;
  z-index: 100;
  max-width: calc(100vw - 2rem);
  box-shadow: 0 12px 40px rgba(0, 224, 255, 0.2);
}
.toast.err { border-color: var(--danger); }

/* ───── Responsive iPhone 7 (375px) ───── */
@media (max-width: 720px) {
  .kpis { grid-template-columns: repeat(2, 1fr); padding: 14px 14px 0; gap: 8px; }
  .kpi { padding: 12px 14px; }
  .kpi strong { font-size: 22px; }
  .filters { grid-template-columns: 1fr; padding: 12px 14px; }
  .tabs { padding: 14px 14px 0; gap: 4px; }
  .tab { padding: 7px 11px; font-size: 12px; }
  .row { grid-template-columns: 50px 1fr 80px 70px; padding: 12px 14px; gap: 10px; }
  .row .badge.large { display: none; }
  .row .price small { display: none; }
  .topbar { padding: 12px 14px; }
  .topbar .hide-sm { display: none; }
  .list-head { padding: 10px 14px; font-size: 11px; }
  .modal-card { margin: 10px; max-height: 96vh; }
  .modal-card header { padding: 14px 16px; }
  .modal-body { padding: 14px 16px 16px; }
  .modal-card footer { padding: 12px 16px; }
  .modal-body .grid { grid-template-columns: 1fr; }
}

/* ── Wallapop modal ─────────────────────────────────────────────── */

.btn-wp {
  background: linear-gradient(135deg, #2bd97a, #00e0ff);
  color: #06060e;
  font-weight: 700;
  padding: 8px 14px;
}
.btn-wp:hover { filter: brightness(1.08); }
.btn-wp:disabled { opacity: 0.5; cursor: not-allowed; }

.wp-help {
  margin: 0 0 14px;
  padding: 10px 12px;
  background: rgba(0, 224, 255, 0.05);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  line-height: 1.5;
}

.wp-copy-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.wp-copy-row input,
.wp-copy-row textarea {
  flex: 1;
  min-width: 0;
}
.wp-copy-row .btn-ghost {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 8px 12px;
  font-size: 13px;
}
.wp-copy.copied {
  color: var(--success);
  border-color: var(--success);
}

.wp-fotos-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.wp-fotos-actions .btn-primary,
.wp-fotos-actions .btn-ghost {
  padding: 10px 16px;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.wp-status {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--bg-2);
}
.wp-status.published {
  color: var(--success);
  background: rgba(43, 217, 122, 0.08);
}

/* Badge en la lista de productos cuando hay anuncio en Wallapop */
.wp-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(43, 217, 122, 0.18);
  color: var(--success);
  border-radius: 4px;
  vertical-align: middle;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

/* ── Wallapop bookmarklet section ──────────────────────────── */
.wp-bookmarklet {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.wp-bookmarklet summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
  outline: none;
}
.wp-bookmarklet[open] summary { margin-bottom: 10px; }
.wp-bookmarklet-body ol { margin: 6px 0; padding-left: 20px; font-size: 13px; line-height: 1.6; }
.wp-bookmarklet-body kbd {
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  font-family: monospace;
}
.wp-drag {
  margin: 8px 0;
  padding: 10px;
  background: var(--bg-3);
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  text-align: center;
}
.wp-drag a {
  display: inline-block;
  padding: 8px 16px;
  background: linear-gradient(135deg, #2bd97a, #00e0ff);
  color: #06060e;
  font-weight: 700;
  border-radius: 8px;
  cursor: grab;
}
.wp-drag a:active { cursor: grabbing; }
#wp-bookmarklet-code {
  font-family: monospace;
  font-size: 11px;
  background: var(--bg-3);
  white-space: pre;
  overflow-x: auto;
}

/* ───── Chats WhatsApp ────────────────────────────────────────── */

.chats-section {
  padding: 0 16px 24px;
}

.chats-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  height: calc(100vh - 220px);
  min-height: 480px;
  max-width: 1280px;
  margin: 0 auto;
}

@media (max-width: 720px) {
  .chats-grid {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  .chats-list-pane { max-height: 40vh; }
  .chats-detail-pane { min-height: 60vh; }
}

.chats-list-pane,
.chats-detail-pane {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.chats-list-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chats-list-body {
  overflow-y: auto;
  flex: 1;
}

.chat-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .15s ease;
}
.chat-item:hover { background: rgba(0, 224, 255, 0.05); }
.chat-item.active {
  background: rgba(0, 224, 255, 0.12);
  border-left: 3px solid var(--accent);
  padding-left: 11px;
}

.chat-item-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.chat-item-tel { font-size: 11px; margin-top: 2px; }

.chat-item-preview {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-badge {
  display: inline-block;
  background: var(--accent);
  color: #000;
  border-radius: 999px;
  padding: 1px 7px;
  font-weight: 600;
  font-size: 11px;
}
.chat-badge.pay {
  background: var(--purple);
  color: #fff;
}

.chats-empty {
  padding: 64px 24px;
  text-align: center;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#chats-detail {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.chats-detail-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-3);
}

.chats-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
}

.msg {
  max-width: 78%;
  display: flex;
  flex-direction: column;
}
.msg-in { align-self: flex-start; }
.msg-out,
.msg-out_humano {
  align-self: flex-end;
  align-items: flex-end;
}

.msg-bubble {
  padding: 9px 13px;
  border-radius: 14px;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.35;
}
.msg-in .msg-bubble {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.msg-out .msg-bubble {
  background: rgba(0, 224, 255, 0.18);
  color: #cffaff;
  border-bottom-right-radius: 4px;
}
.msg-out_humano .msg-bubble {
  background: rgba(163, 112, 255, 0.22);
  color: #ecdfff;
  border-bottom-right-radius: 4px;
}

.msg-time {
  font-size: 11px;
  margin-top: 3px;
  padding: 0 6px;
}

.chats-reply {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--bg-3);
}
.chats-reply textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 140px;
}
.chats-reply button {
  align-self: flex-end;
  min-width: 96px;
}

/* ───── Pedidos (flujo reserva → pago → venta) ───────────────── */

.pedidos-section { padding: 0 16px 24px; max-width: 1280px; margin: 0 auto; }

.pedidos-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 14px;
}

.pedidos-filters { display: flex; gap: 8px; }

.tab-mini {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.tab-mini:hover { border-color: var(--accent); }
.tab-mini.active {
  background: rgba(0, 224, 255, 0.18);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.pedidos-list { display: flex; flex-direction: column; gap: 10px; }

.pedido-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  align-items: center;
}

.pedido-img {
  width: 72px;
  height: 72px;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pedido-img img { width: 100%; height: 100%; object-fit: cover; }

.pedido-info { min-width: 0; }

.pedido-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.pedido-head strong {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 420px;
}

.pedido-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.pedido-pill.reservado { background: rgba(255, 184, 77, 0.18); color: var(--warn); }
.pedido-pill.pagado    { background: rgba(43, 217, 122, 0.18); color: var(--success); }
.pedido-pill.expirado  { background: rgba(255, 94, 125, 0.18); color: var(--danger); }

.pedido-cliente {
  margin-top: 6px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pedido-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.mini {
  font-size: 12px;
  padding: 6px 11px;
}
.btn-ghost.mini.danger { color: var(--danger); border-color: rgba(255, 94, 125, 0.3); }

@media (max-width: 720px) {
  .pedido-card {
    grid-template-columns: 56px 1fr;
    grid-template-rows: auto auto;
  }
  .pedido-img { width: 56px; height: 56px; }
  .pedido-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .pedido-head strong { max-width: 100%; white-space: normal; }
}

/* ───── Inventariar (visión + Amazon CSE) ───────────────────── */

.inventariar-section { padding: 0 16px 24px; max-width: 1280px; margin: 0 auto; }

.inventariar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 14px;
}
.inventariar-filters { display: flex; gap: 8px; flex-wrap: wrap; }

.inv-list { display: flex; flex-direction: column; gap: 10px; }

.inv-scan-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.inv-scan-head {
  display: grid;
  grid-template-columns: 80px 1fr auto auto auto;
  gap: 8px;
  padding: 12px 14px;
  cursor: pointer;
  align-items: center;
  transition: background .15s;
}
.inv-scan-head:hover { background: rgba(0, 224, 255, 0.04); }
.inv-scan-reproc { font-size: 14px !important; padding: 6px 9px !important; }

.inv-scan-thumb {
  width: 80px; height: 80px;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.inv-scan-thumb img { width: 100%; height: 100%; object-fit: cover; }

.inv-scan-meta { min-width: 0; }
.inv-scan-title {
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  margin-bottom: 4px;
}

.inv-scan-toggle { font-size: 20px; color: var(--muted); }

.inv-scan-body {
  border-top: 1px solid var(--line);
  background: var(--bg-3);
}

.inv-cand-row {
  display: grid;
  grid-template-columns: 1.6fr 2fr auto auto;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.inv-cand-row:last-child { border-bottom: none; }

.inv-cand-prod {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}
.inv-cand-thumb {
  width: 44px; height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-2);
}
.inv-cand-marca {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-cand-asin {
  min-width: 0;
  font-size: 13px;
}
.inv-cand-asin a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inv-cand-asin code {
  background: var(--bg-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}

.inv-cand-estado { white-space: nowrap; }

.inv-cand-acts { display: flex; gap: 5px; flex-wrap: nowrap; }
.inv-cand-acts button[disabled] { opacity: 0.4; cursor: not-allowed; }

/* pill: estados de scan */
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.pill.pendiente { background: rgba(255, 184, 77, 0.18); color: var(--warn); }
.pill.procesado { background: rgba(43, 217, 122, 0.18); color: var(--success); }
.pill.error     { background: rgba(255, 94, 125, 0.18); color: var(--danger); }

@media (max-width: 720px) {
  .inv-scan-head { grid-template-columns: 56px 1fr auto; }
  .inv-scan-thumb { width: 56px; height: 56px; }
  .inv-cand-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .inv-cand-acts { justify-content: flex-end; flex-wrap: wrap; }
}
