/* cyrillic-ext */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459WRhyzbi.woff2) format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* cyrillic */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459W1hyzbi.woff2) format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* vietnamese */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459WZhyzbi.woff2) format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* latin-ext */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459Wdhyzbi.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459Wlhyw.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* cyrillic-ext */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459WRhyzbi.woff2) format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* cyrillic */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459W1hyzbi.woff2) format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* vietnamese */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459WZhyzbi.woff2) format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* latin-ext */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459Wdhyzbi.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459Wlhyw.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* cyrillic-ext */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459WRhyzbi.woff2) format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* cyrillic */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459W1hyzbi.woff2) format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* vietnamese */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459WZhyzbi.woff2) format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* latin-ext */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459Wdhyzbi.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459Wlhyw.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* cyrillic-ext */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459WRhyzbi.woff2) format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* cyrillic */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459W1hyzbi.woff2) format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* vietnamese */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459WZhyzbi.woff2) format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* latin-ext */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459Wdhyzbi.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/montserrat/v31/JTUSjIg1_i6t8kCHKm459Wlhyw.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'mkr';
    src: url('/theme1/css/icons/fonts/mkr.eot?qrr250');
    src: url('/theme1/css/icons/fonts/mkr.eot?qrr250#iefix') format('embedded-opentype'), url('/theme1/css/icons/fonts/mkr.ttf?qrr250') format('truetype'), url('/theme1/css/icons/fonts/mkr.woff?qrr250') format('woff'), url('/theme1/icons/fonts/mkr.svg?qrr250#mkr') format('svg');
    font-weight: normal;
    font-style: normal;
    font-display: block
}
:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --s2: #ffffff;
    --s3: #222638;
    --activecolor:#ffffff;
    --border: #E5EBEE;
    --accent: #4f8ef7;
    --green: #24B698;
    --red: #EF536A;
    --yellow: #f7c94f;
    --purple: #837FF7;
    --text: rgb(75 72 112 / 90%);
    --textcolor: #3890c6;
    --textcolors: #6C6C70;
    --heading: #585859;
    --muted: #585859;
    --standardcolor:#93d3e4;
    --mono: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --sans: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-family-standard: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
.hide{
    display: none !important;
}
.overflow-hidden{
    overflow: hidden !important;
}
.mb-0{
    margin-bottom: 0 !important;
}
.mt-0{
    margin-bottom: 0 !important;
}
body {
    background: none;
    color: var(--text);
    font-family: var(--sans);
    font-size: 14px;
    min-height: 100vh;
    font-family: var(--font-family-standard);
    -ms-overflow-style: none;
}
::-webkit-scrollbar-button {
  display: none; 
}

