/* =====================================================================
   سامانه برنامه‌ریزی تحصیلی — سیستم طراحی «شاد/رترو» (Flip7-inspired)
   بر اساس flip7-card-game-DESIGN.md — پالت فیروزه‌ای/طلایی/مرجانی،
   دکمه‌های حبه‌ای، سایه‌های رنگی درخشان، لبه‌های گرد بزرگ.
   واحدهای rpx سند مرجع (مبنای طرح 750rpx=375px) به px تبدیل شده‌اند: px = rpx / 2
   نام متغیرهای CSS با نسخهٔ قبلی یکی نگه داشته شده تا در PHP جایی نشکند؛
   فقط مقادیر رنگ عوض شده‌اند.
   ===================================================================== */

:root,
[data-theme="light"] {
    /* --- پالت خام Flip7 --- */
    --teal: #14b8a6;
    --teal-light: #5eead4;
    --teal-dark: #0f766e;
    --teal-bg: #ecfeff;
    --gold: #fbbf24;
    --gold-light: #fde68a;
    --gold-dark: #d97706;
    --coral: #fb7185;
    --coral-light: #fda4af;
    --coral-dark: #e11d48;
    --cream: #fff7ed;
    --sky: #60a5fa;
    --ok-green: #22c55e;
    --err-red: #ef4444;

    /* --- نگاشت معنایی (نام متغیرها ثابت مانده) --- */
    --brand: var(--teal);
    --brand-hover: var(--teal-dark);
    --brand-soft: var(--teal-bg);
    --brand-contrast: #ffffff;

    --bg-body: #EFF8F7;
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --bg-sidebar: var(--teal-dark);
    --bg-sidebar-active: var(--teal);
    --bg-topbar: #ffffff;
    --bg-hover: var(--teal-bg);
    --bg-input: var(--cream);

    --text-main: #1B2624;
    --text-muted: #5B6D68;
    --text-on-brand: #ffffff;
    --text-sidebar: #E8F6F5;
    --text-sidebar-muted: #BFE3DF;

    --border-color: #DCEEEC;
    --shadow-card: 0 4px 20px rgba(43, 168, 162, .12);
    --shadow-sm: 0 2px 8px rgba(20, 34, 30, .08);
    --shadow-md: 0 4px 16px rgba(20, 34, 30, .12);
    --shadow-lg: 0 8px 32px rgba(20, 34, 30, .18);
    --glow-coral: 0 4px 20px rgba(239, 108, 74, .35);
    --glow-teal: 0 4px 20px rgba(43, 168, 162, .30);
    --glow-gold: 0 4px 20px rgba(255, 210, 63, .45);
    --glow-sky: 0 4px 16px rgba(93, 173, 226, .30);
    --focus-ring: 0 0 0 4px rgba(43, 168, 162, .18);

    /* --- Tokens from stitch-preview --- */
    --page-bg: #fffaf5;
    --panel-bg: #ffffff;
    --panel-muted: #fff3e8;
    --panel-border: #f3dfc4;
    --text-soft: #5c5147;
    --text-strong: #20160f;
    --teal-ink: #0f766e;
    --teal-ink-deep: #083b39;
    --gold-accent: #fbbf24;
    --gold-accent-deep: #452403;
    --surface-1: #ffffff;
    --surface-2: #fdf7f1;
    --surface-3: #fff7ed;
    --stroke-strong: #f0dfc8;
    --sidebar-bg: linear-gradient(145deg, #0f766e 0%, #0d9488 45%, #115e59 100%);
    --topbar-bg: rgba(255,255,255,.88);
    --topbar-border: rgba(15,118,110,.14);
    --page-header-bg: linear-gradient(135deg, rgba(20,184,166,.12), rgba(251,191,36,.20));
    --page-surface-bg: linear-gradient(180deg, rgba(255,255,255,.94), rgba(253,247,241,.94));
    --illustration-bg: linear-gradient(135deg, rgba(20,184,166,.14) 0%, rgba(251,191,36,.16) 100%);
    --shadow-soft: 0 14px 44px rgba(0, 106, 102, .08);
    --shadow-strong: 0 16px 36px rgba(0, 106, 102, .12);
    --shadow-elevated: 0 20px 48px rgba(0, 106, 102, .14);
    --radius-xl: 2rem;
    --radius-lg: 1.25rem;
    --radius-md: 1rem;
    --radius-sm: .75rem;
    --spacing-1: .25rem;
    --spacing-2: .5rem;
    --spacing-3: .75rem;
    --spacing-4: 1rem;
    --spacing-5: 1.25rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
    --spacing-10: 2.5rem;
    --spacing-12: 3rem;

    --danger: var(--coral);
    --danger-soft: #FBE9E4;
    --warning: var(--gold-dark);
    --warning-soft: #FFF6DC;
    --info: var(--sky);
    --info-soft: #E9F3FB;
    --success: var(--ok-green);
    --success-soft: #E4F7EC;

    --bounce: cubic-bezier(.34, 1.56, .64, 1);

    color-scheme: light;
}

[data-theme="dark"] {
    --teal: #3CC4BD;
    --teal-light: #5AD6CF;
    --teal-dark: #1E8C86;
    --teal-bg: rgba(60, 196, 189, .14);
    --gold: #FFD23F;
    --gold-light: #FFE47A;
    --gold-dark: #E6B800;
    --coral: #FF8A6A;
    --coral-light: #FFA98D;
    --coral-dark: #D45233;
    --cream: #22322B;
    --sky: #7EC1EA;
    --ok-green: #3FCB80;
    --err-red: #F1685C;

    --brand: var(--teal);
    --brand-hover: var(--teal-light);
    --brand-soft: var(--teal-bg);
    --brand-contrast: #06110e;

    --bg-body: #101C19;
    --bg-card: #172A25;
    --bg-elevated: #1D332C;
    --bg-sidebar: #0C1917;
    --bg-sidebar-active: #1B332C;
    --bg-topbar: #172A25;
    --bg-hover: #1D332C;
    --bg-input: #22322B;

    --text-main: #EAF6F3;
    --text-muted: #93B0AA;
    --text-on-brand: #06110e;
    --text-sidebar: #DCF0EC;
    --text-sidebar-muted: #7FA69E;

    --page-bg: #071513;
    --panel-bg: #10221f;
    --panel-muted: #1d2f2b;
    --panel-border: #28433f;
    --text-soft: #b7d4ce;
    --text-strong: #f5fffc;
    --teal-ink: #8ce7de;
    --teal-ink-deep: #dffcf8;
    --surface-1: #132925;
    --surface-2: #0f1f1b;
    --surface-3: #19332d;
    --stroke-strong: #2e4b45;
    --sidebar-bg: linear-gradient(145deg, #052f2d 0%, #0f766e 45%, #134e4a 100%);
    --topbar-bg: rgba(10,22,20,.9);
    --topbar-border: rgba(255,255,255,.08);
    --page-header-bg: linear-gradient(135deg, rgba(45,212,191,.18), rgba(251,191,36,.16));
    --page-surface-bg: linear-gradient(180deg, rgba(16,34,31,.95), rgba(8,20,17,.96));
    --illustration-bg: linear-gradient(135deg, rgba(45,212,191,.16) 0%, rgba(251,191,36,.16) 100%);

    --border-color: #24413B;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, .35);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .35);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, .45);
    --glow-coral: 0 4px 20px rgba(255, 138, 106, .30);
    --glow-teal: 0 4px 20px rgba(60, 196, 189, .30);
    --glow-gold: 0 4px 20px rgba(255, 210, 63, .35);
    --glow-sky: 0 4px 16px rgba(126, 193, 234, .30);
    --focus-ring: 0 0 0 4px rgba(60, 196, 189, .25);

    --danger: var(--coral);
    --danger-soft: rgba(255, 138, 106, .16);
    --warning: var(--gold);
    --warning-soft: rgba(255, 210, 63, .16);
    --info: var(--sky);
    --info-soft: rgba(126, 193, 234, .16);
    --success: var(--ok-green);
    --success-soft: rgba(63, 203, 128, .16);

    --bounce: cubic-bezier(.34, 1.56, .64, 1);

    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-weight: 400;
    background:
        radial-gradient(circle at top right, rgba(252, 208, 61, .16), transparent 24%),
        linear-gradient(180deg, var(--page-bg) 0%, var(--bg-body) 100%);
    color: var(--text-main);
    transition: background-color .15s ease, color .15s ease;
}

a {
    text-decoration: none;
}

b, strong, .fw-bold {
    font-weight: 800;
}

:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}

/* ---------------------------------------------------------------------
   چیدمان کلی: نوار بالا تمام‌عرض + (سایدبار راست + محتوا) زیرش
   --------------------------------------------------------------------- */
:root {
    --topbar-h: 64px;
}

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

.app-shell::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at top right, rgba(252, 208, 61, .22), transparent 28%),
        radial-gradient(circle at 0% 100%, rgba(0, 106, 102, .14), transparent 34%),
        linear-gradient(135deg, rgba(255,255,255,.32), transparent 55%);
    z-index: -1;
}

