:root {
  /* Colores Primarios */
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #6366f1;
  --primary-subtle: rgba(79, 70, 229, 0.08);
  --secondary: #64748b;
  --accent: #06b6d4;

  /* Colores de Estado */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* Neutros Light Mode */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;

  /* Sidebar */
  --sidebar-width: 264px;
  --sidebar-collapsed-width: 80px;
  --sidebar-bg: #ffffff;
  --sidebar-text: #64748b;
  --sidebar-hover: #f1f5f9;
  --sidebar-active: rgba(79, 70, 229, 0.08);
  --sidebar-active-text: #4f46e5;

  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

  /* Transiciones */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --border-color: #1e293b;

  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-hover: #1e293b;
  --sidebar-active: rgba(99, 102, 241, 0.15);
  --sidebar-active-text: #818cf8;

  --primary-subtle: rgba(99, 102, 241, 0.15);
}

/* Reset y Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  overflow-x: hidden;
  font-size: 0.9375rem;
}

/* Layout Principal */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.25rem;
  transition: var(--transition);
}

.sidebar-logo:hover {
  color: var(--text-primary);
}

.sidebar-logo i {
  font-size: 1.5rem;
  color: var(--primary);
}

.sidebar.collapsed .sidebar-logo span {
  display: none;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.375rem;
  border-radius: 0.375rem;
  transition: var(--transition);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  background: var(--sidebar-hover);
  color: var(--primary);
}

/* Sidebar Menu */
.sidebar-menu {
  list-style: none;
  padding: 0.5rem 0 1rem;
}

.sidebar-menu-label {
  padding: 1.25rem 1.5rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  list-style: none;
}

.sidebar.collapsed .sidebar-menu-label {
  display: none;
}

.sidebar-menu-item {
  margin: 1px 0.625rem;
  list-style: none;
}

.sidebar-menu-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.875rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 0.5rem;
  transition: var(--transition);
  font-weight: 500;
  font-size: 0.875rem;
  position: relative;
}

.sidebar-menu-link:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

.sidebar-menu-link.active {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
  font-weight: 600;
}

.sidebar-menu-link.active::before {
  content: '';
  position: absolute;
  left: -0.625rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.sidebar-menu-link i {
  font-size: 1.125rem;
  min-width: 1.25rem;
  text-align: center;
  opacity: 0.85;
}

.sidebar-menu-link.active i {
  opacity: 1;
}

.sidebar.collapsed .sidebar-menu-link span {
  display: none;
}

/* Sidebar Collapsible Groups */
.sidebar-menu-group {
  margin: 1px 0.625rem;
  list-style: none;
}

.sidebar-group-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.875rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 0.5rem;
  transition: var(--transition);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  width: 100%;
}

.sidebar-group-toggle:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

.sidebar-group-toggle.active {
  color: var(--text-primary);
}

.sidebar-group-toggle i:first-child {
  font-size: 1.125rem;
  min-width: 1.25rem;
  text-align: center;
  opacity: 0.85;
}

.sidebar-chevron {
  margin-left: auto;
  font-size: 0.75rem !important;
  min-width: auto !important;
  opacity: 0.5 !important;
  transition: transform 0.25s ease;
}

.sidebar-group-toggle.open .sidebar-chevron {
  transform: rotate(180deg);
}

.sidebar-submenu {
  list-style: none;
  padding: 0;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-submenu.open {
  max-height: 500px;
}

.sidebar-submenu li {
  margin: 0;
}

.sidebar-submenu .sidebar-menu-link {
  padding: 0.375rem 0.875rem 0.375rem 2.75rem;
  font-size: 0.8125rem;
  font-weight: 400;
  position: relative;
}

.sidebar-submenu .sidebar-menu-link::after {
  content: '';
  position: absolute;
  left: 1.625rem;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--transition);
}

.sidebar-submenu .sidebar-menu-link:hover::after,
.sidebar-submenu .sidebar-menu-link.active::after {
  background: var(--primary);
}

.sidebar-submenu .sidebar-menu-link.active {
  background: transparent;
  color: var(--sidebar-active-text);
  font-weight: 600;
}

.sidebar-submenu .sidebar-menu-link.active::before {
  display: none;
}

.sidebar.collapsed .sidebar-group-toggle span,
.sidebar.collapsed .sidebar-chevron {
  display: none;
}

.sidebar.collapsed .sidebar-submenu {
  display: none;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 999;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Topbar Icon Buttons */
.topbar-icon-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.125rem;
}

.topbar-icon-btn:hover {
  background: var(--bg-secondary);
  color: var(--primary);
  border-color: var(--border-color);
}

/* Search */
.search-container {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.875rem;
  pointer-events: none;
}

.search-input {
  width: 240px;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: var(--transition);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
  width: 300px;
}

.search-results-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1050;
  padding: 0.5rem;
}

/* User Menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0.75rem;
  background: transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.user-menu:hover {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.user-avatar-lg {
  width: 42px;
  height: 42px;
  font-size: 1rem;
}

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

.user-name {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-role {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.dropdown-header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

/* ============================================
   CONTENT AREA
   ============================================ */
.content-area {
  flex: 1;
  padding: 1.5rem;
}

/* ============================================
   CARDS
   ============================================ */
.card-modern {
  background: var(--bg-primary);
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
  overflow: hidden;
}

.card-modern:hover {
  box-shadow: var(--shadow);
}

