/* =====================================================================
   سنام — سامانه نظرسنجی و ارزیابی مدارس (استان ایلام)
   شیت اصلی — نسخه ۲
   پالت کاملاً نو: سبزآبی روشن، زرد آفتابی، مرجانی و آبی آسمانی
   ===================================================================== */

@font-face {
    font-family: 'IRANSans';
    src: url('IRANSans-web.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    /* پالت پایه برند سنام */
    --sanam-teal:      #0f8b8d;
    --sanam-teal-dark: #076466;
    --sanam-mint:      #06d6a0;
    --sanam-sun:       #ffd166;
    --sanam-coral:     #ef476f;
    --sanam-sky:       #118ab2;
    --sanam-ink:       #14344f;
    --sanam-ink-soft:  #3d5a73;
    --sanam-cream:     #fffaf0;

    /* رنگ‌های نقش‌پذیر (با تم هر نقش بازنویسی می‌شوند) */
    --brand:        #0f8b8d;
    --brand-2:      #06d6a0;
    --brand-soft:   #e3f6f5;
    --accent:       #ffd166;
    --accent-2:     #ef476f;
    --on-brand:     #ffffff;

    --ink:          #14344f;
    --ink-2:        #47657f;
    --muted:        #7d93a6;
    --line:         #e4ecf1;
    --surface:      #ffffff;
    --surface-2:    #f5fafb;

    --radius:       18px;
    --radius-lg:    26px;
    --radius-sm:    12px;
    --shadow:       0 10px 30px rgba(20, 52, 79, .10);
    --shadow-lg:    0 22px 55px rgba(20, 52, 79, .18);
    --ring:         0 0 0 4px rgba(15, 139, 141, .18);
    --ease:         cubic-bezier(.22, 1, .36, 1);
}

/* ---------- تم دانش‌آموز: شاد، پررنگ، کودکانه ---------- */
.theme-student {
    --brand:      #ff6b6b;
    --brand-2:    #ffa94d;
    --brand-soft: #fff1e6;
    --accent:     #ffd43b;
    --accent-2:   #4dabf7;
    --ring:       0 0 0 4px rgba(255, 107, 107, .22);
    --radius:     24px;
    --radius-lg:  32px;
}

/* ---------- تم آموزگار: سبز حرفه‌ای و آرام ---------- */
.theme-teacher {
    --brand:      #0f8b8d;
    --brand-2:    #06d6a0;
    --brand-soft: #e3f6f5;
    --accent:     #ffd166;
    --accent-2:   #118ab2;
    --ring:       0 0 0 4px rgba(15, 139, 141, .20);
}

/* ---------- تم اولیا: بنفش گرم و صمیمی ---------- */
.theme-parent {
    --brand:      #7048a8;
    --brand-2:    #b197fc;
    --brand-soft: #f3efff;
    --accent:     #ffa8a8;
    --accent-2:   #e8590c;
    --ring:       0 0 0 4px rgba(112, 72, 168, .20);
}

/* ---------- تم مهندس: فولادی، دقیق و فنی ---------- */
.theme-engineer {
    --brand:      #1b4965;
    --brand-2:    #5fa8d3;
    --brand-soft: #e7eef5;
    --accent:     #f4801f;
    --accent-2:   #16697a;
    --ring:       0 0 0 4px rgba(27, 73, 101, .20);
    --radius:     12px;
    --radius-lg:  16px;
    --radius-sm:  8px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    font-family: 'IRANSans', Tahoma, sans-serif;
    line-height: 1.85;
    color: var(--ink);
    background: var(--surface-2);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }

/* =====================================================================
   پس‌زمینه تصویری مدرسه (خواسته ۳)
   ===================================================================== */
.scene-bg {
    position: relative;
    min-height: 100vh;
}

.scene-bg::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url('assets/school-bg.svg');
    background-size: cover;
    background-position: bottom center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: -2;
}

/* پرده رنگی نیمه‌شفاف — تصویر مدرسه دیده می‌شود و متن هم خوانا می‌ماند
   رنگ پرده با تم هر نقش تغییر می‌کند */
