@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap");

:root {
    --bs-font: "Cairo", "Inter", sans-serif;
}

body,
.form-control,
.btn,
.nav-text,
.dashboard_bar,
table,
h1, h2, h3, h4, h5, h6,
p, label, .alert, .badge,
.metismenu, input, select, textarea {
    font-family: "Cairo", "Inter", sans-serif !important;
}

html[dir="rtl"],
html[dir="rtl"] body,
html[dir="rtl"] #main-wrapper {
    direction: rtl !important;
    text-align: right;
}

html[dir="rtl"] .nav-header {
    left: auto !important;
    right: 0;
    text-align: right;
    border-right: 0;
    border-left: 1px solid var(--border);
}
html[dir="rtl"] .ic-sidenav {
    left: auto !important;
    right: 0;
    border-right: 0;
    border-left: 1px solid var(--border);
}
html[dir="rtl"] .content-body {
    margin-left: 0;
    margin-right: var(--dz-sidebar-width);
}
html[dir="rtl"] .header {
    padding-left: 0;
    padding-right: var(--dz-sidebar-width);
}
html[dir="rtl"] .footer {
    margin-left: 0;
    margin-right: var(--dz-sidebar-width);
}
html[dir="rtl"] .nav-control {
    right: auto;
    left: -4rem;
}
html[dir="rtl"] .header .header-content {
    padding-left: 1.875rem;
    padding-right: 5rem;
}
html[dir="rtl"] .menu-toggle .nav-header .nav-control {
    right: auto !important;
    left: -4rem;
}
html[dir="rtl"] .menu-toggle .header .header-content {
    padding-left: 1.875rem !important;
    padding-right: 5rem !important;
}
html[dir="rtl"] .ic-sidenav .metismenu > li > a {
    text-align: right;
    justify-content: flex-start;
}
html[dir="rtl"] .ic-sidenav .metismenu > li > a i {
    margin-left: 12px;
    margin-right: 0;
}
@media only screen and (max-width: 47.9375rem) {
    html[dir="rtl"] .content-body,
    html[dir="rtl"] .footer {
        margin-right: 0;
    }
    html[dir="rtl"] .header {
        padding-right: 5rem;
        padding-left: 0;
    }
    html[dir="rtl"] .header .header-content {
        padding-right: 3.75rem;
        padding-left: 0.938rem;
    }
    html[dir="rtl"] .nav-control {
        left: -3rem;
    }
    html[dir="rtl"] .ic-sidenav {
        right: calc(var(--dz-sidebar-width) * -1);
        left: auto !important;
    }
    html[dir="rtl"] .menu-toggle .ic-sidenav {
        right: 0;
    }
}

html[dir="rtl"] .form-label,
html[dir="rtl"] label,
html[dir="rtl"] .card-header,
html[dir="rtl"] .card-title,
html[dir="rtl"] .dropdown-item,
html[dir="rtl"] .page-head,
html[dir="rtl"] .alert,
html[dir="rtl"] .form-control,
html[dir="rtl"] .form-select,
html[dir="rtl"] select,
html[dir="rtl"] textarea {
    text-align: right;
}
html[dir="rtl"] .table thead th,
html[dir="rtl"] .table td {
    text-align: right;
    unicode-bidi: normal;
}
html[dir="rtl"] input[type="number"],
html[dir="rtl"] input[type="month"],
html[dir="rtl"] input[type="date"] {
    direction: ltr;
    text-align: right;
    unicode-bidi: isolate;
}
html[dir="rtl"] .form-check {
    padding-left: 0;
    padding-right: 1.5em;
    text-align: right;
}
html[dir="rtl"] .form-check-input {
    float: right;
    margin-right: -1.5em;
    margin-left: 0;
}
html[dir="rtl"] .alert-dismissible {
    padding-right: 1rem;
    padding-left: 3rem;
}
html[dir="rtl"] .alert-dismissible .btn-close {
    left: 0;
    right: auto;
}
html[dir="rtl"] .nav-header .brand-logo {
    justify-content: flex-start;
}
html[dir="rtl"] .eye {
    right: auto;
    left: 20px;
}
html[dir="rtl"] .header-profile > a.nav-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin: 0;
    direction: rtl;
}
html[dir="rtl"] .header-profile > a.nav-link .header-info {
    text-align: right !important;
    padding: 0 !important;
    margin: 0 !important;
    direction: rtl;
    unicode-bidi: normal;
}
html[dir="rtl"] .dropdown-menu {
    text-align: right;
}
html[dir="rtl"] .auth-form,
html[dir="rtl"] .auth-form label,
html[dir="rtl"] .auth-form .form-control {
    text-align: right;
}
html[dir="rtl"] .site-wrap,
html[dir="rtl"] .site-hero,
html[dir="rtl"] .site-nav {
    text-align: right;
    direction: rtl;
}
.table-search {
    max-width: 280px;
    margin: 0 0 16px;
}
.table-search .form-control {
    text-align: right;
}
.page-head .row {
    align-items: center;
}
.ic-chart-card.stat-card {
    min-height: auto;
    padding: 0;
    box-shadow: 0 10px 28px rgba(13, 27, 42, 0.06);
}
.ic-chart-card .data-value {
    display: block;
    margin-top: 8px;
    font-size: 22px;
    font-weight: 800;
}

