/* ==========================================
   KUENTAS — SISTEMA DE DISEÑO PREMIUM v3
   Vibrante · Moderno · Elegante
   ========================================== */

/* === CSS VARIABLES — PALETA NEON PREMIUM === */
:root {
  /* Fuentes */
  --font-primary: 'Plus Jakarta Sans', sans-serif;
  --font-display: 'Outfit', sans-serif;

  /* Fondo oscuro profundo */
  --bg-deep: #04070f;
  --bg-app-gradient: linear-gradient(135deg, #060b18 0%, #0d1528 40%, #080e1e 100%);

  /* Canales RGB para consistencia y adaptabilidad del tema */
  --color-primary-rgb: 124, 58, 237;
  --color-primary-light-rgb: 139, 92, 246;
  --color-cyan-rgb: 167, 139, 250;
  --color-rose-rgb: 236, 72, 153;
  --color-amber-rgb: 192, 132, 252;

  /* Colores Neon Principales */
  --color-primary: #7c3aed;         /* Violeta */
  --color-primary-light: #8b5cf6;
  --color-primary-hover: #6d28d9;
  --color-cyan: #a78bfa;            /* Lavanda brillante */
  --color-rose: #ec4899;            /* Fucsia/Rosa vibrante */
  --color-amber: #c084fc;           /* Violeta/Púrpura medio */
  --color-success: #8b5cf6;         /* Violeta para éxito/positivo */
  --color-warning: #a78bfa;
  --color-danger: #ec4899;
  --color-info: #c084fc;

  /* Backgrounds de colores */
  --color-success-bg: rgba(var(--color-primary-light-rgb), 0.12);
  --color-warning-bg: rgba(var(--color-cyan-rgb), 0.12);
  --color-danger-bg: rgba(var(--color-rose-rgb), 0.12);

  /* Widget de Tasas */
  --widget-bg: rgba(var(--color-primary-rgb), 0.07);
  --widget-border: rgba(var(--color-primary-rgb), 0.18);
  --widget-bg-hover: rgba(var(--color-primary-rgb), 0.12);
  --widget-border-hover: rgba(var(--color-primary-rgb), 0.35);
  --widget-shadow-hover: 0 0 20px rgba(var(--color-primary-rgb), 0.1);

  /* Glassmorphism */
  --glass-bg: rgba(15, 20, 40, 0.6);
  --glass-bg-hover: rgba(20, 28, 55, 0.8);
  --glass-border: rgba(var(--color-primary-rgb), 0.15);
  --glass-border-hover: rgba(var(--color-primary-rgb), 0.4);
  --glass-border-focus: rgba(var(--color-primary-light-rgb), 0.6);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(var(--color-primary-rgb), 0.05);
  --glass-shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 20px rgba(var(--color-primary-rgb), 0.1);
  --btn-primary-shadow: 0 4px 15px rgba(var(--color-primary-rgb), 0.35);
  --btn-primary-shadow-hover: 0 8px 25px rgba(var(--color-primary-rgb), 0.55);
  --btn-success-shadow: 0 4px 15px rgba(var(--color-primary-light-rgb), 0.3);
  --btn-success-shadow-hover: 0 8px 25px rgba(var(--color-primary-light-rgb), 0.45);

  /* Texto */
  --text-main: #f0f4ff;
  --text-muted: #7b8ab8;
  --text-inverse: #ffffff;
  --text-success: #a78bfa;          /* Lavanda brillante para texto success en dark mode */
  --text-danger: #ec4899;           /* Fucsia brillante para texto danger en dark mode */
  --text-warning: #c084fc;          /* Morado claro para texto warning en dark mode */
  --text-info: #d8b4fe;             /* Lavanda muy claro para texto info en dark mode */
  --price-color: var(--color-primary-light);

  /* Gradientes de Acento */
  --grad-primary: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  --grad-cyan: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
  --grad-rose: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  --grad-amber: linear-gradient(135deg, #c084fc 0%, #a855f7 100%);
  --grad-success: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  --grad-aurora: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 50%, #c084fc 100%);
  --grad-text: linear-gradient(135deg, #f3e8ff 0%, #c084fc 100%);

  /* Transiciones */
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Variables que varían entre temas */
  --sidebar-bg: rgba(8, 12, 26, 0.85);
  --header-bg: rgba(8, 12, 26, 0.4);
  --modal-bg: rgba(12, 17, 35, 0.96);
  --input-color: #ffffff;
  --input-placeholder-color: rgba(123, 138, 184, 0.5);
  --select-option-bg: #0d1030;
  --aurora-opacity: 1;
  --pattern-opacity: 0.4;
  --autofill-bg: #080c1e;
  --pattern-svg: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%237c3aed' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  --auth-panel-bg: rgba(8, 12, 28, 0.5);
  --toast-bg: rgba(10, 15, 35, 0.92);
}

/* === TEMA CLARO === */
html[data-theme="light"] {
  /* Canales RGB para consistencia y adaptabilidad del tema claro */
  --color-primary-rgb: 15, 118, 110;         /* #0f766e */
  --color-primary-light-rgb: 20, 184, 166;   /* #14b8a6 */
  --color-cyan-rgb: 6, 182, 212;             /* #06b6d4 */
  --color-rose-rgb: 244, 63, 94;             /* #f43f5e */
  --color-amber-rgb: 234, 88, 12;            /* #ea580c */

  /* Reemplazo completo de colores hacia un Teal Nórdico sumamente relajante y profesional */
  --color-primary: #0f766e;         /* Teal Profundo */
  --color-primary-light: #14b8a6;   /* Teal claro */
  --color-primary-hover: #0d9488;
  --color-cyan: #06b6d4;
  --color-rose: #f43f5e;
  --color-amber: #e0f2fe;
  --color-success: #0d9488;         /* Éxito en tono Teal */
  --color-warning: #d97706;
  --color-danger: #e11d48;
  --color-info: #0284c7;

  /* Fondos de colores en modo claro */
  --color-success-bg: rgba(var(--color-primary-rgb), 0.08);
  --color-warning-bg: rgba(var(--color-amber-rgb), 0.08);
  --color-danger-bg: rgba(var(--color-rose-rgb), 0.08);

  /* Widget de Tasas */
  --widget-bg: rgba(var(--color-primary-rgb), 0.05);
  --widget-border: rgba(var(--color-primary-rgb), 0.12);
  --widget-bg-hover: rgba(var(--color-primary-rgb), 0.09);
  --widget-border-hover: rgba(var(--color-primary-rgb), 0.25);
  --widget-shadow-hover: 0 0 20px rgba(var(--color-primary-rgb), 0.05);

  /* Fondos de la App */
  --bg-deep: #ffffff;
  --bg-app-gradient: linear-gradient(135deg, #ffffff 0%, #f0fdfa 50%, #f4f4f5 100%); /* Toque verde menta/salvia ultra pastel */
  
  /* Vidrio y Bordes */
  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-bg-hover: rgba(255, 255, 255, 0.98);
  --glass-border: rgba(var(--color-primary-rgb), 0.08);
  --glass-border-hover: rgba(var(--color-primary-rgb), 0.2);
  --glass-border-focus: rgba(var(--color-primary-rgb), 0.4);
  --glass-shadow: 0 12px 40px rgba(var(--color-primary-rgb), 0.04), 0 2px 4px rgba(0, 0, 0, 0.01);
  --glass-shadow-hover: 0 16px 40px rgba(var(--color-primary-rgb), 0.08), 0 0 20px rgba(var(--color-primary-rgb), 0.05);
  --btn-primary-shadow: 0 4px 15px rgba(var(--color-primary-rgb), 0.35);
  --btn-primary-shadow-hover: 0 8px 25px rgba(var(--color-primary-rgb), 0.55);
  --btn-success-shadow: 0 4px 15px rgba(var(--color-primary-rgb), 0.3);
  --btn-success-shadow-hover: 0 8px 25px rgba(var(--color-primary-rgb), 0.45);
  
  /* Textos */
  --text-main: #0f172a;             /* Pizarra muy oscuro */
  --text-muted: #475569;            /* Gris de contraste */
  --text-inverse: #ffffff;
  --text-success: #0d9488;          /* Verde Teal oscuro legible para éxito */
  --text-danger: #e11d48;           /* Rojo carmín oscuro legible para peligro */
  --text-warning: #d97706;          /* Ámbar oscuro legible para advertencias */
  --text-info: #0284c7;             /* Azul oscuro legible para info */
  --price-color: var(--color-primary); /* En modo claro los precios deben ser del primary oscuro para ser legibles */

  /* Gradientes */
  --grad-primary: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  --grad-cyan: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
  --grad-rose: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  --grad-amber: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  --grad-success: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  --grad-aurora: linear-gradient(135deg, #0f766e 0%, #14b8a6 50%, #38bdf8 100%);
  --grad-text: linear-gradient(135deg, #115e59 0%, #0f766e 100%);

  /* Contenedores */
  --sidebar-bg: rgba(255, 255, 255, 0.96);
  --header-bg: rgba(255, 255, 255, 0.5);
  --modal-bg: #ffffff;
  --input-color: #0f172a;
  --input-placeholder-color: rgba(71, 85, 105, 0.6);
  --select-option-bg: #ffffff;
  --aurora-opacity: 0.25;
  --pattern-opacity: 0.04;
  --autofill-bg: #f0fdfa;
  --pattern-svg: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%230f766e' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  --auth-panel-bg: rgba(255, 255, 255, 0.7);
  --toast-bg: rgba(255, 255, 255, 0.96);
}

/* === RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === BODY === */
body {
  background: var(--bg-app-gradient);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  position: relative;
}

/* Aurora background effect */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(var(--color-primary-rgb), 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(var(--color-primary-light-rgb), 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(var(--color-primary-rgb), 0.05) 0%, transparent 60%);
  animation: auroraShift 15s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
  opacity: var(--aurora-opacity);
}

body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--pattern-svg);
  opacity: var(--pattern-opacity);
  pointer-events: none;
  z-index: 0;
}

@keyframes auroraShift {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(3%, 2%) rotate(1deg); }
  100% { transform: translate(-2%, -3%) rotate(-1deg); }
}

/* ==========================================
   AUTENTICACIÓN — LOGIN & REGISTRO
   ========================================== */
.auth-wrapper {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* Panel Izquierdo — Presentación */
.auth-intro-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 50px 60px;
  background: var(--auth-panel-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-right: 1px solid rgba(var(--color-primary-rgb), 0.12);
  overflow-y: auto;
  animation: slideInLeft 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.auth-intro-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-aurora);
}

.intro-branding {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.intro-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--grad-primary);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(var(--color-primary-rgb), 0.4);
}

.intro-logo-text {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 40px;
  margin-bottom: 40px;
}

.auth-intro-panel h2 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1.2;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intro-lead {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-muted);
}

/* Features */
.features-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.feature-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  animation: fadeInUp 0.5s ease-out both;
}

