﻿/* ========================================================================
   METRONIC-INSPIRED LAYOUT - TERRAVIX v4.0
   Professional Clean Design | WCAG 2.2 AA Compliant
   ======================================================================== */

/* ========================================
   1. CSS VARIABLES & DESIGN TOKENS
   ======================================== */
:root {
  /* Color System - WCAG Compliant */
  --tvx-white: #FFFFFF;
  --tvx-gray-50: #F9FAFB;
  --tvx-gray-100: #F3F4F6;
  --tvx-gray-200: #E5E7EB;
  --tvx-gray-300: #D1D5DB;
  --tvx-gray-400: #9CA3AF;
  --tvx-gray-500: #6B7280;
  --tvx-gray-600: #4B5563;
  --tvx-gray-700: #374151;
  --tvx-gray-800: #1F2937;
  --tvx-gray-900: #111827;
  
  --tvx-primary: #008C45;
  --tvx-primary-hover: #00753A;
  --tvx-primary-light: rgba(0, 140, 69, 0.08);
  --tvx-danger: #DC2626;
  --tvx-success: #16A34A;
  --tvx-warning: #EA580C;
  
  /* Accent Colors */
  --tvx-accent-gold: #F59E0B;
  --tvx-accent-gold-light: #FEF3C7;
  
  /* Sidebar Dimensions - Professional Standards (Enterprise UX/UI) */
  --tvx-sidebar-width-expanded: 211.2px;      /* Desktop expandido (enterprise spec) */
  --tvx-sidebar-width-collapsed: 0px;       /* Desktop contraído - DESAPARECE COMPLETAMENTE */
  --tvx-sidebar-width-mobile: 88%;          /* Mobile expandido (drawer) */
  --tvx-sidebar-width-mobile-min: 256px;    /* Mobile mínimo */
  --tvx-sidebar-width-mobile-max: 304px;    /* Mobile máximo */
  --tvx-header-height: 51.2px;
  
  /* Spacing */
  --tvx-space-1: 0.25rem;
  --tvx-space-2: 0.5rem;
  --tvx-space-3: 0.75rem;
  --tvx-space-4: 1rem;
  --tvx-space-5: 1.25rem;
  --tvx-space-6: 1.5rem;
  --tvx-space-8: 2rem;
  
  /* Typography - Professional System Fonts */
  --tvx-font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tvx-font-mono: "SF Mono", "Roboto Mono", "Courier New", monospace;
  
  /* Font Sizes - Modular Scale Compacto (reducido ~6%) */
  --tvx-font-size-2xs: 0.5875rem;   /* 7.52px → ~7.2px */
  --tvx-font-size-xs: 0.6875rem;    /* 8.8px */
  --tvx-font-size-sm: 0.8125rem;    /* 10.4px */
  --tvx-font-size-base: 0.9375rem;  /* 12px */
  --tvx-font-size-md: 1.0625rem;    /* 13.6px */
  --tvx-font-size-lg: 1.1875rem;    /* 15.2px */
  --tvx-font-size-xl: 1.375rem;     /* 17.6px */
  --tvx-font-size-2xl: 1.75rem;     /* 22.4px */
  
  /* Font Weights - Precise Control */
  --tvx-font-weight-normal: 400;
  --tvx-font-weight-medium: 500;
  --tvx-font-weight-semibold: 600;
  --tvx-font-weight-bold: 700;
  
  /* Line Heights - Optimal Readability */
  --tvx-line-height-tight: 1.25;
  --tvx-line-height-normal: 1.5;
  --tvx-line-height-relaxed: 1.75;
  
  /* Letter Spacing - Professional Touch */
  --tvx-letter-spacing-tight: -0.02em;
  --tvx-letter-spacing-normal: 0;
  --tvx-letter-spacing-wide: 0.025em;
  
  /* Border Radius */
  --tvx-radius-sm: 0.375rem;
  --tvx-radius-md: 0.5rem;
  --tvx-radius-lg: 0.75rem;
  
  /* Shadows */
  --tvx-shadow-sm: 0 1px 1.6px 0 rgba(0, 0, 0, 0.05);
  --tvx-shadow-md: 0 3.2px 4.8px -1px rgba(0, 0, 0, 0.1);
  --tvx-shadow-lg: 0 8px 12px -2.4px rgba(0, 0, 0, 0.1);
  
  /* Touch Targets */
  --tvx-target-min: 35.2px;
  
  /* Transitions */
  --tvx-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --tvx-transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Z-Index Scale - Professional Stacking (actualizado para drawer) */
  --tvx-z-base: 1;
  --tvx-z-header: 40;
  --tvx-z-overlay: 50;
  --tvx-z-sidebar: 60;
  --tvx-z-dropdown: 70;
  --tvx-z-modal: 80;
  --tvx-z-toast: 90;
  --tvx-z-skip-link: 9999;
}

/* ========================================
   2. GLOBAL UTILITIES
   ======================================== */
   
/* Font Rendering Optimization */
body {
  font-family: var(--tvx-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "liga" 1, "kern" 1;
}

.u-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border-width: 0 !important;
}

.u-hide {
  display: none !important;
}

/* ========================================
   3. MAIN WRAPPER LAYOUT
   ======================================== */
.tvx-wrapper {
  display: flex;
  min-height: 100vh;
  background-color: var(--tvx-gray-50);
  font-family: var(--tvx-font-sans);
}

/* ========================================
   4. SIDEBAR VERTICAL (Metronic Style)
   ======================================== */
