/* ============================================
   ADMIN PANEL - Estilos Específicos
   Usa variables y clases del sistema global
   ============================================ */

/* LAYOUT */
.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

#loginScreen {
  width: 100%;
  padding: 40px 20px;
}

#dashboardScreen.active {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
}

/* LOGIN */
.login-container {
  max-width: 450px;
  margin: 0 auto;
  width: 100%;
}

.login-card {
  background: radial-gradient(circle at top left, rgba(75, 140, 255, 0.16), transparent 60%),
    radial-gradient(circle at bottom right, rgba(163, 104, 255, 0.12), transparent 55%),
    rgba(9, 9, 26, 0.95);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  padding: 48px 40px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.login-card h1 {
  font-size: 2.25rem;
  margin-bottom: 12px;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* FORMS */
.form-group {
  margin-bottom: 24px;
  text-align: left;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 18px;
  background: rgba(5, 5, 24, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text);
  font: inherit;
  transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(5, 5, 24, 0.8);
  box-shadow: 0 0 0 3px rgba(75, 140, 255, 0.15);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

/* BUTTONS */
.btn {
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-md);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--text);
  box-shadow: 0 8px 20px rgba(75, 140, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(75, 140, 255, 0.5);
}

.btn-secondary {
  background: rgba(100, 116, 139, 0.3);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(100, 116, 139, 0.5);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.btn-full {
  width: 100%;
}

/* MESSAGES */
.error-message {
  color: #ef4444;
  margin-top: 16px;
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--radius-md);
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-size: 0.95rem;
}

/* SIDEBAR */
.sidebar {
  width: 280px;
  background: radial-gradient(circle at top left, rgba(75, 140, 255, 0.12), transparent 60%), rgba(9, 9, 26, 0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  padding: 32px 24px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar .logo {
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .logo h2 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.role-badge {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-menu li {
  margin-bottom: 8px;
}

.nav-menu a {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  font-weight: 500;
  border: 1px solid transparent;
}

.nav-menu a:hover {
  color: var(--text);
  background: rgba(75, 140, 255, 0.1);
  border-color: rgba(75, 140, 255, 0.3);
  transform: translateX(4px);
}

.nav-menu a.active {
  color: var(--text);
  background: rgba(75, 140, 255, 0.15);
  border-color: rgba(75, 140, 255, 0.4);
  box-shadow: 0 4px 12px rgba(75, 140, 255, 0.2);
}

/* MAIN CONTENT */
.main-content {
  margin-left: 280px;
  flex: 1;
  min-height: 100vh;
}

/* TOP BAR */
.top-bar {
  background: radial-gradient(circle at top left, rgba(75, 140, 255, 0.08), transparent 60%), rgba(9, 9, 26, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  padding: 24px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar h1 {
  font-size: 1.875rem;
}

.mobile-menu-btn {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(75, 140, 255, 0.12);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 1.2rem;
  cursor: pointer;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info span {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  object-fit: cover;
}

/* CONTENT AREA */
.content-area {
  padding: 40px;
}

.content-table {
  overflow-x: auto;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.stat-card {
  background: radial-gradient(circle at top left, rgba(75, 140, 255, 0.12), transparent 60%), rgba(9, 9, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  padding: 28px;
  transition: all var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(75, 140, 255, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.stat-card h3 {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* SECTIONS */
.recent-section {
  background: radial-gradient(circle at top left, rgba(75, 140, 255, 0.08), transparent 60%), rgba(9, 9, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  padding: 32px;
}

.recent-section h2 {
  font-size: 1.5rem;
  margin-bottom: 28px;
}

/* CONTENT LIST */
.content-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.content-item {
  background: rgba(5, 5, 24, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition-fast);
}

.content-item:hover {
  border-color: rgba(75, 140, 255, 0.4);
  background: rgba(75, 140, 255, 0.08);
  transform: translateX(4px);
}

.content-info h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.content-meta {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* BADGES */
.badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-draft {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-published {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-archived {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

/* VIEW HEADER */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.filters {
  display: flex;
  gap: 16px;
}

.filters select {
  padding: 10px 16px;
  background: rgba(5, 5, 24, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition-fast);
  font: inherit;
}

.filters select:hover {
  border-color: var(--accent);
  background: rgba(5, 5, 24, 0.8);
}

/* TABLES */
.content-table {
  background: radial-gradient(circle at top left, rgba(75, 140, 255, 0.06), transparent 60%), rgba(9, 9, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 18px 20px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
  background: rgba(75, 140, 255, 0.08);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  color: var(--text-muted);
}

tr:hover td {
  background: rgba(75, 140, 255, 0.05);
}

.actions {
  display: flex;
  gap: 10px;
}

/* EDITOR */
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
}

.editor-main {
  background: radial-gradient(circle at top left, rgba(75, 140, 255, 0.08), transparent 60%), rgba(9, 9, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  padding: 32px;
}

#contentTitle {
  font-size: 2rem;
  font-weight: 700;
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 16px 0;
  margin-bottom: 24px;
  width: 100%;
  font-family: inherit;
}

#contentTitle:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.meta-box {
  background: radial-gradient(circle at top left, rgba(75, 140, 255, 0.08), transparent 60%), rgba(9, 9, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  padding: 24px;
}

.meta-box h3 {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* MEDIA GRID */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.media-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: rgba(5, 5, 24, 0.8);
}

.media-item:hover {
  transform: scale(1.05);
  border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(75, 140, 255, 0.3);
}

.media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
  padding: 16px;
  font-size: 0.875rem;
}

/* PROFILE */
.profile-container {
  max-width: 700px;
  background: radial-gradient(circle at top left, rgba(75, 140, 255, 0.08), transparent 60%), rgba(9, 9, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  padding: 40px;
}

.profile-container h2 {
  font-size: 1.75rem;
  margin-bottom: 32px;
}

/* UTILITIES */
.loading {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}

.text-center {
  text-align: center;
}

.mb-4 {
  margin-bottom: 1.5rem;
}

.mt-4 {
  margin-top: 1.5rem;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
}

.text-button {
    display: block;
    margin: 12px auto 0;
    border: 0;
    background: transparent;
    color: #2563eb;
    cursor: pointer;
}

.media-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.media-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(6px);
}

.media-modal__content {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  background: #0b1028;
  color: var(--text);
}

.media-modal__close {
  float: right;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 2rem;
  cursor: pointer;
}

.media-preview {
  display: grid;
  place-items: center;
  min-height: 180px;
  margin: 24px 0;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.25);
}

.media-preview img,
.media-preview video {
  max-width: 100%;
  max-height: 55vh;
  border-radius: var(--radius-md);
}

.media-preview audio {
  width: min(520px, 100%);
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: inline-block;
  }

  .top-bar h1 {
    font-size: 1.35rem;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .top-bar,
  .content-area {
    padding: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  table {
    font-size: 0.875rem;
  }

  th,
  td {
    padding: 12px 10px;
  }
}
input[type="search"], .admin-application-form input, .admin-application-form textarea, .admin-application-form select { width: 100%; margin: .45rem 0; padding: .75rem; border: 1px solid rgba(148,163,184,.25); border-radius: .65rem; background: rgba(15,23,42,.65); color: inherit; }
.admin-application-form { margin-top: 1rem; padding: 1.25rem; border: 1px solid rgba(148,163,184,.2); border-radius: 1rem; }
.btn-small { padding: .4rem .65rem; font-size: .8rem; }
