*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface2: #f0ede8;
  --border: rgba(0,0,0,0.1);
  --border-strong: rgba(0,0,0,0.2);
  --text: #1a1916;
  --text-muted: #6b6860;
  --text-faint: #9e9b94;
  --green-bg: #eaf3de;
  --green-text: #3b6d11;
  --green-border: #c0dd97;
  --amber-bg: #faeeda;
  --amber-text: #854f0b;
  --amber-border: #fac775;
  --red-bg: #fcebeb;
  --red-text: #a32d2d;
  --red-border: #f7c1c1;
  --blue-bg: #e6f1fb;
  --blue-text: #185fa5;
  --purple-bg: #eeedfe;
  --purple-text: #534ab7;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

/* Dark theme — same warm, slightly-cream character as the light palette,
   just inverted, rather than a stark pure-black scheme. Toggled by setting
   data-theme="dark" on <html> (see VP.setTheme in common.js). */
/* Always reserve room for the vertical scrollbar. Without this, pages
   paint short (heading + "Cargando...") with no scrollbar, then grow tall
   once data renders -- the scrollbar appears, the viewport narrows by its
   width, and every centred .vp-shell slides left. Reserving the gutter up
   front means its arrival changes nothing. */
html { scrollbar-gutter: stable; }

html[data-theme="dark"] {
  --bg: #171614;
  --surface: #211f1c;
  --surface2: #2a2825;
  --border: rgba(255,255,255,0.09);
  --border-strong: rgba(255,255,255,0.18);
  --text: #f0eee9;
  --text-muted: #ada99f;
  --text-faint: #7c7870;
  --green-bg: #1e2a15;
  --green-text: #9bd66b;
  --green-border: #3b5527;
  --amber-bg: #332310;
  --amber-text: #eab765;
  --amber-border: #5c4620;
  --red-bg: #331b1b;
  --red-text: #ef8f8f;
  --red-border: #5c2f2f;
  --blue-bg: #16232f;
  --blue-text: #7fb8e8;
  --purple-bg: #211f38;
  --purple-text: #a79ce8;
}

body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; font-size: 15px; }

/* Reserves the same space the nav bar (56px, see .vp-nav) occupies once
   mountNav() inserts it via JS on every page. Without this, each page
   briefly renders with .vp-shell content flush at the very top, then
   visibly jumps down the instant the nav is mounted -- this removes that
   jump by reserving the space up front, before JS runs. !important wins
   over .vp-shell's own margin: 0 auto shorthand reliably regardless of
   cascade order. */

.app-layout { display: grid; grid-template-columns: 300px 1fr; grid-template-rows: auto 1fr; min-height: 100vh; max-width: 1400px; margin: 0 auto; }

.app-header { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; border-bottom: 0.5px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 50; }

.app-logo { font-size: 16px; font-weight: 600; letter-spacing: -0.3px; color: black; }
.app-logo span { font-weight: 400; color: var(--text-muted); }
.app-logo-sandbox { color: red; }

.header-right { display: flex; align-items: center; gap: 10px; }

.search-wrap { position: relative; }
.search-input { padding: 7px 11px 7px 32px; font-size: 13px; border: 0.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-family: inherit; width: 220px; transition: all 0.15s; }
.search-input:focus { outline: none; width: 280px; border-color: var(--text-muted); background: var(--surface); }
.search-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }

.search-clear-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: var(--text-faint); border: none; border-radius: 50%; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--surface); padding: 0; transition: background 0.15s; }
.search-clear-btn:hover { background: var(--text-muted); }

.bulk-item-row { border: 0.5px solid var(--border); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 8px; background: var(--surface); }
.bulk-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.bulk-item-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); }

.sort-select { padding: 6px 10px; font-size: 13px; border: 0.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-family: inherit; cursor: pointer; }
.sort-select:focus { outline: none; }

.refresh-btn { background: none; border: 0.5px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; cursor: pointer; color: var(--text-muted); font-size: 13px; display: flex; align-items: center; gap: 5px; font-family: inherit; transition: all 0.15s; }
.refresh-btn:hover { background: var(--surface2); color: var(--text); }
.refresh-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.refresh-btn:disabled:hover { background: none; color: var(--text-muted); }

.sidebar { padding: 1.25rem; border-right: 0.5px solid var(--border); background: var(--surface); position: sticky; top: 57px; height: calc(100vh - 57px); overflow-y: auto; }

.new-order-card { background: var(--bg); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; }

.card-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.7px; color: var(--text-faint); margin-bottom: 12px; }

.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; position: relative; }
.form-group label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.form-group input, .form-group select { padding: 7px 10px; font-size: 13px; border: 0.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-family: inherit; transition: border-color 0.15s; width: 100%; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--text-muted); }

.autocomplete-list { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border: 0.5px solid var(--border-strong); border-radius: var(--radius-sm); z-index: 200; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,0.1); margin-top: 2px; }
.autocomplete-item { padding: 8px 10px; font-size: 13px; cursor: pointer; color: var(--text); display: flex; align-items: center; justify-content: space-between; transition: background 0.1s; }
.autocomplete-item:hover { background: var(--surface2); }
.autocomplete-freq { font-size: 11px; color: var(--text-faint); }

.add-bulk-btn { width: 100%; margin-top: 4px; margin-bottom: 8px; justify-content: center; color: var(--text-muted); font-size: 12px; border-style: dashed; }
.add-bulk-btn:hover { color: var(--text); background: var(--surface2); }

.form-actions { margin-top: 4px; }

