/* ============================================================
   CALTEJ PEDIDOS - Estilo moderno (identidad: rojo #C00000)
   ============================================================ */
@import url('https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css');
:root {
  --rojo: #C00000;
  --rojo-hover: #a00;
  --rojo-suave: rgba(192, 0, 0, 0.08);
  --negro: #1a1a1a;
  --gris-oscuro: #2E2E2E;
  --gris: #6b7280;
  --gris-claro: #f5f5f7;
  --borde: rgba(0, 0, 0, 0.08);
  --blanco: #ffffff;
  --sombra: 0 2px 12px rgba(0, 0, 0, 0.06);
  --sombra-lg: 0 4px 24px rgba(0, 0, 0, 0.08);
  --radio: 12px;
  --radio-lg: 16px;
  --estado-ingresado: #6b7280;
  --estado-tejiendo: #ea580c;
  --estado-en-pausa: #ca8a04;
  --estado-realizado: #0f766e;
  --estado-empacado: #2563eb;
  --estado-despachado: #7c3aed;
  --estado-entregado: #059669;
  --estado-cancelado: #dc2626;
  /* Estados de ticket (soporte) */
  --ticket-abierto: #166534;
  --ticket-en_proceso: #92400e;
  --ticket-resuelto: #1e40af;
  --ticket-cerrado: #64748b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--gris-claro);
  color: var(--negro);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: var(--rojo); text-decoration: none; }
a:hover { color: var(--rojo-hover); text-decoration: underline; }

/* Layout: cabecera + contenido (sidebar + main) */
.app-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.layout {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}

@media (min-width: 769px) {
  .layout { flex-direction: row; overflow: visible; }
}

/* ========== Cabecera ========== */
.cabecera {
  flex-shrink: 0;
  background: var(--blanco);
  border-bottom: 1px solid var(--borde);
  box-shadow: var(--sombra);
  position: sticky;
  top: 0;
  z-index: 100;
}

.cabecera__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  max-width: 100%;
}

.cabecera__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--negro);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.cabecera__logo:hover {
  text-decoration: none;
  opacity: 0.9;
}

.cabecera__logo-img {
  display: block;
  height: 40px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  object-position: left center;
}

.cabecera__right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cabecera__notif {
  position: relative;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--radio);
  color: var(--gris);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.cabecera__notif:hover {
  background: var(--rojo-suave);
  color: var(--rojo);
}

/* Punto rojo cuando hay notificaciones nuevas (siempre visible) */
.cabecera__notif--tiene-nuevas {
  position: relative;
}

.cabecera__notif--tiene-nuevas::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  background: var(--rojo);
  border-radius: 50%;
}

/* Solo punto rojo (::after), sin número en el badge */
.cabecera__notif-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.cabecera__notif-badge:empty,
.cabecera__notif-badge[data-count="0"] {
  display: none;
}

.cabecera__notif-wrap {
  position: relative;
}

.cabecera__notif-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.35rem;
  width: 360px;
  max-width: calc(100vw - 2rem);
  max-height: 420px;
  display: flex;
  flex-direction: column;
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra-lg);
  z-index: 200;
}

@media (max-width: 768px) {
  .cabecera__notif-dropdown {
    position: fixed;
    top: 3.5rem;
    left: 1rem;
    right: 1rem;
    width: auto;
    max-width: none;
    max-height: min(420px, 55vh);
    margin-top: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .cabecera__notif-dropdown-list {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }
}

.cabecera__notif-dropdown[hidden] {
  display: none !important;
}

.cabecera__notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--borde);
  gap: 0.5rem;
  min-width: 0;
}

.cabecera__notif-dropdown-title {
  font-weight: 600;
  font-size: 0.9375rem;
  flex-shrink: 0;
}

.cabecera__notif-dropdown-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cabecera__notif-dropdown-marcar {
  border: none;
  background: none;
  color: var(--rojo);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 360px) {
  .cabecera__notif-dropdown-marcar {
    white-space: normal;
    text-align: right;
  }
}

.cabecera__notif-dropdown-marcar:hover {
  background: var(--rojo-suave);
}

.cabecera__notif-dropdown-cerrar {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--gris);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cabecera__notif-dropdown-cerrar:hover {
  background: var(--gris-claro);
  color: var(--negro);
}

.cabecera__notif-dropdown-list {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.cabecera__notif-dropdown-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--gris);
  font-size: 0.9rem;
}

.cabecera__notif-item {
  border-bottom: 1px solid var(--borde);
}

.cabecera__notif-item:last-child {
  border-bottom: none;
}

.cabecera__notif-item-inner {
  display: block;
  padding: 0.75rem 1rem;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.cabecera__notif-item-inner:hover {
  background: var(--gris-claro);
}

.cabecera__notif-item--no-leida {
  background: var(--rojo-suave);
}

.cabecera__notif-item--no-leida .cabecera__notif-item-inner:hover {
  background: rgba(192, 0, 0, 0.12);
}

.cabecera__notif-item-titulo {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.2rem;
}

.cabecera__notif-item-mensaje {
  display: block;
  font-size: 0.8125rem;
  color: var(--gris);
  line-height: 1.35;
}

.cabecera__notif-item-fecha {
  display: block;
  font-size: 0.75rem;
  color: var(--gris);
  margin-top: 0.35rem;
}

/* ========== Comunicado: solo imagen, clic fuera cierra ========== */
.comunicado-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  cursor: pointer;
}

.comunicado-backdrop[hidden] {
  display: none;
}

.comunicado-imagen-wrap {
  max-width: 100%;
  max-height: calc(100vh - 2rem);
  aspect-ratio: 35 / 25;
  cursor: default;
}

.comunicado-imagen-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cabecera__user-wrap {
  position: relative;
}

