/* ============================================================
   ApeexSense APEEX skin — aligned with Company-System
   Font Awesome Pro 6 + APEEX layout / cards / tables / forms
   ============================================================ */

:root {
    --accent: #6B7280;
    --accent-rgb: 107, 114, 128;
    --primary: #1a1a24;
    --secondary: #6b7280;
    --apeex-sidebar-width: 280px;
    --apeex-sidebar-collapsed-width: 72px;
    --apeex-sidebar-off: -110%;
    --apeex-sidebar-bg: #fafafa;
    --apeex-sidebar-border: #e5e5e5;
    --apeex-sidebar-text: #1a1a1a;
    --apeex-sidebar-muted: #5a5a5a;
    --apeex-sidebar-hover-bg: #f0f0f0;
    --apeex-sidebar-active-bg: #ffffff;
    --apeex-sidebar-active-border: #3a3a3a;
    --apeex-sidebar-accent: #1a1a1a;
    --apeex-sidebar-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    --apeex-sidebar-radius: 2px;
    --apeex-header-height: 60px;
    --apeex-header-bg: #ffffff;
    --apeex-header-border: #e5e7eb;
    --apeex-header-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    --apeex-header-text: #1a1a24;
    --apeex-header-muted: #6b7280;
    --apeex-header-accent: #10b981;
    --theme-color: #111827;
}

[dir="rtl"] {
    --apeex-sidebar-off: 110%;
}

body {
    color: rgba(0, 0, 0, 0.7);
    background-color: #f1f1f1;
    font-family: Almarai, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: -0.011em;
}

.fa,
.fas,
.far,
.fal,
.fat,
.fad,
.fab,
.fa-solid,
.fa-regular,
.fa-light,
.fa-thin,
.fa-duotone,
.fa-brands,
.fa-sharp {
    font-family: "Font Awesome 6 Pro", "Font Awesome 6 Brands" !important;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

.fa,
.far,
.fa-regular,
.fal,
.fa-light {
    font-weight: 400;
}

.fas,
.fa-solid {
    font-weight: 900;
}

/* FA4 aliases used in DataTables / legacy blades */
.fa-file-pdf-o:before { content: "\f1c1"; }
.fa-file-text-o:before { content: "\f15c"; }
.fa-refresh:before { content: "\f2f1"; }
.fa-eye-slash:before { content: "\f070"; }
.fa-eye:before { content: "\f06e"; }
.fa-print:before { content: "\f02f"; }
.fa-bars:before { content: "\f0c9"; }
.fa-angle-down:before { content: "\f107"; }
.fa-file:before { content: "\f15b"; }
.fa-barcode:before { content: "\f02a"; }
.fa-mobile:before { content: "\f3cd"; }

.apeex-overlay {
    display: none;
    position: fixed;
    top: var(--apeex-header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.4);
    z-index: 1055;
    backdrop-filter: blur(2px);
}

body.sidebar-open {
    overflow: hidden;
}

body.sidebar-open .apeex-overlay {
    display: block;
}

body:not(.pos-page) {
    padding-top: var(--apeex-header-height);
}

/* ===== Header ===== */
.apeex-header,
header.full-container.apeex-header {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    z-index: 1050;
    background: var(--apeex-header-bg);
    border-bottom: 1px solid var(--apeex-header-border);
    box-shadow: var(--apeex-header-shadow);
    min-height: var(--apeex-header-height);
    line-height: normal;
    padding: 0 !important;
    width: auto !important;
    margin: 0 !important;
}

.apeex-header-inner {
    height: var(--apeex-header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    gap: 12px;
}

.apeex-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.apeex-logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    text-decoration: none;
}

.apeex-system-name {
    color: var(--apeex-header-text);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.apeex-logo-img {
    display: block;
    max-height: 35px;
    width: auto;
}

.apeex-powered {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    font-size: 10px;
    color: #b0b0b0;
    border-inline-start: 1px solid #e5e7eb;
    padding-inline-start: 14px;
    line-height: 1;
    white-space: nowrap;
}

.apex-mark {
    display: block;
    height: 22px;
    width: auto;
}

.apeex-powered-bold {
    font-weight: 600;
    color: var(--apeex-header-accent);
}

.apeex-powered-icon {
    width: 14px;
    height: 14px;
    display: flex;
}

.apeex-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
}

.apeex-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
}