.btn { padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; cursor: pointer; border: 0.5px solid var(--border-strong); background: var(--surface); color: var(--text); font-family: inherit; transition: all 0.15s; display: inline-flex; align-items: center; gap: 5px; }
.btn:hover { background: var(--surface2); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-block { width: 100%; justify-content: center; }
.btn-primary { background: var(--text); color: var(--surface); border-color: var(--text); }
.btn-primary:hover { opacity: 0.85; background: var(--text); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-xs { padding: 3px 7px; font-size: 11px; }
.btn-pagado { background: var(--green-bg); color: var(--green-text); border-color: var(--green-border); }
.btn-pagado:hover { background: var(--green-border); }
.btn-enviado { background: #3a3a3a; color: var(--surface); border-color: #3a3a3a; }
.btn-enviado:hover { opacity: 0.85; background: #3a3a3a; }
html[data-theme="dark"] .btn-enviado { background: #a09c92; color: #171614; border-color: #8f8b82; }
html[data-theme="dark"] .btn-enviado:hover { background: #a09c92; opacity: 1; }
.btn-undo { background: var(--surface2); color: var(--text-muted); border-color: var(--border); }
.btn-undo:hover { background: var(--amber-bg); color: var(--amber-text); }
.btn-danger { background: var(--red-bg); color: var(--red-text); border-color: var(--red-border); }
.btn-danger:hover { background: var(--red-border); }
.btn-edit { background: var(--blue-bg); color: var(--blue-text); border-color: #b5d4f4; }
.btn-edit:hover { background: #b5d4f4; }
.btn-add-quick { background: var(--green-bg); color: var(--green-text); border-color: var(--green-border); }
.btn-add-quick:hover { background: var(--green-border); }

.main-content { padding: 1.5rem; overflow-y: auto; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 1.5rem; }
.stat { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
.stat-value { font-size: 20px; font-weight: 600; color: var(--text); letter-spacing: -0.5px; }
.stat-value.danger { color: var(--red-text); }
.stat-value.warn { color: var(--amber-text); }
.stat-sub { font-size: 11px; color: var(--text-faint); margin-top: 3px; }

.tabs { display: flex; gap: 3px; background: var(--surface2); border-radius: var(--radius-md); padding: 3px; margin-bottom: 1.5rem; }
.tab { flex: 1; padding: 8px 6px; font-size: 13px; border: none; background: transparent; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-muted); font-family: inherit; font-weight: 400; transition: all 0.15s; display: flex; align-items: center; justify-content: center; gap: 5px; }
.tab.active { background: var(--surface); color: var(--text); font-weight: 500; border: 0.5px solid var(--border); }
.tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 20px; font-size: 11px; background: var(--surface2); color: var(--text-muted); }
.tab-badge.has-items { background: var(--red-bg); color: var(--red-text); }

.section-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.7px; color: var(--text-faint); margin-bottom: 10px; }

.customer-group { margin-bottom: 1.25rem; }
.customer-header { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); margin-bottom: 5px; background: var(--surface2); }
.customer-header--unnamed { background: var(--red-bg); border: 1px solid var(--red-border); }
.customer-header--unnamed .customer-name { color: var(--red-text); }
.customer-header[data-tiktok-ready="true"] { background: #e8f5e2; }
.customer-group[data-tiktok-ready="true"] { background: #f4faf1; }
html[data-theme="dark"] .customer-header[data-tiktok-ready="true"] { background: var(--green-bg); border: 1px solid var(--green-border); }
html[data-theme="dark"] .customer-group[data-tiktok-ready="true"] { background: rgba(155,214,107,0.05); }
html[data-theme="dark"] .notas-link { color: var(--blue-text); }
.customer-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--blue-bg); color: var(--blue-text); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.customer-name { font-size: 13px; font-weight: 600; }
.shipment-count { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.customer-owed { font-size: 12px; color: var(--text-muted); }
.customer-bulk-actions { margin-left: auto; display: flex; gap: 5px; }

/* ORDER ROW — fixed layout so hover buttons don't shift anything */
.order-row {
  display: grid;
  grid-template-columns: 1fr 80px auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 3px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  position: relative;
}
.order-row.overdue-unpaid { background: var(--red-bg); border-color: var(--red-border); }
.order-row.overdue-paid { background: var(--amber-bg); border-color: var(--amber-border); }
.order-row.shipped-row { opacity: 0.5; }

.order-userline { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.order-username { font-size: 12px; font-weight: 600; cursor: pointer; }
.order-username:hover { text-decoration: underline; }
.channel-tag { font-size: 10px; padding: 2px 7px; border-radius: 8px; font-weight: 600; }
.channel-tiktok { background: var(--blue-bg); color: var(--blue-text); }
.channel-shopify { background: var(--green-bg); color: var(--green-text); }
.channel-manual { background: var(--amber-bg); color: var(--amber-text); }

.order-producto { font-size: 13px; font-weight: 500; white-space: pre-line; }
.order-meta { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

/* Hover zone — fixed width so it never causes reflow */
.row-hover-zone {
  display: flex;
  gap: 4px;
  align-items: center;
  width: 80px;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.row-hover-zone.visible { opacity: 1; pointer-events: auto; }

.order-precio { font-size: 13px; font-weight: 600; white-space: nowrap; text-align: right; }

.status-pill { font-size: 11px; padding: 3px 9px; border-radius: 20px; white-space: nowrap; font-weight: 500; }
.pill-nopagado { background: var(--amber-bg); color: var(--amber-text); }
.pill-pagado { background: var(--green-bg); color: var(--green-text); }
.pill-enviado { background: var(--surface2); color: var(--text-faint); border: 0.5px solid var(--border); }
.pill-anotado { background: var(--purple-bg); color: var(--purple-text); }

/* ── Status modal (bulk + single) ── */
.scm-modal { width: 600px; max-width: calc(100vw - 24px); }
.scm-half { border: 0.5px solid var(--border); border-radius: var(--radius-md); padding: 12px; margin-bottom: 12px; }
.scm-half-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); margin-bottom: 4px; }
.scm-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.scm-bulk { background: var(--surface2); }
.scm-bulk.is-disabled { opacity: 0.55; }
.scm-bulk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.scm-bulk-btn { padding: 8px 12px; font-size: 13px; font-weight: 500; border-radius: var(--radius-sm); border: 0.5px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; font-family: inherit; white-space: nowrap; }
.scm-bulk-btn:hover:not(:disabled) { background: var(--bg); }
.scm-bulk-btn:disabled { cursor: not-allowed; }
.scm-bulk-btn.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.scm-bulk-anotado { display: flex; flex: 1; min-width: 220px; border: 0.5px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.scm-bulk-anotado .scm-bulk-btn { border: none; border-radius: 0; border-right: 0.5px solid var(--border); }
.scm-bulk-ship { flex: 1; min-width: 0; border: none; background: transparent; font-size: 12px; padding: 0 8px; color: var(--text); font-family: inherit; }
.scm-row-list { display: flex; flex-direction: column; max-height: 340px; overflow-y: auto; }
.scm-row { padding: 9px 2px; border-top: 0.5px solid var(--border); }
.scm-row:first-child { border-top: none; }
.scm-row-top { display: flex; align-items: center; gap: 8px; }
.scm-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.scm-row-title { font-size: 13px; }
.scm-row-meta { font-size: 11px; color: var(--text-faint); }
.scm-arrow { color: var(--text-faint); font-size: 13px; }
.scm-chip { font-size: 12px; font-weight: 500; padding: 5px 8px; border-radius: var(--radius-sm); border: 0.5px solid var(--border-strong); background: var(--surface); color: var(--text-muted); font-family: inherit; max-width: 200px; cursor: pointer; }
.scm-chip--pagado { background: var(--green-bg); color: var(--green-text); border-color: var(--green-border); }
.scm-chip--nopagado { background: var(--amber-bg); color: var(--amber-text); border-color: var(--amber-border); }
.scm-chip--anotado { background: var(--purple-bg); color: var(--purple-text); border-color: var(--purple-text); }
.scm-chip--enviado { background: var(--blue-bg); color: var(--blue-text); border-color: var(--blue-text); }
.scm-row-warn { font-size: 11px; color: var(--amber-text); margin-top: 4px; text-align: right; }
.scm-summary { font-size: 12px; color: var(--amber-text); background: var(--amber-bg); border: 0.5px solid var(--amber-border); border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 12px; }
@media (max-width: 520px) {
  .scm-row-top { flex-wrap: wrap; }
  .scm-row-main { flex-basis: 100%; }
  .scm-arrow { margin-left: auto; }
  .scm-chip { max-width: 60%; }
}

.order-actions { display: flex; gap: 4px; min-width: 75px; justify-content: flex-end; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-faint); font-size: 14px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 500; display: flex; align-items: center; justify-content: center; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 360px;
  max-width: 90vw;
  max-height: 80vh;
  border: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-title {
  flex-shrink: 0;
}

.modal-body {
  flex-shrink: 0;
}

.modal-actions {
  flex-shrink: 0;
}
.modal-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.modal-body { font-size: 13px; color: var(--text-muted); margin-bottom: 1.25rem; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.edit-form { display: grid; gap: 8px; margin-bottom: 1rem; }
.edit-form input, .edit-form select, .edit-form textarea { padding: 7px 10px; font-size: 13px; border: 0.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-family: inherit; width: 100%; resize: vertical; }
.edit-form input:focus, .edit-form select:focus, .edit-form textarea:focus { outline: none; border-color: var(--text-muted); }

.status-options { display: flex; flex-direction: column; gap: 6px; margin-bottom: 1rem; }

.bulk-status-modal { width: 400px; }
.status-pills { display: flex; gap: 6px; margin-bottom: 1rem; }
.status-pill-toggle { flex: 1; padding: 7px 10px; font-size: 12px; font-weight: 500; border-radius: 20px; border: 0.5px solid var(--border-strong); background: var(--surface); color: var(--text-muted); cursor: pointer; font-family: inherit; transition: all 0.15s; }
.status-pill-toggle:hover { background: var(--surface2); }
.status-pill-toggle.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.bulk-order-list { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; margin-bottom: 1rem; }
.bulk-order-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 0.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; }
.bulk-order-product { flex: 1; }
.btn-primary:disabled { background: var(--surface2); color: var(--text-faint); border-color: var(--border); cursor: not-allowed; opacity: 1; }

.customer-history-modal { width: 420px; }
.customer-history-list { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 1rem; }
.history-row { border: 0.5px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; }
.history-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.history-row-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }

.search-results-section { margin-bottom: 1.5rem; }
.search-divider { display: flex; align-items: center; gap: 10px; margin: 1rem 0; color: var(--text-faint); font-size: 12px; }
.search-divider::before, .search-divider::after { content: ''; flex: 1; height: 0.5px; background: var(--border); }

.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.analytics-card { background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.analytics-card-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.7px; color: var(--text-faint); margin-bottom: 1rem; }
.analytics-big { font-size: 28px; font-weight: 600; letter-spacing: -1px; color: var(--text); margin-bottom: 4px; }
.analytics-sub { font-size: 12px; color: var(--text-muted); }
.top-client-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 0.5px solid var(--border); font-size: 13px; }
.top-client-row:last-child { border-bottom: none; }
.top-client-name { font-weight: 500; }
.top-client-val { color: var(--text-muted); font-size: 12px; }

/* QC History tab */
.qc-history-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 0.5px solid var(--border); border-radius: var(--radius-lg);
  padding: 12px; margin-bottom: 8px;
}
.qc-history-thumbs { display: flex; gap: 6px; flex-shrink: 0; }
.qc-history-thumbs img {
  width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-sm);
  cursor: pointer; border: 0.5px solid var(--border);
}
.qc-history-more {
  width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  background: var(--surface2); border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; color: var(--text-muted);
}
.qc-history-nophoto {
  width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  background: var(--surface2); border-radius: var(--radius-sm); font-size: 10px; color: var(--text-faint); text-align: center; padding: 4px;
}
.qc-history-info { flex: 1; min-width: 0; }
.qc-history-username { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.qc-history-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.top-client-amount { font-weight: 600; }
.pending-breakdown { display: flex; flex-direction: column; gap: 8px; }
.breakdown-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.breakdown-label { color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.breakdown-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(10px); background: var(--text); color: var(--surface); padding: 10px 20px; border-radius: var(--radius-md); font-size: 13px; font-weight: 500; opacity: 0; transition: all 0.2s; pointer-events: none; white-space: nowrap; z-index: 999; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.spinning { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.client-list-card {
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
  height: 220px;
  display: flex;
  flex-direction: column;
}

.client-list-scroll {
  overflow-y: auto;
  flex: 1;
  margin-top: 8px;
}

.client-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
}

.client-list-item:hover {
  background: var(--surface2);
}

.client-list-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue-bg);
  color: var(--blue-text);
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.client-list-name {
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-list-count {
  font-size: 11px;
  color: var(--text-faint);
  flex-shrink: 0;
}
/* ============================================================================
   Vel Papier — shell, landing, analytics, charts
   ----------------------------------------------------------------------------
   Type: DM Sans carries the UI (unchanged). Fraunces carries display numbers
   and headings only — its soft terminals echo the brushed wordmark, where a
   high-contrast Didone would fight it.
   Structure: wide-tracked uppercase micro-labels. Lifted straight from the
   logo's own tagline lockup (S e l e c c i o n a d o  p a r a  t i), so
   section boundaries are marked in the brand's own voice.
   ==========================================================================*/

:root {
  --track-wide: 0.18em;
  --display: 'Fraunces', Georgia, serif;
  --shadow-card: 0 1px 2px rgba(26,25,22,.04), 0 6px 16px -8px rgba(26,25,22,.10);
  --shadow-lift: 0 2px 4px rgba(26,25,22,.05), 0 14px 28px -12px rgba(26,25,22,.18);
}

/* ── Persistent top bar ─────────────────────────────────────────────── */

/* Fixed, not sticky: the nav is inserted by mountNav() *after* first
   paint, so while it was in normal flow every page visibly dropped 56px
   the moment JS ran. Taking it out of flow means it can never shift
   anything -- the 56px it needs is reserved up front by body's padding-top
   (declared inline in each page's <head> so it applies at first paint,
   before style.css has even downloaded). Both numbers are 56px: change
   one, change the other. */
.vp-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.5rem;
  height: 56px;
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
}

.vp-nav-mark {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1.1;
}
.vp-nav-mark-name {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.2px;
  color: var(--text);
}
.vp-nav-mark-sub {
  font-size: 8.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  color: var(--text-faint);
}

.vp-nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.vp-nav-links::-webkit-scrollbar { display: none; }

.vp-nav-link {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.vp-nav-link:hover { background: var(--surface2); color: var(--text); }
.vp-nav-link.is-active { background: var(--text); color: var(--surface); }
.vp-nav-link:focus-visible { outline: 2px solid var(--blue-text); outline-offset: 2px; }

/* Persistent "pedidos de Shopify esperando confirmar cliente" count, shown
   on the Pedidos nav link from every page. Deliberately styled like an
   urgent notification badge (not the muted grey of .tab-badge) since the
   whole point is that it should be hard to miss, anywhere in the app. */
.vp-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  margin-left: 5px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--red-bg);
  color: var(--red-text);
  border: 0.5px solid var(--red-border);
  vertical-align: middle;
}

.vp-nav-theme-toggle {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
}
.vp-nav-theme-toggle:hover { background: var(--surface2); color: var(--text); }
.vp-nav-theme-toggle:focus-visible { outline: 2px solid var(--blue-text); outline-offset: 2px; }
.vp-nav-theme-toggle svg { position: absolute; transition: opacity .15s, transform .15s; }
.vp-nav-theme-toggle .vp-theme-icon-moon { opacity: 0; transform: scale(.6) rotate(-90deg); }
.vp-nav-theme-toggle .vp-theme-icon-sun { opacity: 1; transform: scale(1) rotate(0); }
.vp-nav-theme-toggle.is-dark .vp-theme-icon-sun { opacity: 0; transform: scale(.6) rotate(90deg); }
.vp-nav-theme-toggle.is-dark .vp-theme-icon-moon { opacity: 1; transform: scale(1) rotate(0); }

/* ── Page shell for the new pages ───────────────────────────────────── */

.vp-shell { max-width: 1180px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.vp-shell--wide { max-width: 1360px; }

.vp-eyebrow {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  color: var(--text-faint);
  margin-bottom: 12px;
}

.vp-section { margin-top: 2.75rem; }
.vp-section:first-of-type { margin-top: 0; }

.vp-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 0.5px solid var(--border);
}
.vp-section-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.3px;
}
.vp-section-note { font-size: 12px; color: var(--text-faint); }

/* ── Landing hero ───────────────────────────────────────────────────── */

.vp-hero {
  position: relative;
  padding: 2.25rem 0 2rem;
  overflow: hidden;
}
.vp-hero-greet {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 5vw, 46px);
  letter-spacing: -1.2px;
  line-height: 1.05;
  color: var(--text);
}
.vp-hero-greet strong { font-weight: 600; }
.vp-hero-date {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  color: var(--text-faint);
}
.vp-hero-line {
  margin-top: 18px;
  font-size: 15px;
  color: var(--text-muted);
  max-width: 46ch;
  line-height: 1.55;
}
.vp-hero-line b { color: var(--text); font-weight: 600; }

.vp-hero-tulip {
  position: absolute;
  right: -14px;
  top: -6px;
  width: 168px;
  height: auto;
  opacity: .22;
  color: var(--green-text);
  pointer-events: none;
}

/* ── Stat cards ─────────────────────────────────────────────────────── */

.vp-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.vp-stat {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}
.vp-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  color: var(--text-faint);
}
.vp-stat-value {
  font-family: var(--display);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-top: 8px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.vp-stat-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  min-height: 26px;
}
.vp-stat-delta { font-size: 12px; font-weight: 600; white-space: nowrap; }
.vp-stat-delta.up { color: var(--green-text); }
.vp-stat-delta.down { color: var(--red-text); }
.vp-stat-delta.flat { color: var(--text-faint); font-weight: 500; }
.vp-stat-sub { font-size: 11px; color: var(--text-faint); }

.vp-spark { width: 96px; height: 26px; flex-shrink: 0; }

/* ── Hub cards — the signature. Index cards pulled from a tray. ─────── */

.vp-hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 14px;
}

.vp-hub-card {
  position: relative;
  display: block;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 18px 18px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s, border-color .18s;
}
/* the tab edge */
.vp-hub-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--tab, var(--text-faint));
}
.vp-hub-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--border-strong);
}
.vp-hub-card:focus-visible { outline: 2px solid var(--blue-text); outline-offset: 3px; }