.feature-item:nth-child(1) { animation-delay: 0.1s; }
.feature-item:nth-child(2) { animation-delay: 0.2s; }
.feature-item:nth-child(3) { animation-delay: 0.3s; }

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  background: rgba(var(--color-primary-rgb), 0.12);
  border: 1px solid rgba(var(--color-primary-rgb), 0.2);
  color: var(--color-cyan);
  border-radius: 14px;
  flex-shrink: 0;
  transition: var(--transition-normal);
}

.feature-item:hover .feature-icon {
  background: rgba(var(--color-primary-rgb), 0.25);
  border-color: rgba(var(--color-primary-rgb), 0.5);
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.3);
}

.feature-details h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.feature-details p {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Tutorial */
.intro-tutorial {
  background: rgba(var(--color-primary-rgb), 0.04);
  border: 1px solid rgba(var(--color-primary-rgb), 0.15);
  border-radius: 20px;
  padding: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.intro-tutorial h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tutorial-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.t-step {
  display: flex;
  align-items: center;
  gap: 14px;
}

.t-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--grad-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(var(--color-primary-rgb), 0.4);
}

.t-step p {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-muted);
  margin: 0;
}

/* Panel derecho — Formulario */
.auth-form-panel {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  overflow-y: auto;
  position: relative;
}

@media (max-width: 1000px) {
  .auth-wrapper { grid-template-columns: 1fr; }
  .auth-intro-panel { display: none; }
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 44px;
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(var(--color-primary-rgb), 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: scaleUpSpring 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.auth-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 29px;
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.3) 0%, transparent 50%, rgba(var(--color-cyan-rgb), 0.15) 100%);
  pointer-events: none;
  z-index: -1;
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 82px;
  height: 82px;
  background: var(--grad-primary);
  color: #fff;
  border-radius: 22px;
  margin-bottom: 16px;
  box-shadow: 0 8px 30px rgba(var(--color-primary-rgb), 0.5);
  transition: var(--transition-bounce);
}

.auth-logo:hover {
  transform: scale(1.06) rotate(-3deg);
  box-shadow: 0 12px 40px rgba(var(--color-primary-rgb), 0.7);
}