.app-row {
    display: flex;
    flex: 1;
    min-height: 0;
    gap: 1rem;
    padding: .8rem 1rem 1rem;
}

.app-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: calc(var(--topbar-h) + .4rem);
    height: calc(100vh - var(--topbar-h) - 1.2rem);
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 1.7rem;
    box-shadow: 0 24px 56px rgba(2, 70, 66, .28);
    backdrop-filter: blur(18px);
    isolation: isolate;
}

.app-sidebar::before {
    content: '';
    position: sticky;
    top: 0;
    height: 70px;
    margin: -1rem -1rem 0;
    background: linear-gradient(180deg, rgba(255,255,255,.08), transparent);
    pointer-events: none;
}

/* بخش برند داخل نوار بالا — هم‌عرض سایدبار تا خط جداکننده دقیقاً زیرش ادامه پیدا کند */
.topbar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 280px;
    flex-shrink: 0;
    padding-left: 1.1rem;
    margin-left: .25rem;
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.02rem;
    letter-spacing: .01em;
}

.topbar-brand .brand-badge {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--gold-light), var(--gold-dark));
    color: #4A3600;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: var(--glow-gold);
}

@media (max-width: 767.98px) {
    .topbar-brand {
        width: auto;
        border-left: none;
        margin-left: 0;
        padding-left: 0;
    }
}

