.app-header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 90%;
    padding: 10px 28px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.45);
    box-shadow: 0 16px 45px rgba(40, 100, 180, 0.12);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.app-header-welcome {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.app-header-avatar {
    display: grid;
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border-radius: 10%;
    place-items: center;
    background: linear-gradient(135deg, #4d91ff, #55cfff);
    box-shadow: 0 10px 24px rgba(52, 120, 232, 0.24);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
}

.app-header-avatar[href] {
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.app-header-avatar[href]:hover,
.app-header-avatar[href]:focus-visible {
    box-shadow: 0 14px 28px rgba(52, 120, 232, 0.34);
    outline: 2px solid rgba(52, 120, 232, 0.48);
    outline-offset: 3px;
    transform: translateY(-2px);
}
.app-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
/* ===== متن خوش‌آمد: هرگز ستون باریک نمی‌شود =====
   عنوان در یک خط می‌ماند و اگر جا نبود با «…» کوتاه می‌شود.
   توضیح (p) دیگر در هدر چاپ نمی‌شود؛ اگر جایی مانده باشد پنهان است. */
.app-header-text { flex: 1 1 auto; min-width: 0; }
.app-header .app-header-welcome p { display: none !important; }
.app-header .app-header-welcome h1 {
    margin: 0;
    overflow: hidden;
    color: #20324d;
    font-size: 1.3rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== منو: همیشه در یک ردیف؛ اگر جا نشد، هدر خودش به حالت همبرگری می‌رود ===== */
.app-header-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
}
.app-header-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    color: #35506f;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: 0.25s ease;
}
.app-header-actions a:hover { transform: translateY(-2px); background: transparent; color: #1f4a8f; }
.app-header-actions a.active {
    background: rgba(255, 255, 255, 0.68);
    box-shadow: 0 10px 24px rgba(40, 100, 180, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.app-header-dropdown { position: relative; }
.app-header-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    color: #35506f;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    white-space: nowrap;
}
.app-header-dropdown-toggle span { font-size: 0.8rem; transition: transform 0.2s ease; }
.app-header-dropdown-toggle.active {
    background: rgba(255, 255, 255, 0.68);
    box-shadow: 0 10px 24px rgba(40, 100, 180, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.app-header-dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 2px #fff; }
.app-header-dropdown-menu a.active { background: rgba(52, 120, 232, 0.1); color: #1f4a8f; }
.app-header-dropdown.is-open .app-header-dropdown-toggle span { transform: rotate(180deg); }
.app-header-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    display: none;
    min-width: 190px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 16px 35px rgba(40, 100, 180, 0.16);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.app-header-dropdown.is-open .app-header-dropdown-menu { display: grid; gap: 4px; }
.app-header-dropdown-menu a { justify-content: flex-start; padding: 9px 12px; box-shadow: none; }

.app-header-toggle {
    display: none;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
}
.app-header-toggle span { display: block; width: 22px; height: 3px; margin: 4px auto; border-radius: 999px; background: #284b77; }
.app-header-spacer { height: 116px; }

/* ===== لپ‌تاپ: همه چیز کمی جمع‌وجورتر تا منو و متن کنار هم جا شوند ===== */
@media (max-width: 1440px) {
    .app-header { gap: 16px; padding: 10px 20px; }
    .app-header-actions { gap: 4px; }
    .app-header-actions a,
    .app-header-dropdown-toggle { padding: 8px 12px; font-size: 0.92rem; }
    .app-header .app-header-welcome h1 { font-size: 1.18rem; }
}

@media (max-width: 1200px) {
    .app-header { width: 94%; }
    .app-header-actions a,
    .app-header-dropdown-toggle { padding: 8px 10px; font-size: 0.88rem; }
    .app-header-avatar { flex-basis: 48px; width: 48px; height: 48px; }
    .app-header-welcome { gap: 12px; }
}

/* ===== حالت همبرگری =====
   دو راه فعالش می‌کند:
   ۱) عرض صفحه ۹۰۰px یا کمتر (حتی بدون جاوااسکریپت)،
   ۲) کلاس is-compact که جاوااسکریپتِ app_header.php هر وقت منو و
      متن کنار هم جا نشوند می‌گذارد — پس با هر تعداد لینک و هر طول
      نامی، هدر هیچ‌وقت روی هم نمی‌افتد. */
.app-header.is-compact { flex-wrap: wrap; }
/* منوی باز روی محتوای صفحه می‌افتد؛ پس‌زمینه را پررنگ‌تر کن تا لینک‌ها خوانا باشند. */
.app-header.menu-open { background: rgba(255, 255, 255, 0.94); }
.app-header.is-compact .app-header-toggle { display: block; }
.app-header.is-compact .app-header-actions { display: none; flex-basis: 100%; width: 100%; margin-top: 4px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.7); }
.app-header.is-compact.menu-open .app-header-actions { display: flex; flex-direction: column; align-items: stretch; max-height: calc(100vh - 140px); overflow-y: auto; }
.app-header.is-compact .app-header-actions a,
.app-header.is-compact .app-header-dropdown-toggle { justify-content: flex-start; width: 100%; padding: 10px 16px; font-size: 1rem; }
.app-header.is-compact .app-header-dropdown { width: 100%; }
.app-header.is-compact .app-header-dropdown-menu { position: static; min-width: 0; margin-top: 8px; box-shadow: none; }

@media (max-width: 900px) {
    .app-header { flex-wrap: wrap; }
    .app-header-toggle { display: block; }
    .app-header-actions { display: none; flex-basis: 100%; width: 100%; margin-top: 4px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.7); }
    .app-header.menu-open .app-header-actions { display: flex; flex-direction: column; align-items: stretch; max-height: calc(100vh - 140px); overflow-y: auto; }
    .app-header-actions a, .app-header-dropdown-toggle { justify-content: flex-start; width: 100%; padding: 10px 16px; font-size: 1rem; }
    .app-header-dropdown { width: 100%; }
    .app-header-dropdown-menu { position: static; min-width: 0; margin-top: 8px; box-shadow: none; }
}

@media (max-width: 640px) {
    .app-header { width: 92%; padding: 14px; gap: 12px; border-radius: 20px; }
    .app-header-avatar { flex-basis: 40px; width: 40px; height: 40px; }
    .app-header-welcome { gap: 10px; }
    .app-header .app-header-welcome h1 { font-size: 1rem; }
    .app-header-spacer { height: 94px; }
}

/* ==========================================================================
   قدم ششم: عدد فیدبک روی هدر و اعلان فیدبک.
   اینجا هستند و نه در feedback.css، چون app_header.php این اعلان را روی
   هر صفحه‌ای رندر می‌کند و فقط همین فایل در همه‌ی صفحات لود می‌شود.
   ========================================================================== */

/* ---------- عدد روی هدر ---------- */

.app-header-feedback {
    position: relative;
}

.app-header-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-left: 5px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1;
    vertical-align: middle;
}

/* ---------- اعلان فیدبک ---------- */

.feedback-toast {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 2500;
    width: min(340px, calc(100vw - 40px));
    padding: 16px 18px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 48px rgba(15, 32, 57, 0.22);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.feedback-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.feedback-toast-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    font-size: 17px;
    line-height: 1;
    color: #35506f;
    cursor: pointer;
}

.feedback-toast-close:hover {
    background: rgba(0, 0, 0, 0.12);
}

.feedback-toast-title {
    margin: 0 0 6px;
    padding-right: 26px;
    font-size: 13.5px;
    font-weight: 800;
    color: #1d3d66;
}

.feedback-toast-sentence {
    margin: 0 0 8px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #67809c;
}

.feedback-toast-text {
    margin: 0 0 10px;
    font-size: 12.5px;
    line-height: 1.65;
    color: #4a637f;
}

.feedback-toast-link {
    font-size: 12px;
    font-weight: 700;
    color: #3478e8;
    text-decoration: none;
}

.feedback-toast-link:hover {
    text-decoration: underline;
}

@media (max-width: 560px) {
    .feedback-toast {
        right: 12px;
        left: 12px;
        bottom: 16px;
        width: auto;
    }
}