@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}

body { 
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: #faf6f0;
}

/* Estilos Bento */
.bento-card {
  background-color: #ffffff;
  border: 1px solid #eedcd2;
  border-radius: 1.5rem; /* rounded-3xl */
  box-shadow: 0 4px 12px rgba(69, 26, 3, 0.03);
  transition: none !important;
}

.bento-card:hover {
  box-shadow: 0 8px 20px rgba(69, 26, 3, 0.06);
}

/* Scrollbar minimalista otoñal */
.custom-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.custom-scroll::-webkit-scrollbar-track {
  background: #faf6f0;
}

.custom-scroll::-webkit-scrollbar-thumb {
  background: #e5c3b2;
  border-radius: 9999px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
  background: #dd906b;
}

/* Pastel dynamic colors with text contrast */
.bg-pastel-blue {
  background-color: #ebf5fb !important;
  border-color: #d4e6f1 !important;
}

.bg-pastel-green {
  background-color: #e8f8f5 !important;
  border-color: #d1f2eb !important;
}

.bg-pastel-orange {
  background-color: #fdf2e9 !important;
  border-color: #fadbd8 !important;
}

.bg-pastel-purple {
  background-color: #f4ecf7 !important;
  border-color: #e8daef !important;
}

.bg-pastel-yellow {
  background-color: #fef9e7 !important;
  border-color: #fcf3cf !important;
}

/* Input styles for form categories */
.pastel-category-blue {
  background-color: #f2f7fc;
  border: 1px solid #d4e6f1;
}

.pastel-category-purple {
  background-color: #fbf6fc;
  border: 1px solid #e8daef;
}

.pastel-category-green {
  background-color: #f2fbf9;
  border: 1px solid #d1f2eb;
}

.pastel-category-yellow {
  background-color: #fffdf7;
  border: 1px solid #fcf3cf;
}

.pastel-category-orange {
  background-color: #fffaf5;
  border: 1px solid #fce4d6;
}

/* Collapsible system y Pantalla Completa */
body.card-open-active {
  overflow: hidden !important;
}

.collapsible-card {
  transition: none !important;
}

.collapsible-card.card-expanded,
.collapsible-card.card-expanded:hover,
.bento-card.collapsible-card.card-expanded,
.bento-card.collapsible-card.card-expanded:hover {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  z-index: 99999 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  overflow-y: auto !important;
  background-color: #fdfaf7 !important;
  backdrop-filter: blur(16px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4) !important;
  padding: 0 0 3rem 0 !important;
  transform: none !important;
  filter: none !important;
  will-change: auto !important;
  animation: cardFadeIn 0.15s ease-out !important;
}

/* Jerarquía de capas (z-index) para evitar que cualquier diálogo quede oculto */
#modal-tech-chat-view,
#modal-reception-chat {
  z-index: 100100 !important;
}

#tech-profile-drawer,
#modal-quick-story-popup {
  z-index: 100200 !important;
}

#form-modal,
#quick-order-modal,
#rental-order-modal,
#rental-detail-modal,
#envio-modal,
#guia-envio-modal,
#fix-errored-order-modal,
#wallpaper-modal,
#tools-url-modal,
#pb-login-modal,
#modal-select-technician-profile,
#modal-reception-incompatible {
  z-index: 100400 !important;
}

/* Modales de Confirmación y Acciones Prioritarias (SIEMPRE por encima de todo) */
#modal-confirma-pero,
#modal-confirm-por-piezas,
#signature-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100800 !important;
}

#modal-confirma-pero textarea {
  min-height: 120px !important;
  line-height: 1.5 !important;
  color: #0f172a !important;
  background-color: #ffffff !important;
  box-sizing: border-box !important;
}

#passkey-modal,
#biometric-scan-modal {
  z-index: 100850 !important;
}

#conflict-modal,
#sync-import-modal {
  z-index: 100900 !important;
}

#pwa-install-banner {
  z-index: 100920 !important;
}

