/* =========================================================
   حساب‌یار سراج – Design System (Central Theme)
   ---------------------------------------------------------
   ⚠️ برای تغییر رنگ یا فونت کل سایت فقط همین فایل را ویرایش کنید.
   ========================================================= */

/* ---------- 1) Font (تنها نقطه تغییر فونت) ---------- */
/* فونت پیش‌فرض: Yekan — برای تغییر کافیست همین یک خط عوض شود */
@import url('<?= MY_URL ?>assets/css/font.css');

:root {
    --font-main: 'Yekan Bakh', 'Yekan', 'IRANSans', Tahoma, sans-serif;

    /* =========================================================
       2) Colors – Light (پالت آبی فولادی، ملایم و مناسب مدرسه)
       ========================================================= */
    --c-primary-50:  #f2f6fc;
    --c-primary-100: #e2ebf6;
    --c-primary-200: #c4d6ec;
    --c-primary-300: #9cb8dc;
    --c-primary-400: #7094c5;
    --c-primary-500: #4f78ac;
    --c-primary-600: #3d5f8f;   /* ← رنگ اصلی برند */
    --c-primary-700: #2f4a72;
    --c-primary-800: #253a5a;
    --c-primary-900: #1d2d46;

    --c-accent:      #c9a45a;   /* طلایی ملایم برای تأکید */
    --c-accent-soft: #fdf6e6;

    --c-success:     #3f8a6a;
    --c-danger:      #c25a54;
    --c-warning:     #d08a3f;
    --c-info:        #4a86a8;

    /* ---------- Neutrals ---------- */
    --c-bg:          #f4f6fa;
    --c-surface:     #ffffff;
    --c-surface-2:   #f8fafc;
    --c-border:      #e1e6ef;
    --c-border-soft: #eef1f7;

    --c-text:        #1f2a3d;
    --c-text-soft:   #4b5565;
    --c-text-muted:  #8a93a6;
    --c-text-invert: #ffffff;

    /* ---------- Sidebar (light) ---------- */
    --sb-bg-1:       #2f4a72;   /* گرادیان بالا */
    --sb-bg-2:       #1d2d46;   /* گرادیان پایین */
    --sb-text:       #cbd6e6;
    --sb-text-hover: #ffffff;
    --sb-hover-bg:   rgba(255,255,255,.07);
    --sb-active-bg:  rgba(255,255,255,.14);

    /* ---------- Shadows ---------- */
    --shadow-xs: 0 1px 2px rgba(16,24,40,.04);
    --shadow-sm: 0 1px 3px rgba(16,24,40,.07), 0 1px 2px rgba(16,24,40,.04);
    --shadow-md: 0 4px 12px rgba(16,24,40,.07);
    --shadow-lg: 0 12px 28px rgba(16,24,40,.10);
    --shadow-focus: 0 0 0 3px rgba(61,95,143,.18);

    /* ---------- Typography Scale ---------- */
    --fs-xs: 11px;   --fs-sm: 12.5px; --fs-md: 13.5px; --fs-base: 14px;
    --fs-lg: 16px;   --fs-xl: 20px;   --fs-2xl: 26px;

    /* ---------- Radius ---------- */
    --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px;
    --radius-xl: 20px; --radius-pill: 999px;

    /* ---------- Spacing ---------- */
    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
    --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

    /* ---------- Layout ---------- */
    --sidebar-w: 260px;
    --sidebar-w-collapsed: 78px;
    --topbar-h: 64px;

    /* ---------- Transitions ---------- */
    --t-fast: .15s ease;
    --t-base: .25s ease;
    --t-slow: .32s cubic-bezier(.4,0,.2,1);
}

/* =========================================================
   3) Dark Mode
   ========================================================= */