.vp-hub-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: var(--surface2);
  color: var(--tab, var(--text-muted));
  margin-bottom: 14px;
}
.vp-hub-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.3px;
  margin-bottom: 5px;
}
.vp-hub-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.vp-hub-go {
  margin-top: 14px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--track-wide);
  color: var(--text-faint);
  display: flex; align-items: center; gap: 5px;
  transition: color .15s, gap .15s;
}
.vp-hub-card:hover .vp-hub-go { color: var(--tab, var(--text)); gap: 9px; }

/* ── Attention list ─────────────────────────────────────────────────── */

.vp-alerts { display: flex; flex-direction: column; gap: 8px; }
.vp-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: background .15s, border-color .15s;
}
.vp-alert:hover { background: var(--surface2); border-color: var(--border-strong); }
.vp-alert-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.vp-alert-text { flex: 1; font-size: 13.5px; }
.vp-alert-text b { font-weight: 600; }
.vp-alert-count {
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.vp-alert--ok { border-style: dashed; background: transparent; }
.vp-alert--ok .vp-alert-text { color: var(--text-muted); }

/* ── Panels & charts ────────────────────────────────────────────────── */

.vp-panel {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
}
.vp-panel-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.vp-panel-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-wide); color: var(--text-faint);
}
.vp-panel-note { font-size: 11px; color: var(--text-faint); }

