/* Shell Layout V2 — theme tokens, chrome, collapse, accordion */

/* Disable transitions during theme switch / first paint */
.preload,
.preload * {
    transition: none !important;
    animation: none !important;
}

.overflow-y-auto {
    -webkit-overflow-scrolling: touch;
}

:root {
    --sidebar-w: 260px;
    --nav-h: 70px;

    --c-primary: #4f46e5;
    --c-success: #059669;
    --c-danger: #e11d48;
    --c-warning: #d97706;
    --c-info: #0284c7;
    --c-violet: #7c3aed;
    --c-fab: #4f46e5;
}

[data-theme="light"] {
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-panel: rgba(255, 255, 255, 0.85);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-main: #e2e8f0;
    --border-dash: #cbd5e1;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02), 0 4px 12px rgba(0, 0, 0, 0.03);
    --shadow-card: 0 4px 6px rgba(0, 0, 0, 0.02), 0 10px 24px rgba(0, 0, 0, 0.04), 0 20px 40px rgba(0, 0, 0, 0.02);

    --bg-primary-soft: #e0e7ff;
    --bg-success-soft: #d1fae5;
    --bg-warning-soft: #fef3c7;
    --bg-danger-soft: #ffe4e6;
    --bg-info-soft: #e0f2fe;
    --bg-violet-soft: #ede9fe;
    --bg-slate-soft: #f1f5f9;

    --step-glow: rgba(79, 70, 229, 0.2);
}

[data-theme="dark"] {
    --bg-body: #090e17;
    --bg-card: #111827;
    --bg-panel: rgba(17, 24, 39, 0.85);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-main: rgba(255, 255, 255, 0.08);
    --border-dash: rgba(255, 255, 255, 0.15);

    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.5);

    --bg-primary-soft: rgba(99, 102, 241, 0.15);
    --bg-success-soft: rgba(16, 185, 129, 0.15);
    --bg-warning-soft: rgba(245, 158, 11, 0.15);
    --bg-danger-soft: rgba(244, 63, 94, 0.15);
    --bg-info-soft: rgba(14, 165, 233, 0.15);
    --bg-violet-soft: rgba(139, 92, 246, 0.15);
    --bg-slate-soft: rgba(255, 255, 255, 0.05);

    --c-primary: #818cf8;
    --c-success: #34d399;
    --c-danger: #fb7185;
    --c-warning: #fbbf24;
    --c-info: #38bdf8;
    --c-violet: #a78bfa;

    --step-glow: rgba(129, 140, 248, 0.25);
}

body.shell-layout-body {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    transition: 0.3s;
    overflow-x: hidden;
}

html.sng-tw-overlay-open,
html.sng-tw-overlay-open body {
    overflow: hidden !important;
    overscroll-behavior: none;
}

/* Chrome geometry matches Sobhani/New UI/student-panel-tailwind.html.
   Do not rely on Tailwind `hidden` + `lg:flex` (vendor CSS after
   tailwind.generated.css can win that cascade). Invalid utilities like
   px-4.5 are also pinned here. */
.mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    padding: 0 1rem;
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1030;
    border-bottom: 1px solid var(--border-main);
    box-sizing: border-box;
}
.mobile-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    right: 1.25rem;
    height: var(--nav-h);
    padding: 0 1rem;
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-main);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    z-index: 1040;
    box-sizing: border-box;
}
#sidebar {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--sidebar-w);
    padding: 30px;
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 1px solid var(--border-main);
    z-index: 1040;
    box-sizing: border-box;
    overflow: visible;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.shell-page-header {
    display: none;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--border-main);
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
}
#content {
    max-width: 1400px;
    margin-left: auto;
    min-height: 100vh;
    padding: 90px 15px 2rem;
    box-sizing: border-box;
    transition: margin-right 0.35s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
