/* ============================================================
   Gyanada Institute – Admin Panel Stylesheet
   File: admin/assets/admin.css
   ============================================================ */

/* ---- Variables ---- */
:root {
  --primary:       #0096c7;
  --primary-dark:  #0077b6;
  --primary-light: #00aadf;
  --accent:        #f5c518;
  --accent-dark:   #c9a000;
  --secondary:     #06b6d4;
  --success:       #22c55e;
  --warning:       #eab308;
  --danger:        #ef4444;
  --info:          #3b82f6;
  --sidebar-w:     260px;
  --topbar-h:      64px;
  --text-dark:     #111827;
  --text-body:     #374151;
  --text-muted:    #6b7280;
  --text-light:    #9ca3af;
  --bg-white:      #ffffff;
  --bg-light:      #f8fafc;
  --bg-gray:       #f1f5f9;
  --border:        #e2e8f0;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.07);
  --shadow:        0 4px 16px rgba(0,0,0,.08);
  --shadow-md:     0 8px 30px rgba(0,0,0,.12);
  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     16px;
  --radius-full:   9999px;
  --font:          'Raleway', sans-serif;
  --transition:    all .25s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text-body); background: var(--bg-gray); line-height: 1.65; overflow-x: hidden; }
img  { max-width: 100%; display: block; }
a    { text-decoration: none; color: inherit; transition: var(--transition); }
ul   { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, textarea, select { font-family: var(--font); }
h1,h2,h3,h4,h5,h6 { font-weight: 700; color: var(--text-dark); line-height: 1.25; }

/* ================================================================
   LOGIN PAGE
================================================================ */
.login-body { background: var(--bg-gray); }

.login-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ---- Left Branding Panel ---- */
.login-branding {
  background: linear-gradient(145deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 56px;
}

.lb-circles .c1,.lb-circles .c2,.lb-circles .c3 {
  position: absolute;
  border-radius: 50%;
  opacity: .08;
  background: #fff;
}
.lb-circles .c1 { width: 420px; height: 420px; top: -100px; right: -100px; }
.lb-circles .c2 { width: 280px; height: 280px; bottom: 60px; left: -80px; }
.lb-circles .c3 { width: 160px; height: 160px; bottom: 200px; right: 60px; }

.login-brand-inner { position: relative; z-index: 2; color: #fff; max-width: 400px; }

.lb-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 40px; }
.lb-icon { width: 52px; height: 52px; background: rgba(255,255,255,.15); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.lb-name { font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; }
.lb-tagline { font-size: .78rem; color: rgba(255,255,255,.65); font-weight: 500; }

.login-brand-inner h1 { font-size: 2.4rem; font-weight: 800; line-height: 1.2; margin-bottom: 14px; }
.login-brand-inner h1 span { color: var(--accent); }
.login-brand-inner > p { font-size: .92rem; color: rgba(255,255,255,.75); margin-bottom: 36px; line-height: 1.7; }

.lb-features { display: flex; flex-direction: column; gap: 14px; }
.lb-feat { display: flex; align-items: center; gap: 12px; font-size: .88rem; color: rgba(255,255,255,.85); }
.lb-feat i { width: 34px; height: 34px; background: rgba(255,255,255,.12); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: .9rem; flex-shrink: 0; }

/* ---- Right Form Panel ---- */
.login-form-panel { display: flex; align-items: center; justify-content: center; padding: 60px 40px; background: var(--bg-white); }

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

.lf-header { margin-bottom: 32px; }
.lf-header h2 { font-size: 1.65rem; font-weight: 800; margin-bottom: 6px; }
.lf-header p  { color: var(--text-muted); font-size: .9rem; }

.lf-form { display: flex; flex-direction: column; gap: 20px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: .84rem; font-weight: 600; color: var(--text-dark); }

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon-wrap > i:first-child {
  position: absolute; left: 14px;
  color: var(--text-light); font-size: .9rem;
  pointer-events: none;
}
.input-icon-wrap input {
  width: 100%;
  padding: 13px 44px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: .92rem;
  color: var(--text-dark);
  background: var(--bg-light);
  outline: none;
  transition: var(--transition);
}
.input-icon-wrap input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(0,150,199,.08); }

.pw-toggle {
  position: absolute; right: 14px;
  color: var(--text-light); font-size: .88rem;
  cursor: pointer; padding: 4px;
}
.pw-toggle:hover { color: var(--primary); }

.lf-options { display: flex; justify-content: space-between; align-items: center; }
.remember-me { display: flex; align-items: center; gap: 7px; font-size: .85rem; color: var(--text-muted); cursor: pointer; }
.remember-me input { accent-color: var(--primary); width: 15px; height: 15px; }
.forgot-link { font-size: .82rem; color: var(--primary); font-weight: 600; }
.forgot-link:hover { color: var(--primary-dark); }

.btn-login {
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-radius: var(--radius);
  font-size: .98rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 22px rgba(0,150,199,.3);
  transition: var(--transition);
  margin-top: 4px;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,150,199,.4); }

.lf-footer { margin-top: 28px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.back-link { font-size: .82rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.back-link:hover { color: var(--primary); }
.lf-hint { font-size: .78rem; color: var(--text-muted); }

/* ================================================================
   ALERTS
================================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .87rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.alert-danger  { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.alert-info    { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }

/* ================================================================
   ADMIN LAYOUT (sidebar + topbar + content)
================================================================ */
/* admin-layout: sidebar is position:fixed, so we just need the main area to offset itself */
.admin-layout { display: block; min-height: 100vh; }

/* ---- Sidebar ---- */
.admin-sidebar {
  background: var(--primary-dark);
  width: var(--sidebar-w);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: transform .3s ease;
}

.sidebar-logo {
  padding: 22px 22px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-logo-icon { width: 40px; height: 40px; background: rgba(255,255,255,.12); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--accent); }
.sidebar-logo-text .name    { font-size: 1.05rem; font-weight: 800; color: #fff; }
.sidebar-logo-text .tagline { font-size: .7rem; color: rgba(255,255,255,.5); }

.sidebar-nav { flex: 1; padding: 18px 12px; }

.nav-section-title {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.35);
  padding: 14px 10px 8px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius);
  color: rgba(255,255,255,.7);
  font-size: .87rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
}
.nav-item i { width: 20px; text-align: center; font-size: .92rem; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
.nav-item .nav-badge { margin-left: auto; background: var(--accent); color: #fff; font-size: .68rem; padding: 2px 7px; border-radius: var(--radius-full); font-weight: 700; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-admin-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.sai-avatar { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1rem; flex-shrink: 0; }
.sai-name   { font-size: .84rem; font-weight: 600; color: #fff; }
.sai-role   { font-size: .72rem; color: rgba(255,255,255,.5); }
.btn-logout { width: 100%; padding: 9px; background: rgba(239,68,68,.15); color: #fca5a5; border-radius: var(--radius); font-size: .84rem; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; transition: var(--transition); }
.btn-logout:hover { background: rgba(239,68,68,.28); color: #fff; }

/* ---- Main Wrapper ---- */
.admin-main { margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; transition: margin-left .3s ease; }

/* ---- Topbar ---- */
.admin-topbar {
  height: var(--topbar-h);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-page-title { font-size: 1.1rem; font-weight: 700; color: var(--text-dark); }
.topbar-breadcrumb { font-size: .8rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.topbar-breadcrumb a { color: var(--primary); }

.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-btn-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  background: var(--bg-light);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: .95rem;
  cursor: pointer; transition: var(--transition);
  position: relative;
}
.topbar-btn-icon:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.topbar-notif-dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; border: 2px solid var(--bg-white); }
.sidebar-toggle { display: none; }

.topbar-admin {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-light);
  cursor: pointer;
  transition: var(--transition);
}
.topbar-admin:hover { border-color: var(--primary); background: rgba(0,150,199,.04); }
.topbar-admin-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; color: #fff; font-size: .85rem; }
.topbar-admin-name { font-size: .83rem; font-weight: 600; color: var(--text-dark); }
.topbar-admin i.fa-chevron-down { font-size: .7rem; color: var(--text-muted); }

/* ---- Page Content ---- */
.admin-content { flex: 1; padding: 28px; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 14px;
}
.page-header-title h1 { font-size: 1.45rem; font-weight: 800; margin-bottom: 4px; }
.page-header-title p  { font-size: .86rem; color: var(--text-muted); }
.page-header-actions  { display: flex; gap: 10px; flex-wrap: wrap; }

/* ================================================================
   BUTTONS
================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: .87rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover   { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,150,199,.3); }
.btn-accent    { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover    { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-success   { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover   { filter: brightness(.9); }
.btn-danger    { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover    { filter: brightness(.9); }
.btn-outline   { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover   { background: var(--primary); color: #fff; }
.btn-ghost     { background: var(--bg-light); color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover     { background: var(--border); color: var(--text-dark); }
.btn-sm        { padding: 7px 14px; font-size: .8rem; }
.btn-icon      { padding: 8px; width: 36px; height: 36px; justify-content: center; border-radius: var(--radius-sm); }

/* ================================================================
   STAT CARDS
================================================================ */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }
.stat-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 18px;
}
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.stat-card.blue::before   { background: var(--primary); }
.stat-card.orange::before { background: var(--accent); }
.stat-card.green::before  { background: var(--success); }
.stat-card.cyan::before   { background: var(--secondary); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.blue   .stat-icon { background: rgba(0,150,199,.1);  color: var(--primary); }
.orange .stat-icon { background: rgba(245,197,24,.1); color: var(--accent); }
.green  .stat-icon { background: rgba(34,197,94,.1);  color: var(--success); }
.cyan   .stat-icon { background: rgba(6,182,212,.1);  color: var(--secondary); }

.stat-info {}
.stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1.1; color: var(--text-dark); }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.stat-change { font-size: .75rem; font-weight: 600; display: flex; align-items: center; gap: 3px; margin-top: 4px; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ================================================================
   DATA TABLE CARD
================================================================ */
.table-card { background: var(--bg-white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--border); overflow: hidden; }
.table-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-white);
}
.table-card-title { font-size: .98rem; font-weight: 700; color: var(--text-dark); display: flex; align-items: center; gap: 8px; }
.table-card-title i { color: var(--primary); }
.table-card-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-light);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
}
.search-box input { background: none; border: none; outline: none; font-size: .85rem; color: var(--text-dark); width: 180px; }
.search-box i { color: var(--text-muted); font-size: .85rem; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 14px 16px;
  font-size: .86rem;
  color: var(--text-body);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--bg-light); }

