/* ===== Variables ===== */
:root {
  --bg:        #f4f6fb;
  --surface:   #ffffff;
  --border:    #e2e8f0;
  --primary:   #FFA000;
  --primary-h: #e08c00;
  --success:   #22c55e;
  --danger:    #ef4444;
  --info:      #3b82f6;
  --text:      #1e293b;
  --muted:     #64748b;
  --radius:    12px;
  --shadow:    0 1px 4px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.15);
  --header-h:  60px;
  --nav-h:     64px;
  --bar-h:     56px;
}

[data-theme="dark"] {
  --bg:      #1a1f27;
  --surface: #242b35;
  --border:  #2f3844;
  --text:    #f0f0f0;
  --muted:   #8d99a8;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; min-height: 100dvh;
  overflow-x: hidden;
  transition: background .2s, color .2s;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ===== Login Page ===== */
.login-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 28px;
  width: 100%; max-width: 360px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  text-align: center; margin-bottom: 6px;
}
.login-logo img { height: 48px; width: auto; }
.login-subtitle {
  text-align: center; font-size: .82rem;
  color: var(--muted); margin-bottom: 28px;
}
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: .78rem; font-weight: 700;
  color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em;
}
.form-input {
  width: 100%; padding: 13px 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 1rem; color: var(--text); background: var(--surface);
  outline: none; transition: border-color .15s;
  -webkit-appearance: none;
}
.form-input:focus { border-color: var(--primary); }
.btn-login {
  width: 100%; padding: 14px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 50px; cursor: pointer;
  font-size: 1rem; font-weight: 700;
  box-shadow: 0 4px 14px rgba(255,160,0,.35);
  transition: opacity .15s, transform .1s;
  margin-top: 4px;
}
.btn-login:active  { transform: scale(.97); opacity: .9; }
.btn-login:disabled{ opacity: .6; pointer-events: none; }
.error-msg {
  background: #fef2f2; border: 1px solid #fecaca; color: #dc2626;
  border-radius: 8px; padding: 10px 14px; font-size: .85rem;
  margin-bottom: 14px; display: none;
}
.error-msg.show { display: block; }

/* ===== App Shell ===== */
.app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

/* Header */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  padding: 0 16px;
  box-shadow: var(--shadow);
}
.header-logo { display: flex; align-items: center; gap: 10px; }

/* Live indicator */
.live-badge {
  display: flex; align-items: center; gap: 5px;
  font-size: .72rem; color: var(--success); font-weight: 600;
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--success);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.6); }
  70%  { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

.btn-icon {
  background: none; border: 1px solid var(--border);
  color: var(--muted); border-radius: 8px;
  width: 36px; height: 36px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; transition: background .15s;
}
.btn-icon:active { background: var(--border); }
#btnInstall i { animation: install-pulse 2s ease-in-out infinite; }
@keyframes install-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}

/* ===== Campana de notificaciones ===== */
.btn-notif { position: relative; }
.notif-dot {
  position: absolute; top: 5px; right: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #ef4444;
  border: 2px solid var(--surface);
  animation: notif-pulse 2s infinite;
}
@keyframes notif-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,.6); }
  70%  { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

.notif-overlay {
  display: none; position: fixed; inset: 0; z-index: 149;
}
.notif-overlay.open { display: block; }

.notif-panel {
  position: fixed; top: var(--header-h); right: 12px;
  width: min(360px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 8px 32px rgba(0,0,0,.18);
  z-index: 150; display: flex; flex-direction: column;
  max-height: calc(100vh - var(--header-h) - 80px);
  transform: translateY(-10px) scale(.97);
  opacity: 0; pointer-events: none;
  transition: transform .18s ease, opacity .18s ease;
}
.notif-panel.open {
  transform: translateY(6px) scale(1);
  opacity: 1; pointer-events: auto;
}
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.notif-panel-title { font-weight: 700; font-size: .95rem; }
.notif-panel-close {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1rem; padding: 4px 6px;
  border-radius: 6px; transition: background .15s;
}
.notif-panel-close:hover { background: var(--border); }

.notif-list {
  overflow-y: auto; flex: 1;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.notif-item {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  cursor: default; transition: background .12s;
}
.notif-item.unread { background: rgba(255,160,0,.07); }
.notif-item-title {
  font-size: .88rem; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.notif-item-title .unread-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #FFA000;
  flex-shrink: 0;
}
.notif-item-body { font-size: .82rem; color: var(--muted); }
.notif-item-time { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.notif-empty {
  text-align: center; padding: 32px 16px;
  font-size: .88rem; color: var(--muted);
}

/* ===== Bottom Nav ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; box-shadow: 0 -2px 12px rgba(0,0,0,.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: .68rem; font-weight: 600;
  padding: 8px 4px; transition: color .15s; -webkit-tap-highlight-color: transparent;
}
.nav-tab i { font-size: 1.2rem; }
.nav-tab.active { color: var(--primary); }
.nav-tab .nav-badge {
  position: absolute;
  top: 6px; right: calc(50% - 22px);
  background: var(--danger); color: #fff;
  font-size: .62rem; font-weight: 700; border-radius: 10px;
  padding: 1px 5px; min-width: 16px; text-align: center;
}
.nav-tab { position: relative; }

/* ===== Content ===== */
.content {
  flex: 1;
  margin-top: var(--header-h);
  margin-bottom: var(--nav-h);
  padding: 14px;
  overflow-y: auto;
}
/* Cuando la franja de depósito está visible (Pedidos / Depósito), el contenido
   se corre para no quedar tapado por la franja fija. */
.app.has-bar .content { margin-top: calc(var(--header-h) + var(--bar-h)); }

/* ===== Franja: Depósito asignado (sub-header fijo) =====
   La franja usa el mismo fondo que el header para que se sienta como una
   extensión del mismo. Adentro va una tarjeta (.deposito-bar-card) con su
   propio fondo, que es la que muestra el nombre del depósito y el estado.   */
.deposito-bar {
  display: none;
  position: fixed;
  top: var(--header-h); left: 0; right: 0;
  height: var(--bar-h);
  z-index: 99;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  padding: 0 14px 6px;
  box-shadow: var(--shadow);
}
.app.has-bar .deposito-bar { display: flex; }
/* Mientras la franja está visible, el header pierde su sombra y su borde
   inferior para que header + franja se vean como un único bloque alto sin
   línea interna. */
.app.has-bar .header {
  box-shadow: none;
  border-bottom: none;
}

.deposito-bar-card {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
}
.deposito-bar-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary);
  color: #fff;
  font-size: .82rem;
  flex-shrink: 0;
}
.deposito-bar-nombre {
  flex: 1; min-width: 0;
  font-size: .92rem; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.deposito-bar-estado {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .75rem; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  color: var(--danger);
  flex-shrink: 0;
}
.deposito-bar[data-abierto="1"] .deposito-bar-estado {
  background: color-mix(in srgb, var(--success) 12%, var(--surface));
  color: var(--success);
}
.deposito-bar-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
}

/* Section */
.section { display: none; }
.section.active { display: block; }

/* Section header */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-size: 1rem; font-weight: 800;
}
.section-count {
  background: var(--primary); color: #fff;
  font-size: .72rem; font-weight: 700;
  border-radius: 20px; padding: 2px 10px;
}
.section-count.empty { background: var(--border); color: var(--muted); }
#countHistorial { background: var(--border); color: var(--text); }

/* Empty */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 12px; opacity: .3; display: block; }
.empty-state p { font-size: .9rem; }

