﻿@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');

/* Shared theme: change these tokens to restyle every page, including authentication. */
:root {
    --pos-bg: #f3f3f3;
    --pos-surface: #fff;
    --pos-subtle: #f8f8f8;
    --pos-text: #262626;
    --pos-muted: #737373;
    --pos-border: #e5e5e5;
    --pos-primary: #262626;
    --pos-primary-hover: #404040;
    --pos-primary-active: #171717;
    --pos-primary-soft: #ededed;
    --pos-focus: #a3a3a3;
    --pos-focus-ring: 0 0 0 .2rem #a3a3a333;
    --pos-radius: 16px;
    --pos-control-radius: 9px;
    --pos-shadow: 0 4px 24px #26262605;
    --bs-body-font-family: 'Prompt', system-ui, sans-serif;
    --bs-body-color: var(--pos-text);
    --bs-body-bg: var(--pos-bg);
    --bs-primary: var(--pos-primary);
    --bs-primary-rgb: 38, 38, 38;
    --bs-secondary-rgb: 115, 115, 115;
    --bs-dark-rgb: 38, 38, 38;
    --bs-light-rgb: 248, 248, 248;
    --bs-link-color-rgb: 38, 38, 38;
    --bs-link-hover-color-rgb: 64, 64, 64;
    --bs-focus-ring-color: #a3a3a333;
    --bs-link-color: var(--pos-primary);
    --bs-link-hover-color: var(--pos-primary-hover);
    --bs-border-color: var(--pos-border);
    --bs-secondary-color: var(--pos-muted);
}

body {
    font-family: var(--bs-body-font-family);
    background: var(--pos-bg);
    color: var(--pos-text);
    font-size: .9375rem;
    line-height: 1.65;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 500;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.4rem;
}

h3 {
    font-size: 1.15rem;
}

h4 {
    font-size: 1.075rem;
}

h5 {
    font-size: 1rem;
}

a,
button,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--pos-focus);
    outline-offset: 3px;
}

.text-secondary {
    color: var(--pos-muted) !important;
}

/* Layout classes are shared by all authenticated views. */
.app-shell {
    min-height: 100vh;
    align-items: stretch;
}

.app-main {
    min-width: 0;
    flex: 1;
}

.app-content {
    padding: 20px !important;
    max-width: 1800px;
    margin-inline: auto;
}

.app-content>.card+.card {
    margin-top: 16px;
}

.app-sidebar {
    width: 244px;
    flex: 0 0 244px;
    background: var(--pos-surface);
    border-color: var(--pos-border) !important;
}

.sidebar {
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
    padding: 24px 16px !important;
    scrollbar-width: thin;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 8px 24px;
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--pos-text);
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 11px;
    background: var(--pos-primary-soft);
    color: var(--pos-primary);
}

.app-menu>.row {
    border-radius: 12px;
    margin: 0 0 16px;
    align-items: center;
    gap: 10px !important;
    padding: 12px !important;
}

.app-menu>.row>.col-lg {
    flex: 1;
    min-width: 0;
}

.app-menu>.row h5 {
    margin-bottom: 2px !important;
    overflow-wrap: anywhere;
}

.app-menu>.row p {
    margin-bottom: 0 !important;
    color: var(--pos-muted);
    font-size: .75rem;
}

.app-menu .profileCircle {
    display: grid;
    place-items: center;
    width: 42px !important;
    height: 42px !important;
    border-radius: 12px !important;
}

.app-menu .profileCircle>div {
    padding: 0 !important;
    font-size: 20px !important;
}

.app-menu .nav {
    gap: 4px;
    margin-bottom: 10px;
}

.app-menu .nav h5 {
    border: 0 !important;
    font-size: .7rem;
    color: var(--pos-muted);
    font-weight: 500;
    margin: 12px 10px 3px !important;
    padding: 0 !important;
    letter-spacing: .03em;
}

.app-menu .nav h5:empty {
    display: none;
}

.app-menu .list-group-item-action {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 9px;
    padding: 10px 12px !important;
    color: #525252;
    font-size: .85rem;
    background: transparent;
    text-decoration: none;
    transition: background-color .15s, color .15s;
}

