/* ==========================================================
   مدرستي — نظام التصميم
   فكرة التصميم: "دفتر القسم الرقمي" — شرائط تبويب أيام كأنها
   فواصل دفتر، وبطاقات مواد بألوان أقلام مميزة.
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@500;700;800&family=IBM+Plex+Sans+Arabic:wght@400;500;600&display=swap');

:root {
  /* ----- الألوان ----- */
  --ink:        #1F3B57;   /* أزرق سبورة داكن */
  --ink-2:      #2C5078;
  --paper:      #F1F4F9;   /* خلفية فاتحة زرقاء ناعمة */
  --paper-card: #FFFFFF;
  --amber:      #E8A33D;   /* لون القلم البرتقالي - إبراز */
  --amber-dark: #C6821E;
  --green:      #2FA876;   /* حضور / نجاح */
  --red:        #E4574C;   /* غياب / خطر */
  --violet:     #8E5CE0;   /* لمسة ثانوية */
  --line:       #DDE4EE;
  --text:       #1B2430;
  --text-mute:  #6B7688;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 24px rgba(31, 59, 87, 0.08);
  --shadow-hover: 0 14px 32px rgba(31, 59, 87, 0.14);

  --font-display: 'Tajawal', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans Arabic', system-ui, sans-serif;
}

[data-theme="dark"] {
  --ink:        #EAF0F8;
  --ink-2:      #C7D6E8;
  --paper:      #101823;
  --paper-card: #16202D;
  --line:       #223046;
  --text:       #E7ECF3;
  --text-mute:  #92A0B4;
  --shadow: 0 8px 24px rgba(0,0,0,0.35);
  --shadow-hover: 0 14px 32px rgba(0,0,0,0.45);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  direction: rtl;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 8px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ------------------ زر عام ------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { box-shadow: var(--shadow-hover); }
.btn-amber { background: var(--amber); color: #1B2430; }
.btn-outline { background: transparent; border: 2px solid var(--line); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

/* ------------------ نماذج ------------------ */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mute);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--paper-card);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--amber);
}

/* ------------------ بطاقات ------------------ */
.card {
  background: var(--paper-card);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
}
.badge-green { background: rgba(47,168,118,.14); color: var(--green); }
.badge-red   { background: rgba(228,87,76,.14); color: var(--red); }
.badge-amber { background: rgba(232,163,61,.16); color: var(--amber-dark); }
.badge-mute  { background: var(--line); color: var(--text-mute); }

/* ==========================================================
   واجهات الدخول (splash / login / register)
   ========================================================== */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(160deg, #0B1424 0%, #16243A 35%, #1F3B57 65%, #2C5078 100%);
  background-size: 34px 34px, 34px 34px, 200% 200%;
  background-position: 0 0, 0 0, 0% 0%;
  animation: authBgShift 12s ease-in-out infinite;
}
@keyframes authBgShift {
  0%, 100% { background-position: 0 0, 0 0, 0% 0%; }
  50% { background-position: 0 0, 0 0, 100% 100%; }
}
.auth-shell::before, .auth-shell::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none;
  animation: blobFloat 9s ease-in-out infinite;
}
.auth-shell::before {
  width: 360px; height: 360px; background: rgba(232,163,61,.4);
  top: -100px; right: -100px;
}
.auth-shell::after {
  width: 320px; height: 320px; background: rgba(142,92,224,.4);
  bottom: -80px; left: -80px; animation-delay: 2s;
}
@keyframes blobFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  50%      { transform: translate(-14px, 18px) scale(1.1); }
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--paper-card);
  border-radius: 28px;
  box-shadow: 0 30px 70px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.08), 0 0 60px rgba(232,163,61,.12);
  padding: 38px 30px 32px;
  position: relative;
  z-index: 2;
  animation: fadeInUp .55s cubic-bezier(.2,.9,.25,1) both;
  overflow: hidden;
}
.auth-card::before {
  content: ''; position: absolute; top: 0; right: 0; left: 0; height: 4px;
  background: linear-gradient(90deg, var(--violet), var(--amber), var(--green), var(--violet));
  background-size: 300% 100%;
  animation: authStripe 4s linear infinite;
}
@keyframes authStripe { to { background-position: -300% 0; } }
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.brand .logo,
.logo {
  width: 54px; height: 54px;
  border-radius: 17px;
  display: block; object-fit: cover;
  box-shadow: 0 10px 24px rgba(31,59,87,.4), 0 0 0 3px rgba(232,163,61,.18);
  position: relative;
  animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { box-shadow: 0 10px 24px rgba(31,59,87,.4), 0 0 0 3px rgba(232,163,61,.18); }
  50% { box-shadow: 0 10px 28px rgba(31,59,87,.45), 0 0 0 7px rgba(232,163,61,.05); }
}
.brand .name { font-family: var(--font-display); font-weight: 900; font-size: 22px; color: var(--ink); letter-spacing: -.2px; }
.brand .tag { font-size: 12px; color: var(--text-mute); font-weight: 600; }

.role-tabs {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 24px;
  background: linear-gradient(160deg, #101B2C 0%, #1F3B57 100%);
  padding: 12px 8px; border-radius: 22px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 10px 26px rgba(16,27,44,.35);
}
.role-tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 2px 6px; border-radius: 15px;
  font-family: var(--font-display); font-weight: 800; font-size: 10px; line-height: 1.25;
  color: rgba(255,255,255,.55); text-align: center; word-break: keep-all;
  transition: all .2s cubic-bezier(.2,.9,.25,1);
}
.role-tabs a .tab-emoji {
  font-size: 17px; line-height: 1; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08); transition: all .2s ease;
}
.role-tabs a:nth-child(1) .tab-emoji { background: rgba(255,255,255,.1); }
.role-tabs a:nth-child(2) .tab-emoji { background: rgba(47,168,118,.22); }
.role-tabs a:nth-child(3) .tab-emoji { background: rgba(142,92,224,.25); }
.role-tabs a:nth-child(4) .tab-emoji { background: rgba(58,161,201,.25); }
.role-tabs a:nth-child(5) .tab-emoji { background: rgba(232,163,61,.25); }
.role-tabs a.active {
  color: #fff;
  background: rgba(255,255,255,.07);
}
.role-tabs a.active .tab-emoji {
  transform: scale(1.15) translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}
