/* Khmer + Latin faces, served locally.
   These were commented out, which left font-family: "Noto Serif Khmer" with no
   source of its own — the page fell back to whatever the machine had unless it
   could reach fonts.googleapis.com. A till on a LAN often cannot. */
@font-face {
    font-family: "Noto Serif Khmer";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../Font/khmer.woff2") format("woff2");
    unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}

@font-face {
    font-family: "Noto Serif Khmer";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../Font/latinex.woff2") format("woff2");
    unicode-range:
        U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
        U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
        U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Noto Serif Khmer";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../Font/latin.woff2") format("woff2");
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
        U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Only the font here.
   `margin: 0` and `box-sizing: border-box` used to be on this rule as well, but
   Tailwind's preflight already sets both — and it does so inside @layer base,
   which utilities are allowed to override. This file is unlayered and loads after
   the build, so its `margin: 0` beat the utilities layer and silently cancelled
   every space-y-*, space-x-* and divide-y in the app (Tailwind v4 emits those as
   zero-specificity `:where(...)` rules). That is why cards sat flush with no gap. */
* {
    font-family: "Noto Serif Khmer", serif;
}



@keyframes pageEnter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main {
    position: relative;
    max-height: 95vh;
    overflow: hidden;


}

#toggleSidebar {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 1000;

    font-size: 25px;

    width: 20px;
    height: 60px;

    background: #2563eb;
    /* blue */
    color: white;

    border-radius: 30px 0 0 30px;
    /* round LEFT only */
    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
}

#container {
    width: 100%;
    height: 100vh;
    display: flex;
    /* enforce flex even if a class gets lost */
}

#sidebar {
    flex: 0 0 380px;
    max-width: 80vw;
    /* was 700px */
    min-width: 280px;
    background: #fff;
}

#inner-sidebar {
    height: 90vh !important;
    overflow: auto;
    background-color: white;
    width: 100%;
    /* follow sidebar width */
}

#screen-only {
    width: 100%;

    overflow: hidden;
}

#tab-content {
    height: 90vh;
    overflow: auto;
}

/* slim styled scrollbar for product grid */
#tab-content {
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: rgba(124, 92, 252, .45) transparent;
    scroll-behavior: smooth;
}

/* Chrome / Edge / Safari */
#tab-content::-webkit-scrollbar {
    width: 8px;
}

#tab-content::-webkit-scrollbar-track {
    background: transparent;
}

#tab-content::-webkit-scrollbar-thumb {
    background: rgba(124, 92, 252, .35);
    /* matches your purple card theme */
    border-radius: 9999px;
    border: 2px solid transparent;
    background-clip: content-box;
    /* inset look */
}

#tab-content::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 92, 252, .65);
    background-clip: content-box;
}

#sidebar.hidden {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

/* collapsed state */
#sidebar.collapsed {
    width: 0;
    opacity: 0;
    overflow: hidden;
}

#mainContent {
    flex: 1 1 auto;
    /* take all remaining space */
    min-width: 0;
    /* CRITICAL: lets it shrink, otherwise sidebar "moves alone" */
    overflow: hidden;
}

#mainContent.expanded {
    width: 100%;
}

#resizer {
    flex: 0 0 6px;
    /* fixed 6px wide, never grows */
    cursor: col-resize;
    background: #e5e7eb;
    position: relative;
    z-index: 20;
    transition: background 0.15s ease;
}

#resizer:hover,
#resizer.active {
    background: #60a5fa;
}

.resizer-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 40px;
    border-radius: 999px;
    background: #9ca3af;
}

/* your existing toggle button */
#toggleSidebar {
    position: fixed;
    top: 5%;
    right: 0;
    transform: translateY(-50%);
    z-index: 1000;
}

.card_style {
    isolation: isolate;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    min-width: 0;
    min-height: 150px;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease,
        background-color 0.25s ease;
}

.card_style {
    position: relative;
}

.info {
    position: absolute;
    top: 20px;
    right: 10px;
    border: #eff6ff;
    font-size: 20px;
}

.card_style:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    background-color: #f8fafc;
    /* soft */
}

.card_style:hover img {
    transform: scale(1.05);
}

.card_style.active {
    border-color: #2563eb;
    background-color: #eff6ff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.card_style:active {
    transform: scale(0.98);
}

.cart-burst {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
}

/* ===== Customer display toggle ===== */
.cd-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: #6b7280;
}

.cd-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    padding: 0 !important;
    /* beat the global input padding rule */
}

.cd-track {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    border-radius: 999px;
    background: #d1d5db;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.cd-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
    transition: left 0.2s ease;
}

.cd-toggle input:checked+.cd-track {
    background: #22c55e;
}

.cd-toggle input:checked+.cd-track .cd-knob {
    left: 22px;
}

.cart-icon {
    position: absolute;
    font-size: 26px;
    /* 🔥 BIGGER */
    animation: pop 0.8s ease-out forwards;
}

/* ===== Theme toggle button ===== */
.theme-btn {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
    transition: all .2s ease;
}

.theme-btn:hover {
    color: #111827;
    border-color: #d1d5db;
}

.theme-btn {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
    transition: all .2s ease;
}

.theme-btn:hover {
    color: #111827;
    border-color: #d1d5db;
}

.theme-btn.dark-on {
    background: #1e293b;
    border-color: #334155;
    color: #fbbf24;
}

/* 🛒 Cart = ORANGE */
.cart-icon.cart {
    color: #fb923c;
    /* orange-400 */
    text-shadow: 0 0 10px rgba(251, 146, 60, 0.8);
}

/* ➕ Plus = GREEN */
.cart-icon.plus {
    color: #22c55e;
    /* green-500 */
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
}

.screen-only {
    width: 100%;
    height: 80vh;

    position: relative;
}

#header_invoice {
    position: sticky;
    background-color: rgb(255, 255, 255);
    top: 0;
    z-index: 999;
}

#total {
    position: sticky;
    background-color: rgb(255, 255, 255);
    bottom: 0;
    width: 100%;
    height: auto;
}

.card {
    border-bottom: 1px solid rgb(218, 218, 218);
    background-color: rgb(247, 247, 247);
}

.list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    border: 1px solid #e5e7eb;
    max-height: 260px;
    /* taller: ~6-7 rows visible */
    overflow-y: auto;
    padding: 0;
    margin: 4px 0 0;
    list-style: none;
    background: white;
    z-index: 9999;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* slim styled scrollbar */
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: rgba(100, 116, 139, .5) transparent;
}

/* Chrome / Edge / Safari */
.list::-webkit-scrollbar {
    width: 6px;
}

.list::-webkit-scrollbar-track {
    background: transparent;
}

.list::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, .4);
    border-radius: 9999px;
}

.list::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, .7);
}

.hidden {
    display: none;
}

#list_main {
    position: relative;
    /* needed for absolute ul to position correctly */
    width: 300px;
    /* same width as before */
}

.invoice-totals {
    display: flex;
    align-items: center;
    justify-content: end;
}

#inner-sidebar {
    height: 90vh !important;
    overflow: auto;
    background-color: white;
}

#invoice h1 {
    font-size: 20px;
}

#invoice table th {
    font-size: 10px;
}

#invoice table td {
    font-size: 8px !important;
}

table td,
table th {
    padding: 2px 5px;
}

#logo {
    width: 100px;
}

.animate-scaleUp {
    animation: scaleUp 0.2s ease-out;
}

.scroll_content_70 {

    max-height: 80vh;

    overflow-y: auto;
}

#Table-sale-list {
    width: 100%;

    border-collapse: collapse;
    font-size: 13px;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Table header */
#Table-sale-list thead th {
    position: sticky;
    /* header stays on top */
    top: 0;
    background-color: #f9fafb;
    z-index: 10;
    padding: 10px 8px;
    /* more padding makes header taller */
    text-align: left;
}

/* Table body rows */
#Table-sale-list tbody tr {
    height: auto;
    /* let it grow if content bigger */
    border-bottom: 1px solid #e5e7eb;
    /* light row separator */
}

/* Table cells */
#Table-sale-list td {
    padding: 8px 6px;
    /* better spacing inside cells */
    vertical-align: middle;
    /* aligns content nicely vertically */
}

/* Optional: alternate row color */
#Table-sale-list tbody tr:nth-child(even) {
    background-color: #f5f5f5;
}

#Table-sale-list thead th {
    position: sticky !important;
    top: 0;
    z-index: 10;
    background-color: rgb(20, 20, 99);
    /* must have a background */
    color: white;
}

#toastMessage {
    z-index: 10000 !important;
    /* Above the bottom menu bar, not on it. Keyed on the id so it beats the utility
       class in the markup whatever order the stylesheets load in, and so it does not
       depend on an arbitrary-value Tailwind class the build may not contain. */
    bottom: 6.5rem;
}

/* sticky header */

/* ===== Shared Table Styles ===== */
#Table-sale-list-container {
    max-height: 70vh;
    overflow-y: auto;
    /* vertical scroll */
    overflow-x: hidden;
    /* avoid horizontal scroll conflict */
}

#Table-sale-list {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#Table-sale-list thead th {
    position: sticky !important;
    top: 0;
    z-index: 10;
    background-color: rgb(0, 0, 129);
    /* must have background */
    color: white;
    font-weight: bold;
    text-align: left;
    padding: 5px 8px;
}

#Table-sale-list th:nth-child(2) {
    position: sticky !important;
    left: 0;
    background-color: rgb(0, 0, 129);
    /* must have background */
    color: white;
    font-weight: bold;
    text-align: left;
    color: white;
    z-index: 999 !important;
}

#Table-sale-list td:nth-child(2) {
    position: sticky !important;
    left: 0;
    background-color: rgb(255, 255, 255);
    /* must have background */
    z-index: 9 !important;
}

#Table-sale-list tbody td {
    padding: 5px 8px;
    border-bottom: 1px solid #ccc;
}

#Table-sale-list tbody tr:hover {
    background-color: #f9f9f9;
}

/* Product Table  */
/* ------------------------------------------------------------------------------ */
/* Remove global box-shadow / border-radius for report table */
#product_table {
    border-radius: 0 !important;
    box-shadow: none !important;
}

#product_table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#product_table thead th {
    position: sticky !important;
    top: 0;
    z-index: 10;
    background-color: rgb(0, 0, 129);
    /* must have background */
    color: white;
    font-weight: bold;
    text-align: left;
    padding: 5px 8px;
}

#product_table th:nth-child(1) {
    position: sticky !important;
    left: 0;
    background-color: rgb(0, 0, 129);
    /* must have background */
    color: white;
    font-weight: bold;
    text-align: left;
    color: white;
    z-index: 999 !important;
}

#product_table td:nth-child(1) {
    position: sticky !important;
    left: 0;
    background-color: rgb(255, 255, 255);
    /* must have background */
    z-index: 9 !important;
}

#product_table th:nth-child(3) {
    position: sticky !important;
    left: 30px;
    background-color: rgb(0, 0, 129);
    /* must have background */
    color: white;
    font-weight: bold;
    text-align: left;
    color: white;
    z-index: 999 !important;
}

#product_table td:nth-child(3) {
    position: sticky !important;
    left: 30px;
    background-color: rgb(255, 255, 255);
    /* must have background */
    z-index: 9 !important;
}

#product_table tbody td {
    padding: 5px 8px;
    border-bottom: 1px solid #ccc;
}

#product_table tbody tr:hover {
    background-color: #f9f9f9;
}

/* Product Table  */
/* ------------------------------------------------------------------------------ */
/* Report Table Base */
#wh-product {
    width: 100%;

    border-collapse: collapse;
    font-size: 13px;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Table header */
#wh-product thead th {
    position: sticky !important;
    top: 0;
    z-index: 10;
    background-color: rgb(0, 0, 129);
    /* header bg */
    color: white;
    font-weight: bold;
    text-align: left;
    padding: 8px 10px;
    /* consistent padding */
    white-space: nowrap;
}

/* Table body cells */
#wh-product tbody td {
    padding: 8px 10px;
    /* consistent padding */
    border-bottom: 1px solid #ccc;
    vertical-align: middle;
    /* center content vertically */
    white-space: nowrap;
}

/* Table rows */
#wh-product tbody tr {
    height: auto;
    /* allow growth for bigger content */
}

/* Right-align numeric columns */
#wh-product tbody td.numeric {
    text-align: right;
}

/* Hover effect */
#wh-product tbody tr:hover {
    background-color: #f9f9f9;
}

/* Optional: alternate row colors */
#wh-product tbody tr:nth-child(even) {
    background-color: #fefefe;
}