.cabecera__user-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem 0.4rem 0.4rem;
  border: none;
  background: transparent;
  border-radius: var(--radio);
  color: var(--negro);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.cabecera__user-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.cabecera__user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--rojo);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
}

.cabecera__user-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cabecera__user-chevron {
  flex-shrink: 0;
  transition: transform 0.2s;
}

.cabecera__user-btn[aria-expanded="true"] .cabecera__user-chevron {
  transform: rotate(180deg);
}

.cabecera__user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.35rem;
  min-width: 220px;
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra-lg);
  padding: 0.5rem 0;
  z-index: 200;
}

.cabecera__user-dropdown-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--borde);
}

.cabecera__user-dropdown-header strong {
  display: block;
  font-size: 0.9375rem;
}

.cabecera__user-rol {
  font-size: 0.75rem;
  color: var(--gris);
  text-transform: capitalize;
}

.cabecera__user-dropdown-item {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--negro);
  font-size: 0.9375rem;
  transition: background 0.2s;
}

.cabecera__user-dropdown-item:hover {
  background: var(--rojo-suave);
  color: var(--rojo);
  text-decoration: none;
}

.cabecera__user-dropdown-item--logout {
  color: var(--gris);
  border-top: 1px solid var(--borde);
  margin-top: 0.25rem;
  padding-top: 0.75rem;
}

.cabecera__user-dropdown-item--logout:hover {
  color: var(--rojo);
}

/* ========== Sidebar fijo al hacer scroll ========== */
.sidebar {
  position: fixed;
  left: 0;
  top: 64px; /* debajo de la cabecera (padding + logo) */
  bottom: 0;
  width: 260px;
  background: var(--blanco);
  border-right: 1px solid var(--borde);
  padding: 0.75rem 0;
  box-shadow: var(--sombra-lg);
  overflow: hidden;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

/* Menú solo iconos: al pasar el mouse se despliega a la derecha; nombres en la misma línea que cada icono */
.sidebar--icons-only {
  width: 72px;
  transition: width 0.6s ease;
}

.sidebar--icons-only:hover {
  width: 260px;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-top: 0.75rem;
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 1.25rem;
  margin: 0 0.5rem;
  border-radius: var(--radio);
  color: var(--gris);
  font-weight: 500;
  font-size: 0.9375rem;
  position: relative;
  white-space: nowrap;
}

.sidebar__item:hover {
  background: var(--rojo-suave);
  color: var(--rojo);
  text-decoration: none;
}

.sidebar__item.activo {
  background: var(--rojo-suave);
  color: var(--rojo);
  font-weight: 600;
  text-decoration: none;
}

.sidebar__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar__icon svg {
  width: 22px;
  height: 22px;
}

.sidebar__label {
  overflow: hidden;
}

/* Iconos fijos en columna de 72px; al hacer hover en el sidebar se despliegan los nombres a la derecha */
.sidebar--icons-only .sidebar__item {
  padding: 0.65rem 0;
  justify-content: flex-start;
  margin: 0;
  gap: 0;
}

.sidebar--icons-only .sidebar__icon {
  width: 72px;
  min-width: 72px;
  flex-shrink: 0;
  margin: 0;
}

.sidebar--icons-only .sidebar__label {
  overflow: hidden;
  opacity: 0;
  width: 0;
  padding: 0;
  margin: 0;
  white-space: nowrap;
  transition: opacity 0.35s ease, width 0.35s ease, padding 0.35s ease;
}

/* Al hacer hover en el menú: se despliega a la derecha y los nombres quedan en la misma línea que cada icono */
.sidebar--icons-only:hover .sidebar__label {
  opacity: 1;
  width: auto;
  padding: 0 1rem 0 0.5rem;
  margin: 0;
}

.sidebar__item.sidebar__item--logout {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--borde);
}

.sidebar__item.sidebar__item--logout .sidebar__label {
  margin-top: 0;
}

.sidebar__item--logout,
.sidebar__item--logout:hover {
  color: var(--gris);
}

.sidebar__item--logout:hover {
  background: rgba(0, 0, 0, 0.04);
}

.sidebar__item--logout.activo {
  background: transparent;
  color: var(--gris);
}

/* Área principal: empieza a la derecha de los iconos del menú (72px) */
.main {
  flex: 1;
  margin-left: 72px;
  padding: 1.75rem 2rem;
  padding-bottom: 5rem; /* Espacio para la burbuja de mensajes (no tapa Saldo, etc.) */
  background: transparent;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.main h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--negro);
  margin: 0 0 1.5rem 0;
  letter-spacing: -0.025em;
}

.main__intro {
  color: var(--gris);
  font-size: 0.9375rem;
  margin: -0.5rem 0 1.5rem 0;
}

.form-hint {
  display: block;
  font-size: 0.8125rem;
  color: var(--gris);
  margin-top: 0.35rem;
}

.config-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.config-form__grid--dias {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.config-form__section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem 0;
}

.config-form__grid--horario {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

/* Página Mi cuenta: formulario en dos columnas, sin celdas vacías */
.pagina-mi-cuenta .mi-cuenta-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 2rem;
  width: 100%;
  max-width: 100%;
}
.pagina-mi-cuenta .mi-cuenta-form .form-group--full {
  grid-column: 1 / -1;
}
.pagina-mi-cuenta .mi-cuenta-form input,
.pagina-mi-cuenta .mi-cuenta-form textarea {
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 600px) {
  .pagina-mi-cuenta .mi-cuenta-form {
    grid-template-columns: 1fr;
  }
}

.main h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--negro);
  margin: 1.5rem 0 0.75rem 0;
}

/* Botones */
.btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: var(--radio);
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background 0.2s, transform 0.15s;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--rojo);
  color: var(--blanco);
}