.role-tabs a:nth-child(1).active .tab-emoji { background: linear-gradient(135deg,#fff,#cfd8e3); box-shadow: 0 6px 16px rgba(255,255,255,.25); }
.role-tabs a:nth-child(2).active .tab-emoji { background: linear-gradient(135deg,#4FD1A5,var(--green)); }
.role-tabs a:nth-child(3).active .tab-emoji { background: linear-gradient(135deg,#A78BFA,var(--violet)); }
.role-tabs a:nth-child(4).active .tab-emoji { background: linear-gradient(135deg,#5FA8E0,#3AA1C9); }
.role-tabs a:nth-child(5).active .tab-emoji { background: linear-gradient(135deg,var(--amber),var(--amber-dark)); }

/* حقول البريد وكلمة المرور — أيقونات وتوهّج بدون أي تعديل على HTML */
.auth-card .field { position: relative; }
.auth-card .field:has(input[type="email"])::after,
.auth-card .field:has(input[type="password"])::after {
  position: absolute; left: 16px; top: 39px; font-size: 16px; pointer-events: none; opacity: .55;
}
.auth-card .field:has(input[type="email"])::after { content: '📧'; }
.auth-card .field:has(input[type="password"])::after { content: '🔒'; }
.auth-card .field:has(input[type="email"]) input,
.auth-card .field:has(input[type="password"]) input { padding-left: 42px; }
.auth-card .field input:focus { box-shadow: 0 0 0 4px rgba(232,163,61,.15); border-color: var(--amber); }

/* حقل الكود المميّز */
.code-input {
  text-align: center; letter-spacing: 6px; font-weight: 800; font-size: 22px;
  font-family: var(--font-display); background: var(--paper);
  border: 2px solid var(--line); transition: all .2s ease;
}
.code-input:focus { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(232,163,61,.15); background: var(--paper-card); }

/* ==========================================================
   واجهة التطبيق (بعد الدخول): شريط علوي + قائمة جانبية
   ========================================================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  background: var(--ink);
  color: #fff;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}
.sidebar .brand .name, .sidebar .brand .tag { color: #fff; }
.sidebar .brand .tag { color: rgba(255,255,255,.6); }
.sidebar nav { margin-top: 30px; display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,.75); font-weight: 600; font-size: 14px;
}
.sidebar nav a svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar nav a.active, .sidebar nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar .logout { margin-top: auto; }

.main {
  flex: 1;
  min-width: 0;
  padding: 26px 28px 100px;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin: -26px -28px 24px; padding: 14px 22px;
  flex-wrap: wrap; gap: 12px;
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(31,59,87,.08);
}
[data-theme="dark"] .topbar { background: rgba(16,24,35,.72); }
.topbar::after {
  content: ''; position: absolute; inset-inline: 0; bottom: -1px; height: 2.5px;
  background: linear-gradient(90deg, var(--amber), var(--violet), transparent);
}
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.topbar-logo {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  box-shadow: 0 5px 14px rgba(31,59,87,.3);
}
.topbar h1 { font-size: 20px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { color: var(--text-mute); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ------------------ شارة تبديل الابن النشط في الهيدر ------------------ */
.kid-switcher {
  position: relative; display: flex; align-items: center; gap: 7px;
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: 100px; padding: 5px 12px 5px 6px;
  box-shadow: var(--shadow); cursor: pointer;
}
.kid-switcher-avatar {
  width: 26px; height: 26px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 11px;
}
.kid-switcher-avatar img { width: 100%; height: 100%; object-fit: cover; }
.kid-switcher-name { font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.kid-switcher svg { width: 13px; height: 13px; color: var(--text-mute); flex-shrink: 0; }
.kid-switcher-form { position: absolute; inset: 0; margin: 0; }
.kid-switcher-form select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.topbar-actions {
  display: flex; align-items: center; gap: 6px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 100px; padding: 5px; box-shadow: inset 0 1px 2px rgba(0,0,0,.03);
}
[data-theme="dark"] .topbar-actions { background: rgba(255,255,255,.04); }
.toggle-theme { position: relative; }
.toggle-theme svg { width: 19px; height: 19px; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 15px;
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  box-shadow: 0 4px 12px rgba(232,163,61,.35);
  border: 2px solid var(--paper-card);
  padding: 0; cursor: pointer; flex-shrink: 0;
}

/* ------------------ جرس الإشعارات ------------------ */
.notif-badge {
  position: absolute; top: -4px; left: -4px; min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: 100px; background: var(--red); color: #fff; font-size: 9.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--paper-card);
}

/* ------------------ مبدّل اللغة (عربي / فرنسي / إنجليزي) ------------------ */
.lang-switcher { position: relative; }
.lang-switcher-btn {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  color: #fff; border-radius: 100px; padding: 6px 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 11.5px;
  cursor: pointer; transition: background .15s ease;
}
.lang-switcher-btn:hover { background: rgba(255,255,255,.15); }
.lang-switcher-btn .lang-flag { font-size: 13px; line-height: 1; }
.lang-switcher-btn svg { flex-shrink: 0; opacity: .8; }
.lang-switcher-menu {
  position: absolute; top: calc(100% + 8px); z-index: 70; min-width: 150px;
  background: var(--paper-card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-hover); padding: 6px; display: none;
}
[dir="rtl"] .lang-switcher-menu { right: 0; }
[dir="ltr"] .lang-switcher-menu { left: 0; }
.lang-switcher-menu.open { display: block; animation: dropIn .15s ease forwards; }
.lang-switcher-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--text);
  transition: background .15s ease;
}
.lang-switcher-item:hover { background: var(--paper); }
.lang-switcher-item.active { color: var(--amber-dark); background: rgba(232,163,61,.12); }

/* داخل السايدبار: بجانب اسم التطبيق مباشرة */
.sidebar .brand { flex-wrap: wrap; row-gap: 10px; }
.sidebar .brand .lang-switcher { margin-inline-start: auto; }

/* داخل الهيدر العلوي على الجوال: نفس مظهر أزرار الوضع الليلي/الإشعارات لكن بلون فاتح */
.topbar-actions .lang-switcher-btn {
  background: transparent; border: none; color: var(--text); padding: 6px 8px;
}
.topbar-actions .lang-switcher-btn:hover { background: var(--paper-card); border-radius: 100px; }

@media (max-width: 880px) {
  .lang-switcher-btn .lang-code { display: none; }
  .lang-switcher-btn { padding: 6px; }
}

/* ------------------ قائمة الحساب المنسدلة ------------------ */
.account-menu { position: relative; }
.account-dropdown {
  position: absolute; top: calc(100% + 12px); left: 0; width: 240px;
  background: var(--paper-card); border-radius: 16px; box-shadow: var(--shadow-hover);
  border: 1px solid var(--line); padding: 8px; z-index: 60;
  display: none; opacity: 0; transform: translateY(-6px);
  transition: opacity .15s ease, transform .15s ease;
}
.account-dropdown.open { display: block; animation: dropIn .18s ease forwards; }
@keyframes dropIn { to { opacity: 1; transform: translateY(0); } }
.account-dropdown-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line);
}
.account-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--text);
  transition: background .15s ease;
}
.account-dropdown-item:hover { background: var(--paper); }
.account-dropdown-item.danger { color: var(--red); margin-top: 4px; border-top: 1px solid var(--line); padding-top: 12px; border-radius: 0 0 10px 10px; }

/* شريط تنقّل سفلي على الهاتف (تجربة أشبه بتطبيق) — يتقلّص ليسع كل العناصر بلا تمرير */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; right: 0; left: 0;
  background: var(--paper-card);
  border-top: 1px solid var(--line);
  padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-between;
  z-index: 40;
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 8.3px; color: var(--text-mute); font-weight: 700;
  padding: 3px 1px; flex: 1 1 0; min-width: 0;
}
.bottom-nav a span { max-width: 100%; text-align: center; line-height: 1.12; overflow-wrap: break-word; word-break: keep-all; }
.bottom-nav a.active { color: var(--amber-dark); }
.bottom-nav svg { width: 18px; height: 18px; flex-shrink: 0; }

@media (max-width: 360px) {
  .bottom-nav a { font-size: 7.6px; }
  .bottom-nav svg { width: 15px; height: 15px; }
}

/* ==========================================================
   العنصر المميز: شريط "دفتر" لجدول الحصص الأسبوعي
   ========================================================== */
.notebook {
  background: var(--paper-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.notebook-tabs {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--ink);
}
.notebook-tabs::-webkit-scrollbar { display: none; }
.notebook-tabs a {
  flex: 0 0 auto;
  padding: 14px 20px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: rgba(255,255,255,.55);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.notebook-tabs a.active {
  color: #fff;
  border-bottom-color: var(--amber);
  background: rgba(255,255,255,.06);
}
.notebook-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; }

.lesson-chip {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--line);
  border-right: 6px solid var(--chip, var(--violet));
  background: var(--paper-card);
  transition: transform .15s ease, box-shadow .15s ease;
}
.lesson-chip:hover { transform: translateX(-2px); box-shadow: var(--shadow); }
.lesson-chip .time { font-family: var(--font-display); font-weight: 800; font-size: 14px; color: var(--ink); min-width: 78px; }
.lesson-chip .info b { display: block; font-size: 14.5px; }
.lesson-chip .info span { font-size: 12.5px; color: var(--text-mute); }
.lesson-chip .info small.room { font-size: 11.5px; color: var(--text-mute); }

.empty-state {
  text-align: center; padding: 40px 20px; color: var(--text-mute);
}

/* ==========================================================
   ترحيب وحالات فارغة عصرية (Hero / Onboarding)
   ========================================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-8px) rotate(3deg); }
}
.main > * { animation: fadeInUp .5s ease both; }
.main > *:nth-child(2) { animation-delay: .05s; }
.main > *:nth-child(3) { animation-delay: .1s; }
.main > *:nth-child(4) { animation-delay: .15s; }

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 30px 26px;
  margin-bottom: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(232,163,61,.35), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(142,92,224,.35), transparent 55%),
    linear-gradient(135deg, var(--ink) 0%, var(--ink-2) 100%);
  color: #fff;
  box-shadow: var(--shadow-hover);
}
.hero-eyebrow { font-size: 12.5px; color: rgba(255,255,255,.65); font-weight: 700; letter-spacing: .5px; margin-bottom: 6px; }
.hero h1 { color: #fff; font-size: 24px; margin-bottom: 6px; }
.hero p { color: rgba(255,255,255,.75); font-size: 14px; margin: 0; }
.hero-deco {
  position: absolute; left: -20px; top: -20px; font-size: 90px; opacity: .12;
  animation: floatSlow 6s ease-in-out infinite;
  user-select: none; pointer-events: none;
}
.hero-chip {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  background: rgba(255,255,255,.14); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.18); border-radius: 100px;
  padding: 8px 16px; font-size: 13px; font-weight: 700; color: #fff;
}
.hero-compact { padding: 18px 20px; margin-bottom: 14px; border-radius: 20px; }
.hero-compact h1 { font-size: 19px; margin-bottom: 2px; }
.hero-compact p { font-size: 12.5px; }
.hero-compact .hero-deco { font-size: 56px; opacity: .15; }
.hero-compact .hero-chip { margin-top: 10px; padding: 6px 12px; font-size: 12px; }
.hero-photo {
  position: absolute; left: 22px; top: 22px; width: 64px; height: 64px; border-radius: 18px;
  overflow: hidden; border: 2px solid rgba(255,255,255,.3); box-shadow: 0 8px 20px rgba(0,0,0,.25);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-has-photo .hero-eyebrow,
.hero-has-photo h1,
.hero-has-photo p { padding-left: 84px; }
@media (max-width: 380px) {
  .hero-has-photo .hero-eyebrow,
  .hero-has-photo h1,
  .hero-has-photo p { padding-left: 74px; }
}

.onboard-card {
  text-align: center; padding: 48px 24px; border-radius: var(--radius-lg);
  background: var(--paper-card); box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.onboard-illustration {
  width: 96px; height: 96px; margin: 0 auto 20px; border-radius: 28px;
  display: flex; align-items: center; justify-content: center; font-size: 44px;
  background: linear-gradient(135deg, rgba(232,163,61,.22), rgba(142,92,224,.22));
  animation: floatSlow 5s ease-in-out infinite;
}
.onboard-card h3 { font-size: 19px; margin-bottom: 8px; }
.onboard-card p { color: var(--text-mute); font-size: 14px; max-width: 320px; margin: 0 auto 22px; }

.btn-glow {
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  color: #1B2430; box-shadow: 0 10px 26px rgba(232,163,61,.4);
}
.btn-glow:hover { box-shadow: 0 14px 34px rgba(232,163,61,.55); }
.auth-card .btn-glow { position: relative; overflow: hidden; }
.auth-card .btn-glow::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 60%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-20deg); left: -80%;
  animation: btnShimmer 3.2s ease-in-out infinite;
}
@keyframes btnShimmer {
  0% { left: -80%; }
  35%, 100% { left: 140%; }
}

/* ==========================================================
   بطاقة نموذج بعناوين أقسام ملوّنة + صفوف أبناء بأفاتار
   ========================================================== */
.form-section-title {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.form-section-title .num {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  color: #1B2430; font-family: var(--font-display); font-weight: 800; font-size: 13px;
}
.cascade-field { animation: fadeInUp .35s ease both; }

.child-row {
  padding: 14px 16px; border-radius: var(--radius-md);
  border: 1.5px solid var(--line); background: var(--paper-card);
  margin-bottom: 10px; transition: box-shadow .15s ease, border-color .15s ease;
}
.child-row:hover { box-shadow: var(--shadow); }
.child-row.is-active { border-color: var(--amber); background: linear-gradient(135deg, rgba(232,163,61,.07), transparent); }
.child-top { display: flex; align-items: center; gap: 12px; }
.child-avatar {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 17px; color: #fff;
  background: linear-gradient(135deg, var(--violet), #6f43c0);
}
.child-row.is-active .child-avatar { background: linear-gradient(135deg, var(--amber), var(--amber-dark)); }
.child-avatar img, .photo-picker img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.child-name-wrap { flex: 1; min-width: 0; }
.child-name-wrap b {
  display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.child-name-wrap span {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 12px; color: var(--text-mute); margin-top: 3px; line-height: 1.4;
}
.child-status { flex-shrink: 0; }
.child-bottom-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line);
}

.teacher-eval-row {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  margin-top: 10px;
}
.teacher-code-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 100px;
  padding: 5px 10px; font-size: 12px; font-family: var(--font-display); font-weight: 700; color: var(--text-mute);
}
.teacher-code-chip button { background: none; border: none; cursor: pointer; font-size: 12px; padding: 0; }

/* ==========================================================
   استمارة تقييم التلميذ (رأي الأستاذ) — عناصر تقييم سريعة اللمس
   ========================================================== */
.rating-row { margin-bottom: 12px; }
.rating-row > .rating-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.rating-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rating-pills input { position: absolute; opacity: 0; width: 0; height: 0; }
.rating-pills label {
  display: flex; align-items: center; justify-content: center;
  padding: 10px 4px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--paper-card); font-size: 12.5px; font-weight: 700; color: var(--text-mute);
  cursor: pointer; transition: all .15s ease; text-align: center;
}
.rating-pills input:nth-of-type(1):checked + label { background: rgba(228,87,76,.12); border-color: var(--red); color: var(--red); }
.rating-pills input:nth-of-type(2):checked + label { background: rgba(232,163,61,.14); border-color: var(--amber-dark); color: var(--amber-dark); }
.rating-pills input:nth-of-type(3):checked + label { background: rgba(47,168,118,.12); border-color: var(--green); color: var(--green); }

.flag-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.flag-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 100px; border: 1.5px solid var(--line);
  background: var(--paper-card); font-size: 12.5px; font-weight: 600; color: var(--text-mute);
  cursor: pointer; transition: all .15s ease;
}
.flag-chip input { display: none; }
.flag-chip:has(input:checked) { background: rgba(228,87,76,.1); border-color: var(--red); color: var(--red); }
.flag-chip.picked { background: rgba(232,163,61,.1); border-color: var(--amber-dark); color: var(--amber-dark); cursor: default; }

