@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

@keyframes page-transition-in {
    from {
        opacity: 0;
    }
}

.app-confirm-dialog.is-return-review #appConfirmMessage {
    width: 100%;
    padding: 0.8rem;
    background: var(--light-gray);
    border-radius: 6px;
    text-align: left;
    white-space: pre-line;
}

@media (prefers-reduced-motion: reduce) {
    main {
        animation: none;
    }
}

.app-confirm-password-label,
.app-confirm-password-wrap,
.app-confirm-pin-label,
.app-confirm-pin-inputs {
    display: none;
}

.app-confirm-dialog .app-confirm-error[hidden] {
    display: none;
}

.app-confirm-error {
    margin: 0.65rem 0 0;
    color: #b42318;
    font-size: 0.85rem;
    text-align: left;
}

.app-confirm-password[aria-invalid="true"] {
    border-color: #b42318 !important;
    outline-color: #b42318;
}

.app-confirm-dialog .app-confirm-accept:disabled {
    cursor: wait;
    opacity: 0.7;
}

.app-confirm-dialog.requires-password .app-confirm-password-label,
.app-confirm-dialog.requires-password .app-confirm-password-wrap {
    display: block;
    width: 100%;
}

.app-confirm-dialog.requires-password .app-confirm-password-label {
    margin: 1rem 0 0.35rem;
    color: var(--text-color, #292929);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
}

.app-confirm-dialog.requires-password .app-confirm-password {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-height: 2.8rem;
    padding: 0.65rem 2.8rem 0.65rem 0.8rem;
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 0.6rem;
    background: var(--card-bg, #fff);
    color: var(--text-color, #292929);
}

.app-confirm-password-wrap {
    position: relative;
}

.app-confirm-password-toggle {
    position: absolute;
    top: 50%;
    right: 0.65rem;
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    padding: 0;
    color: var(--text-color, #292929);
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transform: translateY(-50%);
}

.app-confirm-password-toggle:hover {
    background: var(--light-gray, #f1f1f1);
}

.app-confirm-dialog.requires-password .app-confirm-password-toggle {
    display: grid;
}

.app-confirm-password-toggle {
    display: none;
}

.app-confirm-dialog.requires-password.has-pin .app-confirm-methods {
    display: grid;
}

.app-confirm-methods {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    margin: 1rem 0 0.75rem;
    padding: 0.25rem;
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 0.65rem;
    background: var(--light-gray, #f1f1f1);
}

.app-confirm-methods[hidden] {
    display: none !important;
}

.app-confirm-method {
    min-height: 2.45rem;
    padding: 0.4rem 0.6rem;
    border: 0;
    border-radius: 0.45rem;
    background: transparent;
    color: var(--text-color, #292929);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.app-confirm-method.is-active {
    background: var(--primary-green, #cf1018);
    color: #fff;
}

.app-confirm-method:focus-visible,
.app-confirm-pin-inputs input:focus-visible {
    outline: 2px solid var(--primary-green, #cf1018);
    outline-offset: 2px;
}

.app-confirm-dialog.requires-password.has-pin.is-pin-mode .app-confirm-password-label,
.app-confirm-dialog.requires-password.has-pin.is-pin-mode .app-confirm-password-wrap {
    display: none;
}

.app-confirm-dialog.requires-password.has-pin.is-pin-mode .app-confirm-pin-label {
    display: block;
    margin: 1rem 0 0.35rem;
    color: var(--text-color, #292929);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
}

.app-confirm-dialog.requires-password.has-pin.is-pin-mode .app-confirm-pin-inputs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
    margin: 0.4rem 0 1rem;
}

.app-confirm-pin-inputs input {
    box-sizing: border-box;
    min-width: 0;
    min-height: 3rem;
    margin: 0;
    padding: 0.25rem;
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 0.55rem;
    background: var(--card-bg, #fff);
    color: var(--text-color, #292929);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
}

.users-access-gate {
    display: grid;
    box-sizing: border-box;
    width: 100%;
    min-height: 100vh;
    place-items: center;
    padding: 1.5rem;
}

.users-access-card {
    position: relative;
    box-sizing: border-box;
    width: min(100%, 28rem);
    min-width: 0;
    padding: clamp(1.5rem, 5vw, 2.5rem);
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 1.25rem;
    background: var(--card-bg, #fff);
    box-shadow: 0 1rem 3rem rgba(20, 25, 35, 0.1);
}

.users-access-close {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 50%;
    color: var(--text-color, #292929);
    text-decoration: none;
}

.users-access-close:hover {
    background: rgba(127, 127, 127, 0.12);
    color: var(--primary-green, #cf1018);
}

.users-access-close:focus-visible {
    outline: 2px solid var(--primary-green, #cf1018);
    outline-offset: 2px;
}

.users-access-card h1 {
    margin: 0.8rem 0 0.4rem;
}

.users-access-card p {
    color: var(--text-color, #292929);
    opacity: 0.75;
}

.users-access-card .users-access-back {
    margin-bottom: 0;
    text-align: center;
}

.users-access-card label,
.users-access-card input,
.users-access-card button {
    display: block;
    width: 100%;
}

.users-access-card input {
    box-sizing: border-box;
    min-height: 2.9rem;
    margin: 0.4rem 0 1rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 0.6rem;
    background: var(--card-bg, #fff);
    color: var(--text-color, #292929);
}

.users-access-card .users-access-password-wrap {
    position: relative;
}

.users-access-card .users-access-password-wrap input {
    padding-right: 3rem;
}

.users-access-card .users-access-methods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    margin: 1.1rem 0;
    padding: 0.25rem;
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 0.75rem;
    background: var(--light-gray, #f1f1f1);
}

.users-access-card .users-access-method {
    min-height: 2.5rem;
    padding: 0.45rem 0.6rem;
    border: 0;
    border-radius: 0.55rem;
    background: transparent;
    color: var(--text-color, #292929);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.users-access-card .users-access-method.is-active {
    background: var(--primary-green, #cf1018);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.users-access-card .users-access-method:focus-visible,
.users-access-card .users-access-pin-inputs input:focus-visible {
    outline: 2px solid var(--primary-green, #cf1018);
    outline-offset: 2px;
}

.users-access-card .users-access-method-panel[hidden] {
    display: none;
}

.users-access-card .users-access-pin-inputs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0.4rem 0 1rem;
}

.users-access-card .users-access-pin-inputs input {
    min-width: 0;
    min-height: 3.15rem;
    margin: 0;
    padding: 0.25rem;
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 0.6rem;
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
}

.users-access-card .users-access-password-toggle {
    position: absolute;
    top: 50%;
    right: 0.45rem;
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    padding: 0;
    color: var(--text-color, #292929);
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transform: translateY(-50%);
}

.users-access-card .users-access-password-toggle:hover {
    background: rgba(127, 127, 127, 0.12);
    color: var(--primary-green, #cf1018);
}

.users-access-card .users-access-password-toggle:focus-visible {
    outline: 2px solid var(--primary-green, #cf1018);
    outline-offset: 2px;
}

.users-access-card button {
    min-height: 2.9rem;
    border: 0;
    border-radius: 0.6rem;
    background: var(--primary-green, #cf1018);
    color: #fff;
    font-weight: 600;
    text-align: center;
}

.users-access-error {
    color: #b42318 !important;
    opacity: 1 !important;
}

.management-page {
    width: min(100%, 1440px);
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2.25rem);
}

.system-guide-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(16rem, 0.65fr);
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--card-bg, #fff), var(--light-gray, #f3f4f6));
    box-shadow: 0 0.4rem 1.5rem rgba(20, 25, 35, 0.04);
}

.system-guide-hero h1 {
    margin: 0.25rem 0 0.55rem;
}

.system-guide-lead {
    max-width: 62ch;
    margin: 0;
    color: var(--text-color, #292929);
    opacity: 0.78;
}

.system-guide-welcome {
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 0.85rem;
    background: var(--card-bg, #fff);
}

.system-guide-welcome > strong {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.system-guide-welcome > p {
    margin: 0.5rem 0 0.85rem;
    color: var(--text-color, #292929);
    font-size: 0.9rem;
    opacity: 0.78;
}

.system-guide-action {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.8rem;
    color: #fff;
    background: var(--primary-green, #cf1018);
    border: 1px solid var(--primary-green, #cf1018);
    border-radius: 0.55rem;
    font-weight: 600;
    text-decoration: none;
}

.system-guide-action:hover,
.system-guide-action:focus-visible {
    color: #fff;
    filter: brightness(0.92);
}

.system-guide-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 0.85rem;
    background: var(--card-bg, #fff);
}

.system-guide-toc a {
    padding: 0.45rem 0.7rem;
    color: var(--text-dark, #222);
    background: var(--light-gray, #f3f4f6);
    border-radius: 999px;
    font-size: 0.87rem;
    font-weight: 600;
    text-decoration: none;
}

.system-guide-toc a:hover,
.system-guide-toc a:focus-visible {
    color: var(--primary-green, #cf1018);
    outline: 2px solid currentColor;
    outline-offset: 1px;
}

.system-guide-section {
    scroll-margin-top: 1.25rem;
    margin: 0 0 2rem;
}

.system-guide-section-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.system-guide-section-header h2 {
    margin: 0 0 0.2rem;
    font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.system-guide-section-header p {
    margin: 0;
    color: var(--text-color, #292929);
    font-size: 0.9rem;
    opacity: 0.72;
}

.system-guide-section-icon {
    display: grid;
    flex: 0 0 2.7rem;
    place-items: center;
    width: 2.7rem;
    height: 2.7rem;
    color: var(--primary-green, #cf1018);
    background: var(--light-gray, #f3f4f6);
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 0.8rem;
    font-size: 1.2rem;
}

.system-guide-routine {
    display: grid;
    gap: 0.7rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.system-guide-routine li {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 0.8rem;
    background: var(--card-bg, #fff);
}

.system-guide-routine li > span {
    display: grid;
    flex: 0 0 1.8rem;
    place-items: center;
    width: 1.8rem;
    height: 1.8rem;
    color: #fff;
    background: var(--primary-green, #cf1018);
    border-radius: 50%;
    font-weight: 700;
}

.system-guide-routine strong {
    display: block;
    margin-bottom: 0.2rem;
}

.system-guide-routine p {
    margin: 0;
    color: var(--text-color, #292929);
    font-size: 0.9rem;
    opacity: 0.78;
}

.system-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
    gap: 0.85rem;
}

.system-guide-card {
    min-width: 0;
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 0.9rem;
    background: var(--card-bg, #fff);
    box-shadow: 0 0.35rem 1.25rem rgba(20, 25, 35, 0.035);
}

.system-guide-card h3 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.8rem;
    font-size: 1rem;
}

.system-guide-card h3 i,
.system-guide-tips-grid i {
    color: var(--primary-green, #cf1018);
}

.system-guide-card ol,
.system-guide-card ul {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding-left: 1.25rem;
    line-height: 1.55;
}

.system-guide-card p {
    margin: 0;
    line-height: 1.55;
}

.system-guide-card .system-guide-note {
    margin-top: 0.85rem;
    padding: 0.7rem 0.8rem;
    color: var(--text-color, #292929);
    background: var(--light-gray, #f3f4f6);
    border-left: 3px solid var(--primary-green, #cf1018);
    border-radius: 0.35rem;
    font-size: 0.88rem;
}

.system-guide-shortcuts {
    padding: 0 !important;
    list-style: none;
}

.system-guide-shortcuts li {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.6rem;
}

.system-guide-page kbd {
    display: inline-block;
    padding: 0.12rem 0.35rem;
    color: var(--text-dark, #222);
    background: var(--light-gray, #f3f4f6);
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 0.3rem;
    font: inherit;
    font-size: 0.78rem;
    white-space: nowrap;
}

.system-guide-return-card {
    max-width: 900px;
}

.system-guide-tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
    gap: 0.65rem;
}

.system-guide-tips-grid p {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0;
    padding: 0.8rem;
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 0.7rem;
    background: var(--card-bg, #fff);
    line-height: 1.5;
}

.system-guide-tips-grid i {
    margin-top: 0.15rem;
}

.system-guide-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #d9d9d9);
}

.system-guide-footer > span {
    color: var(--text-color, #292929);
    font-size: 0.88rem;
    opacity: 0.75;
}

@media (max-width: 760px) {
    .system-guide-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .system-guide-toc {
        gap: 0.4rem;
    }

    .system-guide-toc a {
        font-size: 0.82rem;
    }

    .system-guide-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

.management-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.management-header h1 {
    margin: 0.25rem 0;
}

.management-header p {
    margin: 0;
    color: var(--text-color, #292929);
    opacity: 0.72;
}

.management-kicker {
    color: var(--primary-green, #cf1018) !important;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.management-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.85rem;
    margin: 1.25rem 0;
}

.management-stat,
.management-panel {
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 1rem;
    background: var(--card-bg, #fff);
    box-shadow: 0 0.4rem 1.5rem rgba(20, 25, 35, 0.04);
}

.management-stat {
    display: grid;
    gap: 0.3rem;
    padding: 1rem 1.15rem;
}

.management-stat span {
    color: var(--text-color, #292929);
    font-size: 0.84rem;
    opacity: 0.72;
}

.management-stat strong {
    font-size: 1.45rem;
}

.management-panel {
    overflow: hidden;
}

.products-main > .management-panel {
    margin: 1.25rem 0;
}

.returns-record {
    grid-template-columns: minmax(12rem, 1.5fr) repeat(5, minmax(7rem, 1fr));
}

.trash-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.trash-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.35rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 0.55rem;
    background: var(--card-bg, #fff);
    color: var(--text-color, #292929);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.trash-actions .trash-restore-button {
    border-color: rgba(25, 135, 84, 0.35);
    color: #198754;
}

.trash-actions .trash-delete-button {
    border-color: rgba(207, 16, 24, 0.35);
    color: var(--primary-green, #cf1018);
}

.trash-actions button:hover {
    background: rgba(127, 127, 127, 0.08);
}

.management-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border-color, #d9d9d9);
}

.management-panel-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.management-panel-body {
    padding: 1.1rem 1.25rem;
}

.management-search {
    width: min(100%, 26rem);
    min-height: 2.6rem;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 0.65rem;
    background: var(--card-bg, #fff);
    color: var(--text-color, #292929);
}

.returns-search-tools {
    display: flex;
    flex: 1 1 32rem;
    justify-content: flex-end;
    gap: 0.65rem;
    min-width: 0;
}

.returns-search-tools label {
    flex: 1 1 15rem;
    min-width: 0;
}

.returns-search-tools .management-search {
    width: 100%;
    max-width: none;
}

.returns-search-status {
    min-height: 1.2rem;
    margin: 0;
    padding: 0 1.25rem;
    color: var(--text-color, #292929);
    font-size: 0.78rem;
    opacity: 0.75;
}

.return-entry-form {
    display: grid;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
}

.return-entry-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: 0.85rem;
}

.return-entry-fields label,
.return-serial-section > label {
    display: grid;
    gap: 0.4rem;
    color: var(--text-color, #292929);
    font-size: 0.88rem;
    font-weight: 600;
}

.return-product-picker {
    position: relative;
    display: grid;
    align-content: start;
    gap: 0.4rem;
    min-width: 0;
}

.return-product-picker > label {
    color: var(--text-color, #292929);
    font-size: 0.88rem;
    font-weight: 600;
}

.return-entry-fields input,
.return-entry-fields select,
.return-serial-entry input {
    width: 100%;
    min-width: 0;
    min-height: 2.6rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 0.6rem;
    background: var(--card-bg, #fff);
    color: var(--text-color, #292929);
}

.return-product-options {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.2rem);
    right: 0;
    left: 0;
    display: grid;
    max-height: 18rem;
    overflow: auto;
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 0.65rem;
    background: var(--card-bg, #fff);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.16);
}

.return-product-options[hidden] {
    display: none;
}

.return-product-option {
    display: grid;
    gap: 0.2rem;
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 0;
    border-bottom: 1px solid var(--border-color, #d9d9d9);
    background: transparent;
    color: var(--text-color, #292929);
    text-align: left;
    cursor: pointer;
}

.return-product-option:last-child {
    border-bottom: 0;
}

.return-product-option:hover,
.return-product-option:focus-visible {
    background: var(--surface-color, rgba(127, 127, 127, 0.1));
    outline: none;
}

.return-product-option span {
    font-size: 0.78rem;
    opacity: 0.75;
}

.return-form-status,
.return-entry-actions p,
.return-serial-section p {
    margin: 0;
    color: var(--text-color, #292929);
    font-size: 0.85rem;
}

.return-serial-section {
    display: grid;
    gap: 0.6rem;
    padding: 0.9rem;
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 0.7rem;
}

.return-serial-section[hidden] {
    display: none;
}

.return-serial-entry,
.return-entry-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.return-serial-entry button,
.return-entry-actions button {
    min-height: 2.6rem;
    padding: 0.55rem 0.9rem;
    border: 0;
    border-radius: 0.6rem;
    background: var(--primary-green, #cf1018);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.return-entry-actions {
    flex-wrap: wrap;
}

.return-entry-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.return-serial-section ul {
    display: grid;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.return-serial-section li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0.6rem;
    border-radius: 0.45rem;
    background: var(--surface-color, rgba(127, 127, 127, 0.08));
    overflow-wrap: anywhere;
}

.return-serial-section li button {
    border: 0;
    background: transparent;
    color: var(--primary-green, #cf1018);
    cursor: pointer;
}

.management-card-list {
    display: grid;
    gap: 0.8rem;
}

.management-record {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(6rem, 1fr));
    align-items: center;
    gap: 0.9rem;
    padding: 1rem;
    border: 1px solid var(--border-color, #d9d9d9);
    border-radius: 0.8rem;
    background: var(--card-bg, #fff);
}

.management-record-main {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.management-record-main strong {
    overflow-wrap: anywhere;
}

.management-record-main span,
.management-record-field span {
    color: var(--text-color, #292929);
    font-size: 0.82rem;
    opacity: 0.72;
}

.management-record-field {
    display: grid;
    gap: 0.25rem;
}

.management-badge {
    display: inline-flex;
    width: fit-content;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: rgba(207, 16, 24, 0.1);
    color: var(--primary-green, #cf1018);
    font-size: 0.8rem;
    font-weight: 600;
}

.management-empty {
    display: grid;
    justify-items: center;
    gap: 0.45rem;
    padding: 3rem 1rem;
    color: var(--text-color, #292929);
    text-align: center;
    opacity: 0.75;
}

.management-record[hidden],
.management-empty[hidden] {
    display: none !important;
}

.management-empty i {
    font-size: 2rem;
}

@media (max-width: 720px) {
    .management-header,
    .management-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .returns-search-tools {
        width: 100%;
        flex: 1 1 auto;
        flex-direction: column;
    }

    .returns-search-tools label {
        flex: 1 1 auto;
        width: 100%;
    }

    .return-serial-entry {
        align-items: stretch;
        flex-direction: column;
    }

    .management-record {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .returns-record {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .management-record-main {
        grid-column: 1 / -1;
    }
}

:root {
    /* Light mode variables */
    --primary-green: #cf1018;
    --secondary-green: #b40d14;
    --hover-green: #a20b12;
    --light-green: rgba(207, 16, 24, 0.1);
    --white: #ffffff;
    --light-gray: #f1f1f1; /* Darkened from #f8f9fa */
    --main-bg: #f1f1f1;
    --text-dark: #202124;
    --card-bg: #ffffff;
    --border-color: #d9d9d9;
    --text-color: #292929;
    --shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    --transition: width 0.28s ease, margin 0.28s ease, transform 0.28s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

[data-theme="dark"] {
    /* Dark mode variables */
    --primary-green: #f0444b;
    --secondary-green: #cf1018;
    --hover-green: #ff6268;
    --light-green: rgba(240, 68, 75, 0.18);
    --white: #1a1a1a;
    --light-gray: #2d2d2d;
    --main-bg: #121212;
    --text-dark: #ffffff;
    --card-bg: #1e1e1e;
    --border-color: #404040;
    --text-color: #e0e0e0;
    --shadow: 0 2px 15px rgba(0, 0, 0, 0.4);
    --table-hover: #2a2a2a;
    --table-stripe: #232323;
    --input-bg: #2d2d2d;
    --input-text: #ffffff;
    --modal-bg: #1e1e1e;
    --text-muted: #a0a0a0;
    --link-color: #ff777c;
    --text-dark: #ffffff;
    --text-color: #ffffff;
    --text-muted: #a0a0a0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--main-bg);
    color: var(--text-dark);
}

main {
    animation: page-transition-in 100ms ease-out both;
}

::after,
::before {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
}

li {
    list-style: none;
}

h1 {
    font-weight: 600;
    font-size: 1.5rem;
}

.wrapper {
    display: flex;
}

.main {
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    transition: all 0.35s ease-in-out;
    background-color: var(--main-bg);  /* Changed from #fcfdff */
    margin-left: 70px;
    padding: 2rem;
    transition: var(--transition);
    margin-top: 0; /* Remove top margin since we don't have a fixed navbar anymore */
    padding-top: 1rem;
}

.app-topbar {
    position: fixed;
    top: 0;
    left: 70px;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-sizing: border-box;
    width: calc(100% - 70px);
    min-width: 0;
    margin-left: 0;
    padding: 0.9rem 1rem 0.85rem 1.25rem;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--border-color, #d9d9d9);
    backdrop-filter: blur(8px);
}

#sidebar.expand ~ .app-topbar {
    left: 260px;
    width: calc(100% - 260px);
}

[data-theme="dark"] .app-topbar {
    background: rgba(18, 18, 18, 0.92);
}

.topbar-current-page {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    overflow: hidden;
    color: var(--text-dark);
    font-size: 0.82rem;
    white-space: nowrap;
}

.topbar-brand-name {
    overflow: hidden;
    color: #777;
    text-overflow: ellipsis;
}

.topbar-divider {
    color: #999;
}

.topbar-current-page strong {
    overflow: hidden;
    color: var(--text-dark);
    font-size: 0.92rem;
    font-weight: 700;
    text-overflow: ellipsis;
}

.topbar-tools {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0.75rem;
    min-width: 0;
    margin-left: auto;
}

.topbar-clock {
    color: #777;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.topbar-new-sale {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.5rem;
    padding: 0.55rem 0.9rem;
    background: var(--primary-green);
    color: #fff;
    border-radius: 0.7rem;
    font-size: 0.83rem;
    font-weight: 700;
    box-shadow: 0 0.5rem 1rem rgba(207, 16, 24, 0.18);
}

.topbar-new-sale:hover {
    background: var(--hover-green);
    color: #fff;
    transform: none;
}

.topbar-user {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.7rem;
    padding: 0.3rem 0.5rem 0.3rem 0.3rem;
    background: rgba(207, 16, 24, 0.06);
    border: 1px solid rgba(207, 16, 24, 0.12);
    border-radius: 999px;
}

.topbar-avatar {
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    background: var(--primary-green);
    color: #fff;
    border-radius: 50%;
    font-size: 0.82rem;
    font-weight: 700;
}

.topbar-user-copy {
    display: flex;
    flex-direction: column;
    max-width: 9rem;
    min-width: 0;
    overflow: hidden;
    line-height: 1.2;
}

.topbar-username {
    color: var(--text-dark);
    font-size: 0.74rem;
    font-weight: 700;
}

.topbar-role-label {
    color: #777;
    font-size: 0.62rem;
}

@media (max-width: 900px) {
    .topbar-clock {
        display: none;
    }

    .topbar-brand-name {
        display: none;
    }
}

@media (max-width: 768px) {
    .app-topbar,
    #sidebar.expand ~ .app-topbar {
        position: fixed;
        top: 0;
        left: 55px;
        width: calc(100% - 55px);
        margin-left: 0;
        gap: 0.5rem;
        padding: 0.65rem 0.6rem;
    }

    .topbar-tools {
        gap: 0.45rem;
    }

    .topbar-user-copy {
        display: none;
    }

    .topbar-new-sale {
        min-height: 2.25rem;
        padding: 0.45rem 0.6rem;
        white-space: nowrap;
    }
}

#sidebar.expand ~ .main {
    margin-left: 260px;
}

#sidebar.expand ~ .main .main-navbar {
    left: 260px;
}

#sidebar {
    width: 70px;
    min-width: 70px;
    z-index: 1000;
    background: linear-gradient(180deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    box-shadow: var(--shadow);
    position: fixed;
    height: 100vh;
    overflow: hidden;
    transition: none;
}

.sidebar-interactive #sidebar {
    transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), min-width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s ease;
}

#sidebar.expand {
    width: 260px;
    min-width: 260px;
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.18);
}

.toggle-btn {
    display: flex;
    flex: 0 0 70px;
    align-items: center;
    justify-content: center;
    width: 70px;
    min-width: 70px;
    height: 70px;
    background-color: transparent;
    cursor: pointer;
    border: 0;
    padding: 0;
}

.toggle-btn i {
    font-size: 1.5rem;
    color: #FFF;
}

/* Improved sidebar logo transition */
.sidebar-logo {
    margin: auto 0;
    opacity: 0;
    width: 0;
    transition: opacity 0.3s ease, width 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

#sidebar.expand .sidebar-logo {
    opacity: 1;
    width: 160px; /* Fixed width to prevent jumping */
    margin-left: 10px;
}

.sidebar-logo a {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#sidebar.expand .sidebar-logo a {
    opacity: 1;
    transform: translateX(0);
}

.sidebar-logo a {
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--white);
    font-size: 1.4rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#sidebar .sidebar-title,
#sidebar .sidebar-logo,
#sidebar a.sidebar-link span,
#sidebar .sidebar-section-title {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transform: translateX(-8px);
    transition: opacity 0.2s ease, max-width 0.32s ease, transform 0.28s ease;
    pointer-events: none;
}

#sidebar.expand .sidebar-title,
#sidebar.expand .sidebar-logo,
#sidebar.expand a.sidebar-link span,
#sidebar.expand .sidebar-section-title {
    opacity: 1;
    max-width: 180px;
    transform: translateX(0);
    pointer-events: auto;
}

#sidebar:not(.expand) .sidebar-nav {
    padding-top: 1.25rem;
}

#sidebar:not(.expand) .sidebar-link {
    justify-content: center;
    padding: 0.75rem 0;
    border-left: 0;
}

#sidebar:not(.expand) .sidebar-link i {
    margin-right: 0 !important;
}

.sidebar-nav {
    padding: 2rem 0;
    flex: 1 1 auto;
}

a.sidebar-link {
    position: relative;
    padding: .625rem 1.625rem;
    color: #FFF;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    white-space: nowrap;
    border-left: 3px solid transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, padding 0.25s ease;
    border-radius: 8px;
    margin: 4px 8px;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 24px; /* Fixed width for all icons */
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    transition: margin-right 0.2s ease;
}

a.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.16);
    border-left: 3px solid rgba(255, 255, 255, 0.9);
    transform: none;
}

a.sidebar-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-left-color: #fff;
    font-weight: 600;
}

#sidebar:not(.expand) a.sidebar-link.active {
    border-left-color: transparent;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

/* Card Styling */
.card {
    border-radius: 10px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    background: var(--card-bg);  /* Slightly darker card background */
    overflow: hidden;
    color: var(--text-color);
}

.card-body {
    padding: 20px;
    padding: 1.5rem;
}

.card .text-xs {
    font-size: 0.8rem;
    font-weight: bold;
}

.card .h5 {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0;
}

.card .col-auto {
    display: flex;
    align-items: center;
    justify-content: center;
}

.card .fa-2x {
    font-size: 2rem;
    color: #d1d3e2;
}

/* Card Border Colors */
.border-left-dark {
    border-left: 4px solid #343a40;
}

.border-left-danger {
    border-left: 4px solid #e74a3b;
}

.border-left-warning {
    border-left: 4px solid #f6c23e;
}

/* Earnings Overview and Revenue Sources */
.card-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 20px;
}

#earnings-overview,
#revenue-sources {
    height: 300px;
    background-color: #f4f4f4;
    border-radius: 5px;
}

h1, h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #100e0e;

}
.d-flex {
    display: flex;
    flex-wrap: wrap; /* Allow charts to wrap on smaller screens */
}
.small-chart {
    width: 300px !important;   /* Set a specific width */
    height: 300px !important;  /* Set a specific height */
    max-width: 100%;           /* Ensure it remains responsive */
    margin: 0 auto;            /* Center the canvas horizontally */
    display: block;            /* Ensure block-level display for centering */
    border-radius: 12px;
    padding: 10px;
    background: var(--white);
}

.small-card {
    width: 400px;              /* Set a specific width for this card */
    height: auto;              /* Allow height to adjust automatically */
    display: flex;
    justify-content: center;   /* Center horizontally */
    align-items: center;       /* Center vertically */
    flex-direction: column;    /* Ensure the content is stacked vertically */
}

.small-card-body {
    padding: 10px;             /* Add some padding */
    margin: 0;                 /* Optional: remove margins for this card */
    text-align: center;        /* Center-align the text inside the card */
}



/* Form Styling */
.form-group {
    margin-bottom: 10px; /* Reduced from 15px */
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

input[type="text"],
input[type="number"],
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    width: 100%;
    padding: 0.7rem 0.8rem;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 0.7rem;
    background: var(--card-bg);
    color: var(--text-dark);
    font-size: 0.96rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

input[type="text"]:focus,
input[type="number"]:focus,
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    border-color: var(--primary-green);
    outline: 3px solid rgba(207, 16, 24, 0.14);
    outline-offset: 2px;
    background: var(--card-bg);
}

button,
input,
select,
textarea,
a {
    transition: var(--transition);
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(207, 16, 24, 0.16);
    outline-offset: 2px;
}

/* Button Styling */
button {
    padding: 0.7rem 1.1rem;
    background: var(--primary-green);
    color: var(--white);
    border: none;
    border-radius: 0.8rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    margin-right: 0.35rem;
    box-shadow: 0 0.45rem 0.9rem rgba(207, 16, 24, 0.14);
}

button:hover {
    background: var(--hover-green);
    transform: translateY(-1px);
    box-shadow: 0 0.75rem 1.3rem rgba(207, 16, 24, 0.18);
}

button.delete-btn {
    background-color: #dc3545;
}

button.delete-btn:hover {
    background-color: #c82333;
}

button.edit-btn {
    background-color: #007bff;
}

button.edit-btn:hover {
    background-color: #0056b3;
}

button.stock-in-btn {
    background-color: var(--primary-green);
}

button.stock-in-btn:hover {
    background-color: var(--hover-green);
}

button.stock-out-btn {
    background-color: #ffc107;
    color: black;
}

button.stock-out-btn:hover {
    background-color: #e0a800;
}

/* Table Styling */
.table-responsive {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1rem;
    margin-bottom: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
    background: var(--white);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    table-layout: fixed;
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background: rgba(207, 16, 24, 0.04);
}

/* Column widths */
#inventoryTable th,
#inventoryTable td {
    padding: 8px;
}

#inventoryTable th:nth-child(1), /* Item ID */
#inventoryTable td:nth-child(1) {
    width: 80px;
}

#inventoryTable th:nth-child(2), /* Image */
#inventoryTable td:nth-child(2) {
    width: 100px;
}

#inventoryTable th:nth-child(8), /* Quantity */
#inventoryTable td:nth-child(8),
#inventoryTable th:nth-child(9), /* Reorder Point */
#inventoryTable td:nth-child(9) {
    width: 90px;
}

#inventoryTable th:last-child, /* Actions */
#inventoryTable td:last-child {
    width: 240px;
}

th, td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    font-size: 14px;
    color: var(--text-color);
    border-color: var(--border-color);
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
    background-color: var(--light-green);
    color: var(--primary-green);
    font-weight: 600;
    border: none;
    padding: 15px;
}

tr:nth-child(even) {
    background-color: #f0f0f0;  /* Darker even rows */
}

tr:hover {
    background-color: #e5e5e5;  /* Darker hover state */
}

/* Table row and cell styles */
tr {
    position: relative;
    transition: none;
    background-color: var(--white);
}

[data-theme="dark"] tr {
    background-color: var(--card-bg) !important; /* Keep dark background in dark mode */
}

[data-theme="dark"] td {
    background-color: var(--card-bg) !important; /* Ensure cells stay dark */
}

/* Remove general warning styles */
tr.table-warning,
tr.table-warning[data-out-of-stock="true"] {
    background-color: transparent !important;
}

/* Only highlight the item name */
.item-info {
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

[data-theme="dark"] .item-info {
    color: var(--text-color);
}

[data-theme="dark"] tr.table-warning .item-info {
    color: #ffc107 !important; /* Yellow for low stock */
}

[data-theme="dark"] tr.table-warning[data-out-of-stock="true"] .item-info {
    color: #dc3545 !important; /* Red for out of stock */
}

/* Remove hover effects */
[data-theme="dark"] tr:hover,
[data-theme="dark"] tr.table-warning:hover,
[data-theme="dark"] tr.table-warning[data-out-of-stock="true"]:hover {
    background-color: var(--card-bg) !important;
}

/* Remove all tooltip related styles */
tr[data-tooltip],
tr[data-tooltip]:hover::before,
tr[data-tooltip]:hover::after {
    all: unset;
}

/* Modal Styles */
.modal {
    display: none; 
    position: fixed;
    z-index: 1050 !important; /* Increase z-index */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #ddd;
    width: 50%;
    border-radius: 8px;
    border-radius: 15px;
    border: none;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.15);
}

.barcode-input-row {
    display: flex;
    gap: 0.45rem;
}

.barcode-input-row input {
    min-width: 0;
    flex: 1 1 auto;
}

.barcode-input-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.45rem;
}

.barcode-scanner-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 40px;
    margin: 0;
    padding: 0.5rem 0.75rem;
    color: #fff;
    background: var(--primary-green);
    border-radius: 5px;
    font-size: 0.85rem;
}

.barcode-scanner-button {
    color: var(--text-dark);
    background: var(--light-gray);
    border: 1px solid var(--border-color);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
.card:hover {
    cursor: pointer; /* Changes the cursor to a pointer on hover */
    background-color: #f5f5fa; /* Darker background on hover */
    transition: background-color 0.3s ease; /* Smooth transition */
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

/* Additional Improvements */
.alert {
    border-radius: 12px;
    border: none;
    box-shadow: var(--shadow);
}

/* Form Controls */
input[type="text"],
input[type="number"],
input[type="password"],
select {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    padding: 12px;
    transition: var(--transition);
}

input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px var(--light-green);
}

/* Status Indicators */
.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-low {
    background-color: #ffc107;
}

.status-out {
    background-color: #dc3545;
}

/* Smooth Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--hover-green);
}

/* Loading Animation */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Dark mode toggle button */
.theme-toggle {
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-color);
    transition: transform 0.3s ease;
    transform: none !important; /* Remove rotation */
}

.theme-toggle:hover {
    background-color: var(--hover-green) !important;
    transform: none !important; /* Remove rotation */
}

/* Dark mode specific overrides */
[data-theme="dark"] .card:hover {
    background-color: #2a2a2a;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] tr:nth-child(even) {
    background-color: var(--table-stripe);
}

[data-theme="dark"] tr:hover {
    background-color: var(--table-hover);
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] select {
    background-color: var(--input-bg);
    color: var (--input-text);
    border-color: var(--border-color);
}

[data-theme="dark"] .modal-content {
    background-color: var(--modal-bg);
    color: var(--text-color);
}

[data-theme="dark"] .close {
    color: var(--text-color);
}

/* Theme toggle button styling */
.theme-toggle {
    width: calc(100% - 16px) !important; /* Account for margins */
    text-align: left;
    background: transparent !important;
    color: var(--white) !important;
    padding: .625rem 1rem !important;
    border-radius: 8px !important;
    margin: 4px 8px !important;
    display: flex !important;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
}

.theme-toggle i {
    font-size: 1.1rem;
    margin-right: .75rem;
    min-width: 20px; /* Ensure icon has minimum width */
}

.theme-label {
    text-overflow: ellipsis;
    overflow: hidden;
}

#sidebar:not(.expand) .theme-label {
    display: none;
}

/* Improve text readability in dark mode */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--text-color);
}

[data-theme="dark"] .text-dark {
    color: var(--text-color) !important;
}

/* Chart improvements for dark mode */
[data-theme="dark"] .small-chart {
    background: var(--card-bg);
}

/* Alert styling for dark mode */
[data-theme="dark"] .alert {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

/* Theme toggle alignment fixes */
.theme-item {
    margin: 0 !important;
    padding: 0 !important;
}

.theme-toggle {
    width: 100% !important;
    padding: .625rem 1.625rem !important;
    margin: 4px 0 !important;
    display: flex !important;
    align-items: center !important;
}

.theme-toggle i {
    width: 24px !important; /* Match other icons width */
    text-align: center !important;
    margin-right: 12px !important; /* Match other icons margin */
}

/* Icon alignment in sidebar */
.sidebar-link i {
    width: 24px !important;
    text-align: center !important;
    margin-right: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Improved dark mode visibility for forms and modals */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
    border-color: #404040 !important;
}

[data-theme="dark"] .modal-content {
    background-color: #1e1e1e !important;
    color: #ffffff !important;
}

[data-theme="dark"] .close {
    color: #ffffff !important;
}

/* Better visibility for alerts in dark mode */
[data-theme="dark"] .alert {
    background-color: #2d2d2d;
    border-color: #404040;
    color: #ffffff;
}

/* Product Page Specific Styles */
.header-section,
.header-title,
.header-actions,
.main-navbar {
    display: none;
}

.main {
    margin-top: 0 !important;
    padding-top: 1rem;
}

.alert-list {
    margin: 0;
    padding-left: 1.5rem;
}

.alert-list li {
    margin: 0.5rem 0;
}

.alert-list a {
    color: inherit;
    text-decoration: underline;
}

.import-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 600px;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.table-section {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.table-section .card-body {
    padding: 1.5rem;
}

/* Responsive adjustments */
.mobile-menu-btn,
.sidebar-backdrop {
    display: none;
}

@media (max-width: 768px) {
    .header-section {
        padding: 1rem;
    }

    .header-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .input-group {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    #sidebar,
    #sidebar.expand {
        width: 260px;
        min-width: 260px;
        transform: translateX(-100%);
        z-index: 1200;
    }

    #sidebar.mobile-open {
        transform: translateX(0);
    }

    #sidebar.mobile-open .sidebar-title {
        width: auto;
        opacity: 1;
    }

    #sidebar.mobile-open a.sidebar-link span {
        display: inline;
    }

    #sidebar.mobile-open:not(.expand) .theme-label {
        display: inline;
    }

    #sidebar.mobile-open .sidebar-link::after {
        display: none;
    }

    .main,
    #sidebar.expand ~ .main {
        width: 100%;
        margin-left: 0 !important;
        padding: 4.5rem 1rem 1.5rem;
    }

    .mobile-menu-btn {
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 1100;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        margin: 0;
        padding: 0;
        color: #fff;
        background: var(--primary-green);
        border-radius: 6px;
        box-shadow: var(--shadow);
    }

    .mobile-menu-btn i {
        font-size: 1.35rem;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1150;
        display: none;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        background: rgba(0, 0, 0, 0.48);
        border-radius: 0;
    }

    #sidebar.mobile-open + .mobile-menu-btn + .sidebar-backdrop {
        display: block;
    }
}

/* Table row hover and highlighting */
tr {
    transition: none; /* Remove transition */
    position: relative;
}

tr:hover {
    background-color: transparent !important; /* Remove hover background */
    cursor: default; /* Remove pointer cursor */
}

/* Low stock and out of stock highlighting - Light mode */
tr.table-warning {
    background-color: #fff3cd !important; /* Light yellow background */
}

tr.table-warning[data-out-of-stock="true"] {
    background-color: #ffe0e0 !important; /* Light red background */
}

tr.table-warning td {
    color: #856404 !important; /* Dark yellow text */
}

tr.table-warning[data-out-of-stock="true"] td {
    color: #dc3545 !important; /* Red text */
    font-weight: 500;
}

/* Dark mode adjustments */
[data-theme="dark"] tr.table-warning {
    background-color: rgba(255, 193, 7, 0.2) !important;
}

[data-theme="dark"] tr.table-warning[data-out-of-stock="true"] {
    background-color: rgba(220, 53, 69, 0.2) !important;
}

/* Remove hover states */
tr.table-warning:hover,
tr.table-warning[data-out-of-stock="true"]:hover,
[data-theme="dark"] tr.table-warning:hover,
[data-theme="dark"] tr.table-warning[data-out-of-stock="true"]:hover {
    background-color: inherit !important;
}

/* Dark mode table adjustments */
[data-theme="dark"] tr:hover {
    background-color: rgba(207, 16, 24, 0.18) !important;
}

[data-theme="dark"] tr.table-warning {
    background-color: rgba(255, 193, 7, 0.15) !important;
    color: #ffc107;
}

[data-theme="dark"] tr.table-warning:hover {
    background-color: rgba(255, 193, 7, 0.25) !important;
}

/* Remove existing tooltip styles */
tr[data-tooltip]:hover::before,
tr[data-tooltip]:hover::after {
    display: none;
}

/* Table row styles */
tr {
    position: relative;
    background-color: var(--white) !important;
}

tr:hover td {
    font-weight: 500;
    color: var(--primary-green) !important;
}

/* Low stock and out of stock highlighting */
tr.table-warning {
    background-color: #fff3cd !important;
}

tr.table-warning[data-out-of-stock="true"] {
    background-color: #ffe0e0 !important;
}

tr.table-warning td {
    color: #856404 !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.pos-main {
    padding: 1.5rem 2rem;
}

.users-main {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
}

.users-layout {
    grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.5fr);
}

.users-field-note {
    margin: -0.2rem 0 0;
    color: #777;
    font-size: 0.72rem;
    line-height: 1.45;
}

.users-password-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 0.45rem;
    justify-self: start;
    color: var(--text-dark) !important;
    font-size: 0.78rem !important;
    font-weight: 400 !important;
    cursor: pointer;
}

.users-password-toggle input {
    width: 16px;
    min-height: 16px;
    margin: 0;
    accent-color: var(--primary-green);
}

.users-list-controls {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.4rem 0.65rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.users-list-controls label {
    color: var(--text-dark);
    font-size: 0.76rem;
    font-weight: 650;
}

.users-list-controls input {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 0.45rem 0.65rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.78rem;
}

.users-list-controls p {
    grid-column: 2;
    margin: 0;
    color: #777;
    font-size: 0.7rem;
}

.users-no-results {
    padding: 1rem !important;
    color: #777 !important;
    text-align: center;
}

.users-role-form {
    align-items: center;
}

.users-role-form button {
    width: auto;
    min-width: 82px;
    padding: 0 0.55rem;
    gap: 0.25rem;
    white-space: nowrap;
}

.users-role-form button:disabled {
    color: var(--text-dark);
    background: var(--light-gray);
    cursor: default;
    opacity: 0.72;
}

.topbar-login-name {
    color: #777;
    font-size: 0.68rem;
    line-height: 1.2;
}

.users-name-details {
    margin-top: 0.25rem;
}

.users-name-details summary {
    width: fit-content;
    color: var(--primary-green);
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
}

.users-name-form {
    display: flex;
    gap: 0.3rem;
    padding-top: 0.4rem;
}

.users-name-form input {
    width: min(160px, 100%);
    min-width: 0;
    min-height: 32px;
    padding: 0.35rem 0.45rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.72rem;
}

.users-panel .users-name-form button {
    width: auto;
    min-height: 32px;
    margin: 0;
    padding: 0.35rem 0.5rem;
    color: #fff;
    background: var(--primary-green);
    border-radius: 4px;
    font-size: 0.68rem;
}

.users-username {
    color: var(--text-dark);
    font-size: 0.76rem;
}

.users-panel .users-role-form button {
    display: inline-flex;
    width: auto;
    min-width: 92px;
    height: 36px;
    align-items: center;
    justify-content: center;
    padding: 0 0.6rem;
    color: #fff;
    background: var(--primary-green);
    border-radius: 5px;
    font-size: 0.72rem;
    line-height: 1;
}

.users-panel .users-role-form button:disabled {
    color: var(--text-dark);
    background: var(--light-gray);
}

.users-password-details {
    margin-top: 0.55rem;
}

.users-password-details summary {
    width: fit-content;
    color: var(--primary-green);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
}

.users-password-disclaimer {
    max-width: 280px;
    margin: 0.4rem 0 0;
    color: #777;
    font-size: 0.68rem;
    line-height: 1.45;
}

.users-permission-form {
    display: grid;
    gap: 0.45rem;
    min-width: 190px;
    max-width: 280px;
    padding: 0.65rem 0 0.25rem;
}

.users-permission-area {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.users-permission-area legend {
    padding: 0 0.2rem;
    color: var(--text-dark);
    font-size: 0.68rem;
    font-weight: 600;
}

.users-permission-area label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-color);
    font-size: 0.68rem;
}

.users-permission-area input[type="checkbox"] {
    width: 14px;
    min-height: 14px;
    margin: 0;
    accent-color: var(--primary-green);
}

.users-permission-area input[type="checkbox"]:disabled {
    opacity: 0.55;
}

.users-password-form {
    display: grid;
    gap: 0.45rem;
    min-width: 190px;
    max-width: 280px;
    padding: 0.75rem 0 0.25rem;
}

.users-password-form > label:not(.users-password-toggle) {
    color: var(--text-dark);
    font-size: 0.72rem;
    font-weight: 600;
}

.users-password-form input[type="password"],
.users-password-form input[type="text"] {
    width: 100%;
    min-height: 36px;
    padding: 0.45rem 0.55rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.75rem;
}

.users-password-form .users-password-note {
    margin: 0;
    line-height: 1.4;
}

.users-panel .users-set-password-button {
    min-height: 36px;
    margin: 0.15rem 0 0;
    padding: 0.45rem 0.65rem;
    color: #fff;
    background: var(--primary-green);
    border-radius: 5px;
    font-size: 0.72rem;
}

.users-panel .users-set-password-button:hover {
    background: var(--hover-green);
}

.app-confirm-dialog {
    position: fixed;
    inset: 0;
    width: min(92vw, 420px);
    max-width: none;
    max-height: min(90vh, 640px);
    margin: auto;
    padding: 0;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: auto;
}

.app-confirm-dialog::backdrop {
    background: rgba(18, 18, 18, 0.58);
    backdrop-filter: blur(2px);
}

.app-confirm-card {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 0.75rem;
    padding: 1.6rem;
    text-align: center;
}

.app-confirm-close {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    padding: 0;
    color: var(--text-dark);
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.app-confirm-close:hover {
    background: var(--light-gray);
}

.app-confirm-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    color: var(--primary-green);
    background: var(--light-green);
    border-radius: 50%;
    font-size: 1.35rem;
}

.app-confirm-card h2 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.2rem;
    text-align: center;
}

.app-confirm-card p {
    margin: 0;
    color: var(--text-dark);
    font-size: 0.9rem;
    line-height: 1.5;
}

.app-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    margin-top: 0.35rem;
}

.app-confirm-actions button {
    min-width: 105px;
    min-height: 40px;
    margin: 0;
    padding: 0.55rem 0.9rem;
    border-radius: 6px;
    font-size: 0.84rem;
    font-weight: 600;
}

.app-confirm-cancel {
    color: var(--text-dark);
    background: var(--light-gray);
    border: 1px solid var(--border-color);
}

.app-confirm-accept {
    color: #fff;
    background: var(--primary-green);
}

.app-confirm-accept:hover {
    background: var(--hover-green);
}

@media (max-width: 768px) {
    .users-main,
    #sidebar.expand ~ .users-main {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
    }

    .users-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .users-list-controls {
        grid-template-columns: minmax(0, 1fr);
    }

    .users-list-controls p {
        grid-column: 1;
    }

    .users-password-form {
        max-width: none;
    }
}

.pos-page-header,
.pos-catalog-toolbar,
.pos-cart-heading,
.pos-product-footer,
.pos-cart-line-heading,
.pos-change {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.pos-page-header {
    margin-bottom: 1.25rem;
}

.pos-page-header h1,
.pos-catalog-toolbar h2,
.pos-cart-heading h2 {
    margin: 0;
    color: var(--text-dark);
    text-align: left;
}

.pos-page-header h1 {
    font-size: 1.55rem;
}

.pos-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pos-shortcuts-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.7rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
}

.pos-shortcuts-button:hover {
    border-color: var(--primary-green);
}

.pos-shortcuts-button kbd,
.pos-shortcuts-dialog kbd {
    padding: 0.1rem 0.35rem;
    color: var(--text-dark);
    background: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font: inherit;
    font-size: 0.75rem;
}

.pos-shortcuts-dialog {
    position: fixed;
    inset: 0;
    width: min(92vw, 460px);
    max-width: none;
    max-height: min(90vh, 640px);
    margin: auto;
    padding: 1rem 1.15rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
    overflow: auto;
}

.pos-shortcuts-dialog::backdrop {
    background: rgba(18, 18, 18, 0.58);
}

.pos-shortcuts-dialog header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.pos-shortcuts-dialog h2 {
    margin: 0;
    font-size: 1.2rem;
}

.pos-shortcuts-dialog header button {
    width: 2rem;
    height: 2rem;
    color: var(--text-dark);
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.4rem;
}

.pos-shortcuts-dialog dl {
    display: grid;
    gap: 0.6rem;
    margin: 1rem 0;
}

.pos-shortcuts-dialog dl > div {
    display: grid;
    grid-template-columns: 7rem 1fr;
    align-items: center;
    gap: 0.6rem;
}

.pos-shortcuts-dialog dt,
.pos-shortcuts-dialog dd,
.pos-shortcuts-dialog > p {
    margin: 0;
}

.pos-shortcuts-dialog dt {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pos-shortcuts-dialog > p {
    color: var(--text-muted, var(--text-color));
    font-size: 0.84rem;
    line-height: 1.5;
}

.pos-eyebrow {
    margin: 0 0 0.2rem;
    color: var(--primary-green);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.pos-sales-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--primary-green);
    font-weight: 600;
}

.sales-main {
    padding: 1.5rem 2rem;
}

.sales-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.sales-page-header h1 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.55rem;
    text-align: left;
}

.sales-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.sales-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 42px;
    margin: 0;
    padding: 0.55rem 0.9rem;
    color: var(--text-dark);
    background: transparent;
    border-bottom: 3px solid transparent;
    border-radius: 5px 5px 0 0;
    font-weight: 600;
}

.sales-tab.is-active {
    color: var(--primary-green);
    border-bottom-color: var(--primary-green);
}

.sales-tab span {
    min-width: 1.4rem;
    padding: 0.1rem 0.35rem;
    color: var(--text-dark);
    background: var(--light-gray);
    border-radius: 999px;
    font-size: 0.72rem;
    text-align: center;
}

.sales-tab:focus-visible {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

.sales-table-wrap {
    overflow-x: auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: var(--shadow);
}

.sales-table {
    min-width: 760px;
    margin: 0;
    table-layout: auto;
    box-shadow: none;
}

.sales-table th {
    color: var(--text-dark);
    background: var(--light-gray);
    font-size: 0.8rem;
    text-align: left;
}

.sales-table td {
    padding: 0.7rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.82rem;
}

.sales-table tbody tr[hidden],
#salesEmptyRow[hidden] {
    display: none;
}

.sales-table tbody tr:last-child td {
    border-bottom: 0;
}

.sales-row-actions {
    min-width: 126px;
    white-space: nowrap;
}

.sales-reprint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    color: #fff;
    background: var(--primary-green);
    border-radius: 5px;
}

.sales-view-serials {
    display: inline-flex;
    min-width: 40px;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin: 0;
    padding: 0.35rem 0.55rem;
    color: #fff;
    background: var(--primary-green);
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 700;
}

.sales-view-serials:hover {
    background: var(--hover-green);
}

.sales-no-serials {
    color: #888;
}

.sales-serial-dialog {
    position: fixed;
    inset: 0;
    width: min(100% - 2rem, 480px);
    max-height: min(85dvh, 640px);
    margin: auto;
    padding: 1.1rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.85rem;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
    overflow: auto;
}

.sales-serial-dialog::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.sales-serial-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.sales-serial-header h2 {
    margin: 0.15rem 0;
    font-size: 1.1rem;
}

.sales-serial-header p:last-child {
    margin: 0;
    color: #777;
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.sales-serial-close-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    margin: 0;
    padding: 0;
    color: var(--text-dark);
    background: var(--light-gray);
    border-radius: 50%;
}

.sales-serial-items {
    display: grid;
    gap: 0.75rem;
    padding: 0.85rem 0;
}

.sales-serial-item {
    padding: 0.8rem;
    background: var(--main-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.65rem;
}

.sales-serial-item h3 {
    margin: 0;
    font-size: 0.9rem;
}

.sales-serial-item p {
    margin: 0.25rem 0 0.5rem;
    color: #777;
    font-size: 0.75rem;
}

.sales-serial-item ul {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sales-serial-item li code {
    display: block;
    padding: 0.5rem 0.6rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.4rem;
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.sales-serial-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.7rem;
    border-top: 1px solid var(--border-color);
}

.sales-serial-actions button {
    min-width: 88px;
    min-height: 40px;
    margin: 0;
    padding: 0.55rem 0.85rem;
    color: var(--text-dark);
    background: var(--light-gray);
    border: 1px solid var(--border-color);
}

.sales-reprint:hover {
    background: var(--hover-green);
}

.sales-row-actions {
    text-align: center;
}

.sales-cancel {
    min-height: 36px;
    margin: 0 0 0 0.35rem;
    padding: 0.4rem 0.6rem;
    color: #fff;
    background: #b42318;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
}

.sales-cancel:hover:not(:disabled) {
    background: #8f1b13;
}

.sales-cancel:disabled {
    color: #555;
    background: var(--light-gray);
    cursor: not-allowed;
}

.sales-action-status {
    margin: 0 0 1rem;
    padding: 0.7rem 0.85rem;
    color: #155d36;
    background: #e5f4eb;
    border-radius: 5px;
}

.sales-action-status.is-error {
    color: #8f1b13;
    background: #fde8e7;
}

.sales-empty {
    padding: 1.5rem !important;
    color: #777 !important;
    text-align: center !important;
}

.pos-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(560px, 640px);
    gap: 1.25rem;
    align-items: start;
}

.pos-catalog-toolbar {
    margin-bottom: 0.8rem;
}

.pos-catalog-actions {
    display: flex;
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 0.5rem;
}

.pos-catalog-actions .pos-search {
    flex: 1 1 200px;
}

.pos-catalog-filters {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.75rem;
    color: var(--text-dark);
    font-size: 0.8rem;
    font-weight: 600;
}

.pos-catalog-filters > .pos-input {
    width: auto;
    min-width: 180px;
    min-height: 38px;
    margin: 0;
    padding: 0.4rem 0.65rem;
}

.pos-stock-filter {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 0.45rem;
    margin-left: auto;
    padding: 0 0.7rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
}

.pos-stock-filter input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary-green);
}

.pos-scan-status {
    min-height: 1.25rem;
    margin: -0.3rem 0 0.45rem;
    color: #777;
    font-size: 0.75rem;
}

.pos-scan-warning {
    padding: 0.45rem 0.6rem;
    color: #8a4100;
    background: #fff3d6;
    border-left: 3px solid #d98400;
    border-radius: 3px;
}

.pos-scan-success {
    color: #155d36;
}

.pos-scan-warning-dialog {
    width: min(92vw, 430px);
    max-width: none;
    padding: 0;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid #d98400;
    border-radius: 8px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.3);
}

.pos-scan-warning-dialog::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.pos-scan-warning-content {
    padding: 1.25rem;
}

.pos-scan-warning-content h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    color: #8a4100;
    font-size: 1.1rem;
}

.pos-scan-warning-content p {
    margin: 0 0 1rem;
    line-height: 1.5;
}

.pos-scan-warning-content button {
    min-height: 40px;
    padding: 0.5rem 1rem;
    color: #fff;
    background: var(--primary-green);
    border: 0;
    border-radius: 5px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.pos-catalog-toolbar h2,
.pos-cart-heading h2 {
    font-size: 1.1rem;
}

.pos-view-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 0.2rem;
    padding: 0.2rem;
    background: var(--main-bg);
    border-radius: 6px;
}

.pos-view-toggle button {
    min-height: 34px;
    margin: 0;
    padding: 0.35rem 0.65rem;
    color: var(--text-dark);
    background: transparent;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
}

.pos-view-toggle button:hover:not(:disabled) {
    background: var(--light-green);
    transform: none;
}

.pos-view-toggle button.is-active,
.pos-view-toggle button.is-active:hover {
    color: #fff;
    background: var(--primary-green);
}

.pos-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: min(100%, 340px);
    margin: 0;
    padding: 0 0.75rem;
    color: #737373;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.pos-search input {
    width: 100%;
    min-height: 42px;
    padding: 0.5rem 0;
    color: var(--text-dark);
    background: transparent;
    border: 0;
    outline: 0;
    box-shadow: none;
}

.pos-search input:focus {
    border: 0;
    box-shadow: none;
}

.pos-muted {
    margin: 0 0 0.65rem;
    color: #777;
    font-size: 0.82rem;
}

.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 0.65rem;
}

.pos-product-grid.is-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.pos-product {
    display: flex;
    min-height: 114px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.4rem;
    margin: 0;
    padding: 0.8rem;
    color: var(--text-dark);
    text-align: left;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: none;
    transition: border-color 0.16s ease, background-color 0.16s ease;
}

.pos-product-grid.is-list .pos-product {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.8rem;
}

.pos-product-grid.is-list .pos-product > strong {
    flex: 1 1 35%;
    min-width: 0;
}

.pos-product-grid.is-list .pos-product-sku {
    flex: 0 1 20%;
    min-width: 0;
}

.pos-product-grid.is-list .pos-product-footer {
    flex: 1 1 auto;
    margin-top: 0;
}

.pos-product:hover:not(:disabled) {
    color: var(--text-dark);
    background: var(--card-bg);
    border-color: var(--primary-green);
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.pos-product:disabled {
    color: #777;
    background: var(--light-gray);
    cursor: not-allowed;
    opacity: 0.72;
    transform: none;
}

.pos-product > strong {
    font-size: 0.88rem;
}

.pos-product-sku,
.pos-stock {
    color: #777;
    font-size: 0.75rem;
}

.pos-product-footer {
    margin-top: auto;
    gap: 0.4rem;
}

.pos-product-footer strong {
    color: var(--primary-green);
    font-size: 0.9rem;
}

.pos-stock-empty {
    color: #b40d14;
}

.pos-cart-panel {
    position: static;
    padding: 1rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--primary-green);
    border-radius: 6px;
    box-shadow: var(--shadow);
}

.pos-cart-heading {
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.pos-cart-count {
    color: #777;
    font-size: 0.8rem;
}

.pos-cart-items {
    max-height: 34vh;
    overflow-y: auto;
}

.pos-cart-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem 0.75rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color);
}

.pos-cart-line-heading {
    grid-column: 1 / -1;
    align-items: flex-start;
}

.pos-cart-line-heading strong {
    font-size: 0.86rem;
}

.pos-remove-line {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: -0.25rem -0.25rem 0 0;
    padding: 0;
    color: #777;
    background: transparent;
    border-radius: 4px;
}

.pos-remove-line:hover {
    color: var(--primary-green);
    background: var(--light-green);
    transform: none;
}

.pos-line-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.pos-line-inputs label,
.pos-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0;
    color: var(--text-dark);
    font-size: 0.75rem;
    font-weight: 600;
}

.pos-sale-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1rem;
}

.pos-sale-field-column {
    min-width: 0;
}

.pos-line-inputs input {
    width: 72px;
    min-height: 34px;
    padding: 0.35rem;
    color: var(--text-dark);
    background: var(--main-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.pos-line-inputs input.pos-line-total-input {
    width: 112px;
}

.pos-line-total {
    align-self: end;
    padding-bottom: 0.45rem;
    font-size: 0.82rem;
}

.pos-empty-state {
    padding: 1rem 0;
    color: #777;
    font-size: 0.85rem;
    text-align: center;
}

.pos-totals {
    display: grid;
    gap: 0.5rem;
    margin: 0.85rem 0;
}

.pos-totals > div,
.receipt-totals > div {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.84rem;
}

.pos-total {
    margin-top: 0.25rem;
    padding-top: 0.7rem;
    color: var(--text-dark);
    border-top: 1px solid var(--border-color);
    font-size: 1rem !important;
}

.pos-total strong {
    color: var(--primary-green);
    font-size: 1.2rem;
}

.pos-input {
    width: 100%;
    min-height: 42px;
    margin: 0.35rem 0 0.7rem;
    padding: 0.55rem 0.7rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.pos-address-results {
    position: relative;
    z-index: 20;
    max-height: 220px;
    margin: -0.55rem 0 0.7rem;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-shadow: 0 6px 16px rgb(0 0 0 / 12%);
}

.pos-address-results[hidden] {
    display: none;
}

.pos-customer-lookup {
    position: relative;
    z-index: 30;
}

.pos-customer-suggestions {
    position: absolute;
    top: calc(100% - 0.45rem);
    right: 0;
    left: 0;
    z-index: 40;
    max-height: 240px;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-shadow: 0 6px 16px rgb(0 0 0 / 12%);
}

.pos-customer-suggestions[hidden] {
    display: none;
}

.pos-customer-suggestion {
    display: grid;
    width: 100%;
    gap: 0.15rem;
    margin: 0;
    padding: 0.65rem 0.75rem;
    color: var(--text-dark);
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    cursor: pointer;
}

.pos-customer-suggestion:last-child {
    border-bottom: 0;
}

.pos-customer-suggestion span,
.pos-customer-suggestion small {
    color: #777;
    font-size: 0.72rem;
    font-weight: 400;
    overflow-wrap: anywhere;
}

.pos-customer-suggestion:hover,
.pos-customer-suggestion:focus-visible {
    background: var(--light-green);
    outline: none;
}

.pos-address-result {
    display: block;
    width: 100%;
    padding: 0.65rem 0.75rem;
    color: var(--text-dark);
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.pos-address-result:last-child {
    border-bottom: 0;
}

.pos-address-result:hover,
.pos-address-result:focus-visible {
    background: var(--hover-bg, #f3f6f4);
    outline: none;
}

.pos-change {
    margin: 0.1rem 0 0.75rem;
    color: #666;
    font-size: 0.82rem;
}

.pos-quick-cash {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin: -0.15rem 0 0.75rem;
}

.pos-cash-chip-arc {
    display: grid;
    grid-template-areas: "exact twenty fifty hundred five thousand";
    grid-template-columns: repeat(6, minmax(0, 58px));
    grid-template-rows: 96px;
    justify-content: space-between;
    align-items: start;
    width: 100%;
}

.pos-cash-chip-arc button {
    position: relative;
    display: grid;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    padding: 5px;
    place-items: center;
    color: #fff;
    background: #176f50;
    border: 3px dashed rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    outline: 2px solid #176f50;
    outline-offset: -1px;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2), inset 0 0 0 2px rgba(255, 255, 255, 0.28);
    font-size: 0.75rem;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.pos-cash-chip-arc button[data-cash-increment="exact"] {
    grid-area: exact;
    transform: translateY(34px);
}

.pos-cash-chip-arc button[data-cash-increment="100"] {
    grid-area: hundred;
    transform: translateY(4px);
}

.pos-cash-chip-arc button[data-cash-increment="20"] {
    grid-area: twenty;
    transform: translateY(18px);
    color: #fff7ce;
    background: #827028;
    outline-color: #827028;
}

.pos-cash-chip-arc button[data-cash-increment="50"] {
    grid-area: fifty;
    transform: translateY(4px);
    background: #c26427;
    outline-color: #c26427;
}

.pos-cash-chip-arc button[data-cash-increment="500"] {
    grid-area: five;
    transform: translateY(18px);
}

.pos-cash-chip-arc button[data-cash-increment="1000"] {
    grid-area: thousand;
    transform: translateY(34px);
}

.pos-cash-chip-arc button span {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 50%;
}

.pos-cash-chip-arc button[data-cash-increment="100"] {
    background: #b52e43;
    outline-color: #b52e43;
}

.pos-cash-chip-arc button[data-cash-increment="500"] {
    background: #2863a5;
    outline-color: #2863a5;
}

.pos-cash-chip-arc button[data-cash-increment="1000"] {
    color: #fff4bd;
    background: #303238;
    outline-color: #c9a84e;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.24), inset 0 0 0 2px rgba(201, 168, 78, 0.55);
}

.pos-cash-chip-arc button:hover:not(:disabled) {
    filter: brightness(1.12);
    transform: translateY(-2px) rotate(-3deg);
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.2), inset 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.pos-cash-chip-arc button:active:not(:disabled) {
    transform: translateY(1px) scale(0.96);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), inset 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.pos-cash-chip-arc button:focus-visible,
.pos-cash-clear:focus-visible {
    outline: 3px solid var(--text-dark);
    outline-offset: 3px;
}

.pos-cash-chip-arc button:disabled {
    cursor: not-allowed;
    filter: grayscale(0.85);
    opacity: 0.48;
}

.pos-cart-panel .pos-cash-chip-arc {
    display: flex;
    min-height: 0;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.25rem 0;
}

.pos-cart-panel .pos-cash-chip-arc button,
.pos-cart-panel .pos-cash-chip-arc button[data-cash-increment] {
    position: relative;
    display: inline-flex;
    flex: 0 1 auto;
    width: auto;
    min-width: 44px;
    height: 38px;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.45rem;
    border: 1px solid transparent;
    border-radius: 6px;
    outline: none;
    box-shadow: none;
    font-size: 0.78rem;
    text-shadow: none;
    transform: none;
}

.pos-cart-panel .pos-cash-chip-arc button span {
    display: inline;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
}

.pos-cart-panel .pos-cash-chip-arc button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.pos-cart-panel .pos-quick-cash .pos-cash-clear {
    display: inline-flex;
    flex: 0 0 auto;
    width: auto;
    min-width: 70px;
    height: 36px;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    outline: none;
    box-shadow: none;
    font-size: 0.75rem;
}

.pos-cart-panel .pos-quick-cash .pos-cash-clear span {
    display: inline;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
}

.pos-cart-panel .pos-cash-chip-arc button:focus-visible,
.pos-cart-panel .pos-quick-cash .pos-cash-clear:focus-visible {
    outline: 3px solid var(--text-dark);
    outline-offset: 2px;
}

.pos-cash-chip-arc button[data-tooltip]::after,
.pos-quick-cash .pos-cash-clear[data-tooltip]::after {
    position: absolute;
    z-index: 20;
    bottom: calc(100% + 9px);
    left: 50%;
    width: max-content;
    max-width: min(220px, 70vw);
    padding: 0.4rem 0.6rem;
    color: #fff;
    background: #20252b;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
    content: attr(data-tooltip);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-shadow: none;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

.pos-cash-chip-arc button[data-tooltip]::before,
.pos-quick-cash .pos-cash-clear[data-tooltip]::before {
    position: absolute;
    z-index: 21;
    bottom: calc(100% + 3px);
    left: 50%;
    width: 7px;
    height: 7px;
    background: #20252b;
    content: "";
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 4px) rotate(45deg);
    transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

.pos-cash-chip-arc button[data-tooltip]:hover::after,
.pos-cash-chip-arc button[data-tooltip]:hover::before,
.pos-cash-chip-arc button[data-tooltip]:focus-visible::after,
.pos-cash-chip-arc button[data-tooltip]:focus-visible::before,
.pos-quick-cash .pos-cash-clear[data-tooltip]:hover::after,
.pos-quick-cash .pos-cash-clear[data-tooltip]:hover::before,
.pos-quick-cash .pos-cash-clear[data-tooltip]:focus-visible::after,
.pos-quick-cash .pos-cash-clear[data-tooltip]:focus-visible::before {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.pos-quick-cash .pos-cash-clear {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    min-height: 42px;
    margin: 0;
    padding: 4px;
    color: #fff;
    background: #626873;
    border: 3px dashed rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    outline: 2px solid #626873;
    outline-offset: -1px;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2), inset 0 0 0 2px rgba(255, 255, 255, 0.28);
    font-size: 0.85rem;
    transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.pos-quick-cash .pos-cash-clear span {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 50%;
}

.pos-quick-cash .pos-cash-clear:hover:not(:disabled) {
    background: #b52e43;
    outline-color: #b52e43;
    filter: brightness(1.12);
    transform: translateY(-2px) rotate(-3deg);
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.2), inset 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.pos-quick-cash .pos-cash-clear:active:not(:disabled) {
    transform: translateY(1px) scale(0.96);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), inset 0 0 0 2px rgba(255, 255, 255, 0.28);
}

@media (prefers-reduced-motion: reduce) {
    .pos-cash-chip-arc button,
    .pos-quick-cash .pos-cash-clear,
    .pos-cash-chip-arc button[data-tooltip]::before,
    .pos-cash-chip-arc button[data-tooltip]::after,
    .pos-quick-cash .pos-cash-clear[data-tooltip]::before,
    .pos-quick-cash .pos-cash-clear[data-tooltip]::after {
        transition: none;
    }
}

.pos-change strong {
    color: var(--text-dark);
}

.pos-checkout-button {
    position: sticky;
    bottom: -1rem;
    z-index: 1;
    width: 100%;
    min-height: 48px;
    margin: 0 0 -1rem;
    padding: 0.65rem;
    color: #fff;
    border: 1px solid var(--card-bg);
    background: var(--primary-green);
    border-radius: 5px;
    font-weight: 700;
}

.pos-checkout-button:hover:not(:disabled) {
    background: var(--hover-green);
}

.pos-checkout-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}

.pos-error {
    margin: 0 0 0.75rem;
    padding: 0.6rem;
    color: #8f1016;
    background: #fde8e9;
    border-radius: 4px;
    font-size: 0.82rem;
}

.pos-receipt-dialog {
    position: fixed;
    inset: 0;
    width: min(100% - 2rem, 460px);
    max-height: calc(100dvh - 2rem);
    margin: auto;
    padding: 1.25rem;
    color: #222;
    background: #fff;
    border: 0;
    border-radius: 6px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
    overflow: auto;
}

.pos-receipt-dialog::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.receipt-header {
    padding-bottom: 0.8rem;
    border-bottom: 2px solid #cf1018;
    text-align: center;
}

.receipt-header h2 {
    margin: 0;
    color: #222;
    font-size: 1rem;
    text-align: center;
}

.receipt-header p,
.receipt-thank-you {
    margin: 0.25rem 0 0;
    color: #666;
    font-size: 0.8rem;
    text-align: center;
}

.receipt-details,
.receipt-lines,
.receipt-totals {
    display: grid;
    gap: 0.45rem;
    padding: 0.75rem 0;
    border-bottom: 1px dashed #ccc;
}

.receipt-details > div,
.receipt-lines > div {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    font-size: 0.78rem;
}

.receipt-lines > div {
    flex-wrap: wrap;
}

.receipt-lines small {
    flex-basis: 100%;
    color: #777;
}

.receipt-grand-total {
    padding-top: 0.5rem;
    border-top: 1px solid #aaa;
    font-size: 1rem !important;
}

.receipt-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.receipt-actions button {
    margin: 0;
    padding: 0.55rem 0.8rem;
    border-radius: 4px;
}

.receipt-close {
    color: var(--text-dark);
    background: var(--light-gray);
}

@media (max-width: 980px) {
    .pos-layout {
        grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
    }
}

@media (max-width: 1200px) {
    .pos-layout {
        grid-template-columns: minmax(0, 1fr) minmax(420px, 520px);
    }

    .pos-sale-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .pos-page-header {
        flex-wrap: wrap;
    }

    .pos-main-mode-tabs {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
    }

    .pos-sales-link {
        order: 2;
    }

    .pos-header-actions {
        order: 2;
        flex-wrap: wrap;
        justify-content: flex-end;
        margin-left: auto;
    }
}

@media (max-width: 768px) {
    .pos-main {
        padding-top: 4.5rem;
    }

    .sales-main {
        padding: 4.5rem 1rem 1.5rem;
    }

    .pos-layout {
        grid-template-columns: 1fr;
    }

    .pos-cart-panel {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .pos-catalog-filters {
        flex-wrap: wrap;
    }

    .pos-catalog-filters > .pos-input {
        min-width: 0;
        flex: 1 1 160px;
    }

    .pos-stock-filter {
        margin-left: 0;
    }

    .pos-checkout-button {
        position: static;
        margin-bottom: 0;
    }

    .pos-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    }

    .pos-page-header {
        align-items: flex-start;
    }

    .pos-catalog-actions {
        flex-direction: column;
    }

    .pos-page-header h1 {
        font-size: 1.3rem;
    }

    .sales-page-header h1 {
        font-size: 1.3rem;
    }
}

@media print {
    @page pos-receipt {
        size: 80mm 200mm;
        margin: 0;
    }

    body.pos-printing * {
        visibility: hidden !important;
    }

    body.pos-printing .pos-receipt-dialog,
    body.pos-printing .pos-receipt-dialog * {
        visibility: visible !important;
    }

    body.pos-printing,
    body.pos-order-printing {
        page: pos-receipt;
    }

    body.pos-printing .pos-receipt-dialog,
    body.pos-order-printing .pos-receipt-dialog {
        position: absolute;
        inset: 0 auto auto 0;
        display: block;
        box-sizing: border-box;
        width: 80mm;
        max-width: none;
        max-height: none;
        height: auto;
        margin: 0;
        padding: 3mm;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
        break-inside: avoid-page;
        page-break-inside: avoid;
    }

    body.pos-printing .pos-receipt,
    body.pos-order-printing .pos-receipt {
        box-sizing: border-box;
        width: 100%;
        font-size: 9pt;
    }

    body.pos-printing .receipt-actions {
        display: none;
    }

    body.pos-printing .receipt-header,
    body.pos-order-printing .receipt-header {
        padding-bottom: 0.35rem;
    }

    body.pos-printing .receipt-details,
    body.pos-printing .receipt-lines,
    body.pos-printing .receipt-totals,
    body.pos-order-printing .receipt-details,
    body.pos-order-printing .receipt-lines,
    body.pos-order-printing .receipt-totals {
        gap: 0.2rem;
        padding: 0.35rem 0;
    }

    body.pos-printing .receipt-details > div,
    body.pos-printing .receipt-lines > div,
    body.pos-order-printing .receipt-details > div,
    body.pos-order-printing .receipt-lines > div {
        gap: 0.3rem;
        font-size: 8pt;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.pos-printing .receipt-details > div > *,
    body.pos-printing .receipt-lines > div > *,
    body.pos-order-printing .receipt-details > div > *,
    body.pos-order-printing .receipt-lines > div > * {
        overflow-wrap: anywhere;
    }
}

.inventory-controls,
.inventory-pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.inventory-controls {
    padding: 0.75rem 0;
}

.inventory-controls label {
    margin: 0;
    color: var(--text-dark);
    font-size: 0.85rem;
    font-weight: 600;
}

.inventory-controls input,
.inventory-controls select {
    min-height: 40px;
    padding: 0.5rem 0.65rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

#inventorySearch {
    flex: 1 1 220px;
    max-width: 360px;
}

#inventorySort {
    min-width: 145px;
}

#inventoryPageSize {
    width: 76px;
}

#inventoryResultCount {
    margin-left: auto;
    color: var(--text-dark);
    font-size: 0.85rem;
}

.inventory-pagination {
    justify-content: space-between;
    padding: 0.25rem 0 1rem;
}

.inventory-pagination > div {
    display: flex;
    gap: 0.4rem;
}

.inventory-pagination button,
#inventorySortDirection {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    color: #fff;
    background: var(--primary-green);
    border-radius: 6px;
}

.inventory-pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none;
}

@media (max-width: 768px) {
    .inventory-controls {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.5rem;
    }

    #inventorySearch {
        grid-column: 2 / 4;
        width: 100%;
        max-width: none;
    }

    #inventorySort {
        min-width: 0;
        width: 100%;
    }

    #inventoryResultCount {
        grid-column: 1 / -1;
        margin-left: 0;
        text-align: right;
    }
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--primary-green);
    outline-offset: 3px;
}

tbody tr:not([data-out-of-stock="true"]):not(.table-warning):hover td {
    background-color: #f6e8e9 !important;
    transition: background-color 0.18s ease;
}

[data-theme="dark"] tbody tr:not([data-out-of-stock="true"]):not(.table-warning):hover td {
    background-color: #352426 !important;
}

body.sidebar-open {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

tr.table-warning[data-out-of-stock="true"] td {
    color: #dc3545 !important;
}

/* Dark mode adjustments */
[data-theme="dark"] tr {
    background-color: var(--white) !important;
}

[data-theme="dark"] tr:hover td {
    color: var(--hover-green) !important;
}

[data-theme="dark"] tr.table-warning {
    background-color: rgba(255, 193, 7, 0.2) !important;
}

[data-theme="dark"] tr.table-warning[data-out-of-stock="true"] {
    background-color: rgba(220, 53, 69, 0.2) !important;
}

[data-theme="dark"] tr.table-warning td {
    color: #ffd740 !important;
}

[data-theme="dark"] tr.table-warning[data-out-of-stock="true"] td {
    color: #ff4444 !important;
}

/* Remove all hover background effects */
tr:hover,
tr.table-warning:hover,
tr.table-warning[data-out-of-stock="true"]:hover,
[data-theme="dark"] tr:hover,
[data-theme="dark"] tr.table-warning:hover,
[data-theme="dark"] tr.table-warning[data-out-of-stock="true"]:hover {
    background-color: inherit !important;
}

/* Modal Form Styling */
.modal .form-group {
    margin-bottom: 8px; /* Reduced from 1rem */
}

.modal label {
    display: block;
    margin-bottom: 2px; /* Reduced from 0.5rem */
    font-weight: 500;
    color: var(--text-color);
}

.modal input {
    width: 100%;
    padding: 6px 8px; /* Reduced from 0.75rem */
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--white);
    color: var(--text-color);
    font-size: 0.9rem;
    transition: var(--transition);
}

.modal input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px var(--light-green);
    outline: none;
}

.modal button[type="submit"] {
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem;
}

[data-theme="dark"] .modal label {
    color: var(--text-color);
}

[data-theme="dark"] .modal input {
    background: var(--input-bg);
    color: var (--input-text);
    border-color: var(--border-color);
}

/* Action Buttons Layout */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 4px;
}

.action-buttons button {
    width: 100%;
    padding: 6px 8px;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Adjust table cell width for actions column */
#inventoryTable th:last-child,
#inventoryTable td:last-child {
    min-width: 220px; /* Ensure minimum width */
    width: 240px;
    padding: 8px;
}

/* Alert Section Styling */
.alert-section {
    display: flex;
    gap: 1rem;
}

.alert-section .alert {
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    flex: 1;
}

.alert-list {
    margin: 0;
    padding-left: 1.2rem;
}

.alert-list li {
    margin: 0.3rem 0;
    font-size: 0.9rem;
}

.alert-list a {
    color: inherit;
    text-decoration: none;
}

.alert-list a:hover {
    text-decoration: underline;
}

/* Row highlight animation */
@keyframes highlight {
    0% { background-color: var(--light-green); }
    100% { background-color: inherit; }
}

/* Stock Modal Styles */
.modal-item-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-green);
    margin: 0.5rem 0; /* Reduced from 1rem */
}

.current-stock {
    margin-bottom: 0.5rem; /* Reduced from 1rem */
    padding: 0.25rem; /* Reduced from 0.5rem */
    background: var(--light-gray);
    border-radius: 6px;
    text-align: center;
}

.submit-btn.stock-in {
    background-color: var(--primary-green);
}

.submit-btn.stock-out {
    background-color: #ffc107;
    color: black;
}

[data-theme="dark"] .modal-item-name {
    color: var(--hover-green);
}

[data-theme="dark"] .current-stock {
    background: var(--table-stripe);
}

/* Modal Layout Improvements */
.modal-wide {
    width: 90%;
    max-width: 800px; /* Reduced from 1000px */
    margin: 5% auto; /* Adjusted from 2% to center better */
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px; /* Reduced from 15px */
    margin-bottom: 10px; /* Reduced from 15px */
}

.form-column {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Reduced from 15px */
}

.image-preview {
    width: 200px;
    height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: contain; /* Changed from cover to contain */
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    background-color: var(--light-gray);
    padding: 10px;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

[data-theme="dark"] .image-preview {
    border-color: var(--border-color);
    background-color: var(--input-bg);
}

/* Item Image Styling */
.item-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.item-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    background-color: var(--light-gray);
}

.image-preview {
    position: relative;
    width: 200px;
    height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: contain; /* Changed from cover to contain */
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    background-color: var(--light-gray);
    padding: 10px;
}

.clear-image-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
    border: 2px solid var(--white);
}

.clear-image-btn:hover {
    background: var(--hover-green);
    transform: none;
}

[data-theme="dark"] .item-thumbnail {
    background-color: var(--table-stripe);
    border: 1px solid var(--border-color);
}

/* Table Image Column */
.product-image-cell {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    height: 100px !important;
    padding: 8px !important;
    text-align: center !important;
}

.product-image-cell img {
    width: 100px !important;
    height: 80px !important;
    object-fit: contain !important;
    background-color: var(--light-gray);
    padding: 4px;
    border-radius: 4px;
}

#inventoryTable th.image-column {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
}

/* Force table layout */
#inventoryTable {
    table-layout: fixed !important;
    width: 100% !important;
}

/* Image Preview Modal */
.image-preview-modal {
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: hidden;
}

.image-preview-modal .modal-content {
    position: relative;
    background: transparent;
    box-shadow: none;
    max-width: 90%;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-preview-modal img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    background-color: var(--white);
    padding: 10px;
}

.image-preview-modal .close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 1001;
}

/* Dark mode adjustments */
[data-theme="dark"] .product-image-cell img {
    border: 1px solid var(--border-color);
    background-color: var(--table-stripe);
}

/* Sidebar Header Styling */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    height: 70px;
    background: linear-gradient(90deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
    opacity: 0;
    width: 0;
    overflow: hidden;
    margin-left: 10px;
    transition: var(--transition);
}

#sidebar.expand .sidebar-title {
    opacity: 1;
    width: auto;
}

.sidebar-title span {
    max-width: 160px;
    font-size: 0.68em;
    display: block;
    opacity: 0.9;
    white-space: normal;
    line-height: 1.25;
}

/* Remove navbar-related styles */
.main-navbar {
    display: none;
}

/* Navbar Styling */
.main-navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 70px;
    height: 70px;
    background: var(--white);
    box-shadow: var(--shadow);
    z-index: 999;
    transition: var(--transition);
}

.nav-content {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 2rem;
}

.nav-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-green);
}

/* Adjust navbar position when sidebar is expanded */
#sidebar.expand ~ .main .main-navbar {
    left: 260px;
}

/* Adjust main content margin for navbar */
.main {
    margin-top: 70px;
}

/* Dark mode adjustments for navbar */
[data-theme="dark"] .main-navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .nav-title {
    color: var(--text-color);
}

/* Page Header Styling */
.header-section {
    background: linear-gradient(90deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    color: white;
    display: flex;
    flex-direction: column;
}

.header-title h1 {
    color: white;
    margin: 0;
    font-weight: 600;
}

.header-title span {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Action Button Styling */
.action-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-green);
    color: white;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--hover-green);
    transform: translateY(-2px);
}

.action-btn.primary {
    background: var(--secondary-green);
}

/* Import section fix */
.import-section {
    position: relative;
    z-index: 1000;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 45px;
    height: 45px;
    background: var(--primary-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--hover-green);
    transform: translateY(-3px);
}

[data-theme="dark"] .back-to-top {
    background: var(--secondary-green);
}

/* Table image column styling */
#inventoryTable .image-column {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

#inventoryTable .table-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

#inventoryTable .table-image:hover {
    transform: scale(1.1);
}

/* Adjust gap between labels and fields in the add/edit modal */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px; /* Adjust margin as needed */
}