.tvx-sidebar {
  position: fixed;
  left: 0;
  top: var(--tvx-header-height); /* 51.2px - debajo del header */
  bottom: 0;
  width: var(--tvx-sidebar-width-expanded);
  background-color: var(--tvx-white);
  border-right: 1px solid var(--tvx-gray-200);
  display: flex;
  flex-direction: column;
  z-index: var(--tvx-z-sidebar);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
  overflow-y: auto;
}

/* Estado expandido (visible) */
.tvx-sidebar.expanded {
  transform: translateX(0);
}

/* Estado contraído (OCULTO COMPLETAMENTE en todas las resoluciones) */
.tvx-sidebar.collapsed {
  transform: translateX(-100%);
  box-shadow: none;
}

/* Desktop: Sidebar se oculta completamente igual que mobile */
@media (min-width: 1025px) {
  .tvx-sidebar {
    width: var(--tvx-sidebar-width-expanded);
  }
  
  .tvx-sidebar.expanded {
    transform: translateX(0);
    box-shadow: none;
  }
  
  .tvx-sidebar.collapsed {
    transform: translateX(-100%);
  }
}

/* Mobile/Tablet: Sidebar con overlay */
@media (max-width: 1024px) {
  .tvx-sidebar {
    width: var(--tvx-sidebar-width-mobile);
  }
  
  .tvx-sidebar.expanded {
    transform: translateX(0);
    box-shadow: var(--tvx-shadow-xl);
  }
  
  .tvx-sidebar.collapsed {
    transform: translateX(-100%);
  }
}

/* Sidebar Brand/Logo */
.tvx-sidebar__brand {
  height: var(--tvx-header-height);
  padding: var(--tvx-space-4);
  border-bottom: 1px solid var(--tvx-gray-200);
  display: flex;
  align-items: center;
}

.tvx-brand-link {
  display: flex;
  align-items: center;
  gap: var(--tvx-space-3);
  text-decoration: none;
  color: var(--tvx-gray-900);
  width: 100%;
}

.tvx-brand-link:focus-visible {
  outline: 1.6px solid var(--tvx-primary);
  outline-offset: 1.6px;
  border-radius: var(--tvx-radius-sm);
}

.tvx-brand-icon {
  flex-shrink: 0;
  width: 25.6px;
  height: 25.6px;
}

.tvx-brand-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tvx-brand-name {
  font-size: var(--tvx-font-size-sm);
  font-weight: 600;
  color: var(--tvx-gray-900);
  white-space: nowrap;
}

.tvx-brand-tagline {
  font-size: var(--tvx-font-size-2xs);
  color: var(--tvx-gray-500);
  white-space: nowrap;
}

/* Sidebar Navigation */
.tvx-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--tvx-space-4) 0;
}

.tvx-sidebar__nav::-webkit-scrollbar {
  width: 4.8px;
}

.tvx-sidebar__nav::-webkit-scrollbar-thumb {
  background-color: var(--tvx-gray-300);
  border-radius: 2.4px;
}

/* Nav Sections */
.tvx-nav-section {
  margin-bottom: var(--tvx-space-2);
}

.tvx-nav-section-title {
  display: flex;
  align-items: center;
  gap: var(--tvx-space-2);
  padding: var(--tvx-space-3) var(--tvx-space-4);
  font-size: var(--tvx-font-size-2xs);
  font-weight: 600;
  color: var(--tvx-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tvx-section-icon {
  width: 11.2px;
  height: 11.2px;
  color: var(--tvx-gray-400);
  flex-shrink: 0;
}

.tvx-section-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Nav Items */
.tvx-nav-item {
  display: flex;
  align-items: center;
  gap: var(--tvx-space-3);
  padding: var(--tvx-space-2_5) var(--tvx-space-4);
  min-height: 30.4px;
  color: var(--tvx-gray-700);
  text-decoration: none;
  transition: all var(--tvx-transition-fast);
  position: relative;
}

.tvx-nav-item:hover {
  background-color: #F1F5F9;                 /* Slate 100 - gris muy claro */
  color: #0F172A;                            /* Slate 900 - texto oscuro */
}

.tvx-nav-item:focus-visible {
  outline: 1.6px solid #008C45;                /* Blue 500 - outline azul */
  outline-offset: -1.6px;
  background-color: rgba(0, 140, 69, 0.05);                 /* Blue 50 - fondo azul claro */
}

.tvx-nav-item.active {
  background-color: rgba(0, 140, 69, 0.05);                 /* Blue 50 - fondo azul */
  color: #00753A;                            /* Blue 700 - texto azul */
  font-weight: 500;
}

.tvx-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2.4px;
  background-color: #008944;                 /* Blue 700 - barra azul */
}

.tvx-nav-icon {
  width: 14.4px;
  height: 14.4px;
  flex-shrink: 0;
  stroke-width: 2;
}

.tvx-nav-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--tvx-font-size-xs);
}

/* Sidebar collapsed state */
.tvx-sidebar.collapsed .tvx-brand-text,
.tvx-sidebar.collapsed .tvx-nav-text,
.tvx-sidebar.collapsed .tvx-section-text {
  display: none;
}

.tvx-sidebar.collapsed .tvx-nav-section-title {
  justify-content: center;
  padding: var(--tvx-space-3) var(--tvx-space-2);
}

.tvx-sidebar.collapsed .tvx-nav-item {
  justify-content: center;
  padding: var(--tvx-space-3) var(--tvx-space-2);
}

/* Sidebar Footer (espaciador) */
.tvx-sidebar__footer {
  margin-top: auto;
  height: var(--tvx-space-4);
}

