/* ============================================================
   واجهة الادارة (IT) - تصميم لوحة التحكم الجديدة
   ============================================================ */

:root {
    --it-sidebar-width: 250px;
    --it-navy-1: #2b31a0;
    --it-navy-2: #131a5e;
    --it-blue: #2f6bff;
    --it-bg: #e9edfa;
    --it-text: #1e2a4a;
    --it-muted: #8a93ad;
    --it-radius: 18px;
}

body.it-app {
    background: var(--it-bg);
    font-family: 'Tajawal', Arial, sans-serif;
    color: var(--it-text);
    min-height: 100vh;
    padding-right: var(--it-sidebar-width);
    padding-bottom: 0;
}

body.it-app .back-to-top {
    right: auto;
    left: 30px;
}

/* ---------------- Sidebar ---------------- */

.it-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--it-sidebar-width);
    background: linear-gradient(180deg, var(--it-navy-1) 0%, var(--it-navy-2) 100%);
    border-radius: 26px 0 0 26px;
    box-shadow: -18px 0 40px rgba(16, 24, 90, 0.18);
    direction: rtl;
    display: flex;
    flex-direction: column;
    z-index: 1100;
    overflow: hidden;
}

.it-sidebar::after {
    content: "";
    position: absolute;
    right: -40%;
    bottom: -18%;
    width: 180%;
    height: 45%;
    background: radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 65%);
    pointer-events: none;
}

.it-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 18px 18px;
    position: relative;
    z-index: 2;
}

.it-brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.it-brand-logo img {
    max-width: 36px;
    max-height: 36px;
}

.it-brand-text h4 {
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
}

.it-brand-text span {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.78rem;
    margin-top: 3px;
}

.it-nav {
    list-style: none;
    margin: 0;
    padding: 4px 12px 24px;
    overflow-y: auto;
    flex: 1;
    position: relative;
    z-index: 2;
}

.it-nav::-webkit-scrollbar {
    width: 5px;
}

.it-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 5px;
}

.it-nav li {
    margin-bottom: 2px;
}

.it-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.it-nav a i {
    font-size: 0.95rem;
    width: 20px;
    text-align: center;
    opacity: 0.85;
}

.it-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-decoration: none;
}

.it-nav a.active {
    background: var(--it-blue);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(47, 107, 255, 0.35);
}

.it-nav a.active i {
    opacity: 1;
}

.it-nav-logout a {
    color: #ffd0d0;
}

/* ---------------- Shell / content ---------------- */

.it-shell {
    padding: 18px 20px 28px 20px;
}

.it-panel {
    position: relative;
    background: #ffffff;
    border-radius: 26px;
    box-shadow: 0 18px 45px rgba(20, 30, 100, 0.08);
    padding: 18px 22px 30px;
    min-height: calc(100vh - 46px);
}

.it-panel::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 130px;
    background: linear-gradient(180deg, rgba(233, 238, 250, 0) 0%, rgba(214, 224, 250, 0.55) 100%);
    border-radius: 0 0 26px 26px;
    pointer-events: none;
    z-index: 0;
}

.it-panel > * {
    position: relative;
    z-index: 1;
}

/* ---------------- Topbar ---------------- */

.it-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    direction: rtl;
    padding: 6px 4px 4px;
    min-height: 62px;
}

.it-topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    order: 2;
}

.it-bell {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid #e9edf8;
    background: #ffffff;
    color: #3b4a72;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(20, 30, 100, 0.07);
    text-decoration: none;
}

.it-bell:hover {
    color: var(--it-blue);
    text-decoration: none;
}

.it-bell-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #ff4d5e;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

.it-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #eef2ff;
    color: #2f6bff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(20, 30, 100, 0.1);
}

.it-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.it-user-meta {
    line-height: 1.3;
}

.it-user-meta strong {
    display: block;
    font-size: 0.9rem;
    color: var(--it-text);
}

.it-user-meta .it-user-role {
    font-size: 0.78rem;
    color: var(--it-muted);
    background: none;
    border: 0;
    padding: 0;
}

.it-topbar-title {
    order: 1;
    flex: 1;
    text-align: center;
}

.it-topbar-title .section-title,
.it-topbar-title h1 {
    margin: 0;
}

/* عنوان الصفحة داخل الشريط العلوي */
.it-page-head {
    text-align: center;
    direction: rtl;
}