/* Scrollable container (if needed) */
#wh-product-container {
    max-height: 70vh;
    overflow-y: auto;
}

/* Optional: fix table width for horizontal scroll */
#wh-product {
    table-layout: auto;
    /* auto or fixed depending on your preference */
}

/* ------------------------------------------------------------------------------ */

/* Report Table Base */
#user-table {
    width: 100%;

    border-collapse: collapse;
    font-size: 13px;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Table header */
#user-table thead th {
    position: sticky !important;
    top: 0;
    z-index: 10;
    background-color: rgb(0, 0, 129);
    /* header bg */
    color: white;
    font-weight: bold;
    text-align: left;
    padding: 8px 10px;
    /* consistent padding */
    white-space: nowrap;
}

/* Table body cells */
#user-table tbody td {
    padding: 8px 10px;
    /* consistent padding */
    border-bottom: 1px solid #ccc;
    vertical-align: middle;
    /* center content vertically */
    white-space: nowrap;
}

/* Right-align numeric columns */
#user-table tbody td.numeric {
    text-align: right;
}

/* Hover effect */
#user-table tbody tr:hover {
    background-color: #f9f9f9;
}

/* Optional: alternate row colors */
#user-table tbody tr:nth-child(even) {
    background-color: #fefefe;
}

/* Scrollable container (if needed) */
#user-table-container {
    max-height: 70vh;
    overflow-y: auto;
}

/* Optional: fix table width for horizontal scroll */
#user-table {
    table-layout: auto;
    /* auto or fixed depending on your preference */
}

/* ------------------------------------------------------------------------------ */

/* ------------------------------------------------------------------------------ */

/* Report Table Base */
#customer-list {
    width: 100%;
    /* Table container min-height */
    border-collapse: collapse;
    font-size: 13px;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Table header */
#customer-list thead th {
    position: sticky !important;
    top: 0;
    z-index: 10;
    background-color: rgb(0, 0, 129);
    /* header bg */
    color: white;
    font-weight: bold;
    text-align: left;
    padding: 8px 10px;
    /* consistent padding */
    white-space: nowrap;
}

/* Table body cells */
#customer-list tbody td {
    padding: 8px 10px;
    /* consistent padding */
    border-bottom: 1px solid #ccc;
    vertical-align: middle;
    /* center content vertically */
    white-space: nowrap;
}

/* Table rows */
#customer-list tbody tr {
    height: auto;
    /* allow growth for bigger content */
}

/* Right-align numeric columns */
#customer-list tbody td.numeric {
    text-align: right;
}

/* Hover effect */
#customer-list tbody tr:hover {
    background-color: #f9f9f9;
}

/* Optional: alternate row colors */
#customer-list tbody tr:nth-child(even) {
    background-color: #fefefe;
}

/* Scrollable container (if needed) */
#customer-list-container {
    max-height: 70vh;
    overflow-y: auto;
}

/* Optional: fix table width for horizontal scroll */
#customer-list {
    table-layout: auto;
    /* auto or fixed depending on your preference */
}

/* ------------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------------------- */
/* Sale Order  */
#Table-sale-order {
    width: 100%;

    border-collapse: collapse;
    font-size: 13px;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Table header */
#Table-sale-order thead th {
    position: sticky;
    /* header stays on top */
    top: 0;
    background-color: #f9fafb;
    z-index: 10;
    padding: 10px 8px;
    /* more padding makes header taller */
    text-align: left;
}

/* Table body rows */
#Table-sale-order tbody tr {
    height: auto;
    /* let it grow if content bigger */
    border-bottom: 1px solid #e5e7eb;
    /* light row separator */
}

/* Table cells */
#Table-sale-order td {
    padding: 8px 6px;
    /* better spacing inside cells */
    vertical-align: middle;
    /* aligns content nicely vertically */
}

/* Optional: alternate row color */
#Table-sale-order tbody tr:nth-child(even) {
    background-color: #f5f5f5;
}

#Table-sale-order thead th {
    position: sticky !important;
    top: 0;
    z-index: 10;
    background-color: rgb(20, 20, 99);
    /* must have a background */
    color: white;
}

#toastMessage {
    z-index: 10000 !important;
}

/* sticky header */

/* ===== Shared Table Styles ===== */
#Table-sale-order-container {
    max-height: 70vh;
    overflow-y: auto;
    /* vertical scroll */
    overflow-x: hidden;
    /* avoid horizontal scroll conflict */
}

#Table-sale-order {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

#Table-sale-order thead th {
    position: sticky !important;
    top: 0;
    z-index: 10;
    background-color: rgb(0, 0, 129);
    /* must have background */
    color: white;
    font-weight: bold;
    text-align: left;
    padding: 5px 8px;
}

#Table-sale-order th:nth-child(2) {
    position: sticky !important;
    left: 0;
    background-color: rgb(0, 0, 129);
    /* must have background */
    color: white;
    font-weight: bold;
    text-align: left;
    color: white;
    z-index: 999 !important;
}

#Table-sale-order td:nth-child(2) {
    position: sticky !important;
    left: 0;
    background-color: rgb(255, 255, 255);
    /* must have background */
    z-index: 9 !important;
}

#Table-sale-order tbody td {
    padding: 5px 8px;
    border-bottom: 1px solid #ccc;
}

#Table-sale-order tbody tr:hover {
    background-color: #f9f9f9;
}



/* ------------------------------------------------------------------------------ */

/* Report Table Base */
#vendor-list {
    width: 100%;
    /* Table container min-height */
    border-collapse: collapse;
    font-size: 13px;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Table header */
#vendor-list thead th {
    position: sticky !important;
    top: 0;
    z-index: 10;
    background-color: rgb(0, 0, 129);
    /* header bg */
    color: white;
    font-weight: bold;
    text-align: left;
    padding: 8px 10px;
    /* consistent padding */
    white-space: nowrap;
}

/* Table body cells */
#vendor-list tbody td {
    padding: 8px 10px;
    /* consistent padding */
    border-bottom: 1px solid #ccc;
    vertical-align: middle;
    /* center content vertically */
    white-space: nowrap;
}

/* Table rows */
#vendor-list tbody tr {
    height: auto;
    /* allow growth for bigger content */
}

/* Right-align numeric columns */
#vendor-list tbody td.numeric {
    text-align: right;
}

/* Hover effect */
#vendor-list tbody tr:hover {
    background-color: #f9f9f9;
}

/* Optional: alternate row colors */
#vendor-list tbody tr:nth-child(even) {
    background-color: #fefefe;
}

/* Scrollable container (if needed) */
#vendor-list-container {
    max-height: 70vh;
    overflow-y: auto;
}

/* Optional: fix table width for horizontal scroll */
#vendor-list {
    table-layout: auto;
    /* auto or fixed depending on your preference */
}

/* ------------------------------------------------------------------------------ */

/* ------------------------------------------------------------------------------ */

/* Report Table Base */
#Table-Purchase-list {
    width: 100%;
    /* Table container min-height */
    border-collapse: collapse;
    font-size: 13px;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Table header */
#Table-Purchase-list thead th {
    position: sticky !important;
    top: 0;
    z-index: 10;
    background-color: rgb(0, 0, 129);
    /* header bg */
    color: white;
    font-weight: bold;
    text-align: left;
    padding: 8px 10px;
    /* consistent padding */
    white-space: nowrap;
}

/* Table body cells */
#Table-Purchase-list tbody td {
    padding: 8px 10px;
    /* consistent padding */
    border-bottom: 1px solid #ccc;
    vertical-align: middle;
    /* center content vertically */
    white-space: nowrap;
}

/* Table rows */
#Table-Purchase-list tbody tr {
    height: auto;
    /* allow growth for bigger content */
}

/* Right-align numeric columns */
#Table-Purchase-list tbody td.numeric {
    text-align: right;
}

/* Hover effect */
#Table-Purchase-list tbody tr:hover {
    background-color: #f9f9f9;
}

/* Optional: alternate row colors */
#Table-Purchase-list tbody tr:nth-child(even) {
    background-color: #fefefe;
}

/* Scrollable container (if needed) */
#Table-Purchase-list-container {
    max-height: 70vh;
    overflow-y: auto;
}

/* Optional: fix table width for horizontal scroll */
#Table-Purchase-list {
    table-layout: auto;
    /* auto or fixed depending on your preference */
}

/* ------------------------------------------------------------------------------ */




#Table-item-ledger-entry {
    width: 100%;

    border-collapse: collapse;
    font-size: 13px;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Table header */
#Table-item-ledger-entry thead th {
    position: sticky;
    /* header stays on top */
    top: 0;
    background-color: #f9fafb;
    z-index: 10;
    padding: 10px 8px;
    /* more padding makes header taller */
    text-align: left;
}

/* Table body rows */
#Table-item-ledger-entry tbody tr {
    height: auto;
    /* let it grow if content bigger */
    border-bottom: 1px solid #e5e7eb;
    /* light row separator */
}

/* Table cells */
#Table-item-ledger-entry td {
    padding: 8px 6px;
    /* better spacing inside cells */
    vertical-align: middle;
    /* aligns content nicely vertically */
}

/* Optional: alternate row color */
#Table-item-ledger-entry tbody tr:nth-child(even) {
    background-color: #f5f5f5;
}

#Table-item-ledger-entry thead th {
    position: sticky !important;
    top: 0;
    z-index: 10;
    background-color: rgb(20, 20, 99);
    /* must have a background */
    color: white;
}

#Table-item-ledger-entry th:nth-child(4) {
    position: sticky !important;
    left: 0;
    background-color: rgb(0, 0, 129);
    /* must have background */
    color: white;
    font-weight: bold;
    text-align: left;
    color: white;
    z-index: 999 !important;
}

#Table-item-ledger-entry td:nth-child(4) {
    position: sticky !important;
    left: 0;
    background-color: rgb(255, 255, 255);
    /* must have background */
    z-index: 9 !important;
}

/* -------------------------------------------------------- */









/* ------------------------------------------------------------------------------ */

/* Report Table Base */
#Table-sale-list {
    width: 100%;
    /* Table container min-height */
    border-collapse: collapse;
    font-size: 13px;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Table header */
#Table-sale-list thead th {
    position: sticky !important;
    top: 0;
    z-index: 10;
    background-color: rgb(0, 0, 129);
    /* header bg */
    color: white;
    font-weight: bold;
    text-align: left;
    padding: 8px 10px;
    /* consistent padding */
    white-space: nowrap;
}

/* Table body cells */
#Table-sale-list tbody td {
    padding: 8px 10px;
    /* consistent padding */
    border-bottom: 1px solid #ccc;
    vertical-align: middle;
    /* center content vertically */
    white-space: nowrap;
}

/* Table rows */
#Table-sale-list tbody tr {
    height: auto;
    /* allow growth for bigger content */
}

/* Right-align numeric columns */
#Table-sale-list tbody td.numeric {
    text-align: right;
}

/* Hover effect */
#Table-sale-list tbody tr:hover {
    background-color: #f9f9f9;
}

/* Optional: alternate row colors */
#Table-sale-list tbody tr:nth-child(even) {
    background-color: #fefefe;
}

/* Scrollable container (if needed) */
#Table-sale-list-container {
    max-height: 70vh;
    overflow-y: auto;
}

/* Optional: fix table width for horizontal scroll */
#Table-sale-list {
    table-layout: auto;
    /* auto or fixed depending on your preference */
}

#Table-sale-list th:nth-child(3) {
    position: sticky !important;
    left: 0;
    background-color: rgb(0, 0, 129);
    /* must have background */
    color: white;
    font-weight: bold;
    text-align: left;
    color: white;
    z-index: 999 !important;
}

#Table-sale-list td:nth-child(3) {
    position: sticky !important;
    left: 0;
    background-color: rgb(255, 255, 255);
    /* must have background */
    z-index: 9 !important;

}

/* ------------------------------------------------------------------------------ */

/* ------------------------------------------------------------------------------ */

/* Report Table Base */
#Table-expense-list {
    width: 100%;
    /* Table container min-height */
    border-collapse: collapse;
    font-size: 13px;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Table header */
#Table-expense-list thead th {
    position: sticky !important;
    top: 0;
    z-index: 10;
    background-color: rgb(0, 0, 129);
    /* header bg */
    color: white;
    font-weight: bold;
    text-align: left;
    padding: 8px 10px;
    /* consistent padding */
    white-space: nowrap;
}