/* Sidebar Toggle Button (DEPRECATED - ya no se usa) */
.tvx-sidebar__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38.4px;
  margin: var(--tvx-space-4);
  background-color: var(--tvx-white);
  border: 1px solid var(--tvx-gray-200);
  border-radius: var(--tvx-radius-md);
  color: var(--tvx-gray-600);
  cursor: pointer;
  transition: all var(--tvx-transition-fast);
}

.tvx-sidebar__toggle:hover {
  background-color: var(--tvx-gray-100);
  border-color: var(--tvx-gray-300);
  color: var(--tvx-gray-900);
}

.tvx-sidebar__toggle:focus-visible {
  outline: 1.6px solid var(--tvx-primary);
  outline-offset: 1.6px;
}

.tvx-toggle-icon {
  width: 16px;
  height: 16px;
}

/* ========================================
   5. MAIN CONTAINER (Adaptado para sidebar-enterprise.css)
   ======================================== */
.tvx-main {
  flex: 1;
  margin-left: var(--tvx-sidebar-width-expanded); /* 211.2px por defecto */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 200ms cubic-bezier(0.4, 0, 0.2, 1),
              padding-top 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Desktop & Tablet (>512px): Agregar padding-top para header enterprise sticky */
@media (min-width: 641px) {
  .tvx-main {
    padding-top: var(--tvx-ent-header-height-full); /* 51.2px - Espacio para header sticky */
  }
}

/* Desktop: Sidebar enterprise colapsado */
@media (min-width: 1025px) {
  .tvx-sidebar-enterprise.is-collapsed ~ .tvx-main {
    margin-left: var(--tvx-sidebar-width-collapsed); /* 57.6px */
  }
}

/* Mobile/Tablet: Sin margen lateral (sidebar overlay) */
@media (max-width: 1024px) {
  .tvx-main {
    margin-left: 0 !important;
  }
}

/* ========================================
   6. HEADER HORIZONTAL (Premium Professional Design)
   ======================================== */
.tvx-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--tvx-header-height);
  background-color: var(--tvx-white);
  border-bottom: 1px solid var(--tvx-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--tvx-space-6);
  gap: var(--tvx-space-6);
  z-index: var(--tvx-z-header);
  box-shadow: 0 1px 2.4px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(6.4px);
  -webkit-backdrop-filter: blur(6.4px);
}

.tvx-header__start,
.tvx-header__end {
  display: flex;
  align-items: center;
  gap: var(--tvx-space-4);
}

/* Hamburger Menu - Refined Design */
.tvx-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  padding: 6.4px;
  margin-right: var(--tvx-space-3);
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: var(--tvx-radius-md);
  cursor: pointer;
  transition: all var(--tvx-transition-fast);
  flex-shrink: 0;
}

.tvx-hamburger:hover {
  background-color: var(--tvx-gray-100);
  border-color: var(--tvx-gray-200);
}

.tvx-hamburger:focus-visible {
  outline: 1.6px solid var(--tvx-primary);
  outline-offset: 1.6px;
}

.tvx-hamburger:active {
  transform: scale(0.96);
}

.tvx-hamburger__line {
  display: block;
  width: 16px;
  height: 1.6px;
  background-color: var(--tvx-gray-700);
  border-radius: 1.6px;
  transition: all var(--tvx-transition-base);
}

.tvx-hamburger:hover .tvx-hamburger__line {
  background-color: var(--tvx-gray-900);
}

/* Logo TerraVix en Header */
.tvx-header-brand {
  display: flex;
  align-items: center;
  gap: var(--tvx-space-3);
  text-decoration: none;
  color: var(--tvx-gray-900);
  padding-right: var(--tvx-space-4);
  border-right: 1px solid var(--tvx-gray-200);
  margin-right: var(--tvx-space-2);
}

.tvx-header-brand:focus-visible {
  outline: 1.6px solid var(--tvx-primary);
  outline-offset: 1.6px;
  border-radius: var(--tvx-radius-sm);
}

.tvx-header-brand__icon {
  flex-shrink: 0;
  width: 25.6px;
  height: 25.6px;
}

.tvx-header-brand__text {
  display: flex;
  flex-direction: column;
}

.tvx-header-brand__text .tvx-brand-name {
  font-size: var(--tvx-font-size-sm);
  font-weight: var(--tvx-font-weight-semibold);
  color: var(--tvx-gray-900);
  line-height: var(--tvx-line-height-tight);
  letter-spacing: var(--tvx-letter-spacing-tight);
}

.tvx-header-brand__text .tvx-brand-tagline {
  font-size: var(--tvx-font-size-2xs);
  font-weight: var(--tvx-font-weight-normal);
  color: var(--tvx-gray-500);
  line-height: var(--tvx-line-height-tight);
  letter-spacing: var(--tvx-letter-spacing-normal);
}

/* Responsive: Ocultar texto del logo en mobile */
@media (max-width: 640px) {
  .tvx-header-brand__text {
    display: none;
  }
  
  .tvx-header-brand {
    padding-right: var(--tvx-space-3);
    margin-right: 0;
    border-right: none;
  }
}

/* ========================================
   7. CONTEXT SELECTORS (Header Left) - Diseño Compacto Profesional
   ======================================== */
.tvx-context-selectors {
  display: flex;
  align-items: center;
  gap: var(--tvx-space-2);                   /* Reducido de space-3 a space-2 */
}