.vp-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.vp-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }

.vp-chart-host { width: 100%; }
.vp-chart { width: 100%; height: auto; display: block; overflow: visible; }
.vp-chart-axis { font-size: 10px; fill: var(--text-faint); font-family: 'DM Sans', sans-serif; }
.vp-donut { width: 168px; height: 168px; display: block; margin: 0 auto; }
.vp-donut-top { font-family: 'Fraunces', Georgia, serif; font-size: 19px; font-weight: 600; fill: var(--text); }
.vp-donut-sub { font-size: 9.5px; fill: var(--text-faint); font-family: 'DM Sans', sans-serif;
                text-transform: uppercase; letter-spacing: .1em; }

.vp-empty-sm { font-size: 12.5px; color: var(--text-faint); padding: 1.5rem 0; text-align: center; }

/* legend */
.vp-legend { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.vp-legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.vp-legend-dot { width: 9px; height: 9px; border-radius: 2.5px; flex-shrink: 0; }
.vp-legend-name { flex: 1; color: var(--text-muted); }
.vp-legend-val { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ranked bars */
.vp-rank { display: flex; flex-direction: column; gap: 11px; }
.vp-rank-row { display: flex; gap: 10px; align-items: flex-start; }
.vp-rank-idx {
  font-family: var(--display); font-size: 12px; font-weight: 600;
  color: var(--text-faint); width: 16px; text-align: right; flex-shrink: 0;
  line-height: 1.5; font-variant-numeric: tabular-nums;
}
.vp-rank-body { flex: 1; min-width: 0; }
.vp-rank-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.vp-rank-label {
  font-size: 13px; font-weight: 500; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.vp-rank-val { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vp-rank-track { height: 5px; border-radius: 3px; background: var(--surface2); margin-top: 5px; overflow: hidden; }
.vp-rank-fill { height: 100%; border-radius: 3px; opacity: .85; }
.vp-rank-sub { font-size: 11px; color: var(--text-faint); margin-top: 3px; }

/* funnel */
.vp-funnel { display: flex; flex-direction: column; gap: 13px; }
.vp-funnel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.vp-funnel-label { font-size: 13px; font-weight: 500; }
.vp-funnel-val { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.vp-funnel-val em { font-style: normal; font-weight: 500; color: var(--text-faint); font-size: 11px; margin-left: 6px; }
.vp-funnel-track { height: 9px; border-radius: 5px; background: var(--surface2); margin-top: 6px; overflow: hidden; }
.vp-funnel-fill { height: 100%; border-radius: 5px; opacity: .88; }

/* data table */
.vp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.vp-table th {
  text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-wide); color: var(--text-faint);
  padding: 0 10px 9px; border-bottom: 0.5px solid var(--border);
}
.vp-table th.num, .vp-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.vp-table td { padding: 9px 10px; border-bottom: 0.5px solid var(--border); }
.vp-table tr:last-child td { border-bottom: none; }
.vp-table tbody tr:hover { background: var(--surface2); }
.vp-table-name { font-weight: 500; }

/* period switch */
.vp-period { display: flex; gap: 3px; background: var(--surface2); border-radius: var(--radius-md); padding: 3px; }
.vp-period-btn {
  padding: 6px 13px; font-size: 12.5px; border: none; background: transparent;
  border-radius: var(--radius-sm); cursor: pointer; color: var(--text-muted);
  font-family: inherit; font-weight: 500; transition: all .15s; white-space: nowrap;
}
.vp-period-btn:hover { color: var(--text); }
.vp-period-btn.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }

/* ── QC history (calidad.html) ──────────────────────────────────────── */

.vp-qc-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.vp-input {
  padding: 8px 12px; font-size: 13px; border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  font-family: inherit;
}
.vp-input:focus { outline: none; border-color: var(--text-muted); }

.vp-qc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; align-items: start; }

.vp-qc-card {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card);
  transition: box-shadow .18s, transform .18s;
}
.vp-qc-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.vp-qc-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--surface2); }
.vp-qc-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; cursor: pointer; display: block; }
.vp-qc-photos-more {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2); color: var(--text-muted); font-size: 13px; font-weight: 600;
  aspect-ratio: 1; cursor: pointer;
}
.vp-qc-nophoto {
  grid-column: 1 / -1; aspect-ratio: 3; display: flex; align-items: center;
  justify-content: center; color: var(--text-faint); font-size: 12px; background: var(--surface2);
}
.vp-qc-body { padding: 13px 14px 14px; }
.vp-qc-user { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.vp-qc-meta { font-size: 11.5px; color: var(--text-muted); line-height: 1.55; }
.vp-qc-meta code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px; background: var(--surface2); padding: 1px 5px; border-radius: 4px;
}
.vp-qc-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.vp-qc-tag {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 20px;
  background: var(--surface2); color: var(--text-muted);
}
.vp-qc-tag.tiktok { background: var(--blue-bg); color: var(--blue-text); }
.vp-qc-tag.shopify { background: var(--green-bg); color: var(--green-text); }
.vp-qc-tag.manual { background: var(--amber-bg); color: var(--amber-text); }

