/* =============================================
   CRM WhatsApp — Design System v2.0
   Paleta: Navy-purple dark (#14142b)
   Tipografía: Inter + Outfit (Google Fonts)
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

/* =============================================
   CSS VARIABLES
   ============================================= */
:root {
  /* Light Mode */
  --bg-primary: #f8f7fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f3f4f6;
  --bg-input: #f9fafb;
  --bg-sidebar: #ffffff;
  --bg-chat-bubble-in: #f3f4f6;
  --bg-chat-bubble-out: #7367F0;
  --border: #e5e7eb;
  --border-hover: #d1d5db;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-bubble-out: #ffffff;
  --accent: #7367F0;
  --accent-hover: #5a4fd4;
  --accent-soft: rgba(115, 103, 240, 0.1);
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.1);
  --info: #3b82f6;
  --info-soft: rgba(59, 130, 246, 0.1);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: 0.25s ease;
  --sidebar-width: 240px;
  --header-height: 56px;
}

/* Dark Mode — Paleta Oficial Vuexy SaaS (#25293C base · #2F3349 surface · #7367F0 accent) */
.dark {
  --bg-primary: #25293c;
  --bg-secondary: #2f3349;
  --bg-card: #2f3349;
  --bg-card-hover: #363b54;
  --bg-input: #25293c;
  --bg-sidebar: #2f3349;
  --bg-chat-bubble-in: #323752;
  --bg-chat-bubble-out: #7367F0;
  --border: rgba(225, 222, 245, 0.08);
  --border-hover: rgba(225, 222, 245, 0.16);
  --text-primary: #cfd3ec;
  --text-secondary: #a3a7c5;
  --text-muted: #797e9e;
  --text-bubble-out: #ffffff;
  --accent: #7367F0;
  --accent-hover: #675dd8;
  --shadow-sm: 0 2px 4px rgba(15, 20, 34, 0.4);
  --shadow-md: 0 4px 18px rgba(15, 20, 34, 0.5);
  --shadow-lg: 0 10px 30px rgba(15, 20, 34, 0.6);
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  line-height: 1.3;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Scrollbar custom */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* =============================================
   APP SPLASH SCREEN (CARGA ORGÁNICA SIN TIEMPO FIJO - DOBLE TAMAÑO)
   ============================================= */
.app-splash {
  position: fixed;
  inset: 0;
  background: #14142b;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.app-splash.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.03);
}

.splash-glow {
  position: absolute;
  width: min(720px, 90vw);
  height: min(720px, 90vw);
  background: radial-gradient(circle, rgba(115, 103, 240, 0.28) 0%, rgba(40, 199, 111, 0.1) 45%, transparent 70%);
  border-radius: 50%;
  filter: blur(65px);
  animation: splashPulseGlow 3s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes splashPulseGlow {
  0% { transform: scale(0.85); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 1; }
}

.splash-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  max-width: min(540px, 92vw);
}

.splash-logo-container {
  position: relative;
  width: 144px;
  height: 144px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}

.splash-logo-pulse {
  position: absolute;
  inset: -12px;
  border-radius: 44px;
  background: linear-gradient(135deg, #7367F0, #28C76F);
  opacity: 0.45;
  filter: blur(20px);
  animation: splashPulseLogo 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes splashPulseLogo {
  0%, 100% { opacity: 0.35; transform: scale(0.95); }
  50% { opacity: 0.75; transform: scale(1.08); }
}

.splash-logo-icon {
  position: relative;
  width: 136px;
  height: 136px;
  background: linear-gradient(135deg, rgba(47, 51, 73, 0.95) 0%, rgba(37, 41, 60, 0.98) 100%);
  border: 2px solid rgba(115, 103, 240, 0.45);
  border-radius: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.2rem;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6), inset 0 2px 2px rgba(255, 255, 255, 0.2);
}

.splash-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  color: #cfd3ec;
  margin: 0 0 0.6rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  letter-spacing: -0.5px;
}

.splash-badge {
  font-size: clamp(0.8rem, 2vw, 1.05rem);
  font-weight: 700;
  padding: 0.25rem 0.85rem;
  border-radius: 12px;
  background: rgba(115, 103, 240, 0.2);
  color: #7367F0;
  border: 1.5px solid rgba(115, 103, 240, 0.35);
  letter-spacing: 0.5px;
}

.splash-status {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: #a3a7c5;
  margin: 0 0 2rem 0;
  font-weight: 400;
  letter-spacing: 0.3px;
}

.splash-progress-track {
  width: min(380px, 85vw);
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.splash-progress-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 45%;
  background: linear-gradient(90deg, #7367F0, #28C76F);
  border-radius: 99px;
  animation: splashIndeterminate 1.3s cubic-bezier(0.65, 0, 0.35, 1) infinite;
  box-shadow: 0 0 18px rgba(115, 103, 240, 0.8);
}

@keyframes splashIndeterminate {
  0% { left: -45%; width: 30%; }
  50% { width: 60%; }
  100% { left: 100%; width: 30%; }
}

/* =============================================
   LOGIN FULL-SCREEN TURISMO + IA (PANORÁMICO + MASCOTAS VIAJERAS)
   ============================================= */
.login-overlay {
  position: fixed;
  inset: 0;
  background: #0f1738;
  display: flex;
  z-index: 9999;
  overflow-x: hidden;
  overflow-y: auto;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.login-overlay.hidden { opacity: 0; pointer-events: none; visibility: hidden; }

.login-split-container {
  position: relative;
  display: flex;
  width: 100vw;
  min-height: 100dvh;
  background-color: #131c47;
  background-image:
    linear-gradient(90deg, rgba(10, 19, 54, 0.84) 0%, rgba(14, 27, 72, 0.58) 38%, rgba(45, 52, 125, 0.18) 68%, rgba(88, 92, 185, 0.32) 100%),
    url('/img/login/bg-hero-turismo.webp');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  overflow: hidden;
}

/* Capa de Aviones y Estelas Punteadas en Movimiento */
.login-planes-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.plane-trail-path {
  animation: dashTrailFlow 14s linear infinite;
}
@keyframes dashTrailFlow {
  to { stroke-dashoffset: -160; }
}
.flying-plane-unit {
  filter: drop-shadow(0 4px 10px rgba(14, 165, 233, 0.55)) drop-shadow(0 0 6px rgba(255, 255, 255, 0.65));
  will-change: transform;
}

/* --- LADO IZQUIERDO: PROPUESTA TURÍSTICA + 6 MÓDULOS + 4 DESTINOS --- */
.login-hero-side {
  flex: 1.05;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.4rem 2.5rem 2.2rem 3.4rem;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 0.95rem;
}
.hero-brand-logo {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, #38bdf8 0%, #4f46e5 55%, #7c3aed 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.5), 0 0 20px rgba(56, 189, 248, 0.35);
}
.hero-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.hero-badge {
  font-size: 0.72rem;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #ffffff;
  padding: 0.16rem 0.62rem;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.45);
}
.hero-subtitle {
  color: rgba(238, 242, 255, 0.88);
  font-size: 0.86rem;
  margin-top: 0.15rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

/* Copywriting central */
.hero-copy-block {
  margin: auto 0;
  padding: 1rem 0;
  max-width: 560px;
}
.hero-headline {
  font-size: clamp(2rem, 2.85vw, 2.75rem);
  font-weight: 800;
  line-height: 1.14;
  color: #ffffff;
  letter-spacing: -0.025em;
  margin-bottom: 0.85rem;
  text-shadow: 0 4px 18px rgba(6, 12, 34, 0.55);
}
.headline-cyan {
  background: linear-gradient(90deg, #38bdf8 0%, #67e8f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 10px rgba(56, 189, 248, 0.28));
}
.hero-lead {
  font-size: 0.96rem;
  line-height: 1.55;
  color: rgba(241, 245, 249, 0.92);
  margin-bottom: 1.65rem;
  text-shadow: 0 2px 10px rgba(6, 12, 34, 0.65);
}

/* Matriz 3x2 de 6 Módulos con Squircles a Color */
.hero-features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 0.95rem 1.1rem;
  max-width: 530px;
}
.hero-feature-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.35rem 0.5rem 0.35rem 0.35rem;
  border-radius: 14px;
  background: rgba(15, 23, 52, 0.32);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.hero-feature-item:hover {
  transform: translateY(-2px);
  background: rgba(15, 23, 52, 0.52);
  border-color: rgba(255, 255, 255, 0.22);
}
.feature-squircle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.sq-green {
  background: linear-gradient(135deg, #22c55e, #10b981);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}
.sq-blue {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}
.sq-purple {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}
.sq-amber {
  background: linear-gradient(135deg, #facc15, #f59e0b);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}
.sq-pink {
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  box-shadow: 0 6px 16px rgba(236, 72, 153, 0.4);
}
.sq-teal {
  background: linear-gradient(135deg, #2dd4bf, #0d9488);
  box-shadow: 0 6px 16px rgba(20, 184, 166, 0.4);
}
.feature-text {
  display: flex;
  flex-direction: column;
  line-height: 1.22;
}
.feature-text strong {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.feature-text span {
  font-size: 0.74rem;
  color: rgba(226, 232, 240, 0.9);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* 4 Tarjetas Fotográficas de Destinos (Abajo-Izquierda) */
.hero-destinations-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  max-width: 520px;
  margin-top: 0.5rem;
}
.dest-card {
  position: relative;
  height: 148px;
  border-radius: 16px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 14px 30px rgba(7, 11, 28, 0.55);
  cursor: pointer;
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}
.dest-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.dest-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 18px 36px rgba(7, 11, 28, 0.7), 0 0 20px rgba(56, 189, 248, 0.35);
}
.dest-card:hover img {
  transform: scale(1.1);
}
.dest-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6, 11, 28, 0.88) 0%, rgba(6, 11, 28, 0.25) 45%, transparent 100%);
  display: flex;
  align-items: flex-end;
  padding: 0.65rem 0.7rem;
}
.dest-pin-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
}

/* --- LADO DERECHO: TARJETA BLANCA + MASCOTAS ASOMÁNDOSE + DOCK INFERIOR --- */
.login-form-side {
  flex: 1;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 3rem 1.8rem 1rem;
}

/* Pill superior derecho de estado del sistema */
.login-system-status {
  position: absolute;
  top: 1.75rem;
  right: 2.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 1rem;
  background: rgba(30, 41, 82, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 500;
  color: #f1f5f9;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
  z-index: 5;
}
.status-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  animation: statusPulse 2s ease-in-out infinite;
}
@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.22); }
}

/* Escenario que agrupa la tarjeta blanca y los personajes asomándose a su derecha */
.login-card-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 115px; /* Espacio para que los personajes a la derecha se vean completos */
  margin-top: 1.2rem;
}

/* Tarjeta Blanca Perlada con Halo Índigo */
.login-card-glass {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 26px;
  padding: 2.15rem 2.25rem 1.85rem;
  width: 405px;
  max-width: 92vw;
  box-shadow:
    0 25px 65px rgba(18, 21, 68, 0.42),
    0 0 55px rgba(99, 102, 241, 0.42),
    0 0 0 6px rgba(129, 140, 248, 0.14);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  z-index: 4;
}

.login-card-glass.shake-error {
  animation: mascotShake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  border-color: rgba(239, 68, 68, 0.7) !important;
  box-shadow: 0 20px 55px rgba(239, 68, 68, 0.35), 0 0 0 6px rgba(239, 68, 68, 0.18) !important;
}

@keyframes mascotShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-8px, 0, 0); }
  40%, 60% { transform: translate3d(8px, 0, 0); }
}

/* Header de marca dentro de la tarjeta blanca */
.card-brand-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.25rem;
}
.card-brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 55%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(99, 102, 241, 0.35);
}
.card-brand-titles h2 {
  font-size: 1.22rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.card-brand-titles span {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 500;
}

.login-card-title h3 {
  font-size: 1.48rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.2rem;
  letter-spacing: -0.02em;
}
.login-card-title p {
  color: #64748b;
  font-size: 0.83rem;
  margin-bottom: 1.25rem;
}

/* Alerta integrada de error */
.login-alert-box {
  margin-bottom: 1rem;
  padding: 0.7rem 0.9rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  color: #b91c1c;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  line-height: 1.35;
}
.login-alert-box svg {
  flex-shrink: 0;
  color: #ef4444;
}

/* Inputs Claros Nítidos dentro de la Tarjeta Blanca */
.login-card-glass .form-group {
  margin-bottom: 0.95rem;
}
.login-card-glass .form-group label {
  color: #1e293b;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 0.95rem;
  color: #64748b;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: color 0.2s ease;
}
.input-wrapper:focus-within .input-icon {
  color: #4f46e5;
}

.input-valid-badge {
  position: absolute;
  right: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.login-card-glass .input-wrapper .form-control {
  padding-left: 2.75rem;
  padding-right: 2.75rem;
  height: 46px;
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 500;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.login-card-glass .input-wrapper .form-control::placeholder {
  color: #94a3b8;
}
.login-card-glass .input-wrapper .form-control:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.login-card-glass .input-wrapper .form-control:focus {
  border-color: #6366f1;
  background: #ffffff;
  box-shadow: 0 0 0 3.5px rgba(99, 102, 241, 0.16);
}

/* Blindaje Anti-Autofill de Chrome en Tarjeta Clara */
.login-card-glass .form-control:-webkit-autofill,
.login-card-glass .form-control:-webkit-autofill:hover,
.login-card-glass .form-control:-webkit-autofill:focus,
.login-card-glass .form-control:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0px 1000px #f1f5f9 inset !important;
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #0f172a !important;
  border: 1.5px solid #cbd5e1 !important;
  transition: background-color 9999s ease-in-out 0s;
}
.login-card-glass .form-control:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px #ffffff inset, 0 0 0 3.5px rgba(99, 102, 241, 0.16) !important;
  border-color: #6366f1 !important;
}

.btn-toggle-password {
  position: absolute;
  right: 0.65rem;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: color 0.2s ease, background 0.2s ease;
}
.btn-toggle-password:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.06);
}

