/* ============================================================
   CenLearn — Unified Design System  (Mobile-First Responsive)
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Ensure font-display: swap to prevent Chrome slow network intervention warnings */
@font-face {
  font-family: 'FontAwesome';
  font-display: swap;
}

body {
  font-family: 'Inter', sans-serif;
  background: #f1f5f9;
  margin: 0;
  color: #1e293b;
}

/* Prevent horizontal scroll on mobile */
@media (max-width: 900px) {

  html,
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }
}

:root {
  --blue: #1792bb;
  --blue-dk: #0f5f80;
  --green: #10b981;
  --green-dk: #059669;
  --amber: #f59e0b;
  --amber-dk: #d97706;
  --red: #ef4444;
  --red-dk: #dc2626;
  --purple: #8b5cf6;
  --purple-dk: #6d28d9;
  --slate: #64748b;
  --sidebar-w: 240px;
  --topbar-h: 60px;
}

/* ── Hamburger Button ── */
.cl-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer !important;
  flex-shrink: 0;
  padding: 0;
  outline: none;
  transition: background .15s;
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  z-index: 10001 !important;
  pointer-events: auto !important;
  touch-action: manipulation;
}

.cl-hamburger:hover {
  background: rgba(0, 0, 0, .06);
}

.cl-hamburger:focus {
  outline: none;
  box-shadow: none;
}

.cl-hamburger i {
  font-size: 18px;
  color: #374151;
  pointer-events: none;
  line-height: 1;
}

/* ── Sidebar Overlay ── */
.cl-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 9998 !important;
  backdrop-filter: blur(2px);
  pointer-events: auto !important;
}

.cl-sidebar-overlay.active {
  display: block !important;
}

/* ── Sidebar ── */
.cl-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 9999 !important;
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
  transform: translateX(-240px);
  pointer-events: auto !important;
}

.cl-sidebar a,
.t-sidebar a,
.td-sidebar a,
.s-sidebar a,
.sd-sidebar a,
.mc-sidebar a,
.main-sidebar a,
#sidebar a {
  pointer-events: auto !important;
  cursor: pointer !important;
  touch-action: manipulation;
}

.cl-sidebar.open {
  transform: translateX(0);
}

@media(min-width: 901px) {
  .cl-sidebar {
    transform: translateX(0);
  }
}