.btn-primary:hover {
  background: var(--rojo-hover);
  color: var(--blanco);
}

.btn-secondary {
  background: var(--gris-oscuro);
  color: var(--blanco);
}

.btn-secondary:hover {
  background: var(--negro);
  color: var(--blanco);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--rojo);
  color: var(--rojo);
}

.btn-outline:hover {
  background: var(--rojo-suave);
  color: var(--rojo);
  text-decoration: none;
}

/* Acciones ítem (cliente): todos los botones mismo estilo outline */
.acciones-item-cliente {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.acciones-item-cliente .btn {
  background: transparent;
  border: 1px solid var(--rojo);
  color: var(--rojo);
}
.acciones-item-cliente .btn:hover {
  background: var(--rojo-suave);
  color: var(--rojo);
  text-decoration: none;
}

/* Chat pedido: botón flotante global (todas las páginas) */
.chat-pedido-widget { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999; }
.chat-pedido-btn {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.25rem; border-radius: 2rem; border: none;
  background: var(--rojo); color: var(--blanco); cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2); font-weight: 600; font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.chat-pedido-btn { position: relative; }
.chat-pedido-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.25); color: var(--blanco); }
.chat-pedido-btn svg { flex-shrink: 0; }
.chat-pedido-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 1.25rem; height: 1.25rem; padding: 0 0.35rem;
  background: var(--blanco); color: var(--rojo); border-radius: 999px;
  font-size: 0.7rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.chat-pedido-conv-item {
  display: block; width: 100%; padding: 0.6rem 0.75rem; border-radius: 8px; margin-bottom: 0.35rem;
  background: #f8fafc; border: 1px solid var(--borde); color: inherit; text-align: left; cursor: pointer;
  transition: background 0.15s; font-family: inherit; font-size: inherit;
}
.chat-pedido-conv-item:hover { background: #e2e8f0; }
.chat-pedido-conv-item strong { display: block; font-size: 0.9rem; margin-bottom: 0.2rem; }
.chat-pedido-conv-item span { font-size: 0.8rem; color: var(--gris); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-pedido-conv-item .chat-pedido-conv-unread {
  display: inline-block; font-size: 0.7rem; padding: 0.15rem 0.45rem; border-radius: 999px; margin-left: 0.35rem;
  background: var(--rojo); color: var(--blanco); font-weight: 600; line-height: 1.2;
}
.chat-pedido-conv-item.chat-pedido-conv-item-unread {
  background: #fff5f5; border-color: #fecaca;
}
.chat-pedido-conv-item.chat-pedido-conv-item-unread:hover { background: #fee2e2; }
.chat-pedido-nuevo-wrap { margin-bottom: 0.75rem; }
.chat-pedido-btn-nuevo {
  display: block; width: 100%; padding: 0.65rem 1rem; border-radius: 8px; border: 1px solid #fecaca;
  background: #fff5f5; color: var(--rojo); font-weight: 600; font-size: 0.95rem; cursor: pointer; text-align: center;
}
.chat-pedido-btn-nuevo:hover { background: var(--rojo-suave); color: #b91c1c; border-color: #f87171; }
.chat-pedido-panel {
  position: absolute; bottom: 100%; right: 0; margin-bottom: 0.5rem;
  width: 380px; max-width: calc(100vw - 2rem); max-height: 420px;
  background: var(--blanco); border-radius: var(--radio-lg); box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-pedido-panel[hidden] { display: none !important; }
.chat-pedido-panel-header {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--borde); background: #f8fafc;
}
.chat-pedido-volver { flex-shrink: 0; background: none; border: none; cursor: pointer; font-size: 0.85rem; color: var(--rojo); padding: 0.2rem 0; }
.chat-pedido-volver:hover { text-decoration: underline; }
.chat-pedido-panel-header .chat-pedido-panel-title { margin: 0; font-size: 0.95rem; font-weight: 600; flex: 1; min-width: 0; }
.chat-pedido-btn-nuevo-header {
  flex-shrink: 0; padding: 0.35rem 0.65rem; border-radius: 6px; border: 1px solid #fecaca;
  background: #fff5f5; color: var(--rojo); font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.chat-pedido-btn-nuevo-header:hover { background: var(--rojo-suave); color: #b91c1c; }
.chat-pedido-estado-wrap { flex-shrink: 0; position: relative; display: flex; align-items: center; gap: 0.35rem; }
.chat-pedido-estado-wrap label { font-size: 0.75rem; color: var(--gris); }
.ticket-estado-btn { cursor: pointer; border: none; font-size: 0.75rem; font-weight: 600; padding: 0.35rem 0.6rem; border-radius: 6px; transition: filter 0.15s; }
.ticket-estado-btn:hover { filter: brightness(0.96); }
.ticket-estado-dropdown { position: fixed; z-index: 1201; background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra-lg); min-width: 140px; padding: 0.25rem; }
.ticket-estado-dropdown .ticket-estado-opcion { display: block; width: 100%; text-align: left; padding: 0.4rem 0.6rem; border: none; background: none; cursor: pointer; border-radius: 6px; font-size: 0.85rem; font-weight: 600; transition: filter 0.15s; }
.ticket-estado-dropdown .ticket-estado-opcion:hover { filter: brightness(0.96); }
.ticket-estado-opcion--abierto { background: rgba(22, 101, 52, 0.14); color: var(--ticket-abierto); }
.ticket-estado-opcion--en_proceso { background: rgba(146, 64, 14, 0.14); color: var(--ticket-en_proceso); }
.ticket-estado-opcion--resuelto { background: rgba(30, 64, 175, 0.14); color: var(--ticket-resuelto); }
.ticket-estado-opcion--cerrado { background: rgba(100, 116, 139, 0.2); color: var(--ticket-cerrado); }
.ticket-estado-btn.ticket-estado-btn--abierto { background: rgba(22, 101, 52, 0.14); color: var(--ticket-abierto); }
.ticket-estado-btn.ticket-estado-btn--en_proceso { background: rgba(146, 64, 14, 0.14); color: var(--ticket-en_proceso); }
.ticket-estado-btn.ticket-estado-btn--resuelto { background: rgba(30, 64, 175, 0.14); color: var(--ticket-resuelto); }
.ticket-estado-btn.ticket-estado-btn--cerrado { background: rgba(100, 116, 139, 0.2); color: var(--ticket-cerrado); }
.ticket-estado-badge-solo { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0.35rem 0.6rem; border-radius: 6px; }
.ticket-estado-badge-solo.ticket-estado-btn--abierto { background: rgba(22, 101, 52, 0.14); color: var(--ticket-abierto); }
.ticket-estado-badge-solo.ticket-estado-btn--en_proceso { background: rgba(146, 64, 14, 0.14); color: var(--ticket-en_proceso); }
.ticket-estado-badge-solo.ticket-estado-btn--resuelto { background: rgba(30, 64, 175, 0.14); color: var(--ticket-resuelto); }
.ticket-estado-badge-solo.ticket-estado-btn--cerrado { background: rgba(100, 116, 139, 0.2); color: var(--ticket-cerrado); }
.chat-pedido-cerrar { background: none; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--gris); padding: 0 0.25rem; }
.chat-pedido-cerrar:hover { color: var(--negro); }
.chat-pedido-estado-dentro {
  padding: 0.5rem 0.75rem; margin: -0.75rem -0.75rem 0.5rem -0.75rem; background: var(--fondo); border-bottom: 1px solid var(--borde);
  font-size: 0.85rem; color: var(--gris);
}
.chat-pedido-list {
  flex: 1; min-height: 240px; max-height: 280px; overflow-y: auto; padding: 0.75rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.chat-pedido-msg { max-width: 88%; padding: 0.5rem 0.75rem; border-radius: 12px; font-size: 0.9rem; white-space: pre-wrap; word-break: break-word; }
.chat-pedido-msg.cliente { align-self: flex-end; background: var(--rojo-suave); color: #1e293b; border-bottom-right-radius: 4px; }
.chat-pedido-msg.admin { align-self: flex-start; background: #e2e8f0; color: #1e293b; border-bottom-left-radius: 4px; }
.chat-pedido-msg-meta { font-size: 0.7rem; color: var(--gris); margin-top: 0.2rem; }
.chat-pedido-form { padding: 0.75rem; border-top: 1px solid var(--borde); display: flex; gap: 0.5rem; align-items: flex-end; }
.chat-pedido-form textarea { flex: 1; resize: none; padding: 0.5rem; border: 1px solid var(--borde); border-radius: 8px; font-family: inherit; }
.chat-pedido-form .btn { flex-shrink: 0; }
.chat-pedido-sin-pedido { padding: 1rem; text-align: center; color: var(--gris); font-size: 0.9rem; }
.chat-pedido-sin-pedido a { color: var(--rojo); }

/* Móvil: burbuja solo icono; posición original. El contenido tiene padding extra para no quedar tapado */
@media (max-width: 768px) {
  .chat-pedido-widget {
    bottom: calc(64px + 1rem + env(safe-area-inset-bottom, 0));
    right: 1rem;
  }
  .chat-pedido-btn .chat-pedido-btn-text { display: none; }
  .chat-pedido-btn {
    padding: 0.75rem;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    justify-content: center;
  }
  .chat-pedido-btn svg { margin: 0; }
}

/* Formularios */
input, select, textarea {
  padding: 0.65rem 1rem;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--rojo);
  box-shadow: 0 0 0 3px var(--rojo-suave);
}

label { display: block; margin-bottom: 0.35rem; font-weight: 500; color: var(--negro); }

.form-group { margin-bottom: 1.25rem; }
.form-group label { margin-bottom: 0.4rem; }

.error { color: var(--rojo); font-size: 0.875rem; margin-top: 0.25rem; }

/* Alertas */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radio);
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
}

.alert-success {
  background: rgba(5, 150, 105, 0.1);
  color: #047857;
}

.alert-danger {
  background: rgba(192, 0, 0, 0.1);
  color: var(--rojo);
}

/* Cards dashboard */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--radio-lg);
  padding: 1.5rem;
  box-shadow: var(--sombra);
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: var(--sombra-lg);
  transform: translateY(-2px);
}

.card.rojo { border-left: 4px solid var(--rojo); }
.card.negro { border-left: 4px solid var(--gris-oscuro); }

.card .numero {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--negro);
  letter-spacing: -0.02em;
}