/* Table body cells */
#Table-expense-list tbody td {
    padding: 8px 10px;
    /* consistent padding */
    border-bottom: 1px solid #ccc;
    vertical-align: middle;
    /* center content vertically */
    white-space: nowrap;
}

/* Table rows */
#Table-expense-list tbody tr {
    height: auto;
    /* allow growth for bigger content */
}

/* Right-align numeric columns */
#Table-expense-list tbody td.numeric {
    text-align: right;
}

/* Hover effect */
#Table-expense-list tbody tr:hover {
    background-color: #f9f9f9;
}

/* Optional: alternate row colors */
#Table-expense-list tbody tr:nth-child(even) {
    background-color: #fefefe;
}

/* Scrollable container (if needed) */
#Table-sale-list-container {
    max-height: 70vh;
    overflow-y: auto;
}

/* Optional: fix table width for horizontal scroll */
#Table-expense-list {
    table-layout: auto;
    /* auto or fixed depending on your preference */
}

#Table-expense-list th:nth-child(3) {
    position: sticky !important;
    left: 0;
    background-color: rgb(0, 0, 129);
    /* must have background */
    color: white;
    font-weight: bold;
    text-align: left;
    color: white;
    z-index: 999 !important;
}

#Table-expense-list td:nth-child(3) {
    position: sticky !important;
    left: 0;
    background-color: rgb(255, 255, 255);
    /* must have background */
    z-index: 9 !important;

}

/* ------------------------------------------------------------------------------ */



.hight_index {
    z-index: 10000;
}

.min_heigh_70 {
    min-width: 70%;
}

#shop_info {
    display: flex;
    flex-direction: column;
}

.img {
    width: 100px;
    height: 100px;

    overflow: hidden;
}

.img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img_400 {
    width: 200px;
    height: 200px;

    overflow: hidden;
}

.img_400 img {
    width: 100%;
    height: 100%;
    /* Product preview in the add/edit form — show the whole pack, uncropped, so
       what is previewed here is what the POS tile will show. */
    object-fit: contain;
    background: #f5f3ff;
}

#DatePromptModal button {
    padding: 3px;
    border-radius: 5px;
    font-size: 12px;
}

#chasier {
    font-size: 26px;
}

#refresh-icon {
    font-size: 25px;
}

.no-stock-float {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: bold;
    color: #ef4444;
    pointer-events: none;
    animation: floatUp 1s ease-out forwards;
    z-index: 9999;
}

/* PRODUCT CARD PREMIUM CLEAN */
.card_style {
    min-height: 150px !important;
    max-height: 270px !important;

    border-radius: 18px !important;
    overflow: hidden;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08) !important;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card_style:hover {
    transform: translateY(-3px);
    border-color: #c4b5fd !important;
    box-shadow: 0 12px 28px rgba(88, 28, 135, 0.16) !important;
    background: #ffffff !important;
}

.card_style button {
    height: 100%;
    background: transparent;
}

/* IMAGE */
.card_style img {
    width: 100%;
    height: 145px !important;
    min-height: 145px !important;
    max-height: 145px !important;
    /* contain, not cover: these are packshots, not scenery. cover filled the tile
       by cropping the top and bottom off every tin and bottle, which is exactly
       the part the cashier identifies the product by. Letterboxing against the
       tile colour keeps the whole pack visible whatever its aspect ratio. */
    object-fit: contain;
    padding: 6px;
    background: #f5f3ff;
    transition: transform .25s ease;
}

.card_style:hover img {
    transform: scale(1.04);
}

/* INFO ICON */
.info {
    top: 8px !important;
    right: 8px !important;
    font-size: 15px !important;
    background: rgba(255, 255, 255, .9);
    padding: 5px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}

/* PRODUCT NAME */
.product-name-card {
    text-align: left !important;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.35;
    color: #1e293b;
    min-height: 36px;

    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* STOCK + PRICE TEXT */
.product-text-card {
    font-size: 11.5px !important;
    font-weight: 600;
}

/* PRICE */
.pricing {
    font-size: 14px !important;
    font-weight: 800 !important;
    color: #4c1d95;
    white-space: nowrap;
}

/* OLD PRICE */
del.pricing {
    font-size: 11px !important;
    color: #94a3b8 !important;
    font-weight: 500 !important;
}

/* TEXT AREA */
.card_style .flex.flex-col.justify-between.p-2 {
    height: 118px !important;
    margin-top: 0 !important;
    padding: 10px !important;
}

/* CENTER AREA LESS UGLY */
.card_style p {
    margin: 0;
    text-align: left;
    line-height: 1.5;
}

.card_style .text-center {
    text-align: left !important;
}

/* DISCOUNT BADGE */
.card_style span.bg-red-500 {
    border-radius: 999px !important;
    font-size: 10px !important;
    padding: 3px 7px !important;
    font-weight: 800;
}

.info-wrap {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 5;
    /* lower it too — only needs to beat the image/badge */
}

.info-wrap .info {
    position: static !important;
    display: inline-flex;
    cursor: help;
    background: rgba(255, 255, 255, .95);
    border-radius: 999px;
    padding: 5px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
    transition: transform .15s ease;
}

.info-wrap:hover .info {
    transform: scale(1.15);
}

/* ── Popup: fixed = escapes every card, always on top ── */
.info-popup {
    position: fixed;
    /* key change */
    width: 250px;
    background: linear-gradient(160deg, #1e293b, #0f172a);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, .25);
    border-radius: 14px;
    font-size: 12px;
    line-height: 1.5;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(.97);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    z-index: 2147483647;
    /* max, and it actually works now */
    pointer-events: none;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
    overflow: hidden;
}

.info-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.info-popup .ip-header {
    background: rgba(59, 130, 246, .15);
    border-bottom: 1px solid rgba(148, 163, 184, .2);
    padding: 10px 12px;
    font-weight: 700;
    color: #fff;
    font-size: 13px;
}

.info-popup .ip-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 12px;
    border-bottom: 1px dashed rgba(148, 163, 184, .15);
}

.info-popup .ip-row:last-child {
    border-bottom: none;
}

.info-popup .ip-label {
    color: #94a3b8;
    white-space: nowrap;
}

.info-popup .ip-value {
    text-align: right;
    font-weight: 600;
    color: #f1f5f9;
    word-break: break-word;
}

.info-popup .ip-desc {
    padding: 8px 12px 10px;
    color: #cbd5e1;
    font-style: italic;
    background: rgba(0, 0, 0, .2);
}

.card_style:hover::before {
    opacity: 1;
}

.card_style:nth-child(1) {
    animation-delay: 0.05s;
}

.card_style:nth-child(2) {
    animation-delay: 0.1s;
}

.card_style:nth-child(3) {
    animation-delay: 0.15s;
}

.card_style:nth-child(4) {
    animation-delay: 0.2s;
}

.card_style:nth-child(5) {
    animation-delay: 0.25s;
}

.card_style:nth-child(6) {
    animation-delay: 0.3s;
}

.card_style:nth-child(7) {
    animation-delay: 0.35s;
}

.card_style:nth-child(8) {
    animation-delay: 0.4s;
}

.card_style:nth-child(9) {
    animation-delay: 0.45s;
}

.card_style:nth-child(10) {
    animation-delay: 0.5s;
}

.card_style:nth-child(11) {
    animation-delay: 0.55s;
}

.card_style:nth-child(12) {
    animation-delay: 0.6s;
}

.card_style:nth-child(13) {
    animation-delay: 0.65s;
}

.card_style:nth-child(14) {
    animation-delay: 0.7s;
}

.card_style:nth-child(15) {
    animation-delay: 0.75s;
}

.card_style:nth-child(16) {
    animation-delay: 0.8s;
}

.card_style:nth-child(17) {
    animation-delay: 0.85s;
}

.card_style:nth-child(18) {
    animation-delay: 0.9s;
}

.card_style:nth-child(19) {
    animation-delay: 0.95s;
}

.card_style:nth-child(20) {
    animation-delay: 1s;
}

.card_style:nth-child(21) {
    animation-delay: 1.05s;
}

.card_style:nth-child(22) {
    animation-delay: 1.1s;
}

.card_style:nth-child(23) {
    animation-delay: 1.15s;
}

.card_style:nth-child(24) {
    animation-delay: 1.2s;
}

.card_style:nth-child(25) {
    animation-delay: 1.25s;
}

.card_style:nth-child(26) {
    animation-delay: 1.3s;
}

.card_style:nth-child(27) {
    animation-delay: 1.35s;
}

.card_style:nth-child(28) {
    animation-delay: 1.4s;
}

.card_style:nth-child(29) {
    animation-delay: 1.45s;
}

.card_style:nth-child(30) {
    animation-delay: 1.5s;
}



/* Fade + slide down animation */
@keyframes fadeSlideDown {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-add {
    animation: fadeSlideDown 0.3s ease forwards;
}

/* Number count animation (optional) */
.number-change {
    transition: all 0.3s ease;
}

#total {
    transition: all 0.3s ease;
}

.ss-f {
    height: 38px;
    width: 100%;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #bae6fd;
    color: #0f172a;
    font-size: 13px;
    padding: 0 10px 0 12px;
    outline: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: .15s ease;
}

.ss-f::placeholder {
    color: #94a3b8;
}

.ss-f:focus {
    border-color: #38bdf8;
    background: #f8fdff;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, .20);
}

.ss-f option {
    background: #ffffff;
    color: #0f172a;
}

.ss-f[type=date] {
    color-scheme: light;
}

.ss-f[type=date]::-webkit-calendar-picker-indicator {
    filter: none;
    opacity: .65;
    cursor: pointer;
}

#default-modal-purchase-list span,
#default-modal-purchase-list i {
    color: #64748b;
}

#default-modal-purchase-list .fa-cart-flatbed {
    color: #0284c7;
}

#purchaseTableBody tr {
    background: #ffffff;
    border-bottom: 1px solid #e0f2fe;
}

#purchaseTableBody tr:hover {
    background: #f0f9ff;
}

#purchaseTableBody td {
    color: #334155;
}

/* ===== Category tabs: premium 3D pills ===== */
/* ===== Category tabs: subtle minimal ===== */

.tab-track {
    background: rgba(255, 255, 255, 0.25);
    /* faint frosted strip on the amber */
    border-radius: 10px;
    box-shadow: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, .2) transparent;
    scroll-behavior: smooth;
}

.tab-track::-webkit-scrollbar {
    height: 3px;
}

.tab-track::-webkit-scrollbar-track {
    background: transparent;
}

.tab-track::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, .15);
    border-radius: 9999px;
}

.tab-track:hover::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, .3);
}

.tab-pill {
    white-space: nowrap;
    padding: 0.45rem 1rem;
    border-radius: 7px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4b5563;
    background: transparent;
    /* no box until you interact */
    border: 1px solid transparent;
    box-shadow: none;
    transition: background 0.15s ease, color 0.15s ease;
    cursor: pointer;
}

.tab-pill:hover {
    background: rgba(255, 255, 255, 0.55);
    color: #111827;
    transform: none;
    /* no lifting/jumping */
}

.tab-pill.tab-active {
    color: #111827;
    background: #ffffff;
    /* clean white chip, no gradient */
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    /* whisper of depth */
    transform: none;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.6rem;
}

/* ===== Cart header controls ===== */
.hd-controls {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    flex-shrink: 0;
}

.hd-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 30px;
    min-width: 30px;
    padding: 0 8px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #6b7280;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.hd-item:hover {
    background: #fff;
    color: #111827;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}

.hd-item.dark-on {
    color: #d97706;
}

/* theme button state */

.hd-sep {
    width: 1px;
    height: 16px;
    background: #e5e7eb;
}

/* mini switch */
.cd-switch {
    position: relative;
    display: inline-flex;
}

.cd-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    padding: 0 !important;
}

.cd-track {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 16px;
    border-radius: 999px;
    background: #d1d5db;
    transition: background .2s ease;
}

.cd-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
    transition: left .2s ease;
}

.cd-switch input:checked+.cd-track {
    background: #22c55e;
}

.cd-switch input:checked+.cd-track .cd-knob {
    left: 18px;
}

@keyframes cardStyleIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translate(-50%, 0) scale(0.8);
    }

    20% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -60px) scale(1.2);
    }
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.25s ease-out forwards;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        opacity: 0;
        transform: scale(1);
    }
}

.rotate-180 {
    transform: rotate(180deg);
}

#welcomeScreen h1 {
    animation: fadeInOut 5s ease-in-out forwards;
}


.filter-input {
    height: 44px;
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(255, 255, 255, 0.96);
    padding: 0 0.85rem;
    font-size: 0.875rem;
    color: #0f172a;
    outline: none;
}

