:root {
  --primary: #6366f1;
  --secondary: #ec4899;
  --accent: #8b5cf6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --dark-bg: #0b0f19;
  --dark-card: #111827;
  --dark-sidebar: #0f172a;
  --light-text: #f8fafc;
  --gray-text: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.08);
  --primary-color: var(--primary);
  --danger-color: var(--danger);
  --card-bg: var(--dark-card);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--dark-bg);
  color: var(--light-text);
  min-height: 100vh;
  display: flex;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

/* Login Page Styling */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 24px;
  background: radial-gradient(circle at center, #111827, #030712);
}

.login-wrapper {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: var(--dark-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 3rem 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.login-logo-section {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  height: 56px;
  width: auto;
  margin-bottom: 1rem;
}

.login-logo-section h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.login-logo-section p {
  font-size: 0.875rem;
  color: var(--gray-text);
}

.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--gray-text);
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1.25rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
}

.form-group input, .form-group select, .form-group textarea {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 6px;
  color: white;
  font-size: 0.95rem;
  font-family: inherit;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-outline {
  border: 1px solid var(--border-color);
  color: white;
  background: transparent;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
}

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Admin Panel Layout */
.admin-container {
  display: flex;
  width: 100%;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: var(--dark-sidebar);
  border-right: 1px solid var(--border-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
}

.sidebar-logo {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo img {
  height: 40px;
}

.sidebar-logo span {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  padding: 1.5rem 0;
  flex-grow: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 1.5rem;
  color: var(--gray-text);
  font-weight: 500;
  font-size: 0.95rem;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
  color: white;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-nav a.active {
  border-left: 3px solid var(--primary);
  padding-left: calc(1.5rem - 3px);
  color: var(--primary);
}

.sidebar-user {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--gray-text);
}

.logout-link {
  color: var(--danger);
  font-weight: 600;
}

.logout-link:hover {
  text-decoration: underline;
}

/* Main Content Area */
.admin-content {
  margin-left: 260px;
  flex-grow: 1;
  padding: 2.5rem;
  min-width: 0;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.admin-header h1 {
  font-size: 2rem;
  font-weight: 800;
}

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

.stat-card {
  background: var(--dark-card);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 12px;
}

.stat-header {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: white;
}

/* Data Tables */
.table-card {
  background: var(--dark-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

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

.table-card-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.filters-form {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

th {
  background: rgba(255, 255, 255, 0.02);
  font-weight: 600;
  color: var(--gray-text);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-pending { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-confirmed { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-cancelled { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-refunded { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }

.badge-created { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-captured { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-failed { background: rgba(239, 68, 68, 0.15); color: #f87171; }

/* Course List / Editor Grid */
.courses-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.course-admin-card {
  background: var(--dark-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.course-admin-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.course-admin-desc {
  font-size: 0.85rem;
  color: var(--gray-text);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.course-admin-meta {
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
}

.course-admin-actions {
  display: flex;
  gap: 0.75rem;
}

.course-admin-actions a, .course-admin-actions button {
  flex-grow: 1;
  text-align: center;
}

/* Modal details overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-card {
  background: var(--dark-card);
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: 500px;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

.modal-header {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close-btn {
  font-size: 1.5rem;
  cursor: pointer;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.pagination-item {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.85rem;
}

.pagination-item:hover, .pagination-item.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

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

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }
  
  .admin-sidebar {
    width: 100%;
    min-height: auto;
    position: relative;
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  
  .sidebar-logo {
    border-bottom: none;
    padding: 1rem;
  }
  
  .sidebar-nav {
    display: flex;
    flex-direction: row;
    padding: 0;
    flex-wrap: wrap;
    width: 100%;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
  }
  
  .sidebar-nav a {
    padding: 10px 1rem;
    font-size: 0.85rem;
  }
  
  .sidebar-nav a.active {
    border-left: none;
    border-bottom: 2px solid var(--primary);
    padding-left: 1rem;
  }
  
  .sidebar-user {
    width: 100%;
    padding: 10px 1rem;
    border-top: none;
    justify-content: flex-end;
    gap: 1rem;
  }
  
  .admin-content {
    margin-left: 0;
    padding: 1.5rem;
  }
  
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .stats-row {
    grid-template-columns: 1fr;
  }
}
