html,
body {
    height: 100%;
}

body {
    min-height: 100%;
    background: #f5f7fb;
    font-family: "Segoe UI", "Cairo", sans-serif;
}

.app-body {
    background: #f5f7fb;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1f3c88 0%, #1b2a5b 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    gap: 2rem;
    max-height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    box-shadow: 18px 0 40px -28px rgba(15, 23, 42, 0.5);
}

.sidebar-brand .clinic-logo {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.sidebar-brand .clinic-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-section {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-link:hover,
.sidebar-link:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

.sidebar-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.22);
}

.sidebar-icon {
    font-size: 1.15rem;
    width: 1.75rem;
    text-align: center;
}

.sidebar-footer {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 18px;
    padding: 1.25rem 1rem;
}

.sidebar-user .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
    display: grid;
    place-items: center;
    font-weight: 700;
}

.btn-logout,
.btn-login {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.65rem 1rem;
    border: none;
    background: #fff;
    color: #1f3c88;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-logout:hover,
.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
    color: #142050;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    background: #ffffff;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.topbar-title h1 {
    font-weight: 700;
    color: #1f3c88;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.topbar-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.topbar-btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.55rem 1.2rem;
    box-shadow: 0 10px 25px rgba(31, 60, 136, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-btn.btn-outline-primary {
    background: #ffffff;
    border-color: rgba(31, 60, 136, 0.2);
    color: #1f3c88;
}

.topbar-btn.btn-outline-primary:hover {
    background: #1f3c88;
    color: #ffffff;
}

.topbar-search {
    background: #f1f4ff;
    border-radius: 999px;
    padding: 0.35rem 1rem;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid rgba(13, 110, 253, 0.1);
    max-width:310px;
}

.topbar-search i {
    color: #1f3c88;
}

    .topbar-search .form-control {
        border: none;
        background: transparent;
        box-shadow: none;
        flex: 1;
        width: 320px;
    }

.main-container {
    padding: 2rem;
    flex: 1 1 auto;
}

.app-footer {
    background-color: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
    font-family: "Segoe UI", "Cairo", sans-serif;
}

.app-footer .footer-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
}

.app-footer span {
    color: #6c757d;
}

@media (max-width: 992px) {
    .app-wrapper {
        flex-direction: column;
    }

    .app-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding: 1.5rem 1.25rem;
        gap: 1.5rem;
        position: relative;
        max-height: none;
        box-shadow: none;
    }

    .sidebar-menu {
        flex: 1;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar-link {
        flex: 1 1 45%;
    }

    .sidebar-footer {
        flex: 1;
    }

    .app-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 576px) {
    .sidebar-link {
        flex: 1 1 100%;
    }

    .main-container {
        padding: 1.5rem 1rem;
    }

    .topbar-search {
        width: 100%;
    }

    .topbar-actions {
        gap: 0.75rem;
    }

    .topbar-buttons {
        width: 100%;
    }

    .topbar-buttons .topbar-btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

[dir="rtl"] .table {
    direction: rtl;
}

[dir="rtl"] .form-label {
    float: right;
}

.dashboard-card {
    border-radius: 18px;
    background-color: #ffffff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.dashboard-title {
    font-weight: 700;
    color: #0d6efd;
}

.table thead {
    background: linear-gradient(90deg, #0d6efd, #4dabff);
    color: #fff;
}

.table tbody tr:hover {
    background-color: #f1f4ff;
}

img {
    max-width: 100%;
    height: auto;
}

.clinic-logo {
    display: inline-block;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    object-fit: cover;
}

/*[dir="rtl"] .app-wrapper {
    flex-direction: row-reverse;
}*/

[dir="rtl"] .app-sidebar {
    text-align: right;
}

[dir="rtl"] .sidebar-link {
    flex-direction: row;
}

[dir="rtl"] .sidebar-icon {
    text-align: center;
}

[dir="rtl"] .topbar-actions {
    margin-right: auto;
    margin-left: 0;
    justify-content: flex-start;
}

[dir="rtl"] .topbar-buttons {
    justify-content: flex-start;
}

/* ===== Dashboard enhancements ===== */
.dashboard-layout {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 0.75rem;
}

.dashboard-header {
    border-radius: 18px;
    background-color: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.dashboard-filters .form-label {
    font-size: 0.85rem;
    color: #6c757d;
}

.dashboard-filters .form-control-sm {
    border-radius: 12px;
    border-color: rgba(13, 110, 253, 0.15);
    background-color: #f8faff;
}

.dashboard-filters .btn {
    border-radius: 12px;
    font-weight: 600;
}

.metric-card {
    background: linear-gradient(135deg, #ffffff 0%, #f5f8ff 100%);
    border-radius: 18px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    font-weight: 700;
}

.metric-title {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.35rem;
}

.metric-value {
    font-weight: 700;
    color: #1f3c88;
    margin-bottom: 0.35rem;
}

.metric-subtitle {
    font-size: 0.8rem;
}

.empty-state {
    text-align: center;
    background: linear-gradient(145deg, #f8faff 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    border: 1px dashed rgba(13, 110, 253, 0.15);
}

.empty-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.chart-wrapper {
    position: relative;
    min-height: 240px;
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    background-color: #f9fbff;
    border: 1px solid rgba(13, 110, 253, 0.08);
}

.summary-badge {
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-weight: 700;
    min-width: 64px;
    text-align: center;
}

@media (max-width: 992px) {
    .metric-card {
        padding: 1.25rem;
    }

    .chart-wrapper {
        min-height: 200px;
    }
}

@media (max-width: 576px) {
    .metric-card {
        flex-direction: row;
        justify-content: flex-start;
    }

    .dashboard-filters {
        width: 100%;
    }
}
/* ===== End Sticky Footer ===== */


/* Calendar enhancements */
.calendar-header .calendar-toolbar .form-label {
    font-weight: 600;
    color: #6c757d;
}

.calendar-toolbar .form-select,
.calendar-toolbar .form-control {
    border-radius: 12px;
    border-color: rgba(31, 60, 136, 0.15);
    box-shadow: none;
}

.calendar-toolbar .form-select:focus,
.calendar-toolbar .form-control:focus {
    border-color: #1f3c88;
    box-shadow: 0 0 0 0.1rem rgba(31, 60, 136, 0.15);
}

.calendar-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    font-size: 0.85rem;
    color: #4c5673;
}

.calendar-legend .legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.calendar-container {
    min-height: 650px;
    padding: 1.5rem;
}

.calendar-container .fc {
    font-family: "Segoe UI", "Cairo", sans-serif;
}

.calendar-container .fc-toolbar-title {
    font-weight: 700;
    color: #1f3c88;
}

.calendar-container .fc-button-primary {
    background: #1f3c88;
    border-color: #1f3c88;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(31, 60, 136, 0.18);
}

.calendar-container .fc-button-primary:not(:disabled).fc-button-active,
.calendar-container .fc-button-primary:not(:disabled):active {
    background: #142050;
    border-color: #142050;
}

.calendar-container .fc-timegrid-slot,
.calendar-container .fc-timegrid-axis-cushion {
    font-size: 0.85rem;
}
.fc-timegrid-slot {
    height: 80px !important;
}
/* السماح للأحداث بالتمدد داخل الخانة */
.fc-timegrid-event {
    min-height: 60px !important;
    display: flex !important;
    align-items: center !important;
}

/* عدم قص محتوى الكارت */
.fc-timegrid-event-harness,
.fc-timegrid-event-harness > a {
    overflow: visible !important;
}
.calendar-container .fc-event {
    border: none;
    background: transparent;
    color: inherit;
    box-shadow: none;
    padding: 0;
}

.calendar-container .fc-event .fc-event-main {
    padding: 0;
}

.calendar-focus {
    outline: 3px solid rgba(13, 110, 253, 0.5) !important;
}

.calendar-dark {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 0 0 24px 24px;
}

.calendar-dark .fc-theme-standard .fc-scrollgrid {
    border-color: rgba(148, 163, 184, 0.2);
}

.calendar-dark .fc-col-header-cell-cushion,
.calendar-dark .fc-timegrid-slot-label,
.calendar-dark .fc-timegrid-axis-cushion {
    color: #e2e8f0;
}

.calendar-dark .fc-event {
    color: #fff;
}

.calendar-fallback .fallback-calendar {
    background: transparent;
}

.fallback-calendar-header .btn {
    border-radius: 10px;
}

.fallback-calendar-title {
    font-size: 1.05rem;
}

.fallback-calendar-body {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.fallback-day-card {
    border-radius: 18px;
    background: #ffffff;
}

.fallback-day-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fallback-event {
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.fallback-event:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 26px rgba(15, 23, 42, 0.18);
}

.fallback-day-slots .btn {
    border-radius: 12px;
}

.calendar-dark .fallback-calendar-title {
    color: #e2e8f0;
}

.calendar-dark .fallback-day-card {
    background: #15213b;
    box-shadow: none;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.calendar-dark .calendar-event-card {
    box-shadow: 0 20px 36px rgba(15, 23, 42, 0.45);
    border-color: rgba(148, 163, 184, 0.25);
}

.calendar-dark .calendar-event-card::before {
    opacity: 0.4;
}

.calendar-dark .calendar-event-status {
    background: rgba(15, 23, 42, 0.25);
    border-color: rgba(226, 232, 240, 0.35);
}

.calendar-dark .fallback-event:hover {
    box-shadow: 0 22px 38px rgba(15, 23, 42, 0.5);
}

.calendar-dark .fallback-day-slots .btn {
    border-color: rgba(226, 232, 240, 0.35);
    color: #e2e8f0;
}

.calendar-dark .fallback-day-slots .btn:hover {
    background: rgba(226, 232, 240, 0.1);
}

.service-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem 1.5rem;
}

.appointment-card {
    border-radius: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.appointment-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(31, 60, 136, 0.1);
}

.appointment-card .appointment-number {
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.appointment-cards-wrapper {
    max-height: 520px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.appointment-cards-wrapper::-webkit-scrollbar {
    width: 6px;
}

.appointment-cards-wrapper::-webkit-scrollbar-thumb {
    background: rgba(31, 60, 136, 0.25);
    border-radius: 999px;
}
.calendar-event-card {
    position: relative;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--event-color, #1f3c88) 0%, var(--event-color-dark, #142050) 100%);
    color: #fff;
    box-shadow: 0 12px 26px rgba(31, 60, 136, 0.22);
    border: 1px solid var(--event-border-color, rgba(31, 60, 136, 0.35));
    overflow: hidden;
    isolation: isolate;
}

.calendar-event-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.45), transparent 55%);
    opacity: 0.9;
    pointer-events: none;
}

.calendar-event-card-content {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.8rem 0.9rem;
    z-index: 1;
}

.calendar-event-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.calendar-event-time {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
}

.calendar-event-time i {
    font-size: 0.9rem;
}

.calendar-event-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.calendar-event-patient {
    font-weight: 700;
    font-size: 1rem;
}

.calendar-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.78rem;
    opacity: 0.9;
}

.calendar-event-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.calendar-event-meta i {
    font-size: 0.9rem;
}

.calendar-event-status.status-pending {
    background: rgba(246, 195, 67, 0.25);
    border-color: rgba(246, 195, 67, 0.45);
}

.calendar-event-status.status-confirmed,
.calendar-event-status.status-treated {
    background: rgba(25, 135, 84, 0.25);
    border-color: rgba(25, 135, 84, 0.45);
}

.calendar-event-status.status-inprogress {
    background: rgba(13, 110, 253, 0.25);
    border-color: rgba(13, 110, 253, 0.45);
}

.calendar-event-status.status-cancelled {
    background: rgba(108, 117, 125, 0.25);
    border-color: rgba(108, 117, 125, 0.45);
}

.calendar-container .fc-timegrid-event-harness {
    margin-bottom: 6px;
}
.calendar-event-card.status-cancelled {
    opacity: 0.78;
}
/* إطار و خلفية التقويم */
#calendar .fc {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    padding: 16px 20px;
}

/* شريط عنوان الأيام */
#calendar .fc-col-header-cell {
    background: #f8fafc;
    color: #0f172a;
    font-weight: 600;
    border: none;
}

#calendar .fc-col-header-cell-cushion {
    padding: 10px 4px;
    font-size: 0.9rem;
}

/* تلوين اليوم الحالي */
#calendar .fc-day-today {
    background: #eff6ff !important; /* أزرق فاتح */
}