.scene-bg::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(1200px 680px at 50% 0%,
            color-mix(in srgb, var(--brand) 68%, transparent) 0%,
            transparent 72%),
        linear-gradient(180deg,
            color-mix(in srgb, var(--brand) 52%, transparent) 0%,
            color-mix(in srgb, var(--brand) 26%, transparent) 42%,
            rgba(5, 32, 48, .40) 100%);
    z-index: -1;
}

/* پشتیبان برای مرورگرهای بدون color-mix */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .scene-bg::after {
        background: linear-gradient(180deg, rgba(13, 90, 95, .68) 0%, rgba(5, 32, 48, .45) 100%);
    }
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 18px 70px;
}

.container-wide { max-width: 1320px; }

/* =====================================================================
   سربرگ برند سنام
   ===================================================================== */
.brand-header {
    text-align: center;
    padding: 46px 10px 34px;
    color: #fff;
}

.brand-mark {
    width: 96px;
    height: 96px;
    margin: 0 auto 16px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    color: #fff;
    background: linear-gradient(140deg, var(--brand-2), var(--brand));
    box-shadow: 0 18px 40px rgba(0, 0, 0, .28), inset 0 -4px 12px rgba(0, 0, 0, .15);
    border: 4px solid rgba(255, 255, 255, .28);
    animation: markFloat 4.5s var(--ease) infinite;
}

@keyframes markFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-10px) rotate(-3deg); }
}

.brand-title {
    margin: 0;
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -.5px;
    text-shadow: 0 4px 18px rgba(0, 0, 0, .35);
}

.brand-subtitle {
    margin: 8px auto 0;
    max-width: 640px;
    font-size: 16px;
    color: rgba(255, 255, 255, .92);
    text-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}

.brand-owner {
    display: inline-block;
    margin-top: 16px;
    padding: 7px 18px;
    font-size: 13px;
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    backdrop-filter: blur(6px);
}

/* سربرگ فشرده داخل صفحات */
.brand-header.compact { padding: 26px 10px 18px; }
.brand-header.compact .brand-mark { width: 62px; height: 62px; font-size: 27px; border-radius: 20px; animation: none; }
.brand-header.compact .brand-title { font-size: 27px; }
.brand-header.compact .brand-subtitle { font-size: 13.5px; }

/* =====================================================================
   کارت‌ها
   ===================================================================== */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, .6);
    margin-bottom: 24px;
    animation: riseIn .55s var(--ease) both;
}

@keyframes riseIn {
    from { opacity: 0; transform: translateY(26px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card-title {
    margin: 0 0 6px;
    font-size: 20px;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i { color: var(--brand); }

.card-hint {
    margin: 0 0 22px;
    font-size: 14px;
    color: var(--muted);
}

/* =====================================================================
   انتخاب نقش (خواسته ۷)
   ===================================================================== */
.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
    gap: 16px;
}

.role-card {
    position: relative;
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 24px;
    padding: 26px 22px;
    text-align: center;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s;
    overflow: hidden;
    animation: riseIn .5s var(--ease) both;
}

.role-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 6px;
    background: linear-gradient(90deg, var(--rc-a), var(--rc-b));
}

.role-card:nth-child(1) { animation-delay: .05s; }
.role-card:nth-child(2) { animation-delay: .12s; }
.role-card:nth-child(3) { animation-delay: .19s; }
.role-card:nth-child(4) { animation-delay: .26s; }

.role-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 26px 50px rgba(20, 52, 79, .22);
    border-color: var(--rc-a);
}

.role-card .role-emoji {
    font-size: 46px;
    display: block;
    margin-bottom: 8px;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .12));
}

.role-card .role-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    background: linear-gradient(140deg, var(--rc-b), var(--rc-a));
    box-shadow: 0 10px 20px rgba(0, 0, 0, .16);
}

.role-card h3 { margin: 0 0 8px; font-size: 18px; color: var(--ink); }
.role-card p  { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.8; }

.role-card .role-go {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--rc-a);
}

