:root {
    --brand-primary: #1a459b;
    --brand-primary-dark: #12306d;
    --brand-primary-soft: rgba(26, 69, 155, 0.12);
    --brand-primary-softer: rgba(26, 69, 155, 0.08);
    --brand-accent: #4aa7f0;
    --brand-text: #16213a;
    --brand-surface: #f6f8fb;
    --brand-sidebar: #d9e3f2;
    --brand-sidebar-hover: #c7d7ee;
    --brand-border: #cdd9ea;
}

::selection {
    background: var(--brand-primary);
    color: #fff;
}

a,
.text-primary,
.footer a,
.footer-contact i,
.user-menu-link:hover,
.notifications-footer a,
.management-topbar__section,
.management-breadcrumbs a,
.management-tag--success,
.sidebar-nav .sidebar-item.active > .sidebar-link,
.sidebar-nav .sidebar-item.active > .sidebar-link i,
.sidebar-nav .sidebar-item.active > .sidebar-link .feather,
.sidebar-nav .sidebar-item .sidebar-link:hover,
.user-n {
    color: var(--brand-primary) !important;
}

.btn-primary,
.bg-primary,
.badge.bg-primary,
.page-item.active .page-link,
.select2-container--default .select2-selection--multiple .select2-selection__choice,
.user-dropdown-header,
thead .bg-main,
.mobile-sidebar-header,
.management-topbar__toggle,
.management-sidebar__logo-mark,
.management-sidebar .nav-link.active,
.management-tag--primary {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.page-link:hover,
.footer a:hover,
.management-topbar__toggle:hover {
    background-color: var(--brand-primary-dark) !important;
    border-color: var(--brand-primary-dark) !important;
    color: #fff !important;
}

.btn-outline-primary,
.btn-outline-info {
    border-color: var(--brand-primary) !important;
    color: var(--brand-primary) !important;
}

.btn-outline-primary:hover,
.btn-outline-info:hover {
    background: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: #fff !important;
}

.form-control:focus,
.form-select:focus,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default .select2-selection--single:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(26, 69, 155, 0.16) !important;
}

.select2-container--default .select2-selection--single {
    background-color: #fff !important;
    border: 1px solid #cfdae9 !important;
    border-radius: 7px !important;
    color: #172033;
    min-height: 38px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #172033;
    line-height: 36px;
    padding-inline: 12px 28px;
}

[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-inline: 28px 12px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
    inset-inline-end: 6px;
}

[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__arrow {
    inset-inline: 6px auto;
}

.select2-dropdown {
    border-color: #cfdae9 !important;
    border-radius: 8px !important;
    box-shadow: 0 12px 26px rgba(18, 48, 109, 0.14);
    overflow: hidden;
    z-index: 1060;
}

.select2-search--dropdown {
    padding: 8px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #cfdae9 !important;
    border-radius: 6px;
    min-height: 34px;
    outline: none;
    padding: 6px 10px;
}

.select2-container--default .select2-results__option {
    color: #26344d;
    font-size: 13px;
    padding: 8px 12px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--brand-primary) !important;
    color: #fff !important;
}

.select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: var(--brand-primary-softer);
    color: var(--brand-primary);
}

.erp-paginator {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    padding-block: 12px;
}

.erp-paginator__summary {
    align-items: center;
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(18, 48, 109, 0.035);
    color: #64748b;
    display: inline-flex;
    font-size: 12px;
    font-weight: 600;
    gap: 6px;
    min-height: 34px;
    padding: 5px 12px;
}

.erp-paginator__current {
    align-items: center;
    background: var(--brand-primary);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    height: 22px;
    justify-content: center;
    min-width: 24px;
    padding-inline: 7px;
}

.erp-paginator__total {
    color: #26344d;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.erp-paginator__controls {
    align-items: center;
    display: inline-flex;
    gap: 5px;
}

.erp-paginator__btn {
    align-items: center;
    background: #fff;
    border: 1px solid #d8e1ee;
    border-radius: 7px;
    box-shadow: 0 4px 10px rgba(18, 48, 109, 0.035);
    color: #52677f !important;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    min-width: 34px;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.erp-paginator__btn svg,
.erp-paginator__btn .feather {
    height: 16px;
    stroke: currentColor !important;
    width: 16px;
}

html[dir="ltr"] .erp-paginator__btn svg,
html[dir="ltr"] .erp-paginator__btn .feather {
    transform: scaleX(-1);
}

.erp-paginator__btn:hover,
.erp-paginator__btn:focus {
    background: #eef4ff;
    border-color: #cfdcf0;
    color: var(--brand-primary) !important;
    transform: translateY(-1px);
}

.erp-paginator__btn.is-disabled {
    background: #f6f9fd;
    border-color: #e3eaf4;
    box-shadow: none;
    color: #a9b6c7 !important;
    cursor: not-allowed;
    opacity: 0.78;
    transform: none;
}

.erp-purchase-payment-modal {
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    box-shadow: 0 24px 56px rgba(18, 48, 109, 0.18);
    overflow: hidden;
}

.erp-purchase-payment-modal .modal-header,
.erp-purchase-payment-modal .modal-footer {
    background: #fbfdff;
    border-color: #dbe4f0;
}

.erp-purchase-payment-modal .modal-title {
    color: #172033;
    font-size: 16px;
    font-weight: 650;
}

.erp-purchase-payment-modal .modal-body {
    background: #fff;
    padding: 20px;
}

.erp-balance-allocation-option {
    background: #f6f9fd;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    padding: 12px 14px;
}

.erp-payment-allocation-box {
    background: #fbfdff;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    max-height: 280px;
    overflow: auto;
    padding: 12px;
}

.erp-payment-allocation-box .table-responsive {
    box-shadow: none;
}

.erp-payment-allocation-box .form-check-input {
    cursor: pointer;
}

@media (max-width: 576px) {
    .erp-paginator {
        justify-content: center;
    }

    .erp-paginator__summary {
        order: -1;
        width: 100%;
        justify-content: center;
    }
}

.sidebar-nav .sidebar-item .sidebar-link:hover,
.sidebar-nav .sidebar-item.active > .sidebar-link,
.management-sidebar .nav-link.active,
.management-sidebar .nav-link:hover {
    background-color: var(--brand-primary-soft) !important;
}

.notification-badge,
.notify .point,
.notify .heartbit,
.management-tag--success {
    background-color: var(--brand-primary) !important;
}

.login-card .logo {
    max-width: 340px;
}

.navbar-brand .brand-logo {
    display: block;
    width: 142px;
    max-width: 160px;
    height: auto;
    object-fit: contain;
}

.navbar-brand .brand-icon {
    display: block;
    width: 36px;
    height: 36px;
    margin-inline-end: 8px;
    object-fit: contain;
}

.topbar .navbar-brand {
    min-width: 160px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-card .btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark)) !important;
    box-shadow: 0 6px 16px rgba(26, 69, 155, 0.28) !important;
}

.login-card input:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(26, 69, 155, 0.14) !important;
}

.company-name-display span[style],
.notification-bell-container svg[style],
.notification-bell-container i[style] {
    color: var(--brand-primary) !important;
    stroke: var(--brand-primary) !important;
}

/* Navigation polish */
.topbar {
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
    border-bottom: 1px solid var(--brand-border);
    box-shadow: 0 4px 18px rgba(18, 48, 109, 0.08);
}

.topbar::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
    z-index: 1;
}

.topbar .top-navbar,
.topbar .navbar-collapse,
.topbar .top-navbar .navbar-header {
    background: transparent !important;
}

.topbar .top-navbar .navbar-nav > .nav-item > .nav-link,
.topbar .nav-toggler,
.topbar .topbartoggler,
.topbar .lang-pill,
.topbar .lang-icon {
    color: var(--brand-primary) !important;
}

.topbar .top-navbar .navbar-nav > .nav-item > .nav-link:hover,
.topbar .nav-toggler:hover,
.topbar .topbartoggler:hover {
    background: rgba(26, 69, 155, 0.1) !important;
    color: var(--brand-primary-dark) !important;
}

.company-name-display {
    min-height: 70px;
    display: flex;
    align-items: center;
}

.company-name-display span {
    font-size: 14px;
    letter-spacing: 0;
}

.profile-pic {
    border: 2px solid #e5ebf5;
    background: #f4f7fb;
}

.left-sidebar,
.left-sidebar .scroll-sidebar,
.left-sidebar .sidebar-nav {
    background: var(--brand-sidebar) !important;
}

