/* ── Reset & Variables ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:        #e63027;
  --red-dark:   #c0261e;
  --bg:         #f2f2f2;
  --surface:    #ffffff;
  --text:       #1a1a1a;
  --muted:      #666;
  --border:     #e0e0e0;
  --radius:     8px;
  --shadow:     0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.16);
  --transition: .18s ease;
}

body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }

.container { max-width: 1260px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

/* ── Logo texto (fallback) ── */
.logo { font-size: 1.5rem; font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: -.5px; }
.logo span { color: var(--red); }

/* ── Logo imagen ── */
.logo-img-link { display: inline-flex; align-items: center; text-decoration: none; flex-shrink: 0; }

/* Header (fondo oscuro — combina con el fondo de las imágenes) */
.logo-img--header {
  height: 52px; width: auto;
  display: block;
}

/* Sidebar admin (fondo oscuro) */
.logo-img--sidebar {
  width: 100%; max-width: 200px;
  height: auto; display: block;
}

/* Auth modal */
.auth-logo-link { display: block; text-align: center; margin-bottom: 20px; }
.logo-img--auth {
  height: 60px; width: auto;
  border-radius: 8px;
  display: inline-block;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 20px; border-radius: var(--radius); font-weight: 600; font-size: .9rem;
  cursor: pointer; text-decoration: none; border: 2px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.btn--primary  { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-dark); }
.btn--outline  { border-color: var(--red); color: var(--red); background: transparent; }
.btn--outline:hover { background: var(--red); color: #fff; }
.btn--full     { width: 100%; }
.btn--sm       { padding: 6px 14px; font-size: .82rem; }
.btn:disabled  { opacity: .5; cursor: not-allowed; }

/* ── Badges ── */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .78rem;
  font-weight: 600; letter-spacing: .2px;
}
.badge--red    { background: #fde8e8; color: #c0261e; }
.badge--yellow { background: #fff3cd; color: #856404; }
.badge--green  { background: #d1fae5; color: #065f46; }
.badge--type   { background: #fff3cd; color: #856404; }

/* ── TRM bar ── */
.trm-bar {
  background: #e63027;
  text-align: center;
  padding: 5px 16px;
  font-size: .78rem;
  color: #fff;
  letter-spacing: .02em;
}
.trm-bar__text strong { font-weight: 700; }

/* ── Header ── */
.header {
  background: #0f172a;
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 2px 16px rgba(0,0,0,.32);
}
.header__inner {
  display: flex; align-items: center;
  height: 70px; gap: 0;
}
.nav {
  display: flex; gap: 8px;
  flex: 1; justify-content: center;
}
.nav a {
  color: rgba(255,255,255,.75); text-decoration: none;
  font-weight: 500; font-size: .95rem;
  padding: 8px 16px; border-radius: 8px;
  transition: background var(--transition), color var(--transition);
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.1); }
.header__actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header__actions .btn--outline,
.user-menu .btn--outline {
  border-color: rgba(255,255,255,.35); color: rgba(255,255,255,.9); background: transparent;
}
.header__actions .btn--outline:hover,
.user-menu .btn--outline:hover { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.6); }
.user-menu { display: flex; align-items: center; gap: 10px; }
.user-menu__name { font-weight: 600; font-size: .9rem; color: rgba(255,255,255,.7); }
.btn--cart { position: relative; }
.cart-count { background: var(--red); color: #fff; }

/* ── Animación fly-to-cart ── */
@keyframes cart-bump {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.28); }
  100% { transform: scale(1); }
}
.cart-btn-bump { animation: cart-bump 0.38s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Toast de sin stock */
.cart-stock-toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: #1e293b; color: #fff; padding: 12px 20px; border-radius: 12px;
  font-size: .85rem; font-weight: 500; text-align: center; max-width: 320px; width: max-content;
  z-index: 9999; pointer-events: none; opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  border-left: 4px solid var(--red);
}
.cart-stock-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Filters Bar ── */
.filters-bar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 0 10px; }
.filters-inner { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-input {
  flex: 1; min-width: 200px; padding: 9px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: .92rem; outline: none; transition: border-color var(--transition);
}
.filter-input:focus { border-color: var(--red); }
.filter-select {
  padding: 9px 12px; border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: .9rem; background: var(--surface); outline: none; cursor: pointer;
  transition: border-color var(--transition);
}
.filter-select:focus { border-color: var(--red); }
.filter-check { display: flex; align-items: center; gap: 7px; font-size: .9rem; font-weight: 500; cursor: pointer; }
.translation-indicator { font-size: .85rem; color: var(--muted); padding: 4px 0; }
.translation-indicator:not(.hidden) { display: block; }

/* ── Loader ── */
.loader-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 60px 0; color: var(--muted); }
.loader {
  width: 40px; height: 40px; border: 4px solid var(--border); border-top-color: var(--red);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Section body ── */
.section-body { padding: 32px 0 60px; }

/* ── Brand Rail (infinite marquee) ── */
.bm-rail {
  background: #ffffff;
  border-top:    1px solid #e6e6ea;
  border-bottom: 1px solid #e6e6ea;
  padding: 0;
  overflow: hidden;
}
.bm-rail__label {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: #c0c0cc;
  text-align: center;
  padding-top: 22px;
  margin-bottom: 16px;
  user-select: none;
}
.bm-rail__viewport {
  overflow: hidden;
  padding-bottom: 22px;
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    #fff 9%,
    #fff 91%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    #fff 9%,
    #fff 91%,
    transparent 100%
  );
}
.bm-rail__track {
  display: flex;
  width: max-content;
  animation: bm-scroll 44s linear infinite;
}
.bm-rail__track:hover {
  animation-play-state: paused;
}
@keyframes bm-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.bm-rail__set {
  display: flex;
  align-items: center;
}
.bm-logo-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 152px;
  height: 68px;
  background: none;
  border: none;
  border-right: 1px solid #ebebef;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0 30px;
  transition: background 0.2s ease;
  outline-offset: -3px;
}
.bm-logo-item:hover {
  background: #f5f5f8;
}
.bm-logo-item:hover .bm-logo-img {
  opacity: 1;
  transform: scale(1.08);
}
.bm-logo-img {
  display: block;
  max-width: 96px;
  max-height: 40px;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0.62;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .bm-rail__track { animation: none; }
}

/* ── Product Grid ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.placeholder-msg { color: var(--muted); text-align: center; grid-column: 1/-1; padding: 60px 0; }
.placeholder-msg.error { color: var(--red); }

/* ── Product Card ── */
.product-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; cursor: pointer; display: flex; flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-card__img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #f0f0f0; }
.product-card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.product-card__name { font-weight: 600; font-size: .9rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card__meta { font-size: .8rem; color: var(--muted); }
.product-card__stock { margin-top: auto; }

/* ── Talla chips ── */
.tallas-row { display: flex; flex-wrap: wrap; gap: 5px; }
.talla-chip {
  padding: 3px 9px; border: 1.5px solid var(--border); border-radius: 20px;
  font-size: .75rem; font-weight: 700; cursor: pointer; background: var(--surface);
  transition: all var(--transition); line-height: 1.4;
}
.talla-chip:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.talla-chip.active { background: var(--red); color: #fff; border-color: var(--red); }
.talla-sin-stock { opacity: .4; text-decoration: line-through; cursor: not-allowed; }
.btn-ver-tallas {
  display: inline-block; background: none; border: none; padding: 0;
  font-size: .7rem; color: var(--muted); cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px; transition: color var(--transition);
}
.btn-ver-tallas:hover { color: var(--red); }

/* ── Price Blur ── */
.precio-wrap { position: relative; display: block; }
body:not(.autenticado) .precio-wrap { min-height: 78px; }
.precio-blur {
  font-size: 1.15rem; font-weight: 700; color: var(--red);
  transition: filter var(--transition);
}
body:not(.autenticado) .precio-blur { filter: blur(6px); user-select: none; pointer-events: none; }
.precio-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px;
}
body.autenticado .precio-overlay { display: none; }
.precio-overlay span { font-size: 1rem; }
.precio-overlay small { font-size: .7rem; color: var(--muted); white-space: nowrap; }

/* ── Pagination ── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 32px 0 0; }
.pagination__info { font-size: .9rem; color: var(--muted); font-weight: 500; }

/* ── Modal overlay ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 300;
  backdrop-filter: blur(3px);
}

/* ── Modals ── */
.modal {
  position: fixed; z-index: 400; background: var(--surface);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  overflow: hidden; animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.95) translateY(8px); } to { opacity: 1; transform: none; } }