.card .titulo {
  color: var(--gris);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

/* Tablas */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--blanco);
  border-radius: var(--radio-lg);
  overflow: hidden;
  box-shadow: var(--sombra);
  border: 1px solid var(--borde);
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--borde);
}

th {
  background: rgba(0, 0, 0, 0.02);
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--gris);
  letter-spacing: 0.02em;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(0, 0, 0, 0.01); }

table a { font-weight: 500; }

/* Scroll horizontal en tablas (móvil y desktop cuando hay overflow) - mismo diseño que Mis pedidos, sin marco extra */
.table-responsive,
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
  margin-bottom: 1rem;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
}

.badge-ingresado { background: #f3f4f6; color: var(--estado-ingresado); }
.badge-tejiendo { background: rgba(234, 88, 12, 0.14); color: var(--estado-tejiendo); }
.badge-en_pausa { background: rgba(250, 204, 21, 0.24); color: var(--estado-en-pausa); }
.badge-realizado { background: rgba(15, 118, 110, 0.12); color: var(--estado-realizado); }
.badge-empacado { background: rgba(37, 99, 235, 0.12); color: var(--estado-empacado); }
.badge-despachado { background: rgba(124, 58, 237, 0.12); color: var(--estado-despachado); }
.badge-entregado { background: rgba(5, 150, 105, 0.12); color: var(--estado-entregado); }
.badge-cancelado { background: rgba(220, 38, 38, 0.12); color: var(--estado-cancelado); }
.badge-stock { background: rgba(59, 130, 246, 0.14); color: #1d4ed8; }

/* Barra progreso incentivos */
.progress-bar-wrap {
  background: #e5e7eb;
  border-radius: var(--radio);
  height: 10px;
  overflow: hidden;
  margin: 0.75rem 0;
  max-width: 320px;
}

.progress-bar {
  height: 100%;
  background: var(--rojo);
  border-radius: var(--radio);
  transition: width 0.4s ease;
}

.progress-bar-wrap--dashboard {
  max-width: 100%;
  height: 12px;
}

/* ========== Dashboard inicio (cliente + staff) ========== */
.dashboard-hero {
  margin-bottom: 2rem;
}

.dashboard-hero__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--negro);
  margin: 0 0 0.35rem 0;
  letter-spacing: -0.03em;
}

