/* ============================================================
   THEME EMERALD — Global override
   Unified light emerald theme for the entire ERP.
   Loaded LAST (after Bootstrap + AntDesign) so it wins.
   ============================================================ */

:root {
    --bs-primary: #059669;
    --bs-primary-rgb: 5, 150, 105;
    --bs-primary-bg-subtle: #ECFDF5;
    --bs-link-color: #059669;
    --bs-link-hover-color: #047857;
    --bs-link-color-rgb: 5, 150, 105;
    --bs-link-hover-color-rgb: 4, 120, 87;

    --ant-primary-color: #059669;
    --ant-primary-color-hover: #10B981;
    --ant-primary-color-active: #047857;
    --ant-primary-color-outline: rgba(5, 150, 105, 0.2);
    --ant-primary-color-deprecated-bg: #ECFDF5;
    --ant-primary-color-deprecated-border: #A7F3D0;
    --ant-primary-color-deprecated-l-35: #A7F3D0;
    --ant-primary-color-deprecated-l-20: #6EE7B7;
    --ant-primary-color-deprecated-t-20: #34D399;
    --ant-primary-color-deprecated-t-50: #A7F3D0;
    --ant-primary-color-deprecated-f-12: rgba(5, 150, 105, 0.12);
    --ant-primary-color-active-deprecated-f-30: rgba(5, 150, 105, 0.3);
    --ant-primary-color-active-deprecated-d-02: #ECFDF5;

    --ant-primary-1: #ECFDF5;
    --ant-primary-2: #D1FAE5;
    --ant-primary-3: #A7F3D0;
    --ant-primary-4: #6EE7B7;
    --ant-primary-5: #34D399;
    --ant-primary-6: #10B981;
    --ant-primary-7: #059669;
    --ant-primary-8: #047857;
    --ant-primary-9: #065F46;
    --ant-primary-10: #064E3B;

    --ant-link-color: #059669;
    --ant-link-color-hover: #047857;
}

/* ---------- Bootstrap utilities ---------- */

.text-primary {
    color: var(--bs-primary) !important;
}

    .text-primary:hover,
    .text-primary:focus {
        color: var(--bs-link-hover-color) !important;
    }

.bg-primary {
    background-color: var(--bs-primary) !important;
}

.border-primary {
    border-color: var(--bs-primary) !important;
}

.btn-primary {
    --bs-btn-bg: var(--bs-primary) !important;
    --bs-btn-border-color: var(--bs-primary) !important;
    --bs-btn-hover-bg: var(--bs-link-hover-color) !important;
    --bs-btn-hover-border-color: var(--bs-link-hover-color) !important;
    --bs-btn-active-bg: var(--bs-link-hover-color) !important;
    --bs-btn-active-border-color: var(--bs-link-hover-color) !important;
    --bs-btn-disabled-bg: var(--bs-primary) !important;
    --bs-btn-disabled-border-color: var(--bs-primary) !important;
    background-color: var(--bs-btn-bg) !important;
    border-color: var(--bs-btn-border-color) !important;
    color: #fff !important;
}

.btn-outline-primary {
    --bs-btn-color: var(--bs-primary) !important;
    --bs-btn-border-color: var(--bs-primary) !important;
    --bs-btn-hover-bg: var(--bs-primary) !important;
    --bs-btn-hover-border-color: var(--bs-primary) !important;
    --bs-btn-hover-color: #fff !important;
    --bs-btn-active-bg: var(--bs-primary) !important;
    --bs-btn-active-border-color: var(--bs-primary) !important;
    color: var(--bs-btn-color) !important;
    border-color: var(--bs-btn-border-color) !important;
}

.link-primary,
a.text-primary {
    color: var(--bs-primary) !important;
}

.form-check-input:checked,
.form-select:focus,
.form-control:focus,
.form-range::-webkit-slider-thumb {
    border-color: var(--bs-primary) !important;
}

.form-check-input:checked {
    background-color: var(--bs-primary) !important;
}

.form-control:focus,
.form-select:focus,
.form-control:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(5, 150, 105, 0.15) !important;
}

.text-primary-emphasis {
    color: var(--bs-link-hover-color) !important;
}

.bg-primary-subtle {
    background-color: var(--bs-primary-bg-subtle) !important;
}

.border-primary-subtle {
    border-color: var(--bs-primary-bg-subtle) !important;
}

/* AntDesign primary buttons, links, tabs, pagination active, switches etc. */

.ant-btn-primary {
    background-color: var(--ant-primary-color) !important;
    border-color: var(--ant-primary-color) !important;
}

    .ant-btn-primary:hover:not(:disabled) {
        background-color: var(--ant-primary-color-hover) !important;
        border-color: var(--ant-primary-color-hover) !important;
    }

    .ant-btn-primary:active:not(:disabled),
    .ant-btn-primary:focus:not(:disabled) {
        background-color: var(--ant-primary-color-active) !important;
        border-color: var(--ant-primary-color-active) !important;
    }

.ant-btn-link {
    color: var(--ant-primary-color) !important;
}

.ant-btn-link[ant-click-animating-without-extra-node]:after,
.ant-btn-primary:focus-within {
    box-shadow: 0 0 0 2px var(--ant-primary-color-outline) !important;
}

.ant-btn:focus-visible,
.ant-btn:active {
    outline-color: var(--ant-primary-color) !important;
}

a.ant-link,
.ant-typography a,
.ant-layout-sider a,
.ant-menu-item a {
    color: var(--ant-primary-color) !important;
}

    a.ant-link:hover,
    .ant-typography a:hover {
        color: var(--ant-primary-color-hover) !important;
    }

.ant-switch {
    background-color: var(--ant-primary-color) !important;
}

.ant-pagination .ant-pagination-item-active {
    border-color: var(--ant-primary-color) !important;
    background: var(--ant-primary-color) !important;
}

.ant-layout-content .ant-menu .ant-menu-item-selected,
.ant-layout-content .ant-menu .ant-menu-submenu-selected > .ant-menu-submenu-title,
.ant-layout-content .ant-menu-light .ant-menu-item-selected {
    color: var(--ant-primary-color) !important;
    background: rgba(5, 150, 105, 0.1) !important;
}

/* Sidebar menu links — global link color spill nahi (sidebar apni colors rakhta hai) */
.erp-sidebar .ant-menu-item a,
.erp-sidebar .ant-menu-submenu-title a {
    color: #475569 !important;
}

.erp-sidebar .ant-menu-item:hover a,
.erp-sidebar .ant-menu-submenu-title:hover a {
    color: #059669 !important;
}

.erp-sidebar .ant-menu-item-selected a {
    color: #059669 !important;
}

.ant-tabs .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn,
.ant-tabs .ant-tabs-tab:hover .ant-tabs-tab-btn {
    color: var(--ant-primary-color) !important;
}

.ant-tabs .ant-tabs-ink-bar {
    background: var(--ant-primary-color) !important;
}

.ant-badge .ant-badge-status-processing {
    background-color: var(--ant-primary-color) !important;
}

.ant-message,
.ant-notification-notice-message,
.ant-notification-notice-description {
    color: #0F172A;
}

.ant-table-thead > tr > th {
    background: #F8FAFD !important;
    font-weight: 600;
}

/* Bring paragraph/icon blues used for accents to emerald where they are "brand"-like */
.anticon-primary,
.anticon.anticon-check-circle {
    color: var(--ant-primary-color) !important;
}