:root {
  --green: #80D8FF;
  --green-mid: #4FC3F7;
  --green-dark: #0277BD;
  --green-light: #E1F5FE;
  --green-xlight: #F0F9FF;
  --sky: #B4E8FE;
  --sky-mid: #5BBFE0;
  --sky-dark: #2B8EAD;
  --sky-light: #EAF8FF;
  --peach: #FF9F6B;
  --peach-light: #FFF1EA;
  --coral: #FF6B8A;
  --coral-light: #FFF0F4;
  --yellow: #FFD166;
  --yellow-light: #FFFBEB;
  --lavender: #A78BFA;
  --lavender-light: #F5F3FF;
  --text: #162032;
  --text-mid: #4A5568;
  --text-muted: #8A9BB0;
  --bg: #F2F7FB;
  --card: #FFFFFF;
  --border: rgba(0,0,0,0.07);
  --sidebar-w: 230px;
  --shadow: 0 4px 24px rgba(22,50,80,0.08);
  --shadow-sm: 0 2px 10px rgba(22,50,80,0.06);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: 'Nunito Sans', 'Tajawal', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.app-shell { display: flex; min-height: 100vh; }

a { color: inherit; text-decoration: none; }

/* ─── SIDEBAR ─────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--green-dark) 0%, var(--green) 100%);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: fixed;
  inset-inline-start: 0;
  top: 0;
  z-index: 50;
  box-shadow: 4px 0 24px rgba(22,50,80,0.15);
}
[dir="rtl"] .sidebar { box-shadow: -4px 0 24px rgba(22,50,80,0.15); }

.sidebar-logo {
  padding: 26px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.logo-mark { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.logo-text {
  font-family: 'Nunito', 'Tajawal', sans-serif;
  font-weight: 900;
  font-size: 16px;
  color: white;
  line-height: 1.1;
}
.logo-sub { font-size: 10px; color: rgba(255,255,255,0.55); font-weight: 600; margin-top: 1px; }

.sidebar-section-label {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.35);
  padding: 18px 24px 6px;
}

.sidebar-nav { display: flex; flex-direction: column; }

.wy-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
  font-size: 13.5px;
  border-radius: 0;
}
.wy-nav-item:hover { background: rgba(255,255,255,0.1); color: white; }
.wy-nav-item.active { background: rgba(255,255,255,0.15); color: white; }
.wy-nav-item.active::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 8px; bottom: 8px;
  width: 3px;
  background: var(--sky);
  border-radius: 0 3px 3px 0;
}
[dir="rtl"] .wy-nav-item.active::before { border-radius: 3px 0 0 3px; }
.wy-nav-icon { font-size: 17px; width: 22px; text-align: center; }
.wy-nav-badge {
  margin-inline-start: auto;
  min-width: 18px; height: 18px;
  background: var(--coral);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 800;
  color: white;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
  font-family: 'Nunito', 'Tajawal', sans-serif;
}
.wy-nav-badge.yellow { background: var(--yellow); color: #92400E; }
.wy-nav-badge.muted  { background: rgba(255,255,255,0.18); color: rgba(255,255,255,0.7); }

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.12);
  border-radius: 12px;
}
.user-ava {
  width: 36px; height: 36px;
  background: var(--sky);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Nunito', 'Tajawal', sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: var(--green-dark);
  flex-shrink: 0;
}
.user-meta { min-width: 0; }
.user-name {
  font-weight: 700; font-size: 13px; color: white;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-role { font-size: 10px; color: rgba(255,255,255,0.55); margin-top: 1px; }
.logout-btn {
  margin-inline-start: auto;
  font-size: 15px; opacity: 0.6;
  background: none; border: none; color: white; cursor: pointer; padding: 4px;
}
.logout-btn:hover { opacity: 1; }

/* ─── MAIN ────────────────────────────── */
.main {
  margin-inline-start: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 10px rgba(22,50,80,0.05);
  border-radius: 0px 0px 20px 20px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  width: 280px;
  transition: border-color 0.2s;
}
.search-box:focus-within { border-color: var(--sky-mid); }
.search-box input {
  border: none; background: none; outline: none;
  font-family: inherit; font-size: 13.5px;
  color: var(--text); width: 100%;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-icon { color: var(--text-muted); font-size: 15px; }

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-inline-start: auto;
}

.action-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: 10px;
  font-family: 'Nunito', 'Tajawal', sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: all 0.18s;
  text-decoration: none;
}
.action-btn.primary { background: var(--green); color: white; box-shadow: 0 3px 10px rgba(128,216,255,0.3); }
.action-btn.primary:hover { background: var(--green-mid); transform: translateY(-1px); }
.action-btn.secondary { background: var(--sky-light); color: var(--sky-dark); }
.action-btn.secondary:hover { background: var(--sky); }
.action-btn.ghost { background: transparent; color: var(--text-mid); }
.action-btn.ghost:hover { background: var(--bg); }