/* رنگ اختصاصی هر کارت نقش */
.rc-student  { --rc-a: #ff6b6b; --rc-b: #ffa94d; }
.rc-teacher  { --rc-a: #0f8b8d; --rc-b: #06d6a0; }
.rc-parent   { --rc-a: #7048a8; --rc-b: #b197fc; }
.rc-engineer { --rc-a: #1b4965; --rc-b: #5fa8d3; }

/* =====================================================================
   فرم‌ها
   ===================================================================== */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink-2);
    margin-bottom: 8px;
}

input[type="text"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    font-family: inherit;
    font-size: 15px;
    color: var(--ink);
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    transition: border-color .25s, box-shadow .25s, background .25s;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    background: #fff;
    border-color: var(--brand);
    box-shadow: var(--ring);
}

textarea { resize: vertical; line-height: 1.9; }

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237d93a6'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 22px;
    padding-left: 42px;
    cursor: pointer;
}

.input-icon { position: relative; }
.input-icon > i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--brand);
    font-size: 15px;
    pointer-events: none;
}
.input-icon input { padding-right: 44px; }

/* =====================================================================
   دکمه‌ها
   ===================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 13px 26px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), filter .25s;
}

.btn-primary {
    color: var(--on-brand);
    background: linear-gradient(135deg, var(--brand-2), var(--brand));
    box-shadow: 0 12px 26px rgba(20, 52, 79, .22);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 18px 34px rgba(20, 52, 79, .3); }

.btn-ghost {
    color: var(--ink-2);
    background: var(--surface-2);
    border: 2px solid var(--line);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.btn-light {
    color: #fff;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .3);
    backdrop-filter: blur(6px);
}
.btn-light:hover { background: rgba(255, 255, 255, .26); }

.btn-danger {
    color: #c92a2a;
    background: #fff0f0;
    border: 2px solid #ffc9c9;
}
.btn-danger:hover { background: #ffe3e3; }

.btn-sm { padding: 8px 15px; font-size: 13px; }
.btn-block { width: 100%; }

.btn-submit {
    width: 100%;
    padding: 18px;
    font-size: 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-2), var(--brand));
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 800;
    box-shadow: 0 16px 34px rgba(20, 52, 79, .26);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.btn-submit:hover { transform: translateY(-3px); box-shadow: 0 22px 44px rgba(20, 52, 79, .34); }

/* =====================================================================
   نوار وضعیت مدرسه / نقش
   ===================================================================== */
.session-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 20px;
    margin-bottom: 22px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .28);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 14px;
}

.session-bar .chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .22);
}

.session-bar .chip strong { font-weight: 800; }
.session-bar .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.session-bar a { color: #fff; text-decoration: none; }

/* =====================================================================
   نوار پیشرفت
   ===================================================================== */
.progress-sticky {
    position: sticky;
    top: 0;
    z-index: 60;
    margin: 0 -18px 22px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 6px 18px rgba(20, 52, 79, .10);
}

.progress-track {
    height: 12px;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand-2), var(--brand));
    transition: width .45s var(--ease);
}

.progress-label {
    margin-top: 7px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-2);
    display: flex;
    justify-content: space-between;
}

/* =====================================================================
   بخش‌های پرسشنامه
   ===================================================================== */
.section-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 0;
    margin-bottom: 26px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: riseIn .55s var(--ease) both;
}

.section-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 26px;
    background: linear-gradient(120deg, var(--brand), var(--brand-2));
    color: #fff;
}

.section-head .sec-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    background: rgba(255, 255, 255, .22);
    border: 1px solid rgba(255, 255, 255, .3);
}

.section-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.section-head .sec-count {
    margin-right: auto;
    font-size: 12.5px;
    padding: 5px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .2);
    white-space: nowrap;
}

.section-body { padding: 22px 26px 26px; }

.guide-text {
    background: var(--brand-soft);
    color: var(--ink-2);
    border-right: 5px solid var(--brand);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin: 0 0 20px;
}

/* ---------- پرسش ---------- */
.question-box {
    padding: 18px 18px 14px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 2px solid transparent;
    margin-bottom: 16px;
    transition: border-color .3s, background .3s, transform .3s var(--ease);
}

.question-box:hover { background: #fff; border-color: var(--line); }

.question-box.answered {
    background: #fff;
    border-color: color-mix(in srgb, var(--brand) 35%, #ffffff);
}

.q-text {
    display: flex;
    gap: 10px;
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
    margin-bottom: 14px;
    line-height: 1.9;
}

.q-num {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--brand);
    background: var(--brand-soft);
}

/* ---------- طیف امتیاز ---------- */
.rating {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 9px;
}

.rating-item { position: relative; }

.rating-item input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.rating-item .rt-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 11px 5px;
    border-radius: var(--radius-sm);
    background: #fff;
    border: 2px solid var(--line);
    cursor: pointer;
    text-align: center;
    transition: all .25s var(--ease);
    height: 100%;
}

