/* ============================================
   Aurexa Academy — Premium Admin Panel v2.0
   ============================================ */

.admin-layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--navbar-height);
  background: var(--bg-secondary);
  background-image: var(--gradient-mesh);
}

/* ── Sidebar ── */
.admin-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: var(--space-xl) 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--navbar-height);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  z-index: var(--z-base);
  transition: transform var(--transition-base);
  backdrop-filter: blur(12px);
}

.admin-sidebar-header {
  padding: 0 var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: var(--space-lg);
}

.admin-sidebar-header h3 { font-size: var(--fs-md); color: var(--text-primary); }
.admin-sidebar-header p { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 4px; }

.admin-nav { flex: 1; }

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px var(--space-lg);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
}

.admin-nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.admin-nav-item.active {
  color: var(--brand);
  background: rgba(var(--brand-rgb), 0.08);
  border-left-color: var(--brand);
}

.admin-nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }

.admin-sidebar-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border-light);
}

/* ── Main Content ── */
.admin-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: var(--space-xl) var(--space-2xl);
  min-height: calc(100vh - var(--navbar-height));
}

.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2xl);
  background: var(--bg-elevated);
  padding: var(--space-lg) var(--space-xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}

.admin-page-header h2 { font-size: var(--fs-xl); }

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.stat-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  transition: all var(--transition-base);
}

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

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-icon.blue { background: rgba(var(--brand-rgb), 0.1); color: var(--brand); }
.stat-icon.green { background: rgba(var(--success-rgb), 0.1); color: var(--success); }
.stat-icon.orange { background: rgba(var(--accent-rgb), 0.1); color: var(--accent); }
.stat-icon.purple { background: rgba(139,92,246,0.1); color: #8B5CF6; }

.stat-info h3 { font-size: var(--fs-2xl); margin-bottom: 2px; }
.stat-info p { font-size: var(--fs-sm); color: var(--text-muted); }

/* ── Admin Dashboard Charts ── */
.admin-dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.admin-chart-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
}

.admin-chart-card h3 {
  font-size: var(--fs-lg);
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}

/* ── Admin Table ── */
.admin-table-wrapper {
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.admin-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-light);
}

.admin-table-header h3 { font-size: var(--fs-lg); }

.admin-search {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  max-width: 280px;
}

.admin-search input { border: none; background: transparent; width: 100%; font-size: var(--fs-sm); color: var(--text-primary); }
.admin-search svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }

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

.admin-table th {
  padding: 12px var(--space-xl);
  text-align: left;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-secondary);
}

.admin-table td {
  padding: 14px var(--space-xl);
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

.admin-table tr:hover td { background: var(--bg-tertiary); }

.admin-table .actions { display: flex; gap: var(--space-sm); }

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
}

.action-btn.edit { background: rgba(52,152,219,0.1); color: #3498DB; }
.action-btn.edit:hover { background: #3498DB; color: white; }
.action-btn.delete { background: rgba(231,76,60,0.1); color: #E74C3C; }
.action-btn.delete:hover { background: #E74C3C; color: white; }
.action-btn.view { background: rgba(46,204,113,0.1); color: #2ECC71; }
.action-btn.view:hover { background: #2ECC71; color: white; }

/* ── Notices Card ── */
.notice-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-md);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--brand);
  transition: all var(--transition-base);
}

.notice-card:hover { box-shadow: var(--shadow-card-hover); }
.notice-card h4 { font-size: var(--fs-base); margin-bottom: var(--space-xs); }
.notice-card p { font-size: var(--fs-sm); margin-bottom: var(--space-sm); color: var(--text-secondary); }
.notice-card .notice-meta { display: flex; justify-content: space-between; align-items: center; }
.notice-card .notice-date { font-size: var(--fs-xs); color: var(--text-muted); }

/* ── Inquiry Card ── */
.inquiry-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-md);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-base);
}

.inquiry-card.unread { border-left: 4px solid var(--accent); background: rgba(var(--accent-rgb),0.03); }
.inquiry-card h4 { font-size: var(--fs-base); margin-bottom: 4px; }
.inquiry-card .inquiry-contact { font-size: var(--fs-sm); color: var(--brand); margin-bottom: var(--space-sm); }
.inquiry-card p { font-size: var(--fs-sm); color: var(--text-secondary); }
.inquiry-card .inquiry-meta { display: flex; justify-content: space-between; align-items: center; margin-top: var(--space-sm); }

/* ── Gallery Upload ── */
.gallery-upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--bg-secondary);
  margin-bottom: var(--space-xl);
}

.gallery-upload-zone:hover { border-color: var(--brand); background: rgba(var(--brand-rgb),0.03); }
.gallery-upload-zone .upload-icon { font-size: 48px; margin-bottom: var(--space-md); }
.gallery-upload-zone h4 { margin-bottom: var(--space-xs); }
.gallery-upload-zone p { font-size: var(--fs-sm); color: var(--text-muted); }

.admin-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.admin-gallery-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  height: 180px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
}

.admin-gallery-item img { width: 100%; height: 100%; object-fit: cover; }

.admin-gallery-item .gallery-item-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.admin-gallery-item:hover .gallery-item-actions { opacity: 1; }

/* ── Mobile Toggle ── */
.admin-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--brand);
  color: white;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xl);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-sticky);
  cursor: pointer;
  border: none;
}

@media (max-width: 1024px) {
  .admin-dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .admin-sidebar {
    transform: translateX(-100%);
    z-index: var(--z-modal);
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; padding: var(--space-lg); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-sidebar-toggle { display: flex; }
  .admin-table-wrapper { overflow-x: auto; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .admin-page-header { flex-direction: column; gap: var(--space-md); align-items: flex-start; }
}
