:root {
  --primary-color: #1a2a47; /* Azul oscuro Nexo */
  --accent-color: #2dd4bf;  /* Turquesa Nexo */
  --secondary-color: #64748b;
  --bg-color: #f1f5f9;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --success-color: #10b981;
}

body {
  background-color: var(--bg-color);
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
}

/* Header Styles */
.admin-navbar {
  background: white;
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary-color);
}

.navbar-user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 700;
}

/* Layout */
.admin-main {
  display: flex;
  min-height: calc(100vh - 60px);
}

.admin-sidebar {
  width: 240px;
  background: white;
  border-right: 1px solid var(--border-color);
  padding: 2rem 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  gap: 0.75rem;
}

.sidebar-link:hover, .sidebar-link.active {
  color: var(--primary-color);
  background: #f8fafc;
  border-left: 4px solid var(--accent-color);
}

.admin-content {
  flex: 1;
  padding: 2rem;
}

/* Dashboard Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-card.dark {
  background: var(--primary-color);
  color: white;
  border: none;
}

.stat-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.stat-card.dark .stat-title { color: #94a3b8; }

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.stat-sub {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.stat-card.dark .stat-sub { color: #94a3b8; }

/* Tabs */
.tabs-container {
  background: white;
  border-radius: 1rem;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.tabs-header {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: #f8fafc;
}

.tab-btn {
  padding: 1.25rem 2rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--nx-text-muted);
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 3px solid transparent;
}

.tab-btn.active {
  color: var(--nx-primary);
  border-bottom-color: var(--nx-accent);
}

.tab-content { padding: 1.5rem; }

/* Buttons & Utils */
.logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.logout-btn:hover { color: #ef4444; }

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

.admin-table th, .admin-table td {
  padding: 1.25rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

.admin-table th {
  background: #fcfdfe;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.admin-table td {
  font-size: 1.1rem;
  color: #1e293b;
}

.admin-table tr:hover td {
  background: #f8fafc;
}

.admin-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
/* Nexos Premium Design System - Vanilla CSS */
:root {
  --nx-primary: #0c1b33;
  --nx-accent: #2dd4bf;   /* Turquesa Nexo */
  --nx-accent-soft: rgba(45, 212, 191, 0.1);
  --nx-success: #10b981;
  --nx-warning: #f59e0b;
  --nx-danger: #ef4444;
  --nx-bg: #f8fafc;
  --nx-card-bg: #ffffff;
  --nx-border: #e2e8f0;
  --nx-text-main: #1e293b;
  --nx-text-muted: #64748b;
  --nx-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --nx-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --nx-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --nx-radius-lg: 1.25rem;
  --nx-radius-md: 0.75rem;
}

/* Page Headers */
.nx-page-header {
  margin-bottom: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.nx-page-header h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--nx-primary);
  margin: 0;
  letter-spacing: -0.025em;
}

.nx-page-header p {
  color: var(--nx-text-muted);
  margin-top: 0.5rem;
  font-size: 1rem;
}

/* Card System */
.nx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.nx-card {
  background: var(--nx-card-bg);
  border-radius: var(--nx-radius-lg);
  border: 1px solid var(--nx-border);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.nx-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--nx-shadow-lg);
  border-color: var(--nx-accent);
}

.nx-card-image {
  height: 200px;
  background: #f1f5f9;
  position: relative;
  overflow: hidden;
}

.nx-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.nx-card:hover .nx-card-image img {
  transform: scale(1.05);
}

.nx-card-content {
  padding: 1.5rem;
  flex-grow: 1;
}

.nx-card-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fcfdfe;
}

