/* ============================================
   EPIRIONS - SISTEMA DE DISEÑO APP INTERNA
   Estilo unificado con la Landing Page
   ============================================ */

:root {
  /* Colores principales */
  --white: #ffffff;
  --black: #0a0a0f;
  
  /* Grises */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  /* Púrpuras (color principal) */
  --purple-50: #faf5ff;
  --purple-100: #ede9fe;
  --purple-200: #ddd6fe;
  --purple-300: #c4b5fd;
  --purple-400: #a78bfa;
  --purple-500: #E91E8C;
  --purple-600: #7c3aed;
  
  /* Rosas */
  --pink-100: #fce7f3;
  --pink-400: #f472b6;
  --pink-500: #ec4899;
  
  /* Azules */
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  
  /* Otros colores */
  --green-500: #22c55e;
  --orange-500: #f97316;
  --red-500: #ef4444;
  
  /* Gradientes */
  --gradient-primary: linear-gradient(135deg, #E91E8C 0%, #4361EE 100%);
  --gradient-purple: linear-gradient(135deg, #E91E8C 0%, #7B2FD4 100%);
  --gradient-card: linear-gradient(135deg, rgba(233, 30, 140, 0.03) 0%, rgba(67, 97, 238, 0.03) 100%);
  
  /* Compatibilidad */
  --primary: #0f172a;
  --accent: #E91E8C;
  --accent-light: #ff3ea8;
  --accent-bg: rgba(233, 30, 140, 0.1);
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --warning: #f97316;
  --warning-bg: rgba(249, 115, 22, 0.1);
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  
  /* Fondos */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  
  /* Bordes */
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  
  /* Texto */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  /* Sombras mejoradas */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-purple: 0 4px 20px rgba(139, 92, 246, 0.25);
  
  /* Radios */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;
  
  /* Transiciones */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  
  /* Tipografía */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================
   RESET Y BASE
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background: linear-gradient(180deg, #faf5ff 0%, #ffffff 25%, #f0f9ff 75%, #fdf4ff 100%);
  background-attachment: fixed;
}

/* ============================================
   LAYOUT
   ============================================ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 260px;
  background: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(139, 92, 246, 0.1);
  padding: 16px 16px 8px 16px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for better mobile support */
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.app-main {
  flex: 1;
  margin-left: 260px;
  padding: 32px 40px;
  max-width: calc(100% - 260px);
}

.app-container {
  max-width: 1000px;
  margin: 0 auto;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 42px;
  height: 42px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
  box-shadow: var(--shadow-purple);
}

.sidebar-logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.5px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  color: var(--gray-600);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: rgba(139, 92, 246, 0.08);
  color: var(--purple-600);
}

.sidebar-link.active {
  background: var(--purple-100);
  color: var(--purple-600);
}

.sidebar-link-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.sidebar-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), transparent);
  margin: 8px 0;
  flex-shrink: 0;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--purple-400);
  padding: 4px 16px;
  margin-top: 2px;
  flex-shrink: 0;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 8px 0 0 0;
  flex-shrink: 0;
  border-top: 1px solid rgba(139, 92, 246, 0.08);
}

.sidebar-user {
  padding: 10px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(139, 92, 246, 0.1);
  border-radius: var(--radius-lg);
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: white;
}

.sidebar-user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-900);
}

.sidebar-user-plan {
  font-size: 12px;
  color: var(--gray-500);
}

/* ============================================
   HEADER PÁGINA
   ============================================ */

.page-header {
  margin-bottom: 32px;
}

.page-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 16px;
  color: var(--gray-500);
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 92, 246, 0.1);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-base);
}

.card:hover {
  border-color: rgba(139, 92, 246, 0.2);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(139, 92, 246, 0.08);
  background: rgba(139, 92, 246, 0.02);
}

/* Card variantes */
.card-highlight {
  border-color: var(--purple-300);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.card-success {
  border-color: var(--green-500);
  background: rgba(34, 197, 94, 0.05);
}

/* ============================================
   BLOQUE DE CONTENIDO (Dashboard principal)
   ============================================ */

.content-block {
  background: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 92, 246, 0.1);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  transition: all var(--transition-base);
}

.content-block:hover {
  border-color: rgba(139, 92, 246, 0.2);
  box-shadow: var(--shadow-lg);
}

