:root {
    --bs-primary: #1f7a8c;
    --bs-primary-rgb: 31, 122, 140;
}

.login-page {
    min-height: 100vh;
}

.login-logo {
    letter-spacing: 0;
}

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

.app-main,
.app-content,
.transaction-card {
    position: relative;
}

.mypos-sidebar {
    background: #1f252b !important;
    color: #e9ecef;
    min-height: 100vh;
}

.mypos-sidebar .sidebar-brand,
.mypos-sidebar .sidebar-wrapper {
    background: #1f252b !important;
}

.mypos-sidebar .sidebar-wrapper {
    min-height: calc(100vh - 57px);
    overflow-y: auto;
    scrollbar-color: rgba(255,255,255,.25) transparent;
}

.mypos-sidebar .nav-header {
    color: rgba(255, 255, 255, .72);
}

.mypos-sidebar .nav-link {
    color: rgba(255, 255, 255, .86);
}

.mypos-sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.mypos-sidebar .nav-link.active {
    color: #fff;
    background: #1f7a8c;
}

.mypos-sidebar .nav-link.disabled {
    color: rgba(255, 255, 255, .38) !important;
    opacity: 1;
    background: transparent;
}

.navbar-badge {
    font-size: .75rem;
    line-height: 1;
    min-width: 20px;
    padding: .3rem .4rem;
    position: absolute;
    right: 0;
    top: .15rem;
}

.mypos-theme-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--bs-navbar-color);
    display: inline-flex;
    height: 40px;
    justify-content: center;
    padding: 0;
    width: 40px;
}

.mypos-theme-toggle:hover,
.mypos-theme-toggle:focus {
    color: var(--bs-navbar-hover-color);
}

.mypos-login-theme-toggle {
    align-items: center;
    display: inline-flex;
    gap: .35rem;
    position: fixed;
    right: 1rem;
    top: 1rem;
    z-index: 10;
}

.receivable-notif-menu {
    min-width: 280px;
}

.notif-dot {
    border: 1px solid #000;
    border-radius: 50%;
    display: inline-block;
    height: 18px;
    margin-right: .45rem;
    vertical-align: -3px;
    width: 18px;
}

.notif-dot-red {
    background: #f0182f;
}

.notif-dot-yellow {
    background: #ffea00;
}

.notif-dot-blue {
    background: #0dcaf0;
}

.reminder-modal {
    border: 0;
    border-radius: 6px;
}

.reminder-modal .modal-body {
    padding: 2.5rem 2rem 1.5rem;
}

.reminder-icon {
    align-items: center;
    border: 4px solid #f4b57c;
    border-radius: 50%;
    color: #f2a900;
    display: inline-flex;
    font-size: 2.5rem;
    height: 88px;
    justify-content: center;
    line-height: 1;
    margin-bottom: 1.4rem;
    width: 88px;
}

.reminder-title {
    color: #575757;
    font-size: 1.85rem;
    margin-bottom: 1.2rem;
}

.reminder-lines {
    display: inline-block;
    text-align: left;
}