#sync-loading-overlay,
#loading-overlay {
  z-index: 100950 !important;
}

#toast {
  z-index: 100999 !important;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.collapsible-card.card-expanded .collapsible-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  padding: 1.25rem 2rem !important;
  margin: 0 0 1.5rem 0 !important;
  border-bottom: 2px solid rgba(229, 210, 195, 0.9);
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.08);
}

.collapsible-card.card-expanded .collapsible-header .card-expand-badge {
  background-color: #ef4444 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
}

.collapsible-card.card-expanded .collapsible-header .card-expand-badge i::before {
  content: "\f066" !important; /* fa-compress */
}

.collapsible-card.card-expanded .collapsible-header .card-expand-badge span.card-expand-text {
  font-size: 0;
}

.collapsible-card.card-expanded .collapsible-header .card-expand-badge span.card-expand-text::before {
  content: "Cerrar Pantalla Completa" !important;
  font-size: 10px;
}

.collapsible-card.card-expanded .collapsible-body.expanded {
  max-height: none !important;
  opacity: 1 !important;
  overflow: visible !important;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem 1.5rem;
}

.collapsible-header {
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.collapsible-header:hover {
  background-color: rgba(69, 26, 3, 0.02);
}

.collapsible-body {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  display: none;
  transition: none !important;
}

.collapsible-body.expanded {
  max-height: none !important;
  opacity: 1 !important;
  display: block !important;
  transition: none !important;
}

.chevron-icon {
  transition: transform 0.3s ease;
}

.chevron-icon.rotate-180 {
  transform: rotate(180deg);
}

/* Onboarding / Selection Cards */
.selection-card {
  background-color: #ffffff;
  border: 2px solid #eedcd2;
  border-radius: 1.75rem;
  padding: 2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.selection-card:hover {
  transform: translateY(-4px);
  border-color: #e05a26;
  box-shadow: 0 10px 25px rgba(224, 90, 38, 0.1);
}

.step-container-card {
  background-color: #ffffff;
  border: 2px solid #eedcd2;
  border-radius: 2rem;
  box-shadow: 0 10px 25px rgba(69, 26, 3, 0.08);
  width: 100%;
  max-width: 580px;
  padding: 2.5rem;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pattern Lock styles */
.pattern-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #eedcd2; /* autumn-200 */
  position: relative;
  transition: background-color 0.2s, transform 0.2s;
}

.pattern-dot-wrapper:hover .pattern-dot {
  background-color: #dd906b; /* autumn-400 */
  transform: scale(1.15);
}

.pattern-dot.active {
  background-color: #e05a26; /* autumn-500 */
  transform: scale(1.25);
}

.pattern-dot.active .pattern-halo {
  transform: scale(2.4);
  background-color: rgba(224, 90, 38, 0.15);
}

.pattern-dot.error {
  background-color: #ef4444; /* red-500 */
  transform: scale(1.25);
}

.pattern-dot.error .pattern-halo {
  transform: scale(2.4);
  background-color: rgba(239, 68, 68, 0.15);
}

.pattern-halo {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.2s, background-color 0.2s;
  pointer-events: none;
}

.pattern-number {
  position: absolute;
  top: -12px;
  right: -12px;
  font-size: 10px;
  font-weight: 800;
  background-color: #ffffff;
  color: #7c2d12; /* autumn-700 */
  border: 1px solid #eedcd2;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  pointer-events: none;
  user-select: none;
  transition: all 0.2s;
}

.pattern-dot.active .pattern-number {
  background-color: #e05a26;
  color: #ffffff;
  border-color: #e05a26;
}

.pattern-dot.error .pattern-number {
  background-color: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

/* Shake animation for errors */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.shake-animation {
  animation: shake 0.4s ease-in-out;
}

/* Estilos para tarjetas en espera de confirmación / por confirmar (contorno negro que titila, sin opacar la card) */
.collapsible-card.status-por-confirmar {
  border: 2px solid #000000 !important;
  animation: border-blink 1.5s infinite ease-in-out !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes border-blink {
  0%, 100% {
    border-color: #000000;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
  }
  50% {
    border-color: #dcd6e2;
    box-shadow: none;
  }
}

/* Modo lista (colapsada/cerrada) mantiene tamaño y opacidad normales */
.collapsible-card.status-por-confirmar:not(.card-expanded) {
  opacity: 1;
  transform: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

/* Hover sutil cuando está colapsada */
.collapsible-card.status-por-confirmar:not(.card-expanded):hover {
  opacity: 1;
  transform: none;
}

/* Al expandirse mantiene su tamaño */
.collapsible-card.status-por-confirmar.card-expanded {
  opacity: 1;
  transform: none;
}

/* PIN Lock and Keypad Styles */
.pin-digit-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  border: 2px solid #eedcd2; /* autumn-200 */
  background-color: #ffffff;
  font-size: 1.5rem;
  font-weight: 900;
  color: #451a03; /* autumn-800 */
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.pin-digit-slot.active {
  border-color: #e05a26; /* autumn-500 */
  background-color: #fdfbf7; /* autumn-50 */
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(224, 90, 38, 0.25);
}

.pin-digit-slot.filled {
  border-color: #e05a26;
  background-color: #e05a26;
  transform: scale(1.02);
}

.pin-digit-slot.error {
  border-color: #ef4444; /* red-500 */
  background-color: #ef4444;
  color: #ffffff;
  animation: shake 0.4s ease-in-out;
}

.keypad-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 3.75rem !important;
  width: 100% !important;
  min-width: 3.75rem !important;
  background-color: #faf6f0 !important; /* Fuerza el fondo crema suave */
  border: 1px solid #e5c3b2 !important; /* Fuerza el borde otoñal visible */
  border-radius: 1.25rem !important;
  font-size: 1.35rem !important;
  font-weight: 800 !important;
  color: #451a03 !important;
  cursor: pointer !important;
  transition: all 0.2s ease-in-out !important;
  box-shadow: 0 2px 5px rgba(69, 26, 3, 0.08) !important;
  user-select: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.keypad-btn:hover {
  background-color: #f5ebf7 !important;
  border-color: #dd906b !important;
  transform: translateY(-1px);
}

.keypad-btn:active {
  background-color: #e5c3b2 !important;
  transform: scale(0.95);
}

/* ================= FALLBACKS SI TAILWIND CSS NO CARGA ================= */
.hidden {
  display: none;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #faf6f0;
  color: #451a03;
}

#view-login:not(.hidden) {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  background: linear-gradient(to top right, #faf6f0, #fdfbf7, #eedcd2);
}

#login-card {
  background-color: #ffffff;
  border: 2px solid #eedcd2;
  border-radius: 1.5rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 28rem; /* max-w-md */
  box-shadow: 0 10px 25px rgba(69, 26, 3, 0.08);
  box-sizing: border-box;
}

#login-card .text-center {
  text-align: center;
  margin-bottom: 1.5rem;
}

#login-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #270e01;
  margin: 0.5rem 0 0 0;
  line-height: 1.25;
}

#login-card p {
  font-size: 0.875rem;
  color: #b45309;
  margin: 0.25rem 0 0 0;
}