.course-thumb { width: 52px; height: 38px; border-radius: 6px; object-fit: cover; }
.course-title-cell { font-weight: 600; color: var(--text-dark); max-width: 220px; line-height: 1.35; }
.course-title-cell small { font-weight: 400; color: var(--text-muted); display: block; font-size: .75rem; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
}
.badge-success { background: #dcfce7; color: #16a34a; }
.badge-danger  { background: #fee2e2; color: #dc2626; }
.badge-warning { background: #fef9c3; color: #ca8a04; }
.badge-info    { background: #dbeafe; color: #1d4ed8; }
.badge-primary { background: rgba(0,150,199,.1); color: var(--primary); }
.badge-accent  { background: rgba(245,197,24,.1); color: var(--accent); }
.badge-secondary { background: rgba(6,182,212,.1); color: var(--secondary); }

.action-btns { display: flex; gap: 6px; }
.table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: .82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 10px;
}
.pagination-btns { display: flex; gap: 4px; }
.pg-btn { padding: 6px 12px; border-radius: var(--radius-sm); background: var(--bg-light); border: 1px solid var(--border); font-size: .8rem; font-weight: 500; cursor: pointer; transition: var(--transition); }
.pg-btn.active,.pg-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ================================================================
   FORM CARD (Add / Edit Course)
================================================================ */
.form-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 22px;
}
.form-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-light);
}
.form-card-header h3 { font-size: 1rem; font-weight: 700; color: var(--text-dark); }
.form-card-header i  { color: var(--primary); }
.form-card-body { padding: 24px; }