.filter-input:focus {
    border-color: #22d3ee;
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.25);
}

#expense_table_body tr:hover {
    background: #f8fafc;
}

.expense-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-paid {
    background: #dcfce7;
    color: #166534;
}

.badge-unpaid {
    background: #fee2e2;
    color: #991b1b;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge-cancelled {
    background: #e5e7eb;
    color: #374151;
}

#mobileCartToggle {
    display: none;
}

@keyframes scaleUp {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-scaleUp {
    animation: scaleUp 0.25s ease-out forwards;
}

@keyframes pop {
    0% {
        transform: translate(0, 0) scale(0.3);
        opacity: 0;
    }

    40% {
        opacity: 1;
    }

    100% {
        transform: translate(var(--x), var(--y)) scale(1.2);
        opacity: 0;
    }
}

/* Hide elements you don’t want in print */

@media print {
    .screen-only {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    .shop-info {
        display: block;
        text-align: right;
    }

    .shop-info div {
        line-height: 1.4;
    }

    .space {
        margin-bottom: 15px;
    }
}

@media screen {
    .print-only {
        display: none;
    }

    .space {
        margin-bottom: 15px;
    }
}

@media (max-width: 430px) {
    body {
        font-size: 12px;
    }

    h1 {
        font-size: 18px;
    }

    h2 {
        font-size: 15px;
    }

    /* ---------- Layout: stack products / cart ---------- */
    #container {
        flex-direction: column;
        height: auto;
        overflow: auto;
    }

    #mainContent {
        width: 100%;
        min-height: 52vh;
    }

    #tab-content {
        height: 52vh !important;
    }

    #resizer {
        display: none;
    }

    #sidebar {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
        position: sticky;
        bottom: 0;
        z-index: 30;
        border-top: 2px solid #e5e7eb;
    }

    #inner-sidebar {
        height: 44vh !important;
    }

    /* ---------- Top bar ---------- */
    #category_show {
        flex-direction: column;
        align-items: stretch;
        margin: 0 0.35rem;
    }

    #category_show>div:first-child {
        padding: 4px;
    }

    /* search group fills the width */
    #category_show .flex.items-stretch.h-10 {
        height: 38px;
        width: 100%;
    }

    #field-select {
        padding-left: 6px;
        padding-right: 18px;
        font-size: 11px;
        max-width: 90px;
    }

    #search-dropdown {
        width: 100% !important;
        min-width: 0;
        font-size: 12px;
    }

    #category-tabs {
        width: 100%;
        padding: 2px 4px;
    }

    .tab-pill {
        padding: 0.4rem 0.6rem;
        /* keep height for fingers */
        font-size: 0.68rem;
    }

    /* ---------- Product grid: 2 columns ---------- */
    #tab-content .min_heigh_70,
    #tab-content .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.4rem;
        padding: 0.4rem;
    }

    .card_style {
        min-height: 150px !important;
        max-height: 230px !important;
        border-radius: 12px !important;
    }

    .card_style img {
        max-height: 90px !important;
        min-height: 90px !important;
    }

    .card_style .add-to-cart-btn>div:last-child {
        height: 95px !important;
        padding: 5px;
        margin-top: 2px;
    }

    .product-name-card {
        font-size: 11px;
        min-height: 28px;
        -webkit-line-clamp: 2;
    }

    .product-text-card {
        font-size: 10px !important;
    }

    .pricing {
        font-size: 12px !important;
    }

    del.pricing {
        font-size: 9.5px !important;
    }

    .info {
        font-size: 14px !important;
        padding: 5px;
    }

    /* ---------- Bottom drawer ---------- */
    #drawer {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
        padding: 0.4rem;
        max-height: 60vh;
        overflow-y: auto;
    }

    #drawer-body {
        min-height: 48px;
        display: flex;
        align-items: center;
        padding: 6px 12px;
    }

    #drawer-swipe {
        bottom: 48px;
        /* peek = header height; Flowbite resets to 0 when open */
    }

    #drawer .p-4 {
        padding: 0.5rem;
    }

    #drawer i {
        font-size: 13px;
    }

    #drawer .font-medium {
        font-size: 9.5px;
    }

    #drawer .w-12.h-12 {
        width: 2rem;
        height: 2rem;
    }

    /* ---------- Modals: full screen ---------- */
    #default-modal-customer-list>div,
    #default-modal-product-list .flex>div,
    #default-modal-sale-list>div,
    #default-modal-warehouse>div,
    #default-modal-expense-list>div,
    #default-modal-ledger-entry-list>div,
    #default-modal-sales-order-list>div,
    #default-modal-sales-order-save>div {
        max-width: 100vw !important;
        width: 100vw !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    #default-modal-sale-list,
    #default-modal-expense-list,
    #default-modal-warehouse,
    #default-modal-ledger-entry-list {
        padding: 0 !important;
    }

    /* filter grids collapse to 2 cols */
    #default-modal-sale-list .grid,
    #default-modal-expense-list .grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.4rem;
    }

    /* hide misaligned filter icons (same fix as laptop) */
    #default-modal-sale-list .fa-user.absolute,
    #default-modal-sale-list .fa-box.absolute {
        display: none;
    }

    #customer_search,
    #product_search,
    #document_search_invoice {
        padding-left: 12px !important;
    }

    /* report tables */
    #Table-sale-list,
    #Table-sale-order,
    #Table-item-ledger-entry,
    #Table-Purchase-list,
    #Table-expense-list,
    #product_table,
    #wh-product,
    #user-table,
    #customer-list,
    #vendor-list {
        font-size: 10.5px;
    }

    #Table-sale-list thead th,
    #Table-sale-order thead th,
    #Table-item-ledger-entry thead th,
    #product_table thead th,
    #wh-product thead th {
        padding: 4px;
    }

    #Table-sale-list tbody td,
    #Table-sale-order tbody td,
    #Table-item-ledger-entry tbody td,
    #product_table tbody td,
    #wh-product tbody td {
        padding: 3px 4px;
    }

    /* ---------- Layout: full-screen products, cart as overlay ---------- */
    #container {
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
    }

    #mainContent {
        width: 100%;
        flex: 1 1 auto;
    }

    #tab-content {
        height: calc(100vh - 110px) !important;
        /* minus top bar + drawer peek */
        padding-bottom: 80px;
        /* room behind floating button */
    }

    #resizer {
        display: none;
    }

    /* cart hidden below screen, slides up when open */
    #sidebar {
        position: fixed !important;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
        height: 88vh;
        z-index: 45;
        /* above drawer(40), below modals(50) */
        transform: translateY(100%);
        transition: transform 0.28s ease;
        border-top-left-radius: 18px;
        border-top-right-radius: 18px;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
        overflow: hidden;
    }

    #sidebar.mobile-open {
        transform: translateY(0);
    }

    #inner-sidebar {
        height: 88vh !important;
    }

    /* ---------- Floating cart button ---------- */
    #mobileCartToggle {
        display: flex;
        position: fixed;
        right: 14px;
        bottom: 64px;
        /* clear of drawer peek */
        z-index: 46;
        /* above the cart panel */
        width: 56px;
        height: 56px;
        border-radius: 999px;
        border: none;
        background: #2563eb;
        color: #fff;
        font-size: 22px;
        align-items: center;
        justify-content: center;
        box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
        cursor: pointer;
    }

    #mobileCartToggle.cart-open {
        background: #ef4444;
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
    }

    #mobileCartBadge {
        display: none;
        position: absolute;
        top: -4px;
        right: -4px;
        min-width: 22px;
        height: 22px;
        padding: 0 5px;
        border-radius: 999px;
        background: #f59e0b;
        color: #fff;
        font-size: 12px;
        font-weight: 800;
        align-items: center;
        justify-content: center;
        border: 2px solid #fff;
    }

    @keyframes cartPulse {
        0% {
            transform: scale(1);
        }

        40% {
            transform: scale(1.18);
        }

        100% {
            transform: scale(1);
        }
    }

    #mobileCartToggle.pulse {
        animation: cartPulse 0.35s ease;
    }
}

/* ==========================================================
   TABLET RESPONSIVE — 431px – 999px
   Targets: iPad portrait (768px), small tablets, big phones
   Keeps products + cart side-by-side (POS style) but shrinks
   the cart so the product grid stays usable.
   ========================================================== */
/* ==========================================
                   TABLET 431–999px : compact cart
                   ========================================== */
@media (min-width: 431px) and (max-width: 999px) {
    #resizer {
        display: none;
    }

    /* cart hidden below screen, slides up when open */
    #sidebar {
        position: fixed !important;
        left: 0;
        right: 0;
        bottom: 0;
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
        height: 88vh;
        z-index: 45;
        transform: translateY(100%);
        transition: transform 0.28s ease;
        border-top-left-radius: 18px;
        border-top-right-radius: 18px;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
        overflow: hidden;
        background: #fff;
    }

    #sidebar.mobile-open {
        transform: translateY(0);
    }

    #inner-sidebar {
        height: 88vh !important;
    }

    /* products get the full width */
    #mainContent {
        width: 100%;
        flex: 1 1 auto;
    }

    /* floating cart button */
    #mobileCartToggle {
        display: flex;
        position: fixed;
        right: 16px;
        bottom: 70px;
        z-index: 46;
        width: 58px;
        height: 58px;
        border-radius: 999px;
        border: none;
        background: #2563eb;
        color: #fff;
        font-size: 23px;
        align-items: center;
        justify-content: center;
        box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
        cursor: pointer;
    }

    #mobileCartToggle.cart-open {
        background: #ef4444;
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
    }

    #mobileCartBadge {
        display: none;
        position: absolute;
        top: -4px;
        right: -4px;
        min-width: 22px;
        height: 22px;
        padding: 0 5px;
        border-radius: 999px;
        background: #f59e0b;
        color: #fff;
        font-size: 12px;
        font-weight: 800;
        align-items: center;
        justify-content: center;
        border: 2px solid #fff;
    }

    @keyframes cartPulse {
        0% {
            transform: scale(1);
        }

        40% {
            transform: scale(1.18);
        }

        100% {
            transform: scale(1);
        }
    }

    #mobileCartToggle.pulse {
        animation: cartPulse 0.35s ease;
    }

    .ci-header {
        padding: 9px 11px;
        gap: 8px;
    }

    .ci-name {
        font-size: 12.5px;
    }

    .ci-order-no {
        font-size: 11px;
    }

    .ci-qty {
        font-size: 11px;
    }

    .ci-price-line {
        font-size: 11px;
    }

    .ci-total-amount {
        font-size: 13.5px;
    }

    .ci-total-currency {
        font-size: 11px;
    }

    .ci-panel-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 10px;
        gap: 8px;
    }

    .ci-input {
        padding: 8px;
        /* keep touch-friendly */
        font-size: 13px;
    }

    .ci-lot-btn {
        min-width: 40px;
        /* finger target */
        padding: 9px 12px;
    }
}

/* ==========================================
                   MOBILE ≤430px : cart usable with thumbs
                   ========================================== */
@media (max-width: 430px) {

    .ci-header {
        padding: 8px 10px;
        gap: 8px;
    }

    .ci-name {
        font-size: 12.5px;
    }

    .ci-order-no {
        font-size: 11px;
    }

    .ci-price-line {
        font-size: 11px;
    }

    .ci-total-amount {
        font-size: 13.5px;
    }

    .ci-total-currency {
        font-size: 11px;
    }

    .ci-panel.ci-open {
        max-height: 560px;
    }

    /* editor stacks: 1 field per row, big inputs */
    .ci-panel-inner {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 8px;
    }

    .ci-input {
        padding: 10px;
        font-size: 16px;
        /* 16px stops iOS auto-zoom on focus */
    }

    .ci-lot-btn {
        min-width: 44px;
        padding: 10px 14px;
        font-size: 14px;
    }

    .ci-empty {
        padding: 24px 12px;
        font-size: 13px;
    }

    .ci-empty+* img,
    .ci-empty img {
        width: 90px;
        height: 90px;
    }

    /* totals area */
    #total {
        padding: 8px;
        gap: 6px;
    }

    #total p {
        font-size: 12px;
    }

    #total p.font-semibold {
        font-size: 13.5px;
    }

    /* currency + customer stacked */
    #total .w-full.flex.items-end.justify-between.gap-2 {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    #total .relative.w-full.min-w-\[180px\] {
        min-width: 0;
    }

    #total #list_main {
        width: 100% !important;
        min-width: 0;
    }

    #total select,
    #total #customerSearch {
        height: 40px;
        /* touch target */
        font-size: 16px;
        /* no iOS zoom */
        width: 100%;
    }

    #total .fa-dollar-sign,
    #total #list_main .fa-user-tie {
        display: none;
    }

    #total select {
        padding-left: 10px !important;
    }

    #total #list_main input#customerSearch {
        padding-left: 10px !important;
    }

    /* action buttons: 2 per row, tall enough to tap */
    #total .mt-5.grid.grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    #total .mt-5 button {
        padding: 10px 8px !important;
        font-size: 13px;
    }

    /* header controls */
    #header_invoice h2 {
        font-size: 17px;
    }

    .hd-item {
        height: 32px;
        min-width: 32px;
    }
}