.dashboard-hero__sub {
  color: var(--gris);
  font-size: 1rem;
  margin: 0;
}

.dashboard-hero--cliente .dashboard-hero__title {
  font-size: 1.5rem;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.dashboard-cards--cliente {
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: 1fr;
}
.dashboard-cards--cliente .dashboard-card__value {
  font-size: 1.25rem;
}
.dashboard-cards--cliente .dashboard-card {
  padding: 1rem 1rem;
}
.dashboard-cards--cliente .dashboard-card__label {
  font-size: 0.8rem;
}
@media (max-width: 1100px) {
  .dashboard-cards--cliente {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 600px) {
  .dashboard-cards--cliente {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-cards--cliente .dashboard-card__value {
    font-size: 1.1rem;
  }
}

.dashboard-card {
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--radio-lg);
  padding: 1.5rem;
  box-shadow: var(--sombra);
  transition: box-shadow 0.2s, transform 0.15s;
}

.dashboard-card:hover {
  box-shadow: var(--sombra-lg);
  transform: translateY(-2px);
}

.dashboard-card--accent {
  border-left: 4px solid var(--rojo);
  background: linear-gradient(135deg, var(--blanco) 0%, var(--rojo-suave) 100%);
}

/* Admin: colores por tipo de métrica */
.dashboard-card--ventas {
  border-left: 4px solid var(--rojo);
  background: linear-gradient(135deg, var(--blanco) 0%, var(--rojo-suave) 100%);
}
.dashboard-card--pedidos {
  border-left: 4px solid #2563eb;
  background: linear-gradient(135deg, var(--blanco) 0%, rgba(37, 99, 235, 0.08) 100%);
}
.dashboard-card--pares {
  border-left: 4px solid #059669;
  background: linear-gradient(135deg, var(--blanco) 0%, rgba(5, 150, 105, 0.08) 100%);
}
.dashboard-card--clientes {
  border-left: 4px solid var(--gris-oscuro);
  background: linear-gradient(135deg, var(--blanco) 0%, rgba(46, 46, 46, 0.06) 100%);
}

.dashboard-cards--staff {
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: 1fr;
}
.dashboard-cards--staff .dashboard-card__value {
  font-size: 1.2rem;
}
.dashboard-cards--staff .dashboard-card {
  padding: 1rem 0.75rem;
}
.dashboard-cards--staff .dashboard-card__label {
  font-size: 0.75rem;
}
@media (max-width: 1200px) {
  .dashboard-cards--staff {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 768px) {
  .dashboard-cards--staff {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-cards--staff .dashboard-card__value {
    font-size: 1.1rem;
  }
}

.dashboard-card__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gris);
  margin-bottom: 0.5rem;
}

.dashboard-card__value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--negro);
  letter-spacing: -0.02em;
}

.dashboard-incentivo {
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: var(--blanco);
  border-radius: var(--radio-lg);
  border: 1px solid var(--borde);
  box-shadow: var(--sombra);
}

.dashboard-incentivo__text {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  color: var(--negro);
}

.dashboard-incentivo__meta {
  font-size: 0.875rem;
  color: var(--gris);
  margin: 0.5rem 0 0 0;
}

.dashboard-section__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--negro);
  margin: 0 0 1rem 0;
}

.dashboard-section {
  margin-bottom: 2rem;
}

.dashboard-empty {
  color: var(--gris);
  margin-bottom: 1rem;
}

  .table-wrap,
  .table-responsive,
  .movimientos-box {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0.5rem;
  }

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
}

/* ========== Límite de pares por día (barras horizontales) ========== */
.limite-pares-block__hint {
  font-size: 0.875rem;
  color: var(--gris);
  margin: 0 0 1rem 0;
  max-width: 560px;
}

.limite-pares-box {
  background: var(--blanco);
  border-radius: var(--radio-lg);
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--borde);
  box-shadow: var(--sombra);
}

.limite-pares-nav {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.75rem;
  max-width: 900px;
  margin: 0 auto;
}

.limite-pares-nav__btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border: 1px solid var(--borde);
  border-radius: 8px;
  background: var(--gris-claro);
  color: var(--gris-oscuro);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  align-self: center;
}

.limite-pares-nav__btn:hover {
  background: var(--rojo-suave);
  border-color: var(--rojo);
  color: var(--rojo);
}

.limite-pares-list {
  overflow: hidden;
  flex: 1 1 0;
  min-width: 0;
}

.limite-pares-list-inner {
  display: flex;
  transition: transform 0.25s ease-out;
  height: 100%;
}