.app-menu .list-group-item-action i {
    width: 19px;
    text-align: center;
    margin: 0 !important;
}

.app-menu .list-group-item-action:hover {
    background: var(--pos-subtle);
    color: var(--pos-primary);
}

.app-menu .list-group-item-action.active {
    color: var(--pos-primary-active);
    background: var(--pos-primary-soft);
    font-weight: 500;
}

.app-menu a[href='/logout'] {
    color: #525252;
}

.app-topbar {
    background: var(--pos-surface);
    border-bottom: 1px solid var(--pos-border);
    min-height: 78px;
    padding: 16px 28px;
}

.app-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.app-topbar-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.app-topbar-caption {
    color: var(--pos-muted);
    font-size: .75rem;
    margin: 1px 0 0;
}

.app-topbar .navbar-brand {
    color: var(--pos-text);
    font-size: 1.1rem;
}

.app-topbar .navbar-collapse {
    width: 100%;
}

.app-topbar .navbar-collapse .app-menu {
    margin-top: 18px;
}

.profile-avatar {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    border-radius: 8px;
    margin-right: 6px;
    color: var(--pos-text);
}

/* Bootstrap components provide the common visual language across existing views. */
.card {
    --bs-card-bg: var(--pos-surface);
    --bs-card-border-color: var(--pos-border);
    --bs-card-border-radius: var(--pos-radius);
    border: 1px solid var(--pos-border);
    box-shadow: var(--pos-shadow);
    min-width: 0;
}

.card.p-4 {
    padding: 20px !important;
}

.card-header {
    border-color: var(--pos-border);
    background: var(--pos-surface);
    padding: 14px 18px;
}

.card-footer {
    background: var(--pos-subtle);
    border-color: var(--pos-border);
}

.card h2>i,
.card h3>i {
    color: var(--pos-primary);
}

.card.text-bg-light {
    background: var(--pos-subtle) !important;
    color: var(--pos-text) !important;
    box-shadow: none;
}

.card.text-bg-light h3 {
    font-size: .875rem;
    color: var(--pos-muted);
}

.card.text-bg-light .fs-4 {
    font-size: 1.5rem !important;
    color: var(--pos-text) !important;
    font-weight: 500;
}

.btn {
    --bs-btn-border-radius: var(--pos-control-radius);
    --bs-btn-font-size: .875rem;
    --bs-btn-padding-y: .55rem;
    --bs-btn-padding-x: .9rem;
    font-weight: 400;
    transition: background-color .15s, border-color .15s, box-shadow .15s;
}

.btn-sm {
    --bs-btn-padding-y: .35rem;
    --bs-btn-padding-x: .65rem;
    --bs-btn-font-size: .775rem;
    --bs-btn-border-radius: 7px;
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    --bs-btn-disabled-color: #fff;
    --bs-btn-bg: var(--pos-primary);
    --bs-btn-border-color: var(--pos-primary);
    --bs-btn-hover-bg: var(--pos-primary-hover);
    --bs-btn-hover-border-color: var(--pos-primary-hover);
    --bs-btn-active-bg: var(--pos-primary-active);
    --bs-btn-active-border-color: var(--pos-primary-active);
    --bs-btn-disabled-bg: var(--pos-primary);
    --bs-btn-disabled-border-color: var(--pos-primary);
    --bs-btn-focus-shadow-rgb: 163, 163, 163;
}

.btn-secondary {
    --bs-btn-disabled-color: var(--pos-muted);
    --bs-btn-disabled-bg: var(--pos-primary-soft);
    --bs-btn-disabled-border-color: var(--pos-border);
    --bs-btn-color: #404040;
    --bs-btn-bg: var(--pos-primary-soft);
    --bs-btn-border-color: var(--pos-primary-soft);
    --bs-btn-hover-color: #262626;
    --bs-btn-hover-bg: #e0e0e0;
    --bs-btn-hover-border-color: #e0e0e0;
    --bs-btn-active-color: #262626;
    --bs-btn-active-bg: #d4d4d4;
    --bs-btn-active-border-color: #d4d4d4;
}