/* Badge de Advertencia Bloq Mayús */
.capslock-warning-badge {
  margin-top: 6px;
  padding: 5px 11px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 9px;
  color: #b45309;
  font-size: 0.76rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.2rem;
  margin-bottom: 1.15rem;
  font-size: 0.81rem;
}
.remember-me {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #475569;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.remember-me input[type="checkbox"] {
  accent-color: #6366f1;
  width: 16px;
  height: 16px;
  cursor: pointer;
  border-radius: 4px;
}
.forgot-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: #6366f1;
  font-size: 0.81rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.2s ease;
}
.forgot-link-btn:hover {
  text-decoration: underline;
  color: #4338ca;
}

/* Botón Principal de Login con Brillo Azul-Violeta */
.btn-login-neon {
  height: 48px;
  background: linear-gradient(90deg, #4338ca 0%, #6366f1 50%, #4f46e5 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-login-neon .btn-arrow-icon {
  transition: transform 0.25s ease;
}
.btn-login-neon:hover {
  background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 50%, #4338ca 100%);
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.6);
  transform: translateY(-2px);
}
.btn-login-neon:hover .btn-arrow-icon {
  transform: translateX(4px);
}
.btn-login-neon:active {
  transform: translateY(0);
}

/* Separador SSO y Botones Google / Microsoft */
.sso-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.05rem 0 0.9rem;
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 500;
}
.sso-divider::before,
.sso-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
.sso-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.btn-sso {
  height: 42px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 11px;
  color: #334155;
  font-size: 0.84rem;
  font-weight: 600;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.03);
}
.btn-sso:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.07);
}

/* Panel de Recuperación de Clave Integrado */
.forgot-password-panel {
  animation: fadeInPanel 0.28s ease forwards;
}
@keyframes fadeInPanel {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.forgot-panel-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}
.forgot-password-panel h4 {
  font-size: 1.15rem;
  color: #0f172a;
  margin-bottom: 0.35rem;
}
.forgot-password-panel p {
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.forgot-steps {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}
.forgot-step-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  font-size: 0.79rem;
  color: #334155;
  line-height: 1.4;
}
.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #4338ca;
  font-weight: 700;
  font-size: 0.74rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-back-login {
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.86rem;
}

.login-footer {
  text-align: center;
  margin-top: 1.1rem;
  color: #94a3b8;
  font-size: 0.72rem;
}

/* =============================================
   PERSONAJES VIAJEROS ASOMÁNDOSE AL BORDE DERECHO DE LA TARJETA
   ============================================= */
.mascot-peeker-side {
  position: absolute;
  right: -175px;
  bottom: -10px;
  width: 195px;
  height: 430px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  z-index: 5;
  pointer-events: auto;
}

/* Burbuja de diálogo blanca estilo cómic arriba de los personajes */
.mascot-speech-bubble {
  position: absolute;
  top: 8px;
  right: 4px;
  width: 158px;
  padding: 0.65rem 0.85rem;
  background: #ffffff;
  border: 1.5px solid #e0e7ff;
  border-radius: 18px;
  color: #1e293b;
  font-size: 0.76rem;
  line-height: 1.32;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 12px 28px rgba(30, 27, 75, 0.22);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.25s ease;
  z-index: 10;
  animation: speechFloat 4s ease-in-out infinite;
}
.mascot-speech-bubble strong {
  font-size: 0.84rem;
  font-weight: 800;
  color: #0f172a;
}
.mascot-speech-bubble span {
  color: #475569;
  font-weight: 500;
}
.mascot-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 34px;
  width: 13px;
  height: 13px;
  background: #ffffff;
  border-right: 1.5px solid #e0e7ff;
  border-bottom: 1.5px solid #e0e7ff;
  transform: rotate(45deg);
}
.mascot-speech-bubble.bubble-pop {
  transform: scale(1.06) translateY(-3px);
  border-color: #818cf8;
}
.state-error .mascot-speech-bubble {
  border-color: #fca5a5;
  background: #fff5f5;
}
.state-error .mascot-speech-bubble strong {
  color: #dc2626;
}

@keyframes speechFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.svg-container {
  width: 100%;
  height: auto;
  max-height: 350px;
  filter: drop-shadow(0 14px 28px rgba(15, 23, 42, 0.38));
  overflow: visible !important;
}

/* Base de Personaje */
.char {
  transform-box: fill-box;
  transform-origin: bottom center;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Distorsión Corporal Predeterminada por Variables --mx y --my */
#purple {
  transform: skewX(calc(var(--mx, 0) * -5deg)) scaleY(calc(1 + var(--my, 0) * -0.03));
}
#black {
  transform: skewX(calc(var(--mx, 0) * -4deg)) scaleY(calc(1 + var(--my, 0) * -0.03));
}
#yellow {
  transform: skewX(calc(var(--mx, 0) * 3.5deg)) scaleY(calc(1 + var(--my, 0) * -0.03));
}

/* Capas Faciales */
.face {
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.face-hidden, .face-visible, .face-happy, .face-error { opacity: 0; pointer-events: none; }
.face-default { opacity: 1; }

/* Manitas de los personajes (Ocultas por defecto, suben en contraseña) */
.char-hands {
  opacity: 0;
  transform: translateY(28px) scale(0.75);
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.3s ease, transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.char-hands .hand-left,
.char-hands .hand-right {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-box: fill-box;
  transform-origin: center;
}

/* Ojos & Pupilas traducidos por --mx y --my */
.eye-tracker {
  transform: translate(calc(var(--mx, 0) * 5px), calc(var(--my, 0) * 3px));
}
.pupil {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- ANIMACIONES DE ENTRADA E IDLE --- */
.arc-anim, .drop-anim, .jelly-anim, .breathe {
  will-change: transform, opacity;
}
.arc-anim {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: growUp 1.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes growUp {
  0%   { opacity: 0; transform: scaleY(0) scaleX(1.2); }
  45%  { opacity: 1; transform: scaleY(1.12) scaleX(0.9); }
  75%  { transform: scaleY(0.95) scaleX(1.03); }
  100% { opacity: 1; transform: scaleY(1) scaleX(1); }
}

.drop-anim {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: portalOpen 1.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes portalOpen {
  0%   { opacity: 0; transform: translateY(-140px) scale(0.4); }
  50%  { opacity: 1; transform: translateY(0) scaleY(0.82) scaleX(1.18); }
  80%  { transform: translateY(0) scaleY(1.05) scaleX(0.96); }
  100% { opacity: 1; transform: translateY(0) scaleY(1) scaleX(1); }
}

.jelly-anim {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: jellyBlobUp 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes jellyBlobUp {
  0%   { opacity: 0; transform: scaleY(0.05) scaleX(1.3); }
  45%  { opacity: 1; transform: scaleY(1.14) scaleX(0.88); }
  75%  { transform: scaleY(0.94) scaleX(1.04); }
  100% { opacity: 1; transform: scaleY(1) scaleX(1); }
}

.breathe {
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scaleY(1) translateY(0); }
  50%      { transform: scaleY(1.02) translateY(-2px); }
}

.eye-blink {
  transform-box: fill-box;
  transform-origin: center;
  animation: eyeBlink 4.5s ease-in-out infinite;
}
@keyframes eyeBlink {
  0%, 96%, 100% { transform: scaleY(1); }
  98%           { transform: scaleY(0.1); }
}

/* =============================================
   ESTADOS INTERACTIVOS DE LOS PERSONAJES (A LA DERECHA DE LA TARJETA)
   ============================================= */

/* 1. EMAIL FOCUS: Se inclinan hacia la izquierda (hacia la tarjeta) siguiendo el texto */
.state-email #purple {
  transform: skewX(calc(var(--mx, -0.8) * -9deg)) scaleY(1.04) !important;
}
.state-email #black {
  transform: skewX(calc(var(--mx, -0.8) * -7deg)) scaleY(1.04) !important;
}
.state-email #yellow {
  transform: skewX(calc(var(--mx, -0.8) * -6deg)) scaleY(1.02) !important;
}

.state-email-valid .face-default { opacity: 0 !important; }
.state-email-valid .face-happy { opacity: 1 !important; }

/* 2. PASSWORD FOCUS (Hidden): Se tapan los ojos con las manitas y se inclinan a la derecha */
.state-password .face-default { opacity: 0 !important; }
.state-password .face-hidden { opacity: 1 !important; }
.state-password .face-visible { opacity: 0 !important; }
.state-password .char-hands {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.state-password #purple {
  transform: skewX(-9deg) scaleY(0.95) !important;
}
.state-password #black {
  transform: skewX(-7deg) scaleY(0.92) !important;
}
.state-password #yellow {
  transform: skewX(-8deg) scaleY(0.95) !important;
}

/* 3. SHOW PASSWORD VISIBLE: Separan una manita y se asoman hacia la tarjeta (izquierda) */
.state-show-password .face-default { opacity: 0 !important; }
.state-show-password .face-hidden { opacity: 0 !important; }
.state-show-password .face-visible { opacity: 1 !important; }
.state-show-password .char-hands {
  opacity: 1;
  transform: translateY(13px) scale(0.9);
}
.state-show-password .char-hands .hand-left {
  transform: translate(-10px, 6px) scale(0.85);
}
.state-show-password #purple {
  transform: skewX(12deg) scaleY(1.06) !important;
}
.state-show-password #black {
  transform: skewX(10deg) scaleY(1.07) !important;
}
.state-show-password #yellow {
  transform: skewX(8deg) scaleY(1.04) !important;
}
.state-show-password .eye-tracker {
  transform: translate(-6px, -1px) !important;
}
.state-show-password .pupil {
  transform: scale(1.3) !important;
}

/* 4. ERROR STATE: Expresión de susto */
.state-error .face-default,
.state-error .face-hidden,
.state-error .face-visible,
.state-error .face-happy { opacity: 0 !important; }
.state-error .face-error { opacity: 1 !important; }
.state-error .char-hands { opacity: 0 !important; }

/* 5. SUCCESS STATE: Celebración feliz */
.state-success .face-default,
.state-success .face-hidden,
.state-success .face-visible,
.state-success .face-error { opacity: 0 !important; }
.state-success .face-happy { opacity: 1 !important; }
.state-success .char-hands { opacity: 0 !important; }

/* Destello de la cámara fotográfica */
.camera-flash-active {
  animation: cameraFlashPop 0.55s ease-out;
}
@keyframes cameraFlashPop {
  0% { transform: scale(1); fill: #ffffff; filter: drop-shadow(0 0 25px #ffffff); }
  50% { transform: scale(4.5); fill: #fef08a; filter: drop-shadow(0 0 40px #fef08a); }
  100% { transform: scale(1); fill: #fef08a; }
}

.mascot-floor-glow {
  position: absolute;
  bottom: 4px;
  width: 90%;
  height: 45px;
  background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.45) 0%, transparent 75%);
  filter: blur(14px);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.login-confetti-canvas {
  position: absolute;
  inset: -60px;
  width: calc(100% + 240px);
  height: calc(100% + 120px);
  pointer-events: none;
  z-index: 20;
}

/* =============================================
   DOCK INFERIOR DE 3 MÉTRICAS DE CONFIANZA
   ============================================= */
.login-bottom-metrics {
  margin-top: 1.35rem;
  padding: 0.75rem 1.4rem;
  background: rgba(15, 23, 52, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  backdrop-filter: blur(16px);
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 14px 35px rgba(8, 12, 32, 0.42);
  z-index: 4;
}
.bottom-metric-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.bottom-metric-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.14);
}
.metric-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.metric-circle.amber {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.metric-circle.emerald {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.metric-circle.purple {
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.38);
}
.bottom-metric-item strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}
.bottom-metric-item small {
  display: block;
  font-size: 0.7rem;
  color: rgba(203, 213, 225, 0.85);
}

/* =============================================
   ANIMACIÓN DE APERTURA DE VENTANA / BÓVEDA (`.success-reveal`)
   ============================================= */
#loginOverlay.success-reveal {
  pointer-events: none;
  animation: fadeOverlayOut 0.85s cubic-bezier(0.7, 0, 0.3, 1) 0.5s forwards;
}
#loginOverlay.success-reveal .login-hero-side {
  animation: curtainSlideLeft 0.8s cubic-bezier(0.7, 0, 0.25, 1) 0.4s forwards;
}
#loginOverlay.success-reveal .login-form-side {
  animation: curtainSlideRight 0.8s cubic-bezier(0.7, 0, 0.25, 1) 0.4s forwards;
}
@keyframes curtainSlideLeft {
  0% { transform: translateX(0) scale(1); opacity: 1; filter: blur(0px); }
  100% { transform: translateX(-110%) scale(0.9); opacity: 0; filter: blur(12px); }
}
@keyframes curtainSlideRight {
  0% { transform: translateX(0) scale(1); opacity: 1; filter: blur(0px); }
  100% { transform: translateX(110%) scale(0.9); opacity: 0; filter: blur(12px); }
}
@keyframes fadeOverlayOut {
  0% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; display: none; }
}

/* =============================================
   RESPONSIVE DESIGN (TABLETS & MOBILES — 100dvh + Anti-Zoom iOS)
   ============================================= */
@media (max-width: 1260px) {
  .login-hero-side {
    padding: 2rem 1.5rem 1.8rem 2rem;
  }
  .login-card-stage {
    margin-right: 95px;
  }
  .mascot-peeker-side {
    right: -145px;
    width: 165px;
  }
}