.apeex-nav > li {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.apeex-nav-btn,
.apeex-header .btn.btn-light,
.apeex-header .btn.btn-success {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    min-height: 38px;
    line-height: 1.2;
    text-decoration: none !important;
}

.apeex-nav-btn {
    border: none;
    background: transparent;
    color: var(--apeex-header-muted);
    cursor: pointer;
    font-family: inherit;
}

.apeex-nav-btn:hover,
.apeex-header a.nav-link.dropdown-item:hover {
    background: #f3f4f6;
    color: var(--apeex-header-text);
}

.apeex-header a.nav-link.dropdown-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    color: var(--apeex-header-muted);
    font-size: 13px;
    background: transparent;
}

.apeex-header .btn.btn-light {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: var(--apeex-header-text);
}

.apeex-header .btn.btn-success {
    background: #111827;
    border-color: #111827;
    color: #fff;
}

.apeex-header .btn.btn-success:hover {
    background: #000;
    border-color: #000;
}

.apeex-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: var(--apeex-header-text);
    font-size: 20px;
    cursor: pointer;
}

.apeex-sidebar-toggle:hover {
    background: #f3f4f6;
}

.apeex-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    background: transparent;
    color: var(--apeex-header-text);
    text-decoration: none !important;
}

.apeex-profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--apeex-header-muted);
    overflow: hidden;
}

.apeex-header .badge {
    margin-inline-start: 4px;
}

.apeex-header .badge-success {
    background: #dcfce7 !important;
    color: #166534 !important;
    border-radius: 6px;
    height: auto;
    width: auto;
    font-size: 10px;
    padding: 2px 6px;
}

.apeex-header .notification-number,
.apeex-header .badge-danger {
    background: #ef4444 !important;
    color: #fff !important;
    border-radius: 999px;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
}

/* ===== Sidebar ===== */
nav.side-navbar.apeex-sidebar,
.apeex-sidebar.side-navbar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0;
    inset-inline-start: 0;
    inset-inline-end: auto;
    left: auto;
    right: auto;
    height: auto !important;
    width: var(--apeex-sidebar-width) !important;
    background: var(--apeex-sidebar-bg);
    border-inline-end: 1px solid var(--apeex-sidebar-border);
    border-inline-start: none;
    box-shadow: var(--apeex-sidebar-shadow);
    z-index: 1060;
    overflow: hidden;
    padding-top: 0;
    background: var(--apeex-sidebar-bg) !important;
    opacity: 1 !important;
    transition: transform 0.25s ease, width 0.25s ease;
    display: flex;
    flex-direction: column;
}

.apeex-sidebar-inner {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0 12px;
    background: var(--apeex-sidebar-bg);
    scrollbar-width: thin;
    scrollbar-color: #d1d5db var(--apeex-sidebar-bg);
}

.apeex-sidebar .mCustomScrollBox,
.apeex-sidebar .mCSB_container,
.apeex-sidebar .mCSB_container_wrapper,
.apeex-sidebar .mCSB_wrap,
.apeex-sidebar .mCSB_container.mCS_y_hidden {
    background: var(--apeex-sidebar-bg) !important;
    overscroll-behavior: contain;
}

.apeex-sidebar .mCSB_scrollTools {
    display: none !important;
}

.apeex-sidebar .side-menu > li > a i,
nav.side-navbar.apeex-sidebar li a i {
    background: transparent !important;
    border: none !important;
    margin-right: 0;
}

.apeex-sidebar .side-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.apeex-sidebar .side-menu > li {
    margin-bottom: 4px;
    padding: 0;
}

.apeex-sidebar .side-menu > li > a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 1px 18px;
    min-height: 40px;
    color: var(--apeex-sidebar-text);
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0.01em;
    text-decoration: none;
    border-radius: var(--apeex-sidebar-radius);
    transition: none;
}

.apeex-sidebar .side-menu > li > a i {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--apeex-sidebar-muted);
    font-size: 17px;
    flex-shrink: 0;
}

.apeex-sidebar .side-menu > li:not(.active) > a span {
    opacity: 0.75;
}

.apeex-sidebar .side-menu > li:not(.active) > a:hover span,
.apeex-sidebar .side-menu > li > a[aria-expanded="true"] span {
    opacity: 1;
}

.apeex-sidebar .side-menu > li > a:hover,
.apeex-sidebar .side-menu > li > a[aria-expanded="true"],
.apeex-sidebar .side-menu > li.active > a {
    background: var(--apeex-sidebar-hover-bg);
    color: var(--apeex-sidebar-accent);
}

.apeex-sidebar .side-menu > li.active > a,
.apeex-sidebar .side-menu > li > a[aria-expanded="true"] {
    background: var(--apeex-sidebar-active-bg);
    font-weight: 500;
}

.apeex-sidebar .side-menu > li > a:hover i,
.apeex-sidebar .side-menu > li.active > a i,
.apeex-sidebar .side-menu > li > a[aria-expanded="true"] i {
    color: var(--apeex-sidebar-accent);
}

