:root {
    --bs-body-font-family: Arial, sans-serif;
    --bs-btn-font-family: Arial, sans-serif;
}

body,
button,
input,
select,
textarea,
.nk-menu,
.nk-header,
.dropdown-menu,
.btn,
.form-control {
    font-family: Arial, sans-serif !important;
}

/* DashLite assigns Nunito directly to headings, so inheritence from body alone
   is not enough to keep the project typography consistently Arial. */
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    font-family: Arial, sans-serif !important;
}

/* Day-mode content colours: primary data and labels are black; supporting
   descriptions and help text retain DashLite's soft text treatment. */
body:not(.dark-mode) .form-label,
body:not(.dark-mode) .nk-content .table th,
body:not(.dark-mode) .nk-content .table td,
body:not(.dark-mode) .nk-content .nk-tb-list,
body:not(.dark-mode) .nk-content .nk-tb-list .nk-tb-col,
body:not(.dark-mode) .nk-content .nk-tb-list .tb-amount span,
body:not(.dark-mode) .nk-content .nk-tb-list .tb-amount .currency {
    color: #000 !important;
}

body:not(.dark-mode) .text-soft,
body:not(.dark-mode) .nk-content .nk-block-des,
body:not(.dark-mode) .nk-content .nk-tb-list .tb-sub,
body:not(.dark-mode) .form-note {
    color: #8094ae !important;
}

.user-username-note {
    font-size: 0.7rem;
    white-space: nowrap;
}

.management-table .nk-tb-head .nk-tb-col {
    padding-bottom: 0.85rem;
    padding-top: 0.85rem;
    white-space: nowrap;
}

.management-table .nk-tb-head {
    background-color: #e8ebff;
}

.management-table .nk-tb-head .nk-tb-col,
.management-table .nk-tb-head .nk-tb-col span,
body:not(.dark-mode) .nk-content .management-table .nk-tb-head .nk-tb-col,
body:not(.dark-mode) .nk-content .management-table .nk-tb-head .nk-tb-col span {
    color: #000 !important;
    font-weight: 600;
}

.management-table .nk-tb-head .nk-tb-col:not(:last-child) {
    border-right-color: #cfd5f6;
}

.dark-mode .management-table .nk-tb-head {
    background-color: #242a35;
}

.dark-mode .management-table .nk-tb-head .nk-tb-col,
.dark-mode .management-table .nk-tb-head .nk-tb-col span {
    color: #fff !important;
}

.dark-mode .management-table .nk-tb-head .nk-tb-col:not(:last-child) {
    border-right-color: #1d2d40 !important;
}

.dark-mode .management-table .nk-tb-item:not(.nk-tb-head) .nk-tb-col:not(:last-child) {
    border-right-color: #1d2d40 !important;
}

.management-table .nk-tb-item:not(.nk-tb-head) .nk-tb-col {
    padding-bottom: 0.65rem;
    padding-top: 0.65rem;
}

.management-table .nk-tb-col:not(:last-child) {
    border-right: 1px solid #dbdfea;
}

/* Keep the inline Category form action equal to DashLite's standard input
   height. The explicit sizing also prevents flexbox from collapsing it. */
.category-form-actions {
    min-height: 36px;
}

.category-form-actions .category-form-submit {
    min-height: 36px;
}

/* Keep PHPFlasher's standard Toastr notification separate from DashLite's
   full-width Toastr container styles. */
#toast-container.toast-bottom-right {
    bottom: 1.5rem;
    left: auto;
    padding: 0;
    right: 1.5rem;
    width: auto;
}

#toast-container.toast-bottom-right > .toast {
    margin-left: auto;
    margin-right: 0;
}

/* Keep PHPFlasher Toastr's original semantic palette in either application
   theme. DashLite's dark-mode toast rules must not alter notification meaning. */
#toast-container > .toast-success {
    background-color: #51a351 !important;
    color: #fff !important;
}

#toast-container > .toast-error {
    background-color: #bd362f !important;
    color: #fff !important;
}

#toast-container > .toast-info {
    background-color: #2f96b4 !important;
    color: #fff !important;
}

#toast-container > .toast-warning {
    background-color: #f89406 !important;
    color: #fff !important;
}

#toast-container > .toast-success *,
#toast-container > .toast-error *,
#toast-container > .toast-info *,
#toast-container > .toast-warning * {
    color: inherit !important;
}

#toast-container > .toast .toast-progress {
    background-color: rgba(0, 0, 0, 0.25) !important;
}