.limite-pares-list-inner .limite-pares-item {
  flex: 0 0 20%;
  width: 20%;
  min-width: 160px;
  padding: 1rem 1.25rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  justify-content: center;
  background: var(--gris-claro);
  border-radius: 10px;
  border: 1px solid var(--borde);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.limite-pares-list-inner .limite-pares-item.dia-card--hoy {
  border-color: var(--rojo);
  box-shadow: 0 0 0 1px var(--rojo);
}

.limite-pares-list-inner .limite-pares-item.dia-card--inactivo {
  background: #e5e7eb;
  opacity: 0.92;
}

.limite-pares-list-inner .limite-pares-item.dia-card--inactivo .limite-pares-item__bar-wrap {
  background: rgba(0, 0, 0, 0.06);
}

.limite-pares-item__fecha {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--negro);
}

.limite-pares-item__bar-wrap {
  height: 8px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.limite-pares-item__bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.25s ease-out;
}

.limite-pares-item__bar--ok {
  background: linear-gradient(90deg, #059669, #10b981);
}

.limite-pares-item__bar--cerca {
  background: linear-gradient(90deg, #ca8a04, #eab308);
}

.limite-pares-item__bar--limit {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

.limite-pares-item__bar--inactivo {
  background: #9ca3af;
}

.limite-pares-item__nums {
  font-size: 0.8125rem;
  color: var(--gris);
  font-variant-numeric: tabular-nums;
}

.limite-pares-item__estado {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.limite-pares-item__estado.estado-ok { color: #059669; }
.limite-pares-item__estado.estado-cerca { color: #ca8a04; }
.limite-pares-item__estado.estado-limit { color: #dc2626; }
.limite-pares-item__estado.estado-inactivo { color: #6b7280; }

.limite-pares-list-inner.modo-1 { width: 500%; }
.limite-pares-list-inner.modo-2 { width: 250%; }

@media (max-width: 480px) {
  .limite-pares-list-inner .limite-pares-item {
    padding: 0.6rem 0.75rem;
    gap: 0.25rem;
  }
  .limite-pares-item__fecha { font-size: 0.75rem; }
  .limite-pares-item__bar-wrap { height: 5px; }
}

@media (min-width: 1025px) {
  .limite-pares-list { overflow: visible; flex: none; min-width: 0; }
  .limite-pares-list-inner {
    width: 100% !important;
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
  }
  .limite-pares-list-inner .limite-pares-item {
    flex: none;
    width: auto !important;
    min-width: 0;
  }
}

/* Referencias legacy (por si se usan en otros sitios) */
.estado-ok { color: #059669; }
.estado-cerca { color: #ca8a04; }
.estado-limit { color: #dc2626; }

/* Login / Registro */
.login-wrap,
.registro-wrap {
  max-width: 420px;
  margin: 3rem auto;
  padding: 2.5rem;
  background: var(--blanco);
  border-radius: var(--radio-lg);
  box-shadow: var(--sombra-lg);
  border: 1px solid var(--borde);
}

.login-wrap h1,
.registro-wrap h1 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--negro);
  margin: 0 0 1.5rem 0;
  letter-spacing: -0.025em;
}

.login-wrap .btn,
.registro-wrap .btn {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
  font-size: 1rem;
}

.login-wrap .mt-1,
.registro-wrap .mt-1 {
  text-align: center;
  margin-top: 1.25rem;
}

/* Página login/registro: fondo suave y centrado */
body.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(160deg, var(--gris-claro) 0%, #e8e8ec 100%);
}

/* ========== Login split (como la imagen: card centrada, no pantalla completa) ========== */
body.auth-page .login-split {
  display: flex;
  width: 100%;
  max-width: 960px;
  min-height: 480px;
  max-height: 90vh;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12), 0 2px 12px rgba(0, 0, 0, 0.08);
  align-self: center;
}

.login-split__left {
  flex: 1;
  min-width: 260px;
  background: linear-gradient(145deg, #2E2E2E 0%, #8B0000 38%, #C00000 72%, #a01818 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.35rem 1.2rem;
}

.login-split__blobs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-split__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.3;
}

.login-split__blob--1 {
  width: 200px;
  height: 200px;
  background: rgba(255, 80, 80, 0.5);
  top: -50px;
  right: -40px;
  animation: login-blob 18s ease-in-out infinite;
}

.login-split__blob--2 {
  width: 150px;
  height: 150px;
  background: rgba(192, 0, 0, 0.5);
  bottom: 15%;
  left: -30px;
  animation: login-blob 14s ease-in-out infinite reverse;
}

.login-split__blob--3 {
  width: 130px;
  height: 130px;
  background: rgba(255, 120, 100, 0.4);
  top: 45%;
  right: 10%;
  animation: login-blob 12s ease-in-out infinite 1s;
}

.login-split__blob--4 {
  width: 160px;
  height: 160px;
  background: rgba(139, 0, 0, 0.4);
  bottom: -25px;
  right: 20%;
  animation: login-blob 16s ease-in-out infinite 0.5s;
}

@keyframes login-blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(15px, -10px) scale(1.05); }
  66% { transform: translate(-8px, 8px) scale(0.98); }
}

.login-split__welcome {
  position: relative;
  z-index: 1;
  max-width: 340px;
  color: #fff;
}

.login-split__logo {
  display: block;
  width: 225px;
  height: auto;
  margin: 0 auto 0.55rem auto;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.25));
}

/* Logo (estructura separada del texto) */
.login-split__logo-wrap {
  z-index: 2;
  display: flex;
  justify-content: center;
  width: 100%;
}

@media (min-width: 701px) {
  /* En PC, el logo se ancla arriba y NO afecta el centrado vertical del texto */
  .login-split__logo-wrap {
    position: absolute;
    top: 3rem;
    left: 50%;
    transform: translateX(-50%);
  }

  .login-split__logo {
    margin-bottom: 0;
  }
}

.login-split__welcome h1 {
  font-size: 1.625rem;
  font-weight: 700;
  margin: 0 0 0.6rem 0;
  letter-spacing: -0.03em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.2);
}

.login-split__welcome p {
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0;
  opacity: 0.92;
}

/* Panel derecho: formulario */
.login-split__right {
  flex: 0 0 360px;
  background: var(--blanco);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.login-split__form-wrap {
  width: 100%;
  max-width: 300px;
}

/* Crear cuenta: formulario más largo, con scroll si hace falta (sin barra visible) */
.login-split__form-wrap--registro {
  max-height: min(420px, 70vh);
  overflow-y: auto;
  padding-right: 0.25rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.login-split__form-wrap--registro::-webkit-scrollbar {
  display: none;
}

.login-split__form-wrap--registro .login-split__form .form-group {
  margin-bottom: 0.75rem;
}

.login-split__title {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--rojo);
  margin: 0 0 1.25rem 0;
}

.login-split__form .form-group { margin-bottom: 1rem; }

.login-split__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gris);
  margin-bottom: 0.4rem;
}

.login-split__input-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.9rem;
  border: 1px solid var(--borde);
  border-radius: 10px;
  background: #fafafa;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-split__input-wrap:focus-within {
  border-color: var(--rojo);
  box-shadow: 0 0 0 3px var(--rojo-suave);
  background: var(--blanco);
}

.login-split__icon {
  flex-shrink: 0;
  color: var(--rojo);
  opacity: 0.85;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-split__icon svg {
  width: 20px;
  height: 20px;
}

.login-split__input-wrap input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0.75rem 0;
  font-size: 1rem;
}

.login-split__input-wrap input::placeholder {
  color: #9ca3af;
}

.login-split__input-wrap input:focus {
  outline: none;
  box-shadow: none;
}

.login-split__options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 0.75rem;
}