.auth-header h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-switch a {
  color: var(--color-primary-light);
  text-decoration: none;
  font-weight: 700;
  transition: var(--transition-fast);
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-switch a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ==========================================
   BLOBS DE GRADIENTES ANIMADOS PARA EL LOGIN
   ========================================== */
.auth-form-panel {
  position: relative;
  overflow: hidden;
  background: var(--auth-panel-bg);
}

/* Esferas de color difuminadas (blobs) */
.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  -webkit-filter: blur(100px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
  animation: floatBlob 12s ease-in-out infinite alternate;
}

.blob-1 {
  width: 250px;
  height: 250px;
  background: var(--color-primary-light);
  top: 10%;
  left: 10%;
  animation-duration: 14s;
}

.blob-2 {
  width: 320px;
  height: 320px;
  background: var(--color-cyan);
  bottom: 10%;
  right: 5%;
  animation-duration: 18s;
  animation-delay: -2s;
}

.blob-3 {
  width: 200px;
  height: 200px;
  background: #7c3aed; /* violeta neon */
  top: 45%;
  left: 45%;
  animation-duration: 16s;
  animation-delay: -4s;
  opacity: 0.1;
}

@keyframes floatBlob {
  0% {
    transform: translate(0px, 0px) scale(1);
  }
  33% {
    transform: translate(30px, -40px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.95);
  }
  100% {
    transform: translate(0px, 0px) scale(1);
  }
}

/* Asegurar que la tarjeta quede por encima de los blobs */
.auth-card {
  z-index: 1;
}

/* Animación de cambio/entrada suave de los formularios */
.auth-form {
  animation: formEntrance 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes formEntrance {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================
   LAYOUT PRINCIPAL DE LA APLICACIÓN
   ========================================== */
.app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* === SIDEBAR === */
.sidebar {
  width: 280px;
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(var(--color-primary-rgb), 0.12);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-aurora);
}

.sidebar::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(ellipse at top center, rgba(var(--color-primary-rgb), 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar-header {
  padding: 28px 22px 20px;
  border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.1);
  position: relative;
  z-index: 1;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  margin-bottom: 18px;
}

.logo svg {
  color: var(--color-primary-light);
  filter: drop-shadow(0 0 6px rgba(var(--color-primary-light-rgb), 0.6));
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.business-info {
  display: flex;
  flex-direction: column;
}

.business-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.username {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Widget Tasas de Cambio */
.exchange-rate-widget {
  margin: 12px 16px;
  padding: 14px 16px;
  background: var(--widget-bg);
  border: 1px solid var(--widget-border);
  border-radius: 18px;
  text-align: center;
  transition: var(--transition-normal);
  position: relative;
  z-index: 1;
}

.exchange-rate-widget:hover {
  background: var(--widget-bg-hover);
  border-color: var(--widget-border-hover);
  box-shadow: var(--widget-shadow-hover);
}

.widget-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.widget-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  margin-bottom: 6px;
}

.currency-symbol {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.rate-number {
  font-size: 1.4rem;
  font-weight: 900;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: var(--font-display);
}

.currency-code {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Navegación Lateral */
.sidebar-nav {
  flex-grow: 1;
  padding: 16px 12px;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 14px;
  font-weight: 500;
  font-size: 0.92rem;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-primary);
  opacity: 0;
  transition: opacity 0.25s ease;
  border-radius: 14px;
  z-index: -1;
}

.nav-item svg {
  transition: var(--transition-normal);
  flex-shrink: 0;
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(var(--color-primary-rgb), 0.08);
  border: none;
}

.nav-item:hover svg {
  color: var(--color-primary-light);
  filter: drop-shadow(0 0 4px rgba(var(--color-primary-light-rgb), 0.5));
  transform: scale(1.1);
}

.nav-item.active {
  background: var(--grad-primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(var(--color-primary-rgb), 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.nav-item.active svg {
  color: #fff;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.4));
}

.sidebar-footer {
  padding: 16px 12px 20px;
  border-top: 1px solid rgba(var(--color-primary-rgb), 0.1);
  position: relative;
  z-index: 1;
}

.btn-logout-sidebar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid rgba(var(--color-rose-rgb), 0.2);
  color: var(--color-danger);
  border-radius: 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition-normal);
}

.btn-logout-sidebar:hover {
  background: rgba(var(--color-rose-rgb), 0.1);
  border-color: rgba(var(--color-rose-rgb), 0.45);
  box-shadow: 0 0 20px rgba(var(--color-rose-rgb), 0.15);
  transform: translateY(-1px);
  color: var(--text-danger);
}

/* Contenido Principal */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Header Superior */
.app-header {
  padding: 20px 36px;
  border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
}

.app-header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 100%; height: 1px;
  background: linear-gradient(to right, transparent, rgba(var(--color-primary-rgb), 0.3), rgba(6, 182, 212, 0.2), transparent);
}

.header-title h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-title p {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.quick-stats-top {
  display: flex;
  gap: 12px;
}

.quick-rate {
  font-size: 0.88rem;
  background: rgba(var(--color-primary-rgb), 0.08);
  border: 1px solid rgba(var(--color-primary-rgb), 0.2);
  padding: 8px 18px;
  border-radius: 999px;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.quick-rate:hover {
  background: rgba(var(--color-primary-rgb), 0.15);
  border-color: rgba(var(--color-primary-rgb), 0.4);
}

.quick-rate strong {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--color-cyan);
  -webkit-text-fill-color: var(--color-cyan);
}

/* Viewport de Vistas */
.view-viewport {
  flex-grow: 1;
  padding: 36px 40px;
  overflow-y: auto;
}

.app-view {
  animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   BOTONES
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  font-size: 0.93rem;
  font-weight: 700;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: var(--transition-bounce);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.08);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97) !important; }

.btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
  border-radius: 10px;
}

.btn-lg {
  padding: 15px 30px;
  font-size: 1.05rem;
  border-radius: 16px;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: var(--btn-primary-shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--btn-primary-shadow-hover);
  filter: brightness(1.08);
}

.btn-success {
  background: var(--grad-success);
  color: #fff;
  box-shadow: var(--btn-success-shadow);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: var(--btn-success-shadow-hover);
  filter: brightness(1.08);
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(var(--color-primary-rgb), 0.2);
  color: var(--text-muted);
  transition: var(--transition-normal);
}

.btn-outline-light:hover {
  background: rgba(var(--color-primary-rgb), 0.1);
  border-color: rgba(var(--color-primary-rgb), 0.4);
  color: var(--text-main);
  box-shadow: 0 0 15px rgba(var(--color-primary-rgb), 0.15);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(var(--color-primary-rgb), 0.2);
  color: var(--text-muted);
  transition: var(--transition-normal);
}

.btn-outline:hover {
  background: rgba(var(--color-primary-rgb), 0.08);
  border-color: rgba(var(--color-primary-rgb), 0.4);
  color: var(--text-main);
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid rgba(var(--color-rose-rgb), 0.3);
  color: var(--color-danger);
}

.btn-danger-outline:hover {
  background: rgba(var(--color-rose-rgb), 0.1);
  border-color: rgba(var(--color-rose-rgb), 0.5);
}

.btn-danger-button {
  background: var(--grad-rose);
  color: #fff;
  box-shadow: 0 4px 15px rgba(var(--color-rose-rgb), 0.3);
}

.btn-danger-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(var(--color-rose-rgb), 0.45);
  filter: brightness(1.1);
}

.btn-danger-link {
  background: transparent;
  color: var(--color-danger);
  border: none;
  font-weight: 600;
  padding: 4px 8px;
}

.btn-danger-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

.btn-icon-only {
  width: 42px;
  height: 42px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  flex-shrink: 0;
}

/* ==========================================
   FORMULARIOS & INPUTS
   ========================================== */
.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: rgba(var(--color-primary-rgb), 0.04);
  border: 1px solid rgba(var(--color-primary-rgb), 0.15);
  border-radius: 14px;
  color: var(--input-color) !important;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  -webkit-appearance: none;
}

.form-control:focus {
  border-color: rgba(var(--color-primary-light-rgb), 0.7);
  background: rgba(var(--color-primary-rgb), 0.08);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.12), 0 0 20px rgba(var(--color-primary-rgb), 0.15), inset 0 0 8px rgba(var(--color-primary-rgb), 0.04);
  transform: translateY(-1px);
}

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

