.erp-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    background: rgba(255, 255, 255, 0.65);
    padding: 24px 40px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .05);

    animation: headerFade .6s ease forwards;
}

@keyframes headerFade {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.erp-topbar-left {
    display: flex;
    align-items: center;
    gap: 26px;
}

.erp-topbar-logo {
    height: 140px;
    width: auto;
    object-fit: contain;
    transition: .4s ease;
}

.erp-topbar-logo:hover {
    transform: scale(1.07);
}

.erp-topbar-title {
    display: flex;
    flex-direction: column;
}

.erp-topbar-title h1 {
    font-size: 24px;
    font-weight: 900;
    margin: 0;
    color: #0f172a;
    letter-spacing: .4px;
}

.erp-topbar-title p {
    margin: 6px 0 0 0;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

.erp-branch-badge {
    display: inline-block;

    padding: 4px 10px;
    font-size: 11px;
    font-weight: 800;
    border-radius: 20px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #fff;
    letter-spacing: .5px;
}

.erp-topbar-right {
    text-align: left;
}

.erp-datetime {
    font-size: 16px;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: .6px;
    position: relative;
    display: inline-block;
}



@media(max-width:768px) {
    .erp-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 18px 20px;
    }
}

/* ================= Echo One UI ================= */

.echo-one-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 10050;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 12px 18px;
    border-radius: 50px;

    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #fff;
    font-weight: 800;
    cursor: pointer;

    box-shadow: 0 10px 30px rgba(37, 99, 235, .4);
    transition: .3s;
}

.echo-one-btn:hover {
    transform: translateY(-3px);
}

.echo-dot {
    width: 10px;
    height: 10px;
    background: #22d3ee;
    border-radius: 50%;
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    0% {
        opacity: .5;
        transform: scale(.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }

    100% {
        opacity: .5;
        transform: scale(.9);
    }
}

/* Panel */

.echo-panel {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 420px;

    background: #ffffff;
    box-shadow: 20px 0 60px rgba(0, 0, 0, .15);

    transform: translateX(-100%);
    transition: .4s cubic-bezier(.77, 0, .18, 1);
    display: flex;
    flex-direction: column;
    z-index: 10000;
}

.echo-panel.active {
    transform: translateX(0);
}

.echo-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .25);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: .3s;
    z-index: 10000;
}

.echo-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.echo-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.echo-body {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

.echo-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.echo-input {
    display: flex;
    padding: 14px;
    border-top: 1px solid #eee;
    gap: 10px;
}

.echo-input input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 20px;
    border: 1px solid #ddd;
}

.echo-input button {
    background: #2563eb;
    border: none;
    color: #fff;
    padding: 10px 14px;
    border-radius: 50%;
    cursor: pointer;
}

.echo-suggest {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.echo-suggest button {
    border: none;
    padding: 12px 16px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    text-align: right;
    transition: .25s ease;
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}

.echo-suggest button:hover {
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, .25);
}

/* جسم الشات */
.echo-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* أزرار الاقتراحات ثابتة */
.echo-suggest {
    flex-shrink: 0;
    padding: 10px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

/* الرسائل فقط هي اللي تعمل scroll */
.echo-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
}

/* input ثابت */
.echo-input {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

#echoOneBtn {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    touch-action: none;
    /* يمنع سحب الصفحة أثناء السحب */
}

#echoOneBtn * {
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
    /* يخلي الضغط والدراغ على الزر نفسه */
}

.global-lead-toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: #fff;
    color: #111827;
    padding: 18px 22px;
    border-radius: 16px;
    z-index: 999999;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .22);
    border-top: 5px solid #16a34a;
    min-width: 280px;
    text-align: center;
    opacity: 0;
    transition: all .3s ease;
    font-family: inherit;
}

.global-lead-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* =========================================================
   School dashboard header/page alignment fix
   ضع هذا الكود في آخر: /dashboard/school/system/sys.css
   أو في آخر: /assets/css/header.css بعد كل أكواد الهيدر
========================================================= */

/* خلي الهيدر والصفحة نفس العرض ونفس بداية/نهاية المحتوى */
.main-content.full-width {
    min-width: 0 !important;
    padding: 20px 24px 40px !important;
    background: #f4f7fb !important;
}

.main-content.full-width>.erp-topbar {
    position: relative !important;
    top: auto !important;
    z-index: 10 !important;

    width: min(1500px, 100%) !important;
    margin: 0 auto 18px !important;
    padding: 18px 24px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 18px !important;

    border-radius: 28px !important;
    background: rgba(255, 255, 255, .96) !important;
    border: 1px solid #dbe4f0 !important;
    box-shadow: 0 18px 46px rgba(15, 23, 42, .055) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;

    animation: none !important;
    transform: none !important;
}

.main-content.full-width>.erp-topbar::before,
.main-content.full-width>.erp-topbar::after,
.erp-datetime::after {
    display: none !important;
    content: none !important;
    animation: none !important;
}

.erp-topbar-left {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    min-width: 0 !important;
}



.erp-topbar-logo:hover {
    transform: none !important;
}

.erp-topbar-title {
    min-width: 0 !important;
}

.erp-topbar-title h1 {
    margin: 0 !important;
    color: #0b1b45 !important;
    font-size: 21px !important;
    font-weight: 1000 !important;
    line-height: 1.45 !important;
    letter-spacing: 0 !important;
}

.erp-topbar-title p {
    margin: 4px 0 0 !important;
    color: #64748b !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1.5 !important;
}

.erp-topbar-right {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex: 0 0 auto !important;
    text-align: start !important;
}






/* محاذاة جسم الداشبورد مع الهيدر */
.school-edu-dashboard {
    width: min(1500px, 100%) !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

@media (max-width: 768px) {
    .main-content.full-width {
        padding: 12px !important;
    }

    .main-content.full-width>.erp-topbar {
        margin-bottom: 14px !important;
        padding: 14px !important;
        border-radius: 22px !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .erp-topbar-left {
        flex: 1 1 auto !important;
        gap: 10px !important;
    }

    .erp-topbar-logo {
        width: 52px !important;
        height: 52px !important;
        min-width: 52px !important;
        max-width: 52px !important;
        border-radius: 15px !important;
    }

    .erp-topbar-title h1 {
        font-size: 16px !important;
        line-height: 1.45 !important;
    }

    .erp-topbar-title p {
        font-size: 11px !important;
    }

    .erp-topbar-right {
        display: none !important;
    }
}