/* ==========================================================
   style.css — جاویدگرام (نسخه‌ی حرفه‌ای بازطراحی‌شده)
   ========================================================== */

@font-face { font-family: 'JavidFont'; src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'JavidFont'; src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'JavidFont'; src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
    --jg-primary: #12408c; --jg-primary-dark: #0a2a5e; --jg-primary-light: #2e5aa8;
    --jg-accent: #f2a80c; --jg-accent-dark: #d18f00;
    --jg-accent-boy: #12408c; --jg-accent-girl: #f2a80c;
    --jg-bg: #eef2f8; --jg-surface: #ffffff; --jg-surface-2: #f6f8fc;
    --jg-text: #1a2332; --jg-text-muted: #7a8698; --jg-border: #e4e9f1;
    --jg-danger: #e5484d; --jg-success: #30a46c;
    --jg-radius: 18px; --jg-radius-sm: 12px; --jg-radius-lg: 24px;
    --jg-shadow: 0 4px 20px rgba(18,64,140,0.08); --jg-shadow-lg: 0 12px 40px rgba(18,64,140,0.15);
    --jg-gradient: linear-gradient(135deg, var(--jg-primary), var(--jg-primary-dark));
    --jg-gradient-accent: linear-gradient(135deg, var(--jg-accent), var(--jg-accent-dark));
    --jg-transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* ⚠️ باگِ ریشه‌ایِ واقعی (۱۴۰۵/۰۵/۲۱، تاییدشده با body.getBoundingClientRect() هم رویِ
   سیستمِ وحید هم رویِ ابزارِ خودم — عددها عیناً یکی بودن): وقتی overflow-x:hidden رویِ
   خودِ body هم گذاشته می‌شد، طبقِ قاعده‌ی CSS («اگه یکی از overflow-x/overflow-y چیزی
   غیرِ visible باشه، اون‌یکی هم به‌جایِ visible میره رویِ auto»)، overflow-y خودِ body
   هم بی‌سروصدا auto می‌شد — یعنی body خودش تبدیل به یک اسکرول‌کانتینرِ کاملاً جدا از
   صفحه می‌شد، با ارتفاعی که فقط از رویِ محتوایِ عادیِ داخلِ جریان (topbar+فرمِ فیلتر+پیامِ
   خالی، این‌جا حدودِ ۲۱۸px) محاسبه می‌شد — نه از رویِ ارتفاعِ واقعیِ ویوپورت. هر پنلِ
   position:absolute (مثلِ همین دراپ‌داونِ شیشه‌ای) که containing-blockش داخلِ body بود،
   به همین جعبه‌ی ۲۱۸پیکسلیِ body کلیپ می‌شد — و برایِ دیدنِ بقیه‌اش باید خودِ body
   اسکرول می‌خورد، نه صفحه/window (که با scrollTo معمولی اصلاً اثر نداشت). فیکس:
   overflow-x:hidden فقط رویِ html می‌مونه (کافیه، چون html همیشه حداقل به‌اندازه‌ی
   ویوپورت رشد می‌کنه)؛ body دیگه overflow خاصی نداره و اسکرولِ کلِ صفحه دوباره یکپارچه
   با اسکرولِ خودِ window/html می‌شه. */
html { overflow-x: hidden; width: 100%; }
html, body { direction: rtl; text-align: right; font-family: 'JavidFont', Tahoma, sans-serif; background: var(--jg-bg); color: var(--jg-text); margin: 0; padding: 0; font-size: 15px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
body { width: 100%; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c5cfdd; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
a { color: var(--jg-primary); }

.jg-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--jg-gradient); padding: 20px; position: relative; overflow: hidden; }
.jg-login-wrap::before, .jg-login-wrap::after { content: ''; position: absolute; border-radius: 50%; }
.jg-login-wrap::before { width: 340px; height: 340px; top: -120px; right: -100px; background: rgba(242,168,12,0.12); }
.jg-login-wrap::after { width: 260px; height: 260px; bottom: -90px; left: -70px; background: rgba(255,255,255,0.06); }
.jg-login-card { background: var(--jg-surface); border-radius: var(--jg-radius-lg); padding: 40px 30px; width: 100%; max-width: 400px; text-align: center; box-shadow: var(--jg-shadow-lg); position: relative; z-index: 1; animation: jg-rise 0.6s cubic-bezier(0.2,0.8,0.2,1); }
@keyframes jg-rise { from { opacity: 0; transform: translateY(30px) scale(0.97); } to { opacity: 1; transform: none; } }
.jg-login-card img.jg-logo { width: 96px; margin-bottom: 14px; filter: drop-shadow(0 6px 14px rgba(18,64,140,0.2)); }
.jg-login-card h1 { font-size: 22px; margin: 0 0 6px; color: var(--jg-primary); font-weight: 700; }
.jg-login-card p.jg-sub { color: var(--jg-text-muted); font-size: 13px; margin-bottom: 28px; }

.jg-field { text-align: right; margin-bottom: 18px; }
.jg-field label { display: block; font-size: 13px; margin-bottom: 8px; color: var(--jg-text-muted); font-weight: 500; }
.jg-field input, .jg-field select, .jg-field textarea { width: 100%; padding: 13px 16px; border: 1.5px solid var(--jg-border); border-radius: var(--jg-radius-sm); font-family: inherit; font-size: 15px; background: var(--jg-surface-2); transition: var(--jg-transition); color: var(--jg-text); }
.jg-field input:focus, .jg-field select:focus, .jg-field textarea:focus { outline: none; border-color: var(--jg-primary); background: #fff; box-shadow: 0 0 0 4px rgba(18,64,140,0.08); }
.jg-login-card .jg-field input { direction: ltr; text-align: center; letter-spacing: 1px; }

/* فیلد رمز به‌همراه دکمه‌ی چشمِ نمایش/پنهان. دکمه داخلِ خودِ فیلد شناور می‌شود؛ بدون این
   استایل‌ها، چون input عرض ۱۰۰٪ دارد دکمه به خط بعد می‌افتد و زیر فیلد می‌چسبد.
   پدینگ از هر دو طرف یکسان داده شده تا متنِ وسط‌چینِ فیلدِ ورود واقعاً وسط بماند. */
.jg-password-wrap { position: relative; display: block; }
.jg-field .jg-password-wrap input { padding-left: 46px; padding-right: 46px; }
.jg-password-eye {
    position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; padding: 0; margin: 0;
    display: flex; align-items: center; justify-content: center;
    border: none; background: transparent; color: var(--jg-text-muted);
    cursor: pointer; border-radius: 50%; transition: var(--jg-transition);
}
.jg-password-eye:hover { color: var(--jg-primary); background: rgba(18,64,140,0.08); }
.jg-password-eye:focus-visible { outline: 2px solid var(--jg-primary); outline-offset: 2px; }
.jg-password-eye svg { display: block; }

.jg-btn { width: 100%; padding: 14px; border: none; border-radius: var(--jg-radius-sm); background: var(--jg-gradient); color: #fff; font-size: 15px; font-family: inherit; font-weight: 700; cursor: pointer; transition: var(--jg-transition); box-shadow: 0 6px 18px rgba(18,64,140,0.25); }
.jg-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(18,64,140,0.35); }
.jg-btn:active { transform: translateY(0); }
.jg-btn.accent { background: var(--jg-gradient-accent); box-shadow: 0 6px 18px rgba(242,168,12,0.3); }

.jg-error { background: #fdecee; color: var(--jg-danger); border-radius: var(--jg-radius-sm); padding: 12px 16px; font-size: 13px; margin-bottom: 18px; border: 1px solid #f8d7da; text-align: right; }
.jg-success-box { background: #e8f7ef; color: var(--jg-success); border-radius: var(--jg-radius-sm); padding: 12px 16px; font-size: 13px; margin-bottom: 18px; border: 1px solid #c8ecd8; }
.jg-chart-empty {
    display: flex; align-items: center; justify-content: center;
    min-height: 120px; color: var(--jg-text-muted); font-size: 13px;
    background: var(--jg-surface-2); border: 1px dashed var(--jg-border);
    border-radius: var(--jg-radius-sm); text-align: center; padding: 16px;
}

.jg-topbar { background: var(--jg-gradient); color: #fff; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; border-radius: 0 0 var(--jg-radius); box-shadow: var(--jg-shadow); position: sticky; top: 0; z-index: 50; min-height: 62px; box-sizing: border-box; }
.jg-topbar .jg-welcome-name {
    font-size: clamp(11px, 3vw, 13px); font-weight: 700;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.jg-topbar-role-subtitle { font-size: 10px; font-weight: 600; opacity: 0.85; margin-top: 1px; }
.jg-topbar .jg-date { font-size: 10px; opacity: 0.85; margin-top: 1px; }

/* عکس/حرفِ شاخصِ داخل سربرگ */
.jg-topbar-avatar-wrap { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; }
.jg-topbar-avatar-photo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: block; border: 2px solid rgba(255,255,255,0.5); }
.jg-topbar-avatar-letter { width: 40px; height: 40px; background: rgba(255,255,255,0.18); font-size: 16px; }
.jg-topbar-avatar-editable { cursor: pointer; position: relative; }
.jg-topbar-avatar-editable:hover { filter: brightness(0.92); }

/* بجِ ستاره کنارِ زنگ — کارِ #۵۹. کوچک و چشمک‌زن تا در همه‌جایِ اپ (نه فقط خانه) خودنمایی کنه */
.jg-topbar-star-badge {
    display: flex; align-items: center; gap: 3px; flex-shrink: 0;
    background: linear-gradient(135deg, #f2a80c, #ffd166); color: #5a3d00;
    border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 800;
    box-shadow: 0 2px 10px rgba(242,168,12,0.45);
    animation: jg-topbar-star-blink 1.7s ease-in-out infinite;
}
.jg-topbar-star-icon { font-size: 13px; line-height: 1; }
@keyframes jg-topbar-star-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.15); }
}

/* دکمه‌ی «صفحه‌ی شخصیِ من» — بینِ سه‌نقطه و زنگوله، لینکِ مستقیم به کارتابل */
.jg-topbar-home-btn { background: rgba(255,255,255,0.14); border: none; color: #fff; font-size: 15px; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--jg-transition); text-decoration: none; }
.jg-topbar-home-btn:hover { background: rgba(255,255,255,0.24); }

/* زنگ اعلان‌ها — کوچک و جمع‌وجورتر از قبل */
.jg-topbar-bell-btn { background: rgba(255,255,255,0.14); border: none; color: #fff; font-size: 15px; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; position: relative; display: flex; align-items: center; justify-content: center; transition: var(--jg-transition); }
.jg-topbar-bell-btn:hover { background: rgba(255,255,255,0.24); }
.jg-topbar-bell-badge { position: absolute; top: -3px; left: -4px; background: var(--jg-accent); color: #fff; border-radius: 8px; font-size: 9px; padding: 1px 4px; min-width: 14px; text-align: center; line-height: 1.4; }

/* پنلِ زنگوله — جمع‌وجور، یک‌اندازه برایِ همه‌یِ آیتم‌ها (عنوانِ تک‌خط + جزئیاتِ حداکثر دوخط)؛ روی گوشی شناور و تمام‌عرض */
.jg-bell-panel { position: fixed; z-index: 1000; background: #fff; color: #263041; border-radius: 16px; box-shadow: 0 12px 40px rgba(10,42,94,0.28), 0 2px 8px rgba(0,0,0,0.08); width: 340px; max-width: calc(100vw - 16px); max-height: min(70vh, 460px); overflow: hidden; direction: rtl; text-align: right; display: none; }
.jg-bell-panel.jg-open { display: flex; flex-direction: column; }
.jg-bell-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid #eef1f6; flex: none; }
.jg-bell-head b { font-size: 14px; color: var(--jg-primary); }
.jg-bell-head span { font-size: 11.5px; color: #7a8599; }
.jg-bell-list { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; flex: 1 1 auto; }
.jg-bell-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid #f1f3f8; transition: background .15s; }
.jg-bell-row:last-child { border-bottom: 0; }
.jg-bell-row:hover, .jg-bell-row:active { background: #f5f8fe; }
.jg-bell-row.jg-fresh { background: #fff8e6; }
.jg-bell-row.jg-fresh:hover { background: #fff1cc; }
.jg-bell-ic { flex: 0 0 34px; height: 34px; border-radius: 11px; background: #eef3fc; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.jg-bell-row.jg-fresh .jg-bell-ic { background: #ffe9ad; }
.jg-bell-txt { flex: 1 1 auto; min-width: 0; }
.jg-bell-title { font-size: 13px; font-weight: 700; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.jg-bell-new { display: inline-block; vertical-align: 1px; margin-inline-start: 6px; background: #e8590c; color: #fff; font-size: 9.5px; font-weight: 700; border-radius: 6px; padding: 0 5px; line-height: 1.6; }
.jg-bell-detail { font-size: 11.5px; line-height: 1.6; color: #6b778c; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.jg-bell-count { flex: none; align-self: center; min-width: 24px; height: 22px; padding: 0 7px; box-sizing: border-box; border-radius: 11px; background: var(--jg-accent); color: #fff; font-size: 11.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.jg-bell-empty { padding: 26px 14px; text-align: center; color: #8a94a7; font-size: 13px; }

/* منوی سه‌نقطه (جایگزین لینک مستقلِ «خروج») */
.jg-topbar-kebab-btn { background: rgba(255,255,255,0.14); border: none; color: #fff; font-size: 18px; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; line-height: 1; transition: var(--jg-transition); }
.jg-topbar-kebab-btn:hover { background: rgba(255,255,255,0.24); }
.jg-topbar-kebab-dropdown { display: none; position: absolute; left: 0; top: 38px; background: #fff; border-radius: 12px; box-shadow: var(--jg-shadow-lg); min-width: 175px; overflow: hidden; z-index: 100; flex-direction: column; }
.jg-topbar-kebab-dropdown.open { display: flex; animation: jg-fade 0.15s ease; }
.jg-topbar-kebab-item { display: block; width: 100%; box-sizing: border-box; text-align: right; padding: 12px 16px; border: none; background: none; font-family: inherit; font-size: 13.5px; color: var(--jg-text); cursor: pointer; text-decoration: none; }
.jg-topbar-kebab-item:hover { background: var(--jg-surface-2); }
.jg-topbar-kebab-item.jg-topbar-kebab-danger { color: var(--jg-danger); border-top: 1px solid var(--jg-border); }
.jg-topbar-kebab-form { margin: 0; }
.jg-topbar-kebab-item-active { color: var(--jg-primary); font-weight: 600; }
.jg-topbar-kebab-label { padding: 8px 16px 2px; font-size: 11px; color: var(--jg-text-muted); }
.jg-topbar-kebab-divider { height: 1px; background: var(--jg-border); margin: 2px 0; }

/* دیالوگ آپلود/برشِ دایره‌ای عکس پروفایل */
.jg-pp-picker { text-align: center; }
.jg-pp-picker #jg-pp-file { display: none; }
.jg-pp-pick-btn { display: inline-block; padding: 11px 20px; border-radius: 12px; background: var(--jg-surface-2); border: 1.5px dashed var(--jg-border); color: var(--jg-primary); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: var(--jg-transition); }
.jg-pp-pick-btn:hover { background: #e8edf5; }
.jg-pp-stage-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 14px; }
.jg-pp-stage { position: relative; width: 260px; height: 260px; overflow: hidden; border-radius: 14px; background: #1a2332; touch-action: none; }
.jg-pp-stage img { position: absolute; user-select: none; -webkit-user-drag: none; }
.jg-pp-mask { position: absolute; inset: 0; pointer-events: none; border-radius: 50%; margin: 30px; box-shadow: 0 0 0 999px rgba(0,0,0,0.55); border: 2px solid rgba(255,255,255,0.85); }
.jg-pp-zoom { width: 220px; }

.jg-panel-body { padding: 22px 18px 40px; max-width: 680px; margin: 0 auto; }

.jg-card { background: var(--jg-surface); border-radius: var(--jg-radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--jg-shadow); border: 1px solid var(--jg-border); animation: jg-fade 0.4s ease; }
@keyframes jg-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.jg-card h3 { margin-top: 0; font-size: 17px; color: var(--jg-primary); }
.jg-card h4 { font-size: 15px; }

.jg-tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 12px; }
.jg-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px 12px; border-radius: var(--jg-radius); background: var(--jg-surface); border: 1.5px solid var(--jg-border); text-decoration: none; color: var(--jg-text); font-size: 13.5px; font-weight: 500; transition: var(--jg-transition); box-shadow: 0 2px 8px rgba(18,64,140,0.05); text-align: center; }
.jg-tile:hover { transform: translateY(-4px); border-color: var(--jg-primary); box-shadow: var(--jg-shadow); }
.jg-tile .jg-tile-icon { width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 26px; background: linear-gradient(135deg, rgba(18,64,140,0.1), rgba(18,64,140,0.04)); }
.jg-tile.accent .jg-tile-icon { background: linear-gradient(135deg, rgba(242,168,12,0.16), rgba(242,168,12,0.05)); }

.jg-child-card { display: flex; align-items: center; gap: 14px; border: 2px solid var(--jg-border); cursor: pointer; transition: var(--jg-transition); }
.jg-child-card:hover { border-color: var(--jg-primary-light); transform: translateX(-3px); }
.jg-child-card.selected { border-color: var(--jg-accent); background: #fffaf0; }
.jg-child-card img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, var(--jg-primary-light), var(--jg-primary)); border: 2px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,0.12); }

/* ========== کارتِ کلاس (فهرست «کلاس‌ها») — فاز ۳ ========== */
.jg-class-card {
    display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--jg-text);
    cursor: pointer; border: 1.5px solid var(--jg-border);
}
.jg-class-card:hover { border-color: var(--jg-primary-light); transform: translateX(-3px); box-shadow: var(--jg-shadow-lg); }
.jg-class-card .jg-avatar-letter { width: 50px; height: 50px; font-size: 20px; }
.jg-class-card-body { flex: 1; min-width: 0; }
.jg-class-card-name { font-size: 15.5px; font-weight: 700; color: var(--jg-primary); }
.jg-class-card-teacher { font-size: 12px; color: var(--jg-text-muted); margin-top: 3px; }
.jg-class-card-chevron { color: var(--jg-text-muted); flex-shrink: 0; font-size: 20px; transition: var(--jg-transition); }
.jg-class-card:hover .jg-class-card-chevron { color: var(--jg-primary); transform: translateX(-3px); }

.jg-branch-badge { display: inline-block; padding: 3px 12px; border-radius: 20px; font-size: 11px; color: #fff; font-weight: 500; }
.jg-branch-badge.boy { background: var(--jg-accent-boy); }
.jg-branch-badge.girl { background: var(--jg-accent-girl); }

.jg-avatar-letter { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 18px; background: var(--jg-gradient); flex-shrink: 0; }
.jg-avatar-photo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--jg-surface-2); border: 2px solid #fff; box-shadow: 0 2px 8px rgba(18,64,140,0.12); }
.jg-class-card .jg-avatar-photo { width: 50px; height: 50px; }

.jg-list-row { display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--jg-border); }
.jg-list-row:last-child { border-bottom: none; }

.jg-skeleton { background: linear-gradient(90deg,#eef2f8 25%,#e0e7f1 50%,#eef2f8 75%); background-size: 200% 100%; animation: jg-shimmer 1.4s infinite; border-radius: 8px; }
@keyframes jg-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

select.jg-input, input.jg-input, textarea.jg-input { width: 100%; padding: 12px 14px; border-radius: var(--jg-radius-sm); border: 1.5px solid var(--jg-border); font-family: inherit; font-size: 14px; background: var(--jg-surface-2); transition: var(--jg-transition); color: var(--jg-text); }
select.jg-input:focus, input.jg-input:focus, textarea.jg-input:focus { outline: none; border-color: var(--jg-primary); background: #fff; box-shadow: 0 0 0 4px rgba(18,64,140,0.08); }

.jg-btn-sm { border: none; background: var(--jg-primary); color: #fff; padding: 7px 14px; border-radius: 10px; cursor: pointer; font-size: 12px; font-family: inherit; font-weight: 500; transition: var(--jg-transition); }
.jg-btn-sm:hover { background: var(--jg-primary-dark); }
.jg-btn-sm.accent { background: var(--jg-accent); }

/* ⚠️ باگِ واقعیِ رفع‌شده (۱۴۰۵/۰۵/۳۰): این کلاس قبلاً فقط در book.css تعریف شده بود،
   ولی صفحاتِ دیگه‌ای (رویدادها، تقویم، درخواست‌ها) هم بدونِ لودِ اون فایل ازش استفاده
   می‌کردن — یعنی دکمه‌های ✏️/🗑️/📋 اون صفحات کاملاً بی‌استایل (ظاهرِ خامِ مرورگر)
   رندر می‌شدن. حالا این‌جا، تویِ style.css (که همه‌جا لود می‌شه) تعریف شده. */
.jg-book-mini-btn {
    border: none; background: var(--jg-surface-2); color: var(--jg-primary);
    border-radius: 8px; padding: 5px 12px; cursor: pointer; font-size: 11.5px;
    font-family: inherit; font-weight: 600; text-decoration: none; display: inline-block;
}
.jg-book-mini-btn.danger { color: var(--jg-danger); }
.jg-btn-sm.accent:hover { background: var(--jg-accent-dark); }

/* ========== نوار ناوبری مدیریتی ========== */
.jg-admin-nav { background: var(--jg-surface); border-radius: var(--jg-radius); padding: 12px; margin-bottom: 16px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; box-shadow: var(--jg-shadow); border: 1px solid var(--jg-border); }
.jg-admin-nav-item { padding: 8px 16px; border-radius: 12px; text-decoration: none; font-size: 13px; font-weight: 500; background: var(--jg-surface-2); color: var(--jg-text); transition: var(--jg-transition); }
.jg-admin-nav-item:hover { background: #e4ebf5; }
.jg-admin-nav-item.active { background: var(--jg-gradient); color: #fff; box-shadow: 0 3px 10px rgba(18,64,140,0.25); }
.jg-admin-nav-item.back { background: transparent; color: var(--jg-text-muted); }
.jg-admin-nav-item.back:hover { background: var(--jg-surface-2); }

/* ردیف‌های لیست با جداکننده نرم */
.jg-data-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--jg-border); gap: 10px; }
.jg-data-row:last-child { border-bottom: none; }

/* پیام موفقیت درون کارت */
.jg-inline-success { background: #e8f7ef; color: var(--jg-success); border: 1px solid #c8ecd8; }

/* برچسب وضعیت */
.jg-status-pill { display: inline-block; padding: 3px 12px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.jg-status-pill.paid { background: #e8f7ef; color: var(--jg-success); }
.jg-status-pill.due { background: #fdecee; color: var(--jg-danger); }
.jg-status-pill.credit { background: #fff6e5; color: var(--jg-accent-dark); }

/* ========== نوار تب پایین (پنل دانش‌آموز/والد) ========== */
.jg-bottom-nav {
    position: fixed; bottom: 0; right: 0; left: 0; z-index: 60;
    background: rgba(255,255,255,0.98); backdrop-filter: blur(10px);
    border-top: 1px solid var(--jg-border); box-shadow: 0 -6px 24px rgba(18,64,140,0.1);
    display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.jg-bottom-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1;
    text-decoration: none; color: var(--jg-text-muted); font-size: 10.5px; font-weight: 500;
    padding: 6px 2px; border-radius: 14px; transition: var(--jg-transition);
}
.jg-bottom-nav-item .jg-bn-icon { font-size: 20px; line-height: 1; transition: transform 0.2s; }
.jg-bottom-nav-item.active {
    color: #fff;
    background: var(--jg-gradient);
    box-shadow: 0 4px 14px rgba(18,64,140,0.35);
    transform: translateY(-3px);
}
.jg-bottom-nav-item.active .jg-bn-icon { transform: scale(1.1); }
.jg-bottom-nav-item.disabled { opacity: 0.35; pointer-events: none; }
.jg-bottom-nav-item.jg-bottom-nav-exit { flex: 0 0 auto; width: 44px; height: 44px; padding: 0; align-self: center; background: transparent; color: var(--jg-danger); }
.jg-bottom-nav-item.jg-bottom-nav-exit .jg-bn-icon { font-size: 27px; font-weight: 900; color: var(--jg-danger); }
.jg-bottom-nav-item.jg-bottom-nav-exit .jg-bn-label { display: none; }
.jg-bottom-nav-item.jg-bottom-nav-exit.active { background: transparent; }

/* ========== ردیف زیرتب‌های داخل صفحه (فاز ۳: قبلاً این کلاس استفاده می‌شد ولی هیچ‌جا
   تعریف نشده بود — مثلاً در teacher_class.php زیرتب‌های ویرایش، یا vp_content.php) ========== */
.jg-subtab-row {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
}
.jg-subtab-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--jg-surface); border: 1.5px solid var(--jg-border); border-radius: 14px;
    padding: 8px 14px; text-decoration: none; color: var(--jg-text); font-size: 12.5px; font-weight: 600;
    white-space: nowrap; transition: var(--jg-transition); box-shadow: 0 2px 6px rgba(18,64,140,0.05);
}
.jg-subtab-chip:hover { border-color: var(--jg-primary-light); transform: translateY(-2px); }
.jg-subtab-chip.active { border-color: var(--jg-primary); background: rgba(18,64,140,0.08); color: var(--jg-primary); }
.jg-subtab-chip.disabled { opacity: 0.4; pointer-events: none; }
.jg-bottom-nav-spacer { height: 66px; }
.jg-ajax-tabs-loading { opacity: 0.5; pointer-events: none; transition: opacity 0.15s ease; }

/* نوار تب پایین معلم (۷ تب) — کوچک‌تر و کمی بلندتر تا بدون اسکرول افقی جا شود
   و برچسب‌های دوخطی (مثل «گفتگو» / «دانش‌آموزان») به‌خوبی نمایش داده شوند */
.jg-bottom-nav-7 { padding: 6px 2px calc(6px + env(safe-area-inset-bottom)); }
.jg-bottom-nav-7 .jg-bottom-nav-item { flex: 1; min-width: 0; font-size: 9px; padding: 5px 1px; gap: 2px; border-radius: 10px; }
.jg-bottom-nav-7 .jg-bn-icon { font-size: 16px; }
.jg-bottom-nav-7 .jg-bn-label { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.jg-bottom-nav-7 .jg-bn-label-line { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jg-bottom-nav-7 .jg-bottom-nav-item.active { transform: translateY(-2px); }
.jg-bottom-nav-spacer-7 { height: 76px; }

.jg-bottom-nav-8 { padding: 5px 1px calc(5px + env(safe-area-inset-bottom)); }
.jg-bottom-nav-8 .jg-bottom-nav-item { flex: 1; min-width: 0; font-size: 8.5px; padding: 4px 1px; gap: 1px; border-radius: 9px; }
.jg-bottom-nav-8 .jg-bn-icon { font-size: 15px; }
.jg-bottom-nav-8 .jg-bn-label { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.jg-bottom-nav-8 .jg-bn-label-line { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jg-bottom-nav-8 .jg-bottom-nav-item.active { transform: translateY(-2px); }
.jg-bottom-nav-spacer-8 { height: 74px; }

/* ========== منویِ کشوییِ مشترکِ ناوبری (جایگزینِ نوارِ افقیِ پایین) ========== */
.jg-nav-fab {
    position: fixed; bottom: 18px; right: 18px; width: 46px; height: 46px; z-index: 60;
    border-radius: 50%; border: 1px solid rgba(242,168,12,0.55);
    background: rgba(242,168,12,0.55); backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    box-shadow: 0 6px 20px rgba(209,143,0,0.35), inset 0 1px 0 rgba(255,255,255,0.4);
    display: flex; align-items: center; justify-content: center;
    padding: 0; cursor: pointer; color: #fff; transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.jg-nav-fab svg { width: 20px; height: 20px; }
.jg-nav-fab.open { background: rgba(209,143,0,0.7); border-color: rgba(209,143,0,0.7); }
.jg-nav-backdrop {
    position: fixed; inset: 0; background: rgba(10,20,40,0); pointer-events: none;
    transition: background 0.25s ease; z-index: 58;
}
.jg-nav-backdrop.open { background: rgba(10,20,40,0.38); pointer-events: auto; }
.jg-nav-drawer {
    position: fixed; top: 0; bottom: 0; right: 0; width: 240px; max-width: 78vw; z-index: 59;
    background: linear-gradient(165deg, rgba(255,255,255,0.72), rgba(238,242,248,0.68)), linear-gradient(135deg, rgba(18,64,140,0.10), rgba(242,168,12,0.10));
    backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-left: 1px solid rgba(18,64,140,0.18); border-radius: 20px 0 0 20px;
    box-shadow: -10px 0 34px rgba(18,64,140,0.20);
    transform: translateX(100%); transition: transform 0.32s cubic-bezier(0.16,1,0.3,1);
    overflow-y: auto;
    /* پدینگِ پایین عمداً به‌اندازه‌ی جای دکمه‌ی شناورِ باز/بستنِ منو (jg-nav-fab) + کمی فاصله
       است — وگرنه، چون آن دکمه با z-index بالاتر همیشه رویِ همین گوشه می‌نشیند، آخرین
       آیتمِ منو (وقتی تا ته اسکرول می‌شود) زیرِ خودِ دکمه پنهان می‌ماند. */
    padding: calc(12px + env(safe-area-inset-top)) 0 calc(80px + env(safe-area-inset-bottom));
}
.jg-nav-drawer.open { transform: translateX(0); }
.jg-nav-section-label {
    display: flex; align-items: center; gap: 6px; padding: 8px 18px 3px;
    font-size: 10.5px; font-weight: 700; color: var(--jg-primary-dark); letter-spacing: 0.03em;
}
.jg-nav-section-label::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--jg-accent); flex-shrink: 0; }
.jg-nav-divider { margin: 4px 18px; border-top: 1px solid rgba(18,64,140,0.14); }
.jg-nav-item {
    display: flex; align-items: center; gap: 10px; padding: 7px 18px; font-size: 13px;
    font-weight: 500; color: var(--jg-text); text-decoration: none; position: relative;
    transition: background 0.18s ease, color 0.18s ease;
}
.jg-nav-item:hover { background: rgba(18,64,140,0.08); }
.jg-nav-item.active {
    background: linear-gradient(90deg, rgba(242,168,12,0.16), rgba(242,168,12,0.03));
    color: var(--jg-primary-dark); font-weight: 700;
}
.jg-nav-item.active::before {
    content: ''; position: absolute; right: 0; top: 6px; bottom: 6px; width: 3px;
    border-radius: 3px; background: var(--jg-accent);
}
.jg-nav-item-icon { font-size: 16px; line-height: 1; width: 20px; text-align: center; }

/* ========== دراپ‌داونِ شیشه‌ایِ سفارشی (مثلاً «بخشِ محتوا») — جایگزینِ select بومی، چون
   پیکرِ بومیِ موبایل به CSS صفحه اصلاً توجه نمی‌کند ========== */
.jg-glass-dd-trigger {
    width: 100%; min-width: 64px; box-sizing: border-box;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(18,64,140,0.25);
    background: linear-gradient(135deg, rgba(18,64,140,0.10), rgba(242,168,12,0.10));
    font-family: inherit; font-size: 14px; font-weight: 600; color: var(--jg-primary);
    cursor: pointer; text-align: right; transition: background 0.2s ease;
}
.jg-glass-dd-trigger.open { background: linear-gradient(135deg, rgba(18,64,140,0.16), rgba(242,168,12,0.16)); }
.jg-glass-dd-trigger-label { white-space: nowrap; }
.jg-glass-dd-caret { font-size: 12px; color: var(--jg-accent-dark); transition: transform 0.25s ease; flex-shrink: 0; }
.jg-glass-dd-trigger.open .jg-glass-dd-caret { transform: rotate(180deg); }

.jg-glass-dd-panel {
    position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 51;
    /* ⚠️ چون right:0/left:0 نسبت به عرضِ خودِ wrap محاسبه می‌شه، برای selectهای جمع‌وجورِ
       auto-width (مثلِ فیلترهایِ روز/ماه در دفترِ کلاس) این عرض می‌تونه به‌اندازه‌ی یک رقم
       (مثلاً همون روزِ فعلاً انتخاب‌شده) کوچیک بشه؛ min-width تضمین می‌کنه پنلِ بازشده
       (که گزینه‌های بلندتر مثلِ اسمِ ماه رو نشون می‌ده) هیچ‌وقت جمع نشه — کارِ #۳۲
       ⚠️ باگِ واقعیِ z-index (۱۴۰۵/۰۵/۲۱، گزارشِ تبِ درخواست‌ها با اسکرین‌شاتِ وحید):
       نوارِ بالای صفحه (.jg-topbar) با position:sticky و z-index:50 پشتِ سرِ هم می‌مونه؛
       اگه یه selectِ درست‌زیرِ توپ‌بار (مثلِ فیلترِ همین صفحه) باز بشه و کاربر برایِ دیدنِ
       بقیه‌ی گزینه‌ها صفحه رو اسکرول کنه، توپ‌بار (که ثابت می‌مونه) رویِ نیمه‌ی بالاییِ پنل
       می‌نشست چون z-index (۴۰) کمتر از توپ‌بار (۵۰) بود. حالا ۵۱ (بالایِ توپ‌بار، ولی هنوز
       پایینِ نوارِ ذخیره‌ی چسبان/۵۵ و منویِ پایین/FAB/۶۰). */
    width: max-content; min-width: 100%; max-width: 92vw;
    /* ⚠️ باگِ واقعیِ رندر (۱۴۰۵/۰۵/۲۱، تاییدشده با DevTools رویِ خودِ سیستمِ وحید): با
       backdrop-filter، پنل گاهی دقیقاً همون چیزی که DOM/CSS می‌گفت (open، ارتفاعِ کامل،
       موقعیتِ درست — با console.log مستقیم تاییدشده) رو رویِ صفحه نقاشی نمی‌کرد؛ فقط چند
       گزینه‌ی اول واقعاً paint می‌شدن و بقیه‌ی پنل (که geometry‌اش کاملاً درست بود) خالی/
       نامرئی می‌موند. این یک باگِ شناخته‌شده‌ی ترکیبِ backdrop-filter + transition تویِ
       بعضی مرورگرها/GPUهاست، نه باگِ منطقِ کد. حذف شد و به‌جاش یه پس‌زمینه‌ی تقریباً کاملاً
       مات (بدونِ بلور) گذاشته شد — کمی از جلوه‌ی «شیشه‌ای» کم می‌شه ولی رندرِ صد در صد
       قابلِ‌اعتماد مهم‌تره. */
    background: rgba(255,255,255,0.97);
    border: 1px solid rgba(18,64,140,0.18); border-radius: 14px;
    box-shadow: 0 14px 36px rgba(18,64,140,0.22);
    padding: 6px; max-height: 320px; overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.jg-glass-dd-item span:first-child { white-space: nowrap; }
.jg-glass-dd-panel.open { opacity: 1; visibility: visible; transform: translateY(0); }
.jg-glass-dd-panel.open-up { top: auto; bottom: calc(100% + 6px); transform: translateY(6px); }
.jg-glass-dd-panel.open-up.open { transform: translateY(0); }
.jg-glass-dd-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 500;
    color: var(--jg-text); text-decoration: none; transition: background 0.15s ease;
}
.jg-glass-dd-item:hover { background: rgba(18,64,140,0.08); }
.jg-glass-dd-item.active { background: rgba(242,168,12,0.16); color: var(--jg-primary-dark); font-weight: 700; }
.jg-glass-dd-dot {
    width: 15px; height: 15px; border-radius: 50%; flex-shrink: 0;
    border: 2px solid rgba(18,64,140,0.35); background: transparent; transition: var(--jg-transition);
}
.jg-glass-dd-dot.active { border-color: var(--jg-accent); background: var(--jg-accent); box-shadow: 0 0 0 3px rgba(242,168,12,0.22); }

/* استفاده‌شده توسط assets/js/glass-select.js (تبدیلِ خودکارِ همه‌ی selectها) */
.jg-glass-dd-wrap { position: relative; width: 100%; }
.jg-glass-dd-native {
    position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden;
    pointer-events: none; margin: 0; padding: 0; border: 0;
}
.jg-glass-dd-trigger.disabled { opacity: 0.55; cursor: not-allowed; }

/* ========== یکدست‌سازیِ ظاهرِ همه‌ی فیلدهای متنیِ فرم‌های مدیریتی (کادر/کلاس/دانش‌آموز/
   مالی/محتوا/...) با همون زبانِ بصریِ دراپ‌داونِ شیشه‌ای — با !important چون این فیلدها
   قبلاً استایلِ inline (اولویتِ بالاتر از استایل‌شیت) داشتند ========== */
.jg-field input[type="text"],
.jg-field input[type="tel"],
.jg-field input[type="number"],
.jg-field input[type="password"],
.jg-field input[type="date"],
.jg-field input[type="email"],
.jg-field input[type="search"],
.jg-field textarea,
.jg-search-input {
    background: linear-gradient(135deg, rgba(18,64,140,0.05), rgba(242,168,12,0.05)) !important;
    border: 1px solid rgba(18,64,140,0.22) !important;
    border-radius: 12px !important;
    color: var(--jg-text) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.jg-field input[type="text"]:focus,
.jg-field input[type="tel"]:focus,
.jg-field input[type="number"]:focus,
.jg-field input[type="password"]:focus,
.jg-field input[type="date"]:focus,
.jg-field input[type="email"]:focus,
.jg-field input[type="search"]:focus,
.jg-field textarea:focus,
.jg-search-input:focus {
    outline: none !important;
    border-color: var(--jg-primary) !important;
    box-shadow: 0 0 0 3px rgba(242,168,12,0.18) !important;
    background: rgba(255,255,255,0.85) !important;
}
.jg-field input[readonly] { opacity: 0.7; }

/* بج تعداد پیام خوانده‌نشده کنار نام هر دانش‌آموز/والد (تب‌های خصوصی معلم) */
.jg-unread-pill {
    background: var(--jg-accent); color: #fff; font-size: 10.5px; font-weight: 700;
    border-radius: 10px; padding: 1px 7px; min-width: 18px; text-align: center; flex-shrink: 0;
}

/* ردیف چک‌باکس‌دار برای انتخاب چندگانه‌ی دانش‌آموز/والد جهت ارسال گروهی خصوصی */
.jg-select-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--jg-border); }
.jg-select-row:last-child { border-bottom: none; }
.jg-select-row input[type="checkbox"] { width: 19px; height: 19px; flex-shrink: 0; accent-color: var(--jg-primary); cursor: pointer; }
.jg-select-row .jg-select-row-link { flex: 1; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--jg-text); min-width: 0; }
.jg-select-row .jg-select-row-name { flex: 1; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jg-select-row .jg-select-row-chevron { color: var(--jg-text-muted); flex-shrink: 0; }

/* نوار پایین شناور برای ارسال گروهی، وقتی حداقل یک نفر انتخاب شده باشد */
.jg-bulk-bar {
    position: fixed; right: 0; left: 0; bottom: 76px; z-index: 55;
    background: var(--jg-gradient); color: #fff; padding: 10px 16px;
    display: none; align-items: center; gap: 10px; box-shadow: 0 -4px 16px rgba(18,64,140,0.25);
}
.jg-bulk-bar.open { display: flex; }
.jg-bulk-bar span { font-size: 13px; font-weight: 600; flex-shrink: 0; }
.jg-bulk-bar button { border: none; border-radius: 10px; padding: 8px 16px; font-size: 12.5px; font-family: inherit; font-weight: 700; cursor: pointer; flex-shrink: 0; }
.jg-bulk-bar .jg-bulk-send-btn { background: #fff; color: var(--jg-primary); margin-right: auto; }
.jg-bulk-bar .jg-bulk-cancel-btn { background: rgba(255,255,255,0.2); color: #fff; }

/* پنجره‌ی ترکیبِ ارسال گروهی (بازِ همان الگوی forward-modal) */
.jg-bulk-compose-box { display: flex; flex-direction: column; gap: 10px; }
.jg-bulk-compose-box textarea {
    width: 100%; min-height: 90px; padding: 12px; border-radius: 12px; border: 1.5px solid var(--jg-border);
    font-family: inherit; font-size: 14px; background: var(--jg-surface-2); color: var(--jg-text); resize: vertical; box-sizing: border-box;
}
.jg-bulk-compose-box .jg-bulk-recipients { font-size: 12px; color: var(--jg-text-muted); }

/* مودال ارسال گروهی خصوصی (تب‌های خصوصی معلم) — این صفحه chat.css را لود نمی‌کند،
   پس استایل مودال باید همین‌جا در style.css کامل تعریف شود */
.jg-forward-modal { position: fixed; inset: 0; background: rgba(10,20,40,0.5); display: none; align-items: flex-end; justify-content: center; z-index: 90; }
.jg-forward-modal.open { display: flex; animation: jg-fade 0.15s ease; }
.jg-forward-sheet {
    background:
        radial-gradient(circle at 12% 0%, rgba(242,168,12,0.16) 0%, transparent 45%),
        radial-gradient(circle at 100% 15%, rgba(18,64,140,0.14) 0%, transparent 50%),
        linear-gradient(165deg, rgba(255,255,255,0.85), rgba(238,242,248,0.8));
    backdrop-filter: blur(28px) saturate(200%); -webkit-backdrop-filter: blur(28px) saturate(200%);
    border: 1px solid rgba(255,255,255,0.55); border-bottom: none;
    border-radius: 26px 26px 0 0; width: 100%; max-width: 480px;
    box-shadow: 0 -14px 44px rgba(18,64,140,0.28); box-sizing: border-box;
    min-height: 72vh; max-height: 94vh; display: flex; flex-direction: column; overflow: hidden;
}
.jg-forward-sheet h4 { margin: 0; padding: 18px 18px 12px; font-size: 14.5px; text-align: center; flex-shrink: 0; color: var(--jg-primary-dark); }
.jg-forward-sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 18px 20px; flex: 1 1 auto; min-height: 0; }
.jg-forward-sheet-footer { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid rgba(18,64,140,0.14); flex-shrink: 0; }
.jg-forward-sheet-footer > button { flex: 1; margin: 0; width: auto; }
.jg-forward-cancel { display: block; text-align: center; text-decoration: none; border: 1.5px solid var(--jg-border); background: none; color: var(--jg-danger); padding: 12px; font-size: 13.5px; cursor: pointer; font-family: inherit; border-radius: var(--jg-radius-sm); }

/* ========== دیالوگ‌های طراحی‌شده (جایگزین alert/confirm/prompt پیش‌فرض مرورگر) ========== */
.jg-dialog-overlay {
    position: fixed; inset: 0; background: rgba(10,20,40,0.5); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center; z-index: 200;
    opacity: 0; pointer-events: none; transition: opacity 0.18s ease; padding: 20px; box-sizing: border-box;
}
.jg-dialog-overlay.open { opacity: 1; pointer-events: auto; }
.jg-dialog-box {
    background: #fff; border-radius: var(--jg-radius-lg); padding: 24px 20px 20px; width: 100%; max-width: 340px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3); transform: translateY(14px) scale(0.97); transition: transform 0.18s ease;
    text-align: center; box-sizing: border-box;
}
.jg-dialog-overlay.open .jg-dialog-box { transform: translateY(0) scale(1); }
.jg-dialog-icon { font-size: 30px; margin-bottom: 8px; line-height: 1; }
.jg-dialog-msg { font-size: 14px; color: var(--jg-text); line-height: 1.8; margin-bottom: 16px; white-space: pre-wrap; }
.jg-dialog-label { display: block; font-size: 12px; color: var(--jg-text-muted); margin-bottom: 6px; text-align: right; }
.jg-dialog-input, .jg-dialog-select, textarea.jg-dialog-input {
    width: 100%; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--jg-border);
    font-family: inherit; font-size: 14px; background: var(--jg-surface-2); color: var(--jg-text);
    margin-bottom: 14px; box-sizing: border-box; resize: vertical;
}
.jg-dialog-input:focus, .jg-dialog-select:focus, textarea.jg-dialog-input:focus { outline: none; border-color: var(--jg-primary); background: #fff; }
/* دیالوگ‌هایِ کوتاه (alert/confirm/prompt) اسکرول نمی‌خورند، پس sticky برایشان کافی است
   و ریسکی ندارد. برایِ دیالوگ‌هایِ بلند/اسکرول‌شونده (مثلِ فرمِ فروشگاه)، override پایین‌تر
   (.jg-shop-modal-box) این را به position:fixed تغییر می‌دهد — چون jg-dialog-box همیشه
   transform دارد (برایِ انیمیشنِ باز/بسته‌شدن)، و sticky داخلِ والدِ transform‌دار در
   بعضی مرورگرها اصلاً نمی‌چسبد. */
.jg-dialog-actions { display: flex; gap: 10px; position: sticky; bottom: 0; background: #fff; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--jg-border); }
.jg-dialog-btn { flex: 1; border: none; border-radius: 12px; padding: 11px; font-size: 13.5px; font-weight: 700; font-family: inherit; cursor: pointer; transition: var(--jg-transition); }
.jg-dialog-btn-primary { background: var(--jg-gradient); color: #fff; box-shadow: 0 4px 14px rgba(18,64,140,0.3); }
.jg-dialog-btn-primary:hover { transform: translateY(-1px); }
.jg-dialog-btn-danger { background: var(--jg-danger); color: #fff; box-shadow: 0 4px 14px rgba(229,72,77,0.3); }
.jg-dialog-btn-danger:hover { transform: translateY(-1px); }
.jg-dialog-btn-ghost { background: var(--jg-surface-2); color: var(--jg-text); }
.jg-dialog-btn-ghost:hover { background: #e8edf5; }

/* توست کوتاه خودمحوشونده (جایگزین alert برای پیام‌های موفقیت/خطای سریع) */
.jg-toast {
    position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #262f3d; color: #fff; padding: 12px 20px; border-radius: 14px; font-size: 13px; font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25); z-index: 210; opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease; max-width: 88%; text-align: center;
}
.jg-toast.open { opacity: 1; transform: translateX(-50%) translateY(0); }
.jg-toast-success { background: #1d7a4c; }
.jg-toast-error { background: #b3392f; }

/* ========== ویجت اخبار/آموزش (فاز ۴، اصلاح‌شده) — بخش‌های رنگیِ جدا زیرِ هم، هرکدام لیستِ
   ردیفی با آیکونِ گرد سمت چپ؛ دقیقاً مطابق نمونه‌ی ارسالی ========== */
.jg-news-section { background: var(--jg-surface); border-radius: var(--jg-radius); padding: 12px; margin-bottom: 14px; box-shadow: var(--jg-shadow); border: 1px solid var(--jg-border); border-right: 4px solid var(--jg-news-color, var(--jg-primary)); }
.jg-news-section-header { display: inline-block; background: var(--jg-news-color, var(--jg-primary)); color: #fff; font-size: 12.5px; font-weight: 700; padding: 5px 16px; border-radius: 20px; margin-bottom: 10px; }
.jg-news-section-list { display: flex; flex-direction: column; gap: 8px; }
.jg-news-section-list.jg-news-scrolls { max-height: 260px; overflow-y: auto; padding-left: 2px; }
.jg-news-row { display: flex; align-items: center; gap: 10px; border: none; background: var(--jg-surface-2); border-radius: 12px; padding: 8px 10px; cursor: pointer; text-align: right; font-family: inherit; transition: var(--jg-transition); width: 100%; box-sizing: border-box; }
.jg-news-row:hover { background: #e8edf5; }
.jg-news-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.jg-news-row-title { font-size: 13px; font-weight: 700; color: var(--jg-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jg-news-row-sub { font-size: 11px; color: var(--jg-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jg-news-row-icon { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; background: var(--jg-news-color, var(--jg-primary)); color: #fff; }
.jg-news-row-icon-photo { object-fit: cover; background: #fff; }

/* پاپ‌آپِ خوانایی خبر — گسترش‌یافته‌ی .jg-dialog-box پایه، برای تجربه‌ی خواندن راحت‌تر */
.jg-news-reader-overlay .jg-dialog-box { max-width: 480px; max-height: 82vh; overflow-y: auto; text-align: right; padding: 0 0 20px; }
.jg-news-reader-img { width: 100%; display: block; border-radius: var(--jg-radius-lg) var(--jg-radius-lg) 0 0; max-height: 220px; object-fit: cover; margin-bottom: 14px; }
.jg-news-reader-cat { font-size: 11.5px; color: var(--jg-primary); font-weight: 700; margin: 0 20px 6px; }
.jg-news-reader-title { font-size: 17px; font-weight: 800; color: var(--jg-text); margin: 0 20px 12px; line-height: 1.6; }
.jg-news-reader-body { font-size: 14px; color: var(--jg-text); line-height: 2; margin: 0 20px; white-space: pre-wrap; }
.jg-news-reader-meta { font-size: 11.5px; color: var(--jg-text-muted); margin: 14px 20px 0; }
.jg-news-reader-overlay .jg-dialog-actions { margin: 0 20px !important; }

/* دکمه‌ی ایموجی عمومی که با jgAttachEmojiPicker کنار هر فیلد متنی گذاشته می‌شود */
.jg-emoji-inline-btn {
    position: absolute; top: 8px; left: 6px; border: none; background: none; font-size: 18px;
    cursor: pointer; z-index: 2; padding: 2px; line-height: 1;
}
.jg-emoji-inline-panel {
    display: none; position: absolute; top: 100%; left: 0; margin-top: 4px; z-index: 60;
    background: #fff; border: 1px solid var(--jg-border); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    padding: 8px; max-height: 180px; overflow-y: auto; width: 260px;
    grid-template-columns: repeat(7, 1fr);
}
.jg-emoji-inline-panel.open { display: grid; animation: jg-fade 0.12s ease; }
.jg-emoji-inline-panel button { border: none; background: none; font-size: 19px; cursor: pointer; padding: 4px; border-radius: 6px; }
.jg-emoji-inline-panel button:hover { background: var(--jg-surface-2); }

/* ========== ردیف جمع‌وجور حساب کاربری (بالای تب خانه) ========== */
.jg-account-row { display: flex; gap: 8px; margin-bottom: 14px; }
.jg-account-chip {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--jg-surface); border: 1.5px solid var(--jg-border); border-radius: 14px;
    padding: 10px 8px; text-decoration: none; color: var(--jg-text); font-size: 12px; font-weight: 600;
    transition: var(--jg-transition); box-shadow: 0 2px 6px rgba(18,64,140,0.05);
}
.jg-account-chip:hover { border-color: var(--jg-primary-light); transform: translateY(-2px); }
.jg-account-chip.accent { border-color: rgba(242,168,12,0.4); color: var(--jg-accent-dark); }

/* ========== بنر مدرسه/کلاس ========== */
.jg-banner-wrap { border-radius: var(--jg-radius-lg); overflow: hidden; margin-bottom: 16px; box-shadow: var(--jg-shadow-lg); position: relative; }
.jg-banner-wrap img { width: 100%; display: block; aspect-ratio: 16/7; object-fit: cover; }
.jg-banner-scroll { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--jg-radius-lg); margin-bottom: 16px; box-shadow: var(--jg-shadow-lg); }
.jg-banner-scroll::-webkit-scrollbar { display: none; }
.jg-banner-scroll img { flex: 0 0 100%; scroll-snap-align: start; width: 100%; aspect-ratio: 16/7; object-fit: cover; }

/* اسلایدشوِ خودکارِ بنر — وقتی بیش از یک بنرِ فعال باشد (جایگزینِ jg-banner-scroll) */
.jg-banner-slideshow { position: relative; border-radius: var(--jg-radius-lg); overflow: hidden; margin-bottom: 16px; box-shadow: var(--jg-shadow-lg); aspect-ratio: 16/7; }
.jg-banner-slideshow .jg-banner-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.9s ease; }
.jg-banner-slideshow .jg-banner-slide.jg-active { opacity: 1; }
.jg-banner-slideshow .jg-banner-slide img { width: 100%; height: 100%; display: block; object-fit: cover; }
.jg-banner-slideshow .jg-banner-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; z-index: 2; }
.jg-banner-slideshow .jg-banner-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.55); box-shadow: 0 0 3px rgba(0,0,0,0.3); transition: var(--jg-transition); cursor: pointer; }
.jg-banner-slideshow .jg-banner-dot.jg-active { background: #fff; width: 18px; border-radius: 5px; }

/* ========== پیام فوری ========== */
.jg-urgent-box {
    background: linear-gradient(135deg, #fff6e5, #fffaf0); border: 1.5px solid rgba(242,168,12,0.35);
    border-radius: var(--jg-radius); padding: 16px 18px; margin-bottom: 16px; position: relative;
    animation: jg-fade 0.4s ease;
}
.jg-urgent-box::before { content: '📣'; position: absolute; top: -12px; right: 16px; background: var(--jg-gradient-accent); width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; box-shadow: 0 4px 12px rgba(242,168,12,0.4); }
.jg-urgent-box h4 { margin: 4px 0 6px; color: var(--jg-accent-dark); font-size: 14px; }
.jg-urgent-box p { margin: 0; font-size: 13px; color: var(--jg-text); }

/* ========== بخش‌های تب خانه/کلاس ========== */
.jg-section-title { font-size: 13px; font-weight: 700; color: var(--jg-text-muted); margin: 20px 0 10px; padding-right: 4px; display: flex; align-items: center; gap: 6px; }
.jg-content-card { background: var(--jg-surface); border-radius: var(--jg-radius); padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--jg-shadow); border: 1px solid var(--jg-border); animation: jg-fade 0.4s ease; }
.jg-content-card.motivational { background: linear-gradient(135deg, rgba(18,64,140,0.05), rgba(242,168,12,0.05)); border-color: rgba(18,64,140,0.15); }
.jg-content-card.motivational::before { content: '💡'; margin-left: 6px; }
.jg-content-card h4 { margin: 0 0 6px; font-size: 14.5px; }
.jg-content-card p { font-size: 13px; margin: 0 0 8px; line-height: 1.7; }
.jg-content-card p a, .jg-board-card p a, .jg-urgent-box p a, .jg-targeted-notice-card p a { color: var(--jg-primary); font-weight: 600; word-break: break-all; text-decoration: underline; text-decoration-color: rgba(18,64,140,0.35); }
.jg-content-card p a:hover, .jg-board-card p a:hover, .jg-urgent-box p a:hover, .jg-targeted-notice-card p a:hover { color: var(--jg-primary-dark); }
.jg-content-card .jg-content-meta { font-size: 11px; color: var(--jg-text-muted); margin-top: 8px; }
.jg-content-card img { max-width: 100%; border-radius: 12px; margin-top: 6px; }
.jg-school-info-card { background: rgba(18,64,140,0.04); border-color: rgba(18,64,140,0.15); }
.jg-school-info-card p { display: flex; gap: 6px; align-items: flex-start; }

/* ========== راهنمای آپلود (پنل ادمین) ========== */
.jg-upload-guide { background: #f0f5fc; border: 1px dashed var(--jg-primary-light); border-radius: 12px; padding: 10px 14px; font-size: 12px; color: var(--jg-primary-dark); margin: 6px 0 14px; line-height: 1.8; }
.jg-kind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 8px; margin-bottom: 4px; }
.jg-kind-option { display: flex; align-items: center; gap: 6px; border: 1.5px solid var(--jg-border); border-radius: 12px; padding: 10px 12px; cursor: pointer; font-size: 12.5px; transition: var(--jg-transition); }
.jg-kind-option:has(input:checked) { border-color: var(--jg-primary); background: rgba(18,64,140,0.06); }
.jg-class-checklist { max-height: 220px; overflow-y: auto; border: 1.5px solid var(--jg-border); border-radius: 12px; padding: 10px 14px; }
.jg-class-checklist label { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }

/* ========== بنر نصب اپ (PWA) ========== */
.jg-pwa-banner {
    position: fixed; left: 12px; right: 12px; bottom: -140px; z-index: 200;
    transition: bottom 0.35s cubic-bezier(.2,.9,.3,1);
    max-width: 460px; margin: 0 auto;
}
.jg-pwa-banner.open { bottom: 14px; }
.jg-pwa-card {
    background: #fff; border-radius: 18px; padding: 14px 16px; display: flex; align-items: center; gap: 12px;
    box-shadow: 0 10px 34px rgba(10,30,70,0.22); border: 1px solid rgba(18,64,140,0.08); position: relative;
}
.jg-pwa-icon { width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; box-shadow: 0 3px 10px rgba(18,64,140,0.25); }
.jg-pwa-text { flex: 1; min-width: 0; }
.jg-pwa-title { font-size: 13.5px; font-weight: 700; color: var(--jg-text); margin-bottom: 2px; }
.jg-pwa-desc { font-size: 11.5px; color: var(--jg-text-muted); line-height: 1.6; display: flex; align-items: center; flex-wrap: wrap; gap: 3px; }
.jg-pwa-share-icon { display: inline-flex; color: var(--jg-primary); }
.jg-pwa-install-btn {
    border: none; background: var(--jg-gradient); color: #fff; font-family: inherit; font-weight: 700; font-size: 13px;
    padding: 9px 18px; border-radius: 12px; cursor: pointer; flex-shrink: 0; box-shadow: 0 3px 10px rgba(18,64,140,0.3);
}
.jg-pwa-install-btn:hover { transform: translateY(-1px); }
.jg-pwa-close {
    position: absolute; top: -8px; left: -8px; width: 24px; height: 24px; border-radius: 50%;
    background: #fff; border: 1px solid var(--jg-border); color: #778; font-size: 11px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* تب «سال تحصیلی» و مشابه — دکمه‌ی + حالا ثابت (fixed) گوشه‌ی پایین‌سمت‌چپ است، در همه‌ی
   تب‌هایی که ازش استفاده می‌کنند (سال/کلاس جدید/کادر/دانش‌آموز/مالی/...) همیشه یک‌جا و
   قابل‌مشاهده می‌ماند، حتی موقعِ اسکرول */
.jg-card-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.jg-card-header-row h3 { margin: 0; }
.jg-fab-add {
    position: fixed; bottom: 18px; left: 18px; z-index: 60;
    width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.5);
    background: rgba(18,64,140,0.62); backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    color: #fff; font-size: 26px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer;
    box-shadow: 0 6px 20px rgba(18,64,140,0.45), inset 0 1px 0 rgba(255,255,255,0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease; flex-shrink: 0;
}
.jg-fab-add:hover { transform: scale(1.07) rotate(90deg); background: rgba(10,42,94,0.72); box-shadow: 0 8px 24px rgba(18,64,140,0.55); }
.jg-fab-add:active { transform: scale(0.94) rotate(90deg); }

/* دکمه‌ی شناورِ «بازگشت به جستجو» — وسطِ پایینِ صفحه، عمداً دور از FABِ منو (راست) و
   FABِ + (چپ) تا تداخلی نداشته باشه؛ فقط بعدِ یه جهش از رویِ جستجو ظاهر می‌شه. */
.jg-fin-back-to-search-btn {
    position: fixed; bottom: 20px; left: 50%; z-index: 59;
    width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.75);
    background: var(--jg-gradient);
    color: #fff; font-size: 19px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 8px 22px rgba(18,64,140,0.42), inset 0 1px 0 rgba(255,255,255,0.35);
    opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(16px) scale(0.85);
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}
.jg-fin-back-to-search-btn.show { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0) scale(1); }
.jg-fin-back-to-search-btn:hover { box-shadow: 0 10px 26px rgba(18,64,140,0.55); transform: translateX(-50%) translateY(-3px) scale(1.06); }
.jg-fin-back-to-search-btn:active { transform: translateX(-50%) translateY(0) scale(0.95); }

.jg-year-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 14px; border-radius: 14px; background: var(--jg-surface-2); margin-bottom: 10px;
    border: 1px solid var(--jg-border); transition: var(--jg-transition);
}
.jg-year-item:last-child { margin-bottom: 0; }
.jg-year-item.active {
    background: linear-gradient(135deg, rgba(18,64,140,0.07), rgba(46,158,108,0.09));
    border-color: var(--jg-primary);
}
.jg-year-item-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.jg-year-icon { font-size: 22px; flex-shrink: 0; }
.jg-year-title { font-size: 15px; font-weight: 700; color: var(--jg-text); }
.jg-year-active-badge {
    font-size: 10.5px; font-weight: 700; color: #1d7a4c; background: #e3f6ea;
    padding: 2px 9px; border-radius: 8px; display: inline-block; margin-top: 4px;
}
.jg-year-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* کارتِ دانش‌آموز در فهرست: به‌جایِ کنارِ هم‌چپاندنِ نام/کلاس/دکمه‌ها در یک ردیفِ شلوغ،
   سه ردیفِ جدا — نام، اطلاعاتِ کلاس، دکمه‌ها — که هرکدوم جا برایِ نفس‌کشیدن دارن. */
.jg-student-card { flex-direction: column; align-items: stretch; gap: 10px; }
.jg-student-card .jg-year-item-main { align-items: flex-start; }
.jg-student-card .jg-year-title { display: block; margin-bottom: 4px; }
.jg-student-card .jg-year-active-badge { margin-top: 0; }
.jg-student-card .jg-year-actions { flex-wrap: wrap; justify-content: flex-start; }
.jg-year-btn {
    width: 36px; height: 36px; border-radius: 50%; border: none; background: #fff; cursor: pointer;
    font-size: 15px; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1); transition: var(--jg-transition); text-decoration: none;
}
.jg-year-btn:hover { transform: scale(1.1); }
.jg-year-btn-activate { color: var(--jg-accent); }
.jg-year-edit-btn { color: var(--jg-primary); }
.jg-year-delete-btn { color: var(--jg-danger); }

/* دکمه‌ی «انتخاب و برش عکس» عمومی برای فرم‌های پروفایل (photo-picker.js) */
.jg-photo-picker-wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.jg-photo-picker-preview { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--jg-border); flex-shrink: 0; }

/* عکس پروفایل واقعی در لیست کادر (به‌جای ایموجیِ پیش‌فرض، وقتی عکسی تعیین شده باشد) */
.jg-year-avatar-photo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1.5px solid var(--jg-border); }

/* لیستِ دسترسی‌های معاون/مدیر (چک‌باکس‌های راست‌چین، زیرِ هم، با زیرپنل‌های تودرتو) */
.jg-perm-list { display: flex; flex-direction: column; gap: 8px; }
.jg-perm-item {
    display: flex; flex-direction: row-reverse; align-items: center; justify-content: flex-end;
    gap: 10px; padding: 11px 14px; border: 1.5px solid var(--jg-border); border-radius: 12px;
    background: var(--jg-surface-2); cursor: pointer; font-size: 13.5px; text-align: right;
    transition: var(--jg-transition);
}
.jg-perm-item:has(input:checked) { border-color: var(--jg-primary); background: rgba(18,64,140,0.06); }
.jg-perm-item input { flex-shrink: 0; width: 18px; height: 18px; accent-color: var(--jg-primary); }
.jg-perm-item span { flex: 1; }
.jg-perm-subpanel {
    display: flex; flex-direction: column; gap: 6px; margin: -2px 0 4px;
    padding: 10px 14px; border-radius: 12px; background: rgba(18,64,140,0.04);
    border: 1px dashed var(--jg-border);
}
.jg-perm-subitem {
    display: flex; flex-direction: row-reverse; align-items: center; justify-content: flex-end;
    gap: 9px; font-size: 12.5px; text-align: right; cursor: pointer; padding: 4px 2px;
}
.jg-perm-subitem input { flex-shrink: 0; width: 16px; height: 16px; accent-color: var(--jg-primary); }
.jg-perm-subitem span { flex: 1; }
.jg-perm-subpanel-title { font-size: 11.5px; font-weight: 700; color: var(--jg-text-muted); margin-bottom: 2px; text-align: right; }

/* تب‌های ریزتر فرم دانش‌آموز/خانواده (برای اینکه با چند فرزند اسکرول افقی نخورد) */
.jg-subtab-chip-sm { padding: 6px 10px; font-size: 11.5px; }

/* باکس پیشنهادهای سرچ زنده در تب دانش‌آموز */
.jg-suggest-box {
    position: absolute; top: 100%; right: 0; left: 0; z-index: 40; margin-top: 4px;
    background: #fff; border: 1px solid var(--jg-border); border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12); max-height: 240px; overflow-y: auto;
}
.jg-suggest-item { padding: 10px 14px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--jg-border); }
.jg-suggest-item:last-child { border-bottom: none; }
.jg-suggest-item:hover { background: var(--jg-surface-2); }

/* تعریفِ واقعیِ .jg-flash-highlight/.jg-flash-fading پایین‌ترِ همین فایل است — این‌جا
   فقط radius را برای این المان‌ها نگه می‌داریم تا با نسخه‌ی قدیمی هماهنگ بماند. */
.jg-flash-highlight { border-radius: 14px; }

/* بلوکِ فیلدهای هر فرزند در فرم پاپ‌آپ دانش‌آموز */
.jg-fs-remove-child-btn { border: none; background: none; color: var(--jg-danger); font-size: 12px; cursor: pointer; margin-bottom: 14px; padding: 0; }

/* بج شماره‌های موبایلِ موجود در فرم دانش‌آموز (با دکمه‌ی ویرایش/حذف) */
.jg-fs-phone-badge { display: inline-flex; align-items: center; gap: 4px; }
.jg-fs-phone-icon-btn { border: none; background: none; cursor: pointer; font-size: 12px; padding: 2px 3px; }

/* اطمینان از فاصله‌ی تبِ خانواده/فرزندان از دیواره (به‌صورت !important تا هیچ استایلِ
   دیگری رویش override نکند و در همه‌ی نسخه‌ها قطعی اعمال شود) */
#jg-fs-tab-family, #jg-fs-student-blocks {
    padding-right: 22px !important;
    box-sizing: border-box !important;
}

/* ردیفِ تب‌های «خانواده/فرزندان» داخل پاپ‌آپ فرم دانش‌آموز — این ردیف بیرون از
   .jg-forward-sheet-body است، پس پدینگِ آن را ارث نمی‌برد و باید جدا اضافه شود
   (این دقیقاً همان چیزی بود که هیچ‌وقت درست نشده بود). */
.jg-fs-tabs-row {
    padding: 0 18px !important;
    box-sizing: border-box !important;
}

/* ============================================================================
   روکشِ آپلود — لودرِ سراسریِ همه‌ی فرم‌های آپلود (assets/js/upload-progress.js)

   کلِ صفحه را می‌پوشاند تا کاربر وسطِ آپلود چیزِ دیگری را نزند، و سه چیز را روشن
   نشان می‌دهد: چه چیزی در حال رفتن است، چند درصد رفته، و کِی تمام شد.
   ============================================================================ */
.jg-uploading {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(16, 22, 34, 0.72);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    display: none; align-items: center; justify-content: center; padding: 24px;
}
.jg-uploading.show { display: flex; }

.jg-uploading-card {
    background: var(--jg-surface); border-radius: var(--jg-radius-lg);
    padding: 26px 22px; width: 100%; max-width: 300px; text-align: center;
    box-shadow: var(--jg-shadow-lg); animation: jg-rise 0.3s cubic-bezier(0.2,0.8,0.2,1);
}

.jg-uploading-ring { position: relative; width: 88px; height: 88px; margin: 0 auto 14px; }
.jg-uploading-ring svg { width: 88px; height: 88px; transform: rotate(-90deg); }
.jg-uploading-ring circle { fill: none; stroke-width: 4; }
.jg-uploading-ring-bg { stroke: var(--jg-border); }
.jg-uploading-ring-fill {
    stroke: var(--jg-primary); stroke-linecap: round;
    transition: stroke-dashoffset 0.2s linear;
}
.jg-uploading-percent {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 19px; font-weight: 700; color: var(--jg-primary); font-variant-numeric: tabular-nums;
}

.jg-uploading-title { font-size: 14.5px; font-weight: 700; color: var(--jg-text); margin-bottom: 5px; }
.jg-uploading-sub {
    font-size: 11.5px; color: var(--jg-text-muted); margin-bottom: 14px;
    word-break: break-word; line-height: 1.7;
}

.jg-uploading-track { height: 6px; border-radius: 4px; background: var(--jg-surface-2); overflow: hidden; }
.jg-uploading-fill { height: 100%; width: 0; background: var(--jg-gradient); border-radius: 4px; transition: width 0.15s linear; }

.jg-uploading-cancel {
    margin-top: 16px; border: none; background: var(--jg-surface-2); color: var(--jg-text-muted);
    border-radius: 10px; padding: 9px 20px; font-family: inherit; font-size: 12.5px; cursor: pointer;
}
.jg-uploading-cancel:hover { background: #eceff5; color: var(--jg-danger); }

/* ============================================================================
   انتخابگرِ فایلِ استاندارد — جایگزینِ input[type=file] خامِ مرورگر، برایِ همه‌جایِ اپ که
   فایل/عکس/فیلم می‌گیرد. متن فارسی، شکلِ یکسان همه‌جا. با assets/js/upload-progress.js
   تداخلی ندارد (همون input واقعیه، فقط پوسته‌اش عوض شده).
   استفاده: <label class="jg-file-drop"><input type="file" class="jg-file-drop-input" ...>
             <span class="jg-file-drop-icon">📎</span>
             <span class="jg-file-drop-text">برایِ افزودنِ عکس/فیلم/سند اینجا بزنید</span>
             <span class="jg-file-drop-filename"></span></label>
   و یک خط جاوااسکریپت که رویِ change کلاسِ has-file و متنِ نامِ فایل را ست کند. */
.jg-file-drop {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    border: 2px dashed var(--jg-border); border-radius: 14px; padding: 18px 14px; cursor: pointer;
    background: var(--jg-surface-2); transition: var(--jg-transition); text-align: center;
}
.jg-file-drop:hover { border-color: var(--jg-primary); background: rgba(18,64,140,0.05); }
/* بدونِ top/right صریح، مرورگر (خصوصاً در RTL) این اینپوتِ ۱ پیکسلی را سرِ جایِ
   استاتیکِ عرضِ طبیعی‌اش (که برایِ input[type=file] می‌تواند خیلی عریض‌تر باشد) قرار
   می‌دهد و از سمتِ چپِ صفحه بیرون می‌زند — همان باگِ واقعیِ اسکرولِ افقیِ کل صفحه در
   هر جایی که این کامپوننت هست (محتوایِ کلاس، کتابخانه، پرونده‌ی اسنادِ دانش‌آموز، ...) */
.jg-file-drop-input { position: absolute; top: 0; right: 0; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.jg-file-drop-icon { font-size: 24px; line-height: 1; }
.jg-file-drop-text { font-size: 12px; color: var(--jg-text-muted); }
.jg-file-drop-filename { font-size: 12.5px; font-weight: 700; color: var(--jg-primary); display: none; word-break: break-all; }
.jg-file-drop.has-file { border-style: solid; border-color: var(--jg-primary); background: rgba(18,64,140,0.05); }
.jg-file-drop.has-file .jg-file-drop-text { display: none; }
.jg-file-drop.has-file .jg-file-drop-filename { display: block; }

/* ============================================================================
   اتوکامپلیتِ سه‌حرفیِ مشترک (assets/js/autocomplete.js) — برایِ هر <input class="jg-autocomplete"
   data-suggest-url="..."> در سراسرِ اپ. */
.jg-ac-wrap { position: relative; }
.jg-ac-panel {
    position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 45;
    background: rgba(255,255,255,0.85); backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(18,64,140,0.18); border-radius: 14px;
    box-shadow: 0 14px 36px rgba(18,64,140,0.22);
    padding: 6px; max-height: 280px; overflow-y: auto;
    display: none;
}
.jg-ac-panel.open { display: block; }
.jg-ac-group-label {
    font-size: 10.5px; font-weight: 700; color: var(--jg-text-muted); padding: 6px 10px 4px;
}
.jg-ac-item {
    padding: 9px 12px; border-radius: 10px; font-size: 13px; color: var(--jg-text);
    cursor: pointer; text-align: right; transition: background 0.12s ease;
}
.jg-ac-item:hover, .jg-ac-item.active { background: rgba(18,64,140,0.08); }

/* نوارِ جستجویِ عمومی (هرجا یه <input class="jg-autocomplete"> بالایِ یه لیست لازمه) */
.jg-search-bar { margin-bottom: 14px; }
.jg-search-bar input.jg-autocomplete {
    width: 100%; box-sizing: border-box; padding: 11px 14px; border-radius: 12px;
    border: 1px solid var(--jg-border); font-family: inherit; font-size: 14px;
}
/* هایلایتِ چندثانیه‌ایِ رکوردی که از رویِ جستجو انتخاب شده — jgFlashHighlight() در financial.js */
/* ⚠️ باگِ رفع‌شده: قبلاً این هایلایت یه انیمیشنِ کوتاهِ محو-شونده بود (۱.۶ ثانیه) که
   اغلب تا لحظه‌ی نگاه‌کردنِ واقعیِ کاربر (بعدِ اسکرولِ smooth) از قبل محو شده بود. الان
   رنگ فوراً و *ثابت* اعمال می‌شه (بدونِ انیمیشن)، و فقط وقتی JS کلاسِ jg-flash-fading
   رو (چند ثانیه بعد) اضافه کنه، با یه ترنزیشنِ نرم محو می‌شه. */
.jg-flash-highlight {
    background: rgba(18,64,140,0.16);
    border-radius: 10px;
    transition: background 1.1s ease;
}
.jg-flash-highlight.jg-flash-fading { background: transparent; }

/* ============================================================================
   نوارِ نازکِ بارگذاری (assets/js/page-loader.js) — برایِ تعویضِ تب، منو، و ثبتِ
   فرم‌هایی که روکشِ کاملِ آپلود ندارند. عمداً سبک و بی‌سروصداست، نه یه overlay دیگه. */
#jg-page-loader-bar {
    position: fixed; top: 0; right: 0; left: 0; height: 3px; width: 0;
    background: linear-gradient(90deg, var(--jg-accent), var(--jg-primary-light), var(--jg-accent));
    background-size: 200% 100%; animation: jg-loader-shimmer 1.2s linear infinite;
    z-index: 500; opacity: 0; box-shadow: 0 0 8px rgba(242,168,12,0.6);
    pointer-events: none;
}
#jg-page-loader-bar.active { opacity: 1; }
@keyframes jg-loader-shimmer { from { background-position: 0 0; } to { background-position: -200% 0; } }

/* اسپینرِ رویِ خودِ لینک/دکمه‌ای که زده شده — تا مشخص باشه دقیقاً کدوم کلیک در حالِ اجراست */
.jg-loading-link, .jg-loading-btn { position: relative; pointer-events: none; }
.jg-loading-link { opacity: 0.55; }
.jg-loading-btn { color: transparent !important; }
.jg-loading-link::after, .jg-loading-btn::after {
    content: ''; position: absolute; top: 50%; right: 50%; transform: translate(50%, -50%);
    width: 16px; height: 16px; border-radius: 50%;
    border: 2.5px solid rgba(255,255,255,0.55); border-top-color: #fff;
    animation: jg-loader-spin 0.7s linear infinite;
}
/* دکمه‌های کم‌رنگ/شیشه‌ای معمولاً پس‌زمینه‌ی روشن دارند؛ اسپینرِ سفید روشون دیده نمی‌شه */
.jg-loading-link::after { border-color: rgba(18,64,140,0.25); border-top-color: var(--jg-primary); }
.jg-btn-sm.jg-loading-btn::after,
.jg-uploading-cancel.jg-loading-btn::after { border-color: rgba(18,64,140,0.25); border-top-color: var(--jg-primary); }
@keyframes jg-loader-spin { to { transform: translate(50%, -50%) rotate(360deg); } }

/* ============================================================================
   سندِ واریزیِ تراکنش‌های مالی (includes/finance_receipts.php)
   ============================================================================ */
.jg-receipt-row {
    display: flex; align-items: center; gap: 7px; margin-top: 6px;
    font-size: 10.5px; color: var(--jg-text-muted);
}
.jg-receipt-thumb {
    width: 34px; height: 34px; flex-shrink: 0; border-radius: 8px; overflow: hidden;
    border: 1px solid var(--jg-border); background: var(--jg-surface-2);
    display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none; font-size: 15px;
}
.jg-receipt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jg-receipt-thumb.pdf { color: var(--jg-primary); }

/* در فرمِ تراکنش، سندِ فعلی بزرگ‌تر نشان داده می‌شود چون کاربر باید بتواند تشخیصش بدهد */
#jg-fin-receipt-current .jg-receipt-thumb { width: 54px; height: 54px; border-radius: 10px; }

/* ============================================================================
   حساب‌هایِ بانکی + دکمه/مودالِ مشترکِ «پرداخت» — includes/bank_accounts.php،
   includes/payment_requests.php، assets/js/payment_widget.js
   ============================================================================ */
.jg-bank-accounts-block { margin-bottom: 4px; }
.jg-bank-account-card {
    background: var(--jg-surface-2); border: 1px solid var(--jg-border); border-radius: 12px;
    padding: 12px 14px; margin-bottom: 8px; font-size: 12.5px;
}
.jg-bank-account-name { font-weight: 800; color: var(--jg-primary); margin-bottom: 2px; }
.jg-bank-account-holder { color: var(--jg-text-muted); font-size: 11.5px; margin-bottom: 6px; }
.jg-bank-account-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 4px 0; border-top: 1px dashed var(--jg-border); font-size: 12px;
}
.jg-bank-account-row:first-of-type { border-top: none; }
.jg-bank-account-row b { direction: ltr; font-family: inherit; letter-spacing: 0.5px; }
.jg-bank-account-value { display: inline-flex; align-items: center; gap: 6px; direction: ltr; }
.jg-copy-btn {
    border: none; background: none; cursor: pointer; font-size: 12px; line-height: 1;
    padding: 2px 4px; border-radius: 6px; color: var(--jg-primary); opacity: 0.75;
}
.jg-copy-btn:hover, .jg-copy-btn:active { opacity: 1; background: var(--jg-surface-2); }
.jg-copy-btn.copied { color: var(--jg-success, #1d7a4c); opacity: 1; }

.jg-pay-trigger-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 16px; border-radius: 12px; border: none; cursor: pointer;
    background: var(--jg-gradient); color: #fff; font-family: inherit; font-size: 13px; font-weight: 700;
}
.jg-pay-trigger-btn:active { transform: scale(0.97); }

/* ============================================================================
   روشِ پرداخت (نقدی/چک) — includes/finance_checks.php
   ============================================================================ */
.jg-check-details {
    margin-top: 6px; padding: 8px 10px; border-radius: 10px;
    background: var(--jg-surface-2); border: 1px dashed var(--jg-border);
    font-size: 11px; color: var(--jg-text-muted); line-height: 1.9;
}
.jg-check-details strong { color: var(--jg-text); font-size: 11.5px; }

@media print { .jg-no-print { display: none !important; } }

/* ============================================================================
   بنرِ تبریکِ تولد — بالایِ بنرِ مدرسه (includes/calendar.php, includes/home_content.php)
   ============================================================================ */
.jg-cal-birthday-banner {
    background: linear-gradient(135deg, #e91e8c, #ff6fa8);
    color: #fff; border-radius: 18px; padding: 14px 16px; margin-bottom: 12px;
    text-align: center; box-shadow: 0 8px 24px rgba(233,30,140,0.28);
    animation: jg-cal-birthday-pop 0.6s ease;
}
.jg-cal-birthday-banner .emoji { font-size: 26px; }
.jg-cal-birthday-banner .msg { font-size: 14px; font-weight: 700; margin-top: 4px; }
@keyframes jg-cal-birthday-pop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* بنرِ بزرگِ تبریکِ «امروز» در پنلِ شخصی (panels/profile.php) — jg_calendar_my_birthday_today_html */
.jg-profile-birthday-hero {
    background: linear-gradient(120deg, #ff6fa8, #ffb457, #ff6fa8);
    background-size: 200% 200%;
    color: #fff; border-radius: 22px; padding: 22px 18px; margin-bottom: 16px;
    text-align: center; box-shadow: 0 12px 32px rgba(233,30,140,0.32);
    animation: jg-cal-birthday-pop 0.6s ease, jg-birthday-hero-shine 4s ease infinite;
}
.jg-profile-birthday-hero .emoji { font-size: 40px; letter-spacing: 4px; }
.jg-profile-birthday-hero .msg { font-size: 18px; font-weight: 800; margin-top: 8px; }
@keyframes jg-birthday-hero-shine { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* کارتِ مشخصاتِ چک (تاریخچه‌یِ حقوقِ کادر) */
.jg-check-card { margin-top: 10px; border: 1px solid var(--jg-border, #d6dde8); border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #f4f8fd, #eaf1fb); }
.jg-check-card-head { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; font-size: 12.5px; font-weight: 700; background: rgba(13, 48, 112, .07); color: var(--jg-primary); }
.jg-check-card-body { display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 12px; align-items: flex-start; }
.jg-check-card-rows { flex: 1 1 200px; min-width: 0; }
.jg-check-card-rows > div { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 12.5px; border-bottom: 1px dashed rgba(0, 0, 0, .08); }
.jg-check-card-rows > div > span { color: var(--jg-text-muted); }
.jg-check-card-rows > div > strong { text-align: left; }
.jg-check-card-amount { border-bottom: 0 !important; padding-top: 8px !important; font-size: 14px !important; }
.jg-check-card-photo { position: relative; display: block; flex: 0 0 150px; max-width: 100%; border-radius: 8px; overflow: hidden; border: 1px solid var(--jg-border, #d6dde8); background: #fff; }
.jg-check-card-photo img { display: block; width: 100%; height: auto; max-height: 110px; object-fit: cover; }
.jg-check-card-photo span { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; font-size: 11px; padding: 3px; color: #fff; background: rgba(13, 48, 112, .75); }
.jg-check-card-photo.pdf { padding: 14px; text-align: center; font-size: 12.5px; color: var(--jg-primary); }

/* ========== ردیفِ «تخفیفِ توافقیِ شهریه» در دفترهایِ مالیِ خانواده (۱۴۰۵/۰۷/۱۹) ========== */
.jg-tx-discount { background:#fff7e0 !important; border-right:4px solid #f59e0b; }
tr.jg-tx-discount td:first-child { border-right:4px solid #f59e0b; }
.jg-tx-discount-chip { display:inline-block; font-size:10.5px; font-weight:700; color:#92400e; background:#fde68a; border-radius:999px; padding:1px 8px; margin-inline-start:6px; white-space:nowrap; }
@media print { .jg-tx-discount { background:#fff7e0 !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; } }
