:root {
    --ink: #0E2B30;
    --ink-2: #163A40;
    --ink-text: #B9CDD0;
    --ink-line: rgba(255, 255, 255, .08);
    --teal: #0F8B8D;
    --teal-soft: #E3F2F2;
    --stamp: #E8A33D;
    --bg: #EEF2F2;
    --panel: #fff;
    --line: #DCE4E4;
    --text: #18292C;
    --muted: #64797C;
    --radius: 10px;
    --side-w: 248px;
    --side-w-mini: 72px;
    --top-h: 60px;
}

html,
body {
    height: 100%
}

body {
    background: var(--bg) !important;
    /* color: var(--text); */
    font-size: 14px
}

table td,
table th {
    font-variant-numeric: tabular-nums
}

h1,
h2,
h3 {
    font-weight: 600;
    letter-spacing: -.01em
}

/* ---------- shell ---------- */
.app {
    display: flex;
    min-height: 100vh
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--side-w);
    background: var(--ink);
    color: var(--ink-text);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width .2s ease, transform .2s ease
}

.app-main {
    margin-left: var(--side-w);
    flex: 1;
    min-width: 0;
    transition: margin .2s ease;
    display: flex;
    flex-direction: column
}

.side-brand {
    height: var(--top-h);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 18px;
    border-bottom: 1px solid var(--ink-line)
}

.side-brand img {
    height: 54px;
    max-width: 100%;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    padding: 3px
}

.side-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--ink-2) transparent
}

.side-group {
    padding: 14px 10px 6px;
    font-size: 12px;
    font-weight: 600;
    color: #6E8D92;
    white-space: nowrap
}

.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    margin: 2px 0;
    border-radius: 8px;
    color: var(--ink-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 13.5px;
    position: relative;
    white-space: nowrap
}

.side-link i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    opacity: .85
}

.side-link:hover {
    background: var(--ink-2);
    color: #fff;
    text-decoration: none
}

.side-link.active {
    background: var(--ink-2);
    color: #fff
}

.side-link.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--stamp)
}

.side-foot {
    padding: 12px 18px;
    border-top: 1px solid var(--ink-line);
    font-size: 12px;
    color: #6E8D92;
    white-space: nowrap
}

body.ui-collapsed .app-sidebar {
    width: var(--side-w-mini)
}

body.ui-collapsed .app-main {
    margin-left: var(--side-w-mini)
}

body.ui-collapsed .side-link span,
body.ui-collapsed .side-group,
body.ui-collapsed .side-foot {
    display: none
}

body.ui-collapsed .side-link {
    justify-content: center
}

.app-top {
    height: var(--top-h);
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1030
}

.top-toggle {
    border: 1px solid var(--line);
    background: #fff;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: var(--text);
    cursor: pointer
}

.top-toggle:hover {
    background: var(--teal-soft);
    border-color: var(--teal)
}

.top-title {
    font-weight: 700;
    font-size: 16px;
    margin: 0
}

.top-user {
    margin-left: auto;
    position: relative
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: 0;
    padding: 4px 6px;
    border-radius: 999px;
    cursor: pointer;
    color: var(--text);
    font-weight: 500
}

.user-btn:hover {
    background: var(--bg)
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--teal-soft) center/cover no-repeat;
    border: 2px solid var(--teal-soft);
    display: grid;
    place-items: center;
    color: var(--teal)
}

.user-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 230px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(14, 43, 48, .14);
    padding: 6px;
    z-index: 1050
}

.top-user.open .user-menu {
    display: block
}

.user-menu a,
.user-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    background: none;
    border-radius: 8px;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 400;
    text-align: left;
    text-decoration: none;
    cursor: pointer
}

.user-menu a:hover,
.user-menu button:hover {
    background: var(--bg);
    text-decoration: none
}

.user-menu .danger {
    color: #B42318
}

.user-menu hr {
    margin: 6px 0;
    border-color: var(--line)
}

.app-content {
    padding: 20px;
    flex: 1
}