.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
  border: 1px solid rgba(var(--color-primary-light-rgb), 0.4) !important;
  -webkit-text-fill-color: var(--input-color) !important;
  -webkit-box-shadow: 0 0 0px 1000px var(--autofill-bg) inset !important;
  transition: background-color 5000s ease-in-out 0s;
  border-radius: 14px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.col-6 { width: 50%; }
.col-12 { width: 100%; }

.input-action-group {
  display: flex;
  gap: 0;
  width: 100%;
}

.input-action-group select,
.input-action-group input {
  flex-grow: 1;
}

.input-addon {
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: rgba(var(--color-primary-rgb), 0.08);
  border: 1px solid rgba(var(--color-primary-rgb), 0.2);
  border-left: none;
  border-radius: 0 14px 14px 0;
  color: var(--color-primary-light);
  font-weight: 700;
  font-size: 0.85rem;
}

.input-action-group input {
  border-radius: 14px 0 0 14px;
}

.font-large {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-display);
}

.width-300 { width: 300px; }

/* ==========================================
   TABLAS DE DATOS
   ========================================== */
.table-container {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  margin-top: 20px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 15px 22px;
  border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.06);
}

.data-table th {
  background: rgba(var(--color-primary-rgb), 0.05);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.data-table tbody tr {
  transition: var(--transition-fast);
}

.data-table tbody tr:hover {
  background: rgba(var(--color-primary-rgb), 0.05);
}

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

.actions-col {
  text-align: right;
  width: 120px;
}

.actions-cell {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.btn-action {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 7px;
  border-radius: 9px;
  transition: var(--transition-fast);
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  transform: scale(1.1);
}

.btn-action.edit:hover {
  color: var(--color-primary-light);
  background: rgba(var(--color-primary-rgb), 0.12);
  box-shadow: 0 0 12px rgba(var(--color-primary-rgb), 0.2);
}

.btn-action.delete:hover {
  color: var(--color-danger);
  background: rgba(var(--color-rose-rgb), 0.1);
  box-shadow: 0 0 12px rgba(var(--color-rose-rgb), 0.2);
}

/* ==========================================
   DASHBOARD & MÉTRICAS
   ========================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  margin-bottom: 30px;
}

.metric-card {
  padding: 26px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.metric-card.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--glass-shadow);
  transition: var(--transition-normal);
}

.metric-card.glass::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-aurora);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.metric-card.glass:hover::before {
  opacity: 1;
}

.metric-card.glass:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--color-primary-rgb), 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 30px rgba(var(--color-primary-rgb), 0.08);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.metric-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.metric-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-normal);
}

.metric-card:hover .metric-icon {
  transform: scale(1.1) rotate(-5deg);
}

.metric-icon.green {
  background: rgba(var(--color-primary-light-rgb), 0.15);
  color: var(--text-success);
  box-shadow: 0 4px 12px rgba(var(--color-primary-light-rgb), 0.25);
}

.metric-icon.blue {
  background: rgba(var(--color-cyan-rgb), 0.15);
  color: var(--text-info);
  box-shadow: 0 4px 12px rgba(var(--color-cyan-rgb), 0.25);
}

.metric-icon.orange {
  background: rgba(var(--color-rose-rgb), 0.15);
  color: var(--text-danger);
  box-shadow: 0 4px 12px rgba(var(--color-rose-rgb), 0.25);
}

.metric-icon.purple {
  background: rgba(var(--color-primary-rgb), 0.15);
  color: var(--color-primary-light);
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.25);
}

.metric-content {
  margin-bottom: 12px;
}

.value-usd {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--text-main);
}

.value-usd.success { color: var(--text-success); }
.value-usd.danger { color: var(--text-danger); }

.value-ves {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

.metric-footer {
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(var(--color-primary-rgb), 0.08);
  padding-top: 10px;
}

.dashboard-details-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.chart-container-card,
.alerts-container-card {
  border-radius: 22px;
  padding: 26px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.card-title-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.08);
  padding-bottom: 14px;
}

.card-title-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chart-wrapper {
  position: relative;
  height: 280px;
  width: 100%;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.73rem;
  font-weight: 800;
  border-radius: 8px;
  letter-spacing: 0.03em;
}

.badge.danger {
  background: rgba(var(--color-rose-rgb), 0.14);
  color: var(--text-danger);
  border: 1px solid rgba(var(--color-rose-rgb), 0.2);
}

.badge.warning {
  background: rgba(var(--color-warning-rgb), 0.12);
  color: var(--text-warning);
  border: 1px solid rgba(var(--color-warning-rgb), 0.2);
}

.badge.success {
  background: rgba(var(--color-success-rgb), 0.12);
  color: var(--text-success);
  border: 1px solid rgba(var(--color-success-rgb), 0.2);
}

/* Alert List */
.dashboard-alerts-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-alerts-list li {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(var(--color-rose-rgb), 0.05);
  border: 1px solid rgba(var(--color-rose-rgb), 0.15);
  border-left: 4px solid var(--color-danger);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-fast);
}

.dashboard-alerts-list li:hover {
  background: rgba(var(--color-rose-rgb), 0.08);
  transform: translateX(2px);
}

.dashboard-alerts-list li.warning {
  background: rgba(var(--color-warning-rgb), 0.05);
  border-color: rgba(var(--color-warning-rgb), 0.2);
  border-left-color: var(--color-warning);
}

.dashboard-alerts-list li .prod-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.dashboard-alerts-list li .stock-details {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dashboard-alerts-list li.empty-list {
  border-left: none;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(var(--color-primary-rgb), 0.08);
  color: var(--text-muted);
  text-align: center;
  justify-content: center;
  font-size: 0.9rem;
  padding: 30px;
}

/* ==========================================
   PUNTO DE VENTA (POS)
   ========================================== */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 24px;
  height: calc(100vh - 190px);
  overflow: hidden;
}

.pos-products-side {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.search-bar-wrapper {
  position: relative;
  margin-bottom: 20px;
}

.search-bar-wrapper .form-control {
  padding-left: 48px;
}

.search-bar-wrapper .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.pos-products-grid {
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-auto-rows: max-content;
  align-items: start;
  gap: 16px;
  overflow-y: auto;
  padding-bottom: 20px;
}

.pos-product-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: var(--transition-normal);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  position: relative;
}

.pos-product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.25), rgba(var(--color-cyan-rgb), 0.15)) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pos-product-card:hover::before {
  opacity: 1;
}

