:root {
  /* Paleta principal (indigo, mas contemporaneo que el azul plano anterior) */
  --azul: #4f46e5;
  --azul-oscuro: #4338ca;
  --azul-suave: #eef2ff;
  --azul-suave-texto: #4338ca;

  --gris-borde: #e5e7f0;
  --gris-texto: #64748b;
  --gris-texto-fuerte: #334155;

  --rojo: #e11d48;
  --rojo-suave: #fff1f2;
  --rojo-suave-texto: #be123c;

  --verde: #10b981;
  --verde-suave: #ecfdf5;
  --verde-suave-texto: #047857;

  --naranja: #ea580c;
  --naranja-suave: #fff7ed;
  --naranja-suave-texto: #c2410c;

  --amarillo: #d97706;
  --amarillo-suave: #fffbeb;
  --amarillo-suave-texto: #b45309;

  --morado: #7c3aed;
  --morado-suave: #f5f3ff;
  --morado-suave-texto: #6d28d9;

  --neutro-suave: #f1f5f9;
  --neutro-suave-texto: #475569;

  --superficie: #ffffff;
  --fondo: #f5f6fa;
  --texto: #0f172a;

  --radio-sm: 8px;
  --radio: 12px;
  --radio-lg: 16px;
  --sombra-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --sombra: 0 1px 2px rgba(15,23,42,0.04), 0 8px 20px -10px rgba(15, 23, 42, 0.12);
  --sombra-lg: 0 20px 45px -20px rgba(15, 23, 42, 0.25);
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--azul); }

:focus-visible {
  outline: 2px solid var(--azul);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Navegacion ---------- */

nav {
  background: linear-gradient(180deg, #12172b 0%, #0b0f1f 100%);
  color: white;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  flex-wrap: wrap;
  gap: 0.5rem;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

.nav-bar { display: flex; align-items: center; justify-content: space-between; }
.nav-menu { display: flex; align-items: center; justify-content: space-between; flex: 1; gap: 1rem; flex-wrap: wrap; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radio-sm);
}
.nav-toggle:hover { background: rgba(255,255,255,0.08); }

nav .navlinks { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
nav form { display: inline; }

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  margin-right: 0.9rem;
  padding-right: 1.1rem;
  border-right: 1px solid rgba(255,255,255,0.10);
}
.brand-icon {
  font-size: 1.05rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--azul), #7c6cf6);
  box-shadow: 0 4px 10px -2px rgba(79,70,229,0.55);
}
.brand-link .brand { font-weight: 700; font-size: 0.92rem; color: white; letter-spacing: -0.01em; white-space: nowrap; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #b6bcd6;
  text-decoration: none;
  font-size: 0.87rem;
  font-weight: 500;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-icon { font-size: 1rem; line-height: 1; }
.nav-link:hover { color: white; background: rgba(255,255,255,0.08); }
.nav-link.active { color: white; background: rgba(124, 108, 246, 0.28); box-shadow: inset 0 0 0 1px rgba(124,108,246,0.35); }

nav button.link-btn {
  background: none; border: none; color: #b6bcd6; cursor: pointer; font-size: 0.87rem; padding: 0.5rem 0.8rem;
  border-radius: 999px; transition: background 0.15s, color 0.15s;
}
nav button.link-btn:hover { color: white; background: rgba(255,255,255,0.08); }
nav .userchip { font-size: 0.82rem; color: #8b92b3; margin-right: 0.3rem; }
.bell-link { position: relative; }

@media (max-width: 900px) {
  nav { padding: 0.6rem 1rem; }
  .nav-bar { width: 100%; justify-content: space-between; }
  .brand-link { border-right: none; padding-right: 0; margin-right: 0; }
  .brand-link .brand { font-size: 0.78rem; }
  .nav-toggle { display: block; }
  .nav-menu {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    padding-bottom: 0.8rem;
  }
  .nav-menu.open { display: flex; }
  nav .navlinks { flex-direction: column; align-items: stretch; width: 100%; gap: 0.15rem; }
  .nav-link, nav button.link-btn { width: 100%; border-radius: var(--radio-sm); }
  nav .userchip { margin: 0.5rem 0 0.2rem 0; padding: 0 0.75rem; }
  .navlinks + .navlinks { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid rgba(255,255,255,0.08); }
}

.badge-count {
  display: inline-block;
  background: var(--rojo);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.05rem 0.42rem;
  border-radius: 999px;
  margin-left: 0.3rem;
  box-shadow: 0 0 0 2px rgba(11,15,31,1);
}
.notif-item { padding: 0.8rem 0.2rem; border-bottom: 1px solid var(--gris-borde); }
.notif-item.unread { background: var(--azul-suave); border-radius: var(--radio-sm); padding: 0.8rem 0.9rem; }
.notif-item .notif-fecha { font-size: 0.8rem; color: var(--gris-texto); }
.notif-item .notif-texto { margin-bottom: 0.15rem; }
.link-btn-inline {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--rojo);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}
.link-btn-inline:hover { color: var(--rojo-suave-texto); }

/* ---------- Layout general ---------- */

.container { max-width: 1600px; margin: 0 auto; padding: 2.2rem 1.5rem; }
@media (max-width: 700px) {
  .container { padding: 1.2rem 0.9rem; }
}

h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 1.3rem; color: var(--texto); }
h2 { font-size: 1.08rem; font-weight: 650; letter-spacing: -0.005em; margin-bottom: 0.9rem; color: var(--texto); }

.card {
  background: var(--superficie);
  border: 1px solid var(--gris-borde);
  border-radius: var(--radio-lg);
  box-shadow: var(--sombra);
  padding: 1.6rem;
  margin-bottom: 1.5rem;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.75rem 0.8rem; border-bottom: 1px solid var(--gris-borde); font-size: 0.88rem; }
th {
  color: var(--gris-texto);
  font-weight: 650;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: transparent;
  border-bottom: 1.5px solid var(--gris-borde);
}
tbody tr { transition: background 0.1s; }
tr:hover td { background: #fafbff; }
tr:last-child td { border-bottom: none; }

label { display: block; font-size: 0.84rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--gris-texto-fuerte); }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=file], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid var(--gris-borde);
  border-radius: var(--radio-sm);
  font-size: 0.92rem;
  margin-bottom: 1rem;
  background: var(--superficie);
  font-family: inherit;
  color: var(--texto);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 3.5px rgba(79, 70, 229, 0.14);
}
textarea { min-height: 90px; resize: vertical; }