.form-group label {
    margin-bottom: 5px; /* Adjust margin as needed */
}

/* Highlight item name only in dark mode */
body.dark-mode .table-warning td:nth-child(3),
body.dark-mode .table-danger td:nth-child(3) {
    background-color: transparent;
    color: inherit;
}

body.dark-mode .table-warning td:nth-child(3) .item-info {
    color: yellow;
}

body.dark-mode .table-danger td:nth-child(3) .item-info {
    color: red;
}

/* Table row highlighting - Light Mode */
tr.table-warning {
    background-color: rgba(255, 193, 7, 0.1) !important; /* Light yellow background */
}

tr.table-warning[data-out-of-stock="true"] {
    background-color: rgba(220, 53, 69, 0.1) !important; /* Light red background */
}

/* Dark mode row highlighting */
[data-theme="dark"] tr.table-warning td {
    color: #ffc107 !important; /* Yellow text in dark mode */
}

[data-theme="dark"] tr.table-warning[data-out-of-stock="true"] td {
    color: #dc3545 !important; /* Red text in dark mode */
}

/* Remove item-info specific coloring since we're coloring the whole row */
[data-theme="dark"] .item-info {
    color: inherit !important;
}

[data-theme="dark"] tr.table-warning .item-info,
[data-theme="dark"] tr.table-warning[data-out-of-stock="true"] .item-info {
    color: inherit !important;
}