.pos-product-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--glass-border-hover);
  box-shadow: var(--glass-shadow-hover);
}

.pos-product-card .prod-code {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.pos-product-card .prod-title {
  font-weight: 700;
  font-size: 0.93rem;
  margin-bottom: 10px;
  line-height: 1.3;
  flex-grow: 1;
}

.pos-product-card .price-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

.pos-product-card .price-usd {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 900;
  background: var(--grad-success);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pos-product-card .price-ves {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pos-product-card .stock-tag {
  font-size: 0.73rem;
  font-weight: 700;
  padding-top: 8px;
  border-top: 1px solid rgba(var(--color-primary-rgb), 0.08);
  letter-spacing: 0.02em;
}

.pos-product-card .stock-tag.danger { color: var(--text-danger); }
.pos-product-card .stock-tag.warning { color: var(--text-warning); }
.pos-product-card .stock-tag.success { color: var(--text-success); }

/* Carrito POS */
.pos-cart-side {
  border-radius: 22px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.cart-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(var(--color-primary-rgb), 0.04);
}

.cart-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cart-items-list {
  flex-grow: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.08);
}

.empty-cart-message {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: auto;
  padding: 20px;
}

.cart-item {
  display: flex;
  gap: 12px;
  background: rgba(var(--color-primary-rgb), 0.04);
  border: 1px solid rgba(var(--color-primary-rgb), 0.1);
  border-radius: 14px;
  padding: 10px 12px;
  align-items: center;
  transition: var(--transition-fast);
}

.cart-item:hover {
  background: rgba(var(--color-primary-rgb), 0.08);
  border-color: rgba(var(--color-primary-rgb), 0.22);
}

.cart-item-details {
  flex-grow: 1;
}

.cart-item-title {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 175px;
}

.cart-item-prices {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.cart-item-price-usd {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--price-color);
}

.cart-item-price-ves {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-item-qty {
  font-weight: 800;
  font-size: 0.9rem;
  width: 22px;
  text-align: center;
}

.btn-cart-qty {
  width: 26px;
  height: 26px;
  background: rgba(var(--color-primary-rgb), 0.1);
  border: 1px solid rgba(var(--color-primary-rgb), 0.2);
  border-radius: 8px;
  color: var(--color-primary-light);
  font-weight: 900;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.btn-cart-qty:hover {
  background: rgba(var(--color-primary-rgb), 0.25);
  border-color: rgba(var(--color-primary-rgb), 0.5);
  transform: scale(1.1);
}

.btn-cart-remove {
  background: transparent;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition-fast);
}

.btn-cart-remove:hover {
  background: rgba(var(--color-rose-rgb), 0.1);
  transform: scale(1.1);
}

.cart-checkout-options {
  padding: 14px 22px;
  border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.08);
}

.cart-checkout-options .form-group {
  margin-bottom: 10px;
}

.mixed-payment-box {
  background: rgba(var(--color-primary-rgb), 0.04);
  border: 1px solid rgba(var(--color-primary-rgb), 0.15);
  border-radius: 14px;
  padding: 12px;
  margin-top: 10px;
  animation: slideDown 0.2s ease-out;
}

/* Totales */
.cart-summary {
  padding: 18px 22px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.summary-line:last-child { margin-bottom: 0; }

.summary-line span {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.summary-line strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-main);
}

.summary-line strong.ves-text {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.summary-line.debt-indicator {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(var(--color-primary-rgb), 0.15);
}

.pos-cart-side .btn-submit-sale {
  border-radius: 0 0 22px 22px;
}

/* ==========================================
   CLIENTES Y DEUDAS
   ========================================== */
.debts-grid-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  height: calc(100vh - 190px);
}

.customers-list-card {
  border-radius: 22px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.p-15 { padding: 15px; }
.m-x-15 { margin-left: 15px; margin-right: 15px; margin-bottom: 15px; }

.customer-cards-list {
  flex-grow: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.customer-item-card {
  background: rgba(var(--color-primary-rgb), 0.03);
  border: 1px solid rgba(var(--color-primary-rgb), 0.1);
  border-radius: 14px;
  padding: 12px 15px;
  cursor: pointer;
  transition: var(--transition-normal);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.customer-item-card:hover {
  background: rgba(var(--color-primary-rgb), 0.08);
  border-color: rgba(var(--color-primary-rgb), 0.25);
  transform: translateX(2px);
}

.customer-item-card.active {
  background: rgba(var(--color-primary-rgb), 0.12);
  border-color: var(--color-primary-light);
  box-shadow: 0 0 15px rgba(var(--color-primary-rgb), 0.15);
}

.cust-card-info h4 {
  font-size: 0.93rem;
  font-weight: 700;
  margin-bottom: 4px;
}

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

.cust-card-debt { text-align: right; }

.cust-card-debt .usd {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
}

.cust-card-debt .usd.has-debt { color: var(--text-danger); }

.cust-card-debt .ves {
  font-size: 0.73rem;
  color: var(--text-muted);
}

.customer-detail-card {
  border-radius: 22px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  padding: 30px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.empty-state-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
  gap: 16px;
}

.empty-state-detail svg { color: rgba(var(--color-primary-rgb), 0.2); }

.empty-state-detail h4 {
  font-size: 1.1rem;
  color: var(--text-main);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.1);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.detail-header h3 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 900;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.detail-header p {
  color: var(--text-muted);
  margin-top: 4px;
}

.detail-debt-badge {
  text-align: right;
  padding: 12px 20px;
  background: var(--color-danger-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

.detail-debt-badge .label {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--text-danger);
  margin-bottom: 2px;
  text-transform: uppercase;
}

.detail-debt-badge .amount {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text-danger);
  display: block;
  line-height: 1.2;
}

.detail-debt-badge .amount-ves {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.detail-actions-row {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
}

.detail-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.1);
  margin-bottom: 20px;
}

.detail-tabs .tab {
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition-fast);
  border-radius: 10px 10px 0 0;
}

.detail-tabs .tab:hover { color: var(--text-main); }

.detail-tabs .tab.active {
  color: var(--color-primary-light);
  border-bottom-color: var(--color-primary-light);
  background: rgba(var(--color-primary-rgb), 0.06);
}

.tab-pane {
  flex-grow: 1;
  overflow-y: auto;
}

.simple-table-wrapper { max-height: 100%; }
.simple-table-wrapper table th { padding: 10px 16px; font-size: 0.75rem; }
.simple-table-wrapper table td { padding: 12px 16px; font-size: 0.85rem; }

/* ==========================================
   CONFIGURACIÓN
   ========================================== */
.settings-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 28px;
}

.settings-card {
  padding: 30px;
  border-radius: 22px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  box-shadow: var(--glass-shadow);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.settings-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.settings-card:hover::before {
  transform: scaleX(1);
}

.settings-card:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--glass-shadow-hover);
}

.settings-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.settings-card .description {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ==========================================
   MODALES
   ========================================== */
.modal-overlay {
  position: fixed;
  left: 0; top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 13, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  width: 100%;
  max-width: 600px;
  background: var(--modal-bg);
  border: 1px solid rgba(var(--color-primary-rgb), 0.2);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(var(--color-primary-rgb), 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border-radius: 26px;
  padding: 32px;
  animation: scaleUpSpring 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.modal-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-aurora);
}

.modal-card.modal-sm {
  max-width: 440px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.1);
  padding-bottom: 14px;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-close-modal:not(.btn) {
  background: rgba(var(--color-primary-rgb), 0.06);
  border: 1px solid rgba(var(--color-primary-rgb), 0.15);
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  line-height: 1;
}

.btn-close-modal:not(.btn):hover {
  color: #fff;
  background: rgba(var(--color-rose-rgb), 0.15);
  border-color: rgba(var(--color-rose-rgb), 0.3);
  transform: rotate(90deg) scale(1.1);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  border-top: 1px solid rgba(var(--color-primary-rgb), 0.08);
  padding-top: 20px;
}

.info-box-sm {
  padding: 12px 16px;
  background: rgba(var(--color-primary-rgb), 0.05);
  border: 1px solid rgba(var(--color-primary-rgb), 0.12);
  border-radius: 14px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.info-box-sm strong { color: #ec4899; }

/* ==========================================
   ANIMACIONES & KEYFRAMES
   ========================================== */
.hidden { display: none !important; }

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

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleUp {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes scaleUpSpring {
  from { transform: scale(0.88); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(-12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--color-primary-rgb), 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(var(--color-primary-rgb), 0); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: rgba(var(--color-primary-rgb), 0.03); }
::-webkit-scrollbar-thumb {
  background: rgba(var(--color-primary-rgb), 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(var(--color-primary-rgb), 0.4); }

/* ==========================================
   IMÁGENES Y MINIATURAS
   ========================================== */
.image-upload-wrapper {
  margin-top: 8px;
  background: rgba(var(--color-primary-rgb), 0.03);
  border: 1px dashed rgba(var(--color-primary-rgb), 0.2);
  border-radius: 18px;
  overflow: hidden;
  transition: var(--transition-normal);
}

.image-drag-area {
  padding: 26px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  transition: var(--transition-normal);
}

.image-drag-area svg {
  color: var(--color-primary-light);
  opacity: 0.7;
  transition: var(--transition-normal);
}

.image-drag-area:hover {
  background: rgba(var(--color-primary-rgb), 0.06);
  color: var(--text-main);
}

.image-drag-area:hover svg {
  opacity: 1;
  transform: translateY(-3px) scale(1.08);
  filter: drop-shadow(0 0 8px rgba(var(--color-primary-light-rgb), 0.5));
}

.image-drag-area.drag-over {
  background: rgba(var(--color-primary-rgb), 0.1);
  border-color: var(--color-primary-light);
  color: var(--text-main);
}

.image-preview-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  gap: 20px;
  background: rgba(var(--color-primary-rgb), 0.05);
}

#prod-image-preview {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(var(--color-primary-rgb), 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.btn-delete-image { flex-shrink: 0; }

.product-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(var(--color-primary-rgb), 0.15);
  background: rgba(var(--color-primary-rgb), 0.05);
}

.product-avatar-placeholder-sm {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  background: var(--grad-primary);
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.3);
}

/* Imágenes POS */
.pos-product-card {
  overflow: hidden;
}

.pos-product-image-container {
  position: relative;
  width: 100%;
  height: 118px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.1);
  overflow: hidden;
}

.pos-product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pos-product-card:hover .pos-product-image {
  transform: scale(1.06);
}

.pos-product-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2.2rem;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  background: linear-gradient(135deg, #1e1040 0%, #0f0a2a 100%);
  position: relative;
}

.pos-product-avatar-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(var(--color-primary-rgb), 0.25), transparent 70%);
}

.pos-product-card .card-content-box {
  padding: 14px 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Qty Input */
.cart-item-qty-input {
  width: 58px;
  padding: 4px 6px;
  background: rgba(var(--color-primary-rgb), 0.06);
  border: 1px solid rgba(var(--color-primary-rgb), 0.2);
  border-radius: 8px;
  color: var(--text-main);
  font-weight: 800;
  text-align: center;
  outline: none;
  transition: var(--transition-fast);
}

.cart-item-qty-input:focus {
  border-color: var(--color-primary-light);
  background: rgba(var(--color-primary-rgb), 0.12);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.15);
}

.cart-item-qty-input::-webkit-outer-spin-button,
.cart-item-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-item-qty-input[type=number] { -moz-appearance: textfield; }

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */
.toast-container {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 310px;
  max-width: 420px;
  padding: 15px 20px;
  background: var(--toast-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(var(--color-primary-rgb), 0.18);
  border-radius: 18px;
  color: var(--text-main);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 14px;
  transform: translateX(130%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast svg { flex-shrink: 0; }

.toast-message {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

.toast.success {
  border-left: 3px solid var(--color-success);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), -2px 0 20px rgba(var(--color-primary-light-rgb), 0.15);
}
.toast.success svg { color: var(--text-success); }

.toast.danger {
  border-left: 3px solid var(--color-danger);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), -2px 0 20px rgba(var(--color-rose-rgb), 0.15);
}
.toast.danger svg { color: var(--text-danger); }

.toast.warning {
  border-left: 3px solid var(--color-warning);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), -2px 0 20px rgba(var(--color-cyan-rgb), 0.15);
}
.toast.warning svg { color: var(--text-warning); }

.toast.info {
  border-left: 3px solid var(--color-primary);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), -2px 0 20px rgba(var(--color-primary-rgb), 0.2);
}
.toast.info svg { color: var(--text-info); }

/* Select Options */
select.form-control option {
  background-color: var(--select-option-bg) !important;
  color: var(--input-color) !important;
}

/* Glass utility class */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
}