.login-split__options .login-split__remember,
.login-split__olvidar {
  font-size: 0.75rem;
  color: var(--gris);
}

.login-split__options .login-split__remember {
  margin: 0;
}

.login-split__olvidar:hover {
  color: var(--rojo);
  text-decoration: none;
}

.login-split__texto {
  font-size: 0.9375rem;
  color: var(--gris);
  line-height: 1.5;
  margin: 0 0 1.25rem 0;
}

.login-split__remember {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--gris);
  cursor: pointer;
  user-select: none;
}

.login-split__remember input {
  width: 0.9375rem;
  height: 0.9375rem;
  accent-color: var(--rojo);
}

.login-split__btn {
  width: 100%;
  padding: 0.8rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(90deg, #C00000 0%, #8B0000 100%);
  box-shadow: 0 3px 12px rgba(192, 0, 0, 0.35);
  transition: transform 0.15s, box-shadow 0.2s;
}

.login-split__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(192, 0, 0, 0.4);
}

.login-split__btn:active {
  transform: translateY(0);
}

.login-split__registro {
  text-align: center;
  margin: 1.25rem 0 0 0;
  font-size: 0.875rem;
  color: var(--gris);
}

.login-split__registro a {
  color: var(--rojo);
  font-weight: 500;
}

.login-split__registro a:hover {
  text-decoration: underline;
}

/* Responsive: en móvil el split se apila y ocupa más ancho */
@media (max-width: 700px) {
  body.auth-page .login-split {
    flex-direction: column;
    max-width: 100%;
    min-height: 0;
  }

  .login-split__left {
    flex-direction: column;
    min-height: 140px;
    min-width: 100%;
    padding: 1.25rem 1rem;
  }

  .login-split__logo-wrap {
    position: static;
    transform: none;
    top: auto;
    left: auto;
  }

  .login-split__welcome h1 {
    font-size: 1.25rem;
  }

  .login-split__welcome p {
    font-size: 0.75rem;
  }

  .login-split__logo {
    width: 130px;
    margin-bottom: 0.55rem;
  }

  .login-split__right {
    flex: 1;
    flex-basis: auto;
    min-height: 0;
    padding: 1.25rem;
  }

  .login-split__form-wrap {
    max-width: 100%;
  }
}

/* Diseñador SVG */
.disenador-wrap {
  border: 1px solid var(--borde);
  border-radius: var(--radio-lg);
  background: var(--blanco);
  padding: 1.25rem;
  margin: 1rem 0;
  box-shadow: var(--sombra);
}

.disenador-wrap svg { max-width: 100%; height: auto; }

.zona-btn {
  margin: 0.25rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--borde);
  border-radius: 8px;
  cursor: pointer;
  background: var(--blanco);
  transition: border-color 0.2s, background 0.2s;
}

.zona-btn.activo {
  border-color: var(--rojo);
  background: var(--rojo-suave);
}

.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.color-picker-wrap input[type="color"] {
  width: 44px;
  height: 40px;
  padding: 4px;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--borde);
}

