@font-face {
    font-family: "HK Grotesk";
    font-style: normal;
    font-weight: 400;
    src: url("../fonts/hkgrotesk-regular.woff2") format("woff2");
}

@font-face {
    font-family: "HK Grotesk";
    font-style: normal;
    font-weight: 500;
    src: url("../fonts/hkgrotesk-medium.woff2") format("woff2");
}

@font-face {
    font-family: "HK Grotesk";
    font-style: normal;
    font-weight: 600;
    src: url("../fonts/hkgrotesk-semibold.woff2") format("woff2");
}

@font-face {
    font-family: "HK Grotesk";
    font-style: normal;
    font-weight: 700;
    src: url("../fonts/hkgrotesk-bold.woff2") format("woff2");
}

body {
    background: #f3f6f9;
    color: #212529;
    font-family: "HK Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: .92rem;
}

.app-loading-overlay {
    align-items: center;
    background: rgba(243, 246, 249, .78);
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 3000;
}

.app-loading-box {
    align-items: center;
    background: #fff;
    border: 1px solid #e9ebec;
    border-radius: 4px;
    box-shadow: 0 10px 28px rgba(15, 34, 58, .16);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: min(368px, calc(100vw - 32px));
    padding: 24px;
    text-align: center;
}

.app-loading-box strong {
    color: #1f2937;
    font-size: .95rem;
    font-weight: 700;
}

.app-loading-box span {
    color: #667085;
    font-size: .9rem;
}

.app-loading-spinner {
    animation: appLoadingSpin .75s linear infinite;
    border: 3px solid #e9ebec;
    border-radius: 50%;
    border-top-color: #0ab39c;
    height: 38px;
    width: 38px;
}

@keyframes appLoadingSpin {
    to {
        transform: rotate(360deg);
    }
}

html[data-layout-width="fluid"] .container-fluid {
    max-width: none;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    width: 100%;
}

.layout-wrapper {
    min-height: 100vh;
}

.app-sidebar {
    background: #fff;
    bottom: 0;
    border-right: 1px solid #e9ebec;
    color: #6d7080;
    left: 0;
    position: fixed;
    top: 0;
    width: 240px;
    z-index: 1040;
}

.template-fluid .app-sidebar {
    box-shadow: 0 2px 4px rgba(15, 34, 58, .08);
}

.sidebar-brand {
    align-items: center;
    border-bottom: 1px solid #e9ebec;
    display: flex;
    min-height: 70px;
    justify-content: center;
    padding: 0 20px;
}

.sidebar-brand a {
    align-items: center;
    color: #212529;
    display: flex;
    text-decoration: none;
    width: 100%;
}

.sidebar-logo {
    display: block;
    height: auto;
    max-height: 38px;
    max-width: 168px;
    object-fit: contain;
    width: auto;
}

.sidebar-nav {
    height: calc(100vh - 70px);
    overflow-y: auto;
    padding: 16px 10px 26px;
}

.nav-section {
    color: #98a2b3;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .05em;
    margin: 14px 0 8px;
    text-transform: uppercase;
}

.menu-group {
    margin-bottom: 2px;
}

.side-menu-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 4px;
    color: #6d7080;
    display: flex;
    font: inherit;
    font-size: .94rem;
    font-weight: 500;
    justify-content: space-between;
    min-height: 39px;
    padding: 9px 10px;
    text-align: left;
    transition: color .15s ease, background-color .15s ease;
    width: 100%;
}

