/* ================================================================
   POS SYSTEM — Master Stylesheet
   Bootstrap 5.3 base + all POS-specific components
   File location: <your-ci4-project>/public/assets/css/pos.css
   ================================================================ */

/* ----------------------------------------------------------------
   CSS VARIABLES
   ---------------------------------------------------------------- */
:root {
    --pos-sidebar-width:    230px;
    --pos-sidebar-bg:       #1a1d23;
    --pos-sidebar-hover:    #2a2e38;
    --pos-sidebar-active:   #0d6efd;
    --pos-navbar-height:    56px;
    --pos-text-muted:       #8b9199;
    --pos-section-label:    #5a6170;
    --pos-border:           #e9ecef;
    --pos-bg-page:          #f4f6f9;
    --pos-bg-white:         #ffffff;
    --pos-bg-light:         #f8fafc;
}

/* ----------------------------------------------------------------
   BASE
   ---------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--pos-bg-page);
    font-size: 0.875rem;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #212529;
}

/* ----------------------------------------------------------------
   TOP NAVBAR
   ---------------------------------------------------------------- */
.pos-navbar {
    background: var(--pos-bg-white);
    border-bottom: 1px solid var(--pos-border);
    height: var(--pos-navbar-height);
    z-index: 1030;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* ----------------------------------------------------------------
   SIDEBAR
   ---------------------------------------------------------------- */
.pos-sidebar {
    width: var(--pos-sidebar-width);
    min-width: var(--pos-sidebar-width);
    background: var(--pos-sidebar-bg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.2s ease;
    z-index: 1020;
    flex-shrink: 0;
}

.sidebar-nav {
    padding: 0.5rem 0 2rem;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* details/summary collapsible group */
.sidebar-group {
    display: block;
    width: 100%;
}

.sidebar-group summary {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem 1.1rem;
    color: #c9ced6;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background-color: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
    user-select: none;
    list-style: none;
}

.sidebar-group summary::-webkit-details-marker {
    display: none;
}

.sidebar-group summary::marker {
    display: none;
    content: '';
}

.sidebar-group summary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-group summary i {
    font-size: 1.1rem;
    width: 1.2rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-group summary .toggle-icon {
    margin-left: auto;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
    color: #c9ced6;
}

.sidebar-group[open] summary {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-group[open] summary .toggle-icon {
    transform: rotate(90deg);
    color: #ffffff;
}

.sidebar-group-content {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 0;
    width: 100%;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 1.1rem;
    color: #c9ced6;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    text-decoration: none;
}

.sidebar-link.active {
    background: rgba(13, 110, 253, 0.15);
    color: #fff;
    border-left-color: #0d6efd;
    font-weight: 600;
}

.sidebar-link i {
    font-size: 1.05rem;
    width: 1.2rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link .link-badge {
    margin-left: auto;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    color: #c9ced6;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
}
.dashboard-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 1.1rem;
    margin: 0.3rem 0.6rem 0.5rem;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    border-radius: 8px;
    transition: background 0.15s, transform 0.15s;
    white-space: nowrap;
    cursor: pointer;
    border: none;
}

.dashboard-link:hover {
    background: linear-gradient(135deg, #0b5ed7, #084298);
    color: #fff;
    text-decoration: none;
    transform: translateX(2px);
}

.dashboard-link i {
    font-size: 1.1rem;
    width: 1.2rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-group-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 0.3rem 1.1rem;
}

.sidebar-group-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--pos-section-label);
    padding: 0.5rem 1.1rem 0.2rem;
    text-transform: uppercase;
    user-select: none;
}

/* ----------------------------------------------------------------
   MAIN CONTENT AREA
   ---------------------------------------------------------------- */
.pos-main {
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    min-width: 0;
    flex: 1;
}

/* ----------------------------------------------------------------
   PAGE HEADER
   ---------------------------------------------------------------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--pos-border);
}

.page-header h1 {
    font-size: 1.35rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    line-height: 1.3;
}

/* ----------------------------------------------------------------
   CARDS
   ---------------------------------------------------------------- */
.card {
    border: 1px solid var(--pos-border);
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    border-radius: 0.5rem;
}

.card-header {
    background: var(--pos-bg-white);
    border-bottom: 1px solid var(--pos-border);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.85rem 1.1rem;
    color: #374151;
}

.card-footer {
    background: var(--pos-bg-light);
    border-top: 1px solid var(--pos-border);
    padding: 0.6rem 1.1rem;
    font-size: 0.82rem;
}

/* ----------------------------------------------------------------
   STAT / KPI CARDS  (Dashboard & Reports)
   ---------------------------------------------------------------- */
.stat-card {
    border-radius: 0.5rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid transparent;
    height: 100%;
}

.stat-card .stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0.15rem 0;
}

.stat-card .stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
    margin-bottom: 0.1rem;
}

.stat-card .stat-icon {
    font-size: 2rem;
    opacity: 0.18;
    line-height: 1;
}

/* ----------------------------------------------------------------
   STATUS BADGES
   ---------------------------------------------------------------- */
.status-badge {
    display: inline-block;
    font-size: 0.70rem;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1.4;
}

.badge-completed    { background: #d1fae5; color: #065f46; }
.badge-voided       { background: #fee2e2; color: #991b1b; }
.badge-pending      { background: #fef3c7; color: #92400e; }
.badge-active       { background: #d1fae5; color: #065f46; }
.badge-suspended    { background: #fee2e2; color: #991b1b; }
.badge-in-stock     { background: #d1fae5; color: #065f46; }
.badge-low-stock    { background: #fef3c7; color: #92400e; }
.badge-out-of-stock { background: #fee2e2; color: #991b1b; }
.badge-closed       { background: #e2e8f0; color: #475569; }
.badge-draft        { background: #f1f5f9; color: #64748b; }
.badge-approved     { background: #dbeafe; color: #1e40af; }

/* ----------------------------------------------------------------
   TABLES
   ---------------------------------------------------------------- */
.table-sm td,
.table-sm th {
    vertical-align: middle;
}

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

/* DataTables overrides */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    padding: 0.75rem 1rem;
    background: #f8f9fc;
    border-bottom: 1px solid #eef0f4;
}
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.85rem;
    color: #333;
    margin: 0;
    white-space: nowrap;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1.5px solid #667eea;
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 0.4rem;
    min-width: 220px;
    background: #fff;
}
.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.18);
}

.dataTables_wrapper .dataTables_length select {
    border: 1.5px solid #667eea;
    border-radius: 8px;
    padding: 0.35rem 1.8rem 0.35rem 0.65rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #4c1d95;
    background: #fff;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 0.375rem !important;
    font-size: 0.82rem;
}

/* ----------------------------------------------------------------
   AVATAR
   ---------------------------------------------------------------- */
.avatar-circle-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #0d6efd;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    user-select: none;
}

/* ----------------------------------------------------------------
   LOGIN PAGE  (standalone — no sidebar)
   ---------------------------------------------------------------- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1d23 0%, #2d3748 100%);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    padding: 2.5rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-logo i {
    font-size: 2.5rem;
    color: #0d6efd;
}

/* ----------------------------------------------------------------
   POS TERMINAL LAYOUT  (2-column grid)
   ---------------------------------------------------------------- */
.pos-terminal-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1rem;
    height: calc(100vh - var(--pos-navbar-height) - 2rem);
    min-height: 500px;
}

/* LEFT panel — product search + cart items */
.pos-product-panel {
    background: var(--pos-bg-white);
    border-radius: 0.75rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* RIGHT panel — totals + checkout */
.pos-cart-panel {
    background: var(--pos-bg-white);
    border-radius: 0.75rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* Search bar strip at top of left panel */
.pos-search-bar {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}
.pos-search-bar .form-control,
.pos-search-bar .input-group-text {
    border: none;
    border-radius: 10px;
    background: #fff;
    font-size: 0.86rem;
    padding: 8px 14px;
}
.pos-search-bar .form-control:focus {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.35);
}
.pos-search-bar .input-group-text {
    border-radius: 10px 0 0 10px;
    border-right: 1px solid #f0f0f0;
    color: #667eea;
}
.pos-search-bar .input-group .form-control {
    border-radius: 0;
}
.pos-search-bar .input-group .btn {
    border: none;
    border-left: 1px solid #f0f0f0;
    border-radius: 0 10px 10px 0;
    background: #fff;
    color: #764ba2;
    padding: 8px 12px;
}
.pos-search-bar .input-group .btn:hover {
    background: #ede9fe;
    color: #4c1d95;
}

/* Cart panel header */
.pos-cart-header {
    padding: 0.9rem 1.1rem;
    border-bottom: none;
    font-weight: 700;
    font-size: 0.95rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.pos-cart-header .badge {
    background: rgba(255,255,255,0.25);
    color: #fff;
    font-weight: 600;
    padding: 4px 10px;
}
.pos-cart-header #clearCartBtn {
    border: 1px solid rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    font-size: 0.8rem;
}
.pos-cart-header #clearCartBtn:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* Scrollable cart items area */
.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.6rem;
    min-height: 0;
    background: #f8f9fc;
}

/* ── Individual cart item — colorful card ─────────────────────── */
.cart-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0.6rem;
    font-size: 0.82rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-left: 5px solid #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 0.5rem;
    transition: transform 0.15s, box-shadow 0.15s;
}

/* Alternate colored left borders for cart cards */
.cart-item:nth-child(6n+1) { border-left-color: #667eea; }
.cart-item:nth-child(6n+2) { border-left-color: #11998e; }
.cart-item:nth-child(6n+3) { border-left-color: #4facfe; }
.cart-item:nth-child(6n+4) { border-left-color: #f7971e; }
.cart-item:nth-child(6n+5) { border-left-color: #a18cd1; }
.cart-item:nth-child(6n+6) { border-left-color: #ff6b6b; }

.cart-item:last-child { margin-bottom: 0; }
.cart-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.cart-item-name {
    flex: 1;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1a1e2b;
}
.cart-item-name small {
    font-weight: 400;
    color: #8b9199;
}

/* Quantity +/- controls */
.cart-qty-control {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    flex-shrink: 0;
    background: #f1f3f8;
    border-radius: 8px;
    padding: 2px;
}

.cart-qty-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
    line-height: 1;
    color: #667eea;
    font-weight: 700;
    transition: background 0.15s;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.cart-qty-btn:hover    { background: #667eea; color: #fff; }
.cart-qty-btn:active   { transform: scale(0.92); }

.cart-qty-input {
    width: 42px;
    height: 24px;
    text-align: center;
    border: none;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0;
    color: #1a1e2b;
    background: #fff;
}

.cart-qty-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(102,126,234,0.35);
}

.cart-item-price {
    font-weight: 700;
    min-width: 76px;
    text-align: right;
    color: #1a1e2b;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.cart-remove-btn {
    color: #ff6b6b;
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px;
    font-size: 0.95rem;
    opacity: 0.5;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: opacity 0.15s;
    border-radius: 6px;
}

.cart-remove-btn:hover { opacity: 1; background: #fee2e2; }

/* Cart totals section */
.pos-cart-totals {
    border-top: 2px solid #f0f0f0;
    padding: 0.8rem 1.1rem;
    font-size: 0.86rem;
    flex-shrink: 0;
    background: linear-gradient(180deg, #f8f9ff 0%, #fff 100%);
}

.pos-cart-totals .total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.15rem 0;
    gap: 0.5rem;
    color: #444;
}
.pos-cart-totals .total-row span:last-child {
    font-weight: 600;
    color: #1a1e2b;
}

.pos-cart-totals .grand-total {
    font-size: 1.35rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border-top: 2px solid #f0f0f0;
    margin-top: 0.4rem;
    padding-top: 0.5rem;
}

/* Checkout / action buttons strip */
.pos-cart-actions {
    padding: 0.7rem;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-shrink: 0;
    background: #fff;
}
.pos-cart-actions .btn {
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
}
.pos-cart-actions #discountBtn {
    border: none;
    color: #fff;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 14px rgba(79,172,254,0.35);
}
.pos-cart-actions #discountBtn:hover {
    filter: brightness(1.05);
    box-shadow: 0 6px 18px rgba(79,172,254,0.5);
    color: #fff;
}
.pos-cart-actions #suspendBtn {
    border: none;
    color: #fff;
    background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
    box-shadow: 0 4px 14px rgba(247,151,30,0.35);
}
.pos-cart-actions #suspendBtn:hover {
    filter: brightness(1.05);
    box-shadow: 0 6px 18px rgba(247,151,30,0.5);
    color: #fff;
}
.pos-cart-actions #chargeBtn {
    border: none;
    color: #fff !important;
    background: #16a34a;
    border-radius: 14px;
    padding: 14px 20px;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 20px rgba(22,163,74,0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}
.pos-cart-actions #chargeBtn:hover {
    background: #15803d;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(22,163,74,0.45);
    color: #fff !important;
}
.pos-cart-actions #chargeBtn:disabled {
    background: #b0bec5;
    box-shadow: none;
    transform: none;
    opacity: 0.7;
    color: #fff !important;
}

/* ----------------------------------------------------------------
   PRODUCT SEARCH DROPDOWN
   ---------------------------------------------------------------- */
.product-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    max-height: 340px;
    overflow-y: auto;
    z-index: 1050;
    padding: 4px;
}

.product-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    border-bottom: none;
    border-radius: 8px;
    font-size: 0.82rem;
    transition: background 0.12s;
    margin-bottom: 2px;
}

.product-result-item:last-child { margin-bottom: 0; }
.product-result-item:hover {
    background: linear-gradient(135deg, rgba(102,126,234,0.1) 0%, rgba(118,75,162,0.06) 100%);
}

.product-result-item.out-of-stock {
    opacity: 0.45;
    cursor: not-allowed;
}

.product-result-item .stock-badge {
    font-size: 0.70rem;
    padding: 0.15rem 0.5rem;
    flex-shrink: 0;
    border-radius: 20px;
    font-weight: 600;
}

/* ----------------------------------------------------------------
   SHIFT MANAGEMENT
   ---------------------------------------------------------------- */

/* Denomination count table inputs */
.denom-count {
    width: 90px;
    text-align: center;
}

.denom-subtotal {
    font-weight: 600;
    color: #0f172a;
}

/* Variance colour helpers */
.variance-over   { color: #059669; font-weight: 700; }
.variance-short  { color: #dc2626; font-weight: 700; }
.variance-zero   { color: #6b7280; }

/* ----------------------------------------------------------------
   RECEIPT / PRINT
   ---------------------------------------------------------------- */
.receipt-screen-wrapper {
    max-width: 520px;
    margin: 2rem auto;
}

.receipt-card {
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
    overflow: hidden;
}

.receipt-top-bar {
    background: #1a1d23;
    color: #fff;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.receipt-body {
    padding: 1.5rem;
}

/* Thermal / monospace receipt styles */
.receipt-thermal {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.45;
    color: #000;
}

.receipt-center   { text-align: center; }
.receipt-right    { text-align: right; }
.receipt-bold     { font-weight: 700; }
.receipt-large    { font-size: 16px; font-weight: 700; }

.receipt-divider {
    border-top: 1px dashed #666;
    margin: 0.5rem 0;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.1rem;
    gap: 0.5rem;
}

.receipt-row .label { flex: 1; }
.receipt-row .value { text-align: right; min-width: 80px; flex-shrink: 0; }

.item-row          { margin-bottom: 0.3rem; }
.item-row .item-name   { font-weight: 600; word-break: break-word; }
.item-row .item-detail {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #555;
}

.receipt-screen-actions {
    text-align: center;
    margin-top: 1rem;
    padding-bottom: 2rem;
}

.void-stamp {
    color: #dc3545;
    border: 3px solid #dc3545;
    display: inline-block;
    padding: 0.2rem 0.8rem;
    font-weight: 900;
    font-size: 1.4rem;
    transform: rotate(-12deg);
    letter-spacing: 0.1em;
    margin: 0.5rem auto;
}

/* ----------------------------------------------------------------
   STOCK LEVEL SPARKLINE
   ---------------------------------------------------------------- */
#ledgerSparkline {
    display: block;
    width: 100% !important;
    max-height: 40px;
}

/* ----------------------------------------------------------------
   TOGGLE PASSWORD (change password page)
   ---------------------------------------------------------------- */
.toggle-pw { line-height: 1; }

/* Requirement list items on change-password */
#pwRequirements li {
    transition: color 0.2s;
    font-size: 0.8rem;
    padding: 0.05rem 0;
}

/* ----------------------------------------------------------------
   FORMS — General helpers
   ---------------------------------------------------------------- */
.conversion-row {
    animation: fadeInRow 0.15s ease;
}

@keyframes fadeInRow {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Margin preview box on product form */
#marginInfo {
    font-size: 0.78rem;
    transition: background 0.3s, border-color 0.3s;
}

/* ----------------------------------------------------------------
   PRINT — Global rules
   ---------------------------------------------------------------- */
@media print {
    .pos-navbar,
    .pos-sidebar,
    .pos-cart-actions,
    .no-print,
    .btn,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        display: none !important;
    }

    body         { background: #fff !important; }
    .card        { box-shadow: none !important; border: 1px solid #ccc !important; }
    .pos-main    { overflow: visible !important; }

    /* Shift report print */
    .receipt-wrapper {
        width: 80mm;
        font-size: 12px;
        font-family: 'Courier New', monospace;
    }

    /* Receipt page print — match thermal width */
    .receipt-screen-wrapper { max-width: 100%; margin: 0; }
    .receipt-top-bar        { display: none !important; }
    .receipt-card           { box-shadow: none; border-radius: 0; }
    .receipt-body           { padding: 0.25rem; }
    .receipt-thermal        { font-size: 11px; }
}

/* ----------------------------------------------------------------
   RESPONSIVE — Mobile
   ---------------------------------------------------------------- */
@media (max-width: 991.98px) {
    /* Sidebar becomes an off-canvas drawer */
    .pos-sidebar {
        position: fixed;
        top: var(--pos-navbar-height);
        left: 0;
        height: calc(100vh - var(--pos-navbar-height));
        transform: translateX(-100%);
    }

    .pos-sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,.25);
    }

    /* POS terminal stacks vertically on small screens */
    .pos-terminal-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .pos-product-panel { min-height: 400px; }
    .pos-cart-panel    { min-height: 300px; border-left: 1px solid var(--pos-border); }
}

@media (max-width: 767.98px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stat-card .stat-value { font-size: 1.35rem; }

    .receipt-screen-wrapper { margin: 0.5rem; }
}

@media (max-width: 575.98px) {
    .pos-cart-totals .grand-total { font-size: 1rem; }
    body { font-size: 0.82rem; }
}