/* session accordion */
.vp-sess { border: 0.5px solid var(--border); border-radius: var(--radius-lg);
           background: var(--surface); margin-bottom: 8px; overflow: hidden; }
.vp-sess-head {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  cursor: pointer; background: none; border: none; width: 100%;
  font-family: inherit; text-align: left; color: inherit;
}
.vp-sess-head:hover { background: var(--surface2); }
.vp-sess-id { font-weight: 600; font-size: 13.5px; }
.vp-sess-when { font-size: 11.5px; color: var(--text-faint); }
.vp-sess-stats { margin-left: auto; display: flex; gap: 18px; align-items: center; }
.vp-sess-stat { text-align: right; }
.vp-sess-stat-v { font-family: var(--display); font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.vp-sess-stat-l { font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-faint); }
.vp-sess-chev { color: var(--text-faint); transition: transform .2s; }
.vp-sess.is-open .vp-sess-chev { transform: rotate(90deg); }
.vp-sess-body { padding: 0 16px 16px; }

/* lightbox */
.vp-lightbox {
  position: fixed; inset: 0; background: rgba(20,19,17,.92); z-index: 900;
  display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out;
}
.vp-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }

/* generic modal */
.vp-modal-overlay {
  position: fixed; inset: 0; background: rgba(20,19,17,.72); z-index: 900;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.vp-modal-card {
  position: relative; width: 100%; max-height: 84vh; overflow-y: auto;
  background: var(--surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); padding: 24px;
}
.vp-modal-close {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
  border: none; background: var(--surface2); border-radius: 50%; color: var(--text);
  font-size: 20px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.vp-modal-close:hover { background: var(--border); }
.vp-table-row-clickable { cursor: pointer; }
.vp-table-row-clickable:hover { background: var(--surface2); }

/* loading */
.vp-loading { display: flex; align-items: center; justify-content: center; gap: 10px;
              padding: 4rem 1rem; color: var(--text-faint); font-size: 13.5px; }
.vp-loading::before {
  content: ''; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--text-muted);
  animation: vp-spin .7s linear infinite;
}
@keyframes vp-spin { to { transform: rotate(360deg); } }

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .vp-nav { gap: .9rem; padding: 0 1rem; }
  .vp-nav-mark-sub { display: none; }
  .vp-shell { padding: 1.5rem 1rem 3rem; }
  .vp-hero { padding: 1.5rem 0 1.25rem; }
  .vp-hero-tulip { width: 78px; opacity: .12; }
  .vp-sess-stats { gap: 12px; }
  .vp-sess-head { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .vp-hub-card, .vp-qc-card, .vp-hub-go, .vp-sess-chev { transition: none; }
  .vp-hub-card:hover, .vp-qc-card:hover { transform: none; }
  .vp-loading::before { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════════════
   MERGE REVIEW MODAL + PENDING MATCH HINT
   Add this block anywhere in style.css (e.g. right after .modal-actions).
   ═══════════════════════════════════════════════════════════════════════ */

.merge-review-modal {
  width: 640px;
  max-width: 92vw;
  height: 560px;
  max-height: 85vh;
}

.merge-confidence {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface2);
  margin-bottom: 14px;
}

.merge-confidence-pct {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.merge-confidence-msg {
  font-size: 13px;
  color: var(--text-muted);
}

#merge-compare-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-bottom: 14px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
}

.compare-header {
  display: grid;
  grid-template-columns: 90px 1fr 1fr;
  gap: 10px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 0.5px solid var(--border);
  background: var(--surface2);
  position: sticky;
  top: 0;
}

.compare-row {
  display: grid;
  grid-template-columns: 90px 1fr 1fr;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  border-bottom: 0.5px solid var(--border);
  align-items: center;
}

.compare-row:last-child { border-bottom: none; }

.compare-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.compare-incoming, .compare-onfile {
  word-break: break-word;
  line-height: 1.35;
}

.compare-row.match-exact {
  background: var(--green-bg);
}
.compare-row.match-exact .compare-incoming,
.compare-row.match-exact .compare-onfile {
  color: var(--green-text);
  font-weight: 500;
}

.compare-row.match-partial {
  background: var(--amber-bg);
}
.compare-row.match-partial .compare-incoming,
.compare-row.match-partial .compare-onfile {
  color: var(--amber-text);
}

.compare-row.match-none .compare-incoming,
.compare-row.match-none .compare-onfile {
  color: var(--text-faint);
}

#merge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.pending-match-hint {
  font-size: 12px;
  color: var(--text-muted);
  padding: 3px 10px;
  background: var(--amber-bg);
  border-radius: 99px;
  white-space: nowrap;
}
.pending-match-hint strong {
  color: var(--amber-text);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.relink-picker-modal {
  width: 420px;
  max-width: 92vw;
  height: 480px;
  max-height: 80vh;
}

.relink-results {
  flex: 1;
  overflow-y: auto;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  min-height: 0;
}

.relink-option {
  padding: 9px 12px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 0.5px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.1s;
}

.relink-option:last-child { border-bottom: none; }

.relink-option:hover {
  background: var(--surface2);
}

.relink-option-id {
  font-size: 11px;
  color: var(--text-faint);
}

/* ═══════════════════════════════════════════════════════════════════════
   CALIDAD PAGE — sidebar filters, drawer on mobile, tiles/list views
   Add this block anywhere in style.css.
   ═══════════════════════════════════════════════════════════════════════ */

.cal-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.cal-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* The "Filtros" button only exists on narrow screens; on desktop the
   sidebar is permanently visible so the toggle would be meaningless. */
.cal-filter-toggle { display: none; }

.cal-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.cal-main { min-width: 0; }

.cal-sidebar {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 1rem;
}

.cal-sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cal-sidebar-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-faint);
}