/* خطوط الشبكة أنعم */
#calendar .fc-scrollgrid,
#calendar .fc-timegrid-slot,
#calendar .fc-timegrid-axis {
    border-color: #e2e8f0;
}

/* الخانة الزمنية: ارتفاع مريح */
#calendar .fc-timegrid-slot {
    height: 64px !important;
}

/* شكل كروت المواعيد */
#calendar .fc-timegrid-event,
#calendar .fc-daygrid-event {
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    padding: 2px 6px;
    font-size: 0.8rem;
}

/* محتوى الكارت منسّق */
#calendar .fc-event-main {
    padding-inline: 4px;
}

/* Hover على المواعيد */
#calendar .fc-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.2);
}

/* خط الوقت الحالي */
#calendar .fc-timegrid-now-indicator-line {
    border-color: #2563eb;
}

/* زرار today + prev/next */
#calendar .fc .fc-button {
    border-radius: 999px;
    font-size: 0.8rem;
}

#calendar .fc .fc-button-primary {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

    #calendar .fc .fc-button-primary:not(:disabled):hover {
        background: #1e40af;
        border-color: #1e40af;
    }
/* شبكة الخدمات */
.service-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.5rem;
}

/* الكارت نفسه */
.service-pill {
    border-radius: 0.75rem;
    padding: 0.75rem 0.9rem;
    box-shadow: 0 0 0 1px #e5e7eb;
    background-color: #ffffff;
    transition: all 0.15s ease-in-out;
    font-size: 0.9rem;
}

    .service-pill .service-name {
        font-weight: 600;
    }

    .service-pill .badge {
        font-size: 0.75rem;
    }