.left-sidebar {
    border-inline-end: 1px solid #c4d1e4;
    box-shadow: 6px 0 18px rgba(18, 48, 109, 0.06);
}

.sidebar-nav #sidebarnav {
    padding: 12px 8px !important;
}

.sidebar-nav .user-profile {
    margin: 0 8px 10px !important;
    padding: 10px 8px !important;
    border-bottom: 1px solid #bfcee4 !important;
}

.sidebar-nav .user-profile .user-n {
    color: var(--brand-primary) !important;
    font-size: 22px;
    font-weight: 700;
}

.sidebar-nav ul .sidebar-item .sidebar-link,
#main-wrapper .left-sidebar .sidebar-nav .sidebar-item .sidebar-link {
    min-height: 44px;
    margin: 3px 8px !important;
    padding: 11px 12px !important;
    border-radius: 8px !important;
    color: #314765 !important;
    font-weight: 500;
}

.sidebar-nav ul .sidebar-item .sidebar-link .hide-menu,
#main-wrapper .left-sidebar .sidebar-nav .sidebar-item .sidebar-link .hide-menu {
    color: inherit !important;
}

.sidebar-nav ul .sidebar-item .sidebar-link i,
.sidebar-nav ul .sidebar-item .sidebar-link .feather,
#main-wrapper .left-sidebar .sidebar-nav .sidebar-item .sidebar-link [data-feather] {
    color: #486386 !important;
    stroke: #486386 !important;
}

.sidebar-nav ul .sidebar-item .sidebar-link:hover,
.sidebar-nav .sidebar-item .sidebar-link:hover {
    background: var(--brand-sidebar-hover) !important;
    color: var(--brand-primary-dark) !important;
}

.sidebar-nav ul .sidebar-item .sidebar-link:hover i,
.sidebar-nav ul .sidebar-item .sidebar-link:hover .feather,
.sidebar-nav ul .sidebar-item .sidebar-link:hover [data-feather] {
    color: var(--brand-primary) !important;
    stroke: var(--brand-primary) !important;
}