[data-theme="dark"] {
    --c-primary-50:  #1a2438;
    --c-primary-100: #22304a;
    --c-primary-200: #2d3f60;
    --c-primary-500: #6f93c7;
    --c-primary-600: #8aabe0;
    --c-primary-700: #a9c3ec;

    --c-accent-soft: #2a2419;

    --c-bg:          #0f1620;
    --c-surface:     #17202e;
    --c-surface-2:   #1b2534;
    --c-border:      #263143;
    --c-border-soft: #202a3a;

    --c-text:        #e6ecf5;
    --c-text-soft:   #b6c0d1;
    --c-text-muted:  #7f8b9f;
    --c-text-invert: #0f1620;

    --sb-bg-1:       #17202e;
    --sb-bg-2:       #0f1620;
    --sb-text:       #b6c0d1;
    --sb-hover-bg:   rgba(255,255,255,.05);
    --sb-active-bg:  rgba(138,171,224,.15);

    --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
    --shadow-md: 0 4px 14px rgba(0,0,0,.45);
    --shadow-lg: 0 16px 34px rgba(0,0,0,.55);
    --shadow-focus: 0 0 0 3px rgba(138,171,224,.25);

    color-scheme: dark;
}

/* =========================================================
   4) Reset & Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    font-family: var(--font-main);
    font-size: var(--fs-base);
    color: var(--c-text);
    background: var(--c-bg);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    transition: background var(--t-base), color var(--t-base);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-text-muted); }

/* =========================================================
   5) Layout Shell
   ========================================================= */
.app-shell { display: flex; min-height: 100vh; }

.main-content {
    flex: 1;
    margin-right: var(--sidebar-w);
    transition: margin-right var(--t-slow);
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.app-shell.sidebar-collapsed .main-content { margin-right: var(--sidebar-w-collapsed); }

.content-inner {
    padding: var(--sp-6);
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* =========================================================
   6) Sidebar
   ========================================================= */
.sidebar {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--sb-bg-1) 0%, var(--sb-bg-2) 100%);
    color: var(--sb-text);
    padding: var(--sp-4) var(--sp-3);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    transition: width var(--t-slow), transform var(--t-slow);
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.sidebar.collapsed .menu-item span,
.sidebar.collapsed .menu-item .chevron,
.sidebar.collapsed .logout-container span,
.sidebar.collapsed .brand-text { display: none; }
.sidebar.collapsed .menu-item > a { justify-content: center; padding: 11px; }
.sidebar.collapsed .submenu { display: none !important; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: var(--sp-3) 0 var(--sp-5); }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-3) var(--sp-5);
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: var(--sp-3);
    transition: all var(--t-base);
}
.sidebar-brand .brand-logo {
    width: 42px; height: 42px;
    background: var(--c-accent-soft);
    border-radius: var(--radius-md);
    display: grid; place-items: center;
    color: var(--c-primary-700);
    font-size: 20px;
    flex-shrink: 0;
}
.sidebar-brand .brand-text { display: flex; flex-direction: column; line-height: 1.35; white-space: nowrap; }
.sidebar-brand .brand-text strong { color: #fff; font-size: var(--fs-md); font-weight: 700; }
.sidebar-brand .brand-text small  { color: var(--sb-text); font-size: var(--fs-xs); opacity: .8; }

.menu-item > a {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 11px var(--sp-4);
    border-radius: var(--radius-md);
    color: var(--sb-text);
    font-size: var(--fs-md);
    font-weight: 500;
    transition: all var(--t-fast);
    position: relative;
}
.menu-item > a:hover { background: var(--sb-hover-bg); color: var(--sb-text-hover); }
.menu-item > a i:first-child { width: 20px; text-align: center; font-size: 15px; flex-shrink: 0; }
.menu-item > a .chevron { margin-right: auto; font-size: 11px; transition: transform var(--t-base); opacity: .7; }
.menu-item.open > a .chevron { transform: rotate(180deg); }

.menu-item.active > a,
.menu-item > a.active {
    background: var(--sb-active-bg);
    color: #fff;
    box-shadow: inset -3px 0 0 var(--c-accent);
}

.submenu {
    list-style: none;
    margin: var(--sp-1) 0 var(--sp-2);
    padding: 0 var(--sp-6) 0 0;
    display: none;
    flex-direction: column;
    gap: 2px;
}
.menu-item.open .submenu { display: flex; }

.submenu a {
    display: block;
    padding: 8px var(--sp-3);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    color: var(--sb-text);
    transition: all var(--t-fast);
    position: relative;
    white-space: nowrap;
}
.submenu a::before {
    content: '';
    position: absolute;
    right: -14px; top: 50%;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--sb-text);
    opacity: .5;
    transform: translateY(-50%);
    transition: all var(--t-fast);
}
.submenu a:hover { color: #fff; background: var(--sb-hover-bg); }
.submenu a.active { color: #fff; background: var(--sb-active-bg); }
.submenu a.active::before { background: var(--c-accent); opacity: 1; box-shadow: 0 0 0 3px rgba(201,164,90,.25); }

.logout-container { margin-top: auto; padding-top: var(--sp-4); border-top: 1px solid rgba(255,255,255,.08); }
.side-login-btn {
    width: 100%;
    display: flex; align-items: center; justify-content: center;
    gap: var(--sp-2);
    padding: 11px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,.07);
    color: #fff;
    font-size: var(--fs-md);
    font-weight: 500;
    transition: all var(--t-fast);
    white-space: nowrap;
}
.side-login-btn:hover { background: rgba(255,255,255,.15); }

/* =========================================================
   7) Topbar
   ========================================================= */
.topbar {
    position: sticky;
    top: 0;
    z-index: 90;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--sp-6);
    background: color-mix(in srgb, var(--c-surface) 85%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--c-border);
    transition: background var(--t-base);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .topbar { background: var(--c-surface); }
}