/* الحالة المختارة */
.btn-check:checked + .service-pill {
    border-color: #0d6efd;
    background-color: #e9f3ff;
    box-shadow: 0 0.35rem 0.7rem rgba(15, 23, 42, 0.12);
}

/* هوفر بسيط */
.service-pill:hover {
    border-color: #b0c4ff;
}

/* مع RTL لو حابب النص يمين */
[dir="rtl"] .service-pill {
    text-align: right;
}


/* =========================================================
   Layout overrides: Fixed + Collapsible + Mobile Offcanvas
   ========================================================= */

/* نخلي اتجاه الـ wrapper ثابت ونخلّي الخلفية */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    background: #f5f7fb;
}

/* RTL: بلاش row-reverse علشان السايدبار ثابت */
/*[dir="rtl"] .app-wrapper {
    flex-direction: row;
}*/

/* السايدبار ثابت في الجنب وطوله من فوق لتحت */
.app-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1f3c88 0%, #1b2a5b 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    gap: 2rem;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    box-shadow: 18px 0 40px -28px rgba(15, 23, 42, 0.5);
}

[dir="rtl"] .app-sidebar {
    left: auto;
    right: 0;
}

/* المحتوى الرئيسي ياخد المساحة الباقية */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: 260px;
}

[dir="rtl"] .app-main {
    margin-left: 0;
    margin-right: 260px;
}