.btn-light {
    --bs-btn-bg: var(--pos-subtle);
    --bs-btn-border-color: var(--pos-border);
    --bs-btn-hover-bg: var(--pos-primary-soft);
    --bs-btn-hover-border-color: #d4d4d4;
}

.btn-outline-primary, .btn-outline-secondary {
    --bs-btn-color: var(--pos-primary);
    --bs-btn-border-color: var(--pos-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    --bs-btn-disabled-color: var(--pos-muted);
    --bs-btn-disabled-border-color: var(--pos-border);
    --bs-btn-hover-bg: var(--pos-primary);
    --bs-btn-hover-border-color: var(--pos-primary);
    --bs-btn-active-bg: var(--pos-primary-active);
    --bs-btn-active-border-color: var(--pos-primary-active);
}

.form-label {
    font-size: .875rem;
    font-weight: 400;
    margin-bottom: 8px;
}

.form-control,
.form-select {
    border-color: var(--pos-border);
    border-radius: var(--pos-control-radius);
    min-height: 44px;
    font-size: .875rem;
    background-color: var(--pos-surface);
}

.form-control::placeholder {
    color: #a3a3a3;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--pos-focus);
    box-shadow: var(--pos-focus-ring);
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
    background-color: var(--pos-subtle);
}

.form-control-sm,
.form-select-sm,
.input-group-sm>.form-control,
.input-group-sm>.form-select {
    min-height: 34px;
}

.form-floating>label {
    color: var(--pos-muted);
    font-size: .875rem;
}

.form-text {
    font-size: .75rem;
    color: var(--pos-muted);
    line-height: 1.7;
    margin-top: 8px;
}

.form-check-input:checked {
    background-color: var(--pos-primary);
    border-color: var(--pos-primary);
}

.input-group-text {
    background: var(--pos-subtle);
    border-color: var(--pos-border);
    font-size: .875rem;
}

select[readonly],
input[type=checkbox][readonly] {
    pointer-events: none;
}

.table-responsive {
    border: 1px solid var(--pos-border);
    border-radius: 12px;
    scrollbar-width: thin;
    padding: 0;
}

.table-responsive:has(.dt-container) {
    border: 0;
}

.table {
    --bs-table-bg: var(--pos-surface);
    --bs-table-color: var(--pos-text);
    --bs-table-border-color: var(--pos-border);
    --bs-table-hover-bg: var(--pos-subtle);
    --bs-table-hover-color: var(--pos-text);
    width: 100%;
    min-width: max-content;
    margin-bottom: 0;
    vertical-align: middle;
    font-size: .8rem;
}

.table.data-table {
    min-width: 0;
}

.table> :not(caption)>*>* {
    padding: 8px 10px;
}

.table thead {
    --bs-table-bg: var(--pos-subtle);
    --bs-table-color: #737373;
}

.table th {
    font-weight: 500;
    white-space: nowrap;
    font-size: .75rem;
}

#sell_modal .cart-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
}

#sell_modal .cart-table th:first-child,
#sell_modal .cart-table td:first-child {
    width: 38%;
    white-space: normal;
    overflow-wrap: anywhere;
}

#sell_modal .cart-table th:nth-child(2),
#sell_modal .cart-table td:nth-child(2) {
    width: 32%;
}

#sell_modal .cart-table th:nth-child(3),
#sell_modal .cart-table td:nth-child(3) {
    width: 23%;
}

#sell_modal .cart-table th:last-child,
#sell_modal .cart-table td:last-child {
    width: 7%;
    padding-left: 4px;
    padding-right: 8px;
}

#sell_modal .cart-table td {
    white-space: normal;
    overflow-wrap: anywhere;
}

.sell-modal-dialog {
    max-width: 1440px;
}

#sell_modal .modal-content {
    max-height: calc(100vh - 2rem);
}

#sell_modal .sell-modal-body {
    overflow-y: auto;
}

.sell-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.sell-step-badge {
    display: inline-grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    border-radius: 50%;
    background: var(--pos-primary-soft);
    color: var(--pos-primary);
    font-size: .8rem;
    font-weight: 600;
}

.sell-catalog-results {
    max-height: min(56vh, 620px);
    min-height: 250px;
    overflow-y: auto;
    padding: 2px 6px 4px 2px;
    scrollbar-width: thin;
}