@media (max-width: 1080px) {
  .login-split-container {
    flex-direction: column;
    overflow-y: auto;
  }
  .login-hero-side {
    flex: 0 0 auto;
    padding: 1.5rem 1.5rem 1rem;
    align-items: center;
    text-align: center;
  }
  .hero-copy-block {
    max-width: 640px;
    padding: 0.5rem 0;
  }
  .hero-features-grid {
    margin: 0 auto;
    text-align: left;
  }
  .hero-destinations-grid {
    max-width: 560px;
    width: 100%;
    margin: 1rem auto 0;
  }
  .login-system-status {
    display: none;
  }
  .login-form-side {
    padding: 1rem 1.25rem 2rem;
  }
  .login-card-stage {
    margin-right: 80px;
    margin-top: 0.5rem;
  }
}

@media (max-width: 768px) {
  /* Evitar auto-zoom de Safari iOS al tocar inputs */
  .login-card-glass .input-wrapper .form-control {
    font-size: 16px !important;
    height: 48px;
  }
  .hero-features-grid,
  .hero-destinations-grid,
  .login-bottom-metrics {
    display: none;
  }
  .hero-lead {
    margin-bottom: 0.5rem;
    font-size: 0.86rem;
  }
  .hero-headline {
    font-size: 1.65rem;
    margin-bottom: 0.4rem;
  }
  .login-card-stage {
    flex-direction: column-reverse;
    margin-right: 0;
    margin-top: 0;
  }
  .mascot-peeker-side {
    position: relative;
    right: auto;
    bottom: auto;
    width: 150px;
    height: 155px;
    margin-bottom: -18px;
    z-index: 3;
  }
  .mascot-speech-bubble {
    display: none;
  }
  .login-card-glass {
    width: 100%;
    max-width: 400px;
    padding: 1.6rem 1.4rem;
  }
}

/* =============================================
   FORM ELEMENTS
   ============================================= */
.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control,
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  padding-right: 2rem;
  cursor: pointer;
}

.dark select.form-control,
.dark select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a1a1b5'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

select option,
select optgroup {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.5rem;
}

.dark select option,
.dark select optgroup {
  background-color: #1c1c3a;
  color: #f3f4f6;
}

/* Country Code Phone Input Group */
.phone-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  overflow: hidden;
  transition: border var(--transition), box-shadow var(--transition);
}

.phone-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.phone-country-select {
  border: none !important;
  background-color: transparent !important;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 0.4rem 0.6rem 0.6rem !important;
  cursor: pointer;
  outline: none !important;
  border-right: 1px solid var(--border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  width: auto;
  min-width: 95px;
  flex-shrink: 0;
}

.phone-input-number {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  flex: 1;
  padding: 0.65rem 0.75rem !important;
  outline: none !important;
}

/* Searchable Combobox Component */
.searchable-combobox {
  position: relative;
}

.combobox-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.combobox-search-icon {
  position: absolute;
  left: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
}

.combobox-input {
  padding-left: 2.2rem !important;
  padding-right: 2.2rem !important;
}

.combobox-clear-btn {
  position: absolute;
  right: 0.6rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 50%;
  transition: color var(--transition);
}
.combobox-clear-btn:hover { color: var(--danger); }

.combobox-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 230px;
  overflow-y: auto;
  z-index: 5500;
  display: flex;
  flex-direction: column;
}

.combobox-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.combobox-item:last-child { border-bottom: none; }
.combobox-item:hover, .combobox-item.active {
  background: var(--bg-card-hover);
}

.combobox-item-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.combobox-item-info {
  flex: 1;
  min-width: 0;
}

.combobox-item-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combobox-item-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.combobox-dni-badge {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: 0.9; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }

.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.78rem; }
.btn-block { width: 100%; }

/* =============================================
   APP LAYOUT — Sidebar Full-Height + Header + Content
   ============================================= */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--header-height) 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar content";
  height: 100vh;
  overflow: hidden;
}

/* =============================================
   HEADER (Topbar a la derecha del Sidebar)
   ============================================= */
.header {
  grid-area: header;
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.4rem;
  z-index: 100;
}

.header-left {
  display: none;
  align-items: center;
  gap: 0.8rem;
}

.header-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
}

.header-center {
  flex: 1;
  max-width: 540px;
  margin: 0 1.5rem 0 0;
}

.header-search {
  position: relative;
  display: flex;
  align-items: center;
}

.header-search-icon {
  position: absolute;
  left: 0.9rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
}

.header-search-input {
  width: 100%;
  padding: 0.52rem 2.8rem 0.52rem 2.35rem;
  background: #f1f5f9;
  border: 1px solid transparent;
  border-radius: 99px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  outline: none;
  transition: all var(--transition);
}

.dark .header-search-input {
  background: var(--bg-input);
  border-color: var(--border);
}

.header-search-input:focus {
  background: var(--bg-card);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.header-search-kbd {
  position: absolute;
  right: 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.12rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: inherit;
  pointer-events: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.header-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.98rem;
  transition: all var(--transition);
  position: relative;
}
.header-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.header-theme-btn {
  background: #fef3c7;
  border-color: #fde68a;
  color: #d97706;
}
.dark .header-theme-btn {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.28);
  color: #fbbf24;
}

.mobile-menu-btn { display: none; }

/* Theme toggle icons */
.theme-icon-dark { display: none; }
.dark .theme-icon-light { display: none; }
.dark .theme-icon-dark { display: inline; }

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 0.6rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.25rem 0.55rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--transition);
}
.user-menu:hover { background: var(--bg-card-hover); }

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
}

.user-name { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); line-height: 1.15; }
.user-role { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.user-menu-chevron { font-size: 0.8rem; color: var(--text-muted); margin-left: 0.15rem; }

.btn-logout { margin-left: 0.2rem; }

/* =============================================
   SIDEBAR NAVIGATION — Executive Deep Navy Full-Height
   ============================================= */
.header-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.header-brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb 0%, #7367F0 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.header-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.header-brand-sub {
  font-size: 0.66rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-wa-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.36rem 0.85rem;
  border-radius: 99px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #059669;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.header-wa-icon {
  font-size: 0.82rem;
}

.dark .header-wa-pill {
  color: #34d399;
  background: rgba(16, 185, 129, 0.16);
}

.header-wa-pill:hover {
  background: rgba(16, 185, 129, 0.2);
  transform: translateY(-1px);
}

.header-wa-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.header-wa-dot.disconnected {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
}

.sidebar {
  grid-area: sidebar;
  background: linear-gradient(180deg, #0b1528 0%, #0f1e38 55%, #081020 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 0.65rem;
  transition: transform var(--transition), width var(--transition);
  box-shadow: 4px 0 24px rgba(8, 16, 32, 0.16);
  z-index: 110;
}

.sidebar-top-brand {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  padding: 0.85rem 1rem 0.75rem;
  margin-bottom: 0.2rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.sidebar-brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: transparent;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.42);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-top-brand:hover .sidebar-brand-logo {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 8px 22px rgba(6, 182, 212, 0.48);
}

.sidebar-brand-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.sidebar-brand-info {
  min-width: 0;
  line-height: 1.18;
}

.sidebar-brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.08rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}

.sidebar-brand-accent,
.brand-accent-cyan {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-brand-pro {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(124, 58, 237, 0.28));
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
  line-height: 1.1;
}

.sidebar-brand-subtitle {
  font-size: 0.66rem;
  color: #94a3b8;
  font-weight: 500;
  white-space: nowrap;
}

.sidebar.collapsed .sidebar-top-brand {
  justify-content: center;
  padding: 0.85rem 0;
}
.sidebar.collapsed .sidebar-brand-info {
  display: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0.65rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.42rem 0.8rem;
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  text-align: left;
  position: relative;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.sidebar-item.active {
  background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 22%;
  height: 56%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #93c5fd;
}

.sidebar-icon {
  font-size: 1.08rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-badge {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0.35rem 0.8rem;
}

.sidebar-section-title {
  font-size: 0.62rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 0.22rem 0.8rem 0.12rem;
}

.sidebar-bottom-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.4rem;
}

@media (max-height: 920px) {
  .sidebar-promo-card {
    display: none;
  }
}

/* Inspirational Destination Promo Card inside Sidebar */
.sidebar-promo-card {
  margin: 0 0.7rem;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  height: 175px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.36);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.sidebar-promo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
}

.sidebar-promo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.sidebar-promo-card:hover .sidebar-promo-img {
  transform: scale(1.06);
}

.sidebar-promo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 21, 38, 0.08) 0%, rgba(9, 21, 38, 0.68) 54%, rgba(9, 21, 38, 0.96) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.85rem 0.85rem;
}

.sidebar-promo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sidebar-promo-texts {
  flex: 1;
  min-width: 0;
}

.sidebar-promo-head {
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.2;
}

.sidebar-promo-sub {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  color: #cbd5e1;
  line-height: 1.35;
}

.sidebar-promo-circle-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
}

.sidebar-promo-card:hover .sidebar-promo-circle-btn {
  background: #2563eb;
  border-color: #60a5fa;
  transform: translateX(2px);
}

.sidebar-footer {
  padding: 0.45rem 0.65rem 0.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar.collapsed .sidebar-promo-card {
  display: none;
}

.sidebar.collapsed .sidebar-brand-texts {
  display: none;
}

.sidebar.collapsed .sidebar-top-brand {
  justify-content: center;
  padding: 0.85rem 0.35rem;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
  display: block;
}

/* Sidebar Collapse Toggle Button */
.sidebar-collapse-btn {
  opacity: 0.6;
}
.sidebar-collapse-btn:hover { opacity: 1; }

.collapse-icon {
  font-style: normal;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  transition: transform var(--transition);
}

/* =============================================
   SIDEBAR — Collapsed State
   ============================================= */
.sidebar.collapsed {
  width: 60px;
  min-width: 60px;
}

.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-badge,
.sidebar.collapsed .sidebar-section-title {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

.sidebar.collapsed .sidebar-item {
  justify-content: center;
  padding: 0.55rem 0;
  gap: 0;
  position: relative;
}

.sidebar.collapsed .sidebar-icon {
  width: 100%;
  font-size: 1.2rem;
}

.sidebar.collapsed .sidebar-divider {
  margin: 0.3rem 0.6rem;
}

.sidebar.collapsed .collapse-icon {
  transform: rotate(180deg);
}

/* Tooltip on hover (collapsed) */
.sidebar.collapsed .sidebar-item::after {
  content: attr(title);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  margin-left: 8px;
}

.sidebar.collapsed .sidebar-item:hover::after {
  opacity: 1;
}

/* Grid transition when sidebar collapses */
.app-layout {
  transition: grid-template-columns 0.3s ease;
}

.app-layout.sidebar-collapsed {
  grid-template-columns: 60px 1fr;
}

/* =============================================
   MOBILE BOTTOM NAV
   ============================================= */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  z-index: 150;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
}

.dark .mobile-bottom-nav {
  box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0.3rem 0.8rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  cursor: pointer;
  transition: color var(--transition);
  border-radius: var(--radius-sm);
}

.mobile-nav-item.active {
  color: var(--accent);
}

.mobile-nav-icon {
  font-size: 1.2rem;
}

.mobile-nav-label {
  font-size: 0.6rem;
  font-weight: 500;
}

/* =============================================
   MAIN CONTENT AREA
   ============================================= */
.main-content {
  grid-area: content;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-primary);
}

.view {
  padding: 1.5rem;
  animation: viewFadeIn 0.3s ease;
}

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

/* View header */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.view-header h2 {
  font-size: 1.25rem;
}

.view-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

/* =============================================
   HOME — Panoramic Greeting Hero Banner + Pill Date Toolbar
   ============================================= */
.home-greeting-hero {
  position: relative;
  border-radius: 18px;
  overflow: visible;
  margin-bottom: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #0a1936;
  box-shadow: 0 10px 30px rgba(9, 21, 38, 0.14);
  min-height: 215px;
  display: flex;
  align-items: stretch;
}

.home-hero-backdrop {
  position: absolute;
  inset: 0;
  border-radius: 17px;
  overflow: hidden;
  background-color: #0a1936;
  background-image:
    linear-gradient(90deg, rgba(6, 18, 42, 0.42) 0%, rgba(6, 18, 42, 0.16) 38%, rgba(6, 18, 42, 0) 55%),
    url('/img/login/hero-banner-machupicchu.webp?v=4');
  background-size: cover;
  background-position: center 46%;
  background-repeat: no-repeat;
  z-index: 0;
}

.dark .home-hero-backdrop {
  background-color: #0a1936;
  background-image:
    linear-gradient(90deg, rgba(6, 18, 42, 0.52) 0%, rgba(6, 18, 42, 0.22) 38%, rgba(6, 18, 42, 0) 58%),
    url('/img/login/hero-banner-machupicchu.webp?v=4');
  background-size: cover;
  background-position: center 46%;
  background-repeat: no-repeat;
}

.home-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.4rem 1.65rem;
  width: 100%;
}

.greeting-left {
  flex: 0 1 440px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.home-greeting-hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.08rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0;
  text-shadow: 0 2px 14px rgba(4, 12, 28, 0.65);
}

.greeting-subtitle {
  color: rgba(241, 245, 249, 0.94);
  font-size: 0.85rem;
  line-height: 1.48;
  margin-top: 0.55rem;
  margin-bottom: 0;
  max-width: 410px;
  text-shadow: 0 1px 8px rgba(4, 12, 28, 0.65);
}

.greeting-hero-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.85rem;
  min-width: 0;
}

/* Floating White Pill Date Filter Bar */
.hero-date-toolbar-wrap {
  position: relative;
  z-index: 25;
}

.hero-date-pill-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  flex-wrap: wrap;
}

.dark .hero-date-pill-bar {
  background: rgba(37, 41, 60, 0.95);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
}

.hero-month-picker-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.18s ease;
}

.hero-month-picker-wrap:hover {
  background: rgba(37, 99, 235, 0.06);
}

.hero-cal-icon {
  font-size: 0.88rem;
}

.hero-month-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  padding-right: 0.2rem;
}

.hero-month-select option {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
}

.hero-pill-divider {
  width: 1px;
  height: 20px;
  background: #e2e8f0;
  margin: 0 0.15rem;
}