.sidebar-nav ul .sidebar-item .sidebar-link.active,
.sidebar-nav ul .sidebar-item.selected > .sidebar-link,
.sidebar-nav .sidebar-item.active > .sidebar-link {
    background: linear-gradient(90deg, #ffffff 0%, #eef5ff 100%) !important;
    color: var(--brand-primary) !important;
    box-shadow: inset 3px 0 0 var(--brand-primary), 0 5px 12px rgba(26, 69, 155, 0.12);
    font-weight: 700 !important;
}

html[dir="rtl"] .sidebar-nav ul .sidebar-item .sidebar-link.active,
html[dir="rtl"] .sidebar-nav ul .sidebar-item.selected > .sidebar-link,
html[dir="rtl"] .sidebar-nav .sidebar-item.active > .sidebar-link {
    background: linear-gradient(270deg, #ffffff 0%, #eef5ff 100%) !important;
    box-shadow: inset -3px 0 0 var(--brand-primary), 0 5px 12px rgba(26, 69, 155, 0.12);
}

.sidebar-nav ul .sidebar-item .sidebar-link.active i,
.sidebar-nav ul .sidebar-item .sidebar-link.active .feather,
.sidebar-nav ul .sidebar-item.selected > .sidebar-link i,
.sidebar-nav ul .sidebar-item.selected > .sidebar-link .feather,
.sidebar-nav .sidebar-item.active > .sidebar-link i,
.sidebar-nav .sidebar-item.active > .sidebar-link .feather {
    color: var(--brand-primary) !important;
    stroke: var(--brand-primary) !important;
}

.sidebar-nav .has-arrow::after {
    border-color: #405a7d !important;
}

.sidebar-nav .sidebar-footer,
.left-sidebar .sidebar-footer {
    background: var(--brand-sidebar) !important;
    border-top: 1px solid #bfcee4 !important;
}

.logout-btn {
    background: #fff !important;
    border: 1px solid #d8e1ee;
    box-shadow: none !important;
}

.widget-content.d-print-none > .d-none.d-lg-flex,
.global-quick-actions {
    gap: 8px;
    align-items: center;
    padding: 0 !important;
    margin: 0 0 14px !important;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.widget-content.d-print-none .btn {
    min-height: 34px;
    border-radius: 6px;
    border-color: #c8d4e5 !important;
    color: #24405f !important;
    background: #fff !important;
    font-weight: 400;
    box-shadow: 0 1px 2px rgba(18, 48, 109, 0.06);
}

.widget-content.d-print-none .btn.btn-primary {
    border-color: var(--brand-primary) !important;
    background: var(--brand-primary) !important;
    color: #fff !important;
}

.global-quick-actions .btn {
    min-height: 34px;
    border-radius: 6px;
    font-weight: 400;
    padding-inline: 12px;
}

.global-quick-actions .btn-outline-secondary {
    background: #fff !important;
    border-color: #cfd9e8 !important;
    color: #314765 !important;
}

.global-quick-actions .btn-outline-secondary:hover,
.global-quick-actions .btn-outline-secondary:focus {
    background: #eef4ff !important;
    border-color: #b9c8dc !important;
    color: var(--brand-primary) !important;
}

.global-quick-actions .dropdown-menu {
    min-width: 260px;
}

.global-quick-actions .global-reports-menu {
    min-width: 300px;
}

.global-quick-actions .dropdown-item {
    align-items: center;
    display: flex;
    gap: 8px;
}

.global-quick-actions .dropdown-item .feather,
.global-quick-actions .dropdown-item svg,
.global-quick-actions .dropdown-item i {
    color: #64748b !important;
    height: 15px;
    stroke: #64748b !important;
    width: 15px;
}

.global-quick-actions .dropdown-item:hover .feather,
.global-quick-actions .dropdown-item:hover svg,
.global-quick-actions .dropdown-item:hover i {
    color: var(--brand-primary) !important;
    stroke: var(--brand-primary) !important;
}

.widget-content.d-print-none .btn .feather-icon,
.widget-content.d-print-none .btn svg,
.widget-content.d-print-none .btn i,
.widget-content.d-print-none .btn .first-icon,
.widget-content.d-print-none .btn .fo-icon {
    color: currentColor !important;
    stroke: currentColor !important;
}

.widget-content.d-print-none .btn:hover,
.widget-content.d-print-none .btn:focus {
    background: var(--brand-primary) !important;
    color: #fff !important;
    box-shadow: 0 6px 14px rgba(26, 69, 155, 0.2);
}

.widget-content.d-print-none .btn:hover .feather-icon,
.widget-content.d-print-none .btn:focus .feather-icon {
    color: #fff !important;
    stroke: #fff !important;
}

body,
.page-wrapper {
    background: var(--brand-surface) !important;
}

.container-fluid {
    background: var(--brand-surface);
}

.card {
    border: 1px solid #d8e1ee !important;
    box-shadow: 0 8px 20px rgba(18, 48, 109, 0.07) !important;
}

.card-header.bg-light,
.card-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #d8e1ee !important;
    color: var(--brand-text);
}

.card-header .card-title,
.card-header h5,
.card-header h6 {
    color: #25415f !important;
}

.card-header .feather,
.card-header [data-feather] {
    color: var(--brand-primary) !important;
    stroke: var(--brand-primary) !important;
}

.bg-main,
thead .bg-main,
.table thead .bg-main {
    background: #edf1f6 !important;
    color: #243b5a !important;
}

html,
body {
    color: #1f2a3d;
    line-height: 1.55;
}

.page-wrapper .container-fluid {
    padding-top: 22px;
}

.page-titles {
    background: #fff;
    border: 1px solid #d8e1ee;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(18, 48, 109, 0.06);
    padding: 18px 20px;
}

.page-titles h1,
.page-titles h2,
.page-titles h3,
.page-titles h4 {
    color: #14213d !important;
    font-size: 22px;
    font-weight: 600 !important;
    letter-spacing: 0;
    line-height: 1.25;
}

.page-titles .page-subtitle,
.erp-page-subtitle {
    color: #64748b;
    font-size: 13px;
    margin-top: 4px;
}

.page-titles .btn,
.erp-page-actions .btn {
    min-height: 34px;
}

.page-titles .breadcrumb,
.page-titles .breadcrumb a {
    color: #72839a !important;
    font-size: 12px;
}

.page-titles .breadcrumb-item.active a,
.page-titles .breadcrumb-item.active {
    color: var(--brand-primary) !important;
    font-weight: 600;
}

.card {
    border-radius: 8px !important;
}

.card-body {
    color: #26344d;
}

.card-title,
.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 {
    letter-spacing: 0;
}

.btn {
    border-radius: 6px;
    font-weight: 500;
    letter-spacing: 0;
}

.btn-primary,
.bg-primary,
.btn-main {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: #fff !important;
}

.btn-primary svg,
.btn-primary i,
.btn-primary .feather,
.btn-primary [data-feather],
.btn-primary .feather-sm,
.btn-primary .feather-icon,
.btn-main svg,
.btn-main i,
.btn-main .feather,
.btn-main [data-feather] {
    color: #fff !important;
    fill: none !important;
    stroke: #fff !important;
}

.btn-primary .text-primary,
.btn-primary .text-info,
.btn-primary .text-success,
.btn-primary .text-muted {
    color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-main:hover,
.btn-main:focus {
    background-color: var(--brand-primary-dark) !important;
    border-color: var(--brand-primary-dark) !important;
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(26, 69, 155, 0.18);
}

.btn-secondary {
    background: #eef2f7 !important;
    border-color: #d8e1ee !important;
    color: #344155 !important;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
    color: #1f2a3d !important;
}

.btn-info {
    background: #eaf2ff !important;
    border-color: #c8d9f5 !important;
    color: var(--brand-primary) !important;
}

.btn-info:hover,
.btn-info:focus {
    background: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: #fff !important;
}

.btn-secondary svg,
.btn-secondary i,
.btn-secondary .feather,
.btn-secondary [data-feather],
.btn-info svg,
.btn-info i,
.btn-info .feather,
.btn-info [data-feather],
.btn-outline-primary svg,
.btn-outline-primary i,
.btn-outline-primary .feather,
.btn-outline-primary [data-feather] {
    color: currentColor !important;
    fill: none !important;
    stroke: currentColor !important;
}

.btn-outline-primary,
.btn-outline-info,
.btn-outline-secondary {
    background: #fff !important;
    border-color: #c8d4e5 !important;
    color: #314765 !important;
}

.btn-outline-primary:hover,
.btn-outline-info:hover,
.btn-outline-secondary:hover,
.btn-outline-primary:focus,
.btn-outline-info:focus,
.btn-outline-secondary:focus {
    background: #eef4ff !important;
    border-color: var(--brand-primary) !important;
    color: var(--brand-primary) !important;
}

.btn-outline-success {
    background: #fff !important;
    border-color: #b8ddc4 !important;
    color: #166534 !important;
}

.btn-outline-success:hover,
.btn-success {
    background: #16803f !important;
    border-color: #16803f !important;
    color: #fff !important;
}

.btn-outline-warning {
    background: #fff !important;
    border-color: #f4c77c !important;
    color: #9a5b00 !important;
}

.btn-outline-warning:hover,
.btn-warning {
    background: #d97706 !important;
    border-color: #d97706 !important;
    color: #fff !important;
}

.btn-outline-danger {
    background: #fff !important;
    border-color: #f0b7b7 !important;
    color: #b42318 !important;
}

.btn-outline-danger:hover,
.btn-danger {
    background: #c53030 !important;
    border-color: #c53030 !important;
    color: #fff !important;
}

.table {
    color: #243044;
    margin-bottom: 0;
}

.table-responsive {
    border-radius: 8px;
}

.table > :not(caption) > * > * {
    padding: 0.82rem 0.95rem;
    border-bottom-color: #e4ebf5;
    vertical-align: middle;
}

.table thead tr,
.table thead .bg-main,
.table thead tr.bg-main,
.table .bg-main.text-white {
    background: #edf1f6 !important;
    color: #243b5a !important;
}

.table thead th,
.table thead .text-white,
.table thead tr.bg-main th {
    color: #243b5a !important;
    border-bottom: 1px solid #cbd8ea !important;
    font-size: 12px;
    font-weight: 700 !important;
    white-space: nowrap;
}

.table tbody tr:nth-child(even) {
    background-color: #fbfdff;
}

.table-hover tbody tr:hover,
.table tbody tr:hover {
    background-color: rgba(26, 69, 155, 0.055) !important;
}

.table a {
    color: var(--brand-primary);
    font-weight: 600;
}

.table .erp-money,
.table td.text-end,
.table td .erp-money {
    color: #26344d;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.table .erp-id,
.table td:first-child a,
.table td a.text-primary {
    color: var(--brand-primary) !important;
    font-weight: 700;
}

.table td .btn.btn-sm,
.table td a.btn.btn-sm,
.table td button.btn.btn-sm {
    align-items: center;
    background: #f3f6fb !important;
    border-color: transparent !important;
    color: #52657f !important;
    display: inline-flex;
    height: 30px;
    justify-content: center;
    min-width: 30px;
    padding: 0 8px;
    box-shadow: none !important;
}

.table td .btn.btn-sm.btn-primary,
.table td a.btn.btn-sm.btn-primary,
.table td button.btn.btn-sm.btn-primary {
    background: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: #fff !important;
}

.table td .btn.btn-sm.btn-secondary,
.table td a.btn.btn-sm.btn-secondary,
.table td button.btn.btn-sm.btn-secondary {
    background: #eef2f7 !important;
    border-color: #d8e1ee !important;
    color: #344155 !important;
}

.table td .btn.btn-sm.btn-info,
.table td a.btn.btn-sm.btn-info,
.table td button.btn.btn-sm.btn-info {
    background: #eaf2ff !important;
    border-color: #c8d9f5 !important;
    color: var(--brand-primary) !important;
}

.table td .btn.btn-sm.btn-danger,
.table td a.btn.btn-sm.btn-danger,
.table td button.btn.btn-sm.btn-danger {
    background: #c53030 !important;
    border-color: #c53030 !important;
    color: #fff !important;
}

.table td .btn.btn-sm svg,
.table td .btn.btn-sm i,
.table td .btn.btn-sm .feather,
.table td .btn.btn-sm [data-feather] {
    color: currentColor !important;
    fill: none !important;
    stroke: currentColor !important;
}

.table td .btn.btn-sm:hover,
.table td a.btn.btn-sm:hover,
.table td button.btn.btn-sm:hover {
    background: var(--brand-primary) !important;
    color: #fff !important;
}

.table td .btn.btn-sm.btn-outline-danger:hover,
.table td button.btn.btn-sm.btn-outline-danger:hover {
    background: #c53030 !important;
    color: #fff !important;
}

.badge {
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    padding: 0.35rem 0.6rem;
}

.bg-success-subtle.text-success,
.badge.bg-success {
    background: #e8f7ee !important;
    color: #166534 !important;
}

.bg-warning-subtle.text-warning,
.badge.bg-warning {
    background: #fff4df !important;
    color: #9a5b00 !important;
}

.bg-danger-subtle.text-danger,
.badge.bg-danger {
    background: #fdecec !important;
    color: #b42318 !important;
}

.bg-info-subtle.text-info,
.badge.bg-info {
    background: #eaf2ff !important;
    color: var(--brand-primary) !important;
}

label,
.form-label {
    color: #64748b !important;
    font-size: 12px;
    font-weight: 600 !important;
    margin-bottom: 6px;
}

.form-control,
.form-select,
.input-group-text {
    border-color: #d5deeb;
    border-radius: 6px;
    color: #1f2a3d;
    min-height: 38px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.18rem rgba(26, 69, 155, 0.12);
}

.nav-tabs-bordered .nav-link,
.nav-tabs .nav-link {
    color: #64748b;
    font-weight: 600;
}

.nav-tabs-bordered .nav-link.active,
.nav-tabs .nav-link.active {
    color: var(--brand-primary);
    border-color: #d8e1ee #d8e1ee #fff;
}

.alert-success-light,
.alert-danger-light {
    border: 1px solid #dbe5f3;
    color: #243044;
}

.alert-success-light {
    background: #f0f8f3;
}

.alert-danger-light {
    background: #fff2f0;
}

.dropdown-menu {
    border: 1px solid #d8e1ee;
    border-radius: 8px;
    box-shadow: 0 14px 30px rgba(18, 48, 109, 0.12);
}

.dropdown-item {
    color: #314765;
    padding: 0.55rem 1rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: #eef4ff;
    color: var(--brand-primary);
}

.erp-empty-state,
.loading-spinner {
    color: #64748b;
}

.erp-empty-state {
    align-items: center;
    background: #fbfdff;
    border: 1px dashed #cfd9e8;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    min-height: 180px;
    padding: 28px;
    text-align: center;
}

.erp-empty-state i,
.erp-empty-state .feather,
.loading-spinner i,
.loading-spinner .feather {
    color: #8aa0bb !important;
    stroke: #8aa0bb !important;
}

.erp-form-section,
.erp-workflow-form .card,
.erp-detail-section {
    background: #fff;
    border: 1px solid #d8e1ee !important;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(18, 48, 109, 0.05) !important;
}

.erp-form-section-title,
.erp-workflow-form .card-header h5,
.erp-detail-section .card-header h5 {
    color: #172033 !important;
    font-size: 15px;
    font-weight: 650 !important;
}

.erp-line-items .card-header,
.erp-workflow-form .card-header.bg-main {
    background: #edf1f6 !important;
    color: #243b5a !important;
}

.erp-line-items .card-header [class*="col-"],
.erp-workflow-form .card-header.bg-main [class*="col-"] {
    color: #243b5a !important;
    font-size: 12px;
    font-weight: 700 !important;
}

.erp-balance-summary,
#entry_totals {
    background: #fbfdff !important;
    border: 1px solid #d8e1ee;
    border-radius: 8px !important;
}

.erp-sticky-actions {
    background: rgba(255, 255, 255, 0.94);
    border-top: 1px solid #d8e1ee;
    bottom: 0;
    box-shadow: 0 -8px 20px rgba(18, 48, 109, 0.08);
    margin-inline: -1.5rem;
    padding: 12px 1.5rem;
    position: sticky;
    z-index: 20;
}

.sidebar-nav .first-level {
    margin: 2px 8px 8px !important;
}

.sidebar-nav .first-level .sidebar-link {
    color: #5f728e !important;
    font-size: 13px;
    font-weight: 500 !important;
    min-height: 36px;
    opacity: 0.82;
    padding-inline-start: 34px !important;
}

html[dir="rtl"] .sidebar-nav .first-level .sidebar-link {
    padding-inline-start: 12px !important;
    padding-inline-end: 34px !important;
}

.sidebar-nav .sidebar-item:not(.selected):not(.active) .first-level .sidebar-link {
    opacity: 0.62;
}

.voucher-detail-page .card-body > .row.g-3 > [class*="col-"].border-bottom {
    background: #fbfdff;
    border: 1px solid #e2eaf5 !important;
    border-radius: 8px;
}

.voucher-detail-page .card-body > .row.g-3 > [class*="col-"].border-bottom > .p-3 {
    padding: 14px !important;
}

.voucher-detail-page .fw-bold.text-primary {
    color: #64748b !important;
    font-size: 12px;
    font-weight: 700 !important;
}

.voucher-detail-page .card-body > .row.g-3 > [class*="col-"].border-bottom span:last-child {
    color: #172033;
    font-weight: 600;
    text-align: end;
}

/* Latest hierarchy pass */
.page-titles {
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid #d8e1ee !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin-bottom: 18px !important;
    padding: 4px 2px 16px !important;
    position: relative;
}

.page-titles::before {
    background: var(--brand-primary);
    border-radius: 999px;
    bottom: -1px;
    content: "";
    height: 3px;
    inset-inline-start: 2px;
    position: absolute;
    width: 58px;
}

.page-titles h1,
.page-titles h2,
.page-titles h3,
.page-titles h4 {
    font-size: 24px;
    font-weight: 650 !important;
}

.page-titles .page-subtitle,
.erp-page-subtitle {
    display: none;
}

.company-name-display {
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

.company-name-display .topbar-company-name {
    color: var(--brand-primary) !important;
    font-size: 13px;
    font-weight: 700;
}

.company-name-display .topbar-branch-name {
    color: #6b7d94;
    font-size: 11px;
    margin-top: 3px;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-brand a {
    align-items: center;
    display: flex !important;
    flex-direction: column;
    gap: 5px;
    justify-content: center;
    text-decoration: none;
}

.sidebar-brand-icon {
    height: 32px;
    object-fit: contain;
    width: 32px;
}

.sidebar-nav .sidebar-brand .user-n {
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
}

.erp-form-shell {
    margin-inline: auto;
    max-width: none;
    width: 100%;
}

.erp-workflow-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.erp-workflow-form > .card,
.erp-workflow-form .erp-form-group {
    border-color: #dbe4f0 !important;
    box-shadow: 0 8px 18px rgba(18, 48, 109, 0.045) !important;
    margin-bottom: 0 !important;
}

.erp-workflow-form .card-header {
    background: #fbfdff !important;
    padding: 12px 16px !important;
}

.erp-workflow-form .card-body {
    padding: 18px !important;
}

.erp-workflow-form .form-label {
    color: #5c6f89;
    font-size: 12px;
    font-weight: 650 !important;
    margin-bottom: 6px;
}

.erp-workflow-form .form-control,
.erp-workflow-form .form-select,
.erp-workflow-form .select2-container .select2-selection {
    background-color: #fff;
    border-color: #cfd9e8;
    min-height: 38px;
}

.erp-workflow-form .input-group-text {
    background: #f5f8fc;
    border-color: #cfd9e8;
    color: #61738c;
}

.erp-workflow-form .row.g-3 {
    align-items: start;
}

.erp-workflow-form .form-control::placeholder {
    color: #9aa8ba;
}

.erp-workflow-form .card-header h6,
.erp-workflow-form .erp-form-section-title {
    align-items: center;
    color: #172033 !important;
    display: flex;
    gap: 6px;
    line-height: 1.3;
}

.erp-workflow-form .card-header h6::before,
.erp-workflow-form .erp-form-section-title::before {
    background: var(--brand-primary);
    border-radius: 999px;
    content: "";
    display: inline-block;
    height: 14px;
    width: 3px;
}

.erp-workflow-form .alert {
    border-radius: 8px;
}

.erp-line-items {
    overflow: hidden;
}

.erp-line-items .entry-row {
    background: #fff;
    border: 1px solid #edf1f6;
    border-radius: 8px;
    margin-inline: 0;
    padding: 10px 4px;
}

.erp-line-items .entry-row:hover {
    background: #fbfdff;
    border-color: #dbe4f0;
}

.erp-line-items .select2-container {
    width: 100% !important;
}

.erp-line-items .erp-product-picker {
    align-items: stretch;
    display: flex;
    gap: 8px;
    min-width: 330px;
}

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

.erp-line-items .erp-table tbody tr {
    background: #fff;
}

.erp-line-items .erp-table tbody tr:hover {
    background: #fbfdff !important;
}

.erp-line-items .erp-table td {
    padding: 10px 8px;
}

.erp-line-items .erp-table .form-control,
.erp-line-items .erp-table .form-select {
    min-height: 36px;
}

.erp-line-items .erp-table .select2-container--default .select2-selection--single {
    min-height: 36px;
}

.erp-line-items .erp-table .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 34px;
}

.erp-line-items .erp-table .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 34px;
}

.erp-line-items .erp-line-discount {
    flex-wrap: nowrap;
    min-width: 170px;
}

.erp-line-items .erp-line-discount .form-control {
    flex: 1 1 auto;
    min-width: 86px;
}

.erp-line-items .erp-line-discount .select2-container,
.erp-line-items .erp-line-discount .discount-type-select {
    flex: 0 0 70px;
    min-width: 70px;
    width: 70px !important;
}

.erp-line-items .erp-line-discount .select2-selection--single {
    border-bottom-left-radius: 0 !important;
    border-top-left-radius: 0 !important;
}

[dir="rtl"] .erp-line-items .erp-line-discount .select2-selection--single {
    border-bottom-left-radius: 7px !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 7px !important;
    border-top-right-radius: 0 !important;
}

.erp-line-items .erp-line-discount .select2-selection__rendered {
    padding-inline: 10px 22px !important;
    text-align: center;
}

.erp-line-items .erp-table tbody td {
    border-color: #e2eaf5 !important;
}

.erp-line-items .btn-light-danger {
    align-items: center;
    background: #fff5f5 !important;
    border: 1px solid #ffd6d6 !important;
    color: #c92a2a !important;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    min-width: 34px;
    padding: 0 8px !important;
}

.erp-line-items .btn-light-danger:hover {
    background: #ffe8e8 !important;
    color: #a61e1e !important;
}

.erp-balance-summary span[id^="total"],
#balance-diff {
    font-variant-numeric: tabular-nums;
}

.erp-sticky-actions .btn {
    min-width: 112px;
}

.erp-invoice-summary .bg-light-primary,
.erp-invoice-summary .bg-light-warning,
.erp-invoice-summary .bg-light-info,
.erp-invoice-summary .bg-light-success {
    background: #fff !important;
    border: 1px solid #dbe4f0 !important;
    box-shadow: 0 6px 14px rgba(18, 48, 109, 0.045);
    color: #26344d !important;
}

.erp-invoice-summary .text-primary,
.erp-invoice-summary .text-warning,
.erp-invoice-summary .text-info,
.erp-invoice-summary .text-success {
    color: #26344d !important;
    font-weight: 600 !important;
}

.erp-invoice-summary span[id$="_value"],
.erp-invoice-summary #products_value,
.erp-invoice-summary #discount_value,
.erp-invoice-summary #tax_value,
.erp-invoice-summary #total_value {
    color: #172033;
    font-variant-numeric: tabular-nums;
    font-weight: 600 !important;
}

#sales-invoice-products-table,
#purchase-invoice-products-table,
#edit-purchase-invoice-products-table {
    min-width: 980px;
}