.cl-sidebar.theme-blue {
  background: linear-gradient(180deg, #0f2027 0%, #203a43 60%, #2c5364 100%);
}

.cl-sidebar.theme-green {
  background: linear-gradient(180deg, #052e16 0%, #14532d 60%, #166534 100%);
}

.cl-sidebar.theme-amber {
  background: linear-gradient(180deg, #1c1917 0%, #292524 60%, #44403c 100%);
}

.cl-sidebar.theme-red {
  background: linear-gradient(180deg, #1c0a0a 0%, #3b0f0f 60%, #7f1d1d 100%);
}

.cl-sidebar.theme-purple {
  background: linear-gradient(180deg, #1e1b4b 0%, #312e81 60%, #4338ca 100%);
}

.sidebar-brand {
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  flex-shrink: 0;
}

.sidebar-brand .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.sidebar-brand .logo-icon i {
  color: #fff;
  font-size: 16px;
}

.sidebar-brand h2 {
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -.3px;
}

.sidebar-brand p {
  color: rgba(255, 255, 255, .4);
  font-size: 10px;
  margin: 2px 0 0;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .15);
  border-radius: 2px;
}

.nav-section {
  padding: 8px 18px 4px;
  font-size: 9.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, .3);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  color: rgba(255, 255, 255, .65);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background .18s, color .18s;
  border-left: 3px solid transparent;
  min-height: 40px;
}

.nav-item a:hover {
  background: rgba(255, 255, 255, .07);
  color: #fff;
}

.nav-item.active a {
  color: #fff;
}

.theme-blue .nav-item.active a {
  background: rgba(23, 146, 187, .18);
  border-left-color: #1792bb;
}

.theme-green .nav-item.active a {
  background: rgba(16, 185, 129, .18);
  border-left-color: #10b981;
}

.theme-amber .nav-item.active a {
  background: rgba(245, 158, 11, .18);
  border-left-color: #fcd34d;
}

.theme-red .nav-item.active a {
  background: rgba(239, 68, 68, .18);
  border-left-color: #fca5a5;
}

.theme-purple .nav-item.active a {
  background: rgba(139, 92, 246, .18);
  border-left-color: #a78bfa;
}

.nav-item a i {
  width: 16px;
  text-align: center;
  font-size: 14px;
}

.sidebar-footer {
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-avatar i {
  color: #fff;
  font-size: 15px;
}

.user-meta {
  flex: 1;
  min-width: 0;
}

.user-meta strong {
  display: block;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta span {
  color: rgba(255, 255, 255, .45);
  font-size: 10px;
}

.btn-signout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .7);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background .2s;
  width: 100%;
  justify-content: center;
  min-height: 36px;
}

.btn-signout:hover {
  background: rgba(255, 255, 255, .14);
  color: #fff;
  text-decoration: none;
}

/* ── Main Layout ── */
.cl-main {
  margin-left: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin 0s;
}

@media(min-width: 901px) {
  .cl-main {
    margin-left: var(--sidebar-w);
  }
}

.cl-topbar {
  background: #fff;
  padding: 0 32px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 12px;
}

.topbar-title h1 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.topbar-title p {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.cl-content {
  flex: 1;
  padding: 28px 32px;
}

/* ── Cards ── */
.cl-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
  overflow: hidden;
}

.cl-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.cl-card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cl-card-header h3 i {
  font-size: 14px;
  color: #64748b;
}

.cl-card-body {
  padding: 24px;
}

.cl-card-body.no-pad {
  padding: 0;
}

/* ── Stat Cards ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon i {
  font-size: 20px;
  color: #fff;
}

.stat-info strong {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}

.stat-info span {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

/* ── Class Cards ── */
.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.class-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}

.class-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
  transform: translateY(-2px);
}

.class-card-header {
  padding: 20px 20px 16px;
  position: relative;
}

.class-card-header h4 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}

.class-card-header p {
  font-size: 12px;
  color: rgba(255, 255, 255, .75);
  margin: 0;
}

.class-card-body {
  padding: 16px 20px;
}

.class-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 500;
}

.meta-chip i {
  font-size: 10px;
}

.class-code {
  display: inline-block;
  padding: 4px 12px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  font-family: monospace;
}

.class-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* ── Buttons ── */
.btn-cl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .2s, transform .1s;
  min-height: 44px;
}