.dark .hero-pill-divider {
  background: rgba(255, 255, 255, 0.14);
}

.hero-quick-segments {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.hero-seg-btn {
  padding: 0.32rem 0.68rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #475569;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.dark .hero-seg-btn {
  color: var(--text-secondary);
}

.hero-seg-btn:hover {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}

.hero-seg-btn.active {
  background: #dbeafe;
  color: #2563eb;
  font-weight: 700;
}

.dark .hero-seg-btn.active {
  background: rgba(37, 99, 235, 0.28);
  color: #93c5fd;
}

.hero-custom-range-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.32rem 0.72rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #334155;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.dark .hero-custom-range-btn {
  color: var(--text-primary);
}

.hero-custom-range-btn:hover,
.hero-custom-range-btn.active {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

/* Custom Range Floating Popover */
.hero-custom-range-popover {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
  z-index: 120;
  animation: viewFadeIn 0.2s ease;
}

.hero-custom-range-popover.open {
  display: block;
}

.popover-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.popover-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.popover-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
}

.popover-close-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.popover-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

.popover-field label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.22rem;
}

.popover-input {
  width: 100%;
  padding: 0.38rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  outline: none;
}

.popover-input:focus {
  border-color: var(--accent);
}

.popover-divider-lbl {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0.55rem 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.popover-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

.btn-popover-excel {
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-popover-excel:hover {
  border-color: var(--success);
  color: var(--success);
}

.btn-popover-apply {
  flex: 1;
  padding: 0.42rem 0.85rem;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.btn-popover-apply:hover {
  filter: brightness(1.06);
}

.dash-active-months-strip {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.dash-month-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.16rem 0.48rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dash-month-chip:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: #3b82f6;
  color: #2563eb;
}

.dash-month-chip.active {
  background: rgba(16, 185, 129, 0.16);
  border-color: #10b981;
  color: #059669;
}

/* Scenic Inspirational Quote on Bottom-Right of Hero */
.hero-scenic-caption {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 0.3rem;
  margin-top: auto;
  padding-right: 0.25rem;
}

.hero-calligraphy {
  font-family: 'Caveat', cursive;
  font-size: 1.55rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.05;
  text-shadow: 0 2px 12px rgba(9, 21, 38, 0.75), 0 1px 3px rgba(0, 0, 0, 0.6);
  transform: rotate(-2deg);
}

.hero-location-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.18rem 0.6rem;
  border-radius: 99px;
  background: rgba(9, 21, 38, 0.58);
  backdrop-filter: blur(6px);
  color: #f8fafc;
  font-size: 0.68rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

@media (max-width: 1100px) {
  .home-hero-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .greeting-left {
    flex: 1 1 auto;
  }
  .greeting-hero-right {
    width: 100%;
    align-items: flex-start;
  }
  .hero-scenic-caption {
    align-self: flex-end;
  }
}

/* =============================================
   HOME — Primary KPI Cards (3x2 Grid with Wide Sparklines)
   ============================================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.kpi-grid-3x2 {
  grid-template-columns: repeat(3, 1fr);
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.05rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  animation: kpiSlideIn 0.45s ease forwards;
  opacity: 0;
  transform: translateY(10px);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.kpi-exec-card {
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 1.05rem 1.2rem;
}

.kpi-card:nth-child(1) { animation-delay: 0.04s; }
.kpi-card:nth-child(2) { animation-delay: 0.08s; }
.kpi-card:nth-child(3) { animation-delay: 0.12s; }
.kpi-card:nth-child(4) { animation-delay: 0.16s; }
.kpi-card:nth-child(5) { animation-delay: 0.20s; }
.kpi-card:nth-child(6) { animation-delay: 0.24s; }

@keyframes kpiSlideIn {
  to { opacity: 1; transform: translateY(0); }
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.09);
  border-color: var(--border-hover);
}

/* Accent gradients on left border */
.kpi-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}

.kpi-purple::before { background: linear-gradient(180deg, #7367F0, #a78bfa); }
.kpi-amber::before { background: linear-gradient(180deg, #f59e0b, #fbbf24); }
.kpi-green::before { background: linear-gradient(180deg, #10b981, #34d399); }
.kpi-blue::before { background: linear-gradient(180deg, #3b82f6, #60a5fa); }
.kpi-rose::before { background: linear-gradient(180deg, #f43f5e, #fb7185); }
.kpi-violet::before { background: linear-gradient(180deg, #a855f7, #c084fc); }

.kpi-card-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.kpi-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-purple .kpi-icon-wrap { background: var(--accent-soft); }
.kpi-amber .kpi-icon-wrap { background: var(--warning-soft); }
.kpi-green .kpi-icon-wrap { background: rgba(245, 158, 11, 0.14); }
.kpi-blue .kpi-icon-wrap { background: var(--info-soft); }
.kpi-rose .kpi-icon-wrap { background: rgba(244, 63, 94, 0.12); }
.kpi-violet .kpi-icon-wrap { background: rgba(168, 85, 247, 0.12); }

.kpi-icon {
  font-size: 1.15rem;
}

.kpi-info {
  flex: 1;
  min-width: 0;
}

.kpi-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.kpi-card-mid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.15rem;
}

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.kpi-subvalue {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 0.22rem;
}

.kpi-sparkline {
  width: 118px;
  height: 44px;
  flex-shrink: 0;
  overflow: visible;
}

.kpi-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.35rem;
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.71rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  color: var(--text-secondary);
  background: var(--bg-card-hover);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-trend.trend-up {
  color: #059669;
  background: rgba(16, 185, 129, 0.13);
}

.dark .kpi-trend.trend-up {
  color: #34d399;
  background: rgba(16, 185, 129, 0.18);
}

.kpi-trend.trend-purple {
  color: #7c3aed;
  background: rgba(139, 92, 246, 0.13);
}

.dark .kpi-trend.trend-purple {
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.2);
}

.kpi-trend.trend-down {
  color: var(--danger);
  background: var(--danger-soft);
}

/* =============================================
   HOME — Secondary Operational Strip (3x2 Mini-Pills)
   ============================================= */
.kpi-secondary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}

.kpi-sec-3x2 {
  grid-template-columns: repeat(3, 1fr);
}

.kpi-mini-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.025);
}

.kpi-mini-pill:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.kpi-mini-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.mini-green { background: rgba(16, 185, 129, 0.12); }
.mini-blue { background: rgba(115, 103, 240, 0.12); }
.mini-indigo { background: rgba(59, 130, 246, 0.12); }
.mini-amber { background: rgba(245, 158, 11, 0.12); }
.mini-purple { background: rgba(139, 92, 246, 0.12); }
.mini-emerald { background: rgba(245, 158, 11, 0.12); }

.kpi-mini-body {
  flex: 1;
  min-width: 0;
}

.kpi-mini-label {
  display: block;
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-mini-val-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.18rem;
}

.kpi-mini-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.kpi-mini-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-mini-badge.badge-live-green {
  color: #059669;
}

.dark .kpi-mini-badge.badge-live-green {
  color: #34d399;
}

/* =============================================
   HOME — Row 3: 3 Analytical Blocks (Funnel + AI)
   ============================================= */
.home-analytics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.dash-card-tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* Visual 5-Stage CRM Funnel */
.crm-funnel-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.crm-funnel-step {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  transition: transform 0.18s ease;
}

.crm-funnel-step:hover {
  transform: translateX(3px);
}

.crm-funnel-bar-wrap {
  flex: 1;
  background: var(--bg-input);
  border-radius: 10px;
  height: 36px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.crm-funnel-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 0.22;
}

.crm-funnel-step-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}

.crm-funnel-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.45rem;
}

.crm-funnel-metrics {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 82px;
  justify-content: flex-end;
}

.crm-funnel-count {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.crm-funnel-pct {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.42rem;
  border-radius: 6px;
}

/* AI Mini Stat 2x2 Grid */
.ai-exec-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.ai-exec-stat {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
}

.ai-exec-stat-icon {
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-purple { background: rgba(115, 103, 240, 0.14); }
.stat-icon-rose { background: rgba(244, 63, 94, 0.14); }
.stat-icon-amber { background: rgba(245, 158, 11, 0.14); }
.stat-icon-green { background: rgba(16, 185, 129, 0.14); }

.ai-exec-stat-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.ai-exec-stat-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.ai-intent-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0.5rem 0 0.45rem;
}

.btn-link-xs {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.btn-link-xs:hover {
  text-decoration: underline;
}

/* =============================================
   HOME — Rows 4, 5, 6 (2-Col Asymmetric & 3-Col Footer)
   ============================================= */
.home-row-2col {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  gap: 1rem;
  margin-bottom: 1.15rem;
  align-items: stretch;
}

.home-col-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.home-row-3col-footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.home-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1rem;
}

/* Dashboard Cards */
.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: all var(--transition);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.035);
  display: flex;
  flex-direction: column;
}

.dash-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.dash-card-header {
  padding: 0.85rem 1.05rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.dash-card-header h3 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dash-card-body {
  padding: 0.7rem 0.85rem;
  max-height: 360px;
  overflow-y: auto;
  flex: 1;
}

.dash-body-tall {
  max-height: 540px;
}

/* Centered Empty State with Icon (Check-ins, Contracts) */
.dash-empty-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.35rem 1rem;
  gap: 0.35rem;
}

.dash-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-input);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

.dash-empty-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.dash-empty-sub {
  font-size: 0.73rem;
  color: var(--text-muted);
}

.contract-empty-cta {
  margin-top: 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.9rem;
  border-radius: 99px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.06);
  color: #2563eb;
  font-family: inherit;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.dark .contract-empty-cta {
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(96, 165, 250, 0.3);
}

.contract-empty-cta:hover {
  background: #2563eb;
  color: #ffffff;
}

/* Activity Avatar with WhatsApp Sub-Badge & AI Image Pill */
.activity-avatar-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.activity-wa-mini-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  font-size: 0.52rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}

.activity-ai-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  font-size: 0.66rem;
  font-weight: 600;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.dark .activity-ai-pill {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.22);
}

/* Top Sellers Progress Bar */
.agent-rank-bar-wrap {
  width: 100%;
  max-width: 150px;
  height: 6px;
  border-radius: 99px;
  background: var(--bg-input);
  overflow: hidden;
  margin-top: 0.3rem;
}

.agent-rank-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #06b6d4 0%, #3b82f6 100%);
  transition: width 0.5s ease;
}

/* WhatsApp Line Card Avatar */
.wa-line-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.14);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Quotation & Flight Request Mini Rows */
.quotation-mini-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.5rem;
  border-radius: 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.quotation-mini-item:last-child {
  border-bottom: none;
}

.quotation-mini-item:hover {
  background: var(--bg-card-hover);
}

.quotation-mini-badge-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.dark .quotation-mini-badge-icon {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.16);
}

.quotation-mini-info {
  flex: 1;
  min-width: 0;
}

.quotation-mini-route {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quotation-mini-meta {
  font-size: 0.71rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.12rem;
}

.quotation-mini-right {
  text-align: right;
  flex-shrink: 0;
}

.quotation-mini-price {
  font-family: 'Outfit', sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Activity items */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.55rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  cursor: pointer;
}

.activity-item:hover {
  background: var(--bg-card-hover);
}

.activity-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
}

.activity-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* Line status items */
.line-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.line-item:hover {
  background: var(--bg-card-hover);
}

.line-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.line-dot.connected { background: var(--success); box-shadow: 0 0 6px rgba(16, 185, 129, 0.4); }
.line-dot.disconnected { background: var(--danger); }
.line-dot.pending { background: var(--warning); }

.line-info {
  flex: 1;
  min-width: 0;
}

.line-name {
  font-size: 0.82rem;
  font-weight: 500;
}

.line-company {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.line-status-text {
  font-size: 0.7rem;
  flex-shrink: 0;
}

/* Agent rank items */
.agent-rank-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.agent-rank-item:hover {
  background: var(--bg-card-hover);
}

.agent-rank-num {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 22px;
  text-align: center;
}

.agent-rank-num.top-1 { color: #f59e0b; }
.agent-rank-num.top-2 { color: var(--text-secondary); }
.agent-rank-num.top-3 { color: #cd7f32; }

.agent-rank-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
}

.agent-rank-info {
  flex: 1;
  min-width: 0;
}

.agent-rank-name {
  font-size: 0.82rem;
  font-weight: 500;
}

.agent-rank-stat {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Checkin items */
.checkin-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.5rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--warning);
  background: var(--warning-soft);
  margin-bottom: 0.4rem;
}

.checkin-icon { font-size: 1rem; }

.checkin-info { flex: 1; min-width: 0; }

.checkin-name {
  font-size: 0.82rem;
  font-weight: 500;
}

.checkin-deadline {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Alert items */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--danger);
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.alert-item.alert-warning { border-left-color: var(--warning); }
.alert-item.alert-info { border-left-color: var(--info); }

.alert-icon { font-size: 0.85rem; flex-shrink: 0; margin-top: 0.05rem; }
.alert-time { font-size: 0.68rem; color: var(--text-muted); margin-top: 0.15rem; }

/* Refund summary */
.refund-summary {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.5rem;
}

.refund-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}

.refund-summary-label { color: var(--text-secondary); }

.refund-summary-value {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
}

.refund-summary-value.pending { color: var(--warning); }
.refund-summary-value.completed { color: var(--success); }

/* Ticket mini cards (for home view) */
.ticket-mini {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  cursor: pointer;
}

.ticket-mini:hover {
  background: var(--bg-card-hover);
}

.ticket-mini-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.ticket-mini-info {
  flex: 1;
  min-width: 0;
}

.ticket-mini-title {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket-mini-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

/* Settings grid */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.settings-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem;
  cursor: pointer;
}

.settings-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.settings-card-icon {
  font-size: 1.8rem;
}

.settings-card-info h4 {
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
}

