/* ============================================================
   TKA PORTAL - Admin CSS
   Premium School Management Design System
   ============================================================ */

/* --- Fonts & Root Variables --- */
:root {
  --font: 'Plus Jakarta Sans', sans-serif;

  /* Brand Colors */
  --primary:        #1e40af;
  --primary-light:  #3b82f6;
  --primary-soft:   #eff6ff;
  --primary-border: #bfdbfe;

  /* Grays */
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;
  --white:     #ffffff;

  /* Sidebar */
  --sidebar-w:      260px;
  --sidebar-bg:     #0f172a;
  --sidebar-border: rgba(255,255,255,0.06);

  /* Topbar */
  --topbar-h:   64px;
  --topbar-bg:  #ffffff;

  /* Radius */
  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  28px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:  0 10px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-blue: 0 8px 25px rgba(59,130,246,0.35);
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.admin-body {
  font-family: var(--font);
  background: var(--slate-100);
  color: var(--slate-800);
  margin: 0;
  overflow-x: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand { display: flex; align-items: center; gap: .75rem; }

.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.3rem;
  box-shadow: 0 4px 12px rgba(59,130,246,0.4);
}

.brand-name { font-size: .9rem; font-weight: 800; color: #fff; display: block; }
.brand-sub  { font-size: .7rem; color: rgba(255,255,255,0.4); display: block; }

.sidebar-close {
  background: none; border: none; color: rgba(255,255,255,0.5);
  font-size: 1.2rem; cursor: pointer; padding: 4px;
}

/* Sidebar User */
.sidebar-user {
  display: flex; align-items: center; gap: .85rem;
  padding: 1rem 1.25rem;
}

.user-avatar {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: .85rem; font-weight: 800;
  flex-shrink: 0;
}

.user-name { font-size: .85rem; font-weight: 700; color: #fff; }
.user-role { font-size: .72rem; color: rgba(255,255,255,0.45); }

.sidebar-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: 0 1.25rem;
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem .75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.nav-section-label {
  font-size: .65rem;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: .75rem .75rem .35rem;
}

.nav-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem .85rem;
  border-radius: var(--r-md);
  color: rgba(255,255,255,0.6);
  font-size: .875rem; font-weight: 500;
  text-decoration: none;
  margin-bottom: 2px;
  transition: all .2s;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.active {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: #fff;
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
  font-weight: 600;
}
.nav-item-danger { color: rgba(252,165,165,0.7) !important; }
.nav-item-danger:hover { background: rgba(239,68,68,0.15) !important; color: #fca5a5 !important; }

.nav-icon { font-size: 1.1rem; flex-shrink: 0; }

.sidebar-footer {
  padding: .85rem 1.25rem;
  border-top: 1px solid var(--sidebar-border);
}
.sidebar-footer-text { font-size: .7rem; font-weight: 700; color: rgba(255,255,255,0.4); }
.sidebar-footer-sub  { font-size: .65rem; color: rgba(255,255,255,0.25); }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 900;
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--slate-200);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  box-shadow: 0 1px 0 var(--slate-200);
}

.topbar-left { display: flex; align-items: center; gap: 1rem; }

.topbar-toggle {
  width: 36px; height: 36px;
  border: none; background: var(--slate-100);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--slate-600);
  font-size: 1.1rem; transition: all .2s;
}
.topbar-toggle:hover { background: var(--primary-soft); color: var(--primary); }

.breadcrumb-school { font-size: .8rem; color: var(--slate-400); font-weight: 500; }
.breadcrumb-sep     { font-size: .65rem; color: var(--slate-300); margin: 0 .4rem; }
.breadcrumb-page    { font-size: .85rem; font-weight: 700; color: var(--slate-800); }

.topbar-right { display: flex; align-items: center; gap: .75rem; }

.topbar-badge {
  display: flex; align-items: center; gap: .4rem;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 8px;
  padding: .35rem .75rem;
  font-size: .75rem; font-weight: 600;
}

.topbar-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: .8rem; font-weight: 800;
  cursor: pointer;
}