.apeex-sidebar .side-menu > li > a[data-toggle="collapse"]::before,
nav.side-navbar.apeex-sidebar li a[data-toggle=collapse]::before {
    content: none !important;
    display: none !important;
}

.apeex-sidebar .side-menu > li > a[data-toggle="collapse"]::after {
    content: "\f105";
    font-family: "Font Awesome 6 Pro";
    font-weight: 400;
    font-size: 14px;
    color: var(--apeex-sidebar-muted);
    margin-inline-start: auto;
    transition: none;
    display: inline-block;
    line-height: 1;
}

[dir="rtl"] .apeex-sidebar .side-menu > li > a[data-toggle="collapse"]::after {
    transform: rotate(180deg);
}

.apeex-sidebar .side-menu > li > a[aria-expanded="true"]::after,
[dir="rtl"] .apeex-sidebar .side-menu > li > a[aria-expanded="true"]::after {
    transform: rotate(90deg) !important;
}

.apeex-sidebar .side-menu ul.collapse {
    list-style: none;
    padding: 0 0 6px;
    margin: 0;
}

.apeex-sidebar .side-menu ul.collapse a {
    display: flex;
    align-items: center;
    padding-block: 7px;
    padding-inline: 52px 16px;
    font-size: 12.5px;
    font-weight: 400;
    color: var(--apeex-sidebar-text);
    border-radius: 8px;
    border-inline-start: 2px solid transparent;
    text-decoration: none;
}

.apeex-sidebar .side-menu ul.collapse a:hover,
.apeex-sidebar .side-menu ul.collapse li.active > a {
    background: var(--apeex-sidebar-hover-bg);
    border-inline-start-color: var(--apeex-sidebar-active-border);
    color: var(--apeex-sidebar-accent);
}

.apeex-sidebar .side-menu ul.collapse li.channel-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.apeex-sidebar .side-menu ul.collapse li.channel-row > a.channel-row-link {
    flex: 1;
    min-width: 0;
}

.apeex-sidebar .side-menu ul.collapse li.channel-row > a.channel-row-eye {
    flex: 0 0 32px;
    justify-content: center;
    padding: 7px 0;
}