.topbar-left    { display: flex; align-items: center; gap: var(--sp-4); }
.topbar-actions { display: flex; align-items: center; gap: var(--sp-3); }

.hamburger-menu {
    width: 38px; height: 38px;
    border-radius: var(--radius-md);
    display: grid; place-items: center;
    color: var(--c-text-soft);
    transition: all var(--t-fast);
}
.hamburger-menu:hover { background: var(--c-primary-50); color: var(--c-primary-600); }

.school-name { display: flex; align-items: center; gap: var(--sp-2); font-weight: 600; font-size: var(--fs-md); }
.school-name .school-icon {
    color: var(--c-primary-600);
    background: var(--c-primary-50);
    width: 34px; height: 34px;
    border-radius: var(--radius-md);
    display: grid; place-items: center;
    font-size: 14px;
}
.school-logo-img {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    background: #fff;
    object-fit: contain;
    padding: 3px;
    border: 1px solid var(--c-border);
    flex-shrink: 0;
}
.topbar-user { display: flex; align-items: center; }
.user-avatar-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-primary-600), var(--c-primary-700));
    color: #fff;
    display: grid; place-items: center;
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
    transition: all var(--t-fast);
    border: 2px solid transparent;
}
.user-avatar-btn:hover {
    border-color: var(--c-primary-400);
    transform: scale(1.05);
}
.user-avatar-btn img {
    width: 100%; height: 100%;
    object-fit: cover;
}
/* دکمه toggle حالت شب */
.theme-toggle {
    width: 38px; height: 38px;
    border-radius: var(--radius-md);
    display: grid; place-items: center;
    color: var(--c-text-soft);
    transition: all var(--t-fast);
}
.theme-toggle:hover { background: var(--c-primary-50); color: var(--c-primary-600); }

/* =========================================================
   8) Form Controls
   ========================================================= */