.settings-card-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Tickets & Contacts grid (full page views) */
.tickets-grid,
.contacts-grid,
.lines-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* =============================================
   CHAT LAYOUT — 3 columnas Modernizadas (viewChats)
   ============================================= */
.dashboard-chat {
  display: grid;
  grid-template-columns: 325px 1fr 340px;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
  margin: -1.5rem;
  background: var(--bg-primary);
}

/* Columna izquierda — Bandeja de Conversaciones */
.sidebar-left {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 0.95rem 0.95rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.chat-sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.sidebar-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.chat-filter-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.chat-filter-icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 0.55rem 0.85rem 0.55rem 2.25rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.81rem;
  outline: none;
  font-family: inherit;
  transition: all var(--transition);
}

.search-box input:focus {
  border-color: #6366f1;
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.search-box::before {
  content: '🔍';
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  opacity: 0.65;
}

/* Píldoras de Filtros de Bandeja con Contadores */
.inbox-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.inbox-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.3rem 0.68rem;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  cursor: pointer;
  border-radius: 99px;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.inbox-tab:hover {
  border-color: #6366f1;
  color: #4f46e5;
}

.inbox-tab.active {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28);
}

.inbox-tab .tab-count {
  background: rgba(100, 116, 139, 0.16);
  color: var(--text-secondary);
  padding: 0.06rem 0.42rem;
  border-radius: 99px;
  font-size: 0.66rem;
  font-weight: 700;
}

.inbox-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.tab-dot-green {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
}

/* Lista de chats */
.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.55rem;
}

.chat-item {
  display: flex;
  align-items: flex-start;
  gap: 0.72rem;
  padding: 0.72rem 0.75rem;
  margin-bottom: 0.25rem;
  border-radius: 13px;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
}

.chat-item:hover {
  background: var(--bg-card-hover);
}

.chat-item.active {
  background: rgba(99, 102, 241, 0.09);
  border-left-color: #4f46e5;
}

.dark .chat-item.active {
  background: rgba(115, 103, 240, 0.18);
  border-left-color: #7367f0;
}

.chat-item-avatar-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-avatar-wa-sub {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  font-size: 0.52rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-secondary);
}

.chat-info {
  flex: 1;
  min-width: 0;
}

.chat-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.chat-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-time {
  font-size: 0.69rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.chat-preview {
  font-size: 0.76rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.16rem;
}

.chat-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-top: 0.38rem;
}

.chat-item-tags {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  min-width: 0;
}

.chat-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  padding: 0.12rem 0.48rem;
  border-radius: 6px;
  font-size: 0.66rem;
  font-weight: 600;
  white-space: nowrap;
}

.chat-tag-pill.tag-blue { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.chat-tag-pill.tag-green { background: rgba(16, 185, 129, 0.13); color: #059669; }
.chat-tag-pill.tag-purple { background: rgba(139, 92, 246, 0.13); color: #7c3aed; }
.chat-tag-pill.tag-amber { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.chat-tag-pill.tag-rose { background: rgba(244, 63, 94, 0.13); color: #e11d48; }
.chat-tag-pill.tag-slate { background: rgba(100, 116, 139, 0.12); color: #475569; }

.dark .chat-tag-pill.tag-blue { color: #93c5fd; background: rgba(59, 130, 246, 0.22); }
.dark .chat-tag-pill.tag-green { color: #6ee7b7; background: rgba(16, 185, 129, 0.22); }
.dark .chat-tag-pill.tag-purple { color: #c4b5fd; background: rgba(139, 92, 246, 0.22); }
.dark .chat-tag-pill.tag-amber { color: #fcd34d; background: rgba(245, 158, 11, 0.22); }
.dark .chat-tag-pill.tag-rose { color: #fda4af; background: rgba(244, 63, 94, 0.22); }
.dark .chat-tag-pill.tag-slate { color: #cbd5e1; background: rgba(100, 116, 139, 0.22); }

.unread-badge {
  background: #4f46e5;
  color: #ffffff;
  font-size: 0.67rem;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35);
}

.company-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Columna central — Conversación Activa */
.chat-main {
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  overflow: hidden;
}

.chat-header-bar {
  padding: 0.75rem 1.2rem 0.6rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.chat-header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.chat-header-avatar-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.chat-avatar-wa-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  font-size: 0.52rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-secondary);
}

.chat-header-identity {
  margin-right: 0.35rem;
}

.chat-header-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
}

.chat-header-phone {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.chat-header-pills {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  flex-wrap: wrap;
}

.chat-header-status {
  font-size: 0.71rem;
  padding: 0.18rem 0.6rem;
  border-radius: 99px;
  font-weight: 700;
}

.status-active { background: rgba(16, 185, 129, 0.14); color: #059669; }
.status-urgent { background: var(--danger-soft); color: var(--danger); }
.status-pending { background: var(--warning-soft); color: var(--warning); }
.status-closed { background: var(--bg-card); color: var(--text-muted); }

.chat-channel-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.71rem;
  font-weight: 600;
  padding: 0.18rem 0.6rem;
  border-radius: 99px;
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}

.dark .chat-channel-pill {
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.22);
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.chat-hdr-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.34rem 0.8rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.chat-hdr-btn:hover {
  border-color: #6366f1;
  color: #4f46e5;
}

.chat-hdr-btn.autopilot-on {
  background: rgba(16, 185, 129, 0.13);
  border-color: rgba(16, 185, 129, 0.35);
  color: #059669;
}

.chat-hdr-more-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-header-submeta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.73rem;
  color: var(--text-secondary);
  padding-top: 0.42rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.chat-header-submeta strong {
  color: var(--text-primary);
  font-weight: 600;
}

.submeta-sep {
  color: var(--border-hover);
}

.collision-banner {
  background: var(--warning-soft);
  color: var(--warning);
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
  text-align: center;
  display: none;
}
.collision-banner.show { display: block; }

/* Área de Mensajes y Burbujas con Avatar Lateral */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.15rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.msg-row-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  animation: msgFadeIn 0.25s ease;
}

.msg-row-wrap.row-inbound {
  justify-content: flex-start;
}

.msg-row-wrap.row-outbound {
  justify-content: flex-end;
}

.msg-side-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.msg-side-avatar.bot-avatar {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #ffffff;
  font-size: 0.95rem;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.28);
}

.message-bubble {
  max-width: 68%;
  padding: 0.78rem 1rem;
  border-radius: 16px;
  font-size: 0.84rem;
  line-height: 1.52;
  position: relative;
}

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

.message-inbound {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.035);
}

.message-outbound {
  background: linear-gradient(135deg, #5b50f0 0%, #6366f1 100%);
  color: #ffffff;
  border-top-right-radius: 4px;
  box-shadow: 0 6px 18px rgba(91, 80, 240, 0.24);
}

.message-sender {
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.message-inbound .message-sender {
  color: var(--text-secondary);
}

.message-outbound .message-sender {
  color: rgba(255, 255, 255, 0.92);
}

.message-time {
  font-size: 0.65rem;
  opacity: 0.72;
  text-align: right;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

.message-system {
  align-self: center;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.4rem 1rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  max-width: 80%;
  text-align: center;
}

/* Tarjeta Visual de Vuelo / Captura Analizada dentro de Burbuja */
.msg-flight-card {
  margin-top: 0.65rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.msg-flight-left {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 170px;
}

.msg-flight-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.msg-airline-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  color: #e11d48;
  background: rgba(225, 29, 72, 0.08);
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
}

.msg-flight-route {
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary);
}

.msg-flight-date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.msg-flight-times {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.msg-flight-hour {
  font-family: 'Outfit', sans-serif;
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-primary);
}

.msg-flight-dur {
  font-size: 0.67rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
  padding: 0 0.35rem;
  border-bottom: 1px dashed var(--border-hover);
}

.msg-flight-fares {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
}

.msg-fare-box {
  padding: 0.45rem 0.65rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-align: center;
  min-width: 82px;
}

.msg-fare-box.fare-prime {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
}

.msg-fare-price {
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
}

.msg-fare-box.fare-prime .msg-fare-price {
  color: #059669;
}

.msg-fare-lbl {
  font-size: 0.63rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.msg-fare-box.fare-prime .msg-fare-lbl {
  color: #059669;
  font-weight: 700;
}

/* Barra Moderna del Copiloto IA */
.chat-copilot-bar {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 0.55rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.copilot-brand-box {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.copilot-robot-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  box-shadow: 0 3px 8px rgba(99, 102, 241, 0.25);
}

.copilot-brand-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.copilot-brand-sub {
  font-size: 0.66rem;
  color: var(--text-muted);
}

.copilot-action-pills {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  flex: 1;
  justify-content: center;
}

.copilot-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.34rem 0.72rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.copilot-pill-btn:hover {
  border-color: #6366f1;
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.06);
  transform: translateY(-1px);
}

.copilot-tone-mini {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: var(--bg-input);
  padding: 0.18rem;
  border-radius: 99px;
  border: 1px solid var(--border);
}

.tone-mini-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.tone-mini-btn.active {
  background: var(--bg-card);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Barra de Entrada de Mensajes */
.chat-input-bar {
  padding: 0.65rem 1.15rem 0.8rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.chat-attach-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.chat-attach-btn:hover {
  border-color: #6366f1;
  color: #4f46e5;
}

.chat-input-pill-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.15rem 0.45rem 0.15rem 0.85rem;
  transition: all 0.18s ease;
}

.chat-input-pill-wrap:focus-within {
  border-color: #6366f1;
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.chat-input {
  flex: 1;
  padding: 0.48rem 0;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.84rem;
  resize: none;
  min-height: 34px;
  max-height: 110px;
  outline: none;
}

.chat-emoji-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
  transition: opacity 0.15s ease;
}

.chat-emoji-btn:hover {
  opacity: 1;
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #5b50f0 0%, #6366f1 100%);
  color: #ffffff;
  border: none;
  border-radius: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(91, 80, 240, 0.3);
}

.chat-send-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* Columna derecha — Expediente CRM 360° con Pestañas */
.sidebar-right {
  background: var(--bg-primary);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 0.85rem;
}

.crm-right-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem;
  background: var(--bg-secondary);
  padding: 0.28rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.crm-rtab {
  padding: 0.42rem 0.5rem;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
}

.crm-rtab:hover {
  color: var(--text-primary);
}

.crm-rtab.active {
  background: rgba(99, 102, 241, 0.14);
  color: #4f46e5;
}

.dark .crm-rtab.active {
  background: rgba(115, 103, 240, 0.25);
  color: #c4b5fd;
}

.crm-card-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.025);
}

.crm-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.crm-card-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.crm-mini-outline-btn {
  padding: 0.2rem 0.58rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.crm-mini-outline-btn:hover {
  border-color: #6366f1;
  color: #4f46e5;
}

.crm-contact-info-table {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.crm-kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  gap: 0.5rem;
}

.crm-kv-lbl {
  color: var(--text-muted);
  font-weight: 500;
}

.crm-kv-val {
  color: var(--text-primary);
  font-weight: 700;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.crm-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.58rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
}

.crm-tag-chip .tag-x {
  cursor: pointer;
  opacity: 0.65;
  font-size: 0.75rem;
}

.crm-tag-chip .tag-x:hover {
  opacity: 1;
}

/* Filas de Análisis de la IA */
.crm-ai-analysis-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.crm-ai-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.76rem;
}

.crm-ai-row-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.crm-ai-icon-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.crm-ai-summary-box {
  margin-top: 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Recomendación de la IA */
.crm-ai-rec-card {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.09) 100%);
  border-color: rgba(99, 102, 241, 0.22);
}

.crm-rec-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.48;
  margin-bottom: 0.7rem;
}

.crm-apply-suggestion-btn {
  width: 100%;
  padding: 0.48rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  background: var(--bg-card);
  color: #4f46e5;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
}

.dark .crm-apply-suggestion-btn {
  color: #a5b4fc;
}

.crm-apply-suggestion-btn:hover {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
}

/* Acciones Rápidas en Columna Derecha */
.crm-qa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.crm-qa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  padding: 0.48rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.crm-qa-btn:hover {
  border-color: #6366f1;
  color: #4f46e5;
}

.crm-qa-btn.primary {
  background: linear-gradient(135deg, #5b50f0 0%, #6366f1 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(91, 80, 240, 0.25);
}

.crm-qa-btn.primary:hover {
  color: #ffffff;
  filter: brightness(1.06);
}

.crm-qa-btn.full {
  width: 100%;
  margin-bottom: 0.42rem;
}

.crm-qa-btn.full:last-child {
  margin-bottom: 0;
}

/* Toggle switch */
.switch {
  position: relative;
  width: 40px;
  height: 22px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 22px;
  cursor: pointer;
  transition: background var(--transition);
}
.switch .slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }
/* =============================================
   COPILOTO IA & SMART REPLIES
   ============================================= */
.smart-reply-chips {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.smart-reply-chips::-webkit-scrollbar { display: none; }

.smart-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(115, 103, 240, 0.3);
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  animation: chipFadeIn 0.3s ease;
}

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

.smart-chip:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(115, 103, 240, 0.4);
}

.emotion-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
}

.emo-neutral { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }
.emo-happy { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.emo-frustrated { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.emo-angry { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.emo-anxious { background: rgba(168, 85, 247, 0.15); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.3); }
.emo-confused { background: rgba(0, 207, 232, 0.15); color: #00cfe8; border: 1px solid rgba(0, 207, 232, 0.3); }
.emo-urgent { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid #ef4444; animation: pulse-dot 1.5s infinite; }

.intent-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 99px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 500;
}

.btn-xs {
  padding: 0.15rem 0.45rem;
  font-size: 0.7rem;
  border-radius: var(--radius-sm);
}

/* =============================================
   TOASTS
   ============================================= */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 10000;
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  min-width: 280px;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  pointer-events: auto;
  animation: toastIn 0.35s ease;
}

.toast.removing { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(50px); }
}

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info { border-left: 3px solid var(--info); }

/* =============================================
   MODALS (Premium — Glassmorphism)
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  backdrop-filter: blur(4px);
  animation: overlayIn 0.25s ease;
}
.modal-overlay.show { display: flex; }

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

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 460px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 1.05rem; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.6rem;
  /* Botón destructivo (Eliminar) a la IZQUIERDA */
  justify-content: flex-start;
}
.modal-footer .btn-primary,
.modal-footer .btn-ghost {
  margin-left: auto;
}

/* =============================================
   SKELETON LOADERS
   ============================================= */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-line { height: 14px; margin-bottom: 0.5rem; }
.skeleton-circle { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-card { height: 60px; margin-bottom: 0.4rem; border-radius: var(--radius-md); }

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-muted);
  text-align: center;
  gap: 0.8rem;
}
.empty-state-icon { font-size: 3rem; opacity: 0.3; }
.empty-state-text { font-size: 0.9rem; }

/* =============================================
   SMART REPLY CHIPS
   ============================================= */
.smart-reply-chips {
  display: flex;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.smart-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(115, 103, 240, 0.2);
  cursor: pointer;
  transition: all var(--transition);
  animation: chipIn 0.3s ease forwards;
  opacity: 0;
  transform: translateY(6px);
  white-space: nowrap;
}

.smart-chip:nth-child(1) { animation-delay: 0.05s; }
.smart-chip:nth-child(2) { animation-delay: 0.12s; }
.smart-chip:nth-child(3) { animation-delay: 0.19s; }

@keyframes chipIn {
  to { opacity: 1; transform: translateY(0); }
}

.smart-chip:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(115, 103, 240, 0.25);
}

/* =============================================
   INTENT / EMOTION BADGES
   ============================================= */
.intent-badge,
.emotion-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
  transition: all var(--transition);
}

.intent-badge {
  background: var(--info-soft);
  color: var(--info);
}

.emotion-badge { background: var(--success-soft); color: var(--success); }
.emotion-badge.emo-angry { background: var(--danger-soft); color: var(--danger); }
.emotion-badge.emo-frustrated { background: var(--warning-soft); color: var(--warning); }
.emotion-badge.emo-anxious { background: var(--warning-soft); color: var(--warning); }
.emotion-badge.emo-happy { background: var(--success-soft); color: var(--success); }
.emotion-badge.emo-confused { background: var(--info-soft); color: var(--info); }
.emotion-badge.emo-urgent { background: var(--danger-soft); color: var(--danger); }

/* =============================================
   TRAINING MODAL
   ============================================= */
.training-tab {
  font-size: 0.78rem !important;
  padding: 0.3rem 0.6rem !important;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
  border-bottom: 2px solid transparent !important;
  transition: all var(--transition);
}

.training-tab.active {
  border-bottom-color: var(--accent) !important;
  color: var(--accent) !important;
  background: var(--accent-soft) !important;
}

.training-tab-content { max-height: 300px; overflow-y: auto; }

/* Knowledge / Example Items */
.training-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem;
  margin-bottom: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  transition: border-color var(--transition);
}

.training-item:hover { border-color: var(--border-hover); }

.training-item-content { flex: 1; }

.training-item-q {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.training-item-a {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.training-item-delete {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  flex-shrink: 0;
}

.training-item-delete:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

/* Playground typing indicator */
.playground-typing {
  display: flex;
  gap: 4px;
  padding: 0.5rem 0.8rem;
  align-items: center;
}

.playground-typing .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
  animation: dotPulse 1.4s infinite;
}

.playground-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.playground-typing .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.4; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.2); }
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  70% { box-shadow: 0 0 0 6px transparent; opacity: 0.7; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =============================================

   CRM ACTIONS (sidebar)
   ============================================= */
.crm-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* =============================================
   TIMELINE TABS + TIMELINE (sidebar)
   ============================================= */
.timeline-tabs {
  display: flex;
  gap: 0.2rem;
}

.timeline-tab {
  padding: 0.15rem 0.4rem;
  font-size: 0.72rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  line-height: 1;
}

.timeline-tab:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.timeline-tab.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.crm-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 250px;
  overflow-y: auto;
}