.apeex-sidebar .close {
    display: none;
    position: absolute;
    top: 8px;
    inset-inline-end: 10px;
    z-index: 2;
    cursor: pointer;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

nav.side-navbar.shrink.apeex-sidebar {
    transform: translateX(var(--apeex-sidebar-off));
    width: var(--apeex-sidebar-width) !important;
    opacity: 1 !important;
}

@media (min-width: 1200px) {
    html.apeex-pre-open body:not(.pos-page) nav.side-navbar.shrink.apeex-sidebar {
        transform: none;
        width: var(--apeex-sidebar-width) !important;
    }

    html.apeex-pre-open body:not(.pos-page) nav.side-navbar.shrink.apeex-sidebar .side-menu > li > a span,
    html.apeex-pre-open body:not(.pos-page) nav.side-navbar.shrink.apeex-sidebar .side-menu > li > a::after {
        display: inline;
    }

    html.apeex-pre-open body:not(.pos-page) nav.side-navbar.shrink .apeex-sidebar-brand {
        justify-content: space-between;
    }

    html.apeex-pre-open body:not(.pos-page) nav.side-navbar.shrink .apeex-sidebar-brand .apeex-system-name,
    html.apeex-pre-open body:not(.pos-page) nav.side-navbar.shrink .apeex-sidebar-brand-toggle {
        display: inline-flex;
    }

    html.apeex-pre-open body:not(.pos-page) .page.apeex-content {
        padding-inline-start: var(--apeex-sidebar-width);
    }

    html.apeex-pre-collapsed body:not(.pos-page) .apeex-header,
    html.apeex-pre-collapsed body:not(.pos-page) .page.apeex-content {
        inset-inline-start: var(--apeex-sidebar-collapsed-width);
    }

    html.apeex-pre-collapsed body:not(.pos-page) .page.apeex-content {
        padding-inline-start: var(--apeex-sidebar-collapsed-width);
    }

    html.apeex-pre-collapsed body:not(.pos-page) footer.main-footer.apeex-footer,
    body:not(.pos-page).apeex-collapsed footer.main-footer.apeex-footer,
    .page.apeex-content.active footer.main-footer.apeex-footer,
    .page.active .apeex-footer {
        position: fixed !important;
        bottom: 0 !important;
        inset-inline-start: var(--apeex-sidebar-collapsed-width) !important;
        inset-inline-end: 0 !important;
    }

    nav.side-navbar.shrink.apeex-sidebar {
        transform: none;
        width: var(--apeex-sidebar-collapsed-width) !important;
        opacity: 1 !important;
    }

    nav.side-navbar.shrink.apeex-sidebar .side-menu > li > a span,
    nav.side-navbar.shrink.apeex-sidebar .side-menu ul.collapse,
    nav.side-navbar.shrink.apeex-sidebar .side-menu > li > a::after {
        display: none;
    }

    nav.side-navbar.shrink.apeex-sidebar .side-menu > li > a {
        justify-content: center;
        padding: 10px 8px;
    }

    body:not(.pos-page) .apeex-header {
        inset-inline-start: var(--apeex-sidebar-width);
        z-index: 110;
    }

    body:not(.pos-page).apeex-collapsed .apeex-header {
        inset-inline-start: var(--apeex-sidebar-collapsed-width);
    }

    body:not(.pos-page) .apeex-header .apeex-logo-link,
    body:not(.pos-page) .apeex-header .apeex-powered {
        display: none;
    }

    .page.apeex-content {
        padding-inline-start: var(--apeex-sidebar-width);
        width: 100%;
        float: none;
        margin: 0;
    }

    .page.apeex-content.active {
        padding-inline-start: var(--apeex-sidebar-collapsed-width);
    }

    footer.main-footer.apeex-footer {
        position: fixed !important;
        bottom: 0 !important;
        left: auto !important;
        right: auto !important;
        inset-inline-start: var(--apeex-sidebar-width);
        inset-inline-end: 0;
        width: auto !important;
    }
}

@media (max-width: 1199px) {
    .apeex-sidebar-brand {
        display: none;
    }

    .apeex-header-inner {
        padding: 0 10px;
        gap: 8px;
    }

    .apeex-logo-img {
        max-height: 28px;
    }

    .apeex-header-right {
        overflow: visible;
        min-width: 0;
    }

    .apeex-nav {
        gap: 2px;
    }

    .apeex-header .btn.btn-light,
    .apeex-header .btn.btn-success,
    .apeex-header a.nav-link.dropdown-item {
        font-size: 0;
        gap: 0;
        padding: 8px;
        min-width: 38px;
        min-height: 38px;
        justify-content: center;
        white-space: nowrap;
    }

    .apeex-header .btn.btn-light i,
    .apeex-header .btn.btn-success i,
    .apeex-header a.nav-link.dropdown-item i {
        font-size: 18px;
        margin: 0;
    }

    .apeex-header .badge {
        font-size: 10px !important;
        position: absolute;
        top: 2px;
        inset-inline-end: 2px;
        margin: 0;
    }

    .apeex-header .badge-success {
        display: none;
    }

    .apeex-header .nav-item {
        position: relative;
    }

    .apeex-profile-btn {
        padding: 4px;
    }

    .apeex-header,
    header.full-container.apeex-header {
        z-index: 1070;
    }

    nav.side-navbar.apeex-sidebar {
        z-index: 1060;
        width: min(280px, 86vw) !important;
        top: var(--apeex-header-height) !important;
    }

    nav.side-navbar.apeex-sidebar .close {
        display: flex;
        color: var(--apeex-sidebar-text);
        background: var(--apeex-sidebar-hover-bg);
    }

    .page.apeex-content,
    .page.apeex-content.active,
    .page.apeex-content.active-sm {
        padding-inline-start: 0 !important;
        width: 100% !important;
        float: none;
        margin: 0;
    }

    footer.main-footer.apeex-footer {
        position: fixed !important;
        bottom: 0 !important;
        left: auto !important;
        right: auto !important;
        inset-inline-start: 0 !important;
        inset-inline-end: 0 !important;
        width: auto !important;
    }

    .fixed-actions {
        right: 8px;
        transform: translateY(-50%) scale(0.9);
    }

    [dir="rtl"] .fixed-actions {
        right: auto;
        left: 8px;
    }
}

/* ===== Content + footer ===== */
.page.apeex-content {
    position: relative;
    min-height: calc(100vh - 60px);
    padding-top: 16px;
    padding-bottom: 72px;
    float: none;
    width: 100%;
    background: #f1f1f1;
}

.page.apeex-content img {
    max-width: 100%;
    height: auto;
}

.page.apeex-content img.apex-mark {
    width: auto;
    height: 20px;
    max-height: 20px;
}

.page.apeex-content > #content {
    padding-inline: 16px;
}

footer.main-footer.apeex-footer {
    position: fixed !important;
    bottom: 0 !important;
    left: auto !important;
    right: auto !important;
    inset-inline-start: 0;
    inset-inline-end: 0;
    width: auto !important;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 12px 16px;
    z-index: 1000;
    direction: ltr;
}

