/* ============================================================
   SCHOOL MANAGEMENT SYSTEM - MODERN UI DESIGN SYSTEM
   ============================================================ */

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  --primary:        #4361ee;
  --primary-dark:   #3451d1;
  --primary-light:  #eef0fd;
  --success:        #2dc58a;
  --success-light:  #e9faf3;
  --warning:        #f59e0b;
  --warning-light:  #fef3c7;
  --danger:         #ef233c;
  --danger-light:   #ffe0e3;
  --info:           #4cc9f0;
  --info-light:     #e0f7fe;
  --purple:         #7c3aed;
  --purple-light:   #ede9fe;
  --orange:         #f4a261;
  --orange-light:   #fff0e4;

  --sidebar-bg:     #0f172a;
  --sidebar-text:   #94a3b8;
  --sidebar-hover:  #1e293b;
  --sidebar-active: #4361ee;
  --sidebar-active-bg: rgba(67,97,238,0.15);
  --sidebar-group-label: #475569;
  --sidebar-border: #1e293b;
  --sidebar-width:  260px;

  --topbar-height:  64px;
  --topbar-bg:      #ffffff;
  --topbar-border:  #e2e8f0;

  --body-bg:        #f1f5f9;
  --card-bg:        #ffffff;
  --card-shadow:    0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  --card-shadow-hover: 0 4px 12px rgba(0,0,0,.1), 0 8px 32px rgba(0,0,0,.06);
  --border-color:   #e2e8f0;
  --text-primary:   #1e293b;
  --text-secondary: #64748b;
  --text-muted:     #94a3b8;

  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      16px;
  --radius-xl:      24px;
  --transition:     all 0.2s ease;
}

/* ── Base / Body ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--body-bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* ── SIDEBAR ──────────────────────────────────────────────── */
.sms-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: var(--transition);
}

.sms-sidebar .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  height: var(--topbar-height);
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  text-decoration: none;
}

.sms-sidebar .sidebar-brand img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: rgba(255,255,255,0.08);
  padding: 4px;
}

.sms-sidebar .sidebar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.sms-sidebar .sidebar-brand-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.sms-sidebar .sidebar-brand-sub {
  font-size: 10px;
  color: var(--sidebar-text);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Sidebar scroll area */
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--sidebar-border) transparent;
}

.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--sidebar-border); border-radius: 4px; }

/* Group labels */
.sidebar-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--sidebar-group-label);
  padding: 16px 20px 6px;
  display: block;
}

/* Nav items */
.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav .nav-item {
  margin: 1px 8px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-nav .nav-link i,
.sidebar-nav .nav-link .nav-icon {
  font-size: 17px;
  flex-shrink: 0;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
}

.sidebar-nav .nav-link:hover {
  color: #ffffff;
  background: var(--sidebar-hover);
}

.sidebar-nav .nav-link.active,
.sidebar-nav .nav-item.active > .nav-link {
  color: #ffffff;
  background: var(--sidebar-active-bg);
}

.sidebar-nav .nav-link.active i,
.sidebar-nav .nav-item.active > .nav-link i {
  color: var(--sidebar-active);
  opacity: 1;
}

/* Submenu toggle arrow */
.sidebar-nav .nav-link .nav-arrow {
  margin-left: auto;
  font-size: 13px;
  transition: transform 0.2s ease;
  opacity: 0.5;
  flex-shrink: 0;
}

.sidebar-nav .nav-link[aria-expanded="true"] .nav-arrow {
  transform: rotate(90deg);
}

/* Submenu */
.sidebar-submenu {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  max-height: 0;
}

.sidebar-submenu.open {
  max-height: 800px;
}

.sidebar-submenu .nav-item {
  margin: 1px 0;
}

.sidebar-submenu .nav-link {
  font-size: 12.5px;
  padding: 7px 12px 7px 40px;
  color: #64748b;
}

.sidebar-submenu .nav-link::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  opacity: 0.6;
  position: absolute;
  left: 28px;
}

.sidebar-submenu .nav-link {
  position: relative;
}

.sidebar-submenu .nav-link:hover {
  color: #ffffff;
  background: var(--sidebar-hover);
}