/* Remove hover background effects but keep row colors */
tr:hover,
tr.table-warning:hover,
tr.table-warning[data-out-of-stock="true"]:hover,
[data-theme="dark"] tr:hover,
[data-theme="dark"] tr.table-warning:hover,
[data-theme="dark"] tr.table-warning[data-out-of-stock="true"]:hover {
    background-color: inherit !important;
}

/* Out of stock highlighting - Light Mode */
tr[data-out-of-stock="true"] {
    background-color: rgba(220, 53, 69, 0.3) !important; /* Brighter red background */
}

tr[data-out-of-stock="true"] td {
    color: #dc3545 !important; /* Red text */
    font-weight: 600 !important;
}

/* Low stock highlighting - Light Mode */
tr.table-warning:not([data-out-of-stock="true"]) {
    background-color: rgba(255, 193, 7, 0.2) !important; /* Yellow background */
}

tr.table-warning:not([data-out-of-stock="true"]) td {
    color: #856404 !important; /* Dark yellow text */
}

/* Dark mode adjustments */
[data-theme="dark"] tr[data-out-of-stock="true"] {
    background-color: rgba(220, 53, 69, 0.25) !important; /* Red background in dark mode */
}

[data-theme="dark"] tr[data-out-of-stock="true"] td {
    color: #ff4444 !important; /* Bright red text in dark mode */
    font-weight: 600 !important;
}

