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

:root {
  /* ── Tema claro wholesale — acento ÍNDIGO para diferenciarse del sitio
     mayorista original (que es claro con acento teal #00bfa5) ── */
  --primary: #1e1e2d;
  --primary-light: #3a3a52;
  --accent: #4f46e5;
  --accent-light: #6366f1;
  --accent-soft: rgba(79,70,229,.08);
  --bg: #f5f6fb;
  --surface: #fff;
  --surface-alt: #fafaff;
  --text: #1e1e2d;
  --text-secondary: #555;
  --text-muted: #6b7280;
  --border: #e6e8f0;
  --border-light: #eef0f6;
  --green: #16a34a;
  --orange: #fb8c00;
  --red: #ef5350;
  --row-hover: #f4f4ff;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.1);
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  padding-bottom: 72px;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
  background: var(--surface);
  color: var(--text);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,.88);
}
.logo { font-size: 22px; font-weight: 800; letter-spacing: -.3px; color: var(--primary); }
.logo span { font-weight: 400; color: var(--accent); }
.logo-img { height: 22px; display: block; }
.cart-summary {
  background: var(--accent-soft);
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  border: 1px solid rgba(79,70,229,.15);
}
.cart-icon { font-size: 16px; }

/* Category Tabs */
.tabs {
  display: flex;
  gap: 0;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
}
.tab-btn {
  padding: 12px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all .2s;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.tab-btn:hover { color: var(--accent); background: var(--row-hover); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 700;
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.filter-group { display: flex; align-items: center; gap: 8px; }
.btn-download {
  margin-left: auto;
  padding: 7px 16px;
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn-download:hover { background: var(--accent); color: #fff; }
.filter-group label { font-weight: 600; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.filter-group select,
.filter-group input {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  transition: all .2s;
  background: var(--surface-alt);
}
.filter-group select:focus,
.filter-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.filter-group select { min-width: 180px; }
.filter-group input { min-width: 240px; }
.result-count { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* Table */
.table-wrapper { padding: 16px 20px; }
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.data-table thead { background: var(--surface-alt); }
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  font-weight: 600;
  user-select: none;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.data-table th.sortable { cursor: pointer; }
.data-table th.sortable:hover { color: var(--accent); background: var(--row-hover); }
.data-table th .sort-arrow { margin-left: 4px; font-size: 10px; opacity: .4; }
.data-table th.sort-asc .sort-arrow,
.data-table th.sort-desc .sort-arrow { opacity: 1; color: var(--accent); }

.data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  vertical-align: middle;
}
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--row-hover); }
.data-table tbody tr.in-cart { background: var(--accent-soft); }
.data-table tbody tr.in-cart:hover { background: rgba(79,70,229,.12); }

.col-brand { font-weight: 600; min-width: 110px; color: var(--primary); }
.col-name {
  max-width: 350px;
  cursor: pointer;
  position: relative;
  color: var(--text-secondary);
}
.col-name:hover { color: var(--accent); text-decoration: underline; }
.col-ean { font-family: 'Cascadia Code', 'Consolas', monospace; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.col-sku { font-family: 'Cascadia Code', 'Consolas', monospace; font-size: 12px; color: var(--text-muted); }
.col-stock { text-align: center; font-weight: 600; }
.stock-ok { color: var(--green); }
.stock-low { color: var(--orange); }
.stock-out { color: var(--red); }
.col-price {
  font-weight: 700;
  color: var(--primary);
  text-align: right;
  white-space: nowrap;
  font-size: 14px;
}
.price-original {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: line-through;
  font-weight: 400;
  display: block;
}
.badge-no-dcto {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

/* Toast de notificación */
.refresh-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 9999;
}
.refresh-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Quantity Selector */
.qty-selector {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-alt);
}
.qty-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.qty-btn:hover { background: var(--accent-soft); color: var(--accent); }
.qty-btn:active { background: rgba(79,70,229,.15); }
.qty-btn.minus { border-right: 1px solid var(--border-light); }
.qty-btn.plus { border-left: 1px solid var(--border-light); }
.qty-btn:disabled { opacity: .25; cursor: not-allowed; }
.qty-value {
  width: 40px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  padding: 0 4px;
  color: var(--text-muted);
}
.qty-value.has-qty { color: var(--accent); }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px 16px 20px;
}
.page-btn {
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.page-btn:hover { background: var(--row-hover); border-color: var(--accent); color: var(--accent); }
.page-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(79,70,229,.25);
}
.page-btn:disabled { opacity: .35; cursor: not-allowed; }

/* Image Modal */
.image-modal {
  display: none;
  position: fixed;
  z-index: 500;
  pointer-events: none;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  max-width: 280px;
  max-height: 280px;
  border: 1px solid var(--border);
}
.image-modal.visible { display: block; }
.image-modal img {
  max-width: 260px;
  max-height: 260px;
  display: block;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

/* Loading */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(247,248,250,.95);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.loading-overlay.hidden { display: none; }
.loading-overlay p { color: var(--text-muted); font-weight: 500; }
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Cart Bar */
.cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  color: var(--text);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,.06);
  transform: translateY(100%);
  transition: transform .25s ease;
}
.cart-bar.visible { transform: translateY(0); }
.cart-bar-info { display: flex; gap: 24px; align-items: center; font-size: 14px; color: var(--text-secondary); }
.cart-bar-total { font-size: 17px; color: var(--primary); }
.btn-cart {
  padding: 10px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(79,70,229,.25);
}
.btn-cart:hover:not(:disabled) { background: #4338ca; box-shadow: 0 4px 12px rgba(79,70,229,.35); }
.btn-cart:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
  font-size: 15px;
}

/* User header */
.header-right { display: flex; align-items: center; gap: 12px; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.btn-logout {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* ── Login Page ── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  padding: 20px;
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}
.login-logo { font-size: 28px; font-weight: 800; color: var(--primary); letter-spacing: -.3px; }
.login-logo span { font-weight: 400; color: var(--accent); }
.login-logo-img { height: 29px; display: block; margin: 0 auto 8px; }
.login-subtitle { color: var(--text-muted); font-size: 14px; margin: 8px 0 32px; }
.form-field { text-align: left; margin-bottom: 20px; }
.form-field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.form-field input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  transition: all .2s;
  background: var(--surface-alt);
}
.form-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.captcha-wrapper { display: flex; justify-content: center; margin-bottom: 24px; }
.btn-login {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(79,70,229,.25);
}
.btn-login:hover:not(:disabled) { background: #4338ca; }
.btn-login:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.login-error {
  margin-top: 16px;
  padding: 10px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--red);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
}
/* Admin detected step */
.admin-detected {
  text-align: center;
  margin-bottom: 20px;
}
.admin-detected-text {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(79,70,229,.08);
  border: 1px solid rgba(79,70,229,.2);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.admin-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 13px;
}
.admin-divider::before, .admin-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.btn-client-login {
  background: var(--surface) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}
.btn-client-login:hover:not(:disabled) {
  background: var(--bg) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

.hidden { display: none !important; }

/* ── Cart Page ── */
.cart-page { padding: 24px 28px; max-width: 1200px; margin: 0 auto; }
.cart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.cart-header h2 { font-size: 22px; font-weight: 700; color: var(--primary); }
.btn-back {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: opacity .15s;
}
.btn-back:hover { opacity: .7; }

.cart-table { width: 100%; }
.cart-table-wrapper { overflow-x: auto; }
.cart-product-name { font-weight: 500; max-width: 300px; }
.cart-total-row td { border-top: 2px solid var(--border); padding-top: 14px; }
.cart-total-label { text-align: right; font-size: 16px; font-weight: 700; color: var(--primary); }
.cart-total-value { font-size: 18px; font-weight: 800; color: var(--accent); text-align: right; }

.btn-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all .15s;
}
.btn-remove:hover { color: var(--red); background: #fef2f2; }

/* Cart info bar */
.cart-info-bar {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(79,70,229,.05);
  border: 1px solid rgba(79,70,229,.15);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}
.cart-info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.cart-info-icon { font-size: 16px; }
.cart-info-item strong { color: var(--accent); }

.cart-confirm-wrap { text-align: right; }
.cart-min-warning {
  margin-top: 8px;
  font-size: 12px;
  color: var(--orange);
  font-weight: 500;
}

/* Datos de envío (checkout propio) */
.cart-shipping {
  margin-top: 20px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cart-shipping h3 {
  margin: 0 0 14px;
  font-size: 16px;
  color: var(--text);
}
.ship-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px;
}
.ship-field { display: flex; flex-direction: column; gap: 5px; }
.ship-field-wide { grid-column: 1 / -1; }
.ship-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.ship-field input,
.ship-field select {
  padding: 10px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.ship-field input::placeholder { color: var(--text-muted); }
.ship-field input:focus,
.ship-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.ship-field input.field-error,
.ship-field select.field-error { border-color: var(--red); }
.ship-field select:disabled { opacity: .55; cursor: not-allowed; }
.factura-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.factura-toggle input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.factura-fields {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.ship-error {
  margin-top: 8px;
  font-size: 13px;
  color: var(--red);
  font-weight: 500;
}
@media (max-width: 640px) {
  .ship-grid { grid-template-columns: 1fr; }
}

.cart-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  gap: 16px;
}
.btn-primary {
  padding: 12px 32px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(79,70,229,.25);
}
.btn-primary:hover { background: #4338ca; }
.btn-primary:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; box-shadow: none; opacity: .6; }
.btn-secondary {
  padding: 12px 32px;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.cart-empty p { font-size: 18px; margin-bottom: 20px; }

/* Alerts */
.stock-alerts { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.alert {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
}
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* Order Confirmation */
.order-confirmation {
  position: fixed;
  inset: 0;
  background: rgba(247,248,250,.97);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  padding: 48px 40px;
  text-align: center;
  max-width: 480px;
}
.confirm-icon { font-size: 48px; color: var(--accent); margin-bottom: 16px; }
.confirm-card h2 { font-size: 22px; font-weight: 700; color: var(--primary); margin-bottom: 12px; }
.confirm-card p { color: var(--text-secondary); font-size: 15px; margin-bottom: 28px; line-height: 1.5; }

/* ── Orders Button ── */
.btn-orders {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-orders:hover { border-color: var(--accent); color: var(--accent); }

/* ── Orders Page ── */
.orders-page { padding: 24px 28px; max-width: 900px; margin: 0 auto; }
.orders-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.orders-header h2 { font-size: 22px; font-weight: 700; color: var(--primary); }

.orders-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.orders-empty p { font-size: 18px; margin-bottom: 20px; }

.orders-error {
  text-align: center;
  padding: 40px 20px;
  color: var(--red);
  font-size: 14px;
}
.orders-error button { margin-top: 16px; }

.orders-list { display: flex; flex-direction: column; gap: 12px; }

.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.order-card:hover { box-shadow: var(--shadow-md); }

.order-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  transition: background .15s;
  gap: 12px;
}
.order-card-header:hover { background: var(--surface-alt); }

.order-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.order-id { font-size: 15px; font-weight: 700; color: var(--primary); }
.order-date { font-size: 12px; color: var(--text-muted); }

.order-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.order-items { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.order-total { font-size: 16px; font-weight: 700; color: var(--primary); white-space: nowrap; }

.order-status {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
}
.status-paid { background: #dcfce7; color: #166534; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-cancelled { background: #fef2f2; color: #991b1b; }
.status-shipped { background: #dbeafe; color: #1e40af; }
.status-delivered { background: #dcfce7; color: #166534; }
.status-other { background: #f3f4f6; color: #4b5563; }
.status-unknown { background: #f3f4f6; color: #9ca3af; }

.order-toggle {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform .2s;
}
.order-card.expanded .order-toggle { transform: rotate(180deg); }

.order-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}
.order-card.expanded .order-card-body {
  max-height: 800px;
}

.order-products-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.order-products-table thead {
  background: var(--surface-alt);
}
.order-products-table th {
  padding: 8px 16px;
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  font-weight: 600;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.order-products-table td {
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.order-products-table tbody tr:last-child td { border-bottom: none; }
.op-name { font-weight: 500; color: var(--text-secondary); max-width: 300px; }
.op-sku { font-family: 'Cascadia Code', 'Consolas', monospace; font-size: 11px; color: var(--text-muted); }
.op-qty { text-align: center; font-weight: 600; }
.op-price { text-align: right; white-space: nowrap; }
.op-original-price {
  display: block;
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
}
.op-subtotal { text-align: right; font-weight: 600; white-space: nowrap; }

.order-summary {
  padding: 12px 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  border-top: 1px solid var(--border-light);
}
.order-summary-row {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}
.order-summary-row span:last-child { min-width: 80px; text-align: right; }
.order-summary-total {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.order-pay-action { margin-top: 12px; }
.btn-pay {
  display: inline-block;
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(79,70,229,.25);
}
.btn-pay:hover { background: #4338ca; }

/* ── Smart Search Autocomplete ── */
.search-group { position: relative; }
.search-wrapper { position: relative; }
.search-wrapper input { min-width: 300px; }
.search-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 480px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 300;
}
.search-dropdown.hidden { display: none; }
.search-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background .1s;
  gap: 16px;
}
.search-suggestion:hover,
.search-suggestion.active { background: var(--accent-soft); }
.sg-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.sg-brand {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .3px;
}
.sg-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sg-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sg-sku {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'Cascadia Code', 'Consolas', monospace;
}
.sg-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.sg-stock {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.search-suggestion mark {
  background: rgba(79,70,229,.25);
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}
.search-footer {
  padding: 6px 14px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  background: var(--surface-alt);
  border-top: 1px solid var(--border-light);
}

/* Scrollbar */
::-webkit-scrollbar { height: 5px; width: 5px; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* Precio desactualizado (producto sin precio en la lista, modo "mostrar Jumpseller") */
.badge-stale { display: inline-block; font-size: 11px; font-weight: 600; color: #92400e; background: #fef3c7; border-radius: 4px; padding: 1px 6px; margin-left: 4px; vertical-align: middle; }

/* Badge "wholesale" junto al logo */
.header-left { display: flex; align-items: center; gap: 10px; }
.login-logo-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.logo-badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(79,70,229,.35); padding: 3px 9px; border-radius: 100px; line-height: 1; white-space: nowrap; }