#sales-invoice-products-table th,
#sales-invoice-products-table td,
#purchase-invoice-products-table th,
#purchase-invoice-products-table td,
#edit-purchase-invoice-products-table th,
#edit-purchase-invoice-products-table td {
    text-align: start !important;
    vertical-align: middle;
}

#sales-invoice-products-table .erp-money,
#purchase-invoice-products-table .erp-money,
#edit-purchase-invoice-products-table .erp-money {
    color: #26344d !important;
    font-weight: 500 !important;
    text-align: end !important;
    white-space: nowrap;
}

#sales-invoice-products-table td:last-child,
#purchase-invoice-products-table td:last-child,
#edit-purchase-invoice-products-table td:last-child {
    text-align: end !important;
    width: 72px;
}

.erp-kpi-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
    border: 1px solid #dbe4f0 !important;
    box-shadow: 0 6px 16px rgba(18, 48, 109, 0.055) !important;
}

.erp-kpi-context {
    color: #7b8798;
    font-size: 11px;
    margin-top: 4px;
}

.chart-container {
    min-height: 320px;
    position: relative;
}

.loading-spinner {
    min-height: 220px;
}

.loading-spinner .btn {
    margin-top: 6px;
}

.table-responsive {
    border-radius: 8px;
}

.table thead th,
.table thead td {
    background: #edf1f6 !important;
    border-bottom: 1px solid #d8e1ee !important;
    color: #243b5a !important;
    font-size: 12px;
    font-weight: 700 !important;
    position: sticky;
    top: 0;
    z-index: 2;
}