.tvx-selector {
  display: flex;
  align-items: center;
  gap: var(--tvx-space-1);                   /* Reducido de space-2 a space-1 */
  background: var(--tvx-gray-50);            /* Fondo sutil */
  border: 1px solid var(--tvx-gray-200);     /* Borde delicado */
  border-radius: var(--tvx-radius-md);       /* Border radius consistente */
  padding: 4.8px 8px;                         /* Padding compacto */
  transition: all 0.2s ease;
}

.tvx-selector:hover {
  background: var(--tvx-white);
  border-color: var(--tvx-gray-300);
  box-shadow: 0 1.6px 3.2px rgba(0, 0, 0, 0.04); /* Sombra sutil al hover */
}

.tvx-selector:has(.rz-dropdown:focus),
.tvx-selector:has(.rz-dropdown:focus-within) {
  background: var(--tvx-white);
  border-color: var(--tvx-primary);
  box-shadow: 0 0 0 2.4px var(--tvx-primary-light);
}

.tvx-selector-icon {
  width: 12.8px;                               /* Reducido de 14.4px a 12.8px */
  height: 12.8px;
  color: var(--tvx-gray-500);
  flex-shrink: 0;
}

/* Radzen Dropdown Styling - Más compacto y profesional */
.tvx-dd--context {
  min-width: 120px;                          /* Reducido de 144px */
  max-width: 160px;                          /* Reducido de 192px */
  border: none !important;                   /* Sin borde (lo tiene el contenedor) */
  background: transparent !important;        /* Fondo transparente */
  font-size: 11px;                           /* Reducido de 11.2px */
  font-weight: var(--tvx-font-weight-medium);
  line-height: var(--tvx-line-height-tight);
  padding: 0 !important;                     /* Sin padding interno */
  height: 22.4px !important;                   /* Altura reducida */
  color: var(--tvx-gray-700);
}

.tvx-dd--context:focus,
.tvx-dd--context:focus-within {
  border: none !important;
  box-shadow: none !important;               /* Shadow en el contenedor, no en el dropdown */
  outline: none !important;
}

/* Placeholder más sutil */
.tvx-dd--context .rz-dropdown-placeholder {
  color: var(--tvx-gray-400);
  font-weight: var(--tvx-font-weight-normal);
}

/* ========================================
   8. HEADER ACTIONS (Header Right)
   ======================================== */
.tvx-header-actions {
  display: flex;
  align-items: center;
  gap: var(--tvx-space-2);
}

/* ========================================
   CREATE BUTTON (Primary Action - Metronic Style)
   ======================================== */
.tvx-create-btn {
  display: flex;
  align-items: center;
  gap: var(--tvx-space-2);
  height: 32px;
  padding: 0 var(--tvx-space-4);
  background-color: var(--tvx-primary);
  color: var(--tvx-white);
  border: none;
  border-radius: var(--tvx-radius-lg);
  font-size: var(--tvx-font-size-xs);
  font-weight: var(--tvx-font-weight-semibold);
  letter-spacing: var(--tvx-letter-spacing-wide);
  cursor: pointer;
  transition: all var(--tvx-transition-fast);
  box-shadow: 0 1.6px 3.2px rgba(15, 23, 42, 0.04);
}

.tvx-create-btn:hover {
  background-color: var(--tvx-primary-hover);
  box-shadow: 0 3.2px 9.6px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}

.tvx-create-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 1.6px rgba(15, 23, 42, 0.06);
}

.tvx-create-btn:focus-visible {
  outline: 1.6px solid var(--tvx-primary);
  outline-offset: 1.6px;
}

.tvx-create-icon {
  width: 14.4px;
  height: 14.4px;
  stroke-width: 2.5;
}

.tvx-create-text {
  font-weight: var(--tvx-font-weight-semibold);
  letter-spacing: var(--tvx-letter-spacing-wide);
}

/* ========================================
   QUICK ACTIONS ICONS (Modern Icon Buttons)
   ======================================== */
.tvx-quick-actions {
  display: flex;
  align-items: center;
  gap: var(--tvx-space-1);
  padding-left: var(--tvx-space-2);
  margin-left: var(--tvx-space-2);
  border-left: 1px solid var(--tvx-gray-200);
}

.tvx-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background-color: transparent;
  border: none;
  border-radius: var(--tvx-radius-md);
  color: var(--tvx-gray-600);
  cursor: pointer;
  transition: all var(--tvx-transition-fast);
}

.tvx-icon-btn:hover {
  background-color: var(--tvx-gray-100);
  color: var(--tvx-gray-900);
}

.tvx-icon-btn:focus-visible {
  outline: 1.6px solid var(--tvx-primary);
  outline-offset: 1.6px;
}

.tvx-icon-btn:active {
  transform: scale(0.95);
}

.tvx-icon-btn__svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

/* Icon Badge (for notifications count) */
.tvx-icon-badge {
  position: absolute;
  top: 4.8px;
  right: 4.8px;
  min-width: 14.4px;
  height: 14.4px;
  padding: 0 4px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: var(--tvx-white);
  font-size: var(--tvx-font-size-2xs);
  font-weight: var(--tvx-font-weight-bold);
  line-height: 14.4px;
  text-align: center;
  border-radius: 7.2px;
  border: 1.6px solid var(--tvx-white);
  box-shadow: 0 1.6px 3.2px rgba(239, 68, 68, 0.3);
}

.tvx-icon-badge--pulse {
  animation: tvx-badge-pulse 2s ease-in-out infinite;
}

@keyframes tvx-badge-pulse {
  0%, 100% {
    box-shadow: 0 1.6px 3.2px rgba(239, 68, 68, 0.3);
  }
  50% {
    box-shadow: 0 1.6px 6.4px rgba(239, 68, 68, 0.5), 0 0 0 2.4px rgba(239, 68, 68, 0.1);
  }
}