.reminder-line {
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

@media (min-width: 992px) {
    .layout-fixed .mypos-sidebar {
        bottom: 0;
        height: 100vh;
        position: fixed;
        top: 0;
        z-index: 1038;
    }

    .sidebar-overlay {
        display: none !important;
        pointer-events: none !important;
    }
}

body:not(.modal-open) .modal.fade:not(.show),
body:not(.modal-open) .modal-backdrop,
body:not(.modal-open) .offcanvas-backdrop {
    display: none !important;
    pointer-events: none !important;
}

.chart-box {
    min-height: 320px;
}

.dashboard-chart-card .chart-box {
    min-height: 530px;
}

.small-box h3 {
    font-size: 1.35rem;
    line-height: 1.2;
}

.table {
    vertical-align: middle;
}

.table-sort-link {
    align-items: center;
    color: inherit;
    display: inline-flex;
    gap: .35rem;
    text-decoration: none;
    white-space: nowrap;
}

.table-sort-link:hover,
.table-sort-link:focus {
    color: var(--bs-primary);
}

.table-sort-link .bi {
    font-size: .82rem;
    opacity: .55;
}

.table-sort-link.is-active .bi {
    color: var(--bs-primary);
    opacity: 1;
}

th.text-end .table-sort-link {
    justify-content: flex-end;
    width: 100%;
}

.table-number {
    width: 64px;
}

.table-actions {
    width: 120px;
}

.btn-group form {
    display: inline-flex;
}

.product-thumb {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: .35rem;
    border: 1px solid var(--bs-border-color);
}

.product-preview {
    width: 180px;
    height: 135px;
    object-fit: cover;
    border-radius: .5rem;
    border: 1px solid var(--bs-border-color);
}

.product-detail-row,
.transaction-detail-row,
.js-transaction-detail-row {
    cursor: pointer;
}

.product-detail-row:focus,
.transaction-detail-row:focus,
.js-transaction-detail-row:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: -2px;
}

.product-detail-image {
    aspect-ratio: 4 / 3;
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    object-fit: contain;
    width: 100%;
}

.product-detail-empty {
    align-items: center;
    aspect-ratio: 4 / 3;
    border: 1px dashed var(--bs-border-color);
    border-radius: 6px;
    display: flex;
    justify-content: center;
}

.product-detail-list dt,
.product-detail-list dd {
    margin-bottom: .65rem;
}

.transaction-number-input {
    min-width: 92px;
}

.stock-physical-input {
    min-width: 104px;
}

.transaction-card {
    border-top: 3px solid #0d6efd;
    border-radius: 6px;
}

.transaction-business-row {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.transaction-business-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .35rem;
}

.transaction-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    justify-content: flex-end;
}

.transaction-meta-table th,
.transaction-entry-table th {
    background: #f3f4f6;
    color: #2f3439;
    font-weight: 700;
    white-space: nowrap;
}

.transaction-meta-table th {
    width: 120px;
}

.transaction-meta-table td {
    min-width: 260px;
}

.transaction-entry-table th {
    background: #e9ecef;
}

.transaction-entry-table td,
.transaction-entry-table th {
    padding: .35rem;
}

.transaction-cart-table thead th {
    background: #17a2b8;
    border-color: rgba(255, 255, 255, .45);
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
}

.transaction-empty-row {
    background: #f8c6cf !important;
    color: #7f1d1d;
    padding: .45rem .5rem !important;
}

.transaction-total-input {
    background: #e9ecef;
    color: #dc3545;
    font-size: 1.1rem;
    font-weight: 700;
    height: 46px;
    text-align: right;
}

.transaction-add-button {
    min-width: 124px;
}

.transaction-modal-row {
    align-items: center;
    display: grid;
    gap: .75rem;
    grid-template-columns: 130px 10px minmax(0, 1fr);
    margin-bottom: .45rem;
}

.transaction-modal-row label {
    font-weight: 700;
    margin-bottom: 0;
}

.transaction-payment-choice {
    background: #eef0f2;
    padding: .45rem;
}

.debt-card {
    border-radius: 6px;
}

.debt-card .card-header {
    border-radius: 6px 6px 0 0;
}

.debt-table thead th {
    background: #e9ecef;
    color: #454b51;
    font-weight: 700;
    vertical-align: middle;
    white-space: nowrap;
}

.debt-table td {
    vertical-align: top;
}

.debt-action-cell {
    width: 56px;
}

.debt-action-buttons {
    align-items: center;
    display: inline-flex;
    flex-wrap: nowrap;
    gap: .35rem;
    justify-content: center;
    white-space: nowrap;
}

.debt-action-buttons .btn {
    flex: 0 0 auto;
}