.rating-item .rt-emoji { font-size: 23px; line-height: 1; transition: transform .25s var(--ease); }
.rating-item .rt-label { font-size: 11.5px; font-weight: 700; color: var(--muted); }

.rating-item .rt-box:hover {
    border-color: var(--brand);
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(20, 52, 79, .12);
}
.rating-item .rt-box:hover .rt-emoji { transform: scale(1.18); }

.rating-item input:checked + .rt-box {
    background: linear-gradient(135deg, var(--brand-2), var(--brand));
    border-color: transparent;
    box-shadow: 0 10px 22px rgba(20, 52, 79, .22);
}
.rating-item input:checked + .rt-box .rt-label { color: #fff; }
.rating-item input:checked + .rt-box .rt-emoji { transform: scale(1.25); }

.rating-item input:focus-visible + .rt-box { box-shadow: var(--ring); }

/* تم دانش‌آموز: طیف بزرگ‌تر و شادتر */
.theme-student .rating-item .rt-emoji { font-size: 30px; }
.theme-student .rating-item .rt-label { font-size: 12.5px; }
.theme-student .rating-item .rt-box { padding: 14px 5px; border-width: 3px; }
.theme-student .q-text { font-size: 16.5px; }
.theme-student .section-head h2 { font-size: 20px; }

/* تم مهندس: فشرده‌تر و فنی‌تر */
.theme-engineer .rating-item .rt-emoji { font-size: 18px; }
.theme-engineer .q-text { font-size: 14.5px; }

/* ---------- توضیحات تکمیلی هر بخش (خواسته ۵) ---------- */
.section-note {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: var(--radius);
    background: var(--brand-soft);
    border: 2px dashed color-mix(in srgb, var(--brand) 35%, #ffffff);
}

@supports not (border: 2px dashed color-mix(in srgb, red 50%, blue)) {
    .section-note { border: 2px dashed rgba(15, 139, 141, .35); }
}

.section-note label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink-2);
    margin-bottom: 9px;
}

.section-note label i { color: var(--brand); }

.section-note .optional-tag {
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    border: 1px solid var(--line);
}

.section-note textarea {
    background: #fff;
    border-color: transparent;
    font-size: 14px;
}

/* =====================================================================
   پیام‌ها
   ===================================================================== */
.msg {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 15px 19px;
    border-radius: var(--radius);
    font-size: 14.5px;
    margin-bottom: 20px;
    font-weight: 600;
    animation: riseIn .4s var(--ease) both;
}

.msg i { font-size: 17px; margin-top: 3px; }
.msg.success { background: #e6fcf5; color: #0b7285; border: 1px solid #96f2d7; }
.msg.error   { background: #fff0f3; color: #c92a2a; border: 1px solid #ffc9c9; }
.msg.warning { background: #fff9db; color: #9c6a00; border: 1px solid #ffec99; }
.msg.info    { background: #e7f5ff; color: #1864ab; border: 1px solid #a5d8ff; }

/* کارت موفقیت ثبت */
.done-card { text-align: center; padding: 50px 30px; }

.done-card .done-icon {
    width: 110px;
    height: 110px;
    margin: 0 auto 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: #fff;
    background: linear-gradient(140deg, var(--brand-2), var(--brand));
    box-shadow: 0 18px 40px rgba(20, 52, 79, .25);
    animation: pop .6s var(--ease) both;
}

@keyframes pop {
    0%   { transform: scale(.4); opacity: 0; }
    60%  { transform: scale(1.12); opacity: 1; }
    100% { transform: scale(1); }
}

.done-card h2 { margin: 0 0 10px; font-size: 25px; color: var(--ink); }
.done-card p  { margin: 0 auto 26px; max-width: 470px; color: var(--muted); font-size: 15px; }

.done-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* =====================================================================
   صفحه ورود
   ===================================================================== */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 18px 60px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border-radius: 30px;
    padding: 40px 34px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .3);
    animation: riseIn .6s var(--ease) both;
}

.login-card .login-icon {
    width: 78px;
    height: 78px;
    margin: 0 auto 18px;
    border-radius: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 33px;
    color: #fff;
    background: linear-gradient(140deg, var(--brand-2), var(--brand));
    box-shadow: 0 14px 30px rgba(20, 52, 79, .25);
}

.login-card h1 { margin: 0 0 6px; font-size: 22px; text-align: center; color: var(--ink); }
.login-card .lead { margin: 0 0 26px; text-align: center; font-size: 13.5px; color: var(--muted); }

.helper-note {
    margin-top: 22px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px dashed var(--line);
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.9;
}

/* =====================================================================
   لینک‌های کمکی بالای صفحه
   ===================================================================== */
.top-actions {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 400;
    display: flex;
    gap: 8px;
}

.top-actions a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 15px;
    font-size: 12.5px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    /* پس‌زمینه تیره و مات تا روی نوار پیشرفت سفید هم خوانا بماند */
    background: rgba(17, 45, 64, .72);
    border: 1px solid rgba(255, 255, 255, .22);
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
    transition: background .25s, transform .25s var(--ease);
}

.top-actions a:hover { background: rgba(17, 45, 64, .92); transform: translateY(-2px); }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    opacity: .9;
}
.back-link:hover { opacity: 1; }