.sell-product-grid {
    row-gap: 10px;
}

.sell-product-card {
    display: flex;
    width: 100%;
    min-height: 142px;
    height: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 15px;
    border: 1px solid var(--pos-border);
    border-radius: 12px;
    background: var(--pos-surface);
    color: var(--pos-text);
    text-align: left;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.sell-product-card:hover,
.sell-product-card:focus-visible {
    border-color: var(--pos-primary);
    box-shadow: var(--pos-shadow);
    transform: translateY(-1px);
}

.sell-product-card-name {
    display: -webkit-box;
    width: 100%;
    min-height: 3em;
    overflow: hidden;
    font-weight: 500;
    line-height: 1.5;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.sell-product-card-price {
    font-size: .95rem;
    font-weight: 600;
}

.sell-product-card-stock {
    color: var(--pos-muted);
    font-size: .75rem;
}

.sell-product-card-action {
    margin-top: auto;
    padding-top: 8px;
    color: var(--pos-primary);
    font-size: .75rem;
    font-weight: 500;
}

.sell-empty-state {
    display: flex;
    min-height: 160px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--pos-muted);
    text-align: center;
}

.sell-empty-state>i {
    font-size: 1.6rem;
    opacity: .65;
}

.sell-cart-panel {
    display: flex;
    min-height: 0;
    flex-direction: column;
}

.sell-cart-table-wrap {
    max-height: min(37vh, 400px);
    overflow-y: auto;
}

#sell_modal .cart-table th {
    position: sticky;
    z-index: 1;
    top: 0;
    background: var(--pos-subtle);
}

.sell-cart-product {
    font-weight: 500;
}

.sell-cart-quantity {
    display: inline-block;
    min-width: 24px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.sell-cart-control {
    display: inline-grid;
    width: 28px;
    height: 28px;
    padding: 0 !important;
    place-items: center;
    border: 1px solid var(--pos-border);
    background: var(--pos-surface);
    color: var(--pos-text);
}

.sell-cart-control:hover {
    border-color: var(--pos-primary);
    background: var(--pos-primary-soft);
}

.sell-cart-remove {
    border-color: transparent;
    color: #b42318;
}

.sell-cart-empty {
    padding: 22px 12px;
    color: var(--pos-muted);
    text-align: center;
}

.sell-cart-empty>i {
    margin-bottom: 8px;
    font-size: 1.35rem;
    opacity: .65;
}

.sell-order-fields {
    display: grid;
    gap: 12px;
    margin-top: auto;
    padding-top: 18px;
}

.sell-clear-cart {
    align-self: flex-end;
    margin-top: 12px;
    font-size: .8rem;
    text-decoration: none;
}

.sell-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--pos-surface);
}

.sell-total {
    display: flex;
    flex-direction: column;
}

.sell-total strong {
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
}

@media (min-width: 992px) {
    #sell_modal .sell-catalog-panel {
        padding-right: 24px;
        border-right: 1px solid var(--pos-border);
    }

    #sell_modal .sell-cart-panel {
        padding-left: 8px;
    }
}

@media (max-width: 767.98px) {
    .sell-modal-dialog {
        margin: .5rem;
    }

    #sell_modal .modal-header,
    #sell_modal .modal-footer,
    #sell_modal .modal-body {
        padding: 16px;
    }

    .sell-catalog-results {
        max-height: 38vh;
        min-height: 180px;
    }

    .sell-cart-table-wrap {
        max-height: 30vh;
    }

    .sell-product-card {
        min-height: 132px;
        padding: 12px;
    }

    .sell-modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .sell-modal-footer>div:last-child {
        justify-content: flex-end;
    }
}

.table tbody tr:last-child>* {
    border-bottom: 0;
}

.table .btn {
    --bs-btn-padding-y: .35rem;
    --bs-btn-padding-x: .6rem;
    --bs-btn-font-size: .8rem;
}

.badge {
    font-weight: 400;
    line-height: 1.5;
    padding: .35em .65em;
    border-radius: 6px;
}