/* ==========================================================
   SMALL TABLETS / LARGE PHONES: 431px – 640px
   Stack the cart under the products — side-by-side is too tight
   ========================================================== */
@media (min-width: 431px) and (max-width: 640px) {

    #container {
        flex-direction: column;
        height: auto;
        overflow: auto;
    }

    #mainContent {
        width: 100%;
        min-height: 55vh;
    }

    #tab-content {
        height: 55vh !important;
    }


    #inner-sidebar {
        height: 42vh !important;
    }
}


/* ==========================================================
   LAPTOP RESPONSIVE — replace your old
   @media (min-width: 1000px) and (max-width: 1400px) { ... }
   block with everything below.
   Targets: 1366×768, 1280×800, 1440×900 laptops
   ========================================================== */

@media (min-width: 1000px) and (max-width: 1400px) {

    /* ---------- 1. Typography (12px minimum — 10px was too small) ---------- */
    body {
        font-size: 13px;
    }

    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 18px;
    }

    h3 {
        font-size: 16px;
    }

    h5 {
        font-size: 12px;
    }

    p,
    span,
    label {
        font-size: 12px;
    }

    #tittle_span {
        font-size: 18px;
    }

    input,
    select,
    textarea,
    button {
        font-size: 12px;
        padding: 4px 8px;
    }

    /* ---------- 2. Layout: narrower cart → more room for products ---------- */
    #sidebar {
        flex: 0 0 320px;
        min-width: 250px;
    }

    /* 768px-tall screens overflow at 90vh, use 88vh + smaller sticky areas */
    #inner-sidebar,
    #tab-content {
        height: 88vh !important;
    }

    .scroll_content_70 {
        max-height: 74vh;
        min-height: 74vh;
    }

    /* ---------- 3. Top bar: compact search + category tabs ---------- */
    #category_show>div:first-child {
        padding: 6px 8px;
        /* was px-4 py-3 */
    }

    #search-dropdown {
        width: 11rem;
        /* was w-56 / w-64 */
    }

    #field-select {
        padding-left: 8px;
        padding-right: 22px;
    }

    #category-tabs {
        padding: 2px 6px;
    }

    .tab-pill {
        padding: 0.3rem 0.7rem;
        font-size: 0.72rem;
    }

    /* ---------- 4. Product grid: auto-fit cards, smaller images ---------- */
    /* Overrides Tailwind lg:grid-cols-6 → cards never get squeezed */
    /* ---------- 4. Product grid: auto-fit cards, smaller images ---------- */

    .card_style {
        min-height: 190px !important;
        max-height: 280px !important;
        padding: 8px;
        border-radius: 14px;
        opacity: 0;
        animation: cardStyleIn .4s ease forwards;
    }

    .card_style img {
        max-height: 125px !important;
        min-height: 125px !important;
        border-radius: 10px;
    }

    .card_style .add-to-cart-btn>div:last-child {
        height: 110px !important;
        padding: 5px;
        margin-top: 4px;
    }

    .card_style h5 {
        font-size: 11px;
        line-height: 1.3;
    }

    .product-text-card {
        font-size: 11px;
    }

    .product-name-card {
        font-size: 12px;
        min-height: 32px;
    }

    .pricing {
        font-size: 13px !important;
    }

    /* ---------- 5. Cart / invoice side ---------- */
    #sidebar input {
        padding: 2px 6px !important;
    }

    #add-to-cart-btn {
        padding: 0;
    }

    .btn_sale_invoice {
        padding: 2px !important;
    }

    .btn_sale_invoice button {
        padding: 2px 4px !important;
    }

    .bonus {
        padding: 2px !important;
    }

    #chasier {
        font-size: 20px;
    }

    #refresh-icon {
        font-size: 16px;
    }

    .hd-item {
        height: 26px;
        min-width: 26px;
        font-size: 11px;
    }

    /* ---------- 6. Report tables & modals ---------- */
    .respond_laptop {
        padding: 5px;
    }

    #Table-sale-list,
    #Table-sale-order,
    #Table-item-ledger-entry,
    #Table-Purchase-list,
    #Table-expense-list,
    #product_table,
    #wh-product,
    #user-table,
    #customer-list {
        font-size: 12px;
    }

    #Table-sale-list thead th,
    #Table-sale-order thead th,
    #Table-item-ledger-entry thead th,
    #product_table thead th,
    #wh-product thead th {
        padding: 5px 6px;
    }

    #Table-sale-list tbody td,
    #Table-sale-order tbody td,
    #Table-item-ledger-entry tbody td,
    #product_table tbody td,
    #wh-product tbody td {
        padding: 4px 6px;
    }

    #drawer i {
        font-size: 15px;
        padding: 0;
    }

    #drawer-body {
        padding: 8px;
    }

    /* ---------- Cart items: compact ---------- */
    .ci-header {
        padding: 7px 10px;
        gap: 8px;
    }

    .ci-name {
        font-size: 12px;
    }

    .ci-order-no {
        font-size: 10.5px;
    }

    .ci-qty {
        font-size: 11px;
    }

    .ci-price-line {
        font-size: 11px;
        margin-top: 3px;
    }

    .ci-badge {
        font-size: 9.5px;
        padding: 1px 6px;
        margin-top: 3px;
    }

    .ci-total-amount {
        font-size: 13px;
    }

    .ci-total-currency {
        font-size: 10.5px;
    }

    .ci-total del {
        font-size: 10px;
    }

    .ci-chevron {
        font-size: 13px;
    }

    .ci-remove {
        font-size: 13px;
    }

    .ci-controls {
        gap: 5px;
    }

    /* editor panel */
    .ci-panel-inner {
        padding: 8px 10px 10px;
        gap: 7px;
    }

    .ci-label {
        font-size: 10.5px;
        margin-bottom: 2px;
    }

    .ci-input {
        padding: 5px 7px;
        font-size: 12px;
        border-radius: 6px;
    }

    .ci-lot-row {
        padding: 5px 8px;
    }

    .ci-lot-label {
        font-size: 11px;
    }

    .ci-lot-btn {
        min-width: 28px;
        padding: 4px 8px;
        font-size: 11.5px;
    }

    /* totals + action buttons */
    #total {
        padding: 6px;
        gap: 4px;
    }

    #total p {
        font-size: 11.5px;
    }

    #total p.font-semibold {
        font-size: 12.5px;
    }

    #total select,
    #total #customerSearch {
        padding-top: 5px !important;
        padding-bottom: 5px !important;
        height: 34px;
        font-size: 12px;
    }

    #total .mt-5 {
        margin-top: 8px;
    }

    #total .mt-5 button {
        padding: 5px 6px !important;
        font-size: 11.5px;
        border-radius: 8px;
    }

    /* empty cart state */
    .ci-empty {
        padding: 30px 14px;
        font-size: 13px;
    }

    /* ---------- Top bar ---------- */
    #category_show {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }

    #category_show>div:first-child {
        padding: 4px 6px;
    }

    /* search group: shorter + narrower */
    #category_show .flex.items-stretch.h-10 {
        height: 34px;
    }

    #field-select {
        padding-left: 8px;
        padding-right: 22px;
        font-size: 12px;
    }

    #search-dropdown {
        width: 10rem;
        font-size: 12px;
    }

    /* category tabs */
    #category-tabs {
        padding: 2px 6px;
    }

    .tab-pill {
        padding: 0.3rem 0.7rem;
        font-size: 0.72rem;
    }

    /* ---------- Product grid ---------- */
    #tab-content .min_heigh_70,
    #tab-content .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
        gap: 0.6rem;
        padding: 0.5rem;
    }

    .card_style {
        min-height: 220px !important;
        max-height: 300px !important;
        padding: 8px;
        border-radius: 14px;
    }

    .card_style img {
        max-height: 150px !important;
        min-height: 150px !important;
        border-radius: 10px;
    }

    .card_style .add-to-cart-btn>div:last-child {
        height: 115px !important;
        padding: 6px;
        margin-top: 4px;
    }

    .product-name-card {
        font-size: 12.5px;
        min-height: 34px;
    }

    .pricing {
        font-size: 14px !important;
    }


    .product-text-card {
        font-size: 11px !important;
    }

    .pricing {
        font-size: 13px !important;
    }

    del.pricing {
        font-size: 10.5px !important;
    }

    .info {
        font-size: 14px !important;
        padding: 4px;
    }

    /* ---------- Sidebar / resizer ---------- */
    #sidebar {
        min-width: 250px;
    }

    /* ---------- Drawer menu ---------- */
    #drawer {
        gap: 0.5rem;
        padding: 0.5rem;
    }

    #drawer i {
        font-size: 15px;
    }

    #drawer .font-medium {
        font-size: 11px;
    }

    #drawer .w-12.h-12 {
        width: 2.25rem;
        height: 2.25rem;
    }

    /* ---------- Modals on this page ---------- */
    #default-modal-sale-list .grid,
    #default-modal-expense-list .grid {
        gap: 0.5rem;
    }

    #default-modal-sale-list input,
    #default-modal-sale-list select,
    #default-modal-expense-list input,
    #default-modal-expense-list select {
        padding-top: 6px;
        padding-bottom: 6px;
        font-size: 12px;
    }

    #Table-sale-order thead th,
    #Table-sale-order tbody td {
        padding: 4px 6px;
        font-size: 11.5px;
    }

    /* sale-list modal: hide misaligned filter icons */
    #default-modal-sale-list .fa-user.absolute,
    #default-modal-sale-list .fa-box.absolute {
        display: none;
    }

    #customer_search,
    #product_search,
    #document_search_invoice {
        padding-left: 12px !important;
    }


    /* bottom drawer: header = 60px peek, no open-state gap */
    #drawer-body {
        min-height: 60px;
        display: flex;
        align-items: center;
        padding: 8px 16px;
    }
    .fa-warehouse{
        display: none;
    }
    #fa-user-tie2{
        display: none;
    }
    .fa-magnifying-glass{
        display: none;
    }
}

/* ==========================================================
   SMALL LAPTOPS ONLY: 1000px – 1199px  (e.g. 1024×768)
   Extra squeeze on top of the block above
   ========================================================== */
@media (min-width: 1000px) and (max-width: 1199px) {

    /* 280px was too narrow to work in: the totals, the currency, the customer
       box, the seller and the warehouse pickers all stack into one column and
       the amounts end up shoulder to shoulder with their labels.

       360px is close to the most that can be given back without costing a
       product column. The grid is auto-fill minmax(150px, 1fr): at 1024 wide a
       280px cart leaves ~738px and a 360px cart leaves ~658px, and four
       columns need ~624px — so both show four. Past about 380 it drops to
       three, which is a worse trade than a narrow cart. */
    #sidebar {
        /* Left at the original 280px: this rule is NOT scoped to the till, and
           Purchasing is built from the same skeleton and reads it too — widening
           here took 80px out of its table. The till gets its 450px from the
           body.pos-till block at the end of this file instead. */
        flex: 0 0 280px;
    }

    #tab-content .min_heigh_70 {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    }

    .card_style img {
        max-height: 105px !important;
        min-height: 105px !important;
    }

    .card_style .add-to-cart-btn>div:last-child {
        height: 100px !important;
    }

    #search-dropdown {
        width: 9rem;
    }

    #tab-content .min_heigh_70,
    #tab-content .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    }

    .card_style img {
        max-height: 105px !important;
        min-height: 105px !important;
    }

    .card_style .add-to-cart-btn>div:last-child {
        height: 100px !important;
    }

    #search-dropdown {
        width: 8rem;
    }

    /* sale-list modal: hide misaligned filter icons */
    #default-modal-sale-list .fa-user.absolute,
    #default-modal-sale-list .fa-box.absolute {
        display: none;
    }

    #customer_search,
    #product_search,
    #document_search_invoice {
        padding-left: 12px !important;
    }
}