::-webkit-scrollbar-track {
    background: #e5e5e7;
    -webkit-box-shadow: inset 0 0 5px #ccc;
    -webkit-border-radius: 5px;
    box-shadow: inset 0 0 5px #ccc;
    border-radius: 5px;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    -webkit-border-radius: 10px;
    border-radius: 10px;
    background: #b2b2b2 !important;
    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.6);
}
.floating_Scrollbar_v2{
    transition: scrollbar-width 0.3s;
    scrollbar-gutter: stable;
    scrollbar-width: 0;
}
.floating_Scrollbar_v2::-webkit-scrollbar{
    width: 8px; 
    visibility: hidden; 
}
.floating_Scrollbar_v2::-webkit-scrollbar-track{
    background: transparent;
    visibility: hidden; 
}
.floating_Scrollbar_v2::-webkit-scrollbar-thumb{
    background: #aaa;
    border-radius: 4px;
    visibility: hidden;
    transition: visibility 0.1s;
    background:transparent;
}
.floating_Scrollbar_v2:hover::-webkit-scrollbar-thumb{
    visibility: visible;
}
.floating_Scrollbar_v2:hover::-webkit-scrollbar-track{
    visibility: visible;
}
.floating_Scrollbar_v2:hover{
    scrollbar-width: auto;    
}
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 200;
}
.logo {
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 9px;
}
.logo-sub {
    color: var(--muted);
    font-weight: 400;
    font-size: 11px;
}
.topbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.shared-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 0px 0px;
    flex-wrap: wrap;
    position: sticky;
    top: 0px;
    z-index: 100;
    margin-bottom: 10px;
}
.filter-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.sel {
    padding: 6px 11px;
    background: var(--s3);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--s2);
    font-family: var(--sans);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    appearance: none;
}
.sel:focus {
    border-color: var(--accent);
}
.bar-spacer {
    flex: 1;
}
.main-tabs {
    display: flex;
    top: 1px;
    z-index: 999;
    gap: 10px;
    position: absolute;
    left: 0;
    right: 0;
    margin: auto;
    justify-content: center;
    max-width: fit-content;
}
/* .tabs-content-block.full-width .main-tabs {
    position: static;
} */
.mtab {
    padding: 7px 13px;
    border-radius: 10px;
    border: 1px solid #bfcfd9;
    background: #eff4f9;
    text-align: center;
    color: #6c6c70;
    box-shadow: 0 4px 4px 0 #5F7CB814;
    font-weight: 400;
    font-size: 16px;
    line-height: 100%;
    transition: all 0.15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    height: 32px;
}
.mtab:hover {
    color: var(--text);
}
.mtab.active {
    color: var(--activecolor);
    background: #585859;
    border-color: #585859;
}
.mtab-count {
    background: #585859;
    color: var(--s2);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 6px;
    border: none;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: #3a7aee;
}
.btn-ghost {
    background: #585859;
    color: #fff;
    border: 1px solid #585859;
}
.btn-ghost:hover {
    color: var(--text);
    border-color: var(--muted);
}
.btn-green {
    background: rgba(45, 212, 160, 0.12);
    color: var(--green);
    border: 1px solid rgba(45, 212, 160, 0.2);
}
.btn-green:hover {
    background: rgba(45, 212, 160, 0.22);
}
.btn-red {
    background: rgba(247, 90, 90, 0.1);
    color: var(--red);
    border: 1px solid rgba(247, 90, 90, 0.2);
}
.btn-red:hover {
    background: rgba(247, 90, 90, 0.2);
}
.btn-sm {
    padding: 5px 11px;
    font-size: 12px;
}
.btn-xs {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 5px;
}
.page {
    display: none;
}
.page.active {
    display: block;
}
#page-formulas {
    margin-top: 10px;
}
/* Formula Builder */
.fb-layout {
    display: grid;
    grid-template-columns: 275px 1fr 295px;
    height: calc(100vh - 100px);
    gap: 15px;
}
.fb-left {
    background: var(--bg);
    /*border-right: 1px solid var(--border);*/
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 10px;
}
.fb-center {
    background: var(--bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 10px;
    margin-top: 0px;
}
.fb-right {
    /*border-left: 1px solid var(--border);*/
    background: var(--bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 10px;
}
.panel-header {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* border-bottom: 1px solid var(--border); */
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.comp-list {
    flex: 1;
    overflow-y: auto;
    padding: 0px;
}
.comp-item {
    padding: 9px 11px;
    border-radius: 0;
    cursor: pointer;
    /* margin-bottom: 3px; */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    border-bottom: 1px solid #E5EBEE;
    transition: all 0.12s;
}
.comp-item:hover {
    background: var(--s2);
    border-color: var(--border);
}
.comp-item.active {
    background: rgba(79, 142, 247, 0.08);
    border-color: rgba(79, 142, 247, 0.35);
}
.comp-item:has(+ .comp-group-header) {
    border: none;
}
.comp-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.comp-item-formula {
    font-family: var(--mono);
    font-size: 14px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 125px;
}
.badge {
    flex-shrink: 0;
    padding: 2px 6px;
    border-radius: 45px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: capitalize;
}
.badge-earn {
    background: #D6F3EE;
    color: var(--green);
}
.badge-deduct {
    background: #FFCDD4;
    color: var(--red);
}
.badge-employer {
    background: #DAD9FD;
    color: #a78bfa;
}
.add-comp-btn {
    margin: 0px;
    padding: 0;
    border: 1px solid #BFCFD9;
    border-radius: 10px;
    background: #eff4f9;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 12px;
    cursor: pointer;
    width: 32px;
    transition: all 0.12s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-width: 32px;
    margin-left: auto;
    height: 32px;
}
.add-comp-btn .mkr-plus:before {
    font-size: 17px;
    color: #ADB0B4;
}
.add-comp-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.add-comp-btns .savebtn-v2 {
    font-size: 12px;
}
.add-comp-btns {
    justify-content: center;
}
#comp-count {
    font-size: 14px;
    color: #6C6C70;
    font-weight: 600;
    opacity: 60%;
    margin-left: 5px;
}
.editor-header {
    padding: 13px 22px;
    border-bottom: 1px solid #E5EBEE;
    display: flex;
    align-items: center;
    gap: 12px;
}
.editor-title-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--heading);
    font-family: var(--sans);
    font-size: 17px;
    font-weight: 600;
}
.editor-title-input::placeholder {
    color: var(--muted);
}
.editor-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}
.field-group {
    margin-bottom: 17px;
}
.field-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: capitalize;
    color: #6C6C70;
    margin-bottom: 6px;
}
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 11px;
}
.input/*,
.select-input*/ {
    width: 100%;
    padding: 7px 11px;
    background: #eff4f9 !important;
    border: 1px solid #bfcfd9 !important;
    border-radius: 10px;
    color: rgb(75 72 112 / 90%);
    font-family: var(--sans);
    font-size: 13px;
    outline: none;
    transition: border-color 0.12s;
    appearance: none;
    height: 32px;
}
#comp-desc-input {
    height: 60px;
}
.input:focus,
.select-input:focus {
    border-color: var(--accent);
}
.input::placeholder {
    color: var(--muted);
}
.formula-wrap {
    position: relative;
}
.formula-editor {
    width: 100%;
    min-height: 80px;
    background: #ffff;
    border: 1px solid #BFCFD9;
    border-radius: 8px;
    color: rgb(75 72 112 / 90%);
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.7;
    padding: 11px 35px 11px 13px;
    outline: none;
    resize: vertical;
    transition: border-color 0.12s;
}
.formula-editor:focus {
    border-color: var(--accent);
}
.formula-status {
    position: absolute;
    bottom: 9px;
    right: 11px;
    font-family: var(--mono);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted);
    transition: background 0.2s;
}
.status-dot.valid {
    background: var(--green);
}
.status-dot.invalid {
    background: var(--red);
}
.status-dot.checking {
    background: var(--yellow);
    animation: pulse 1s infinite;
}
@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}
.formula-error {
    margin-top: 6px;
    padding: 7px 11px;
    background: rgba(247, 90, 90, 0.08);
    border: 1px solid rgba(247, 90, 90, 0.2);
    border-radius: 6px;
    color: var(--red);
    font-family: var(--mono);
    font-size: 12px;
    display: none;
}
.formula-error.show {
    display: block;
}
/* ── Non-blocking dependency/sequence warnings (missing formula on a
   referenced component, or referenced component's Display Order not
   lower than this component's) — amber, distinct from hard parse errors ── */