.apeex-footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.apeex-footer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    direction: ltr;
}

.apeex-footer-logo svg,
.apeex-footer-logo .apex-mark {
    height: 20px;
    width: auto;
    display: block;
}

.apeex-footer-copy {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.7);
    font-family: inherit;
}

.apeex-footer-copy .apeex-text-bold,
.apeex-footer-brand {
    font-weight: 700;
    color: #1a1a24;
    text-decoration: none;
}

.apeex-footer-version {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.6);
    font-weight: 500;
    font-family: inherit;
}

/* ===== Cards / tables / buttons / forms ===== */
.card {
    border: 1px solid #e3e3e3;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    background: #fff;
}

.card-header {
    background: #fafafa;
    border-bottom: 1px solid #e3e3e3;
    border-radius: 16px 16px 0 0;
    padding: 14px 20px;
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5 {
    font-size: 16px;
    font-weight: 700;
    color: #202223;
}

.btn {
    border-radius: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary,
.btn-info {
    background: #111827;
    border-color: #111827;
}

.btn-primary:hover,
.btn-info:hover,
.btn-primary:focus,
.btn-info:focus {
    background: #000;
    border-color: #000;
}

.btn-success {
    background: #111827;
    border-color: #111827;
}

.form-control,
.select2-container .select2-selection--single,
.bootstrap-select .dropdown-toggle {
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    min-height: 38px;
    font-size: 14px;
}

body:not(.pos-page) input[type="color"].form-control {
    height: 38px;
    min-height: 38px;
    padding: 4px;
}

.form-control:focus {
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

table.dataTable,
.table {
    background: #fff;
}

.table thead th,
table.dataTable thead th {
    font-weight: 600;
    color: #5a5e62;
    background: #fafafa;
    border-bottom: 1px solid #e3e3e3 !important;
    font-size: 13px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 12px 16px;
}

.table tbody td,
table.dataTable tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #e3e3e3;
    vertical-align: middle;
}

.table tbody tr:hover,
table.dataTable tbody tr:hover {
    background: #fafafa;
}

.dt-buttons .btn,
.dataTables_wrapper .dt-buttons .btn {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #202223;
}

.count-title {
    border: 1px solid #e4e6fc;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dashboard-counts .count-title i {
    color: #111827;
}

.dropdown-menu {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    padding: 6px;
}

.dropdown-menu .dropdown-item,
.dropdown-menu > li > a {
    border-radius: 8px;
    padding: 8px 12px;
}

.modal-content {
    border-radius: 16px;
    border: 1px solid #e5e7eb;
}

.modal-header {
    border-bottom: 1px solid #e5e7eb;
}

.right-sidebar {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.apeex-header-tools {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border-radius: 12px;
    background: #f3f4f6;
}

.apeex-header-divider {
    display: block;
    width: 1px;
    height: 18px;
    background: #c5cad3;
}

.apeex-icon-btn {
    position: relative;
    min-width: 38px;
    justify-content: center;
    padding: 8px;
}

.apeex-icon-btn i {
    font-size: 20px;
}

.apeex-notification-bell,
.apeex-gear,
.apeex-lang,
.apeex-profile {
    position: relative;
}

.apeex-notification-badge {
    position: absolute;
    top: 2px;
    inset-inline-end: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    border: 2px solid #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 12px;
    text-align: center;
}

.apeex-note-panel,
.apeex-gear-panel,
.apeex-dropdown-globe,
.apeex-profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-end: 0;
    z-index: 1200;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.apeex-note-panel[hidden],
.apeex-gear-panel[hidden],
.apeex-dropdown-globe[hidden],
.apeex-profile-dropdown[hidden] {
    display: none !important;
}

.apeex-note-panel {
    width: min(320px, calc(100vw - 16px));
    padding: 8px;
}

.apeex-note-panel a,
.apeex-note-empty {
    display: block;
    margin: 0;
    padding: 10px 12px;
    border-radius: 8px;
    color: #111827;
    font-size: 13px;
    text-decoration: none;
}

.apeex-note-panel a:hover {
    background: #f3f4f6;
}

.apeex-gear.is-open .apeex-icon-btn,
.apeex-lang.is-open .apeex-icon-btn,
.apeex-notification-bell.is-open .apeex-icon-btn,
.apeex-profile.is-open .apeex-profile-btn {
    background: #fff;
    color: #111827;
    box-shadow: inset 0 0 0 1.5px #111827;
}

.apeex-gear-panel {
    width: min(280px, calc(100vw - 16px));
    max-height: min(70vh, 520px);
    overflow-y: auto;
    padding: 12px 12px 6px;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.apeex-gear-panel::-webkit-scrollbar {
    width: 4px;
}

.apeex-gear-panel::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
}

.apeex-gear-title {
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.apeex-gear-panel section {
    margin-bottom: 6px;
}

.apeex-gear-panel h3 {
    margin: 0 0 2px;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
}

.apeex-gear-panel a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 0;
    margin: 0;
    padding: 4px 8px;
    border-radius: 8px;
    color: #111827;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
}

.apeex-gear-panel a i {
    width: 28px;
    font-size: 18px;
    text-align: center;
    color: #243028;
}

.apeex-gear-panel a:hover {
    background: #f3f4f6;
    color: #111827;
}

.apeex-dropdown-globe {
    min-width: 140px;
    margin: 0;
    padding: 6px 0;
    list-style: none;
}

.apeex-dropdown-globe a {
    display: block;
    padding: 10px 16px;
    color: #1a1a24;
    font-size: 14px;
    text-decoration: none;
}

.apeex-dropdown-globe a:hover,
.apeex-dropdown-globe a.is-active {
    background: #f9fafb;
}

.apeex-profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 4px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
}

.apeex-profile-btn:hover {
    background: #f3f4f6;
}

.apeex-profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #eef2ff;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.apeex-profile-dropdown {
    min-width: 220px;
    margin: 0;
    padding: 6px 0;
    list-style: none;
}

.apeex-profile-dropdown-user {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 16px 8px;
}

.apeex-profile-dropdown-user strong {
    font-size: 13px;
    color: #1a1a24;
}

.apeex-profile-dropdown-user span {
    font-size: 12px;
    color: #6b7280;
}

.apeex-profile-divider {
    height: 1px;
    margin: 6px 16px;
    background: #e5e7eb;
}

.apeex-profile-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border: 0;
    background: transparent;
    color: #1a1a24;
    font-size: 14px;
    text-align: start;
    text-decoration: none;
}