.side-menu-toggle .menu-title {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.side-menu-toggle i:first-child {
    color: #6d7080;
    font-size: 1.1rem;
    min-width: 20px;
    transition: color .15s ease;
}

.side-menu-toggle:hover,
.side-menu-toggle:focus {
    background: #f3f6f9;
    color: #299cdb;
}

.side-menu-toggle:hover i,
.side-menu-toggle:focus i {
    color: #299cdb;
}

.menu-arrow {
    color: #878a99;
    font-size: 1rem;
    margin-left: 8px;
    transition: transform .18s ease, color .15s ease;
}

.side-menu-toggle[aria-expanded="false"] .menu-arrow {
    transform: rotate(-90deg);
}

.submenu {
    margin: 0 0 4px 30px;
}

.submenu.is-hidden {
    display: none;
}

.submenu .side-link {
    color: #6d7080;
    font-size: .9rem;
    min-height: 34px;
    padding: 7px 10px;
    position: relative;
}

.submenu .side-link::before {
    color: #adb5bd;
    content: "-";
    left: -14px;
    position: absolute;
}

.submenu .side-link.is-active {
    color: #299cdb;
}

.side-link {
    align-items: center;
    border-radius: 4px;
    color: #6d7080;
    display: flex;
    font-size: .94rem;
    font-weight: 500;
    gap: 12px;
    min-height: 39px;
    padding: 9px 10px;
    text-decoration: none;
    transition: color .15s ease, background-color .15s ease;
}

.side-link i {
    color: #6d7080;
    font-size: 1.1rem;
    min-width: 20px;
    transition: color .15s ease;
}

.side-link:hover,
.side-link:focus {
    background: #f3f6f9;
    color: #299cdb;
}

.side-link:hover i,
.side-link:focus i {
    color: #299cdb;
}

.main-content {
    margin-left: 240px;
    min-height: 100vh;
    transition: margin-left .18s ease;
}

body.sidebar-collapsed .app-sidebar {
    width: 70px;
}

body.sidebar-collapsed .main-content {
    margin-left: 70px;
}

body.sidebar-collapsed .sidebar-brand {
    padding: 0 12px;
}

body.sidebar-collapsed .sidebar-logo {
    max-height: 34px;
    max-width: 46px;
    object-fit: cover;
    object-position: left center;
}

body.sidebar-collapsed .nav-section,
body.sidebar-collapsed .side-menu-toggle .menu-title span,
body.sidebar-collapsed .side-link span,
body.sidebar-collapsed .menu-arrow {
    display: none;
}

body.sidebar-collapsed .sidebar-nav {
    padding-left: 10px;
    padding-right: 10px;
}

body.sidebar-collapsed .side-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed .submenu {
    display: none;
}

body.sidebar-collapsed .side-menu-toggle {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed .side-menu-toggle i:first-child {
    min-width: 0;
}

body.sidebar-collapsed .side-link i {
    min-width: 0;
}

.app-topbar {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #e9ebec;
    display: flex;
    height: 70px;
    justify-content: space-between;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.app-topbar .layout-width {
    align-items: center;
    display: flex;
    height: 70px;
    justify-content: space-between;
    padding-left: 18px;
    width: 100%;
}

.topbar-left,
.topbar-actions {
    align-items: center;
    display: flex;
    gap: 16px;
}

.menu-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    color: #687182;
    display: inline-flex;
    font-size: 1.45rem;
    height: 38px;
    justify-content: center;
    padding: 0;
    width: 38px;
}

.menu-toggle:hover {
    color: #299cdb;
}

.topbar-search {
    align-items: center;
    background: #f3f3f9;
    border-radius: 4px;
    color: #878a99;
    display: flex;
    gap: 10px;
    min-width: 230px;
    padding: 0 13px;
    position: relative;
}

.topbar-search input {
    background: transparent;
    border: 0;
    color: #495057;
    height: 38px;
    outline: 0;
    width: 100%;
}

.topbar-search input::placeholder {
    color: #878a99;
}

.topbar-supplier-results {
    background: #fff;
    border: 1px solid #dfe3e8;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .16);
    color: #212529;
    left: 0;
    max-height: 320px;
    min-width: 360px;
    overflow-y: auto;
    position: absolute;
    top: calc(100% + 6px);
    width: max-content;
    z-index: 1100;
}

.topbar-supplier-result {
    display: block;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid #eef0f2;
    padding: 10px 12px;
}

.topbar-supplier-result:last-child {
    border-bottom: 0;
}

.topbar-supplier-result strong,
.topbar-supplier-result span {
    display: block;
}

.topbar-supplier-result span {
    color: #6c757d;
    font-size: .75rem;
    margin-top: 2px;
}

.topbar-supplier-empty {
    color: #6c757d;
    padding: 10px 12px;
}

.topbar-actions {
    gap: 4px;
}

.software-balance-pill {
    align-items: center;
    background: #fff7e6;
    border: 1px solid #ffd591;
    border-radius: 4px;
    color: #ad6800;
    display: inline-flex;
    font-size: 0.86rem;
    font-weight: 600;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    text-decoration: none;
    white-space: nowrap;
}

.software-balance-pill:hover {
    background: #fff1d6;
    color: #8c5200;
}

.software-balance-pill.is-reminder {
    background: #fff1f0;
    border-color: #ffa39e;
    color: #cf1322;
}

.app-install-button {
    align-items: center;
    background: #0ab39c;
    border: 1px solid #0ab39c;
    border-radius: 4px;
    color: #fff;
    display: inline-flex;
    font-size: .86rem;
    font-weight: 600;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    white-space: nowrap;
}

.app-install-button:hover {
    background: #099885;
    border-color: #099885;
}

.topbar-icon {
    align-items: center;
    background: transparent;
    border: 0;
    color: #687182;
    display: flex;
    font-size: 1.2rem;
    height: 70px;
    justify-content: center;
    position: relative;
    width: 44px;
}

.topbar-icon:hover {
    background: #f3f6f9;
    color: #299cdb;
}

.topbar-badge {
    align-items: center;
    background: #f06548;
    border-radius: 999px;
    color: #fff;
    display: flex;
    font-size: .62rem;
    font-weight: 700;
    height: 17px;
    justify-content: center;
    min-width: 17px;
    padding: 0 4px;
    position: absolute;
    right: 7px;
    top: 17px;
}

.profile-button {
    align-items: center;
    background: #f3f6f9;
    border: 0;
    display: flex;
    gap: 10px;
    height: 70px;
    padding: 0 18px;
}

.profile-avatar {
    align-items: center;
    background: #299cdb;
    border-radius: 50%;
    color: #fff;
    display: flex;
    font-weight: 700;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.profile-logo {
    background: #fff;
    border: 1px solid #e9ebec;
    border-radius: 50%;
    height: 38px;
    object-fit: contain;
    padding: 3px;
    width: 38px;
}

.profile-copy {
    display: block;
    line-height: 1.2;
    text-align: left;
}

.profile-copy strong {
    color: #343a40;
    display: block;
    font-size: .9rem;
    font-weight: 600;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-copy small {
    color: #878a99;
    display: block;
    font-size: .75rem;
    margin-top: 2px;
}

.profile-menu {
    border: 0;
    border-radius: 0;
    box-shadow: 0 5px 10px rgba(30, 32, 37, .12);
    margin-top: 0 !important;
    min-width: 220px;
    padding: 10px 0;
}

.profile-menu .dropdown-header {
    color: #878a99;
    font-size: .78rem;
    font-weight: 600;
    padding: 7px 18px;
}

.profile-menu .dropdown-item {
    align-items: center;
    color: #343a40;
    display: flex;
    font-size: .9rem;
    gap: 10px;
    padding: 9px 18px;
}

.profile-menu .dropdown-item i {
    color: #878a99;
    font-size: 1rem;
}

.profile-menu .dropdown-item:hover,
.profile-menu .dropdown-item:focus {
    background: #f3f6f9;
    color: #299cdb;
}

.app-shell,
.page-content {
    padding: 24px 0;
}

.template-fluid .page-content {
    min-height: calc(100vh - 70px);
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.page-heading h1 {
    color: #111827;
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0;
}

.page-heading p {
    color: #667085;
    margin: 4px 0 0;
}

.panel,
.metric-card,
.filter-panel,
.entry-card {
    background: #fff;
    border: 1px solid #e9ebec;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(56, 65, 74, .08);
}

.template-fluid .panel,
.template-fluid .metric-card,
.template-fluid .filter-panel,
.template-fluid .entry-card {
    border-color: #e9ebec;
    box-shadow: 0 1px 2px rgba(56, 65, 74, .06);
}

.panel,
.filter-panel,
.entry-card {
    padding: 1.25rem;
}

.filter-panel {
    margin-bottom: 16px;
}

.panel > form,
.entry-card > form {
    margin: 0;
}

.panel h2.h5,
.entry-card h2.h5 {
    border-top: 1px solid #e9ebec;
    color: #343a40;
    font-size: .95rem;
    font-weight: 600;
    margin: 1.5rem -1.25rem 1rem;
    padding: 1rem 1.25rem 0;
}

.panel hr {
    border-color: #e9ebec;
    margin: 1.5rem -1.25rem 0;
    opacity: 1;
}

.panel.form-panel {
    max-width: none;
}

.panel.form-panel form > p,
.panel.form-panel .form-row {
    margin-bottom: 1rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, max-content)) auto;
    gap: 12px;
    align-items: end;
}

.collection-filter-grid {
    grid-template-columns: repeat(6, minmax(150px, max-content)) auto;
}

.filter-grid > div:not(.filter-actions) {
    min-width: 180px;
    width: max-content;
}

.filter-grid select,
.filter-grid input {
    min-width: 180px;
    width: auto;
}

.filter-grid select {
    max-width: min(360px, 36vw);
}

.filter-grid input {
    max-width: 260px;
}

.filter-actions,
.entry-actions {
    display: flex;
    gap: 8px;
    align-items: end;
}

.common-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, max-content));
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e9ebec;
    margin-bottom: 14px;
}