.app-sidebar .user-mini {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.15rem 1.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
    margin: .75rem .75rem .55rem;
    border-radius: 1.25rem;
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.app-sidebar .user-mini .avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--gold-light), var(--gold));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4A3600;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.app-sidebar .user-mini .name {
    color: #fff;
    font-weight: 800;
    font-size: .92rem;
}

.app-sidebar .user-mini .role {
    font-size: .76rem;
    color: var(--text-sidebar-muted);
}

.app-nav {
    list-style: none;
    margin: 0;
    padding: .65rem;
    flex: 1;
}

.app-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    color: var(--text-sidebar);
    padding: .82rem .95rem;
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 700;
    margin-bottom: .3rem;
    transition: background-color .2s var(--bounce), color .2s var(--bounce), transform .2s var(--bounce), box-shadow .2s ease;
    position: relative;
}

.app-nav .nav-link::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(255,255,255,.08), transparent);
    opacity: 0;
    transition: opacity .2s ease;
}

.app-nav .nav-link:hover::after,
.app-nav .nav-link.active::after {
    opacity: 1;
}

.app-nav .nav-link i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    color: var(--text-sidebar-muted);
}

.app-nav .nav-link:hover {
    background-color: rgba(255,255,255,.14);
    color: #fff;
    transform: translateX(-2px);
}

.app-nav .nav-link.active {
    background: linear-gradient(145deg, var(--gold-light), var(--gold));
    color: #4A3600;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(252, 208, 61, .22);
}

.app-nav .nav-link.active i {
    color: #4A3600;
}

.app-nav .nav-badge {
    margin-right: auto;
    background: var(--coral);
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 .35rem;
    box-shadow: var(--glow-coral);
}

.app-sidebar .sidebar-footer {
    padding: .9rem 1.25rem;
    border-top: 3px dashed rgba(255, 255, 255, .12);
    font-size: .75rem;
    color: var(--text-sidebar-muted);
}

/* ---------------------------------------------------------------------
   ستون محتوا
   --------------------------------------------------------------------- */
.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    background: var(--topbar-bg);
    backdrop-filter: blur(18px);
    border: 1px solid var(--topbar-border);
    padding: 0 1.25rem;
    min-height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: .75rem;
    z-index: 1060;
    margin: .75rem 1rem 0;
    border-radius: 1.45rem;
    box-shadow: 0 14px 34px rgba(15,118,110,.10);
}

.app-topbar::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(255,255,255,.18), transparent 35%, rgba(255,255,255,.08));
    pointer-events: none;
}

.app-topbar .search-box {
    flex: 1;
    max-width: 420px;
}

.app-topbar .search-box .form-control {
    background-color: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-main);
    border-radius: 999px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    font-size: 1.05rem;
    transition: transform .2s var(--bounce), background-color .15s ease, color .15s ease;
}

.icon-btn:hover {
    background-color: var(--bg-hover);
    color: var(--brand);
    transform: scale(1.08);
}

.theme-toggle {
    position: relative;
}

.app-content {
    padding: 1.4rem 1.2rem 2rem;
    flex: 1;
    max-width: 1500px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.page-header {
    margin-bottom: .2rem;
    padding: 1.3rem 1.35rem;
    border-radius: 1.7rem;
    background: var(--page-header-bg);
    border: 1px solid var(--panel-border);
    box-shadow: 0 18px 44px rgba(15,118,110,.10);
    backdrop-filter: blur(6px);
}
    display: flex;
    flex-direction: column;
    gap: .35rem;
    position: relative;
    overflow: hidden;
}

.page-header::before,
.page-header::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.page-header::before {
    width: 180px;
    height: 180px;
    background: rgba(255,255,255,.22);
    top: -70px;
    right: -40px;
}

.page-header::after {
    width: 120px;
    height: 120px;
    background: rgba(252, 208, 61, .18);
    bottom: -40px;
    left: -20px;
}

.page-header h1 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: .01em;
    margin: 0;
    color: var(--teal-ink-deep);
}