/* Close button is drawer-only; hidden on desktop where there's nothing to close */
.cal-sidebar-close {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}

.cal-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cal-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.cal-field-hint {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.35;
}

.cal-field .vp-input { width: 100%; box-sizing: border-box; }

.cal-clear-btn { width: 100%; justify-content: center; }

/* ── Customer combo box ─────────────────────────────────────────────── */

.cal-combo { position: relative; }

.cal-combo-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  z-index: 40;
  box-shadow: 0 6px 20px rgba(0,0,0,0.10);
}

.cal-combo-list.is-open { display: block; }

.cal-combo-option {
  padding: 8px 11px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 0.5px solid var(--border);
}

.cal-combo-option:last-child { border-bottom: none; }
.cal-combo-option:hover { background: var(--surface2); }

/* ── List view ──────────────────────────────────────────────────────── */

.cal-list {
  display: flex;
  flex-direction: column;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

.cal-list-row {
  display: grid;
  grid-template-columns: 52px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 0.5px solid var(--border);
}

.cal-list-row:last-child { border-bottom: none; }
.cal-list-row:hover { background: var(--surface2); }

.cal-list-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--surface2);
}

.cal-list-thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 12px;
  cursor: default;
}

.cal-list-main { min-width: 0; }

.cal-list-user {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.cal-list-sub {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-list-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cal-list-when {
  font-size: 11px;
  color: var(--text-faint);
  text-align: right;
  white-space: nowrap;
}

.cal-list-photocount { color: var(--text-muted); }

.cal-sidebar-backdrop { display: none; }

/* ── Mobile / tablet: sidebar becomes a slide-in drawer ─────────────── */

@media (max-width: 900px) {
  .cal-filter-toggle { display: inline-flex; }

  .cal-layout { grid-template-columns: 1fr; }

  .cal-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    z-index: 600;
    border-radius: 0;
    border-right: 0.5px solid var(--border);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }

  .cal-sidebar.is-open { transform: translateX(0); }

  .cal-sidebar-close { display: block; }

  .cal-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 590;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  .cal-sidebar-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  /* Tags and timestamp stack under the main text on narrow screens
     rather than squeezing the username into nothing. */
  .cal-list-row {
    grid-template-columns: 44px 1fr;
    row-gap: 6px;
  }
  .cal-list-thumb { width: 44px; height: 44px; }
  .cal-list-tags,
  .cal-list-when {
    grid-column: 2;
    justify-content: flex-start;
    text-align: left;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   CALIDAD — pagination + order detail modal
   ═══════════════════════════════════════════════════════════════════════ */

.cal-pagination-slot:empty { display: none; }

.cal-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 2px;
}

.cal-pagination-range {
  font-size: 12px;
  color: var(--text-muted);
}

.cal-pagination-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cal-page-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  font-size: 13px;
  font-family: inherit;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.cal-page-btn:hover:not(:disabled) { background: var(--surface2); }
.cal-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.cal-page-btn.is-active {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}

.cal-page-ellipsis {
  padding: 0 4px;
  color: var(--text-faint);
  font-size: 13px;
}

.vp-qc-card, .cal-list-row { cursor: pointer; }
.vp-qc-photos img, .cal-list-thumb { cursor: zoom-in; }

.cal-detail-modal {
  width: 480px;
  max-width: 92vw;
  height: 560px;
  max-height: 85vh;
}

.cal-detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-bottom: 14px;
}

.cal-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--surface2);
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 14px;
}