.form-select,
.form-input,
.form-control,
select.form-control {
    font-family: inherit;
    font-size: var(--fs-md);
    color: var(--c-text);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: 9px 14px;
    min-height: 38px;
    transition: all var(--t-fast);
    outline: none;
    width: 100%;
}
.form-select {
    padding-left: 32px;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234b5565' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: left 12px center;
}
[data-theme="dark"] .form-select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b6c0d1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}
.form-select:focus,
.form-input:focus,
.form-control:focus {
    border-color: var(--c-primary-500);
    box-shadow: var(--shadow-focus);
}
.year-selector .form-select { min-width: 160px; }

/* =========================================================
   9) Buttons
   ========================================================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: var(--sp-2);
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: var(--fs-md);
    font-weight: 500;
    transition: all var(--t-fast);
    border: 1px solid transparent;
    white-space: nowrap;
}
.btn-primary { background: var(--c-primary-600); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--c-primary-700); }
.btn-ghost { background: var(--c-surface); color: var(--c-text-soft); border-color: var(--c-border); }
.btn-ghost:hover { background: var(--c-surface-2); color: var(--c-text); }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-success { background: var(--c-success); color: #fff; }

/* =========================================================
   10) Card / Badge / Alert
   ========================================================= */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    padding: var(--sp-5);
    transition: all var(--t-fast);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-title { font-size: var(--fs-lg); font-weight: 600; margin: 0 0 var(--sp-4); }

.badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 600;
}
.badge-primary { background: var(--c-primary-50); color: var(--c-primary-700); }
.badge-success { background: rgba(63,138,106,.12); color: var(--c-success); }
.badge-danger  { background: rgba(194,90,84,.12);  color: var(--c-danger); }
.badge-warning { background: rgba(208,138,63,.14); color: var(--c-warning); }
/* =========================================================
   12) Shared Components — Tables, Bulk, Drawer, Pagination
   ========================================================= */

/* ---------- 12.1 Table Toolbar ---------- */
.tbl-toolbar {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--c-border);
    flex-wrap: wrap;
}
.tbl-toolbar .live-search {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 380px;
}
.tbl-toolbar .live-search i {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--c-text-muted);
    font-size: 13px;
    pointer-events: none;
}
.tbl-toolbar .live-search input {
    width: 100%;
    padding: 9px 36px 9px 34px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: var(--fs-md);
    background: var(--c-surface);
    color: var(--c-text);
    outline: none;
    transition: all var(--t-fast);
    min-height: 38px;
}
.tbl-toolbar .live-search input:focus {
    border-color: var(--c-primary-500);
    box-shadow: var(--shadow-focus);
}
.tbl-toolbar .live-search .clear-btn {
    position: absolute;
    left: 8px; top: 50%;
    transform: translateY(-50%);
    width: 24px; height: 24px;
    border-radius: var(--radius-sm);
    display: grid; place-items: center;
    color: var(--c-text-muted);
    font-size: 11px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--t-fast);
    background: none;
    border: none;
}
.tbl-toolbar .live-search.has-value .clear-btn { opacity: 1; visibility: visible; }
.tbl-toolbar .live-search .clear-btn:hover { background: var(--c-surface-2); color: var(--c-danger); }

.tbl-toolbar .filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    font-size: var(--fs-sm);
    color: var(--c-text-soft);
    cursor: pointer;
    transition: all var(--t-fast);
}
.tbl-toolbar .filter-chip:hover { background: var(--c-primary-50); color: var(--c-primary-700); }
.tbl-toolbar .filter-chip select {
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    cursor: pointer;
    padding: 0;
    min-height: auto;
}

/* ---------- 12.2 Bulk Action Bar ---------- */
.bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: 10px var(--sp-4);
    background: var(--c-primary-50);
    border-bottom: 1px solid var(--c-primary-200);
    animation: bulkSlide .2s ease;
    flex-wrap: wrap;
}
@keyframes bulkSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.bulk-bar[hidden] { display: none; }
.bulk-bar .bulk-info {
    display: flex; align-items: center; gap: 8px;
    font-size: var(--fs-sm); color: var(--c-primary-800); font-weight: 500;
}
.bulk-bar .bulk-info strong { font-weight: 700; }
.bulk-bar .bulk-actions { display: flex; gap: 8px; }