.formula-warning {
    margin-top: 6px;
    padding: 7px 11px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 6px;
    color: var(--yellow, #f59e0b);
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.6;
    display: none;
}
.formula-warning.show {
    display: block;
}
/* ── Expanded/actual formula preview (read-only) ── */
.formula-expanded-group {
    margin-top: 10px;
}
.formula-expanded-label {
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.formula-expanded {
    width: 100%;
    min-height: 60px;
    background: #F1F3F5;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--green);
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.7;
    padding: 11px 13px;
    outline: none;
    resize: vertical;
    cursor: not-allowed;
}
.formula-expanded:focus {
    border-color: var(--border);
}
.formula-expanded::placeholder {
    color: var(--muted);
}
/* ── Formula source tabs: Employee / Payroll / Component ── */
.fb-src-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.fb-src-tab {
    padding: 5px 13px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    transition: all .15s;
}
.fb-src-tab:hover {
    color: var(--text);
    border-color: var(--accent);
}
.fb-src-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.fb-src-search-wrap {
    margin-top: 7px;
}
.fb-src-search {
    width: 100%;
    padding: 6px 10px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--textcolors);
    font-family: var(--mono);
    font-size: 13px;
    outline: none;
    transition: border-color .15s;
}
.fb-src-search::placeholder {
    color: rgb(75 72 112 / 90%);
    /*opacity: .7;*/
}
.fb-src-search:focus {
    border-color: var(--accent);
}
.var-chips-empty {
    width: 100%;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    padding: 8px 2px;
}
.var-chip-group-label {
    width: 100%;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    margin: 4px 0 -1px;
}
.var-chip-group-label:first-child {
    margin-top: 0;
}
.var-chip-earn {
    background: #D6F3EE;
    color: var(--green);
}
.var-chip-earn:hover {
    background: #c3ece4;
}
.var-chip-deduct {
    background: #FFCDD4;
    color: var(--red);
}
.var-chip-deduct:hover {
    background: #ffbecb;
}
.var-chip-employer {
    background: #DAD9FD;
    color: #837FF7;
}
.var-chip-employer:hover {
    background: rgba(131, 127, 247, .3);
}
/* "Total" group chips (Total Cost / Net Earning / Social Cost — Monthly &
   Yearly) shown under Employer Contributions on the Component/YTD source
   tabs. These aren't tied to a component's type, so they get their own
   colour rather than reusing earn/deduct/employer. */
.var-chip-total {
    background: #FDECC8;
    color: #B8860B;
}
.var-chip-total:hover {
    background: #fbe0a3;
}
/* YTD tab chips reuse the earn/deduct/employer/total colours but get a
   dashed outline so it's obvious at a glance that inserting this chip gives
   ytd_<key> (the label itself is already prefixed "YTD " in JS). The
   compound selector below (vs. plain .var-chip-ytd) keeps this above
   .var-chip's own `border: none` regardless of source order. */
.var-chip.var-chip-ytd,
.var-chip-earn.var-chip-ytd,
.var-chip-deduct.var-chip-ytd,
.var-chip-employer.var-chip-ytd,
.var-chip-total.var-chip-ytd {
    border: 1px dashed currentColor;
}
.var-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}
.var-chip {
    padding: 6px 9px;
    border-radius: 10px;
    background: rgb(190 222 240 / 30%);
    border: none;
    /*color: #04A9F5;*/
    font-family: var(--mono);
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
}
.var-chip:hover {
    background: rgba(79, 142, 247, 0.22);
}
.fn-chip {
    padding: 3px 9px;
    border-radius: 5px;
    background: #DAD9FD;
    color: #837FF7;
    font-family: var(--mono);
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
}
.fn-chip:hover {
    background: rgba(124, 90, 240, 0.22);
}
.test-section {
    background: #EFF4F9;
    border: none;
    border-radius: 9px;
    padding: 15px;
}
.test-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.test-input-wrap label {
    display: block;
    font-size: 14px;
    color: #6C6C70;
    margin-bottom: 3px;
    font-weight: 500;
}
.test-result {
    margin-top: 11px;
    padding: 8px 13px;
    background: #81ACED;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
/*.test-section .input, .test-section .input, 
.select-input .select-input {
    background-color: #fff;
}*/
.test-result-value {
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--green);
}
.test-result-value.error {
    color: var(--red);
    font-size: 13px;
}
.editor-footer {
    padding: 11px 22px;
    border-top: 1px solid #E5EBEE;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    background: var(--surface);
}
.divider {
    height: 1px;
    background: #E5EBEE;
    margin: 16px 0;
}
.preview-body {
    flex: 1;
    overflow-y: auto;
    padding: 13px 0;
}
.preview-heading {
    padding:3px 13px 7px;
    font-size:14px;
    color:#6C6C70;
    font-family:var(--mono);
    text-transform:capitalize;
    letter-spacing:0;
    font-weight: 500;
    opacity: 50%;
    white-space: nowrap;
    overflow: hidden;
    min-width: 100%;
    text-overflow: ellipsis;
}
.preview-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 13px;
    border-radius: 6px;
    margin-bottom: 2px;
    font-size: 14px;
    color: #6C6C70;
}
.border-top-1 {
    border-top: 1px solid #E5EBEE;
    padding-top: 10px;
    margin-top: 10px;
}
.preview-row:hover {
    background: var(--s2);
}
.preview-row.earn .preview-row-amount {
    color: var(--green);
}
.preview-row.deduct .preview-row-amount {
    color: var(--red);
}
.preview-row.employer .preview-row-amount {
    color: #a78bfa;
}
.preview-row-name {
    color: var(--textcolors);
    font-weight: 500;
}
.preview-row-amount {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
}
.preview-row-amount.earn {
    color: #24B698;
}
.preview-row-amount.deduct {
    color: #ED546B;
}
.preview-total {
    padding: 9px;
    margin-top: 5px;
    border-top: 1px solid #E5EBEE;
}
.preview-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 3px;
    font-size: 14px;
    font-weight: 500;
}
.preview-total-row.net {
    margin-top: 5px;
    padding: 8px 10px;
    background: #81ACED;
    border-radius: 7px;
    font-weight: 500;
    color: #fff;
}
.preview-total-row.net .preview-row-amount {
    color: #fff;
    font-size: 14px;
}
.currency-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 45px;
    background: rgba(79, 142, 247, 0.1);
    color: var(--accent);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    margin-left: 5px;
}
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--muted);
    text-align: center;
    gap: 9px;
    padding: 24px;
}
.empty-state p {
    font-size: 13px;
    line-height: 1.6;
}
/* Slab/Cap/Rules pages */
.page-main {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0;
    margin-top: 60px;
    border-radius: 10px;
    max-height: calc(100vh - 125px);
    overflow: hidden auto;
}
.tabs-content-block.full-width .page-main {
    max-width: 100%;
    margin-top: 10px;
}
.sec-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 16px;
}
.sec-title {
    font-size: 14px;
    font-weight: 600;
    color: #6C6C70;
}
.sec-desc {
    font-size: 13px;
    color: #6C6C70;
    margin-top: 4px;
    line-height: 1.5;
    background-color: #F2F7FE;
    border-radius: 8px;
    padding: 6px 10px;
}
.slab-wrap {
    background: var(--surface);
    border-radius: 10px;
    overflow: hidden auto;
    max-height: calc(100vh - 177px);
}
.slab-wrap::-webkit-scrollbar-track{
    margin-top: 53px;
}
.slab-table {
    width: 100%;
    border-collapse: collapse;
}
.slab-table thead tr {
    background: var(--s2);
}
.slab-table th,
.table-layout th {
    padding: 10px 5px;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: #ADB0B4;
    border-bottom: 1px solid #E5EBEE;
}
.slab-table th {
    position: sticky;
    top: 0;
    background-color: #fff;
}
.slab-table #slab-tbody tr,
.table-layout tr {
    height: 56px;
}
.slab-table td,
.table-layout td {
    padding: 0 5px;
    border-bottom: 1px solid #E5EBEE;
}
.slab-table tr:last-child td,
.table-layout tr:last-child td {
    border-bottom: none;
}
.slab-table tr:hover td {
    background: rgba(79, 142, 247, 0.03);
}
.slab-input {
    width: 100%;
    padding: 7px 14px;
    color: var(--text);
    font-family: var(--mono);
    font-size: 13px;
    outline: none;
}
.slab-input:focus {
    background: rgba(79, 142, 247, 0.05);
}
.slab-input::placeholder {
    color: var(--muted);
}
.slab-input.rate {
    color: var(--yellow);
}
.slab-input.flat {
    color: var(--purple);
}
.slab-row-num {
    /*padding: 0px 12px;*/
    color: var(--muted);
    font-family: var(--mono);
    font-size: 14px;
    text-align: center;
    width: 30px;
    background-color: #D7E8FF;
    border-radius: 50%;
    font-weight: 500;
    height: 30px;
    align-content: center;
}
.slab-actions {
    padding: 7px 10px;
}
.slab-bar-cell {
    padding: 7px 14px;
    width: 120px;
}
.slab-bar {
    height: 5px;
    border-radius: 3px;
    background: var(--s3);
    overflow: hidden;
}
.slab-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}
.add-slab-row {
    padding: 10px;
    background: transparent;
    border: none;
    border-top: 1px dashed var(--border);
    color: var(--muted);
    font-family: var(--sans);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.12s;
}
.addRowBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    border-top: 1px solid #E5EBEE;
}
.savebtn-v2 .mkr-plus:before {
    color: #fff;
}
.add-slab-row:hover {
    color: var(--accent);
    background: rgba(79, 142, 247, 0.04);
}
.preview-box {
    background: var(--surface);
    border-radius: 10px;
    margin-top: 24px;
}
.preview-title {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 13px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 15px;
}
.preview-income-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 9px;
    padding: 0 15px;
}
.preview-income-row label {
    font-size: 12px;
    color: var(--muted);
    width: 130px;
}
.preview-inp {
    padding: 7px 11px;
    border: 1px solid #bfcfd9;
    border-radius: 6px;
    color: var(--text);
    font-family: var(--mono);
    font-size: 13px;
    outline: none;
    width: 155px;
}
.preview-inp:focus {
    border-color: var(--accent);
}
.preview-result {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(361px, 1fr));
    gap: 10px;
    margin-top: 13px;
    padding: 0 15px;
}
.preview-stat {
    background: #eff4f9;
    border-radius: 17px;
    padding: 12px;
    border: 1px solid #bfcfd9;
    height: 80px;
}
.preview-stat-label {
    font-size: 16px;
    color: #ADB0B4;
    margin-bottom: 5px;
    font-weight: 500;
}
.preview-stat-value {
    font-family: var(--mono);
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
    text-align: center;
}
.preview-stat-value.green {
    color: var(--green);
}
.preview-stat-value.red {
    color: var(--red);
}
.preview-stat-value.yellow {
    color: var(--yellow);
}
.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}
#tax-breakdown-table th, 
#tax-breakdown-table td {
    padding: 0 15px;
}
.breakdown-table tr {
    border-bottom: 1px solid var(--border);
}
.breakdown-table tr:last-child {
    border-bottom: none;
    font-weight: 600;
}
.breakdown-table td {
    padding: 7px 11px;
    font-size: 13px;
}
.breakdown-table td:first-child {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
}
.breakdown-table td:nth-child(2) {
    text-align: right;
    font-family: var(--mono);
    color: var(--yellow);
}
.breakdown-table td:nth-child(3) {
    text-align: right;
    font-family: var(--mono);
    color: var(--green);
}
.cap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(365px, 1fr));
    gap: 13px;
    max-height: calc(100vh - 140px);
    overflow: hidden auto;
}
.cap-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    position: relative;
}
.cap-card-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.cap-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cap-row {
    display: flex;
    align-items: center;
    gap: 0px;
    margin-bottom: 8px;
    flex-direction: column;
}
.cap-row label {
    font-size: 14px;
    color: var(--muted);
    width: 100%;
    flex-shrink: 0;
    display: block;
}
.cap-input {
    flex: 1;
    padding: 7px 10px;
    /* background: var(--s2); */
    border: 1px solid var(--border);
    /* border-radius: 6px; */
    color: var(--text);
    font-family: var(--mono);
    font-size: 13px;
    outline: none;
    min-width: 0;
    width: 100%;
}
.cap-card .cap-input.select2 {
    border: 0;
    padding: 0;
    background: transparent;
}
.cap-rule-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.cap-rule-group .cap-row {
    flex: 1 0 calc(50% - 8px);
}
.cap-card-header button.btn {
    font-size: 16px;
    background-color: transparent;
}
#page-caps .page-main {
    overflow: hidden;
    max-height: calc(100vh - 85px);
    border-radius: 0;
}
.cap-input:focus {
    border-color: var(--accent);
}
.cap-formula-preview {
    margin-top: 6px;
    padding: 8px 11px;
    background: var(--bg);
    border-radius: 7px;
    border: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 12px;
    color: var(--green);
}
.cap-formula-label {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 0;
    text-transform: capitalize;
    letter-spacing: 0.05em;
}
.cap-delete {
    position: absolute;
    top: 12px;
    right: 12px;
}
.rule-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rule-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 0px;
}
.copy-btn {
    padding: 0;
    border: none;
}
.rule-conds>.rule-row {
    padding: 10px 16px !important;
}
.rule-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 16px;
}
.rule-builder {
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.rule-line {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}
.rule-word {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}
.rule-sel {
    padding: 7px 10px;
    background: #eff4f9;
    border: 1px solid #bfcfd9;
    border-radius: 6px;
    color: var(--text);
    font-family: var(--sans);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    appearance: none;
}
.rule-sel:focus {
    border-color: var(--accent);
}
.rule-inp {
    padding: 7px 10px;
    background: #eff4f9;
    border: 1px solid #bfcfd9;
    border-radius: 10px;
    color: var(--text);
    font-family: var(--mono);
    font-size: 13px;
    outline: none;
    width: 108px;
}
.rule-inp:focus {
    border-color: var(--accent);
}
.rule-inp.wide {
    width: 108px;
}
.rule-output {
    margin-top: 9px;
    padding: 9px 12px;
    background: var(--bg);
}
.rule-out-box{
    padding: 9px 12px; 
    border: 1px solid var(--border);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.rule-output-formula {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--green);
}
.rule-output-label {
    font-size: 12px;
    color: #6C6C70;
    padding-bottom: 6px;
}
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}
.modal-backdrop.show {
    display: flex;
}
.modal-backdrop.show .modal {
    display: block;
}
.modal.show {
    display: block;
}
.modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1050;
    display: none;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    outline: 0;
}
.modal-dialog {
    position: relative;
    width: auto;
    margin: 10px;
}
.modal-content {
    position: relative;
    background-color: #fff;
    -webkit-background-clip: padding-box;
    background-clip: padding-box;
    border-radius: 6px;
    outline: 0;
}
.modal-header {
    background: #f7f9fc;
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    border: none;
}
.modal-title {
    color: #585859;
    font-size: 16px;
    font-weight: 500;
}
.modal-body {
    padding: 15px;
}
.modal-body .field-label {
    font-size: 14px;
    font-weight: 500;
    text-transform: capitalize;
    color: #222;
}
.modal-footer {
    padding: 15px;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
/* ── Sequencing warning modal (replaces native confirm()) ── */
#seq-warning-modal .modal-dialog {
    width: 480px;
    max-width: 90vw;
}
.seq-warning-icon {
    font-size: 18px;
    color: var(--yellow, #f59e0b);
    margin-right: 8px;
    line-height: 1;
}
.seq-warning-intro {
    font-size: 13px;
    color: #3f3f46;
    line-height: 1.5;
    margin: 0 0 10px;
}
.seq-warning-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.seq-warning-list li {
    padding: 7px 11px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 6px;
    color: #92640a;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.5;
}
.seq-warning-question {
    font-size: 13px;
    font-weight: 500;
    color: #222;
    margin: 0;
}
#seq-warning-ok {
    background: var(--yellow, #f59e0b) !important;
    border-color: var(--yellow, #f59e0b) !important;
}
.savebtn-v2,
.cancelbtn-v2{
    border: none !important;
    font-weight: 500 !important;
    height: 32px !important;
    border-radius: 10px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    min-width: 90px;
    cursor: pointer;
}
.savebtn-v2.save-blue {
    background-color: #D5E6FD !important;
    color: #585859 !important;
}
.savebtn-v2 {
    background: #585859 !important;
    color: #fff !important;
}
.cancelbtn-v2 {
    background: #E4E4E4 !important;
    color: #6C6C70 !important;
}
@keyframes mIn {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: none;
        opacity: 1;
    }
}
.toast-wrap {
    position: fixed;
    bottom: 0;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    z-index: 9999;
    top: 0;
}
.toast {
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    background: var(--s2);
    border: 1px solid var(--border);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: tIn 0.2s ease;
    min-width: 200px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.toast.success {
    border-color: rgba(45, 212, 160, 0.3);
}
.toast.error {
    border-color: rgba(247, 90, 90, 0.3);
}
@keyframes tIn {
    from {
        transform: translateX(16px);
        opacity: 0;
    }
    to {
        transform: none;
        opacity: 1;
    }
}
.empty {
    text-align: center;
    padding: 30px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
}
.doc-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    background: var(--s2);
    border: 1px solid var(--border);
    color: var(--muted);
    transition: all 0.15s;
}
.doc-pill:hover {
    color: var(--text);
    border-color: var(--muted);
}
.doc-pill.active {
    background: #585858;
    border-color: #585858;
    color: #fff;
}
.slab-type-tab {
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: #E4E4E4;
    border: 1px solid var(--border);
    color: var(--muted);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.slab-type-tab.active .badge-count {
    background-color: #E4E4E4 !important;
    color: #585858 !important;
}
.slab-mode-badge {
    color: #747579 !important;
}
.slab-type-tab:hover {
    color: var(--text);
}
.slab-type-tab.active {
    background: #585859;
    border-color:#585859;
    color: #fff;
}
.doc-section {
    animation: fadeIn 0.2s ease;
}
.doc-section h2 {
    font-size: 14px;
    font-weight: 600;
    color: #585859;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.doc-section h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    margin: 16px 0 6px;
}
.doc-section p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 10px;
}
.doc-section code {
    background: var(--bg);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--green);
}
.doc-section pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    margin: 10px 0;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--green);
    overflow-x: auto;
    line-height: 1.6;
}
.doc-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}
.doc-section th {
    background: var(--s2);
    padding: 8px 12px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}