[data-theme="dark"] tr.table-warning:not([data-out-of-stock="true"]) {
    background-color: rgba(255, 193, 7, 0.15) !important; /* Yellow background in dark mode */
}

[data-theme="dark"] tr.table-warning:not([data-out-of-stock="true"]) td {
    color: #ffc107 !important; /* Yellow text in dark mode */
}

/* Preserve highlighting on hover */
tr[data-out-of-stock="true"]:hover,
tr.table-warning:hover,
[data-theme="dark"] tr[data-out-of-stock="true"]:hover,
[data-theme="dark"] tr.table-warning:hover {
    background-color: inherit !important;
}

/* Out of stock highlighting - Light Mode */
tr[data-out-of-stock="true"] {
    background-color: rgba(220, 53, 69, 0.15) !important;
}

tr[data-out-of-stock="true"] td {
    color: #dc3545 !important;
    font-weight: 500;
}

/* Low stock highlighting - Light Mode */
tr.table-warning:not([data-out-of-stock="true"]) {
    background-color: rgba(255, 193, 7, 0.15) !important;
}

tr.table-warning:not([data-out-of-stock="true"]) td {
    color: #856404 !important;
}

/* Out of stock highlighting - Dark Mode */
[data-theme="dark"] tr[data-out-of-stock="true"] {
    background-color: rgba(220, 53, 69, 0.2) !important;
}