.app-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    min-height: calc(100vh - var(--top-h) - 40px)
}

.app-scrim {
    display: none
}

/* ---------- controls & tables (override legacy) ---------- */
.br-20 {
    border-radius: var(--radius) !important
}

.btn {
    border-radius: 8px;
    font-weight: 500
}

.btn-primary {
    background: var(--teal);
    border-color: var(--teal)
}

.btn-primary:hover {
    background: #0B6F71;
    border-color: #0B6F71
}

.btn-outline-primary {
    color: var(--teal);
    border-color: var(--teal)
}

.btn-outline-primary:hover {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff
}

.form-control,
.form-select {
    border-radius: 8px;
    border-color: var(--line)
}

.form-control:focus,
.form-select:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(15, 139, 141, .15)
}

.select2-container .select2-selection--single {
    border-radius: 8px !important;
    border-color: var(--line) !important
}

table.dataTable thead th,
.QA_section .QA_table .table thead th {
    background: var(--ink) !important;
    color: #fff !important;
    font-weight: 600;
    font-size: 12.5px;
    border: 0
}

table.dataTable thead th:first-child {
    border-radius: 8px 0 0 8px
}

table.dataTable thead th:last-child {
    border-radius: 0 8px 8px 0
}

table.dataTable tbody tr:hover {
    background: #F6FAFA
}

table.dataTable tbody td {
    border-bottom: 1px solid var(--line);
    font-size: 13px
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--line) !important;
    border-radius: 8px !important
}

.dataTables_paginate a {
    border: 1px solid var(--line) !important;
    border-radius: 8px !important
}

.dataTables_paginate a.current,
.dataTables_paginate a:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--teal) !important;
    border-color: var(--teal) !important;
    color: #fff !important;
    box-shadow: none !important
}

.modal-content {
    border: 0;
    border-radius: 14px !important;
    box-shadow: 0 24px 60px rgba(14, 43, 48, .25)
}

.swal2-popup {
    border-radius: 14px !important
}

.swal2-styled.swal2-confirm {
    background: var(--teal) !important
}

/* ---------- responsive ---------- */
@media (max-width:991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        width: var(--side-w) !important
    }

    .app-main,
    body.ui-collapsed .app-main {
        margin-left: 0
    }

    body.ui-open .app-sidebar {
        transform: none
    }

    body.ui-open .app-scrim {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(14, 43, 48, .5);
        z-index: 1035
    }

    body.ui-collapsed .side-link span,
    body.ui-collapsed .side-group,
    body.ui-collapsed .side-foot {
        display: revert
    }

    body.ui-collapsed .side-link {
        justify-content: flex-start
    }

    .app-content {
        padding: 12px
    }

    .app-panel {
        padding: 14px
    }

    .user-name {
        display: none
    }
}

@media (prefers-reduced-motion:reduce) {
    * {
        transition: none !important
    }
}

:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px
}

/* admin pages bring their own white cards, so the admin shell has no extra panel */
.app-content>.barba-container {
    width: 100%
}

.app-content .bg-white.br-20.border {
    border-color: var(--line) !important
}

.app-content hr {
    border-color: var(--line);
    opacity: 1
}

/* neutralise legacy layout rules (css.css) that caused an inner scroll box / sideways overflow */
#wrapper,
#page-content-wrapper {
    height: auto !important;
    min-width: 0 !important;
    overflow: visible !important
}

html,
body {
    overflow-x: hidden
}

.main-data {
    height: auto !important;
    overflow: visible !important
}

.app-main {
    width: calc(100% - var(--side-w))
}

body.ui-collapsed .app-main {
    width: calc(100% - var(--side-w-mini))
}

@media (max-width:991.98px) {

    .app-main,
    body.ui-collapsed .app-main {
        width: 100%
    }
}


/* Main Button Base Styling */
.button2 {
    background-color: #ffffff !important;
    border: 1px solid var(--line);
    border-radius: var(--radius) !important;
    /* Uses standard 10px rounded corner */
    color: var(--text) !important;
    text-decoration: none !important;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(14, 43, 48, 0.04);
}