.timeline-item {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  animation: fadeSlideUp 0.3s ease;
}

.timeline-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.timeline-item-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.timeline-item-content {
  flex: 1;
  min-width: 0;
}

.timeline-item-title {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.15rem;
}

.timeline-empty {
  padding: 1rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

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

/* =============================================
   TICKETS LIST (modal)
   ============================================= */
.tickets-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tickets-filters {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tickets-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 55vh;
  overflow-y: auto;
}

.ticket-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  animation: fadeSlideUp 0.25s ease;
}

.ticket-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.ticket-card-icon {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}

.ticket-card-body {
  flex: 1;
  min-width: 0;
}

.ticket-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.ticket-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket-card-number {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'Outfit', monospace;
  flex-shrink: 0;
}

.ticket-card-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-badge.status-open {
  background: var(--info-soft);
  color: var(--info);
}

.status-badge.status-in_progress {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-badge.status-resolved {
  background: var(--success-soft);
  color: var(--success);
}

.status-badge.status-closed {
  background: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
}

/* Refund-specific statuses */
.status-badge.status-solicitado {
  background: var(--info-soft);
  color: var(--info);
}

.status-badge.status-aprobado {
  background: var(--success-soft);
  color: var(--success);
}

.status-badge.status-en_proceso {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-badge.status-depositado {
  background: rgba(16, 185, 129, 0.2);
  color: #059669;
}

.status-badge.status-rechazado {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Category badges */
.category-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 500;
  background: var(--accent-soft);
  color: var(--accent);
}

/* =============================================
   TICKET DETAIL (modal)
   ============================================= */
.ticket-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.ticket-detail-field {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.ticket-detail-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ticket-detail-value {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.ticket-detail-description {
  padding: 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  white-space: pre-wrap;
}

.ticket-detail-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

/* =============================================
   REFUND CARD (inside refunds modal list)
   ============================================= */
.refund-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
  animation: fadeSlideUp 0.25s ease;
}

.refund-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.refund-amount {
  font-family: 'Outfit', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  min-width: 90px;
  text-align: right;
}

.refund-card-body {
  flex: 1;
  min-width: 0;
}

.refund-card-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.refund-card-actions {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
}

/* =============================================
   RESPONSIVE — Large Laptop (max-width: 1440px)
   ============================================= */
@media (max-width: 1440px) {
  .kpi-grid-primary {
    grid-template-columns: repeat(3, 1fr);
  }
  .kpi-secondary-strip {
    grid-template-columns: repeat(3, 1fr);
  }
  .home-grid-3col {
    grid-template-columns: 1fr 1fr;
  }
  .home-grid-3col .home-col-side {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

/* =============================================
   RESPONSIVE — Tablet (max-width: 1024px)
   ============================================= */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 200px;
  }

  .dashboard-chat { grid-template-columns: 280px 1fr; }
  .sidebar-right { display: none; }

  .header-center { max-width: 300px; margin: 0 1rem; }
  .header-search-kbd { display: none; }

  .kpi-grid,
  .kpi-grid-3x2,
  .kpi-sec-3x2,
  .kpi-secondary-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .home-analytics-row,
  .home-row-2col,
  .home-row-3col-footer,
  .home-grid {
    grid-template-columns: 1fr;
  }

  .user-info-header { display: none; }
}

/* =============================================
   RESPONSIVE — Mobile (max-width: 768px)
   ============================================= */
@media (max-width: 768px) {
  :root {
    --header-height: 52px;
  }

  .app-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "content";
  }

  .header-left {
    display: flex;
  }

  /* Sidebar becomes slide-out drawer */
  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 200;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu-btn { display: flex; }

  /* Header adjustments */
  .header-center { display: none; }
  .header-logo { font-size: 0.95rem; }
  .header-brand-sub { display: none; }
  .header-wa-pill span:not(.header-wa-dot) { display: none; }
  .header-wa-pill { padding: 0.35rem; }
  .user-info-header { display: none; }
  .btn-logout { display: none; }

  /* Mobile bottom nav */
  .mobile-bottom-nav { display: flex; }

  /* Main content needs bottom padding for nav */
  .main-content {
    padding-bottom: 60px;
  }

  .view { padding: 0.85rem; }

  /* KPI cards 2x2 obligatorio en móvil */
  .kpi-grid,
  .kpi-grid-3x2,
  .kpi-sec-3x2,
  .kpi-secondary-strip {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.55rem;
  }
  .kpi-card,
  .kpi-exec-card {
    padding: 0.7rem;
    gap: 0.45rem;
  }
  .kpi-icon-wrap { width: 32px; height: 32px; }
  .kpi-value { font-size: 1.18rem; }
  .kpi-label { font-size: 0.7rem; }
  .kpi-sparkline { width: 48px; height: 22px; }

  /* Home grid */
  .home-analytics-row,
  .home-row-2col,
  .home-row-3col-footer,
  .home-grid {
    grid-template-columns: 1fr;
  }

  .hero-custom-range-popover {
    left: 0;
    right: auto;
    width: min(320px, 88vw);
  }

  /* Quick actions scroll */
  .quick-actions {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.3rem;
    -webkit-overflow-scrolling: touch;
  }

  .quick-action-btn {
    flex-shrink: 0;
  }

  /* Chat layout */
  .dashboard-chat {
    grid-template-columns: 1fr;
    height: calc(100vh - var(--header-height) - 60px);
  }

  .sidebar-left {
    display: none;
  }

  .sidebar-left.mobile-open {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 200;
    width: 100%;
    top: var(--header-height);
    bottom: 60px;
  }

  .sidebar-right { display: none; }

  /* Message bubbles */
  .message-bubble { max-width: 85%; }

  /* Settings grid */
  .settings-grid { grid-template-columns: 1fr; }

  /* Greeting */
  .home-greeting-hero h1 { font-size: 1.2rem; }
  .greeting-date-box { display: none; }

  /* Ticket detail grid */
  .ticket-detail-grid { grid-template-columns: 1fr; }

  /* Modal adjustments */
  .modal {
    max-width: 96vw;
    max-height: 92vh;
    border-radius: var(--radius-lg);
  }

  .modal-body { padding: 1rem; }
}

/* =============================================
   RESPONSIVE — Small phone (max-width: 480px)
   ============================================= */
@media (max-width: 480px) {
  .kpi-grid,
  .kpi-grid-primary,
  .kpi-secondary-strip {
    grid-template-columns: 1fr 1fr !important;
  }

  .quick-actions { gap: 0.4rem; }

  .view-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .toast {
    min-width: auto;
    max-width: 90vw;
    margin-right: 0.5rem;
  }
}

/* =============================================
   MÓDULO: CONTRATOS Y VENDEDORES
   ============================================= */

/* Wizard Stepper */
.wizard-stepper {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
  position: relative;
}

.wizard-stepper::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 40px;
  right: 40px;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  position: relative;
  z-index: 1;
  cursor: default;
}

.wizard-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.wizard-step.active .wizard-step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 12px rgba(115, 103, 240, 0.4);
}

.wizard-step.completed .wizard-step-num {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

.wizard-step-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.3s;
}

.wizard-step.active .wizard-step-label {
  color: var(--primary);
  font-weight: 600;
}

.wizard-step.completed .wizard-step-label {
  color: #10b981;
}

/* Contracts Grid */
.contracts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.contract-card {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contract-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Sellers Grid */
.sellers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.seller-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.seller-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Combobox Dropdown (reused from ticket/refund combobox) */
.combobox-dropdown {
  position: absolute;
  z-index: 1000;
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  max-height: 240px;
  overflow-y: auto;
  margin-top: 4px;
}

.combobox-item {
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s;
}

.combobox-item:hover {
  background: var(--bg-card-hover);
}

.combobox-item:last-child {
  border-bottom: none;
}

/* Contract Summary */
.contract-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
}

/* =============================================
   RESPONSIVE DESIGN SYSTEM (Mobile, Tablet, Desktop)
   ============================================= */

@media (max-width: 768px) {
  /* Layout & Containers */
  .main-content {
    padding: 0.6rem !important;
  }

  /* Modals on mobile */
  .modal {
    width: 95vw !important;
    max-width: 95vw !important;
    margin: 10px auto !important;
    padding: 0.85rem !important;
    max-height: 90vh !important;
    border-radius: var(--radius-lg) !important;
  }

  /* Header and Filter Toolbars */
  .view-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.6rem !important;
    margin-bottom: 0.6rem !important;
  }

  .view-header button,
  .view-header .btn {
    width: 100% !important;
  }

  /* Toolbar Filters */
  .view-filters {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
    padding: 0.6rem !important;
  }

  .view-filters select,
  .view-filters input,
  select.form-control,
  input.form-control {
    width: 100% !important;
    min-width: 100% !important;
  }

  /* Button Group View Switcher on Mobile */
  .btn-group#ticketViewModeGroup,
  .btn-group#refundViewModeGroup {
    width: 100% !important;
    display: flex !important;
  }

  .btn-group#ticketViewModeGroup button,
  .btn-group#refundViewModeGroup button {
    flex: 1 !important;
    text-align: center !important;
    justify-content: center !important;
    padding: 0.35rem 0.2rem !important;
    font-size: 0.78rem !important;
  }

  /* KPI Grid — ALWAYS 2 Columns on Mobile with Compact Height */
  div[style*="grid-template-columns"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
    margin-bottom: 0.8rem !important;
  }

  div[style*="grid-template-columns"] > div {
    padding: 0.5rem 0.7rem !important;
  }

  div[style*="grid-template-columns"] > div > div:first-child {
    font-size: 0.68rem !important;
  }

  div[style*="grid-template-columns"] > div > div:last-child {
    font-size: 1.05rem !important;
    margin-top: 0.1rem !important;
  }

  /* KANBAN BOARD MOBILE SLIDER (Horizontal Touch Swipe) */
  #viewTicketsKanban,
  #viewRefundsKanban,
  #viewBookingsKanban,
  #viewContractsKanban {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 0.75rem !important;
    padding-bottom: 0.6rem !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch;
  }

  #viewTicketsKanban > div,
  #viewRefundsKanban > div,
  #viewBookingsKanban > div,
  #viewContractsKanban > div {
    flex: 0 0 85vw !important;
    min-width: 85vw !important;
    max-width: 85vw !important;
    scroll-snap-align: start !important;
  }

  /* Ticket & Refund Cards */
  .ticket-card-item,
  .refund-card-item {
    padding: 0.85rem !important;
  }

  .ticket-card-item > div:first-child,
  .refund-card-item > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }

  .ticket-card-item > div:first-child > div:last-child,
  .refund-card-item > div:first-child > div:last-child {
    text-align: left !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
    justify-content: space-between !important;
  }

  /* Detail Grids in Modals */
  .ticket-detail-grid {
    grid-template-columns: 1fr !important;
    gap: 0.6rem !important;
  }

  .ticket-detail-field[style*="grid-column: span 2"] {
    grid-column: span 1 !important;
  }

  /* Card Action Footer */
  .ticket-card-item > div:last-child,
  .refund-card-item > div:last-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }

  .ticket-card-item > div:last-child > div,
  .refund-card-item > div:last-child > div {
    width: 100% !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }

  .ticket-card-item > div:last-child > div button,
  .refund-card-item > div:last-child > div button {
    flex: 1 !important;
    min-width: 110px !important;
  }

  .beneficiary-row {
    grid-template-columns: 1fr 1fr !important;
  }
  .contracts-grid,
  .sellers-grid {
    grid-template-columns: 1fr !important;
  }
  .wizard-stepper {
    gap: 0.2rem !important;
  }
  .wizard-step-label {
    font-size: 0.62rem !important;
  }
}