/* ======== وضع الكولابس على الديسكتوب (أيقونات بس) ======== */

.app-wrapper.sidebar-collapsed .app-sidebar {
    width: 72px;
}

.app-wrapper.sidebar-collapsed .app-main {
    margin-left: 80px;
}

[dir="rtl"] .app-wrapper.sidebar-collapsed .app-main {
    margin-right: 80px;
    margin-left: 0;
}

/* نخفي النصوص ونسيب الأيقونات */
.app-wrapper.sidebar-collapsed .sidebar-link span,
.app-wrapper.sidebar-collapsed .clinic-name,
.app-wrapper.sidebar-collapsed .sidebar-footer .sidebar-user .d-flex.flex-column {
    display: none;
}

.app-wrapper.sidebar-collapsed .sidebar-brand {
    justify-content: center;
}

.app-wrapper.sidebar-collapsed .clinic-logo {
    margin-inline: auto;
    max-width: 231%;
    margin: -50%;
}

/* نتأكد إن الأيقونات مظبوطة في النص */
.sidebar-icon {
    font-size: 1.15rem;
    width: 1.75rem;
    text-align: center;
}

/* ======== موبايل: السايدبار يبقى Offcanvas من الجانب ======== */

@media (max-width: 991.98px) {
    /* السايدبار برة الشاشة افتراضيًا */
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease-in-out;
        width: 260px;
        z-index: 1030;
    }

    [dir="rtl"] .app-sidebar {
        transform: translateX(100%);
    }

    /* المحتوى بدون هوامش في الموبايل */
    .app-main {
        margin-left: 0;
        margin-right: 0;
    }

    /* لما الكلاس sidebar-open يتحط على الـ wrapper نفتح السايدبار */
    .app-wrapper.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    /* أوفرلاي بسيط لما السايدبار مفتوح */
    .app-wrapper.sidebar-open::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 1029;
    }

    /* نخلي التوب بار ثابت فوق علشان زرار المنيو يفضل ظاهر */
    .app-topbar {
        position: sticky;
        top: 0;
        z-index: 1020;
        border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    }
}
/* ===== Language switch: arrow + code + globe ===== */
.lang-switch .btn-plain-lang {
    padding: 0;
    border: none;
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: #4b5563; /* رمادي غامق شوية */
    font-weight: 500;
}

    .lang-switch .btn-plain-lang:focus,
    .lang-switch .btn-plain-lang:active {
        box-shadow: none;
        outline: none;
    }

/* السهم الصغير */
.lang-arrow {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #6b7280; /* لون السهم */
    margin-inline-end: 2px;
}

/* كود اللغة */
.lang-code {
    letter-spacing: 0.08em;
}

