/* ============================================
   TaskMaster AI — Sistema de Diseño Principal
   Estilo: Ultra Dark + Emerald Glow
   ============================================ */

/* ====== Google Fonts ====== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ====== Variables CSS ====== */
:root {
  /* Colores principales — Negro profundo */
  --color-bg: #050505;
  --color-bg-secondary: #0a0a0a;
  --color-bg-tertiary: #111111;
  --color-bg-card: rgba(14, 14, 14, 0.7);
  --color-bg-hover: rgba(255, 255, 255, 0.04);
  --color-surface: #080808;

  /* Texto */
  --color-text: #f0f0f0;
  --color-text-secondary: #9ca3af;
  --color-text-muted: #525866;
  --color-text-inverse: #050505;

  /* Acento principal — Esmeralda brillante */
  --color-primary: #00e68a;
  --color-primary-light: #33ffaa;
  --color-primary-dark: #00b368;
  --color-primary-glow: rgba(0, 230, 138, 0.15);
  --color-primary-glow2: rgba(0, 230, 138, 0.06);

  /* Prioridades */
  --color-high: #ff4d6a;
  --color-high-bg: rgba(255, 77, 106, 0.10);
  --color-medium: #ffb833;
  --color-medium-bg: rgba(255, 184, 51, 0.10);
  --color-low: #00e68a;
  --color-low-bg: rgba(0, 230, 138, 0.10);

  /* Estados */
  --color-success: #00e68a;
  --color-success-bg: rgba(0, 230, 138, 0.10);
  --color-warning: #ffb833;
  --color-danger: #ff4d6a;
  --color-info: #4d8bff;

  /* Bordes — sutil tinte verde */
  --color-border: rgba(255, 255, 255, 0.06);
  --color-border-hover: rgba(0, 230, 138, 0.2);

  /* Sombras con glow verde */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 8px 50px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 40px rgba(0, 230, 138, 0.1);
  --shadow-glow-strong: 0 0 60px rgba(0, 230, 138, 0.2);

  /* Espaciado */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Bordes redondeados — más suaves */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Tipografía */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-xs: 0.75rem;
  --font-sm: 0.8125rem;
  --font-md: 0.9375rem;
  --font-lg: 1.125rem;
  --font-xl: 1.5rem;
  --font-2xl: 2rem;
  --font-3xl: 2.5rem;

  /* Transiciones */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --ai-panel-width: 380px;
  --header-height: 64px;
}

/* ====== Reset ====== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow: hidden;
}

a {
  color: var(--color-primary-light);
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  background: none;
  color: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: var(--font-md);
  border: none;
  outline: none;
  background: none;
  color: var(--color-text);
}

ul,
ol {
  list-style: none;
}

/* ====== Scrollbar Personalizado ====== */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ====== Layout Principal ====== */
.app-layout {
  display: flex;
  height: 100vh;
  position: relative;
  background: var(--color-bg);
}

/* ====== Fondo con orbes de gradiente ====== */
.app-layout::before {
  content: '';
  position: fixed;
  top: -30%;
  left: -20%;
  width: 140%;
  height: 140%;
  background: radial-gradient(ellipse at 15% 15%, rgba(0, 230, 138, 0.07) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 85%, rgba(0, 230, 138, 0.04) 0%, transparent 40%),
    radial-gradient(ellipse at 60% 20%, rgba(77, 139, 255, 0.02) 0%, transparent 35%);
  pointer-events: none;
  z-index: 0;
  animation: float-orbs 20s ease-in-out infinite alternate;
}

@keyframes float-orbs {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(-2%, 2%) scale(1.05);
  }
}

/* -- Sidebar -- */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(8, 8, 8, 0.85);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), width var(--transition-normal);
  z-index: 100;
  position: relative;
  flex-shrink: 0;
  backdrop-filter: blur(24px);
}

.sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-lg) var(--space-md);
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sidebar__logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-glow);
}

.sidebar__logo-text {
  font-weight: 700;
  font-size: var(--font-lg);
  color: var(--color-text);
}

.sidebar__logo-text span {
  color: var(--color-primary);
}

.sidebar__close {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: background var(--transition-fast);
}

.sidebar__close:hover {
  background: var(--color-bg-hover);
}

/* Navegación */
.sidebar__nav {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  overflow-y: auto;
}

.sidebar__section-title {
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  padding: var(--space-md) var(--space-sm) var(--space-xs);
}

.sidebar__nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-md);
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
  margin-bottom: 2px;
  position: relative;
}

.sidebar__nav-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.sidebar__nav-item.active {
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.08), rgba(0, 212, 170, 0.03));
  color: var(--color-primary);
  border: 1px solid rgba(0, 212, 170, 0.12);
}

.sidebar__nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px var(--color-primary);
}