.common-fields > div {
    min-width: 150px;
    width: max-content;
}

.common-fields select,
.common-fields input {
    min-width: 150px;
    width: auto;
}

.common-fields input[type="text"],
.common-fields input[type="date"] {
    max-width: 180px;
}

.common-fields select {
    max-width: 210px;
}

.entry-row {
    display: grid;
    grid-template-columns: minmax(130px, .8fr) minmax(260px, 1.8fr) repeat(4, minmax(88px, .7fr)) auto;
    gap: 10px;
    align-items: end;
}

.entry-card {
    overflow-x: auto;
}

.entry-card .entry-row {
    min-width: 940px;
}

.entry-card .common-fields {
    min-width: 560px;
}

.entry-card .form-label,
.filter-panel .form-label,
.panel .form-label {
    color: #212529;
    font-size: .86rem;
    font-weight: 500;
    margin-bottom: .45rem;
}

.metric-card {
    padding: 1.1rem;
}

.metric-card span {
    color: #667085;
    display: block;
    font-size: 0.9rem;
}

.metric-card strong {
    display: block;
    font-size: 1.65rem;
    line-height: 1.2;
}

.form-panel input,
.form-panel select,
.form-panel textarea {
    display: block;
    width: 100%;
    padding: .375rem .75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: .375rem;
}