.content-block-header {
  padding: 24px 28px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.content-block-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-purple);
}

.content-block-body {
  padding: 28px;
}

.content-block-text {
  font-size: 17px;
  line-height: 1.8;
  color: var(--gray-700);
  white-space: pre-wrap;
}

.content-block-actions {
  display: flex;
  gap: 12px;
  padding: 20px 28px;
  border-top: 1px solid rgba(139, 92, 246, 0.08);
  background: rgba(139, 92, 246, 0.02);
}

/* ============================================
   STATS CARDS
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 92, 246, 0.1);
  border-radius: var(--radius-xl);
  padding: 24px;
  transition: all var(--transition-base);
}

.stat-card:hover {
  border-color: rgba(139, 92, 246, 0.25);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  background: var(--purple-100);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.stat-card-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 4px;
  letter-spacing: -1px;
}

.stat-card-label {
  font-size: 14px;
  color: var(--gray-500);
  font-weight: 500;
}

/* Variantes de stat card */
.stat-card.streak .stat-card-icon {
  background: rgba(249, 115, 22, 0.1);
}

.stat-card.success .stat-card-icon {
  background: rgba(34, 197, 94, 0.1);
}

/* ============================================
   BOTONES
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-purple);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.8);
  color: var(--gray-700);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.btn-secondary:hover:not(:disabled) {
  background: white;
  border-color: var(--purple-400);
  color: var(--purple-600);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.08);
  color: var(--purple-600);
}

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

.btn-success:hover:not(:disabled) {
  background: #16a34a;
  transform: translateY(-2px);
}

.btn-danger {
  background: transparent;
  color: var(--red-500);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.1);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
  border-radius: var(--radius-xl);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-lg);
}

/* ============================================
   INPUTS Y FORMULARIOS
   ============================================ */

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

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-lg);
  font-size: 15px;
  color: var(--gray-900);
  background: rgba(255, 255, 255, 0.8);
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--purple-400);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
  background: white;
}

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

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23E91E8C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 44px;
}

.form-hint {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 6px;
}

.form-error {
  font-size: 13px;
  color: var(--red-500);
  margin-top: 6px;
}

/* ============================================
   BADGES Y TAGS
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.badge-primary {
  background: var(--purple-100);
  color: var(--purple-600);
}

.badge-success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--green-500);
}

.badge-warning {
  background: rgba(249, 115, 22, 0.1);
  color: var(--orange-500);
}

.badge-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red-500);
}

.badge-neutral {
  background: var(--gray-100);
  color: var(--gray-600);
}

/* ============================================
   RACHA / STREAK
   ============================================ */

.streak-display {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: var(--radius-xl);
}

.streak-icon {
  font-size: 36px;
}

.streak-info {
  flex: 1;
}

.streak-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.5px;
}