#login-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #7c2d12;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  margin-bottom: 1rem;
}

#pin-display-container {
  display: flex !important;
  justify-content: center !important;
  gap: 1rem !important;
  margin-top: 0.5rem !important;
  margin-bottom: 1.5rem !important;
}

#pin-keypad {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0.75rem !important;
  width: 16rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 0.25rem !important;
  margin-bottom: 0.25rem !important;
}



/* ================= ESTILOS INTERFAZ WARM AUTUMN & DESLIZADORES SLIDE-TO-ACTION (PANEL TÉCNICOS) ================= */
.wa-chat-bg {
  background-color: #faf6f0;
  background-image: radial-gradient(#eedcd2 1px, transparent 1px);
  background-size: 24px 24px;
}

.chat-bubble-out {
  background-color: #e05a26 !important;
  color: #ffffff !important;
  border-radius: 1.25rem 1.25rem 0.25rem 1.25rem !important;
  box-shadow: 0 4px 12px rgba(224, 90, 38, 0.2) !important;
}

.chat-bubble-in {
  background-color: #ffffff !important;
  color: #270e01 !important;
  border-radius: 1.25rem 1.25rem 1.25rem 0.25rem !important;
  border: 1px solid #eedcd2 !important;
  box-shadow: 0 2px 6px rgba(69, 26, 3, 0.06) !important;
}

.chat-bubble-system {
  background-color: #fef3c7 !important;
  color: #78350f !important;
  border: 1px solid #fde68a !important;
  border-radius: 1rem !important;
  box-shadow: 0 2px 6px rgba(120, 53, 15, 0.08) !important;
}

.chat-item-active {
  background-color: #fdfbf7 !important;
  border-left: 4px solid #e05a26 !important;
  box-shadow: 0 2px 8px rgba(224, 90, 38, 0.12) !important;
}

.chat-item-active:hover {
  background-color: #faf6f0 !important;
}

/* DESLIZADOR INTERACTIVO UBER (SLIDE-TO-ACTION) */
.uber-slide-container {
  position: relative;
  width: 100%;
  height: 60px;
  background-color: #f4f4f5;
  border: 2px solid #e4e4e7;
  border-radius: 1.75rem;
  overflow: hidden;
  user-select: none;
  touch-action: pan-y;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.08);
}

