/* ══════════════════════════════════════════════════════════
   COTIZADOR DE BODAS · HACIENDA SAN MIGUEL QUERÉTARO
   Sistema de Diseño Premium · Complemento v4.0.0
   8 Abril 2026
   ══════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════
   TOKENS EXTENDIDOS - Paleta Premium Actualizada
══════════════════════════════════════════════════════════ */

:root {
  /* ── Paleta Premium (Bodas de Alta Gama) ── */
  --premium-brown:     #8B4513;
  --premium-brown-dk:  #A0522D;
  --premium-brown-lt:  #D2691E;
  
  --premium-neutral-bg:  #F8F6F3;
  --premium-neutral-sec: #E8E6E3;
  --premium-text-main:   #1A1A1A;
  --premium-text-sec:    #2D2D2D;
  
  /* ── Estados específicos del negocio ── */
  --estado-borrador:    #6B7280;
  --estado-revision:    #DDA520;
  --estado-aprobada:    #2D5016;
  --estado-rechazada:   #8B0000;
  --estado-cancelada:   #DC2626;
  --estado-pendiente:   #CD853F;
  --estado-vigente:     #047857;
  --estado-vencido:     #78350F;
  
  /* ── Prioridades (Aprobaciones) ── */
  --prioridad-urgente:  #DC2626;
  --prioridad-alta:     #F59E0B;
  --prioridad-media:    #3B82F6;
  --prioridad-baja:     #6B7280;
  
  /* ── Espaciado consistente (base 8px) ── */
  --sp-xxs: 4px;
  --sp-xs:  8px;
  --sp-sm:  12px;
  --sp-md:  16px;
  --sp-lg:  24px;
  --sp-xl:  32px;
  --sp-2xl: 48px;
  --sp-3xl: 64px;
  
  /* ── Tipografía específica ── */
  --fs-h1: 36px;
  --fs-h2: 28px;
  --fs-h3: 22px;
  --fs-h4: 18px;
  --fs-body: 16px;
  --fs-regular: 14px;
  --fs-small: 12px;
  --fs-caption: 11px;
  
  /* ── Z-index layers ── */
  --z-base:     1;
  --z-dropdown: 1000;
  --z-sticky:   1020;
  --z-fixed:    1030;
  --z-modal:    1040;
  --z-popover:  1050;
  --z-tooltip:  1060;
  --z-toast:    1070;
  
  /* ── Breakpoints (para JS) ── */
  --bp-mobile:  640px;
  --bp-tablet:  1024px;
  --bp-desktop: 1440px;
}

/* ══════════════════════════════════════════════════════════
   COMPONENTES PREMIUM - Badges de Estado
══════════════════════════════════════════════════════════ */

.badge-estado {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-estado-borrador {
  background: #F3F4F6;
  color: var(--estado-borrador);
  border: 1px solid #D1D5DB;
}

.badge-estado-en_revision {
  background: #FFF8E6;
  color: var(--estado-revision);
  border: 1px solid #FDE68A;
}

.badge-estado-aprobada {
  background: #ECFDF5;
  color: var(--estado-aprobada);
  border: 1px solid #A7F3D0;
}

.badge-estado-rechazada,
.badge-estado-cancelada {
  background: #FEF2F2;
  color: var(--estado-rechazada);
  border: 1px solid #FECACA;
}

.badge-estado-pendiente {
  background: #FFF8E6;
  color: var(--estado-pendiente);
  border: 1px solid #FDE68A;
}

.badge-estado-vigente {
  background: #D1FAE5;
  color: var(--estado-vigente);
  border: 1px solid #6EE7B7;
}

.badge-estado-vencido {
  background: #FEF3C7;
  color: var(--estado-vencido);
  border: 1px solid #FCD34D;
}

/* ── Badge de Prioridad ── */
.badge-prioridad {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-prioridad-urgente {
  background: #FEE2E2;
  color: var(--prioridad-urgente);
  border: 1px solid #FCA5A5;
}

.badge-prioridad-alta {
  background: #FEF3C7;
  color: var(--prioridad-alta);
  border: 1px solid #FCD34D;
}

.badge-prioridad-media {
  background: #DBEAFE;
  color: var(--prioridad-media);
  border: 1px solid #93C5FD;
}

.badge-prioridad-baja {
  background: #F3F4F6;
  color: var(--prioridad-baja);
  border: 1px solid #D1D5DB;
}

/* ══════════════════════════════════════════════════════════
   CARDS PREMIUM - Variantes Consistentes
══════════════════════════════════════════════════════════ */

.card-premium {
  background: white;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  padding: var(--sp-lg);
  transition: all var(--tr-base);
}

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

.card-premium-elevated {
  background: white;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  padding: var(--sp-xl);
}

.card-premium-outline {
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  transition: all var(--tr-base);
}

.card-premium-outline:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--sh-brand);
}

/* ── Card Header ── */
.card-header-premium {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-lg);
  padding-bottom: var(--sp-md);
  border-bottom: 2px solid var(--gray-150);
}