.debt-info-grid {
    display: grid;
    gap: 1rem 2rem;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.debt-status-badge {
    font-size: .9rem;
    padding: .45rem .75rem;
}

.debt-update-form {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.debt-note-input {
    flex: 1 1 320px;
}

.debt-proof-input {
    flex: 0 1 300px;
}

.payment-proof-link {
    font-weight: 600;
}

.payment-proof-preview {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    max-height: 160px;
    max-width: 240px;
    object-fit: contain;
    padding: .25rem;
}

.transaction-proof-box {
    border-top: 1px solid var(--bs-border-color);
    padding-top: .75rem;
}

.transaction-proof-button {
    background: transparent;
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    padding: .25rem;
}

.transaction-proof-button img {
    display: block;
    max-height: 150px;
    max-width: 220px;
    object-fit: contain;
}

.payment-proof-zoom {
    align-items: center;
    background: rgba(0, 0, 0, .86);
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    padding: 5rem 1rem 1rem;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 2000;
}

.payment-proof-zoom[hidden] {
    display: none;
}

.payment-proof-zoom-toolbar {
    display: flex;
    gap: .5rem;
    position: fixed;
    right: 1rem;
    top: 1rem;
    z-index: 2001;
}

.payment-proof-zoom-stage {
    height: 100%;
    overflow: auto;
    text-align: center;
    width: 100%;
}

.payment-proof-zoom-stage img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transform-origin: center center;
    transition: transform .15s ease;
}

.payment-proof-zoom-open {
    overflow: hidden;
}

.report-criteria-card,
.report-info-card,
.report-data-card,
.report-detail-card,
.report-grand-card {
    border-radius: 6px;
}

.report-criteria-card {
    border-top: 3px solid #0d6efd;
}

.report-criteria-card .card-header,
.report-info-card .card-header,
.report-data-card .card-header {
    border-radius: 6px 6px 0 0;
}

.report-data-card thead th,
.report-detail-card thead th {
    background: #f8f9fa;
    color: #1f2933;
    font-weight: 700;
    vertical-align: middle;
}

.report-detail-card {
    border-top: 3px solid #6c757d;
}

.report-detail-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.75rem;
}

.report-grand-card {
    border-top: 3px solid #198754;
}

.finance-filter-card {
    border-top: 3px solid #0d6efd;
    border-radius: 6px;
}

.finance-date-input {
    max-width: 170px;
}

.finance-box {
    border-radius: 4px;
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .12);
    min-height: 112px;
    overflow: hidden;
    position: relative;
}

.finance-box .inner {
    padding: 16px;
}

.finance-box h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: .25rem;
}

.finance-box p {
    margin-bottom: 0;
}

.finance-box-icon {
    bottom: 18px;
    color: rgba(0, 0, 0, .18);
    font-size: 4.25rem;
    line-height: 1;
    position: absolute;
    right: 28px;
}

.finance-table-card {
    border-radius: 6px;
}

.finance-table-card thead th {
    background: #f8f9fa;
    color: #1f2933;
    font-weight: 700;
    vertical-align: middle;
}

.invoice-sheet {
    background: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    padding: 1.25rem;
}

.invoice-title {
    color: #2f5ea7;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0;
}

.invoice-table thead th {
    background: #2f5ea7;
    color: #fff;
}

.invoice-recap-body {
    background: #fff;
    color: #111;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    margin: 0;
}

.invoice-recap-actions {
    margin: 18px auto 0;
    max-width: 920px;
    text-align: right;
}

.invoice-recap-actions button {
    background: #0d6efd;
    border: 0;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font: inherit;
    padding: 8px 16px;
}

.invoice-recap-actions .invoice-recap-back-button {
    background: #6c757d;
    margin-left: 8px;
}

.invoice-recap-page {
    margin: 18px auto;
    max-width: 920px;
}

.invoice-recap-header {
    border-collapse: collapse;
    margin-bottom: 20px;
    width: 100%;
}

.invoice-recap-header td {
    vertical-align: top;
    width: 50%;
}