.sidebar__nav-icon {
  font-size: 1.125rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar__nav-badge {
  margin-left: auto;
  background: rgba(0, 212, 170, 0.12);
  color: var(--color-primary);
  font-size: var(--font-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  min-width: 24px;
  text-align: center;
}

/* Categorías en sidebar */
.sidebar__category-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
}

.sidebar__category-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.sidebar__category-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.sidebar__category-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__category-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.sidebar__category-item:hover .sidebar__category-actions {
  opacity: 1;
}

.sidebar__category-edit,
.sidebar__category-delete {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.sidebar__category-edit:hover {
  background: rgba(0, 230, 138, 0.1);
  transform: scale(1.1);
}

.sidebar__category-delete:hover {
  background: rgba(255, 77, 106, 0.1);
  transform: scale(1.1);
}

.sidebar__add-category {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar__add-category:hover {
  background: var(--color-bg-hover);
  color: var(--color-primary);
}

/* Footer del sidebar */
.sidebar__footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.sidebar__user:hover {
  background: var(--color-bg-hover);
}

.sidebar__user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--color-text-inverse);
  box-shadow: 0 0 12px rgba(0, 212, 170, 0.2);
}

.sidebar__user-info {
  display: flex;
  flex-direction: column;
}

.sidebar__user-name {
  font-size: var(--font-sm);
  font-weight: 600;
}

.sidebar__user-email {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
}

/* -- Contenido Principal -- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  z-index: 1;
}

/* Header */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  height: var(--header-height);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(5, 5, 5, 0.8);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
  z-index: 10;
}

.main-header__left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.main-header__menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: background var(--transition-fast);
}

.main-header__menu-btn:hover {
  background: var(--color-bg-hover);
}

.main-header__title {
  font-size: var(--font-xl);
  font-weight: 700;
}

.main-header__subtitle {
  font-size: var(--font-sm);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.main-header__right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.main-header__btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  position: relative;
  border: 1px solid var(--color-border);
}

.main-header__btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-primary);
  border-color: var(--color-border-hover);
}

.main-header__btn .badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary);
}

/* Área de contenido scrolleable */
.main-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xl);
}

/* -- Panel IA -- */
.ai-panel {
  width: var(--ai-panel-width);
  background: rgba(8, 8, 8, 0.9);
  border-left: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform var(--transition-normal), width var(--transition-normal);
  z-index: 1;
  backdrop-filter: blur(20px);
}

.ai-panel.hidden {
  width: 0;
  overflow: hidden;
  border: none;
}

.ai-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  height: var(--header-height);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.ai-panel__title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  font-size: var(--font-md);
}

.ai-panel__title-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

.ai-panel__close-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

.ai-panel__close-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.ai-panel__messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

.ai-panel__quick-actions {
  padding: var(--space-sm) var(--space-md);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.ai-panel__quick-btn {
  padding: 6px var(--space-md);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
  background: var(--color-bg-tertiary);
}

.ai-panel__quick-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(0, 212, 170, 0.06);
  box-shadow: 0 0 12px rgba(0, 212, 170, 0.1);
}

.ai-panel__input-area {
  padding: var(--space-md);
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.ai-panel__input-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-lg);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.ai-panel__input-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 16px rgba(0, 212, 170, 0.1);
}

.ai-panel__input {
  flex: 1;
  padding: var(--space-xs) 0;
  font-size: var(--font-sm);
}

.ai-panel__input::placeholder {
  color: var(--color-text-muted);
}

.ai-panel__send-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(0, 212, 170, 0.2);
}

.ai-panel__send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 24px rgba(0, 212, 170, 0.3);
}

.ai-panel__send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ====== Dashboard Stats ====== */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: rgba(14, 14, 14, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--stat-color, var(--color-primary)), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, var(--color-primary-glow2) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-normal);
  pointer-events: none;
}

.stat-card:hover {
  border-color: rgba(0, 230, 138, 0.15);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), 0 0 30px rgba(0, 230, 138, 0.08);
}

.stat-card:hover::before,
.stat-card:hover::after {
  opacity: 1;
}

.stat-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
  position: relative;
  z-index: 1;
}

.stat-card__value {
  font-size: var(--font-2xl);
  font-weight: 800;
  line-height: 1;
  margin-bottom: var(--space-xs);
  position: relative;
  z-index: 1;
}

.stat-card__label {
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
  position: relative;
  z-index: 1;
}

/* ====== Sección de Tareas ====== */
.tasks-section {
  margin-top: var(--space-lg);
}

.tasks-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.tasks-section__title {
  font-size: var(--font-lg);
  font-weight: 700;
}

.tasks-section__filters {
  display: flex;
  gap: var(--space-xs);
}