.apeex-profile-dropdown a i {
    width: 20px;
    font-size: 18px;
    text-align: center;
    color: #6b7280;
}

.apeex-profile-dropdown a:hover {
    background: #f9fafb;
}

.apeex-profile-logout,
.apeex-profile-logout i {
    color: #ef4444;
}

.apeex-profile-logout:hover {
    background: #fef2f2;
}

body.dark-mode .apeex-header-tools {
    background: #23232f;
}

body.dark-mode .apeex-note-panel,
body.dark-mode .apeex-gear-panel,
body.dark-mode .apeex-dropdown-globe,
body.dark-mode .apeex-profile-dropdown {
    background: #1a1a24;
    border-color: #2d2d38;
}

body.dark-mode .apeex-note-panel a,
body.dark-mode .apeex-gear-panel a,
body.dark-mode .apeex-gear-title,
body.dark-mode .apeex-dropdown-globe a,
body.dark-mode .apeex-profile-dropdown a,
body.dark-mode .apeex-profile-dropdown-user strong {
    color: #e5e7eb;
}

body.dark-mode .apeex-gear-panel a i,
body.dark-mode .apeex-profile-dropdown a i,
body.dark-mode .apeex-gear-panel h3,
body.dark-mode .apeex-profile-dropdown-user span {
    color: #9ca3af;
}

.pos-page .apeex-sidebar.side-navbar,
.pos-page nav.side-navbar.apeex-sidebar {
    top: 0 !important;
}

/* Auth */
.cs_auth_card {
    display: flex;
    min-height: 100vh;
    background: #f1f1f1;
}

.cs_card_card_out {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    padding: 24px;
}

.cs_card_card_in {
    background: #fff;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    padding: clamp(1.5rem, 4vw, 3rem);
    box-shadow: 0 18px 36px -12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.cs_login_logo {
    display: block;
    text-align: center;
    margin-bottom: 1.5rem;
}

.cs_login_logo img {
    max-width: 180px;
    height: auto;
}

.cs_login_title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: #1a1a24;
}