/* Secondary button */
.btn-secondary {
  background: rgba(var(--color-primary-rgb), 0.08);
  border: 1px solid rgba(var(--color-primary-rgb), 0.2);
  color: var(--text-muted);
  transition: var(--transition-normal);
}

.btn-secondary:hover {
  background: rgba(var(--color-primary-rgb), 0.15);
  border-color: rgba(var(--color-primary-rgb), 0.4);
  color: var(--text-main);
}

/* Modal body spacing helper */
.modal-body {
  padding: 0;
}

/* Gradient heading for support/profile pages */
.gradient-heading {
  font-family: var(--font-display);
  font-weight: 900;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Layout y cabecera responsiva general */
.view-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
}

.cash-split-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 28px;
  margin-bottom: 30px;
}

/* Control de Caja Styles */
.cash-open-layout {
  display: flex;
  flex-direction: column;
}

#header-cash-status.closed {
  border-color: rgba(244, 63, 94, 0.3) !important;
  background: rgba(244, 63, 94, 0.06) !important;
  color: #ef4444 !important;
}

#header-cash-status.open {
  border-color: rgba(16, 185, 129, 0.3) !important;
  background: rgba(16, 185, 129, 0.06) !important;
  color: #10b981 !important;
}

#header-cash-dot.closed {
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}