.card-title-premium {
  font-family: var(--ff-serif);
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
}

.card-subtitle-premium {
  font-size: var(--fs-small);
  color: var(--gray-500);
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════
   TIMELINE COMPONENT - Para Historial y Auditoría
══════════════════════════════════════════════════════════ */

.timeline-premium {
  position: relative;
  padding-left: var(--sp-xl);
}

.timeline-premium::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--gray-300), transparent);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--sp-lg);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--brand-primary);
  z-index: var(--z-base);
}

.timeline-marker.success {
  border-color: var(--success);
}

.timeline-marker.warning {
  border-color: var(--warning);
}

.timeline-marker.danger {
  border-color: var(--danger);
}

.timeline-content {
  background: white;
  padding: var(--sp-md);
  border-radius: var(--r-md);
  border-left: 3px solid var(--brand-primary);
  box-shadow: var(--sh-xs);
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-xs);
}

.timeline-title {
  font-weight: 600;
  color: var(--gray-900);
  font-size: var(--fs-regular);
}

.timeline-date {
  font-size: var(--fs-small);
  color: var(--gray-500);
}

.timeline-body {
  font-size: var(--fs-regular);
  color: var(--gray-600);
  line-height: 1.5;
}

.timeline-meta {
  display: flex;
  gap: var(--sp-sm);
  margin-top: var(--sp-xs);
  font-size: var(--fs-small);
  color: var(--gray-500);
}

/* ══════════════════════════════════════════════════════════
   STATS & KPI CARDS - Dashboard Premium
══════════════════════════════════════════════════════════ */

.kpi-card {
  background: white;
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  box-shadow: var(--sh-sm);
  position: relative;
  overflow: hidden;
  transition: all var(--tr-base);
}

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

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-gold));
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-md);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: linear-gradient(135deg, var(--brand-primary-xs), white);
  color: var(--brand-primary);
}

.kpi-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-small);
  font-weight: 600;
}

.kpi-trend.up {
  color: var(--success);
}

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

.kpi-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
  margin-bottom: var(--sp-xs);
}

.kpi-label {
  font-size: var(--fs-small);
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.kpi-footer {
  margin-top: var(--sp-md);
  padding-top: var(--sp-md);
  border-top: 1px solid var(--gray-150);
  font-size: var(--fs-small);
  color: var(--gray-600);
}

/* ══════════════════════════════════════════════════════════
   TABLES PREMIUM - Estilos Mejorados
══════════════════════════════════════════════════════════ */

.table-premium {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-xs);
}

.table-premium thead {
  background: linear-gradient(to bottom, var(--gray-50), var(--gray-100));
}

.table-premium th {
  padding: var(--sp-md) var(--sp-lg);
  text-align: left;
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--gray-200);
}

.table-premium td {
  padding: var(--sp-md) var(--sp-lg);
  font-size: var(--fs-regular);
  color: var(--gray-800);
  border-bottom: 1px solid var(--gray-150);
}

.table-premium tbody tr {
  transition: background-color var(--tr-fast);
}

.table-premium tbody tr:hover {
  background-color: var(--gray-50);
}

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

/* ── Columnas especiales ── */
.table-premium .col-actions {
  text-align: right;
  white-space: nowrap;
}

.table-premium .col-numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table-premium .col-center {
  text-align: center;
}

/* ══════════════════════════════════════════════════════════
   EMPTY STATES - Consistentes y Elegantes
══════════════════════════════════════════════════════════ */

.empty-state-premium {
  text-align: center;
  padding: var(--sp-3xl) var(--sp-lg);
  background: white;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}

.empty-state-icon-premium {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--sp-lg);
  background: linear-gradient(135deg, var(--gray-100), var(--gray-50));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--gray-400);
}

.empty-state-title-premium {
  font-family: var(--ff-serif);
  font-size: var(--fs-h3);
  color: var(--gray-800);
  margin-bottom: var(--sp-sm);
}

.empty-state-desc-premium {
  font-size: var(--fs-regular);
  color: var(--gray-500);
  max-width: 400px;
  margin: 0 auto var(--sp-lg);
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════
   FILTERS & SEARCH BAR - Diseño Cohesivo
══════════════════════════════════════════════════════════ */

.filters-bar-premium {
  background: white;
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-lg);
  box-shadow: var(--sh-xs);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-md);
  align-items: flex-end;
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-label {
  display: block;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.search-input-premium {
  width: 100%;
  padding: var(--sp-sm) var(--sp-md);
  border: 2px solid var(--gray-200);
  border-radius: var(--r-md);
  font-size: var(--fs-regular);
  transition: all var(--tr-fast);
}

.search-input-premium:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-xs);
}

.search-input-premium::placeholder {
  color: var(--gray-400);
}

/* ══════════════════════════════════════════════════════════
   ALERTS & NOTIFICATIONS - Sistema Unificado
══════════════════════════════════════════════════════════ */

.alert-premium {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  border-radius: var(--r-md);
  border-left: 4px solid;
  margin-bottom: var(--sp-md);
  font-size: var(--fs-regular);
}