[data-theme="dark"] tr[data-out-of-stock="true"] td {
    color: #ff4444 !important;
    font-weight: 500;
}

/* Low stock highlighting - Dark Mode */
[data-theme="dark"] tr.table-warning:not([data-out-of-stock="true"]) {
    background-color: rgba(255, 193, 7, 0.2) !important;
}

[data-theme="dark"] tr.table-warning:not([data-out-of-stock="true"]) td {
    color: #ffd740 !important;
}

/* Preserve highlighting on hover */
tr[data-out-of-stock="true"]:hover,
tr.table-warning:hover,
[data-theme="dark"] tr[data-out-of-stock="true"]:hover,
[data-theme="dark"] tr.table-warning:hover {
    background-color: inherit !important;
}

/* Base table styles */
tr {
    position: relative;
    background-color: var(--white);
}

/* Low stock highlighting (yellow) */
tr.table-warning:not([data-out-of-stock="true"]) {
    background-color: rgba(255, 193, 7, 0.2) !important;
}

tr.table-warning:not([data-out-of-stock="true"]) td {
    color: #856404 !important;
}

/* Out of stock highlighting (red) */
tr[data-out-of-stock="true"] {
    background-color: rgba(255, 0, 0, 0.15) !important;
}

tr[data-out-of-stock="true"] td {
    color: #ff0000 !important;
    font-weight: 600 !important;
}

/* Dark mode adjustments */
[data-theme="dark"] tr.table-warning:not([data-out-of-stock="true"]) {
    background-color: rgba(255, 193, 7, 0.15) !important;
}

[data-theme="dark"] tr.table-warning:not([data-out-of-stock="true"]) td {
    color: #ffc107 !important;
}

[data-theme="dark"] tr[data-out-of-stock="true"] {
    background-color: rgba(255, 0, 0, 0.2) !important;
}

[data-theme="dark"] tr[data-out-of-stock="true"] td {
    color: #ff4444 !important;
    font-weight: 600 !important;
}

/* Remove hover effects */
tr:hover,
tr.table-warning:hover,
tr[data-out-of-stock="true"]:hover,
[data-theme="dark"] tr:hover,
[data-theme="dark"] tr.table-warning:hover,
[data-theme="dark"] tr[data-out-of-stock="true"]:hover {
    background-color: inherit !important;
}

/* Clear all existing table highlighting styles */
/* Base table row */
tr {
    background-color: var(--white);
}

/* Low stock (yellow) */
tr.table-warning {
    background-color: #fff3cd !important;
}

tr.table-warning td {
    color: #856404 !important;
}

/* Out of stock (red) */
tr[data-out-of-stock="true"] {
    background-color: #ffebee !important;
}

tr[data-out-of-stock="true"] td {
    color: #dc3545 !important;
    font-weight: 600 !important;
}

/* Dark mode */
[data-theme="dark"] tr.table-warning {
    background-color: rgba(255, 193, 7, 0.15) !important;
}

[data-theme="dark"] tr.table-warning td {
    color: #ffc107 !important;
}

[data-theme="dark"] tr[data-out-of-stock="true"] {
    background-color: rgba(220, 53, 69, 0.2) !important;
}

[data-theme="dark"] tr[data-out-of-stock="true"] td {
    color: #ff4444 !important;
}

/* Alert Section Styling - Dark Mode */
[data-theme="dark"] .alert.alert-warning {
    background-color: rgba(255, 193, 7, 0.15) !important;
    border-color: rgba(255, 193, 7, 0.3) !important;
    color: #ffc107 !important; /* Yellow text */
}

[data-theme="dark"] .alert.alert-danger {
    background-color: rgba(220, 53, 69, 0.15) !important;
    border-color: rgba(220, 53, 69, 0.3) !important;
    color: #ff4444 !important; /* Red text */
}

[data-theme="dark"] .alert a {
    color: inherit !important;
    text-decoration: underline;
}

[data-theme="dark"] .alert strong {
    color: inherit !important;
}

/* Low stock (yellow) */
tr.table-warning:not([data-out-of-stock="true"]) {
    background-color: rgba(255, 193, 7, 0.2) !important;
}

tr.table-warning:not([data-out-of-stock="true"]) td {
    color: #856404 !important;
}

/* Out of stock (red) */
tr[data-out-of-stock="true"] {
    background-color: rgba(255, 0, 0, 0.15) !important;
}

tr[data-out-of-stock="true"] td {
    color: #ff0000 !important;
    font-weight: 600 !important;
}

/* Dark mode adjustments */
[data-theme="dark"] tr.table-warning:not([data-out-of-stock="true"]) {
    background-color: rgba(255, 193, 7, 0.15) !important;
}

[data-theme="dark"] tr.table-warning:not([data-out-of-stock="true"]) td {
    color: #ffc107 !important;
}

[data-theme="dark"] tr[data-out-of-stock="true"] {
    background-color: rgba(255, 0, 0, 0.2) !important;
}

[data-theme="dark"] tr[data-out-of-stock="true"] td {
    color: #ff4444 !important;
    font-weight: 600 !important;
}

/* Hover effects with glow */
tr.table-warning:not([data-out-of-stock="true"]):hover {
    box-shadow: 0 0 10px 2px rgba(255, 193, 7, 0.5) !important;
}

tr[data-out-of-stock="true"]:hover {
    box-shadow: 0 0 10px 2px rgba(255, 0, 0, 0.5) !important;
}