#header-cash-dot.open {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.diff-positive {
  color: #10b981 !important;
}

.diff-negative {
  color: #ef4444 !important;
}

.diff-neutral {
  color: var(--text-muted) !important;
}

/* Animaciones y Hover */
#header-cash-status {
  transition: all 0.2s ease;
}

#header-cash-status:hover {
  transform: translateY(-1px);
}

/* === INDICADOR DE RED (ONLINE / OFFLINE) PWA === */
#header-network-status {
  transition: all 0.3s ease;
}

#header-network-status.online {
  color: #a78bfa !important; /* Lavanda brillante */
  background: rgba(var(--color-primary-rgb), 0.07) !important;
  border: 1px solid rgba(var(--color-primary-rgb), 0.18) !important;
}

#header-network-status.offline {
  color: #ec4899 !important; /* Fucsia */
  background: rgba(236, 72, 153, 0.07) !important;
  border: 1px solid rgba(236, 72, 153, 0.18) !important;
}

#header-network-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

#header-network-dot.online {
  background-color: #8b5cf6 !important; /* Violeta */
  box-shadow: 0 0 10px #8b5cf6;
  animation: pulse-online 2s infinite;
}

#header-network-dot.offline {
  background-color: #ec4899 !important; /* Fucsia */
  box-shadow: 0 0 10px #ec4899;
  animation: pulse-offline 1.5s infinite;
}

@keyframes pulse-online {
  0% {
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(139, 92, 246, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
  }
}

@keyframes pulse-offline {
  0% {
    box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(236, 72, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(236, 72, 153, 0);
  }
}

/* === MAQUETACIÓN RESPONSIVA Y BARRA INFERIOR (PWA) === */
.bottom-nav {
  display: none; /* Oculto en escritorio */
}
.bottom-sheet {
  display: none;
}

/* Tablas con scroll horizontal responsivo por defecto */
.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
}

@media (max-width: 768px) {
  /* Reducir tamaño de fuentes base y títulos para mayor densidad visual */
  body {
    font-size: 14px !important;
  }

  h1 { font-size: 1.7rem !important; }
  h2 { font-size: 1.4rem !important; }
  h3 { font-size: 1.15rem !important; }
  h4 { font-size: 0.95rem !important; }

  /* Ajustar grilla de detalles de dashboard en móvil */
  .dashboard-details-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Reducir paddings generales de tarjetas de contenido */
  .glass, .card {
    padding: 14px 12px !important;
  }

  .view-container {
    padding: 12px 10px !important;
  }

  /* Tablas compactas en móvil para evitar scroll horizontal excesivo */
  .data-table th, .data-table td {
    padding: 8px 6px !important;
    font-size: 0.8rem !important;
  }

  /* Ocultar barra lateral en móvil */
  .sidebar {
    display: none !important;
  }

  /* El contenido ocupa todo el ancho y deja espacio inferior para la bottom-nav */
  .main-content {
    margin-left: 0 !important;
    padding: 10px 10px 80px 10px !important; /* Optimizado de 16px a 10px */
    width: 100% !important;
    min-height: calc(100vh - 68px);
  }

  /* Reordenar Header de la App */
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0 20px 0;
  }

  .header-actions {
    width: 100%;
  }

  .quick-stats-top {
    flex-wrap: wrap;
    gap: 8px !important;
    justify-content: flex-start;
  }

  .quick-rate {
    font-size: 0.78rem !important;
    padding: 6px 10px !important;
  }

  /* Mostrar Barra de Navegación Inferior */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 68px;
    background: rgba(4, 7, 15, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    justify-content: space-around;
    align-items: center;
    z-index: 999;
    padding: 4px 10px;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 500;
    gap: 4px;
    flex: 1;
    transition: all 0.25s ease;
  }

  .bottom-nav-item svg {
    color: var(--text-muted);
    transition: all 0.25s ease;
  }

  .bottom-nav-item:hover, .bottom-nav-item.active {
    color: var(--color-primary);
  }

  .bottom-nav-item.active svg {
    color: var(--color-primary);
    filter: drop-shadow(0 0 6px rgba(124, 58, 237, 0.6));
    transform: translateY(-2px);
  }

  /* Grid de métricas en móvil (una sola columna o dos columnas compactas) */
  /* Grid de métricas en móvil (dos columnas compactas) */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .metric-card {
    padding: 14px 12px !important;
    border-radius: 14px !important;
  }

  .metric-card .value {
    font-size: 1.25rem !important;
  }

  .metric-card .sub {
    font-size: 0.72rem !important;
  }

  /* Adaptación de Formularios de Registro/Login */
  .auth-wrapper {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .auth-intro-panel {
    display: none; /* Ocultamos la presentación gigante en pantallas de celular */
  }

  .auth-form-panel {
    padding: 30px 20px;
    width: 100%;
  }

  /* Adaptación del Punto de Venta (POS) a una sola columna */
  .pos-layout {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    height: auto !important;
    overflow: visible !important;
  }

  .pos-products-side {
    height: auto !important;
    overflow: visible !important;
  }

  .pos-products-grid {
    grid-template-columns: repeat(2, 1fr) !important; /* 2 columnas compactas en móvil */
    gap: 8px !important; /* Ganamos espacio lateral */
    overflow-y: visible !important;
    padding-bottom: 10px;
  }

  .pos-product-card {
    border-radius: 12px !important;
    padding: 10px !important; /* Más compacto */
  }

  .pos-product-card .prod-img-wrapper {
    height: 90px !important; /* Altura compacta en móviles */
  }

  .pos-product-card .prod-title {
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
    height: 32px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .pos-product-card .price-usd {
    font-size: 0.95rem !important;
  }

  .pos-product-card .price-ves {
    font-size: 0.72rem !important;
  }

  .pos-product-card .stock-tag {
    font-size: 0.7rem !important;
    padding: 2px 6px !important;
  }

  /* Buscador Sticky en móvil */
  .pos-products-side .search-bar-wrapper {
    position: sticky;
    top: -16px; /* Alineado con el padding de main-content */
    z-index: 100;
    background: rgba(8, 12, 28, 0.9); /* Translúcido premium a tono con la app en modo oscuro */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 10px; /* Padding a los lados para respirar */
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.3s ease, border-color 0.3s ease;
  }

  /* Ajuste para el Tema Claro en el buscador sticky móvil */
  html[data-theme="light"] .pos-products-side .search-bar-wrapper {
    background: rgba(255, 255, 255, 0.92); /* Translúcido premium a tono con el fondo claro */
    border-bottom: 1px solid rgba(15, 118, 110, 0.12); /* Tono teal del tema claro */
  }

  /* Adaptación de Cabecera e Historial */
  .view-header-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }

  .view-header-row .search-bar-wrapper {
    width: 100% !important;
  }

  .view-header-row .form-control.width-300 {
    width: 100% !important;
  }

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

  /* Adaptación de Caja en Móvil */
  .cash-split-layout {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .pos-cart-side {
    position: relative;
    top: 0;
    max-height: none;
    height: auto;
    margin-top: 10px;
    padding: 20px 16px !important;
  }

  .cart-items-list {
    max-height: 280px;
    overflow-y: auto;
  }

  /* Botón Flotante del Carrito (FAB) en móvil */
  .pos-mobile-cart-fab {
    display: flex !important;
    position: fixed;
    bottom: 84px; /* Arriba de la bottom-nav de 68px */
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--grad-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4);
    justify-content: center;
    align-items: center;
    z-index: 998;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .pos-mobile-cart-fab:active {
    transform: scale(0.9);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
  }

  .pos-mobile-cart-fab.hidden {
    display: none !important;
  }

  .fab-icon-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .fab-badge {
    position: absolute;
    top: -12px;
    right: -12px;
    background: var(--color-rose);
    color: white;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 4px;
    border: 2px solid #04070f;
  }

  /* Adaptación de Clientes y Deudas */
  .debts-grid-layout {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* --- Estilo de Bottom Sheet ('Más Opciones') --- */
  .bottom-sheet {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    visibility: hidden;
    transition: visibility 0.3s ease;
  }

  .bottom-sheet:not(.hidden) {
    visibility: visible;
  }

  .bottom-sheet-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .bottom-sheet:not(.hidden) .bottom-sheet-backdrop {
    opacity: 1;
  }

  .bottom-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 15, 30, 0.95) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 24px 20px 40px 20px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
  }

  .bottom-sheet:not(.hidden) .bottom-sheet-content {
    transform: translateY(0);
  }

  .bottom-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 12px;
  }

  .bottom-sheet-header h4 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
  }

  .bottom-sheet-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .sheet-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 12px 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
    gap: 8px;
    transition: all 0.2s ease;
  }

  .sheet-grid-item:active {
    background: rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.2);
    transform: scale(0.96);
  }

  .sheet-grid-item .sheet-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    color: var(--text-muted);
    transition: all 0.2s ease;
  }

  .sheet-grid-item:active .sheet-icon {
    color: var(--color-primary);
    background: rgba(124, 58, 237, 0.15);
  }

  .sheet-grid-item.text-danger {
    color: #ef4444;
  }
  
  .sheet-grid-item.text-danger .sheet-icon {
    color: #ef4444;
  }

  /* Transformar Modales (.modal-card) en Bottom Sheets en celulares */
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .modal-card {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 24px 24px 0 0 !important;
    border-bottom: none !important;
    padding: 24px 20px 48px 20px !important; /* Margen para teclado en pantalla */
    transform: translateY(0) !important;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  @keyframes modalSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
}