.it-page-head h1,
.it-page-head h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--it-text);
    margin: 0 0 8px;
}

.it-page-head .section-title {
    display: none;
}

.it-page-head::after {
    content: "";
    display: block;
    width: 74px;
    height: 6px;
    margin: 0 auto;
    border-radius: 6px;
    background:
        radial-gradient(circle at 12px 50%, #2f6bff 3px, transparent 4px),
        radial-gradient(circle at 37px 50%, #9aa9ff 3px, transparent 4px),
        radial-gradient(circle at 62px 50%, #c9d3ff 3px, transparent 4px);
}

/* ---------------- Stat cards ---------------- */

.it-stats-grid {
    direction: rtl;
    margin-top: 18px;
}

.it-stat-card {
    background: #ffffff;
    border: 1px solid #eef1f9;
    border-radius: var(--it-radius);
    box-shadow: 0 12px 28px rgba(20, 30, 100, 0.07);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    height: 100%;
}

.it-stat-text {
    text-align: right;
}

.it-stat-title {
    color: var(--it-muted);
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 6px;
}

.it-stat-value {
    color: var(--it-text);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin: 0 0 10px;
}

.it-stat-bar {
    display: block;
    width: 56px;
    height: 4px;
    border-radius: 4px;
    background: currentColor;
    opacity: 0.85;
}

.it-chip {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

/* ألوان هادئة للأيقونات */
.it-tone-blue   { color: #3f6bff; }
.it-tone-green  { color: #16a97a; }
.it-tone-orange { color: #f0a022; }
.it-tone-purple { color: #7a5af8; }
.it-tone-pink   { color: #ef4f92; }
.it-tone-teal   { color: #14a2b8; }
.it-tone-red    { color: #ef4b5c; }

.it-chip.it-tone-blue   { background: #e8eeff; }
.it-chip.it-tone-green  { background: #e3f7f0; }
.it-chip.it-tone-orange { background: #fdf1dd; }
.it-chip.it-tone-purple { background: #efeaff; }
.it-chip.it-tone-pink   { background: #fdeaf2; }
.it-chip.it-tone-teal   { background: #e2f5f8; }
.it-chip.it-tone-red    { background: #fde9eb; }

/* ---------------- Menu cards ---------------- */

.it-menu-grid {
    direction: rtl;
    margin-top: 6px;
}

.it-menu-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    height: 100%;
    min-height: 84px;
    background: #ffffff;
    border: 1px solid #eef1f9;
    border-radius: var(--it-radius);
    box-shadow: 0 12px 26px rgba(20, 30, 100, 0.06);
    padding: 14px 18px;
    color: var(--it-text);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.it-menu-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 34px rgba(20, 30, 100, 0.12);
    border-color: #dbe3ff;
    color: var(--it-text);
    text-decoration: none;
}

.it-menu-card .it-menu-label {
    flex: 1;
    text-align: right;
}

.it-menu-card .it-menu-arrow {
    color: #b9c2da;
    font-size: 0.9rem;
}

/* ---------------- محتوى الصفحات الداخلية ---------------- */

body.it-app .it-shell .container,
body.it-app .it-shell .container-fluid {
    max-width: 100%;
}

body.it-app .it-shell > .it-panel > .container-fluid {
    padding-top: 0 !important;
}

body.it-app .it-shell .text-center.pb-2 .section-title {
    display: none;
}

/* ---------------- Mobile ---------------- */

.it-sidebar-toggle {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 1201;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 14px;
    background: var(--it-navy-1);
    color: #fff;
    font-size: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(20, 30, 100, 0.25);
}

.it-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 16, 60, 0.45);
    z-index: 1099;
    display: none;
}

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

@media (max-width: 991.98px) {
    body.it-app {
        padding-right: 0;
    }

    .it-sidebar {
        transform: translateX(105%);
        transition: transform 0.25s ease;
        border-radius: 0;
    }

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

    .it-sidebar-toggle {
        display: inline-flex;
    }

    .it-shell {
        padding: 12px 10px 20px;
    }

    .it-panel {
        padding: 14px 12px 24px;
        border-radius: 20px;
        min-height: auto;
    }

    .it-topbar {
        flex-wrap: wrap;
        padding-left: 56px;
    }

    .it-topbar-title {
        order: 3;
        flex: 0 0 100%;
        margin-top: 6px;
    }

    .it-user-meta {
        display: none;
    }
}