.list-group {
    --bs-list-group-border-color: var(--pos-border);
    --bs-list-group-border-radius: 10px;
    --bs-list-group-action-hover-bg: var(--pos-subtle);
    --bs-list-group-active-bg: var(--pos-primary);
    --bs-list-group-active-border-color: var(--pos-primary);
}

.list-group-item {
    padding: 13px 16px;
}

.dropdown-menu {
    --bs-dropdown-bg: var(--pos-surface);
    --bs-dropdown-border-color: var(--pos-border);
    --bs-dropdown-border-radius: 12px;
    --bs-dropdown-link-hover-bg: var(--pos-subtle);
    --bs-dropdown-link-active-bg: var(--pos-primary);
    padding: 6px;
    box-shadow: 0 12px 32px #26262612;
    font-size: .85rem;
}

.dropdown-item {
    border-radius: 7px;
    padding: 9px 12px;
}

.pagination {
    --bs-pagination-color: var(--pos-primary);
    --bs-pagination-border-color: var(--pos-border);
    --bs-pagination-hover-color: var(--pos-primary-active);
    --bs-pagination-hover-bg: var(--pos-primary-soft);
    --bs-pagination-active-bg: var(--pos-primary);
    --bs-pagination-active-border-color: var(--pos-primary);
    --bs-pagination-focus-box-shadow: var(--pos-focus-ring);
    gap: 5px;
}

.page-link {
    border-radius: 8px;
    font-size: .85rem;
}

.modal-content {
    --bs-modal-bg: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-radius);
    box-shadow: 0 20px 60px #26262620;
}

.modal-header,
.modal-footer {
    border-color: var(--pos-border);
    padding: 18px 24px;
}

.modal-body {
    background-color: var(--pos-surface);
    padding: 24px;
}

.alert {
    border-radius: 10px;
    font-size: .875rem;
}

.swal2-popup {
    border-radius: var(--pos-radius);
    font-family: var(--bs-body-font-family);
}

.swal2-popup .swal2-title {
    font-size: 1.35rem;
}

.swal2-popup .swal2-styled.swal2-confirm {
    background-color: var(--pos-primary);
    border-radius: var(--pos-control-radius);
}

/* Reusable content patterns. */
.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0 0 28px;
}

.stats-grid>.card {
    flex: 1 1 190px;
    width: auto;
    min-width: min(100%, 190px);
    padding: 20px !important;
}

.product-grid {
    row-gap: 16px;
}

.product-tile {
    height: 100%;
    padding: 20px;
    border: 1px solid var(--pos-border);
    background: var(--pos-surface);
    border-radius: 12px;
    transition: border-color .15s, box-shadow .15s;
}

.product-tile:hover {
    border-color: #c7c7c7;
    box-shadow: var(--pos-shadow);
}

.product-tile h5 {
    margin-bottom: 12px;
}

.product-tile p {
    color: var(--pos-muted);
    font-size: .85rem;
}

.billing-history-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.billing-history-search {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid var(--pos-border);
    border-radius: 14px;
    background: var(--pos-subtle);
}

.billing-history-search-field {
    flex: 0 1 250px;
    min-width: 0;
}

.billing-history-customer-field {
    flex: 1 1 360px;
}

.billing-history-search .form-label {
    margin-bottom: 6px;
    color: var(--pos-muted);
    font-size: .8rem;
}

.billing-history-search .input-group-text {
    min-width: 42px;
    justify-content: center;
}

.billing-history-clear {
    min-height: 42px;
    white-space: nowrap;
}

.billing-history-list {
    display: grid;
    gap: 8px;
}

.billing-history-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--pos-border);
    border-radius: 14px;
    background: var(--pos-surface);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.billing-history-card:hover {
    border-color: #c7c7c7;
    box-shadow: var(--pos-shadow);
}

.billing-history-card-main {
    min-width: 0;
    flex: 1 1 auto;
}

