:root {
    --crm-primary: #0f766e;
    --crm-primary-dark: #115e59;
    --crm-primary-soft: #ccfbf1;
    --crm-accent: #f59e0b;
    --crm-danger: #dc2626;
    --crm-ink: #172033;
    --crm-muted: #64748b;
    --crm-line: #e2e8f0;
    --crm-surface: #ffffff;
    --crm-canvas: #f4f7f9;
    --crm-sidebar: #102a2a;
    --crm-sidebar-soft: #173b3a;
    --crm-radius: 16px;
    --crm-shadow: 0 10px 30px rgba(15, 23, 42, .07);
}

html { scroll-behavior: smooth; }

body {
    background: var(--crm-canvas);
    color: var(--crm-ink);
    font-family: Inter, Nunito, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: .925rem;
}

#wrapper { min-height: 100vh; }
#content-wrapper { background: var(--crm-canvas) !important; }
#content { min-width: 0; }

.sidebar.bg-haramayn,
body .bg-haramayn.sidebar {
    background: linear-gradient(180deg, var(--crm-sidebar) 0%, #0c2020 100%) !important;
    width: 17rem;
    min-height: 100vh;
    padding: 0 .75rem 1.5rem;
    box-shadow: 8px 0 30px rgba(15, 23, 42, .08);
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    position: sticky;
    scrollbar-color: rgba(94, 234, 212, .35) transparent;
    scrollbar-width: thin;
    top: 0;
    transition: width .22s ease, transform .22s ease, padding .22s ease, box-shadow .22s ease;
    z-index: 1035;
}

.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(94, 234, 212, .28); border-radius: 999px; }
.sidebar:hover::-webkit-scrollbar-thumb { background: rgba(94, 234, 212, .48); }

