/* =====================================================================
   دکتر پلن — سیستم طراحی «premium-v2»
   این فایل بعد از app.css بارگذاری می‌شود و فقط لایهٔ ظاهر را عوض می‌کند
   (توکن‌ها، پوستهٔ پنل، کارت/جدول/فرم/دکمه). ساختار HTML و منطق دست‌نخورده است.
   رنگ برند از لوگو: بنفش #5225C0 + طلایی #FBB22E. حالت روشن/تیره با data-theme.
   ===================================================================== */

/* ---------- ۱) توکن‌ها ---------- */
:root,
[data-theme="light"] {
    --ds-brand: #5225c0;
    --ds-brand-hover: #411ca0;
    --ds-brand-soft: #efebfb;
    --ds-brand-line: #d9d0f5;
    --ds-accent: #fbb22e;
    --ds-accent-soft: #fff4dc;
    --ds-accent-ink: #8a5a00;

    --ds-bg: #f5f6fa;
    --ds-surface: #ffffff;
    --ds-surface-2: #f8f9fc;
    --ds-line: #e5e7ef;
    --ds-line-strong: #d3d6e2;
    --ds-text: #181a2b;
    --ds-text-2: #4d526a;
    --ds-text-3: #6b7088;

    --ds-ok: #17794d;        --ds-ok-soft: #e4f5ec;
    --ds-warn: #8a5a00;      --ds-warn-soft: #fff4dc;
    --ds-danger: #c2243f;    --ds-danger-soft: #fdebee;
    --ds-info: #1b62a8;      --ds-info-soft: #e7f1fb;

    --ds-r-sm: 8px;
    --ds-r-md: 12px;
    --ds-r-lg: 16px;
    --ds-shadow-1: 0 1px 2px rgba(24, 26, 43, .05);
    --ds-shadow-2: 0 4px 16px rgba(24, 26, 43, .07);
    --ds-shadow-3: 0 12px 32px rgba(24, 26, 43, .12);
    --ds-ring: 0 0 0 3px rgba(82, 37, 192, .22);

    /* پالت دسته‌بندی دروس/نمودارها — شش رنگ متمایز و هماهنگ با برند */
    --cat-1: #5225c0; --cat-2: #d98a00; --cat-3: #0e9f8e; --cat-4: #d6456a; --cat-5: #2f7ddb; --cat-6: #3fa55b;
    --ds-sidebar-w: 264px;
    --ds-topbar-h: 56px;

    /* نگاشت به متغیرهای قدیمی app.css تا همهٔ صفحه‌ها خودکار هماهنگ شوند */
    --brand-primary: var(--ds-brand);
    --brand-primary-dark: var(--ds-brand-hover);
    --brand-primary-soft: var(--ds-brand-soft);
    --brand-secondary: var(--ds-accent);
    --accent-orange: var(--ds-accent);
    --page-bg: var(--ds-bg);
    --panel-bg: var(--ds-bg);
    --panel-muted: var(--ds-surface-2);
    --panel-border: var(--ds-line);
    --surface-1: var(--ds-surface);
    --surface-2: var(--ds-surface);
    --surface-3: var(--ds-surface-2);
    --text-strong: var(--ds-text);
    --text-soft: var(--ds-text-2);
    --stroke-strong: var(--ds-line-strong);
    --sidebar-bg: var(--ds-surface);
    --topbar-bg: var(--ds-surface);
    --topbar-border: var(--ds-line);
    --teal: var(--ds-brand);
    --teal-light: #8467e0;
    --teal-dark: var(--ds-brand-hover);
    --teal-bg: var(--ds-brand-soft);
    --teal-ink: var(--ds-brand);
    --teal-ink-deep: var(--ds-brand-hover);
    --teal-primary-ink: var(--ds-brand);
    --gold: var(--ds-accent);
    --gold-dark: var(--ds-accent-ink);
    --gold-accent: var(--ds-accent);
    --gold-accent-deep: #3d2a00;
    --coral: var(--ds-danger);
    --coral-dark: #a31b33;
    --coral-ink: var(--ds-danger);
    --brand: var(--ds-brand);
    --brand-hover: var(--ds-brand-hover);
    --brand-soft: var(--ds-brand-soft);
    --bg-body: var(--ds-bg);
    --bg-card: var(--ds-surface);
    --bg-elevated: var(--ds-surface);
    --bg-sidebar: var(--ds-surface);
    --bg-sidebar-active: var(--ds-brand-soft);
    --bg-topbar: var(--ds-surface);
    --bg-hover: var(--ds-surface-2);
    --bg-input: var(--ds-surface);
    --text-main: var(--ds-text);
    --text-muted: var(--ds-text-2);
    --text-sidebar: var(--ds-text);
    --text-sidebar-muted: var(--ds-text-2);
    --border-color: var(--ds-line);
    --focus-ring: var(--ds-ring);
    --shadow-card: var(--ds-shadow-1);
    --shadow-md: var(--ds-shadow-2);
    --shadow-lg: var(--ds-shadow-3);
    --glow-teal: var(--ds-shadow-2);
    --glow-gold: var(--ds-shadow-2);
    --danger: var(--ds-danger);   --danger-soft: var(--ds-danger-soft);
    --warning: var(--ds-warn);    --warning-soft: var(--ds-warn-soft);
    --info: var(--ds-info);       --info-soft: var(--ds-info-soft);
    --success: var(--ds-ok);      --success-soft: var(--ds-ok-soft);
    --radius-lg: var(--ds-r-lg);
    --radius-md: var(--ds-r-md);
    --radius-sm: var(--ds-r-sm);
    color-scheme: light;
}