/* ---------- Toast entry animation ----------
   showToast() adds `animate-[toastIn_.25s_ease-out]`, but the keyframes it names
   were never defined anywhere, so the class resolved to an animation with no
   steps and the toast simply snapped into place. Defined here (rather than in
   the Tailwind source) because style.css is loaded by every layout — the POS,
   purchasing and login screens all share this toast. */
@keyframes toastIn {
    /* Rises INTO place now that the toast lives at the bottom of the screen —
       dropping down from above reads as falling off when the anchor is bottom-left. */
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================================
   PREMIUM BUTTON SYSTEM (app-wide)
   -----------------------------------------------------------
   Unifies every <button> across the app to ONE consistent shape
   — a slightly-rounded flat square, replacing the previous mix
   of full pills / 2xl / xl / lg corners scattered across pages —
   plus a subtle "lift" shadow on hover/press for a premium feel.
   Colors/backgrounds are untouched; only geometry + elevation.
   ============================================================ */
button {
    border-radius: 8px !important;
}

button:not(:disabled) {
    transition: box-shadow 0.15s ease, transform 0.1s ease;
}

button:not(:disabled):hover {
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
    transform: translateY(-1px);
}

button:not(:disabled):active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

button:disabled {
    cursor: not-allowed;
}

/* ============================================================
   PREMIUM INPUT SYSTEM (app-wide)
   -----------------------------------------------------------
   Unifies every text/date/number/search input, select, and
   textarea across the app to ONE consistent shape — a slightly
   rounded flat square (4px), replacing the previous mix of
   lg/xl/2xl rounded corners scattered across filter bars, forms,
   and the cart. Matches the button system's "slightly rounded
   flat premium" language, just less rounded than buttons (8px)
   so inputs read as flatter/quieter than actionable controls.
   Colors/borders/padding are untouched; only corner radius.
   ============================================================ */
input[type="text"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="tel"],
select,
textarea {
    border-radius: 4px !important;
}

/* ---------- Pagination / small table action buttons: one shared component for
   prev / page-number / next controls and the compact row-action icon buttons
   used by the management tables ---------- */
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

.page-btn:hover:not(:disabled):not(.page-btn-active) {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.page-btn-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.page-btn-active:hover {
    background: #1d4ed8 !important;
}

/* ---------- Manage Users list: row hover + selected row ----------
   Written by hand rather than as Tailwind utilities because classes used ONLY in
   public/assets/js/admin.js are not picked up by the Tailwind scan (verified:
   hover:bg-slate-100 and hover:border-amber-500 never reach the bundle), so a
   utility here would silently do nothing. The selected rule is repeated with
   :hover so it beats the hover rule on specificity instead of losing to it. */
#user-table-body tr {
    transition: background-color .15s ease;
}

#user-table-body tr:hover {
    background-color: #f1f5f9;          /* slate-100 */
}

#user-table-body tr.is-selected,
#user-table-body tr.is-selected:hover {
    background-color: #e0f2fe;          /* sky-100 */
    font-weight: 600;
}


/* ── Bottom menu on a short screen ──────────────────────────────────────────
   The menu is a fixed overlay sitting on top of the till. At full size its
   tiles need roughly 190px, which on a 1024x768 machine is close to a third of
   the visible window — the product grid behind it ends up showing barely two
   rows.

   These rules scale the tiles with the viewport HEIGHT, which is the dimension
   that actually hurts here; width is already handled by the grid's own
   breakpoints. The drawer's positioning and Flowbite's show/hide transforms are
   deliberately left alone — only padding and icon sizes move.

   Selectors are id-scoped so they beat the utility classes on specificity,
   which keeps this working regardless of stylesheet order and needs no
   !important. */

/* never let the menu take more than half the screen, whatever is in it */
#drawer-swipe {
    max-height: 55vh;
}

@media (max-height: 850px) {
    #drawer-swipe #drawer-body {
        padding-top: 0.45rem;
        padding-bottom: 0.45rem;
    }

    #drawer-swipe #drawer-swipe-label {
        font-size: 0.8125rem;
    }

    #drawer-swipe #drawer {
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }

    #drawer-swipe #drawer .rounded-base {
        padding: 0.5rem 0.35rem;
    }

    #drawer-swipe #drawer .rounded-full {
        width: 2rem;
        height: 2rem;
        padding: 0;
        margin-bottom: 0.3rem;
    }

    #drawer-swipe #drawer .rounded-full i {
        font-size: 0.8125rem;
    }

    #drawer-swipe #drawer .text-body {
        font-size: 0.72rem;
        line-height: 1rem;
    }
}

/* 1024x768 and smaller: the browser leaves ~640px, so go tighter again */
@media (max-height: 700px) {
    #drawer-swipe #drawer-body {
        padding-top: 0.3rem;
        padding-bottom: 0.3rem;
    }

    #drawer-swipe #drawer {
        gap: 0.4rem;
        padding: 0.4rem 0.6rem;
    }

    #drawer-swipe #drawer .rounded-full {
        width: 1.7rem;
        height: 1.7rem;
        margin-bottom: 0.2rem;
    }

    #drawer-swipe #drawer .rounded-full i {
        font-size: 0.72rem;
    }

    #drawer-swipe #drawer .text-body {
        font-size: 0.66rem;
        line-height: 0.9rem;
    }
}

/* Tailwind never emitted .bottom-full — its scanner had not seen the class until
   the customer dropdown started using it. Verified absent from
   public/build/assets/app-*.css by testing the backslash-escaped selector, which
   is how CSS writes class names containing a dot; a plain substring test lies.
   The build cannot be regenerated on this server, so it is written out here. */
.bottom-full { bottom: 100%; }

/* The delete button, armed and waiting for a second tap.
   Green, matching the tick it now shows: the pair reads as "confirm", where red
   would read as "this already happened" — and nothing has yet. Slightly larger so
   the change is felt as well as seen on a touch screen, where a finger is covering
   most of the button. */
.ci-remove-armed {
    background: #16a34a !important;
    color: #fff !important;
    border-color: #15803d !important;
    transform: scale(1.12);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .30);
    transition: transform .12s ease-out, box-shadow .12s ease-out;
}

/* A cart line on its way out.

   Two animations, one gesture: the CARD slides right and flushes from white through
   pink to red, while the WRAPPER collapses behind it so the rows below close the gap
   instead of leaving a hole. The collapse is held off until the swipe is mostly done —
   collapsing first yanks the card out from under the movement and it reads as a flicker.

   min-height: 0 is load-bearing, not tidiness. #cartBody is a column flex container,
   so every row is a flex item with min-height: auto — which resolves to the content's
   height and, in the cascade, BEATS max-height. Without it the collapse animated a
   max-height that was never applied: the card faded and swiped, and a full-height hole
   stayed behind it. On a short cart that reads as a small glitch; on a full one it
   looks broken, which is exactly how it was reported.

   The row is only hidden, never removed here. The server has not been told yet and
   cartLineVanish() may need to put it back, so nothing is torn out of the DOM until
   Livewire's morph does it for real.

   Animation properties beat ordinary declarations, so these win over .ci-card's own
   background and transform, and over .animate-add on the wrapper, without !important. */
.ci-vanishing {
    min-height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    animation: ci-line-collapse .32s cubic-bezier(.4, 0, .2, 1) forwards;
}

.ci-vanishing .ci-card {
    animation: ci-line-swipe .32s cubic-bezier(.4, 0, .2, 1) forwards;
}

@keyframes ci-line-swipe {
    0% {
        transform: translateX(0);
        background: #fff;
        border-color: #fca5a5;
    }
    40% {
        transform: translateX(8%);
        background: #fee2e2;
        border-color: #f87171;
    }
    100% {
        transform: translateX(110%);
        background: #dc2626;
        border-color: #dc2626;
        color: #fff;
        opacity: .2;
    }
}

@keyframes ci-line-collapse {
    /* hold full height while the card is still travelling */
    0%, 55% {
        max-height: 30rem;
        min-height: 0;
        opacity: 1;
    }
    100% {
        max-height: 0;
        min-height: 0;
        opacity: 0;
        /* The flex gap survives a zero-height item, leaving a thin band where the row
           was. One negative margin the size of #cartBody's gap closes it. */
        margin-top: -0.25rem;
        margin-bottom: 0;
        padding: 0;
    }
}

/* No sliding for anyone who has asked the system for less movement — it still has
   to disappear, and it still goes red, it just does it without the travel. */
@media (prefers-reduced-motion: reduce) {
    .ci-vanishing,
    .ci-vanishing .ci-card {
        animation: none;
    }
    .ci-vanishing {
        max-height: 0;
        min-height: 0;
        opacity: 0;
        margin: 0;
        padding: 0;
    }
    .ci-vanishing .ci-card {
        background: #dc2626;
    }
}

/* The pointer says the page is working.
   Set on <body> and inherited by everything, because the wait happens after the click
   and the pointer has usually moved off the button by then. !important beats the
   cursor each control sets for itself. */
body.export-busy,
body.export-busy * {
    cursor: progress !important;
}


/* ============================================================
   Customer suggestions — placed against the viewport, not the filter bar

   The filter bar is overflow-x-auto so the controls can scroll sideways. CSS
   will not clip one axis only: a computed overflow-x of auto forces overflow-y
   to auto too, which trapped this list inside a strip one filter-row tall and
   made the cashier scroll the bar to read it.

   position: fixed takes it out of that box. The coordinates come from the
   input's bounding rect and are refreshed by placeCustomerList() in script.js —
   a fixed element follows nothing on its own.
   ============================================================ */
#customer_list.cust-pop {
    position: fixed !important;
    /* Above the sale-list modal, whose own layers sit in the hundreds. */
    z-index: 10000;
    /* mt-1 and w-full were measured against the wrapper; the rect covers both now. */
    margin-top: 0;
    width: auto;
    overflow-y: auto;
    /* Reaching the end of the list must not start scrolling the report behind it. */
    overscroll-behavior: contain;
}

/* ============================================================
   Sale-order detail — the line table

   Twelve columns of money in a modal. Left to wrap, the cells broke mid-figure: "27.20 $"
   put its dollar sign on a second line, item codes split after the hyphen, and the
   headers went to two rows. Nothing wraps now except the item name, which is the only
   column that needs the room; the wrapper's overflow-x-auto scrolls instead.
   ============================================================ */
.so-lines-table th,
.so-lines-table td {
    white-space: nowrap;
}

/* Item Name — the third column, and the only one long enough to deserve wrapping. */
.so-lines-table th:nth-child(3),
.so-lines-table td:nth-child(3) {
    white-space: normal;
    min-width: 16rem;
}

/* A number is read against the ones above it, so the digits line up. */
.so-lines-table td.text-right,
.so-lines-table th.text-right {
    font-variant-numeric: tabular-nums;
}



/* ==========================================================
   THE TILL, AND ONLY THE TILL
   ==========================================================
   Everything below is scoped to body.pos-till.

   Purchasing is built from the SAME layout skeleton as the Sale screen — its own
   #container, #mainContent, #resizer, #sidebar and #inner-sidebar, with the same
   ids — and it loads this same stylesheet. So an unscoped `#sidebar` rule written
   for the till lands on Purchasing too. Forcing 450px there took 130px out of a
   page whose main panel is a wide table, and the stock column went off the edge.

   master.blade.php is used by pos.blade.php and by nothing else, so the class on
   its <body> means exactly "the till". Purchasing extends master_purchasing and
   never gets it.
   ========================================================== */

/* ---- 1024x768: reclaim the height the layout was throwing away ---------- */
@media (max-height: 850px) {

    /* Pinned to `height: 90vh !important` in two places. On a 1280x1024 desk
       monitor the 10% left over is invisible; on a 768px till it is 77px, and the
       cart is the panel that did not fit.

       It stops ABOVE the yellow Menu strip, which is position:fixed across the
       bottom of the viewport: at full height the drawer was drawn over the cart's
       last 36px, which is where the Order button sits. 36px of strip + 8px clear. */
    body.pos-till #inner-sidebar {
        height: calc(100vh - 44px) !important;
    }

    /* The empty-cart illustration is sized for a tall screen. py-16 around a
       160px image is ~330px of a 768px screen, spent on the state the cashier
       looks at between every sale. */
    body.pos-till #cartEmpty img {
        width: 96px;
        height: 96px;
    }

    body.pos-till #cartEmpty h3 {
        margin-top: 0.75rem;
        font-size: 1rem;
    }

    body.pos-till #cartEmpty {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    /* ---- the yellow Menu strip ----
       60px tall because Flowbite is told data-drawer-edge-offset="bottom-[60px]",
       which it applies as a class on #drawer-swipe. The short-screen rules further
       up tighten the padding INSIDE it, which is why they never made it shorter —
       the height is the offset, not the content. On a 653px viewport a permanent
       60px strip is 9% of the screen given to a label. */
    body.pos-till #drawer-swipe {
        bottom: 36px !important;
    }

    body.pos-till #drawer-swipe #drawer-body {
        padding-top: 0.2rem !important;
        padding-bottom: 0.2rem !important;
    }

    body.pos-till #drawer-swipe #drawer-swipe-label {
        font-size: 0.8rem;
    }

    body.pos-till #drawer-swipe #drawer-body svg {
        width: 1rem;
        height: 1rem;
    }

    body.pos-till #drawer-swipe #drawer-body > span {
        top: 0.3rem;
    }
}