.invoice-recap-logo {
    display: block;
    margin-bottom: 5px;
    max-height: 60px;
    max-width: 120px;
    object-fit: contain;
}

.invoice-recap-title-cell {
    text-align: right;
}

.invoice-recap-title-cell h1 {
    color: #2f5ea7;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: .5px;
    margin: 0 0 6px;
}

.invoice-recap-customer {
    line-height: 1.45;
    margin-bottom: 18px;
}

.invoice-recap-customer-name {
    font-weight: 700;
}

.invoice-recap-box {
    border: 1px solid #dcdcdc;
    margin-bottom: 30px;
}

.invoice-recap-box-header {
    background: #6c757d;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
}

.invoice-recap-badge {
    border-radius: .7rem;
    color: #fff;
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1;
    padding: .35rem .6rem;
}

.invoice-recap-badge.is-paid {
    background: #28a745;
}

.invoice-recap-badge.is-unpaid {
    background: #dc3545;
}

.invoice-recap-table,
.invoice-recap-total {
    border-collapse: collapse;
    width: 100%;
}

.invoice-recap-table th,
.invoice-recap-table td,
.invoice-recap-total td {
    border: 1px solid #333;
    padding: 6px;
}

.invoice-recap-table th {
    background: #2f5ea7;
    color: #fff;
    text-align: center;
}

.invoice-recap-summary-row td {
    font-weight: 600;
}

.invoice-recap-empty {
    color: #6c757d;
    text-align: center;
}

.invoice-recap-total {
    margin-top: 10px;
}

.invoice-recap-total td:first-child {
    font-size: 14px;
    text-align: right;
    width: 70%;
}

.invoice-recap-total td:last-child {
    font-size: 14px;
    width: 30%;
}

.invoice-recap-payment {
    color: #6c757d;
    line-height: 1.4;
    margin-top: 28px;
    width: 50%;
}

.invoice-recap-payment p {
    margin: 0 0 13px;
}

.invoice-recap-footer {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr 1fr;
    margin-top: 34px;
}

.invoice-recap-signature {
    text-align: right;
}

.user-card,
.level-card,
.access-card,
.setting-card,
.access-group-card {
    border-radius: 6px;
}

.user-card,
.level-card,
.setting-card,
.access-group-card {
    border-top: 3px solid #0d6efd;
}

.user-table thead th {
    background: #f8f9fa;
    color: #1f2933;
    font-weight: 700;
    vertical-align: middle;
    white-space: nowrap;
}

.user-table td {
    vertical-align: middle;
}

.user-action-button {
    align-items: center;
    display: inline-flex;
    gap: .35rem;
}

.access-card > .card-body {
    background: #fff;
}

.access-group-card + .access-group-card {
    margin-top: 1.25rem;
}

.access-group-card .card-header {
    background: #f8f9fa;
}

.setting-logo-preview {
    border: 1px solid var(--bs-border-color);
    border-radius: 4px;
    height: 120px;
    object-fit: contain;
    padding: .25rem;
    width: 120px;
}

.setting-logo-empty {
    align-items: center;
    border: 1px dashed var(--bs-border-color);
    border-radius: 4px;
    display: inline-flex;
    height: 120px;
    justify-content: center;
    width: 120px;
}

.setting-favicon-preview {
    border: 1px solid var(--bs-border-color);
    border-radius: 4px;
    height: 48px;
    object-fit: contain;
    padding: .25rem;
    width: 48px;
}