.billing-history-card-topline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.billing-history-bill-number {
    font-size: 1rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.billing-history-status {
    padding: 3px 9px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #067647;
    font-size: .72rem;
    white-space: nowrap;
}

.billing-history-card-details {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(170px, 1fr) minmax(130px, .7fr);
    gap: 8px 16px;
}

.billing-history-detail {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.billing-history-detail-label {
    color: var(--pos-muted);
    font-size: .73rem;
}

.billing-history-detail-value {
    overflow-wrap: anywhere;
    font-size: .86rem;
}

.billing-history-card-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.billing-history-card-actions .btn {
    min-height: 40px;
}

.billing-history-empty,
.billing-history-loading {
    display: flex;
    min-height: 230px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--pos-muted);
    text-align: center;
}

.billing-history-empty h3 {
    margin: 4px 0 0;
    color: var(--pos-text);
    font-size: 1rem;
}

.billing-history-empty-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 16px;
    background: var(--pos-subtle);
    color: var(--pos-muted);
    font-size: 1.2rem;
}

#billingHistoriesHTML[aria-busy="true"] {
    opacity: .68;
}

.loading-skeleton-table,
.loading-skeleton-cards,
.loading-skeleton-catalog {
    display: grid;
    gap: 12px;
}

.loading-skeleton-row {
    display: grid;
    grid-template-columns: minmax(32px, .3fr) minmax(100px, 2fr) minmax(70px, 1fr) minmax(90px, .8fr);
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--pos-border);
}

.loading-skeleton-cards {
    grid-template-columns: 1fr;
}

.loading-skeleton-card,
.loading-skeleton-product {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--pos-border);
    border-radius: 14px;
    background: var(--pos-surface);
}

.loading-skeleton-product {
    min-height: 142px;
}

.loading-skeleton {
    position: relative;
    display: block;
    width: 100%;
    height: 14px;
    overflow: hidden;
    border-radius: 7px;
    background: var(--pos-primary-soft);
}

.loading-skeleton::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, #ffffffa8, transparent);
    content: "";
    transform: translateX(-100%);
    animation: loading-skeleton-shimmer 1.35s infinite;
}

.loading-skeleton-short {
    width: 38%;
}

.loading-skeleton-wide {
    width: 78%;
}

.loading-skeleton-actions {
    width: 64px;
}

.loading-skeleton-select {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: var(--pos-muted);
}

.loading-skeleton-select .loading-skeleton {
    width: 100px;
}