.cs_login_subtitle {
    font-size: 1rem;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.cs_input_shell {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
}

.cs_input_addon {
    position: absolute;
    inset-inline-start: 15px;
    color: #6c757d;
    font-size: 16px;
    z-index: 2;
}

.cs_form_field {
    padding-inline-start: 40px !important;
    padding-inline-end: 48px !important;
    width: 100%;
    height: 46px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
}

.cs_toggle_password {
    position: absolute;
    inset-inline-end: 10px;
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    z-index: 2;
}

.cs_btn_primary {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 12px;
    background: #111827;
    color: #fff;
    font-weight: 600;
}

.cs_btn_primary:hover {
    background: #000;
    color: #fff;
}

body.dark-mode {
    --apeex-sidebar-active-border: transparent;
    --apeex-sidebar-bg: #1a1a24;
    --apeex-sidebar-border: #2d2d38;
    --apeex-sidebar-text: #e5e7eb;
    --apeex-sidebar-muted: #9ca3af;
    --apeex-sidebar-hover-bg: #23232f;
    --apeex-sidebar-active-bg: #2b2b38;
    --apeex-sidebar-accent: #ffffff;
    --apeex-header-bg: #1a1a24;
    --apeex-header-border: #2d2d38;
    --apeex-header-text: #e5e7eb;
    --apeex-header-muted: #9ca3af;
    background-color: #111118 !important;
    color: #e5e7eb;
}

body.dark-mode .apeex-header,
body.dark-mode header.full-container.apeex-header,
body.dark-mode nav.side-navbar.apeex-sidebar,
body.dark-mode .apeex-sidebar-inner,
body.dark-mode .page.apeex-content,
body.dark-mode .card,
body.dark-mode .count-title,
body.dark-mode footer.main-footer.apeex-footer,
body.dark-mode .cs_card_card_in,
body.dark-mode .dropdown-menu,
body.dark-mode .modal-content,
body.dark-mode .right-sidebar,
body.dark-mode table.dataTable,
body.dark-mode .table,
body.dark-mode .table thead th,
body.dark-mode table.dataTable thead th,
body.dark-mode .card-header,
body.dark-mode .mCustomScrollBox,
body.dark-mode .mCSB_container {
    background: #1a1a24 !important;
    color: #e5e7eb;
    border-color: #2d2d38 !important;
}

body.dark-mode .apeex-header .btn.btn-light,
body.dark-mode .apeex-nav-btn,
body.dark-mode .apeex-header a.nav-link.dropdown-item,
body.dark-mode .form-control,
body.dark-mode .cs_form_field,
body.dark-mode .apeex-profile-avatar {
    background: #23232f !important;
    color: #e5e7eb;
    border-color: #2d2d38 !important;
}

body.dark-mode .apeex-header .btn.btn-light:hover,
body.dark-mode .apeex-nav-btn:hover,
body.dark-mode .apeex-header a.nav-link.dropdown-item:hover,
body.dark-mode .apeex-sidebar-toggle:hover {
    background: #2b2b38 !important;
    color: #fff;
}

body.dark-mode .apeex-footer-copy,
body.dark-mode .apeex-footer-copy .apeex-text-bold,
body.dark-mode .apeex-footer-version,
body.dark-mode .text-muted {
    color: #9ca3af !important;
}

body.dark-mode .apeex-sidebar .side-menu > li > a,
body.dark-mode .apeex-sidebar .side-menu > li > a:hover,
body.dark-mode .apeex-sidebar .side-menu ul.collapse,
body.dark-mode .apeex-sidebar .side-menu ul.collapse a,
body.dark-mode .apeex-sidebar .side-menu ul.collapse a:hover,
body.dark-mode .side-navbar li a,
body.dark-mode .side-navbar li a:hover,
body.dark-mode .side-navbar li ul,
body.dark-mode .fixed-actions a,
body.dark-mode .fixed-actions a:hover {
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

body.dark-mode .apeex-sidebar .side-menu > li > a i,
body.dark-mode .side-navbar li a i,
body.dark-mode .side-navbar li a:hover i {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #c4b5fd !important;
}

body.dark-mode .dt-buttons .btn,
body.dark-mode .btn-default,
body.dark-mode .fixed-actions a {
    background: #23232f !important;
    color: #e5e7eb;
    border-color: #2d2d38;
}

#content {
    overflow-x: auto;
}

@media (max-width: 767px) {
    .page.apeex-content {
        padding-top: 12px;
        padding-bottom: 88px;
    }

    .page.apeex-content > #content {
        padding-inline: 10px;
    }

    .card-header {
        padding: 12px;
    }

    .apeex-footer-content {
        justify-content: center;
        text-align: center;
    }

    .right-sidebar.open {
        position: fixed !important;
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        max-width: none;
        z-index: 1060;
    }
}

.cs_auth_card .form-group-material {
    margin: 0 0 4px;
    position: relative;
}

.cs_auth_card .input-material {
    background: #fff;
    border: 1px solid #e5e7eb !important;
    box-shadow: none !important;
}

.cs_auth_card .forgot-pass,
.cs_auth_card .signup {
    color: #6B7280;
    font-size: 13px;
}

.apeex-sidebar-brand {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
    padding: 12px 14px 4px;
}