#content.is-quick-nav {
    padding-bottom: 130px;
}
@media (min-width: 768px) {
    #content {
        padding-left: 30px;
        padding-right: 30px;
    }
}
@media (min-width: 1024px) {
    .mobile-header,
    .mobile-bottom-nav {
        display: none;
    }
    #sidebar {
        display: flex;
    }
    .shell-page-header {
        display: flex;
    }
    #content,
    #content.is-quick-nav {
        margin-right: var(--sidebar-w);
        padding-top: 30px;
        padding-bottom: 2rem;
    }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(150, 150, 150, 0.3); border-radius: 10px; }

/* Legacy spinner markup is commented out in _LayoutV2; ajax overlay is .reg-loading below. */

.glass-sidebar {
    background-color: #ffffff !important;
    border-left: 1px solid var(--border-main) !important;
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.08) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
[data-theme="dark"] .glass-sidebar {
    background-color: #111827 !important;
    border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.4) !important;
}

.glass-modal {
    background-color: #ffffff !important;
    border: 1px solid var(--border-main) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.12) !important;
}
[data-theme="dark"] .glass-modal {
    background-color: #111827 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45) !important;
}

.btn-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: var(--shadow-sm);
}
.btn-action-icon:hover {
    background: var(--bg-primary-soft);
    color: var(--c-primary);
    border-color: var(--c-primary);
}
.badge-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: var(--c-danger);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

/* Desktop sidebar collapse */
html.sidebar-collapsed #sidebar {
    transform: translateX(calc(100% + 16px));
    pointer-events: none;
}
html.sidebar-collapsed .sidebar-collapse-btn {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
html.sidebar-collapsed #content {
    margin-right: 0 !important;
    margin-left: 0 !important;
    max-width: none !important;
    width: 100%;
}
.sidebar-collapse-btn {
    position: absolute;
    top: 28px;
    left: -14px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    color: var(--c-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    z-index: 5;
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}
.sidebar-collapse-btn:hover {
    transform: scale(1.08);
    background: var(--bg-primary-soft);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.18);
}
.sidebar-collapse-btn i {
    font-size: 0.85rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-collapse-btn:hover i {
    transform: translateX(2px);
}

.sidebar-expand-tab {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%) translateX(100%);
    z-index: 1042;
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 72px;
    border-radius: 14px 0 0 14px;
    background: var(--c-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: -6px 0 24px rgba(79, 70, 229, 0.35);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
    opacity: 0;
    pointer-events: none;
}
.sidebar-expand-tab:hover {
    box-shadow: -8px 0 28px rgba(79, 70, 229, 0.45);
    width: 40px;
}
.sidebar-expand-tab i {
    font-size: 1.1rem;
    animation: expandPulse 1.8s ease-in-out infinite;
}
@keyframes expandPulse {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-3px); }
}
@media (min-width: 1024px) {
    .sidebar-expand-tab { display: flex; }
    html.sidebar-collapsed .sidebar-expand-tab {
        transform: translateY(-50%) translateX(0);
        opacity: 1;
        pointer-events: auto;
    }
}

#sidebar .user-pro {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 2rem;
    padding: 0.75rem;
    border-radius: 1rem;
    background: var(--bg-body);
    border: 1px solid var(--border-main);
    box-sizing: border-box;
}
#sidebar .user-avatar {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 14px;
    flex-shrink: 0;
}
#sidebar .side-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
}
#sidebar .side-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}
.side-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1.125rem;
    color: var(--text-muted);
    border-radius: 1rem;
    font-weight: 700;
    transition: all 0.15s;
    text-decoration: none;
    width: 100%;
    text-align: right;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    box-sizing: border-box;
}
.side-link:hover {
    color: var(--text-main);
    background: var(--bg-body);
}
.side-link i {
    font-size: 1.25rem;
    flex-shrink: 0;
}
.side-link.active {
    color: var(--c-primary) !important;
    background: var(--bg-primary-soft);
}
#sidebar .btn-logout {
    display: block;
    text-decoration: none;
    box-sizing: border-box;
}
#themeToggleDesk {
    width: auto;
    flex-grow: 1;
    font-size: 0.75rem;
    font-weight: 700;
    padding-left: 1rem;
    padding-right: 1rem;
    white-space: nowrap;
}