@keyframes loading-skeleton-shimmer {
    to {
        transform: translateX(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .loading-skeleton::after {
        animation: none;
    }
}

@media (max-width: 991.98px) {
    .app-sidebar {
        width: 220px;
        flex-basis: 220px;
    }

    .app-content {
        padding: 16px !important;
    }

    .app-topbar {
        padding: 16px 20px;
    }
}

@media (max-width: 767.98px) {
    .app-content {
        padding: 12px !important;
    }

    .card.p-4 {
        padding: 16px !important;
    }

    .app-topbar {
        padding: 12px 16px;
        min-height: 68px;
    }

    .app-content .row>[class*='col-lg']+[class*='col-lg'] {
        margin-top: 12px;
    }

    .stats-grid>.card {
        margin-top: 0 !important;
    }

    .card h2 .btn {
        margin-top: 8px;
    }

    .billing-history-search {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        padding: 14px;
    }

    .billing-history-search-field,
    .billing-history-customer-field {
        flex: 1 1 auto;
    }

    .billing-history-clear {
        align-self: flex-start;
    }

    .billing-history-card {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        padding: 14px;
    }

    .billing-history-card-details {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .billing-history-card-actions {
        justify-content: flex-end;
        padding-top: 12px;
        border-top: 1px solid var(--pos-border);
    }

    .table> :not(caption)>*>* {
        padding: 7px 8px;
    }

    .table-responsive.data-table-responsive {
        overflow: visible;
    }

    .data-table {
        width: 100% !important;
        table-layout: auto;
        font-size: .8rem;
    }

    .data-table th {
        white-space: normal;
        line-height: 1.35;
    }

    .data-table td {
        overflow-wrap: anywhere;
    }

    .data-table .btn {
        min-width: 34px;
        min-height: 34px;
        padding: 6px 8px;
        margin: .1875rem;
    }

    .dt-container {
        width: 100%;
    }

    .dt-container .dt-layout-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 12px;
        margin: 10px 0;
    }

    .dt-container .dt-layout-cell {
        flex: 1 1 auto;
        min-width: 0;
    }

    .dt-container .dt-search {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
    }

    .dt-container .dt-search input {
        width: min(58vw, 230px);
        margin: 0;
    }

    .dt-container .dt-length select {
        min-height: 36px;
    }

    .dt-container .dt-info {
        padding-top: 4px;
        font-size: .75rem;
        line-height: 1.5;
    }

    .dt-container .dt-paging .pagination {
        flex-wrap: wrap;
        gap: 2px;
    }

    .dt-container .dt-paging .page-link {
        min-width: 36px;
        min-height: 36px;
        display: grid;
        place-items: center;
        padding: 6px;
    }

    table.dataTable>tbody>tr.child>td {
        padding: 10px 12px;
        background: var(--pos-subtle);
    }

    table.dataTable>tbody>tr.child ul.dtr-details {
        display: grid;
        gap: 6px;
        width: 100%;
    }

    table.dataTable>tbody>tr.child ul.dtr-details>li {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 6px 0;
        border-bottom: 1px solid var(--pos-border);
    }

    table.dataTable>tbody>tr.child ul.dtr-details>li:last-child {
        border-bottom: 0;
    }

    table.dataTable>tbody>tr.child span.dtr-title {
        flex: 0 0 38%;
        color: var(--pos-muted);
        font-weight: 600;
    }

    table.dataTable>tbody>tr.child span.dtr-data {
        min-width: 0;
        text-align: right;
        overflow-wrap: anywhere;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}

@media print {
    body {
        background: white;
        color: black;
    }

    .app-sidebar,
    .app-topbar {
        display: none !important;
    }

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

    .card {
        box-shadow: none;
    }

    .table-responsive {
        overflow: visible;
    }
}

.app-main>.navbar a {
    color: var(--pos-muted) !important;
}

.app-main>.navbar a:hover {
    color: var(--pos-primary) !important;
}
/* Semantic alerts and profile colors retain their original colors. */
.swal2-popup .swal2-styled.swal2-cancel {
    border-radius: var(--pos-control-radius);
}

.app-sidebar {
    overflow-x: hidden;
    transition: width .2s ease, flex-basis .2s ease;
}

.app-sidebar-toggle {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    color: var(--pos-text);
    border-color: var(--pos-border);
}

.app-sidebar-toggle:hover {
    color: var(--pos-primary);
}

.app-shell.sidebar-collapsed .app-sidebar {
    width: 76px;
    flex-basis: 76px;
}

.app-shell.sidebar-collapsed .app-sidebar .sidebar {
    padding: 24px 8px !important;
}

.app-shell.sidebar-collapsed .app-sidebar .app-menu > .row {
    justify-content: center !important;
    padding-inline: 0 !important;
}

.app-shell.sidebar-collapsed .app-sidebar .app-menu > .row .col-auto {
    display: flex;
    justify-content: center;
    width: 100%;
}

.app-shell.sidebar-collapsed .app-sidebar .app-menu > .row .col-lg,
.app-shell.sidebar-collapsed .app-sidebar .app-menu .menu-label,
.app-shell.sidebar-collapsed .app-sidebar .app-menu .menu-section-label {
    display: none;
}

.app-shell.sidebar-collapsed .app-sidebar .app-menu .nav {
    align-items: center;
}

.app-shell.sidebar-collapsed .app-sidebar .app-menu .nav-item {
    width: 100%;
}

.app-shell.sidebar-collapsed .app-sidebar .app-menu .nav-item > a {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    padding-inline: 0 !important;
}

.app-shell.sidebar-collapsed .app-sidebar .app-menu .nav-item > a i {
    width: 1.25rem;
    margin-right: 0 !important;
    text-align: center;
}

.dashboard-chart {
    position: relative;
    height: 320px;
}

.select2-selection__rendered {
    padding: 8px 10px 10px 10px !important;
}

.select2-selection__choice {
    background-color: var(--pos-primary-soft) !important;
    color: var(--pos-primary) !important;
    border-color: var(--pos-primary-soft) !important;
}

@media (prefers-reduced-motion: reduce) {
    .app-sidebar {
        transition: none;
    }
}