.modal__close {
  position: absolute; top: 14px; right: 16px; width: 32px; height: 32px;
  border: none; background: rgba(0,0,0,.08); border-radius: 50%; cursor: pointer;
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  z-index: 10; transition: background var(--transition);
}
.modal__close:hover { background: rgba(0,0,0,.16); }

/* Product modal */
.modal--product {
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(960px, 96vw); max-height: 90vh; overflow-y: auto;
}
.modal-product__body { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.modal-loader { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 60px; grid-column: 1/-1; }

/* Auth modal */
.modal--sm {
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(420px, 94vw); padding: 40px 36px;
}

/* ── Gallery ── */
.gallery { background: #f5f5f5; display: flex; flex-direction: column; min-height: 280px; }
.gallery__main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; }
.gallery__main img { max-width: 100%; max-height: 320px; object-fit: contain; border-radius: 6px; }
.gallery--empty { align-items: center; justify-content: center; }
.gallery--empty img { max-width: 140px; opacity: .4; }
.gallery__thumbs { display: flex; gap: 8px; padding: 10px 14px; overflow-x: auto; border-top: 1px solid var(--border); }
.gallery__thumb {
  width: 64px; height: 64px; object-fit: cover; border-radius: 6px; cursor: pointer; flex-shrink: 0;
  border: 2px solid transparent; transition: border-color var(--transition); opacity: .7;
}
.gallery__thumb:hover, .gallery__thumb.active { border-color: var(--red); opacity: 1; }

/* ── Detail Info ── */
.detail-info { padding: 28px 24px; display: flex; flex-direction: column; gap: 14px; }
.detail-name { font-size: 1.3rem; font-weight: 700; line-height: 1.3; }
.detail-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-sku { font-size: .85rem; color: var(--muted); font-family: monospace; }
.detail-brand { font-size: .9rem; }
.detail-label { font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.detail-tallas { display: flex; flex-direction: column; }
.detail-desc p { font-size: .9rem; line-height: 1.65; color: #444; }
.detail-desc p.collapsed { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.translate-btn { align-self: flex-start; }
.translation-result { font-size: .9rem; background: #f0f7ff; border-radius: 6px; padding: 10px 14px; }
.translate-badge { display: inline-block; margin-left: 10px; font-size: .78rem; font-weight: 500; color: #1d6fa4; background: #e8f4fd; border-radius: 20px; padding: 2px 10px; vertical-align: middle; }

/* ── Auth forms ── */
.auth-logo { display: block; text-align: center; margin-bottom: 22px; font-size: 1.7rem; }
.modal--sm h2 { font-size: 1.4rem; font-weight: 700; text-align: center; margin-bottom: 4px; }
.auth-subtitle { color: var(--muted); text-align: center; font-size: .9rem; margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-weight: 600; font-size: .87rem; }
.form-group input {
  padding: 10px 13px; border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: .95rem; outline: none; transition: border-color var(--transition);
}
.form-group input:focus { border-color: var(--red); }
.form-error  { color: #c0261e; font-size: .85rem; background: #fde8e8; border-radius: 6px; padding: 8px 12px; }
.form-success { color: #065f46; font-size: .85rem; background: #d1fae5; border-radius: 6px; padding: 8px 12px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: .9rem; color: var(--muted); }
.link { color: var(--red); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }

/* ── Admin Layout ── */
.admin-layout { display: flex; min-height: calc(100vh - 62px); }

/* ── Sidebar ── */
.admin-sidebar {
  width: 208px; flex-shrink: 0; background: #0f172a;
  display: flex; flex-direction: column;
  position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto;
}
.admin-sidebar__logo {
  padding: 0; border-bottom: 1px solid rgba(255,255,255,.06); overflow: hidden;
}

.admin-sidebar__nav { display: flex; flex-direction: column; padding: 12px 10px; flex: 1; gap: 1px; }

.admin-nav {
  display: flex; align-items: center; padding: 9px 13px;
  border: none; border-radius: 7px; background: transparent;
  color: rgba(255,255,255,.38); font-size: .855rem; font-weight: 500;
  cursor: pointer; text-align: left; width: 100%;
  transition: background .15s, color .15s; letter-spacing: .05px;
}
.admin-nav:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.82); }
.admin-nav.active {
  background: rgba(255,255,255,.1); color: #f8fafc; font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

.admin-sync-bar {
  display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 4px;
}
.admin-sync-bar .btn {
  font-size: .75rem; border-color: rgba(255,255,255,.15);
  color: rgba(255,255,255,.5); background: transparent;
}
.admin-sync-bar .btn:hover:not(:disabled) {
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.8);
  border-color: rgba(255,255,255,.3);
}
.admin-sync-bar .btn:disabled { opacity: .4; cursor: not-allowed; }
.sync-status-box {
  background: rgba(0,0,0,.25); border-radius: 6px; padding: 8px 10px;
  font-size: .72rem; color: rgba(255,255,255,.75); line-height: 1.5;
}
.sync-status-box .sync-ico { font-size: .95rem; }
.sync-status-box .sync-time { color: rgba(255,255,255,.4); font-size: .68rem; }
.admin-sidebar__back {
  margin: 6px 10px 20px; background: transparent;
  border-color: rgba(255,255,255,.1); color: rgba(255,255,255,.3); font-size: .8rem;
}
.admin-sidebar__back:hover {
  background: rgba(255,255,255,.06); color: rgba(255,255,255,.6);
  border-color: rgba(255,255,255,.2);
}

/* ── Content ── */
.admin-main { flex: 1; min-width: 0; background: #f1f5f9; }
.admin-content { padding: 36px 40px; max-width: 1100px; }

.admin-section-title {
  font-size: 1.2rem; font-weight: 700; color: #0f172a;
  margin-bottom: 24px; letter-spacing: -.3px;
}
.admin-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 16px;
}
.admin-section-header h2 { font-size: 1.2rem; font-weight: 700; margin: 0; color: #0f172a; }
.admin-section-header h4 {
  font-size: .7rem; font-weight: 700; margin: 0;
  text-transform: uppercase; letter-spacing: .9px; color: #94a3b8;
}

/* ── Table ── */
.admin-table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.04);
  margin-bottom: 6px;
}
.admin-table th, .admin-table td {
  padding: 11px 16px; text-align: left;
  border-bottom: 1px solid #f1f5f9; font-size: .875rem;
}
.admin-table th {
  background: #f8fafc; font-weight: 600; color: #94a3b8;
  font-size: .7rem; text-transform: uppercase; letter-spacing: .8px;
  border-bottom: 1px solid #e2e8f0;
}
.admin-table tbody tr { transition: background .1s; }
.admin-table tbody tr:hover td { background: #f8fafc; }
.admin-table tfoot td {
  background: #f8fafc; font-weight: 600; color: #334155;
  border-top: 1px solid #e2e8f0; border-bottom: none;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-actions { display: flex; gap: 6px; }
.td-muted { color: #94a3b8; font-size: .85rem; }
.td-mono  { font-family: ui-monospace, 'SF Mono', monospace; font-size: .8rem; }

/* ── Status pills ── */
.st {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 20px; font-size: .72rem; font-weight: 600;
  letter-spacing: .2px; white-space: nowrap;
}
.st--gray   { background: #f1f5f9; color: #64748b; }
.st--violet { background: #f5f3ff; color: #7c3aed; }
.st--blue   { background: #eff6ff; color: #2563eb; }
.st--green  { background: #f0fdf4; color: #16a34a; }
.st--amber  { background: #fefce8; color: #ca8a04; }
.st--red    { background: #fef2f2; color: #dc2626; }

/* ── Button variants ── */
.btn--ghost { border-color: transparent; background: transparent; color: #64748b; }
.btn--ghost:hover { background: #f1f5f9; color: #334155; border-color: transparent; }
.btn--danger { color: #dc2626; }
.btn--danger:hover { background: #fef2f2; color: #dc2626; border-color: transparent; }

/* ── Dashboard ── */
.dash-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 14px; margin-bottom: 4px;
}
.dash-card {
  background: #fff; border-radius: 10px; padding: 20px 22px 18px;
  box-shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.04);
  transition: box-shadow .2s, transform .2s;
}
.dash-card:hover {
  box-shadow: 0 4px 12px rgba(15,23,42,.1), 0 12px 32px rgba(15,23,42,.07);
  transform: translateY(-2px);
}
.dash-label {
  font-size: .7rem; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .7px; margin-bottom: 10px;
}
.dash-val {
  font-size: 1.7rem; font-weight: 800; color: #0f172a;
  letter-spacing: -.7px; line-height: 1;
}

/* ── Pedido detail ── */
.pedido-detail { display: flex; flex-direction: column; gap: 16px; }
.detail-block {
  background: #fff; border-radius: 10px; padding: 22px 26px;
  box-shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.04);
}
.detail-block h4 {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: #94a3b8; margin-bottom: 16px;
}
.detail-block h5 { font-size: .875rem; font-weight: 700; color: #334155; margin-bottom: 12px; }
.detail-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 28px; }
.detail-row p { margin: 4px 0; font-size: .875rem; color: #475569; }
.detail-client-name { font-size: 1rem; font-weight: 700; color: #0f172a; margin-bottom: 5px; }
.estado-control { text-align: right; min-width: 210px; }
.form-label-sm {
  display: block; font-size: .7rem; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px;
}
.pago-summary { display: flex; gap: 24px; font-size: .875rem; color: #64748b; align-items: center; }
.pago-summary strong { color: #0f172a; font-weight: 700; }
.saldo-pendiente strong { color: var(--red); }

/* ── Pago / Gasto form ── */
.pago-form {
  background: #f8fafc; border-radius: 8px; border: 1px solid #e2e8f0;
  padding: 18px 20px; margin-top: 16px;
}
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 130px; }

/* Admin-scoped form groups */
.admin-content .form-group,
.admin-modal__box .form-group { display: flex; flex-direction: column; gap: 6px; }

.admin-content .form-group label,
.admin-modal__box .form-group label {
  font-size: .7rem; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .6px;
}
.admin-content .form-group input,
.admin-content .form-group select,
.admin-content .form-group textarea,
.admin-modal__box .form-group input,
.admin-modal__box .form-group select,
.admin-modal__box .form-group textarea {
  padding: 9px 12px; border: 1.5px solid #e2e8f0; border-radius: 7px;
  font-size: .9rem; width: 100%; background: #fff; outline: none;
  font-family: inherit; color: #0f172a;
  transition: border-color .15s, box-shadow .15s;
}
.admin-content .form-group input:focus,
.admin-content .form-group select:focus,
.admin-content .form-group textarea:focus,
.admin-modal__box .form-group input:focus,
.admin-modal__box .form-group select:focus,
.admin-modal__box .form-group textarea:focus {
  border-color: #94a3b8; box-shadow: 0 0 0 3px rgba(15,23,42,.05);
}
.admin-content .form-group textarea,
.admin-modal__box .form-group textarea { resize: vertical; }
.label-hint { font-weight: 400; color: #cbd5e1; text-transform: none; letter-spacing: 0; font-size: .72rem; }

/* ── Admin modal ── */
.admin-modal {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 700;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
.admin-modal__box {
  background: #fff; border-radius: 12px;
  box-shadow: 0 24px 80px rgba(15,23,42,.18), 0 4px 16px rgba(15,23,42,.08);
  padding: 28px 30px 24px; width: min(560px, 96vw); max-height: 92vh; overflow-y: auto;
}
.admin-modal__box h3 { font-size: 1.05rem; font-weight: 700; color: #0f172a; margin-bottom: 20px; }
.admin-modal__actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid #f1f5f9;
}
.admin-form { display: flex; flex-direction: column; gap: 14px; }

/* ── Caja ── */
.caja-resumen { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 22px; }
.caja-card {
  background: #fff; border-radius: 10px; padding: 20px 22px;
  box-shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.04);
}
.caja-card span {
  display: block; font-size: .7rem; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .7px; margin-bottom: 10px;
}
.caja-card strong { font-size: 1.5rem; font-weight: 800; letter-spacing: -.5px; }
.caja-ing-val { color: #16a34a; }
.caja-gas-val { color: #dc2626; }
.caja-sal-val { color: #0f172a; }
.caja-neg-val { color: #dc2626; }

/* ── Delivery input ── */
.qty-input { width: 64px !important; padding: 5px 8px !important; text-align: center; }

/* ── Price discount ── */
.precio-original { font-size: .82rem; color: #94a3b8; text-decoration: line-through; display: block; }
.descuento-badge { font-size: .68rem; background: #f0fdf4; color: #16a34a; border-radius: 20px; padding: 1px 7px; font-weight: 700; }

/* ── Responsive ── */
@media (max-width: 860px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; }
  .admin-sidebar__nav { flex-direction: row; overflow-x: auto; padding: 8px 10px; gap: 4px; }
  .admin-nav { padding: 7px 14px; border-radius: 7px; white-space: nowrap; }
  .admin-nav.active { box-shadow: none; }
  .admin-content { padding: 20px 16px; }
  .caja-resumen { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: repeat(2,1fr); }
  .detail-row { flex-direction: column; }
  .estado-control { text-align: left; min-width: unset; }
  .pago-summary { flex-direction: column; gap: 4px; }
}

/* ── Cart button on cards ── */
.btn-add-cart { display: none; width: 100%; margin-top: 6px; }
body.autenticado .btn-add-cart { display: flex; }
.btn--add-cart-modal { width: 100%; margin-bottom: 8px; }
body:not(.autenticado) .btn--add-cart-modal { display: none; }

/* ── Cart header button ── */
.btn--cart { position: relative; padding: 8px 14px; gap: 6px; }
.cart-count {
  background: var(--red); color: #fff; border-radius: 50%;
  width: 18px; height: 18px; font-size: .72rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ── Cart overlay ── */
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 500; }

/* ── Cart drawer ── */
.cart-drawer {
  position: fixed; top: 0; right: 0; width: 380px; max-width: 96vw; height: 100vh;
  background: var(--surface); z-index: 600; box-shadow: -4px 0 24px rgba(0,0,0,.15);
  display: flex; flex-direction: column;
  transition: width .22s ease;
  animation: slideIn .22s ease;
}
.cart-drawer--wide { width: min(660px, 94vw); }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }

.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.cart-header h3 { font-size: 1.1rem; font-weight: 700; }
.cart-header__actions { display: flex; align-items: center; gap: 8px; }
.cart-expand { background: none; border: 1.5px solid var(--border); border-radius: 6px; font-size: .85rem; cursor: pointer; color: var(--muted); padding: 2px 7px; line-height: 1.6; }
.cart-expand:hover { border-color: var(--red); color: var(--red); }
.cart-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--muted); }
.cart-close:hover { color: var(--text); }

.cart-items { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.cart-empty { color: var(--muted); text-align: center; padding: 40px 0; }

.cart-item {
  display: flex; gap: 10px; align-items: center;
  background: #f9f9f9; border-radius: var(--radius); padding: 10px;
}
.cart-item__img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.cart-item__info { flex: 1; min-width: 0; }
.cart-item__name { font-size: .85rem; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-drawer--wide .cart-item__name { white-space: normal; overflow: visible; text-overflow: unset; }
.cart-item__meta { font-size: .78rem; color: var(--muted); }
.cart-item__price { font-size: .85rem; font-weight: 700; color: var(--red); margin-top: 2px; }
.cart-item__qty { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cart-item__qty button { width: 24px; height: 24px; border: 1.5px solid var(--border); background: var(--surface); border-radius: 50%; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; }
.cart-item__qty button:hover { border-color: var(--red); color: var(--red); }
.cart-item__qty span { font-weight: 700; min-width: 20px; text-align: center; }
.cart-item__remove { background: none; border: none; color: #ccc; cursor: pointer; font-size: 1rem; flex-shrink: 0; }
.cart-item__remove:hover { color: var(--red); }

.cart-footer { padding: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; flex-shrink: 0; }
.cart-notas { width: 100%; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: .88rem; resize: vertical; min-height: 60px; outline: none; font-family: inherit; }
.cart-notas:focus { border-color: var(--red); }
.cart-total-row { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.cart-total-price { font-size: 1.15rem; color: var(--red); }

/* ── Toast ── */
.toast-success {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: #065f46; color: #fff; padding: 14px 28px; border-radius: 30px;
  font-weight: 600; font-size: .95rem; z-index: 900; box-shadow: var(--shadow-lg);
  animation: fadeUp .3s ease;
}
@keyframes fadeUp { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ── Admin tabs ── */
.admin-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 2px solid var(--border); }
.admin-tab { padding: 10px 24px; background: none; border: none; font-size: .95rem; font-weight: 600; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color var(--transition), border-color var(--transition); }
.admin-tab.active { color: var(--red); border-bottom-color: var(--red); }

/* ── Report / Ledger globals ──────────────────────────────────────────────── */
.report-toolbar     { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; gap:12px; flex-wrap:wrap; }
.balance-root       { font-family:'Segoe UI',system-ui,sans-serif; }
.balance-report-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:20px; padding-bottom:14px; border-bottom:2px solid var(--border); }
.balance-brand      { font-size:1.2rem; font-weight:800; letter-spacing:-.5px; color:var(--text); margin:0; }
.balance-brand span { color:var(--red); }
.balance-fecha      { font-size:.82rem; color:var(--muted); text-align:right; margin:0; }
.text-green { color:#065f46; }
.text-red   { color:#c0261e; }

/* ── Balance layout: ledgers + sidebar ───────────────────────────────────── */
.balance-layout  { display:grid; grid-template-columns:1fr 240px; gap:20px; align-items:start; }
.balance-ledgers { min-width:0; }
.balance-sidebar { position:sticky; top:16px; }

/* ── CxC summary box (sidebar) ───────────────────────────────────────────── */
.cxc-box            { background:var(--surface); border:1.5px solid var(--border); border-radius:10px; overflow:hidden; box-shadow:var(--shadow); }
.cxc-box-title      { background:#0f172a; color:#fff; font-size:.75rem; font-weight:700; letter-spacing:.8px; text-transform:uppercase; padding:8px 14px; }
.cxc-box-table      { width:100%; border-collapse:collapse; font-size:.83rem; }
.cxc-box-table th   { background:#f8fafc; padding:7px 12px; font-weight:600; border-bottom:1px solid var(--border); text-align:left; }
.cxc-box-table td   { padding:6px 12px; border-bottom:1px solid #f3f4f6; }
.cxc-row-debe td:last-child { color:#c0261e; font-weight:600; }
.cxc-row-ok td:last-child   { color:#065f46; }
.cxc-row-total      { background:#f8fafc; }
.cxc-row-total td   { font-size:.9rem; border-top:2px solid var(--border); border-bottom:none; }

/* ── Ledger table (como Excel) ───────────────────────────────────────────── */
.ledger-block       { margin-bottom:24px; border:1.5px solid var(--border); border-radius:10px; overflow:hidden; background:var(--surface); box-shadow:var(--shadow); }
.ledger-header      { display:flex; justify-content:space-between; align-items:flex-start; background:#f8fafc; padding:12px 16px; border-bottom:1.5px solid var(--border); gap:12px; flex-wrap:wrap; }
.ledger-title       { font-size:.88rem; font-weight:700; letter-spacing:.2px; color:var(--text); margin-bottom:2px; display:block; }
.ledger-contacto    { font-size:.78rem; color:var(--muted); }
.ledger-table       { width:100%; border-collapse:collapse; font-size:.83rem; }
.ledger-table thead th { background:#0f172a; color:#fff; padding:7px 10px; font-size:.75rem; font-weight:700; letter-spacing:.4px; text-transform:uppercase; text-align:left; white-space:nowrap; }
.ledger-table tbody tr:hover { background:#f8fafc; }
.ledger-table tbody td { padding:7px 10px; border-bottom:1px solid #f1f5f9; vertical-align:middle; }
.ledger-table tfoot td { padding:8px 10px; }
.lr-fecha   { white-space:nowrap; color:var(--muted); font-size:.8rem; }
.lr-num     { white-space:nowrap; color:var(--muted); font-weight:600; }
.lr-tipo    { display:inline-block; padding:2px 8px; border-radius:4px; font-size:.72rem; font-weight:700; letter-spacing:.4px; }
.lr-tipo--orden { background:#dbeafe; color:#1e40af; }
.lr-tipo--pago  { background:#dcfce7; color:#166534; }
.lr-detalle { max-width:280px; color:var(--muted); font-size:.8rem; line-height:1.4; }
.lr-pos     { color:#065f46; font-weight:600; text-align:right; white-space:nowrap; }
.lr-neg     { color:#c0261e; font-weight:600; text-align:right; white-space:nowrap; }
.lr-acum    { text-align:right; white-space:nowrap; font-size:.88rem; }
.lr-pago    { background:#f0fdf4; }
.lr-saldo-row td { background:#0f172a; color:#fff; font-size:.88rem; }
.lr-debe    { color:#fca5a5; font-size:1rem; }
.lr-aldia   { color:#86efac; font-size:1rem; }
.lr-saldo-label { font-size:.7rem; font-weight:700; letter-spacing:.5px; margin-left:6px; opacity:.8; }

/* ── CxC resumen top ─────────────────────────────────────────────────────── */
.cxc-resumen-top    { display:flex; gap:12px; margin-bottom:20px; flex-wrap:wrap; }
.cxc-res-card       { background:var(--surface); border:1.5px solid var(--border); border-radius:8px; padding:12px 18px; flex:1; min-width:140px; }
.cxc-res-label      { display:block; font-size:.75rem; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.4px; margin-bottom:4px; }
.cxc-res-val        { font-size:1.2rem; font-weight:800; }

/* ── Caja ─────────────────────────────────────────────────────────────────── */
.caja-resumen-wrap  { margin-bottom:24px; }
.caja-dia           { margin-bottom:20px; }
.caja-dia-label     { font-size:.78rem; font-weight:700; text-transform:uppercase; letter-spacing:.6px; color:var(--muted); padding:8px 0 6px; border-bottom:1.5px solid var(--border); margin-bottom:8px; }

/* ── Por pedir ────────────────────────────────────────────────────────────── */
.pp-cliente-card {
  border: 1.5px solid var(--border); border-radius: 12px;
  margin-bottom: 24px; overflow: hidden;
}
.pp-cliente-header {
  display: flex; justify-content: space-between; align-items: center;
  background: #0f172a; padding: 14px 20px; gap: 12px; flex-wrap: wrap;
}
.pp-cliente-nombre { font-size: 1rem; font-weight: 700; color: #f8fafc; display: block; }
.pp-cliente-email  { font-size: .8rem; color: rgba(255,255,255,.5); margin-top: 2px; display: block; }
.pp-pedidos-count  { font-size: .75rem; font-weight: 600; color: rgba(255,255,255,.4); white-space: nowrap; }

.pp-pedido { border-bottom: 1.5px solid var(--border); }
.pp-pedido:last-child { border-bottom: none; }

.pp-pedido-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 18px; background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.pp-pedido-id    { font-weight: 700; font-size: .9rem; color: #0f172a; }
.pp-pedido-fecha { font-size: .8rem; }
.pp-pedido-dir   { font-size: .8rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-estado-wrap  { margin-left: auto; }
.pp-estado-sel   {
  padding: 5px 10px; border: 1.5px solid var(--border); border-radius: 7px;
  font-size: .82rem; font-weight: 600; background: #fff; cursor: pointer;
}
.pp-badge-ok {
  background: #dcfce7; color: #166534; font-size: .72rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}
.pp-notas { font-size: .8rem; color: var(--muted); padding: 6px 18px 8px; font-style: italic; }

.pp-items { padding: 6px 0; }
.pp-item  {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px; cursor: pointer;
  transition: background .12s; border-bottom: 1px solid #f1f5f9;
}
.pp-item:last-child { border-bottom: none; }
.pp-item:hover      { background: #f8fafc; }
.pp-item--ok        { background: #f0fdf4 !important; }

.pp-check { width: 18px; height: 18px; flex-shrink: 0; accent-color: #16a34a; cursor: pointer; }

.pp-item-info   { flex: 1; min-width: 0; }
.pp-item-name   { display: block; font-size: .9rem; font-weight: 600; color: #0f172a; }
.pp-item-meta   { display: block; font-size: .78rem; color: var(--muted); margin-top: 2px; }

.pp-item-status {
  font-size: .75rem; font-weight: 700; white-space: nowrap;
  color: #94a3b8;
}
.pp-item--ok .pp-item-status { color: #16a34a; }

/* ── Entregas narrativas ──────────────────────────────────────────────────── */
.entrega-pedido         { border:1.5px solid var(--border); border-radius:10px; margin-bottom:20px; overflow:hidden; }
.entrega-pedido-header  { display:flex; justify-content:space-between; align-items:flex-start; background:#f8fafc; padding:16px 20px; gap:16px; flex-wrap:wrap; }
.entrega-pedido-title   { font-size:1rem; font-weight:700; margin-bottom:2px; }
.entrega-pedido-meta    { font-size:.83rem; color:var(--muted); margin-bottom:2px; }
.entrega-pedido-dir     { font-size:.85rem; color:var(--text); }
.entrega-resumen        { font-size:.88rem; }
.entrega-productos      { padding:0; }
.entrega-item           { display:flex; justify-content:space-between; align-items:center; padding:14px 20px; border-top:1px solid var(--border); gap:16px; flex-wrap:wrap; }
.entrega-item--ok       { background:#f0fdf4; }
.entrega-item--pendiente { background:#fff8f8; }
.entrega-item--parcial  { background:#fffbeb; }
.entrega-item-info      { display:flex; gap:12px; align-items:flex-start; flex:1; }
.entrega-item-num       { font-weight:700; color:var(--muted); flex-shrink:0; }
.entrega-item-name      { font-size:.9rem; font-weight:600; margin-bottom:3px; }
.entrega-item-status    { font-size:.85rem; color:var(--muted); }
.entrega-item-action    { flex-shrink:0; }

/* ── Print ────────────────────────────────────────────────────────────────── */
@media print {
  .no-print, .report-toolbar, .admin-sidebar, .header, .btn, select { display:none !important; }
  .report-body { box-shadow:none; padding:0; }
  .admin-content { padding:0; }
}

/* ── Admin pedido detail ───────────────────────────────────────────────────── */
.pd-header       { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:16px; gap:12px; }
.pd-num          { font-size:1.05rem; font-weight:700; color:#0f172a; margin-bottom:3px; }
.pd-fecha        { font-size:.82rem; color:#94a3b8; margin-bottom:4px; }
.pd-cliente      { font-size:.9rem; color:#475569; margin-bottom:2px; }
.pd-dir          { font-size:.85rem; color:#64748b; margin-top:3px; }
.pd-estado-select { padding:5px 10px; border-radius:6px; border:1.5px solid var(--border); font-size:.85rem; cursor:pointer; background:#fff; }
.pd-estado-select--inline { font-size:.78rem; padding:4px 8px; font-weight:600; border-radius:20px; border-width:1.5px; }
.st-select--por_revisar { background:#f1f5f9; color:#475569; border-color:#cbd5e1; }
.st-select--remitido    { background:#ede9fe; color:#6d28d9; border-color:#c4b5fd; }
.st-select--procesado   { background:#dbeafe; color:#1d4ed8; border-color:#93c5fd; }
.st-select--parcial     { background:#fef3c7; color:#92400e; border-color:#fcd34d; }
.st-select--completado  { background:#dcfce7; color:#166534; border-color:#86efac; }

/* ── Brand Margins section (user modal) ── */
.bm-section        { margin-top:14px; }
.bm-section-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:4px; }
.bm-hint           { font-size:.75rem; color:var(--muted); margin-bottom:8px; }
.bm-col-heads      { display:grid; grid-template-columns:minmax(0,1fr) 76px 96px 34px; gap:6px;
                     font-size:.68rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em;
                     color:var(--muted); padding:0 2px 4px; border-bottom:1px solid var(--border); margin-bottom:4px; }
.bm-row            { display:grid; grid-template-columns:minmax(0,1fr) 76px 96px 34px; gap:6px; align-items:center; margin-bottom:6px; }
/* Resetear flex/min-width que vienen de .filter-input y .filter-select */
.bm-row .bm-select,
.bm-row .bm-input-num { width:100%; min-width:0; flex:none; padding:5px 8px; font-size:.82rem; box-sizing:border-box; }
.bm-row .bm-input-num { text-align:right; }
.bm-row .btn           { width:34px; padding:0; justify-content:center; flex-shrink:0; }

/* Meta bar: estado + totales en una línea */
.pd-meta-bar     { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px;
                   background:#f8fafc; border:1.5px solid var(--border); border-radius:8px;
                   padding:10px 14px; margin-bottom:20px; }
.pd-totals       { display:flex; gap:8px; flex-wrap:wrap; }
.pd-total-pill   { display:flex; flex-direction:column; align-items:center; padding:6px 14px;
                   background:#fff; border:1.5px solid var(--border); border-radius:8px;
                   font-size:.75rem; color:#94a3b8; gap:2px; }
.pd-total-pill strong   { font-size:.95rem; font-weight:700; color:#0f172a; }
.pd-total-pill--debe    { border-color:#fca5a5; background:#fff5f5; }
.pd-total-pill--debe strong { color:#c0261e; }
.pd-total-pill--ok      { border-color:#bbf7d0; background:#f0fdf4; }
.pd-total-pill--ok strong   { color:#16a34a; }

/* Bloques de sección */
.pd-block        { background:#fff; border:1.5px solid var(--border); border-radius:10px;
                   overflow:hidden; margin-bottom:14px; }
.pd-block-header { display:flex; justify-content:space-between; align-items:center;
                   padding:10px 16px; border-bottom:1px solid #f1f5f9; }
.pd-block-title  { font-size:.7rem; font-weight:700; text-transform:uppercase; letter-spacing:.8px;
                   color:#94a3b8; margin:0; padding:10px 16px 0; display:block; }
.pd-block-header + .pd-items,
.pd-block-header + .pd-pagos { border-top: none; }
.pd-empty        { font-size:.88rem; color:#94a3b8; padding:10px 16px 14px; }
.pd-notas        { font-size:.85rem; color:#64748b; padding:8px 16px 12px;
                   border-top:1px solid #f1f5f9; font-style:italic; }

/* Filas de productos — sin tabla, sin scroll horizontal */
.pd-items        { display:flex; flex-direction:column; }
.pd-item         { display:flex; justify-content:space-between; align-items:center;
                   padding:10px 16px; border-bottom:1px solid #f8fafc; gap:12px; }
.pd-item-left    { flex:1; min-width:0; }
.pd-item-name    { display:block; font-weight:600; font-size:.9rem; line-height:1.35; }
.pd-item-sku     { display:block; font-size:.78rem; color:#94a3b8; margin-top:2px; }
.pd-item-right   { display:flex; align-items:center; gap:12px; flex-shrink:0; }
.pd-item-qty     { font-size:.85rem; color:#94a3b8; min-width:28px; text-align:right; }
.pd-item-uprice  { min-width:80px; text-align:right; }
.pd-item-price   { font-weight:700; font-size:.95rem; min-width:80px; text-align:right; }
/* Editor de items del pedido — tarjetas verticales */
.pd-edit-list    { display:flex; flex-direction:column; gap:8px; }
.pd-edit-card    { border:1.5px solid var(--border); border-radius:8px; padding:10px 12px; background:#fff; }
.pd-edit-card__top  { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; margin-bottom:8px; }
.pd-edit-card__name { font-size:.88rem; font-weight:600; color:#0f172a; line-height:1.3; flex:1; }
.pd-edit-del        { flex-shrink:0; color:#94a3b8; }
.pd-edit-card__fields { display:flex; flex-wrap:wrap; gap:10px; align-items:flex-end; }
.pd-edit-field      { display:flex; flex-direction:column; gap:3px; }
.pd-edit-field span { font-size:.72rem; color:var(--muted); font-weight:500; text-transform:uppercase; letter-spacing:.3px; }
.pd-edit-field input.filter-input { padding:5px 8px; font-size:.85rem; }
.pd-edit-sub-wrap strong { font-size:.95rem; font-weight:700; color:#0f172a; }
.pd-edit-add-bar { display:flex; gap:6px; margin-top:8px; }
.pd-edit-footer  { display:flex; justify-content:space-between; align-items:center;
                   margin-top:12px; padding-top:12px; border-top:1.5px solid var(--border); gap:8px; flex-wrap:wrap; }
.pd-edit-footer strong { font-size:.95rem; }
/* Card en búsqueda (catálogo) */
.pd-edit-card--searching { display:flex; gap:8px; align-items:flex-start; }
.pd-catalog-dropdown { display:none; position:absolute; top:100%; left:0; right:0; z-index:200;
  background:var(--surface); border:1.5px solid var(--border); border-radius:8px;
  box-shadow:0 4px 16px rgba(0,0,0,.1); max-height:240px; overflow-y:auto; margin-top:2px; }
.pd-catalog-dropdown.open { display:block; }
.pd-items-footer { display:flex; justify-content:space-between; padding:10px 16px;
                   background:#f8fafc; border-top:1.5px solid #e2e8f0;
                   font-size:.88rem; color:#64748b; }
.pd-items-footer strong { font-size:1rem; color:#0f172a; }

/* Pagos — filas compactas */
.pd-pagos        { display:flex; flex-direction:column; }
.pd-pago         { display:flex; align-items:center; gap:12px; padding:9px 16px;
                   border-bottom:1px solid #f8fafc; font-size:.88rem; flex-wrap:wrap; }
.pd-pago:last-child { border-bottom:none; }
.pd-pago-fecha   { color:#94a3b8; white-space:nowrap; min-width:52px; }
.pd-pago-metodo  { font-weight:600; }
.pd-pago-ref     { color:#94a3b8; flex:1; min-width:80px; }
.pd-pago-del     { padding:2px 8px !important; margin-left:auto; color:#cbd5e1 !important; }
.pd-pago-del:hover { color:var(--red) !important; }
.pd-pago-form    { padding:14px 16px; border-top:1.5px solid #f1f5f9;
                   display:flex; flex-direction:column; gap:10px; }

.admin-modal__box--wide { max-width:820px; max-height:92vh; overflow-y:auto; }

/* ── Historial timeline ───────────────────────────────────────────────────── */
.historial-timeline { position:relative; padding-left:20px; }
.historial-timeline::before { content:''; position:absolute; left:7px; top:0; bottom:0; width:2px; background:var(--border); }
.h-event  { position:relative; margin-bottom:16px; }
.h-dot    { position:absolute; left:-16px; top:4px; width:10px; height:10px; border-radius:50%; background:var(--red); border:2px solid #fff; box-shadow:0 0 0 2px var(--red); }
.h-body   { background:#f8fafc; border-radius:8px; padding:10px 14px; }
.h-evento { font-size:.78rem; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--red); }
.h-desc   { font-size:.88rem; color:var(--text); margin:2px 0; }
.h-time   { font-size:.78rem; color:var(--muted); }

/* ── Entregas ─────────────────────────────────────────────────────────────── */
.entrega-card         { background:var(--surface); border-radius:10px; padding:18px; margin-bottom:16px; box-shadow:var(--shadow); }
.entrega-card__header { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.entrega-qty-input    { width:60px; padding:4px 8px; border:1.5px solid var(--border); border-radius:6px; font-size:.9rem; text-align:center; }

/* ── Pedidos: filtro + crear pedido ──────────────────────────────────────── */
.pedidos-filtros      { margin-bottom: 14px; }
.pedidos-search-input { max-width: 320px; height: 38px; }

.cp-hint { font-size: .82rem; color: #94a3b8; margin: -2px 0 14px; }

/* Cabecera de columnas */
.cp-col-heads {
  display: flex; gap: 6px; align-items: center;
  padding: 6px 10px; background: #f8fafc;
  border: 1.5px solid var(--border); border-radius: 8px 8px 0 0;
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: #94a3b8;
}
.cp-col-producto { flex: 1; min-width: 180px; }
.cp-col-talla    { width: 56px; flex-shrink: 0; }
.cp-col-cant     { width: 52px; flex-shrink: 0; }
.cp-col-precio   { width: 90px; flex-shrink: 0; }
.cp-col-sub      { width: 86px; flex-shrink: 0; text-align: right; font-size: .85rem; font-weight: 600; color: var(--muted); }
.cp-subtotal     { display: flex; align-items: center; justify-content: flex-end; padding: 0 4px; font-size: .85rem; font-weight: 600; color: #0f172a; }
.cp-col-del      { width: 28px; flex-shrink: 0; }

/* Filas de producto */
#cp-rows { border-left: 1.5px solid var(--border); border-right: 1.5px solid var(--border); }
.cp-row  {
  display: flex; gap: 6px; align-items: center;
  padding: 7px 10px; border-bottom: 1px solid #f1f5f9; background: #fff;
}

/* Inputs genéricos */
.cp-input {
  padding: 6px 9px; border: 1.5px solid #e2e8f0; border-radius: 6px;
  font-size: .85rem; font-family: inherit; background: #fff; outline: none;
  transition: border-color .15s;
}
.cp-input:focus { border-color: #94a3b8; }
.cp-input--tal   { width: 56px;  text-align: center; }
.cp-input--num   { width: 52px;  text-align: center; }
.cp-input--price { width: 90px; }
.cp-row-del { padding: 3px 8px !important; color: #cbd5e1 !important; }
.cp-row-del:hover { color: var(--red) !important; }

/* Fila manual (producto inexistente) */
.cp-manual-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cp-manual-nombre { width: 100%; font-size: .85rem; }
.cp-manual-sku    { width: 100%; color: #94a3b8; }
.cp-row--manual   { background: var(--surface); }

/* Buscador con autocompletado */
.cp-search-wrap  { flex: 1; min-width: 0; position: relative; }
.cp-search-wrap.cp-col-producto { min-width: 180px; }
.cp-search-input {
  width: 100%; padding: 6px 10px; border: 1.5px solid #e2e8f0; border-radius: 6px;
  font-size: .85rem; font-family: inherit; background: #fff; outline: none;
}
.cp-search-input:focus { border-color: #94a3b8; }

/* Badge de producto seleccionado */
.cp-selected {
  display: flex; align-items: flex-start; gap: 6px;
  background: #f0f9ff; border: 1.5px solid #bae6fd; border-radius: 6px;
  padding: 6px 8px; min-width: 0; overflow: hidden;
}
.cp-sel-info {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px;
}
.cp-selected-name {
  font-size: .84rem; font-weight: 600; color: #0369a1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-sel-sku {
  font-size: .72rem; color: #475569; font-weight: 500; letter-spacing: .2px;
}
.cp-clear-btn {
  background: none; border: none; cursor: pointer; color: #94a3b8;
  font-size: .85rem; flex-shrink: 0; padding: 0 2px; line-height: 1;
}
.cp-clear-btn:hover { color: var(--red); }

/* Dropdown de resultados */
.cp-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0;
  min-width: 300px; right: 0;
  background: #fff; border: 1.5px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15,23,42,.12); z-index: 800;
  max-height: 300px; overflow-y: auto;
}
.cp-dd-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px; gap: 12px; cursor: pointer;
  border-bottom: 1px solid #f1f5f9; transition: background .1s;
}
.cp-dd-item:last-child { border-bottom: none; }
.cp-dd-item:hover      { background: #f0f9ff; }
.cp-dd-left   { flex: 1; min-width: 0; }
.cp-dd-name   { display: block; font-size: .87rem; font-weight: 600; color: #0f172a;
                line-height: 1.3; overflow-wrap: break-word; }
.cp-dd-sku    { display: block; font-size: .76rem; color: #94a3b8; margin-top: 1px; }
.cp-dd-right  { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.cp-dd-price  { font-size: .85rem; font-weight: 700; color: #0f172a; }
.cp-dd-stock  { font-size: .72rem; color: #16a34a; font-weight: 600; }
.cp-dd-nostock { font-size: .72rem; color: #94a3b8; }
.cp-dd-msg    { padding: 12px 14px; font-size: .85rem; color: #94a3b8; text-align: center; }

/* ── Cuentas por cobrar ───────────────────────────────────────────────────── */
.cxc-filters { margin-bottom:12px; }
.cxc-filters select { padding:6px 12px; border:1.5px solid var(--border); border-radius:6px; font-size:.88rem; cursor:pointer; }
.td-danger  { color:#c0261e; font-weight:600; }
.td-ok      { color:#065f46; font-weight:600; }

/* ── Mis Pedidos (clientes) ───────────────────────────────────────────────── */
#section-mis-pedidos  { padding:32px 0; min-height:60vh; }
.mp-header  { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }
/* Balance global del cliente */
.mp-balance-bar {
  display: flex; gap: 0; border-radius: 10px; overflow: hidden;
  border: 1.5px solid var(--border); margin-bottom: 24px;
}
.mp-balance-bar--debe { border-color: #fca5a5; }
.mp-balance-bar--ok   { border-color: #86efac; }
.mp-balance-item {
  flex: 1; padding: 14px 18px; text-align: center;
  border-right: 1.5px solid var(--border);
  background: var(--surface);
}
.mp-balance-item:last-child { border-right: none; }
.mp-balance-item span   { display: block; font-size: .75rem; color: var(--muted); margin-bottom: 4px; }
.mp-balance-item strong { font-size: 1.1rem; }
.mp-header h2 { font-size:1.4rem; font-weight:700; }
.mp-list    { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:16px; margin-bottom:32px; }
.mp-card    { background:var(--surface); border-radius:10px; padding:18px; box-shadow:var(--shadow); cursor:pointer; transition:transform var(--transition), box-shadow var(--transition); }
.mp-card:hover { transform:translateY(-2px); box-shadow:0 8px 24px rgba(0,0,0,.1); }
.mp-card__top   { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.mp-card__num   { font-weight:700; font-size:.95rem; }
.mp-card__fecha { font-size:.82rem; color:var(--muted); margin-bottom:10px; }
.mp-card__amounts { display:flex; flex-direction:column; gap:2px; font-size:.85rem; }
.mp-empty   { text-align:center; padding:60px 20px; color:var(--muted); }
.mp-sub     { font-size:.85rem; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.5px; margin:16px 0 8px; }
.mp-table   { font-size:.88rem; }
.mp-detail  { background:var(--surface); border-radius:12px; padding:24px; box-shadow:var(--shadow-lg); margin-top:16px; }
.mp-detail__header { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.mp-detail__meta   { display:flex; align-items:center; gap:12px; flex-wrap:wrap; font-size:.88rem; margin-bottom:16px; }
.loader-wrap.small  { padding:20px; }

/* ── Balances tab ─────────────────────────────────────────────────────────── */
.balances-two {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start;
}
.balances-block-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; gap: 12px; flex-wrap: wrap;
}
.balances-block-title {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: #94a3b8; margin: 0;
}
.balances-empty { color: var(--muted); font-size: .9rem; padding: 12px 0; }

/* ── CxC top summary bar ─────────────────────────────────────────────────── */
.cxc-top-resumen {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  font-size: .88rem; color: #64748b; margin-bottom: 20px;
  padding: 10px 16px; background: #fff; border-radius: 8px;
  border: 1.5px solid var(--border);
}

/* ── Cart labels ─────────────────────────────────────────────────────────── */
.cart-label    { font-size: .8rem; font-weight: 600; color: var(--muted); }
.cart-required { color: var(--red); }

/* ── Cart address block ─────────────────────────────────────────────────── */
.cart-addr-block {
  background: #fff8f0; border: 1.5px solid #f59e0b;
  border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
}
.cart-addr-label {
  font-size: .78rem; font-weight: 700; color: #92400e;
  text-transform: uppercase; letter-spacing: .4px;
}
.cart-addr-input {
  width: 100%; padding: 6px 10px; border: 1.5px solid #fcd34d;
  border-radius: 6px; font-size: .88rem; resize: vertical;
  min-height: 56px; outline: none; font-family: inherit; background: #fff;
}
.cart-addr-input:focus { border-color: #f59e0b; }

/* ── Auth invite note ─────────────────────────────────────────────────────── */
.auth-invite {
  margin-top: 18px; font-size: .82rem; color: var(--muted);
  text-align: center; line-height: 1.5;
}

/* ── Ledger value column ─────────────────────────────────────────────────── */
.lr-valor { white-space: nowrap; }

/* ── Responsive ── */
.modal-product__body { grid-template-columns: 1fr 1fr; }

@media (max-width: 860px) {
  .balances-two { grid-template-columns: 1fr; }
  .pd-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .modal-product__body { grid-template-columns: 1fr; }
  .modal--product { top: 0; left: 0; right: 0; bottom: 0; transform: none; width: 100%; max-height: 100vh; border-radius: 0; }
  .nav { display: none; }
  .filters-inner { flex-direction: column; align-items: stretch; }
  .filter-input { min-width: unset; }
  .modal--sm { padding: 32px 22px; }
}

/* ── Banner flotante WhatsApp ─────────────────────────────────────────────── */
.wa-float {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; align-items: center; gap: 10px;
  background: #25d366; color: #fff;
  border-radius: 16px; padding: 12px 18px 12px 14px;
  box-shadow: 0 4px 20px rgba(37,211,102,.5);
  text-decoration: none; font-weight: 600;
  transition: transform .18s ease, box-shadow .18s ease;
}
.wa-float:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(37,211,102,.6); }
.wa-float__icon { flex-shrink: 0; width: 26px; height: 26px; }
.wa-float__text { display: flex; flex-direction: column; gap: 1px; }
.wa-float__label { font-size: .82rem; font-weight: 700; white-space: nowrap; }
.wa-float__sub   { font-size: .74rem; font-weight: 400; opacity: .92; white-space: nowrap; }
body.cart-open .wa-float { opacity: 0; pointer-events: none; transition: opacity .2s; }

/* ── WhatsApp en el candado de precio ────────────────────────────────────── */
.precio-overlay { gap: 3px; }
.wa-precio {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 4px; padding: 5px 10px;
  background: #25d366; color: #fff;
  border-radius: 20px; font-size: .72rem; font-weight: 700;
  text-decoration: none; white-space: nowrap;
  transition: background .15s;
}
.wa-precio:hover { background: #1da851; color: #fff; }
.wa-precio svg  { width: 13px; height: 13px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE MÓVIL
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── 860px: balance columna, tablas admin con scroll horizontal ── */
@media (max-width: 860px) {
  .balance-layout { grid-template-columns: 1fr; }
  .balance-sidebar { position: static; }
  /* Tablas que pueden desbordar en mobile */
  .admin-table      { min-width: 520px; }
  .ledger-table     { min-width: 380px; }
  /* El contenedor del admin hace scroll si el contenido es más ancho */
  .admin-content    { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ── 700px: header compacto, ajustes generales ── */
@media (max-width: 700px) {
  /* ── Header ── */
  .header__inner    { height: auto; min-height: 56px; padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
  .logo-img--header { height: 38px; }
  .user-menu        { gap: 6px; }
  .user-menu__name  { display: none; }
  #btn-login,
  .user-menu .btn   { padding: 7px 11px; font-size: .8rem; }
  .btn--cart        { padding: 7px 11px; }

  /* ── Nav: visible como franja scrollable debajo del logo ── */
  .nav {
    display: flex !important;
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 4px 0 6px;
    gap: 2px;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { font-size: .82rem; padding: 6px 12px; white-space: nowrap; border-radius: 6px; }

  /* ── Contenedor y sección ── */
  .container        { padding: 0 12px; }
  .section-body     { padding: 18px 0 40px; }

  /* ── Filtros ── */
  .filter-select, .filter-input { width: 100%; box-sizing: border-box; }

  /* ── Admin sidebar nav ── */
  .admin-nav        { font-size: .78rem; padding: 6px 10px; }
  .admin-sync-bar   { flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
  .admin-sync-bar .btn { flex: 1 1 auto; min-width: 76px; font-size: .76rem; padding: 5px 8px; text-align: center; }

  /* ── Admin modal ── */
  .admin-modal__box { padding: 18px 14px 16px; width: min(560px, 100vw); border-radius: 0; border-top-left-radius: 12px; border-top-right-radius: 12px; }
  .admin-modal      { align-items: flex-end; }

  /* ── Tarjetas de producto ── */
  .product-card__body { padding: 10px 10px 12px; }

  /* ── Cart drawer ── */
  .cart-drawer      { width: 100vw; max-width: 100vw; border-radius: 16px 16px 0 0; top: auto; bottom: 0; height: 90vh; animation: slideUp .22s ease; }
  .cart-drawer--wide { width: 100vw; max-width: 100vw; }
  @keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }

  /* ── WA float ── */
  .wa-float         { bottom: 12px; right: 12px; padding: 9px 13px 9px 10px; gap: 7px; border-radius: 14px; }
  .wa-float__icon   { width: 20px; height: 20px; }
  .wa-float__label  { font-size: .73rem; }
  .wa-float__sub    { font-size: .65rem; }
}

/* ── 480px: teléfonos pequeños ── */
@media (max-width: 480px) {
  /* Grid de productos a 2 columnas en pantallas muy estrechas */
  .product-grid     { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-card__name { font-size: .82rem; }
  .product-card__img  { height: 140px; object-fit: cover; }

  /* Caja y dash en 1 columna */
  .caja-resumen     { grid-template-columns: 1fr; }
  .dash-grid        { grid-template-columns: 1fr !important; }

  /* Admin content más compacto */
  .admin-content    { padding: 12px 8px; }

  /* Carrusel de marcas ligeramente más pequeño */
  .bm-logo-item     { width: 120px; height: 60px; padding: 0 20px; }
  .bm-logo-img      { max-width: 76px; max-height: 34px; }

  /* Overlay de precio: botón WA en 2 líneas si es necesario */
  .wa-precio        { white-space: normal; text-align: center; justify-content: center; font-size: .68rem; padding: 4px 8px; }
}

/* ── Outlet / Promociones ────────────────────────────────────────────────── */
.nav-outlet { color: #f59e0b !important; font-weight: 700 !important; }
.nav-outlet:hover { background: rgba(245,158,11,.15) !important; color: #fbbf24 !important; }

.outlet-hero {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  padding: 36px 20px 28px;
  text-align: center;
  border-bottom: 3px solid #f59e0b;
}
.outlet-hero__title { font-size: 1.8rem; font-weight: 800; color: #fff; margin-bottom: 6px; }
.outlet-hero__sub   { font-size: .95rem; color: #94a3b8; }

.outlet-tabs {
  display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 4px;
}
.outlet-tab {
  padding: 7px 18px; border-radius: 20px; border: 2px solid var(--border);
  background: var(--surface); font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: all .15s; color: var(--muted);
}
.outlet-tab:hover { border-color: #f59e0b; color: #f59e0b; }
.outlet-tab.active { background: #f59e0b; border-color: #f59e0b; color: #fff; }

/* Tarjeta outlet: badge de descuento en esquina */
.outlet-card { position: relative; overflow: visible; }
.outlet-tag {
  position: absolute; top: -8px; left: 10px; z-index: 2;
  padding: 3px 10px; border-radius: 20px;
  font-size: .7rem; font-weight: 800; letter-spacing: .4px;
  text-transform: uppercase; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.outlet-tag--clo   { background: #dc2626; color: #fff; }
.outlet-tag--sale  { background: #f59e0b; color: #fff; }
.outlet-tag--promo { background: #16a34a; color: #fff; }

.precio-pvp {
  display: block;
  font-size: .72rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 2px;
  letter-spacing: .01em;
}

.outlet-original-row {
  display: flex; align-items: center; gap: 6px; margin-bottom: 2px;
}