.cal-detail-label {
  display: inline-block;
  min-width: 82px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-faint);
}

.cal-detail-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-faint);
  margin: 14px 0 8px;
}

.cal-detail-order {
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
}

.cal-detail-order-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--surface2);
  font-size: 12px;
}

.cal-detail-order-id { font-family: monospace; color: var(--text-muted); }
.cal-detail-order-price { font-weight: 600; }

.cal-detail-item {
  display: flex;
  gap: 8px;
  padding: 6px 12px;
  font-size: 13px;
  border-top: 0.5px solid var(--border);
}

.cal-detail-item span:first-child {
  color: var(--text-faint);
  min-width: 28px;
}

.cal-detail-item--empty { color: var(--text-faint); font-style: italic; }

.cal-detail-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.cal-detail-photos img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: zoom-in;
}

/* ═══════════════════════════════════════════════════════════════════════
   AJUSTES — settings page sections, cards, and the duplicate-customer tool
   ═══════════════════════════════════════════════════════════════════════ */

.aj-section { margin-bottom: 1.75rem; }

.aj-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.aj-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
}

.aj-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.aj-row-label { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.aj-row-hint { font-size: 12px; color: var(--text-muted); }

/* Duplicate-pair review cards */

.aj-dup-pair {
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
}

.aj-dup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: var(--surface2);
  font-size: 12px;
}

.aj-dup-score {
  font-weight: 700;
  color: var(--amber-text);
}

.aj-dup-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.aj-dup-side {
  padding: 10px 12px;
  font-size: 13px;
  border-right: 0.5px solid var(--border);
}
.aj-dup-side:last-child { border-right: none; }

.aj-dup-username { font-weight: 600; margin-bottom: 4px; }
.aj-dup-detail { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

.aj-dup-expand-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 6px 12px;
  background: none;
  border: none;
  border-top: 0.5px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
}
.aj-dup-expand-btn:hover { background: var(--surface2); color: var(--text); }

.aj-dup-expanded {
  border-top: 0.5px solid var(--border);
  background: var(--surface2);
  padding: 4px 0;
}

.aj-dup-field-row {
  display: grid;
  grid-template-columns: 90px 1fr 1fr;
  gap: 0;
  padding: 5px 12px;
  font-size: 12px;
  border-bottom: 0.5px solid var(--border);
}
.aj-dup-field-row:last-child { border-bottom: none; }

.aj-dup-field-label {
  color: var(--text-faint);
  font-weight: 500;
}

.aj-dup-field-val {
  color: var(--text-muted);
  padding: 0 6px;
  overflow-wrap: break-word;
}

.aj-dup-actions {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 0.5px solid var(--border);
  justify-content: flex-end;
}

/* ═══════════════════════════════════════════════════════════════════════
   AJUSTES — merge modal (wider than standard, for side-by-side comparison)
   ═══════════════════════════════════════════════════════════════════════ */

.aj-dup-threshold-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 4px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 4px;
}

.aj-dup-threshold-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.aj-dup-threshold-row input[type="range"] {
  flex: 1;
  min-width: 0;
}

.aj-dup-threshold-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  min-width: 34px;
  text-align: right;
  flex-shrink: 0;
}

.aj-dup-refresh-btn {
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 15px;
  line-height: 1;
}

.aj-merge-modal {
  width: 760px;
  max-width: 94vw;
  height: 620px;
  max-height: 88vh;
}

.aj-merge-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-bottom: 14px;
}

.aj-history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 0.5px solid var(--border);
  font-size: 13px;
}
.aj-history-row:last-child { border-bottom: none; }

.aj-history-main { display: flex; flex-direction: column; gap: 2px; }
.aj-history-arrow { font-weight: 500; }
.aj-history-date { font-size: 11px; color: var(--text-faint); }

/* ═══════════════════════════════════════════════════════════════════════
   AJUSTES — TikTok historical backfill modal
   ═══════════════════════════════════════════════════════════════════════ */

.aj-backfill-modal {
  width: 460px;
  max-width: 92vw;
  height: auto;
  max-height: 80vh;
}

.aj-backfill-title {
  text-align: center;
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 14px;
}

.aj-backfill-intro {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 16px;
  text-align: center;
}

.aj-backfill-dropzone {
  display: block;
  margin-bottom: 20px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.aj-backfill-dropzone:hover,
.aj-backfill-dropzone.is-dragover {
  border-color: var(--text-muted);
  background: var(--surface2);
}
.aj-backfill-dropzone input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.aj-backfill-dropzone-icon { font-size: 26px; margin-bottom: 8px; }
.aj-backfill-dropzone-label { font-size: 13.5px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.aj-backfill-dropzone-hint { font-size: 12px; color: var(--text-faint); }

.aj-backfill-stats {
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
}

.aj-backfill-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  font-size: 13px;
  border-bottom: 0.5px solid var(--border);
  background: var(--surface);
}
.aj-backfill-stat-row:last-child { border-bottom: none; }
.aj-backfill-stat-row.is-highlight { background: var(--surface2); }
.aj-backfill-stat-label { color: var(--text-muted); }
.aj-backfill-stat-value { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

.aj-backfill-note {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.5;
  margin: 0 0 4px;
}

.aj-backfill-success {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--green-text);
  padding: 4px 0 16px;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════════════
   AJUSTES — product duplicate-merger modal
   ═══════════════════════════════════════════════════════════════════════ */

.aj-prod-keeper-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.aj-prod-keeper-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--surface);
}
.aj-prod-keeper-card:hover { border-color: var(--text-muted); }
.aj-prod-keeper-card.is-selected {
  border-color: var(--green-text);
  background: var(--surface2);
}
.aj-prod-keeper-card.is-unselected { opacity: 0.45; }

.aj-prod-keeper-name { font-weight: 600; font-size: 13.5px; margin-bottom: 2px; }
.aj-prod-keeper-hint { font-size: 11px; color: var(--text-faint); }
.aj-prod-keeper-badge {
  display: inline-block;
  margin-top: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--green-text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.aj-prod-variant-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 4px 0 8px;
}

.aj-prod-variant-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 12.5px;
}

.aj-prod-variant-name { overflow-wrap: break-word; }
.aj-prod-variant-arrow { color: var(--text-faint); font-size: 14px; text-align: center; }

.aj-prod-variant-select {
  padding: 6px 8px;
  font-size: 12.5px;
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  width: 100%;
}