.setting-favicon-empty {
    align-items: center;
    border: 1px dashed var(--bs-border-color);
    border-radius: 4px;
    display: inline-flex;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.setting-upload-preview {
    min-height: .25rem;
}

.setting-upload-preview img:not(.d-none) {
    display: block;
    margin: .25rem 0 .5rem;
}

[data-bs-theme="dark"] .transaction-meta-table th,
[data-bs-theme="dark"] .transaction-entry-table th,
[data-bs-theme="dark"] .debt-table thead th,
[data-bs-theme="dark"] .report-data-card thead th,
[data-bs-theme="dark"] .report-detail-card thead th,
[data-bs-theme="dark"] .finance-table-card thead th,
[data-bs-theme="dark"] .user-table thead th {
    background: #252b31;
    color: #e9ecef;
}

[data-bs-theme="dark"] .transaction-entry-table th {
    background: #2c333a;
}

[data-bs-theme="dark"] .transaction-empty-row {
    background: #4a1f28 !important;
    color: #ffd8de;
}

[data-bs-theme="dark"] .transaction-total-input {
    background: #252b31;
    color: #ff8f9d;
}

[data-bs-theme="dark"] .transaction-payment-choice,
[data-bs-theme="dark"] .access-card > .card-body,
[data-bs-theme="dark"] .access-group-card .card-header {
    background: #212529;
}

[data-bs-theme="dark"] .setting-logo-empty,
[data-bs-theme="dark"] .setting-favicon-empty,
[data-bs-theme="dark"] .setting-logo-preview,
[data-bs-theme="dark"] .setting-favicon-preview {
    background: #1b1f23;
}

[data-bs-theme="dark"] .small-box,
[data-bs-theme="dark"] .finance-box {
    box-shadow: 0 .125rem .35rem rgba(0, 0, 0, .45);
}

[data-bs-theme="dark"] .invoice-sheet {
    background: var(--bs-body-bg);
}

[data-bs-theme="dark"] .debt-table .table-danger {
    --bs-table-bg: #4a1f28;
    --bs-table-border-color: #74303b;
    --bs-table-color: #ffd7dd;
    --bs-table-color-state: #fff;
    --bs-table-hover-bg: #572631;
    --bs-table-striped-bg: #52242e;
    color: var(--bs-table-color);
}

[data-bs-theme="dark"] .debt-table tr.table-danger > * {
    color: #fff !important;
}

[data-bs-theme="dark"] .debt-table .table-warning {
    --bs-table-bg: #463b1b;
    --bs-table-border-color: #756431;
    --bs-table-color: #ffe8a3;
    --bs-table-color-state: #fff;
    --bs-table-hover-bg: #524620;
    --bs-table-striped-bg: #4f421e;
    color: var(--bs-table-color);
}

[data-bs-theme="dark"] .debt-table tr.table-warning > * {
    color: #fff !important;
}

[data-bs-theme="dark"] .debt-table .table-info {
    --bs-table-bg: #143a46;
    --bs-table-border-color: #286374;
    --bs-table-color: #a8efff;
    --bs-table-color-state: #fff;
    --bs-table-hover-bg: #194756;
    --bs-table-striped-bg: #174350;
    color: var(--bs-table-color);
}

[data-bs-theme="dark"] .debt-table tr.table-info > * {
    color: #fff !important;
}

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

@media print {
    @page {
        margin: 15mm;
        size: A4 portrait;
    }

    .no-print,
    .app-header,
    .app-sidebar,
    .app-footer,
    .app-content-header {
        display: none !important;
    }

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

    .invoice-sheet {
        border: 0;
        padding: 0;
    }

    .invoice-page-break {
        break-after: page;
        page-break-after: always;
    }

    #toolbarContainer,
    #debug-bar,
    #debug-icon {
        display: none !important;
    }

    .invoice-recap-body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        width: 100%;
    }

    .invoice-recap-page {
        margin: 0;
        max-width: none;
    }
}

@media (max-width: 767.98px) {
    .transaction-business-row {
        align-items: stretch;
        flex-direction: column;
    }

    .transaction-action-group {
        justify-content: flex-start;
    }

    .transaction-meta-table td {
        min-width: 180px;
    }

    .transaction-modal-row {
        grid-template-columns: 1fr;
        gap: .25rem;
    }

    .transaction-modal-row > span {
        display: none;
    }

    .debt-info-grid {
        grid-template-columns: 1fr;
    }
}