.account-empty-state {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 7rem;
    padding: 1.5rem;
    text-align: center;
    white-space: nowrap;
}

/* Level 3 accounts has several reference columns. Keep the desktop table
   inside its card and reserve predictable space for each field. */
.accounts-table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
}

.accounts-table {
    table-layout: fixed;
}

.accounts-table .nk-tb-col:nth-child(1) {
    width: 6.5%;
}

.accounts-table .nk-tb-col:nth-child(2) {
    width: 6%;
}

.accounts-table .nk-tb-col:nth-child(3) {
    width: 16%;
}

.accounts-table .nk-tb-col:nth-child(4) {
    width: 14%;
}

.accounts-table .nk-tb-col:nth-child(5) {
    width: 12%;
}

.accounts-table .nk-tb-col:nth-child(6) {
    width: 16%;
}

.accounts-table .nk-tb-col:nth-child(7) {
    width: 20%;
}

.accounts-table .nk-tb-col:nth-child(8) {
    max-width: none;
    width: 9.5%;
}

.accounts-table .nk-tb-col-check {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

.accounts-table .nk-tb-col > span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.accounts-table .nk-tb-col-tools .nk-tb-actions {
    overflow: hidden;
}

/* Preserve each responsive table's columns on smaller screens. DashLite's
   native table-responsive wrapper scrolls inside the card, never the page. */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.categories-table {
    min-width: 0;
    table-layout: fixed;
}

.categories-table .nk-tb-col:nth-child(1) {
    width: 12%;
}

.categories-table .nk-tb-col:nth-child(2) {
    width: 42%;
}

.categories-table .nk-tb-col:nth-child(3) {
    width: 46%;
}

.categories-table .nk-tb-actions {
    gap: 0.25rem;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
}

.categories-table .nk-tb-actions > li {
    margin: 0 !important;
}

.categories-table .nk-tb-col-tools .btn {
    gap: 0.2rem;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
}

.categories-table .nk-tb-col-tools .btn .icon,
.categories-table .nk-tb-col-tools .btn .icon + span {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.account-types-table {
    min-width: 680px;
}

.account-heads-table {
    min-width: 800px;
}

.accounts-table {
    min-width: 1050px;
}

.inventory-table {
    min-width: 0;
    table-layout: fixed;
    width: 100%;
}

.inventory-table .nk-tb-col:nth-child(1) {
    width: 6%;
}

.inventory-table .nk-tb-col:nth-child(2) {
    width: 10%;
}

.inventory-table .nk-tb-col:nth-child(3) {
    width: 18%;
}

.inventory-table .nk-tb-col:nth-child(4) {
    width: 10%;
}

.inventory-table .nk-tb-col:nth-child(5) {
    width: 15%;
}

.inventory-table .nk-tb-col:nth-child(6),
.inventory-table .nk-tb-col:nth-child(7),
.inventory-table .nk-tb-col:nth-child(8) {
    width: 8%;
}

.inventory-table .nk-tb-col:nth-child(9) {
    width: 17%;
}

.inventory-table .nk-tb-col > span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inventory-search-form {
    align-items: center;
    display: flex;
    justify-content: flex-end;
}

.inventory-search-form .form-control-wrap {
    width: min(100%, 22rem);
}

.inventory-table .nk-tb-col {
    min-width: 0;
}

.inventory-table .nk-tb-col-tools .nk-tb-actions {
    flex-wrap: nowrap;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
}

.inventory-table .nk-tb-col-tools .nk-tb-actions > li {
    margin: 0 !important;
}

.inventory-table .nk-tb-col-tools .btn {
    gap: 0.2rem;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
}

.inventory-table .nk-tb-col-tools .btn .icon,
.inventory-table .nk-tb-col-tools .btn .icon + span {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.businesses-table,
.users-table {
    min-width: 850px;
}

@media (max-width: 575.98px) {
    /* DashLite's card-stretch expands cards with negative side margins on
       desktop. Keep cards inside the content column on phone screens. */
    .nk-block > .card.card-stretch {
        margin-left: 0;
        margin-right: 0;
    }

    .nk-block-head .nk-block-between {
        align-items: flex-start;
        flex-direction: column;
        gap: 1rem;
    }

    .nk-block-head .nk-block-head-content:last-child,
    .nk-block-head .nk-block-head-content:last-child > .btn {
        width: 100%;
    }

    .inventory-table .nk-tb-col {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .inventory-table .nk-tb-col-tools .btn {
        font-size: 0.72rem;
        padding: 0.38rem;
    }

    #toast-container.toast-bottom-right {
        left: 0.75rem;
        right: 0.75rem;
    }

    #toast-container.toast-bottom-right > .toast {
        margin-left: 0;
        max-width: 100%;
        width: 100%;
    }
}

@media (min-width: 992px) {
    .nk-header-tools .settings-dropdown {
        padding: 0 2rem;
    }

    .nk-header-tools .settings-nav-link {
        color: #dfe4ff;
        font-size: 14px;
        font-weight: 500;
        letter-spacing: 0;
        padding: 1.25rem 0;
    }

    .nk-header-tools .settings-nav-link:hover,
    .nk-header-tools .settings-nav-link:focus {
        color: #fff;
    }

    .nk-header-tools .settings-nav-link.nk-menu-toggle:after {
        color: rgba(196, 206, 254, 0.7);
        content: "\e9c5";
        font-size: 0.8rem;
        position: static;
        display: inline-flex;
        margin-left: 0.5rem;
        margin-right: -2px;
        margin-top: -1px;
        transform: none;
        vertical-align: middle;
    }

    .settings-dropdown:not(.business-switcher) > .settings-menu.dropdown-menu-md {
        max-width: 225px;
        min-width: 225px;
    }
}

.settings-menu .dropdown-inner {
    padding: 0.35rem 0;
}

.settings-menu-list {
    padding: 0;
    margin: 0;
}

.settings-menu-list a {
    display: flex;
    align-items: center;
    padding: 0.55rem 1.5rem;
    font-weight: 500;
    color: #526484;
    line-height: 1.3rem;
}

.settings-menu-list .business-switch-option {
    align-items: center;
    background: transparent;
    border: 0;
    color: #526484;
    display: flex;
    font-weight: 500;
    line-height: 1.3rem;
    padding: 0.55rem 1.5rem;
    text-align: left;
    width: 100%;
}

.settings-menu-list .business-switch-option:hover,
.settings-menu-list .business-switch-option.active {
    color: #6576ff;
}

.settings-menu-list .business-switch-option .icon {
    color: #8094ae;
    font-size: 1.05rem;
    margin-right: 0.4rem;
    opacity: 0.8;
    width: 1.45rem;
}

.settings-menu-list a .icon {
    width: 1.45rem;
    margin-right: 0.4rem;
    color: #8094ae;
    font-size: 1.05rem;
    opacity: 0.8;
}

.settings-menu-list a:hover,
.settings-menu-list a:focus,
.settings-menu-list .business-switch-option:hover,
.settings-menu-list .business-switch-option:focus {
    background-color: #6576ff;
    color: #fff;
    outline: 0;
}

.settings-menu-list a:hover .icon,
.settings-menu-list a:focus .icon,
.settings-menu-list .business-switch-option:hover .icon,
.settings-menu-list .business-switch-option:focus .icon {
    color: #fff;
}

.dark-mode .settings-menu-list a,
.dark-mode .settings-menu-list a .icon {
    color: #fff;
}

.business-selection-page {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 145px);
    padding: 2rem 0;
}

.business-selection-panel {
    max-width: 440px;
    width: 100%;
}

.business-selection-icon {
    align-items: center;
    background: rgba(101, 118, 255, 0.12);
    border-radius: 50%;
    color: #6576ff;
    display: flex;
    font-size: 2rem;
    height: 72px;
    justify-content: center;
    width: 72px;
}

.theme-mode-switch {
    align-items: center;
    display: flex !important;
    padding-right: 5rem !important;
}

.theme-mode-switch.dark-switch:before {
    right: 1.5rem;
}

.theme-mode-switch.dark-switch:after {
    content: "" !important;
    font-family: inherit;
    font-size: 0;
    right: calc(3.5rem - 2px - 0.125rem);
}

.theme-mode-switch.dark-switch.active:after {
    right: calc(1.5rem + 2px + 0.125rem);
}

@media (max-width: 575.98px) {
    .business-selection-page {
        align-items: flex-start;
        min-height: auto;
        padding-top: 1rem;
    }

    .accounts-level-three-page .nk-block-between {
        align-items: flex-start;
        flex-direction: column;
        gap: 1rem;
    }

    .accounts-level-three-page .nk-block-head-content:last-child,
    .accounts-level-three-page .nk-block-head-content:last-child .btn {
        width: 100%;
    }
}