/* ==========================================
   PWA SPLASH SCREEN (ANIMACIÓN DE CARGA)
   ========================================== */
.pwa-splash-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-app-gradient);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 99999; /* Por encima de cualquier modal o barra */
  transition: opacity 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.pwa-splash-overlay.fade-out {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

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

.splash-logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
  z-index: 2;
  animation: splashPulse 2.2s infinite ease-in-out;
}

.splash-spinner-ring {
  position: absolute;
  width: 124px;
  height: 124px;
  border: 3px solid transparent;
  border-top-color: var(--color-primary-light);
  border-bottom-color: var(--color-cyan);
  border-radius: 50%;
  animation: splashSpin 1.4s infinite linear;
  z-index: 1;
}

.splash-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2.3rem;
  letter-spacing: 3px;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 8px 0;
  animation: splashFadeIn 0.8s ease-out;
}

.splash-subtitle {
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 500;
  margin: 0;
  animation: splashFadeIn 1.1s ease-out;
}

@keyframes splashPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(var(--color-primary-rgb), 0.25)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 25px rgba(var(--color-primary-rgb), 0.55)); }
}

@keyframes splashSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

/* ==========================================
   ROLES DE USUARIO: MODO CAJERO ACTIVADO
   ========================================== */
body.cajero-active .admin-only {
  display: none !important;
}

/* ==========================================
   AJUSTES RESPONSIVOS DE AUTENTICACIÓN
   ========================================== */
@media (max-height: 740px) or (max-width: 500px) {
  .auth-form-panel {
    padding: 20px 14px !important;
    align-items: flex-start !important; /* Evita recortes superiores en Flexbox */
  }
  .auth-card {
    padding: 24px 20px !important;
    margin: 10px auto !important;
  }
  .auth-header {
    margin-bottom: 12px !important;
  }
  .auth-logo img {
    height: 65px !important;
  }
  .auth-header p {
    font-size: 0.85rem !important;
  }
  .auth-form .form-group {
    margin-bottom: 10px !important;
  }
  .form-control {
    padding: 10px 14px !important;
    font-size: 0.88rem !important;
  }
  .btn-block {
    padding: 10px !important;
    font-size: 0.9rem !important;
  }
  .checkbox-group {
    margin: 10px 0 10px 0 !important;
  }
}

/* Grilla de onboarding responsive */
@media (max-width: 600px) {
  .onboarding-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  #modal-onboarding .modal-card {
    padding: 24px 16px !important;
    border-radius: 20px !important;
  }
  #modal-onboarding h2 {
    font-size: 1.5rem !important;
  }
}

/* Onboarding optimizado para pantallas cortas de PC / Portátiles */
@media (max-height: 780px) {
  #modal-onboarding .modal-card {
    padding: 16px 20px !important;
    margin: 1vh auto !important;
    max-height: 96vh !important;
  }
  #modal-onboarding h2 {
    font-size: 1.35rem !important;
    margin-bottom: 2px !important;
  }
  #modal-onboarding p {
    font-size: 0.8rem !important;
  }
  #modal-onboarding .onboarding-grid {
    margin-bottom: 12px !important;
    gap: 8px !important;
  }
  #modal-onboarding .glass {
    padding: 8px 10px !important;
  }
  #modal-onboarding .glass p {
    font-size: 0.72rem !important;
    line-height: 1.2 !important;
  }
  #modal-onboarding .glass h5 {
    font-size: 0.8rem !important;
  }
  #modal-onboarding button {
    padding: 10px !important;
    font-size: 0.85rem !important;
  }
}