.panel form input,
.panel form select,
.panel form textarea,
.filter-panel select,
.filter-panel input,
.entry-card input,
.entry-card select {
    appearance: none;
    background-clip: padding-box;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    color: #212529;
    display: block;
    font-size: 1rem;
    line-height: 1.5;
    min-height: 38px;
    padding: .47rem .75rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    width: 100%;
}

.panel form select,
.filter-panel select,
.entry-card select {
    background-image:
        linear-gradient(45deg, transparent 50%, #878a99 50%),
        linear-gradient(135deg, #878a99 50%, transparent 50%);
    background-position:
        calc(100% - 17px) 16px,
        calc(100% - 12px) 16px;
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
    padding-right: 2.2rem;
}

.panel form textarea {
    min-height: 82px;
}

.panel form input::placeholder,
.filter-panel input::placeholder,
.entry-card input::placeholder {
    color: #878a99;
}

.panel form input[readonly],
.entry-card input[readonly],
.filter-panel input[readonly] {
    background-color: #fff;
}

.panel form input:disabled,
.panel form select:disabled,
.panel form textarea:disabled,
.entry-card input:disabled,
.entry-card select:disabled {
    background-color: #e9ecef;
    opacity: 1;
}

.panel form input[type="checkbox"],
.panel form input[type="radio"],
.entry-card input[type="checkbox"],
.entry-card input[type="radio"],
.filter-panel input[type="checkbox"],
.filter-panel input[type="radio"] {
    appearance: auto;
    display: inline-block;
    min-height: auto;
    padding: 0;
    width: auto;
}

.panel form input[type="file"],
.entry-card input[type="file"],
.filter-panel input[type="file"] {
    appearance: auto;
    padding: .375rem .75rem;
}

.panel form input[type="hidden"],
.entry-card input[type="hidden"],
.filter-panel input[type="hidden"] {
    display: none;
}

.panel form input:focus,
.panel form select:focus,
.panel form textarea:focus,
.filter-panel select:focus,
.filter-panel input:focus,
.entry-card input:focus,
.entry-card select:focus {
    border-color: #a0c8f1;
    box-shadow: 0 0 0 .16rem rgba(41, 156, 219, .16);
    outline: 0;
}

.flatpickr-input[readonly],
.flatpickr-input.form-control[readonly] {
    background-color: #fff;
}

.flatpickr-calendar {
    border: 0;
    border-radius: 4px;
    box-shadow: 0 5px 10px rgba(30, 32, 37, .12);
    font-family: "HK Grotesk", system-ui, sans-serif;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover {
    background: #299cdb;
    border-color: #299cdb;
}

.flatpickr-day.today {
    border-color: #299cdb;
}

.flatpickr-months .flatpickr-month {
    color: #343a40;
}

.numInputWrapper span {
    border-color: #e9ebec;
}

.btn-primary {
    background: #0ab39c;
    border-color: #0ab39c;
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background: #099885;
    border-color: #099885;
    color: #fff;
}

.btn-outline-primary {
    border-color: #0ab39c;
    color: #0a9b88;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: #0ab39c;
    border-color: #0ab39c;
    color: #fff;
}

.table {
    margin-bottom: 0;
}

.table-responsive {
    width: 100%;
}

.datatable-scroll {
    width: 100% !important;
}

.table-responsive {
    max-height: min(62vh, 640px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive > .table,
.table-responsive table {
    min-width: 760px;
}

.table-responsive .table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.table > :not(caption) > * > * {
    padding: .75rem .75rem;
}

.table-bordered > :not(caption) > * {
    border-color: #e9ebec;
}

.table-bordered > :not(caption) > * > * {
    border-color: #e9ebec;
}

.table thead th {
    background: #fff;
    color: #212529;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

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

.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-bg-type: #fff;
}

.table-striped > tbody > tr:nth-of-type(even) > * {
    --bs-table-bg-type: #fbfcfd;
}

.table tbody td a {
    color: #299cdb;
    text-decoration: none;
}

.dataTables_wrapper .dataTables_filter {
    margin-bottom: .75rem;
    text-align: right;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #d9dde3;
    border-radius: .375rem;
    margin-left: .5rem;
    padding: .375rem .75rem;
}

.dataTables_wrapper .dataTables_length {
    margin-bottom: .75rem;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid #d9dde3;
    border-radius: .375rem;
    margin: 0 .35rem;
    min-height: 34px;
    padding: .25rem 1.75rem .25rem .5rem;
}

.dataTables_wrapper .dataTables_info {
    color: #495057;
    padding-top: .85rem;
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: .75rem;
}

.dataTables_wrapper .pagination {
    gap: 4px;
    justify-content: flex-end;
    margin-bottom: 0;
}

.dataTables_wrapper .page-link {
    border-color: #e9ebec;
    border-radius: 4px;
    color: #299cdb;
    min-width: 34px;
    text-align: center;
}

.dataTables_wrapper .page-item.active .page-link {
    background: #299cdb;
    border-color: #299cdb;
    color: #fff;
}

.dataTables_wrapper .page-item.disabled .page-link {
    color: #878a99;
}

.form-panel input[type="checkbox"] {
    display: inline-block;
    width: auto;
}

.panel form input[type="checkbox"] {
    display: inline-block;
    width: auto;
}

.summary-strip {
    background: #f8f9fa;
    border: 1px solid #e9ebec;
    display: grid;
    gap: 0;
    grid-template-columns: repeat(6, minmax(130px, 1fr));
}

.summary-strip > div {
    border-right: 1px solid #e9ebec;
    padding: 12px 14px;
}

.summary-strip > div:last-child {
    border-right: 0;
}

.summary-strip span {
    color: #667085;
    display: block;
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
}

.summary-strip strong {
    color: #111827;
    display: block;
    font-size: 1.15rem;
    margin-top: 4px;
}

.eb-cost-summary-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.eb-cost-summary-grid > div {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    min-height: 74px;
    padding: 12px 14px;
}

.eb-cost-summary-grid span {
    color: #64748b;
    display: block;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.25;
    text-transform: uppercase;
}

.eb-cost-summary-grid strong {
    color: #0f172a;
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 8px;
    word-break: break-word;
}

.stock-balance-label {
    border: 1px solid #10b981;
    border-radius: 4px;
    min-width: 190px;
    padding: 10px 14px;
    text-align: right;
}

.stock-balance-label span {
    color: #667085;
    display: block;
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
}

.stock-balance-label strong {
    color: #111827;
    display: block;
    font-size: 1.2rem;
    margin-top: 3px;
}

.payment-summary-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    margin-bottom: 12px;
}

.payment-summary-grid .panel {
    min-height: 62px;
    padding: 10px 12px !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.payment-summary-grid .text-muted.small {
    font-size: 11px;
    line-height: 1.15;
    margin-bottom: 3px;
}

.payment-summary-grid .h4,
.payment-summary-grid .h3,
.payment-summary-grid .fs-3,
.payment-summary-grid .display-6 {
    font-size: 20px !important;
    line-height: 1.15;
    margin-bottom: 0 !important;
}

@media (max-width: 768px) {
    .payment-summary-grid {
        grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
        gap: 8px;
    }
}

.admin-like-form {
    margin: 0;
}

.admin-form-card {
    background: #fff;
    border: 1px solid #e2e5e8;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(56, 65, 74, .06);
    margin-bottom: 16px;
    overflow: hidden;
}

.admin-form-title {
    border-bottom: 1px solid #e9ebec;
    color: #111827;
    font-size: .95rem;
    font-weight: 600;
    padding: 14px 18px;
}

.admin-form-row {
    align-items: center;
    border-bottom: 1px solid #eef1f4;
    display: grid;
    gap: 16px;
    grid-template-columns: 150px minmax(0, 1fr);
    min-height: 72px;
    padding: 12px 18px;
}

.admin-form-row:last-child {
    border-bottom: 0;
}

.admin-form-label {
    color: #111827;
    font-size: .82rem;
    margin: 0;
}

.admin-form-control {
    align-items: center;
    display: flex;
    gap: 10px;
}

.admin-form-control-sm {
    max-width: 250px;
}

.admin-form-control select,
.admin-form-control input[type="text"],
.admin-inline-row input,
.admin-inline-row select {
    appearance: auto;
    background-color: #fff;
    border: 1px solid #cfd6df;
    border-radius: 4px;
    color: #212529;
    min-height: 38px;
    padding: .45rem .7rem;
}

.admin-form-control select {
    min-width: 290px;
}

.admin-form-control input[type="text"] {
    width: 250px;
}

.admin-check-row {
    min-height: 44px;
}

.admin-check-row .admin-form-control {
    grid-column: 1 / -1;
}

.admin-check-row input {
    margin-right: 4px;
}

.admin-row-icons {
    align-items: center;
    display: inline-flex;
    font-size: 1.45rem;
    gap: 10px;
}

.icon-muted {
    color: #a0a3a6;
}

.icon-add {
    color: #55a630;
}

.icon-view {
    color: #8c939b;
}

.admin-inline-table {
    max-height: min(62vh, 640px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-inline-head,
.admin-inline-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(190px, 1fr)) 150px;
    min-width: 880px;
}

.admin-inline-head {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ebec;
    color: #111827;
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
}

.admin-inline-head > div {
    padding: 12px 10px;
}

.admin-inline-row {
    background: #f3f6f9;
    border-bottom: 1px solid #eef1f4;
}

.admin-inline-row > div {
    padding: 12px 10px;
}

.admin-inline-row input {
    max-width: 158px;
    width: 100%;
}

.delete-cell {
    align-items: center;
    display: flex;
}

.admin-add-row {
    background: transparent;
    border: 0;
    color: #299cdb;
    font-size: .82rem;
    padding: 10px;
}

.admin-add-row i {
    color: #55a630;
    font-size: 1.05rem;
    vertical-align: -2px;
}

.admin-submit-card {
    align-items: center;
    display: flex;
    gap: 10px;
    padding: 14px 18px;
}

@media (max-width: 992px) {
    body.sidebar-collapsed .app-sidebar {
        width: 240px;
    }

    body.sidebar-collapsed .main-content {
        margin-left: 0;
    }

    body.sidebar-collapsed .sidebar-logo {
        max-height: 38px;
        max-width: 168px;
        object-fit: contain;
    }

    body.sidebar-collapsed .nav-section,
    body.sidebar-collapsed .side-menu-toggle .menu-title span,
    body.sidebar-collapsed .menu-arrow,
    body.sidebar-collapsed .side-link span {
        display: block;
    }

    body.sidebar-collapsed .submenu:not(.is-hidden) {
        display: block;
    }

    body.sidebar-collapsed .side-menu-toggle {
        justify-content: space-between;
        padding: 9px 10px;
    }

    body.sidebar-collapsed .side-link {
        justify-content: flex-start;
        padding: 9px 10px;
    }

    .app-sidebar {
        transform: translateX(-100%);
        transition: transform .18s ease;
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .app-shell,
    .page-content {
        padding: 16px 0;
    }

    .app-topbar .layout-width {
        padding-left: 0;
    }

    .topbar-search {
        min-width: 180px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .filter-grid,
    .collection-filter-grid,
    .common-fields {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }

    .filter-grid > div:not(.filter-actions),
    .filter-grid select,
    .filter-grid input,
    .common-fields > div,
    .common-fields select,
    .common-fields input {
        width: 100%;
    }

    .entry-row {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }
}

@media (max-width: 576px) {
    html[data-layout-width="fluid"] .container-fluid {
        padding-left: .75rem;
        padding-right: .75rem;
    }

    .app-shell,
    .page-content {
        padding: 12px 0;
    }

    .filter-grid,
    .collection-filter-grid,
    .common-fields,
    .entry-row {
        grid-template-columns: 1fr;
    }

    .filter-actions,
    .entry-actions {
        width: 100%;
    }

    .filter-actions .btn,
    .entry-actions .btn {
        flex: 1;
    }

    .summary-strip {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
    }

    .summary-strip > div {
        border-bottom: 1px solid #e9ebec;
    }

    .topbar-search,
    .topbar-icon,
    .profile-copy {
        display: none;
    }

    .profile-button {
        padding: 0 12px;
    }
}

/* Project-wide responsive fit layer */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

.layout-wrapper,
.main-content,
.page-content,
.container,
.container-fluid,
.row,
.card,
.card-body,
.form-group,
.filter-grid > *,
.collection-filter-grid > *,
.common-fields > *,
.entry-row > *,
.summary-strip > * {
    min-width: 0;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea,
.form-control,
.form-select,
.select2-container {
    max-width: 100%;
    min-width: 0;
}

input[type="file"] {
    height: auto;
    white-space: normal;
}

textarea {
    resize: vertical;
}

select.form-select,
select {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.select-autosize-wrap {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.select-autosize-wrap select[data-autosize-select="true"] {
    max-width: none !important;
    min-width: 100%;
    width: max(100%, var(--autosize-select-width, 100%));
}

@media (min-width: 992px) {
    .select-autosize-wrap select[data-autosize-select="true"] {
        width: max(100%, min(var(--autosize-select-width, 100%), 72vw));
    }
}

.btn,
button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
    max-width: 100%;
    white-space: normal;
}

.filter-grid,
.collection-filter-grid,
.common-fields,
.entry-row {
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}

.filter-grid select,
.filter-grid input,
.collection-filter-grid select,
.collection-filter-grid input,
.common-fields select,
.common-fields input,
.entry-row select,
.entry-row input,
.entry-row textarea {
    width: 100%;
}

.filter-actions,
.entry-actions,
.page-heading,
.card-header,
.dataTables_wrapper .row,
.dataTables_wrapper .dataTables_paginate,
.dataTables_wrapper .pagination {
    flex-wrap: wrap;
    min-width: 0;
}

.table-responsive,
.datatable-scroll {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table,
.datatable-scroll table {
    width: 100%;
}

.summary-strip {
    grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
}

.topbar-search {
    max-width: min(320px, 45vw);
}

@media (max-width: 768px) {
    body {
        font-size: .9rem;
    }

    html[data-layout-width="fluid"] .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .page-heading {
        gap: 10px;
    }

    .page-heading .btn,
    .card-header .btn,
    .filter-actions .btn,
    .entry-actions .btn {
        min-height: 38px;
    }

    .table-responsive table,
    .datatable-scroll table {
        min-width: 720px;
    }

    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none;
        text-align: left;
        width: 100%;
    }

    .dataTables_wrapper .dataTables_filter input {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 420px) {
    html[data-layout-width="fluid"] .container-fluid {
        padding-left: .75rem;
        padding-right: .75rem;
    }

    .filter-actions,
    .entry-actions {
        flex-direction: column;
    }

    .filter-actions .btn,
    .entry-actions .btn,
    .admin-submit-card .btn {
        width: 100%;
    }
}

/* Device adaptive foundation: mobile, tablet, and desktop */
.sidebar-backdrop {
    background: rgba(15, 23, 42, .38);
    bottom: 0;
    display: none;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1035;
}

.page-heading > div:first-child {
    min-width: 0;
}

.page-heading > .d-flex {
    flex-wrap: wrap;
}

.panel,
.filter-panel,
.entry-card,
.metric-card,
.ts-admin-card {
    max-width: 100%;
}

.panel form .row,
.filter-panel .row,
.entry-card .row {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: .9rem;
}

.form-label {
    line-height: 1.25;
}

.btn {
    align-items: center;
    display: inline-flex;
    gap: .35rem;
    justify-content: center;
}

.btn i {
    line-height: 1;
}

.dataTables_wrapper {
    max-width: 100%;
    overflow: visible;
}

.dataTables_wrapper > .row {
    align-items: center;
    row-gap: .75rem;
}

.dataTables_wrapper .dataTables_length select {
    display: inline-block;
    min-width: 70px;
    width: auto;
}

.dataTables_wrapper .dataTables_filter {
    text-align: right;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #ced4da;
    border-radius: 4px;
    min-height: 38px;
    padding: .45rem .75rem;
}

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

.table-responsive::-webkit-scrollbar,
.select-autosize-wrap::-webkit-scrollbar,
.entry-card::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.table-responsive::-webkit-scrollbar-thumb,
.select-autosize-wrap::-webkit-scrollbar-thumb,
.entry-card::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

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

@media (min-width: 1200px) {
    .page-heading .btn {
        white-space: nowrap;
    }
}

@media (max-width: 1199.98px) {
    html[data-layout-width="fluid"] .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .page-heading {
        align-items: flex-start;
    }

    .filter-grid,
    .collection-filter-grid,
    .common-fields,
    .entry-row {
        grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
    }

    .filter-actions,
    .entry-actions {
        align-self: end;
    }
}

@media (max-width: 991.98px) {
    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .app-sidebar {
        box-shadow: 0 8px 24px rgba(15, 23, 42, .22);
        max-width: min(82vw, 300px);
        width: min(82vw, 300px);
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .sidebar-nav {
        padding-bottom: 90px;
    }

    .app-topbar {
        height: 62px;
    }

    .app-topbar .layout-width {
        height: 62px;
        padding: 0 .75rem;
    }

    .topbar-actions {
        margin-left: auto;
    }

    .app-install-button span,
    .software-balance-pill span {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-icon {
        height: 62px;
        width: 38px;
    }

    .profile-button {
        height: 62px;
        padding: 0 .75rem;
    }

    .profile-logo,
    .profile-avatar {
        height: 34px;
        width: 34px;
    }

    .page-heading {
        flex-direction: column;
    }

    .page-heading > .d-flex,
    .page-heading .btn {
        width: 100%;
    }

    .page-heading > .d-flex {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .panel,
    .filter-panel,
    .entry-card {
        padding: 1rem;
    }

    .metric-card {
        padding: .95rem;
    }

    .metric-card strong {
        font-size: 1.35rem;
    }

    .summary-strip {
        grid-template-columns: repeat(auto-fit, minmax(min(155px, 100%), 1fr));
    }
}

@media (max-width: 767.98px) {
    body {
        font-size: .88rem;
    }

    .page-heading h1 {
        font-size: 1.25rem;
    }

    .page-heading p {
        font-size: .9rem;
    }

    .panel,
    .filter-panel,
    .entry-card {
        padding: .9rem;
    }

    .filter-grid,
    .collection-filter-grid,
    .common-fields,
    .entry-row,
    .ts-form-row {
        grid-template-columns: 1fr !important;
    }

    .filter-actions,
    .entry-actions {
        align-items: stretch;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        width: 100%;
    }

    .filter-actions .btn,
    .entry-actions .btn {
        width: 100%;
    }

    .topbar-search {
        display: none;
    }

    .table-responsive table,
    .datatable-scroll table,
    table.datatable-scroll {
        min-width: 760px;
    }

    .dataTables_wrapper .dataTables_filter {
        text-align: left;
    }

    .dataTables_wrapper .dataTables_filter label,
    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
    }

    .dataTables_wrapper .pagination {
        justify-content: flex-start;
    }

    .modal-dialog {
        margin: .75rem;
    }
}

@media (max-width: 575.98px) {
    html[data-layout-width="fluid"] .container-fluid {
        padding-left: .65rem;
        padding-right: .65rem;
    }

    .app-shell,
    .page-content {
        padding: 10px 0;
    }

    .menu-toggle {
        height: 36px;
        width: 36px;
    }

    .topbar-icon[title="Apps"],
    .topbar-icon[title="Fullscreen"] {
        display: none;
    }

    .app-install-button {
        padding: 0 10px;
    }

    .app-install-button span,
    .software-balance-pill span {
        display: none;
    }

    .profile-button {
        background: transparent;
        gap: 0;
    }

    .profile-copy {
        display: none;
    }

    .page-heading {
        margin-bottom: 12px;
    }

    .page-heading > .d-flex {
        grid-template-columns: 1fr;
    }

    .btn,
    button,
    input[type="submit"],
    input[type="button"],
    input[type="reset"] {
        min-height: 40px;
    }

    .panel form input,
    .panel form select,
    .panel form textarea,
    .filter-panel select,
    .filter-panel input,
    .entry-card input,
    .entry-card select,
    .form-control,
    .form-select {
        font-size: .95rem;
        min-height: 40px;
    }

    .summary-strip {
        grid-template-columns: 1fr;
    }

    .summary-strip > div {
        border-right: 0;
    }
}

.menu-permission-grid ul {
    display: grid;
    gap: 10px 18px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    list-style: none;
    margin: 0;
    padding: 14px;
}

.menu-permission-grid li {
    min-width: 0;
}

.menu-permission-grid label {
    align-items: flex-start;
    display: flex;
    gap: 8px;
    line-height: 1.25;
    margin: 0;
}

.menu-permission-grid input[type="checkbox"] {
    flex: 0 0 auto;
    margin-top: 2px;
}

.menu-permission-accordion {
    border: 1px solid #d8dde6;
    border-radius: 6px;
    overflow: hidden;
}

.menu-permission-panel + .menu-permission-panel {
    border-top: 1px solid #d8dde6;
}

.menu-permission-header {
    align-items: center;
    background: #fff;
    border: 0;
    color: #1f2937;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    min-height: 48px;
    padding: 0 14px;
    text-align: left;
    width: 100%;
}

.menu-permission-header[aria-expanded="true"] {
    background: #f7f8fb;
}

.menu-permission-title {
    align-items: center;
    display: flex;
    gap: 10px;
    min-width: 0;
}

.menu-permission-title i {
    color: #299cdb;
    font-size: 1rem;
}

.menu-permission-count {
    color: #687385;
    font-size: .8rem;
    white-space: nowrap;
}

.menu-permission-arrow {
    color: #687385;
    transition: transform .15s ease;
}

.menu-permission-header[aria-expanded="true"] .menu-permission-arrow {
    transform: rotate(90deg);
}

.menu-permission-body {
    background: #fff;
    padding: 14px;
}

.menu-permission-body.is-hidden {
    display: none;
}

.menu-permission-option {
    align-items: flex-start;
    display: flex;
    gap: 9px;
    line-height: 1.25;
    margin: 0;
}

.menu-permission-option input {
    flex: 0 0 auto;
    margin-top: 2px;
}

.menu-permission-parent {
    font-weight: 600;
}

.menu-permission-children {
    display: grid;
    gap: 10px 18px;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    margin-top: 12px;
    padding-left: 26px;
}

.menu-selected-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 420px;
}

.menu-selected-list span {
    background: #eef6ff;
    border: 1px solid #cfe7ff;
    border-radius: 999px;
    color: #1f5f96;
    display: inline-flex;
    font-size: .78rem;
    line-height: 1.2;
    padding: 3px 8px;
}

@media (max-width: 575.98px) {
    .menu-permission-header {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .menu-permission-count {
        display: none;
    }

    .menu-permission-children {
        grid-template-columns: 1fr;
        padding-left: 0;
    }
}

.topbar-supplier-result:hover,
.topbar-supplier-result:focus-visible {
    background: #eaf8f5;
    color: inherit;
    outline: 2px solid #008b83;
    outline-offset: -2px;
}

/* Keep numeric validation while removing the browser's uncomfortable step arrows. */
input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