/* أيقونة الجلوب */
.lang-globe {
    font-size: 1rem;
    margin-inline-start: 2px;
    color: #4b5563;
}

/* منيو اللغات */
.lang-switch .dropdown-menu {
    border-radius: 12px;
    font-size: 0.9rem;
    min-width: 160px;
}

.lang-switch .dropdown-item.active-lang {
    font-weight: 600;
    background-color: #e0edff;
    color: #1f3c88;
}

/* RTL: لو حابب السهم يبقى نفس الاتجاه */
[dir="rtl"] .lang-arrow {
    transform: scaleX(-1); /* اختياري */
}
/* ===== Topbar user menu ===== */
.topbar-user .btn-user {
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

    .topbar-user .btn-user:focus {
        box-shadow: 0 0 0 0.15rem rgba(59, 130, 246, 0.25);
    }

.user-avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #1f3c88;
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
}

/* موبايل: نخفي الاسم ونسيب الأيقونة بس */
@media (max-width: 576px) {
    .topbar-user .btn-user .d-sm-flex {
        display: none !important;
    }
}
/* ===== End Topbar user menu ===== */
.doctor-section-card {
    border-radius: 0.75rem;
}

    .doctor-section-card .card-header {
        border-bottom: 1px solid #f1f1f1;
    }

.doctor-avatar-uploader {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 2px dashed #d0d7e2;
    background-color: #f8fafc;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.1s ease;
}

.doctor-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.doctor-avatar-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.35), rgba(0,0,0,0));
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 1.2rem;
}

.doctor-avatar-uploader:hover {
    border-color: #0d6efd;
    background-color: #eef4ff;
    transform: translateY(-1px);
}

    .doctor-avatar-uploader:hover .doctor-avatar-overlay {
        opacity: 1;
    }

/* الشكل العام للّينك في السايدبار */
.app-sidebar .sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* RTL: خلى الأيقونة على اليمين والنص بعدها */
html[dir="rtl"] .app-sidebar .sidebar-link {
    flex-direction: row !important;
    text-align: right;
}

    /* تعديل المسافات حوالين الأيقونة العادية */
    html[dir="rtl"] .app-sidebar .sidebar-link .sidebar-icon {
        margin-right: 0;
        margin-left: 0.5rem;
    }

    /* السهم بتاع الـ collapse (المينيو اللي بتفتح وتقفل) */
    html[dir="rtl"] .app-sidebar .sidebar-link .bi-chevron-down {
        margin-left: 0 !important;
        margin-right: auto !important;
    }
/* موبايل – عرّض الفورم وخليه يبدأ من فوق */
@media (max-width: 576px) {
    .ea-form-wrapper {
        align-items: flex-start !important;
        justify-content: flex-start !important;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

        .ea-form-wrapper .col-12,
        .ea-form-wrapper .ea-form-card {
            max-width: 100%;
        }
}
@media (max-width: 991.98px) {
    [dir="rtl"] .app-wrapper {
        flex-direction: column !important;
    }
}
/* ==== FINAL RTL SIDEBAR ICON FIX ==== */

html[dir="rtl"] .app-sidebar .sidebar-link {
    display: flex;
    align-items: center;
    flex-direction: row !important;
    text-align: right;
}

    html[dir="rtl"] .app-sidebar .sidebar-link .sidebar-icon {
        margin-right: 0 !important;
        margin-left: 0.5rem !important;
    }

    html[dir="rtl"] .app-sidebar .sidebar-link .bi-chevron-down {
        margin-left: 0 !important;
        margin-right: auto !important;
    }
/* ==== FINAL MOBILE + RTL LAYOUT FIX ==== */

@media (max-width: 991.98px) {

    /* خلي اللفليوت كله عمودي (الهيدر/المحتوى تحت بعض) */
    .app-wrapper {
        flex-direction: column !important;
    }

    .app-main {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* السايدبار يبقى أوف-كانفاس على الشمال في الـ LTR */
    .app-sidebar {
        width: 260px !important;
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0;
        transform: translateX(-100%) !important;
        transition: transform 0.25s ease-in-out;
        z-index: 1030;
    }

    /* وفي العربي يبقى أوف-كانفاس على اليمين */
    html[dir="rtl"] .app-sidebar {
        left: auto !important;
        right: 0 !important;
        transform: translateX(100%) !important;
    }

    /* لما نضيف .sidebar-open من الجافاسكربت يبان السايدبار */
    .app-wrapper.sidebar-open .app-sidebar {
        transform: translateX(0) !important;
    }

    /* أوفرلاي غامق ورا السايدبار في الموبايل */
    .app-wrapper.sidebar-open::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 1029;
    }
}