.btn {
  display: inline-block;
  background: var(--azul);
  color: white;
  border: none;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radio-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(79,70,229,0.05), 0 4px 10px -4px rgba(79,70,229,0.45);
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.btn:hover { background: var(--azul-oscuro); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: var(--superficie); color: var(--gris-texto-fuerte); border: 1.5px solid var(--gris-borde); box-shadow: var(--sombra-sm); }
.btn.secondary:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn.crema { background: #fdf6e3; color: #7c5e10; border: 1.5px solid #f0e0b0; box-shadow: var(--sombra-sm); }
.btn.crema:hover { background: #faedc4; border-color: #e8d190; }
.btn.small { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn.danger { background: var(--rojo); box-shadow: 0 1px 2px rgba(225,29,72,0.05), 0 4px 10px -4px rgba(225,29,72,0.5); }
.btn.danger:hover { background: #be123c; }

/* ---------- Insignias tipo "chip" (fondo suave + texto de color) ---------- */

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
}
.badge.baja { background: var(--neutro-suave); color: var(--neutro-suave-texto); }
.badge.normal { background: var(--azul-suave); color: var(--azul-suave-texto); }
.badge.alta { background: var(--naranja-suave); color: var(--naranja-suave-texto); }
.badge.urgente { background: var(--rojo-suave); color: var(--rojo-suave-texto); }

.badge.pendiente { background: var(--neutro-suave); color: var(--neutro-suave-texto); }
.badge.en_proceso { background: var(--amarillo-suave); color: var(--amarillo-suave-texto); }
.badge.completada { background: var(--verde-suave); color: var(--verde-suave-texto); }
.badge.info { background: var(--morado-suave); color: var(--morado-suave-texto); }

.badge.urgencia-verde { background: var(--verde-suave); color: var(--verde-suave-texto); }
.badge.urgencia-amarillo { background: var(--amarillo-suave); color: var(--amarillo-suave-texto); }
.badge.urgencia-naranja { background: var(--naranja-suave); color: var(--naranja-suave-texto); }
.badge.urgencia-rojo { background: var(--rojo-suave); color: var(--rojo-suave-texto); }

/* --- Pedidos --- */
.pedido-card {
  border-left: 6px solid var(--gris-borde);
  margin-bottom: 1rem;
}
.pedido-card.urgencia-verde { border-left-color: var(--verde); }
.pedido-card.urgencia-amarillo { border-left-color: var(--amarillo); }
.pedido-card.urgencia-naranja { border-left-color: var(--naranja); }
.pedido-card.urgencia-rojo { border-left-color: var(--rojo); }

.pedido-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.6rem;
  margin-bottom: 0.5rem;
}
.pedido-datos-clave {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  row-gap: 0.4rem;
}
.pedido-dato {
  display: flex;
  flex-direction: column;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--texto);
  line-height: 1.15;
  white-space: nowrap;
}
.pedido-dato-label {
  font-size: 0.7rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gris-texto);
  margin-bottom: 0.1rem;
}
.pedido-titulo { font-size: 0.95rem; font-weight: 500; color: var(--gris-texto-fuerte); margin: 0 0 0.9rem 0; }
.pedido-notas {
  font-size: 0.85rem;
  color: var(--gris-texto);
  background: var(--fondo);
  border-radius: var(--radio-sm);
  padding: 0.5rem 0.7rem;
  margin: -0.4rem 0 0.9rem 0;
  white-space: pre-line;
}
.pedido-meta { font-size: 0.85rem; color: var(--gris-texto); }
.pedido-meta strong { color: var(--gris-texto-fuerte); }
.pedido-dias { font-weight: 700; white-space: nowrap; }

.pedido-estado-inline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.semaforo-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.semaforo-btn {
  flex: 0 0 auto;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radio-sm);
  border: 2px solid transparent;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  color: white;
  opacity: 0.5;
  transition: opacity 0.15s, transform 0.1s;
}
.semaforo-btn:hover { opacity: 0.8; transform: translateY(-1px); }
.semaforo-btn.activo { opacity: 1; border-color: var(--texto); box-shadow: var(--sombra-sm); }

.pedido-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

/* Vista detallada: una fila con columnas alineadas en todas las tarjetas
   (datos | estado de proceso | dias | en curso/pausado | tiempo).
   El bloque de estados mide lo mismo en todas (son los mismos botones) y
   los datos ocupan el espacio que sobra, asi todo queda en columna. */