/* ---------- 12.3 Checkbox ---------- */
.cbx {
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
}
.cbx input { position: absolute; opacity: 0; pointer-events: none; }
.cbx .box {
    width: 18px; height: 18px;
    border: 1.5px solid var(--c-border);
    border-radius: 5px;
    background: var(--c-surface);
    display: grid; place-items: center;
    transition: all var(--t-fast);
}
.cbx .box::after {
    content: '';
    width: 9px; height: 5px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg) translate(-1px, -1px) scale(0);
    transition: transform var(--t-fast);
}
.cbx input:checked + .box {
    background: var(--c-primary-600);
    border-color: var(--c-primary-600);
}
.cbx input:checked + .box::after { transform: rotate(45deg) translate(-1px, -1px) scale(1); }
.cbx input:indeterminate + .box {
    background: var(--c-primary-600);
    border-color: var(--c-primary-600);
}
.cbx input:indeterminate + .box::after {
    width: 8px; height: 0;
    border-right: none;
    border-bottom: 2px solid #fff;
    transform: translateY(-1px) scale(1);
}

/* ---------- 12.4 Table Enhancements ---------- */
.data-table thead th.col-check,
.data-table tbody td.col-check { width: 38px; padding-right: 14px; padding-left: 6px; text-align: center; }

.data-table tbody tr.is-selected {
    background: var(--c-primary-50) !important;
}
[data-theme="dark"] .data-table tbody tr.is-selected {
    background: rgba(138,171,224,.10) !important;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.data-table th.sortable:hover { color: var(--c-primary-700); }
.data-table th.sortable i {
    font-size: 10px;
    margin-right: 4px;
    opacity: .4;
    transition: all var(--t-fast);
}
.data-table th.sortable.sorted-asc i  { opacity: 1; color: var(--c-primary-600); }
.data-table th.sortable.sorted-desc i { opacity: 1; color: var(--c-primary-600); transform: rotate(180deg); }

/* ---------- 12.5 Row Actions ---------- */
.row-actions {
    display: inline-flex;
    gap: 4px;
}
.row-actions .btn-icon {
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    display: inline-grid;
    place-items: center;
    background: transparent;
    color: var(--c-text-muted);
    font-size: 12px;
    transition: all var(--t-fast);
    border: none;
    cursor: pointer;
}
.row-actions .btn-icon:hover { background: var(--c-surface-2); color: var(--c-text); }
.row-actions .btn-icon.js-edit:hover  { background: var(--c-primary-50); color: var(--c-primary-700); }
.row-actions .btn-icon.js-del:hover   { background: rgba(194,90,84,.10); color: var(--c-danger); }
.row-actions .btn-icon.js-view:hover  { background: rgba(63,138,106,.10); color: var(--c-success); }

/* ---------- 12.6 Pagination (compact, fixed width) ---------- */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    min-height: 34px;
    padding: 2px 0;
}
.page-btn {
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: var(--fs-sm);
    color: var(--c-text-soft);
    transition: all var(--t-fast);
    min-width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
}
.page-btn:hover:not(:disabled) {
    background: var(--c-surface-2);
    border-color: var(--c-primary-300);
    color: var(--c-primary-700);
}
.page-btn.active {
    background: var(--c-primary-600);
    color: #fff;
    border-color: var(--c-primary-600);
    font-weight: 600;
}
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-dots {
    display: inline-grid;
    place-items: center;
    height: 34px;
    min-width: 26px;
    color: var(--c-text-muted);
    font-size: var(--fs-sm);
    user-select: none;
}