[data-theme="dark"] tr.table-warning:not([data-out-of-stock="true"]):hover {
    box-shadow: 0 0 10px 2px rgba(255, 193, 7, 0.5) !important;
}

.products-main {
    max-width: 1720px;
    margin-left: 70px;
    padding: 1.5rem 2rem;
}

#sidebar.expand ~ .products-main {
    margin-left: 260px;
}

.products-header,
.products-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.products-header {
    justify-content: space-between;
    margin-bottom: 1.1rem;
}

.products-header h1 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.55rem;
    text-align: left;
}

.products-subtitle {
    margin: 0.2rem 0 0;
    color: #777;
    font-size: 0.8rem;
}

.products-header-actions {
    justify-content: flex-end;
}

.inventory-secondary-button,
.inventory-primary-button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.inventory-secondary-button {
    color: var(--text-dark);
    background: var(--card-bg);
}

.inventory-primary-button {
    color: #fff;
    background: var(--primary-green);
    border-color: var(--primary-green);
}

.inventory-primary-button:hover {
    background: var(--hover-green);
}

.products-flash {
    margin: 0 0 0.75rem;
    padding: 0.65rem 0.8rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border-left: 3px solid var(--primary-green);
    font-size: 0.82rem;
}

.products-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.inventory-view-all .products-summary {
    grid-template-columns: minmax(0, 1fr);
}

.products-summary-item {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 0.9rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 3px solid #777;
    border-radius: 5px;
}

.products-summary-item:hover {
    color: var(--primary-green);
    border-color: var(--primary-green);
}

.products-summary-item.is-disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.products-summary-item.is-disabled:hover {
    color: inherit;
    border-color: var(--border-color);
}

.products-summary-item span {
    color: #777;
    font-size: 0.77rem;
    font-weight: 600;
}

.products-summary-item strong {
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
}

.products-summary-warning {
    border-left-color: #b98000;
}

.products-summary-danger {
    border-left-color: var(--primary-green);
}

.branch-stock-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.branch-stock-summary-group {
    min-width: 0;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--card-bg);
}

.branch-stock-summary-group h2 {
    margin: 0 0 0.6rem;
    color: var(--text-dark);
    font-size: 0.82rem;
    font-weight: 700;
}

.branch-stock-summary-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.branch-stock-summary-buttons .products-summary-item {
    min-height: 52px;
    padding: 0.55rem 0.7rem;
}

.branch-stock-summary-buttons .products-summary-item span {
    font-size: 0.72rem;
}

.products-table-panel {
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.products-table-panel .inventory-controls {
    padding: 0.7rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

#inventorySearch {
    flex: 1 1 220px;
    max-width: 420px;
    min-height: 40px;
    padding: 0.5rem 0.65rem;
    color: var(--text-dark);
    background: var(--main-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.inventory-search-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    color: #777;
}

#inventoryStockFilter,
#inventorySort,
#inventoryPageSize {
    min-height: 40px;
    padding: 0.45rem 1.8rem 0.45rem 0.6rem;
    color: var(--text-dark);
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.78rem;
}

#inventorySort {
    min-width: 140px;
}

#inventoryPageSize {
    width: 104px;
}

#inventorySortDirection,
.inventory-pagination button {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    color: var(--text-dark);
    background: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

#inventoryResultCount {
    margin-left: auto;
    color: #777;
    font-size: 0.76rem;
}

.products-table-panel .inventory-pagination {
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    color: #777;
    font-size: 0.76rem;
}

.products-table-panel .inventory-pagination > div {
    display: flex;
    gap: 0.35rem;
}

.product-table-scroll {
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.product-table {
    width: 100%;
    min-width: 1040px;
    margin: 0;
    table-layout: auto;
    background: var(--card-bg);
    border-collapse: collapse;
    box-shadow: none;
}

#inventoryTable.product-table {
    min-width: 1040px !important;
    table-layout: auto !important;
}

.product-table th {
    padding: 0.7rem 0.65rem;
    color: #777;
    background: var(--light-gray) !important;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.68rem;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}

.product-table td {
    padding: 0.65rem;
    color: var(--text-dark);
    background: var(--card-bg) !important;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.76rem;
    vertical-align: middle;
}

.product-table tbody tr:last-child td {
    border-bottom: 0;
}

.product-table tbody tr:hover td {
    background: var(--main-bg) !important;
}

.product-name-cell {
    min-width: 245px;
    max-width: 330px;
}

.product-identity {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.product-identity .product-image {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    object-fit: cover;
}

.product-image-placeholder {
    display: inline-flex;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    color: #888;
    background: var(--light-gray);
    border-radius: 5px;
}

.product-identity-copy {
    display: grid;
    min-width: 0;
    gap: 0.2rem;
}

.product-identity-copy strong,
.product-identity-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-identity-copy strong {
    color: var(--text-dark);
    font-size: 0.78rem;
}

.product-identity-copy span {
    color: #888;
    font-size: 0.68rem;
}

.product-code-cell {
    display: grid;
    gap: 0.2rem;
    white-space: nowrap;
}

.product-code-cell span {
    color: #888;
    font-size: 0.66rem;
}

.product-price-cell {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.product-stock-cell {
    display: grid;
    justify-items: start;
    gap: 0.25rem;
}

.product-stock-cell > strong {
    color: var(--text-dark);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.product-stock-badge {
    padding: 0.18rem 0.38rem;
    border-radius: 3px;
    font-size: 0.62rem;
    font-weight: 700;
    white-space: nowrap;
}

.product-stock-badge.is-in {
    color: #3b6c51;
    background: #e8f1eb;
}

.product-stock-badge.is-low {
    color: #805500;
    background: #fbf0d4;
}

.product-stock-badge.is-out {
    color: #a20b12;
    background: #fbe5e6;
}

.product-actions-cell {
    min-width: 180px;
}

.product-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.2rem;
}

.inventory-row-action {
    display: inline-flex;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    color: #555;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 0.78rem;
}

.inventory-row-action:hover {
    color: var(--primary-green);
    background: var(--light-green);
    transform: none;
}

.inventory-row-action.delete-btn:hover {
    color: #fff;
    background: var(--primary-green);
}

[data-theme="dark"] .product-stock-badge.is-in {
    color: #b7dfc5;
    background: #273b2e;
}

[data-theme="dark"] .product-stock-badge.is-low {
    color: #f0c86a;
    background: #403820;
}

[data-theme="dark"] .product-stock-badge.is-out {
    color: #ffafb2;
    background: #47282a;
}

@media (max-width: 768px) {
    .products-main,
    #sidebar.expand ~ .products-main {
        width: 100%;
        margin-left: 0 !important;
        padding: 4.5rem 1rem 1.5rem;
    }

    .products-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .products-header h1 {
        font-size: 1.3rem;
    }

    .products-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .products-summary {
        gap: 0.4rem;
    }

    .products-summary-item {
        min-height: 58px;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        padding: 0.55rem;
    }

    .products-table-panel .inventory-controls {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.5rem;
    }

    #inventorySearch {
        grid-column: 2 / 4;
        width: 100%;
        max-width: none;
    }

    #inventoryStockFilter,
    #inventorySort {
        min-width: 0;
        width: 100%;
    }

    #inventoryPageSize {
        width: 104px;
    }

    #inventoryResultCount {
        grid-column: 1 / -1;
        margin-left: 0;
        text-align: right;
    }
}

[data-theme="dark"] tr[data-out-of-stock="true"]:hover {
    box-shadow: 0 0 10px 2px rgba(255, 0, 0, 0.5) !important;
}

/* Preserve highlighting on hover */
tr:hover,
tr.table-warning:hover,
tr[data-out-of-stock="true"]:hover {
    background-color: inherit !important;
}

/* Dark mode table and text adjustments */
[data-theme="dark"] .table {
    color: var(--text-color) !important;
}

[data-theme="dark"] .table td,
[data-theme="dark"] .table th {
    color: var(--text-color) !important;
    border-color: var(--border-color);
}

/* Action badge styles for dark mode */
[data-theme="dark"] .action-badge {
    border: 1px solid transparent;
}

[data-theme="dark"] .action-badge.bg-light {
    background-color: var(--card-bg) !important;
    color: var(--text-color) !important;
    border-color: var(--border-color);
}

/* Form control styles for dark mode */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--input-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .input-group-text {
    background-color: var(--card-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

/* Table hover and highlighting in dark mode */
[data-theme="dark"] tr:hover td {
    color: var(--text-color) !important;
}

/* Status highlighting in dark mode */
[data-theme="dark"] tr.table-warning td {
    color: #ffd700 !important; /* Brighter yellow for better visibility */
}

[data-theme="dark"] tr[data-out-of-stock="true"] td {
    color: #ff6b6b !important; /* Brighter red for better visibility */
}

/* Card header text in dark mode */
[data-theme="dark"] .card-header h3 {
    color: var(--text-color) !important;
}

/* Alert styling in dark mode */
[data-theme="dark"] .alert-info {
    background-color: rgba(23, 162, 184, 0.2);
    color: var(--text-color);
    border-color: rgba(23, 162, 184, 0.3);
}

/* Returns table styles */
.badge {
    padding: 0.5em 0.75em;
    font-size: 0.85em;
    font-weight: 500;
    text-transform: capitalize;
}

[data-theme="dark"] .badge {
    color: #fff;
}

.returns-table td {
    vertical-align: middle;
}

.returns-table .badge {
    min-width: 100px;
    text-align: center;
}

/* Button grid improvements */
.button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

.button-grid button {
    padding: 6px 8px;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Return Modal Styles */
#returnModal .modal-content {
    max-width: 500px;
    width: 100%;
    padding: 20px;
}

#returnModal .form-group {
    margin-bottom: 15px;
}

#returnModal .form-control {
    width: 100%;
    padding: 8px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

#returnModal select.form-control {
    height: 38px;
}

#returnModal label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

#returnModal .modal-item-name,
#returnModal .current-stock {
    margin-bottom: 15px;
    font-size: 1.1em;
}

#returnModal button[type="submit"] {
    width: 100%;
    padding: 10px;
    background-color: #0d6efd;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#returnModal button[type="submit"]:hover {
    background-color: #0b5ed7;
}

/* Remove any existing table-warning styles */

/* Low stock highlighting (yellow) */
tr.table-warning:not([data-out-of-stock="true"]) {
    background-color: rgba(255, 193, 7, 0.15) !important;
}

tr.table-warning:not([data-out-of-stock="true"]) td {
    color: #856404 !important;
}

/* Out of stock highlighting (red) */
tr[data-out-of-stock="true"] {
    background-color: rgba(220, 53, 69, 0.15) !important;
}

tr[data-out-of-stock="true"] td {
    color: #dc3545 !important;
    font-weight: 600 !important;
}

/* Dark mode adjustments */
[data-theme="dark"] tr.table-warning:not([data-out-of-stock="true"]) {
    background-color: rgba(255, 193, 7, 0.15) !important;
}

[data-theme="dark"] tr.table-warning:not([data-out-of-stock="true"]) td {
    color: #ffc107 !important;
}

[data-theme="dark"] tr[data-out-of-stock="true"] {
    background-color: rgba(220, 53, 69, 0.2) !important;
}

[data-theme="dark"] tr[data-out-of-stock="true"] td {
    color: #ff4444 !important;
    font-weight: 600 !important;
}

/* Remove hover background changes */
tr:hover,
tr.table-warning:hover,
tr[data-out-of-stock="true"]:hover {
    background-color: inherit !important;
}

/* Reset base styles */
tr {
    background-color: var(--white) !important;
}

/* Out of stock highlighting (red) */
tr[data-out-of-stock="true"],
tr.out-of-stock {
    background-color: rgba(220, 53, 69, 0.15) !important;
}

tr[data-out-of-stock="true"] td,
tr.out-of-stock td {
    color: #dc3545 !important;
}

/* Low stock highlighting (yellow) */
tr.table-warning:not([data-out-of-stock="true"]):not(.out-of-stock) {
    background-color: rgba(255, 193, 7, 0.15) !important;
}

tr.table-warning:not([data-out-of-stock="true"]):not(.out-of-stock) td {
    color: #856404 !important;
}

/* Dark mode adjustments */
[data-theme="dark"] tr[data-out-of-stock="true"],
[data-theme="dark"] tr.out-of-stock {
    background-color: rgba(220, 53, 69, 0.2) !important;
}

[data-theme="dark"] tr[data-out-of-stock="true"] td,
[data-theme="dark"] tr.out-of-stock td {
    color: #ff4444 !important;
}

[data-theme="dark"] tr.table-warning:not([data-out-of-stock="true"]):not(.out-of-stock) {
    background-color: rgba(255, 193, 7, 0.15) !important;
}

[data-theme="dark"] tr.table-warning:not([data-out-of-stock="true"]):not(.out-of-stock) td {
    color: #ffc107 !important;
}

.pos-dashboard {
    max-width: 1720px;
    margin-right: auto;
    margin-left: 70px;
    padding: 1.5rem 2rem;
}

#sidebar.expand ~ .pos-dashboard {
    margin-left: 260px;
}

.dashboard-header,
.dashboard-actions,
.dashboard-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-header {
    margin-bottom: 1.1rem;
}

.dashboard-header h1 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.55rem;
    text-align: left;
}