.uber-slide-track {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  border-radius: 1.75rem;
  transition: width 0.05s ease-out;
}

.uber-slide-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.2s;
  padding: 0 1rem;
}

.uber-slide-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 50px;
  height: 50px;
  border-radius: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.05s ease-out, background-color 0.2s;
  touch-action: none;
}

.uber-slide-thumb:active {
  cursor: grabbing;
}



/* Transición del Drawer de Perfil */
.wa-drawer-open {
  transform: translateX(0) !important;
}

.wa-drawer-closed {
  transform: translateX(100%) !important;
}

/* Chips de estado rápido */
.status-chip {
  transition: all 0.15s ease-in-out;
}
.status-chip:hover {
  transform: translateY(-1px);
}

/* ================= ESCALA MÁS GRANDE EN GENERAL PARA TÉCNICOS ================= */
#view-tecnicos {
  font-size: 1.05rem;
}

#view-tecnicos .tech-status-tab {
  font-size: 0.85rem !important;
  padding: 0.5rem 0.85rem !important;
}

#view-tecnicos .tab-badge {
  font-size: 0.75rem !important;
  padding: 0.15rem 0.5rem !important;
}

@media (min-width: 768px) {
  #view-tecnicos #tech-chat-sidebar {
    width: 24rem !important;
  }
}

@media (min-width: 1024px) {
  #view-tecnicos #tech-chat-sidebar {
    width: 26rem !important;
  }
}

#tecnicos-list .font-extrabold.text-xs {
  font-size: 0.95rem !important;
}

#tecnicos-list .text-\[11px\] {
  font-size: 0.85rem !important;
}

#tecnicos-list .text-\[10px\] {
  font-size: 0.8rem !important;
}

.chat-bubble-out,
.chat-bubble-in {
  font-size: 0.95rem !important;
  padding: 0.85rem 1.1rem !important;
  line-height: 1.5 !important;
}

.chat-bubble-system {
  font-size: 0.875rem !important;
  padding: 0.85rem 1.1rem !important;
}

#tech-chat-active-container h3 {
  font-size: 1rem !important;
}

#tech-chat-active-container p {
  font-size: 0.85rem !important;
}