.alert-premium-success {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.alert-premium-warning {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: var(--warning);
}

.alert-premium-danger {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

.alert-premium-info {
  background: var(--info-bg);
  border-color: var(--info);
  color: var(--info);
}

.alert-premium-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-premium-content {
  flex: 1;
}

.alert-premium-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.alert-premium-message {
  opacity: 0.9;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════
   MODALS PREMIUM - Diseño Consistente
══════════════════════════════════════════════════════════ */

.modal-overlay-premium {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  animation: fadeInModal 0.2s ease;
}

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

.modal-container-premium {
  background: white;
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  max-width: 800px;
  max-height: 90vh;
  width: 90%;
  overflow: hidden;
  animation: slideUpModal 0.3s ease;
}

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

.modal-header-premium {
  padding: var(--sp-xl);
  border-bottom: 2px solid var(--gray-150);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-premium {
  font-family: var(--ff-serif);
  font-size: var(--fs-h2);
  color: var(--gray-900);
  margin: 0;
}

.modal-body-premium {
  padding: var(--sp-xl);
  max-height: 60vh;
  overflow-y: auto;
}

.modal-footer-premium {
  padding: var(--sp-lg) var(--sp-xl);
  border-top: 2px solid var(--gray-150);
  display: flex;
  gap: var(--sp-md);
  justify-content: flex-end;
  background: var(--gray-50);
}

/* ══════════════════════════════════════════════════════════
   BUTTONS PREMIUM - Variantes Extendidas
══════════════════════════════════════════════════════════ */

.btn-premium {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xs);
  padding: var(--sp-sm) var(--sp-lg);
  border-radius: var(--r-md);
  font-size: var(--fs-regular);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--tr-fast);
  border: none;
  outline: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-premium:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-premium-primary {
  background: var(--brand-primary);
  color: white;
}

.btn-premium-primary:hover {
  background: var(--brand-primary-dk);
  transform: translateY(-1px);
  box-shadow: var(--sh-brand);
}

.btn-premium-secondary {
  background: var(--gray-200);
  color: var(--gray-800);
}

.btn-premium-secondary:hover {
  background: var(--gray-300);
}

.btn-premium-success {
  background: var(--success);
  color: white;
}

.btn-premium-success:hover {
  background: #25663F;
  box-shadow: 0 4px 16px rgba(46, 125, 82, 0.3);
}

.btn-premium-danger {
  background: var(--danger);
  color: white;
}

.btn-premium-danger:hover {
  background: #991B1B;
  box-shadow: 0 4px 16px rgba(185, 28, 28, 0.3);
}

.btn-premium-ghost {
  background: transparent;
  color: var(--brand-primary);
  border: 2px solid var(--brand-primary);
}

.btn-premium-ghost:hover {
  background: var(--brand-primary-xs);
}

/* ── Tamaños ── */
.btn-premium-sm {
  padding: 6px 14px;
  font-size: var(--fs-small);
}

.btn-premium-lg {
  padding: var(--sp-md) var(--sp-xl);
  font-size: var(--fs-body);
}

/* ══════════════════════════════════════════════════════════
   LOADING STATES - Skeleton & Spinners
══════════════════════════════════════════════════════════ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-150) 25%,
    var(--gray-100) 50%,
    var(--gray-150) 75%
  );
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s ease-in-out infinite;
  border-radius: var(--r-sm);
}

@keyframes skeletonLoading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--sp-xs);
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: var(--sp-md);
}

.skeleton-card {
  height: 120px;
  border-radius: var(--r-lg);
}

/* ── Spinner ── */
.spinner-premium {
  width: 40px;
  height: 40px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spinnerRotate 0.8s linear infinite;
}

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

.spinner-small {
  width: 20px;
  height: 20px;
  border-width: 3px;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE UTILITIES
══════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .hide-mobile {
    display: none !important;
  }
  
  .filters-bar-premium {
    flex-direction: column;
  }
  
  .filter-group {
    width: 100%;
    min-width: unset;
  }
  
  .kpi-value {
    font-size: 24px;
  }
  
  .table-premium {
    font-size: var(--fs-small);
  }
  
  .table-premium th,
  .table-premium td {
    padding: var(--sp-sm) var(--sp-md);
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .hide-tablet {
    display: none !important;
  }
}

@media (min-width: 1025px) {
  .hide-desktop {
    display: none !important;
  }
}

/* ══════════════════════════════════════════════════════════
   PRINT STYLES
══════════════════════════════════════════════════════════ */

@media print {
  .no-print {
    display: none !important;
  }
  
  .card-premium,
  .table-premium {
    box-shadow: none;
    border: 1px solid var(--gray-300);
  }
  
  body {
    background: white;
  }
}

/* ══════════════════════════════════════════════════════════
   ACCESSIBILITY ENHANCEMENTS
══════════════════════════════════════════════════════════ */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.focus-visible {
  outline: 3px solid var(--brand-primary);
  outline-offset: 2px;
}

/* ── Reduce motion para usuarios con preferencia ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