.dashboard-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dashboard-date-range {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.dashboard-date-range[hidden] {
    display: none;
}

.dashboard-date-range label {
    color: var(--text-dark);
    font-size: 0.8rem;
}

.dashboard-date-range input {
    min-height: 42px;
    min-width: 135px;
    padding: 0.45rem 0.55rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font: inherit;
}

.dashboard-apply-range {
    min-height: 42px;
    padding: 0.5rem 0.8rem;
    color: #fff;
    background: var(--primary-green);
    border: 0;
    border-radius: 5px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.dashboard-department-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
}

.dashboard-department-tab {
    min-height: 38px;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--card-bg);
    color: var(--text-dark);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.dashboard-department-tab:hover,
.dashboard-department-tab.is-active {
    border-color: var(--primary-green);
    background: var(--primary-green);
    color: #fff;
}

.dashboard-department-tab:focus-visible {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

.dashboard-period {
    min-height: 42px;
    padding: 0.5rem 2rem 0.5rem 0.7rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.dashboard-new-sale {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 0.9rem;
    color: #fff;
    background: var(--primary-green);
    border-radius: 5px;
    font-weight: 600;
}

.dashboard-new-sale:hover {
    color: #fff;
    background: var(--hover-green);
}

.dashboard-print-sales {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 0.9rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.dashboard-print-sales:hover {
    color: var(--primary-green);
    border-color: var(--primary-green);
}

.dashboard-print-sales:disabled {
    cursor: wait;
    opacity: 0.65;
}

.dashboard-report-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.dashboard-report-month-label {
    color: var(--text-dark);
    font-size: 0.8rem;
    font-weight: 600;
}

.dashboard-report-month {
    min-height: 42px;
    min-width: 150px;
    padding: 0.45rem 0.55rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font: inherit;
}

.dashboard-report-actions .dashboard-print-sales {
    min-width: 88px;
}

.dashboard-print-report[hidden] {
    display: none;
}

.dashboard-status {
    min-height: 1.2rem;
    margin: -0.25rem 0 0.5rem;
    color: #777;
    font-size: 0.8rem;
}

.dashboard-status-error {
    color: var(--primary-green);
}

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.dashboard-kpi {
    display: flex;
    min-height: 112px;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
    padding: 1rem 1.1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-top: 2px solid #7b7b7b;
    border-radius: 5px;
}

.dashboard-kpi-primary {
    border-top-color: var(--primary-green);
}

.dashboard-kpi-label {
    color: #6d6d6d;
    font-size: 0.78rem;
    font-weight: 600;
}

.dashboard-kpi strong {
    color: var(--text-dark);
    font-size: 1.45rem;
    font-variant-numeric: tabular-nums;
}

.dashboard-kpi-primary strong {
    color: var(--primary-green);
}

.dashboard-kpi-note {
    color: #888;
    font-size: 0.72rem;
}

.dashboard-kpi-comparison {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.2rem;
    color: #6d6d6d;
    font-size: 0.75rem;
    font-weight: 600;
}

.dashboard-kpi-comparison.is-up {
    color: #16803c;
}

.dashboard-kpi-comparison.is-down {
    color: #c62828;
}

.dashboard-kpi-comparison.is-same {
    color: #6d6d6d;
}

.dashboard-primary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(270px, 0.85fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.dashboard-secondary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: start;
}

.dashboard-sales-records {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.dashboard-panel {
    min-width: 0;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.dashboard-panel-header {
    margin-bottom: 0.85rem;
}

.dashboard-panel-header h2 {
    margin: 0;
    color: var(--text-dark);
    font-size: 0.98rem;
    font-weight: 650;
    text-align: left;
}

.dashboard-panel-header p {
    margin: 0.2rem 0 0;
    color: #888;
    font-size: 0.74rem;
}

.dashboard-panel-header a {
    color: var(--primary-green);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.dashboard-chart-wrap {
    position: relative;
    height: 260px;
}

.dashboard-tender-list {
    display: grid;
    gap: 1rem;
    padding-top: 0.2rem;
}

.dashboard-tender-row {
    display: grid;
    gap: 0.35rem;
}

.dashboard-tender-row-header {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--text-dark);
    font-size: 0.82rem;
}

.dashboard-tender-row-header strong {
    font-variant-numeric: tabular-nums;
}

.dashboard-tender-track {
    height: 6px;
    overflow: hidden;
    background: var(--light-gray);
    border-radius: 4px;
}

.dashboard-tender-track span {
    display: block;
    height: 100%;
    background: var(--primary-green);
    border-radius: inherit;
}

.dashboard-tender-row small {
    color: #888;
    font-size: 0.7rem;
}

.dashboard-table-scroll {
    width: 100%;
    overflow-x: auto;
}

.dashboard-table {
    width: 100%;
    min-width: 470px;
    margin: 0;
    table-layout: auto;
    box-shadow: none;
}

.dashboard-table th {
    padding: 0.55rem 0.45rem;
    color: #777;
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}

.dashboard-table td {
    padding: 0.62rem 0.45rem;
    color: var(--text-dark);
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem;
}

.dashboard-table tbody tr:last-child td {
    border-bottom: 0;
}

.dashboard-table .dashboard-money-cell {
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.dashboard-table td:last-child,
.dashboard-table th:last-child {
    text-align: right;
}

.dashboard-table .dashboard-receipt-link {
    color: var(--primary-green);
    font-weight: 600;
    white-space: nowrap;
}

.dashboard-top-items {
    min-width: 350px;
}

.dashboard-empty {
    margin: 0;
    padding: 1rem 0.25rem;
    color: #888;
    font-size: 0.8rem;
}

.dashboard-stock-counts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    margin-bottom: 0.6rem;
}

.dashboard-stock-counts div {
    display: flex;
    justify-content: space-between;
    gap: 0.35rem;
    padding: 0.55rem;
    background: var(--main-bg);
    border-radius: 4px;
    font-size: 0.72rem;
}

.dashboard-stock-counts strong {
    color: var(--text-dark);
    font-variant-numeric: tabular-nums;
}

.dashboard-stock-alerts {
    display: grid;
}

.dashboard-stock-alert {
    display: flex;
    justify-content: space-between;
    gap: 0.55rem;
    padding: 0.58rem 0.1rem;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.73rem;
}

.dashboard-stock-alert:last-child {
    border-bottom: 0;
}

.dashboard-stock-alert:hover {
    color: var(--primary-green);
}

.dashboard-stock-alert strong {
    flex: 0 0 auto;
    font-size: 0.68rem;
}

.dashboard-stock-out {
    color: var(--primary-green);
}

.dashboard-stock-low {
    color: #8b5b00;
}

[data-theme="dark"] .dashboard-stock-low {
    color: #f0c86a;
}

@media (max-width: 1200px) {
    .dashboard-secondary-grid {
        grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
    }

    .dashboard-stock-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .dashboard-primary-grid {
        grid-template-columns: minmax(0, 1fr) minmax(240px, 0.8fr);
    }

    .dashboard-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .pos-dashboard,
    #sidebar.expand ~ .pos-dashboard {
        width: 100%;
        margin-left: 0 !important;
        padding: 4.5rem 1rem 1.5rem;
    }

    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-header h1 {
        font-size: 1.3rem;
    }

    .dashboard-actions {
        width: 100%;
        justify-content: space-between;
    }

    .dashboard-kpis {
        gap: 0.5rem;
    }

    .dashboard-kpi {
        min-height: 100px;
        padding: 0.75rem;
    }

    .dashboard-kpi strong {
        font-size: 1.2rem;
    }

    .dashboard-primary-grid,
    .dashboard-sales-records,
    .dashboard-secondary-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-stock-panel {
        grid-column: auto;
    }

    .dashboard-chart-wrap {
        height: 220px;
    }
}

/* Remove any hover background changes */
tr:hover,
tr.table-warning:hover,
tr[data-out-of-stock="true"]:hover,
tr.out-of-stock:hover {
    background-color: inherit !important;
}

.app-topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 70px;
    z-index: 900;
    display: flex;
    height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.4rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: left 0.28s ease, background-color 0.2s ease, color 0.2s ease;
}

#sidebar.expand ~ .app-topbar {
    left: 260px;
}

.topbar-current-page,
.topbar-tools,
.topbar-user {
    display: flex;
    min-width: 0;
    align-items: center;
}

.topbar-current-page {
    gap: 0.7rem;
    overflow: hidden;
}

.topbar-brand-name {
    overflow: hidden;
    color: #888;
    font-size: 0.7rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-divider {
    color: #bbb;
}

.topbar-current-page > strong {
    overflow: hidden;
    color: var(--text-dark);
    font-size: 0.88rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-tools {
    flex: 0 0 auto;
    gap: 1rem;
}

.topbar-clock {
    color: #777;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.topbar-notifications {
    position: relative;
    flex: 0 0 auto;
}

.topbar-notification-button {
    position: relative;
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    box-sizing: border-box;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--card-bg);
    color: var(--text-dark);
    font-size: 1rem;
    cursor: pointer;
}

.topbar-notification-button > i {
    display: block;
    color: var(--primary-green);
    font-size: 1.15rem;
    line-height: 1;
}

.topbar-notification-button:hover,
.topbar-notification-button[aria-expanded="true"] {
    background: rgba(127, 127, 127, 0.1);
}

.topbar-notification-button:focus-visible {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

.topbar-notification-count {
    position: absolute;
    top: -4px;
    right: -4px;
    z-index: 1;
    display: grid;
    min-width: 18px;
    height: 18px;
    place-items: center;
    padding: 0 4px;
    border: 2px solid var(--card-bg);
    border-radius: 999px;
    background: var(--primary-green);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1;
}

.topbar-notification-count[hidden] {
    display: none;
}

.topbar-notification-panel {
    position: absolute;
    top: calc(100% + 0.65rem);
    right: -5rem;
    z-index: 1000;
    width: min(22rem, calc(100vw - 1.5rem));
    max-height: min(75vh, 34rem);
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.8rem;
    background: var(--card-bg);
    box-shadow: 0 0.75rem 2rem rgba(20, 25, 35, 0.18);
}

.topbar-notification-panel[hidden] {
    display: none;
}

.topbar-notification-header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
}

.topbar-notification-header strong {
    color: var(--text-dark);
    font-size: 0.9rem;
}

.topbar-notification-header span {
    color: #888;
    font-size: 0.7rem;
}

.topbar-notification-group-title {
    margin: 0;
    padding: 0.65rem 1rem 0.35rem;
    color: #888;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.topbar-notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.7rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
}

.topbar-notification-item:hover {
    background: rgba(127, 127, 127, 0.08);
    color: var(--text-dark);
}

.topbar-notification-item > i {
    margin-top: 0.15rem;
    color: var(--primary-green);
}

.topbar-notification-copy {
    display: grid;
    min-width: 0;
    gap: 0.18rem;
}

.topbar-notification-copy strong {
    font-size: 0.78rem;
    font-weight: 650;
}

.topbar-notification-copy span,
.topbar-notification-copy small {
    color: #888;
    font-size: 0.7rem;
}

.topbar-notification-empty {
    margin: 0;
    padding: 1rem;
    color: #888;
    font-size: 0.78rem;
}

.topbar-new-sale {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    color: #fff;
    background: var(--primary-green);
    border-radius: 5px;
    font-size: 0.76rem;
    font-weight: 650;
    white-space: nowrap;
}

.topbar-new-sale:hover {
    color: #fff;
    background: var(--hover-green);
}

.topbar-user {
    gap: 0.45rem;
}

.topbar-avatar {
    display: inline-flex;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #333;
    border-radius: 50%;
    font-size: 0.76rem;
    font-weight: 700;
}

.topbar-username {
    max-width: 140px;
    overflow: hidden;
    color: var(--text-dark);
    font-size: 0.76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-user-copy {
    display: grid;
    min-width: 0;
    gap: 0.05rem;
}

.topbar-role-label {
    color: #888;
    font-size: 0.62rem;
    white-space: nowrap;
}

#appTopbar ~ .main {
    padding-top: 82px !important;
}

@media (max-width: 768px) {
    .app-topbar,
    #sidebar.expand ~ .app-topbar {
        left: 0;
        height: 62px;
        padding: 0 0.75rem 0 64px;
    }

    .topbar-current-page {
        gap: 0.4rem;
    }

    .topbar-brand-name,
    .topbar-divider,
    .topbar-clock,
    .topbar-username,
    .topbar-role-label {
        display: none;
    }

    .topbar-current-page > strong {
        font-size: 0.82rem;
    }

    .topbar-tools {
        gap: 0.55rem;
    }

    .topbar-notification-panel {
        right: -3.2rem;
    }

    .topbar-new-sale {
        width: 36px;
        min-height: 36px;
        padding: 0;
    }

    .topbar-new-sale span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    #appTopbar ~ .main {
        padding-top: 82px !important;
    }
}

@media print {
    .app-topbar {
        display: none !important;
    }

    @page {
        size: landscape;
        margin: 12mm;
    }

    body.dashboard-printing * {
        visibility: hidden !important;
    }

    body.dashboard-printing #dashboardPrintReport,
    body.dashboard-printing #dashboardPrintReport * {
        visibility: visible !important;
    }

    body.dashboard-printing #dashboardPrintReport {
        position: absolute;
        inset: 0;
        display: block !important;
        width: 100%;
        color: #111;
        background: #fff;
        font: 10pt Arial, sans-serif;
    }

    .dashboard-print-page {
        box-sizing: border-box;
        min-height: 180mm;
        page-break-after: always;
        break-after: page;
    }

    .dashboard-print-details {
        page-break-after: auto;
        break-after: auto;
    }

    .dashboard-print-report > header {
        margin-bottom: 18px;
        text-align: center;
    }

    .dashboard-print-report > header p {
        margin: 0 0 5px;
    }

    .dashboard-print-report > header h1 {
        margin: 4px 0;
        font-size: 20pt;
    }

    .dashboard-print-summary {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        margin: 16px 0;
    }

    .dashboard-print-summary > div {
        display: grid;
        gap: 6px;
        padding: 10px;
        border: 1px solid #999;
    }

    .dashboard-print-summary strong {
        font-size: 14pt;
    }

    .dashboard-print-graphs {
        display: grid;
        grid-template-columns: 1.5fr 1fr;
        gap: 16px;
        margin-top: 16px;
    }

    .dashboard-print-graphs figure {
        min-width: 0;
        margin: 0;
        padding: 10px;
        border: 1px solid #999;
    }

    .dashboard-print-graphs figcaption {
        margin-bottom: 8px;
        font-size: 11pt;
        font-weight: 700;
    }

    .dashboard-print-graphs svg {
        display: block;
        width: 100%;
        height: 58mm;
    }

    .dashboard-graph-grid {
        stroke: #ddd;
        stroke-width: 1;
    }

    .dashboard-graph-label {
        fill: #444;
        font-size: 10px;
    }

    .dashboard-graph-line {
        fill: none;
        stroke: #198754;
        stroke-width: 3;
        stroke-linejoin: round;
        stroke-linecap: round;
    }

    .dashboard-graph-point {
        fill: #198754;
    }

    .dashboard-print-type-bars {
        display: grid;
        gap: 18px;
        padding: 10px 0;
    }

    .dashboard-print-type-bars > div {
        display: grid;
        gap: 6px;
    }

    .dashboard-print-type-track {
        display: block;
        height: 14px;
        overflow: hidden;
        background: #e6e6e6;
    }

    .dashboard-print-type-fill {
        display: block;
        height: 100%;
        background: #198754;
    }

    .dashboard-print-type-fill.is-online {
        background: #5470c6;
    }

    .dashboard-print-type-bars strong {
        font-size: 9pt;
    }

    .dashboard-print-details > header {
        margin-bottom: 12px;
    }

    .dashboard-print-details > header h2 {
        margin: 0 0 4px;
        font-size: 18pt;
    }

    .dashboard-print-details > header p {
        margin: 0;
    }

    .dashboard-print-types {
        margin: 12px 0;
        font-weight: 600;
    }

    .dashboard-print-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 8pt;
    }

    .dashboard-print-table th,
    .dashboard-print-table td {
        padding: 6px;
        border: 1px solid #777;
        text-align: left;
        overflow-wrap: anywhere;
    }

    .dashboard-print-table th {
        background: #eee;
    }

    .dashboard-print-table thead {
        display: table-header-group;
    }

    .dashboard-print-table tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .dashboard-print-money {
        text-align: right !important;
        white-space: nowrap;
    }

    .dashboard-print-report > footer {
        margin-top: 16px;
        color: #555;
        font-size: 8pt;
        text-align: right;
    }
}

#sidebar {
    display: flex;
    flex-direction: column;
    background: #242424;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.12);
}

.sidebar-header {
    flex: 0 0 70px;
    gap: 0.45rem;
    padding: 0 0.5rem 0 0;
    background: #242424;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand-mark {
    display: none;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--primary-green);
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 800;
}

#sidebar.expand .sidebar-brand-mark,
#sidebar.mobile-open .sidebar-brand-mark {
    display: inline-flex;
}

#sidebar.expand .sidebar-title,
#sidebar.mobile-open .sidebar-title {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    margin-left: 0;
    opacity: 1;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: none;
}

.sidebar-title span {
    max-width: 140px;
    margin-top: 0.1rem;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.64rem;
    font-weight: 500;
    line-height: 1.2;
    text-transform: none;
}

.sidebar-title .sidebar-product-name {
    color: #fff;
    font-size: 0.62rem;
    font-weight: 600;
}

.sidebar-nav {
    min-height: 0;
    padding: 0.75rem 0.55rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar-nav-list {
    margin: 0;
    padding: 0;
}

.sidebar-section-title {
    padding: 0.8rem 0.75rem 0.35rem;
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
}

#sidebar:not(.expand) .sidebar-section-title {
    display: none;
}

a.sidebar-link,
.sidebar-footer .sidebar-link {
    min-height: 40px;
    margin: 2px 0;
    padding: 0.6rem 0.75rem;
    color: rgba(255, 255, 255, 0.74);
    border: 0;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.16s ease, color 0.16s ease;
}

#sidebar .sidebar-link i {
    flex: 0 0 24px;
    margin-right: 0.6rem !important;
    color: rgba(255, 255, 255, 0.72);
    font-size: 1rem;
}

#sidebar a.sidebar-link:hover,
#sidebar .sidebar-footer .sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
    border: 0;
    transform: none;
}

#sidebar .sidebar-link.active,
#sidebar:not(.expand) .sidebar-link.active {
    color: #fff;
    background: var(--primary-green);
    border: 0;
    box-shadow: none;
    font-weight: 650;
}

#sidebar .sidebar-link.active i {
    color: #fff;
}

#sidebar:not(.expand) .sidebar-link {
    justify-content: center;
    padding: 0.68rem 0;
}

#sidebar:not(.expand) .sidebar-link i {
    margin-right: 0 !important;
}

.sidebar-hover-tooltip {
    position: fixed;
    z-index: 2000;
    padding: 0.4rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.45rem;
    background: #242424;
    box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.2);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-50%) translateX(-4px);
    transition: opacity 100ms ease, transform 100ms ease;
}

.sidebar-hover-tooltip:not([hidden]) {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.sidebar-footer {
    flex: 0 0 auto;
    padding: 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-footer .sidebar-link {
    display: flex;
    width: 100%;
    align-items: center;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.sidebar-footer .sidebar-link i {
    color: rgba(255, 255, 255, 0.72);
}

.sidebar-footer .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.09) !important;
}

#sidebar.mobile-open .sidebar-section-title {
    display: block;
}

#sidebar.mobile-open .sidebar-link {
    justify-content: flex-start;
    padding: 0.6rem 0.75rem;
}

#sidebar.mobile-open .sidebar-link i {
    margin-right: 0.6rem !important;
}

@media (max-width: 768px) {
    #sidebar.mobile-open {
        background: #242424;
    }

    #sidebar.mobile-open .sidebar-header {
        padding-right: 0.8rem;
    }
}

@media (min-width: 769px) and (max-width: 1100px) {
    .topbar-brand-name,
    .topbar-divider {
        display: none;
    }

    .topbar-tools {
        gap: 0.65rem;
    }

    .topbar-username {
        max-width: 85px;
    }
}

.logs-main {
    max-width: 1600px;
    margin-left: 70px;
    padding: 1.5rem 2rem;
}

#sidebar.expand ~ .logs-main {
    margin-left: 260px;
}

.logs-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logs-page-header h1 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.5rem;
    text-align: left;
}

.logs-page-subtitle {
    margin: 0.2rem 0 0;
    color: #777;
    font-size: 0.8rem;
}

.logs-export-button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0.5rem 0.75rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.78rem;
    font-weight: 600;
}

.logs-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(145px, 180px)) minmax(150px, 190px) minmax(130px, 155px);
    gap: 0.55rem;
    margin-bottom: 0.75rem;
}

.logs-search-field,
.logs-date-field {
    display: flex;
    min-width: 0;
    min-height: 42px;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    padding: 0 0.65rem;
    color: #777;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.74rem;
}

.logs-search-field input,
.logs-date-field input {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 0.45rem 0;
    color: var(--text-dark);
    background: transparent;
    border: 0;
    outline: 0;
    box-shadow: none;
    font-size: 0.76rem;
}

.logs-search-field input:focus,
.logs-date-field input:focus {
    border: 0;
    box-shadow: none;
}

.logs-date-field span {
    flex: 0 0 auto;
    color: #888;
    font-size: 0.7rem;
    font-weight: 600;
}

.logs-action-filter {
    min-width: 0;
    min-height: 42px;
    padding: 0.45rem 1.8rem 0.45rem 0.65rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.76rem;
}

.logs-page-size-field {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0 0.55rem;
    color: #888;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.7rem;
    white-space: nowrap;
}

.logs-page-size-field select {
    min-height: 34px;
    padding: 0.35rem 1.5rem 0.35rem 0.45rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.74rem;
}

@media (max-width: 1750px) {
    .logs-filters {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .logs-search-field {
        grid-column: 1 / -1;
    }

    .logs-date-field,
    .logs-action-filter,
    .logs-page-size-field {
        min-width: 0;
        width: 100%;
    }

    .logs-page-size-field {
        justify-content: space-between;
    }
}

.logs-panel {
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.logs-result-bar {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.9rem;
    color: #777;
    background: var(--light-gray);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.73rem;
}

.logs-latest-label {
    color: #888;
}

.log-entries {
    display: grid;
}

.log-entry {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.log-entry:last-child {
    border-bottom: 0;
}

.log-entry-icon {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #686868;
    border-radius: 50%;
    font-size: 0.9rem;
}

.log-action-sale,
.log-action-deleted {
    color: #fff;
    background: var(--primary-green);
}

.log-action-added,
.log-action-restored,
.log-action-stock-in {
    color: #355b44;
    background: #e4efe8;
}

.log-action-edited,
.log-action-stock-out {
    color: #795700;
    background: #f6efd9;
}

.log-action-login {
    color: #36566d;
    background: #e4edf3;
}

.log-action-logout,
.log-action-other {
    color: #555;
    background: #e9e9e9;
}

.log-entry-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.log-action-badge {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
}

.log-entry-heading time {
    color: #888;
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
}

.log-entry-description {
    margin: 0.4rem 0;
    color: var(--text-dark);
    font-size: 0.8rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.log-entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: #888;
    font-size: 0.68rem;
}

.log-entry-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.logs-empty-state {
    display: grid;
    justify-items: center;
    gap: 0.35rem;
    padding: 2.5rem 1rem;
    color: #888;
    text-align: center;
}

.logs-empty-state i {
    margin-bottom: 0.3rem;
    color: var(--primary-green);
    font-size: 1.5rem;
}

.logs-empty-state strong {
    color: var(--text-dark);
    font-size: 0.9rem;
}

.logs-empty-state span {
    font-size: 0.76rem;
}

.logs-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    color: #777;
    border-top: 1px solid var(--border-color);
    font-size: 0.74rem;
}

.logs-pagination > div {
    display: flex;
    gap: 0.4rem;
}

.logs-pagination a {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.4rem 0.65rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.74rem;
    text-decoration: none;
}

.logs-pagination a:hover:not(.is-disabled) {
    color: var(--primary-green);
    border-color: var(--primary-green);
}

.logs-pagination a.is-disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.users-main {
    max-width: 1400px;
    margin-left: 70px;
    padding: 1.5rem 2rem;
}

#sidebar.expand ~ .users-main {
    margin-left: 260px;
}

.users-header {
    margin-bottom: 1rem;
}

.users-header h1 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.45rem;
    text-align: left;
}

