html,
body {
    font-family: 'Cairo', sans-serif;
    background-color: #f4f6f9;
    color: #1f2937;
}

body {
    min-height: 100vh;
}

#sidebar {
    width: 260px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .14);
    background-color: #0b1121 !important;
}

body[dir="rtl"] #sidebar {
    right: 0;
    left: auto;
}

body[dir="ltr"] #sidebar {
    left: 0;
    right: auto;
}

.ms-md-260 {
    margin-left: 260px;
}

.me-md-260 {
    margin-right: 260px;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: #111827;
}

.app-card {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: .75rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.app-card-header {
    padding: 1rem 1rem 0;
}

.app-card-body {
    padding: 1rem;
}

.stat-card {
    min-height: 120px;
    border: 0;
    border-radius: .75rem;
    overflow: hidden;
    box-shadow: 0 12px 24px rgba(15, 23, 42, .08);
}

.stat-card .card-title {
    font-size: .9rem;
    opacity: .86;
}

.stat-card .card-text {
    font-weight: 800;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: .82rem;
    font-weight: 800;
    white-space: nowrap;
}

.table tbody td {
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: #f8fbff;
}

.action-group {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: center;
}

.btn {
    min-height: 40px;
    border-radius: .55rem;
    font-weight: 700;
}

.btn-sm {
    min-height: 34px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
}

.form-control,
.form-select {
    border-radius: .6rem;
    min-height: 42px;
}

.form-control:focus,
.form-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .12);
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, .18), transparent 30%),
        linear-gradient(135deg, #eef5ff 0%, #f8fafc 48%, #eaf7f1 100%);
}

.login-card {
    width: 90%;
    max-width: 400px;
    background: rgba(255, 255, 255, .95);
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 1rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .16);
    padding: 1.25rem;
}

.login-logo {
    width: 76px;
    height: 76px;
    object-fit: contain;
    border-radius: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: .35rem;
}

.login-brand-fallback {
    width: 76px;
    height: 76px;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0d6efd;
    color: #fff;
    font-weight: 900;
    font-size: 1.35rem;
}

.input-icon-group {
    position: relative;
}

.input-icon-group .form-control {
    padding-inline-start: 2.65rem;
}

.input-icon-group .field-icon {
    position: absolute;
    inset-inline-start: .9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    z-index: 2;
}

.quotation-summary {
    max-width: 460px;
    margin-inline-start: auto;
}

.mobile-card-list {
    display: none;
}

.toast {
    opacity: .96;
}

@media (max-width: 767.98px) {
    .ms-md-260,
    .me-md-260 {
        margin: 0;
    }

    #sidebar {
        width: min(86vw, 280px);
    }

    .container-fluid {
        padding-inline: .9rem;
    }

    .page-title {
        font-size: 1.15rem;
    }

    .app-card-body {
        padding: .85rem;
    }

    .quotation-summary {
        max-width: 100%;
    }
}

@media (max-width: 575.98px) {
    .table-stack-sm thead {
        display: none;
    }

    .table-stack-sm tbody tr {
        display: block;
        margin-bottom: .85rem;
        padding: .75rem;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: .75rem;
        box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
    }

    .table-stack-sm tbody td {
        display: flex;
        gap: .75rem;
        justify-content: space-between;
        align-items: center;
        border: 0;
        padding: .45rem 0;
        text-align: end;
    }

    .table-stack-sm tbody td::before {
        content: attr(data-label);
        font-weight: 800;
        color: #64748b;
        text-align: start;
    }

    .action-group {
        justify-content: flex-start;
    }
}

@media (min-width: 768px) {
    .login-card {
        padding: 1.75rem;
    }
}

/* تحسين pagination للغة العربية */
.pagination {
    flex-wrap: wrap;
    gap: 0.25rem;
}
.pagination .page-link {
    min-width: 40px;
    text-align: center;
    border-radius: 0.375rem;
    margin: 0 2px;
}
.pagination .active .page-link {
    background-color: #1E3A8A;
    border-color: #1E3A8A;
}
.page-item.disabled .page-link {
    color: #9ca3af;
}
@media (max-width: 576px) {
    .pagination .page-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
        min-width: 34px;
    }
}