#view-tecnicos .status-chip {
  font-size: 0.85rem !important;
  padding: 0.45rem 0.8rem !important;
}

#view-tecnicos input,
#view-tecnicos textarea {
  font-size: 0.95rem !important;
}

/* ================= CORRECCIÓN RESPONSIVA PARA MÓVILES (VISTA Y PERFIL DE ÓRDENES TALLER) ================= */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

@media (max-width: 767px) {
  body.tech-chat-open {
    overflow: hidden !important;
  }

  /* El contenedor principal de chat ocupa toda la pantalla útil sin desbordarse hacia abajo */
  #tech-chat-container {
    height: calc(100dvh - 65px) !important;
    max-height: calc(100dvh - 65px) !important;
    min-height: auto !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }

  /* Drawer de detalles/perfil de la orden en celulares: visualización tipo Sheet Modal completa */
  #tech-profile-drawer {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    z-index: 100050 !important;
    border-left: none !important;
  }

  /* Modales centrados para que los botones inferiores queden siempre a la vista */
  #form-modal > div,
  #quick-order-modal > div {
    max-height: 88dvh !important;
    overflow-y: auto !important;
  }
}

/* ================= SISTEMA DE NOTIFICACIONES INTERNAS EN ESQUINA SUPERIOR DERECHA ================= */
#in-app-notifications-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 24rem;
  width: calc(100vw - 2rem);
  pointer-events: none;
}

.in-app-toast-card {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 1.25rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border-left-width: 5px;
  overflow: hidden;
  position: relative;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: slideInRightToast 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.in-app-toast-card.toast-leaving {
  animation: slideOutRightToast 0.3s ease-in forwards;
}

@keyframes slideInRightToast {
  from {
    opacity: 0;
    transform: translateX(110%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes slideOutRightToast {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(110%) scale(0.9);
  }
}

.in-app-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.35;
  width: 100%;
  animation: toastProgress linear forwards;
}

/* Transición del Drawer de Perfil */
.wa-drawer-open {
  transform: translateX(0) !important;
}

.wa-drawer-closed {
  transform: translateX(100%) !important;
}

/* Chips de estado rápido */
.status-chip {
  transition: all 0.15s ease-in-out;
}
.status-chip:hover {
  transform: translateY(-1px);
}

/* ================= ESCALA MÁS GRANDE EN GENERAL PARA TÉCNICOS ================= */
#view-tecnicos {
  font-size: 1.05rem;
}

#view-tecnicos .tech-status-tab {
  font-size: 0.85rem !important;
  padding: 0.5rem 0.85rem !important;
}

#view-tecnicos .tab-badge {
  font-size: 0.75rem !important;
  padding: 0.15rem 0.5rem !important;
}

@media (min-width: 768px) {
  #view-tecnicos #tech-chat-sidebar {
    width: 24rem !important;
  }
}

@media (min-width: 1024px) {
  #view-tecnicos #tech-chat-sidebar {
    width: 26rem !important;
  }
}

#tecnicos-list .font-extrabold.text-xs {
  font-size: 0.95rem !important;
}

#tecnicos-list .text-\[11px\] {
  font-size: 0.85rem !important;
}

#tecnicos-list .text-\[10px\] {
  font-size: 0.8rem !important;
}

.chat-bubble-out,
.chat-bubble-in {
  font-size: 0.95rem !important;
  padding: 0.85rem 1.1rem !important;
  line-height: 1.5 !important;
}

.chat-bubble-system {
  font-size: 0.875rem !important;
  padding: 0.85rem 1.1rem !important;
}

#tech-chat-active-container h3 {
  font-size: 1rem !important;
}

#tech-chat-active-container p {
  font-size: 0.85rem !important;
}

#view-tecnicos .status-chip {
  font-size: 0.85rem !important;
  padding: 0.45rem 0.8rem !important;
}

#view-tecnicos input,
#view-tecnicos textarea {
  font-size: 0.95rem !important;
}