/* ------------------ بطاقة فرض (نظام الدورتين) ------------------ */
.hw-card {
  border: 1.5px solid var(--line); border-radius: var(--radius-md);
  padding: 12px 14px; margin-bottom: 10px; background: var(--paper-card);
}
.hw-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hw-card-top b { font-size: 14px; }
.hw-date { font-size: 12px; color: var(--text-mute); margin-top: 4px; }
.hw-section-label { font-size: 12px; font-weight: 800; color: var(--text-mute); margin: 14px 0 8px; }
.hw-section-label:first-of-type { margin-top: 0; }

/* ------------------ بطاقة فرض احترافية (teacher_note.php) ------------------ */
.hw-card-v2 {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper-card); border-radius: 16px;
  box-shadow: var(--shadow); margin-bottom: 10px; padding: 12px 14px;
  border-right: 5px solid var(--line);
}
.hw-card-v2.is-done { border-right-color: var(--green); }
.hw-card-v2.is-upcoming { border-right-color: var(--amber); }
.hw-card-v2-badge {
  flex-shrink: 0; width: 54px; height: 54px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  background: linear-gradient(135deg, rgba(47,168,118,.16), rgba(47,168,118,.08));
  font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--green);
}
.hw-card-v2-badge span { font-size: 9px; font-weight: 700; opacity: .75; }
.hw-card-v2-date {
  flex-shrink: 0; width: 54px; height: 54px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  background: linear-gradient(135deg, rgba(232,163,61,.18), rgba(232,163,61,.09));
}
.hw-card-v2-date b { font-family: var(--font-display); font-weight: 800; font-size: 19px; color: var(--amber-dark); line-height: 1; }
.hw-card-v2-date span { font-size: 9px; font-weight: 700; color: var(--amber-dark); opacity: .8; margin-top: 2px; }
.hw-card-v2-date.is-empty { font-size: 20px; background: var(--paper); }
.hw-card-v2-body { flex: 1; min-width: 0; }
.hw-card-v2-body b { font-family: var(--font-display); font-size: 14.5px; font-weight: 800; display: block; }
.hw-card-v2-tag { display: inline-block; font-size: 10.5px; font-weight: 700; margin-top: 4px; color: var(--green); }
.hw-card-v2-lessons { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.hw-card-v2-lessons span {
  font-size: 10.5px; font-weight: 700; padding: 3px 10px; border-radius: 100px;
  background: rgba(142,92,224,.1); color: var(--violet);
}
.hw-card-v2-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }

/* ------------------ علامات تحتاج انتباه — تصميم تحذيري احترافي ------------------ */
.attn-flags { display: flex; flex-direction: column; gap: 8px; }
.attn-flag-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--paper-card); cursor: pointer; transition: all .18s ease;
}
.attn-flag-chip input { display: none; }
.attn-flag-icon { font-size: 19px; flex-shrink: 0; }
.attn-flag-text { flex: 1; font-size: 13.5px; font-weight: 700; color: var(--text); }
.attn-flag-check {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: transparent;
  flex-shrink: 0; transition: all .18s ease;
}
.attn-flag-chip:has(input:checked) {
  background: linear-gradient(135deg, rgba(228,87,76,.1), rgba(228,87,76,.04));
  border-color: var(--red);
}
.attn-flag-chip:has(input:checked) .attn-flag-check { background: var(--red); border-color: var(--red); color: #fff; }
.attn-flag-chip:has(input:checked) .attn-flag-text { color: var(--red); font-weight: 800; }

/* ------------------ حالة فارغة للفروض — بستايل ودود احترافي ------------------ */
.hw-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 26px 20px; border-radius: 16px; margin-bottom: 4px;
  background: repeating-linear-gradient(135deg, var(--paper), var(--paper) 8px, rgba(31,59,87,.02) 8px, rgba(31,59,87,.02) 16px);
  border: 1.5px dashed var(--line);
}
.hw-empty-icon {
  width: 52px; height: 52px; border-radius: 50%; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.hw-empty-icon.done { background: rgba(47,168,118,.12); }
.hw-empty-icon.upcoming { background: rgba(232,163,61,.14); }
.hw-empty b { font-size: 14px; font-family: var(--font-display); font-weight: 800; color: var(--text); margin-bottom: 4px; }
.hw-empty span { font-size: 11.5px; color: var(--text-mute); line-height: 1.6; max-width: 240px; }

/* ------------------ بطاقة فرض ذكية (parent/homework.php) — مواد وأساتذة مدمجة ------------------ */
.hw-card-v2-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.hw-subject-tag {
  font-size: 10px; font-weight: 800; padding: 3px 10px; border-radius: 100px;
  background: color-mix(in srgb, var(--c, var(--violet)) 16%, var(--paper));
  color: color-mix(in srgb, var(--c, var(--violet)) 78%, black);
}
.hw-teacher-tag { font-size: 10px; font-weight: 700; color: var(--text-mute); padding: 3px 8px; }
.hw-term-tag {
  font-size: 9px; font-weight: 800; color: var(--text-mute);
  background: var(--paper); border-radius: 6px; padding: 3px 7px;
}
.hw-card-v2-date.is-urgent { background: linear-gradient(135deg, rgba(228,87,76,.22), rgba(228,87,76,.1)); }
.hw-card-v2-date.is-urgent b { color: var(--red); }
.hw-card-v2-date.is-urgent span { color: var(--red); }
.hw-countdown {
  display: inline-block; margin-top: 6px; font-size: 10.5px; font-weight: 800;
  color: var(--green); background: rgba(47,168,118,.1); padding: 3px 10px; border-radius: 100px;
}
.hw-countdown.urgent { color: var(--red); background: rgba(228,87,76,.12); }

/* ------------------ مبدّل المادة (أستاذ متعدد المواد لنفس التلميذ) ------------------ */
.subject-switch-panel {
  background: linear-gradient(160deg, #101B2C 0%, #1F3B57 100%);
  border-radius: 18px; padding: 14px; margin-bottom: 16px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.subject-switch-label { font-size: 11.5px; font-weight: 700; color: rgba(255,255,255,.6); margin-bottom: 10px; }
.subject-switch-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.subject-switch-btn {
  flex: 1 1 auto; min-width: 90px; text-align: center;
  font-family: var(--font-display); font-weight: 800; font-size: 12.5px;
  padding: 10px 14px; border-radius: 12px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.8); text-decoration: none; transition: all .15s ease;
}
.subject-switch-btn.active {
  background: var(--c, var(--amber)); color: #1B2430; border-color: transparent;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--c, var(--amber)) 45%, transparent);
}

/* ------------------ بطاقة حصة في الجدول (يديرها ولي الأمر) ------------------ */
.sched-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--radius-md);
  border: 1.5px solid var(--line); border-right: 6px solid var(--chip, var(--violet));
  background: var(--paper-card); margin-bottom: 10px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.sched-card:hover { transform: translateX(-2px); box-shadow: var(--shadow); }
.sched-time {
  flex-shrink: 0; text-align: center; min-width: 58px;
  font-family: var(--font-display);
}
.sched-time b { display: block; font-size: 15px; color: var(--ink); }
.sched-time span { font-size: 10.5px; color: var(--text-mute); }
.sched-info { flex: 1; min-width: 0; }
.sched-info b { display: block; font-size: 14.5px; margin-bottom: 2px; }
.sched-info > span { font-size: 12.5px; color: var(--text-mute); }
.sched-meta { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.sched-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }

/* ------------------ الجدول الأسبوعي الشبكي (بطاقات مصغّرة أنيقة) ------------------ */
.week-grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 4px 2px; }
.week-grid { border-collapse: separate; border-spacing: 5px; width: max-content; min-width: 100%; margin-top: 8px; }
.week-grid th, .week-grid td {
  padding: 0; text-align: center; font-size: 11px; white-space: nowrap; vertical-align: middle;
}
.week-grid thead th {
  background: linear-gradient(160deg, var(--ink), var(--ink-2));
  color: #fff; font-family: var(--font-display); font-weight: 800;
  font-size: 10.5px; line-height: 1.35; padding: 11px 10px; border-radius: 12px;
  box-shadow: 0 3px 8px rgba(31,59,87,.25);
}
.week-grid .day-col {
  position: sticky; right: 0; z-index: 2;
  background: var(--paper-card); font-family: var(--font-display); font-weight: 800;
  color: var(--ink); min-width: 68px; font-size: 12.5px; border-radius: 12px;
  box-shadow: var(--shadow); padding: 10px 6px;
}
.week-grid thead .day-col {
  background: linear-gradient(160deg, var(--amber), var(--amber-dark));
  color: #1B2430; z-index: 3; box-shadow: 0 3px 10px rgba(232,163,61,.35);
}
.week-grid td:not(.has-lesson) {
  background: var(--paper-card);
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  min-width: 62px; height: 52px;
}
.week-grid td.has-lesson {
  background: color-mix(in srgb, var(--chip, var(--violet)) 16%, var(--paper-card));
  border: none; border-radius: 12px; min-width: 62px; height: 52px;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--chip, var(--violet)) 30%, transparent);
  padding: 6px 5px !important;
}
.week-grid td.has-lesson::before {
  content: ''; display: block; width: 22px; height: 3px; border-radius: 3px;
  background: var(--chip, var(--violet)); margin: 0 auto 4px;
}
.week-grid td.has-lesson b { display: block; font-size: 10.5px; color: var(--ink); font-weight: 800; line-height: 1.25; }
.week-grid td.has-lesson span { display: block; font-size: 9px; color: var(--text-mute); margin-top: 2px; }
.week-grid td.has-lesson em { display: block; font-size: 8.5px; color: var(--text-mute); font-style: normal; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }
.week-grid td.has-lesson, .week-grid td.empty-cell {
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.week-grid td.has-lesson:hover { transform: translateY(-2px); filter: brightness(1.02); }
.week-grid td.empty-cell { color: var(--line); font-size: 15px; font-weight: 300; }
.week-grid td.empty-cell:hover { border-color: var(--amber); background: rgba(232,163,61,.08); color: var(--amber-dark); transform: translateY(-1px); }

/* ------------------ الفاصل الفاخر بين الصباح والمساء ------------------ */
.week-grid th.grid-divider, .week-grid td.grid-divider {
  width: 26px; min-width: 26px; padding: 0; border: none; background: transparent;
}
.week-grid td.grid-divider {
  background: linear-gradient(180deg, #E8A33D 0%, #8E5CE0 50%, #1F3B57 100%);
  border-radius: 8px; box-shadow: 0 2px 8px rgba(142,92,224,.35);
  position: relative; overflow: hidden;
}
.week-grid td.grid-divider::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.12) 0 4px, transparent 4px 9px);
}
.week-grid th.grid-divider {
  font-size: 12px; text-align: center; vertical-align: middle;
  background: linear-gradient(180deg, #E8A33D, #8E5CE0);
  border-radius: 10px; color: #fff; box-shadow: 0 3px 10px rgba(142,92,224,.35);
}
.week-grid th.grid-divider span { display: block; font-size: 8px; opacity: .6; margin: 2px 0; }

/* ------------------ لوحة اختيار الأوقات الرسمية — ستايل تقني/مستقبلي ------------------ */
.time-slot-panel {
  background: linear-gradient(160deg, #101B2C 0%, #1F3B57 100%);
  border-radius: 16px; padding: 14px; margin-bottom: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.time-slot-period { margin-bottom: 10px; }
.time-slot-period:last-child { margin-bottom: 0; }
.time-slot-period-label {
  display: block; font-size: 11px; font-weight: 700; color: rgba(255,255,255,.55);
  margin-bottom: 6px; letter-spacing: .3px;
}
.time-slot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.time-slot-grid-5 { grid-template-columns: repeat(5, 1fr); }
.time-slot-grid-3 { grid-template-columns: repeat(3, 1fr); }
.time-slot-hint { font-size: 10.5px; color: rgba(255,255,255,.5); margin: 10px 0 0; text-align: center; }

/* ------------------ صف تبديل الحضور/الغياب (لوحة الإدارة الذكية) ------------------ */
.attend-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.attend-toggle-row:last-child { border-bottom: none; }
.attend-subject {
  font-weight: 800; font-size: 14px; border-right: 4px solid var(--chip, var(--violet)); padding-right: 12px;
}
.attend-toggle-btn {
  padding: 9px 20px; border-radius: 100px; border: none; font-weight: 800; font-size: 12.5px;
  cursor: pointer; transition: all .15s ease; min-width: 96px; font-family: var(--font-display);
}
.attend-toggle-btn.is-present { background: rgba(47,168,118,.14); color: var(--green); }
.attend-toggle-btn.is-present:active { transform: scale(.94); }
.attend-toggle-btn.is-absent {
  background: linear-gradient(135deg, #F17A70, var(--red)); color: #fff;
  box-shadow: 0 4px 12px rgba(228,87,76,.35);
}
.attend-toggle-btn.is-absent:active { transform: scale(.94); }

/* ------------------ بطاقة مادة لتسجيل الغياب — اختيار مزدوج واضح (admin_note.php) ------------------ */
.attend-hint {
  font-size: 12.5px; font-weight: 700; color: var(--amber-dark); margin: 0 0 14px;
  background: rgba(232,163,61,.1); padding: 8px 12px; border-radius: 10px; display: inline-block;
}
.attend-subject-card {
  border: 1.5px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; background: var(--paper-card);
}
.attend-subject-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 6px; }
.attend-choice-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.attend-choice-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 14px 8px; border-radius: 13px; border: 2px solid var(--line);
  background: var(--paper); font-family: var(--font-display); font-weight: 800; font-size: 13.5px;
  color: var(--text-mute); cursor: pointer; transition: all .15s ease;
}
.attend-choice-icon { font-size: 18px; filter: grayscale(1) opacity(.5); transition: filter .15s ease; }
.attend-choice-btn.present.active {
  background: linear-gradient(135deg, rgba(47,168,118,.16), rgba(47,168,118,.06));
  border-color: var(--green); color: var(--green); box-shadow: 0 4px 12px rgba(47,168,118,.2);
}
.attend-choice-btn.absent.active {
  background: linear-gradient(135deg, rgba(228,87,76,.16), rgba(228,87,76,.06));
  border-color: var(--red); color: var(--red); box-shadow: 0 4px 12px rgba(228,87,76,.2);
}
.attend-choice-btn.active .attend-choice-icon { filter: none; }
.attend-choice-btn:active { transform: scale(.96); }
.attend-time-badge {
  display: inline-block; font-size: 10.5px; color: var(--text-mute);
  background: var(--paper); border-radius: 100px; padding: 3px 9px; margin-right: 8px;
  font-family: var(--font-display); font-weight: 700;
}

/* ------------------ سجل الغياب الكامل — خط زمني احترافي ------------------ */
.log-filter-bar {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-bottom: 14px;
}
.log-filter-bar::-webkit-scrollbar { display: none; }
.log-filter-chip {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 100px; border: 1.5px solid var(--line);
  background: var(--paper-card); font-size: 11.5px; font-weight: 700; color: var(--text-mute);
  cursor: pointer; white-space: nowrap; transition: all .15s ease;
}
.log-filter-chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.log-month-header {
  display: flex; align-items: center; gap: 10px; margin: 18px 0 10px;
}
.log-month-header:first-of-type { margin-top: 0; }
.log-month-header span { flex: 1; height: 1px; background: var(--line); }
.log-month-header b {
  font-family: var(--font-display); font-size: 12px; font-weight: 800; color: var(--text-mute);
  white-space: nowrap; padding: 0 4px;
}

.log-card {
  display: flex; gap: 12px; background: var(--paper-card); border-radius: var(--radius-md);
  box-shadow: var(--shadow); margin-bottom: 10px; overflow: hidden;
  border-right: 5px solid var(--chip, var(--violet));
}
.log-card-date {
  flex-shrink: 0; width: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--chip, var(--violet)) 12%, var(--paper));
  padding: 10px 4px;
}
.log-card-date b { font-family: var(--font-display); font-size: 19px; font-weight: 800; color: var(--ink); line-height: 1; }
.log-card-date span { font-size: 10px; color: var(--text-mute); margin-top: 2px; }
.log-card-body { flex: 1; min-width: 0; padding: 12px 14px 12px 4px; }
.log-card-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.log-card-top b { font-size: 14.5px; }
.log-card-teacher { font-size: 12px; color: var(--text-mute); margin-top: 4px; }
.log-card-day { font-size: 10px; font-weight: 800; color: var(--amber-dark); background: rgba(232,163,61,.12); display: inline-block; padding: 2px 9px; border-radius: 100px; margin-bottom: 5px; }
.log-card-notes { font-size: 12px; color: var(--text-mute); margin-top: 4px; background: var(--paper); border-radius: 8px; padding: 6px 10px; }