.table tbody tr {
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

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

.table tbody td,
.table tbody th {
    border-color: #e6edf6 !important;
    vertical-align: middle;
}

.table a[href*="/"]:not(.btn),
.table .erp-clickable-id {
    color: var(--brand-primary) !important;
    font-weight: 500;
    text-decoration: none;
}

.table .erp-money,
.table td.text-end,
.table th.text-end {
    color: #26344d;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    text-align: end !important;
}

.table tbody td:last-child .btn {
    box-shadow: none !important;
}

.table tbody td:last-child .btn:not(.btn-primary):not(.btn-danger):not(.btn-success) {
    opacity: 0.78;
}

.table tbody tr:hover td:last-child .btn {
    opacity: 1;
}

.footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    color: #7b8798 !important;
    font-size: 12px;
}

.footer .container {
    max-width: 100%;
}

.footer-contact {
    opacity: 0.68;
}

.footer-contact + .footer-contact {
    margin-inline-start: 16px;
}

/* 80/20 UI system helpers */
.erp-dashboard-grid {
    margin-bottom: 22px;
}

.erp-stat-card,
.row.g-3.mb-4 > [class*="col-"] > .card.h-100 {
    background: linear-gradient(180deg, #fff 0%, #f9fbfe 100%) !important;
    border: 1px solid #dbe4f0 !important;
    box-shadow: 0 8px 18px rgba(18, 48, 109, 0.055) !important;
    min-height: 132px;
}

.erp-stat-card .card-body,
.row.g-3.mb-4 > [class*="col-"] > .card.h-100 .card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px !important;
}

.erp-stat-card h2,
.erp-stat-card h3,
.row.g-3.mb-4 > [class*="col-"] > .card.h-100 h2,
.row.g-3.mb-4 > [class*="col-"] > .card.h-100 h3 {
    color: #172033 !important;
    font-size: clamp(20px, 1.9vw, 28px);
    font-weight: 650 !important;
    line-height: 1.2;
}

.erp-stat-card h6,
.row.g-3.mb-4 > [class*="col-"] > .card.h-100 h6 {
    color: #7b8798 !important;
    font-size: 12px;
    font-weight: 650;
}

.erp-stat-card .rounded-circle,
.row.g-3.mb-4 > [class*="col-"] > .card.h-100 .rounded-circle {
    background: #eef4ff !important;
    color: var(--brand-primary) !important;
}

.erp-panel,
.widget-content.searchable-container > .card,
.card.erp-list-card {
    border-color: #dbe4f0 !important;
    box-shadow: 0 8px 18px rgba(18, 48, 109, 0.055) !important;
}

.erp-panel .card-header,
.widget-content.searchable-container > .card > .card-header {
    background: #fbfdff !important;
}

.erp-toolbar .btn,
.widget-content.searchable-container .card-header .btn {
    min-height: 34px;
    padding-inline: 12px;
}

.erp-filter-panel,
.accordion-collapse.card-body {
    background: #fff !important;
    border-top: 1px solid #e2eaf5;
}

.erp-filter-panel .form-label,
.accordion-collapse.card-body .form-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 650 !important;
}

.erp-table,
.table.table-hover {
    margin-bottom: 0;
}

.erp-table tbody tr,
.table.table-hover tbody tr {
    background: #fff;
}

.erp-table tbody tr:nth-child(even),
.table.table-hover tbody tr:nth-child(even) {
    background: #fbfdff;
}

.erp-table tbody td,
.table.table-hover tbody td {
    color: #253449;
    padding: 12px 14px;
}

.erp-table thead th,
.table.table-hover thead th {
    padding: 11px 14px;
}

.erp-table .erp-muted-id,
.table .erp-muted-id {
    color: #9aa8ba;
    font-size: 11px;
    margin-inline-end: 6px;
}

.erp-row-actions,
.table .btn-group {
    align-items: center;
    gap: 4px;
}

.erp-row-actions .btn,
.table .btn-group .btn {
    align-items: center;
    display: inline-flex;
    height: 30px;
    justify-content: center;
    min-width: 30px;
    padding: 0 8px;
}

.erp-row-actions .btn-outline-info,
.table .btn-group .btn-outline-info {
    background: #fff !important;
    border-color: #d8e1ee !important;
    color: #52677f !important;
}

.erp-row-actions .btn-outline-info:hover,
.table .btn-group .btn-outline-info:hover {
    background: #eef4ff !important;
    color: var(--brand-primary) !important;
}

.erp-empty-row {
    color: #7b8798;
    padding: 44px 16px !important;
    text-align: center;
}

.erp-money-muted {
    color: #52677f;
    font-variant-numeric: tabular-nums;
}

#vendor-table th,
#vendor-table td {
    text-align: start !important;
}

#vendor-table .erp-money {
    color: #26344d !important;
    font-weight: 500 !important;
    text-align: end !important;
}

#vendor-table td:last-child {
    text-align: end !important;
    width: 86px;
}

#vendor-table .erp-row-actions {
    justify-content: flex-end;
}

/* Detail and form pages: production-safe polish via opt-in classes only */
.erp-detail-page .card,
.erp-detail-card {
    border: 1px solid #dbe4f0 !important;
    box-shadow: 0 8px 18px rgba(18, 48, 109, 0.055) !important;
}

.erp-detail-card > .card-header,
.erp-detail-page .card > .card-header {
    background: #fbfdff !important;
}

.erp-detail-actions {
    background: #fff;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(18, 48, 109, 0.05);
    padding: 10px;
}

.erp-detail-actions .btn {
    min-height: 34px;
}

.erp-detail-grid > [class*="col-"].border-bottom,
.erp-detail-grid .list-group-item {
    background: #fbfdff;
    border: 1px solid #e2eaf5 !important;
    border-radius: 8px;
}