[data-theme="dark"] {
    --ds-brand: #9b82f0;
    --ds-brand-hover: #b5a2f6;
    --ds-brand-soft: rgba(155, 130, 240, .16);
    --ds-brand-line: rgba(155, 130, 240, .35);
    --ds-accent: #fbb22e;
    --ds-accent-soft: rgba(251, 178, 46, .14);
    --ds-accent-ink: #fbc55f;

    --ds-bg: #11101b;
    --ds-surface: #1a1828;
    --ds-surface-2: #222035;
    --ds-line: #2e2b45;
    --ds-line-strong: #3d3959;
    --ds-text: #f1effa;
    --ds-text-2: #bab6d0;
    --ds-text-3: #9a96b3;

    --ds-ok: #4cc791;        --ds-ok-soft: rgba(76, 199, 145, .14);
    --ds-warn: #fbc55f;      --ds-warn-soft: rgba(251, 178, 46, .14);
    --ds-danger: #ff8a9b;    --ds-danger-soft: rgba(255, 138, 155, .14);
    --ds-info: #7fb8f0;      --ds-info-soft: rgba(127, 184, 240, .14);

    --cat-1: #9b82f0; --cat-2: #f2b13c; --cat-3: #3fc7b5; --cat-4: #f0728f; --cat-5: #6aa8f0; --cat-6: #6fd08a;
    --ds-shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
    --ds-shadow-2: 0 4px 16px rgba(0, 0, 0, .35);
    --ds-shadow-3: 0 12px 32px rgba(0, 0, 0, .5);
    --ds-ring: 0 0 0 3px rgba(155, 130, 240, .35);
    --teal-light: #b5a2f6;
    --coral-dark: #ffb4c0;
    --gold-accent-deep: #1a1200;
    --bg-hover: var(--ds-surface-2);
    color-scheme: dark;
}