.btn-cl:hover {
  opacity: .88;
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-cl:active {
  transform: translateY(0);
}

.btn-cl.sm {
  padding: 8px 14px;
  font-size: 12px;
  min-height: 38px;
}

.btn-cl.xs {
  padding: 6px 12px;
  font-size: 11px;
  min-height: 34px;
}

.btn-cl.full {
  width: 100%;
  justify-content: center;
}

.btn-blue {
  background: #1792bb;
  color: #fff;
}

.btn-green {
  background: #10b981;
  color: #fff;
}

.btn-amber {
  background: #f59e0b;
  color: #fff;
}

.btn-red {
  background: #ef4444;
  color: #fff;
}

.btn-purple {
  background: #8b5cf6;
  color: #fff;
}

.btn-ghost {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.btn-ghost:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* ── Tables ── */
.cl-table {
  width: 100%;
  border-collapse: collapse;
}

.cl-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .6px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.cl-table td {
  padding: 14px 16px;
  font-size: 13px;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}

.cl-table tbody tr:hover {
  background: #f8fafc;
}

.cl-table tbody tr:last-child td {
  border-bottom: none;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Badges ── */
.badge-cl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-green {
  background: #dcfce7;
  color: #166534;
}

.badge-amber {
  background: #fef3c7;
  color: #92400e;
}

.badge-red {
  background: #fee2e2;
  color: #991b1b;
}

.badge-purple {
  background: #ede9fe;
  color: #5b21b6;
}

.badge-slate {
  background: #f1f5f9;
  color: #475569;
}

/* ── Alerts ── */
.cl-alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.cl-alert i {
  margin-top: 1px;
  flex-shrink: 0;
}

.alert-info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* ── Forms ── */
.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.form-group {
  margin-bottom: 16px;
  flex: 1;
  min-width: 200px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.form-control-cl {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  font-family: 'Inter', sans-serif;
}

.form-control-cl:focus {
  outline: none;
  border-color: #1792bb;
  box-shadow: 0 0 0 3px rgba(23, 146, 187, .12);
}

.form-control-cl::placeholder {
  color: #94a3b8;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #94a3b8;
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
}

.empty-state p {
  font-size: 14px;
  margin: 0;
}

/* ── Modal ── */
.cl-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  padding: 16px;
}

.cl-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.cl-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  transform: translateY(20px);
  transition: transform .2s;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.cl-modal-overlay.open .cl-modal {
  transform: translateY(0);
}

.cl-modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.cl-modal-header h4 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.cl-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f1f5f9;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 16px;
  transition: background .2s;
}

.cl-modal-close:hover {
  background: #e2e8f0;
}

.cl-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.cl-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── Footer ── */
.cl-footer {
  padding: 16px 32px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

/* ══════════════════════════════════════════
   MOBILE-FIRST BASE — Sidebar always hidden on small screens
   (overrides any inline margin-left on main containers)
══════════════════════════════════════════ */
@media (max-width: 900px) {

  /* ── Hamburger always visible ── */
  .cl-hamburger {
    display: flex !important;
  }

  /* ── ALL sidebar variants hidden by default ── */
  .cl-sidebar,
  .t-sidebar,
  .td-sidebar,
  .s-sidebar,
  .sd-sidebar,
  .mc-sidebar,
  .main-sidebar,
  #sidebar {
    width: 240px !important;
    transform: translateX(-240px) !important;
    transition: transform .25s cubic-bezier(.4, 0, .2, 1) !important;
    will-change: transform;
    z-index: 9999 !important;
  }

  /* ── Slide in when .open is added ── */
  .cl-sidebar.open,
  .t-sidebar.open,
  .td-sidebar.open,
  .s-sidebar.open,
  .sd-sidebar.open,
  .mc-sidebar.open,
  .main-sidebar.open,
  #sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 6px 0 30px rgba(0, 0, 0, .45) !important;
  }

  /* ── ALL main content areas — no sidebar offset ── */
  .cl-main,
  .t-main,
  .td-main,
  .mc-main,
  .sd-main {
    margin-left: 0 !important;
    width: 100% !important;
  }

  /* ── Topbars full width ── */
  .cl-topbar,
  .t-topbar,
  .td-topbar,
  .mc-topbar,
  .sd-topbar {
    padding: 0 14px !important;
    width: 100% !important;
  }

  /* ── Content areas ── */
  .cl-content,
  .t-content,
  .td-content,
  .mc-content,
  .sd-content {
    padding: 16px 14px 40px !important;
  }

  .cl-footer {
    padding: 14px 16px;
  }

  /* ── Grids collapse ── */
  .stat-grid,
  .stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .stats-strip {
    gap: 10px !important;
  }

  .class-grid,
  .classes-grid,
  .sd-grid,
  .td-grid {
    grid-template-columns: 1fr !important;
  }

  /* ── Profile hero ── */
  .profile-hero-inner {
    padding: 20px 16px !important;
    gap: 16px !important;
  }

  .profile-stats {
    display: none !important;
  }

  .ph-stats {
    display: none !important;
  }

  .profile-info h2,
  .ph-info h2 {
    font-size: 18px !important;
  }

  /* ── Forms ── */
  .form-row {
    flex-direction: column !important;
  }

  .form-row .form-group {
    min-width: unset !important;
  }

  .form-row-2,
  .form-row-3 {
    grid-template-columns: 1fr !important;
  }

  /* ── class_view ── */
  .cv-toolbar {
    padding: 0 14px !important;
    height: auto !important;
    min-height: 54px;
    flex-wrap: wrap;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    gap: 6px;
  }

  .cv-toolbar-left,
  .cv-toolbar-right {
    flex-wrap: wrap;
    gap: 6px;
  }

  .cv-content {
    padding: 16px 14px 40px !important;
  }

  .cv-cover-inner {
    padding: 0 14px 20px !important;
  }

  .cv-cover {
    height: 160px !important;
  }

  .cv-cover-right {
    display: none !important;
  }
}

/* ══════════════════════════════════════════
   PHONE (≤ 540px) — Extra compact
══════════════════════════════════════════ */
@media (max-width: 540px) {

  .stat-grid,
  .stats-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .stat-card {
    padding: 12px;
    gap: 10px;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
  }

  .stat-info strong {
    font-size: 18px;
  }

  .cl-card-header {
    padding: 12px 14px;
  }

  .cl-card-body {
    padding: 12px 14px;
  }

  .topbar-title h1,
  .sd-topbar-title h3,
  .td-topbar-title h3 {
    font-size: 15px !important;
  }

  .topbar-title p,
  .sd-topbar-title p {
    display: none !important;
  }

  .btn-cl {
    min-height: 44px;
  }

  .btn-cl.sm {
    padding: 8px 12px;
  }

  /* Bottom-sheet modals */
  .cl-modal-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  .cl-modal {
    border-radius: 20px 20px 0 0 !important;
    max-height: 92vh;
    margin: 0 !important;
  }

  .class-actions {
    flex-direction: column;
  }

  .class-actions .btn-cl {
    width: 100%;
    justify-content: center;
  }

  .cl-table th,
  .cl-table td {
    padding: 9px 10px;
    font-size: 12px;
  }

  .cv-cover-left h1 {
    font-size: 16px !important;
  }

  .cv-tab .badge-cl {
    display: none;
  }

  .btn-accent-sm {
    padding: 7px 10px !important;
    font-size: 11px !important;
  }

  /* Live banner compact */
  .live-banner {
    padding: 10px 14px !important;
    gap: 8px !important;
  }

  .live-banner .live-title {
    font-size: 12px !important;
  }
}

/* ══════════════════════════════════════════
   CROSS-DEVICE FLUID ACCURACY & UTILITIES
   ══════════════════════════════════════════ */
.table-responsive,
.table-scroll,
.cv-table-wrap,
.cl-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

/* Ensure all HTML tables inside content areas scroll gracefully if wide */
.cl-content table,
.t-content table,
.td-content table,
.mc-content table,
.sd-content table,
.content table {
  max-width: 100%;
}

/* Flex Toolbar & Header Utilities */
.cl-toolbar-responsive {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.cl-container-fluid {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

/* Responsive Images, Video & Canvas */
img,
video,
canvas,
iframe {
  max-width: 100%;
  height: auto;
}

/* Smooth Touch Buttons & Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea,
.form-control,
.form-control-cl {
  font-size: 14px !important;
  border-radius: 8px;
  -webkit-appearance: none;
}

@media (max-width: 600px) {

  input,
  select,
  textarea,
  .btn,
  .btn-cl {
    min-height: 42px;
  }

  .modal-dialog {
    margin: 10px !important;
    max-width: calc(100vw - 20px) !important;
  }
}

/* Responsive Embeds & Frames */
.responsive-iframe-wrap {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  /* 16:9 */
  overflow: hidden;
}

.responsive-iframe-wrap iframe,
.responsive-iframe-wrap embed,
.responsive-iframe-wrap object {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ══════════════════════════════════════════
   NETWORK TOAST & RESPONSIVE TOUCH ENHANCEMENTS
   ══════════════════════════════════════════ */
.cl-net-toast {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: calc(100vw - 40px);
  word-break: break-word;
}

@media (max-width: 540px) {
  .cl-net-toast {
    left: 14px !important;
    right: 14px !important;
    bottom: 14px !important;
    width: auto !important;
    font-size: 12px !important;
    padding: 10px 14px !important;
    justify-content: center;
  }
}

/* Table scroll indicators */
.table-responsive::-webkit-scrollbar,
.table-scroll::-webkit-scrollbar,
.cl-table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb,
.table-scroll::-webkit-scrollbar-thumb,
.cl-table-responsive::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.35);
  border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb:hover,
.table-scroll::-webkit-scrollbar-thumb:hover,
.cl-table-responsive::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.6);
}

/* Card Grid Reflow on Window Resize */
@media (max-width: 768px) {
  .cl-grid-2,
  .cl-grid-3,
  .cl-grid-4 {
    grid-template-columns: 1fr !important;
  }
  
  .cl-topbar-actions,
  .topbar-right {
    gap: 6px !important;
  }
}

/* ══════════════════════════════════════════
   UNIVERSAL CENLEARN LOADER & OFFLINE SCREEN
   ══════════════════════════════════════════ */
.cl-fs-loader {
  position: fixed !important;
  inset: 0 !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 999999 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  padding: 20px !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.cl-fs-loader.active {
  opacity: 1 !important;
  pointer-events: all !important;
}

.cl-fs-loader,
.cl-fs-loader.with-backdrop {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.cl-loader-brand {
  font-size: clamp(20px, 4.5vw, 24px);
  font-weight: 800;
  margin-bottom: clamp(14px, 2.5vw, 18px);
  animation: clPulseFade 2s infinite ease-in-out;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.95);
  letter-spacing: -0.3px;
  user-select: none;
}
.cl-loader-brand .brand-cen { color: #60a5fa; }
.cl-loader-brand .brand-learn { color: #ffffff; }

.cl-loader-spinner-wrap {
  position: relative;
  width: clamp(66px, 14vw, 80px);
  height: clamp(66px, 14vw, 80px);
  margin-bottom: clamp(14px, 2.5vw, 18px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.cl-loader-spinner-wrap:hover {
  transform: scale(1.08);
}

.cl-loader-spinner-ring {
  position: absolute;
  inset: 0;
  border: 3.5px solid rgba(30, 58, 138, 0.55);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: clSpin 1s linear infinite;
  box-shadow: 0 0 20px rgba(96, 165, 250, 0.35);
  transition: border-top-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.cl-loader-spinner-ring.offline {
  border-color: rgba(239, 68, 68, 0.25);
  border-top-color: #ef4444;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
  animation: clSpin 2s linear infinite;
}

.cl-loader-spinner-ring.success {
  border-color: rgba(16, 185, 129, 0.25);
  border-top-color: #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.cl-loader-logo {
  width: clamp(42px, 9vw, 52px);
  height: clamp(42px, 9vw, 52px);
  object-fit: contain;
  border-radius: 50%;
  background-color: #ffffff;
  padding: 3px;
  animation: clPulseLogo 2s infinite ease-in-out;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
  user-select: none;
}

.cl-loader-text {
  font-size: clamp(13px, 3vw, 15px);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: flex-end;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
  text-align: center;
  max-width: 90vw;
  user-select: none;
}

.cl-loader-close-btn {
  position: absolute;
  top: 24px;
  right: 28px;
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
  z-index: 1000000;
  padding: 0;
  outline: none;
}
.cl-loader-close-btn:hover {
  background: rgba(239, 68, 68, 0.95);
  border-color: #ef4444;
  transform: scale(1.1);
}

.cl-loader-retry-btn {
  margin-top: 18px;
  padding: 9px 24px;
  background: rgba(30, 41, 59, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
}
.cl-loader-retry-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: #38bdf8;
  transform: scale(1.05);
}

@keyframes clSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes clPulseLogo {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes clPulseFade {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}
.loading-dots {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  animation: clDotsWidth 1.5s steps(4, end) infinite;
}
.loading-dots::after {
  content: '...';
}
@keyframes clDotsWidth {
  0% { width: 0px; }
  100% { width: 1.25em; }
}

/* ═══════════════ CLASSWORK TAB STYLES ═══════════════ */
.cv-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid #e2e8f0;
  margin-bottom: 14px;
}
.cv-section-hdr h2 {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}
.cv-section-hdr span {
  font-size: 11px;
  color: #64748b;
  font-weight: 700;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}
.cw-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cw-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.cw-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}
.cw-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
}
.cw-card-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.cw-type-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  margin-top: 2px;
}
.cw-card-info {
  flex: 1;
  min-width: 0;
}
.cw-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px;
  line-height: 1.35;
  word-break: break-word;
}
.cw-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: #64748b;
  font-weight: 500;
  margin-top: 3px;
}
.cw-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cw-card-meta i {
  font-size: 11.5px;
}
.cw-card-desc {
  font-size: 12px;
  color: #64748b;
  margin: 6px 0 0;
  line-height: 1.45;
  word-break: break-word;
}
.cw-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.2px;
  line-height: 1.4;
}
.status-pill.status-open {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
.status-pill.status-closed {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.status-pill.status-submitted {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}
.status-pill.status-graded,
.status-pill.status-done {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  box-shadow: 0 1px 3px rgba(22, 101, 52, 0.08);
}
@media (max-width: 768px) {
  .cw-card {
    padding: 12px 14px;
  }
  .cw-card-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .cw-card-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
  }
  .cw-type-badge {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }
  .cw-card-title {
    font-size: 13.5px;
  }
  .cw-card-meta {
    gap: 8px;
    font-size: 11px;
  }
}
@media (max-width: 480px) {
  .cv-section-hdr h2 {
    font-size: 14px;
  }
  .cw-card-main {
    gap: 10px;
  }
  .cw-card-actions {
    flex-wrap: wrap;
    justify-content: stretch;
    gap: 6px;
  }
  .cw-card-actions > * {
    flex: 1;
    text-align: center;
    justify-content: center;
  }
  .cw-card-meta span {
    font-size: 10.5px;
  }
}

/* ═══════════════ MODERN RESPONSIVE MODULE / FILE CARDS ═══════════════ */
.mod-grid { display:flex;flex-direction:column;gap:8px; }
.mod-card { background:#fff;border:1px solid #e2e8f0;border-radius:12px;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 16px;box-shadow:0 1px 3px rgba(0,0,0,0.02);transition:all .2s cubic-bezier(.4,0,.2,1); }
.mod-card:hover { border-color:rgba(16,185,129,.35);box-shadow:0 4px 14px rgba(16,185,129,.08);transform:translateY(-1px); }
.mod-card-main { display:flex;align-items:center;gap:12px;flex:1;min-width:0; }
.mod-card-icon { width:42px;height:42px;border-radius:10px;flex-shrink:0;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 6px rgba(0,0,0,0.06); }
.mod-card-icon i { font-size:18px; }
.mod-card-body { flex:1;min-width:0; }
.mod-card-title { font-size:13.5px;font-weight:700;color:#0f172a;margin:0 0 3px;word-break:break-word;line-height:1.35; }
.mod-card-meta { display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:11.5px;color:#64748b;font-weight:500;margin-top:2px; }
.mod-card-meta span { display:inline-flex;align-items:center;gap:4px; }
.mod-card-meta i { font-size:11px; }
.mod-card-actions { display:flex;align-items:center;gap:6px;flex-shrink:0; }

/* ═══════════════ ICONIC CLEAN FOLDER TILES (NO WHITE CARD BOX) ═══════════════ */
.folder-grid { display:grid;grid-template-columns:repeat(auto-fill, minmax(105px, 1fr));gap:12px;margin-bottom:18px; }
.folder-card { position:relative;background:transparent;border:none;border-radius:10px;padding:8px 6px;display:flex;flex-direction:column;align-items:center;text-align:center;text-decoration:none;color:inherit;cursor:pointer;transition:all .18s cubic-bezier(.4,0,.2,1);user-select:none; }
.folder-card:hover { transform:translateY(-2px);background:rgba(245,158,11,.08);color:inherit;text-decoration:none; }
.folder-card:hover .folder-svg .fld-paper { transform:translateY(-4px); }
.folder-svg-wrap { display:flex;align-items:center;justify-content:center;margin-bottom:4px; }
.folder-card-name { font-size:12px;font-weight:600;color:#1e293b;line-height:1.25;margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;word-break:break-word;max-width:100%; }
.folder-card:hover .folder-card-name { color:#0f172a;font-weight:700; }
.folder-card-menu { position:absolute;top:2px;right:2px;display:flex;align-items:center;gap:3px;opacity:0;transition:opacity .15s ease-in-out;z-index:2; }
.folder-card:hover .folder-card-menu { opacity:1; }
.folder-opt-btn { width:20px;height:20px;border-radius:5px;background:#ffffff;border:1px solid #e2e8f0;color:#475569;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;font-size:9.5px;box-shadow:0 1px 3px rgba(0,0,0,.08);transition:all .15s; }
.folder-opt-btn:hover { background:#f8fafc;color:#0f172a; }
.folder-opt-btn.text-danger:hover { background:#fee2e2;color:#dc2626;border-color:#fca5a5; }

/* ═══════════════ FOLDER NAVIGATION & RESPONSIVENESS ═══════════════ */
.folder-nav-bar { display:flex;align-items:center;justify-content:space-between;background:#fff;border:1.5px solid #e2e8f0;border-radius:12px;padding:10px 16px;margin-bottom:14px;gap:12px;flex-wrap:wrap;box-shadow:0 1px 3px rgba(0,0,0,0.02); }
.folder-breadcrumb { display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600;color:#64748b;flex-wrap:wrap; }

@media(max-width:768px){
  .folder-grid { grid-template-columns:repeat(auto-fill, minmax(95px, 1fr));gap:8px; }
  .folder-card { padding:6px 4px; }
  .folder-card-menu { opacity:1; }
  .mod-card { flex-direction:column;align-items:flex-start;padding:12px 14px;gap:10px; }
  .mod-card-main { width:100%; }
  .mod-card-actions { width:100%;justify-content:flex-end;padding-top:8px;border-top:1px solid #f1f5f9; }
  .folder-nav-bar { flex-direction:column;align-items:flex-start; }
  .folder-nav-bar > div:last-child { width:100%;justify-content:flex-start; }
}
@media(max-width:480px){
  .folder-grid { grid-template-columns:repeat(4, 1fr);gap:6px; }
  .folder-svg { width:44px !important;height:35px !important; }
  .folder-card-name { font-size:11px; }
  .mod-card-actions { flex-wrap:wrap;justify-content:stretch; }
  .mod-card-actions > * { flex:1;text-align:center;justify-content:center; }
}
@media(max-width:360px){
  .folder-grid { grid-template-columns:repeat(3, 1fr);gap:6px; }
}

/* ═══════════════ UNIVERSAL RESPONSIVE UTILITIES ═══════════════ */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 12px;
}
.table-responsive > table {
  margin-bottom: 0;
}
.cv-modal-overlay {
  padding: 8px;
}
.cv-modal {
  max-width: min(96vw, 1200px) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
@media (max-width: 768px) {
  .cv-modal {
    max-width: 98vw !important;
    margin: 6px auto !important;
    border-radius: 12px !important;
  }
  .cv-modal-head {
    padding: 12px 16px !important;
  }
  .cv-modal-body {
    padding: 16px 14px !important;
  }
  .cv-modal-foot {
    padding: 12px 16px !important;
    flex-wrap: wrap !important;
  }
  .stats-strip, .stat-pill-row {
    flex-wrap: wrap !important;
  }
  .stat-pill {
    min-width: 130px !important;
    flex: 1 1 calc(50% - 10px) !important;
  }
}
@media (max-width: 480px) {
  .stat-pill {
    min-width: 100% !important;
  }
  .sd-topbar {
    padding: 0 14px !important;
  }
  .sd-content {
    padding: 14px 14px 36px !important;
  }
}