.users-header p:last-child {
    margin: 0.2rem 0 0;
    color: #777;
    font-size: 0.8rem;
}

.users-message {
    margin: 0 0 0.75rem;
    padding: 0.65rem 0.8rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border-left: 3px solid #3b8053;
    font-size: 0.82rem;
}

.permission-notice {
    border-left-color: #b7791f;
}

.permission-notice strong {
    color: var(--text-dark);
}

.users-message.is-error {
    border-left-color: var(--primary-green);
}

.users-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.5fr);
    gap: 0.85rem;
    align-items: start;
}

.users-panel {
    min-width: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.users-panel-header {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.users-panel-header h2 {
    margin: 0;
    color: var(--text-dark);
    font-size: 0.95rem;
    text-align: left;
}

.users-panel-header p {
    margin: 0.2rem 0 0;
    color: #888;
    font-size: 0.73rem;
}

.users-create-form {
    display: grid;
    gap: 0.5rem;
    padding: 1rem;
}

.users-create-form label {
    margin: 0;
    color: var(--text-dark);
    font-size: 0.74rem;
    font-weight: 650;
}

.users-create-form input,
.users-create-form select,
.users-role-form select {
    min-height: 40px;
    padding: 0.5rem 0.65rem;
    color: var(--text-dark);
    background: var(--main-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.78rem;
}

.users-password-note {
    margin: 0;
    color: #888;
    font-size: 0.68rem;
}

.users-create-button {
    min-height: 40px;
    margin: 0.35rem 0 0;
    color: #fff;
    background: var(--primary-green);
    border-radius: 5px;
    font-size: 0.78rem;
    font-weight: 650;
}

.users-table-wrap {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    min-width: 420px;
    margin: 0;
    table-layout: auto;
    box-shadow: none;
}

.users-table th {
    padding: 0.65rem 0.75rem;
    color: #777;
    background: var(--light-gray);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.68rem;
    text-align: left;
}

.users-table td {
    padding: 0.7rem 0.75rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.78rem;
}

.users-table tbody tr:last-child td {
    border-bottom: 0;
}

.users-table td:first-child strong {
    margin-right: 0.45rem;
}

.users-you-label {
    color: #888;
    font-size: 0.67rem;
}

.users-role-badge {
    display: inline-block;
    padding: 0.22rem 0.45rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
}

.users-role-badge.is-admin {
    color: #98202a;
    background: #f8e5e7;
}

.users-role-badge.is-cashier {
    color: #355b44;
    background: #e4efe8;
}

.users-role-form {
    display: flex;
    gap: 0.35rem;
}

.users-role-form select {
    min-height: 34px;
    background-color: var(--card-bg);
}

.users-role-form button {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    color: #fff;
    background: var(--primary-green);
    border-radius: 4px;
}

@media (max-width: 900px) {
    .users-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .users-main,
    #sidebar.expand ~ .users-main {
        width: 100%;
        margin-left: 0 !important;
        padding: 4.5rem 1rem 1.5rem;
    }
}

[data-theme="dark"] .log-action-added,
[data-theme="dark"] .log-action-restored,
[data-theme="dark"] .log-action-stock-in {
    color: #b7dfc5;
    background: #273b2e;
}

[data-theme="dark"] .log-action-edited,
[data-theme="dark"] .log-action-stock-out {
    color: #f0c86a;
    background: #403820;
}

[data-theme="dark"] .log-action-login {
    color: #bed9eb;
    background: #263845;
}

[data-theme="dark"] .log-action-logout,
[data-theme="dark"] .log-action-other {
    color: #ddd;
    background: #383838;
}

@media (max-width: 900px) {
    .logs-filters {
        grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(135px, 1fr));
    }

    .logs-action-filter,
    .logs-page-size-field {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .logs-main,
    #sidebar.expand ~ .logs-main {
        width: 100%;
        margin-left: 0 !important;
        padding: 1.5rem 1rem;
    }

    .logs-page-header h1 {
        font-size: 1.3rem;
    }

    .logs-filters {
        grid-template-columns: 1fr 1fr;
    }

    .logs-search-field,
    .logs-action-filter,
    .logs-page-size-field {
        grid-column: 1 / -1;
    }

    .logs-page-size-field {
        justify-content: flex-start;
        padding: 0 0.65rem;
    }

    .log-entry {
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 0.55rem;
        padding: 0.75rem;
    }

    .log-entry-icon {
        width: 30px;
        height: 30px;
        font-size: 0.78rem;
    }
}

#addProductModal {
    padding: 1rem 0;
    background: rgba(18, 18, 18, 0.58);
}

#addProductModal .modal-wide {
    display: flex;
    width: min(900px, calc(100% - 2rem));
    max-width: 900px;
    max-height: calc(100vh - 2rem);
    flex-direction: column;
    margin: 1rem auto;
    padding: 0;
    overflow: hidden;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.product-modal-header {
    display: flex;
    min-height: 82px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.4rem;
    border-bottom: 1px solid var(--border-color);
}

.product-modal-header .pos-eyebrow {
    margin: 0 0 0.15rem;
}

.product-modal-header h2 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.2rem;
    text-align: left;
}

.product-modal-close {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    color: var(--text-dark);
    background: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.product-modal-close:hover {
    color: var(--primary-green);
    background: var(--light-green);
    transform: none;
}

#addProductModal #productForm {
    display: flex;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
}

#addProductModal .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem 1.4rem;
    min-height: 0;
    margin: 0;
    padding: 1.1rem 1.4rem;
    overflow-y: auto;
}

#addProductModal .form-column {
    min-width: 0;
    gap: 0.75rem;
}

#addProductModal .form-column h3 {
    margin: 0 0 0.1rem;
    color: #777;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
}

#addProductModal .form-group {
    min-width: 0;
    margin: 0;
}

#addProductModal .form-group[hidden] {
    display: none !important;
}

#addProductModal .form-group label {
    margin: 0 0 0.3rem;
    color: var(--text-dark);
    font-size: 0.72rem;
    font-weight: 650;
}

#addProductModal .form-group input:not([type="file"]) {
    width: 100%;
    min-height: 40px;
    padding: 0.5rem 0.65rem;
    color: var(--text-dark);
    background: var(--main-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.8rem;
}

#addProductModal .barcode-input-row {
    align-items: stretch;
}

#addProductModal .barcode-scanner-button {
    min-height: 40px;
}

#addProductModal input[type="file"] {
    display: block;
    width: 100%;
    min-height: 38px;
    color: var(--text-dark);
    font-size: 0.72rem;
}

#addProductModal #imagePreview {
    width: 128px;
    height: 96px;
    margin-top: 0.4rem;
    padding: 0.3rem;
    border-width: 1px;
    border-radius: 5px;
}

#addProductModal .product-modal-footer {
    display: flex;
    min-height: 68px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1.4rem;
    background: var(--light-gray);
    border-top: 1px solid var(--border-color);
}

.product-modal-footer > span {
    color: #777;
    font-size: 0.72rem;
}

.product-modal-footer > div {
    display: flex;
    flex: 0 0 auto;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    body {
        overflow-x: clip;
    }

    .main {
        min-width: 0;
    }

    main input:not([type="checkbox"]):not([type="radio"]),
    main select,
    main textarea {
        font-size: 16px;
    }

    #sidebar,
    #sidebar.expand {
        height: 100vh;
        height: 100dvh;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .sidebar-nav {
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-menu-btn {
        top: max(12px, env(safe-area-inset-top));
        left: max(12px, env(safe-area-inset-left));
        width: 44px;
        height: 44px;
        min-width: 44px;
    }

    .app-topbar,
    #sidebar.expand ~ .app-topbar {
        padding-right: max(0.75rem, env(safe-area-inset-right));
        padding-left: max(64px, calc(env(safe-area-inset-left) + 56px));
    }

    #appTopbar ~ .main {
        padding-right: max(1rem, env(safe-area-inset-right)) !important;
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom)) !important;
        padding-left: max(1rem, env(safe-area-inset-left)) !important;
    }

    .topbar-notification-button {
        width: 44px;
        height: 44px;
    }

    .pos-catalog-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 0.65rem;
    }

    .pos-catalog-actions {
        width: 100%;
        flex: 0 0 auto;
        align-items: stretch;
        flex-direction: column;
    }

    .pos-catalog-actions .pos-search {
        width: 100%;
        min-height: 44px;
        flex: 0 0 auto;
    }

    .pos-catalog-actions .pos-search input {
        min-width: 0;
        min-height: 44px;
    }

    .pos-product {
        min-height: 120px;
    }
}

.product-modal-footer button {
    min-height: 38px;
    margin: 0;
    padding: 0.5rem 0.85rem;
    border-radius: 5px;
    font-size: 0.78rem;
    font-weight: 650;
}

.product-modal-footer .product-modal-cancel {
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.product-modal-footer #submitButton {
    min-width: 128px;
    color: #fff;
    background: var(--primary-green);
}

.product-modal-footer #submitButton:hover {
    background: var(--hover-green);
}

@media (max-width: 768px) {
    #addProductModal {
        padding: 0.5rem 0;
    }

    #addProductModal .modal-wide {
        width: calc(100% - 1rem);
        max-height: calc(100vh - 1rem);
        margin: 0.5rem auto;
    }

    #addProductModal .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.9rem 1rem;
    }

    .product-modal-header,
    #addProductModal .product-modal-footer {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .product-modal-footer > span {
        display: none;
    }
}

.pos-mode-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    margin-bottom: 0.85rem;
    padding: 0.25rem;
    background: var(--main-bg);
    border-radius: 6px;
}

.pos-mode-tabs-overall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pos-main-mode-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    flex: 0 1 980px;
    max-width: 980px;
    margin: 0;
}

.pos-main-mode-tabs.pos-mode-tabs-overall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pos-cart-column {
    min-width: 0;
}

.pos-layout.is-return-stock {
    grid-template-columns: minmax(0, 1fr);
}

.pos-layout.is-return-stock .pos-cart-column {
    max-width: 500px;
}

.pos-mode-tab {
    min-height: 38px;
    margin: 0;
    padding: 0.45rem 0.65rem;
    color: var(--text-dark);
    background: transparent;
    border-radius: 4px;
    font-size: 0.84rem;
    font-weight: 700;
}

.pos-mode-tab:hover:not(:disabled) {
    background: var(--light-green);
    transform: none;
}

.pos-mode-tab.is-active,
.pos-mode-tab.is-active:hover {
    color: #fff;
    background: var(--primary-green);
}

.pos-mode-tab:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

#posStockOutReasonField .pos-input {
    min-height: 76px;
    resize: vertical;
}

#posTotals[hidden],
#posSaleFields[hidden],
#posPaymentAmountFields[hidden],
#posQuickCashFields[hidden],
#posOrFields[hidden],
#posCodNote[hidden],
#posPaylaterNote[hidden],
#posWaybillField[hidden],
#posCustomerNumberField[hidden],
#posStockOutReasonField[hidden],
#posLayout[hidden],
#posCatalog[hidden],
#posCartColumn[hidden],
#posCartPanel[hidden],
#posReturnStock[hidden],
#posPendingOrders[hidden],
#posStockOutRecords[hidden],
#posPendingTools[hidden],
#posPendingPagination[hidden],
#posStockOutRecordsPagination[hidden] {
    display: none;
}

.pos-transaction-status {
    margin: 0 0 0.75rem;
    padding: 0.6rem;
    color: #155d36;
    background: #e5f4eb;
    border-radius: 4px;
    font-size: 0.82rem;
}

.pos-pending-orders {
    max-width: 1320px;
    margin: 0 auto;
}

.pos-stock-out-records {
    max-width: 1320px;
    margin: 0 auto;
}

.pos-stock-out-record-tools {
    grid-template-columns: minmax(220px, 1fr) minmax(110px, 0.3fr);
}

.pos-stock-out-record-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    align-items: start;
    gap: 0.75rem;
}

.pos-stock-out-record {
    display: grid;
    min-width: 0;
    gap: 0.55rem;
    padding: 0.8rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 3px solid #d64545;
    border-radius: 7px;
    box-shadow: var(--shadow);
}

.pos-stock-out-record-header {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
}

.pos-stock-out-record-header h3 {
    min-width: 0;
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.pos-stock-out-branch {
    flex: 0 0 auto;
    padding: 0.2rem 0.4rem;
    color: #a42f39;
    background: rgb(214 69 69 / 9%);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.pos-stock-out-record > p {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 0.74rem;
}

.pos-stock-out-record > p:not(.pos-stock-out-reason) {
    color: #777;
}

.pos-stock-out-reason {
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.pos-stock-out-quantity {
    width: fit-content;
    padding: 0.24rem 0.5rem;
    background: var(--main-bg);
    border-radius: 4px;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.pos-stock-out-record-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.35rem 0.65rem;
    color: #777;
    font-size: 0.7rem;
}

.pos-pending-header,
.pos-pending-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.pos-pending-header {
    margin-bottom: 1rem;
}

.pos-pending-header h2,
.pos-pending-order h3 {
    margin: 0;
    font-size: 1.05rem;
}

.pos-pending-header .pos-muted {
    margin: 0.3rem 0 0;
}

.pos-pending-tools {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(145px, 1fr)) minmax(95px, 0.55fr);
    align-items: end;
    gap: 0.75rem;
    margin-bottom: 0.7rem;
    padding: 0.9rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.pos-pending-search,
.pos-pending-select {
    display: grid;
    gap: 0.35rem;
    color: var(--text-dark);
    font-size: 0.75rem;
    font-weight: 700;
}

.pos-pending-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 40px;
    padding: 0 0.65rem;
    color: #777;
    background: var(--main-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.pos-pending-control input,
.pos-pending-select select {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    color: var(--text-dark);
    background: var(--main-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font: inherit;
}

.pos-pending-control input {
    min-height: 36px;
    padding: 0;
    background: transparent;
    border: 0;
    outline: none;
}

.pos-pending-select select {
    padding: 0 0.55rem;
    font-size: 0.82rem;
}

.pos-pending-control:focus-within,
.pos-pending-select select:focus-visible {
    border-color: var(--primary-green);
    outline: 2px solid var(--primary-green);
    outline-offset: 1px;
}

.pos-pending-count {
    margin: 0 0 0.65rem;
    color: #777;
    font-size: 0.8rem;
}

.pos-pending-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
    align-items: start;
    gap: 0.85rem;
}

.pos-pending-order {
    display: grid;
    align-content: start;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.85rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--primary-green);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.pos-pending-order.is-canceled {
    border-top-color: #b42318;
}

.pos-pending-order.is-canceled .pos-pending-totals {
    color: #8f1b13;
}

.pos-pending-order > header {
    min-width: 0;
}

.pos-pending-order h3 {
    overflow-wrap: anywhere;
    font-size: 0.94rem;
    line-height: 1.35;
}

.pos-pending-order header p {
    display: -webkit-box;
    margin: 0.3rem 0 0;
    color: #777;
    font-size: 0.74rem;
    overflow-wrap: anywhere;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.pos-pending-customer {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.pos-pending-customer p {
    margin: 0;
}

.pos-pending-details {
    min-width: 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.pos-pending-details summary {
    padding: 0.55rem 0;
    color: var(--primary-green);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.pos-pending-details[open] summary {
    margin-bottom: 0.25rem;
}

.pos-pending-items {
    display: grid;
    max-height: 300px;
    overflow: auto;
}

.pos-pending-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem 0.8rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border-color);
}

.pos-pending-item > strong {
    font-size: 0.86rem;
}

.pos-pending-item > small {
    color: #777;
    font-size: 0.78rem;
}

.pos-pending-price-controls {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.6rem;
}

.pos-pending-price-controls label {
    display: grid;
    gap: 0.25rem;
    color: var(--text-dark);
    font-size: 0.75rem;
    font-weight: 600;
}

.pos-pending-price-controls input {
    width: 130px;
    min-height: 36px;
    padding: 0.4rem;
    color: var(--text-dark);
    background: var(--main-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.pos-pending-price-controls > strong {
    margin-left: auto;
}

.pos-pending-totals {
    padding-top: 0.1rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.pos-pending-actions {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    justify-content: stretch;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.pos-pending-actions .pos-checkout-button,
.pos-pending-actions .pos-secondary-button {
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0.45rem 0.6rem;
    font-size: 0.75rem;
}

.pos-pending-actions .pos-pending-cancel {
    grid-column: 1 / -1;
}

.pos-pending-pagination,
.pos-pending-page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.pos-pending-pagination {
    margin-top: 1rem;
    padding: 0.75rem 0;
    color: #777;
    border-top: 1px solid var(--border-color);
    font-size: 0.82rem;
}

.pos-pending-page-actions {
    color: var(--text-dark);
}

.pos-pending-page-actions .pos-secondary-button {
    min-width: 88px;
}

.pos-pending-page-actions .pos-secondary-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pos-secondary-button {
    min-height: 38px;
    padding: 0.45rem 0.75rem;
    color: var(--text-dark);
    background: var(--main-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.pos-secondary-button:hover:not(:disabled) {
    background: var(--light-green);
}

.pos-cod-confirm-dialog {
    width: min(92vw, 430px);
    max-width: none;
    padding: 1.25rem;
    color: var(--text-dark);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.3);
}

.pos-cod-confirm-dialog::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.pos-cod-confirm-dialog h2 {
    margin: 0 0 0.7rem;
    font-size: 1.1rem;
}

.pos-cod-confirm-dialog p {
    line-height: 1.45;
}

.pos-cod-confirm-dialog footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.pos-cod-confirm-dialog footer button {
    min-height: 40px;
    padding: 0.5rem 0.8rem;
    border-radius: 5px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

#posCodConfirmSubmit {
    color: #fff;
    background: var(--primary-green);
    border: 0;
}

#posCodConfirmCancel {
    color: var(--text-dark);
    background: var(--main-bg);
    border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    #sidebar.mobile-open .sidebar-title,
    #sidebar.mobile-open a.sidebar-link span,
    #sidebar.mobile-open .sidebar-section-title,
    #sidebar.mobile-open .sidebar-logo {
        max-width: none;
        transform: none;
        pointer-events: auto;
        opacity: 1;
    }

    #sidebar.mobile-open .sidebar-title {
        flex: 1 1 auto;
    }

    #sidebar.mobile-open .sidebar-section-title {
        display: block;
    }

    #sidebar.mobile-open a.sidebar-link span,
    #sidebar.mobile-open .theme-label {
        display: inline;
        overflow: visible;
    }

    #sidebar.mobile-open .sidebar-link {
        justify-content: flex-start;
        min-height: 44px;
        padding: 0.65rem 0.8rem;
    }

    #sidebar.mobile-open .sidebar-link i {
        margin-right: 0.7rem !important;
    }
}