/* ------------------ بطاقة مركز الساعات الإضافية ------------------ */
.extra-school-card {
  border: 1.5px solid var(--line); border-radius: var(--radius-md);
  padding: 14px 16px; margin-bottom: 10px; background: var(--paper-card);
}
.extra-school-top { display: flex; align-items: center; gap: 12px; }
.extra-school-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: linear-gradient(135deg, rgba(232,163,61,.2), rgba(142,92,224,.2));
}
.extra-school-top b { display: block; font-size: 15px; }
.extra-school-top span { font-size: 12px; color: var(--text-mute); }
.extra-school-links {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line);
}
.extra-school-links a {
  text-align: center; font-size: 11px; font-weight: 700; color: var(--text-mute);
  background: var(--paper); border-radius: 10px; padding: 10px 4px; transition: all .15s ease;
}
.extra-school-links a:hover { background: rgba(232,163,61,.12); color: var(--amber-dark); }

/* ------------------ إشعارات — بطاقات ملوّنة قابلة للضغط ------------------ */
.notif-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper-card); border-radius: var(--radius-md);
  box-shadow: var(--shadow); margin-bottom: 10px; padding: 13px 14px;
  transition: transform .15s ease, box-shadow .15s ease;
  position: relative; overflow: hidden;
}
.notif-card:hover { transform: translateX(-2px); box-shadow: var(--shadow-hover); }
.notif-card.is-new { box-shadow: 0 0 0 2px rgba(232,163,61,.35), var(--shadow); }
.notif-card.is-new::before {
  content: ''; position: absolute; inset: 0 0 0 auto; width: 4px;
  background: linear-gradient(180deg, var(--amber), var(--amber-dark));
}
.notif-card-icon {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  box-shadow: 0 6px 14px rgba(0,0,0,.15);
}
.notif-card-body { flex: 1; min-width: 0; }
.notif-card-top { display: flex; align-items: center; gap: 6px; }
.notif-card-top b { font-size: 13.5px; color: var(--text); }
.notif-card-body p { font-size: 12.5px; color: var(--text-mute); margin: 3px 0 4px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-card-body time { font-size: 10.5px; color: var(--text-mute); opacity: .7; }
.notif-new-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); flex-shrink: 0; box-shadow: 0 0 0 3px rgba(232,163,61,.2); }
.notif-card-arrow { font-size: 20px; color: var(--line); flex-shrink: 0; }

/* ==========================================================
   بطاقة الأستاذ — تصميم مستقبلي مخصص (parent/teachers.php)
   ========================================================== */