.pedido-fila {
  display: grid;
  /* Los estados van siempre en su propia linea, debajo de los datos: con
     "Guardado en" y el boton de WhatsApp ya no caben en la misma fila */
  grid-template-columns: minmax(0, 1fr) 115px 165px 80px;
  grid-template-areas:
    "datos dias proceso tiempo"
    "estado estado estado estado";
  align-items: center;
  gap: 0.6rem 1rem;
  margin-bottom: 0.7rem;
}
.pc-datos { grid-area: datos; display: flex; flex-wrap: wrap; gap: 0.5rem 1.3rem; align-items: flex-end; min-width: 0; }
.pc-estado { grid-area: estado; display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
.pc-dias { grid-area: dias; text-align: center; }
.pc-proceso { grid-area: proceso; text-align: center; }
.pc-tiempo { grid-area: tiempo; text-align: right; }
.pc-cliente { min-width: 140px; max-width: 380px; flex: 0 1 auto; white-space: normal; }
/* Nombre del cliente completo, en hasta 2 lineas (si es mas largo, "...") */
.pc-cliente-nombre {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.15;
}
.pc-estado > .pedido-dato-label { margin: 0; white-space: nowrap; }
.pc-estado .semaforo-btns { gap: 0.35rem; }

/* Pantallas medianas: los estados bajan a su propia linea, debajo de los datos */
@media (max-width: 1500px) {
  .pedido-fila {
    grid-template-columns: minmax(0, 1fr) 115px 165px 80px;
    grid-template-areas:
      "datos dias proceso tiempo"
      "estado estado estado estado";
  }
}
/* Movil: todo apilado */
@media (max-width: 800px) {
  .pedido-fila { display: flex; flex-direction: column; align-items: flex-start; }
  .pc-datos { flex-wrap: wrap; gap: 0.5rem 1.2rem; }
  .pc-estado { flex-wrap: wrap; }
  .pc-dias, .pc-proceso, .pc-tiempo { text-align: left; }
  .pc-proceso:empty, .pc-tiempo:empty { display: none; }
}

.resumen-tam-control {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.resumen-tam-control label { font-size: 0.9rem; font-weight: 650; color: var(--texto); white-space: nowrap; }
.resumen-tam-control input[type="range"] { max-width: 220px; flex: 1 1 160px; }
.resumen-tam-control #resumenTamValor { font-size: 0.9rem; font-weight: 700; min-width: 2.6em; }
.resumen-tam-guardado { font-size: 0.82rem; color: var(--verde-suave-texto, #16a34a); font-weight: 650; }

.pedidos-resumen-grid {
  --escala: 100;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(calc(150px * var(--escala) / 100), 1fr));
  gap: calc(1rem * var(--escala) / 100);
  margin-bottom: 1.5rem;
}
.pedido-resumen-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(0.5rem * var(--escala) / 100);
  text-align: center;
  background: var(--superficie);
  border-radius: var(--radio);
  border-style: solid;
  border-color: #94a3b8;
  border-width: calc(5px * var(--escala) / 100);
  padding: calc(1.1rem * var(--escala) / 100) calc(0.8rem * var(--escala) / 100);
  box-shadow: var(--sombra-sm);
  text-decoration: none;
  transition: transform 0.1s, box-shadow 0.15s;
}
.pedido-resumen-card:hover { transform: translateY(-2px); box-shadow: var(--sombra-lg); }
.pedido-resumen-ref { font-size: calc(1.05rem * var(--escala) / 100); font-weight: 800; color: var(--texto); word-break: break-word; }
.pedido-resumen-dias {
  font-size: calc(0.95rem * var(--escala) / 100);
  font-weight: 750;
  padding: calc(0.15rem * var(--escala) / 100) calc(0.7rem * var(--escala) / 100);
  border-radius: 999px;
}
.pedido-resumen-dias.urgencia-verde { background: var(--verde-suave); color: var(--verde-suave-texto); }
.pedido-resumen-dias.urgencia-amarillo { background: var(--amarillo-suave); color: var(--amarillo-suave-texto); }
.pedido-resumen-dias.urgencia-naranja { background: var(--naranja-suave); color: var(--naranja-suave-texto); }
.pedido-resumen-dias.urgencia-rojo { background: var(--rojo-suave); color: var(--rojo-suave-texto); }
.pedido-resumen-estado {
  font-size: calc(0.72rem * var(--escala) / 100);
  font-weight: 650;
  color: white;
  padding: calc(0.15rem * var(--escala) / 100) calc(0.6rem * var(--escala) / 100);
  border-radius: 999px;
}

/* --- Validar pedido (lector de codigo de barras) --- */
.validar-card { max-width: 640px; text-align: center; }
.validar-card label { text-align: left; }
#scanInput {
  font-size: 1.4rem;
  text-align: center;
  padding: 1rem;
  border-width: 2px;
  margin-bottom: 0;
}
.validar-resultado {
  min-height: 3.4rem;
  margin-top: 1.2rem;
  padding: 1rem;
  border-radius: var(--radio);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fondo);
  color: var(--gris-texto);
}
.validar-resultado.ok { background: var(--verde-suave); color: var(--verde-suave-texto); }
.validar-resultado.error { background: var(--rojo-suave); color: var(--rojo-suave-texto); }
.validar-historial {
  margin-top: 1.2rem;
  text-align: left;
  max-height: 220px;
  overflow-y: auto;
  border-top: 1px solid var(--gris-borde);
  padding-top: 0.6rem;
}
.validar-historial-item { font-size: 0.82rem; padding: 0.3rem 0; color: var(--gris-texto); }
.validar-historial-item.ok { color: var(--verde-suave-texto); }
.validar-historial-item.error { color: var(--rojo-suave-texto); }
.validar-resultado.inicio { background: #dbeafe; color: #1e40af; }
.validar-historial-item.inicio { color: #1e40af; }
.validar-modo {
  max-width: 640px;
  margin: 0 0 1rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radio-sm);
  background: var(--fondo);
  color: var(--gris-texto);
  font-size: 0.9rem;
}
.validar-modo.tiempo { background: #dbeafe; color: #1e40af; }
.validar-en-curso { text-align: left; }
.validar-en-curso h2 { font-size: 1rem; }
.en-curso-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.8rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--gris-borde);
  font-size: 0.9rem;
}
.en-curso-item:last-child { border-bottom: none; }
.en-curso-titulo { color: var(--gris-texto); flex: 1 1 auto; }
.en-curso-tiempo { color: #1e40af; font-weight: 650; white-space: nowrap; }

/* Indicador de proceso en curso y tiempo acumulado en Pedidos */
.pedido-en-curso {
  display: inline-block;
  background: #dbeafe;
  color: #1e40af;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.pedido-pausado {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.pedido-resumen-card .pedido-pausado {
  font-size: calc(0.7rem * var(--escala) / 100);
  padding: calc(0.1rem * var(--escala) / 100) calc(0.5rem * var(--escala) / 100);
}
.pedido-pausado.auto { background: #fee2e2; color: #991b1b; }
.validar-resultado.pausa { background: #fef3c7; color: #92400e; }
.validar-historial-item.pausa { color: #92400e; }
.validar-lista-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.4rem; }
.validar-lista-cabecera h2 { margin: 0; }
.validar-en-curso h2 { font-size: 1rem; }
.en-curso-item .btn { margin-left: auto; }
.pausado-tiempo { color: #92400e; font-weight: 650; white-space: nowrap; }
.pedido-tiempo-total { font-size: 0.8rem; color: var(--gris-texto); white-space: nowrap; }
.pedido-resumen-card .pedido-en-curso {
  font-size: calc(0.7rem * var(--escala) / 100);
  padding: calc(0.1rem * var(--escala) / 100) calc(0.5rem * var(--escala) / 100);
}
/* Alta masiva de pedidos */
.importar-resumen { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.imp-estado {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 650;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
}
.imp-nuevo { background: var(--verde-suave); color: var(--verde-suave-texto); }
.imp-duplicado { background: var(--fondo); color: var(--gris-texto); }
.imp-error { background: var(--rojo-suave); color: var(--rojo-suave-texto); }
.imp-fila-duplicado td, .imp-fila-error td { opacity: 0.75; }
.importar-confirmar { display: inline-block; margin-right: 0.5rem; }

.tiempos-total-row td { font-weight: 800; border-top: 1.5px solid var(--gris-borde); }

.error-box {
  background: var(--rojo-suave);
  border: 1px solid #fecdd3;
  color: var(--rojo-suave-texto);
  padding: 0.75rem 1rem;
  border-radius: var(--radio-sm);
  margin-bottom: 1rem;
  font-size: 0.88rem;
}
.ok-box {
  background: var(--verde-suave);
  border: 1px solid #a7f3d0;
  color: var(--verde-suave-texto);
  padding: 0.75rem 1rem;
  border-radius: var(--radio-sm);
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.login-wrap {
  max-width: 400px;
  margin: 9vh auto;
}
.login-wrap .card { box-shadow: var(--sombra-lg); }

.filters { display: flex; gap: 0.8rem; margin-bottom: 1rem; align-items: end; flex-wrap: wrap; }
.filters select, .filters input[type=text] { margin-bottom: 0; }

.attachment-row { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 0.1rem; border-bottom: 1px solid var(--gris-borde); font-size: 0.9rem; flex-wrap: wrap; gap: 0.4rem; }
.attachment-row:last-child { border-bottom: none; }
.row-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.thread-meta .row-actions { margin-left: auto; }
.muted { color: var(--gris-texto); font-size: 0.85rem; }

.inline-form { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.inline-form select, .inline-form input { margin-bottom: 0; }

.chip-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.6rem; min-height: 1.6rem; }
.chip-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--azul-suave);
  color: var(--azul-suave-texto);
  padding: 0.25rem 0.4rem 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}
.chip-remove {
  background: rgba(67,56,202,0.12);
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chip-remove:hover { background: rgba(67,56,202,0.22); }
.chip-add-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.chip-add-row input[type=text] { flex: 1; min-width: 160px; margin-bottom: 0; }
.chip-add-row select { margin-bottom: 0; width: auto; }

.thread { margin: 1rem 0; }
.thread-item {
  border-left: 3px solid var(--azul);
  background: #fafbff;
  border-radius: 0 var(--radio-sm) var(--radio-sm) 0;
  padding: 0.7rem 1rem;
  margin-bottom: 0.9rem;
}
.thread-meta { font-size: 0.85rem; margin-bottom: 0.3rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.thread-text { font-size: 0.92rem; margin-bottom: 0.4rem; }
.thread-attachments { margin-top: 0.3rem; }

.cliente-picker { position: relative; margin-bottom: 1rem; }
.cliente-picker input[type=text] { margin-bottom: 0; }
.cliente-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--superficie);
  border: 1px solid var(--gris-borde);
  border-radius: var(--radio);
  max-height: 240px;
  overflow-y: auto;
  z-index: 20;
  display: none;
  box-shadow: var(--sombra-lg);
  margin-top: 8px;
}
.cliente-suggestion { padding: 0.6rem 0.8rem; cursor: pointer; font-size: 0.88rem; border-bottom: 1px solid #f1f5f9; }
.cliente-suggestion:last-child { border-bottom: none; }
.cliente-suggestion:hover, .cliente-suggestion.active { background: var(--azul-suave); }

/* ---------- Agenda / calendario ---------- */

.cal-vistas { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.cal-nav-group { display: flex; gap: 0.4rem; align-items: center; }
.calendar { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.calendar th, .calendar td { width: 14.2857%; }
.calendar th { background: transparent; padding: 0.5rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; text-align: center; color: var(--gris-texto); border-bottom: none; }
.calendar td { border: 1px solid var(--gris-borde); border-radius: var(--radio-sm); vertical-align: top; height: 110px; padding: 0.4rem; font-size: 0.78rem; overflow: hidden; }
.calendar-semana td { height: 420px; overflow-y: auto; }
.cal-vacia { background: #fafbfc; border-color: transparent !important; }
.cal-dia { background: var(--superficie); }
.cal-hoy { background: var(--azul-suave); border-color: var(--azul) !important; }
.cal-dia-num { font-weight: 650; margin-bottom: 0.35rem; display: flex; justify-content: space-between; align-items: center; }
.cal-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  text-decoration: none;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1;
  border-radius: 50%;
  background: var(--azul);
  box-shadow: 0 1px 3px rgba(79,70,229,0.4);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.cal-add:hover { background: var(--azul-oscuro); transform: scale(1.1); box-shadow: 0 2px 6px rgba(79,70,229,0.5); }
.cal-add:active { transform: scale(0.96); }
.cal-eventos-lista { display: flex; flex-direction: column; gap: 0.25rem; }
.cal-evento {
  display: block;
  background: var(--azul);
  color: white;
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  font-size: 0.72rem;
  line-height: 1.3;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-word;
}
.cal-evento .cal-evento-hora { display: block; font-weight: 650; opacity: 0.9; font-size: 0.68rem; }
.cal-evento:hover { opacity: 0.85; }
.cal-evento-solo-lectura { background: #94a3b8; cursor: default; }
.cal-evento[draggable="true"] { cursor: grab; }
.cal-evento-serie { font-size: 0.7rem; opacity: 0.85; }
.cal-arrastrando { opacity: 0.4; }
.cal-drop-sobre { outline: 2px dashed var(--azul); outline-offset: -2px; background: var(--azul-suave); }
.calendar-dia th, .calendar-dia td { width: 100%; }
.calendar-dia td { height: 360px; overflow-y: auto; font-size: 0.85rem; }
.calendar-dia .cal-evento { font-size: 0.85rem; padding: 0.4rem 0.6rem; }
.calendar-dia .cal-evento .cal-evento-hora { font-size: 0.78rem; }
.cal-th-dia { color: inherit; text-decoration: none; display: block; }
.cal-th-dia:hover { color: var(--azul); }
.cal-ayuda-dnd { margin-top: 0.8rem; font-size: 0.8rem; }
.borrar-opciones, .repetir-fin { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 1rem; }
.borrar-opciones label, .repetir-fin label { display: flex; align-items: center; gap: 0.45rem; font-weight: 400; margin: 0; flex-wrap: wrap; }
.borrar-opciones input[type=radio], .repetir-fin input[type=radio] { width: auto; margin: 0; }
@media (max-width: 800px) {
  .calendar td { height: 70px; font-size: 0.68rem; padding: 0.25rem; }
  .calendar-semana td { height: 160px; }
  .calendar-dia td { height: 260px; }
  .calendar { border-spacing: 2px; }
}

.color-swatches { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
  position: relative;
  transition: transform 0.1s;
}
.color-swatch:hover { transform: scale(1.08); }
.color-swatch input[type=radio] {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.color-swatch:has(input:checked) {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px white inset, 0 0 0 1px #0f172a;
}

/* ---------- Panel de inicio ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--superficie);
  border: 1px solid var(--gris-borde);
  border-radius: var(--radio-lg);
  box-shadow: var(--sombra);
  padding: 1.3rem 1.4rem;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--azul);
}
.stat-card:hover { box-shadow: var(--sombra-lg); transform: translateY(-2px); }
.stat-card.pendiente::before { background: #94a3b8; }
.stat-card.en_proceso::before { background: var(--amarillo); }
.stat-card.urgente::before { background: var(--rojo); }
.stat-card.info::before { background: var(--verde); }
.stat-card.notif::before { background: var(--morado); }
.stat-number { font-size: 2.15rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1; margin-bottom: 0.4rem; color: var(--texto); }
.stat-label { font-size: 0.85rem; color: var(--gris-texto); font-weight: 600; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: 1fr; } }

.grid-orden-resumen { display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 1.5rem; }
@media (max-width: 1100px) { .grid-orden-resumen { grid-template-columns: 1fr; } }

.dash-list-item {
  display: block;
  padding: 0.65rem 0.1rem;
  border-bottom: 1px solid var(--gris-borde);
  font-size: 0.86rem;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radio-sm);
  transition: background 0.1s;
}
.dash-list-item:hover { color: var(--azul); background: #fafbff; padding-left: 0.5rem; }
.dash-list-item:last-child { border-bottom: none; }
.dash-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.45rem; }
/* Citas y tareas de hoy / mañana: el borde lleva el color de la cita */
.dash-list-item.dash-evento {
  border: 2px solid var(--color-evento, var(--gris-borde));
  border-radius: var(--radio-sm);
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.5rem;
}
.dash-list-item.dash-evento:last-child { border-bottom: 2px solid var(--color-evento, var(--gris-borde)); }
.dash-list-item.dash-evento:hover { padding-left: 0.7rem; background: #fafbff; }

.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem 1.5rem;
}
.data-field { display: flex; flex-direction: column; gap: 0.2rem; }
.data-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gris-texto); font-weight: 650; }
.data-value { font-size: 0.95rem; color: var(--texto); }

.badge-tag {
  display: inline-block;
  color: white;
  font-size: 0.72rem;
  font-weight: 650;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  margin-right: 0.3rem;
  margin-bottom: 0.2rem;
  box-shadow: var(--sombra-sm);
}
.tag-checks { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.2rem; }
.tag-check { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; font-weight: 400; }
.tag-check input[type=checkbox] { width: auto; margin: 0; }
.check-filter-group { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.5rem 0; }
.check-filter-group.horizontal { flex-direction: row; flex-wrap: wrap; gap: 0.6rem 1rem; }

.barchart { display: flex; flex-direction: column; gap: 0.7rem; }
.barchart-row { display: grid; grid-template-columns: 140px 1fr 40px; align-items: center; gap: 0.7rem; }
.barchart-label { font-size: 0.85rem; color: var(--gris-texto-fuerte); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.barchart-label:hover { color: var(--azul); text-decoration: underline; }
.barchart-track { background: var(--neutro-suave); border-radius: 999px; height: 12px; overflow: hidden; }
.barchart-fill { height: 100%; border-radius: 999px; transition: width 0.4s ease; }
.barchart-value { font-size: 0.82rem; font-weight: 650; color: var(--gris-texto-fuerte); text-align: right; }
@media (max-width: 700px) {
  .barchart-row { grid-template-columns: 90px 1fr 30px; }
  .barchart-label { font-size: 0.78rem; }
}

/* ---------- Panel de Configuracion: tarjetas de acceso rapido ---------- */

.config-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.6rem;
}
.config-link-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--superficie);
  border: 1px solid var(--gris-borde);
  border-radius: var(--radio-lg);
  box-shadow: var(--sombra);
  padding: 1.3rem 1.4rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.config-link-card:hover { box-shadow: var(--sombra-lg); transform: translateY(-2px); border-color: #c7d2fe; }
.config-link-icon {
  font-size: 1.5rem;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radio-sm);
  background: var(--azul-suave);
  margin-bottom: 0.3rem;
}
.config-link-title { font-weight: 700; font-size: 0.96rem; color: var(--texto); }
.config-link-desc { font-size: 0.82rem; color: var(--gris-texto); line-height: 1.35; }

/* ---------- Proximos vencimientos: color segun cuantos dias quedan ---------- */

.venc-lista {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.8rem;
}
.venc-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radio-sm);
  border-left: 4px solid var(--gris-borde);
  background: #fafbfc;
}
.venc-item .data-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 650; }
.venc-item .data-value { font-size: 0.92rem; color: var(--texto); }

.venc-critico { border-left-color: var(--rojo); background: var(--rojo-suave); }
.venc-critico .data-label { color: var(--rojo-suave-texto); }

.venc-alto { border-left-color: var(--naranja); background: var(--naranja-suave); }
.venc-alto .data-label { color: var(--naranja-suave-texto); }

.venc-medio { border-left-color: var(--amarillo); background: var(--amarillo-suave); }
.venc-medio .data-label { color: var(--amarillo-suave-texto); }

.venc-bajo { border-left-color: var(--verde); background: var(--verde-suave); }
.venc-bajo .data-label { color: var(--verde-suave-texto); }

/* --- Informes: tiempos de proceso de pedidos --- */
.informe-seccion-cabecera { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem; margin: 0.5rem 0 1rem; }
.informe-seccion-cabecera h2 { margin: 0; }
.informe-periodo { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.informe-seccion-titulo { margin: 2rem 0 1rem; }
.stat-number-tiempo { font-size: 1.7rem; }
.stat-sub { font-size: 0.78rem; color: var(--gris-texto); margin-top: 0.35rem; }
.tabla-tiempos-proceso td { vertical-align: middle; white-space: nowrap; }
.tiempo-barra-celda { width: 35%; min-width: 120px; }
.reparto-tiempos { display: flex; height: 34px; border-radius: var(--radio-sm); overflow: hidden; margin: 0.6rem 0 0.5rem; }
.reparto-tramo {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.78rem; font-weight: 700; white-space: nowrap; overflow: hidden;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

/* Configuracion: estados de Tintoreria */
.cuina-estados-lista { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 1rem; }
.cuina-estado-opcion { display: flex; align-items: center; gap: 0.6rem; font-weight: 400; margin: 0; cursor: pointer; }
.cuina-estado-opcion input { width: auto; margin: 0; }
/* Etiqueta del tipo de pedido */
.pedido-tipo-cuina {
  display: inline-block; background: #ede9fe; color: #5b21b6; font-weight: 700;
  font-size: 0.72rem; padding: 0.12rem 0.55rem; border-radius: 999px; white-space: nowrap;
  vertical-align: middle;
}
.pedido-resumen-card .pedido-tipo-cuina {
  font-size: calc(0.66rem * var(--escala) / 100);
  padding: calc(0.08rem * var(--escala) / 100) calc(0.45rem * var(--escala) / 100);
}
.ref-linea { display: flex; align-items: center; gap: 0.4rem; }
.semaforo-hueco { visibility: hidden; }
@media (max-width: 800px) { .semaforo-hueco { display: none; } }

/* ---------- Notas de voz ---------- */
.nv-grabador { max-width: 560px; margin-left: auto; margin-right: auto; text-align: left; }
.nv-pasos-indicador { display: flex; gap: 1rem; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gris-texto); margin-bottom: 1rem; }
.nv-pasos-indicador .activo { color: var(--azul); font-weight: 700; }
.nv-pasos-indicador .hecho { color: #16a34a; font-weight: 600; }
#nvZonaGrabar { text-align: center; padding: 0.5rem 0 0.5rem; }
.nv-boton-grabar {
  width: 132px; height: 132px; border-radius: 50%; border: none; cursor: pointer;
  background: #dc2626; color: #fff; font-size: 3.2rem; line-height: 1;
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.35);
  transition: transform 0.1s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.nv-boton-grabar:active { transform: scale(0.96); }
.nv-boton-grabar.grabando { animation: nv-pulso 1.2s ease-in-out infinite; background: #b91c1c; }
.nv-boton-grabar.grabando .nv-icono-micro { display: none; }
.nv-boton-grabar.grabando::after { content: ''; display: inline-block; width: 38px; height: 38px; border-radius: 6px; background: #fff; }
@keyframes nv-pulso {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55); }
  50% { box-shadow: 0 0 0 18px rgba(220, 38, 38, 0); }
}
.nv-estado { text-align: center; margin: 0.9rem 0 0.3rem; font-weight: 600; }
.nv-tiempo { text-align: center; font-size: 1.8rem; font-variant-numeric: tabular-nums; font-weight: 700; color: #dc2626; }
.nv-limite { text-align: center; font-size: 0.78rem; margin-top: 0.3rem; }
.nv-botones { display: flex; gap: 0.6rem; justify-content: space-between; margin-top: 1rem; flex-wrap: wrap; }
.nv-botones .btn { flex: 1; min-width: 140px; text-align: center; padding-top: 0.8rem; padding-bottom: 0.8rem; }
.nv-destinatarios { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.5rem; margin-bottom: 1rem; }
.nv-destinatario {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem; margin: 0;
  border: 2px solid var(--gris-borde); border-radius: var(--radio-sm); cursor: pointer; font-weight: 500;
}
.nv-destinatario input { position: absolute; opacity: 0; pointer-events: none; width: auto; }
.nv-destinatario:has(input:checked) { border-color: var(--azul); background: var(--azul-suave); }
.nv-destinatario:has(input:focus-visible) { outline: 2px solid var(--azul); outline-offset: 2px; }
.nv-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--azul); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.nv-nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-enviada { width: 72px; height: 72px; margin: 0.5rem auto 0; border-radius: 50%; background: #16a34a; color: #fff; font-size: 2.4rem; display: flex; align-items: center; justify-content: center; }
.nv-nota { padding-top: 1rem; padding-bottom: 1rem; }
.nv-nota.nv-nueva { border-left: 4px solid #dc2626; }
.nv-nota-cabecera { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; font-size: 0.9rem; }
.nv-texto { margin: 0 0 0.5rem; font-size: 0.9rem; }
.nv-etiqueta { font-size: 0.72rem; padding: 0.15rem 0.5rem; border-radius: 999px; background: var(--gris-borde); color: var(--gris-texto); font-weight: 600; }
.nv-etiqueta-nueva { background: #dc2626; color: #fff; }
.nv-nota-pie { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.6rem; font-size: 0.85rem; }
.nv-form-adjuntar { display: flex; gap: 0.4rem; align-items: center; flex: 1; min-width: 240px; margin: 0; }
.nv-form-adjuntar select { margin: 0; flex: 1; min-width: 0; }
.nv-eliminar { color: #dc2626; }
.nv-orden-item { padding: 0.7rem 0; border-bottom: 1px solid var(--gris-borde); }
.nv-orden-item:last-of-type { border-bottom: none; }
.nv-avatar-yo { background: #16a34a; }

/* Pedidos finalizados: limpieza (solo admin) */
.pf-limpieza-filas { display: flex; flex-wrap: wrap; gap: 0.8rem 1.5rem; align-items: center; justify-content: space-between; }
.pf-limpieza-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0; }
.pf-limpieza-form input[type=date] { width: auto; margin: 0; }

/* Pedidos (empleado de especialidad): vistas y buscador en la misma fila */
.pedidos-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-bottom: 1rem; }
.pedidos-barra .cal-vistas { margin: 0; }
.pedidos-barra > form { margin: 0 !important; flex: 1; min-width: 260px; max-width: 560px; }
.pedidos-barra > form { flex: 0 1 460px; }
.pedidos-barra .resumen-tam-control { margin: 0; }
.pedidos-barra .resumen-tam-control { flex-wrap: nowrap; gap: 0.5rem; }
.pedidos-barra .resumen-tam-control label { margin: 0; }
.pedidos-barra .resumen-tam-control input[type="range"] { width: 140px; flex: 0 1 140px; margin: 0; }
.pedidos-barra .resumen-tam-control .resumen-tam-guardado:empty { display: none; }

/* Pedidos: vista "Escaner + pedidos" (empleado de especialidad) */
.panel-escaner { display: grid; grid-template-columns: minmax(260px, 20%) 1fr; gap: 1.2rem; align-items: start; }
.panel-escaner-izq { position: sticky; top: 0.8rem; }
.panel-escaner-izq iframe { display: block; width: 100%; height: calc(100vh - 200px); min-height: 520px; border: 1px solid var(--gris-borde); border-radius: var(--radio-lg); background: var(--fondo, #f5f6fa); }
.panel-escaner-der { min-width: 0; }
.panel-actualizado { animation: panel-flash 0.8s ease-out; }
@keyframes panel-flash { from { box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.35); border-radius: 12px; } to { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); } }
@media (max-width: 800px) {
  .panel-escaner { grid-template-columns: 1fr; }
  .panel-escaner-izq { position: static; }
  .panel-escaner-izq iframe { height: 460px; min-height: 0; }
}

/* Paginas embebidas (sin menu) */
body.embebido .container { padding: 0.8rem; }
body.embebido h1 { font-size: 1.15rem; margin-bottom: 0.8rem; }
body.embebido .validar-modo { font-size: 0.78rem; }
body.embebido .card { padding: 0.9rem; }

/* Vista Escaner + pedidos: etapa junto al titulo y boton de informacion */
.titulo-con-etapa { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.etapa-titulo { font-size: 0.95rem; padding: 0.3rem 0.8rem; vertical-align: middle; }
.validar-titulo-embed { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.info-btn {
  width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--azul); background: var(--superficie);
  color: var(--azul); font: italic 700 0.85rem/1 Georgia, serif; cursor: pointer; padding: 0; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.info-btn:hover, .info-btn.activo { background: var(--azul); color: #fff; }
.validar-info { background: var(--superficie); border: 1px solid var(--gris-borde); border-radius: var(--radio-sm); padding: 0.6rem 0.7rem; margin-bottom: 0.8rem; font-size: 0.8rem; }
.validar-info p { margin: 0 0 0.4rem !important; }
.validar-info .validar-modo { margin: 0; }

/* Tarjetas de pedidos ya iniciados: el borde parpadea
   - en curso: azul, rapido   - pausado: ambar, mas lento */
.pedido-resumen-card.parpadeo-en-curso { animation: borde-en-curso 1.1s ease-in-out infinite; }
.pedido-resumen-card.parpadeo-pausado { animation: borde-pausado 2s ease-in-out infinite; }
@keyframes borde-en-curso {
  0%, 100% { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.45); }
  50% { border-color: rgba(37, 99, 235, 0.15); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
@keyframes borde-pausado {
  0%, 100% { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.45); }
  50% { border-color: rgba(245, 158, 11, 0.15); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .pedido-resumen-card.parpadeo-en-curso { animation: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.45); }
  .pedido-resumen-card.parpadeo-pausado { animation: none; border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.45); }
}

/* Boton de aviso por WhatsApp (a la derecha del ultimo estado de proceso) */
.semaforo-btn.btn-whatsapp { background-color: #25d366; color: #fff; opacity: 0.55; }
.semaforo-btn.btn-whatsapp.listo { opacity: 1; box-shadow: 0 0 0 2px #128c7e inset; }
.semaforo-btn.btn-whatsapp.avisado { background-color: #128c7e; }
.semaforo-btn.btn-whatsapp:disabled { background-color: #cbd5e1; color: #475569; cursor: not-allowed; opacity: 1; transform: none; }
.whatsapp-avisado { display: block; font-size: 0.75rem; margin-top: 0.25rem; }

/* "Guardado en" de los pedidos (se guarda solo al elegir) */
.guardado-en { display: inline-flex; flex-direction: column; min-width: 150px; }
.guardado-en-select { margin: 0; padding: 0.3rem 0.5rem; font-size: 0.9rem; font-weight: 600; min-width: 150px; }
.guardado-en-select.sin-valor { color: var(--texto-suave, #64748b); font-weight: 400; }
.guardado-en-estado { font-size: 0.72rem; min-height: 1em; margin-top: 0.15rem; color: #64748b; }
.guardado-en-estado.ok { color: #059669; }
.guardado-en-estado.error { color: #dc2626; }
.pedido-resumen-guardado { font-size: calc(0.75rem * var(--escala, 75) / 75); color: #475569; }
.ubicacion-fila { flex-wrap: wrap; gap: 0.5rem; }
.ubicacion-renombrar { display: flex; gap: 0.4rem; align-items: center; flex: 1 1 220px; margin: 0; }
.ubicacion-renombrar input { margin: 0; }
.ubicacion-usos { white-space: nowrap; }
.pc-datos .guardado-en { position: relative; }
.pc-datos .guardado-en-estado { position: absolute; top: 100%; left: 0; white-space: nowrap; }

/* Pedidos sin fecha de entrega: dias que llevan en la tienda */
.badge.urgencia-tienda, .pedido-resumen-dias.urgencia-tienda { background: #e0f2fe; color: #075985; }
.pedido-card.urgencia-tienda { border-left-color: #0ea5e9; }