.sidebar-submenu .nav-link.active {
  color: var(--sidebar-active);
  background: var(--sidebar-active-bg);
  font-weight: 600;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-user-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  transition: var(--transition);
  text-decoration: none;
}

.sidebar-user-mini:hover {
  background: var(--sidebar-hover);
}

.sidebar-user-mini img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--sidebar-border);
}

.sidebar-user-mini .user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-mini .user-name {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-mini .user-role {
  font-size: 10px;
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── TOPBAR ───────────────────────────────────────────────── */
.sms-topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  z-index: 1030;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  transition: left 0.2s ease;
}

.topbar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.topbar-toggle:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.topbar-toggle i { font-size: 20px; }

/* Breadcrumb / Page title in topbar */
.topbar-page-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar-page-title .page-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Topbar actions (right side) */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.topbar-icon-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}

.topbar-icon-btn:hover {
  background: var(--body-bg);
  color: var(--text-primary);
}

.topbar-icon-btn i { font-size: 19px; }

.topbar-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--topbar-bg);
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.topbar-badge:empty,
.topbar-badge[data-count="0"] { display: none; }

/* User avatar button */
.topbar-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: var(--transition);
  text-align: left;
}

.topbar-user-btn:hover { background: var(--body-bg); }

.topbar-user-btn img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
}

.topbar-user-btn .user-details { display: flex; flex-direction: column; }

.topbar-user-btn .user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.topbar-user-btn .user-role {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ── MAIN CONTENT ─────────────────────────────────────────── */
.sms-main {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  min-height: calc(100vh - var(--topbar-height));
  padding: 24px;
  transition: margin-left 0.2s ease;
}

/* ── CARDS ────────────────────────────────────────────────── */
.sms-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  overflow: hidden;
}

.sms-card:hover { box-shadow: var(--card-shadow-hover); }

.sms-card .card-header-sms {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.sms-card .card-title-sms {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.sms-card .card-body-sms {
  padding: 20px;
}

/* ── KPI STAT CARDS ───────────────────────────────────────── */
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
}

.stat-card.primary::before  { background: var(--primary); }
.stat-card.success::before  { background: var(--success); }
.stat-card.warning::before  { background: var(--warning); }
.stat-card.danger::before   { background: var(--danger); }
.stat-card.info::before     { background: var(--info); }
.stat-card.purple::before   { background: var(--purple); }
.stat-card.orange::before   { background: var(--orange); }

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 22px;
}

.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.danger  { background: var(--danger-light);  color: var(--danger); }
.stat-icon.info    { background: var(--info-light);    color: var(--info); }
.stat-icon.purple  { background: var(--purple-light);  color: var(--purple); }
.stat-icon.orange  { background: var(--orange-light);  color: var(--orange); }

.stat-content { flex: 1; min-width: 0; }

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
  padding: 2px 6px;
  border-radius: 20px;
}

.stat-trend.up   { color: var(--success); background: var(--success-light); }
.stat-trend.down { color: var(--danger);  background: var(--danger-light); }
.stat-trend.neutral { color: var(--text-secondary); background: var(--body-bg); }

/* ── PAGE HEADER ──────────────────────────────────────────── */
.page-header-sms {
  margin-bottom: 20px;
}

.page-header-sms .page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.page-header-sms .page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.breadcrumb-sms {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
  font-size: 12px;
}

.breadcrumb-sms li { display: flex; align-items: center; gap: 6px; }
.breadcrumb-sms li::after { content: '/'; color: var(--text-muted); }
.breadcrumb-sms li:last-child::after { display: none; }
.breadcrumb-sms a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb-sms a:hover { color: var(--primary); }
.breadcrumb-sms .active { color: var(--text-muted); }