/* ========================================
   PROFILE MENU (Premium Design)
   ======================================== */
.tvx-profile-menu {
  display: flex;
  align-items: center;
  gap: var(--tvx-space-3);
  height: 35.2px;
  padding: 0 var(--tvx-space-3);
  margin-left: var(--tvx-space-2);
  background-color: var(--tvx-gray-50);
  border: 1px solid var(--tvx-gray-200);
  border-radius: var(--tvx-radius-lg);
  cursor: pointer;
  transition: all var(--tvx-transition-fast);
}

.tvx-profile-menu:hover {
  background-color: var(--tvx-gray-100);
  border-color: var(--tvx-gray-300);
  box-shadow: 0 1.6px 6.4px rgba(0, 0, 0, 0.06);
}

.tvx-profile-menu:focus-visible {
  outline: 1.6px solid var(--tvx-primary);
  outline-offset: 1.6px;
}

.tvx-profile-menu:active {
  transform: scale(0.98);
}

.tvx-profile-menu__avatar {
  width: 28.8px;
  height: 28.8px;
  background: linear-gradient(135deg, var(--tvx-primary), var(--tvx-primary-dark));
  color: var(--tvx-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.2px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 1.6px 6.4px rgba(15, 23, 42, 0.06);
  letter-spacing: 0.02em;
}

.tvx-profile-menu__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
}

.tvx-profile-menu__name {
  font-size: var(--tvx-font-size-xs);
  font-weight: var(--tvx-font-weight-semibold);
  color: var(--tvx-gray-900);
  line-height: var(--tvx-line-height-tight);
  letter-spacing: var(--tvx-letter-spacing-normal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 128px;
}

.tvx-profile-menu__role {
  font-size: var(--tvx-font-size-2xs);
  font-weight: var(--tvx-font-weight-medium);
  color: var(--tvx-gray-500);
  line-height: var(--tvx-line-height-tight);
  letter-spacing: var(--tvx-letter-spacing-normal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 128px;
}

.tvx-profile-menu__chevron {
  width: 12.8px;
  height: 12.8px;
  color: var(--tvx-gray-400);
  flex-shrink: 0;
  transition: transform var(--tvx-transition-fast);
}

.tvx-profile-menu:hover .tvx-profile-menu__chevron {
  color: var(--tvx-gray-600);
  transform: translateY(1px);
}

/* ========================================
   10. CONTENT AREA
   ======================================== */
.tvx-content {
  flex: 1;
  background-color: var(--tvx-gray-50);
}

.tvx-content__inner {
  padding: var(--tvx-space-4);
  width: 100%;
  box-sizing: border-box;
}

/* ========================================
   11. SKIP LINK (WCAG 2.4.1)
   ======================================== */
.tvx-skip-link {
  position: fixed;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--tvx-z-skip-link);
  padding: var(--tvx-space-3) var(--tvx-space-6);
  background-color: var(--tvx-primary);
  color: var(--tvx-white);
  font-size: var(--tvx-font-size-sm);
  font-weight: 600;
  border-radius: var(--tvx-radius-md);
  text-decoration: none;
  box-shadow: var(--tvx-shadow-lg);
  transition: top var(--tvx-transition-fast);
}

.tvx-skip-link:focus {
  top: var(--tvx-space-4);
  outline: 1.6px solid var(--tvx-white);
  outline-offset: 1.6px;
}

/* ========================================
   12. MOBILE OVERLAY (Professional Backdrop)
   ======================================== */
.tvx-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(17, 24, 39, 0.6);
  z-index: calc(var(--tvx-z-sidebar) - 1);
  backdrop-filter: blur(3.2px);
  cursor: pointer;
  animation: tvx-overlay-fade-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: none; /* Oculto por defecto */
}

/* Desktop: Sin overlay (sidebar no tapa contenido) */
@media (min-width: 1025px) {
  .tvx-overlay {
    display: none !important;
  }
}

/* Mobile/Tablet: Mostrar overlay cuando sidebar abierto */
@media (max-width: 1024px) {
  .tvx-overlay {
    display: block;
  }
}

@keyframes tvx-overlay-fade-in {
  from {
    opacity: 0;
    backdrop-filter: blur(0);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(3.2px);
  }
}

/* ========================================
   13. RESPONSIVE DESIGN
   ======================================== */

/* Tablet & Mobile */
@media (max-width: 1024px) {
  .tvx-main {
    margin-left: 0;
  }
  
  .tvx-header {
    padding: 0 var(--tvx-space-4);
  }
  
  .tvx-content__inner {
    padding: var(--tvx-space-4);
  }
}

/* Mobile Only */
@media (max-width: 768px) {
  .tvx-header {
    gap: var(--tvx-space-3);
    padding: 0 var(--tvx-space-3);
  }
  
  .tvx-context-selectors {
    gap: var(--tvx-space-2);
  }
  
  .tvx-dd--context {
    min-width: 112px;
    max-width: 144px;
  }
  
  .tvx-profile-info {
    display: none;
  }
  
  .tvx-profile-chevron {
    display: none;
  }
  
  .tvx-content__inner {
    padding: var(--tvx-space-3);
  }
}

/* ========================================
   14. ACCESSIBILITY FEATURES
   ======================================== */

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .tvx-nav-item:focus-visible,
  .tvx-action-btn:focus-visible,
  .tvx-profile-btn:focus-visible {
    outline: 2.4px solid currentColor;
    outline-offset: 1.6px;
  }
}