/* Badges */
.nx-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nx-badge-accent { background: var(--nx-accent-soft); color: #0d9488; }
.nx-badge-sence { background: #fff7ed; color: #c2410c; border: 1px solid #ffedd5; }
.nx-badge-success { background: #ecfdf5; color: #047857; }
.nx-badge-pending { background: #fffbeb; color: #b45309; }

/* Buttons */
.nx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--nx-radius-md);
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  gap: 0.5rem;
  text-decoration: none;
}

.nx-btn-primary { background: var(--nx-primary); color: white; }
.nx-btn-primary:hover { background: #1e293b; box-shadow: 0 10px 15px -3px rgba(12, 27, 51, 0.2); }

.nx-btn-accent { background: var(--nx-accent); color: var(--nx-primary); }
.nx-btn-accent:hover { opacity: 0.9; transform: scale(1.02); }

.nx-btn-outline { background: white; border: 1px solid var(--nx-border); color: var(--nx-text-main); }
.nx-btn-outline:hover { background: #f8fafc; border-color: var(--nx-text-muted); }

/* Data Grid (Tables) */
.nx-table-container {
  background: white;
  border-radius: var(--nx-radius-lg);
  border: 1px solid var(--nx-border);
  box-shadow: var(--nx-shadow-sm);
  overflow: hidden;
}

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

.nx-table th {
  background: #fcfdfe;
  padding: 1.75rem;
  text-align: left;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--nx-text-muted);
  border-bottom: 3px solid var(--nx-border);
}

.nx-table td {
  padding: 1.75rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 1.2rem;
  color: var(--nx-text-main);
  line-height: 1.6;
}

.nx-table tr:last-child td { border-bottom: none; }
.nx-table tr:hover td { background: #fcfdfe; }

/* Forms */
.nx-form-container {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  padding: 3rem;
  border-radius: 2rem;
  box-shadow: var(--nx-shadow-lg);
  border: 1px solid var(--nx-border);
}

.nx-form-input, 
.form-control, 
input[type="text"], 
input[type="email"], 
input[type="number"], 
input[type="datetime-local"], 
input[type="date"], 
select {
  width: 100%;
  height: 48px; /* Altura estandarizada */
  padding: 0.75rem 1rem;
  border-radius: var(--nx-radius-md);
  border: 1px solid var(--nx-border);
  background: #f8fafc;
  font-size: 0.95rem;
  color: var(--nx-text-main);
  transition: all 0.2s ease;
  box-sizing: border-box;
  -webkit-appearance: none; /* Quitar estilo nativo de Apple */
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
  padding-right: 2.5rem;
}

.nx-form-input:focus, 
.form-control:focus, 
input:focus, 
select:focus {
  outline: none;
  border-color: var(--nx-accent);
  background: white;
  box-shadow: 0 0 0 4px var(--nx-accent-soft);
}

/* Optimización para Ultra Wide */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (min-width: 1600px) {
  .form-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .admin-card {
    max-width: 100%;
    margin-left: 0;
  }
}

/* Utility Classes para Responsividad */
.grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

@media (max-width: 768px) {
  .grid-2-1 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .flex-between {
    flex-direction: column;
    align-items: stretch;
  }
  
  .hide-mobile {
    display: none !important;
  }
}

.admin-content {
  flex: 1;
  padding: 2rem;
  min-width: 0;
}

/* Responsividad General */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .admin-main {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: 0;
    z-index: 99;
  }

  .sidebar-link {
    padding: 0.75rem 1rem;
    border-left: none !important;
    border-bottom: 3px solid transparent;
  }

  .sidebar-link.active {
    border-bottom-color: var(--accent-color);
    background: #f8fafc;
  }

  .admin-content {
    padding: 1rem;
  }

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

  .admin-navbar {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    min-height: auto;
  }

  .navbar-user-info {
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .admin-card {
    padding: 1rem;
    overflow-x: auto;
  }
  
  .dashboard-header {
    margin-bottom: 1.5rem;
  }
}

/* --- PREMIUM UI SYSTEM OVERRIDES --- */

/* Wide Layout - Full screen width */
.admin-content {
  max-width: 98% !important;
  width: 98% !important;
  margin: 0 auto !important;
  padding: 2.5rem !important;
  flex: 1;
}

/* Premium KPI Cards */
.stat-card {
  background: white !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
  padding: 2.5rem !important;
  border-radius: 1.25rem !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

.stat-value {
  font-size: 2.75rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em !important;
  color: var(--primary-color) !important;
  margin: 0.5rem 0 !important;
}

.stat-title {
  color: #64748b !important;
  font-size: 0.85rem !important;
  letter-spacing: 0.05em !important;
}

/* Minimalist Tabs Navigation */
.tabs-container {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  margin-top: 1rem !important;
}

.tabs-header {
  background: transparent !important;
  border-bottom: 2px solid #e2e8f0 !important;
  margin-bottom: 2.5rem !important;
  gap: 2.5rem !important;
  padding: 0 !important;
}

.tab-btn {
  font-size: 1.05rem !important;
  padding: 1rem 0 !important;
  background: transparent !important;
  color: #64748b !important;
  border-bottom: 3px solid transparent !important;
  font-weight: 700 !important;
  transition: all 0.2s ease !important;
}

.tab-btn:hover {
  color: var(--primary-color) !important;
}

.tab-btn.active {
  color: var(--primary-color) !important;
  border-bottom-color: var(--accent-color) !important;
}

/* Badge Premium Style */
.badge {
  padding: 0.5rem 1rem !important;
  border-radius: 2rem !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.025em !important;
}

/* Wide Dashboard Header */
.dashboard-header h1 {
  font-size: 2.5rem !important;
  letter-spacing: -0.02em !important;
}
/* Modal Global System */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 27, 51, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  padding: 2rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: white;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fcfdfe;
}

.modal-content-inner {
  padding: 2rem;
  overflow-y: auto;
  flex-grow: 1;
}

.close-modal {
  background: #f1f5f9;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s;
}

.close-modal:hover {
  background: #fee2e2;
  color: #ef4444;
  transform: rotate(90deg);
}

/* Sidebar Submenu & Sublinks Styles */
.sidebar-submenu {
  display: none;
  background: #f8fafc;
  padding: 0.5rem 0 0.5rem 1rem;
  border-left: 3px solid var(--border-color);
  margin-left: 1.5rem;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  border-radius: 0.375rem;
}

.sidebar-sublink {
  display: flex !important;
  align-items: center;
  padding: 0.5rem 1rem;
  color: var(--text-muted) !important;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  gap: 0.5rem;
  border-radius: 0.375rem;
}

.sidebar-sublink:hover, .sidebar-sublink.active {
  color: var(--primary-color) !important;
  background: #f1f5f9;
}

.sidebar-sublink i, .sidebar-sublink svg {
  color: var(--text-muted);
  transition: all 0.2s;
}

.sidebar-sublink:hover i, .sidebar-sublink:hover svg, 
.sidebar-sublink.active i, .sidebar-sublink.active svg {
  color: var(--accent-color);
}

.submenu-chevron {
  transition: transform 0.2s ease;
}

.active-group .submenu-chevron {
  transform: rotate(180deg);
}