.sidebar .sidebar-brand {
    height: 5.25rem;
    margin: 0 -.75rem .5rem;
    background: rgba(255,255,255,.035);
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.crm-sidebar-close {
    align-items: center;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    color: #fff;
    display: inline-flex;
    font-size: 1.15rem;
    height: 36px;
    justify-content: center;
    position: absolute;
    right: 12px;
    top: 18px;
    transition: background .16s ease, transform .16s ease;
    width: 36px;
    z-index: 2;
}
.crm-sidebar-close:hover { background: rgba(255,255,255,.16); color: #fff; transform: scale(1.04); }

.crm-sidebar-open-button {
    align-items: center;
    background: var(--crm-primary);
    border: 0;
    border-radius: 0 12px 12px 0;
    box-shadow: 0 10px 25px rgba(15,118,110,.25);
    color: #fff;
    display: none;
    font-size: 1rem;
    height: 46px;
    justify-content: center;
    left: 0;
    position: fixed;
    top: 88px;
    width: 46px;
    z-index: 1025;
}
.crm-sidebar-open-button:hover { background: var(--crm-primary-dark); }

.sidebar .sidebar-brand img {
    width: auto !important;
    height: 42px;
    max-width: 150px;
    object-fit: contain;
}
.sidebar .sidebar-brand .crm-brand-logo { border: 2px solid rgba(94,234,212,.55); border-radius: 50%; height: 52px; max-width: none; width: 52px; }
.crm-loader-logo { border: 3px solid rgba(20,184,166,.35); border-radius: 50%; height: 94px; object-fit: cover; width: 94px; }
.crm-login-logo { border: 3px solid #ccfbf1; border-radius: 50%; box-shadow: 0 9px 20px rgba(15,118,110,.16); height: 78px; margin: -1rem auto .85rem; object-fit: cover; width: 78px; }

.sidebar .sidebar-divider { border-color: rgba(255,255,255,.08); margin: .75rem .4rem; }
.sidebar .sidebar-heading {
    color: rgba(255,255,255,.43);
    font-size: .66rem;
    letter-spacing: .13em;
    padding: .55rem .85rem .35rem;
}

.sidebar .nav-item { margin: .16rem 0; }
.sidebar .nav-item .nav-link {
    align-items: center;
    border-radius: 11px;
    color: rgba(255,255,255,.72);
    display: flex;
    font-weight: 600;
    min-height: 44px;
    padding: .72rem .85rem;
    transition: background .18s ease, color .18s ease, transform .18s ease;
    width: 100%;
}

.sidebar .nav-item .nav-link[data-toggle="collapse"]::after {
    color: rgba(255,255,255,.52);
    margin-left: auto;
}

.sidebar .nav-item .nav-link[aria-expanded="true"] {
    background: rgba(255,255,255,.07);
    color: #fff;
}

.sidebar .nav-item .nav-link[aria-expanded="true"] i { color: #fff; }

.sidebar .nav-item .nav-link:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
    transform: translateX(2px);
}

.sidebar .nav-item.active > .nav-link,
.sidebar .nav-item[class*="active"] > .nav-link {
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    box-shadow: 0 8px 18px rgba(13,148,136,.22);
    color: #fff;
}

.sidebar .nav-item .nav-link i { color: #5eead4; font-size: .92rem; margin-right: .7rem; width: 1.25rem; }
.sidebar .nav-item.active .nav-link i { color: #fff; }
.sidebar .collapse-inner { border: 1px solid rgba(15,118,110,.12); border-radius: 12px !important; box-shadow: var(--crm-shadow); }
.sidebar .collapse { position: static !important; }
.sidebar .collapse-inner { margin: .3rem 0 .6rem !important; max-height: 48vh; overflow-y: auto; }
.sidebar .collapse-item { border-radius: 8px !important; font-size: .83rem; margin: .15rem .4rem !important; padding: .6rem .75rem !important; }
.sidebar .collapse-item:hover { background: var(--crm-primary-soft) !important; color: var(--crm-primary-dark) !important; }

.topbar {
    background: rgba(255,255,255,.94) !important;
    border-bottom: 1px solid var(--crm-line);
    box-shadow: 0 4px 18px rgba(15,23,42,.04) !important;
    height: 4.75rem;
    margin-bottom: 1.5rem !important;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    backdrop-filter: blur(12px);
}

.topbar .navbar-search { max-width: 32rem; }
.topbar .navbar-search .form-control {
    background: #f1f5f9 !important;
    border: 1px solid transparent !important;
    border-radius: 11px 0 0 11px;
    height: 42px;
    padding-left: 1rem;
}
.topbar .navbar-search .form-control:focus { background: #fff !important; border-color: #5eead4 !important; box-shadow: 0 0 0 3px rgba(20,184,166,.12); }
.topbar .navbar-search .btn { border-radius: 0 11px 11px 0; min-width: 44px; }
.topbar .nav-link { color: var(--crm-ink) !important; }
.topbar .img-profile { border: 2px solid var(--crm-primary-soft); height: 2.4rem; width: 2.4rem; object-fit: cover; }
.topbar h4 { color: var(--crm-primary-dark); font-size: .83rem; font-weight: 700; margin: .6rem 1rem 0; }

.container-fluid { padding: 0 1.5rem 2rem; }
h1, h2, h3, h4, h5, h6 { color: var(--crm-ink); font-weight: 700; }
.h3, h1.h3 { font-size: 1.55rem; letter-spacing: -.02em; }
.text-gray-800, .text-gray-900 { color: var(--crm-ink) !important; }
.text-gray-600 { color: var(--crm-muted) !important; }

.card {
    border: 1px solid rgba(226,232,240,.9) !important;
    border-radius: var(--crm-radius) !important;
    box-shadow: var(--crm-shadow) !important;
    overflow: hidden;
}
.card-header { background: #fff !important; border-bottom: 1px solid var(--crm-line) !important; padding: 1rem 1.25rem; }
.card-body { padding: 1.25rem; }
.card-header h6, .card-header .font-weight-bold { color: var(--crm-ink) !important; }
.border-left-primary { border-left: 4px solid var(--crm-primary) !important; }
.border-left-success { border-left: 4px solid #16a34a !important; }
.border-left-info { border-left: 4px solid #0284c7 !important; }
.border-left-warning { border-left: 4px solid var(--crm-accent) !important; }

.btn {
    border-radius: 10px;
    font-weight: 650;
    letter-spacing: .005em;
    padding: .58rem .95rem;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--crm-primary) !important; border-color: var(--crm-primary) !important; box-shadow: 0 5px 12px rgba(15,118,110,.17); }
.btn-primary:hover, .btn-primary:focus { background: var(--crm-primary-dark) !important; border-color: var(--crm-primary-dark) !important; }
.btn-success { background: #15803d; border-color: #15803d; }
.btn-danger { background: var(--crm-danger); border-color: var(--crm-danger); }
.btn-warning { color: #422006; }
.btn-sm { border-radius: 8px; padding: .4rem .7rem; }

.form-control, .custom-select {
    background-color: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: var(--crm-ink);
    min-height: 42px;
    padding: .55rem .8rem;
}
.form-control:focus, .custom-select:focus {
    border-color: #2dd4bf;
    box-shadow: 0 0 0 3px rgba(20,184,166,.13);
}
label { color: #334155; font-size: .82rem; font-weight: 700; margin-bottom: .4rem; }

.table-responsive { border-radius: 12px; }
.table { color: #334155; margin-bottom: 0; }
.table thead th {
    background: #f8fafc;
    border-bottom: 1px solid var(--crm-line) !important;
    border-top: 0;
    color: #475569;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .06em;
    padding: .85rem .75rem;
    text-transform: uppercase;
    white-space: nowrap;
}
.table td { border-color: #edf2f7; padding: .8rem .75rem; vertical-align: middle; }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: #f0fdfa; }
.dataTables_wrapper .dataTables_filter input, .dataTables_wrapper .dataTables_length select { border: 1px solid #cbd5e1; border-radius: 8px; padding: .35rem .55rem; }
.page-item .page-link { border-color: var(--crm-line); color: var(--crm-primary); }
.page-item.active .page-link { background: var(--crm-primary); border-color: var(--crm-primary); }

.dropdown-menu { border: 1px solid var(--crm-line); border-radius: 12px; box-shadow: 0 16px 36px rgba(15,23,42,.12) !important; padding: .45rem; }
.dropdown-item { border-radius: 8px; padding: .6rem .75rem; }
.dropdown-item:hover { background: var(--crm-primary-soft); color: var(--crm-primary-dark); }

/* Dashboard v2 */
.crm-dashboard { max-width: 1560px; margin: 0 auto; }
.crm-hero { align-items: center; background: radial-gradient(circle at 88% 5%, rgba(110,231,183,.28), transparent 25%), linear-gradient(118deg, #0f3f3b, #0f766e 58%, #09948a); border-radius: 22px; box-shadow: 0 20px 42px rgba(15,118,110,.19); color: #fff; display: flex; justify-content: space-between; margin: .15rem 0 1.35rem; overflow: hidden; padding: 2rem 2.1rem; position: relative; }
.crm-hero::after { border: 1px solid rgba(255,255,255,.12); border-radius: 50%; content: ''; height: 255px; position: absolute; right: -58px; top: -105px; width: 255px; }
.crm-hero h1 { color: #fff; font-size: clamp(1.5rem, 2.5vw, 2.15rem); letter-spacing: -.04em; margin: .12rem 0 .38rem; }
.crm-hero p:not(.crm-eyebrow) { color: rgba(255,255,255,.74); margin: 0; }
.crm-eyebrow { color: #14b8a6; font-size: .66rem; font-weight: 800; letter-spacing: .13em; margin: 0 0 .38rem; text-transform: uppercase; }
.crm-hero .crm-eyebrow { color: #a7f3d0; }
.crm-hero-actions { display: flex; gap: .65rem; position: relative; z-index: 1; }
.crm-hero .btn-light { color: #0f5954; }
.crm-hero-outline { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.24); color: #fff; }
.crm-hero-outline:hover { background: rgba(255,255,255,.16); color: #fff; }
.crm-stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1.25rem; }
.crm-stat-card { align-items: center; background: #fff; border: 1px solid #e8eef4; border-radius: 16px; box-shadow: 0 6px 18px rgba(15,23,42,.045); display: flex; gap: .9rem; min-height: 115px; padding: 1.15rem; transition: transform .18s ease, box-shadow .18s ease; }
.crm-stat-card:hover { box-shadow: 0 14px 28px rgba(15,23,42,.09); transform: translateY(-2px); }
.crm-stat-icon { align-items: center; border-radius: 13px; display: inline-flex; flex: 0 0 46px; font-size: 1.08rem; height: 46px; justify-content: center; width: 46px; }
.crm-stat-icon.teal { background: #d9faf3; color: #078f81; }.crm-stat-icon.blue { background: #e3efff; color: #2879d7; }.crm-stat-icon.amber { background: #fff2d6; color: #ce8304; }.crm-stat-icon.violet { background: #eeeaff; color: #6657ca; }
.crm-stat-card small, .crm-stat-card em { color: #64748b; display: block; font-size: .72rem; font-style: normal; }.crm-stat-card small { font-weight: 700; }.crm-stat-card strong { color: #172033; display: block; font-size: 1.55rem; letter-spacing: -.04em; line-height: 1.2; margin: .13rem 0; }
.crm-panel { background: #fff; border: 1px solid #e8eef4; border-radius: 17px; box-shadow: 0 7px 20px rgba(15,23,42,.045); overflow: hidden; padding: 1.25rem; }
.crm-panel-head { align-items: flex-start; display: flex; justify-content: space-between; margin-bottom: 1rem; }.crm-panel-head h2 { font-size: 1.04rem; margin: 0; }.crm-panel-head .crm-eyebrow { margin-bottom: .22rem; }
.crm-chip { background: #edfdfa; border-radius: 999px; color: #0f766e; font-size: .7rem; font-weight: 700; padding: .38rem .65rem; }.crm-chart-wrap { height: 275px; }.crm-donut-wrap { height: 205px; margin: .35rem auto .7rem; max-width: 250px; }
.crm-legend { display: flex; gap: 1rem; justify-content: center; }.crm-legend span { color: #64748b; font-size: .78rem; }.crm-legend strong { color: #172033; margin-left: .22rem; }.dot { border-radius: 50%; display: inline-block; height: 8px; width: 8px; }.dot.male { background: #14b8a6; }.dot.female { background: #818cf8; }
.crm-text-link { color: #0f766e; font-size: .8rem; font-weight: 800; }.crm-text-link i { font-size: .65rem; margin-left: .2rem; }.crm-client-row { align-items: center; border-top: 1px solid #eef2f7; color: inherit; display: grid; gap: .75rem; grid-template-columns: 38px minmax(150px, 1.4fr) minmax(110px, 1fr) auto; padding: .78rem 0; }.crm-client-row:hover { color: inherit; text-decoration: none; }.crm-client-row:hover .crm-client-name strong { color: #0f766e; }.crm-avatar { align-items: center; background: #e3f8f4; border-radius: 11px; color: #0f766e; display: inline-flex; font-size: .7rem; font-weight: 800; height: 38px; justify-content: center; width: 38px; }.crm-client-name strong, .crm-client-name small, .crm-timeline-item strong, .crm-timeline-item small { display: block; }.crm-client-name strong, .crm-timeline-item strong { color: #263448; font-size: .82rem; }.crm-client-name small, .crm-timeline-item small { color: #94a3b8; font-size: .72rem; margin-top: .16rem; }.crm-row-group { color: #64748b; font-size: .76rem; }.crm-status { background: #f1f5f9; border-radius: 999px; color: #64748b; font-size: .67rem; font-weight: 800; padding: .32rem .56rem; text-transform: capitalize; }.crm-status.is-active { background: #dcfce7; color: #16803a; }
.crm-timeline-item { align-items: center; border-top: 1px solid #eef2f7; color: inherit; display: grid; gap: .75rem; grid-template-columns: 40px 1fr auto; padding: .72rem 0; }.crm-timeline-item:hover { color: inherit; text-decoration: none; }.crm-timeline-item:hover strong { color: #0f766e; }.crm-timeline-item > i { color: #a8b3c1; font-size: .68rem; }.crm-date-box { background: #effaf8; border-radius: 9px; color: #0f766e; line-height: 1; padding: .38rem .15rem; text-align: center; }.crm-date-box b { display: block; font-size: .92rem; }.crm-date-box small { font-size: .58rem; font-weight: 700; margin-top: .12rem; text-transform: uppercase; }.crm-empty { color: #94a3b8; padding: 2rem .5rem; text-align: center; }.crm-empty i { color: #5eead4; font-size: 1.8rem; }.crm-empty p { font-size: .83rem; margin: .5rem 0; }.crm-empty a { color: #0f766e; font-size: .78rem; font-weight: 800; }.crm-empty.compact { padding: 1.4rem .5rem; }
@media (max-width: 1199.98px) { .crm-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .crm-hero { align-items: flex-start; flex-direction: column; gap: 1.15rem; padding: 1.5rem; }.crm-hero-actions { flex-wrap: wrap; }.crm-stat-grid { gap: .7rem; }.crm-stat-card { min-height: 98px; padding: .9rem; }.crm-stat-icon { flex-basis: 39px; height: 39px; width: 39px; }.crm-stat-card strong { font-size: 1.25rem; }.crm-panel { padding: 1rem; }.crm-chart-wrap { height: 225px; }.crm-client-row { grid-template-columns: 36px 1fr auto; }.crm-row-group { display: none; }.crm-client-row .crm-status { font-size: .6rem; padding: .28rem .43rem; } }
@media (max-width: 420px) { .crm-stat-grid { grid-template-columns: 1fr; }.crm-hero-actions .btn { width: 100%; }.crm-legend { gap: .55rem; }.crm-client-row { gap: .55rem; } }
.modal-content { border: 0; border-radius: 18px; box-shadow: 0 24px 60px rgba(15,23,42,.22); }
.modal-header, .modal-footer { border-color: var(--crm-line); }
.alert { border: 0; border-radius: 11px; }
.badge { border-radius: 999px; font-weight: 700; padding: .38em .68em; }

.sticky-footer { background: transparent !important; padding: 1.25rem 0 !important; }
.sticky-footer .copyright { color: var(--crm-muted); font-size: .78rem; }
.scroll-to-top { background: var(--crm-primary) !important; border-radius: 12px; }

.crm-sidebar-backdrop {
    background: rgba(2, 6, 23, .54);
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity .2s ease;
    visibility: hidden;
    z-index: 1030;
}

.crm-sidebar-backdrop.is-visible { opacity: 1; pointer-events: auto; visibility: visible; }
body.crm-sidebar-open { overflow: hidden; }

.crm-sidebar-floating-toggle { display: none; }

/* Authentication */
body.bg-haramayn {
    background:
        radial-gradient(circle at 12% 18%, rgba(45,212,191,.24), transparent 30%),
        radial-gradient(circle at 88% 80%, rgba(245,158,11,.13), transparent 28%),
        linear-gradient(135deg, #082f2c 0%, #134e4a 52%, #0f766e 100%) !important;
    padding: 1.5rem;
}
body.bg-haramayn > .container { max-width: 1060px; }
body.bg-haramayn .card { border: 1px solid rgba(255,255,255,.45) !important; border-radius: 24px !important; box-shadow: 0 30px 80px rgba(2,44,42,.32) !important; }
body.bg-haramayn .bg-login-image { background-position: center; min-height: 590px; position: relative; }
body.bg-haramayn .bg-login-image::after { background: linear-gradient(180deg, transparent 35%, rgba(6,78,74,.72)); content: ""; inset: 0; position: absolute; }
body.bg-haramayn .form-control-user { border-radius: 11px !important; font-size: .92rem !important; height: 50px; padding: .75rem 1rem !important; }
body.bg-haramayn .btn-user { border-radius: 11px !important; font-size: .9rem; padding: .8rem 1rem; }

@media (min-width: 768px) {
    .sidebar { width: 17rem !important; }
    .sidebar .nav-item .nav-link { width: 100% !important; }
    .sidebar.toggled,
    .sidebar.crm-sidebar-hidden {
        box-shadow: none;
        flex-basis: 0;
        min-width: 0;
        overflow: hidden;
        padding-left: 0;
        padding-right: 0;
        transform: translateX(-105%);
        width: 0 !important;
    }
    body.sidebar-toggled .crm-sidebar-open-button,
    body.crm-sidebar-is-hidden .crm-sidebar-open-button { display: inline-flex; }
}

@media (max-width: 767.98px) {
    #wrapper { display: block !important; }
    #content-wrapper { min-height: 100vh; width: 100%; }
    .sidebar.bg-haramayn,
    body .bg-haramayn.sidebar {
        box-shadow: 18px 0 45px rgba(2,6,23,.28);
        height: 100dvh;
        left: 0;
        max-width: min(82vw, 290px);
        padding: 0 .75rem 1.5rem !important;
        position: fixed;
        top: 0;
        transform: translateX(0);
        transition: transform .22s ease, box-shadow .22s ease;
        width: min(82vw, 290px) !important;
        z-index: 1040;
    }
    .sidebar.toggled,
    .sidebar.crm-sidebar-hidden {
        box-shadow: none;
        margin-left: 0 !important;
        overflow: hidden;
        transform: translateX(-105%);
        width: min(82vw, 290px) !important;
    }
    .sidebar .sidebar-brand { height: 4.8rem; }
    .sidebar .sidebar-brand img { height: 38px; }
    .sidebar .nav-item .nav-link,
    .sidebar.toggled .nav-item .nav-link,
    .sidebar.crm-sidebar-hidden .nav-item .nav-link {
        justify-content: flex-start;
        padding: .72rem .85rem;
        text-align: left;
        width: 100% !important;
    }
    .sidebar .nav-item .nav-link span,
    .sidebar.toggled .nav-item .nav-link span,
    .sidebar.crm-sidebar-hidden .nav-item .nav-link span { display: inline !important; font-size: .84rem !important; }
    .sidebar .nav-item .nav-link i,
    .sidebar.toggled .nav-item .nav-link i,
    .sidebar.crm-sidebar-hidden .nav-item .nav-link i { font-size: .92rem; margin-right: .7rem; }
    .sidebar .sidebar-heading,
    .sidebar.toggled .sidebar-heading,
    .sidebar.crm-sidebar-hidden .sidebar-heading { display: block; text-align: left; }
    .sidebar .collapse,
    .sidebar.toggled .collapse,
    .sidebar.crm-sidebar-hidden .collapse { left: auto !important; margin: 0 !important; position: static !important; top: auto !important; }
    .sidebar .collapse .collapse-inner,
    .sidebar.toggled .collapse .collapse-inner,
    .sidebar.crm-sidebar-hidden .collapse .collapse-inner { border-radius: 12px !important; font-size: inherit; margin: .3rem 0 .6rem !important; width: auto; }
    .topbar { height: 4.25rem; padding: 0 .75rem; }
    #sidebarToggleTop { align-items: center; background: var(--crm-primary-soft); color: var(--crm-primary-dark); display: inline-flex !important; height: 40px; justify-content: center; width: 40px; }
    .crm-sidebar-floating-toggle {
        align-items: center;
        background: var(--crm-primary);
        border: 0;
        border-radius: 12px;
        box-shadow: 0 10px 25px rgba(15,118,110,.3);
        color: #fff;
        display: inline-flex;
        font-size: 1rem;
        height: 44px;
        justify-content: center;
        left: 14px;
        position: fixed;
        top: 14px;
        width: 44px;
        z-index: 1025;
    }
    body.crm-sidebar-open .crm-sidebar-floating-toggle { opacity: 0; pointer-events: none; }
    .crm-sidebar-open-button { display: none !important; }
    .crm-sidebar-close { right: 10px; top: 17px; }
    .container-fluid { padding: 0 .85rem 1.5rem; }
    .card-body { padding: 1rem; }
    .h3, h1.h3 { font-size: 1.3rem; }
    body.bg-haramayn { padding: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Sidebar state is fully independent from the legacy sb-admin toggle. */
body.crm-sidebar-opened #accordionSidebar {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

body.crm-sidebar-closed #accordionSidebar {
    box-shadow: none !important;
    flex: 0 0 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    pointer-events: none !important;
    transform: translateX(-105%) !important;
    visibility: hidden !important;
    width: 0 !important;
}

body.crm-sidebar-closed .crm-sidebar-open-button { display: inline-flex !important; }
body.crm-sidebar-opened .crm-sidebar-open-button { display: none !important; }

@media (max-width: 767.98px) {
    body.crm-sidebar-opened #accordionSidebar {
        opacity: 1 !important;
        transform: translateX(0) !important;
        visibility: visible !important;
        width: min(82vw, 290px) !important;
    }

    body.crm-sidebar-closed #accordionSidebar {
        opacity: 0 !important;
        transform: translateX(-105%) !important;
        visibility: hidden !important;
        width: min(82vw, 290px) !important;
    }

    body.crm-sidebar-closed .crm-sidebar-open-button {
        border-radius: 12px;
        display: inline-flex !important;
        left: 14px;
        top: 14px;
    }

    body.crm-sidebar-opened #sidebarToggleTop { opacity: 0; pointer-events: none; }
}