.nav-header .brand-title {
    max-width: none !important;
    margin-left: 12px;
    margin-right: 0;
}
.brand-title .brand-text {
    color: var(--text-dark, #1c2430);
    font-weight: 800;
    font-size: 22px;
    line-height: 1;
    white-space: nowrap;
}
[data-theme-version="dark"] .brand-title .brand-text {
    color: #fff;
}

html[dir="rtl"] .nav-header .brand-title {
    margin-left: 0;
    margin-right: 12px;
}
html[dir="rtl"] .ic-sidenav .metismenu > li > a {
    text-align: right;
}

.page-head {
    margin-bottom: 8px;
}
.page-head h3,
.dashboard_bar {
    font-weight: 800;
}

.stat-card {
    background: #fff;
    border-radius: 18px;
    padding: 20px 22px 18px;
    box-shadow: 0 10px 28px rgba(13, 27, 42, 0.06);
    height: 100%;
    min-height: 148px;
}
.stat-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.stat-icon.stat-primary { background: rgba(0, 116, 255, 0.12); color: #0074ff; }
.stat-icon.stat-success { background: rgba(16, 162, 86, 0.12); color: #10a256; }
.stat-icon.stat-warning { background: rgba(255, 171, 45, 0.16); color: #d48900; }
.stat-icon.stat-danger { background: rgba(208, 65, 46, 0.12); color: #d0412e; }
.stat-icon.stat-info { background: rgba(0, 160, 186, 0.12); color: #008ea6; }
.stat-label {
    font-weight: 700;
    color: #667085;
    font-size: 14px;
    line-height: 1.3;
}
.stat-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.25;
    color: #0d1b2a;
}
.stat-card:has(.stat-danger) .stat-value {
    color: #d0412e;
}
.stat-value bdi {
    unicode-bidi: isolate;
}
.stat-meta {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #667085;
}
[data-theme-version="dark"] .stat-card {
    background: #1e2736;
    box-shadow: none;
}
[data-theme-version="dark"] .stat-value {
    color: #fff;
}
[data-theme-version="dark"] .stat-label,
[data-theme-version="dark"] .stat-meta {
    color: #9aa4b2;
}

.low-stock {
    color: #d0412e;
    font-weight: 700;
}

.checkout-items {
    overflow: visible;
}
.checkout-head,
.checkout-line {
    display: grid;
    grid-template-columns: minmax(220px, 1.6fr) 110px 130px 140px 140px 70px;
    gap: 10px;
    align-items: center;
}
.checkout-head {
    font-weight: 700;
    color: #667085;
    padding: 0 0 10px;
    border-bottom: 1px solid #eef1f5;
    margin-bottom: 10px;
}
.checkout-line {
    padding: 8px 0;
    border-bottom: 1px solid #f3f5f8;
}
.checkout-line .qty-input {
    min-width: 0;
}
.product-picker {
    position: relative;
    min-width: 0;
}
.product-results {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    z-index: 80;
    background: #fff;
    border: 1px solid #e6eaf0;
    border-radius: 12px;
    max-height: 260px;
    overflow: auto;
    box-shadow: 0 12px 32px rgba(13, 27, 42, 0.12);
}
.product-results[hidden] {
    display: none !important;
}
.product-result {
    display: block;
    width: 100%;
    border: 0;
    background: #fff;
    text-align: right;
    padding: 10px 12px;
    border-bottom: 1px solid #f3f5f8;
    cursor: pointer;
    unicode-bidi: isolate;
}
.product-result:last-child {
    border-bottom: 0;
}
.product-result:hover,
.product-result.is-active {
    background: rgba(0, 116, 255, 0.08);
}
.product-result .name {
    display: block;
    font-weight: 700;
}
.product-result .meta {
    display: block;
    color: #667085;
    font-size: 12px;
    font-weight: 600;
    unicode-bidi: isolate;
}
.product-result.is-empty .name {
    color: #d0412e;
}
.stock-cell {
    white-space: nowrap;
    font-weight: 800;
}
.stock-badge {
    font-weight: 800;
    white-space: nowrap;
}
.stock-badge.is-low,
.stock-badge.is-empty {
    color: #d0412e;
}
.stock-badge small {
    display: inline;
    font-weight: 600;
    color: #667085;
    margin-right: 4px;
}
@media (max-width: 991px) {
    .checkout-head {
        display: none;
    }
    .checkout-line {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
    .checkout-line .product-picker {
        grid-column: 1 / -1;
    }
}
.checkout-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #eef1f5;
}
[data-theme-version="dark"] .product-results,
[data-theme-version="dark"] .product-result {
    background: #1e2736;
    border-color: #2b3648;
}
[data-theme-version="dark"] .product-result .meta,
[data-theme-version="dark"] .stock-badge small {
    color: #9aa4b2;
}

.card {
    border-radius: 16px;
}
.card-title {
    font-weight: 800;
}

.table thead th {
    font-weight: 700;
    white-space: nowrap;
}
.table td .btn {
    margin: 0 2px 4px;
}

.btn {
    font-weight: 700;
    border-radius: 10px;
}

.form-control,
.form-select,
select.form-control {
    border-radius: 10px;
    min-height: 44px;
}

.ic-sidenav .metismenu > li > a {
    border-radius: 12px;
    margin: 0 12px 6px;
    font-weight: 700;
}
.ic-sidenav .metismenu > li.mm-active > a,
.ic-sidenav .metismenu > li > a.mm-active {
    background: rgba(0, 116, 255, 0.1);
    color: #0074ff;
}

.alert {
    border-radius: 12px;
    font-weight: 600;
}

/* Login */
.authincation {
    font-family: "Cairo", sans-serif;
}
.login-aside h2,
.login-aside h3 {
    font-weight: 800;
}
.auth-form h4 {
    font-weight: 800;
}

/* Public site */
.site-wrap {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 0%, rgba(0, 116, 255, 0.12), transparent 40%),
        linear-gradient(180deg, #f6f8fc 0%, #ffffff 50%);
    font-family: "Cairo", sans-serif;
}
.site-nav {
    background: #0b1220;
    padding: 18px 0;
}
.site-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}
.site-hero {
    padding: 90px 0 70px;
}
.site-hero h1 {
    font-size: 44px;
    font-weight: 800;
    color: #0d1b2a;
    line-height: 1.35;
}
.site-card {
    border: 0;
    border-radius: 20px;
    box-shadow: 0 16px 50px rgba(13, 27, 42, 0.08);
}

@media print {
    #preloader,
    .nav-header,
    .header,
    .ic-sidenav,
    .footer,
    .no-print,
    .alert,
    .page-titles {
        display: none !important;
    }
    #main-wrapper,
    .content-body,
    .container-fluid {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    .card {
        box-shadow: none !important;
        border: 0 !important;
    }
}