/* ---------- 12.7 Table Footer ---------- */
.tbl-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: 12px var(--sp-4);
    border-top: 1px solid var(--c-border-soft);
    flex-wrap: wrap;
}
.tbl-footer .tbl-info {
    font-size: var(--fs-sm);
    color: var(--c-text-muted);
    white-space: nowrap;
}
.tbl-footer .page-size {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-sm);
    color: var(--c-text-muted);
    white-space: nowrap;
}
.tbl-footer .page-size select {
    padding: 5px 8px;
    min-height: 32px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: var(--fs-sm);
    background: var(--c-surface);
    color: var(--c-text);
    cursor: pointer;
    outline: none;
}

/* ---------- 12.8 Skeleton ---------- */
.skel-row td { padding: 14px !important; }
.skel {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg,
        var(--c-border-soft) 25%,
        var(--c-border) 50%,
        var(--c-border-soft) 75%);
    background-size: 200% 100%;
    animation: skelAnim 1.4s infinite;
}
@keyframes skelAnim {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
/* =========================================================
   13) Inline Form (Expandable card header)
   ========================================================= */

.inline-form {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height .35s ease, opacity .25s ease, padding .25s ease;
    background: var(--c-surface-2);
    border-bottom: 1px solid var(--c-border);
    padding: 0 var(--sp-5);
}
.inline-form.open {
    max-height: 500px;
    opacity: 1;
    padding: var(--sp-5);
}

.inline-form .form-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: var(--sp-4);
}
.inline-form .form-head .form-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-md);
    background: var(--c-primary-600);
    color: #fff;
    display: grid; place-items: center;
    font-size: 15px;
    flex-shrink: 0;
}
.inline-form .form-head h4 {
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--c-text);
}
/* =========================================================
   14) Year Picker + Topbar extras
   ========================================================= */

.year-picker { position: relative; }

.year-picker-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 14px 5px 12px;
    height: 42px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    background: var(--c-surface);
    cursor: pointer; transition: all var(--t-fast);
    font-family: inherit; color: var(--c-text);
}
.year-picker-btn:hover { border-color: var(--c-primary-400); background: var(--c-primary-50); }
.year-picker.open .year-picker-btn {
    border-color: var(--c-primary-500);
    background: var(--c-primary-50);
    box-shadow: var(--shadow-focus);
}
.year-picker-btn > i:first-child { color: var(--c-primary-600); font-size: 14px; }
.year-picker-btn .chevron { font-size: 10px; color: var(--c-text-muted); transition: transform var(--t-base); margin-right: 2px; }
.year-picker.open .year-picker-btn .chevron { transform: rotate(180deg); }

.year-picker-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.year-picker-label { font-size: 10px; color: var(--c-text-muted); }
.year-picker-current { font-size: var(--fs-md); color: var(--c-text); font-weight: 600; }

.year-picker-menu {
    position: absolute; top: calc(100% + 6px); left: 0;
    min-width: 260px; background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 250; overflow: hidden;
    animation: yearMenuIn .2s ease;
}
.year-picker-menu[hidden] { display: none; }
@keyframes yearMenuIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.year-picker-head {
    padding: 10px 14px; border-bottom: 1px solid var(--c-border);
    font-size: var(--fs-xs); color: var(--c-text-muted);
    letter-spacing: .4px; background: var(--c-surface-2);
}

.year-picker-list {
    list-style: none; margin: 0; padding: 6px;
    max-height: 280px; overflow-y: auto;
}
.year-picker-item {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: transparent; border: none;
    cursor: pointer; font-family: inherit;
    font-size: var(--fs-md); color: var(--c-text);
    text-align: right; transition: all var(--t-fast);
}
.year-picker-item:hover { background: var(--c-surface-2); }
.year-picker-item.active { background: var(--c-primary-50); color: var(--c-primary-700); font-weight: 600; }
.year-picker-item.active i { color: var(--c-primary-600); font-size: 12px; }
.year-picker-item-name { flex: 1; }

.year-picker-foot { padding: 8px; border-top: 1px solid var(--c-border); background: var(--c-surface-2); }
.year-picker-foot a {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: var(--radius-sm);
    font-size: var(--fs-sm); color: var(--c-text-soft);
    transition: all var(--t-fast);
}
.year-picker-foot a:hover { background: var(--c-surface); color: var(--c-primary-700); }
.year-picker-foot a i { font-size: 12px; }