.erp-detail-grid > [class*="col-"].border-bottom > .p-3 {
    padding: 14px !important;
}

.erp-detail-grid .fw-bold.text-primary,
.erp-detail-grid .list-group-item > span:first-child,
.erp-detail-page .list-group-item > span:first-child,
.erp-detail-page .list-group-item .fw-bold {
    color: #64748b !important;
    font-size: 12px;
    font-weight: 700 !important;
}

.erp-detail-grid .d-flex > span:last-child,
.erp-detail-grid .d-flex > a:last-child,
.erp-detail-page .list-group-item > span:last-child,
.erp-detail-page .list-group-item > a:last-child {
    color: #172033;
    font-weight: 600;
    text-align: end;
}

.erp-detail-page .list-group,
.erp-detail-grid .list-group {
    display: grid;
    gap: 8px;
}

.erp-detail-page .list-group-item {
    border-color: #e2eaf5;
    color: #26344d;
}

.erp-total-summary {
    background: #fbfdff;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    margin-top: 16px;
    padding: 14px 18px;
}

.erp-total-summary p {
    border-color: #e2eaf5 !important;
    color: #64748b;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin-bottom: 8px;
    min-width: 280px;
}

.erp-total-summary .invoice-info {
    color: #172033;
    font-weight: 700;
}

.erp-meta-card {
    border-color: #e2eaf5 !important;
    box-shadow: 0 4px 12px rgba(18, 48, 109, 0.04) !important;
}

.erp-kpi-grid .card-body {
    background: #fff !important;
}

.erp-kpi-grid h4 {
    color: #172033 !important;
    font-size: 18px;
    font-weight: 700;
}

.erp-kpi-grid p {
    color: #64748b !important;
    font-weight: 600;
}

.erp-quick-links .btn {
    background: #fff !important;
    border-color: #d8e1ee !important;
    color: #314765 !important;
    justify-content: center;
}

.erp-quick-links .btn:hover,
.erp-quick-links .btn:focus {
    background: #eef4ff !important;
    color: var(--brand-primary) !important;
}

.erp-chart-card .chart-container {
    min-height: 340px;
}

.erp-detail-page .erp-table td,
.erp-detail-page .erp-table th {
    vertical-align: middle;
}

.erp-detail-page .erp-money {
    color: #26344d;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    text-align: end;
    white-space: nowrap;
}

#issued-invoice-table th,
#issued-invoice-table td,
#draft-invoice-table th,
#draft-invoice-table td {
    text-align: start !important;
}

#issued-invoice-table .erp-money,
#draft-invoice-table .erp-money {
    color: #26344d !important;
    font-weight: 500 !important;
    text-align: end !important;
}

#issued-invoice-table td:last-child,
#draft-invoice-table td:last-child {
    text-align: end !important;
    width: 132px;
}

#issued-invoice-table .erp-row-actions,
#draft-invoice-table .erp-row-actions {
    justify-content: flex-end;
}

#invoice-table th,
#invoice-table td,
#purchase-draft-table th,
#purchase-draft-table td,
#customer-table th,
#customer-table td,
#product-table th,
#product-table td,
#journal-table th,
#journal-table td,
#cheque-table th,
#cheque-table td,
#credit_notes_table th,
#credit_notes_table td,
#sales-return-table th,
#sales-return-table td,
#purchase-return-table th,
#purchase-return-table td,
#purchase-debit-note-table th,
#purchase-debit-note-table td,
#sales-debit-note-table th,
#sales-debit-note-table td,
#sub-account-table th,
#sub-account-table td,
#sub-cost-center-table th,
#sub-cost-center-table td,
#cost-center-transaction-table th,
#cost-center-transaction-table td {
    text-align: start !important;
}

#invoice-table .erp-money,
#purchase-draft-table .erp-money,
#customer-table .erp-money,
#product-table .erp-money,
#journal-table .erp-money,
#cheque-table .erp-money,
#credit_notes_table .erp-money,
#sales-return-table .erp-money,
#purchase-return-table .erp-money,
#purchase-debit-note-table .erp-money,
#sales-debit-note-table .erp-money,
#sub-account-table .erp-money,
#sub-cost-center-table .erp-money,
#cost-center-transaction-table .erp-money {
    color: #26344d !important;
    font-weight: 500 !important;
}

#invoice-table td:last-child,
#purchase-draft-table td:last-child,
#customer-table td:last-child,
#product-table td:last-child,
#journal-table td:last-child,
#cheque-table td:last-child,
#credit_notes_table td:last-child,
#sales-return-table td:last-child,
#purchase-return-table td:last-child,
#purchase-debit-note-table td:last-child,
#sales-debit-note-table td:last-child,
#sub-account-table td:last-child,
#sub-cost-center-table td:last-child {
    text-align: end !important;
    width: 112px;
}

#invoice-table .erp-row-actions,
#purchase-draft-table .erp-row-actions,
#customer-table .erp-row-actions,
#product-table .erp-row-actions,
#journal-table .erp-row-actions,
#cheque-table .erp-row-actions,
#credit_notes_table .erp-row-actions,
#sales-return-table .erp-row-actions,
#purchase-return-table .erp-row-actions,
#purchase-debit-note-table .erp-row-actions,
#sales-debit-note-table .erp-row-actions,
#sub-account-table .erp-row-actions,
#sub-cost-center-table .erp-row-actions {
    justify-content: flex-end;
}

.erp-detail-page .erp-row-actions {
    opacity: 0.62;
    transition: opacity 0.15s ease;
}

.erp-detail-page tr:hover .erp-row-actions {
    opacity: 1;
}

@media (max-width: 768px) {
    .erp-detail-actions {
        justify-content: stretch !important;
    }

    .erp-detail-actions .btn,
    .erp-detail-actions .dropdown {
        flex: 1 1 160px;
    }

    .erp-total-summary p {
        min-width: 0;
    }
}

/* Production-safe polish pass: forms, actions, states */
.erp-form-shell {
    margin-inline: auto;
    max-width: 1320px;
}

form.erp-form-shell {
    display: block;
}

.erp-workflow-form {
    color: #253449;
}

.erp-workflow-form > .row,
.erp-form-section .card-body > .erp-workflow-form > .row {
    row-gap: 18px;
}

.erp-form-group {
    background: #fff !important;
    border: 1px solid #dbe4f0 !important;
    border-radius: 8px !important;
    box-shadow: 0 5px 14px rgba(18, 48, 109, 0.045) !important;
}

.erp-form-group > .card-header,
.erp-form-section > .card-header {
    background: #fbfdff !important;
    border-bottom: 1px solid #e2eaf5 !important;
}

.erp-form-group .card-title,
.erp-form-section .card-title,
.erp-form-section-title {
    color: #26344d !important;
    font-size: 14px;
    font-weight: 650 !important;
    letter-spacing: 0;
}

.erp-workflow-form .form-label {
    color: #52677f !important;
    font-size: 12px !important;
    font-weight: 650 !important;
    margin-bottom: 6px;
}

.erp-workflow-form .text-danger {
    color: #dc3545 !important;
}

.erp-workflow-form .form-control,
.erp-workflow-form .form-select,
.erp-workflow-form .select2-container--default .select2-selection--single,
.erp-workflow-form .select2-container--default .select2-selection--multiple {
    border-color: #cfdae9 !important;
    border-radius: 7px !important;
    color: #172033;
    min-height: 38px;
}

.erp-workflow-form .form-control:disabled,
.erp-workflow-form .form-control[readonly],
.erp-workflow-form .form-select:disabled {
    background-color: #f6f9fd !important;
    color: #64748b;
}

.erp-workflow-form .invalid-feedback,
.erp-workflow-form .text-danger.small {
    font-size: 11px;
    font-weight: 600;
}

.erp-workflow-form .col-12 > textarea.form-control,
.erp-workflow-form textarea.form-control {
    resize: vertical;
}

.erp-workflow-form .form-control-sm,
.erp-workflow-form .form-select-sm {
    min-height: 36px;
}

.erp-workflow-form textarea.form-control {
    min-height: 72px;
}

.erp-workflow-form .input-group-text {
    background: #f5f8fc !important;
    border-color: #cfdae9 !important;
    color: #64748b !important;
}

.erp-workflow-form .input-group-text svg,
.erp-workflow-form .input-group-text .feather {
    stroke: #64748b !important;
}

.erp-workflow-form .alert-light-info,
.erp-workflow-form .alert-info {
    background: #f5f8fc !important;
    border: 1px solid #dbe4f0 !important;
    color: #52677f !important;
}