@media (max-width: 480px) {
  .modal-title {
    font-size: 1.05rem !important;
  }

  .status-badge {
    font-size: 0.72rem !important;
    padding: 0.2rem 0.5rem !important;
  }
}

/* ============================================================
   DATA TABLES SYSTEM & CIC CENTRO DE INTELIGENCIA (Vuexy Dark SaaS)
   ============================================================ */

/* Contenedor de Tabla con Card */
.dash-card-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.2rem;
}

/* Tabla Estilo Datagrid Enterprise */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-primary);
}

.data-table thead tr {
  background: var(--bg-input, #f9fafb);
  border-bottom: 1px solid var(--border);
}

.dark .data-table thead tr {
  background: rgba(37, 41, 60, 0.85);
  border-bottom: 1px solid rgba(225, 222, 245, 0.08);
}

.data-table thead th {
  padding: 14px 18px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}

.dark .data-table thead th {
  color: #a3a7c5;
}

.data-table tbody tr {
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--accent-soft) !important;
}

.data-table tbody td {
  padding: 14px 18px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

/* ==========================================================================
   ELEMENTOS VISUALES CIC 2.0 — CENTRO DE INTELIGENCIA DEL CLIENTE
   ========================================================================== */

/* Cabecera Ejecutiva CIC */
.cic-exec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.cic-exec-title-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.cic-exec-badge-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(115, 103, 240, 0.16), rgba(168, 85, 247, 0.14));
  border: 1px solid rgba(115, 103, 240, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  flex-shrink: 0;
}

.cic-exec-title {
  margin: 0;
  font-size: 1.32rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.cic-version-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.cic-exec-subtitle {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.81rem;
}

.cic-exec-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.cic-view-switcher {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 3px;
  gap: 3px;
}

.cic-view-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s ease;
}

.cic-view-btn.active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.cic-action-btn {
  border-radius: 10px !important;
  font-weight: 700 !important;
  padding: 0.48rem 0.9rem !important;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Cinta de Telemetría de 5 Tarjetas KPI en 1 Fila */
.cic-kpi-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.cic-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cic-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cic-kpi-card.kpi-active-filter {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(115, 103, 240, 0.22), var(--shadow-md);
}

.cic-kpi-info .kpi-label {
  font-size: 0.71rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.cic-kpi-info .kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.08;
}

.cic-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.cic-kpi-total { border-left: 4px solid #6366f1; }
.cic-kpi-total .cic-kpi-icon { background: rgba(99, 102, 241, 0.12); border: 1px solid rgba(99, 102, 241, 0.28); }

.cic-kpi-critical { border-left: 4px solid #ef4444; }
.cic-kpi-critical .cic-kpi-icon { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.3); }

.cic-kpi-risk { border-left: 4px solid #f59e0b; }
.cic-kpi-risk .cic-kpi-icon { background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.3); }

.cic-kpi-vip { border-left: 4px solid #a855f7; }
.cic-kpi-vip .cic-kpi-icon { background: rgba(168, 85, 247, 0.12); border: 1px solid rgba(168, 85, 247, 0.3); }

.cic-kpi-health { border-left: 4px solid #10b981; }
.cic-kpi-health .cic-kpi-icon { background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.3); }

.cic-kpi-desc {
  font-size: 0.69rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
  line-height: 1.25;
}

.cic-health-status-tag {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}
.dark .cic-health-status-tag {
  color: #34d399;
}

.cic-kpi-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-input);
  overflow: hidden;
  margin-top: 6px;
}

.cic-kpi-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #22c55e);
  transition: width 0.35s ease;
}

/* Barra Informativa y Semáforo de Salud */
.cic-legend-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.65rem 1rem;
  margin-bottom: 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.76rem;
}

.cic-legend-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cic-legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.cic-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.cic-legend-right {
  color: var(--text-muted);
  font-size: 0.73rem;
  font-weight: 500;
}

/* Barra de Filtros Inteligente */
.cic-filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.75rem 0.95rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.cic-search-wrap {
  position: relative;
  flex: 1 1 260px;
  min-width: 240px;
  display: flex;
  align-items: center;
}

.cic-search-icon {
  position: absolute;
  left: 12px;
  font-size: 0.85rem;
  pointer-events: none;
  opacity: 0.7;
}

.cic-search-input {
  padding-left: 2.2rem !important;
  padding-right: 2rem !important;
  border-radius: 999px !important;
  height: 38px;
  font-size: 0.83rem !important;
}

.cic-search-clear {
  position: absolute;
  right: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
}

.cic-quick-pills {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  flex-wrap: wrap;
}

.cic-Filter-pill {
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.cic-Filter-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cic-Filter-pill.active {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.26);
}

.cic-selects-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cic-select {
  height: 38px;
  border-radius: 10px !important;
  font-size: 0.79rem !important;
  font-weight: 600;
  padding: 0 0.75rem !important;
  width: auto !important;
  min-width: 155px;
}

/* Avatar e Identidad en Tabla CIC */
.cic-avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.86rem;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.12);
}

.cic-role-corner {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
}

.cic-name-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cic-role-tag {
  font-size: 0.63rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
  text-transform: uppercase;
}

.cic-meta-subtitle {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Columna Empresa & Cartera */
.cic-portfolio-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cic-company-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  width: fit-content;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
}

.cic-portfolio-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.73rem;
  color: var(--text-secondary);
}

.cic-prof-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.cic-prof-add-btn {
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cic-prof-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Medidor Visual de Salud en Tabla */
.cic-health-widget {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 112px;
  padding: 5px 10px;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
}

.cic-health-top {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.cic-health-score-num {
  font-size: 0.88rem;
  font-weight: 800;
}

.cic-health-score-num small {
  font-size: 0.66rem;
  font-weight: 600;
  opacity: 0.7;
}

.cic-health-state-lbl {
  font-size: 0.67rem;
  font-weight: 700;
}

.cic-health-bar-mini {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}

.cic-health-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Badges de Tier */
.badge-tier {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.25px;
}

.badge-tier.badge-critical {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.dark .badge-tier.badge-critical {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-tier.badge-risk {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.dark .badge-tier.badge-risk {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-tier.badge-vip-plat {
  background: rgba(168, 85, 247, 0.12);
  color: #7e22ce;
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.dark .badge-tier.badge-vip-plat {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(99, 102, 241, 0.25));
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.badge-tier.badge-vip-gold {
  background: rgba(234, 179, 8, 0.12);
  color: #b45309;
  border: 1px solid rgba(234, 179, 8, 0.3);
}
.dark .badge-tier.badge-vip-gold {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(234, 179, 8, 0.25));
  color: #fde047;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-tier.badge-standard {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.dark .badge-tier.badge-standard {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

/* Counter Pills */
.counter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.76rem;
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.counter-pill.is-zero {
  opacity: 0.65;
  font-weight: 600;
}

.counter-pill.has-danger {
  background: rgba(239, 68, 68, 0.14);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.dark .counter-pill.has-danger {
  color: #f87171;
}

.counter-pill.has-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.dark .counter-pill.has-warning {
  color: #fbbf24;
}

/* Acciones por Fila */
.cic-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-cic-chat {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.28);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.18s ease;
}
.btn-cic-chat:hover {
  background: #10b981;
  color: #ffffff;
}
.dark .btn-cic-chat {
  color: #34d399;
}

.btn-expediente {
  background: linear-gradient(135deg, #7367F0, #5e50ee);
  color: #ffffff !important;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(115, 103, 240, 0.22);
  transition: all 0.2s ease;
}

.btn-expediente:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(115, 103, 240, 0.38);
  background: linear-gradient(135deg, #8075f2, #6a5cf0);
}

/* VISTA 2: Grilla de Tarjetas 360° */
.cic-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.cic-360-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.cic-360-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(115, 103, 240, 0.35);
}

.cic-360-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.cic-360-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.55rem;
  text-align: center;
}

.cic-360-metric-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
}

.cic-360-metric-val {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 2px;
}

.cic-360-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

/* Adaptabilidad Responsiva CIC */
@media (max-width: 1200px) {
  .cic-kpi-grid-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .cic-kpi-grid-5 {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.55rem;
  }
  .cic-kpi-card {
    padding: 0.75rem;
  }
  .cic-exec-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .cic-exec-actions,
  .cic-selects-group {
    width: 100%;
  }
  .cic-select {
    flex: 1;
  }
}

/* Table header tooltips (subtle underline) */
.data-table th[title] {
  cursor: help;
  border-bottom: 1px dotted var(--border);
}

/* Paginador Enterprise */
.data-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0.2rem;
  margin-top: 0.5rem;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-pagination {
  background: var(--accent-soft);
  border: 1px solid rgba(115, 103, 240, 0.25);
  color: var(--accent) !important;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-pagination:hover:not(:disabled) {
  background: var(--accent);
  color: #ffffff !important;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(115, 103, 240, 0.3);
}

.btn-pagination:disabled {
  background: var(--bg-input) !important;
  border-color: var(--border) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
  opacity: 0.5;
}

.pagination-page-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 5px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* =============================================
   MÓDULO: SOLICITUDES DE VUELO / COTIZACIONES (FASE 24 VUEXY PREMIUM)
   ============================================= */

/* 1. Header & Quick Actions */
.quot-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.quot-title-group h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.quot-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 2. Grid de Métricas KPI Superior */
.quot-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}

@media (max-width: 900px) {
  .quot-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem;
  }
}

.quot-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
}

.quot-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.quot-kpi-info {
  display: flex;
  flex-direction: column;
}

.quot-kpi-info .kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.quot-kpi-info .kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.quot-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.quot-kpi-card:hover .quot-kpi-icon {
  transform: scale(1.08);
}

/* Colores Semánticos KPI */
.quot-kpi-pending {
  border-left: 4px solid #ffab00;
}
.quot-kpi-pending .quot-kpi-icon {
  background: rgba(255, 171, 0, 0.12);
  color: #ffab00;
  border: 1px solid rgba(255, 171, 0, 0.25);
}
.quot-kpi-pending .kpi-value {
  color: #ffab00;
}

.quot-kpi-progress {
  border-left: 4px solid #7367F0;
}
.quot-kpi-progress .quot-kpi-icon {
  background: rgba(115, 103, 240, 0.12);
  color: #7367F0;
  border: 1px solid rgba(115, 103, 240, 0.25);
}
.quot-kpi-progress .kpi-value {
  color: #7367F0;
}

.quot-kpi-quoted {
  border-left: 4px solid #3b82f6;
}
.quot-kpi-quoted .quot-kpi-icon {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.25);
}
.quot-kpi-quoted .kpi-value {
  color: #3b82f6;
}

.quot-kpi-accepted {
  border-left: 4px solid #10b981;
}
.quot-kpi-accepted .quot-kpi-icon {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.quot-kpi-accepted .kpi-value {
  color: #10b981;
}

/* 3. Barra de Filtros, Búsqueda y Switcher de Vistas */
.quot-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
  background: var(--bg-card);
  padding: 0.75rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.quot-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 260px;
}

.quot-search-box {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.quot-search-box input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.45rem 0.9rem 0.45rem 2.2rem;
  font-size: 0.84rem;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.quot-search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(115, 103, 240, 0.15);
  background: var(--bg-card);
}

.quot-search-box .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* 4. Píldoras de Filtro (Filter Pills) */
.filter-pills-container {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filter-pills-container::-webkit-scrollbar { display: none; }

.filter-pill {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.filter-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.filter-pill:active {
  transform: scale(0.96);
}

.filter-pill.active {
  background: linear-gradient(135deg, #7367F0 0%, #8f5fe8 100%) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 4px 12px rgba(115, 103, 240, 0.35) !important;
  transform: translateY(-1px);
}

.filter-pill .pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: inherit;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 2px;
}
.filter-pill:not(.active) .pill-count {
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* 5. Selector de Vistas Segmentado (View Switcher) */
.view-switcher-group {
  display: inline-flex;
  background: var(--bg-primary);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border);
  gap: 2px;
}

.view-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  user-select: none;
}

.view-btn:hover {
  color: var(--text-primary);
  background: rgba(115, 103, 240, 0.08);
}

.view-btn.active {
  background: var(--bg-card) !important;
  color: var(--accent) !important;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
}
.dark .view-btn.active {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 6. Tabla DataGrid de Solicitudes */
.quot-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.quot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
  text-align: left;
}

.quot-table thead tr {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

.quot-table th {
  padding: 0.85rem 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.quot-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
  cursor: pointer;
}

.quot-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.quot-table tbody tr:last-child {
  border-bottom: none;
}

.quot-table td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
}

/* Chips de Ruta & Datos en Tabla */
.quot-number-tag {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--accent);
  background: rgba(115, 103, 240, 0.08);
  border: 1px solid rgba(115, 103, 240, 0.2);
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
}

.quot-route-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.quot-route-arrow {
  color: var(--accent);
  font-size: 0.95rem;
}

.quot-client-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quot-client-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7367F0, #9055fd);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quot-pax-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.quot-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.quot-agent-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.quot-time-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.quot-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-quot-action {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-quot-action:hover {
  transform: translateY(-1px);
}

.btn-quot-chat {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.btn-quot-chat:hover {
  background: #10b981;
  color: #fff;
}

.btn-quot-quote {
  background: linear-gradient(135deg, #7367F0, #8f5fe8);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(115, 103, 240, 0.25);
}
.btn-quot-quote:hover {
  box-shadow: 0 4px 12px rgba(115, 103, 240, 0.4);
}

/* 7. Vista de Tarjetas Modulares (Cards Grid) */
.quot-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.quot-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.quot-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.quot-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.quot-card-route {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quot-card-route .icon {
  font-size: 1.3rem;
}

.quot-card-route .cities {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.quot-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--bg-primary);
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 0.8rem;
}

.quot-card-body-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quot-card-body-row strong {
  color: var(--text-primary);
}

.quot-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

/* 8. Tablero Kanban de Vuelos */
.quot-kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-snap-type: x mandatory;
}

.quot-kanban-col {
  min-width: 290px;
  max-width: 330px;
  flex: 1 0 290px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  scroll-snap-align: start;
}

.quot-kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.85rem;
}

.quot-kanban-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quot-kanban-counter {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
}

.quot-kanban-body {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.8rem;
  min-height: 250px;
  max-height: calc(100vh - 350px);
  overflow-y: auto;
  background: var(--bg-primary);
}

.quot-kanban-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
  gap: 6px;
}