/* ================= CORRECCIÓN RESPONSIVA PARA MÓVILES (VISTA Y PERFIL DE ÓRDENES TALLER) ================= */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

@media (max-width: 767px) {
  body.tech-chat-open {
    overflow: hidden !important;
  }

  /* El contenedor principal de chat ocupa toda la pantalla útil sin desbordarse hacia abajo */
  #tech-chat-container {
    height: calc(100dvh - 65px) !important;
    max-height: calc(100dvh - 65px) !important;
    min-height: auto !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }

  /* Drawer de detalles/perfil de la orden en celulares: visualización tipo Sheet Modal completa */
  #tech-profile-drawer {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    z-index: 100050 !important;
    border-left: none !important;
  }

  /* Modales centrados para que los botones inferiores queden siempre a la vista */
  #form-modal > div,
  #quick-order-modal > div {
    max-height: 88dvh !important;
    overflow-y: auto !important;
  }
}

/* ================= SISTEMA DE NOTIFICACIONES INTERNAS EN ESQUINA SUPERIOR DERECHA ================= */
#in-app-notifications-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 24rem;
  width: calc(100vw - 2rem);
  pointer-events: none;
}

.in-app-toast-card {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 1.25rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border-left-width: 5px;
  overflow: hidden;
  position: relative;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: slideInRightToast 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.in-app-toast-card.toast-leaving {
  animation: slideOutRightToast 0.3s ease-in forwards;
}

@keyframes slideInRightToast {
  from {
    opacity: 0;
    transform: translateX(110%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes slideOutRightToast {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(110%) scale(0.9);
  }
}

.in-app-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.35;
  width: 100%;
  animation: toastProgress linear forwards;
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* ================= ANIMACIONES DE PROGRESO DE SUBIDA DE FOTOS ================= */
@keyframes pulseGlowRing {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(224, 90, 38, 0.4);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(224, 90, 38, 0);
  }
}

.animate-glow-ring {
  animation: pulseGlowRing 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

.upload-shimmer-bar {
  background-size: 200% 100%;
  background-image: linear-gradient(90deg, #e05a26 0%, #f59e0b 50%, #10b981 100%);
  transition: width 0.25s ease-out;
}

/* ================= CONTENCIÓN DE ETIQUETAS Y BADGES PARA MÓVILES ================= */
.badge-contained {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.tags-nowrap-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 100%;
  overflow: hidden;
}

/* Prevención de desbordamiento horizontal en tarjetas de listas de taller */
#taller-chats-list-container > div,
#tecnicos-list > div {
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* ================= GRID INTERACTIVA DE TIPOS DE TRABAJO EN RECEPCIÓN ================= */
.worktype-stat-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, box-shadow;
}

.worktype-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(69, 26, 3, 0.08);
}

.worktype-stat-card:active {
  transform: translateY(0) scale(0.98);
}

.worktype-card-active {
  position: relative;
}

.worktype-card-active#worktype-card-ABC {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35), 0 8px 16px rgba(37, 99, 235, 0.15) !important;
}

.worktype-card-active#worktype-card-LAVADA_LUBRICADA {
  border-color: #0d9488 !important;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.35), 0 8px 16px rgba(13, 148, 136, 0.15) !important;
}

.worktype-card-active#worktype-card-TEJIDA_ARO {
  border-color: #d97706 !important;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.35), 0 8px 16px rgba(217, 119, 6, 0.15) !important;
}

.worktype-card-active#worktype-card-OTRO {
  border-color: #9333ea !important;
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.35), 0 8px 16px rgba(147, 51, 234, 0.15) !important;
}

/* Badge de trabajo asignado en cabeceras de órdenes */
.worktype-badge-assigned {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: all 0.2s ease;
}

.worktype-badge-abc {
  background-color: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.worktype-badge-lavada {
  background-color: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.worktype-badge-tejida {
  background-color: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.worktype-badge-otro {
  background-color: #faf5ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}