.button2:hover {
    background-color: var(--teal-soft) !important;
    border-color: var(--teal);
    color: var(--ink) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 139, 141, 0.12);
}

.button2:hover i {
    color: var(--teal) !important;
}

/* Icon & Text Adjustments Inside .button2 */
.button2 i {
    color: var(--muted);
    transition: color 0.2s ease;
    width: 32px;
    text-align: center;
}

.button2 .btnText,
.button2 p {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

/* Active State (.activeformBtn) */
.activeformBtn {
    background-color: var(--ink) !important;
    border-color: var(--ink) !important;
    color: #ffffff !important;
    position: relative;
    box-shadow: 0 4px 12px rgba(14, 43, 48, 0.18);
}

.activeformBtn .btnText,
.activeformBtn p,
.activeformBtn i {
    color: #ffffff !important;
}

/* Accent Indicator Bar on Active State */
.activeformBtn::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12%;
    bottom: 12%;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--stamp);
}

/* Layout Adjustments for Button Grid Container */
.btns .col-12 {
    margin-bottom: 0;
}





/* ==========================================================================
   Borders & Upload Containers (Dashed / Dotted)
   ========================================================================== */
/* Company Logo Container (Dashed Border) */
.company .company-logo {
    width: 100%;
    height: 200px;
    border: dashed 1px #007ae1;
}

.company .company-logo img {
    height: 80px;
}

/* Repeatable Invoice Container (Dotted Border) */
.invoicerepeat {
    border: 1px dotted #007ae1;
}

/* Hover Upload Overlay Style */
.upload-icn {
    width: 100%;
    height: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    background-color: #00c3ff7a;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: .3s;
    cursor: pointer;
}

.upload-icn:hover {
    opacity: 1;
}

.upload-icn i {
    font-size: 2.5rem;
    color: #fff;
    user-select: none;
    cursor: pointer;
    padding: 20px;
    border-radius: 50%;
}

.upload-icn i:hover {
    color: var(--primary);
}


/* ==========================================================================
   Profile Avatar & Circle Utilities
   ========================================================================== */
.account-settings .user-profile {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

.account-settings .user-avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    background-image: url(../img/u/bg-icon.png);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border: 2px var(--primary) solid;
}

.account-settings .user-avatar img {
    height: 100%;
    background-color: #e9ecef;
}

.icn-bg {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #f3f6f9;
    display: flex;
    justify-content: center;
    align-items: center;
}




@media (max-width: 575.98px) {

    .button2 .btnText,
    .button2 p {
        font-size: 10px;
    }



    .fa-2x {
        font-size: .8em;
    }

    div#print,
    #myTable_wrapper {
        zoom: 80%;
    }

    #dataTables_wrapper,
    .dataTables_wrapper,
    table {
        overflow: scroll;
    }

    body {
        zoom: 70% !important;
    }

    .dataTables_wrapper .dataTables_length {
        float: left;

        text-align: start;
    }

    .dataTables_wrapper .dataTables_filter {
        float: right;
        margin-bottom: 4px;
        text-align: end;
    }
}



/* ---------- print overrides ---------- */
@media print {

    html,
    body {
        overflow: visible !important;
        height: auto !important;
        background: #fff !important;
        zoom: 80%;
    }

    .app-sidebar,
    .app-top,
    .app-scrim,
    .noPrint,
    .btn-primary {
        display: none !important;
    }

    .app-main {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .app-content {
        padding: 0 !important;
    }

    .app-panel {
        border: 0 !important;
        padding: 0 !important;
        min-height: auto !important;
        box-shadow: none !important;
    }

    .pwa-banner {
        display: none !important;
    }
}


/* ---------- pwa install banner ---------- */
.pwa-banner {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1060;
    width: calc(100% - 32px);
    max-width: 420px;
}

.pwa-banner-inner {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(14, 43, 48, .18);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}