/* Print Styles */
@media print {
  .tvx-sidebar,
  .tvx-header-actions,
  .tvx-skip-link,
  .tvx-overlay {
    display: none !important;
  }
  
  .tvx-main {
    margin-left: 0 !important;
  }
  
  .tvx-content {
    background-color: var(--tvx-white) !important;
  }
}

/* ============================================================================
   ENHANCED COMPONENTS - WORLD-CLASS UX/UI PATTERNS
   ============================================================================ */

/* ========================================
   HAMBURGER MENU (Header)
   Professional animated hamburger for all breakpoints
   ======================================== */
.tvx-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: var(--tvx-target-min);
  height: var(--tvx-target-min);
  padding: 0;
  background-color: transparent;
  border: none;
  border-radius: var(--tvx-radius-md);
  cursor: pointer;
  transition: background-color var(--tvx-transition-fast);
}

.tvx-hamburger:hover {
  background-color: var(--tvx-gray-100);
}

.tvx-hamburger:focus-visible {
  outline: 1.6px solid var(--tvx-primary);
  outline-offset: 1.6px;
}

.tvx-hamburger:active {
  background-color: var(--tvx-gray-200);
  transform: scale(0.95);
}

.tvx-hamburger__line {
  display: block;
  width: 16px;
  height: 1.6px;
  background-color: var(--tvx-gray-700);
  border-radius: 1.6px;
  transition: all var(--tvx-transition-base);
}

.tvx-hamburger:hover .tvx-hamburger__line {
  background-color: var(--tvx-primary);
}

/* Desktop Sidebar Toggle (Bottom) */
.tvx-sidebar__toggle-desktop {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--tvx-target-min);
  padding: var(--tvx-space-3);
  margin-top: auto;
  background-color: transparent;
  border: none;
  border-top: 1px solid var(--tvx-gray-200);
  color: var(--tvx-gray-600);
  cursor: pointer;
  transition: all var(--tvx-transition-fast);
}

.tvx-sidebar__toggle-desktop:hover {
  background-color: var(--tvx-gray-100);
  color: var(--tvx-primary);
}

.tvx-sidebar__toggle-desktop:focus-visible {
  outline: 1.6px solid var(--tvx-primary);
  outline-offset: -1.6px;
}

.tvx-toggle-icon {
  width: 16px;
  height: 16px;
  transition: transform var(--tvx-transition-base);
}

/* ========================================
   FAVORITES SECTION - Enhanced
   Collapsible favorites with smooth animations
   ======================================== */
.tvx-favorites {
  position: relative;
}

.tvx-favorites__toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--tvx-space-2);
  width: calc(100% - 2 * var(--tvx-space-2));
  min-height: 32px;
  padding: 0.625rem var(--tvx-space-3);
  margin: var(--tvx-space-1) var(--tvx-space-2) 1px var(--tvx-space-2);
  background-color: transparent;
  border: none;
  border-radius: var(--tvx-radius-sm);
  color: var(--tvx-gray-600);
  font-size: 0.875rem;
  font-weight: 400;
  cursor: pointer;
  transition: all var(--tvx-transition-fast);
  text-align: left;
}

.tvx-favorites__toggle:hover {
  background-color: #F1F5F9;                 /* Slate 100 - hover gris suave */
  color: #00753A;                            /* Blue 700 - azul profesional */
}

.tvx-favorites__toggle:focus-visible {
  outline: 1.6px solid var(--tvx-primary);
  outline-offset: 1.6px;
}

.tvx-favorites__toggle-icon {
  width: 12.8px;
  height: 12.8px;
  flex-shrink: 0;
  transition: transform var(--tvx-transition-base);
  opacity: 0.6;
}

.tvx-favorites__toggle:hover .tvx-favorites__toggle-icon {
  opacity: 1;
}

.tvx-favorites__toggle[aria-expanded="true"] .tvx-favorites__toggle-icon {
  transform: rotate(180deg);
}