/* Alerta SLA Parpadeante */
.sla-pulse-badge {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: slaPulse 1.8s infinite;
}

@keyframes slaPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.96); }
}

/* ==========================================================================
   AI EFFECTIVENESS — Métricas de rendimiento del motor de IA
   ========================================================================== */

.ai-effectiveness-section {
  margin-bottom: 1.5rem;
}

/* Intent Rows with Progress Bars */
.ai-intent-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.ai-intent-row:last-child { border-bottom: none; }
.ai-intent-row:hover { background: rgba(115, 103, 240, 0.06); border-radius: 6px; }
.ai-intent-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 115px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-intent-bar-track {
  flex: 1;
  height: 7px;
  background: var(--bg-input);
  border-radius: 99px;
  overflow: hidden;
}
.ai-intent-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb 0%, #7367F0 100%);
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.ai-intent-count {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-primary);
  min-width: 26px;
  text-align: right;
}

/* Emotion Distribution Bars */
.ai-emotion-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
}
.ai-emotion-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  min-width: 90px;
  text-transform: capitalize;
}
.ai-emotion-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.ai-emotion-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.ai-emotion-pct {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 30px;
  text-align: right;
}

/* Auto-Ticket Rows */
.ai-ticket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.ai-ticket-row:last-child { border-bottom: none; }
.ai-ticket-count {
  font-weight: 700;
  color: var(--text-primary);
}

/* ==========================================================================
   VISTA: USUARIOS, NÚMEROS WHATSAPP Y PERMISOS (RBAC 2.0)
   ========================================================================== */
.rbac-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.rbac-master-layout {
  display: grid;
  grid-template-columns: 1.05fr 1.15fr;
  gap: 1.1rem;
  align-items: start;
}

.rbac-directory-col {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.rbac-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding: 0.75rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.rbac-users-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rbac-user-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
}

.rbac-user-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(115, 103, 240, 0.35);
}

.rbac-user-card.active-editing {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(115, 103, 240, 0.22), var(--shadow-md);
}

.rbac-user-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.rbac-user-identity {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.rbac-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.92rem;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.14);
}

.rbac-user-name {
  font-weight: 800;
  font-size: 0.96rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rbac-user-email {
  font-size: 0.77rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.rbac-scope-block {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border-radius: 11px;
  background: var(--bg-input);
  border: 1px solid var(--border);
}

.rbac-scope-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.rbac-scope-lbl {
  font-size: 0.69rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  min-width: 92px;
  padding-top: 2px;
}

.rbac-scope-chips {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
}

.rbac-line-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.28);
}
.dark .rbac-line-chip {
  color: #34d399;
}

.rbac-mod-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.69rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.rbac-mod-chip.is-admin-perm {
  background: rgba(115, 103, 240, 0.12);
  color: var(--accent);
  border-color: rgba(115, 103, 240, 0.3);
  font-weight: 700;
}

.rbac-user-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.35rem;
}

/* Columna Derecha: Configurador Visual */
.rbac-editor-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--topbar-height, 64px) + 1rem);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.rbac-editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.rbac-editor-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-primary);
}

.rbac-editor-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.77rem;
  color: var(--text-muted);
}

.rbac-section-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
}

.rbac-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  font-size: 0.81rem;
  font-weight: 800;
  color: var(--text-primary);
}

.rbac-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.rbac-form-grid-2 label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 3px;
  display: block;
}

.rbac-presets-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.rbac-preset-pill {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.16s ease;
}

.rbac-preset-pill:hover,
.rbac-preset-pill.active {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.25);
}

.rbac-lines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.5rem;
}

.rbac-line-card-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
}

.rbac-line-card-item:hover {
  border-color: var(--accent);
}

.rbac-line-card-item.checked {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

.rbac-perms-groups {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.rbac-perm-category {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.rbac-perm-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
}

.rbac-perm-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 0.42rem;
}

.rbac-perm-item-lbl {
  display: flex;
  align-items: flex-start;
  gap: 0.48rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  cursor: pointer;
  transition: all 0.15s ease;
}

.rbac-perm-item-lbl:hover {
  border-color: var(--accent);
}

.rbac-perm-item-lbl.checked {
  background: rgba(115, 103, 240, 0.1);
  border-color: rgba(115, 103, 240, 0.4);
}

.rbac-selected-counter {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(115, 103, 240, 0.14);
  color: var(--accent);
}

/* Vista Previa en Vivo del Menú Lateral */
.rbac-preview-box {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border-radius: 12px;
  padding: 0.8rem 0.95rem;
  color: #f8fafc;
}

.rbac-preview-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.rbac-preview-chips {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.rbac-preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.22);
  color: #e2e8f0;
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.rbac-editor-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 1180px) {
  .rbac-master-layout {
    grid-template-columns: 1fr;
  }
  .rbac-editor-card {
    position: static;
  }
  .rbac-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .rbac-kpi-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  .rbac-form-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   LIBRO DE RECLAMACIONES INDECOPI — Dual-Mode Executive UI (Light & Dark)
   ========================================================================== */
.indecopi-dossier {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #6366f1;
  border-radius: 12px;
  padding: 1.1rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.dark .indecopi-dossier {
  background: #2f3349;
  border-color: rgba(225, 222, 245, 0.12);
  border-left: 4px solid #7367F0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.indecopi-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.85rem;
  margin-bottom: 0.9rem;
}
.dark .indecopi-header {
  border-bottom-color: rgba(225, 222, 245, 0.1);
}

.indecopi-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.dark .indecopi-title {
  color: #cfd3ec;
}

.indecopi-badge-type {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 0.16rem 0.58rem;
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.dark .indecopi-badge-type {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

.indecopi-badge-company {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
}
.dark .indecopi-badge-company {
  background: rgba(115, 103, 240, 0.18);
  color: #c7d2fe;
  border-color: rgba(115, 103, 240, 0.35);
}

.indecopi-badge-deadline {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 0.16rem 0.55rem;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
}
.dark .indecopi-badge-deadline {
  background: rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.28);
}

.indecopi-deadline-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 3px solid #4f46e5;
  padding: 0.42rem 0.8rem;
  border-radius: 8px;
  text-align: right;
}
.dark .indecopi-deadline-card {
  background: #25293c;
  border-color: rgba(225, 222, 245, 0.14);
  border-left: 3px solid #7367F0;
}

.indecopi-deadline-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.dark .indecopi-deadline-label {
  color: #a3a7c5;
}

.indecopi-deadline-date {
  font-size: 0.86rem;
  font-weight: 800;
  color: #4338ca;
  margin-top: 2px;
}
.dark .indecopi-deadline-date {
  color: #a5b4fc;
}

.indecopi-badge-amount {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 800;
}
.dark .indecopi-badge-amount {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.32);
}

.indecopi-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
}
.dark .indecopi-box {
  background: #25293c;
  border-color: rgba(225, 222, 245, 0.09);
}

.indecopi-box-title {
  font-size: 0.71rem;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}
.dark .indecopi-box-title {
  color: #a3a7c5;
}

.indecopi-highlight-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #4f46e5;
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.65rem;
}
.dark .indecopi-highlight-box {
  background: #25293c;
  border-color: rgba(225, 222, 245, 0.1);
  border-left: 3px solid #7367F0;
}

.indecopi-highlight-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #4338ca;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}
.dark .indecopi-highlight-label {
  color: #a5b4fc;
}

/* ==========================================================================
   SECRET PASSWORD INPUT — Anti-Autocomplete + Botón Ojito SVG (Light & Dark)
   ========================================================================== */
.secret-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.secret-input-wrap .form-control {
  width: 100%;
  padding-right: 2.6rem !important;
}

.secret-field.is-masked {
  -webkit-text-security: disc;
  text-security: disc;
  letter-spacing: 0.08em;
}

.secret-field.is-masked::placeholder {
  letter-spacing: normal;
}

.btn-secret-eye {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: color 0.18s ease, background 0.18s ease;
}

.btn-secret-eye:hover,
.btn-secret-eye.is-revealed {
  color: var(--accent);
  background: var(--accent-soft);
}

@media (max-width: 768px) {
  .secret-input-wrap .form-control {
    font-size: 16px !important;
  }
}

/* ==========================================================================
   AI LEARNED MEMORY & SURGICAL RAG — Aprendizaje Supervisado de Asesores (v4.0)
   Light Mode + Vuexy Dark Slate (#25293c / #2f3349) + Mobile 360px
   ========================================================================== */
.learned-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 800;
  background: var(--warning);
  color: #ffffff;
  line-height: 1;
}

.learned-info-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(115, 103, 240, 0.08);
  border: 1px solid rgba(115, 103, 240, 0.22);
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.dark .learned-info-banner {
  background: rgba(115, 103, 240, 0.14);
  border-color: rgba(115, 103, 240, 0.28);
}

.learned-info-text {
  line-height: 1.45;
  flex: 1;
  min-width: 0;
}

.learned-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.learned-status-pills {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 2px;
}

.learned-status-pills .btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(115, 103, 240, 0.35);
  font-weight: 700;
}

.learned-empty-state {
  text-align: center;
  padding: 1.4rem 1rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.learned-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.55rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.learned-card.is-approved {
  border-left-color: var(--success);
}

.learned-card.is-pending {
  border-left-color: var(--warning);
}

.learned-card.has-legal-risk {
  border-left-color: var(--danger);
}

.dark .learned-card {
  background: #2f3349;
  border-color: rgba(225, 222, 245, 0.09);
}

.learned-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.learned-status-chip,
.learned-cat-chip,
.learned-worker-chip,
.learned-usage-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  padding: 0.14rem 0.48rem;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 700;
}

.learned-status-chip.chip-approved {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}

.dark .learned-status-chip.chip-approved {
  color: #34d399;
}

.learned-status-chip.chip-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.dark .learned-status-chip.chip-pending {
  color: #fbbf24;
}

.learned-cat-chip {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.learned-worker-chip {
  color: var(--text-muted);
  font-weight: 600;
}

.learned-usage-chip {
  background: rgba(59, 130, 246, 0.12);
  color: var(--info);
  margin-left: auto;
}

.legal-risk-banner {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #dc2626;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  font-size: 0.75rem;
  line-height: 1.42;
}

.dark .legal-risk-banner {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

.learned-qa-block {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.55rem;
}

.learned-q-line {
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}

.learned-a-line {
  font-size: 0.77rem;
  color: var(--text-secondary);
  line-height: 1.45;
  word-break: break-word;
}

.learned-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}

.learned-btn-reject {
  color: var(--danger) !important;
}

.learned-actions-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Botón 1-Clic en burbuja de WhatsApp (Asesor Humano -> IA) */
.message-outbound .msg-time-with-actions {
  opacity: 1;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.42rem;
}

.message-outbound .msg-time-with-actions > span {
  opacity: 0.78;
  margin-left: auto;
}

.btn-teach-ai-bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.52rem;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.67rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.14s ease;
}

.btn-teach-ai-bubble:hover {
  background: #ffffff;
  color: #4f46e5;
  border-color: #ffffff;
  transform: translateY(-1px);
}

/* Badge de Telemetría RAG Quirúrgico en Playground */
.rag-stats-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.dark .rag-stats-pill {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
}

.teach-ai-modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}

@media (max-width: 768px) {
  .learned-info-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .learned-info-banner .btn {
    width: 100%;
    justify-content: center;
  }

  .learned-card-actions {
    flex-wrap: wrap;
  }

  .teach-ai-modal-actions {
    flex-direction: column-reverse;
  }

  .teach-ai-modal-actions .btn {
    width: 100%;
    justify-content: center;
  }

  #modalTeachAi .form-control {
    font-size: 16px !important;
  }
}