/* =====================================================================
   پانل مدیریت و داشبورد (تم روشن)
   ===================================================================== */
.admin-body {
    background:
        radial-gradient(900px 500px at 88% -8%, #e3f6f5 0%, transparent 60%),
        radial-gradient(700px 420px at 4% 0%, #fff4e0 0%, transparent 55%),
        #f3f7f9;
    min-height: 100vh;
    padding: 22px;
}

.admin-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}

.admin-brand { display: flex; align-items: center; gap: 13px; }

.admin-brand .mark {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    background: linear-gradient(140deg, var(--sanam-mint), var(--sanam-teal));
}

.admin-brand h1 { margin: 0; font-size: 18px; color: var(--ink); }
.admin-brand span { font-size: 12px; color: var(--muted); }

.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; }

.admin-nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    color: var(--sanam-teal-dark);
    background: #e3f6f5;
    border-radius: 999px;
    border: 1px solid #c3eae9;
    transition: all .25s;
}
.admin-nav a:hover  { background: var(--sanam-teal); color: #fff; }
.admin-nav a.active { background: var(--sanam-teal); color: #fff; }
.admin-nav a.danger { background: #fff0f3; color: #c92a2a; border-color: #ffc9c9; }
.admin-nav a.danger:hover { background: #ffc9c9; color: #a61e1e; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-box {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 14px;
    animation: riseIn .45s var(--ease) both;
}

.stat-box .ic {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    color: #fff;
}

.stat-box .value { font-size: 24px; font-weight: 800; color: var(--ink); line-height: 1.3; }
.stat-box .label { font-size: 12.5px; color: var(--muted); }

.ic-teal   { background: linear-gradient(140deg, #06d6a0, #0f8b8d); }
.ic-sun    { background: linear-gradient(140deg, #ffd166, #f4801f); }
.ic-coral  { background: linear-gradient(140deg, #ff8fa3, #ef476f); }
.ic-sky    { background: linear-gradient(140deg, #5fa8d3, #1b4965); }
.ic-violet { background: linear-gradient(140deg, #b197fc, #7048a8); }

.panel {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--surface-2);
}

.panel-head h2 {
    margin: 0;
    font-size: 17px;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 9px;
}
.panel-head h2 i { color: var(--sanam-teal); }

.admin-grid { display: grid; grid-template-columns: 290px 1fr; gap: 20px; align-items: start; }

.side-list { max-height: 78vh; overflow-y: auto; }

.side-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 14px;
    margin-bottom: 6px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--ink-2);
    font-size: 14px;
    transition: all .22s;
}
.side-item:hover { background: var(--surface-2); color: var(--ink); }
.side-item.active {
    background: linear-gradient(90deg, #e3f6f5, #f5fafb);
    color: var(--sanam-teal-dark);
    font-weight: 800;
    border-right: 4px solid var(--sanam-teal);
}

.side-count {
    font-size: 11.5px;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 999px;
    background: #e3f6f5;
    color: var(--sanam-teal-dark);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.8px;
}

.table th {
    background: var(--surface-2);
    color: var(--ink-2);
    padding: 13px 12px;
    text-align: right;
    font-weight: 800;
    border-bottom: 2px solid var(--line);
    white-space: nowrap;
}

.table td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: #fafdfd; }

.pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.pill-on  { background: #e6fcf5; color: #0b7285; }
.pill-off { background: #fff0f3; color: #c92a2a; }
.pill-role { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }

.code-chip {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 8px;
    background: #f1f3f5;
    border: 1px solid var(--line);
    font-family: Consolas, Menlo, monospace;
    font-size: 13px;
    color: var(--ink);
    direction: ltr;
}

.score-chip {
    display: inline-block;
    min-width: 52px;
    text-align: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 13px;
    color: #fff;
}

.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state i { font-size: 46px; color: var(--line); display: block; margin-bottom: 14px; }
.empty-state h3 { margin: 0 0 8px; color: var(--ink-2); font-size: 17px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.inline-form { background: var(--surface-2); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; border: 1px solid var(--line); }
.inline-form h3 { margin: 0 0 16px; font-size: 15px; color: var(--sanam-teal-dark); display: flex; align-items: center; gap: 8px; }

/* داشبورد */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 22px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    animation: riseIn .5s var(--ease) both;
}
.chart-card h3 {
    margin: 0 0 16px;
    font-size: 15.5px;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 9px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--surface-2);
}
.chart-card h3 i { color: var(--sanam-teal); }
.chart-card.span-2 { grid-column: span 2; }
.chart-wrapper { position: relative; height: 340px; }
.pie-wrapper { position: relative; height: 300px; }

.pie-center {
    position: absolute;
    top: 44%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}
.pie-center span { display: block; font-size: 36px; font-weight: 800; color: var(--sanam-teal); }
.pie-center small { font-size: 13px; color: var(--muted); }

.comment-item {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border-right: 4px solid var(--sanam-sun);
    margin-bottom: 11px;
    font-size: 13.5px;
    line-height: 1.95;
}
.comment-item .meta { font-size: 11.5px; color: var(--muted); margin-bottom: 5px; display: flex; gap: 9px; flex-wrap: wrap; }

.filter-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filter-row select, .filter-row input[type="text"] { width: auto; min-width: 190px; padding: 11px 14px; }

/* =====================================================================
   ریسپانسیو
   ===================================================================== */
@media (max-width: 900px) {
    .admin-grid { grid-template-columns: 1fr; }
    .side-list  { max-height: none; }
    .chart-grid { grid-template-columns: 1fr; }
    .chart-card.span-2 { grid-column: span 1; }
}

@media (max-width: 680px) {
    .brand-title   { font-size: 30px; }
    .brand-subtitle{ font-size: 14px; }
    .card, .section-body { padding: 20px 17px; }
    .section-head  { padding: 16px 17px; }
    .rating        { grid-template-columns: repeat(5, 1fr); gap: 5px; }
    .rating-item .rt-label { font-size: 9.5px; }
    .rating-item .rt-emoji { font-size: 19px; }
    .theme-student .rating-item .rt-emoji { font-size: 23px; }
    .form-row      { grid-template-columns: 1fr; }
    .admin-body    { padding: 12px; }
    .top-actions   { position: static; justify-content: center; padding: 14px 14px 0; }
    .session-bar   { flex-direction: column; align-items: stretch; text-align: center; }
    .session-bar .actions { justify-content: center; }
    .table { font-size: 12.5px; }
    .table th, .table td { padding: 10px 7px; }
}

@media (max-width: 420px) {
    .rating { grid-template-columns: repeat(5, 1fr); gap: 4px; }
    .rating-item .rt-box { padding: 8px 2px; }
    .rating-item .rt-label { font-size: 8.5px; }
}

/* چاپ */
@media print {
    .top-actions, .session-bar, .progress-sticky, .btn, .btn-submit { display: none !important; }
    .scene-bg::before, .scene-bg::after { display: none; }
    body { background: #fff; }
    .card, .section-card, .panel, .chart-card { box-shadow: none; border: 1px solid #ddd; }
}