.aj-prod-unmapped-note {
  font-size: 11.5px;
  color: var(--text-faint);
  margin: 10px 0 4px;
  line-height: 1.5;
}

/* ── Clickable group header name (history moved here from each row) ── */
.customer-name--clickable { cursor: pointer; }
.customer-name--clickable:hover { text-decoration: underline; }

/* ── TikTok shipment link picker ── */
.link-picker {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 0.75rem;
  border: 0.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 12px; cursor: pointer;
}
.link-picker-label { white-space: nowrap; }
.link-picker-select { flex: 1; min-width: 0; font-size: 12px; padding: 3px 6px; }
.link-picker--compact {
  margin-bottom: 0; padding: 4px 6px; gap: 5px;
  font-size: 11px; border: none; flex: 0 0 auto; max-width: 210px;
}
.link-picker--compact .link-picker-label { display: none; }
.link-picker--compact .link-picker-select { font-size: 11px; max-width: 160px; }

/* ── Bulk modal: wider, per-row status + link ── */
.bulk-status-modal { width: 720px; max-width: 95vw; }
.bulk-section-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.4px; opacity: 0.6; margin: 0 0 6px;
}
.bulk-order-list { max-height: 340px; }
.bulk-order-item { align-items: center; gap: 10px; cursor: default; }
.bulk-order-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bulk-order-product { flex: none; }
.bulk-order-meta { font-size: 11px; opacity: 0.6; }
.bulk-row-status { font-size: 12px; padding: 3px 6px; flex: 0 0 auto; }

/* ── Search: Enviado/Archivado tiers, greyed but still interactive ── */
.customer-group--faded { opacity: 0.55; }
.customer-group--faded:hover { opacity: 0.85; }

/* ── Search results filter bar ── */
.search-filter-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0.5rem 0 1rem; }
.search-filter-btn {
  font-family: inherit; font-size: 12px; font-weight: 500;
  padding: 7px 12px; border-radius: 20px;
  border: 0.5px solid var(--border-strong); background: var(--surface); color: var(--text-muted);
  cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.search-filter-btn:hover { background: var(--surface2); }
.search-filter-btn.active { background: var(--text); color: var(--surface); border-color: var(--text); }

/* ── Calidad detail modal: collapsible order blocks + timeline ── */
.cal-detail-order-head { cursor: pointer; }
.cal-detail-order-chevron { display: inline-block; transition: transform 0.15s; color: var(--text-faint); font-size: 10px; }
.cal-detail-order-items { max-height: 0; overflow: hidden; transition: max-height 0.2s ease; }
.cal-detail-order-items.open { max-height: 600px; }
.cal-detail-order-items.open ~ .cal-detail-order-chevron,
.cal-detail-order-head:has(+ .open) .cal-detail-order-chevron { transform: rotate(90deg); }
.cal-detail-order-summary { margin-left: auto; font-size: 11px; color: var(--text-muted); font-weight: 600; }
.cal-detail-item-price { margin-left: auto; color: var(--text-muted); }
.cal-detail-item { display: flex; align-items: center; gap: 8px; }

.cal-detail-timeline-row {
  display: flex; flex-direction: column; gap: 2px;
  padding: 7px 10px; font-size: 11.5px;
  border-bottom: 0.5px solid var(--border);
}
.cal-detail-timeline-row:last-child { border-bottom: none; }
.cal-detail-timeline-time { color: var(--text-faint); font-size: 10.5px; }
.cal-detail-timeline-person { font-weight: 600; }
.cal-detail-timeline-what { color: var(--text-muted); }

.vp-qc-ttid { font-family: monospace; font-size: 11px; font-weight: 400; color: var(--text-faint); }

.cal-detail-order-link { font-size: 11px; color: var(--text-muted); text-decoration: underline; margin-left: 6px; }

.cal-detail-photo-group { margin-bottom: 10px; }
.cal-detail-photo-group:last-child { margin-bottom: 0; }
.cal-detail-photo-group-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-faint); margin-bottom: 4px; }

.cal-detail-order-notes-toggle {
  font-size: 11.5px; color: var(--amber-text); cursor: pointer;
  padding: 6px 12px; border-top: 0.5px solid var(--border);
}
.cal-detail-order-notes {
  max-height: 0; overflow: hidden; transition: max-height 0.2s ease;
  font-size: 12.5px; color: var(--amber-text); padding: 0 12px;
}
.cal-detail-order-notes.open { max-height: 200px; padding: 0 12px 8px; }

/* ── Calidad card: username + prominent-but-smaller TikTok Order ID ── */
.vp-qc-ttid-prominent {
  font-family: monospace; font-size: 12px; font-weight: 400;
  color: var(--text); background: var(--surface2);
  border-radius: var(--radius-sm); padding: 1px 6px;
  vertical-align: middle;
}
.vp-qc-count-badge {
  display: inline-block; border-radius: var(--radius-sm);
  padding: 0px 6px; font-size: 11px; font-weight: 500;
  line-height: 1.6;
}

.vp-qc-count-badge.tiktok  { background: var(--blue-bg);  color: var(--blue-text); }
.vp-qc-count-badge.shopify { background: var(--green-bg); color: var(--green-text); }
.vp-qc-count-badge.manual  { background: var(--amber-bg); color: var(--amber-text); }
.vp-qc-info { font-size: 11px; color: var(--text-muted); line-height: 1.7; margin-top: 4px; }

.vp-qc-count-label { display: inline-block; width: 41px; }
.vp-qc-count-num { display: inline-block; width: 14px; text-align: center; }

.cal-field-checks { display: flex; gap: 12px; margin-top: 4px; font-size: 11.5px; color: var(--text-muted); }
.cal-field-checks label { display: flex; align-items: center; gap: 4px; cursor: pointer; }

.cal-field-input-wrap { position: relative; }
.cal-field-input-wrap .vp-input { padding-right: 28px; }
.cal-field-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 50%; border: none;
  background: var(--surface2); color: var(--text-muted);
  font-size: 13px; line-height: 1; cursor: pointer; display: none;
  align-items: center; justify-content: center;
}
.cal-field-clear.visible { display: flex; }
.cal-field-clear:hover { background: var(--border); color: var(--text); }

.aj-backfill-stat-divider {
  height: 1px;
  background: var(--border, #e5e5e5);
  margin: 8px 0;
}

.order-row.row-pending-save {
  opacity: 0.5;
  pointer-events: none;
}
.order-row.row-pending-save .order-actions::after {
  content: 'Guardando…';
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 600;
}

.status-confirm-prompt {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 0 10px;
}
.status-confirm-prompt strong { color: var(--text); }