/* ============================================================
   MAIN WRAPPER & PAGE CONTENT
   ============================================================ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin .3s;
}

@media (max-width: 991px) {
  .main-wrapper { margin-left: 0; }
}

.page-content { flex: 1; padding: 1.75rem 1.5rem; }

/* Page Header */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.75rem; flex-wrap: wrap; gap: 1rem;
}
.page-title {
  font-size: 1.5rem; font-weight: 800;
  color: var(--slate-900); margin: 0;
  letter-spacing: -.3px;
}
.page-sub {
  font-size: .85rem; color: var(--slate-500);
  margin: .2rem 0 0; font-weight: 400;
}
.page-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  background: white;
  border-radius: var(--r-lg);
  padding: 1.35rem 1.25rem;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-200);
  transition: transform .2s, box-shadow .2s;
  display: flex; align-items: center; gap: 1rem;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}

.stat-body { flex: 1; min-width: 0; }
.stat-value { font-size: 1.65rem; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: .8rem; color: var(--slate-500); font-weight: 500; margin-top: .15rem; }
.stat-sub   { font-size: .72rem; color: var(--slate-400); margin-top: .1rem; }

.stat-bg-icon {
  position: absolute; right: -8px; bottom: -8px;
  font-size: 5rem; opacity: .06;
}