.streak-label {
  font-size: 14px;
  color: var(--gray-600);
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress {
  height: 10px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.progress-success .progress-bar {
  background: var(--green-500);
}

/* ============================================
   LISTAS
   ============================================ */

.list {
  display: flex;
  flex-direction: column;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(139, 92, 246, 0.08);
}

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

.list-item-icon {
  width: 48px;
  height: 48px;
  background: var(--purple-50);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

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

.list-item-title {
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 2px;
}

.list-item-subtitle {
  font-size: 13px;
  color: var(--gray-500);
}

.list-item-action {
  flex-shrink: 0;
}

/* ============================================
   TABS
   ============================================ */

.tabs {
  display: flex;
  gap: 4px;
  padding: 6px;
  background: rgba(139, 92, 246, 0.05);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.tab {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab:hover {
  color: var(--purple-600);
}

.tab.active {
  background: white;
  color: var(--purple-600);
  box-shadow: var(--shadow-sm);
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-state-icon {
  font-size: 56px;
  margin-bottom: 20px;
}

.empty-state-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 15px;
  color: var(--gray-500);
  max-width: 320px;
  margin: 0 auto 28px;
}

/* ============================================
   TOAST / NOTIFICACIONES
   ============================================ */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 24px;
  background: var(--gray-900);
  color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9999;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-success {
  background: var(--green-500);
}

.toast-error {
  background: var(--red-500);
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9990;
  padding: 24px;
}

.modal {
  background: white;
  border-radius: var(--radius-2xl);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
}

.modal-close {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: var(--gray-400);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--purple-50);
  color: var(--purple-600);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid rgba(139, 92, 246, 0.1);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--gray-50);
}

/* ============================================
   TABLAS
   ============================================ */

.table-wrapper {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 16px 18px;
  text-align: left;
}

.table th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--purple-500);
  border-bottom: 2px solid rgba(139, 92, 246, 0.1);
}

.table td {
  border-bottom: 1px solid rgba(139, 92, 246, 0.06);
  color: var(--gray-700);
}

.table tbody tr:hover {
  background: rgba(139, 92, 246, 0.03);
}

/* ============================================
   UTILIDADES
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-success { color: var(--green-500); }
.text-error { color: var(--red-500); }
.text-purple { color: var(--purple-500); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.font-bold { font-weight: 700; }
.font-normal { font-weight: 400; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.hidden { display: none; }
.w-full { width: 100%; }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .app-sidebar {
    width: 72px;
    padding: 16px 8px;
  }
  
  .sidebar-logo-text,
  .sidebar-link span,
  .sidebar-section-title,
  .sidebar-user-info > div {
    display: none;
  }
  
  .sidebar-link {
    justify-content: center;
    padding: 12px;
  }
  
  .sidebar-user {
    padding: 8px;
    display: flex;
    justify-content: center;
  }
  
  .app-main {
    margin-left: 72px;
    max-width: calc(100% - 72px);
  }
}

@media (max-width: 768px) {
  .app-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    height: auto;
    border-right: none;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
    padding: 6px 8px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    z-index: 100;
    background: rgba(255, 255, 255, 0.97);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
  }

  .sidebar-logo,
  .sidebar-section-title,
  .sidebar-divider,
  .sidebar-user,
  .sidebar-upgrade {
    display: none;
  }

  .sidebar-nav {
    flex-direction: row;
    justify-content: space-around;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-link {
    flex-direction: column;
    gap: 3px;
    padding: 6px 10px;
    font-size: 10px;
    min-width: 0;
    flex-shrink: 0;
  }

  .sidebar-link span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 64px;
    text-align: center;
  }

  .sidebar-link-icon {
    font-size: 20px;
  }

  .app-main {
    margin-left: 0;
    max-width: 100%;
    padding: 16px 12px 80px;
  }

  .page-header {
    margin-bottom: 20px;
  }

  .page-title {
    font-size: 24px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card-value {
    font-size: 24px;
  }

  .card-header {
    padding: 16px;
  }

  .card-body {
    padding: 16px;
  }

  .content-block-body {
    padding: 16px;
  }

  .content-block-header {
    padding: 16px;
  }

  .content-block-actions {
    padding: 14px 16px;
  }

  .modal-overlay {
    padding: 8px;
  }

  .modal {
    max-height: 95vh;
    max-height: 95dvh;
    border-radius: var(--radius-xl);
  }

  .modal-body {
    max-height: 65vh;
    max-height: 65dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 88px;
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  .tab {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 10px 16px;
    font-size: 13px;
  }

  /* Inputs: prevenir zoom en iOS */
  .form-input,
  .form-textarea,
  .form-select,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  input[type="url"],
  textarea,
  select {
    font-size: 16px !important;
  }

  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -12px;
    padding: 0 12px;
  }
}

@media (max-width: 480px) {
  .app-main {
    padding: 12px 10px 80px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .content-block-actions {
    flex-direction: column;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }
}

/* ============================================
   UPGRADE BANNER
   ============================================ */

.sidebar-upgrade {
  margin: 12px;
  padding: 18px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  color: white;
  box-shadow: var(--shadow-purple);
}

.sidebar-upgrade .upgrade-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.sidebar-upgrade .upgrade-icon {
  font-size: 1.5rem;
}

.sidebar-upgrade .upgrade-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-upgrade .upgrade-text strong {
  font-size: 14px;
  color: white;
  font-weight: 700;
}

.sidebar-upgrade .upgrade-text span {
  font-size: 12px;
  opacity: 0.9;
  color: white;
}

.sidebar-upgrade .upgrade-btn {
  margin-top: 8px;
  padding: 8px 20px;
  background: white;
  color: var(--purple-600);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: all var(--transition-fast);
  display: inline-block;
}

.sidebar-upgrade .upgrade-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