.teach-card {
  background: var(--paper-card); border-radius: 20px;
  box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden;
  border: 1px solid var(--line);
}
.teach-card-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 14px; }
.teach-avatar {
  width: 52px; height: 52px; border-radius: 16px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 20px; color: #fff;
  background: linear-gradient(135deg, var(--violet), #6B3FC9);
  box-shadow: 0 6px 16px rgba(142,92,224,.35);
}
.teach-info { flex: 1; min-width: 0; }
.teach-info > b { display: block; font-size: 16px; margin-bottom: 7px; font-family: var(--font-display); font-weight: 800; letter-spacing: .2px; color: var(--ink); }
.teach-subjects { display: flex; flex-wrap: wrap; gap: 7px; }
.teach-subj-pill {
  font-family: var(--font-display); font-size: 11.5px; font-weight: 700; padding: 5px 13px; border-radius: 100px;
  background: color-mix(in srgb, var(--c, var(--violet)) 14%, var(--paper));
  color: color-mix(in srgb, var(--c, var(--violet)) 78%, black);
  border: 1px solid color-mix(in srgb, var(--c, var(--violet)) 32%, transparent);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--c, var(--violet)) 18%, transparent);
  letter-spacing: .1px;
}
.teach-contacts { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.teach-circle-btn {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--paper); color: var(--text-mute); font-size: 15px; box-shadow: var(--shadow); transition: transform .15s ease;
}
.teach-circle-btn.wa { background: rgba(37,211,102,.14); color: #25D366; }
.teach-circle-btn:active { transform: scale(.9); }
.teach-circle-btn.danger { background: rgba(228,87,76,.14); color: var(--red); }

/* ------------------ شبكة تنقّل مركز الدعم — أزرار كبيرة واضحة ------------------ */
.extra-school-nav {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  padding: 0 16px 16px;
}
.extra-school-nav-btn {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 14px; border-radius: 15px; background: var(--paper);
  border: 1px solid var(--line);
  font-family: var(--font-display); font-size: 13.5px; font-weight: 800; color: var(--text);
  text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.extra-school-nav-btn:active { transform: scale(.96); background: var(--paper-card); box-shadow: var(--shadow); }
.extra-school-nav-icon {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
}
@media (min-width: 480px) {
  .extra-school-nav { grid-template-columns: repeat(4, 1fr); }
  .extra-school-nav-btn { flex-direction: column; text-align: center; gap: 8px; padding: 16px 8px; }
}

.teach-eval-strip {
  display: flex; align-items: center; gap: 10px; margin: 0 16px 10px;
  padding: 10px 14px; border-radius: 14px; background: var(--dot-bg, var(--paper));
  text-decoration: none; transition: transform .15s ease;
}
.teach-eval-strip:active { transform: scale(.98); }
.teach-eval-dot { font-size: 15px; }
.teach-eval-label { flex: 1; font-weight: 800; font-size: 13px; color: var(--dot-color, var(--text)); }
.teach-eval-arrow { font-size: 11.5px; font-weight: 700; color: var(--dot-color, var(--text-mute)); opacity: .85; white-space: nowrap; }

.teach-code-strip {
  display: flex; align-items: center; gap: 10px; margin: 0 16px 14px;
  padding: 10px 14px; border-radius: 14px;
  background: linear-gradient(135deg, #16243A, #1F3B57);
}
.teach-code-label { font-size: 10.5px; font-weight: 700; color: rgba(255,255,255,.55); white-space: nowrap; }
.teach-code-value { flex: 1; font-family: var(--font-display); font-weight: 800; font-size: 14px; letter-spacing: 3px; color: #fff; text-align: center; }
.teach-code-copy { background: rgba(255,255,255,.12); border: none; border-radius: 8px; width: 28px; height: 28px; font-size: 13px; cursor: pointer; flex-shrink: 0; }

.teach-actions {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.teach-actions form { display: contents; }
.teach-action-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 12px 3px; background: none; border: none; border-left: 1px solid var(--line);
  font-size: 10px; font-weight: 700; color: var(--text-mute); cursor: pointer;
  width: 100%; transition: background .15s ease; text-decoration: none; line-height: 1.35; text-align: center;
}
.teach-action-btn:last-child { border-left: none; }
.teach-action-btn span { font-size: 17px; display: flex; align-items: center; justify-content: center; }
.teach-action-btn:active { background: var(--paper); }
.teach-action-btn.danger { color: var(--red); }
.teach-action-btn.wa-action { color: #1B9E4E; font-weight: 800; }
.teach-action-btn.wa-action span { color: #25D366; }

/* ------------------ تخصيصات بطاقة الإدارة (نفس قالب الأستاذ) ------------------ */
.admin-avatar { background: linear-gradient(135deg, #3AA1C9, #1F6E93); box-shadow: 0 6px 16px rgba(58,161,201,.35); }
.teach-row-avatar.admin-avatar { background: linear-gradient(135deg, #3AA1C9, #1F6E93); box-shadow: 0 4px 10px rgba(58,161,201,.3); }
.admin-position { font-size: 11.5px; color: var(--text-mute); font-weight: 600; margin: -3px 0 7px; }
.admin-child-pill { --c: var(--ink) !important; }
.admin-child-pill.warn { --c: var(--amber-dark) !important; }

/* ==========================================================
   بطاقة الابن — تصميم مستقبلي مخصص (parent/children.php)
   ========================================================== */
.kid-card {
  background: var(--paper-card); border-radius: 20px;
  box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden;
  border: 1px solid var(--line); transition: box-shadow .2s ease;
}
.kid-card.is-active { box-shadow: 0 0 0 2px var(--amber), var(--shadow-hover); }
.kid-card-head { display: flex; align-items: center; gap: 14px; padding: 18px 16px 16px; }
.kid-avatar {
  width: 58px; height: 58px; border-radius: 18px; flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 22px; color: #fff;
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  box-shadow: 0 6px 16px rgba(232,163,61,.35);
}
.kid-avatar img { width: 100%; height: 100%; object-fit: cover; }
.kid-info { flex: 1; min-width: 0; }
.kid-info > b { display: block; font-size: 16.5px; margin-bottom: 7px; font-family: var(--font-display); font-weight: 800; color: var(--ink); }
.kid-class-pill {
  display: inline-block; font-family: var(--font-display); font-size: 11.5px; font-weight: 700;
  padding: 5px 13px; border-radius: 100px; background: rgba(31,59,87,.08); color: var(--ink);
  border: 1px solid rgba(31,59,87,.14);
}

.kid-status-strip {
  display: flex; align-items: center; gap: 10px; margin: 0 16px 14px;
  padding: 10px 14px; border-radius: 14px; text-decoration: none; transition: transform .15s ease;
}
.kid-status-strip:active { transform: scale(.98); }
.kid-status-strip.active { background: rgba(47,168,118,.12); }
.kid-status-strip.active .kid-status-dot { color: var(--green); }
.kid-status-strip.active .kid-status-label { color: var(--green); }
.kid-status-strip.inactive { background: rgba(232,163,61,.1); }
.kid-status-strip.inactive .kid-status-dot { color: var(--amber-dark); }
.kid-status-strip.inactive .kid-status-label { color: var(--amber-dark); }
.kid-status-dot { font-size: 14px; }
.kid-status-label { flex: 1; font-weight: 800; font-size: 12.5px; }
.kid-status-arrow { font-size: 12px; font-weight: 700; color: var(--amber-dark); opacity: .8; }

.kid-actions { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.kid-actions form { display: contents; }
.kid-action-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 13px 4px; background: none; border: none; border-left: 1px solid var(--line);
  font-size: 11px; font-weight: 700; color: var(--text-mute); cursor: pointer; width: 100%;
  transition: background .15s ease;
}
.kid-action-btn:last-child { border-left: none; }
.kid-action-btn span { font-size: 18px; }
.kid-action-btn:active { background: var(--paper); }
.kid-action-btn.danger { color: var(--red); }

/* ==========================================================
   مفتاح تبديل العرض (يومي/أسبوعي) — مقسّم أنيق خفيف
   ========================================================== */
.view-toggle {
  display: flex; background: var(--paper); border-radius: 14px; padding: 4px; gap: 4px;
  margin-bottom: 14px; box-shadow: inset 0 1px 3px rgba(0,0,0,.04);
}
.view-toggle-item {
  flex: 1; text-align: center; padding: 10px 6px; border-radius: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 12.5px; color: var(--text-mute);
  transition: all .2s ease; white-space: nowrap;
}
.view-toggle-item.active {
  background: var(--paper-card); color: var(--ink);
  box-shadow: 0 3px 10px rgba(31,59,87,.14);
}

/* ==========================================================
   أيام الأسبوع — حبيبات فردية قابلة للتمرير بدل شريط داكن واحد
   ========================================================== */
.day-pills {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 2px 2px 6px; margin-bottom: 12px;
}
.day-pills::-webkit-scrollbar { display: none; }
.day-pill {
  flex: 0 0 auto; padding: 10px 18px; border-radius: 100px;
  background: var(--paper-card); border: 1.5px solid var(--line);
  font-family: var(--font-display); font-weight: 700; font-size: 12.5px; color: var(--text-mute);
  transition: all .2s ease; white-space: nowrap;
}
.day-pill.active {
  background: linear-gradient(135deg, var(--ink), var(--ink-2)); color: #fff; border-color: transparent;
  box-shadow: 0 5px 14px rgba(31,59,87,.32);
}
.time-slot-btn {
  font-family: 'Tajawal', var(--font-display), monospace;
  font-weight: 800; font-size: 12.5px; letter-spacing: .5px;
  color: rgba(255,255,255,.75);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px; padding: 9px 4px; cursor: pointer;
  transition: all .15s ease;
}
.time-slot-btn:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); }
.time-slot-btn.active {
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  color: #1B2430; border-color: transparent;
  box-shadow: 0 0 0 3px rgba(232,163,61,.25), 0 6px 16px rgba(232,163,61,.35);
  transform: translateY(-1px);
}
.slot-start.active { background: linear-gradient(135deg, #34C98A, var(--green)); box-shadow: 0 0 0 3px rgba(47,168,118,.25), 0 6px 16px rgba(47,168,118,.35); }
.slot-end.active { background: linear-gradient(135deg, #F17A70, var(--red)); box-shadow: 0 0 0 3px rgba(228,87,76,.25), 0 6px 16px rgba(228,87,76,.35); }

.level-choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.level-choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.level-choice label {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 6px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--paper-card); cursor: pointer; transition: all .15s ease;
  font-size: 12.5px; font-weight: 800; color: var(--text-mute); text-align: center;
}
.level-choice .emoji { font-size: 22px; }
.level-choice input:nth-of-type(1):checked + label { border-color: var(--red); background: rgba(228,87,76,.1); color: var(--red); }
.level-choice input:nth-of-type(2):checked + label { border-color: var(--amber-dark); background: rgba(232,163,61,.14); color: var(--amber-dark); }
.level-choice input:nth-of-type(3):checked + label { border-color: var(--green); background: rgba(47,168,118,.1); color: var(--green); }

/* عرض القراءة فقط لولي الأمر */
.eval-view-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.eval-view-row:last-child { border-bottom: none; }
.eval-dots { display: flex; gap: 4px; }
.eval-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.eval-dots span.on-1 { background: var(--red); }
.eval-dots span.on-2 { background: var(--amber); }
.eval-dots span.on-3 { background: var(--green); }

.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--paper-card); color: var(--text-mute);
  cursor: pointer; font-size: 14px; transition: all .15s ease; padding: 0;
}
.icon-btn:hover { background: var(--paper); color: var(--ink); transform: translateY(-1px); }
.icon-btn.danger:hover { background: rgba(228,87,76,.1); color: var(--red); border-color: var(--red); }
.icon-btn.primary:hover { background: rgba(232,163,61,.12); color: var(--amber-dark); border-color: var(--amber); }
.icon-btn.text { width: auto; padding: 0 14px; font-size: 12.5px; font-weight: 700; gap: 6px; }

/* ==========================================================
   نافذة منبثقة (Modal) — مضغوطة ومحسّنة للهاتف
   ========================================================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,22,32,.55); backdrop-filter: blur(2px);
  display: none; align-items: flex-end; justify-content: center; z-index: 200; padding: 0;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: var(--paper-card); width: 100%; max-width: 480px;
  max-height: 92vh; overflow-y: auto; border-radius: 26px 26px 0 0;
  padding: 0 20px calc(18px + env(safe-area-inset-bottom));
  animation: slideUp .28s ease both; position: relative;
}
@media (min-width: 560px) {
  .modal-overlay { align-items: center; }
  .modal-card { border-radius: 26px; max-height: 88vh; }
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--paper-card); padding: 16px 0 12px;
  margin-bottom: 4px; border-bottom: 1px solid var(--line);
}
.modal-header h3 { margin: 0; font-size: 17px; }
.modal-close {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--paper); border: none; font-size: 15px; color: var(--text-mute); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* حقول مضغوطة داخل النوافذ المنبثقة تحديداً */
.modal-card .field { margin-bottom: 10px; }
.modal-card .field label { font-size: 11.5px; margin-bottom: 4px; }
.modal-card .field input, .modal-card .field select, .modal-card .field textarea { padding: 9px 12px; font-size: 14px; }

/* ------------------ منتقي الصورة ------------------ */
.photo-picker-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.photo-picker {
  width: 66px; height: 66px; border-radius: 20px; flex-shrink: 0; cursor: pointer;
  border: 2px dashed var(--line); background: var(--paper);
  display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--text-mute);
  position: relative; overflow: hidden; transition: border-color .15s ease;
}
.photo-picker:hover { border-color: var(--amber); }
.photo-picker.has-photo { border: none; }
.photo-picker .cam-badge {
  position: absolute; bottom: -2px; left: -2px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--amber); display: flex; align-items: center; justify-content: center;
  font-size: 11px; box-shadow: 0 2px 6px rgba(0,0,0,.25); border: 2px solid var(--paper-card);
}
.photo-picker-hint { font-size: 11.5px; color: var(--text-mute); }

/* ------------------ قسم مضغوط بدون أرقام ------------------ */
.section-heading {
  font-size: 12.5px; font-weight: 800; color: var(--text-mute);
  letter-spacing: .3px;
  margin: 14px 0 8px; padding-right: 9px; border-right: 3px solid var(--amber);
}
.section-heading:first-child { margin-top: 0; }

/* ------------------ شبكة اختيار المواد (chips قابلة للتحديد) — عمودان دائماً حتى على الهاتف ------------------ */
.subject-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.subject-check {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 9px; border-radius: 9px;
  border: 1.5px solid var(--line); border-right: 3px solid var(--chip, var(--line));
  background: var(--paper-card); cursor: pointer; font-size: 12px; line-height: 1.3;
  transition: all .15s ease;
}
.subject-check span { overflow-wrap: anywhere; }
.subject-check input { accent-color: var(--amber); width: 15px; height: 15px; flex-shrink: 0; }
.subject-check:has(input:checked) { background: rgba(232,163,61,.08); border-color: var(--amber); }

/* ------------------ رأس زخرفي للنوافذ المنبثقة (بدون صورة) ------------------ */
.modal-header-icon {
  width: 60px; height: 60px; border-radius: 20px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
  background: linear-gradient(135deg, rgba(232,163,61,.2), rgba(142,92,224,.2));
}
.modal-title.centered { text-align: center; padding-left: 0; }

/* ------------------ صف "إضافة عنصر سريع" (نص + زر) بدون كسر على الهاتف ------------------ */
.inline-add-row { display: flex; gap: 8px; align-items: stretch; }
.inline-add-row input { flex: 1 1 auto; min-width: 0; width: auto; }
.inline-add-row button { flex: 0 0 auto; white-space: nowrap; }

/* ------------------ حقول بأيقونة داخلية (واتساب/هاتف) ------------------ */
.field-icon { position: relative; }
.field-icon input { padding-left: 40px; }
.field-icon .fi-emoji { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 16px; pointer-events: none; }

/* ------------------ تبويبات تبديل الأبناء داخل الصفحة ------------------ */
.child-tabs {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px;
  scrollbar-width: none;
}
.child-tabs::-webkit-scrollbar { display: none; }
.child-tab {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 8px; border-radius: 100px;
  background: var(--paper-card); border: 1.5px solid var(--line);
  font-size: 13px; font-weight: 700; color: var(--text-mute);
  transition: all .15s ease; white-space: nowrap;
}
.child-tab:hover { border-color: var(--amber); }
.child-tab.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.child-tab-avatar {
  width: 26px; height: 26px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--violet), #6f43c0);
  color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 11px;
}
.child-tab-avatar img { width: 100%; height: 100%; object-fit: cover; }
.child-tab.active .child-tab-avatar { background: linear-gradient(135deg, var(--amber), var(--amber-dark)); }

/* شبكة بطاقات */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.stat-card { display: flex; align-items: center; gap: 14px; transition: transform .18s ease, box-shadow .18s ease; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.stat-card .num { font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--ink); }
.stat-card .lbl { font-size: 12.5px; color: var(--text-mute); }
.stat-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(232,163,61,.22), rgba(232,163,61,.08));
  color: var(--amber-dark); flex-shrink: 0; font-size: 20px;
}

/* قائمة إشعارات */
.notif-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: none; }
.notif-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--amber); }
.notif-item.read .notif-dot { background: var(--line); }
.notif-item b { font-size: 14px; }
.notif-item p { margin: 2px 0 0; font-size: 13px; color: var(--text-mute); }
.notif-item time { font-size: 11px; color: var(--text-mute); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--text-mute); font-weight: 700; font-size: 12.5px; }