/* Badges estado de pago (mismos colores en admin y cliente) */
.badge.pago-cancelado_todo { background: rgba(5, 150, 105, 0.14); color: #047857; }
.badge.pago-abono { background: rgba(234, 88, 12, 0.14); color: #c2410c; }
.badge.pago-no_cancelado { background: rgba(220, 38, 38, 0.14); color: #b91c1c; }
.badge.pago-parcial { background: rgba(59, 130, 246, 0.14); color: #1d4ed8; }
.badge.pago-vacio { background: #f3f4f6; color: var(--gris); }
.pago-abono-info { font-size: 0.75rem; color: var(--gris); margin-top: 0.2rem; }

/* Filtros en listar_pedidos */
.main form[method="get"] {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  align-items: center;
}

.main form[method="get"] select,
.main form[method="get"] input[type="text"] {
  min-width: 180px;
}

/* Utilidades */
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 0.5rem; }

/* ========== Bottom nav (solo móvil): Nuevo pedido en el centro ========== */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: var(--blanco);
  border-top: 1px solid var(--borde);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav__inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  max-width: 100%;
  height: 64px;
  padding: 0 0.5rem;
}

.bottom-nav__side {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}
.bottom-nav__left { justify-content: flex-start; }
.bottom-nav__right { justify-content: flex-end; }

/* Cliente: 3 ítems centrados (Inicio | Nuevo pedido | Mis pedidos) */
.bottom-nav--cliente .bottom-nav__inner {
  justify-content: space-evenly;
  gap: 0.5rem;
}
.bottom-nav--cliente .bottom-nav__left,
.bottom-nav--cliente .bottom-nav__right {
  flex: 0 1 auto;
  justify-content: center;
}
.bottom-nav--cliente .bottom-nav__center {
  flex: 0 0 auto;
}

/* Staff: Inicio+Catálogo | Lista pedidos (CTA rojo) | Inventario+Más */
.bottom-nav--staff .bottom-nav__inner {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 0.25rem;
  padding: 0 0.25rem;
}
.bottom-nav--staff .bottom-nav__left,
.bottom-nav--staff .bottom-nav__right {
  flex: 1;
  min-width: 0;
}
.bottom-nav--staff .bottom-nav__center {
  flex-shrink: 0;
}

.bottom-nav__center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0 0.25rem;
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.4rem 0.6rem;
  min-width: 56px;
  color: var(--gris);
  font-size: 0.7rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  border-radius: var(--radio);
}

.bottom-nav__item:hover {
  color: var(--rojo);
  background: var(--rojo-suave);
  text-decoration: none;
}

.bottom-nav__item.activo {
  color: var(--rojo);
  font-weight: 600;
}

.bottom-nav__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav__icon svg {
  width: 22px;
  height: 22px;
}

.bottom-nav__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 72px;
}

/* Botón central destacado: círculo con + */
.bottom-nav__cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--rojo);
  color: var(--blanco);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(192, 0, 0, 0.4);
  transform: translateY(-8px);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.bottom-nav__cta:hover {
  background: var(--rojo-hover);
  color: var(--blanco);
  transform: translateY(-10px);
  box-shadow: 0 6px 20px rgba(192, 0, 0, 0.45);
  text-decoration: none;
}

.bottom-nav__cta.activo {
  background: var(--rojo-hover);
}

.bottom-nav__cta-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav__cta-icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
}

.bottom-nav__cta-label {
  display: none;
  font-size: 0.65rem;
  font-weight: 600;
  margin-top: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Overlay "Más" para staff en móvil */
.bottom-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
}

.bottom-nav-overlay.bottom-nav-overlay--open {
  pointer-events: auto;
  visibility: visible;
}

.bottom-nav-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.bottom-nav-overlay--open .bottom-nav-overlay__backdrop {
  opacity: 1;
}

.bottom-nav-overlay__panel {
  width: 100%;
  max-height: 70vh;
  background: var(--blanco);
  border-radius: var(--radio-lg) var(--radio-lg) 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
  padding: 1rem 1.25rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0));
  transform: translateY(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.bottom-nav-overlay--open .bottom-nav-overlay__panel {
  transform: translateY(0);
}

.bottom-nav-overlay__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--borde);
}

.bottom-nav-overlay__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--negro);
}

.bottom-nav-overlay__close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--gris);
  cursor: pointer;
  border-radius: var(--radio);
  transition: background 0.2s, color 0.2s;
}

.bottom-nav-overlay__close:hover {
  background: var(--rojo-suave);
  color: var(--rojo);
}

.bottom-nav-overlay__links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.bottom-nav-overlay__link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radio);
  color: var(--negro);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.bottom-nav-overlay__link:hover {
  background: var(--rojo-suave);
  color: var(--rojo);
  text-decoration: none;
}

.bottom-nav-overlay__link.activo {
  background: var(--rojo-suave);
  color: var(--rojo);
}

.bottom-nav-overlay__link-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bottom-nav-overlay__link-icon svg {
  width: 22px;
  height: 22px;
}

.bottom-nav-overlay__link--logout {
  color: var(--gris);
  border-top: 1px solid var(--borde);
  margin-top: 0.5rem;
  padding-top: 1rem;
}

.bottom-nav-overlay__link--logout:hover {
  color: var(--rojo);
}

/* Responsive: móvil = bottom nav abajo fijo, sidebar oculto */
@media (max-width: 768px) {
  .cabecera__inner { padding: 0.6rem 1rem; }
  .cabecera__logo-img { max-width: 140px; height: 36px; }
  .cabecera__user-name { display: none; }
  .layout { flex-direction: column; flex: 1; min-height: 0; }

  .sidebar,
  .sidebar--icons-only {
    display: none !important;
  }

  .bottom-nav {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
  }

  .main {
    margin-left: 0;
    margin-top: 0;
    padding: 1.25rem 1rem;
    /* Nav (80px) + un poco de espacio para que la burbuja no tape el último contenido */
    padding-bottom: calc(80px + 3.5rem + env(safe-area-inset-bottom, 0));
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }

  .main h1 {
    font-size: 1.375rem;
    margin-bottom: 1.25rem;
  }

  .cards,
  .dashboard-cards {
    gap: 1rem;
  }

  .card,
  .dashboard-card {
    padding: 1.25rem;
  }

  .table-wrap,
  .table-responsive,
  .movimientos-box {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Padding en secciones para evitar contenido pegado a los bordes */
  .dashboard-section {
    padding-left: 0;
    padding-right: 0;
  }
  .dashboard-section .table-wrap {
    margin-left: 0;
    margin-right: 0;
  }

  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
  }
}