.card-header-modern {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title-modern {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-body-modern {
  padding: 1.5rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-modern {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
}

.btn-primary-modern {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  transition: var(--transition);
}

.btn-primary-modern:hover {
  background: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.btn-secondary-modern {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary-modern:hover {
  background: var(--bg-secondary);
  border-color: var(--primary);
}

.btn-sm-modern {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

/* ============================================
   TABLES
   ============================================ */
.table-modern {
  width: 100%;
  background: var(--bg-primary);
  border-radius: 0.75rem;
  overflow: hidden;
}

.table-modern thead {
  background: var(--bg-secondary);
}

.table-modern th {
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-color);
}

.table-modern td {
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

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

.table-modern tbody tr:hover {
  background: var(--bg-secondary);
}

/* ============================================
   FORMS
   ============================================ */
.form-group-modern {
  margin-bottom: 1.25rem;
}

.form-label-modern {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.form-control-modern {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: var(--transition);
  font-size: 0.875rem;
}

.form-control-modern:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

/* ============================================
   BADGES
   ============================================ */
.badge-modern {
  padding: 0.25rem 0.625rem;
  border-radius: 1rem;
  font-weight: 500;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

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

.badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--info);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .topbar-title {
    font-size: 1.125rem;
  }

  .search-container {
    display: none;
  }

  .user-info {
    display: none !important;
  }
}

@media (max-width: 1024px) {
  .search-input {
    width: 180px;
  }
  .search-input:focus {
    width: 220px;
  }
}

/* ============================================
   SCROLLBAR
   ============================================ */
.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================
   MODALS
   ============================================ */
.modal-backdrop {
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  border-radius: 0.75rem 0.75rem 0 0;
}

.modal-title {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.125rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  border-radius: 0 0 0.75rem 0.75rem;
}

.btn-close {
  filter: var(--bs-btn-close-filter, none);
}

[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* ============================================
   DROPDOWN MENUS
   ============================================ */
.dropdown-menu {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  padding: 0.375rem;
  margin-top: 0.25rem;
}

.dropdown-item {
  color: var(--text-primary);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  transition: var(--transition-fast);
  font-size: 0.875rem;
}

.dropdown-item:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}

.dropdown-item:active {
  background: var(--primary);
  color: white;
}

.dropdown-divider {
  border-color: var(--border-color);
  margin: 0.375rem 0;
}

/* ============================================
   ALERTS & VALIDATION
   ============================================ */
.alert {
  border-radius: 0.5rem;
  border: none;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  border-left: 3px solid var(--danger);
}

.alert-success {
  background: rgba(16, 185, 129, 0.08);
  color: var(--success);
  border-left: 3px solid var(--success);
}

.text-danger {
  color: var(--danger) !important;
  font-size: 0.8125rem;
  margin-top: 0.25rem;
  display: block;
}

/* ============================================
   DATATABLES INTEGRATION
   ============================================ */
.dataTables_wrapper {
  color: var(--text-primary);
}

.dataTables_filter input,
.dataTables_length select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 0.375rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.875rem;
}

.dataTables_info,
.dataTables_length label,
.dataTables_filter label {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.page-item .page-link {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}

.page-item .page-link:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ============================================
   SKELETON LOADERS
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 0.375rem;
}

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

.skeleton-text { height: 1rem; margin-bottom: 0.5rem; }
.skeleton-title { height: 1.5rem; width: 60%; margin-bottom: 1rem; }
.skeleton-card { height: 200px; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
}

.toast-modern {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  min-width: 280px;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.25s ease-out;
}

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

.toast-modern.toast-success { border-left: 3px solid var(--success); }
.toast-modern.toast-error { border-left: 3px solid var(--danger); }
.toast-modern.toast-warning { border-left: 3px solid var(--warning); }
.toast-modern.toast-info { border-left: 3px solid var(--primary); }

.toast-icon { font-size: 1.25rem; flex-shrink: 0; }
.toast-content { flex: 1; }
.toast-title { font-weight: 600; color: var(--text-primary); margin-bottom: 0.125rem; font-size: 0.875rem; }
.toast-message { font-size: 0.8125rem; color: var(--text-secondary); margin: 0; }
.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  line-height: 1;
  transition: var(--transition-fast);
}
.toast-close:hover { color: var(--text-primary); }

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumb-modern {
  background: transparent;
  padding: 0;
  margin-bottom: 1.25rem;
  font-size: 0.8125rem;
}

.breadcrumb-modern .breadcrumb-item {
  color: var(--text-secondary);
}

.breadcrumb-modern .breadcrumb-item + .breadcrumb-item::before {
  content: "\203A";
  color: var(--text-muted);
  font-size: 1.125rem;
}

.breadcrumb-modern .breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 600;
}

.breadcrumb-modern a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition-fast);
}

.breadcrumb-modern a:hover {
  color: var(--primary-dark);
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner-modern {
  width: 36px;
  height: 36px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state-icon {
  font-size: 3.5rem;
  color: var(--text-muted);
  opacity: 0.4;
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.empty-state-text {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */
.fade-in {
  animation: fadeIn 0.3s ease-out;
}

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

.slide-up {
  animation: slideUp 0.3s ease-out;
}

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

.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

/* Company Selector in Topbar */
.company-selector {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.25rem 0.5rem;
}

.company-selector-icon {
  color: var(--primary);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.company-selector-select {
  border: none !important;
  background: transparent !important;
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.125rem 1.5rem 0.125rem 0.25rem !important;
  min-width: 120px;
  max-width: 200px;
  cursor: pointer;
}

.company-selector-select:focus {
  box-shadow: none !important;
}

.company-name-label {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

@media (max-width: 768px) {
  .company-selector,
  .company-name-label {
    display: none !important;
  }
}