.toggle-theme {
  width: 34px; height: 34px; border-radius: 50%;
  border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: transform .15s ease;
}
.toggle-theme:active { transform: scale(.88); }

.code-box {
  font-family: var(--font-display);
  letter-spacing: 6px;
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
  background: var(--paper);
  border: 2px dashed var(--amber);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
}

.flash {
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 14px; font-weight: 600;
}
.flash-error { background: rgba(228,87,76,.12); color: var(--red); }
.flash-ok { background: rgba(47,168,118,.12); color: var(--green); }

/* ------------------ استجابة الشاشات ------------------ */
@media (max-width: 880px) {
  .sidebar { display: none; }
  .main { padding: 18px 16px 90px; }
  .topbar {
    margin: -18px -16px 20px; padding: 10px 12px;
    flex-wrap: nowrap; gap: 8px;
  }
  .topbar-title { gap: 8px; }
  .topbar-logo { width: 30px; height: 30px; border-radius: 9px; box-shadow: 0 3px 8px rgba(31,59,87,.28); }
  .topbar h1 { font-size: 15px; }
  .topbar .sub { display: none; }
  .topbar-right { gap: 6px; }

  .kid-switcher { padding: 3px 8px 3px 3px; gap: 5px; }
  .kid-switcher-avatar { width: 22px; height: 22px; font-size: 9.5px; }
  .kid-switcher-name { max-width: 52px; font-size: 10.5px; }
  .kid-switcher svg { width: 11px; height: 11px; }

  .topbar-actions { padding: 3px; gap: 2px; }
  .avatar { width: 28px; height: 28px; font-size: 11px; border-width: 1.5px; }
  .toggle-theme { width: 26px; height: 26px; }
  .toggle-theme svg { width: 15px; height: 15px; }
  .notif-badge { width: 13px; height: 13px; min-width: 13px; font-size: 8px; top: -2px; left: -2px; }

  .bottom-nav { display: flex; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 360px) {
  .topbar { padding: 8px 10px; gap: 6px; }
  .topbar-logo { width: 26px; height: 26px; border-radius: 8px; }
  .topbar h1 { font-size: 13.5px; }
  .kid-switcher-name { display: none; }
  .kid-switcher { padding: 3px 6px 3px 3px; }
}
@media (max-width: 520px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .auth-card { padding: 26px 20px; }
  .code-box { font-size: 22px; letter-spacing: 4px; }
}

/* ============================================================
   أيام العطل — parent/holidays.php
   ============================================================ */
.next-holiday-card {
  text-align: center; padding: 22px 20px; margin-bottom: 16px;
  background: linear-gradient(160deg, #101B2C 0%, #1F3B57 100%);
  border-radius: 20px; color: #fff;
}
.next-holiday-badge {
  display: inline-block; font-family: var(--font-display); font-weight: 800; font-size: 11.5px;
  background: linear-gradient(135deg, var(--amber), var(--amber-dark)); color: #1B2430;
  padding: 5px 14px; border-radius: 100px; margin-bottom: 10px;
}
.next-holiday-card b { display: block; font-size: 18px; font-family: var(--font-display); font-weight: 800; }
.next-holiday-card span { display: block; font-size: 12.5px; color: rgba(255,255,255,.65); margin-top: 4px; }
.next-holiday-card small { display: block; font-size: 10.5px; color: rgba(232,163,61,.9); margin-top: 8px; }

.holiday-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper-card); border-radius: 16px; box-shadow: var(--shadow);
  padding: 12px 14px; margin-bottom: 10px; position: relative;
}
.holiday-card.is-past { opacity: .5; }
.holiday-card.is-today { box-shadow: 0 0 0 2px var(--amber), var(--shadow); }
.holiday-date-box {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.holiday-date-box.civil { background: linear-gradient(135deg, rgba(58,161,201,.18), rgba(58,161,201,.08)); }
.holiday-date-box.religious { background: linear-gradient(135deg, rgba(142,92,224,.18), rgba(142,92,224,.08)); }
.holiday-date-box b { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--ink); line-height: 1; }
.holiday-date-box span { font-size: 9px; font-weight: 700; color: var(--text-mute); margin-top: 2px; }
.holiday-body { flex: 1; min-width: 0; }
.holiday-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.holiday-top b { font-size: 13.5px; font-family: var(--font-display); font-weight: 800; }
.holiday-type-chip { font-size: 9.5px; font-weight: 700; padding: 2px 8px; border-radius: 100px; flex-shrink: 0; }
.holiday-type-chip.civil { background: rgba(58,161,201,.14); color: #3AA1C9; }
.holiday-type-chip.religious { background: rgba(142,92,224,.14); color: var(--violet); }
.holiday-day-name { display: block; font-size: 11px; color: var(--text-mute); margin-top: 3px; }
.holiday-note { display: block; font-size: 10.5px; color: var(--green); margin-top: 3px; font-weight: 700; }
.holiday-today-flag {
  position: absolute; top: -8px; left: 10px; background: var(--amber); color: #1B2430;
  font-size: 9.5px; font-weight: 800; padding: 3px 10px; border-radius: 100px;
  box-shadow: 0 4px 10px rgba(232,163,61,.4);
}

/* شارة تحذيرية داخل صفحات الجدول/الغياب عندما يكون اليوم المحدد عطلة */
.holiday-alert-banner {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(232,163,61,.16), rgba(232,163,61,.06));
  border: 1.5px dashed var(--amber); margin-bottom: 14px;
}
.holiday-alert-banner .emoji { font-size: 22px; flex-shrink: 0; }
.holiday-alert-banner b { display: block; font-size: 13px; color: var(--amber-dark); }
.holiday-alert-banner span { font-size: 11px; color: var(--text-mute); }

.holiday-mini-strip {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  background: linear-gradient(135deg, rgba(232,163,61,.14), rgba(232,163,61,.05));
  border: 1.5px dashed var(--amber); border-radius: 14px; padding: 10px 14px; margin-bottom: 16px;
  width: 100%; text-align: right; cursor: pointer; font-family: inherit;
}
.holiday-mini-strip .emoji { font-size: 19px; flex-shrink: 0; }
.holiday-mini-strip .txt { flex: 1; font-size: 12.5px; color: var(--text); }
.holiday-mini-strip .txt b { color: var(--amber-dark); font-weight: 800; }
.holiday-mini-strip .arrow { font-size: 18px; color: var(--amber-dark); flex-shrink: 0; }

/* ============================================================
   التقويم الشهري — parent/holidays.php (بستايل Google Calendar محسّن)
   ============================================================ */
.cal-card {
  background: var(--paper-card); border-radius: 20px; box-shadow: var(--shadow);
  padding: 16px 14px; margin-bottom: 18px;
}
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-nav-btn {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--paper); font-size: 18px; font-weight: 800; color: var(--ink); text-decoration: none;
  transition: background .15s ease;
}
.cal-nav-btn:active { background: rgba(232,163,61,.18); }
.cal-title { font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--ink); }