/* ===== Order Card ===== */
.order-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-top: 5px;
  margin-bottom: 5px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .15s;
}
.order-card:active { box-shadow: var(--shadow-md); }

.card-strip {
  height: 4px;
  background: var(--primary);
}
.card-strip.entregado { background: var(--primary); }

.card-body { padding: 14px; }

.card-row1 {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.card-num   { font-weight: 800; font-size: 1rem; color: var(--primary); }
.card-time  { font-size: .72rem; color: var(--muted); }

.card-cliente { font-weight: 700; font-size: .95rem; margin-bottom: 6px; }

.card-address {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: .82rem; color: var(--muted); margin-bottom: 8px;
}
.card-address i { margin-top: 2px; flex-shrink: 0; font-size: .78rem; color: var(--primary); }

.card-phone {
  display: flex; align-items: center; gap: 6px;
  font-size: .82rem; margin-bottom: 10px;
}
.card-phone i { color: var(--success); font-size: .8rem; }
.card-phone a { color: var(--text); }

.card-items {
  background: var(--bg); border-radius: 8px; padding: 8px 10px;
  margin-bottom: 10px; font-size: .8rem; color: var(--muted);
}
.card-item-row { display: flex; justify-content: space-between; padding: 2px 0; }
.card-item-name{ flex: 1; }
.card-item-qty { color: var(--muted); margin-right: 8px; }
.card-item-price{ font-weight: 600; color: var(--text); white-space: nowrap; }

.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border); padding-top: 10px; gap: 8px;
}
.card-total { font-weight: 800; font-size: 1rem; }

.card-actions { display: flex; gap: 8px; }

.btn-map {
  display: flex; align-items: center; gap: 5px;
  padding: 9px 14px; border-radius: 8px;
  background: rgba(59,130,246,.1); color: var(--info);
  border: 1.5px solid rgba(59,130,246,.3);
  font-size: .78rem; font-weight: 700; cursor: pointer;
  white-space: nowrap; transition: background .15s;
  text-decoration: none;
}
.btn-map:active { background: rgba(59,130,246,.2); }

.btn-deliver {
  display: flex; align-items: center; gap: 5px;
  padding: 9px 14px; border-radius: 8px;
  background: var(--success); color: #fff;
  border: none; font-size: .78rem; font-weight: 700; cursor: pointer;
  white-space: nowrap; transition: opacity .15s, transform .1s;
}
.btn-deliver:active   { opacity: .85; transform: scale(.97); }
.btn-deliver:disabled { opacity: .5; pointer-events: none; }

