/* Aljeel Base - Reset, Variables, Utility Classes */
.aljeel-clearfix::after { content: ''; display: table; clear: both; }
.aljeel-text-center { text-align: center; }
.aljeel-text-right { text-align: right; }
.aljeel-text-left { text-align: left; }
.aljeel-flex { display: flex; }
.aljeel-flex-center { display: flex; align-items: center; }
.aljeel-flex-between { display: flex; align-items: center; justify-content: space-between; }
.aljeel-flex-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.aljeel-gap-4 { gap: 4px; }
.aljeel-gap-6 { gap: 6px; }
.aljeel-gap-8 { gap: 8px; }
.aljeel-gap-10 { gap: 10px; }
.aljeel-gap-12 { gap: 12px; }
.aljeel-gap-16 { gap: 16px; }
.aljeel-gap-20 { gap: 20px; }
.aljeel-gap-24 { gap: 24px; }
.aljeel-mt-4 { margin-top: 4px; }
.aljeel-mt-8 { margin-top: 8px; }
.aljeel-mt-12 { margin-top: 12px; }
.aljeel-mt-16 { margin-top: 16px; }
.aljeel-mt-20 { margin-top: 20px; }
.aljeel-mt-24 { margin-top: 24px; }
.aljeel-mb-4 { margin-bottom: 4px; }
.aljeel-mb-8 { margin-bottom: 8px; }
.aljeel-mb-12 { margin-bottom: 12px; }
.aljeel-mb-16 { margin-bottom: 16px; }
.aljeel-mb-20 { margin-bottom: 20px; }
.aljeel-mb-24 { margin-bottom: 24px; }
.aljeel-p-4 { padding: 4px; }
.aljeel-p-8 { padding: 8px; }
.aljeel-p-12 { padding: 12px; }
.aljeel-p-16 { padding: 16px; }
.aljeel-p-20 { padding: 20px; }
.aljeel-p-24 { padding: 24px; }
.aljeel-rounded-6 { border-radius: 6px; }
.aljeel-rounded-8 { border-radius: 8px; }
.aljeel-rounded-10 { border-radius: 10px; }
.aljeel-rounded-12 { border-radius: 12px; }
.aljeel-rounded-16 { border-radius: 16px; }
.aljeel-rounded-20 { border-radius: 20px; }
.aljeel-rounded-full { border-radius: 50%; }
.aljeel-hidden { display: none; }
.aljeel-block { display: block; }
.aljeel-w-full { width: 100%; }
.aljeel-flex-1 { flex: 1; }
.aljeel-flex-shrink-0 { flex-shrink: 0; }
.aljeel-text-sm { font-size: 13px; }
.aljeel-text-xs { font-size: 12px; }
.aljeel-text-lg { font-size: 16px; }
.aljeel-text-xl { font-size: 20px; }
.aljeel-font-bold { font-weight: 700; }
.aljeel-font-medium { font-weight: 500; }
.aljeel-font-semibold { font-weight: 600; }
.aljeel-color-muted { color: #94a3b8; }
.aljeel-color-primary { color: #2563eb; }
.aljeel-color-danger { color: #ef4444; }
.aljeel-color-success { color: #22c55e; }
.aljeel-text-muted { color: #94a3b8; font-size: 11px; }
.aljeel-inline-form { display: inline; }
.aljeel-mt-6 { margin-top: 6px; }
.aljeel-mt-10 { margin-top: 10px; }
.aljeel-mt-28 { margin-top: 28px; }

/* ============================================================
   Design System — Spacing & Typography Tokens
   Shared by all dashboards (admin / supervisor / teacher / parent / student)
   ============================================================ */
:root {
    --aljeel-space-xs: 4px;
    --aljeel-space-sm: 8px;
    --aljeel-space-md: 12px;
    --aljeel-space-lg: 16px;
    --aljeel-space-xl: 24px;
    --aljeel-space-2xl: 34px;   /* between sections */
    --aljeel-space-3xl: 48px;
    --aljeel-heading-color: #1a202c;
    --aljeel-subtitle-color: #64748b;
    --aljeel-link-color: #2563eb;
    --aljeel-link-hover: #1d4ed8;
}

/* Unified headings (RTL/LTR safe via text-align:start and vertical margins) */
.aljeel-h1, .aljeel-h2, .aljeel-h3, .aljeel-user-name {
    color: var(--aljeel-heading-color);
    font-weight: 700;
    line-height: 1.4;
    text-align: start;
    margin: 0 0 var(--aljeel-space-md);
}
.aljeel-h1 { font-size: 26px; }
.aljeel-h2, .aljeel-user-name { font-size: 22px; }
.aljeel-h3 { font-size: 18px; margin-top: var(--aljeel-space-lg); }

/* Section title (canonical) — keeps consistent gap above every section */
.aljeel-section-title {
    font-size: 22px; font-weight: 700; color: var(--aljeel-heading-color);
    line-height: 1.4; text-align: start;
    margin: var(--aljeel-space-2xl) 0 10px;
}
.aljeel-subtitle {
    font-size: 15px; color: var(--aljeel-subtitle-color);
    margin: 0 0 var(--aljeel-space-xl);
}

/* Consistent spacing between stacked sections */
.aljeel-section + .aljeel-section { margin-top: var(--aljeel-space-2xl); }

/* Unified links (use classes instead of bare <a>) */
.aljeel-link {
    color: var(--aljeel-link-color); text-decoration: none; font-weight: 600;
    transition: color .2s;
}
.aljeel-link:hover { color: var(--aljeel-link-hover); }
.aljeel-link-muted { color: var(--aljeel-subtitle-color); }
.aljeel-link-muted:hover { color: #475569; }
.aljeel-link-back {
    display: inline-flex; align-items: center; gap: 6px;
    margin: 12px 0 20px; color: #475569; font-weight: 600; font-size: 14px;
    text-decoration: none; transition: color .2s;
}
.aljeel-link-back:hover { color: var(--aljeel-link-hover); }

body.dsh-dark .aljeel-h1,
body.dsh-dark .aljeel-h2,
body.dsh-dark .aljeel-h3,
body.dsh-dark .aljeel-user-name,
body.dsh-dark .aljeel-section-title { color: #e2e8f0; }
body.dsh-dark .aljeel-subtitle { color: #a0aec0; }
body.dsh-dark .aljeel-link { color: #63b3ed; }
body.dsh-dark .aljeel-link:hover { color: #90cdf4; }
body.dsh-dark .aljeel-link-back { color: #a0aec0; }
body.dsh-dark .aljeel-link-back:hover { color: #e2e8f0; }
.aljeel-plain-link { color: inherit; text-decoration: none; }
.aljeel-plain-link:hover { text-decoration: none; }
body.dsh-dark .aljeel-plain-link { color: inherit; }
.aljeel-mb-6 { margin-bottom: 6px; }
.aljeel-mb-10 { margin-bottom: 10px; }
.aljeel-mb-28 { margin-bottom: 28px; }
.aljeel-color-warning { color: #f59e0b; }
.aljeel-list-none { list-style: none; }
/* Aljeel Components - Cards, Buttons, Badges, Tables, Forms */

/* Card */
.aljeel-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.aljeel-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px;
    color: #1a202c;
}

/* Buttons */
.aljeel-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all .2s;
    border: none;
    cursor: pointer;
    line-height: 1.4;
}
.aljeel-btn-primary { background: #0073aa; color: #fff; }
.aljeel-btn-primary:hover { background: #005a87; color: #fff; }
.aljeel-btn-success { background: #38a169; color: #fff; }
.aljeel-btn-success:hover { background: #2f855a; color: #fff; }
.aljeel-btn-danger { background: #e53e3e; color: #fff; }
.aljeel-btn-danger:hover { background: #c53030; color: #fff; }
.aljeel-btn-outline { background: transparent; color: #4a5568; border: 1px solid #e2e8f0; }
.aljeel-btn-outline:hover { background: #f7fafc; border-color: #cbd5e0; }
.aljeel-btn-sm { padding: 5px 14px; font-size: 13px; border-radius: 6px; }
.aljeel-btn-link { background: none; color: #2563eb; padding: 4px 8px; }
.aljeel-btn-link:hover { background: #eff6ff; }
.aljeel-btn-icon { padding: 8px; font-size: 18px; line-height: 1; min-width: 36px; justify-content: center; }

/* Badges */
.aljeel-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.aljeel-badge-success { background: #c6f6d5; color: #22543d; }
.aljeel-badge-warning { background: #fefcbf; color: #744210; }
.aljeel-badge-danger { background: #fed7d7; color: #822727; }
.aljeel-badge-info { background: #bee3f8; color: #2a4365; }
.aljeel-badge-primary { background: #eff6ff; color: #3b82f6; }

/* Table */
.aljeel-table-wrap { overflow-x: auto; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.aljeel-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.aljeel-table th { background: #f7fafc; color: #4a5568; font-weight: 600; text-align: right; padding: 12px 15px; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
.aljeel-table td { padding: 12px 15px; border-bottom: 1px solid #e2e8f0; vertical-align: middle; }
.aljeel-table tr:last-child td { border-bottom: none; }
.aljeel-table tr:hover td { background: #f7fafc; }

/* Form Elements */
.aljeel-input,
.aljeel-select,
.aljeel-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    transition: border-color .2s;
    box-sizing: border-box;
}
.aljeel-input:focus,
.aljeel-select:focus,
.aljeel-textarea:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.aljeel-label { display: block; font-size: 12px; font-weight: 600; color: #64748b; margin-bottom: 4px; }
.aljeel-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.aljeel-form-row-full { grid-template-columns: 1fr; }
.aljeel-field { margin-bottom: 18px; }

/* Filter Bar */
.aljeel-filter-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.aljeel-filter-bar select,
.aljeel-filter-bar input { padding: 8px 14px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 14px; background: #fff; }

/* Empty State */
.aljeel-empty { text-align: center; padding: 60px 20px; color: #a0aec0; font-size: 16px; }

/* Messages/Alerts */
.aljeel-msg { padding: 16px 20px; border-radius: 10px; margin-bottom: 20px; font-size: 15px; font-weight: 500; }
.aljeel-msg-success { background: #c6f6d5; color: #22543d; border: 1px solid #9ae6b4; }
.aljeel-msg-error { background: #fed7d7; color: #822727; border: 1px solid #feb2b2; }
.aljeel-msg-info { background: #bee3f8; color: #2a4365; border: 1px solid #90cdf4; }

/* Tabs */
.aljeel-tabs { display: flex; gap: 4px; margin-bottom: 24px; background: #f1f5f9; padding: 4px; border-radius: 12px; }
.aljeel-tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none; color: #64748b; border: none; background: none; cursor: pointer; transition: all .2s; }
.aljeel-tab.active { background: #fff; color: #1e293b; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.aljeel-tab:hover:not(.active) { background: rgba(255,255,255,.5); color: #334155; }

/* Toggle Switch */
.aljeel-toggle-label { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.aljeel-toggle-label input { display: none; }
.aljeel-toggle-switch { position: relative; width: 44px; height: 24px; background: #cbd5e1; border-radius: 12px; transition: .3s; flex-shrink: 0; }
.aljeel-toggle-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: .3s; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.aljeel-toggle-label input:checked + .aljeel-toggle-switch { background: #ef4444; }
.aljeel-toggle-label input:checked + .aljeel-toggle-switch::after { transform: translateX(20px); }
.aljeel-toggle-text { font-size: 13px; font-weight: 500; color: #1e293b; }

/* Count Badge */
.aljeel-count-badge { display: inline-flex; align-items: center; justify-content: center; background: #2563eb; color: #fff; font-size: 14px; font-weight: 600; min-width: 28px; height: 28px; padding: 0 10px; border-radius: 20px; vertical-align: middle; margin-right: 6px; }

/* Back Button */
.aljeel-back-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; background: #edf2f7; color: #4a5568; text-decoration: none; border-radius: 10px; font-size: 15px; font-weight: 500; }
.aljeel-back-btn:hover { background: #e2e8f0; color: #2d3748; }

/* Progress Bars */
.aljeel-progress-bar-wrap, .dsh-progress-bar-wrap { height: 6px; background: #edf2f7; border-radius: 6px; overflow: hidden; }
.aljeel-progress-bar-fill, .dsh-progress-bar-fill { height: 100%; background: linear-gradient(90deg, #667eea, #764ba2); border-radius: 6px; transition: width .6s ease; }

/* Progress Overview Card */
.dsh-progress-overview { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
body.dsh-dark .dsh-progress-overview { background: #2d3748; border-color: #4a5568; }

/* Dashboard Messages */
.dsh-msg { padding: 12px 18px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.dsh-msg-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.dsh-msg-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Dashboard Count Badge */
.dsh-count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 8px; background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; border-radius: 12px; font-size: 12px; font-weight: 700; vertical-align: middle; }

/* Contact Form */
.dsh-contact-form { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; }
.dsh-contact-form textarea { width: 100%; min-height: 100px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-family: inherit; font-size: 14px; resize: vertical; }
.dsh-contact-form textarea:focus { border-color: #2563eb; outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

/* Book Title */
.book-title { font-size: 14px; font-weight: 600; color: #1e293b; }

/* Aljeel Dashboard Styles (frontend) */
.dsh-wrap {
    width: 100%;
    margin: 0;
    padding: 24px 48px;
    box-sizing: border-box;
    position: relative;
}
.dsh-wrap::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    width: 100vw;
    height: 100%;
    transform: translateX(-50%);
    background: #fff;
    z-index: -1;
    pointer-events: none;
}
body.dsh-dark .dsh-wrap::before { background: #1a202c; }
.dsh-wrap * { box-sizing: border-box; }

/* Profile Header */
.dsh-head {
    display: flex; align-items: center; gap: 24px;
    background: linear-gradient(135deg, #1a365d 0%, #2563eb 50%, #7c3aed 100%);
    color: #fff; padding: 32px 36px; border-radius: 20px; margin-bottom: 28px;
    box-shadow: 0 8px 32px rgba(37,99,235,.2); position: relative; overflow: hidden;
}
.dsh-head::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(255,255,255,.06) 0%, transparent 60%);
    pointer-events: none;
}
.dsh-head-actions { display: flex; align-items: center; gap: 8px; margin-right: auto; flex-shrink: 0; }
.dsh-head-actions .dsh-btn-icon, .dsh-head-actions .aljeel-notif-bell { flex-shrink: 0; }
.dsh-avatar { flex-shrink: 0; position: relative; }
.dsh-avatar img { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 4px solid rgba(255,255,255,.25); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.dsh-avatar-p { width: 100px; height: 100px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 700; border: 3px solid rgba(255,255,255,.2); }
.dsh-info { flex: 1; position: relative; }
.dsh-info h2 { margin: 0 0 6px; font-size: 28px; font-weight: 700; color: #fff; letter-spacing: -.3px; }
.dsh-info .dsh-badge { background: rgba(255,255,255,.18) !important; color: #fff !important; margin-left: 6px; font-size: 14px; padding: 6px 16px; backdrop-filter: blur(4px); display: inline-block; border-radius: 20px; font-weight: 500; }
.dsh-info p { margin: 8px 0 0 !important; color: rgba(255,255,255,.75) !important; font-size: 16px; }

/* Parent header variant */
.dsh-parent-head { display: flex; align-items: center; gap: 24px; background: #f7fafc; border: 1px solid #e2e8f0; border-radius: 20px; padding: 24px 28px; margin-bottom: 20px; }
.dsh-parent-head .dsh-info h2 { color: #1a202c; font-size: 24px; }
.dsh-parent-head .dsh-info p { color: #718096 !important; font-size: 15px !important; }
.dsh-parent-head .dsh-info .dsh-badge { font-size: 14px !important; }
.dsh-parent-head .dsh-avatar-p { background: #2563eb; color: #fff; }

/* Stats */
.dsh-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.dsh-stat { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 28px 20px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.dsh-stat-n { display: block; font-size: 36px; font-weight: 800; color: #1a202c; line-height: 1; }
.dsh-stat-l { display: block; font-size: 15px; font-weight: 500; color: #a0aec0; margin-top: 10px; }
.dsh-st { font-size: 22px; font-weight: 700; color: #1a202c; margin: 34px 0 10px; }
.dsh-back {
    display: inline-flex; align-items: center; gap: 4px; margin: 12px 0 20px;
    color: #475569; font-weight: 600; font-size: 14px; text-decoration: none; transition: color .2s;
}
.dsh-back:hover { color: #2563eb; }
.dsh-ss { font-size: 15px; color: #a0aec0; margin: 0 0 20px; }

/* Books Grid */
.dsh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.dsh-book { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.04); transition: transform .2s, box-shadow .2s; }
.dsh-book:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.06); }
.dsh-book-img { width: 100%; height: 200px; object-fit: cover; display: block; }
.dsh-book-body { padding: 20px 20px 22px; }
.dsh-book-body h4 { font-size: 18px; font-weight: 700; margin: 0 0 14px; color: #1a202c; line-height: 1.4; }

/* Child Cards - Enhanced Redesign */
.dsh-child {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 18px; overflow: hidden;
    box-shadow: 0 1px 4px rgba(15,23,42,.06); transition: transform .25s, box-shadow .25s, border-color .25s;
    display: flex; flex-direction: column;
}
.dsh-child:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(15,23,42,.10); border-color: #c7d2fe; }
.dsh-child-card {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 22px 24px;
    text-decoration: none; color: inherit; transition: background .2s;
}
.dsh-child-card:hover { background: #f8fafc; }
.dsh-child-avatar-wrap { flex-shrink: 0; }
.dsh-child-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(15,23,42,.12); }
.dsh-child-avatar-p { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; }
.dsh-child-body { flex: 1; min-width: 0; }
.dsh-child-name { font-size: 18px; font-weight: 700; color: #0f172a; margin: 0 0 10px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.dsh-child-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dsh-child-grade { display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; color: #475569; background: #f1f5f9; padding: 5px 14px; border-radius: 999px; }
body.dsh-dark .dsh-child-grade { color: #a0aec0; background: #1a202c; }
.dsh-child-actions { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid #eef2f7; background: #fbfcfe; }
body.dsh-dark .dsh-child { background: #2d3748; border-color: #4a5568; box-shadow: none; }
body.dsh-dark .dsh-child-card:hover { background: #344155; }
body.dsh-dark .dsh-child-actions { background: #1a202c; border-color: #4a5568; }

.dsh-child-btn { flex: 1; justify-content: center; }

.dsh-child-form { flex: 1; margin: 0; }

.dsh-badge-blue { background: #ebf4ff !important; color: #2a4365 !important; }

.dsh-badge-green { background: #f0fff4 !important; color: #2f855a !important; }

.dsh-badge-amber { background: #fffaf0 !important; color: #744210 !important; }

.dsh-badge-gray { background: #f7fafc !important; color: #4a5568 !important; }
.dsh-badge-red { background: #fff5f5 !important; color: #c53030 !important; }

/* ============ Students Grid (طلابي) — Responsive CSS Grid ============ */
.aljeel-students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 20px;
    align-items: stretch;
}

.aljeel-student-card {
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.aljeel-student-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .10);
    border-color: #c7d2fe;
}

.aljeel-student-card__body {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    min-width: 0;
}
.aljeel-student-card__avatar {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(102, 126, 234, .35);
    user-select: none;
}
.aljeel-student-card__content {
    flex: 1;
    min-width: 0;
}
.aljeel-student-card__name {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}
.aljeel-student-card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
}
.aljeel-student-card__pct {
    font-weight: 700;
    font-size: 13px;
}
.aljeel-student-card__bar {
    margin-top: 8px;
    height: 6px;
    background: #edf2f7;
    border-radius: 999px;
    overflow: hidden;
}
.aljeel-student-card__bar > i {
    display: block;
    height: 100%;
    border-radius: 999px;
    transition: width .3s ease;
}
.aljeel-student-card__action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* Dark mode */
body.dsh-dark .aljeel-student-card { background: #2d3748; border-color: #4a5568; box-shadow: none; }
body.dsh-dark .aljeel-student-card:hover { border-color: #6366f1; }
body.dsh-dark .aljeel-student-card__name { color: #e2e8f0; }
body.dsh-dark .aljeel-student-card__bar { background: #1a202c; }

/* Tablet: tighter gaps, slightly smaller cards */
@media (max-width: 768px) {
    .aljeel-students-grid { gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .aljeel-student-card__body { padding: 14px 16px; gap: 12px; }
    .aljeel-student-card__avatar { width: 48px; height: 48px; font-size: 20px; }
    .aljeel-student-card__name { font-size: 14px; -webkit-line-clamp: 1; }
    .aljeel-student-card__meta { gap: 6px; }
    .dsh-child-grade { font-size: 11px; padding: 3px 10px; }
}

/* Mobile: single full-width column, comfortable touch targets */
@media (max-width: 560px) {
    .aljeel-students-grid { grid-template-columns: 1fr; gap: 14px; }
    .aljeel-student-card__body { padding: 14px; gap: 12px; }
    .aljeel-student-card__avatar { width: 46px; height: 46px; font-size: 19px; }
    .aljeel-student-card__action .dsh-btn-icon { min-width: 40px; }
}

/* Content Grid */
.dsh-content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-bottom: 20px; }
.dsh-content-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit; box-shadow: 0 1px 4px rgba(0,0,0,.04); transition: transform .25s, box-shadow .25s, border-color .2s; display: flex; flex-direction: column; }
.dsh-content-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.08); border-color: #2563eb; }
.dsh-content-img { width: 100%; height: 160px; object-fit: cover; display: block; }
.dsh-content-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.dsh-content-body h4 { font-size: 17px; font-weight: 700; color: #1a202c; margin: 0 0 8px; line-height: 1.4; }
.dsh-content-date { font-size: 13px; color: #a0aec0; margin-bottom: 8px; display: block; }
.dsh-content-body p { font-size: 14px; color: #4a5568; line-height: 1.6; margin: 0 0 12px; flex: 1; }
.dsh-content-link { font-size: 14px; font-weight: 600; color: #2563eb; display: inline-flex; align-items: center; gap: 4px; }
.dsh-content-card:hover .dsh-content-link { color: #1d4ed8; }

/* Navigation */
.dsh-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; background: #fff; padding: 12px 16px; border-radius: 14px; border: 1px solid #e2e8f0; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.dsh-nav-wrap { position: relative; margin-bottom: 24px; }
.dsh-nav-wrap .dsh-nav { margin-bottom: 0; }
.dsh-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; text-decoration: none; color: #4a5568; transition: all .2s; }
.dsh-nav a:hover { background: #f7fafc; color: #1a202c; }
.dsh-nav a.dsh-nav-active { background: #ebf8ff; color: #2563eb; }
.dsh-nav a.dsh-nav-danger { color: #e53e3e; }
.dsh-nav a.dsh-nav-danger:hover { background: #fff5f5; }

/* Form Card */
.dsh-form-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 28px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.dsh-form-card h3 { font-size: 20px; font-weight: 700; color: #1a202c; margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid #edf2f7; }
.dsh-field { margin-bottom: 18px; }
.dsh-field label { display: block; font-size: 14px; font-weight: 600; color: #4a5568; margin-bottom: 6px; }
.dsh-field input, .dsh-field select, .dsh-field textarea { width: 100%; padding: 12px 16px; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 15px; background: #fff; transition: border-color .2s; }
.dsh-field input:focus, .dsh-field select:focus { border-color: #2563eb; outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.dsh-field input[type=file] { padding: 10px; border: 1px dashed #cbd5e0; background: #f7fafc; cursor: pointer; }
.dsh-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dsh-actions { display: flex; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #edf2f7; flex-wrap: wrap; }

/* Dashboard Button overrides */
.dsh-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 24px; border-radius: 10px; font-size: 14px; font-weight: 500; text-decoration: none; border: none; cursor: pointer; transition: all .2s; }
.dsh-btn-primary { background: #0073aa; color: #fff; }
.dsh-btn-primary:hover { background: #005a87; color: #fff; }
.dsh-btn-success { background: #38a169; color: #fff; }
.dsh-btn-success:hover { background: #2f855a; color: #fff; }
.dsh-btn-danger { background: #e53e3e; color: #fff; }
.dsh-btn-danger:hover { background: #c53030; color: #fff; }
.dsh-btn-outline { background: transparent; color: #4a5568; border: 1px solid #e2e8f0; }
.dsh-btn-outline:hover { background: #f7fafc; border-color: #cbd5e0; }
.dsh-btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 8px; }
.dsh-btn-icon { padding: 8px; font-size: 18px; line-height: 1; min-width: 36px; justify-content: center; }

/* Table */
.dsh-table-wrap { overflow-x: auto; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.dsh-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.dsh-table th { background: #f7fafc; color: #4a5568; font-weight: 600; text-align: right; padding: 14px 18px; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
.dsh-table td { padding: 14px 18px; border-bottom: 1px solid #edf2f7; vertical-align: middle; color: #2d3748; }
.dsh-table tr:last-child td { border-bottom: none; }
.dsh-table tr:hover td { background: #fafbfc; }

/* Grades */
.dsh-grades { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.dsh-grade-row { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px 18px; }
.dsh-grade-info { flex: 1; min-width: 0; }
.dsh-grade-subject { display: block; font-weight: 600; font-size: 15px; color: #1a202c; margin-bottom: 2px; }
.dsh-grade-score { display: block; font-size: 13px; color: #a0aec0; }
.dsh-grade-bar-wrap { flex: 2; height: 10px; background: #edf2f7; border-radius: 10px; overflow: hidden; }
.dsh-grade-bar { height: 100%; border-radius: 10px; transition: width .6s ease; }
.dsh-grade-pct { font-size: 15px; font-weight: 700; min-width: 48px; text-align: right; direction: ltr; }

/* Notifications */
.dsh-notifications { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.dsh-notif { display: flex; align-items: flex-start; gap: 12px; background: linear-gradient(135deg, #ebf8ff, #e9d8fd); border: 1px solid #bee3f8; border-radius: 14px; padding: 16px 20px; }
.dsh-notif-icon { font-size: 22px; flex-shrink: 0; line-height: 1; }
.dsh-notif-body { flex: 1; }
.dsh-notif-body strong { display: block; font-size: 15px; font-weight: 700; color: #2b6cb0; margin-bottom: 4px; overflow-wrap: break-word; word-break: break-word; }
.dsh-notif-body p { margin: 0 !important; font-size: 14px; color: #4a5568; line-height: 1.5; overflow-wrap: break-word; word-break: break-word; }

/* Progress Grid */
.dsh-progress-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 28px; }
.dsh-progress-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.dsh-progress-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dsh-progress-name { font-size: 16px; font-weight: 700; color: #1a202c; }
.dsh-progress-avg { font-size: 20px; font-weight: 800; }
.dsh-progress-stats { display: flex; gap: 12px; margin-bottom: 8px; }
.dsh-progress-stat { flex: 1; text-align: center; }
.dsh-progress-n { display: block; font-size: 18px; font-weight: 700; color: #2d3748; }
.dsh-progress-l { display: block; font-size: 12px; color: #a0aec0; margin-top: 2px; }

/* Misc */
.dsh-empty { text-align: center; padding: 60px 20px; color: #a0aec0; font-size: 17px; }
.dsh-empty-state { text-align: center; padding: 40px 20px; color: #a0aec0; font-size: 16px; }
.dsh-tabs { display: flex; gap: 4px; margin-bottom: 24px; background: #f7fafc; padding: 4px; border-radius: 12px; }
.dsh-tab { flex: 1; text-align: center; padding: 10px; border-radius: 8px; font-size: 15px; font-weight: 500; text-decoration: none; color: #4a5568; transition: all .2s; }
.dsh-tab.active { background: #fff; color: #1a202c; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.dsh-tab:hover:not(.active) { background: rgba(0,0,0,.03); }

/* Dark Mode */
body.dsh-dark { background: #1a202c; }
.dsh-dark .dsh-wrap { background: transparent; }
.dsh-dark .dsh-table a { color: #63b3ed; }
.dsh-dark .dsh-table a:hover { color: #90cdf4; }
.dsh-dark .dsh-content-link { color: #63b3ed; }
.dsh-dark .dsh-back { color: #a0aec0; }
.dsh-dark .dsh-back:hover { color: #e2e8f0; }
.dsh-dark .dsh-tab { color: #a0aec0; }
.dsh-dark .dsh-tab.active { color: #e2e8f0; background: #2d3748; }
.dsh-dark .dsh-nav-danger { color: #fc8181 !important; }
.dsh-dark .dsh-nav-danger:hover { color: #feb2b2 !important; }
.dsh-dark .dsh-empty, .dsh-dark .dsh-empty-state, .dsh-dark .dsh-ss, .dsh-dark .dsh-stat-l, .dsh-dark .dsh-content-body p { color: #a0aec0; }
.dsh-dark .dsh-nav, .dsh-dark .dsh-book, .dsh-dark .dsh-child, .dsh-dark .dsh-content-card, .dsh-dark .dsh-progress-card, .dsh-dark .dsh-grade-row, .dsh-dark .dsh-form-card { background: #2d3748; border-color: #4a5568; box-shadow: none; }
.dsh-dark .dsh-book-body h4, .dsh-dark .dsh-child-name, .dsh-dark .dsh-content-body h4, .dsh-dark .dsh-st, .dsh-dark .dsh-progress-name, .dsh-dark .dsh-grade-subject, .dsh-dark .dsh-nav a { color: #e2e8f0; }
.dsh-dark .dsh-ss, .dsh-dark .dsh-content-body p, .dsh-dark .dsh-grade-score, .dsh-dark .dsh-stat-l { color: #a0aec0; }
.dsh-dark .dsh-stat, .dsh-dark .dsh-parent-head { background: #2d3748; border-color: #4a5568; }
.dsh-dark .dsh-stat-n { color: #e2e8f0; }
.dsh-dark .dsh-btn-outline { color: #e2e8f0; border-color: #4a5568; }
.dsh-dark .dsh-btn-outline:hover { background: #4a5568; }
.dsh-dark .dsh-table { background: #2d3748; border-color: #4a5568; }
.dsh-dark .dsh-table th { background: #1a202c; color: #e2e8f0; border-color: #4a5568; }
.dsh-dark .dsh-table td { color: #e2e8f0; border-color: #4a5568; }
.dsh-dark .dsh-table tr:hover td { background: #1a202c; }
.dsh-dark .dsh-child-actions, .dsh-dark .dsh-book-foot { background: #1a202c; border-color: #4a5568; }
.dsh-dark .dsh-back { background: #4a5568; color: #e2e8f0; }
.dsh-dark .dsh-back:hover { background: #718096; }
.dsh-dark .dsh-notif { background: linear-gradient(135deg, #2a4365, #44337a); border-color: #4a5568; }
/* Aljeel Admin Page Styles */
.aljeel-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 24px; margin-top: 24px; }
.aljeel-admin-student-card { background: #fff; border: 1px solid #e8ecf1; border-radius: 16px; overflow: hidden; transition: all .25s ease; }
.aljeel-admin-student-card:hover { box-shadow: 0 8px 30px rgba(0,0,0,.06); transform: translateY(-2px); }
.aljeel-admin-card-header { display: flex; align-items: center; gap: 16px; padding: 20px 24px; cursor: pointer; user-select: none; border-bottom: 2px solid transparent; transition: all .2s ease; }
.aljeel-admin-card-header:hover { background: #fafbfd; }
.aljeel-admin-card-header.open { border-bottom-color: #edf2f7; }
.aljeel-admin-card-avatar { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; flex-shrink: 0; }
.aljeel-admin-card-info { flex: 1; min-width: 0; }
.aljeel-admin-card-info h3 { margin: 0; font-size: 15px; font-weight: 600; color: #1e293b; }
.aljeel-admin-card-info .sub { font-size: 12px; color: #94a3b8; margin-top: 3px; }
.aljeel-admin-card-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; flex-shrink: 0; }
.aljeel-admin-chevron { color: #94a3b8; transition: transform .2s; font-size: 14px; }
.aljeel-admin-chevron.open { transform: rotate(180deg); }
.aljeel-admin-card-body { display: none; padding: 0 24px 24px; }
.aljeel-admin-card-body.open { display: block; }
.aljeel-admin-card-body .section-label { font-size: 12px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .5px; margin: 20px 0 10px; display: flex; align-items: center; gap: 6px; }
.aljeel-admin-card-body .section-label:first-child { margin-top: 12px; }
.aljeel-admin-book-grid { display: grid; gap: 6px; }
.aljeel-admin-book-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: #f8fafc; border: 1px solid #f1f5f9; border-radius: 10px; font-size: 13px; transition: all .15s; }
.aljeel-admin-book-row:hover { background: #f1f5f9; border-color: #e2e8f0; }
.aljeel-admin-book-row .book-id { color: #94a3b8; font-size: 11px; margin-left: 10px; }
.aljeel-admin-book-row .book-name { flex: 1; color: #334155; font-weight: 500; }
.aljeel-admin-add-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid #f1f5f9; }
.aljeel-admin-add-form input[type="text"] { width: 220px; direction: ltr; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; }
.aljeel-grade-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #f8fafc; border: 1px solid #f1f5f9; border-radius: 10px; margin-bottom: 4px; font-size: 13px; }
.aljeel-grade-item:hover { background: #f1f5f9; border-color: #e2e8f0; }
.aljeel-grade-subject { font-weight: 600; color: #334155; flex: 1; }
.aljeel-grade-score { color: #94a3b8; font-size: 12px; font-weight: 500; }
.aljeel-grade-add-form input { font-size: 13px; padding: 7px 10px; border: 1px solid #e2e8f0; border-radius: 8px; }
.aljeel-badge-picker { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.aljeel-badge-picker select { padding: 7px 10px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; min-width: 60px; }
.aljeel-badge-picker input[type="text"] { padding: 7px 10px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; width: 60px; text-align: center; }
.aljeel-badge-preview { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; flex-shrink: 0; }

/* Admin badge overrides (differs from components.css) */
.aljeel-admin-card-meta .aljeel-badge { border-radius: 8px; font-size: 11px; padding: 3px 10px; }
.aljeel-admin-card-meta .aljeel-badge-info { background: #eff6ff; color: #3b82f6; }
.aljeel-admin-card-meta .aljeel-badge-success { background: #f0fdf4; color: #22c55e; }
.aljeel-admin-card-meta .aljeel-badge-danger { background: #fef2f2; color: #ef4444; }
/* Aljeel Classes & Timetable Admin Styles */

/* Form Card */
.aljeel-form-card { background: #fff; border: 1px solid #e8ecf1; border-radius: 16px; padding: 24px; margin-bottom: 20px; }
.aljeel-form-card h3 { margin: 0 0 16px; font-size: 16px; font-weight: 600; color: #1e293b; }
.aljeel-form-field label { display: block; font-size: 12px; font-weight: 600; color: #64748b; margin-bottom: 4px; }
.aljeel-form-field input, .aljeel-form-field select, .aljeel-form-field textarea { width: 100%; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; box-sizing: border-box; }
.aljeel-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }

/* Class Cards Grid */
.aljeel-class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 14px; }
.aljeel-class-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 20px 22px; display: flex; align-items: center; gap: 16px; transition: all .2s; }
.aljeel-class-card:hover { border-color: #cbd5e1; box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.aljeel-class-icon { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, #06b6d4, #3b82f6); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.aljeel-class-info { flex: 1; min-width: 0; }
.aljeel-class-info h4 { margin: 0; font-size: 15px; font-weight: 700; color: #0f172a; }
.aljeel-class-info .sub { font-size: 12px; color: #94a3b8; margin-top: 3px; line-height: 1.5; }
.aljeel-class-actions { display: flex; gap: 6px; flex-shrink: 0; }
.aljeel-add-class-btn { font-size: 14px; padding: 8px 18px; border-radius: 10px; }

/* Timetable Grid */
.aljeel-tt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.aljeel-tt-day { background: #fff; border: 1px solid #e8ecf1; border-radius: 12px; overflow: hidden; }
.aljeel-tt-day-head { padding: 12px 16px; background: linear-gradient(135deg, #f0f9ff, #ede9fe); font-weight: 700; font-size: 14px; color: #1e293b; border-bottom: 1px solid #e8ecf1; }
.aljeel-tt-session { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; }
.aljeel-tt-session:last-child { border-bottom: none; }
.aljeel-tt-session.aljeel-tt-online { border-right: 3px solid #ef4444; }
.aljeel-tt-time { font-size: 12px; font-weight: 600; color: #6366f1; margin-bottom: 4px; }
.aljeel-tt-subject { font-size: 14px; font-weight: 600; color: #1e293b; }
.aljeel-tt-teacher { font-size: 12px; color: #64748b; margin-top: 4px; }
.aljeel-tt-room { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.aljeel-tt-online-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; background: #fef2f2; color: #ef4444; border-radius: 6px; font-size: 11px; font-weight: 600; margin-top: 6px; }
.aljeel-tt-link { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: #3b82f6; color: #fff; border-radius: 6px; font-size: 12px; font-weight: 500; text-decoration: none; margin-top: 6px; }
.aljeel-tt-link:hover { background: #2563eb; }

/* Subject Tags */
.aljeel-subject-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; margin: 4px; }
.aljeel-subject-tag .del { cursor: pointer; color: #ef4444; font-weight: 700; margin-right: 4px; }

/* Utility within classes page */
.aljeel-action-row { display: flex; gap: 8px; margin-top: 16px; }
.aljeel-subject-row { display: flex; gap: 6px; margin-bottom: 4px; }
.aljeel-subject-input { flex: 1; }
.aljeel-hint { font-size: 11px; color: #94a3b8; margin-top: 4px; }

/* Aljeel Loader / Spinner */
.aljeel-loader-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,.92); z-index: 999999;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 16px;
    transition: opacity .4s ease, visibility .4s ease;
}
.aljeel-loader-overlay.aljeel-loader-hidden {
    opacity: 0; visibility: hidden; pointer-events: none;
}
.aljeel-loader-spinner {
    width: 48px; height: 48px;
    border: 4px solid #e2e8f0; border-top-color: #2563eb;
    border-radius: 50%; animation: aljeel-spin .8s linear infinite;
}
.aljeel-loader-text {
    font-size: 14px; font-weight: 500; color: #64748b;
    font-family: 'Tajawal', -apple-system, sans-serif;
}
@keyframes aljeel-spin { to { transform: rotate(360deg); } }

/* Inline button spinner */
.aljeel-btn-spinner {
    display: inline-block; width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
    border-radius: 50%; animation: aljeel-spin .6s linear infinite;
    vertical-align: middle; margin-left: 4px;
}
/* ==================== Offcanvas Menu (Tablet/Mobile) ==================== */
.dsh-hamburger {
    display: none; align-items: center; justify-content: center;
    width: 42px; height: 42px; border: none; border-radius: 10px;
    background: #fff; border: 1px solid #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,.06);
    cursor: pointer; font-size: 22px; color: #1a202c; transition: background .2s;
    flex-shrink: 0;
}
.dsh-hamburger:hover { background: #f7fafc; }
.dsh-offcanvas-overlay {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(15,23,42,.45); backdrop-filter: blur(2px);
    opacity: 0; transition: opacity .3s;
}
.dsh-offcanvas-overlay.dsh-offcanvas-open { display: block; opacity: 1; }
.dsh-offcanvas {
    position: fixed; top: 0; right: 0; z-index: 10000;
    width: 280px; max-width: 85vw; height: 100%;
    background: #fff; box-shadow: -4px 0 24px rgba(0,0,0,.15);
    transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
    overflow-y: auto; display: flex; flex-direction: column;
}
body.rtl .dsh-offcanvas { right: auto; left: 0; transform: translateX(-100%); }
body.rtl .dsh-offcanvas.dsh-offcanvas-open { transform: translateX(0); }
.dsh-offcanvas.dsh-offcanvas-open { transform: translateX(0); }
.dsh-offcanvas-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid #e2e8f0; flex-shrink: 0;
}
.dsh-offcanvas-head h3 { margin: 0; font-size: 17px; font-weight: 700; color: #1a202c; }
.dsh-offcanvas-close {
    background: none; border: none; font-size: 24px; color: #64748b;
    cursor: pointer; padding: 4px; line-height: 1; border-radius: 8px;
}
.dsh-offcanvas-close:hover { background: #f1f5f9; color: #1a202c; }
.dsh-offcanvas-nav { display: flex; flex-direction: column; gap: 2px; padding: 12px; flex: 1; }
.dsh-offcanvas-nav a {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px;
    border-radius: 10px; font-size: 15px; font-weight: 500; text-decoration: none;
    color: #4a5569; transition: background .2s, color .2s;
}
.dsh-offcanvas-nav a:hover { background: #f7fafc; color: #1a202c; }
.dsh-offcanvas-nav a.dsh-nav-active { background: #ebf8ff; color: #2563eb; font-weight: 600; }
.dsh-offcanvas-nav a.dsh-nav-danger { color: #e53e3e; }
.dsh-offcanvas-nav a.dsh-nav-danger:hover { background: #fff5f5; }
body.dsh-dark .dsh-offcanvas { background: #1a202c; box-shadow: -4px 0 24px rgba(0,0,0,.4); }
body.dsh-dark .dsh-offcanvas-head { border-color: #4a5568; }
body.dsh-dark .dsh-offcanvas-head h3 { color: #e2e8f0; }
body.dsh-dark .dsh-offcanvas-close { color: #a0aec0; }
body.dsh-dark .dsh-offcanvas-close:hover { background: #2d3748; color: #e2e8f0; }
body.dsh-dark .dsh-offcanvas-nav a { color: #a0aec0; }
body.dsh-dark .dsh-offcanvas-nav a:hover { background: #2d3748; color: #e2e8f0; }
body.dsh-dark .dsh-offcanvas-nav a.dsh-nav-active { background: #1e3a5f; color: #93c5fd; }
body.dsh-dark .dsh-offcanvas-nav a.dsh-nav-danger { color: #fc8181; }
body.dsh-dark .dsh-offcanvas-nav a.dsh-nav-danger:hover { background: #2d1b2e; }
body.dsh-dark .dsh-hamburger { background: #2d3748; border-color: #4a5568; color: #e2e8f0; }
body.dsh-dark .dsh-hamburger:hover { background: #4a5568; }

/* Aljeel Responsive Styles */

/* Laptop (960px and below) — content fills full width after sidebar hides */
@media (max-width: 960px) {
    .dsh-wrap { padding: 20px 32px; }
    .dsh-head { padding: 24px 28px; }
    .dsh-stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
    .dsh-head-actions { gap: 6px; }
    .dsh-head-actions .dsh-btn-icon { width: 36px; height: 36px; font-size: 16px; }
}

/* Tablet (768px and below) */
@media (max-width: 768px) {
    /* Dashboard */
    .dsh-head { flex-direction: column; text-align: center; padding: 24px 20px; }
    .dsh-head-actions { justify-content: center; margin: 0; }
    .dsh-parent-head { flex-direction: column; text-align: center; }
    .dsh-grid, .dsh-content-grid, .dsh-progress-grid { grid-template-columns: 1fr !important; }
    .dsh-stats { grid-template-columns: repeat(2, 1fr); }
    .dsh-nav { display: none; }
    .dsh-hamburger { display: flex; }

    /* Admin */
    .aljeel-admin-grid { grid-template-columns: 1fr; }

    /* Classes */
    .aljeel-class-grid { grid-template-columns: 1fr; }
    .aljeel-class-card { flex-wrap: wrap; gap: 12px; padding: 14px 16px; }
    .aljeel-class-actions { width: 100%; justify-content: flex-start; }
    .aljeel-tt-grid { grid-template-columns: 1fr; }

    /* Profile */
    .aljeel-profile-header { flex-direction: column; text-align: center; padding: 24px 20px; }
    .aljeel-book-card { flex-direction: column; text-align: center; }
    .aljeel-dashboard-grid { grid-template-columns: 1fr !important; }
    .aljeel-stats-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .aljeel-child-card-inner { flex-direction: column; text-align: center; }

    /* Forms */
    .dsh-row { grid-template-columns: 1fr; }
    .aljeel-form-row { grid-template-columns: 1fr; }

    /* Student card */
    .aljeel-student-card .book-list li { flex-direction: column; gap: 8px; align-items: flex-start; }
    .aljeel-transfer-form { width: 100%; }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .dsh-wrap { padding: 16px 20px; }
    .dsh-head { padding: 20px 16px; gap: 16px; }
    .dsh-head-actions { gap: 4px; }
    .dsh-head-actions .dsh-btn-icon { width: 34px; height: 34px; font-size: 15px; }
    .dsh-info h2 { font-size: 22px; }
    .dsh-avatar img, .dsh-avatar-p { width: 72px; height: 72px; font-size: 28px; }
    .dsh-child-card { padding: 14px 16px; gap: 12px; }
    .dsh-child-avatar-wrap { flex-shrink: 0; }
    .dsh-child-avatar, .dsh-child-avatar-p { width: 48px; height: 48px; font-size: 20px; }
    .dsh-child-name { font-size: 15px; -webkit-line-clamp: 1; margin-bottom: 6px; }
    .dsh-child-meta { gap: 6px; }
    .dsh-child-grade { font-size: 11px; padding: 3px 10px; }
    .dsh-child-actions { padding: 10px 14px; flex-wrap: wrap; gap: 6px; }
    .dsh-child-btn, .dsh-child-form { flex: 1 1 100%; }
    .dsh-content-body { padding: 16px; }
    .dsh-content-img { height: 140px; }
    .dsh-stats { grid-template-columns: 1fr; }
    .dsh-form-card { padding: 16px; }
    .dsh-table-wrap { margin: 0 -12px; border-radius: 0; }
    .aljeel-admin-card-header { padding: 14px 16px; }
    .aljeel-admin-card-body { padding: 0 16px 16px; }
    .aljeel-admin-grid { gap: 16px; }
    .aljeel-class-card { padding: 12px 14px; gap: 10px; }
    .aljeel-class-icon { width: 40px; height: 40px; font-size: 18px; }
    .aljeel-class-info h4 { font-size: 14px; white-space: normal; }
    .aljeel-class-info .sub { font-size: 11px; }
    .aljeel-att-student-grid { grid-template-columns: 1fr 1fr; }
    .aljeel-form-card { padding: 16px; }
    .aljeel-tab { padding: 8px 12px; font-size: 12px; }
    .aljeel-class-actions { flex-wrap: wrap; }
    .aljeel-tt-day-head { padding: 10px 12px; font-size: 13px; }
    .aljeel-tt-session { padding: 10px 12px; }
    .aljeel-stats-row { grid-template-columns: 1fr; }
    .aljeel-profile-info h2 { font-size: 22px; }
    .aljeel-profile-avatar img, .aljeel-avatar-placeholder { width: 72px; height: 72px; font-size: 28px; }
    .aljeel-stat-number { font-size: 26px; }
    .aljeel-card { padding: 14px; }
}

/* ==================== Modal ==================== */
.aljeel-modal { position: fixed; inset: 0; z-index: 99999; display: none; }
.aljeel-modal.aljeel-modal-open { display: block; }
.aljeel-modal-overlay { position: absolute; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(2px); }
.aljeel-modal-box {
    position: relative; z-index: 1; max-width: 640px; width: calc(100% - 32px);
    max-height: 85vh; overflow-y: auto; margin: 6vh auto 0; background: #fff; color: #1a202c;
    border-radius: 16px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.3); direction: rtl;
}
.aljeel-modal-close {
    position: absolute; top: 16px; left: 16px; width: 36px; height: 36px; border: none; border-radius: 10px;
    background: #f1f5f9; color: #475569; font-size: 20px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s, color .2s, transform .2s;
}
.aljeel-modal-close:hover { background: #fee2e2; color: #ef4444; transform: rotate(90deg); }
.aljeel-modal-close:focus { outline: none; }
.aljeel-modal-close:focus-visible { box-shadow: 0 0 0 3px rgba(37,99,235,.4); }
.aljeel-modal-title { margin: 0 0 16px; font-size: 20px; font-weight: 700; padding-left: 36px; }
.aljeel-modal-body { font-size: 15px; line-height: 1.7; }
/* Content (trip participants / trip form) lives in a hidden wrapper and is moved
   into the modal at runtime. Force it visible only while inside the modal. */
.aljeel-modal-body > * { display: block !important; }
.aljeel-modal-body h4 { margin: 16px 0 6px; font-size: 16px; }
.aljeel-modal-body .aljeel-modal-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.aljeel-modal-body .aljeel-modal-row span:first-child { color: #64748b; }
.aljeel-modal-body .aljeel-modal-row span:last-child { font-weight: 600; text-align: left; }
.aljeel-modal-body .dsh-badge { margin: 2px 0; }
body.dsh-dark .aljeel-modal-box { background: #2d3748; color: #e2e8f0; }
body.dsh-dark .aljeel-modal-close { background: #4a5568; color: #e2e8f0; }
body.dsh-dark .aljeel-modal-close:hover { background: #5a2330; color: #fca5a5; }
body.dsh-dark .aljeel-modal-body .aljeel-modal-row { border-color: #4a5568; }
body.dsh-dark .aljeel-modal-body .aljeel-modal-row span:first-child { color: #a0aec0; }

/* ==================== Notification Bell & Drawer ==================== */
.aljeel-notif-bell-wrap{position:relative}
.aljeel-notif-bell{background:rgba(255,255,255,.2);border:none;border-radius:50%;width:40px;height:40px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:#fff;transition:background .2s;position:relative;flex-shrink:0}
.aljeel-notif-bell:hover{background:rgba(255,255,255,.3)}
.aljeel-notif-badge{position:absolute;top:-4px;right:-4px;background:#ef4444;color:#fff;font-size:10px;font-weight:700;min-width:18px;height:18px;padding:0 4px;border-radius:9px;display:flex;align-items:center;justify-content:center;line-height:1;border:2px solid rgba(255,255,255,.3)}
.aljeel-notif-drawer{position:fixed;top:0;left:auto;right:-380px;width:360px;height:100%;background:#fff;z-index:99999;box-shadow:-4px 0 24px rgba(0,0,0,.12);display:flex;flex-direction:column;transition:right .3s ease;max-width:100%}
.aljeel-notif-drawer.open{right:0}
.aljeel-notif-drawer-head{display:flex;align-items:center;justify-content:space-between;padding:18px 20px;border-bottom:1px solid #e2e8f0;flex-shrink:0}
.aljeel-notif-drawer-head h3{margin:0;font-size:16px;font-weight:700;color:#1e293b}
.aljeel-notif-close{background:none;border:none;font-size:24px;color:#94a3b8;cursor:pointer;padding:0;line-height:1}
.aljeel-notif-close:hover{color:#475569}
.aljeel-notif-tabs{display:flex;gap:0;border-bottom:1px solid #e2e8f0;flex-shrink:0}
.aljeel-notif-tab{flex:1;padding:12px;text-align:center;font-size:13px;font-weight:600;color:#64748b;background:none;border:none;cursor:pointer;transition:all .2s;border-bottom:2px solid transparent}
.aljeel-notif-tab.active{color:#2563eb;border-bottom-color:#2563eb}
.aljeel-notif-tab:hover:not(.active){color:#475569;background:#f8fafc}
.aljeel-notif-list{flex:1;overflow-y:auto;padding:8px 0}
.aljeel-notif-item{display:flex;gap:10px;padding:14px 20px;border-bottom:1px solid #f1f5f9;transition:background .2s}
.aljeel-notif-item:hover{background:#fafbfc}
.aljeel-notif-item.aljeel-notif-item-unread{background:#eff6ff}
.aljeel-notif-item.aljeel-notif-item-unread:hover{background:#dbeafe}
.aljeel-notif-item-icon{font-size:18px;flex-shrink:0;margin-top:2px}
.aljeel-notif-item-body{flex:1;min-width:0}
.aljeel-notif-item-body strong{display:block;font-size:13px;font-weight:700;color:#1e293b;margin-bottom:4px;overflow-wrap:break-word;word-break:break-word}
.aljeel-notif-item-body p{margin:0!important;font-size:12px;color:#64748b;line-height:1.5;overflow-wrap:break-word;word-break:break-word}
.aljeel-notif-item-date{display:block;font-size:11px;color:#94a3b8;margin-top:4px}
.aljeel-notif-item-actions{display:flex;flex-direction:column;gap:2px;flex-shrink:0;justify-content:center}
.notif-act{background:none;border:none;cursor:pointer;font-size:14px;padding:4px 6px;border-radius:6px;transition:background .2s;line-height:1}
.notif-act:hover{background:#e2e8f0}
.notif-act-del:hover{background:#fef2f2!important}
.aljeel-notif-loading,.aljeel-notif-empty{text-align:center;padding:40px 20px;color:#94a3b8;font-size:14px}
.aljeel-notif-actions{display:flex;gap:8px;padding:14px 20px;border-top:1px solid #e2e8f0;flex-shrink:0}
.aljeel-notif-action-btn{flex:1;padding:10px;border-radius:8px;font-size:13px;font-weight:600;border:none;cursor:pointer;background:#f1f5f9;color:#475569;transition:all .2s}
.aljeel-notif-action-btn:hover{background:#e2e8f0}
.aljeel-notif-action-danger{color:#ef4444}
.aljeel-notif-action-danger:hover{background:#fef2f2!important}
.aljeel-notif-overlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.3);z-index:99998}

@media(max-width:480px){
.aljeel-notif-drawer{width:100%;right:-100%}
.aljeel-notif-item-actions{flex-direction:row}
}

/* ==================== Modern Overview (Home) ==================== */
/* Stats Cards with gradient accents */
.dsh-stat { position: relative; overflow: hidden; padding: 24px 20px; }
.dsh-stat::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
}
.dsh-stat:nth-child(1)::before { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.dsh-stat:nth-child(2)::before { background: linear-gradient(90deg, #7c3aed, #a855f7); }
.dsh-stat:nth-child(3)::before { background: linear-gradient(90deg, #059669, #10b981); }
.dsh-stat:nth-child(4)::before { background: linear-gradient(90deg, #d97706, #f59e0b); }
.dsh-stat:nth-child(5)::before { background: linear-gradient(90deg, #dc2626, #ef4444); }
.dsh-stat-n { font-size: 32px; }
.dsh-stat-l { font-size: 14px; margin-top: 8px; }

/* Session cards - modern compact design */
.dsh-grid .dsh-book {
    border-radius: 16px; border: 1px solid #eef2f7; background: #fff;
    box-shadow: 0 4px 18px rgba(15,23,42,.06); overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.dsh-grid .dsh-book:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(15,23,42,.12); }
.dsh-grid .dsh-book-body { padding: 22px 22px 24px; }
.dsh-grid .dsh-book-body h4 {
    font-size: 17px; margin-bottom: 12px; position: relative; padding-right: 14px; line-height: 1.4;
}
.dsh-grid .dsh-book-body h4::before {
    content: ''; position: absolute; right: 0; top: 3px; bottom: 3px; width: 4px; border-radius: 4px;
    background: linear-gradient(180deg, #2563eb, #7c3aed);
}
.dsh-grid .dsh-book-body p { font-size: 12.5px !important; line-height: 1.7 !important; color: #64748b; }

/* Online session badge/link */
.dsh-book-body .dsh-btn-primary.aljeel-rounded-8 {
    padding: 8px 18px; font-size: 13px; border-radius: 8px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    transition: transform .2s, box-shadow .2s;
}
.dsh-book-body .dsh-btn-primary.aljeel-rounded-8:hover {
    transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.3);
}

/* Today sessions - time badge */
.dsh-grid .dsh-book-body p .dsh-time-badge {
    display: inline-block; background: #eff6ff; color: #2563eb;
    padding: 3px 12px; border-radius: 8px; font-size: 12px; font-weight: 600;
}

/* Weekly Timetable - modern card */
.aljeel-tt-grid { gap: 24px; }
.aljeel-tt-day {
    border-radius: 16px; box-shadow: 0 4px 18px rgba(15,23,42,.06);
    border: 1px solid #eef2f7; background: #fff; overflow: hidden;
}
.aljeel-tt-day-head {
    padding: 16px 20px; font-size: 15px; color: #1e293b;
    background: linear-gradient(135deg, #eef2ff, #faf5ff);
    border-bottom: 1px solid #eef2f7;
}
.aljeel-tt-session {
    padding: 16px 20px; border-bottom: 1px solid #f1f5f9; transition: background .2s;
}
.aljeel-tt-session:hover { background: #f8fafc; }
.aljeel-tt-session:last-child { border-bottom: none; }
.aljeel-tt-subject { font-size: 15px; }
.aljeel-tt-time {
    font-size: 13px; color: #4f46e5; background: #eef2ff;
    display: inline-block; padding: 3px 12px; border-radius: 8px; margin-bottom: 6px;
}
.aljeel-tt-teacher { font-size: 13px; }
.aljeel-tt-room { font-size: 12px; color: #94a3b8; margin-top: 2px; }

/* Online session indicator in timetable */
.aljeel-tt-session.aljeel-tt-online {
    border-right: 4px solid #ef4444; position: relative;
}
.aljeel-tt-session.aljeel-tt-online::after {
    content: '🔴'; position: absolute; top: 14px; left: 14px; font-size: 10px;
}
.aljeel-tt-online-badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
    background: #fef2f2; color: #ef4444; border-radius: 8px; font-size: 11px; font-weight: 600; margin-top: 8px;
}
.aljeel-tt-link {
    display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px;
    background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; border-radius: 8px;
    font-size: 12px; font-weight: 500; text-decoration: none; margin-top: 8px;
    transition: transform .2s, box-shadow .2s;
}
.aljeel-tt-link:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.3); color: #fff; }

/* Dark mode overrides for overview */
body.dsh-dark .dsh-stat::before { opacity: .8; }
body.dsh-dark .dsh-grid .dsh-book { background: #2d3748; border-color: #4a5568; box-shadow: none; }
body.dsh-dark .dsh-grid .dsh-book-body p { color: #a0aec0; }
body.dsh-dark .dsh-grid .dsh-book-body p .dsh-time-badge { background: #1e3a5f; color: #93c5fd; }
body.dsh-dark .aljeel-tt-day { background: #2d3748; border-color: #4a5568; box-shadow: none; }
body.dsh-dark .aljeel-tt-day-head { background: linear-gradient(135deg, #1e293b, #2d1b69); color: #e2e8f0; border-color: #4a5568; }
body.dsh-dark .aljeel-tt-session { border-color: #4a5568; }
body.dsh-dark .aljeel-tt-session:hover { background: #1a202c; }
body.dsh-dark .aljeel-tt-time { background: #1e293b; color: #a5b4fc; }
body.dsh-dark .aljeel-tt-subject { color: #e2e8f0; }
body.dsh-dark .aljeel-tt-room { color: #a0aec0; }

/* Validation error styles */
.aljeel-has-error .aljeel-field-error,
.dsh-field.aljeel-has-error .aljeel-field-error {
    display: block; margin-top: 4px; font-size: 12px; color: #ef4444; font-weight: 500;
}
.dsh-field input.aljeel-input-error,
.dsh-field select.aljeel-input-error,
.dsh-field textarea.aljeel-input-error {
    border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}

/* ==================== Unified Toasts ==================== */
.aljeel-toast-wrap {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    z-index: 100000; display: flex; flex-direction: column; gap: 10px;
    pointer-events: none; width: max-content; max-width: 92vw;
}
.aljeel-toast {
    pointer-events: auto; min-width: 240px; padding: 14px 20px; border-radius: 12px;
    font-size: 14px; font-weight: 600; color: #fff; box-shadow: 0 12px 34px rgba(15,23,42,.22);
    display: flex; align-items: center; gap: 10px; direction: rtl;
    animation: aljeelToastIn .28s ease both;
}
.aljeel-toast-success { background: linear-gradient(135deg, #10b981, #059669); }
.aljeel-toast-error { background: linear-gradient(135deg, #f43f5e, #e11d48); }
.aljeel-toast-hide { opacity: 0; transform: translateY(-8px); transition: opacity .3s, transform .3s; }
@keyframes aljeelToastIn {
    from { opacity: 0; transform: translateY(-12px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
body.dsh-dark .aljeel-toast-success { background: linear-gradient(135deg, #059669, #047857); }
body.dsh-dark .aljeel-toast-error { background: linear-gradient(135deg, #e11d48, #be123c); }

/* ==================== Custom Checkboxes ==================== */
.dsh-field input[type="checkbox"],
.aljeel-checkbox input[type="checkbox"],
input.aljeel-checkbox {
    appearance: none; -webkit-appearance: none; width: 26px; height: 26px; padding: 5px; box-sizing: border-box; margin: 0 8px 0 0;
    border: 2px solid #cbd5e1; border-radius: 7px; background: #fff; cursor: pointer;
    position: relative; flex-shrink: 0; transition: background .18s, border-color .18s, box-shadow .18s;
    vertical-align: middle;
}
.dsh-field input[type="checkbox"]:hover,
.aljeel-checkbox input[type="checkbox"]:hover,
input.aljeel-checkbox:hover { border-color: #2563eb; }
.dsh-field input[type="checkbox"]:checked,
.aljeel-checkbox input[type="checkbox"]:checked,
input.aljeel-checkbox:checked {
    background: linear-gradient(135deg, #2563eb, #7c3aed); border-color: #2563eb;
}
.dsh-field input[type="checkbox"]:checked::after,
.aljeel-checkbox input[type="checkbox"]:checked::after,
input.aljeel-checkbox:checked::after {
    content: ''; position: absolute; left: 50%; top: 44%;
    width: 5px; height: 10px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: translate(-50%, -50%) rotate(45deg);
}
.dsh-field input[type="checkbox"]:focus-visible,
.aljeel-checkbox input[type="checkbox"]:focus-visible,
input.aljeel-checkbox:focus-visible { box-shadow: 0 0 0 3px rgba(37,99,235,.35); outline: none; }
.dsh-field label .aljeel-checkbox-label,
label.aljeel-checkbox-label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 500; }
body.dsh-dark .dsh-field input[type="checkbox"],
body.dsh-dark .aljeel-checkbox input[type="checkbox"],
body.dsh-dark input.aljeel-checkbox { background: #1a202c; border-color: #4a5568; }
body.dsh-dark .dsh-field input[type="checkbox"]:checked,
body.dsh-dark .aljeel-checkbox input[type="checkbox"]:checked,
body.dsh-dark input.aljeel-checkbox:checked { border-color: #7c3aed; }

/* =========================================================================
   Aljeel Unified Loading Indicator
   ========================================================================= */
.aljeel-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.aljeel-loading-overlay.is-visible {
    display: flex;
}
.aljeel-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 28px 36px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    direction: rtl;
}
.aljeel-spinner {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 5px solid #e2e8f0;
    border-top-color: #2563eb;
    animation: aljeel-spin 0.8s linear infinite;
}
.aljeel-loading-text {
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}
@keyframes aljeel-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .aljeel-spinner { animation-duration: 2s; }
}

/* =========================================================================
   Aljeel Password Visibility Toggle (eye icon)
   ========================================================================= */
.aljeel-password-wrap {
    position: relative;
    display: block;
    width: 100%;
    box-sizing: border-box;
}
.aljeel-password-wrap > input {
    width: 100%;
    box-sizing: border-box;
}
.aljeel-password-toggle {
    position: absolute;
    top: 50%;
    inset-inline-end: 8px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    z-index: 2;
}
.aljeel-password-toggle:hover,
.aljeel-password-toggle:focus-visible {
    color: #2563eb;
    outline: none;
}
.aljeel-password-toggle .aljeel-eye {
    display: inline-flex;
    width: 20px;
    height: 20px;
}
.aljeel-password-toggle .aljeel-eye svg {
    display: block;
    width: 20px;
    height: 20px;
}
/* Keep typed text from sliding under the icon (RTL/LTR aware). */
.aljeel-password-wrap > input[type="password"],
.aljeel-password-wrap > input[type="text"] {
    padding-inline-end: 42px !important;
}


/* Hijri date picker */
.aljeel-hijri-field { position: relative; display: flex; align-items: stretch; gap: 6px; }
.aljeel-hijri-display { flex: 1; background: #fff; cursor: pointer; min-width: 0; }
.aljeel-hijri-toggle {
    border: 1px solid #d1d5db; background: #f8fafc;
    padding: 0 12px; cursor: pointer; border-radius: 8px; flex: 0 0 auto;
}
.aljeel-hijri-pop {
    position: absolute; top: calc(100% + 4px); inset-inline-end: 0; z-index: 999;
    width: 260px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15,23,42,.18); padding: 10px; direction: rtl;
}
.aljeel-hijri-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.aljeel-hijri-title { font-weight: 700; color: #0f172a; }
.aljeel-hijri-nav {
    width: 30px; height: 30px; border: none; background: #f1f5f9; border-radius: 8px;
    cursor: pointer; font-size: 18px; line-height: 1; color: #334155;
}
.aljeel-hijri-nav:hover { background: #e2e8f0; }
.aljeel-hijri-week { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; color: #94a3b8; font-size: 12px; margin-bottom: 4px; }
.aljeel-hijri-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.aljeel-hijri-day {
    border: none; background: #f8fafc; border-radius: 8px; padding: 6px 0; cursor: pointer;
    font-size: 13px; color: #1e293b;
}
.aljeel-hijri-day:hover { background: #14b8a6; color: #fff; }
.aljeel-hijri-empty { visibility: hidden; }
.aljeel-hijri-foot { text-align: center; margin-top: 8px; }
.aljeel-hijri-today { border: none; background: #e0f2fe; color: #0369a1; border-radius: 8px; padding: 6px 14px; cursor: pointer; font-size: 13px; }

/* ==================== Classes Page Redesign (aljeel-classes) ==================== */
.aljeel-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.aljeel-page-sub { color: #94a3b8; font-size: 14px; margin: 6px 0 0; line-height: 1.6; max-width: 640px; }

/* Tabs — modern pill style */
.aljeel-tabs { background: #f1f5f9; padding: 5px; border-radius: 14px; }
.aljeel-tab { font-size: 14px; padding: 11px 22px; border-radius: 10px; color: #64748b; }
.aljeel-tab.active { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; box-shadow: 0 6px 16px rgba(99, 102, 241, .30); }
.aljeel-tab:hover:not(.active) { background: rgba(255, 255, 255, .6); color: #334155; }

/* Form cards */
.aljeel-form-card { border: 1px solid #eef2f7; border-radius: 18px; box-shadow: 0 1px 4px rgba(15, 23, 42, .05); padding: 26px; }
.aljeel-form-card h3 { font-size: 17px; font-weight: 700; color: #0f172a; }
.aljeel-form-field label { font-size: 13px; color: #475569; margin-bottom: 6px; }
.aljeel-form-field input, .aljeel-form-field select, .aljeel-form-field textarea {
    padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 14px;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.aljeel-form-field input:focus, .aljeel-form-field select:focus, .aljeel-form-field textarea:focus {
    border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); outline: none;
}
.aljeel-hint { color: #94a3b8; font-size: 12px; margin-top: 6px; }

/* Class grid + cards */
.aljeel-class-grid { gap: 16px; }
.aljeel-class-card {
    background: #fff; border: 1px solid #eef2f7; border-radius: 18px; padding: 18px 20px;
    display: flex; align-items: center; gap: 16px; box-shadow: 0 1px 4px rgba(15, 23, 42, .05);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.aljeel-class-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(15, 23, 42, .10); border-color: #c7d2fe; }
.aljeel-class-icon {
    width: 54px; height: 54px; border-radius: 16px; background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px;
    flex-shrink: 0; box-shadow: 0 6px 16px rgba(99, 102, 241, .35);
}
.aljeel-class-info h4 { font-size: 16px; font-weight: 700; color: #0f172a; }
.aljeel-class-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.aljeel-chip {
    display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; color: #475569;
    background: #f1f5f9; border: 1px solid #e2e8f0; padding: 4px 12px; border-radius: 999px;
}
.aljeel-chip-grade { color: #4338ca; background: #eef2ff; border-color: #e0e7ff; }

/* Action buttons inside cards */
.aljeel-class-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.aljeel-class-actions .button { transition: transform .2s ease, background .2s ease, box-shadow .2s ease; }
.aljeel-class-actions .button:hover { transform: translateY(-2px); }
.aljeel-class-actions .button:active { transform: translateY(0); }

/* Subjects rows (class subjects + global subjects) */
.aljeel-subject-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.aljeel-subject-input {
    flex: 1; width: auto !important; padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 14px;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.aljeel-subject-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); outline: none; }

/* Empty states */
.aljeel-empty-card {
    text-align: center; padding: 48px 24px; border: 1px dashed #cbd5e1; border-radius: 18px;
    background: #fbfcfe; color: #94a3b8;
}
.aljeel-empty-card .aljeel-empty-ico { font-size: 42px; display: block; margin-bottom: 10px; }
.aljeel-empty-card p { font-size: 15px; margin: 0 0 16px; }

@keyframes aljeelSpin { to { transform: rotate(360deg); } }

/* Timetable refinements */
.aljeel-tt-day { border: 1px solid #eef2f7; border-radius: 16px; box-shadow: 0 1px 4px rgba(15, 23, 42, .05); }
.aljeel-tt-day-head { border-radius: 16px 16px 0 0; }

/* Dark mode */
body.dsh-dark .aljeel-class-card { background: #2d3748; border-color: #4a5568; box-shadow: none; }
body.dsh-dark .aljeel-class-card:hover { border-color: #6366f1; }
body.dsh-dark .aljeel-class-info h4 { color: #e2e8f0; }
body.dsh-dark .aljeel-chip { background: #1e293b; color: #cbd5e1; border-color: #334155; }
body.dsh-dark .aljeel-chip-grade { background: #312e81; color: #c7d2fe; border-color: #4338ca; }
body.dsh-dark .aljeel-empty-card { background: #2d3748; border-color: #4a5568; color: #a0aec0; }
body.dsh-dark .aljeel-form-field input,
body.dsh-dark .aljeel-form-field select,
body.dsh-dark .aljeel-form-field textarea,
body.dsh-dark .aljeel-subject-input { background: #1a202c; border-color: #4a5568; color: #e2e8f0; }
body.dsh-dark .aljeel-form-field input:focus,
body.dsh-dark .aljeel-form-field select:focus,
body.dsh-dark .aljeel-subject-input:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(129, 140, 248, .2); }

/* ===== Parent dashboard: compact children's books list ===== */
.aljeel-parent-books {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    gap: 8px;
}
.aljeel-parent-book {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-right-width: 4px;
    border-radius: 10px;
}
.aljeel-parent-book--completed { border-right-color: #38a169; }
.aljeel-parent-book--reading   { border-right-color: #d69e2e; }
.aljeel-parent-book--new       { border-right-color: #a0aec0; }
.aljeel-parent-book-icon { font-size: 16px; line-height: 1; flex-shrink: 0; }
.aljeel-parent-book-name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1a202c;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.aljeel-parent-book-badge { flex-shrink: 0; }
.aljeel-parent-book--completed .aljeel-parent-book-badge { background: #c6f6d5; color: #22543d; }
.aljeel-parent-book--reading   .aljeel-parent-book-badge { background: #fef3c7; color: #744210; }
.aljeel-parent-book--new       .aljeel-parent-book-badge { background: #edf2f7; color: #4a5568; }

body.dsh-dark .aljeel-parent-book { background: #2d3748; border-color: #4a5568; }
body.dsh-dark .aljeel-parent-book-name { color: #e2e8f0; }
body.dsh-dark .aljeel-parent-book--completed .aljeel-parent-book-badge { background: #22543d; color: #c6f6d5; }
body.dsh-dark .aljeel-parent-book--reading   .aljeel-parent-book-badge { background: #744210; color: #fef3c7; }
body.dsh-dark .aljeel-parent-book--new       .aljeel-parent-book-badge { background: #4a5568; color: #e2e8f0; }

/* ===== Student: trip detail page ===== */
.aljeel-trip-card-link { transition: box-shadow .15s, transform .15s; }
.aljeel-trip-card-link:hover { box-shadow: 0 4px 16px rgba(15,23,42,.1); transform: translateY(-2px); }

.aljeel-trip-student-tag {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px 10px;
}
body.dsh-dark .aljeel-trip-student-tag { background: #1a202c; color: #cbd5e1; }

.aljeel-trip-detail { max-width: 760px; margin: 0 auto; }
.aljeel-trip-detail-hero {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 18px;
    background: #f1f5f9;
    aspect-ratio: 16 / 7;
}
.aljeel-trip-detail-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.aljeel-trip-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.aljeel-trip-detail-title { margin: 0; font-size: 24px; font-weight: 800; color: #0f172a; }
.aljeel-trip-student-banner {
    background: linear-gradient(135deg, #eef2ff, #ecfdf5);
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 15px;
    color: #1e293b;
    margin-bottom: 18px;
}
.aljeel-trip-student-banner strong { color: #2563eb; font-size: 17px; }
.aljeel-trip-detail-info {
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 14px;
    padding: 6px 16px;
    margin-bottom: 20px;
}
.aljeel-trip-detail-desc { margin-bottom: 20px; }
.aljeel-trip-detail-desc h3,
.aljeel-trip-detail-gallery h3,
.aljeel-trip-detail-response h3 { font-size: 17px; color: #1e293b; margin: 0 0 10px; }
.aljeel-trip-detail-desc-body { font-size: 15px; line-height: 1.8; color: #475569; }
.aljeel-trip-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
}
.aljeel-trip-gallery-item { display: block; border-radius: 10px; overflow: hidden; border: 1px solid #e2e8f0; }
.aljeel-trip-gallery-item img { width: 100%; height: 90px; object-fit: cover; display: block; }
.aljeel-trip-detail-response {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 18px;
    margin-top: 8px;
}
.aljeel-trip-response-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.aljeel-trip-response-actions .dsh-btn { font-size: 15px; padding: 10px 22px; }
.aljeel-trip-response-msg {
    font-size: 15px;
    font-weight: 700;
    padding: 12px 16px;
    border-radius: 10px;
}
.aljeel-trip-response-msg.is-approved { background: #c6f6d5; color: #22543d; }
.aljeel-trip-response-msg.is-rejected { background: #fed7d7; color: #742a2a; }
.aljeel-trip-response-msg.is-pending  { background: #e2e8f0; color: #475569; }

@media (max-width: 600px) {
    .aljeel-trip-detail-title { font-size: 20px; }
    .aljeel-trip-detail-hero { aspect-ratio: 16 / 9; }
    .aljeel-trip-response-actions { flex-direction: column; }
    .aljeel-trip-response-actions .dsh-btn { width: 100%; }
}

body.dsh-dark .aljeel-trip-detail-title { color: #e2e8f0; }
body.dsh-dark .aljeel-trip-detail-desc h3,
body.dsh-dark .aljeel-trip-detail-gallery h3,
body.dsh-dark .aljeel-trip-detail-response h3 { color: #e2e8f0; }
body.dsh-dark .aljeel-trip-student-banner { background: #1e293b; border-color: #3730a3; color: #cbd5e1; }
body.dsh-dark .aljeel-trip-student-banner strong { color: #93c5fd; }
body.dsh-dark .aljeel-trip-detail-info { background: #2d3748; border-color: #4a5568; }
body.dsh-dark .aljeel-trip-detail-desc-body { color: #cbd5e1; }
body.dsh-dark .aljeel-trip-detail-response { background: #2d3748; border-color: #4a5568; }
body.dsh-dark .aljeel-trip-gallery-item { border-color: #4a5568; }

/* ===== Parent dashboard: full trip detail card (unified .dsh-book chrome) ===== */
.aljeel-par-trip-card {
    margin-bottom: 20px;
}
.aljeel-par-trip-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.aljeel-par-trip-titles { flex: 1; min-width: 0; }
.aljeel-par-trip-title { margin: 0; color: #1a202c; }
.aljeel-par-trip-status.dsh-meta { margin-top: 8px; }
.aljeel-par-trip-desc {
    font-size: 14px;
    line-height: 1.8;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.aljeel-par-trip-desc p { margin: 0 0 8px; }
.aljeel-par-trip-desc p:last-child { margin-bottom: 0; }
.aljeel-par-trip-info {
    border: 1px solid #eef2f7;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}
.aljeel-par-trip-row {
    display: flex;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}
.aljeel-par-trip-row:last-child { border-bottom: none; }
.aljeel-par-trip-key { flex-shrink: 0; font-weight: 700; color: #334155; min-width: 150px; }
.aljeel-par-trip-val { flex: 1; color: #1a202c; text-align: left; direction: ltr; }
.aljeel-par-child-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    margin-top: 10px;
}
.aljeel-par-child-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.aljeel-par-child-name { font-size: 15px; color: #0f172a; }
.aljeel-par-child-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

@media (max-width: 600px) {
    .aljeel-par-trip-head { flex-direction: column-reverse; }
    .aljeel-par-trip-key { min-width: 110px; font-size: 13px; }
    .aljeel-par-trip-row { font-size: 13px; }
    .aljeel-par-child-actions .dsh-btn { width: 100%; }
}

body.dsh-dark .aljeel-par-trip-card { box-shadow: none; }
body.dsh-dark .aljeel-par-trip-title { color: #e2e8f0; }
body.dsh-dark .aljeel-par-trip-desc { background: #1a202c; border-color: #4a5568; color: #cbd5e1; }
body.dsh-dark .aljeel-par-trip-info { border-color: #4a5568; }
body.dsh-dark .aljeel-par-trip-row { border-color: #3a4456; }
body.dsh-dark .aljeel-par-trip-key { color: #cbd5e1; }
body.dsh-dark .aljeel-par-trip-val { color: #e2e8f0; }
body.dsh-dark .aljeel-par-child-row { background: #1a202c; border-color: #4a5568; }
body.dsh-dark .aljeel-par-child-name { color: #e2e8f0; }