.erp-workflow-form .form-check {
    align-items: center;
    display: inline-flex;
    gap: 7px;
    min-height: 30px;
}

.erp-workflow-form .form-check-input {
    border-color: #aebdd1;
    margin: 0;
}

.erp-workflow-form .form-check-input:checked {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.erp-sticky-actions {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    bottom: 12px;
    box-shadow: 0 10px 24px rgba(18, 48, 109, 0.11);
    margin-top: 18px;
    padding: 12px;
    position: sticky;
    z-index: 5;
}

.erp-sticky-actions .btn {
    min-height: 38px;
}

.erp-card-subtitle {
    color: #7b8798;
    font-size: 11px;
    line-height: 1.4;
    margin-top: 2px;
}

.erp-kpi-context-warning {
    color: #b45309 !important;
}

.erp-stat-card .erp-kpi-context,
.erp-kpi-card .erp-kpi-context {
    font-size: 11px;
    font-weight: 600;
}

.erp-empty-state {
    align-items: center;
    color: #7b8798;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 220px;
    padding: 28px 16px;
    text-align: center;
}

.erp-empty-state svg,
.erp-empty-state .feather {
    color: #9aa8ba !important;
    height: 34px;
    margin-bottom: 10px;
    stroke: #9aa8ba !important;
    width: 34px;
}

.erp-empty-state-title {
    color: #26344d;
    font-size: 15px;
    font-weight: 650;
    margin-bottom: 4px;
}

.erp-empty-state-text {
    color: #7b8798;
    font-size: 12px;
    margin-bottom: 0;
}

.erp-row-actions .btn:not(.btn-danger):not(.btn-primary),
.table .btn-group .btn:not(.btn-danger):not(.btn-primary),
.erp-table td:last-child .btn:not(.btn-danger):not(.btn-primary) {
    background: #f6f9fd !important;
    border-color: #e1e8f2 !important;
    color: #61748c !important;
}

.erp-row-actions .btn:not(.btn-danger):not(.btn-primary):hover,
.table .btn-group .btn:not(.btn-danger):not(.btn-primary):hover,
.erp-table td:last-child .btn:not(.btn-danger):not(.btn-primary):hover {
    background: #eef4ff !important;
    border-color: #cfdcf0 !important;
    color: var(--brand-primary) !important;
}

.erp-row-actions .btn svg,
.table .btn-group .btn svg,
.erp-table td:last-child .btn svg,
.erp-table td:last-child .btn i {
    stroke: currentColor !important;
}

.erp-table td:last-child .btn {
    border-radius: 6px;
    box-shadow: none !important;
}

.erp-table td:last-child .btn + .btn,
.erp-table td:last-child .btn + .dropdown,
.erp-table td:last-child .dropdown + .btn {
    margin-inline-start: 4px;
}

.table-responsive {
    background: #fff;
    border: 1px solid #dbe4f0;
    box-shadow: 0 5px 14px rgba(18, 48, 109, 0.035);
}

.erp-table thead th,
.table.table-hover thead th {
    box-shadow: inset 0 -1px 0 #d3deeb;
}

.erp-table tbody tr:hover,
.table.table-hover tbody tr:hover {
    background: #f3f7fd !important;
}

.erp-table tbody tr.table-active,
.table.table-hover tbody tr.table-active {
    background: #edf4ff !important;
    box-shadow: inset 3px 0 0 var(--brand-primary);
}

html[dir="rtl"] .erp-table tbody tr.table-active,
html[dir="rtl"] .table.table-hover tbody tr.table-active {
    box-shadow: inset -3px 0 0 var(--brand-primary);
}

.erp-pos-dashboard {
    display: block;
}

.erp-pos-dashboard .erp-pos-kpi,
.erp-pos-dashboard .erp-pos-panel {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
    border: 1px solid #dbe4f0 !important;
    box-shadow: 0 8px 18px rgba(18, 48, 109, 0.055) !important;
}

.erp-pos-dashboard .erp-pos-kpi .card-body {
    padding: 22px 24px !important;
}

.erp-pos-dashboard .erp-pos-kpi h6 {
    color: #7b8798 !important;
    font-size: 12px;
    font-weight: 650 !important;
}

.erp-pos-dashboard .erp-pos-kpi h2 {
    color: #172033 !important;
    font-size: clamp(22px, 2vw, 30px);
    font-weight: 650 !important;
    line-height: 1.15;
}

.erp-pos-dashboard .erp-pos-kpi small {
    color: #26344d;
    font-weight: 600;
}

.erp-pos-dashboard .erp-pos-kpi .round {
    background: #eef4ff;
    color: var(--brand-primary);
    height: 44px;
    width: 44px;
}

.erp-pos-dashboard .erp-pos-kpi--count .round {
    background: #e9f8ef;
    color: #15803d;
}

.erp-pos-dashboard .erp-pos-kpi--average .round {
    background: #fff4e5;
    color: #c2410c;
}

.erp-pos-dashboard .erp-pos-kpi .round svg,
.erp-pos-dashboard .erp-pos-kpi .round .feather {
    stroke: currentColor !important;
}

.erp-pos-dashboard .erp-pos-panel .card-header {
    background: #fbfdff !important;
    border-bottom-color: #dbe4f0 !important;
    min-height: 48px;
}

.erp-pos-dashboard .erp-pos-panel .card-title {
    color: #26344d;
    font-size: 15px;
    font-weight: 650 !important;
}

.erp-pos-dashboard .chart-container {
    height: 300px;
    min-height: 300px;
    width: 100%;
}

.erp-pos-dashboard .erp-pos-pie {
    height: 300px;
    min-height: 300px;
}

.erp-pos-dashboard .table-responsive {
    border: 0;
    box-shadow: none;
}

.erp-pos-dashboard .erp-table thead th {
    background: #eef3f9 !important;
    color: #172033 !important;
}

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

.erp-pos-dashboard .erp-empty-row {
    background: #fff !important;
    color: #7b8798;
}

.erp-pos-dashboard .erp-empty-row svg,
.erp-pos-dashboard .erp-empty-row .feather {
    display: block;
    margin-inline: auto;
}

.erp-chart-empty {
    align-items: center;
    color: #7b8798;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    min-height: 220px;
    text-align: center;
}

.erp-chart-empty-title {
    color: #26344d;
    font-size: 14px;
    font-weight: 650;
    margin-bottom: 4px;
}

.erp-chart-empty-text {
    color: #7b8798;
    font-size: 12px;
}

.erp-sales-report-page .erp-report-panel,
.erp-sales-report-page .erp-sales-kpi {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
    border: 1px solid #dbe4f0 !important;
    box-shadow: 0 8px 18px rgba(18, 48, 109, 0.055) !important;
}

.erp-sales-report-page .erp-report-panel > .card-header {
    background: #fbfdff !important;
    border-bottom-color: #dbe4f0 !important;
}

.erp-sales-report-page .erp-report-action-grid .btn {
    align-items: center;
    background: #fff !important;
    border-color: #d8e1ee !important;
    color: #314765 !important;
    display: flex;
    font-weight: 400;
    justify-content: center;
    min-height: 38px;
}

.erp-sales-report-page .erp-report-action-grid .btn:hover,
.erp-sales-report-page .erp-report-action-grid .btn:focus {
    background: #eef4ff !important;
    border-color: #cfdcf0 !important;
    color: var(--brand-primary) !important;
}

.erp-sales-report-page .erp-report-filter .card-body {
    padding: 18px !important;
}

.erp-sales-report-page .erp-sales-kpi .card-body {
    padding: 22px 24px !important;
}

.erp-sales-report-page .erp-sales-kpi h6 {
    color: #7b8798;
    font-size: 12px;
    font-weight: 650;
}

.erp-sales-report-page .erp-sales-kpi h4 {
    color: #172033;
    font-size: clamp(18px, 1.55vw, 24px);
    font-weight: 650;
    line-height: 1.25;
}

.erp-sales-report-page .erp-kpi-icon {
    align-items: center;
    background: #eef4ff;
    border-radius: 999px;
    color: var(--brand-primary);
    display: inline-flex;
    flex: 0 0 42px;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.erp-sales-report-page .erp-sales-kpi--success .erp-kpi-icon {
    background: #e9f8ef;
    color: #15803d;
}

.erp-sales-report-page .erp-sales-kpi--warning .erp-kpi-icon {
    background: #fff4e5;
    color: #c2410c;
}

.erp-sales-report-page .erp-kpi-icon svg,
.erp-sales-report-page .erp-kpi-icon .feather {
    stroke: currentColor !important;
}

.erp-sales-report-page .erp-report-stats-strip {
    background: #f6f9fd;
    border-bottom: 1px solid #dbe4f0;
}

.erp-sales-report-page .erp-report-stats-strip .col-lg-4 + .col-lg-4 {
    border-inline-start: 1px solid #dbe4f0;
}

.erp-sales-report-page .erp-report-stats-strip h6 {
    color: #7b8798;
    font-size: 12px;
    font-weight: 650;
}

.erp-sales-report-page .erp-report-stats-strip h4 {
    color: #172033;
    font-size: 16px;
    font-weight: 650;
}

.erp-sales-report-page .erp-report-chart {
    height: 330px;
    min-height: 330px;
}

.erp-sales-report-page .erp-report-donut {
    height: 260px;
    min-height: 260px;
}

.erp-sales-report-page .erp-report-compact-table td {
    padding-block: 8px;
}

.erp-sales-report-page .table-responsive {
    border-color: #dbe4f0;
}

.erp-purchase-report-page .erp-report-panel,
.erp-purchase-report-page .erp-purchase-kpi {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
    border: 1px solid #dbe4f0 !important;
    box-shadow: 0 8px 18px rgba(18, 48, 109, 0.055) !important;
}

.erp-purchase-report-page .erp-report-panel > .card-header {
    background: #fbfdff !important;
    border-bottom-color: #dbe4f0 !important;
}

.erp-purchase-report-page .erp-report-action-grid .btn {
    align-items: center;
    background: #fff !important;
    border-color: #d8e1ee !important;
    color: #314765 !important;
    display: flex;
    font-weight: 400;
    justify-content: center;
    min-height: 38px;
}

.erp-purchase-report-page .erp-report-action-grid .btn:hover,
.erp-purchase-report-page .erp-report-action-grid .btn:focus {
    background: #eef4ff !important;
    border-color: #cfdcf0 !important;
    color: var(--brand-primary) !important;
}

.erp-purchase-report-page .erp-report-filter .card-body {
    padding: 18px !important;
}

.erp-purchase-report-page .erp-purchase-kpi .card-body {
    padding: 22px 24px !important;
}

.erp-purchase-report-page .erp-purchase-kpi h6 {
    color: #7b8798 !important;
    font-size: 12px;
    font-weight: 650;
}

.erp-purchase-report-page .erp-purchase-kpi h4 {
    color: #172033 !important;
    font-size: clamp(18px, 1.55vw, 24px);
    font-weight: 650;
    line-height: 1.25;
}

.erp-purchase-report-page .erp-kpi-icon {
    align-items: center;
    background: #eef4ff;
    border-radius: 999px;
    color: var(--brand-primary);
    display: inline-flex;
    flex: 0 0 42px;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.erp-purchase-report-page .erp-purchase-kpi--success .erp-kpi-icon {
    background: #e9f8ef;
    color: #15803d;
}

.erp-purchase-report-page .erp-purchase-kpi--info .erp-kpi-icon {
    background: #eef4ff;
    color: #2f6fc7;
}

.erp-purchase-report-page .erp-kpi-icon svg,
.erp-purchase-report-page .erp-kpi-icon .feather {
    height: 18px;
    opacity: 1;
    stroke: currentColor !important;
    width: 18px;
}

.erp-purchase-report-page .erp-report-stats-strip {
    background: #f6f9fd;
    border-bottom: 1px solid #dbe4f0;
}

.erp-purchase-report-page .erp-report-stats-strip .col-lg-6 + .col-lg-6 {
    border-inline-start: 1px solid #dbe4f0;
}

.erp-purchase-report-page .erp-report-stats-strip h6 {
    color: #7b8798;
    font-size: 12px;
    font-weight: 650;
}

.erp-purchase-report-page .erp-report-stats-strip h4 {
    color: #172033;
    font-size: 16px;
    font-weight: 650;
}

.erp-purchase-report-page .erp-report-chart {
    height: 330px;
    min-height: 330px;
}

.erp-purchase-report-page .erp-report-donut {
    height: 320px;
    min-height: 320px;
    width: 100%;
}

.erp-purchase-report-page #branch-separation .apexcharts-canvas {
    margin-inline: auto;
}

.erp-purchase-report-page #branch-separation .apexcharts-datalabel-value {
    dominant-baseline: central;
    white-space: nowrap;
}

.erp-purchase-report-page .erp-report-compact-table td {
    padding-block: 8px;
}

.erp-purchase-report-page .table-responsive {
    border-color: #dbe4f0;
}

#results-printable #stats-container .card {
    background: #fff !important;
    border: 1px solid #dbe4f0 !important;
    box-shadow: 0 7px 16px rgba(18, 48, 109, 0.052) !important;
    overflow: hidden;
}