.filter-btn {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.filter-btn:hover {
  color: var(--color-text-secondary);
  background: var(--color-bg-hover);
}

.filter-btn.active {
  background: rgba(0, 212, 170, 0.08);
  color: var(--color-primary);
  border-color: rgba(0, 212, 170, 0.2);
}

/* ====== FAB (Botón flotante) ====== */
.fab {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-text-inverse);
  font-size: 1.5rem;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg), var(--shadow-glow-strong);
  transition: all var(--transition-normal);
  z-index: 50;
}

.fab:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(0, 212, 170, 0.3);
}

.fab:active {
  transform: scale(0.95);
}

/* ====== Toast Notifications ====== */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  box-shadow: var(--shadow-lg);
  animation: slideInRight var(--transition-normal) forwards;
  min-width: 300px;
  max-width: 420px;
  backdrop-filter: blur(10px);
}

.toast.toast--success {
  border-left: 3px solid var(--color-success);
}

.toast.toast--error {
  border-left: 3px solid var(--color-danger);
}

.toast.toast--warning {
  border-left: 3px solid var(--color-warning);
}

.toast.toast--info {
  border-left: 3px solid var(--color-info);
}

.toast.exiting {
  animation: slideOutRight var(--transition-fast) forwards;
}

.toast__icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast__body {
  flex: 1;
}

.toast__title {
  font-size: var(--font-sm);
  font-weight: 600;
}

.toast__message {
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.toast__close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: var(--font-sm);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.toast__close:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

/* ====== Loading Spinner ====== */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-bg-tertiary);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

.spinner--sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  color: var(--color-text-muted);
  gap: var(--space-md);
  flex-direction: column;
}

.loading-overlay__text {
  font-size: var(--font-sm);
}

/* ====== Estado Vacío ====== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state__title {
  font-size: var(--font-lg);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.empty-state__text {
  font-size: var(--font-sm);
  color: var(--color-text-muted);
  max-width: 320px;
}

/* ====== Animaciones ====== */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

/* ====== Overlay del Sidebar (Móvil) ====== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 11, 24, 0.75);
  backdrop-filter: blur(6px);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
  animation: fadeIn var(--transition-fast) forwards;
}

/* ====== Bottom Navigation (Móvil) ====== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(5, 5, 5, 0.95);
  backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  z-index: 200;
  padding: 0 var(--space-sm);
  align-items: center;
  justify-content: space-around;
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  padding: 6px 0;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav__item.active {
  color: var(--color-primary);
}

.bottom-nav__item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  width: 50%;
  height: 2px;
  background: var(--color-primary);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 0 10px var(--color-primary);
}

.bottom-nav__icon {
  font-size: 1.25rem;
  line-height: 1;
}

.bottom-nav__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ====== Responsive ====== */
@media (max-width: 1200px) {
  .ai-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    box-shadow: var(--shadow-lg);
  }

  .ai-panel.hidden {
    transform: translateX(100%);
    width: var(--ai-panel-width);
  }
}

@media (max-width: 768px) {

  /* Layout */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    z-index: 100;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar__close {
    display: flex;
  }

  .sidebar-overlay {
    display: none;
  }

  .sidebar-overlay.active {
    display: block;
  }

  /* Header compacto */
  .main-header {
    height: 48px;
    padding: var(--space-sm) var(--space-md);
  }

  .main-header__menu-btn {
    display: flex;
    width: 36px;
    height: 36px;
  }

  .main-header__title {
    font-size: var(--font-md);
  }

  .main-header__subtitle {
    display: none;
  }

  /* Ocultar search en header, más espacio */
  .main-header__right>div:first-child {
    display: none;
  }

  /* Body con espacio para bottom-nav */
  .main-body {
    padding: var(--space-md);
    padding-bottom: 80px;
  }

  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  /* Bottom Navigation visible */
  .bottom-nav {
    display: flex;
  }

  /* FAB sobre bottom nav */
  .fab {
    bottom: 80px;
    right: var(--space-md);
    width: 52px;
    height: 52px;
    box-shadow: var(--shadow-lg), var(--shadow-glow-strong);
  }

  /* Toast adaptado */
  .toast-container {
    left: var(--space-md);
    right: var(--space-md);
    top: auto;
    bottom: 80px;
  }

  .toast {
    min-width: auto;
    max-width: none;
  }

  /* AI Panel como Bottom Sheet */
  .ai-panel {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    --ai-panel-width: 100%;
    height: 85vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-top: 1px solid var(--color-border-hover);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
    z-index: 300;
  }

  .ai-panel.hidden {
    transform: translateY(100%);
    width: 100%;
  }

  .ai-panel__header {
    height: 44px;
    padding: var(--space-sm) var(--space-md);
    position: relative;
  }

  .ai-panel__header::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: var(--color-text-muted);
    border-radius: var(--radius-full);
  }
}

@media (max-width: 480px) {
  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .main-header {
    padding: var(--space-sm);
  }

  .main-header__title {
    font-size: var(--font-sm);
  }
}

/* ====== Utilidades ====== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-gradient {
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}