/* ---- Selling width ------------------------------------------------------
   The cart was 280px, then 320px, on the very screens it had to be worked in.
   The limit was never the cart: the grid is auto-fill minmax(150px, 1fr), so
   four columns reserve ~624px whether the tiles need it or not, and every pixel
   the cart took came out of that reserve until the grid collapsed to three.

   A 128px tile minimum drops the reserve to ~536px, which pays for a 450px cart
   AND still shows four columns at 1024. Shorter tiles also mean more rows on a
   768px screen. Dragging the resizer overrides this — that writes width and
   flex-basis inline.
   ------------------------------------------------------------------------- */
@media (min-width: 1000px) and (max-width: 1400px) {
    body.pos-till #sidebar {
        flex: 0 0 450px;
    }

    body.pos-till #tab-content .min_heigh_70,
    body.pos-till #tab-content .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)) !important;
    }

    body.pos-till .card_style img {
        max-height: 88px !important;
        min-height: 88px !important;
    }

    body.pos-till .card_style .add-to-cart-btn > div:last-child {
        height: 84px !important;
    }
}

/* ---- Drag the cart wider ------------------------------------------------
   #resizer has been in the markup since the beginning with cursor-col-resize and
   a drawn grab handle, and never had a line of JS behind it — it advertised a
   drag that did not exist. It drags now, and the width is remembered per till.
   ------------------------------------------------------------------------- */
body.pos-till #resizer:hover,
body.pos-till #resizer.is-dragging {
    background: #60a5fa;
}

body.cart-resizing {
    cursor: col-resize;
    user-select: none;
}

body.cart-resizing iframe {
    pointer-events: none;
}

/* ---- Full screen --------------------------------------------------------
   Promotes the REAL cart panel rather than drawing a copy: same DOM, same
   Livewire component, so the steppers, the price and discount inputs, the lot
   picker and remove all keep working, and there is no second copy that can
   disagree with the first about what is being charged.
   ------------------------------------------------------------------------- */
body.pos-till.cart-max #sidebar {
    position: fixed !important;
    inset: 0 !important;
    z-index: 60;
    width: 100% !important;
    max-width: 100% !important;
    flex-basis: auto !important;
    background: #fff;
}

body.pos-till.cart-max #inner-sidebar {
    height: 100vh !important;
    position: static !important;
    border-left: 0;
}

/* A bill stretched across the whole screen is harder to read than a narrow one —
   the amount ends up a long way from the item it belongs to. */
body.pos-till.cart-max .cart-shell,
body.pos-till.cart-max #inner-sidebar > div {
    max-width: 1080px;
    margin-inline: auto;
}

/* Nothing behind it is reachable, so these would be dead controls drawn on top. */
body.pos-till.cart-max #resizer,
body.pos-till.cart-max #mobileCartToggle {
    display: none !important;
}

/* One button, two icons, chosen by the body class. Swapping the icon in JS leaves
   the arrow pointing the wrong way the first time Livewire re-renders under it. */
#cartExpandToggle .cart-max-on {
    display: none;
}

body.cart-max #cartExpandToggle .cart-max-on {
    display: inline-block;
}

body.cart-max #cartExpandToggle .cart-max-off {
    display: none;
}

/* ---- Seller + warehouse: paired only where room is short ----------------
   The markup puts them in one flex row so they CAN sit side by side. That would
   change every screen, and only the 1024-wide tills asked for it — a wide monitor
   has the height to spare and reads better stacked. So the row stacks by default,
   exactly as before, and becomes two columns only inside the range short of room.
   The margin is restored on the stacked form because the mt-3 that used to space
   them moved up onto the wrapper.
   ------------------------------------------------------------------------- */
/* Below 1000px the cart is full width or a slide-up sheet, so these stack. */
.cart-picker-row {
    flex-direction: column;
}

.cart-picker-row > * + * {
    margin-top: 0.75rem;
}

/* 1000px and up: two to a row — Customer + USD, then Seller + Warehouse.

   Four controls stacked in a 380px column put four rows between the total and
   the Order button, and on a 2560px screen that is four rows of half-empty
   boxes. Paired, each gets about half the cart, which is comfortable at 380px
   and still reads when the cart is dragged wider.

   50% minus half the 0.5rem gap, so two fit exactly. min-width:0 because a flex
   item will not shrink below its content intrinsic width by default, and a long
   branch name would otherwise push its partner off the row. */
@media (min-width: 1000px) {
    body.pos-till .cart-picker-row {
        flex-direction: row;
        flex-wrap: wrap;
    }

    body.pos-till .cart-picker-row > * {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 0;
        margin-top: 0;
    }
}

/* 1000-1400: the customer box is hidden at this size (see the cart own
   stylesheet), so the remaining three share one row instead of wrapping
   two-and-one. */
@media (min-width: 1000px) and (max-width: 1400px) {
    body.pos-till .cart-picker-row {
        flex-wrap: nowrap;
    }
}


/* ==========================================================
   PRODUCT TILE — soft glass
   ==========================================================
   A faint wash of the product's own colours behind the photo: mango leans
   warm, sugar leans green, pepper leans red, and forty tiles stop reading as
   forty identical boxes — without the tint ever pulling the eye off the pack.

   Where it has settled after three rounds:
     - the photo is drawn exactly as it is. An earlier version multiplied it
       into the glass so white backgrounds took the tint; that changed how
       every pack looked, and the product has to look like the product.
     - the glass is roughly half its first strength (opacity .7 -> .35,
       saturation 1.8 -> 1.3) with a brighter sheen on top, so it reads as a
       hint of colour rather than a coloured panel.
     - the pack keeps the extra room (padding 6px -> 2px) and the small lift in
       contrast and saturation, so it stays the strongest thing on the card.

   Layers, back to front, inside one isolated stacking context:
     ::before  blurred copy of the image       (z -2)
     ::after   white sheen + edge highlight    (z -1)
     <img>     the photo, untouched            (auto)

   The tint fades in once the image has loaded (cardGlass() adds .is-glass);
   before that, and for any tile whose image never arrives, it is plain white.

   Not scoped to a page, on purpose: nothing matches unless a tile's markup
   opts in with .card-img-wrap, and both the Sale screen and Purchasing do.
   That keeps the two looking identical from ONE set of rules. The layout rules
   further up stay under body.pos-till, because those target shared ids
   (#sidebar, #inner-sidebar) that Purchasing also has.
   ========================================================== */
.card-img-wrap {
    isolation: isolate;
    overflow: hidden;
    border-radius: 12px;
    background: #ffffff;
}

.card-img-wrap::before {
    content: "";
    position: absolute;
    /* past the edges, so the blur has no hard, see-through rim */
    inset: -30%;
    z-index: -2;
    background: var(--card-img, none) center / cover no-repeat;
    filter: blur(24px) saturate(1.15);
    opacity: 0;
    pointer-events: none;
}

/* the tint eases in only on a grid that slid in; on a stock-refresh redraw it
   simply appears, so the tiles do not visibly re-tint after every sale */
.fade-imgs .card-img-wrap::before {
    transition: opacity .35s ease;
}

.card-img-wrap.is-glass::before {
    /* .35 -> .2: a hint of the product colour, not a coloured panel */
    opacity: .2;
}

.card-img-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: linear-gradient(160deg,
            rgba(255, 255, 255, .6) 0%,
            rgba(255, 255, 255, .3) 55%,
            rgba(255, 255, 255, .5) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .8),
        inset 0 0 0 1px rgba(255, 255, 255, .4);
    pointer-events: none;
}

.card-img-wrap img {
    position: relative;
    background: transparent;
    padding: 2px;
    filter: contrast(1.06) saturate(1.15);
}

@media (prefers-reduced-motion: reduce) {
    .card-img-wrap::before {
        transition: none;
    }
}


/* ==========================================================
   PRODUCT GRID — page slide on tab switch
   ==========================================================
   Replaces a per-tile cascade that read as clutter: every tile rose in on its
   own, then its photo popped in, then its glass faded in — three separate things
   moving per tile, and the small scale-up made text shimmer on low-DPI tills.

   Now the grid moves as ONE piece (see swapProductGrid in the page script):
     - old grid: .07s, fades and drifts toward the side being left
     - new grid: .18s, arrives from the side being moved toward, with a strong
       ease-out so it lands softly instead of stopping dead
   The distances are small (28px out, 44px in) — enough to read as a page turn,
   not so much that the eye has to chase the products across the screen.

   Tiles themselves no longer animate. `animation: none` also retires the old
   cardStyleIn fade that only ever existed between 1000px and 1400px.

   transform and opacity only, so it stays smooth on the 1024x768 tills.
   ========================================================== */
@keyframes gridEnterNext {
    from { opacity: 0; transform: translateX(44px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes gridEnterPrev {
    from { opacity: 0; transform: translateX(-44px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes gridLeaveNext {
    to { opacity: 0; transform: translateX(-28px); }
}

@keyframes gridLeavePrev {
    to { opacity: 0; transform: translateX(28px); }
}

@keyframes gridFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* the arriving grid slides in from beside the scroller; without this the
   overhang flashes a horizontal scrollbar for the length of the slide */
#tab-content {
    overflow-x: hidden;
}

#tab-content > .grid-leave-next {
    animation: gridLeaveNext .07s ease-in forwards;
    pointer-events: none;
}

#tab-content > .grid-leave-prev {
    animation: gridLeavePrev .07s ease-in forwards;
    pointer-events: none;
}

#tab-content > .grid-enter-next {
    animation: gridEnterNext .18s cubic-bezier(.16, 1, .3, 1) both;
}

#tab-content > .grid-enter-prev {
    animation: gridEnterPrev .18s cubic-bezier(.16, 1, .3, 1) both;
}

/* reduce-motion PCs: the page still visibly changes, with no movement */
#tab-content > .grid-enter-fade {
    animation: gridFade .12s ease both;
}

.card_style {
    opacity: 1;
    animation: none;
}

/* ---- photos fade in when they are ready, instead of popping ---------------
   cardGlass() marks the tile .is-glass on the image's load event. The
   cardImgReveal animation is a safety net: if that event never arrives (a very
   slow network, or a script failure), the photo still shows after 1.2s rather
   than staying invisible. */
@keyframes cardImgReveal {
    to { opacity: 1; }
}

/* only on a grid that arrived by sliding (.fade-imgs); a stock-refresh redraw
   keeps its already-cached photos on screen instead of blinking them */
.fade-imgs .card-img-wrap img {
    opacity: 0;
    transition: opacity .15s ease;
    animation: cardImgReveal 0s 1.2s forwards;
}

.fade-imgs .card-img-wrap.is-glass img {
    opacity: 1;
}


/* ==========================================================
   SEARCH RESULTS — revealed one by one
   ==========================================================
   The counterpart to the tab-switch page slide: a search's answers arrive one
   tile at a time. Each fades up 14px, 55ms after the one before it.

   The stagger is capped at the 24th tile, so a broad search that matches sixty
   products is still fully on screen in about 1.3s rather than making the cashier
   wait for the tail end of it.

   No scale: a zooming tile makes its text shimmer on the low-DPI tills. And fill
   mode is BACKWARDS, so once a tile has arrived the animation lets go of its
   transform and .card_style:hover can lift it again.

   Higher specificity than `.card_style { animation: none }` (the tab-switch
   block), which is what lets these tiles animate while tab-switch tiles do not.
   ========================================================== */
@keyframes searchTileIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

#tab-content > .search-reveal .card_style {
    animation: searchTileIn .35s cubic-bezier(.2, .8, .2, 1) backwards;
    animation-delay: calc(min(var(--r, 0), 24) * 55ms);
}