.f-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    width: 3rem;
    height: 100%;
    gap: 0.25rem;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}
.f-nav-item:active,
.f-nav-item.active {
    color: var(--c-primary) !important;
}
.tab-fab-wrapper {
    position: relative;
    width: 60px;
    height: 100%;
    display: flex;
    justify-content: center;
}
.tab-fab {
    position: absolute;
    top: -1.25rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 999px;
    background: var(--c-fab);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--bg-body);
    box-shadow: var(--shadow-sm);
    font-size: 1.25rem;
    text-decoration: none;
}

/* Notices */
.n-card {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 16px;
    padding: 16px 15px 16px 20px;
    display: flex;
    gap: 15px;
    align-items: center;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: 0.3s;
    text-decoration: none !important;
    overflow: hidden;
}
.n-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.n-card::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 0 4px 4px 0;
}
.n-danger::before { background: var(--c-danger); }
.n-danger .n-icon-box { background: var(--bg-danger-soft); color: var(--c-danger); }
.n-warning::before { background: var(--c-warning); }
.n-warning .n-icon-box { background: var(--bg-warning-soft); color: var(--c-warning); }
.n-info::before { background: var(--c-info); }
.n-info .n-icon-box { background: var(--bg-info-soft); color: var(--c-info); }
.n-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.n-content { flex-grow: 1; display: flex; flex-direction: column; text-align: right; min-width: 0; }
.n-content-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 4px; width: 100%; }
.n-title { font-weight: 800; font-size: 0.9rem; color: var(--text-main); margin: 0; line-height: 1.4; }
.n-left-wrap { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.n-date {
    font-size: 0.65rem;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 700;
    background: var(--bg-slate-soft);
    color: var(--text-muted);
    border: 1px solid var(--border-main);
}
.n-content p { font-size: 0.75rem; margin: 0; color: var(--text-muted); font-weight: 600; line-height: 1.6; }
.n-chevron { font-size: 1.2rem; color: var(--border-dash); transition: 0.3s; flex-shrink: 0; }
.n-card:hover .n-chevron { transform: translateX(-5px); color: var(--text-muted); }

/* 2-level accordion — max-height (reliable inside overflow:auto drawers) */
.submenu-transition {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}
.submenu-transition.open {
    max-height: 1200px;
    opacity: 1;
}
.submenu-transition > .submenu-inner {
    overflow: hidden;
}
.sidebar-parent-item .submenu-chevron {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-parent-item.is-open .submenu-chevron {
    transform: rotate(180deg);
}
.sidebar-parent-item.is-open {
    color: var(--c-primary) !important;
    background: var(--bg-primary-soft) !important;
    border-right: 4px solid var(--c-primary);
}
#advancedMenuContainer .sidebar-parent-item {
    text-align: right;
}
#advancedMenuContainer .submenu-link {
    position: relative;
    border-right: 2px solid transparent;
}
#advancedMenuContainer .submenu-link:hover {
    border-right-color: var(--c-primary);
}