.stat-blue   .stat-icon { background: #eff6ff; color: #1e40af; }
.stat-blue   .stat-value { color: #1e40af; }
.stat-purple .stat-icon { background: #f5f3ff; color: #6d28d9; }
.stat-purple .stat-value { color: #6d28d9; }
.stat-green  .stat-icon { background: #f0fdf4; color: #065f46; }
.stat-green  .stat-value { color: #059669; }
.stat-orange .stat-icon { background: #fff7ed; color: #c2410c; }
.stat-orange .stat-value { color: #ea580c; }

/* ============================================================
   CARD MODERN
   ============================================================ */
.card-modern {
  background: white;
  border-radius: var(--r-lg);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-modern-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.15rem 1.4rem;
  border-bottom: 1px solid var(--slate-100);
}

.card-modern-title { font-size: .95rem; font-weight: 700; color: var(--slate-800); }
.card-modern-sub   { font-size: .78rem; color: var(--slate-400); margin-top: 2px; }
.card-modern-badge {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: .72rem; font-weight: 700;
  padding: .3rem .7rem; border-radius: 8px;
}

.card-modern-body { padding: 1.25rem 1.4rem; }

.card-info-side {
  background: linear-gradient(145deg, #f8faff, #eff6ff);
  border: 1px solid var(--primary-border);
}
.info-icon-box {
  width: 48px; height: 48px;
  background: var(--primary-soft);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 1.4rem;
  margin-bottom: 1rem;
}
.info-list { padding-left: 1.2rem; color: var(--slate-600); font-size: .85rem; line-height: 1.8; }
.info-stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .4rem 0;
  border-bottom: 1px solid var(--slate-100);
  font-size: .85rem;
}
.info-stat-row:last-child { border-bottom: none; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-modern {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1.1rem;
  border-radius: var(--r-md);
  font-size: .875rem; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none;
  transition: all .2s;
  font-family: var(--font);
  white-space: nowrap;
}

.btn-primary-modern {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: white;
  box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
.btn-primary-modern:hover {
  color: white; transform: translateY(-1px);
  box-shadow: var(--shadow-blue);
}

.btn-outline-modern {
  background: white; color: var(--slate-700);
  border: 1.5px solid var(--slate-200);
}
.btn-outline-modern:hover {
  background: var(--slate-100); color: var(--slate-900);
  border-color: var(--slate-300);
}

.btn-success-modern {
  background: linear-gradient(135deg, #065f46, #10b981);
  color: white;
}
.btn-success-modern:hover { color: white; transform: translateY(-1px); }

.btn-danger-modern {
  background: linear-gradient(135deg, #991b1b, #ef4444);
  color: white;
}
.btn-danger-modern:hover { color: white; transform: translateY(-1px); }

.btn-sm-mod { padding: .4rem .75rem; font-size: .8rem; }
.btn-link-sm {
  font-size: .8rem; font-weight: 600; color: var(--primary);
  text-decoration: none; padding: .3rem .6rem;
  border-radius: 8px;
}
.btn-link-sm:hover { background: var(--primary-soft); }

.btn-icon { width: 32px !important; height: 32px !important; padding: 0 !important; justify-content: center; }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-label-mod {
  display: block;
  font-size: .82rem; font-weight: 600;
  color: var(--slate-700); margin-bottom: .4rem;
  letter-spacing: .2px;
}

.fc-mod {
  border: 2px solid var(--slate-200) !important;
  border-radius: var(--r-md) !important;
  padding: .65rem 1rem !important;
  font-size: .9rem !important;
  font-family: var(--font) !important;
  transition: border-color .2s, box-shadow .2s !important;
  background: var(--slate-50) !important;
  color: var(--slate-800) !important;
}
.fc-mod:focus {
  border-color: var(--primary-light) !important;
  background: white !important;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.1) !important;
  outline: none !important;
}
.fc-sm { padding: .45rem .85rem !important; font-size: .82rem !important; }

.form-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--slate-100);
}

/* ============================================================
   TABLE
   ============================================================ */
.table-modern { margin-bottom: 0; }
.table-modern thead tr {
  background: var(--slate-50);
}
.table-modern thead th {
  font-size: .78rem; font-weight: 700;
  color: var(--slate-500);
  text-transform: uppercase; letter-spacing: .7px;
  border-bottom: 2px solid var(--slate-200) !important;
  padding: .85rem 1rem;
  white-space: nowrap;
}
.table-modern tbody td {
  font-size: .875rem; padding: .85rem 1rem;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: middle; color: var(--slate-700);
}
.table-modern tbody tr:last-child td { border-bottom: none; }
.table-modern tbody tr:hover td { background: var(--slate-50); }

.tr-highlight-me td { background: #eff6ff !important; }

/* ============================================================
   BADGES & STATUS
   ============================================================ */
.badge-nilai {
  display: inline-flex; align-items: center;
  padding: .25rem .7rem; border-radius: 8px;
  font-size: .75rem; font-weight: 700;
}
.badge-nilai.success  { background: #d1fae5; color: #065f46; }
.badge-nilai.primary  { background: #dbeafe; color: #1e40af; }
.badge-nilai.warning  { background: #fef3c7; color: #92400e; }
.badge-nilai.danger   { background: #fee2e2; color: #991b1b; }
.badge-nilai.empty    { background: var(--slate-100); color: var(--slate-400); }
.badge-nilai.badge-xs { padding: .15rem .45rem; font-size: .65rem; }
.badge-nilai.badge-lg { padding: .4rem 1rem; font-size: .85rem; }

.status-lulus { color: #059669; font-size: .82rem; font-weight: 600; }
.status-belum { color: #d97706; font-size: .82rem; font-weight: 600; }

.bg-success-soft { background: #d1fae5 !important; }
.bg-danger-soft  { background: #fee2e2 !important; }
.bg-secondary-soft { background: var(--slate-100) !important; }

.badge-status {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .9rem; border-radius: 10px;
  font-size: .8rem; font-weight: 700;
}
.badge-published   { background: #d1fae5; color: #065f46; }
.badge-unpublished { background: #fef3c7; color: #92400e; }

.code-badge {
  background: var(--primary-soft); color: var(--primary);
  padding: .2rem .55rem; border-radius: 6px;
  font-size: .75rem; font-weight: 700; font-family: monospace;
}

/* ============================================================
   RANKING
   ============================================================ */
.ranking-row {
  display: flex; align-items: center; gap: .85rem;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--slate-100);
  transition: background .15s;
}
.ranking-row:last-child { border-bottom: none; }
.ranking-row:hover { background: var(--slate-50); }

.ranking-pos { width: 36px; text-align: center; }
.rank-medal  { font-size: 1.3rem; }
.rank-num    { font-size: .85rem; font-weight: 700; color: var(--slate-400); }

.ranking-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: .75rem; font-weight: 800;
  flex-shrink: 0;
}
.warning-avatar { background: #fef3c7 !important; color: #92400e !important; }

.ranking-info { flex: 1; min-width: 0; }
.ranking-name { font-size: .875rem; font-weight: 600; color: var(--slate-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-meta { font-size: .72rem; color: var(--slate-400); }

.ranking-score { text-align: right; }
.score-val     { font-size: .9rem; font-weight: 800; color: var(--primary); }
.score-bar     { height: 4px; width: 60px; background: var(--slate-100); border-radius: 2px; margin-top: 3px; }
.score-fill    { height: 100%; border-radius: 2px; }

.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 10px;
  font-size: .8rem; font-weight: 800;
}
.rank-1 { background: #fef3c7; color: #92400e; }
.rank-2 { background: #f1f5f9; color: #475569; }
.rank-3 { background: #fff7ed; color: #c2410c; }
.rank-other { background: var(--slate-100); color: var(--slate-500); font-size: .8rem; }

.score-display { display: flex; flex-direction: column; align-items: flex-end; }
.score-num { font-size: 1rem; }
.score-micro-bar { height: 3px; width: 50px; background: var(--slate-100); border-radius: 2px; margin-top: 3px; }
.score-micro-bar div { height: 100%; border-radius: 2px; }

/* ============================================================
   NILAI INPUT
   ============================================================ */
.nilai-grid { display: flex; flex-direction: column; gap: .5rem; }

.nilai-row {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 1rem;
  background: var(--slate-50);
  border-radius: var(--r-md);
  border: 1.5px solid var(--slate-200);
  transition: border-color .2s;
}
.nilai-row:hover { border-color: var(--primary-light); }

.nilai-mapel      { flex: 1; min-width: 0; }
.nilai-mapel-kode { font-size: .72rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .5px; }
.nilai-mapel-nama { font-size: .875rem; font-weight: 600; color: var(--slate-800); }
.nilai-mapel-kkm  { font-size: .72rem; color: var(--slate-400); }

.nilai-input-wrap { width: 110px; flex-shrink: 0; }
.nilai-input { text-align: center !important; font-weight: 700 !important; font-size: 1rem !important; }

.nilai-badge-wrap { width: 120px; flex-shrink: 0; }

.rata-rata-preview {
  font-size: .875rem; color: var(--slate-500);
  display: flex; align-items: center; gap: .5rem;
}

.kategori-legend { display: flex; flex-direction: column; gap: .6rem; }
.legend-item { display: flex; align-items: center; }

/* ============================================================
   SISWA NILAI CARD (input list)
   ============================================================ */
.siswa-nilai-card {
  background: white;
  border-radius: var(--r-lg);
  border: 1px solid var(--slate-200);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}
.siswa-nilai-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.snc-header  { display: flex; align-items: center; gap: .75rem; margin-bottom: .85rem; }
.snc-avatar  { width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center; color: white; font-size: .85rem; font-weight: 800; flex-shrink: 0; }
.snc-name    { font-size: .875rem; font-weight: 700; color: var(--slate-800); }
.snc-meta    { font-size: .72rem; color: var(--slate-400); }

.snc-progress-wrap { margin-bottom: .85rem; }
.snc-progress-label { display: flex; justify-content: space-between; font-size: .75rem; color: var(--slate-500); margin-bottom: .35rem; }

.snc-actions { display: flex; gap: .5rem; }

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress-mod {
  background: var(--slate-100) !important;
  border-radius: 10px !important;
  overflow: hidden;
}
.progress-mod .progress-bar { border-radius: 10px !important; transition: width .5s ease; }

/* ============================================================
   QUICK ACTIONS
   ============================================================ */
.quick-actions {
  background: white;
  border-radius: var(--r-lg);
  border: 1px solid var(--slate-200);
  padding: 1.1rem 1.4rem;
}
.quick-actions-title { font-size: .75rem; font-weight: 700; color: var(--slate-400); text-transform: uppercase; letter-spacing: 1px; margin-bottom: .85rem; }
.quick-actions-grid  { display: flex; gap: .75rem; flex-wrap: wrap; }

.quick-action-btn {
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  background: var(--slate-50); border: 1.5px solid var(--slate-200);
  border-radius: var(--r-md); padding: .85rem 1.25rem;
  text-decoration: none; color: var(--slate-700);
  font-size: .78rem; font-weight: 600;
  transition: all .2s; min-width: 100px;
}
.quick-action-btn i  { font-size: 1.3rem; color: var(--primary); }
.quick-action-btn:hover { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary); transform: translateY(-2px); }

.quick-nav-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1.25rem;
  color: var(--slate-600); font-size: .875rem; font-weight: 500;
  text-decoration: none; border-bottom: 1px solid var(--slate-100);
  transition: all .15s;
}
.quick-nav-link:last-child { border-bottom: none; }
.quick-nav-link:hover { background: var(--primary-soft); color: var(--primary); }
.quick-nav-link i { font-size: 1rem; color: var(--slate-400); }

/* ============================================================
   UPLOAD AREA
   ============================================================ */
.upload-area {
  border: 2.5px dashed var(--slate-300);
  border-radius: var(--r-lg);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color .2s, background .2s;
  background: var(--slate-50);
}
.upload-area:hover { border-color: var(--primary-light); background: var(--primary-soft); }
.upload-icon  { font-size: 2.5rem; color: var(--slate-300); margin-bottom: .5rem; }
.upload-text  { font-weight: 600; color: var(--slate-600); }
.upload-sub   { font-size: .78rem; color: var(--slate-400); margin-top: .25rem; }
.upload-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

.file-info-box {
  background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 10px; padding: .75rem 1rem;
  font-size: .85rem; color: #065f46;
  display: flex; align-items: center; gap: .5rem;
}

.alert-info-box {
  background: var(--primary-soft); border: 1px solid var(--primary-border);
  border-radius: 12px; padding: .85rem 1rem;
  font-size: .82rem; color: #1e40af;
  display: flex; align-items: flex-start; gap: .65rem;
}
.alert-info-box i { font-size: 1rem; margin-top: .1rem; flex-shrink: 0; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-modern { border-radius: var(--r-xl) !important; border: none !important; overflow: hidden; }
.modal-modern .modal-header {
  border-bottom: 1px solid var(--slate-100);
  padding: 1.25rem 1.5rem;
  background: var(--slate-50);
}
.modal-modern .modal-title { font-weight: 700; font-size: .95rem; color: var(--slate-800); }
.modal-modern .modal-footer { border-top: 1px solid var(--slate-100); padding: 1rem 1.5rem; }

/* ============================================================
   PUBLISH BANNER
   ============================================================ */
.publish-banner {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.4rem; border-radius: var(--r-lg);
  font-size: .875rem;
}
.publish-banner i { font-size: 1.4rem; flex-shrink: 0; }
.publish-banner strong { font-weight: 700; display: block; }
.publish-banner span { font-size: .82rem; }
.published   { background: #f0fdf4; border: 1.5px solid #86efac; color: #065f46; }
.unpublished { background: #fffbeb; border: 1.5px solid #fde68a; color: #92400e; }

/* ============================================================
   FLASH TOAST
   ============================================================ */
.alert-toast {
  position: fixed; top: 1.25rem; right: 1.25rem; z-index: 9999;
  display: flex; align-items: center; gap: .85rem;
  background: white; border-radius: var(--r-lg);
  padding: 1rem 1.25rem; min-width: 300px; max-width: 420px;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid;
  animation: toastIn .35s cubic-bezier(.34,1.56,.64,1);
}
.alert-toast-success { border-color: #10b981; }
.alert-toast-error   { border-color: #ef4444; }
.alert-toast-warning { border-color: #f59e0b; }
.alert-toast-info    { border-color: #3b82f6; }

.alert-toast-icon { font-size: 1.25rem; flex-shrink: 0; }
.alert-toast-success .alert-toast-icon { color: #10b981; }
.alert-toast-error   .alert-toast-icon { color: #ef4444; }
.alert-toast-warning .alert-toast-icon { color: #f59e0b; }
.alert-toast-info    .alert-toast-icon { color: #3b82f6; }

.alert-toast-body  { flex: 1; }
.alert-toast-title { font-weight: 700; font-size: .875rem; }
.alert-toast-msg   { font-size: .82rem; color: var(--slate-500); margin-top: 2px; }
.alert-toast-close { background: none; border: none; color: var(--slate-400); cursor: pointer; font-size: 1rem; padding: 0; }

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

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state {
  text-align: center; padding: 3.5rem 2rem;
  color: var(--slate-400);
}
.empty-state i { font-size: 3rem; display: block; margin-bottom: 1rem; }
.empty-state h5 { color: var(--slate-600); font-weight: 700; }
.empty-state p  { font-size: .875rem; color: var(--slate-400); }

.empty-state-sm {
  text-align: center; padding: 2.5rem 1.5rem;
  color: var(--slate-400);
}
.empty-state-sm i { font-size: 2rem; display: block; margin-bottom: .75rem; }
.empty-state-sm p { font-size: .82rem; }

/* ============================================================
   AVATAR HELPERS
   ============================================================ */
.avatar-xs {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-size: .65rem; font-weight: 800; flex-shrink: 0;
}
.avatar-sm {
  width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-size: .75rem; font-weight: 800;
}
.student-big-avatar {
  width: 80px; height: 80px; border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.75rem; font-weight: 800;
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }
.text-purple { color: #7c3aed !important; }
.text-slate  { color: var(--slate-800) !important; }
.py-6 { padding-top: 3.5rem !important; padding-bottom: 3.5rem !important; }

/* DataTables overrides */
.dataTables_wrapper .dataTables_filter input {
  border: 2px solid var(--slate-200) !important;
  border-radius: var(--r-md) !important;
  padding: .45rem .85rem !important;
  font-size: .85rem !important;
  font-family: var(--font) !important;
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--primary-light) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1) !important;
}
.dataTables_wrapper .dataTables_length select {
  border: 2px solid var(--slate-200) !important;
  border-radius: 10px !important;
  padding: .35rem .65rem !important;
  font-family: var(--font) !important;
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  font-size: .82rem !important;
  color: var(--slate-500) !important;
}
.dataTables_processing {
  background: white !important;
  border: 1px solid var(--slate-200) !important;
  border-radius: var(--r-md) !important;
  box-shadow: var(--shadow-md) !important;
  padding: 1rem 2rem !important;
  font-size: .85rem !important;
}
.page-link { font-family: var(--font) !important; font-size: .82rem !important; }
.page-item.active .page-link { background-color: var(--primary) !important; border-color: var(--primary) !important; }

/* SweetAlert2 overrides */
.swal2-popup { font-family: var(--font) !important; border-radius: var(--r-xl) !important; }
.swal2-title { font-size: 1.2rem !important; font-weight: 800 !important; }
.swal2-html-container { font-size: .9rem !important; color: var(--slate-500) !important; }
.swal2-confirm, .swal2-cancel {
  border-radius: var(--r-md) !important;
  font-family: var(--font) !important;
  font-weight: 600 !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
  .page-content { padding: 1.25rem 1rem; }
  .page-header  { flex-direction: column; align-items: flex-start; }
  .stat-value   { font-size: 1.35rem; }
  .card-modern-body { padding: 1rem; }
  .card-modern-header { padding: .9rem 1rem; flex-wrap: wrap; gap: .5rem; }
  .topbar       { padding: 0 1rem; }
  .quick-action-btn { min-width: 80px; padding: .7rem .9rem; }
}

@media (min-width: 992px) {
  .sidebar-close { display: none !important; }
}