.btn-liberar {
  display: flex; align-items: center; gap: 5px;
  padding: 9px 12px; border-radius: 8px;
  background: transparent; color: var(--danger);
  border: 1px solid var(--danger); font-size: .78rem; font-weight: 700; cursor: pointer;
  white-space: nowrap; transition: opacity .15s, transform .1s, background .15s;
}
.btn-liberar:hover    { background: var(--danger); color: #fff; }
.btn-liberar:active   { opacity: .85; transform: scale(.97); }
.btn-liberar:disabled { opacity: .5; pointer-events: none; }

/* ===== Estado badge en card ===== */
.card-estado-badge {
  font-size: .7rem; font-weight: 700; border-radius: 20px;
  padding: 3px 10px; letter-spacing: .02em;
}

/* ===== Secciones contenedor de pedidos ===== */
.pedidos-seccion {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
  border: 1.5px solid var(--border);
}
.pedidos-seccion--entregar { border-top: 4px solid var(--success); min-height: 250px; display: flex; flex-direction: column; }
.pedidos-seccion--tomar    { border-top: 4px solid var(--info); min-height: 250px; display: flex; flex-direction: column; }

.pedidos-seccion-header {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 16px;
  font-size: .8rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
}
.pedidos-seccion--entregar .pedidos-seccion-header { color: var(--success); }
.pedidos-seccion--tomar    .pedidos-seccion-header { color: var(--info); }

.pedidos-seccion-count {
  margin-left: auto;
  min-width: 22px; height: 22px;
  border-radius: 11px; padding: 0 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800; color: #fff;
}
.pedidos-seccion--entregar .pedidos-seccion-count { background: var(--success); }
.pedidos-seccion--tomar    .pedidos-seccion-count { background: var(--info); }

.pedidos-seccion-lista {
  padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.pedidos-seccion-lista:empty { padding: 0; }

.pedidos-seccion-empty {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px 16px;
  text-align: center;
  color: var(--muted); font-size: .84rem;
}
.pedidos-seccion-empty i { font-size: 1.4rem; display: block; margin-bottom: 6px; opacity: .4; }

/* ===== Mini tarjeta: Para entregar (verde) ===== */
.mini-card-entregar {
  background: rgba(34,197,94,.10);
  border-radius: 12px;
  border: 1.5px solid rgba(34,197,94,.4);
  border-left: 5px solid var(--success);
  padding: 14px 14px;
  margin-top: 5px;
  margin-bottom: 5px;
}
.mce-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.mce-num  { font-weight: 800; font-size: 1.1rem; color: var(--text); }
.mce-time { font-size: .82rem; color: #fff; }
.mce-info-row {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: .95rem; color: var(--text); line-height: 1.4; margin-bottom: 5px;
}
.mce-info-row i {
  color: var(--success); width: 16px; margin-top: 3px;
  flex-shrink: 0; text-align: center; font-size: .88rem;
}
.mini-card-tomar .mce-info-row i { color: var(--info); }
.mce-tarifa-row,
.mct-tarifa-row {
  margin-top: 5px;
  margin-bottom: 5px;
  font-size: 1.05rem; font-weight: 800; color: var(--text);
  text-align: center;
}
.mce-btn-row {
  display: flex; gap: 8px; margin-top: 8px;
}
.mce-btn-half {
  flex: 1;
  padding: 12px 8px;
  border-radius: 9px; font-size: .95rem; font-weight: 700;
  cursor: pointer; min-height: 48px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: opacity .15s, transform .1s;
}
.mce-btn-half:active   { opacity: .85; transform: scale(.97); }
.mce-btn-half:disabled { opacity: .4; pointer-events: none; }
.mce-btn-ruta {
  background: transparent; color: var(--success);
  border: 1.5px solid var(--success);
}
.mce-btn-ruta:active { background: rgba(34,197,94,.1); }
.mce-btn-wa {
  background: transparent; color: var(--success);
  border: 1.5px solid var(--success);
}
.mce-btn-wa:active { background: rgba(34,197,94,.1); }
.mce-btn-liberar {
  background: transparent; color: var(--success);
  border: 1.5px solid var(--success);
}
.mce-btn-liberar:active { opacity: .75; }
.mce-btn-entregar {
  background: var(--success); color: #fff;
  border: none;
}
.mce-btn-entregar:active { opacity: .85; transform: scale(.97); }

/* ===== Mini tarjeta: Para tomar (azul) ===== */
.mini-card-tomar {
  background: rgba(59,130,246,.10);
  border-radius: 12px;
  border: 1.5px solid rgba(59,130,246,.4);
  border-left: 5px solid var(--info);
  padding: 14px 14px;
  margin-top: 5px;
  margin-bottom: 5px;
}
.mct-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.mct-num  { font-weight: 800; font-size: 1.1rem; color: var(--text); }
.mct-time { font-size: .82rem; color: #fff; }
.mct-info-row {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: .95rem; color: var(--text); line-height: 1.4; margin-bottom: 5px;
}
.mct-info-row i {
  color: var(--info); width: 16px; margin-top: 3px;
  flex-shrink: 0; text-align: center; font-size: .88rem;
}
.mct-meta {
  font-size: .88rem; color: var(--muted);
  margin: 5px 0 0; display: flex; gap: 12px; flex-wrap: wrap;
}
.mct-meta i { color: var(--info); margin-right: 4px; }
.mct-bottom {
  display: flex; gap: 8px; margin-top: 12px;
}
.mct-btn-ruta,
.mct-btn-tomar {
  flex: 1; padding: 12px 8px;
  border-radius: 9px; font-size: 1rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px;
  transition: opacity .15s, transform .1s;
}
.mct-btn-ruta {
  border: 1.5px solid var(--info); background: transparent; color: var(--info);
}
.mct-btn-ruta:active  { background: rgba(59,130,246,.1); }
.mct-btn-ruta:disabled { opacity: .4; pointer-events: none; }
.mct-btn-tomar {
  background: var(--info); color: #fff; border: none;
}
.mct-btn-tomar:active { opacity: .85; transform: scale(.97); }

/* ===== Mapa embebido en card ===== */
.card-map-wrap {
  margin: 10px 0; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
}
.card-map-frame {
  width: 100%; height: 160px; display: block; border: none;
}
.card-map-open {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px; font-size: .78rem; font-weight: 600;
  color: var(--info); background: rgba(59,130,246,.06);
  border-top: 1px solid var(--border); text-decoration: none;
}
.card-map-open:active { background: rgba(59,130,246,.14); }
.card-map-wrap--nocoords { border: none; }
.dash-card-map { margin: 8px 0; }
.dash-card-map .card-map-frame { height: 130px; }

.card-punto {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: .82rem; color: var(--text); margin-top: 5px;
  line-height: 1.35;
}
.card-punto i { color: var(--primary); flex-shrink: 0; margin-top: 2px; font-size: .78rem; }
.btn-mostrar-ruta {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: 10px; padding: 9px;
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary); border-radius: 8px;
  font-size: .82rem; font-weight: 700; cursor: pointer;
  transition: background .15s;
}
.btn-mostrar-ruta:active { background: rgba(var(--primary-rgb, 255,160,0),.1); }
.btn-whatsapp {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: 8px; padding: 9px;
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary); border-radius: 10px;
  font-size: .82rem; font-weight: 700; cursor: pointer;
  transition: background .15s;
}
.btn-whatsapp:active { background: rgba(var(--primary-rgb, 255,160,0),.1); }
.dash-card-travel {
  display: flex; gap: 16px; margin-top: 4px;
  font-size: .82rem; font-weight: 600; color: var(--text);
}
.dash-card-travel i { color: var(--primary); margin-right: 4px; }

.btn-ver-pedido {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: 8px; padding: 10px;
  background: var(--surface2, rgba(0,0,0,.04)); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  font-size: .85rem; font-weight: 600;
}
.btn-ver-pedido:active { background: var(--border); }

/* ===== Modal: detalle de pedido ===== */
.pm-block { margin-bottom: 14px; }
.pm-block-title {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px; letter-spacing: .04em;
}
.pm-row {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: .88rem; color: var(--text); padding: 4px 0;
}
.pm-row i { color: var(--primary); margin-top: 3px; flex-shrink: 0; width: 14px; }
.pm-row a { color: var(--info, #3b82f6); text-decoration: none; }
.pm-items {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.pm-item {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 10px; padding: 9px 12px; font-size: .85rem;
  border-bottom: 1px solid var(--border);
}
.pm-item:last-child { border-bottom: none; }
.pm-item-qty { font-weight: 700; color: var(--primary); }
.pm-item-name { color: var(--text); }
.pm-item-price { font-weight: 600; color: var(--text); }
.pm-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 4px 0; margin-top: 6px;
  border-top: 1.5px solid var(--border);
  font-weight: 800; font-size: .95rem;
}

/* ===== Entregado card (historial) ===== */
.card-entregado { margin-bottom: 20px; }
.card-strip-success { background: var(--success); }
.card-entregado .card-num { color: var(--success); }
.badge-entregado {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,160,0,.12); color: var(--primary);
  border-radius: 20px; padding: 3px 10px; font-size: .72rem; font-weight: 700;
}
.hist-icon-primary { color: var(--success); }
.hist-times {
  display: flex; flex-direction: column; gap: 4px;
  font-size: .8rem; color: var(--muted); margin-top: 8px;
}
.hist-times strong { color: var(--text); }
.hist-meta {
  display: flex; gap: 14px; font-size: .78rem; color: var(--muted); margin-top: 6px;
}
.hist-footer {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-top: 10px; padding-top: 10px; border-top: 1.5px solid var(--border);
}
.badge-cobrar {
  display: inline-flex; align-items: center;
  background: rgba(34,197,94,.15); color: var(--success);
  border-radius: 20px; padding: 3px 10px; font-size: .72rem; font-weight: 700;
}
.hist-monto {
  font-size: 1.4rem; font-weight: 900; color: var(--success); letter-spacing: -.5px;
}

/* ===== Modal Detalle Historial ===== */
.detalle-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.detalle-row:last-of-type { border-bottom: none; }
.detalle-icon { color: var(--success); font-size: .95rem; margin-top: 2px; flex-shrink: 0; }
.detalle-label { font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.detalle-value { font-size: .9rem; color: var(--text); font-weight: 500; margin-top: 2px; }
.detalle-monto {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; padding: 12px 14px;
  background: rgba(34,197,94,.08); border: 1.5px solid rgba(34,197,94,.25); border-radius: 10px;
}
.detalle-monto span:first-child { font-size: .82rem; color: var(--muted); font-weight: 600; }
.detalle-monto span:last-child  { font-size: 1.4rem; font-weight: 900; color: var(--success); }
.detalle-hist-footer {
  padding: 12px 18px; border-top: 1px solid var(--border); flex-shrink: 0;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.detalle-hist-btn-ruta {
  width: 100%; padding: 14px; border: none; border-radius: 12px;
  background: var(--success); color: #fff;
  font-size: .95rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.detalle-hist-btn-ruta:disabled { opacity: .4; cursor: default; }

/* ===== Profile section ===== */
.profile-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 16px;
  box-shadow: var(--shadow); margin-bottom: 14px;
}
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.5rem; margin: 0 auto 12px;
  overflow: hidden;
}
.profile-avatar img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.profile-name  { text-align: center; font-size: 1.1rem; font-weight: 800; margin-bottom: 4px; }
.profile-role  { text-align: center; font-size: .8rem; color: var(--muted); margin-bottom: 20px; }
.profile-row   { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border); font-size: .88rem; }
.profile-label { color: var(--muted); }
.profile-value { font-weight: 600; }

.btn-logout {
  width: 100%; padding: 13px; border: none;
  background: var(--primary); color: #fff; border-radius: 10px;
  font-size: .9rem; font-weight: 700; cursor: pointer; margin-top: 12px;
  transition: background .15s;
}
.btn-logout:active { background: var(--primary-h); }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow); margin-bottom: 10px;
}
.toggle-label { font-size: .88rem; font-weight: 600; }
.toggle-switch { display: flex; align-items: center; cursor: pointer; }
.toggle-switch input { display: none; }
.toggle-track {
  width: 44px; height: 24px; border-radius: 12px;
  background: var(--border); position: relative; transition: background .2s;
}
.toggle-switch input:checked + .toggle-track { background: var(--primary); }
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-track .toggle-thumb { transform: translateX(20px); }

/* ===== Refresh btn (pull-to-refresh hint) ===== */
.refresh-bar {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px; font-size: .75rem; color: var(--muted);
  cursor: pointer; user-select: none;
}
.refresh-bar i { font-size: .8rem; }

/* ===== Loading overlay ===== */
.loading-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.3); align-items: center; justify-content: center;
}
.loading-overlay.show { display: flex; }
.spinner {
  width: 48px; height: 48px;
  border: 4px solid rgba(255,255,255,.3); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 12px); left: 16px; right: 16px;
  background: #1e293b; color: #fff;
  padding: 13px 18px; border-radius: 12px;
  font-size: .88rem; text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s; z-index: 999;
  box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; }