.user-avatar-btn {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, var(--c-primary-600), var(--c-primary-700));
    color: #fff; display: grid; place-items: center;
    font-weight: 700; font-size: 14px; overflow: hidden;
    transition: all var(--t-fast);
    border: 2px solid transparent; text-decoration: none; flex-shrink: 0;
}
.user-avatar-btn:hover { border-color: var(--c-primary-400); transform: scale(1.05); }
.user-avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

.topbar-logout { min-height: 38px; padding: 7px 14px; font-size: var(--fs-sm); }

@media (max-width: 900px) {
    .year-picker-text { display: none; }
    .year-picker-btn { padding: 0; width: 42px; justify-content: center; gap: 0; }
    .year-picker-btn .chevron { display: none; }
    .topbar-logout span { display: none; }
    .topbar-logout { width: 38px; padding: 0; justify-content: center; }
}
/* ---------- Grid ---------- */
.inline-form .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--sp-3);
    align-items: start;
    margin-bottom: var(--sp-4);
}

.inline-form .field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}
.inline-form .field label {
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--c-text-muted);
    padding-right: 2px;
}
.inline-form .field label .req { color: var(--c-danger); }
.inline-form .field .form-input,
.inline-form .field .form-select {
    min-height: 42px;
    font-size: var(--fs-md);
}
.inline-form .field-error {
    font-size: var(--fs-xs);
    color: var(--c-danger);
    min-height: 13px;
    line-height: 1.3;
}
.inline-form .field.has-error .form-input,
.inline-form .field.has-error .form-select {
    border-color: var(--c-danger);
    box-shadow: 0 0 0 3px rgba(194,90,84,.10);
}

/* ---------- Actions ---------- */
.inline-form .form-actions {
    display: flex;
    gap: var(--sp-2);
    align-items: center;
    justify-content: flex-start;
    padding-top: var(--sp-3);
    border-top: 1px dashed var(--c-border);
}
.inline-form .form-actions .btn {
    min-width: 110px;
}

/* ---------- Button "Add" (پایه‌ی جدا) ---------- */
.btn-add-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--c-primary-600), var(--c-primary-700));
    color: #fff;
    font-size: var(--fs-md);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(61,95,143,.25);
    transition: all var(--t-fast);
    border: none;
    cursor: pointer;
}
.btn-add-inline:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(61,95,143,.32);
}
.btn-add-inline.active {
    background: var(--c-surface-2);
    color: var(--c-text-soft);
    border: 1px solid var(--c-border);
    box-shadow: none;
}

/* =========================================================
   11) Responsive
   ========================================================= */
@media (max-width: 700px) {
    .inline-form .form-grid {
        grid-template-columns: 1fr;
    }
    .inline-form .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .inline-form .form-actions .btn {
        width: 100%;
    }

    .tbl-toolbar { padding: 10px 12px; }
    .tbl-toolbar .live-search { max-width: 100%; }
    .tbl-footer { padding: 10px 12px; }
    .tbl-footer .tbl-info { display: none; }
    .data-table { font-size: var(--fs-sm); }
}

@media (max-width: 992px) {
    .main-content { margin-right: 0 !important; }
    .sidebar {
        transform: translateX(100%);
        width: var(--sidebar-w) !important;
    }
    .sidebar.mobile-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .sidebar.collapsed .menu-item span,
    .sidebar.collapsed .logout-container span,
    .sidebar.collapsed .brand-text { display: inline; }
    .sidebar.collapsed .submenu { display: flex; }
    .sidebar.collapsed .menu-item > a { justify-content: flex-start; padding: 11px var(--sp-4); }
    .content-inner { padding: var(--sp-4); }
    .topbar { padding: 0 var(--sp-4); }
    .school-name span { display: none; }
}