.page-header .subtitle {
    color: var(--text-muted);
    font-size: .88rem;
    position: relative;
    z-index: 1;
}

.page-header .header-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    width: fit-content;
    padding: .4rem .7rem;
    border-radius: 999px;
    background: rgba(255,255,255,.82);
    border: 1px solid rgba(0, 106, 102, .12);
    color: var(--teal-ink-deep);
    font-size: .78rem;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(0, 106, 102, .08);
    position: relative;
    z-index: 1;
}

.page-header .header-pill i {
    color: var(--gold-accent-deep);
}

.page-surface {
    background: var(--page-surface-bg);
    border: 1px solid var(--panel-border);
    border-radius: 1.5rem;
    box-shadow: 0 16px 36px rgba(15,118,110,.08);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.page-surface::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(0, 106, 102, .035), rgba(252, 208, 61, .05));
}

.page-surface::after {
    content: '';
    position: absolute;
    inset: auto -2rem -2rem auto;
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(252, 208, 61, .18), transparent 70%);
    pointer-events: none;
}

.page-surface > * {
    position: relative;
    z-index: 1;
}

/* ---------------------------------------------------------------------
   کارت‌ها
   --------------------------------------------------------------------- */
.card {
    background: linear-gradient(145deg, var(--surface-1), var(--surface-2));
    border: 1px solid var(--panel-border);
    border-radius: 1.35rem;
    box-shadow: 0 16px 34px rgba(15,118,110,.08);
    backdrop-filter: blur(6px);
}
    color: var(--text-main);
    overflow: hidden;
    position: relative;
    transition: transform .2s var(--bounce), box-shadow .2s ease;
    backdrop-filter: blur(8px);
}

.card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--teal), var(--gold));
    opacity: .85;
}

.card::after {
    content: '';
    position: absolute;
    inset: auto -1rem -1rem auto;
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(43, 168, 162, .08), transparent 70%);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
}

.card-header {
    background: linear-gradient(90deg, rgba(0, 106, 102, .045), rgba(252, 208, 61, .07));
    border-bottom: 1px solid var(--panel-border);
    font-weight: 800;
    padding: 1rem 1.15rem;
    color: var(--teal-ink-deep);
    letter-spacing: .01em;
}

.card-body {
    padding: 1.15rem 1.2rem;
}

.card-accent {
    border-right: 3px solid var(--brand);
}

.card-accent.accent-danger {
    border-right-color: var(--coral);
    background: linear-gradient(90deg, var(--danger-soft), var(--bg-card) 40%);
}
.card-accent.accent-warning {
    border-right-color: var(--gold);
    background: linear-gradient(90deg, var(--warning-soft), var(--bg-card) 40%);
    box-shadow: var(--glow-gold);
}
.card-accent.accent-info { border-right-color: var(--info); }
.card-accent.accent-success { border-right-color: var(--success); }

/* کارت آماری کوچک بالای داشبورد — فشرده، آیکون بالا */
.stat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: 1.2rem .85rem;
    text-align: center;
    border: 1px solid var(--panel-border);
    background: linear-gradient(145deg, var(--surface-1), var(--surface-3));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}