.cal-weekhead { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 6px; }
.cal-weekhead span { text-align: center; font-size: 10.5px; font-weight: 700; color: var(--text-mute); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; touch-action: pan-y; transition: transform .1s ease, opacity .1s ease; }
.cal-cell {
  min-height: 62px; height: auto; border-radius: 8px; display: flex; flex-direction: column; align-items: center;
  gap: 2px; position: relative; background: var(--paper); padding: 4px 2px 6px;
}
.cal-cell.is-empty { background: none; }
.cal-daynum { font-size: 11.5px; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 1px; flex-shrink: 0; }
.cal-pill {
  width: 100%; font-size: 7.4px; font-weight: 700; line-height: 1.25;
  padding: 2px 3px; border-radius: 5px; text-align: center;
  white-space: normal; word-break: break-word; overflow-wrap: break-word;
}
.cal-pill.civil { background: rgba(58,161,201,.85); color: #fff; }
.cal-pill.religious { background: var(--violet); color: #fff; }
.cal-more { font-size: 7px; font-weight: 700; color: var(--text-mute); flex-shrink: 0; }
.cal-cell.is-today .cal-daynum {
  color: #1B2430; background: var(--amber); width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 2px; flex-shrink: 0;
}

.cal-legend { display: flex; justify-content: center; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.cal-legend span { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--text-mute); font-weight: 600; }
.cal-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.cal-legend i.civil { background: #3AA1C9; }
.cal-legend i.religious { background: var(--violet); }
.cal-legend i.today { background: var(--amber); border-radius: 50%; }

@media (min-width: 400px) {
  .cal-cell { min-height: 70px; }
  .cal-pill { font-size: 8px; padding: 2px 5px; }
}

/* ============================================================
   زر أيام العطل — عنصر ثابت داخل القائمة السفلية
   ============================================================ */
.bottom-nav-holiday-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 8.3px; color: var(--text-mute); font-weight: 700;
  padding: 3px 1px; flex: 1 1 0; min-width: 0; background: none; border: none; cursor: pointer; font-family: inherit;
}
.bn-holiday-icon {
  font-size: 16px; line-height: 1; display: inline-block;
  animation: bnHolidayPulse 2.6s ease-in-out infinite;
}
@keyframes bnHolidayPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
@media (max-width: 380px) {
  .bottom-nav-holiday-btn { font-size: 7.6px; }
  .bn-holiday-icon { font-size: 15px; }
}

/* ============================================================
   تقويم مصغّر داخل النافذة المنبثقة العامة
   ============================================================ */
.mini-cal { background: var(--paper); border-radius: 14px; padding: 10px 6px; touch-action: pan-y; }
.mini-cal-nav { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 8px; }
.mini-cal-nav b { font-family: var(--font-display); font-weight: 800; font-size: 13px; color: var(--ink); }
.mini-cal-nav-btn {
  width: 26px; height: 26px; border-radius: 50%; border: none; background: var(--paper-card);
  font-size: 15px; font-weight: 800; color: var(--ink); display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow);
}
.mini-cal-nav-btn:active { transform: scale(.9); }
.mini-cal-hint { text-align: center; font-size: 10px; color: var(--text-mute); margin: 8px 0 0; }
.mini-cal .cal-weekhead span { font-size: 9px; }
.cal-grid.mini { gap: 2px; transition: transform .1s ease; }
.cal-grid.mini .cal-cell {
  min-height: 36px; height: auto; border-radius: 7px; padding: 3px 1px; gap: 1px;
}
.cal-grid.mini .cal-daynum { font-size: 10px; }
.cal-grid.mini .cal-cell.is-today .cal-daynum { width: 17px; height: 17px; font-size: 9.5px; }
.cal-cell.mini-has-holiday { background: var(--paper-card); box-shadow: var(--shadow); }
.cal-pill.mini { font-size: 6.6px; padding: 1px 2px; line-height: 1.15; }
.cal-more { display: block; }

0
/* ============================================================
   فضاء التلميذ — بطاقة ترحيب ملوّنة + شبكة وصول سريع (Tiles)
   ============================================================ */
@keyframes heroBlobFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  50%      { transform: translate(-10px, 12px) scale(1.08); }
}
.student-hero {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 22px 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #5D5FEF 0%, #8E5CE0 45%, #E4574C 100%);
  box-shadow: var(--shadow-hover);
  color: #fff;
}
.student-hero-blob {
  position: absolute; border-radius: 50%; filter: blur(2px); opacity: .35;
  animation: heroBlobFloat 7s ease-in-out infinite;
  pointer-events: none;
}
.student-hero-blob.b1 { width: 140px; height: 140px; background: #FFD166; top: -50px; left: -30px; }
.student-hero-blob.b2 { width: 110px; height: 110px; background: #3AA1C9; bottom: -40px; right: -20px; animation-delay: 1.4s; }
.student-hero-content { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; }
.student-hero-avatar {
  width: 54px; height: 54px; border-radius: 18px; flex-shrink: 0;
  background: rgba(255,255,255,.22); backdrop-filter: blur(6px);
  border: 2px solid rgba(255,255,255,.35);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 22px; color: #fff;
}
.student-hero-hi { font-family: var(--font-display); font-weight: 800; font-size: 19px; }
.student-hero-sub { font-size: 12.5px; color: rgba(255,255,255,.8); margin-top: 2px; }
.student-hero-chip {
  position: relative; z-index: 1; margin-top: 14px; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.16); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.22); border-radius: 100px;
  padding: 7px 14px; font-size: 12.5px; font-weight: 700;
}

.tile-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 16px 6px; border-radius: 18px; text-align: center;
  color: #fff; box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.tile:active { transform: scale(.94); }