/* ---------- ۲) پایه ---------- */
html { scroll-behavior: smooth; }
body {
    background: var(--ds-bg);
    color: var(--ds-text);
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: .94rem;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "kern", "liga";
}
h1, h2, h3, h4, h5, h6 { color: var(--ds-text); font-weight: 800; letter-spacing: 0; }
a { color: var(--ds-brand); }
a:hover { color: var(--ds-brand-hover); }
.text-muted, .text-body-secondary { color: var(--ds-text-3) !important; }
::selection { background: var(--ds-brand); color: #fff; }
:focus-visible { outline: 2px solid var(--ds-brand); outline-offset: 2px; border-radius: 6px; }
.material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
* { scrollbar-width: thin; scrollbar-color: var(--ds-line-strong) transparent; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- ۳) پوستهٔ پنل: نوار بالا + سایدبار ---------- */
:root { --topbar-h: var(--ds-topbar-h); }

.app-topbar {
    width: calc(100% - var(--ds-sidebar-w));
    height: var(--ds-topbar-h);
    min-height: var(--ds-topbar-h);
    flex-basis: var(--ds-topbar-h);
    padding: 0 1.25rem;
    color: var(--ds-text);
    background: color-mix(in srgb, var(--ds-surface) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 0;
    border-bottom: 1px solid var(--ds-line);
    box-shadow: none;
    z-index: 1060;
}
[data-theme="dark"] .app-topbar { background: color-mix(in srgb, var(--ds-surface) 92%, transparent); box-shadow: none; }
.app-topbar .topbar-brand { color: var(--ds-text); width: auto; margin: 0; padding: 0; }
.app-topbar .brand-badge { background: none; box-shadow: none; width: 32px; height: 32px; padding: 0; }
.app-topbar .brand-badge img { width: 32px; height: 32px; display: block; }
.app-topbar .search-box { display: none !important; }
.app-topbar .icon-btn { color: var(--ds-text-2); background: transparent; }
.app-topbar .icon-btn:hover,
.app-topbar .icon-btn:focus-visible { color: var(--ds-brand); background: var(--ds-brand-soft); }
@media (min-width: 992px) { .app-topbar .topbar-brand { display: none; } }

.icon-btn {
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1px solid transparent;
    color: var(--ds-text-2);
    background: transparent;
    box-shadow: none;
    transition: background .15s, color .15s;
}
.notif-badge { background: var(--ds-accent); color: #3d2a00; font-weight: 800; border: 2px solid var(--ds-surface); }
.dropdown-menu { border: 1px solid var(--ds-line); border-radius: var(--ds-r-md); box-shadow: var(--ds-shadow-3); background: var(--ds-surface); }
.notif-dropdown-header { font-weight: 800; border-bottom: 1px solid var(--ds-line); }
.notif-item { border-bottom: 1px solid var(--ds-line); }
.notif-item:hover { background: var(--ds-surface-2); }
.notif-item.notif-unread { background: var(--ds-brand-soft); }

.app-row { padding: 0 var(--ds-sidebar-w) 0 0; }
.app-sidebar {
    width: var(--ds-sidebar-w);
    top: 0; height: 100vh;
    background: var(--ds-surface);
    border: 0;
    border-inline-start: 1px solid var(--ds-line);
    border-radius: 0;
    box-shadow: none;
    padding-bottom: 0;
}
[data-theme="dark"] .app-sidebar { background: var(--ds-surface); box-shadow: none; }
.app-sidebar .sidebar-brand {
    display: flex; align-items: center; gap: .65rem;
    margin: 0; padding: 0 1.1rem;
    height: var(--ds-topbar-h);
    border-bottom: 1px solid var(--ds-line);
    text-decoration: none; color: var(--ds-text);
    flex-shrink: 0;
}
.sidebar-brand-mark { background: none !important; box-shadow: none !important; width: 34px !important; height: 34px !important; padding: 0; display: grid; place-items: center; }
.sidebar-brand-mark img { width: 34px; height: 34px; display: block; }
.app-sidebar .sidebar-brand strong { display: block; font-size: 1rem; font-weight: 900; line-height: 1.2; color: var(--ds-text); }
.app-sidebar .sidebar-brand small { display: block; font-size: .68rem; color: var(--ds-text-3); line-height: 1.3; }

.app-sidebar .user-mini {
    flex-direction: row; align-items: center; text-align: start; gap: .7rem;
    margin: .85rem .85rem .35rem; padding: .65rem .75rem;
    border: 1px solid var(--ds-line); border-radius: var(--ds-r-md);
    background: var(--ds-surface-2); box-shadow: none;
    transition: border-color .15s, background .15s;
}
.app-sidebar .user-mini:hover { border-color: var(--ds-brand-line); background: var(--ds-brand-soft); box-shadow: none; }
.app-sidebar .user-mini .avatar {
    width: 40px; height: 40px; margin: 0; flex-shrink: 0;
    border: 0; border-radius: 50%;
    background: var(--ds-brand-soft); color: var(--ds-brand);
    box-shadow: none; display: grid; place-items: center; overflow: hidden;
}
.app-sidebar .user-mini .avatar img { width: 100%; height: 100%; object-fit: cover; }
.app-sidebar .user-mini .avatar .material-symbols-outlined { font-size: 1.35rem; }
.app-sidebar .user-mini .name { color: var(--ds-text); font-size: .86rem; font-weight: 800; line-height: 1.4; }
[data-theme="dark"] .app-sidebar .user-mini .name { color: var(--ds-text); }
.app-sidebar .user-mini .academic,
.app-sidebar .user-mini .role,
.app-sidebar .user-mini .school-name { color: var(--ds-text-3); font-size: .7rem; line-height: 1.5; justify-content: flex-start; margin: 0; }
.app-sidebar .user-mini .school-name { display: none; }
.app-sidebar .user-mini-edit { display: none; }

.app-nav { padding: .4rem .75rem 1rem; }
.app-nav .nav-link {
    position: relative;
    min-height: 40px; margin-bottom: 2px; padding: .5rem .75rem; gap: .7rem;
    border-radius: 10px;
    color: var(--ds-text-2);
    font-size: .86rem; font-weight: 600;
    transition: background .15s, color .15s;
}
.app-nav .nav-link .material-symbols-outlined { font-size: 1.3rem; color: var(--ds-text-3); transition: color .15s; }
.app-nav .nav-link:hover { color: var(--ds-text); background: var(--ds-surface-2); }
.app-nav .nav-link:hover .material-symbols-outlined { color: var(--ds-brand); }
.app-nav .nav-link.active {
    color: var(--ds-brand); background: var(--ds-brand-soft);
    box-shadow: none; font-weight: 800;
}
.app-nav .nav-link.active::before { display: none; }
.app-nav .nav-link.active .material-symbols-outlined { color: var(--ds-brand); font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
[data-theme="dark"] .app-nav .nav-link { color: var(--ds-text-2); }
[data-theme="dark"] .app-nav .nav-link:hover { color: var(--ds-text); background: var(--ds-surface-2); }
.nav-badge { background: var(--ds-accent); color: #3d2a00; font-weight: 800; }
.app-sidebar .sidebar-footer { background: var(--ds-surface); border-top: 1px solid var(--ds-line); color: var(--ds-text-2); font-size: .85rem; position: sticky; bottom: 0; padding: .8rem 1.1rem; }
.app-sidebar .sidebar-footer a:hover { color: var(--ds-danger); }

/* ---------- ۴) سربرگ صفحه و محتوا ---------- */
.app-content { padding: 1.5rem 1.75rem 2.5rem; max-width: 1480px; }
.page-header {
    min-height: 0; margin: 0 0 1.25rem; padding: 0;
    border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
.page-header h1 { font-size: 1.45rem; font-weight: 900; margin: 0; color: var(--ds-text); }
.page-header .subtitle { color: var(--ds-text-3); font-size: .85rem; }
.page-surface { background: transparent; border: 0; box-shadow: none; padding: 0; border-radius: 0; }

/* ---------- ۵) کارت‌ها و آمار ---------- */
.card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-r-lg);
    box-shadow: var(--ds-shadow-1);
    transition: border-color .15s, box-shadow .2s;
}
.card:hover { box-shadow: var(--ds-shadow-1); border-color: var(--ds-line); transform: none; }
.card-header {
    background: transparent; border-bottom: 1px solid var(--ds-line);
    padding: .9rem 1.15rem; font-weight: 800; font-size: .95rem; color: var(--ds-text);
}
.card-header .material-symbols-outlined { color: var(--ds-brand); }
.card-body { padding: 1.15rem; }
.card-accent { border-inline-start: 3px solid var(--ds-brand); border-right-width: 1px; }
.card-tint-brand { background: var(--ds-brand-soft); }
.card-tint-success { background: var(--ds-ok-soft); }
.card-tint-warning { background: var(--ds-warn-soft); }
.card-tint-danger { background: var(--ds-danger-soft); }

.stat-tile {
    position: relative; overflow: hidden;
    display: flex !important; flex-direction: row; align-items: center; justify-content: flex-start;
    gap: .9rem; text-align: start; padding: 1rem 1.1rem;
}
.stat-tile::before, .stat-tile::after { display: none !important; }
.stat-tile .card-body { display: flex; flex-direction: row; align-items: center; gap: .9rem; padding: 0; text-align: start; }
.stat-tile .stat-icon,
.stat-icon {
    width: 44px; height: 44px; margin: 0; flex-shrink: 0;
    display: grid; place-items: center; border-radius: 12px;
    background: var(--ds-brand-soft); color: var(--ds-brand);
}
.stat-icon.bg-brand-soft { background: var(--ds-brand-soft); color: var(--ds-brand); }
.stat-icon.bg-success-soft { background: var(--ds-ok-soft); color: var(--ds-ok); }
.stat-icon.bg-warning-soft { background: var(--ds-warn-soft); color: var(--ds-warn); }
.stat-icon.bg-danger-soft { background: var(--ds-danger-soft); color: var(--ds-danger); }
.stat-icon.bg-info-soft { background: var(--ds-info-soft); color: var(--ds-info); }
.stat-tile .stat-value { font-size: 1.6rem; font-weight: 900; line-height: 1.2; color: var(--ds-text); margin: 0; font-variant-numeric: tabular-nums; }
.stat-tile .stat-label { font-size: .78rem; color: var(--ds-text-3); margin: 0; }

/* دسترسی سریع (داشبورد دانش‌آموز) — یک رنگ، بدون تزئین */
.dashboard-action-grid { gap: .85rem; }
.dashboard-action-card {
    background: var(--ds-surface) !important;
    border: 1px solid var(--ds-line); border-radius: var(--ds-r-md);
    box-shadow: var(--ds-shadow-1);
    transition: border-color .15s, background .15s, transform .15s;
    --action-color: var(--ds-brand); --action-soft: var(--ds-brand-soft);
}
.dashboard-action-card::before, .dashboard-action-card::after { display: none !important; }
.dashboard-action-card:hover { border-color: var(--ds-brand-line); background: var(--ds-surface-2) !important; transform: translateY(-1px); box-shadow: var(--ds-shadow-1); }
.dashboard-action-card.action-cyan,
.dashboard-action-card.action-pink,
.dashboard-action-card.action-orange,
.dashboard-action-card.action-primary { --action-color: var(--ds-brand); --action-soft: var(--ds-brand-soft); }
.dashboard-action-icon { background: var(--ds-brand-soft) !important; color: var(--ds-brand) !important; border-radius: 10px; }
.dashboard-action-card strong { color: var(--ds-text); font-weight: 800; }
.dashboard-action-card small { color: var(--ds-text-3); }
.dashboard-section-heading h2 { font-size: 1.05rem; font-weight: 900; }
.dashboard-section-kicker, .role-dashboard-kicker { color: var(--ds-text-3) !important; font-size: .72rem; font-weight: 700; }

/* بنر خوشامد */
.student-default-banner, .role-dashboard-banner, .student-mobile-welcome {
    background: var(--ds-surface) !important;
    border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg);
    box-shadow: var(--ds-shadow-1);
    background-image: none !important;
}
.student-default-banner::before, .student-default-banner::after,
.role-dashboard-banner::before, .role-dashboard-banner::after { display: none !important; }
.student-default-banner-copy h2 { color: var(--ds-text); font-size: 1.25rem; font-weight: 900; }
.student-default-banner-copy p { color: var(--ds-text-2); font-size: .88rem; }
.student-default-banner-art { background: var(--ds-brand-soft); border-radius: var(--ds-r-md); }
.student-default-banner-art::before { display: none; }
.student-default-banner-art .material-symbols-outlined { color: var(--ds-brand) !important; }
.student-default-banner-art .art-idea { color: var(--ds-accent) !important; }

/* ---------- ۶) دکمه‌ها ---------- */
.btn { border-radius: 10px; font-weight: 700; font-size: .88rem; padding: .5rem 1rem; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn-sm { padding: .32rem .75rem; font-size: .8rem; border-radius: 8px; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; border-radius: 12px; }
.btn-brand, .btn-primary {
    background: var(--ds-brand); border: 1px solid var(--ds-brand); color: #fff;
    box-shadow: none; background-image: none;
}
.btn-brand:hover, .btn-brand:focus-visible, .btn-primary:hover { background: var(--ds-brand-hover); border-color: var(--ds-brand-hover); color: #fff; box-shadow: none; transform: none; }
[data-theme="dark"] .btn-brand, [data-theme="dark"] .btn-primary { color: #12101f; }
[data-theme="dark"] .btn-brand:hover, [data-theme="dark"] .btn-primary:hover { color: #12101f; }
.btn-outline-brand, .btn-outline-primary { background: transparent; border: 1px solid var(--ds-brand-line); color: var(--ds-brand); }
.btn-outline-brand:hover, .btn-outline-primary:hover { background: var(--ds-brand-soft); border-color: var(--ds-brand); color: var(--ds-brand); }
.btn-outline-secondary { border-color: var(--ds-line-strong); color: var(--ds-text-2); background: transparent; }
.btn-outline-secondary:hover { background: var(--ds-surface-2); color: var(--ds-text); border-color: var(--ds-line-strong); }
.btn-light { background: var(--ds-surface-2); border-color: var(--ds-line); color: var(--ds-text); }
.btn-danger { background: var(--ds-danger); border-color: var(--ds-danger); }
.btn-outline-danger { color: var(--ds-danger); border-color: var(--ds-danger-soft); }
.btn-outline-danger:hover { background: var(--ds-danger-soft); color: var(--ds-danger); border-color: var(--ds-danger); }
.btn-success { background: var(--ds-ok); border-color: var(--ds-ok); }
.btn:focus-visible { box-shadow: var(--ds-ring); outline: none; }
.btn-gold, .btn-warning { background: var(--ds-accent); border-color: var(--ds-accent); color: #3d2a00; }

/* ---------- ۷) فرم‌ها ---------- */
.form-label { font-size: .82rem; font-weight: 700; color: var(--ds-text-2); margin-bottom: .35rem; }
.form-control, .form-select {
    background-color: var(--ds-surface); color: var(--ds-text);
    border: 1px solid var(--ds-line-strong); border-radius: 10px;
    padding: .55rem .8rem; font-size: .9rem; box-shadow: none;
    transition: border-color .15s, box-shadow .15s;
}
.form-control::placeholder { color: var(--ds-text-3); opacity: .8; }
.form-control:hover, .form-select:hover { border-color: var(--ds-text-3); }
.form-control:focus, .form-select:focus { border-color: var(--ds-brand); box-shadow: var(--ds-ring); background-color: var(--ds-surface); color: var(--ds-text); }
.form-control:disabled, .form-select:disabled, .form-control[readonly] { background: var(--ds-surface-2); color: var(--ds-text-3); }
.form-check-input:checked { background-color: var(--ds-brand); border-color: var(--ds-brand); }
.form-check-input:focus { box-shadow: var(--ds-ring); border-color: var(--ds-brand); }
.input-group-text { background: var(--ds-surface-2); border-color: var(--ds-line-strong); color: var(--ds-text-3); }
.form-text, .form-hint { color: var(--ds-text-3); font-size: .78rem; }

/* ---------- ۸) جدول‌ها ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--ds-text); --bs-table-border-color: var(--ds-line); color: var(--ds-text); font-size: .88rem; }
.table > thead > tr > th,
.table > thead th {
    background: var(--ds-surface-2); color: var(--ds-text-2);
    font-size: .76rem; font-weight: 800; white-space: nowrap;
    border-bottom: 1px solid var(--ds-line-strong); padding: .65rem .85rem;
}
.table > tbody > tr > td { padding: .65rem .85rem; border-color: var(--ds-line); vertical-align: middle; }
.table-hover > tbody > tr:hover > * { --bs-table-hover-bg: var(--ds-surface-2); background: var(--ds-surface-2); color: var(--ds-text); }
.table-responsive { border-radius: var(--ds-r-md); }
.card > .table-responsive,
.card > .table { border-radius: 0 0 var(--ds-r-lg) var(--ds-r-lg); }

/* ---------- ۹) نشان‌ها، هشدارها، مودال ---------- */
.badge { font-weight: 700; font-size: .72rem; border-radius: 999px; padding: .32em .7em; }
.badge.bg-success, .badge-success { background: var(--ds-ok-soft) !important; color: var(--ds-ok) !important; }
.badge.bg-danger { background: var(--ds-danger-soft) !important; color: var(--ds-danger) !important; }
.badge.bg-warning { background: var(--ds-warn-soft) !important; color: var(--ds-warn) !important; }
.badge.bg-info { background: var(--ds-info-soft) !important; color: var(--ds-info) !important; }
.badge.bg-secondary { background: var(--ds-surface-2) !important; color: var(--ds-text-2) !important; border: 1px solid var(--ds-line); }
.badge.bg-primary { background: var(--ds-brand-soft) !important; color: var(--ds-brand) !important; }
.alert { border-radius: var(--ds-r-md); border: 1px solid var(--ds-line); font-size: .88rem; }
.alert-success { background: var(--ds-ok-soft); color: var(--ds-ok); border-color: transparent; }
.alert-danger { background: var(--ds-danger-soft); color: var(--ds-danger); border-color: transparent; }
.alert-warning { background: var(--ds-warn-soft); color: var(--ds-warn); border-color: transparent; }
.alert-info { background: var(--ds-info-soft); color: var(--ds-info); border-color: transparent; }
.modal-content { background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); box-shadow: var(--ds-shadow-3); }
.modal-header, .modal-footer { border-color: var(--ds-line); }
.nav-tabs { border-color: var(--ds-line); }
.nav-tabs .nav-link { color: var(--ds-text-2); border: 0; border-bottom: 2px solid transparent; font-weight: 700; }
.nav-tabs .nav-link.active { color: var(--ds-brand); background: transparent; border-bottom-color: var(--ds-brand); }
.progress { background: var(--ds-surface-2); border-radius: 999px; height: .55rem; }
.progress-bar { background: var(--ds-brand); }
.page-link { color: var(--ds-brand); border-color: var(--ds-line); }
.page-item.active .page-link { background: var(--ds-brand); border-color: var(--ds-brand); color: #fff; }
.list-group-item { background: var(--ds-surface); border-color: var(--ds-line); color: var(--ds-text); }

/* ---------- ۱۰) نوار پایین موبایل و دستیار هوشمند ---------- */
.mobile-bottom-nav { background: var(--ds-surface); border-top: 1px solid var(--ds-line); box-shadow: 0 -4px 16px rgba(24, 26, 43, .06); }
.mobile-bottom-nav .tab-btn { color: var(--ds-text-3); font-weight: 700; }
.mobile-bottom-nav .tab-btn.active { color: var(--ds-brand); }
.mobile-fab { background: var(--ds-brand); color: #fff; box-shadow: var(--ds-shadow-3); }
[data-theme="dark"] .mobile-fab { color: #12101f; }

@media (max-width: 991.98px) {
    .app-topbar { width: 100%; padding: 0 .75rem; }
    .app-row { padding: 0; }
    .app-sidebar { width: min(86vw, 300px); border-inline-start: 0; box-shadow: var(--ds-shadow-3); }
    .app-content { padding: 1rem 1rem 6.5rem; }
    .page-header h1 { font-size: 1.2rem; }
    .app-topbar .topbar-brand { display: flex; }
}

/* ---------- ۱۱) صفحه‌های ورود / ثبت‌نام ---------- */
.auth-shell { background: var(--ds-bg); }
.auth-card { background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: 20px; box-shadow: var(--ds-shadow-3); }
.auth-card .auth-form-panel { background: var(--ds-surface); }
.auth-card .auth-illustration { background: linear-gradient(160deg, #3a1a8c 0%, var(--ds-brand) 100%); color: #fff; }
.auth-card .auth-branding .brand-badge { background: #fff; box-shadow: none; padding: 5px; }
.auth-card .auth-branding .brand-badge img { width: 100%; height: 100%; display: block; }
.auth-card .auth-form-group { border-color: var(--ds-line-strong); border-radius: 10px; background: var(--ds-surface); box-shadow: none; }
.auth-card .auth-form-group:focus-within { border-color: var(--ds-brand); box-shadow: var(--ds-ring); }
.auth-card .auth-tab-switch { background: var(--ds-surface-2); border-radius: 12px; }
.auth-card .auth-tab-switch button.active { background: var(--ds-surface); color: var(--ds-brand); box-shadow: var(--ds-shadow-1); }

/* ---------- ۱۲) بنر نقش‌ها، ورود، دستیار ---------- */
.role-dashboard-banner,
.role-dashboard-banner.role-school,
.role-dashboard-banner.role-consultant,
.role-dashboard-banner.role-admin,
.role-dashboard-banner.role-parent {
    --role-accent: var(--ds-brand); --role-secondary: var(--ds-accent); --role-soft: var(--ds-brand-soft);
    background: var(--ds-surface) !important; border-color: var(--ds-line);
}
.role-dashboard-banner-copy h2 { color: var(--ds-text); }
.role-dashboard-banner-copy p { color: var(--ds-text-2) !important; }
.role-dashboard-banner-copy .btn { background: var(--ds-brand); color: #fff; border-color: var(--ds-brand); box-shadow: none; }
[data-theme="dark"] .role-dashboard-banner-copy .btn { color: #12101f; }
.role-dashboard-banner-art { background: var(--ds-brand-soft); box-shadow: none; transform: none; }
.role-dashboard-banner-art .art-float { background: var(--ds-accent); color: #3d2a00; box-shadow: none; }
.role-dashboard-banner-art .art-two { background: var(--ds-brand) !important; color: #fff; }

.auth-logo { display: block; margin: 0 auto; width: 64px; height: 64px; }
.stitch-auth .stitch-brand-name { color: var(--ds-text); font-size: 1.3rem; }
.stitch-auth .auth-heading h1 { color: var(--ds-text); }
.stitch-auth .auth-form-panel { background: var(--ds-surface); }
.stitch-auth .auth-btn { background: var(--ds-brand); border-radius: 10px; box-shadow: none; }
.stitch-auth .auth-btn:hover { background: var(--ds-brand-hover); }
.stitch-auth .ghost-link, .stitch-auth .auth-subtle-link, .stitch-auth .auth-back-link { color: var(--ds-brand) !important; }
.stitch-auth .auth-form-group { background: var(--ds-surface); border-color: var(--ds-line-strong); border-radius: 10px; }
.stitch-auth .auth-form-group:focus-within { border-color: var(--ds-brand); box-shadow: var(--ds-ring); }
.stitch-auth .auth-form-group input { color: var(--ds-text); background: transparent; }
.stitch-auth .auth-trust, .stitch-auth .auth-trust .material-symbols-outlined { color: var(--ds-text-3); }
.auth-card .auth-illustration, .stitch-auth .auth-illustration { background: linear-gradient(160deg, #2e1473 0%, var(--ds-brand) 100%) !important; }
.auth-illustration .visual-card, .auth-illustration .floating-badge { box-shadow: none; }
.auth-illustration .brand-title { color: #fff; }

html #aichat { --ai-brand: var(--ds-brand); --ai-brand2: #7a56e0; }
html[data-theme="dark"] #aichat { --ai-brand2: #6b49cf; }

/* ---------- ۱۳) صفحهٔ اصلی عمومی ---------- */
.landing-navbar { background: color-mix(in srgb, var(--ds-surface) 90%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--ds-line); position: sticky; top: 0; z-index: 1050; }
.landing-navbar-inner { max-width: 1180px; gap: 1.5rem; }
.landing-brand { color: var(--ds-text); font-weight: 900; text-decoration: none; display: flex; align-items: center; gap: .6rem; }
.landing-brand-mark { background: none !important; box-shadow: none !important; width: 34px; height: 34px; padding: 0; display: grid; place-items: center; }
.landing-brand-mark img { width: 34px; height: 34px; display: block; }
.landing-nav-links { display: none; gap: .25rem; margin-inline-end: auto; }
.landing-nav-links a { padding: .4rem .8rem; border-radius: 8px; color: var(--ds-text-2); font-weight: 700; font-size: .88rem; text-decoration: none; }
.landing-nav-links a:hover { background: var(--ds-surface-2); color: var(--ds-brand); }
@media (min-width: 900px) { .landing-nav-links { display: flex; } }

.landing-intro { max-width: 820px; margin: 0 auto; padding: 4rem 1.25rem 2.25rem; text-align: center; }
.landing-intro h1 { font-size: clamp(1.75rem, 4.2vw, 2.7rem); font-weight: 900; line-height: 1.5; margin: 0 0 1rem; }
.landing-intro p { font-size: 1.05rem; line-height: 2; color: var(--ds-text-2); max-width: 640px; margin: 0 auto 1.75rem; }
.landing-intro-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

.landing-hero { max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }
.landing-hero-carousel { border-radius: 22px; overflow: hidden; border: 1px solid var(--ds-line); box-shadow: var(--ds-shadow-2); }
.landing-hero-img { width: 100%; height: auto; max-height: 460px; object-fit: cover; }
.landing-main { max-width: 1180px; margin-inline: auto; }
.landing-section { padding: 4rem 1.25rem; }
.landing-section-tint { background: transparent; }
.landing-kicker { display: inline-block; padding: .2rem .8rem; border-radius: 999px; background: var(--ds-brand-soft); color: var(--ds-brand); font-size: .75rem; font-weight: 800; }
.landing-section-head h2 { font-size: 1.7rem; font-weight: 900; margin-top: .75rem; }
.landing-feature-card, .landing-role-card { border-radius: var(--ds-r-lg); transition: border-color .2s, transform .2s; }
.landing-feature-card:hover, .landing-role-card:hover { border-color: var(--ds-brand-line); transform: translateY(-2px); }
.landing-feature-icon, .landing-role-icon,
.landing-section-tint .row > div .landing-role-icon { background: var(--ds-brand-soft) !important; color: var(--ds-brand) !important; border-radius: 12px; }
.landing-feature-card h3, .landing-role-card h3 { font-size: 1.02rem; font-weight: 800; }
.landing-feature-card p, .landing-role-card p { color: var(--ds-text-2); font-size: .88rem; line-height: 1.9; }
.landing-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); counter-reset: none; }
.landing-steps li { position: relative; padding: 1.5rem; background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); }
.landing-step-no { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--ds-accent); color: #3d2a00; font-weight: 900; margin-bottom: .9rem; }
.landing-steps h3 { font-size: 1rem; font-weight: 800; }
.landing-steps p { color: var(--ds-text-2); font-size: .88rem; line-height: 1.9; margin: 0; }
.landing-cta { background: linear-gradient(160deg, #2e1473 0%, #5225c0 100%); border-radius: 24px; margin: 1rem 1.25rem 3.5rem; padding: 3.5rem 1.5rem; color: #fff; text-align: center; }
.landing-cta h2 { color: #fff; font-weight: 900; }
.landing-cta p { color: rgba(255, 255, 255, .85); }
.landing-cta .btn-brand { background: var(--ds-accent); border-color: var(--ds-accent); color: #3d2a00; }
.landing-cta .btn-brand:hover { background: #ffc24f; border-color: #ffc24f; color: #3d2a00; }
.landing-footer { background: var(--ds-surface); border-top: 1px solid var(--ds-line); color: var(--ds-text-2); }
.landing-footer a { color: var(--ds-text-2); }
.landing-footer a:hover { color: var(--ds-brand); }
.landing-footer-bottom { border-top: 1px solid var(--ds-line); color: var(--ds-text-3); }

/* ---------- ۱۴) نشان نرم و حالت خالی ---------- */
.badge-soft { border-radius: 999px; font-weight: 700; font-size: .74rem; padding: .28em .75em; gap: .3rem; }
.badge-soft .material-symbols-outlined { font-size: .95rem; }
.badge-soft.badge-brand { background: var(--ds-brand-soft); color: var(--ds-brand); }
.badge-soft.badge-danger { background: var(--ds-danger-soft); color: var(--ds-danger); }
.badge-soft.badge-warning { background: var(--ds-warn-soft); color: var(--ds-warn); }
.badge-soft.badge-info { background: var(--ds-info-soft); color: var(--ds-info); }
.badge-soft.badge-success { background: var(--ds-ok-soft); color: var(--ds-ok); }
.badge-soft.badge-muted { background: var(--ds-surface-2); color: var(--ds-text-2); }
.empty-state { color: var(--ds-text-3); text-align: center; padding: 2rem 1rem; }
.empty-state .material-symbols-outlined { display: block; font-size: 2.4rem; margin: 0 auto .5rem; color: var(--ds-brand-line); }

/* ---------- ۱۵) هماهنگی بوت‌استرپ و FAB ---------- */
:root, [data-theme="light"], [data-theme="dark"] { --bs-border-color: var(--ds-line); --bs-body-color: var(--ds-text); --bs-body-bg: var(--ds-bg); --bs-link-color: var(--ds-brand); }
hr { border-color: var(--ds-line); opacity: 1; }
.mobile-fab { background: var(--ds-brand) !important; }