#results-printable #stats-container .card-body {
    background: linear-gradient(180deg, #fff 0%, #fbfdff 100%) !important;
    border-radius: 0 !important;
    min-height: 106px;
    padding: 20px 18px !important;
    position: relative;
}

#results-printable #stats-container .card-body::before {
    background: var(--brand-primary);
    content: "";
    inset-block: 0;
    inset-inline-start: 0;
    position: absolute;
    width: 4px;
}

#results-printable #stats-container .row:first-child > .col-lg-2:nth-child(2) .card-body::before {
    background: #15803d;
}

#results-printable #stats-container .row:first-child > .col-lg-2:nth-child(3) .card-body::before {
    background: #2f6fc7;
}

#results-printable #stats-container .row:first-child > .col-lg-2:nth-child(4) .card-body::before {
    background: #c2410c;
}

#results-printable #stats-container .row:first-child > .col-lg-2:nth-child(5) .card-body::before {
    background: #64748b;
}

#results-printable #stats-container .row:nth-child(2) .card-body::before {
    background: #dc3545;
}

#results-printable #stats-container .card-body::after {
    background: #eef4ff;
    border-radius: 999px;
    content: "";
    height: 38px;
    inset-block-start: 18px;
    inset-inline-end: 18px;
    opacity: 0.85;
    position: absolute;
    width: 38px;
}

#results-printable #stats-container .row:first-child > .col-lg-2:nth-child(2) .card-body::after {
    background: #e9f8ef;
}

#results-printable #stats-container .row:first-child > .col-lg-2:nth-child(3) .card-body::after {
    background: #eef4ff;
}

#results-printable #stats-container .row:first-child > .col-lg-2:nth-child(4) .card-body::after {
    background: #fff4e5;
}

#results-printable #stats-container .row:first-child > .col-lg-2:nth-child(5) .card-body::after {
    background: #f1f5f9;
}

#results-printable #stats-container .row:nth-child(2) .card-body::after {
    background: #fff1f2;
}

#results-printable #stats-container h6 {
    color: #7b8798 !important;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1.25;
    max-width: calc(100% - 48px);
}

#results-printable #stats-container h2 {
    color: #172033 !important;
    font-size: clamp(20px, 1.6vw, 26px);
    font-weight: 650 !important;
    letter-spacing: 0;
    line-height: 1.18;
    margin-top: 6px;
}

#customers-container,
#reps-container,
#invoices-container {
    border: 1px solid #dbe4f0 !important;
    box-shadow: 0 7px 16px rgba(18, 48, 109, 0.052) !important;
}

#customers-container .card-header,
#reps-container .card-header,
#invoices-container .card-header {
    background: #fbfdff !important;
    border-bottom-color: #dbe4f0 !important;
}

#customers-container .table,
#reps-container .table,
#invoices-container .table {
    margin-bottom: 0;
}

#customers-container thead th,
#reps-container thead th,
#invoices-container thead th {
    background: #eef3f9 !important;
    color: #172033 !important;
}

#customers-container tbody td,
#reps-container tbody td,
#invoices-container tbody td {
    color: #253449;
    padding-block: 10px;
}

#customers-container tbody tr:hover,
#reps-container tbody tr:hover,
#invoices-container tbody tr:hover {
    background: #f3f7fd !important;
}

@media (max-width: 768px) {
    .erp-form-shell {
        max-width: 100%;
    }

    .erp-sticky-actions {
        bottom: 8px;
        flex-wrap: wrap;
    }

    .erp-sticky-actions .btn {
        flex: 1 1 150px;
    }
}


.badge.bg-secondary{
    color: #fff !important;
}