/* ── TABLES ───────────────────────────────────────────────── */
.sms-table-wrapper {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

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

.sms-table-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.sms-table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-sms {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table-sms thead th {
  background: #f8fafc;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table-sms tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-primary);
  vertical-align: middle;
}

.table-sms tbody tr:last-child td { border-bottom: none; }

.table-sms tbody tr:hover td { background: #f8fafc; }

/* ── BADGES ───────────────────────────────────────────────── */
.badge-sms {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-sms.primary { background: var(--primary-light); color: var(--primary); }
.badge-sms.success { background: var(--success-light); color: var(--success); }
.badge-sms.warning { background: var(--warning-light); color: var(--warning); }
.badge-sms.danger  { background: var(--danger-light);  color: var(--danger); }
.badge-sms.info    { background: var(--info-light);    color: var(--info); }
.badge-sms.purple  { background: var(--purple-light);  color: var(--purple); }
.badge-sms.gray    { background: #f1f5f9;              color: var(--text-secondary); }

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn-sms {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-sms.primary { background: var(--primary); color: #fff; }
.btn-sms.primary:hover { background: var(--primary-dark); color: #fff; }

.btn-sms.success { background: var(--success); color: #fff; }
.btn-sms.success:hover { filter: brightness(0.9); }

.btn-sms.outline {
  background: transparent;
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-sms.outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-sms.sm { padding: 5px 10px; font-size: 12px; }
.btn-sms.icon { padding: 7px; }

/* Action icon buttons (edit/delete etc) */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-size: 14px;
}

.action-btn.edit   { background: var(--primary-light); color: var(--primary); }
.action-btn.view   { background: var(--info-light);    color: var(--info); }
.action-btn.delete { background: var(--danger-light);  color: var(--danger); }

.action-btn:hover { filter: brightness(0.9); transform: scale(1.08); }

/* ── FORMS ────────────────────────────────────────────────── */
.form-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.form-card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background: #f8fafc;
}

.form-card-header h5 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-card-body { padding: 24px; }

.sms-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: block;
}

.sms-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 13.5px;
  color: var(--text-primary);
  background: var(--card-bg);
  transition: var(--transition);
  outline: none;
}

.sms-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,0.12);
}

/* ── CHARTS ───────────────────────────────────────────────── */
.chart-container {
  position: relative;
  width: 100%;
}

/* ── QUICK ACTIONS ────────────────────────────────────────── */
.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

.quick-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1.5px solid var(--border-color);
  text-decoration: none;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}

.quick-action-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
}

.quick-action-item .qa-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: var(--transition);
}

.quick-action-item .qa-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.2;
}

.quick-action-item:hover .qa-label { color: var(--primary); }

/* ── ACTIVITY FEED ────────────────────────────────────────── */
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 2px;
}

.activity-content .activity-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.activity-content .activity-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── PROGRESS BARS ────────────────────────────────────────── */
.progress-sms {
  height: 6px;
  background: var(--body-bg);
  border-radius: 20px;
  overflow: hidden;
}

.progress-sms .progress-fill {
  height: 100%;
  border-radius: 20px;
  transition: width 0.6s ease;
}

.progress-fill.primary { background: var(--primary); }
.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger  { background: var(--danger); }

/* ── NOTIFICATION DROPDOWN ────────────────────────────────── */
.notif-dropdown {
  width: 360px;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
}

.notif-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-header h6 { font-size: 14px; font-weight: 600; margin: 0; }

.notif-scroll {
  max-height: 320px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f8fafc;
  text-decoration: none;
  transition: var(--transition);
}

.notif-item:hover { background: var(--body-bg); }

.notif-item.unread { background: var(--primary-light); }

.notif-item .notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.notif-item .notif-body { flex: 1; min-width: 0; }