.form-grid         { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid-3       { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.form-full         { grid-column: 1 / -1; }

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label { font-size: .82rem; font-weight: 600; color: var(--text-dark); }
.field-group label .req { color: var(--danger); margin-left: 2px; }

.form-control {
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: .88rem;
  color: var(--text-dark);
  background: var(--bg-white);
  outline: none;
  transition: var(--transition);
  width: 100%;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,150,199,.08); }
.form-control::placeholder { color: var(--text-light); }
textarea.form-control { resize: vertical; min-height: 100px; line-height: 1.6; }
select.form-control { cursor: pointer; }
.form-hint { font-size: .76rem; color: var(--text-muted); margin-top: 3px; }

/* Dynamic list builder */
.dynamic-list { display: flex; flex-direction: column; gap: 8px; }
.dynamic-row { display: flex; align-items: center; gap: 8px; }
.dynamic-row input { flex: 1; }
.btn-remove-row { width: 32px; height: 32px; background: #fee2e2; color: var(--danger); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: var(--transition); }
.btn-remove-row:hover { background: var(--danger); color: #fff; }
.btn-add-row { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-size: .82rem; font-weight: 600; cursor: pointer; padding: 6px 0; background: none; border: none; transition: var(--transition); }
.btn-add-row:hover { color: var(--primary-dark); }

/* Curriculum builder */
.module-block {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}
.module-head {
  padding: 12px 16px;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  gap: 10px;
}
.module-head input { flex: 1; background: var(--bg-white); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 7px 12px; font-size: .88rem; outline: none; }
.module-head input:focus { border-color: var(--primary); }
.btn-remove-module { width: 30px; height: 30px; background: #fee2e2; color: var(--danger); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.btn-remove-module:hover { background: var(--danger); color: #fff; }
.module-lessons { padding: 10px 16px 14px; display: flex; flex-direction: column; gap: 6px; }
.lesson-row { display: flex; align-items: center; gap: 8px; }
.lesson-row input.lesson-input { flex: 1; background: var(--bg-white); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 7px 12px; font-size: .85rem; outline: none; }
.lesson-row input.lesson-input:focus { border-color: var(--primary); }
.lesson-row select { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 7px 10px; font-size: .78rem; outline: none; background: var(--bg-white); }

/* Image preview */
.img-preview-wrap { position: relative; border: 2px dashed var(--border); border-radius: var(--radius); overflow: hidden; min-height: 130px; display: flex; align-items: center; justify-content: center; background: var(--bg-light); cursor: pointer; transition: var(--transition); }
.img-preview-wrap:hover { border-color: var(--primary); background: rgba(0,150,199,.03); }
.img-preview-wrap img { width: 100%; height: 160px; object-fit: cover; display: block; }
.img-preview-placeholder { text-align: center; color: var(--text-muted); font-size: .85rem; }
.img-preview-placeholder i { font-size: 2rem; display: block; margin-bottom: 8px; color: var(--border); }

/* Form sticky footer */
.form-actions {
  position: sticky;
  bottom: 0;
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  z-index: 50;
  box-shadow: 0 -4px 16px rgba(0,0,0,.06);
}

/* ================================================================
   DASHBOARD WIDGETS
================================================================ */
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }

.widget-card { background: var(--bg-white); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow: hidden; }
.widget-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.widget-title { font-size: .94rem; font-weight: 700; color: var(--text-dark); display: flex; align-items: center; gap: 8px; }
.widget-title i { color: var(--primary); }
.widget-body  { padding: 20px; }

/* Recent Activity */
.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-item { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-icon { width: 34px; height: 34px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: .85rem; flex-shrink: 0; }
.activity-icon.add    { background: #dcfce7; color: var(--success); }
.activity-icon.edit   { background: #dbeafe; color: var(--info); }
.activity-icon.delete { background: #fee2e2; color: var(--danger); }
.activity-icon.login  { background: rgba(0,150,199,.1); color: var(--primary); }
.activity-text { flex: 1; }
.activity-text strong { font-size: .86rem; color: var(--text-dark); display: block; }
.activity-text span   { font-size: .78rem; color: var(--text-muted); }

/* Category Pills */
.cat-pills { display: flex; flex-direction: column; gap: 10px; }
.cat-pill { display: flex; align-items: center; gap: 10px; }
.cat-pill-label { font-size: .82rem; color: var(--text-muted); min-width: 110px; }
.cat-pill-bar { flex: 1; height: 7px; background: var(--bg-gray); border-radius: var(--radius-full); overflow: hidden; }
.cat-pill-fill { height: 100%; border-radius: var(--radius-full); background: var(--primary); }
.cat-pill-count { font-size: .8rem; font-weight: 700; color: var(--text-dark); min-width: 28px; text-align: right; }

/* ================================================================
   EMPTY STATE
================================================================ */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state i { font-size: 3rem; color: var(--border); margin-bottom: 16px; }
.empty-state h4 { font-size: 1rem; margin-bottom: 6px; }
.empty-state p  { font-size: .85rem; color: var(--text-muted); margin-bottom: 20px; }

/* ================================================================
   TOAST / FLASH
================================================================ */
.toast-container { position: fixed; top: 78px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 280px; max-width: 380px;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border-left: 4px solid;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideInRight .3s ease;
}
.toast.success { border-color: var(--success); }
.toast.danger  { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
.toast.info    { border-color: var(--info); }
.toast i { font-size: 1.1rem; margin-top: 1px; flex-shrink: 0; }
.toast.success i { color: var(--success); }
.toast.danger  i { color: var(--danger); }
.toast.warning i { color: var(--warning); }
.toast.info    i { color: var(--info); }
.toast-msg { flex: 1; font-size: .85rem; color: var(--text-body); font-weight: 500; }
.toast-close { cursor: pointer; color: var(--text-light); font-size: .8rem; padding: 2px; line-height: 1; }
.toast-close:hover { color: var(--text-dark); }

@keyframes slideInRight { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ================================================================
   MODAL
================================================================ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(3px); z-index: 8000; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .25s; }
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal-box { background: var(--bg-white); border-radius: var(--radius-lg); max-width: 480px; width: 100%; padding: 28px; box-shadow: 0 25px 60px rgba(0,0,0,.25); transform: scale(.93); transition: transform .25s; }
.modal-backdrop.open .modal-box { transform: scale(1); }
.modal-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }
.modal-body  { font-size: .88rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ================================================================
   SIDEBAR OVERLAY  (used on mobile/tablet)
================================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(2px);
  z-index: 199;
  transition: opacity .3s ease;
}
.sidebar-overlay.show { display: block; }

/* body scroll lock when sidebar open */
body.sidebar-open { overflow: hidden; }

/* ================================================================
   RESPONSIVE
================================================================ */

/* ---------- 1200px – large tablets / small desktops ---------- */
@media (max-width: 1200px) {
  .stats-grid       { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid   { grid-template-columns: 1fr; }
  .form-grid-3      { grid-template-columns: 1fr 1fr; }
  :root             { --sidebar-w: 230px; }
}

/* ---------- 1024px ---------- */
@media (max-width: 1024px) {
  .admin-content    { padding: 22px; }
  .stat-value       { font-size: 1.45rem; }
  .search-box input { width: 140px; }
  .topbar-admin-name { display: none; }
}

/* ---------- 900px – sidebar goes off-canvas ---------- */
@media (max-width: 900px) {
  :root { --sidebar-w: 260px; }

  .admin-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0,0,0,.25);
  }
  /* Sidebar is off-canvas: content takes full width */
  .admin-main      { margin-left: 0 !important; width: 100%; }
  .sidebar-toggle  { display: flex !important; }

  .form-grid       { grid-template-columns: 1fr; }
  .form-grid-3     { grid-template-columns: 1fr; }

  /* Tables scroll horizontally */
  .table-card      { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table      { min-width: 600px; }

  /* Stats two columns on tablet */
  .stats-grid      { grid-template-columns: repeat(2, 1fr); gap: 14px; }

  /* Dashboard widgets stack */
  .dashboard-grid  { grid-template-columns: 1fr; gap: 18px; }
}

/* ---------- 768px ---------- */
@media (max-width: 768px) {
  html { font-size: 14px; }

  .admin-topbar {
    padding: 0 16px;
    height: 56px;
  }
  :root { --topbar-h: 56px; }

  .topbar-breadcrumb    { display: none; }
  .topbar-page-title    { font-size: 1rem; }
  .page-header-title h1 { font-size: 1.2rem; }

  .stats-grid   { gap: 14px; }
  .stat-card    { padding: 18px; gap: 14px; }
  .stat-icon    { width: 44px; height: 44px; font-size: 1.1rem; }
  .stat-value   { font-size: 1.35rem; }

  .table-card-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .table-card-actions { width: 100%; }
  .search-box   { width: 100%; }
  .search-box input { width: 100%; }

  /* Lesson row wraps */
  .lesson-row { flex-wrap: wrap; }
  .lesson-row input.lesson-input { min-width: 0; }

  /* Module head wraps */
  .module-head { flex-wrap: wrap; }

  /* Form actions stack */
  .form-actions { padding: 14px 16px; gap: 8px; flex-wrap: wrap; }
  .form-actions .btn { flex: 1; justify-content: center; min-width: 120px; }

  /* Pagination */
  .table-pagination { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ---------- 600px ---------- */
@media (max-width: 600px) {
  .stats-grid           { grid-template-columns: 1fr; }
  .admin-content        { padding: 14px; }
  .page-header          { flex-direction: column; gap: 10px; }
  .page-header-actions  { width: 100%; }
  .page-header-actions .btn { width: 100%; justify-content: center; }

  .topbar-right         { gap: 8px; }

  /* Toast left/right fill on mobile */
  .toast-container { left: 12px; right: 12px; top: 66px; }
  .toast           { min-width: unset; max-width: unset; width: 100%; }

  /* Modal fills screen */
  .modal-backdrop { padding: 12px; }
  .modal-box      { padding: 22px 18px; }

  /* Cat pill label shorter */
  .cat-pill-label { min-width: 80px; font-size: .75rem; }

  /* Login page */
  .login-page           { grid-template-columns: 1fr; }
  .login-branding       { display: none; }
  .login-form-panel     { padding: 36px 20px; }
  .login-form-inner     { max-width: 100%; }
}

/* ---------- 480px ---------- */
@media (max-width: 480px) {
  html { font-size: 13.5px; }

  .admin-topbar         { padding: 0 12px; }
  .admin-content        { padding: 12px; }

  .stat-card            { padding: 16px 14px; gap: 12px; }
  .stat-icon            { width: 40px; height: 40px; font-size: 1rem; }
  .stat-value           { font-size: 1.25rem; }

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

  .btn                  { padding: 9px 14px; }
  .btn-sm               { padding: 6px 11px; font-size: .76rem; }

  .action-btns          { gap: 4px; }

  .data-table th,
  .data-table td        { padding: 10px 12px; }

  .widget-body          { padding: 14px; }
  .widget-header        { padding: 13px 16px; }

  /* Curriculum lesson row: stack type & duration below title */
  .lesson-row { gap: 6px; }
  .lesson-row select { width: 100%; }
}

/* ---------- 360px ---------- */
@media (max-width: 360px) {
  html { font-size: 13px; }
  .admin-content { padding: 10px; }
  .stats-grid { gap: 10px; }
  .stat-value { font-size: 1.15rem; }
  .topbar-btn-icon { width: 34px; height: 34px; }
}

/* ================================================================
   IMAGE UPLOAD DROP AREA
================================================================ */
.upload-drop-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-light);
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
  position: relative;
}
.upload-drop-area:hover,
.upload-drop-area.drag-over {
  border-color: var(--primary);
  background: rgba(0,150,199,.04);
}
.upload-drop-area.drag-over { box-shadow: 0 0 0 4px rgba(0,150,199,.12); }

.upload-drop-area #uploadPlaceholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
  pointer-events: none;
}
.upload-drop-area #uploadPlaceholder .fas {
  font-size: 2.4rem;
  color: var(--primary-light);
  opacity: .6;
}
.upload-drop-text {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-dark);
}
.upload-drop-hint {
  font-size: .78rem;
  color: var(--text-muted);
}

/* ================================================================
   INSTRUCTOR BLOCKS
================================================================ */
.instructor-block {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 14px;
  margin-bottom: 16px;
  background: var(--bg-light);
  position: relative;
}
.instructor-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.instructor-block-label {
  font-weight: 600;
  font-size: .88rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 7px;
}
/* Compact avatar upload inside instructor block */
.instr-drop {
  min-height: 110px;
  max-width: 300px;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 20px;
}
.instr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}
.instr-placeholder .fas {
  font-size: 1.6rem;
  color: var(--primary-light);
  opacity: .65;
}
.instr-preview {
  display: none;
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--accent);
  pointer-events: none;
}