[data-theme="dark"] .toast { background: var(--surface); color: var(--text); border: 1px solid var(--border); }

/* ===== Modal ===== */
.modal-wrap {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.5); backdrop-filter: blur(3px);
  align-items: flex-end; justify-content: center;
}
.modal-wrap.open { display: flex; }
.modal {
  background: var(--surface); border-radius: 20px 20px 0 0;
  width: 100%; max-width: 500px;
  max-height: 80vh; max-height: 80dvh;
  display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.modal-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--border); margin: 10px auto 0;
}
.modal-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 800; }
.modal-close {
  background: none; border: none; color: var(--muted); cursor: pointer;
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 1.1rem;
}
.modal-body { flex: 1; overflow-y: auto; padding: 16px 18px; }

/* ===== Modal Confirmación ===== */
.modal-confirm-wrap { align-items: center; justify-content: center; }
.modal-confirm {
  border-radius: 20px;
  width: calc(100% - 32px);
  max-width: 360px;
  padding: 20px 20px 24px;
}
.confirm-msg {
  font-size: 1rem; color: var(--text); text-align: center;
  line-height: 1.5; margin: 16px 0 24px;
}
.confirm-btns { display: flex; gap: 10px; }
.confirm-btn-cancel {
  flex: 1; padding: 12px; border: 1.5px solid var(--border);
  border-radius: 10px; background: none; color: var(--text);
  font-size: .95rem; cursor: pointer;
}
.confirm-btn-ok {
  flex: 1; padding: 12px; border: none; border-radius: 10px;
  background: var(--primary); color: #fff;
  font-size: .95rem; font-weight: 700; cursor: pointer;
}

/* ===== Modal Ruta ===== */
.modal-ruta-wrap { align-items: center; justify-content: center; }
.modal-ruta {
  border-radius: 20px; width: calc(100% - 24px); max-width: 560px;
  max-height: 95vh; max-height: 95dvh;
  padding: 0; overflow: hidden;
}
.card-pago {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; padding: 6px 10px;
  background: var(--primary)18; border: 1px solid var(--primary)40;
  border-radius: 8px;
}
.card-pago-label { font-size: .82rem; color: #fff; font-weight: 600; }
.card-pago-valor { font-size: 1.2rem; font-weight: 800; color: var(--primary); }

.ruta-modal-title {
  padding: 10px 16px 8px; font-size: .95rem; font-weight: 700;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.ruta-iframe {
  flex: none; aspect-ratio: 1 / 1; width: 100%; border: none; display: block;
}
.btn-cerrar-ruta {
  width: 100%; padding: 14px 16px; flex-shrink: 0;
  background: var(--primary); border: none;
  cursor: pointer; font-size: .95rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: #fff;
}

/* ===== Conexión card (estado conectado / desconectado) ===== */
/* Desconectado: card grande y centrada — llama a la acción. */
.conexion-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  margin-top: 10px;
  margin-bottom: 26px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: border-color .2s, background .2s, padding .2s;
}
.conexion-card-icon {
  width: 56px; height: 56px; margin: 0 auto 10px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--muted) 18%, var(--surface));
  color: var(--muted);
  font-size: 1.4rem;
  transition: background .2s, color .2s, width .2s, height .2s, margin .2s, font-size .2s;
}
.conexion-card-title {
  font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 4px;
}
.conexion-card-text {
  font-size: .82rem; color: var(--muted); margin-bottom: 14px;
}
.conexion-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  border: none; border-radius: 999px;
  background: var(--success); color: #fff;
  font-size: .9rem; font-weight: 700;
  cursor: pointer; user-select: none;
  transition: background .15s, opacity .15s, padding .2s, font-size .2s;
}
.conexion-btn:disabled { opacity: .6; cursor: not-allowed; }

/* Conectado: barra compacta horizontal — deja espacio a la lista. */
.conexion-card.is-conectado {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  text-align: left;
  margin-bottom: 22px;
}
.conexion-card.is-conectado .conexion-card-icon {
  width: 28px; height: 28px; margin: 0;
  background: color-mix(in srgb, var(--success) 18%, var(--surface));
  color: var(--success);
  font-size: .85rem;
}
.conexion-card.is-conectado .conexion-card-title {
  font-size: .85rem; margin: 0; flex: 1;
}
.conexion-card.is-conectado .conexion-card-text { display: none; }
.conexion-card.is-conectado .conexion-btn {
  padding: 6px 14px;
  font-size: .78rem;
  background: var(--danger);
}