.tile-icon { font-size: 24px; }
.tile-label { font-size: 11px; font-weight: 800; font-family: var(--font-display); }
.tile-badge {
  position: absolute; top: 6px; left: 6px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 100px; background: #fff; color: var(--ink);
  font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.tile-blue   { background: linear-gradient(150deg, #3AA1C9, #2C7FA3); }
.tile-amber  { background: linear-gradient(150deg, #E8A33D, #C6821E); }
.tile-violet { background: linear-gradient(150deg, #8E5CE0, #6f43c0); }
.tile-green  { background: linear-gradient(150deg, #2FA876, #1f7d58); }
@media (max-width: 420px) {
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
  .tile { padding: 18px 6px; }
}

/* ------------------ تنبيه الغياب المتتالي ------------------ */
.streak-alert {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-radius: var(--radius-md); margin-bottom: 16px;
  font-size: 13.5px; font-weight: 700;
}
.streak-emoji { font-size: 20px; flex-shrink: 0; }
.streak-alert.streak-good   { background: rgba(47,168,118,.12); color: var(--green); }
.streak-alert.streak-info   { background: rgba(58,161,201,.12); color: #2C7FA3; }
.streak-alert.streak-warn   { background: rgba(232,163,61,.16); color: var(--amber-dark); }
.streak-alert.streak-danger { background: rgba(228,87,76,.14); color: var(--red); animation: streakPulse 1.6s ease-in-out infinite; }
@keyframes streakPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(228,87,76,.25); }
  50%      { box-shadow: 0 0 0 8px rgba(228,87,76,0); }
}

/* ============================================================
   دفتر الأنشطة (bloc note) — student/activities.php
   ============================================================ */
.filter-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; padding-bottom: 2px; }
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto; padding: 8px 16px; border-radius: 100px; font-size: 12.5px; font-weight: 700;
  background: var(--paper-card); border: 1.5px solid var(--line); color: var(--text-mute);
  box-shadow: var(--shadow); white-space: nowrap; transition: all .15s ease;
}
.filter-chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.activity-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--paper-card); border-radius: var(--radius-md);
  border: 1.5px solid var(--line); border-right: 6px solid var(--chip, var(--violet));
  padding: 14px 14px; margin-bottom: 10px;
  transition: opacity .15s ease, transform .15s ease;
}
.activity-card.is-done { opacity: .6; }
.activity-card.is-done .activity-body b { text-decoration: line-through; }
.activity-status-form { flex-shrink: 0; }
.activity-check {
  width: 34px; height: 34px; border-radius: 10px; border: none;
  background: var(--paper); font-size: 17px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.activity-check:active { transform: scale(.9); }
.activity-body { flex: 1; min-width: 0; }
.activity-body b { display: block; font-size: 14.5px; }
.activity-meta { font-size: 12px; color: var(--text-mute); }
.activity-desc { margin: 6px 0 0; font-size: 13px; color: var(--text-mute); }
.activity-footer { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.activity-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.activity-icon-btn {
  width: 30px; height: 30px; border-radius: 9px; border: none; background: var(--paper);
  font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.activity-icon-btn.danger { color: var(--red); }
.activity-icon-btn:active { transform: scale(.9); }

/* زر عائم لإضافة عنصر جديد (تجربة أشبه بتطبيق هاتف) */
.fab {
  position: fixed; bottom: calc(78px + env(safe-area-inset-bottom)); left: 18px; z-index: 45;
  width: 54px; height: 54px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(232,163,61,.45);
  transition: transform .15s ease;
}
.fab svg { width: 24px; height: 24px; }
.fab:active { transform: scale(.9); }
@media (min-width: 881px) { .fab { bottom: 24px; } }

/* موعد فرض داخل خلية التقويم الشهري */
.cal-pill.hw { background: var(--pill-c, var(--amber)); color: #fff; }

/* ============================================================
   شريط نشاط الابن — parent/children.php
   ============================================================ */
.kid-activity-strip {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: var(--paper); border: none; border-top: 1px solid var(--line);
  padding: 10px 16px; cursor: pointer; text-align: right;
}
.kid-activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-mute); flex-shrink: 0; }
.kid-activity-strip.online .kid-activity-dot { background: var(--green); box-shadow: 0 0 0 3px rgba(47,168,118,.18); animation: streakPulse 1.6s ease-in-out infinite; }
.kid-activity-text { flex: 1; font-size: 12px; font-weight: 700; color: var(--text-mute); }
.kid-activity-strip.online .kid-activity-text { color: var(--green); }
.kid-activity-arrow { font-size: 11px; font-weight: 700; color: var(--amber-dark); opacity: .8; }

/* ============================================================
   نافذة احتفالية عند إضافة/إنجاز نشاط — student/activities.php
   ============================================================ */
@keyframes celebrateBounce {
  0%   { transform: scale(.4) rotate(-8deg); opacity: 0; }
  55%  { transform: scale(1.15) rotate(4deg); opacity: 1; }
  75%  { transform: scale(.95) rotate(-2deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes celebratePop {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.celebrate-overlay { z-index: 260; }
.celebrate-card {
  text-align: center; padding-top: 8px;
  background: linear-gradient(160deg, #FFFFFF 0%, #FFF7E8 100%);
}
[data-theme="dark"] .celebrate-card { background: linear-gradient(160deg, #16202D 0%, #1F2A1A 100%); }
.celebrate-emoji {
  font-size: 64px; margin: 18px 0 6px; display: inline-block;
  animation: celebrateBounce .6s ease, celebratePop 1.8s ease-in-out .6s infinite;
}
.celebrate-title { font-size: 21px; margin-bottom: 8px; }
.celebrate-text { font-size: 14.5px; color: var(--text-mute); line-height: 1.8; margin-bottom: 20px; padding: 0 6px; }

/* ============================================================
   بطاقات إحصاء سريعة احترافية (Quick Stats) — parent/dashboard.php
   ============================================================ */
.qs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qs-card {
  position: relative; text-align: right; overflow: hidden;
  background: var(--paper-card); border: 1.5px solid var(--line); border-radius: var(--radius-md);
  padding: 14px 12px; box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.qs-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--qs-accent, var(--amber));
}
.qs-card:active { transform: scale(.96); box-shadow: var(--shadow); }
.qs-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.qs-icon {
  width: 38px; height: 38px; border-radius: 12px; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--qs-icon-bg, rgba(232,163,61,.16));
}
.qs-arrow { font-size: 15px; font-weight: 800; color: var(--text-mute); opacity: .55; }
.qs-num { font-family: var(--font-display); font-size: 24px; font-weight: 800; color: var(--ink); line-height: 1; }
.qs-lbl { font-size: 11.5px; font-weight: 700; color: var(--text-mute); margin-top: 4px; }
.qs-sub {
  font-size: 10.5px; color: var(--text-mute); opacity: .8; margin-top: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-top: 1px dashed var(--line); padding-top: 6px;
}
.qs-pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 3px rgba(228,87,76,.18); animation: streakPulse 1.6s ease-in-out infinite;
  margin-inline-end: auto;
}
.qs-blue   { --qs-accent: #3AA1C9; --qs-icon-bg: rgba(58,161,201,.16); }
.qs-red    { --qs-accent: var(--red); --qs-icon-bg: rgba(228,87,76,.14); }
.qs-violet { --qs-accent: var(--violet); --qs-icon-bg: rgba(142,92,224,.14); }

@media (max-width: 460px) {
  .qs-grid { grid-template-columns: 1fr; gap: 8px; }
  .qs-card { display: flex; align-items: center; gap: 12px; text-align: right; padding: 12px 14px; }
  .qs-card::before { inset: 0 auto 0 0; width: 4px; height: auto; }
  .qs-top { flex-direction: column; align-items: center; gap: 6px; margin-bottom: 0; order: 0; }
  .qs-arrow { display: none; }
  .qs-num { order: 1; }
  .qs-lbl { order: 2; }
  .qs-sub { order: 3; border-top: none; padding-top: 0; margin-top: 2px; }
}

/* ============================================================
   رؤوس بطاقات قابلة للضغط داخل الرئيسية — parent/dashboard.php
   ============================================================ */
.dash-card-head {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: transparent; border: none; border-bottom: 1px solid var(--line);
  padding: 16px 18px; cursor: pointer; text-align: right;
}
.dash-card-head-icon {
  width: 38px; height: 38px; border-radius: 12px; font-size: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--dc-bg, rgba(232,163,61,.16));
}
.dash-card-head-text { flex: 1; min-width: 0; }
.dash-card-head-text h3 { margin: 0; font-size: 14.5px; }
.dash-card-head-text span { font-size: 11px; color: var(--text-mute); }
.dash-card-head-arrow { font-size: 15px; font-weight: 800; color: var(--text-mute); opacity: .5; flex-shrink: 0; }
.dash-card-head:active { background: var(--paper); }
.notebook .dash-card-head { border-radius: var(--radius-md) var(--radius-md) 0 0; }

/* ------------------ بانر تنبيه غياب أستاذ ------------------ */
.dash-alert-banner {
  border-radius: var(--radius-md); margin-bottom: 20px; overflow: hidden;
  background: linear-gradient(135deg, rgba(228,87,76,.10), rgba(228,87,76,.03));
  border: 1.5px solid rgba(228,87,76,.3);
}
.dash-alert-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 10px; }
.dash-alert-icon {
  width: 40px; height: 40px; border-radius: 12px; font-size: 19px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(228,87,76,.16); color: var(--red);
}
.dash-alert-head b { display: block; font-size: 14px; color: var(--red); }
.dash-alert-head span { font-size: 11.5px; color: var(--text-mute); }
.dash-alert-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 16px; scrollbar-width: none; }
.dash-alert-chips::-webkit-scrollbar { display: none; }
.dash-alert-chip {
  flex: 0 0 auto; background: var(--paper-card); border: 1px solid rgba(228,87,76,.25); border-radius: 12px;
  padding: 8px 12px; min-width: 110px;
}
.dash-alert-chip b { display: block; font-size: 12.5px; }
.dash-alert-chip span { font-size: 10.5px; color: var(--text-mute); }

/* ============================================================
   صف أستاذ مضغوط (بستايل قائمة تطبيق) — parent/teachers.php
   ============================================================ */
.teach-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: none; border: none; border-top: 1px solid var(--line);
  padding: 12px 16px; cursor: pointer; text-align: right;
}
.teach-row:active { background: var(--paper); }
.teach-row-avatar {
  width: 42px; height: 42px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 16px; color: #fff;
  background: linear-gradient(135deg, var(--violet), #6B3FC9);
  box-shadow: 0 4px 10px rgba(142,92,224,.3);
}
.teach-row-info { flex: 1; min-width: 0; }
.teach-row-info b { display: block; font-size: 14px; font-family: var(--font-display); font-weight: 800; color: var(--ink); }
.teach-row-info span { display: block; font-size: 11.5px; color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.teach-row-eval { font-size: 13px; flex-shrink: 0; }
.teach-row-arrow { font-size: 15px; font-weight: 800; color: var(--text-mute); opacity: .5; flex-shrink: 0; }

.teach-search-input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 100px;
  padding: 10px 16px; font-size: 13px; background: var(--paper); color: var(--text);
  font-family: inherit;
}
.teach-search-input:focus { outline: none; border-color: var(--amber); background: var(--paper-card); }

/* ============================================================
   رأس قائمة الأساتذة + بحث بالمادة — parent/teachers.php
   ============================================================ */
.teach-list-header {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 13px; padding: 20px 16px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  color: #fff;
}
.teach-list-header::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 90% -20%, rgba(255,255,255,.35), transparent 55%);
  pointer-events: none;
}
.teach-list-header::after {
  content: ''; position: absolute; width: 90px; height: 90px; border-radius: 50%;
  background: rgba(255,255,255,.08); bottom: -40px; left: -20px; pointer-events: none;
}
.teach-list-header--amber  { background: linear-gradient(135deg, #F0B24E, #C6821E); }
.teach-list-header--violet { background: linear-gradient(135deg, #9D6FEA, #6B3FC9); }
.teach-list-header--blue   { background: linear-gradient(135deg, #4FB3D9, #1F6E93); }
.teach-list-header--green  { background: linear-gradient(135deg, #4FC98F, #1F8D5F); }
.teach-list-header-icon {
  position: relative; z-index: 1;
  width: 48px; height: 48px; border-radius: 15px; font-size: 22px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.22); backdrop-filter: blur(6px);
  border: 1.5px solid rgba(255,255,255,.32);
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.teach-list-header-text { position: relative; z-index: 1; flex: 1; min-width: 0; }
.teach-list-header-text h3 { margin: 0; font-size: 16px; color: #fff; font-family: var(--font-display); font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.1); }
.teach-list-header-text span { font-size: 11.5px; color: rgba(255,255,255,.85); font-weight: 600; }
.teach-add-fab {
  position: relative; z-index: 1;
  width: 44px; height: 44px; border-radius: 15px; border: none; flex-shrink: 0; cursor: pointer;
  background: #fff; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(0,0,0,.18); transition: transform .15s ease;
}
.teach-list-header--standalone { border-radius: var(--radius-md); margin-bottom: 14px; box-shadow: var(--shadow); }
.teach-list-header.is-button { border: none; width: 100%; text-align: right; font: inherit; cursor: pointer; padding: 20px 16px; margin: 0; }
.teach-list-header .dash-card-head-arrow { position: relative; z-index: 1; color: rgba(255,255,255,.85); font-size: 16px; flex-shrink: 0; }
.teach-add-fab svg { width: 21px; height: 21px; color: var(--ink); }
.teach-add-fab:active { transform: scale(.9); }

.teach-search-wrap { position: relative; }
.teach-search-icon {
  position: absolute; top: 50%; right: 14px; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-mute); pointer-events: none;
}
.teach-search-input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 100px;
  padding: 10px 40px 10px 34px; font-size: 13px; background: var(--paper); color: var(--text);
  font-family: inherit;
}
.teach-search-input:focus { outline: none; border-color: var(--amber); background: var(--paper-card); }
.teach-search-clear {
  position: absolute; top: 50%; left: 10px; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%; border: none; background: var(--line);
  color: var(--text-mute); font-size: 11px; cursor: pointer; align-items: center; justify-content: center;
  display: flex;
}

.teach-subject-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; animation: chipsIn .2s ease; }
@keyframes chipsIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.teach-subject-chip {
  font-family: var(--font-display); font-size: 11.5px; font-weight: 700; padding: 6px 14px; border-radius: 100px;
  background: var(--paper-card); color: var(--c, var(--violet));
  border: 1.5px solid var(--c, var(--violet)); cursor: pointer;
}
.teach-subject-chip.active { background: var(--c, var(--violet)); color: #fff; }

.teach-row-sessions {
  display: block; font-size: 10.5px; color: var(--violet); font-weight: 700;
  margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ============================================================
   صف ابن مضغوط (بستايل قائمة تطبيق) — parent/children.php
   ============================================================ */
.kid-row.is-active { background: rgba(232,163,61,.06); }
.kid-row-avatar {
  position: relative; width: 42px; height: 42px; border-radius: 14px; flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 16px; color: #fff;
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  box-shadow: 0 4px 10px rgba(232,163,61,.3);
}
.kid-row-avatar img { width: 100%; height: 100%; object-fit: cover; }
.kid-row-online-dot {
  position: absolute; bottom: -1px; left: -1px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--green); border: 2px solid var(--paper-card);
  box-shadow: 0 0 0 2px rgba(47,168,118,.18);
}

/* ============================================================
   إحصاء مصغّر داخل النوافذ المنبثقة — لا ينهار لعمود واحد أبداً
   (يُستعمل بدل .grid.grid-3 داخل المودالات الضيقة)
   ============================================================ */
.kid-mini-stats { display: flex; gap: 8px; }
.kid-mini-stat {
  flex: 1; min-width: 0; text-align: center; padding: 12px 6px;
  background: var(--paper); border-radius: 14px; border: 1px solid var(--line);
}
.kid-mini-stat.is-tappable { cursor: pointer; transition: transform .12s ease, background .12s ease; }
.kid-mini-stat.is-tappable:active { transform: scale(.94); background: var(--paper-card); }
.kid-mini-stat-icon {
  width: 30px; height: 30px; border-radius: 10px; font-size: 14px; margin: 0 auto 6px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(232,163,61,.16);
}
.kid-mini-stat-num { font-family: var(--font-display); font-size: 17px; font-weight: 800; color: var(--ink); line-height: 1; }
.kid-mini-stat-lbl { font-size: 9.5px; font-weight: 700; color: var(--text-mute); margin-top: 4px; line-height: 1.3; }

/* ============================================================
   عمود الوقت داخل صف الحصة المضغوط — parent/schedule.php (عرض يومي)
   ============================================================ */
.sched-row-time {
  flex-shrink: 0; text-align: center; min-width: 52px;
  font-family: var(--font-display);
}
.sched-row-time b { display: block; font-size: 14px; color: var(--ink); }
.sched-row-time span { font-size: 10px; color: var(--text-mute); }

/* ============================================================
   صف إحصائيات لا ينهار أبداً (بديل .grid.grid-3 لمحتوى الصفحات)
   ============================================================ */
.stat-mini-row { display: flex; gap: 10px; }
.stat-mini-item { flex: 1; min-width: 0; }
.stat-mini-item .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 400px) {
  .stat-mini-row { gap: 6px; }
  .stat-mini-item { padding: 10px !important; }
  .stat-mini-item .stat-icon { width: 30px; height: 30px; font-size: 14px; }
  .stat-mini-item .num { font-size: 16px !important; }
  .stat-mini-item .lbl { font-size: 10px; }
}