.doc-section td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.doc-section td:first-child {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--green);
}
.doc-callout {
    background: rgba(79, 142, 247, 0.07);
    border: 1px solid rgba(79, 142, 247, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
}
.doc-callout.warn {
    background: rgba(247, 201, 79, 0.07);
    border-color: rgba(247, 201, 79, 0.2);
}
#page-docs .page-main {
    overflow: hidden;
}
#page-docs .page-main {
    overflow: hidden;
    max-height: calc(100dvh - 93px);
    border-radius: 0;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
/** {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}*/
/* ── Bracket Editor ─────────────────────────────────── */
#bracket-editor {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    overflow: hidden;
    margin-top: 24px;
}
.bracket-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    background: var(--s2);
}
.bracket-editor-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.bracket-editor-title span {
    font-size: 11px;
    color: var(--muted);
    font-family: var(--mono);
    font-weight: 400;
}
.bracket-header-row {
    display: grid;
    grid-template-columns: 36px 1fr 1fr 110px 110px 44px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.bracket-header-row span {
    padding: 0 14px;
    font-size: 14px;
    color: #ADB0B4;
    text-transform: capitalize;
}
.bracket-row {
    display: grid;
    grid-template-columns: 36px 1fr 1fr 110px 110px 44px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}
.bracket-row:hover {
    background: rgba(79, 142, 247, 0.03);
}
.bracket-row:last-child {
    border-bottom: none;
}
.bracket-row-num {
    padding: 0 8px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    text-align: center;
}
.bracket-actions {
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bracket-slab-input {
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--mono);
    font-size: 13px;
    outline: none;
}
.bracket-slab-input:focus {
    background: rgba(79, 142, 247, 0.05);
}
.bracket-slab-input::placeholder {
    color: var(--muted);
}
.bracket-slab-input.rate {
    color: var(--yellow);
}
.bracket-slab-input.flat {
    color: var(--purple);
}
.bracket-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-top: 1px dashed var(--border);
    background: var(--s2);
}
.bracket-add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 11px;
    transition: color 0.12s;
}
.bracket-add-btn:hover {
    color: var(--accent);
}
.bracket-empty {
    padding: 22px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

/** {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}*/
#formulaBuilderFrame{
    height: calc(100dvh - 142px);
}
.convert2slider {
    position: fixed;
    right: 0px;
    left: auto;
    background: #fff;
    height: 100%;
    top: 0;
    padding: 0;
    z-index: 9999;
}
.convert2slider .modal-dialog {
    margin: 0 !important;
}
.modal.convert2slider .modal-content {
    background-color: #fff;
    height: 100vh !important;
}
.modal.show:before {
    content: "";
    background-color: rgba(0, 0, 0, .5);
    width: 100%;
    height: 100%;
    position: fixed;
}
button.btn-close {
    -webkit-appearance: none;
    padding: 0;
    cursor: pointer;
    background: transparent;
    border: 0;
}
.btn-close {
    margin-left: auto;
}
.btn-close .mkr-close:before {
    font-size: 16px;
}
.ipeople-user-data {
    background-color: #fff !important;
    border: 1px solid #bfcfd9;
    border-radius: 10px !important;
    padding: 0 !important;
}
.ipeople-user-data-header {
    background-color: #F5F6F7;
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 5px 0 15px;
    border-radius: 10px 10px 0 0;
}
.ipeople-user-data-heading {
    font-weight: 500;
    color: #6C6C70;
}
.ipeople-user-data-header .headingToggle {
    margin-left: auto;
    background-color: #E4E4E4;
    height: 30px;
    width: 30px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.ipeople-user-data-header .headingToggle .mkr-arrowsup-v2:before {
    color: #585859;
}
.user_field_content_block {
    padding: 15px;
}
.collapsed .user_field_content_block {
    display: none;
}
.collapsed .mkr-arrowsup-v2:before {
    content: "\e915";
    color: #adb0b4 !important;
}
.select2-ui .select2-container .select2-choice {
    height: 32px;
    border-radius: 10px;
    line-height: 22px;
    border: none;
    padding: 0;
    background-image: none;
    background-color: #EFF4F9;
    border: 1px solid #bfcfd9;
    box-shadow: none;
    color: rgb(75 72 112 / 90%);
}
.select2-ui .select2-chosen, 
.select2-ui .select2-choice>span:first-child {
    padding: 4px 0 4px 8px;
}
.select2-ui .select2-container .select2-arrow {
    width: 24px;
    background: no-repeat;
    border: 0;
}
.select2-ui .select2-container .select2-choice b:before {
    position: unset;
}
.select2-ui .select2-container .select2-choice b:before {
    content: "\e915";
    font-family: 'mkr';
    right: 1px;
    position: relative;
    color: #ADB0B4;
    top: 1px;
}
.select2-ui .select2-container.select2-dropdown-open .select2-choice b:before{
    content: "\e9a6";
}
.theme2-field-ui .select2-choice {
    background-color: #eff4f9;
    border-radius: 10px;
    border-color: #bfcfd9;
    background-image: none;
    padding-left: 0;
}
.select2-ui .select2-container .select2-choice .select2-arrow b {
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.select2-ui .select2-container {
    min-width: 100%;
}
.btn-icon{
    background: transparent;
}
.btn-icon:before {
    font-size: 18px;
}
input[type=checkbox] {
    -webkit-appearance: none;
}
.list-checkbox input[type=checkbox] {
    border: 2px solid #dedede;
    border-radius: 3px;
    width: 15px;
    height: 15px;
}
.list-checkbox input[type=checkbox]:checked {
    background-color: #585859;
    border: solid 2px #585859 !important;
    border-radius: 3px;
}
.list-checkbox input[type=checkbox]:checked::after {
    content: "\ece3" !important;
    top: 0px !important;
    left: 0px !important;
    font-family: "mkr";
    font-size: 12px;
    color: #fff;
}
.btn-like-ui{
    padding: 9px 13px;
    border-radius: 10px;
    border: 1px solid #bfcfd9;
    background: #eff4f9;
    text-align: center;
    color: var(--text);
    font-weight: 400;
    font-size: 14px;
    line-height: 100%;
    transition: all 0.15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.date-input::-webkit-calendar-picker-indicator{
    opacity:0;
    position:absolute;
    right:0;
    width:100%;
    height:100%;
    cursor:pointer;
}
.date-input {
    position: relative;
}
.date-input:after {
    content: "\e9a8";
    font-family: 'mkr';
    right: 7px;
    top: 9px;
    position: absolute;
    align-content: center;
}
@media (min-width: 768px) {
    .modal-dialog {
        width: 600px;
        margin: 30px auto;
    }
    #audit-detail-modal .modal-dialog{
        width: 1100px;
    }
}
@media (min-width: 1920px) {
    .convert2slider .modal-dialog, .convert2slider {
        width: 50vw !important;
        max-width: 1024px !important;
    }
}

/* ── Payslip Preview: editable override inputs ────────────────────── */
.preview-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 13px;
    font-size: 13px;
}
.preview-row-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.preview-override-input {
    width: 100px;
    text-align: left;
    border: 1px solid transparent;
    padding: 2px 6px;
    font-size: 13px;
    font-family: var(--mono, monospace);
    color: var(--text, #1a202c);
    border-radius: 10px;
    text-align: right;
    transition:
        border-color 0.15s,
        background 0.15s;
}
input[type="number"].preview-override-input::-webkit-outer-spin-button, 
input[type="number"].preview-override-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}
.preview-override-input:hover,
.preview-override-input:focus {
    border-color: var(--accent, #0070f3);
    background: var(--surface, #fff);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 112, 243, 0.12);
}
/* .preview-row.is-overridden .preview-override-input {
    border-color: var(--warn, #f0a500);
    color: var(--warn, #f0a500);
    background: rgba(240, 165, 0, 0.07);
} */
.preview-formula-hint {
    font-size: 11px;
    color: var(--muted, #8492a6);
    white-space: nowrap;
}
.preview-reset-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted, #8492a6);
    font-size: 15px;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.12s;
}
.preview-reset-btn:hover {
    color: var(--danger, #e53e3e);
}
.preview-override-notice {
    font-size: 12px;
    color: var(--warn, #f0a500);
    padding: 6px 6px 10px 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    border-radius: 8px;
    font-weight: 500;
}
.preview-reset-all-btn {
    font-size: 11px;
    padding: 2px 9px;
    border: 1px solid var(--warn, #585859);
    border-radius: 5px;
    background: #585859;
    color: var(--warn, #fff);
    cursor: pointer;
    transition: background 0.12s;
}
.preview-reset-all-btn:hover {
    background: rgba(240, 165, 0, 0.12);
}

/* ── Component list group headers ─────────────────────────── */
/* .comp-group-header {
  padding: 6px 11px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  position: sticky;
  top: 0;
  z-index: 1;
  margin-top: 4px;
}
.comp-group-header:first-child { margin-top: 0; }

.comp-group-header.earn    { color: var(--green,  #0F6E56); background: #E1F5EE; }
.comp-group-header.deduct  { color: var(--amber,  #854F0B); background: #FAEEDA; }
.comp-group-header.employer{ color: var(--purple, #3C3489); background: #EEEDFE; }
} */
.fb-left .comp-group-header{
    background-color: #EFF4F9;
    padding: 7px 13px 7px;
}
.preview-heading.earn{
    color: var(--green,  #0F6E56);
}
.preview-heading.deduct{
    color: var(--amber,  #ED546B);
}
.preview-heading.employer{
    color: var(--purple, #3C3489);
}
.comp-group-header {
    opacity: 1;
}
.preview-total-row.preview-heading {
    opacity: 1 !important;
}
/* .comp-group-header.preview-heading {
    opacity: 50%;
} */
.row-reverse{
    flex-direction: row-reverse;
}
.rule-row .rule-sel {
    padding: 0;
    border: none;
    background: transparent;
    min-width: auto;
    width: 100%;
}
.rule-conds>.rule-row:last-child .then-row {
    flex: 0 0 auto;
}
.rule-row .select2-container .select2-choice>.select2-chosen{
    margin-right: 45px;
}
#slab-type-calc-mode-toggle:checked + span>#slab-calc-mode-knob {
    right: 3px;
    left: auto !important;
}
#slab-type-calc-mode-toggle:checked + span { 
    background: #585859 !important; 
}
#slab-type-calc-mode-toggle:checked + span #slab-calc-mode-knob { 
    transform: translateX(20px); 
}
.justify-content-unset{
    justify-content: unset !important;
}
.panel-header.justify-content-unset {
    padding: 7px 15px;
}
.strt-end-date .input {
    background-color: #FFFFFF;
}
.new-slab {
    background-color: #E4E4E4 !important;
    width: 32px !important;
    min-width: 32px;
}
.new-slab .mkr-plus:before {
    color: #ADB0B4;
}
.text-right{
    text-align: right !important;
}
.text-left{
    text-align: left !important;
}
.text-center{
    text-align: center !important;
}
.add-slab-row.new-slab {
    margin-left: auto;
}
.plus-btn{
    border: 1px solid #BFCFD9 !important;
    border-radius: 10px !important;
    background: #eff4f9 !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0;
    justify-content: center;
}
.plus-btn .mkr:before {
    font-size: 17px;
    color: #ADB0B4;
}
#rule-list {
    max-height: calc(100vh - 153px);
    overflow: hidden auto;
}
.elseif-btn {
    background-color: #DAD9FD;
    border-color: #DAD9FD;
    border-radius: 10px;
    color: #837FF7;
    font-weight: 600;
    font-size: 14px;
}
.slab-type-tab.active .slab-mode-badge {
    color: #fff !important;
}
#doc-content {
    max-height: calc(100dvh - 220px);
    overflow: hidden auto;
}
#doc-content>.doc-section {
    background: var(--surface);
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.rule-word {
    flex: 0 0 auto;
}
.rule-conds>.rule-row>div {
    flex: 1;
}
.select2-field {
    min-width: 0;
    flex: 1;
}
.fake-btn {
    cursor: unset;
}
.formField-ui .inputElement,
.formField-ui textarea,
.formField-ui .select2-choices{
    border: 1px solid #bfcfd9 !important;
    border-radius: 10px !important;
    background-color: #eff4f9;
    width: 100%;
    background-image: none;
}
.formField-ui .select2-container .select2-choice{
    border-radius: 10px;
    background-color: #eff4f9 !important;
}
.formField-ui .inputElement{
    height: 30px !important;
}
.formField-ui .select2-choices{
    min-height: 30px;
}
.formField-ui .select2-choices .select2-search-choice {
    background-color: #585859;
    border-radius: 10px;
    padding: 5px 25px 5px 10px !important;
    background-image: none;
    border: none;
    box-shadow: none;
}
.formField-ui .select2-choices .select2-search-choice>div {
    color: #fff;
}
.formField-ui .select2-choices .select2-search-choice .select2-search-choice-close:after {
    content: "\edbd";
    font-family: 'mkr';
    color: #fff;
    font-size: 10px;
    line-height: 1.6;
}
.formField-ui .select2-choices .select2-search-choice .select2-search-choice-close {
    background: none;
    left: auto;
    right: 6px;
}
.formField-ui .select2-container-multi.select2-container-active .select2-choices {
    box-shadow: none;
}
/* ── Audit Trail listing — white background + breathing room between rows ──
   #audit-list's rows are rendered by JS (renderAuditTab()/loadAuditTrail()).
   Covers BOTH possible structures it might render:
   1) A real <table> — the common case, matches the column-aligned screenshot.
   2) Plain div rows as direct children of #audit-list.
   Whichever one doesn't apply just matches nothing — harmless. */
#audit-list {
    background: var(--surface, #ffffff);
    padding: 4px 0px 16px;
    font-size: 13.5px;
}

/* Case 1: table-based rows */
#audit-list table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px; /* horizontal 0, vertical 10px = gap between rows + a bit of bottom margin after the last row */
}
#audit-list table thead th,
.formula-table thead th {
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: #ADB0B4;
    padding: 10px 14px;
    white-space: nowrap;
    position: relative;
    overflow: visible;
}

/* ── Audit Trail — click-a-header-to-filter popovers ─────────────────────── */
.audit-th-filterable {
    cursor: pointer;
    user-select: none;
}
.audit-th-filterable:hover {
    color: var(--accent, #4f8ef7);
}
.audit-th-filtered::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 6px;
    border-radius: 50%;
    background: var(--accent, #4f8ef7);
    vertical-align: middle;
}
.audit-th-filter-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    background: #ffffff;
    border: 1px solid var(--border, #E5EBEE);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(20, 20, 43, 0.14);
    padding: 10px;
    min-width: 190px;
    z-index: 6;
    cursor: default;
}
.audit-th-filter-panel.open {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.audit-th-filter-input {
    width: 100%;
    padding: 7px 9px;
    font-size: 13px;
    font-weight: 400;
    text-transform: none;
    font-family: var(--sans);
    color: var(--text);
    background: var(--s3, #f5f6fa);
    border: 1px solid var(--border, #E5EBEE);
    border-radius: 6px;
    outline: none;
}
.audit-th-filter-input:focus {
    border-color: var(--accent, #4f8ef7);
}
.audit-th-filter-clear {
    align-self: flex-end;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    padding: 2px 4px;
}
.audit-th-filter-clear:hover {
    color: var(--red, #EF536A);
}
#audit-list table tbody tr {
    background: #ffffff;
}
#audit-list table tbody td {
    background: #ffffff;
    padding: 13px 14px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text);
}
/*#audit-list table tbody td:first-child {
    border-left: 1px solid var(--border, #E5EBEE);
    border-radius: 8px 0 0 8px;
}
#audit-list table tbody td:last-child {
    border-right: 1px solid var(--border, #E5EBEE);
    border-radius: 0 8px 8px 0;
}
#audit-list table tbody tr:hover td {
    box-shadow: 0 2px 10px rgba(20, 20, 43, 0.08);
}*/

/* Case 2: div-based rows (direct children of #audit-list, no wrapping table) */
#audit-list > *:not(table) {
    background: #ffffff;
    margin-bottom: 10px;
    padding: 12px 14px;
    font-size: 13.5px;
    border-radius: 8px;
    border: 1px solid var(--border, #E5EBEE);
    transition: box-shadow .15s ease;
}
#audit-list > *:not(table):last-child {
    margin-bottom: 16px;
}
#audit-list > *:not(table):hover {
    box-shadow: 0 2px 10px rgba(20, 20, 43, 0.08);
}
.formula-table tbody td {
    font-size: 14px !important;
    padding: 10px 14px !important;
}
.formula-table thead th:first-child {
    width: 22%;
}
.formula-table{
    table-layout: fixed;
}
#audit-detail-body {
    max-height: calc(100dvh - 285px);
}
.formula-table tbody tr:last-child td {
    border-bottom: none !important;
}
/* Formula source tabs (Employee / Payroll / Component / Summary) —
   each one its own little pill button (same recipe as .mtab: light-blue
   fill + border, dark fill when active) instead of a plain underline,
   so it matches the app's rounded button theme. */
.inner-tabs {
    border-bottom: none;
    gap: 7px;
}
.inner-tabs .inner-mtab {
    background: #eff4f9 !important;
    border: 1px solid #bfcfd9 !important;
    box-shadow: 0 2px 3px 0 #5F7CB814;
    padding: 5px 13px;
    border-radius: 8px !important;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    line-height: 1;
    height: auto;
    transition: all .15s ease;
}
.inner-tabs .inner-mtab:hover {
    color: var(--accent);
    border-color: var(--accent) !important;
}
.inner-tabs .inner-mtab.active {
    background: #585859 !important;
    border-color: #585859 !important;
    color: #fff;
    font-weight: 600;
    box-shadow: none;
    border-bottom: 1px solid #585859 !important;
}
@media (width < 1700px){
    .mtab{
        font-size: 14px;
    }
}