.stat-tile .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.stat-icon.bg-brand-soft   { background: linear-gradient(145deg, var(--teal-light), var(--teal)); color: #fff; }
.stat-icon.bg-danger-soft  { background: linear-gradient(145deg, var(--coral-light), var(--coral)); color: #fff; }
.stat-icon.bg-warning-soft { background: linear-gradient(145deg, var(--gold-light), var(--gold)); color: #4A3600; }
.stat-icon.bg-info-soft    { background: linear-gradient(145deg, #8FCBEF, var(--sky)); color: #fff; }
.stat-icon.bg-success-soft { background: linear-gradient(145deg, #6FDBA0, var(--ok-green)); color: #fff; }

.stat-tile .stat-value {
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.2;
}

.stat-tile .stat-label {
    font-size: .78rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* هدر توپر رنگی برای پنل‌های فهرست‌دار (مثل «کارهای من» / «پیگیری از دیگران») */
.list-panel .card-header {
    border-bottom: none;
    color: #fff;
    font-weight: 800;
    letter-spacing: .01em;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.list-panel.panel-danger .card-header  { background: linear-gradient(135deg, var(--coral-light), var(--coral)); box-shadow: var(--glow-coral); }
.list-panel.panel-success .card-header { background: linear-gradient(135deg, #6FDBA0, var(--ok-green)); box-shadow: var(--glow-teal); }
.list-panel.panel-info .card-header    { background: linear-gradient(135deg, #8FCBEF, var(--sky)); box-shadow: var(--glow-sky); }
.list-panel.panel-warning .card-header { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #4A3600; box-shadow: var(--glow-gold); }
.list-panel.panel-brand .card-header   { background: linear-gradient(135deg, var(--teal-light), var(--brand)); color: var(--text-on-brand); box-shadow: var(--glow-teal); }

/* ---------------------------------------------------------------------
   بج‌ها
   --------------------------------------------------------------------- */
.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .65rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 800;
}

.badge-soft.badge-brand   { background: var(--brand-soft); color: var(--brand-hover); }
.badge-soft.badge-danger  { background: var(--danger-soft); color: var(--coral-dark); }
.badge-soft.badge-warning { background: var(--warning-soft); color: var(--gold-dark); }
.badge-soft.badge-info    { background: var(--info-soft); color: #2E75A6; }
.badge-soft.badge-success { background: var(--success-soft); color: #1E8449; }
.badge-soft.badge-muted   { background: var(--bg-hover); color: var(--text-muted); }

/* کد کاربری قابل کپی */
.user-code-box {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    background: var(--cream);
    border: 2px dashed var(--gold-dark);
    border-radius: 999px;
    padding: .5rem 1rem;
    font-family: 'Courier New', monospace;
    font-weight: 800;
    letter-spacing: .5px;
}

/* ---------------------------------------------------------------------
   فرم‌ها
   --------------------------------------------------------------------- */
.form-control, .form-select {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    color: var(--text-main);
    padding: .8rem .95rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .02);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.form-control::placeholder, .form-select::placeholder {
    color: var(--text-muted);
    opacity: .85;
}

.form-control:hover, .form-select:hover {
    border-color: rgba(0, 106, 102, .28);
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-input);
    color: var(--text-main);
    border-color: var(--brand);
    box-shadow: var(--focus-ring);
    transform: translateY(-1px);
}

.form-label {
    font-size: .85rem;
    font-weight: 700;
    margin-bottom: .35rem;
    color: var(--teal-ink-deep);
}

.alert {
    border-radius: 1rem;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
    padding: .9rem 1rem;
}

.alert-success { background: var(--success-soft); color: #1E5E3B; }
.alert-danger { background: var(--danger-soft); color: #8A2F1D; }
.alert-warning { background: var(--warning-soft); color: #7A5600; }
.alert-info { background: var(--info-soft); color: #1F4C69; }

.list-group-item {
    border-color: var(--panel-border);
    border-radius: 0;
    padding: .95rem 1rem;
}

.list-group-item:hover {
    background: rgba(0, 106, 102, .035);
}

.table {
    --bs-table-color: var(--text-main);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--panel-border);
    --bs-table-striped-color: var(--text-main);
    --bs-table-striped-bg: rgba(0, 106, 102, .03);
    --bs-table-hover-color: var(--text-main);
    --bs-table-hover-bg: rgba(0, 106, 102, .05);
}

.table thead th {
    background: linear-gradient(90deg, rgba(0, 106, 102, .05), rgba(252, 208, 61, .06));
    color: var(--teal-ink-deep);
    font-weight: 800;
}

.table > :not(caption) > * > * {
    padding: .85rem 1rem;
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color .15s ease, transform .15s ease;
}

.table tbody tr:hover {
    background: rgba(0, 106, 102, .04);
}

.table-responsive {
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(0, 106, 102, .04);
}

.dropdown-menu, .modal-content {
    border: 1px solid var(--panel-border);
    border-radius: 1rem;
    box-shadow: var(--shadow-strong);
    backdrop-filter: blur(14px);
}

.nav-tabs .nav-link {
    border-radius: 999px;
    margin-left: .2rem;
    color: var(--text-muted);
    font-weight: 700;
}

.nav-tabs .nav-link.active {
    background: var(--brand-soft);
    color: var(--brand-hover);
    border-color: transparent;
}

.pagination .page-link {
    border-radius: 999px;
    margin: 0 .15rem;
    color: var(--teal-ink);
}

.pagination .page-item.active .page-link {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.badge-soft {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .03);
}

/* بازنویسی رنگ پیش‌فرض بوت‌استرپ برای تب‌های nav-pills با پالت برند */
.squishy {
    transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
}

.squishy:active {
    transform: scale(.95);
}

.glow-teal {
    box-shadow: 0 4px 16px rgba(0, 106, 102, .08);
}

.glow-gold {
    box-shadow: 0 4px 16px rgba(252, 208, 61, .3);
}

.glow-gold-hover:hover {
    box-shadow: 0 12px 24px rgba(252, 208, 61, .4);
}

.glass-panel {
    background: linear-gradient(135deg, rgba(0, 106, 102, .05) 0%, rgba(43, 168, 162, .15) 100%);
    backdrop-filter: blur(10px);
}

.focus-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background-color: var(--teal-ink);
    width: 0;
    transition: width .3s ease;
}

.input-wrapper:focus-within .focus-indicator {
    width: 100%;
}

.nav-pills {
    gap: .35rem;
}

.nav-pills .nav-link {
    border-radius: 999px;
    font-weight: 700;
    color: var(--text-muted);
    padding: .4rem 1rem;
    transition: background-color .2s var(--bounce), color .2s var(--bounce);
}

.nav-pills .nav-link:hover {
    background-color: var(--bg-hover);
    color: var(--brand-hover);
}

.nav-pills .nav-link.active {
    background: linear-gradient(145deg, var(--gold-light), var(--gold));
    color: #4A3600;
    box-shadow: var(--glow-gold);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: .01em;
    box-shadow: 0 10px 24px rgba(0, 106, 102, .08);
    transition: transform .2s var(--bounce), box-shadow .2s ease, background-color .2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: scale(.95);
}

.btn-brand {
    background: linear-gradient(135deg, var(--gold-accent), var(--gold) 60%, var(--gold-dark));
    border-color: var(--gold-dark);
    color: #4A3600;
    font-weight: 800;
    box-shadow: 0 16px 30px rgba(251, 191, 36, .30);
}

.btn-brand:hover {
    background: linear-gradient(160deg, var(--gold-light), var(--gold-dark));
    border-color: var(--gold-dark);
    color: #4A3600;
    box-shadow: var(--glow-gold);
}

.btn-outline-brand {
    border-color: var(--brand);
    color: var(--brand-hover);
    background: transparent;
}

.btn-outline-brand:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--text-on-brand);
}

/* حالت انتخاب‌شدهٔ چیپ‌های btn-check (مثل درس‌های هر روز در ویزارد) — کامل رنگی و پایدار،
   چه با کلیک کاربر و چه هنگام پرکردن خودکار فرم (ویرایش) با همان وضعیت checked بماند */
.btn-check:checked + .btn-outline-brand,
.btn-check:active + .btn-outline-brand,
.btn-outline-brand.active {
    background: linear-gradient(145deg, var(--teal-light), var(--teal));
    border-color: var(--teal-dark);
    color: #fff;
    font-weight: 700;
    box-shadow: var(--glow-teal);
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--page-bg);
    padding: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 1180px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 720px;
}

.auth-card .auth-form-panel {
    background: var(--page-bg);
    padding: clamp(1.5rem, 3vw, 3rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card .auth-form-panel .inner {
    width: 100%;
    max-width: 430px;
}

.auth-card .auth-illustration {
    background: var(--illustration-bg);
    padding: clamp(1.5rem, 3vw, 3rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(255,255,255,.2);
}

.auth-card .auth-illustration::before,
.auth-card .auth-illustration::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
}

.auth-card .auth-illustration::before {
    top: -12%;
    right: -10%;
    width: 16rem;
    height: 16rem;
    background: rgba(0, 106, 102, .10);
}

.auth-card .auth-illustration::after {
    bottom: -10%;
    left: -10%;
    width: 20rem;
    height: 20rem;
    background: rgba(252, 208, 61, .15);
}

.auth-card .auth-branding {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
    position: relative;
    z-index: 1;
}

.auth-card .auth-branding .brand-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--panel-bg);
    box-shadow: var(--shadow-strong);
    color: var(--teal-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.auth-card .auth-branding .brand-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--teal-ink-deep);
}

.auth-card .auth-illustration-visual {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
    z-index: 1;
}

.auth-card .auth-illustration-visual .visual-card {
    width: min(100%, 320px);
    background: rgba(255,255,255,.86);
    border: 1px solid rgba(255,255,255,.65);
    border-radius: 1.75rem;
    box-shadow: var(--shadow-strong);
    padding: 1.25rem;
    transform: rotate(-2deg);
}

.auth-card .auth-illustration-visual .visual-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: .35rem;
    height: 8rem;
    margin-bottom: 1rem;
    padding: .75rem;
    background: rgba(0, 106, 102, .05);
    border-radius: 1rem;
}

.auth-card .auth-illustration-visual .visual-bars span {
    width: 1.1rem;
    border-radius: .5rem .5rem 0 0;
    background: linear-gradient(180deg, var(--teal-ink), var(--teal));
}

.auth-card .auth-illustration-visual .visual-bars span:nth-child(3) {
    background: linear-gradient(180deg, var(--gold-accent), var(--gold));
}

.auth-card .auth-illustration-visual .visual-lines {
    display: grid;
    gap: .5rem;
}

.auth-card .auth-illustration-visual .visual-lines div {
    height: .7rem;
    border-radius: 999px;
    background: var(--panel-border);
}

.auth-card .auth-illustration-visual .visual-lines div:last-child {
    width: 55%;
}

.auth-card .floating-badge {
    position: absolute;
    top: 2rem;
    left: 1rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gold-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 22px rgba(252, 208, 61, .35);
}

.auth-card .auth-illustration-footer {
    text-align: center;
    position: relative;
    z-index: 1;
}

.auth-card .auth-illustration-footer h3 {
    color: var(--teal-ink-deep);
    font-weight: 800;
    margin-bottom: .45rem;
}

.auth-card .auth-illustration-footer p {
    color: var(--text-soft);
    font-size: .95rem;
    line-height: 1.7;
    margin: 0 auto;
    max-width: 18rem;
}

.auth-card .auth-tab-switch {
    display: flex;
    gap: .25rem;
    padding: .25rem;
    background: var(--panel-muted);
    border-radius: 999px;
    margin-bottom: 1.5rem;
}

.auth-card .auth-tab-switch button {
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--text-soft);
    font-weight: 800;
    border-radius: 999px;
    padding: .7rem 1rem;
}

.auth-card .auth-tab-switch button.active {
    background: var(--teal-ink);
    color: #fff;
    box-shadow: 0 8px 18px rgba(0, 106, 102, .16);
}

.auth-card .auth-tab-switch button:hover {
    background: rgba(0, 106, 102, .06);
}

.auth-card .auth-form-group {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--panel-bg), var(--surface-3));
    box-shadow: 0 10px 24px rgba(15,118,110,.06);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.auth-card .auth-form-group:hover {
    transform: translateY(-1px);
}

.auth-card .auth-form-group:focus-within {
    border-color: var(--brand);
    box-shadow: var(--focus-ring);
    transform: translateY(-1px);
}

.auth-card .auth-form-group .input-icon {
    color: #bcc9c7;
    margin-left: .75rem;
}

.auth-card .auth-form-group input {
    border: 0;
    outline: 0;
    width: 100%;
    padding: .95rem 0;
    background: transparent;
    color: var(--text-strong);
}

.auth-card .auth-form-group input::placeholder {
    color: #9aa7a3;
}

.auth-card .auth-form-group .ghost-link {
    color: var(--teal-ink);
    font-size: .8rem;
    font-weight: 700;
}

.auth-card .auth-btn {
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: .95rem 1.2rem;
    background: linear-gradient(135deg, var(--gold-accent), var(--gold));
    color: var(--gold-accent-deep);
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(252, 208, 61, .35);
}

.auth-card .auth-btn:hover {
    box-shadow: 0 12px 24px rgba(252, 208, 61, .45);
}

.auth-card .auth-subtle-link {
    color: var(--teal-ink);
    font-weight: 700;
}

.auth-card .auth-role-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    border-radius: 1rem;
    border: 1px solid var(--panel-border);
    background: var(--panel-bg);
    padding: .9rem .7rem;
    color: var(--text-strong);
}

.auth-card .auth-role-card.active {
    border-color: var(--teal-ink);
    background: rgba(0, 106, 102, .08);
}

.auth-card .auth-role-card.active.student {
    border-color: var(--teal-ink);
}

.auth-card .auth-role-card.active.consultant {
    border-color: var(--gold-accent);
    background: rgba(252, 208, 61, .15);
}

.auth-card .auth-success-card {
    background: var(--panel-muted);
    border: 1px solid var(--panel-border);
    border-radius: 1.4rem;
    padding: 1.25rem;
    text-align: center;
}

.auth-card .auth-success-code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: .18em;
    color: var(--teal-ink);
    display: block;
    margin-top: .35rem;
}

@media (max-width: 991.98px) {
    .auth-card {
        grid-template-columns: 1fr;
    }

    .auth-card .auth-illustration {
        display: none;
    }
}

/* ---------------------------------------------------------------------
   حالت خالی
   --------------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.4rem;
    color: var(--border-color);
    display: block;
    margin-bottom: .75rem;
}

/* ---------------------------------------------------------------------
   ویزارد ۳ مرحله‌ای + جدول هفتگی
   --------------------------------------------------------------------- */
.wizard-steps {
    display: flex;
    justify-content: center;
    gap: .5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.wizard-step-pill {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1.1rem;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 700;
    font-size: .85rem;
}

.wizard-step-pill .num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-hover);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    flex-shrink: 0;
}

.wizard-step-pill.current {
    background: linear-gradient(145deg, var(--gold-light), var(--gold));
    border-color: var(--gold-dark);
    color: #4A3600;
    box-shadow: var(--glow-gold);
}

.wizard-step-pill.current .num {
    background: #4A3600;
    color: var(--gold-light);
}

.wizard-step-pill.done {
    color: var(--brand-hover);
    border-color: var(--brand);
}

.wizard-step-pill.done .num {
    background: var(--brand);
    color: #fff;
}

.week-grid-wrap {
    overflow-x: auto;
}

.week-grid {
    border-collapse: separate;
    border-spacing: 3px;
    width: 100%;
    min-width: 980px;
    table-layout: fixed;
}

.week-grid th {
    font-size: .74rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: .35rem .2rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.week-grid th.day-col,
.week-grid td.day-label {
    width: 92px;
}

.week-grid td.day-label {
    font-size: .8rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    text-align: center;
}

.week-cell {
    width: 46px;
    height: 34px;
    border-radius: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
    transition: background-color .12s ease, transform .1s ease;
    position: relative;
}

.week-cell:hover {
    border-color: var(--brand);
}

/* بلاک مدرسه (بازهٔ شروع/پایان روز، ادغام‌شده با colspan) */
.week-cell.cell-school {
    background: var(--info-soft);
    border-color: var(--sky);
    cursor: default;
}

.week-cell.cell-school .cell-title {
    font-size: .66rem;
    color: #2E75A6;
    font-weight: 700;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 6px;
    line-height: 34px;
    text-align: center;
}

/* بلاک کار فوق‌برنامه */
.week-cell.cell-class {
    background: var(--bg-hover);
    border-color: var(--text-muted);
    cursor: not-allowed;
}

.week-cell.cell-class .cell-title {
    font-size: .62rem;
    color: var(--text-muted);
    font-weight: 700;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
    line-height: 34px;
    text-align: center;
}

.week-cell.cell-study {
    background: linear-gradient(145deg, var(--teal-light), var(--teal));
    border-color: var(--teal-dark);
}

.week-cell.cell-selecting {
    outline: 2px dashed var(--gold-dark);
    outline-offset: 1px;
}

.week-cell.cell-locked {
    cursor: not-allowed;
    opacity: .6;
    background: repeating-linear-gradient(
        45deg,
        var(--bg-hover),
        var(--bg-hover) 5px,
        var(--border-color) 5px,
        var(--border-color) 10px
    );
}

.week-cell.cell-locked:hover {
    border-color: var(--border-color);
}

/* خانهٔ دارای برنامهٔ ثبت‌شده (فاز ۵) */
.week-cell.cell-plan {
    background: linear-gradient(145deg, var(--gold-light), var(--gold));
    border-color: var(--gold-dark);
}

.week-cell.cell-plan .cell-title {
    font-size: .6rem;
    color: #4A3600;
    font-weight: 700;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
    line-height: 34px;
    text-align: center;
}

.week-cell.cell-clickable {
    cursor: pointer;
}

.week-cell.cell-clickable:hover {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

.day-date {
    font-size: .66rem;
    font-weight: 400;
    color: var(--text-muted);
}

.grid-toolbar {
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    margin-top: 1rem;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
    margin-left: .4rem;
    vertical-align: middle;
}

/* ---------------------------------------------------------------------
   ریسپانسیو
   --------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        right: 0;
        top: var(--topbar-h);
        height: calc(100vh - var(--topbar-h));
        z-index: 1050;
        transform: translateX(100%);
        transition: transform .25s var(--bounce);
        box-shadow: -10px 0 30px rgba(0, 0, 0, .25);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(16, 28, 25, .5);
        z-index: 1040;
    }

    .sidebar-backdrop.open {
        display: block;
    }

    .app-content {
        padding: 1rem;
    }
}

@media (min-width: 992px) {
    .sidebar-toggle-btn {
        display: none;
    }
}

/* --- امتیازدهی ستاره‌ای (یادداشت مشاوره) --- */
.star-rating {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: .15rem;
}

.star-rating input {
    display: none;
}

.star-rating label {
    cursor: pointer;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--border-color);
    transition: color .15s;
}

.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
    color: var(--gold);
}

.star-display i {
    font-size: 1.1rem;
    color: var(--border-color);
    margin-inline-start: .1rem;
}

.star-display i.bi-star-fill {
    color: var(--gold);
}

/* --- نوتیفیکیشن داخلی --- */
.notif-badge {
    position: absolute;
    top: 2px;
    inset-inline-end: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    border-radius: 999px;
    background: var(--coral);
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--bg-topbar);
}

.notif-dropdown {
    width: 320px;
    max-height: 420px;
    overflow-y: auto;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.notif-dropdown-header {
    padding: .7rem 1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
}

.notif-item {
    display: block;
    padding: .6rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    text-decoration: none;
}

.notif-item:hover {
    background: var(--bg-hover);
}

.notif-item.notif-unread {
    background: var(--brand-soft);
    position: relative;
}

.notif-dropdown-footer {
    display: block;
    padding: .6rem 1rem;
    text-align: center;
    font-size: .85rem;
    color: var(--brand-hover);
    text-decoration: none;
    font-weight: 700;
}

.notif-dropdown-footer:hover {
    background: var(--bg-hover);
}

/* --- چاپ / خروجی PDF (از طریق دیالوگ چاپ مرورگر) --- */
@media print {
    .no-print {
        display: none !important;
    }

    body * {
        visibility: hidden;
    }

    .print-area,
    .print-area * {
        visibility: visible;
    }

    .print-area {
        position: absolute;
        inset-inline-start: 0;
        top: 0;
        width: 100%;
        box-shadow: none !important;
        border: none !important;
    }
}