.apeex-brand-lockup {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.apeex-sidebar-brand .apeex-powered {
    border: 0;
    padding: 0;
    font-size: 11px;
    color: #8a8a8a;
}

.apeex-sidebar-brand .apex-mark {
    height: 26px;
}

.apeex-sidebar-brand-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    border-radius: 8px;
    color: #5a5a5a;
    cursor: pointer;
}

.apeex-sidebar-brand-toggle:hover {
    background: #f0f0f0;
}

@media (min-width: 1200px) {
    body:not(.pos-page) .apeex-sidebar-brand {
        display: flex;
    }

    nav.side-navbar.shrink .apeex-sidebar-brand {
        justify-content: center;
        padding-inline: 8px;
    }

    nav.side-navbar.shrink .apeex-sidebar-brand .apeex-system-name,
    nav.side-navbar.shrink .apeex-sidebar-brand-toggle {
        display: none;
    }
}

body:not(.pos-page) .card-header h1,
body:not(.pos-page) .card-header h2,
body:not(.pos-page) .card-header h3,
body:not(.pos-page) .card-header h4 {
    text-align: start !important;
    font-size: 18px;
    font-weight: 700;
    color: #202223;
    margin: 0;
}

body:not(.pos-page) .table-responsive {
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

body:not(.pos-page) .card .table-responsive {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

body:not(.pos-page) section > .container-fluid > .btn {
    margin-bottom: 12px;
}

body:not(.pos-page) .dashboard-counts .count-title {
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

body:not(.pos-page) .dashboard-counts .count-title i,
body:not(.pos-page) .dashboard-counts .count-title strong,
body:not(.pos-page) .dashboard-counts .count-title .count-number {
    color: #202223 !important;
}

body:not(.pos-page) .brand-text h3 {
    font-size: 18px !important;
    font-weight: 700;
    color: #202223;
}

body:not(.pos-page) section > .container-fluid > h3,
body:not(.pos-page) section > .container-fluid > h4 {
    font-size: 18px;
    font-weight: 700;
    color: #202223;
    line-height: 1.2;
}

body:not(.pos-page) .card-body {
    padding: 16px 20px;
}

body:not(.pos-page) .modal-content {
    border: 1px solid #e3e3e3;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

body:not(.pos-page) .modal-header,
body:not(.pos-page) .modal-footer {
    border-color: #e3e3e3;
}

body:not(.pos-page) label,
body:not(.pos-page) .form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #202223;
}

body:not(.pos-page) .btn {
    min-height: 36px;
    font-size: 14px;
}

body:not(.pos-page) .table,
body:not(.pos-page) table.dataTable {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.7);
}

body:not(.pos-page) .dataTables_wrapper .dataTables_filter input,
body:not(.pos-page) .dataTables_wrapper .dataTables_length select {
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    min-height: 36px;
    padding: 6px 10px;
}

body:not(.pos-page) .btn.btn-default,
body:not(.pos-page) .btn.btn-default:focus,
body:not(.pos-page) .bootstrap-select > .dropdown-toggle {
    color: #202223 !important;
    border-color: #e3e3e3 !important;
    background-color: #fff;
}

body:not(.pos-page) .page-link {
    color: #202223;
}

body:not(.pos-page) .page-item.active .page-link {
    background-color: #111827 !important;
    border-color: #111827 !important;
    color: #fff !important;
}

#loader {
    display: none !important;
}

.apeex-sidebar .apeex-system-name {
    color: var(--apeex-sidebar-text);
}

.apeex-sidebar .side-menu a,
.apeex-sidebar .side-menu a i,
.side-navbar i,
.fixed-actions a,
.fixed-actions a:hover {
    transition: none !important;
}

.fixed-actions a,
.fixed-actions a:hover {
    transform: none;
}

.apeex-sidebar .side-menu > li > a i,
nav.side-navbar.apeex-sidebar li a i {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

[dir="rtl"] .apeex-footer-content {
    flex-direction: row-reverse;
}

[dir="rtl"] .dropdown-menu-right {
    right: auto;
    left: 0;
}

body.dark-mode .apeex-footer-brand,
body.dark-mode .apeex-system-name {
    color: #e5e7eb;
}

@media (min-width: 1200px) {
    body:not(.pos-page) footer.main-footer.apeex-footer {
        inset-inline-start: var(--apeex-sidebar-width) !important;
        inset-inline-end: 0 !important;
    }

    body:not(.pos-page).apeex-collapsed footer.main-footer.apeex-footer,
    body:not(.pos-page) .page.apeex-content.active footer.main-footer.apeex-footer {
        inset-inline-start: var(--apeex-sidebar-collapsed-width) !important;
    }
}