.hide-scrollbar::-webkit-scrollbar { display: none !important; }
.hide-scrollbar {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

/* ========== Shared reg toast + loading (LayoutV2) ========== */
.reg-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 18px 40px -16px rgba(15, 23, 42, 0.28);
    border: 1px solid transparent;
    animation: regToastIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.reg-toast.is-leaving { animation: regToastOut 0.28s ease forwards; }
.reg-toast-success {
    background: rgba(236, 253, 245, 0.92);
    border-color: rgba(16, 185, 129, 0.35);
    color: #065f46;
}
.dark .reg-toast-success,
[data-theme="dark"] .reg-toast-success {
    background: rgba(6, 78, 59, 0.88);
    border-color: rgba(52, 211, 153, 0.35);
    color: #a7f3d0;
}
.reg-toast-error {
    background: rgba(255, 241, 242, 0.94);
    border-color: rgba(244, 63, 94, 0.35);
    color: #9f1239;
}
.dark .reg-toast-error,
[data-theme="dark"] .reg-toast-error {
    background: rgba(76, 5, 25, 0.9);
    border-color: rgba(251, 113, 133, 0.35);
    color: #fecdd3;
}
.reg-toast-warning {
    background: rgba(255, 251, 235, 0.94);
    border-color: rgba(245, 158, 11, 0.4);
    color: #92400e;
}
.dark .reg-toast-warning,
[data-theme="dark"] .reg-toast-warning {
    background: rgba(69, 26, 3, 0.9);
    border-color: rgba(251, 191, 36, 0.35);
    color: #fde68a;
}
.reg-toast-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}
.reg-toast-success .reg-toast-icon { background: rgba(16, 185, 129, 0.15); color: #059669; }
.dark .reg-toast-success .reg-toast-icon,
[data-theme="dark"] .reg-toast-success .reg-toast-icon { background: rgba(16, 185, 129, 0.25); color: #6ee7b7; }
.reg-toast-error .reg-toast-icon { background: rgba(244, 63, 94, 0.12); color: #e11d48; }
.dark .reg-toast-error .reg-toast-icon,
[data-theme="dark"] .reg-toast-error .reg-toast-icon { background: rgba(244, 63, 94, 0.25); color: #fda4af; }
.reg-toast-warning .reg-toast-icon { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.dark .reg-toast-warning .reg-toast-icon,
[data-theme="dark"] .reg-toast-warning .reg-toast-icon { background: rgba(245, 158, 11, 0.25); color: #fcd34d; }
.reg-toast-body {
    flex: 1;
    min-width: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.6;
}
.reg-toast-close {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.5rem;
    display: grid;
    place-items: center;
    opacity: 0.55;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
}
.reg-toast-close:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }
.dark .reg-toast-close:hover,
[data-theme="dark"] .reg-toast-close:hover { background: rgba(255, 255, 255, 0.08); }
@keyframes regToastIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes regToastOut {
    to { opacity: 0; transform: translateY(-8px) scale(0.96); }
}

.reg-loading {
    position: fixed;
    inset: 0;
    z-index: 1250;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}
.reg-loading.is-visible {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto;
}
.reg-loading-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.dark .reg-loading-backdrop,
[data-theme="dark"] .reg-loading-backdrop { background: rgba(2, 6, 23, 0.84); }
.reg-loading-card {
    position: relative;
    z-index: 1;
    width: min(22rem, 100%);
    padding: 2rem 1.75rem 1.75rem;
    border-radius: 1.75rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow:
        0 24px 48px -20px rgba(15, 23, 42, 0.35),
        0 0 0 1px rgba(139, 92, 246, 0.08);
    transform: translateY(10px) scale(0.96);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.reg-loading.is-visible .reg-loading-card { transform: translateY(0) scale(1); }
.dark .reg-loading-card,
[data-theme="dark"] .reg-loading-card {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(51, 65, 85, 0.8);
}
.reg-loading-orbit {
    position: relative;
    width: 5.5rem;
    height: 5.5rem;
    margin: 0 auto 1.25rem;
}
.reg-loading-taxi {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 1rem;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    color: #0f172a;
    background: linear-gradient(145deg, #ffd45a, #ffb800);
    box-shadow: 0 10px 24px -8px rgba(255, 184, 0, 0.55);
    animation: regTaxiPulse 1.6s ease-in-out infinite;
}
.reg-loading-dot {
    position: absolute;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: #8b5cf6;
    top: 50%;
    left: 50%;
    margin: -0.275rem;
    animation: regOrbitSpin 1.4s linear infinite;
}
.reg-loading-dot.d1 { --orbit-delay: 0s; --orbit-color: #8b5cf6; background: var(--orbit-color); }
.reg-loading-dot.d2 { --orbit-delay: -0.46s; --orbit-color: #38bdf8; background: var(--orbit-color); animation-delay: var(--orbit-delay); }
.reg-loading-dot.d3 { --orbit-delay: -0.92s; --orbit-color: #fb7185; background: var(--orbit-color); animation-delay: var(--orbit-delay); }
.reg-loading-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 900;
    color: #0f172a;
}
.dark .reg-loading-title,
[data-theme="dark"] .reg-loading-title { color: #f8fafc; }
.reg-loading-sub {
    margin: 0.4rem 0 1.15rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
}
.reg-loading-bar {
    position: relative;
    display: block;
    width: 100%;
    height: 0.35rem;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.25);
    direction: ltr; /* keep indeterminate bar L→R even on RTL pages */
}
.reg-loading-bar span {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    height: 100%;
    width: 40%;
    border-radius: inherit;
    background: linear-gradient(90deg, #8b5cf6, #38bdf8, #ffb800);
    animation: regBarSlide 1.15s ease-in-out infinite;
}
@keyframes regTaxiPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}
@keyframes regOrbitSpin {
    from { transform: rotate(0deg) translateX(2.35rem) rotate(0deg); }
    to { transform: rotate(360deg) translateX(2.35rem) rotate(-360deg); }
}
@keyframes regBarSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(250%); } /* 100% / 0.4 width → fully exits right */
}

/* Tailwind overlay dialog: header/footer stay visible; only the body scrolls.
   Never combine items-center + overflow-y-auto on the overlay — mobile clips the header. */
.sng-tw-modal-overlay {
    overflow: hidden;
    overscroll-behavior: contain;
}
.sng-tw-modal-sheet {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: min(90vh, calc(100dvh - 1.5rem));
    overflow: hidden;
}
.sng-tw-modal-head,
.sng-tw-modal-foot {
    flex-shrink: 0;
}
.sng-tw-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.sng-tw-modal-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.sng-tw-modal-form .clientside-validation-summary:not(:has(.field-validation-error)) {
    display: none !important;
}

/* Segmented radios (NewDesign nationality track). Input must be the previous sibling of its label. */
.sng-tw-radio-seg {
    display: flex;
    position: relative;
    background: var(--bg-body);
    border: 1px solid var(--border-main);
    border-radius: 1rem;
    padding: 0.375rem;
    gap: 0.15rem;
}
.sng-tw-radio-seg > input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.sng-tw-radio-seg > label {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 0.75rem 0.5rem;
    font-weight: 900;
    font-size: 0.75rem;
    line-height: 1.4;
    cursor: pointer;
    border-radius: 0.75rem;
    color: var(--text-muted);
    transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
}
.sng-tw-radio-seg > input[type="radio"]:checked + label {
    background: var(--bg-primary-soft);
    color: var(--c-primary);
    box-shadow: var(--shadow-sm);
}
.sng-tw-radio-seg > input[type="radio"]:focus-visible + label {
    outline: 2px solid var(--c-primary);
    outline-offset: 2px;
}
.sng-tw-radio-seg.is-stack {
    flex-direction: column;
}
.sng-tw-modal-form .field-validation-error {
    color: var(--c-danger);
    font-size: 11px;
    font-weight: 700;
}
.sng-tw-modal-form .input-validation-error {
    border-color: var(--c-danger);
}
.sng-tw-radio-seg:has(.input-validation-error) {
    border-color: var(--c-danger);
}
.sng-tw-radio-seg.is-stack > label {
    text-align: right;
    padding: 0.75rem 1rem;
}

/* Select2 on LayoutV2: native-like inputs. Kit pages override in sng-kit-controls.css.
   fillSelect2 uses theme default on shell-layout-body (not bootstrap-5). */
body.shell-layout-body .select2-container,
body.shell-layout-body .select2-container--bootstrap-5,
body.shell-layout-body .select2-container--default {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}
    body.shell-layout-body .select2-container .select2-selection--single,
    body.shell-layout-body .select2-container--bootstrap-5 .select2-selection--single {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        box-sizing: border-box !important;
        height: 2.75rem !important;
        min-height: 2.75rem !important;
        padding: 0 0.75rem 0 2.5rem !important;
        border-radius: 0.75rem !important;
        /*border: 1px solid var(--border-main) !important;*/
        border: 1px solid rgba(189, 0, 255, 0.35) !important;
        background-color: var(--bg-body) !important;
        background-image: none !important;
        box-shadow: none !important;
        outline: none !important;
        cursor: pointer !important;
        font-family: inherit !important;
        transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    }
body.shell-layout-body .select2-container .select2-selection--single::after {
    content: "";
    position: absolute;
    left: 0.95rem;
    top: 50%;
    width: 0.42rem;
    height: 0.42rem;
    margin-top: -0.28rem;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease, border-color 0.15s ease;
    pointer-events: none;
}
body.shell-layout-body .select2-container:not(.select2-container--disabled):not(.select2-container--open) .select2-selection--single:hover {
    border-color: var(--c-primary) !important;
}
body.shell-layout-body .select2-container--focus .select2-selection--single,
body.shell-layout-body .select2-container--open .select2-selection--single,
body.shell-layout-body .select2-container--bootstrap-5.select2-container--focus .select2-selection--single,
body.shell-layout-body .select2-container--bootstrap-5.select2-container--open .select2-selection--single {
    border-color: var(--c-primary) !important;
    box-shadow: 0 0 0 3px var(--bg-primary-soft) !important;
}
body.shell-layout-body .select2-container--open .select2-selection--single::after {
    margin-top: -0.08rem;
    border-color: var(--c-primary);
    transform: rotate(225deg);
}
body.shell-layout-body .select2-container--disabled .select2-selection--single {
    opacity: 0.72;
    cursor: not-allowed !important;
    background-color: var(--bg-slate-soft) !important;
}
body.shell-layout-body .select2-selection--single .select2-selection__rendered {
    padding: 0 !important;
    line-height: 1.4 !important;
    text-align: right !important;
    color: var(--text-main) !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
}
body.shell-layout-body .select2-selection--single .select2-selection__placeholder {
    color: var(--text-muted) !important;
    font-weight: 600 !important;
}
body.shell-layout-body .select2-selection--single .select2-selection__arrow {
    display: none !important;
}
body.shell-layout-body .select2-selection--single .select2-selection__clear {
    left: 2.15rem;
    right: auto;
    margin: 0;
    color: var(--text-muted);
    font-weight: 700;
}
body.shell-layout-body select.input-validation-error + .select2-container .select2-selection--single {
    border-color: var(--c-danger) !important;
    box-shadow: 0 0 0 3px var(--bg-danger-soft) !important;
}

body.shell-layout-body .select2-dropdown,
body.shell-layout-body .select2-container--bootstrap-5 .select2-dropdown,
body.shell-layout-body .select2-container--default .select2-dropdown {
    z-index: 1120;
    margin-top: 0.4rem;
    overflow: hidden;
    border-radius: 0.85rem !important;
    border: 1px solid var(--border-main) !important;
    background: var(--bg-card) !important;
    box-shadow: var(--shadow-card);
    color: var(--text-main);
    direction: rtl;
    font-family: inherit;
}
body.shell-layout-body .select2-dropdown.select2-dropdown--above {
    margin-top: 0;
    margin-bottom: 0.4rem;
}
body.shell-layout-body .select2-dropdown .select2-search {
    padding: 0.6rem 0.65rem 0.35rem !important;
}
body.shell-layout-body .select2-dropdown .select2-search .select2-search__field {
    height: 2.5rem !important;
    padding: 0 0.75rem !important;
    border-radius: 0.65rem !important;
    border: 1px solid var(--border-main) !important;
    background: var(--bg-body) !important;
    font-family: inherit !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
body.shell-layout-body .select2-dropdown .select2-search .select2-search__field:focus {
    border-color: var(--c-primary) !important;
    box-shadow: 0 0 0 3px var(--bg-primary-soft) !important;
}
body.shell-layout-body .select2-results__options {
    height: auto !important;
    max-height: 14rem !important;
    overflow-y: auto !important;
    padding: 0.25rem 0.35rem 0.45rem !important;
}
body.shell-layout-body .select2-results__option {
    margin: 0.1rem 0;
    padding: 0.55rem 0.75rem !important;
    border-radius: 0.55rem !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    color: var(--text-main) !important;
    background: transparent !important;
    transition: background-color 0.12s ease, color 0.12s ease;
}
body.shell-layout-body .select2-results__option--highlighted,
body.shell-layout-body .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--bg-primary-soft) !important;
    color: var(--c-primary) !important;
}
body.shell-layout-body .select2-results__option--selected,
body.shell-layout-body .select2-results__option[aria-selected="true"]:not(.select2-results__option--highlighted) {
    background: var(--bg-slate-soft) !important;
    color: var(--text-main) !important;
}
body.shell-layout-body .select2-results__message {
    padding: 0.7rem 0.85rem !important;
    color: var(--text-muted) !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
}

/* کارت هشدار آرشیو/داشبورد دانش‌آموز — روی Track هم لازم است */
.spv2-ncard {
    background: var(--bg-card);
    border: 1px solid var(--border-main);
    border-radius: 16px;
    padding: 16px 15px 16px 20px;
    display: flex;
    gap: 15px;
    align-items: center;
    position: relative;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    cursor: pointer;
    margin-bottom: 0.75rem;
}
.spv2-ncard:hover { box-shadow: var(--shadow-card); }
.spv2-ncard::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 0 4px 4px 0;
}
.spv2-ncard.n-danger::before { background: var(--c-danger); }
.spv2-ncard.n-warning::before { background: var(--c-warning); }
.spv2-ncard.n-info::before { background: var(--c-info); }
.spv2-nicon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.spv2-ncard.n-danger .spv2-nicon { background: var(--bg-danger-soft); color: var(--c-danger); }
.spv2-ncard.n-warning .spv2-nicon { background: var(--bg-warning-soft); color: var(--c-warning); }
.spv2-ncard.n-info .spv2-nicon { background: var(--bg-info-soft); color: var(--c-info); }
.spv2-n-chevron { font-size: 1.2rem; color: var(--border-dash); flex-shrink: 0; }

/* Finance canvas — sticky quick actions (allowed only) */
.spv2-fin-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
    gap: 0.5rem;
}
.spv2-fin-quick-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.65rem 0.35rem;
    border-radius: 1rem;
    border: 1px solid var(--border-main);
    background: var(--bg-body);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.25s ease;
}
.spv2-fin-quick-tile:hover {
    border-color: color-mix(in srgb, var(--c-primary) 45%, transparent);
    background: var(--bg-primary-soft);
    transform: translateY(-1px);
}
.spv2-fin-quick-tile:active { transform: scale(0.97); }
.spv2-fin-quick-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: var(--c-primary);
    background: var(--bg-primary-soft);
}
.spv2-fin-quick-label {
    font-size: 0.65rem;
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
}
html[data-theme="dark"] .spv2-fin-quick-tile {
    background: rgba(10, 11, 28, 0.45);
    border-color: rgba(0, 229, 255, 0.22);
}
html[data-theme="dark"] .spv2-fin-quick-tile:hover {
    border-color: rgba(0, 229, 255, 0.45);
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.18);
}
html[data-theme="dark"] .spv2-fin-quick-icon {
    color: #00e5ff;
    background: rgba(0, 229, 255, 0.12);
}

/* Kit chrome (Controls): assets/css/sng-kit-controls.css */