/* reduce-motion PCs: still one by one, as a quick fade with no movement */
@media (prefers-reduced-motion: reduce) {
    #tab-content > .search-reveal .card_style {
        animation: gridFade .2s ease backwards;
        animation-delay: calc(min(var(--r, 0), 24) * 20ms);
    }
}


/* ==========================================================
   CASHIER MONITOR — short screens (1052x546, 1024x768)
   ==========================================================
   Measured in the browser at 1052x546 rather than guessed. What was wrong:

   1. The Sale Order List footer was drawn ON TOP of the order rows.
      .scroll_content_70 is pinned to min-height:74vh in the 1000-1400 block.
      At 546px tall that is 404px, but after the header (52), filters (74) and
      summary (42) the modal only had 262px left. The table could not shrink, so
      it overflowed its box and the footer — pagination, and the Line / Sale
      Return / Print Receipt buttons — landed over the last rows.

      The modal is already a flex column that shares out the height correctly;
      the fixed min-height was the only thing stopping it. Released here for the
      modal only. On a tall screen this changes nothing: flex-1 hands the table
      the same space the 74vh floor was asking for.

   2. The filter row was 1606px of controls in a 971px box, so Delivery, the date
      range, the Riel toggle and Clear were all off the right edge, reachable only
      by scrolling a bar most people never notice. It wraps now, with tighter
      controls, which costs less height than the scrollbar it replaces.

   3. Product tiles were 232px tall, so barely two rows fit. Shorter photo and a
      two-line name (the third line was running under the price) fit three.

   4. The yellow Menu strip is 36px tall but its content is 60px, so the "Menu"
      label was cut off. The bar now lays itself out inside the strip.
   ========================================================== */

/* ---- 1. let the orders table share the modal's height ---- */
body.pos-till #default-modal-sales-order-list .scroll_content_70 {
    min-height: 0;
    max-height: none;
}

/* the chips were folded into the summary bar, so this div is always empty —
   it was still taking its margin between the summary and the table */
body.pos-till #so_summary_chips:empty {
    display: none;
}

@media (max-height: 700px) {

    /* ---- 2. filters: wrap instead of scrolling out of sight ---- */
    body.pos-till #default-modal-sales-order-list .bg-gray-50.border.rounded-2xl > .flex {
        flex-wrap: wrap;
        overflow-x: visible;
        row-gap: 6px;
    }

    body.pos-till #default-modal-sales-order-list .bg-gray-50.border.rounded-2xl input,
    body.pos-till #default-modal-sales-order-list .bg-gray-50.border.rounded-2xl select,
    body.pos-till #default-modal-sales-order-list .bg-gray-50.border.rounded-2xl label,
    body.pos-till #default-modal-sales-order-list .bg-gray-50.border.rounded-2xl button {
        padding-top: 2px;
        padding-bottom: 2px;
        font-size: 12px;
        min-width: 104px;
    }

    /* every row of orders counts on a 546px screen */
    body.pos-till #default-modal-sales-order-list .modal-card-sale {
        padding: 10px;
    }

    body.pos-till #default-modal-sales-order-list .so-tbl tbody td {
        padding-top: 4px;
        padding-bottom: 4px;
    }

    body.pos-till #default-modal-sales-order-list .mt-4 {
        margin-top: 8px;
    }

    /* ---- 3. product tiles: three rows instead of two ---- */
    body.pos-till .card_style img {
        max-height: 68px !important;
        min-height: 68px !important;
    }

    body.pos-till .card_style .add-to-cart-btn > div:last-child {
        height: auto !important;
        padding: 4px 6px;
    }

    /* the third line was sliding under the price */
    body.pos-till .product-name-card {
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    /* ---- 4. the Menu strip fits its own 36px ---- */
    body.pos-till #drawer-swipe #drawer-body {
        /* min-height:0 matters: another block sets #drawer-body{min-height:60px}, and a
           min-height always beats a plain height — which is why the strip stayed 60px
           tall inside a 36px opening and cut the label in half. */
        height: 36px;
        min-height: 0;
        display: flex;
        align-items: center;
        padding: 0 0.75rem !important;
    }

    body.pos-till #drawer-swipe #drawer-swipe-label {
        font-size: 0.78rem;
        margin: 0;
    }

    body.pos-till #drawer-swipe #drawer-body > span {
        top: 0.25rem;
    }
}

/* ==========================================================================
   BILL DISCOUNT — THE DANGER PROMPT
   ==========================================================================
   The Bill Discount box takes money OFF the bill, and it sits one field away
   from the box that records money COMING IN. Typed into the wrong one, a
   payment hands the goods over for nothing — which is exactly what three
   orders in the other till turned out to be.

   So the cashier is stopped and asked, in Khmer, before it is accepted. Written
   here rather than in Tailwind on purpose: this file is served as it is, so the
   warning cannot be lost to a build that did not run.
   ========================================================================== */
.bdw-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;              /* above the sale-order screen it interrupts */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: bdw-fade 140ms ease-out;
}
.bdw-overlay.hidden { display: none !important; }

.bdw-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.45);
    animation: bdw-pop 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.bdw-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #e11d48 0%, #b91c1c 100%);
    color: #fff;
}
/* informational rather than dangerous: the same card, a calmer colour */
.bdw-card.is-note .bdw-head { background: linear-gradient(135deg, #d97706 0%, #b45309 100%); }

.bdw-badge {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55);
    animation: bdw-pulse 1.8s ease-out infinite;
}
.bdw-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
    margin: 0;
}
.bdw-sub {
    margin: 2px 0 0;
    font-size: 11px;
    letter-spacing: 0.02em;
    opacity: 0.9;
}

.bdw-body { padding: 16px 18px 4px; }

.bdw-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    font-size: 13px;
    color: #334155;
    border-bottom: 1px dashed #e2e8f0;
}
.bdw-row:last-child { border-bottom: 0; }
.bdw-row-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bdw-row.is-cut .bdw-row-val { color: #e11d48; }
.bdw-row.is-final { font-size: 14px; color: #0f172a; }
.bdw-row.is-final .bdw-row-val { font-size: 17px; }

.bdw-note {
    margin: 12px 0 0;
    padding: 11px 13px;
    border-radius: 12px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #7c2d12;
    font-size: 12px;
    line-height: 1.75;
}

.bdw-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 18px 18px;
}
.bdw-btn {
    padding: 10px 16px;
    border-radius: 12px;
    border: 0;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 90ms ease, filter 140ms ease;
}
.bdw-btn:active { transform: translateY(1px); }
.bdw-btn-ghost { background: #e2e8f0; color: #0f172a; }
.bdw-btn-ghost:hover { background: #cbd5e1; }
.bdw-btn-danger { background: #e11d48; color: #fff; }
.bdw-btn-danger:hover { filter: brightness(1.08); }
.bdw-btn.hidden { display: none !important; }

@keyframes bdw-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bdw-pop {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}
@keyframes bdw-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55); }
    70%  { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* ==========================================================================
   THE PAYMENT SCREEN ON A LAPTOP
   ==========================================================================
   On a 1366x768 the body of this screen is 847px of content in 563px of room,
   so REMAINING and RETURN — the two figures a cashier reads while counting out
   change — sat just below the fold and had to be scrolled to. Nothing here
   changes what is on the screen, only how much air is around it: padding,
   gaps and field height come in, and the ~220px that buys is enough to lift
   both figures into view.

   Scoped twice over, deliberately. Only inside this one modal, and only on a
   laptop-shaped viewport: wide enough that it is not the 1052px cashier
   monitor (which has its own rules), short enough that it is not a desktop.
   ========================================================================== */
@media (min-width: 1200px) and (max-height: 900px) {

    /* the scrolling body */
    #default-modal-sales-order-save .overflow-y-auto {
        padding: 0.9rem 1.1rem;
    }
    #default-modal-sales-order-save .space-y-5 > * + * {
        margin-top: 0.7rem;
    }

    /* each white section card */
    #default-modal-sales-order-save .rounded-2xl.p-5 {
        padding: 0.8rem 1rem;
    }

    /* section heading row + its icon chip */
    #default-modal-sales-order-save .mb-4 {
        margin-bottom: 0.55rem;
    }
    #default-modal-sales-order-save .h-7.w-7 {
        height: 1.4rem;
        width: 1.4rem;
    }

    /* fields: label tight to its box, box shorter */
    #default-modal-sales-order-save label {
        margin-bottom: 0.2rem;
    }
    #default-modal-sales-order-save input,
    #default-modal-sales-order-save select,
    #default-modal-sales-order-save textarea {
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
    }

    /* the three figures across the top of PAYMENT */
    #default-modal-sales-order-save .rounded-xl.border.p-4,
    #default-modal-sales-order-save .rounded-xl.p-4 {
        padding: 0.55rem 0.75rem;
    }

    /* grids inside the screen breathe a little less */
    #default-modal-sales-order-save .gap-4 {
        gap: 0.65rem;
    }
    #default-modal-sales-order-save .mb-4.grid,
    #default-modal-sales-order-save .grid.mb-4 {
        margin-bottom: 0.55rem;
    }
}

/* ==========================================================================
   THE PAYMENT SCREEN ON A SHORT TILL (the 1052x546 cashier monitor)
   ==========================================================================
   546px tall leaves 354px of room for 847px of screen: the cashier could see
   ORDER INFO and the top of PAYMENT, and had to scroll blind for the fields they
   actually came here to use. 847px will never fit in 354px, so the aim is not "no
   scrolling" - it is to get PAYMENT up where it can be reached at a glance.

   Three things, in order of what they buy back:
     - ORDER INFO goes across ONE row instead of two          (~85px)
     - the vertical rhythm comes in: padding, gaps, field height (~110px)
     - the round icon chips go. They are decoration, and this screen has no
       room for decoration.

   Keyed on HEIGHT, so the 1024x768 till (which leaves ~640px) gets it too, and a
   desktop never does. The laptop block above stops at min-width:1200, so the two
   do not overlap on this monitor.
   ========================================================================== */
@media (max-height: 700px) {

    #default-modal-sales-order-save .overflow-y-auto {
        padding: 0.6rem 0.8rem;
    }
    #default-modal-sales-order-save .space-y-5 > * + * {
        margin-top: 0.5rem;
    }
    #default-modal-sales-order-save .rounded-2xl.p-5 {
        padding: 0.55rem 0.8rem;
    }
    #default-modal-sales-order-save .mb-4 {
        margin-bottom: 0.4rem;
    }

    /* labels and fields */
    #default-modal-sales-order-save label {
        margin-bottom: 0.15rem;
        font-size: 10px;
    }
    #default-modal-sales-order-save input,
    #default-modal-sales-order-save select,
    #default-modal-sales-order-save textarea {
        padding-top: 0.3rem;
        padding-bottom: 0.3rem;
    }
    #default-modal-sales-order-save .gap-4 {
        gap: 0.5rem;
    }

    /* the three figures across the top of PAYMENT */
    #default-modal-sales-order-save .rounded-xl.border.p-4,
    #default-modal-sales-order-save .rounded-xl.p-4 {
        padding: 0.4rem 0.6rem;
    }

    /* the round icon chip beside each section heading */
    #default-modal-sales-order-save .h-7.w-7 {
        display: none;
    }
}

/* ORDER INFO on one row. Width-guarded: four columns need the room, and the
   phone layout below 900px is better off left alone. */
@media (max-height: 700px) and (min-width: 900px) {
    #default-modal-sales-order-save .so-order-info-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ==========================================================================
   FIELDS WITH A PREFIX GLYPH KEEP THE ROOM FOR IT
   ==========================================================================
   Bill Discount, Discount all items, Pay as Dollar and Pay as riel each carry a
   $ / % / riel sign inside the box, drawn as an absolutely positioned span and
   cleared by the pl-8 the input is built with.

   The 1000-1400 block further up sets `padding: 4px 8px` on every input, and a
   shorthand overwrites all four sides - so pl-8 became 8px, the glyph (which sits
   at 14-21px and does not move) ended up past where the text begins, and on the
   1052px cashier monitor the amount was typed underneath the sign.

   Only the left side is restored here. The tighter top/bottom from that block is
   deliberate and stays.
   ========================================================================== */
@media (min-width: 1000px) and (max-width: 1400px) {
    #default-modal-sales-order-save #so_pay_usd,
    #default-modal-sales-order-save #so_pay_other,
    #default-modal-sales-order-save #so_invoice_discount,
    #default-modal-sales-order-save #so_all_items_discount {
        padding-left: 1.75rem;
    }
}