.dash-stats {
  display: flex; gap: 12px; margin-bottom: 20px;
}
.dash-stat {
  flex: 1; background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 16px 12px; text-align: center;
  box-shadow: var(--shadow);
}
.dash-stat-icon {
  font-size: 1.1rem; margin-bottom: 6px;
}
.dash-stat--pending .dash-stat-icon    { color: var(--success); }
.dash-stat--disponible .dash-stat-icon { color: var(--info, #3b82f6); }
.dash-stat--delivered .dash-stat-icon  { color: var(--text); }
.dash-stat--cobrar .dash-stat-icon     { color: var(--success); }
.dash-stat--cobrado .dash-stat-icon    { color: var(--primary); }
.dash-stat-num {
  font-size: 2rem; font-weight: 800; line-height: 1;
}
.dash-stat-num--currency { font-size: 1.35rem; }
.dash-stat--pending .dash-stat-num    { color: var(--success); }
.dash-stat--disponible .dash-stat-num { color: var(--info, #3b82f6); }
.dash-stat--delivered .dash-stat-num  { color: var(--text); }
.dash-stat--cobrar .dash-stat-num     { color: var(--success); }
.dash-stat--cobrado .dash-stat-num    { color: var(--primary); }
.dash-stat-label {
  font-size: .72rem; color: var(--muted); font-weight: 600;
  margin-top: 4px; text-transform: uppercase; letter-spacing: .03em;
}

@keyframes stat-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}
.stat-pulsing {
  animation: stat-pulse 1s ease-in-out infinite;
}

.dash-block-title {
  font-size: .78rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}

.dash-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); margin-bottom: 8px;
  overflow: hidden; box-shadow: var(--shadow);
  display: flex; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: box-shadow .15s;
}
.dash-card:active { box-shadow: var(--shadow-md); }

.dash-card-strip {
  width: 4px; flex-shrink: 0; background: var(--primary);
}
.dash-card-strip--ok { background: var(--primary); }

.dash-card-body {
  flex: 1; padding: 11px 13px;
}
.dash-card-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 4px;
}
.dash-card-bottom {
  display: flex; justify-content: space-between; align-items: center;
}
.dash-card-num {
  font-weight: 800; font-size: .9rem; color: var(--primary);
}
.dash-card--delivered .dash-card-num { color: var(--primary); }
.dash-card-time {
  font-size: .7rem; color: var(--muted);
}
.dash-card-cliente {
  font-size: .85rem; font-weight: 600; color: var(--text);
}
.dash-card-total {
  font-size: .85rem; font-weight: 700;
}
.dash-card-addr {
  font-size: .75rem; color: var(--muted);
  margin-top: 5px; display: flex; align-items: flex-start; gap: 5px;
}
.dash-card-addr i { color: var(--primary); margin-top: 1px; flex-shrink: 0; }
.btn-tomar {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: 10px; padding: 10px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 8px; cursor: pointer;
  font-size: .85rem; font-weight: 700;
  box-shadow: 0 3px 10px rgba(255,160,0,.3);
  transition: opacity .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn-tomar:active   { opacity: .85; transform: scale(.97); }
.btn-tomar:disabled { opacity: .5; pointer-events: none; }

/* ===== Misc ===== */
.logo-dark  { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark  { display: block; }

/* ===== Banner: instalar PWA en iOS (prerequisito para push) ===== */
.pwa-installed-screen {
  display: none; position: fixed; inset: 0; z-index: 3000;
  background: var(--bg); color: var(--text);
  flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 24px; text-align: center;
}
.pwa-installed-screen.open { display: flex; }
.pwa-installed-screen img { height: 60px; width: auto; margin-bottom: 28px; }
.pwa-installed-title {
  font-size: 1.4rem; font-weight: 700; margin-bottom: 14px;
}
.pwa-installed-text {
  font-size: .95rem; color: var(--muted); line-height: 1.5;
  margin: 0; max-width: 320px;
}
.pwa-installed-text b { color: var(--primary); }

.ios-install-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  display: none; align-items: flex-end; justify-content: center;
  z-index: 2000; padding: 20px;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.ios-install-backdrop.open { display: flex; animation: fadeIn .2s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

#pwaInstallModal { align-items: center; }

.ios-install-card {
  background: var(--surface); color: var(--text);
  width: 100%; max-width: 420px;
  border-radius: 18px;
  padding: 28px 22px 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .35);
  position: relative;
  animation: slideUp .25s ease-out;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.ios-install-close {
  position: absolute; top: 10px; right: 10px;
  background: transparent; border: none; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%;
  color: var(--muted); font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
}
.ios-install-close:active { background: rgba(0, 0, 0, .06); }

.ios-install-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #f59e0b);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; margin: 0 auto 14px;
  box-shadow: 0 6px 20px rgba(255, 160, 0, .35);
}
.ios-install-title {
  text-align: center; font-size: 1.05rem; font-weight: 700;
  margin-bottom: 8px;
}
.ios-install-text {
  text-align: center; font-size: .88rem;
  color: var(--muted); margin-bottom: 14px;
}
.ios-install-steps {
  margin: 0; padding-left: 22px; font-size: .88rem; line-height: 1.55;
}
.ios-install-steps li { margin-bottom: 6px; }
.ios-install-steps b { color: var(--primary, #FFA000); }

.btn-install-confirm, .btn-install-cancel {
  width: 100%; padding: 13px; border: none; border-radius: 10px;
  font-size: .9rem; font-weight: 700; cursor: pointer;
  transition: background .15s;
}
.btn-install-confirm {
  background: var(--primary); color: #fff; margin-top: 4px;
}
.btn-install-confirm:active { background: var(--primary-h); }
.btn-install-cancel {
  background: transparent; color: var(--muted);
  margin-top: 8px;
}
.btn-install-cancel:active { background: rgba(0,0,0,.04); }

/* ===== Version banner ===== */
.version-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: #1e40af; color: #fff;
  padding: 10px 20px;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  font-size: .9rem; font-weight: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.version-banner button {
  background: #fff; color: #1e40af;
  border: none; border-radius: 6px;
  padding: 5px 14px; font-size: .85rem; font-weight: 600;
  cursor: pointer;
}
.version-banner button:hover { background: #e0e7ff; }

/* ============================================================ */
/* ===== Pedidos pendientes ===== */
/* ============================================================ */
.pedidos-list-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 2px 10px;
}
.pedidos-list-title {
  font-size: .82rem; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.pedidos-list-count {
  background: var(--primary); color: #fff;
  font-size: .72rem; font-weight: 800;
  border-radius: 20px; padding: 2px 10px; min-width: 26px; text-align: center;
}

/* Banner: preparación en curso */
.prep-en-curso-banner {
  display: flex; align-items: center; gap: 12px;
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  border: 1.5px solid var(--primary);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.prep-en-curso-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.prep-en-curso-body { flex: 1; min-width: 0; }
.prep-en-curso-label {
  font-size: .7rem; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: .04em;
}
.prep-en-curso-pedido {
  font-size: .92rem; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prep-en-curso-progreso {
  font-size: .78rem; color: var(--muted); margin-top: 1px;
}
.prep-en-curso-btn {
  background: var(--primary); color: #fff; border: none;
  border-radius: 999px; padding: 9px 16px; font-weight: 700;
  font-size: .82rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  flex-shrink: 0; transition: opacity .15s, transform .1s;
}
.prep-en-curso-btn:active { opacity: .85; transform: scale(.97); }

/* Tarjeta de pedido pendiente */
.pedido-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.pedido-card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.pedido-card-num {
  font-weight: 800; font-size: 1rem; color: var(--primary);
}
.pedido-card-cant {
  font-size: .76rem; color: var(--muted); font-weight: 600;
}
.pedido-card-cliente {
  font-size: .9rem; font-weight: 700; color: var(--text);
  margin-bottom: 8px;
}
.pedido-card-items {
  list-style: none; padding: 8px 10px; margin: 0 0 10px;
  background: var(--bg); border-radius: 8px;
  font-size: .82rem; color: var(--text);
}
.pedido-card-items li {
  padding: 2px 0; line-height: 1.35;
  display: flex; gap: 6px;
}
.pedido-card-items .pi-qty {
  font-weight: 700; color: var(--primary); flex-shrink: 0;
  min-width: 28px;
}
.pedido-card-items .pi-mas {
  color: var(--muted); font-style: italic;
}
.pedido-card-espera {
  font-size: .82rem; color: var(--muted);
  margin-bottom: 8px; text-align: center;
}
.pedido-card-btn {
  width: 100%; padding: 12px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 10px; cursor: pointer;
  font-size: .92rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity .15s, transform .1s;
}
.pedido-card-btn:active   { opacity: .85; transform: scale(.98); }
.pedido-card-btn:disabled { opacity: .45; pointer-events: none; }

/* ============================================================ */
/* ===== Armado (preparación) ===== */
/* ============================================================ */
.armado-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.armado-back {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.armado-back:active { background: var(--bg); }
.armado-header-info { flex: 1; min-width: 0; }
.armado-titulo {
  font-size: 1.05rem; font-weight: 800; color: var(--primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.armado-cliente {
  font-size: .85rem; color: var(--muted); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Barra de progreso */
.armado-progreso {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  margin-bottom: 12px; box-shadow: var(--shadow);
}
.armado-progreso-texto {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
  font-size: .82rem; font-weight: 700;
}
.armado-progreso-texto span:last-child { color: var(--primary); }
.armado-progreso-track {
  height: 10px; background: var(--bg);
  border-radius: 999px; overflow: hidden;
}
.armado-progreso-fill {
  height: 100%; background: var(--primary);
  border-radius: 999px; transition: width .35s ease;
}

/* Botón scan grande */
.armado-scan-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 16px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 12px; cursor: pointer;
  font-size: 1rem; font-weight: 800;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(255,160,0,.35);
  transition: opacity .15s, transform .1s;
}
.armado-scan-btn:active { opacity: .9; transform: scale(.98); }
.armado-scan-btn i { font-size: 1.15rem; }

/* Lista de items a cargar */
.armado-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  transition: background .2s, border-color .2s;
}
.armado-item.is-completo {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.armado-item.is-completo .armado-item-nombre,
.armado-item.is-completo .armado-item-ruta { color: #fff; }
.armado-item.is-completo .armado-item-ruta { opacity: .85; }
.armado-item-img {
  width: 48px; height: 48px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0;
  background: var(--bg);
  cursor: zoom-in;
}
img.armado-item-img:active { opacity: .8; }
.armado-item-img--placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 1.1rem;
}
.armado-item-body { flex: 1; min-width: 0; }
.armado-item-ruta {
  font-size: .68rem; color: var(--muted);
  line-height: 1.2; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.armado-item-nombre {
  font-size: .9rem; font-weight: 700; color: var(--text);
  line-height: 1.3;
}
/* Columna derecha con los dos boxes (contenedor arriba, cantidad abajo) */
.armado-item-side {
  display: flex; flex-direction: column;
  align-items: stretch;
  gap: 4px;
  flex-shrink: 0;
  max-width: 40%;
}
.armado-item-side-box {
  display: inline-flex; align-items: center;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .85rem;
  line-height: 1.15;
  white-space: nowrap;
}
.armado-item-side-cont {
  gap: 6px;
  min-width: 0;
}
.armado-item-side-cont i { color: var(--muted); flex-shrink: 0; }
.armado-item-side-cont span {
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis;
  font-weight: 600;
}
.armado-item-side-cant {
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
}
.armado-item-side-cant:active { opacity: .8; }
.armado-item.is-completo .armado-item-side-box {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.35);
  color: #fff;
}
.armado-item.is-completo .armado-item-side-cont i { color: #fff; }

/* Footer de acciones */
.armado-footer {
  display: flex; gap: 10px;
  margin-top: 16px; margin-bottom: 12px;
}
.armado-btn-cancelar,
.armado-btn-finalizar {
  flex: 1; padding: 13px;
  border-radius: 10px; cursor: pointer;
  font-size: .92rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: opacity .15s, transform .1s;
}
.armado-btn-cancelar {
  background: transparent; color: var(--danger);
  border: 1.5px solid var(--danger);
}
.armado-btn-cancelar:active { opacity: .85; transform: scale(.98); }
.armado-btn-finalizar {
  background: var(--primary); color: #fff;
  border: none;
}
.armado-btn-finalizar:active   { opacity: .9; transform: scale(.98); }
.armado-btn-finalizar:disabled { opacity: .35; pointer-events: none; }

/* ============================================================ */
/* ===== Scanner overlay ===== */
/* ============================================================ */
.scanner-overlay {
  display: none; position: fixed; inset: 0; z-index: 800;
  background: #000;
  flex-direction: column;
}
.scanner-overlay.open { display: flex; }
.scanner-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: rgba(0,0,0,.65);
  color: #fff;
  padding-top: max(14px, env(safe-area-inset-top));
  z-index: 2;
}
.scanner-close {
  background: rgba(255,255,255,.15); color: #fff;
  border: none; width: 36px; height: 36px; border-radius: 50%;
  cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.scanner-close:active { background: rgba(255,255,255,.3); }
.scanner-title {
  font-size: .92rem; font-weight: 700;
  flex: 1;
}
.scanner-flash {
  background: rgba(255,255,255,.15); color: #fff;
  border: none; width: 40px; height: 40px; border-radius: 50%;
  cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .15s, color .15s;
}
.scanner-flash:active { background: rgba(255,255,255,.3); }
.scanner-flash.is-on {
  background: #ffeb3b; color: #1a1a1a;
  box-shadow: 0 0 12px rgba(255,235,59,.65);
}
.scanner-video {
  flex: 1; width: 100%; height: 100%;
  object-fit: cover;
  background: #000;
}
.scanner-frame {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(80vw, 320px); height: 200px;
  border: 3px solid var(--primary);
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.35);
  pointer-events: none;
}
.scanner-result {
  position: absolute;
  left: 16px; right: 16px;
  bottom: calc(80px + env(safe-area-inset-bottom));
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(0,0,0,.7); color: #fff;
  font-size: .92rem; font-weight: 700; text-align: center;
  min-height: 22px;
  z-index: 2;
}
.scanner-result.is-ok    { background: rgba(34,197,94,.92); }
.scanner-result.is-error { background: rgba(239,68,68,.92); }
.scanner-footer {
  padding: 14px 16px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  background: rgba(0,0,0,.65);
  z-index: 2;
}
.scanner-manual {
  width: 100%; padding: 12px;
  background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 10px; cursor: pointer;
  font-size: .88rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.scanner-manual:active { background: rgba(255,255,255,.2); }

/* ===== Modal: zoom de foto de producto ===== */
.imagen-zoom {
  display: none; position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,.92);
  align-items: center; justify-content: center;
  padding: 24px;
  -webkit-tap-highlight-color: transparent;
}
.imagen-zoom.open { display: flex; }
.imagen-zoom-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.imagen-zoom-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top)); right: 14px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.18); color: #fff;
  border: none; cursor: pointer; font-size: 1.15rem;
  display: flex; align-items: center; justify-content: center;
}
.imagen-zoom-close:active { background: rgba(255,255,255,.32); }

/* ============================================================ */
/* ===== Sección Depósito (consulta de productos) ===== */
/* ============================================================ */
.deposito-input-form {
  margin-top: 4px; margin-bottom: 20px;
}
.deposito-input-wrap {
  position: relative;
  display: flex; align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
.deposito-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,160,0,.12);
}
.deposito-input-icon {
  color: var(--muted);
  font-size: .95rem;
  padding-left: 14px;
  flex-shrink: 0;
}
.deposito-input {
  flex: 1; min-width: 0;
  padding: 13px 10px;
  background: transparent;
  border: none; outline: none;
  font-size: 1rem; color: var(--text);
  -webkit-appearance: none;
}
.deposito-input::placeholder { color: var(--muted); }
.deposito-input-btn {
  flex-shrink: 0;
  background: var(--primary); color: #fff;
  border: none; border-radius: 8px;
  width: 38px; height: 38px;
  margin-right: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  transition: opacity .15s, transform .1s;
}
.deposito-input-btn:active { opacity: .85; transform: scale(.95); }

.deposito-scan-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 16px;
  background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 1rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 14px rgba(255,160,0,.35);
  margin-top: 20px;
  margin-bottom: 14px;
  transition: opacity .15s, transform .1s;
}
.deposito-scan-btn:active { opacity: .9; transform: scale(.98); }
.deposito-scan-btn i { font-size: 1.15rem; }

.deposito-empty {
  text-align: center; padding: 36px 24px;
  color: var(--muted);
}
.deposito-empty i {
  font-size: 3rem; opacity: .25; display: block; margin-bottom: 14px;
}
.deposito-empty p { font-size: .92rem; line-height: 1.45; }

.deposito-error {
  background: rgba(239,68,68,.10);
  border: 2px solid rgba(239,68,68,.40);
  border-radius: var(--radius);
  padding: 40px 20px;
  min-height: 180px;
  color: var(--danger);
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
}
.deposito-error i { font-size: 3rem; }

.deposito-producto {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.deposito-producto-head {
  display: flex; gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}
.deposito-producto-img {
  width: 100px; height: 100px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
  cursor: zoom-in;
}
.deposito-producto-img--placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 2rem;
  cursor: default;
}
.deposito-producto-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.deposito-producto-ruta {
  font-size: .7rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  line-height: 1.3;
}
.deposito-producto-nombre {
  font-weight: 700; font-size: 1rem; line-height: 1.25;
}
.deposito-producto-codigos {
  font-size: .78rem; color: var(--muted);
  display: flex; flex-direction: column; gap: 2px;
}
.deposito-producto-codigos strong {
  color: var(--text); font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.deposito-producto-badges {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 12px 14px 0;
}
.deposito-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 700;
  border-radius: 99px; padding: 4px 10px;
}
.deposito-badge--ok      { background: rgba(34,197,94,.12);  color: var(--success); }
.deposito-badge--warn    { background: rgba(245,158,11,.18); color: #b45309; }
.deposito-badge--danger  { background: rgba(239,68,68,.12);  color: var(--danger); }
.deposito-badge--info    { background: rgba(59,130,246,.12); color: var(--info); }
.deposito-badge--muted   { background: var(--bg); color: var(--muted); }

.deposito-aviso {
  background: rgba(59,130,246,.08);
  border: 1px solid rgba(59,130,246,.25);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 12px 14px 0;
  font-size: .82rem;
  color: var(--info);
  display: flex; align-items: center; gap: 8px;
}
.deposito-aviso i { font-size: 1rem; flex-shrink: 0; }

.deposito-stock-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--border);
  margin-top: 14px;
}
.deposito-stock-cell {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
}
.deposito-stock-label {
  font-size: .68rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: 4px;
}
.deposito-stock-value {
  font-size: 1.4rem; font-weight: 800;
  line-height: 1.1;
}
.deposito-stock-value.is-ok      { color: var(--success); }
.deposito-stock-value.is-warn    { color: #b45309; }
.deposito-stock-value.is-danger  { color: var(--danger); }

.deposito-precios {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 14px 14px;
}
.deposito-precio-cell {
  background: var(--bg);
  border-radius: 10px;
  padding: 12px;
}
.deposito-precio-label {
  font-size: .72rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: 4px;
}
.deposito-precio-value {
  font-size: 1.2rem; font-weight: 800;
  line-height: 1.15;
}
.deposito-precio-cell--venta .deposito-precio-value { color: var(--primary); }

/* ── Stepper de stock (corrección rápida sin teclado) ───────── */
.deposito-stepper {
  border-top: 1px solid var(--border);
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.deposito-stepper-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  text-align: center;
}
.deposito-stepper-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px;
}
.deposito-stepper-btn {
  flex: 0 0 auto;
  min-width: 52px; height: 52px;
  padding: 0 8px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem; font-weight: 800;
  cursor: pointer;
  transition: transform .08s, background .15s;
  -webkit-user-select: none; user-select: none;
}
.deposito-stepper-btn:active   { transform: scale(.94); background: var(--row-hover, var(--bg)); }
.deposito-stepper-btn--lg      { min-width: 60px; font-size: .92rem; opacity: .85; }
.deposito-stepper-value {
  flex: 1;
  min-height: 64px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 2rem; font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  transition: border-color .15s, color .15s;
}
.deposito-stepper-value.is-dirty {
  border-color: var(--primary);
  color: var(--primary);
}
.deposito-stepper-field {
  display: flex; flex-direction: column; gap: 6px;
}
.deposito-stepper-field-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  text-align: center;
}
.deposito-stepper-select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem; font-weight: 600;
  font-family: inherit;
  transition: border-color .15s, color .15s;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%2364748b' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.deposito-stepper-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,160,0,.12);
}
.deposito-stepper-select.is-dirty {
  border-color: var(--primary);
  color: var(--primary);
}
.deposito-stepper-select.is-empty {
  border-color: var(--danger);
  color: var(--danger);
}
.deposito-stepper-save {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: .92rem; font-weight: 700;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.deposito-stepper-save:hover:not(:disabled) { background: var(--primary-h); }
.deposito-stepper-save:disabled {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
}

/* ── Producto externo (fallback Coto Digital, EAN sin match local) ──
   Misma paleta azul que .mini-card-tomar de rider, para que se
   distinga de un producto local sin chocar visualmente. */
.deposito-producto--externo {
  background: rgba(59,130,246,.10);
  border: 1.5px solid rgba(59,130,246,.4);
  border-left: 5px solid var(--info);
}
.deposito-badge--externo {
  background: rgba(59,130,246,.18);
  color: var(--info);
}
.deposito-aviso--externo {
  background: rgba(59,130,246,.14);
  border-color: rgba(59,130,246,.45);
  color: var(--info);
  margin-bottom: 20px;
}
.deposito-externo-sucursales {
  padding: 0 14px 8px;
  font-size: .78rem;
  color: var(--muted);
}
.deposito-externo-sucursales strong { color: var(--text); }
.deposito-externo-link {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 0 14px 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(59,130,246,.08);
  color: var(--info);
  font-size: .85rem; font-weight: 600;
  text-decoration: none;
}
.deposito-externo-link:hover { background: rgba(59,130,246,.16); }

.deposito-externo-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0 14px 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: none;
  background: var(--info);
  color: #fff;
  font-size: .92rem; font-weight: 700;
  cursor: pointer;
  width: calc(100% - 28px);
  transition: background .15s, opacity .15s;
}
.deposito-externo-btn:hover:not(:disabled) { background: #2563eb; }
.deposito-externo-btn:disabled {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
}

/* Variante "secundaria" cuando hay dos botones (solo ficha vs ficha+artículo) */
.deposito-externo-btn--secundario {
  background: transparent;
  color: var(--info);
  border: 1.5px solid rgba(59,130,246,.45);
}
.deposito-externo-btn--secundario:hover:not(:disabled) {
  background: rgba(59,130,246,.10);
}

/* ─── Tarjeta ficha (caso 2: producto en catálogo, no en mi depósito) ─── */
.deposito-producto--ficha {
  background: rgba(245,158,11,.08);
  border: 1.5px solid rgba(245,158,11,.35);
  border-left: 5px solid var(--warn, #f59e0b);
}
.deposito-badge--ficha {
  background: rgba(245,158,11,.18);
  color: #b45309;
}
[data-theme="dark"] .deposito-badge--ficha { color: #fbbf24; }
.deposito-aviso--ficha {
  background: rgba(245,158,11,.14);
  border-color: rgba(245,158,11,.45);
  color: #b45309;
  margin-bottom: 14px;
}
[data-theme="dark"] .deposito-aviso--ficha { color: #fbbf24; }
.deposito-ficha-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0 14px 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: none;
  background: var(--warn, #f59e0b);
  color: #fff;
  font-size: .92rem; font-weight: 700;
  cursor: pointer;
  width: calc(100% - 28px);
  transition: background .15s, opacity .15s;
}
.deposito-ficha-btn:hover:not(:disabled) { background: #d97706; }
.deposito-ficha-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ─── Modal alta artículo (precio_compra + stock_inicial) ─── */
.alta-articulo {
  display: none; position: fixed; inset: 0; z-index: 950;
  background: rgba(0,0,0,.55);
  align-items: center; justify-content: center;
  padding: 16px;
  -webkit-tap-highlight-color: transparent;
}
.alta-articulo.open { display: flex; }
.alta-articulo-card {
  background: var(--card, #fff);
  color: var(--text);
  border-radius: 14px;
  width: 100%; max-width: 380px;
  padding: 22px 18px 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  position: relative;
}
.alta-articulo-close {
  position: absolute; top: 10px; right: 10px;
  width: 34px; height: 34px; border-radius: 50%;
  background: transparent; color: var(--muted);
  border: none; cursor: pointer; font-size: 1.05rem;
}
.alta-articulo-close:hover { background: var(--bg); color: var(--text); }
.alta-articulo-titulo {
  font-size: 1.05rem; font-weight: 700;
  margin-bottom: 4px;
}
.alta-articulo-producto {
  font-size: .85rem; color: var(--muted);
  margin-bottom: 18px;
  line-height: 1.3;
}
.alta-articulo-label {
  display: block;
  font-size: .78rem; font-weight: 600;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  margin: 14px 0 6px;
}
.alta-articulo-precio-wrap {
  display: flex; align-items: center;
  background: var(--bg);
  border: 1.5px solid var(--border, rgba(0,0,0,.10));
  border-radius: 10px;
  padding: 0 12px;
}
.alta-articulo-precio-wrap:focus-within {
  border-color: var(--info, #3b82f6);
}
.alta-articulo-precio-sym {
  font-size: 1.1rem; font-weight: 700; color: var(--muted);
  margin-right: 6px;
}
.alta-articulo-precio {
  flex: 1;
  border: none; background: transparent; outline: none;
  padding: 12px 0;
  font-size: 1.15rem; font-weight: 700;
  color: var(--text);
  text-align: right;
}
.alta-articulo-stock-controls {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: 6px;
  align-items: center;
}
.alta-articulo-stepper {
  background: var(--bg);
  border: 1.5px solid var(--border, rgba(0,0,0,.10));
  color: var(--text);
  border-radius: 10px;
  padding: 10px 10px;
  font-size: .9rem; font-weight: 700;
  cursor: pointer;
  min-width: 42px;
}
.alta-articulo-stepper--lg { min-width: 52px; }
.alta-articulo-stepper:active { background: var(--border, rgba(0,0,0,.12)); }
.alta-articulo-stock {
  border: 1.5px solid var(--border, rgba(0,0,0,.10));
  background: var(--bg);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 6px;
  font-size: 1.15rem; font-weight: 700;
  text-align: center;
  outline: none;
  min-width: 0;
}
.alta-articulo-stock:focus { border-color: var(--info, #3b82f6); }
.alta-articulo-confirm {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  margin-top: 18px;
  padding: 13px 14px;
  border-radius: 10px;
  border: none;
  background: var(--info, #3b82f6);
  color: #fff;
  font-size: .95rem; font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.alta-articulo-confirm:hover:not(:disabled) { background: #2563eb; }
.alta-articulo-confirm:disabled { opacity: .6; cursor: not-allowed; }

/* Modal: confirmar abandonar preparación */
.abandonar-modal {
  display: none; position: fixed; inset: 0; z-index: 960;
  background: rgba(0,0,0,.55);
  align-items: center; justify-content: center;
  padding: 16px;
  -webkit-tap-highlight-color: transparent;
}
.abandonar-modal.open { display: flex; }
.abandonar-modal-card {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%; max-width: 380px;
  padding: 22px 20px 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  position: relative;
  text-align: center;
}
.abandonar-modal-close {
  position: absolute; top: 10px; right: 10px;
  width: 34px; height: 34px; border-radius: 50%;
  background: transparent; color: var(--muted);
  border: none; cursor: pointer; font-size: 1.05rem;
}
.abandonar-modal-close:hover { background: var(--bg); color: var(--text); }
.abandonar-modal-icon {
  font-size: 2.2rem;
  color: var(--danger, #dc2626);
  margin-bottom: 8px;
}
.abandonar-modal-titulo {
  font-size: 1.1rem; font-weight: 700;
  margin-bottom: 10px;
}
.abandonar-modal-body {
  font-size: .9rem; color: var(--muted);
  line-height: 1.45;
  margin-bottom: 18px;
  text-align: left;
}
.abandonar-modal-body strong { color: var(--text); }
.abandonar-modal-actions {
  display: flex; gap: 8px;
}
.abandonar-modal-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 10px;
  border-radius: 10px;
  border: none;
  font-size: .95rem; font-weight: 700;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.abandonar-modal-btn--cancel {
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border, rgba(0,0,0,.10));
}
.abandonar-modal-btn--cancel:active { background: var(--border, rgba(0,0,0,.12)); }
.abandonar-modal-btn--confirm {
  background: var(--danger, #dc2626);
  color: #fff;
}
.abandonar-modal-btn--confirm:active { opacity: .9; }