.notif-item .notif-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-item .notif-msg {
  font-size: 11.5px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-item .notif-time {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  margin-top: 2px;
}

.notif-footer {
  padding: 10px 16px;
  text-align: center;
  border-top: 1px solid var(--border-color);
}

.notif-footer a {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

/* ── WELCOME BANNER ───────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, #4361ee 0%, #7c3aed 100%);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}

.welcome-banner::after {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 180px; height: 180px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}

.welcome-banner::before {
  content: '';
  position: absolute;
  bottom: -50px; right: 60px;
  width: 120px; height: 120px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.welcome-banner h4 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  position: relative;
  z-index: 1;
}

.welcome-banner p {
  font-size: 13px;
  opacity: 0.85;
  margin: 0;
  position: relative;
  z-index: 1;
}

.welcome-banner .banner-actions {
  margin-top: 16px;
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.banner-btn.white { background: rgba(255,255,255,0.2); color: #fff; }
.banner-btn.white:hover { background: rgba(255,255,255,0.3); color: #fff; }

.banner-btn.solid { background: #fff; color: var(--primary); }
.banner-btn.solid:hover { background: rgba(255,255,255,0.9); }

/* ── EMPTY STATE ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state i {
  font-size: 48px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

/* ── SIDEBAR COLLAPSED ────────────────────────────────────── */
body.sidebar-collapsed .sms-sidebar {
  width: 64px;
}

body.sidebar-collapsed .sms-sidebar .sidebar-brand-text,
body.sidebar-collapsed .sms-sidebar .sidebar-group-label,
body.sidebar-collapsed .sms-sidebar .nav-link span,
body.sidebar-collapsed .sms-sidebar .nav-arrow,
body.sidebar-collapsed .sms-sidebar .user-info,
body.sidebar-collapsed .sms-sidebar .sidebar-submenu {
  display: none !important;
}

body.sidebar-collapsed .sms-sidebar .sidebar-nav .nav-link {
  justify-content: center;
  padding: 10px;
}

body.sidebar-collapsed .sms-sidebar .sidebar-nav .nav-link i {
  margin: 0;
  width: auto;
}

body.sidebar-collapsed .sms-topbar {
  left: 64px;
}

body.sidebar-collapsed .sms-main {
  margin-left: 64px;
}

/* ── ALERTS ───────────────────────────────────────────────── */
.alert-sms {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-sms.success {
  background: var(--success-light);
  border-color: rgba(45,197,138,.2);
  color: #065f46;
}

.alert-sms.error, .alert-sms.danger {
  background: var(--danger-light);
  border-color: rgba(239,35,60,.2);
  color: #7f1d1d;
}

.alert-sms.warning {
  background: var(--warning-light);
  border-color: rgba(245,158,11,.2);
  color: #78350f;
}

.alert-sms.info {
  background: var(--info-light);
  border-color: rgba(76,201,240,.2);
  color: #075985;
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 992px) {
  .sms-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sms-sidebar.open {
    transform: translateX(0);
  }

  .sms-topbar { left: 0; }
  .sms-main   { margin-left: 0; }

  .sms-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1039;
  }

  .sms-overlay.active { display: block; }
}

@media (max-width: 768px) {
  .sms-main { padding: 16px; }
  .stat-value { font-size: 22px; }
  .topbar-user-btn .user-details { display: none; }
}

/* ── UTILITY ──────────────────────────────────────────────── */
.text-primary-sms { color: var(--primary) !important; }
.text-success-sms { color: var(--success) !important; }
.text-warning-sms { color: var(--warning) !important; }
.text-danger-sms  { color: var(--danger)  !important; }
.text-muted-sms   { color: var(--text-muted) !important; }
.text-secondary-sms { color: var(--text-secondary) !important; }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.rounded-sms { border-radius: var(--radius) !important; }
.rounded-lg-sms { border-radius: var(--radius-lg) !important; }

.divider-sms {
  height: 1px;
  background: var(--border-color);
  margin: 12px 0;
}

/* Overrides for Bootstrap conflicts */
.page-wrapper {
  margin-left: var(--sidebar-width) !important;
  margin-top: var(--topbar-height) !important;
  min-height: calc(100vh - var(--topbar-height)) !important;
  padding: 24px !important;
  background: var(--body-bg) !important;
  transition: margin-left 0.2s ease !important;
}

/* Avatar sizes */
.avatar-xs  { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.avatar-sm  { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.avatar-md  { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.avatar-lg  { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.avatar-xl  { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }

/* Enrollment status colors */
.status-active       { color: var(--success); font-weight: 600; }
.status-inactive     { color: var(--text-muted); }
.status-transferred  { color: var(--warning); font-weight: 600; }
.status-graduated    { color: var(--primary); font-weight: 600; }

/* Override for old page-wrapper conflict */
.topbar { display: none !important; }
.leftbar-tab-menu { display: none !important; }

/* ── BOOTSTRAP OVERRIDES: make existing pages look better ── */
/* Cards */
.sms-main .card {
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--card-shadow) !important;
}

.sms-main .card-body {
  padding: 20px !important;
}

.sms-main .card-header {
  background: #f8fafc !important;
  border-bottom: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  padding: 14px 20px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
}

/* Tables */
.sms-main .table {
  font-size: 13px !important;
  border-collapse: collapse !important;
  width: 100% !important;
}

.sms-main .table thead th {
  background: #f8fafc !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  color: var(--text-secondary) !important;
  border-bottom: 1px solid var(--border-color) !important;
  padding: 10px 12px !important;
  white-space: nowrap !important;
}

.sms-main .table tbody td {
  padding: 11px 12px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  color: var(--text-primary) !important;
  vertical-align: middle !important;
}

.sms-main .table tbody tr:last-child td { border-bottom: none !important; }
.sms-main .table tbody tr:hover td { background: #f8fafc !important; }

.sms-main .table-responsive {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
  overflow: hidden !important;
}

/* Buttons */
.sms-main .btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  border-radius: var(--radius) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  padding: 8px 16px !important;
}

.sms-main .btn-secondary {
  border-radius: var(--radius) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

.sms-main .btn-danger {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
  border-radius: var(--radius) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

.sms-main .btn-success {
  background: var(--success) !important;
  border-color: var(--success) !important;
  border-radius: var(--radius) !important;
}

.sms-main .btn-outline-secondary {
  border-radius: var(--radius) !important;
  font-size: 13px !important;
}

/* Badges */
.sms-main .badge.bg-success { background: var(--success) !important; }
.sms-main .badge.bg-danger  { background: var(--danger)  !important; }
.sms-main .badge.bg-primary { background: var(--primary) !important; }
.sms-main .badge.bg-warning { background: var(--warning) !important; }

/* Page title (legacy block navigation) */
.sms-main .page-title {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  margin: 0 !important;
}

/* Modal */
.modal-content {
  border: none !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.15) !important;
}

.modal-header {
  border-bottom: 1px solid var(--border-color) !important;
  padding: 16px 20px !important;
}

.modal-footer {
  border-top: 1px solid var(--border-color) !important;
  padding: 12px 20px !important;
}

/* Forms */
.sms-main .form-control,
.sms-main .form-select {
  border: 1.5px solid var(--border-color) !important;
  border-radius: var(--radius) !important;
  font-size: 13.5px !important;
  color: var(--text-primary) !important;
  padding: 9px 12px !important;
}

.sms-main .form-control:focus,
.sms-main .form-select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(67,97,238,.12) !important;
}

.sms-main .form-label {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--text-secondary) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.4px !important;
}

/* Alert overrides */
.sms-main .alert {
  border-radius: var(--radius) !important;
  font-size: 13px !important;
  border: none !important;
}

.sms-main .alert-success {
  background: var(--success-light) !important;
  color: #065f46 !important;
}

.sms-main .alert-danger {
  background: var(--danger-light) !important;
  color: #7f1d1d !important;
}

.sms-main .alert-warning {
  background: var(--warning-light) !important;
  color: #78350f !important;
}

.sms-main .alert-info {
  background: var(--info-light) !important;
  color: #075985 !important;
}

/* row mb-4 block navigation wrapper */
.sms-main .row.mb-4:first-child {
  margin-bottom: 20px !important;
}

/* Select2 overrides */
.select2-container--default .select2-selection--single {
  border: 1.5px solid var(--border-color) !important;
  height: 40px !important;
  line-height: 38px !important;
  border-radius: var(--radius) !important;
  background: var(--card-bg) !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 38px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 38px !important;
  font-size: 13.5px !important;
  color: var(--text-primary) !important;
  padding-left: 12px !important;
}

.select2-container--default .select2-results__option--highlighted {
  background: var(--primary) !important;
}

.select2-dropdown {
  border: 1.5px solid var(--border-color) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,.08) !important;
}

/* Crispy forms label */
.sms-main .form-group > label {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--text-secondary) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.4px !important;
}

/* Page title box (old theme) */
.page-title-box { display: none !important; }

/* Remove old app.min.css body padding/margin if any */
.sms-main > .container-fluid { padding: 0 !important; }