.tvx-favorites__toggle-text {
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

/* Favorite Star Icon Enhancement */
.tvx-favorite-star {
  width: 14.4px;
  height: 14.4px;
  flex-shrink: 0;
  transition: all var(--tvx-transition-fast);
}

.tvx-favorite-star--filled {
  fill: var(--tvx-accent-gold);
  stroke: var(--tvx-accent-gold);
}

.tvx-favorite-star--outline {
  fill: none;
  stroke: var(--tvx-gray-400);
}

.tvx-nav-item:hover .tvx-favorite-star--outline {
  stroke: var(--tvx-accent-gold);
  transform: scale(1.1);
}

.tvx-nav-item:hover .tvx-favorite-star--filled {
  transform: scale(1.1);
  filter: brightness(1.1);
}

/* ========================================
   RESPONSIVE BEHAVIOR ENHANCEMENTS
   ======================================== */

/* Tablet & Below */
@media (max-width: 1024px) {
  .tvx-hamburger {
    display: flex;
  }
  
  .tvx-sidebar__toggle-desktop {
    display: none;
  }
  
  .tvx-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  
  .tvx-sidebar.expanded {
    transform: translateX(0);
    box-shadow: var(--tvx-shadow-lg);
  }
}

/* Desktop - HAMBURGUESA SIEMPRE VISIBLE */
@media (min-width: 1025px) {
  .tvx-hamburger {
    display: flex;  /* ✓ VISIBLE en desktop para ocultar sidebar completamente */
  }
  
  .tvx-sidebar__toggle-desktop {
    display: none;  /* Ocultar el toggle antiguo de desktop */
  }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .tvx-hamburger__line {
    width: 14.4px;
  }
  
  .tvx-context-selectors {
    gap: var(--tvx-space-2);
  }
  
  .tvx-selector {
    min-width: 96px;
  }
  
  .tvx-favorites__toggle-text {
    font-size: var(--tvx-font-size-xs);
  }
  
  /* Header Actions - Mobile adjustments */
  .tvx-create-btn .tvx-create-text {
    display: none; /* Solo mostrar icono en mobile */
  }
  
  .tvx-create-btn {
    padding: 0 var(--tvx-space-3);
    min-width: 32px;
  }
  
  .tvx-quick-actions {
    gap: 0;
    padding-left: var(--tvx-space-1);
    margin-left: var(--tvx-space-1);
  }
  
  .tvx-icon-btn {
    width: 28.8px;
    height: 28.8px;
  }
  
  .tvx-profile-menu__info {
    display: none; /* Ocultar nombre y rol en mobile */
  }
  
  .tvx-profile-menu {
    padding: 0 var(--tvx-space-2);
    margin-left: var(--tvx-space-1);
  }
  
  .tvx-profile-menu__chevron {
    display: none; /* Ocultar chevron en mobile */
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .tvx-profile-menu__name {
    max-width: 96px;
  }
  
  .tvx-profile-menu__role {
    max-width: 96px;
  }
  
  .tvx-quick-actions button:nth-child(1),
  .tvx-quick-actions button:nth-child(2) {
    display: none; /* Ocultar algunos iconos en tablet */
  }
}

/* ========================================
   MICRO-INTERACTIONS & POLISH
   ======================================== */

/* Smooth hover states */
.tvx-nav-item,
.tvx-action-btn,
.tvx-profile-btn {
  position: relative;
  overflow: hidden;
}

.tvx-nav-item::after,
.tvx-action-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background-color: rgba(0, 140, 69, 0.1);
  transform: translate(-50%, -50%);
  transition: width var(--tvx-transition-base), height var(--tvx-transition-base);
}

.tvx-nav-item:hover::after,
.tvx-action-btn:hover::after {
  width: 200%;
  height: 200%;
}

/* Badge pulse animation */
@keyframes tvx-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.tvx-action-badge {
  animation: tvx-pulse 2s ease-in-out infinite;
}

/* Sidebar expand/collapse animation refinement */
.tvx-sidebar {
  will-change: width;
}

.tvx-sidebar.collapsed .tvx-brand-text,
.tvx-sidebar.collapsed .tvx-nav-text,
.tvx-sidebar.collapsed .tvx-section-text,
.tvx-sidebar.collapsed .tvx-favorites__toggle-text {
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity var(--tvx-transition-fast), transform var(--tvx-transition-fast);
}

.tvx-sidebar.expanded .tvx-brand-text,
.tvx-sidebar.expanded .tvx-nav-text,
.tvx-sidebar.expanded .tvx-section-text,
.tvx-sidebar.expanded .tvx-favorites__toggle-text {
  opacity: 1;
  transform: translateX(0);
  transition: opacity var(--tvx-transition-base) 100ms, transform var(--tvx-transition-base) 100ms;
}

/* Enhanced focus states for keyboard navigation */
.tvx-nav-item:focus-visible {
  box-shadow: inset 0 0 0 1.6px var(--tvx-primary);
  z-index: 1;
}

/* Loading skeleton for async content */
@keyframes tvx-skeleton-pulse {
  0%, 100% {
    background-color: var(--tvx-gray-200);
  }
  50% {
    background-color: var(--tvx-gray-300);
  }
}

.tvx-skeleton {
  animation: tvx-skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--tvx-radius-sm);
}

/* ========================================
   LOADING SCREEN (Initial App Load)
   ======================================== */
.tvx-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--tvx-gray-50) 0%, var(--tvx-white) 100%);
  gap: var(--tvx-space-6);
}

.tvx-loading__spinner {
  width: 51.2px;
  height: 51.2px;
  border: 3.2px solid var(--tvx-gray-200);
  border-top-color: var(--tvx-primary);
  border-radius: 50%;
  animation: tvx-spin 0.8s linear infinite;
}

@keyframes tvx-spin {
  to {
    transform: rotate(360deg);
  }
}

.tvx-loading__text {
  font-size: var(--tvx-font-size-lg);
  font-weight: 500;
  color: var(--tvx-gray-600);
  margin: 0;
  animation: tvx-fade-pulse 2s ease-in-out infinite;
}

@keyframes tvx-fade-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ========================================
   RADZEN NOTIFICATIONS - MINIMALISTA CLEAN
   ======================================== */

/* Override Radzen notification styles */
.rz-notification-container {
  position: fixed;
  top: 64px;
  right: var(--tvx-space-6);
  z-index: var(--tvx-z-modal);
  display: flex;
  flex-direction: column;
  gap: var(--tvx-space-3);
  max-width: 336px;
  width: 100%;
  pointer-events: none;
}

