/* ============================================================
   E-MAKTAB DASHBOARD DESIGN SYSTEM — FULLY RESPONSIVE EDITION
   High-end SaaS/EdTech UI for Admin, Student & Teacher Portals
   - Fully Responsive for Desktop, Tablet, and Mobile (<640px)
   ============================================================ */

.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: #F8FAFC;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
}

/* Sidebar */
.dashboard-sidebar {
  width: 275px;
  background: #0F172A;
  color: #FFFFFF !important;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  transition: var(--transition-normal);
  z-index: 1000;
}

.sidebar-header {
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
}

.sidebar-logo {
  height: 42px;
  width: auto;
  background: #FFFFFF;
  border-radius: 6px;
  padding: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sidebar-title {
  color: #FFFFFF !important;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.sidebar-role-badge {
  font-size: 0.72rem;
  color: #FDE68A !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.sidebar-nav {
  padding: 16px 12px;
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  color: #FFFFFF !important;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  transition: var(--transition-fast);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #FFFFFF !important;
  transform: translateX(4px);
}

.sidebar-link.active {
  background: var(--primary-gradient) !important;
  color: #FFFFFF !important;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(13, 122, 95, 0.5);
}

.sidebar-link .badge-count {
  margin-left: auto;
  background: var(--gold);
  color: #FFFFFF !important;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-footer .btn {
  color: #FFFFFF !important;
  background: rgba(239, 68, 68, 0.3) !important;
  border: 1.5px solid rgba(239, 68, 68, 0.55) !important;
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.sidebar-footer .btn:hover {
  background: rgba(239, 68, 68, 0.5) !important;
  color: #FFFFFF !important;
}

/* Dashboard Main Content */
.dashboard-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.dashboard-topbar {
  height: 74px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-heading);
}

.topbar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0;
  letter-spacing: -0.02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
}

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

.user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-heading);
}

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

/* Content Area */
.dashboard-content {
  padding: 28px;
  flex-grow: 1;
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: #FFFFFF;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-fast);
}

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

.stat-info h3 {
  font-size: 1.75rem;
  color: var(--text-heading);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 3px;
  letter-spacing: -0.02em;
}

.stat-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--gold-subtle);
  color: var(--gold-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

/* Live Class Banner Card (Google Meet Exclusive) */
.live-class-card {
  background: linear-gradient(135deg, #0B5E49 0%, #063C2E 100%);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 28px -4px rgba(11, 94, 73, 0.4);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.live-class-card h3 {
  color: #FFFFFF;
  font-size: 1.35rem;
  margin-bottom: 4px;
}

.live-class-meta {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: #ECFDF5;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* Data Tables */
.data-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.data-card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FAFAFC;
  flex-wrap: wrap;
  gap: 12px;
}

.data-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0;
  letter-spacing: -0.02em;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
  min-width: 600px;
}

.custom-table th {
  background: #F8FAFC;
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-heading);
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
}

.custom-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #F1F5F9;
  color: var(--text-body);
  vertical-align: middle;
}

.custom-table tbody tr:hover {
  background: #F8FAF9;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-review { background: #E0E7FF; color: #3730A3; }
.badge-approved, .badge-active { background: #DCFCE7; color: #166534; }
.badge-rejected, .badge-suspended { background: #FEE2E2; color: #991B1B; }

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
  padding: 16px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(0.98);
  transition: var(--transition-normal);
  border: 1px solid var(--border-color);
}

.modal-overlay.active .modal-box {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #0B5E49 0%, #063C2E 100%);
  color: #FFFFFF;
}

.modal-header h3 {
  font-size: 1.15rem;
  color: #FFFFFF !important;
  font-weight: 700;
  margin: 0;
}

.close-modal-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  font-size: 1.1rem;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #FFFFFF;
  transition: var(--transition-fast);
}

.close-modal-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.modal-body {
  padding: 22px;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #FAFAFC;
}

/* ============================================================
   RESPONSIVE MEDIA QUERIES (DASHBOARD)
   ============================================================ */
@media (max-width: 991px) {
  .dashboard-sidebar {
    position: fixed;
    top: 0;
    left: -275px;
    height: 100vh;
  }

  .dashboard-sidebar.active {
    left: 0;
    box-shadow: var(--shadow-xl);
  }

  .mobile-sidebar-toggle {
    display: block;
  }

  .dashboard-topbar {
    padding: 0 16px;
    height: 66px;
  }

  .dashboard-content {
    padding: 16px;
  }

  .live-class-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .admin-charts-grid,
  .student-grid-split {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}

.admin-charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.student-grid-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

@media (max-width: 640px) {
  .topbar-title {
    font-size: 1.1rem;
  }

  .user-role-tag {
    display: none;
  }

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

  .stat-card {
    padding: 16px;
  }

  .stat-info h3 {
    font-size: 1.5rem;
  }

  .data-card-header {
    padding: 14px 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-footer {
    padding: 12px 16px;
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }
}