.lang-toggle {
  display: inline-flex;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  font-family: 'Nunito', 'Tajawal', sans-serif;
  font-weight: 700;
  font-size: 12px;
}
.lang-toggle a {
  padding: 6px 10px;
  color: var(--text-muted);
  background: white;
  transition: all 0.15s;
}
.lang-toggle a.active { background: var(--green-light); color: var(--green); }
.lang-toggle a:hover:not(.active) { background: var(--bg); }

.notif-wrap { position: relative; cursor: pointer; padding: 4px; }
.notif-icon { font-size: 20px; }
.notif-dot {
  position: absolute;
  top: -2px;
  inset-inline-end: -2px;
  width: 9px; height: 9px;
  background: var(--coral);
  border-radius: 50%;
  border: 2px solid white;
}

/* Content */
.content { padding: 28px; display: flex; flex-direction: column; gap: 24px; }

/* Welcome row */
/* Dashboard shell — flex column with consistent vertical gaps between sections */
.dash-shell {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.welcome-row {
  display: flex; align-items: center; justify-content: space-between;
  animation: fadeUp 0.4s ease both;
  flex-wrap: wrap; gap: 12px;
}
.welcome-text h1 {
  font-family: 'Nunito', 'Tajawal', sans-serif;
  font-weight: 900;
  font-size: 26px;
  color: var(--text);
}
.welcome-text p { color: var(--text-muted); font-size: 13px; margin-top: 3px; }
.date-badge {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  display: inline-flex; align-items: center; gap: 8px;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  animation: fadeUp 0.4s ease 0.05s both;
}
@media (max-width: 1500px) { .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1200px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px)  { .kpi-grid { grid-template-columns: minmax(0, 1fr); } }

.kpi-card {
  background: var(--card);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-card.green    { border-top-color: var(--green); }
.kpi-card.sky      { border-top-color: var(--sky-mid); }
.kpi-card.amber    { border-top-color: var(--yellow); }
.kpi-card.coral    { border-top-color: var(--coral); }
.kpi-card.lavender { border-top-color: var(--lavender); }

.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.kpi-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.kpi-icon.green    { background: var(--green-light); }
.kpi-icon.sky      { background: var(--sky-light); }
.kpi-icon.amber    { background: var(--yellow-light); }
.kpi-icon.coral    { background: var(--coral-light); }
.kpi-icon.lavender { background: var(--lavender-light); }

.kpi-trend {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  font-family: 'Nunito', 'Tajawal', sans-serif;
}
.kpi-trend.up      { background: var(--green-light); color: var(--green); }
.kpi-trend.warn    { background: var(--yellow-light); color: #B45309; }
.kpi-trend.alert   { background: var(--coral-light); color: #BE185D; }
.kpi-trend.neutral { background: var(--sky-light); color: var(--sky-dark); }

.kpi-value {
  font-family: 'Nunito', 'Tajawal', sans-serif;
  font-weight: 900;
  font-size: 28px;
  color: var(--text);
  line-height: 1;
}
.kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-top: 4px; }
.kpi-sub   { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* Sparkline */
.sparkline {
  display: flex; align-items: flex-end; gap: 3px;
  height: 28px; margin-top: 10px;
}
.spark-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  transition: opacity 0.2s;
  opacity: 0.6;
}
.kpi-card:hover .spark-bar { opacity: 1; }
.spark-bar.green    { background: var(--green); }
.spark-bar.sky      { background: var(--sky-mid); }
.spark-bar.amber    { background: var(--yellow); }
.spark-bar.coral    { background: var(--coral); }
.spark-bar.lavender { background: var(--lavender); }

/* Mid row */
.mid-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 340px);
  gap: 20px;
  animation: fadeUp 0.4s ease 0.1s both;
}
@media (max-width: 1280px) { .mid-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 860px)  { .mid-row { grid-template-columns: minmax(0, 1fr); } }

.wy-card {
  background: var(--card);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  overflow: hidden;
}
.wy-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.wy-card-title {
  font-family: 'Nunito', 'Tajawal', sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
}
.wy-card-link { font-size: 12px; font-weight: 700; color: var(--green); cursor: pointer; }
.wy-card-link:hover { text-decoration: underline; }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.donut-svg { flex-shrink: 0; }
.donut-legend { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 120px; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-label { font-size: 12px; color: var(--text-mid); font-weight: 600; }
.legend-val {
  margin-inline-start: auto;
  font-family: 'Nunito', 'Tajawal', sans-serif;
  font-weight: 800; font-size: 13px; color: var(--text);
  padding-inline-start: 12px;
}

/* Weekly bars */
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 100px; margin-top: 8px; }
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-col { width: 100%; display: flex; gap: 3px; align-items: flex-end; }
.bar { flex: 1; border-radius: 5px 5px 0 0; transition: opacity 0.2s; }
.bar:hover { opacity: 0.8; }
.bar-day { font-size: 10px; color: var(--text-muted); font-weight: 700; }
.bar-day.today { color: var(--green); font-weight: 800; }

/* Activity feed */
.activity-list { display: flex; flex-direction: column; gap: 2px; }
.activity-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 8px;
}
.activity-item:hover { background: var(--bg); }
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.activity-body { flex: 1; min-width: 0; }
.activity-title {
  font-weight: 700; font-size: 13px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.activity-detail { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.activity-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.activity-action {
  font-size: 11px; font-weight: 700;
  color: var(--green);
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--green-light);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.activity-item:hover .activity-action { opacity: 1; }

/* Pending */
.pending-list { display: flex; flex-direction: column; gap: 10px; }
.pending-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s;
}
.pending-item:hover { transform: translateX(3px); }
[dir="rtl"] .pending-item:hover { transform: translateX(-3px); }
.pending-item.fees     { background: var(--coral-light);    border-inline-start: 3px solid var(--coral); }
.pending-item.forms    { background: var(--yellow-light);   border-inline-start: 3px solid var(--yellow); }
.pending-item.messages { background: var(--lavender-light); border-inline-start: 3px solid var(--lavender); }
.pending-icon { font-size: 20px; flex-shrink: 0; }
.pending-body { flex: 1; min-width: 0; }
.pending-title { font-weight: 700; font-size: 13px; color: var(--text); }
.pending-sub   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.pending-count { font-family: 'Nunito', 'Tajawal', sans-serif; font-weight: 900; font-size: 20px; }
.pending-count.coral    { color: var(--coral); }
.pending-count.amber    { color: #D97706; }
.pending-count.lavender { color: var(--lavender); }

.quick-announce {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.quick-announce-label {
  font-size: 12px; font-weight: 800; color: var(--text-muted);
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px;
}
.quick-announce textarea {
  width: 100%;
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit; font-size: 13px; color: var(--text);
  resize: none; outline: none; background: var(--bg);
}
.quick-announce .action-btn { width: 100%; justify-content: center; margin-top: 8px; }

/* Bottom row */
.bottom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: 20px;
  animation: fadeUp 0.4s ease 0.15s both;
}
@media (max-width: 1100px) { .bottom-row { grid-template-columns: minmax(0, 1fr); } }

.section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.section-head .title {
  font-family: 'Nunito', 'Tajawal', sans-serif;
  font-weight: 800; font-size: 15px;
}

/* Class cards */
.class-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .class-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px)  { .class-grid { grid-template-columns: minmax(0, 1fr); } }

.class-card {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
}
.class-card:hover { transform: translateY(-2px); }
.class-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; gap: 8px; }
.class-name { font-family: 'Nunito', 'Tajawal', sans-serif; font-weight: 800; font-size: 14px; color: var(--text); }
.class-teacher { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.class-status {
  font-size: 10px; font-weight: 700; font-family: 'Nunito', 'Tajawal', sans-serif;
  padding: 3px 8px; border-radius: 20px; white-space: nowrap;
}
.class-status.active { background: var(--green-light); color: var(--green); }
.class-status.nap    { background: var(--sky-light); color: var(--sky-dark); }

.class-attendance { margin-bottom: 10px; }
.att-numbers {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600;
}
.att-numbers strong { color: var(--text); font-family: 'Nunito', 'Tajawal', sans-serif; font-weight: 800; }
.att-bar { height: 6px; background: #EEF4FB; border-radius: 10px; overflow: hidden; }
.att-fill { height: 100%; border-radius: 10px; }
.att-fill.green { background: linear-gradient(90deg, var(--green), #5CB88A); }
.att-fill.sky   { background: linear-gradient(90deg, var(--sky-mid), var(--sky)); }
.att-fill.peach { background: linear-gradient(90deg, var(--peach), #FFB899); }

.class-moods { display: flex; gap: 4px; flex-wrap: wrap; }
.mood-chip {
  font-size: 13px;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}

/* Staff widget */
.staff-list { display: flex; flex-direction: column; gap: 10px; }
.staff-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg);
  transition: background 0.15s;
}
.staff-row:hover { background: var(--green-xlight); }
.staff-ava {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.staff-meta { min-width: 0; }
.staff-name { font-weight: 700; font-size: 13px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-role { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.staff-status {
  margin-inline-start: auto;
  font-size: 10px; font-weight: 700;
  font-family: 'Nunito', 'Tajawal', sans-serif;
  padding: 3px 8px; border-radius: 20px; white-space: nowrap;
}
.staff-status.in    { background: var(--green-light); color: var(--green); }
.staff-status.leave { background: var(--yellow-light); color: #B45309; }
.staff-status.late  { background: var(--coral-light);  color: var(--coral); }

/* Generic page wrapper for pages other than dashboard, including coming-soon */
.page-card {
  background: var(--card);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.page-empty {
  text-align: center;
  padding: 60px 24px;
}
.page-empty .emoji { font-size: 56px; margin-bottom: 12px; }
.page-empty h2 {
  font-family: 'Nunito', 'Tajawal', sans-serif;
  font-weight: 900; font-size: 22px; color: var(--text); margin-bottom: 6px;
}
.page-empty p { color: var(--text-muted); font-size: 13px; max-width: 420px; margin: 0 auto; }

/* ─── PAGE HEADER ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header-left {}
.page-header-title {
  font-family: 'Nunito', 'Tajawal', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}
.page-header-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  margin-bottom: 0;
}

/* ─── ALERT FLASH ─────────────────────────────────────────── */
.flash-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 18px;
  animation: fadeUp 0.3s ease both;
}
.flash-alert.success { background: var(--green-light); color: var(--green-dark); border-inline-start: 3px solid var(--green); }
.flash-alert.error   { background: var(--coral-light);  color: #9B1239; border-inline-start: 3px solid var(--coral); }
.flash-alert.warning { background: var(--yellow-light); color: #92400E; border-inline-start: 3px solid var(--yellow); }
.flash-close {
  margin-inline-start: auto;
  background: none; border: none; cursor: pointer;
  opacity: 0.5; font-size: 16px; padding: 0; line-height: 1;
  color: inherit;
}
.flash-close:hover { opacity: 1; }

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }

/* Mobile sidebar (basic) */
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s; }
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-inline-start: 0; }
}

/* ─────────────────────────────────────────────────────────────────
   Bootstrap bridge — re-paints legacy Bootstrap-styled list/edit
   pages (Students, Staff, Classes, Roles, Events, Parents, Daily
   Updates) with theme colors, until each page is re-skinned.
   Only targets Bootstrap classes; theme classes are unaffected.
   ───────────────────────────────────────────────────────────── */

/* Override Bootstrap CSS variables where the new layout is mounted */
.app-shell {
  --bs-primary:        #80D8FF;
  --bs-primary-rgb:    128,216,255;
  --bs-success:        #80D8FF;
  --bs-success-rgb:    128,216,255;
  --bs-warning:        #FFD166;
  --bs-warning-rgb:    255,209,102;
  --bs-danger:         #FF6B8A;
  --bs-danger-rgb:     255,107,138;
  --bs-info:           #5BBFE0;
  --bs-info-rgb:       91,191,224;
  --bs-secondary:      #8A9BB0;
  --bs-secondary-rgb:  138,155,176;
  --bs-link-color:     #80D8FF;
  --bs-link-hover-color: #4FC3F7;
}

/* Cards: rounded + theme shadow */
.app-shell .card {
  border: none !important;
  border-radius: 18px !important;
  box-shadow: 0 2px 10px rgba(22,50,80,0.06) !important;
  background: #fff;
  overflow: hidden;
}
.app-shell .card .card-header,
.app-shell .card > .card-body > .card-title:first-child {
  border-bottom: 1px solid var(--border);
  background: var(--green-light);
  padding: 18px 22px;
  font-family: 'Nunito', 'Tajawal', sans-serif;
  font-weight: 800;
  color: var(--text);
  border-radius: 18px 18px 0 0;
}
.app-shell .card .card-body { padding: 22px; }

/* Buttons — re-paint Bootstrap variants in theme palette */
.app-shell .btn {
  border-radius: 10px;
  font-family: 'Nunito', 'Tajawal', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border: none;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.app-shell .btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 8px; }

.app-shell .btn-primary,
.app-shell .btn-success {
  background: var(--green) !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(128,216,255,0.25);
}
.app-shell .btn-primary:hover,
.app-shell .btn-success:hover {
  background: var(--green-mid) !important;
  transform: translateY(-1px);
  color: #fff !important;
}

.app-shell .btn-warning {
  background: var(--yellow) !important;
  color: #92400E !important;
  box-shadow: 0 3px 10px rgba(255,209,102,0.3);
}
.app-shell .btn-warning:hover {
  background: #FFC73C !important;
  color: #92400E !important;
  transform: translateY(-1px);
}

.app-shell .btn-danger {
  background: var(--coral) !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(255,107,138,0.3);
}
.app-shell .btn-danger:hover {
  background: #FF4E73 !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.app-shell .btn-info {
  background: var(--sky-mid) !important;
  color: #fff !important;
}
.app-shell .btn-info:hover { background: var(--sky-dark) !important; color: #fff !important; }

.app-shell .btn-secondary {
  background: var(--bg) !important;
  color: var(--text-mid) !important;
}
.app-shell .btn-secondary:hover { background: #E5EDF6 !important; }

/* Outline variants */
.app-shell .btn-outline-primary,
.app-shell .btn-outline-success {
  background: transparent !important;
  color: var(--green) !important;
  border: 1.5px solid var(--green) !important;
  box-shadow: none;
}
.app-shell .btn-outline-primary:hover,
.app-shell .btn-outline-success:hover {
  background: var(--green) !important;
  color: #fff !important;
}
.app-shell .btn-outline-danger {
  background: transparent !important;
  color: var(--coral) !important;
  border: 1.5px solid var(--coral) !important;
}
.app-shell .btn-outline-danger:hover { background: var(--coral) !important; color: #fff !important; }

/* Tables */
.app-shell .table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
  color: var(--text);
}
.app-shell .table > :not(caption) > * > * { padding: 14px 16px; vertical-align: middle; }
.app-shell .table > thead {
  background: transparent;
  border-bottom: 1.5px solid var(--border);
}
.app-shell .table > thead th {
  font-family: 'Nunito', 'Tajawal', sans-serif;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  border-bottom: none;
  background: transparent;
}
.app-shell .table > tbody > tr { border-bottom: 1px solid var(--border); }
.app-shell .table > tbody > tr:last-child { border-bottom: none; }
.app-shell .table > tbody > tr:hover { background: var(--bg); }
.app-shell .table-striped > tbody > tr:nth-of-type(odd) > * { background-color: transparent; }

/* Form controls */
.app-shell .form-control,
.app-shell .form-select {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s;
}
.app-shell .form-control:focus,
.app-shell .form-select:focus {
  border-color: var(--sky-mid);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(91,191,224,0.15);
}
.app-shell .form-label {
  font-weight: 700;
  font-size: 12px;
  color: var(--text-mid);
  margin-bottom: 6px;
}

/* Badges */
.app-shell .badge {
  font-family: 'Nunito', 'Tajawal', sans-serif;
  font-weight: 700;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.app-shell .badge.bg-primary,
.app-shell .badge.bg-success,
.app-shell .badge.bg-label-primary,
.app-shell .badge.bg-label-success {
  background: var(--green-light) !important;
  color: var(--green) !important;
}
.app-shell .badge.bg-warning,
.app-shell .badge.bg-label-warning {
  background: var(--yellow-light) !important;
  color: #B45309 !important;
}
.app-shell .badge.bg-danger,
.app-shell .badge.bg-label-danger {
  background: var(--coral-light) !important;
  color: #BE185D !important;
}
.app-shell .badge.bg-info,
.app-shell .badge.bg-label-info {
  background: var(--sky-light) !important;
  color: var(--sky-dark) !important;
}
.app-shell .badge.bg-secondary,
.app-shell .badge.bg-label-secondary {
  background: var(--bg) !important;
  color: var(--text-mid) !important;
}

/* Page heading inside legacy pages — make h1/h2/h3 fit theme typography */
.app-shell .card .card-body h1,
.app-shell .card .card-body h2,
.app-shell .card .card-body h3,
.app-shell .card .card-body h4,
.app-shell .card .card-body h5 {
  font-family: 'Nunito', 'Tajawal', sans-serif;
  color: var(--text);
}

/* Pagination */
.app-shell .pagination .page-link {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  margin: 0 2px;
  color: var(--text-mid);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
}
.app-shell .pagination .page-item.active .page-link {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.app-shell .pagination .page-link:hover { background: var(--bg); color: var(--green); }

/* Modal */
.app-shell .modal-content { border: none; border-radius: 18px; }
.app-shell .modal-header { border-bottom: 1px solid var(--border); padding: 18px 22px; }
.app-shell .modal-footer { border-top: 1px solid var(--border); padding: 14px 22px; }

/* Avatar / initial badges (used by some legacy pages) */
.app-shell .avatar-initial {
  border-radius: 10px;
  font-family: 'Nunito', 'Tajawal', sans-serif;
  font-weight: 800;
}

/* ─── Button intent consistency ───────────────────────────── */
/* Edit action: always outlined primary */
.app-shell .btn-edit {
  background: transparent !important;
  color: var(--sky-dark) !important;
  border: 1.5px solid var(--sky-mid) !important;
  box-shadow: none;
}
.app-shell .btn-edit:hover {
  background: var(--sky-light) !important;
  color: var(--sky-dark) !important;
  transform: none;
}
/* Remove the yellow warning override so it can coexist for other use */
.app-shell .btn-warning { color: #92400E !important; }

/* ─── Responsive tweaks ───────────────────────────────────── */
@media (max-width: 768px) {
  .content { padding: 16px; gap: 16px; }
  .page-header-title { font-size: 17px; }
  .action-btn { padding: 7px 12px; font-size: 12px; }
  .app-shell .card .card-header { padding: 14px 16px; }
  .app-shell .card .card-body  { padding: 14px 16px; }
  .app-shell .table > :not(caption) > * > * { padding: 10px 12px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 576px) {
  .page-header { gap: 8px; }
  .page-header-title { font-size: 16px; }
}
/* Card header on pages with filter rows: no tint background */
.app-shell .card .card-header.card-header-plain {
  background: white !important;
  border-bottom: 1px solid var(--border);
}

/* Form section label */
.form-section-label {
  font-family: 'Nunito', 'Tajawal', sans-serif;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Status toggle buttons – consistent sizing */
.app-shell .btn-publish {
  min-width: 100px;
}

/* Table action buttons row */
.tbl-actions { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: nowrap; }

/* Alert override — use our flash style instead of Bootstrap */
.app-shell .alert {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-shell .alert-success {
  background: var(--green-light) !important;
  color: var(--green-dark) !important;
  border-inline-start: 3px solid var(--green) !important;
}
.app-shell .alert-danger {
  background: var(--coral-light) !important;
  color: #9B1239 !important;
  border-inline-start: 3px solid var(--coral) !important;
}
.app-shell .alert-warning {
  background: var(--yellow-light) !important;
  color: #92400E !important;
  border-inline-start: 3px solid var(--yellow) !important;
}
.app-shell .btn-close { opacity: 0.5; }