/* Ocultar contenedor cuando esté vacío */
.rz-notification-container:empty {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.rz-notification {
  pointer-events: all;
  display: flex;
  align-items: flex-start;
  gap: var(--tvx-space-3);
  padding: var(--tvx-space-4);
  background-color: var(--tvx-white);
  border-radius: var(--tvx-radius-lg);
  border-left: 3.2px solid;
  box-shadow: 0 6.4px 19.2px rgba(0, 0, 0, 0.12), 
              0 1.6px 6.4px rgba(0, 0, 0, 0.08);
  animation: tvx-notification-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all var(--tvx-transition-base);
  backdrop-filter: blur(6.4px);
  -webkit-backdrop-filter: blur(6.4px);
}

@keyframes tvx-notification-slide-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.rz-notification:hover {
  box-shadow: 0 9.6px 25.6px rgba(0, 0, 0, 0.16), 
              0 3.2px 9.6px rgba(0, 0, 0, 0.12);
  transform: translateY(-1.6px);
}

/* Success - Verde minimalista */
.rz-notification.rz-severity-success {
  border-left-color: #10B981;
  background-color: #F0FDF4;
}

.rz-notification.rz-severity-success .rz-notification-icon {
  color: #10B981;
}

/* Error - Rojo sobrio */
.rz-notification.rz-severity-error {
  border-left-color: #EF4444;
  background-color: #FEF2F2;
}

.rz-notification.rz-severity-error .rz-notification-icon {
  color: #EF4444;
}

/* Warning - Naranja suave */
.rz-notification.rz-severity-warning {
  border-left-color: #F59E0B;
  background-color: #FFFBEB;
}

.rz-notification.rz-severity-warning .rz-notification-icon {
  color: #F59E0B;
}

/* Info - Azul limpio */
.rz-notification.rz-severity-info {
  border-left-color: var(--tvx-primary);
  background-color: rgba(0, 140, 69, 0.05);
}

.rz-notification.rz-severity-info .rz-notification-icon {
  color: var(--tvx-primary);
}

/* Icon styling */
.rz-notification-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14.4px;
}

/* Content */
.rz-notification-content {
  flex: 1;
  min-width: 0;
}

.rz-notification-summary {
  font-size: var(--tvx-font-size-xs);
  font-weight: var(--tvx-font-weight-semibold);
  color: var(--tvx-gray-900);
  margin-bottom: var(--tvx-space-1);
  line-height: var(--tvx-line-height-tight);
}

.rz-notification-detail {
  font-size: var(--tvx-font-size-xs);
  font-weight: var(--tvx-font-weight-normal);
  color: var(--tvx-gray-600);
  line-height: var(--tvx-line-height-normal);
}

/* Close button */
.rz-notification-close {
  flex-shrink: 0;
  width: 19.2px;
  height: 19.2px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border: none;
  border-radius: var(--tvx-radius-sm);
  color: var(--tvx-gray-400);
  cursor: pointer;
  transition: all var(--tvx-transition-fast);
  padding: 0;
  margin-left: var(--tvx-space-2);
}

.rz-notification-close:hover {
  background-color: var(--tvx-gray-100);
  color: var(--tvx-gray-700);
}

.rz-notification-close:active {
  transform: scale(0.95);
}

/* Responsive */
@media (max-width: 640px) {
  .rz-notification-container {
    top: 57.6px;
    right: var(--tvx-space-4);
    left: var(--tvx-space-4);
    max-width: none;
  }
  
  .rz-notification {
    padding: var(--tvx-space-3);
  }
  
  .rz-notification-summary,
  .rz-notification-detail {
    font-size: var(--tvx-font-size-xs);
  }
}

/* ========================================
   RADZEN DIALOG - MINIMALISTA CLEAN
   ======================================== */



/* Dialog container */
.rz-dialog {
  background-color: var(--tvx-white);
  border-radius: var(--tvx-radius-lg);
  box-shadow: 0 16px 38.4px rgba(0, 0, 0, 0.16), 
              0 6.4px 12.8px rgba(0, 0, 0, 0.12);
  border: none;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  animation: tvx-dialog-fade-in 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes tvx-dialog-fade-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Dialog header */
.rz-dialog-title,
.rz-dialog-titlebar {
  padding: var(--tvx-space-5) var(--tvx-space-6);
  border-bottom: 1px solid var(--tvx-gray-200);
  font-size: var(--tvx-font-size-base);
  font-weight: var(--tvx-font-weight-semibold);
  color: var(--tvx-gray-900);
  line-height: var(--tvx-line-height-tight);
  background-color: var(--tvx-gray-50);
}

/* Dialog close button */
.rz-dialog-titlebar-close {
  width: 25.6px;
  height: 25.6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border: none;
  border-radius: var(--tvx-radius-md);
  color: var(--tvx-gray-500);
  cursor: pointer;
  transition: all var(--tvx-transition-fast);
}

.rz-dialog-titlebar-close:hover {
  background-color: var(--tvx-gray-200);
  color: var(--tvx-gray-900);
}

.rz-dialog-titlebar-close:active {
  transform: scale(0.95);
}

/* Dialog content */
.rz-dialog-content {
  padding: var(--tvx-space-6);
  font-size: var(--tvx-font-size-xs);
  color: var(--tvx-gray-700);
  line-height: var(--tvx-line-height-normal);
}

/* ========================================
   RADZEN TOOLTIP - MINIMALISTA CLEAN
   ======================================== */

.rz-tooltip {
  background-color: var(--tvx-gray-900);
  color: var(--tvx-white);
  padding: var(--tvx-space-2) var(--tvx-space-3);
  border-radius: var(--tvx-radius-md);
  font-size: var(--tvx-font-size-xs);
  font-weight: var(--tvx-font-weight-medium);
  line-height: var(--tvx-line-height-tight);
  box-shadow: 0 3.2px 9.6px rgba(0, 0, 0, 0.15);
  max-width: 240px;
  z-index: var(--tvx-z-modal);
  animation: tvx-tooltip-fade-in 0.15s ease-out;
}

@keyframes tvx-tooltip-fade-in {
  from {
    opacity: 0;
    transform: translateY(-3.2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
