/* ============================================================
   Lavandería — identidad visual basada en el logo del negocio
   (rojo / azul marino / blanco / dorado / verde, estilo bandera +
   hojas). Navbar superior (no sidebar), con animaciones de
   entrada y micro-interacciones.
   ============================================================ */

:root {
  --lav-primary: #1e3a8a;
  --lav-primary-dark: #142a63;
  --lav-primary-soft: #dbe6fb;
  --lav-red: #dc2626;
  --lav-red-dark: #a91d1d;
  --lav-gold: #f5b700;
  --lav-green: #16a34a;
  --lav-accent: var(--lav-red);
  --lav-accent-dark: var(--lav-red-dark);
  --surface: #ffffff;
  --bg-body: #f7f8fb;
  --border-soft: #e3e6ee;
  --text-mute: #64748b;
  --text-base: #1c2333;
  --radius-lg: 16px;
  --radius-md: 10px;
}
[data-bs-theme="dark"] {
  --surface: #15182a;
  --bg-body: #0a0c16;
  --border-soft: #2a3050;
  --text-mute: #9aa3c2;
  --text-base: #eef0f8;
  --lav-primary-soft: #1c2a55;
}

body {
  background: var(--bg-body);
  color: var(--text-base);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
h1, h2, h3, h4, h5, h6, .lav-brand, .nav-link, .btn {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
h1, h2, h3 { font-weight: 600; }

/* ===================== Franja tricolor (guiño a la bandera del logo) ===================== */
.lav-stripe {
  height: 4px;
  background: linear-gradient(90deg, var(--lav-red) 0 33%, #fff 33% 66%, var(--lav-primary) 66% 100%);
}

/* ===================== Navbar superior ===================== */
.lav-navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  padding: .6rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 30;
  animation: lav-slide-down .45s ease both;
}
.lav-brand {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--lav-primary-dark);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}
[data-bs-theme="dark"] .lav-brand { color: #c9d6ff; }
.lav-brand .bi { color: var(--lav-red); }
.lav-brand img { height: 38px; width: auto; display: block; }
.lav-navbar .nav-link {
  color: var(--text-base);
  font-weight: 500;
  font-size: .92rem;
  border-radius: var(--radius-md);
  padding: .45rem .8rem !important;
  transition: background .15s ease, color .15s ease;
}
.lav-navbar .nav-link:hover { background: var(--lav-primary-soft); }
.lav-navbar .nav-link.is-active { background: var(--lav-primary); color: #fff; }
.lav-navbar .dropdown-menu { border-radius: var(--radius-md); border: 1px solid var(--border-soft); }
.lav-tienda-badge {
  background: var(--lav-primary-soft);
  color: var(--lav-primary-dark);
  border-radius: 999px;
  padding: .3rem .8rem;
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}
[data-bs-theme="dark"] .lav-tienda-badge { color: #c9d6ff; background: rgba(30,58,138,.35); }
.lav-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--lav-primary), var(--lav-red));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; flex-shrink: 0;
}
.lav-iconbtn {
  width: 36px; height: 36px; border-radius: var(--radius-md); border: none; background: transparent;
  color: var(--text-base); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none; transition: background .15s ease, transform .15s ease;
}
.lav-iconbtn:hover { background: var(--lav-primary-soft); transform: translateY(-1px); }

.lav-content { padding: 1.75rem 1.25rem; max-width: 1320px; margin: 0 auto; width: 100%; }
.lav-footer { padding: 1rem 1.25rem; text-align: center; font-size: .82rem; color: var(--text-mute); }
.lav-footer-credit { font-size: .76rem; color: var(--text-mute); opacity: .85; }

/* ===================== Tarjetas, botones ===================== */
.card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  background: var(--surface);
  animation: lav-fade-up .4s ease both;
}
.card-header { border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important; font-weight: 600; }
.btn { border-radius: var(--radius-md); font-weight: 500; transition: transform .12s ease, box-shadow .12s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-lav, .btn-lav-primary {
  background: var(--lav-primary); border-color: var(--lav-primary); color: #fff;
}
.btn-lav:hover, .btn-lav-primary:hover { background: var(--lav-primary-dark); border-color: var(--lav-primary-dark); color: #fff; box-shadow: 0 6px 16px rgba(30,58,138,.25); }
.btn-lav-accent { background: var(--lav-red); border-color: var(--lav-red); color: #fff; }
.btn-lav-accent:hover { background: var(--lav-red-dark); border-color: var(--lav-red-dark); color: #fff; box-shadow: 0 6px 16px rgba(220,38,38,.25); }
.form-control:focus, .form-select:focus {
  border-color: var(--lav-primary); box-shadow: 0 0 0 .2rem rgba(30,58,138,.15);
}

.card-stat .card-body h2 { margin-bottom: 0; font-weight: 700; }
.card-stat .card-body h6 { font-size: .82rem; opacity: .9; margin-bottom: .35rem; }

.badge { border-radius: 999px; font-weight: 500; }
.bg-warning.text-dark { background: var(--lav-gold) !important; }

/* ===================== Animaciones ===================== */
@keyframes lav-slide-down { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes lav-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes lav-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes lav-shimmer { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }

.lav-content > *:nth-child(1) { animation-delay: .02s; }
.lav-content > *:nth-child(2) { animation-delay: .07s; }
.lav-content > *:nth-child(3) { animation-delay: .12s; }
.lav-content > *:nth-child(4) { animation-delay: .17s; }
.lav-content .card { animation-name: lav-fade-up; }

.alert { animation: lav-pop .3s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, .card, .lav-navbar, .alert { animation: none !important; transition: none !important; }
}

@media (max-width: 991px) {
  .lav-content { padding: 1.25rem .9rem; }
}

/* ===================== Vista de impresión (Epson LX-200, matricial) =====================
   Boleta angosta de 40 columnas (formato continuo típico de bobina/formulario
   para matriciales en negocios pequeños). Si tu LX-200 usa papel continuo
   ancho (fanfold carta), ajusta $anchoColumnas en boleta_imprimir.php y este
   ancho en mm/in — ver README. */
.ticket-print {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  line-height: 1.3;
  white-space: pre;
  width: 40ch;
  margin: 0 auto;
}
@media print {
  body { margin: 0; }
  .no-print { display: none !important; }
  .ticket-print { font-size: 12px; }
}

/* ===================== App móvil de repartidores ===================== */
.lav-mobile-app {
  max-width: 480px; margin: 0 auto; min-height: 100vh;
  background: var(--bg-body); padding-bottom: 2rem;
}
.lav-mobile-topbar {
  background: linear-gradient(135deg, var(--lav-primary), var(--lav-primary-dark));
  color: #fff; padding: 1.1rem 1.25rem; border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.lav-task-card { border-radius: var(--radius-lg); border: 1px solid var(--border-soft); animation: lav-fade-up .35s ease both; }
.lav-scan-frame {
  border: 3px dashed var(--lav-gold); border-radius: var(--radius-lg);
  overflow: hidden; position: relative; background: #000;
}
.lav-scan-frame video { width: 100%; display: block; }
