body {
    font-family: Arial, sans-serif;
    margin: 0;
    background: #f5f7fb;
    color: #222;
}

header {
    background: #111827;
    color: #fff;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header a {
    color: #fff;
    margin-left: 15px;
    text-decoration: none;
}

main {
    padding: 25px;
}

.alert {
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 5px;
}

.success {
    background: #d1fae5;
}

.error {
    background: #fee2e2;
}
form {
    background: #fff;
    padding: 25px;
    width: 100%;
    max-width: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

label {
    display: block;
    margin-top: 15px;
    font-weight: bold;
}

input,
textarea,
select {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

button {
    margin-top: 20px;
    padding: 12px 18px;
    border: none;
    background: #111827;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 25px;
}

.card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.card h3 {
    margin-top: 0;
    font-size: 16px;
    color: #555;
}

.card p {
    font-size: 26px;
    font-weight: bold;
}

.quick-actions {
    margin-top: 30px;
}

.quick-actions a {
    display: inline-block;
    background: #111827;
    color: #fff;
    padding: 12px 18px;
    border-radius: 6px;
    margin-right: 10px;
    text-decoration: none;
}

table {
    width: 100%;
    background: #fff;
    border-collapse: collapse;
    margin-top: 20px;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

th {
    background: #f3f4f6;
}

.btn {
    display: inline-block;
    background: #111827;
    color: #fff;
    padding: 10px 14px;
    border-radius: 5px;
    text-decoration: none;
    margin-right: 8px;
}
.pos-wrapper {
    display: grid;
    grid-template-columns: 45% 55%;
    gap: 20px;
}

.pos-products,
.pos-cart {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
}

.product-list {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
}

.product-item {
    border: 1px solid #ddd;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    background: #f9fafb;
}

.product-item:hover {
    background: #eef2ff;
}

.cart-summary {
    margin-top: 20px;
    padding: 15px;
    background: #f3f4f6;
    border-radius: 6px;
}
.receipt-wrapper{

    display:flex;

    flex-direction:column;

    align-items:center;

}

.receipt{

    width:360px;

    background:white;

    padding:20px;

    border-radius:8px;

    box-shadow:0 2px 12px rgba(0,0,0,.1);

}

.center{

    text-align:center;

}

.receipt table{

    width:100%;

}

.receipt-info td{

    padding:4px;

}

.items td{

    padding:6px 0;

}

.items th{

    text-align:left;

}

.totals td{

    padding:4px;

}

.grand{

    font-size:18px;

    font-weight:bold;

}

.receipt-buttons{

    margin-top:20px;

}

.receipt-buttons button,

.receipt-buttons .btn{

    padding:10px 16px;

    margin-right:10px;

}

.barcode-label {
    width: 220px;
    background: #fff;
    padding: 12px;
    text-align: center;
    border: 1px solid #ddd;
}

.barcode-label img {
    width: 180px;
    margin: 8px 0;
}

@media print {
    .sidebar,
    .topbar,
    .footer,
    .no-print {
        display: none !important;
    }

    .content {
        padding: 0;
    }
}

@media print{

    header,
    nav,
    .receipt-buttons{

        display:none;

    }

    body{

        background:white;

    }

    .receipt{

        width:100%;

        box-shadow:none;

        border:none;

    }

}
@media print {
    .sidebar,
    .topbar,
    .footer,
    button,
    .btn {
        display: none !important;
    }

    .content {
        padding: 0;
    }

    body {
        background: #fff;
    }
.locked-feature {
    opacity: 0.65;
}

.locked-feature small {
    float: right;
    font-size: 10px;
    text-transform: uppercase;
}
}

.billing-summary-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(210px, 1fr)
    );
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    min-height: 145px;
}

.summary-card h3 {
    margin-bottom: 0.5rem;
}

.summary-value {
    margin: 0.35rem 0;
    font-size: 1.65rem;
    font-weight: 700;
}

.summary-card small {
    display: block;
    margin-top: 0.5rem;
}

.summary-card progress {
    width: 100%;
    margin-top: 0.65rem;
}


/* =========================================================
   Inventory SaaS Integrated UI Override
   Blue + Orange + Scrollable Sidebar
   Applied to the supplied stylesheet
   ========================================================= */

:root {
    --blue-900: #0f2a52;
    --blue-800: #163a70;
    --blue-700: #1d4ed8;
    --blue-600: #2563eb;
    --blue-100: #dbeafe;
    --blue-50: #eff6ff;

    --orange-600: #ea580c;
    --orange-500: #f97316;
    --orange-100: #ffedd5;
    --orange-50: #fff7ed;

    --surface: #ffffff;
    --page-bg: #f5f7fb;
    --text: #1f2937;
    --muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 8px 24px rgba(15, 42, 82, .07);
}

/* Base */
* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    background: var(--page-bg);
    color: var(--text);
}

/* Main app shell */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.main-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    padding: 24px;
}

/* Sidebar */
.sidebar {
    width: 270px;
    height: 100vh;
    max-height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    flex: 0 0 270px;
    overflow: hidden;
    background: linear-gradient(180deg, var(--blue-900) 0%, #0a1d39 100%);
    color: #fff;
    box-shadow: 8px 0 26px rgba(15, 42, 82, .09);
    z-index: 1000;
}

.sidebar .brand {
    flex: 0 0 auto;
    padding: 20px 18px;
    font-size: 19px;
    font-weight: 800;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.09);
}

/* NAV IS THE SCROLL AREA */
.sidebar nav,
.sidebar .sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--orange-500) rgba(255,255,255,.08);
    padding: 10px 0 18px;
}

.sidebar nav a,
.sidebar .sidebar-nav a {
    display: block;
    padding: 11px 18px;
    margin: 2px 9px;
    border-radius: 7px;
    color: #dbeafe;
    text-decoration: none;
    font-size: 13px;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

.sidebar nav a:hover,
.sidebar .sidebar-nav a:hover {
    background: rgba(37, 99, 235, .82);
    color: #fff;
}

.sidebar nav a.active,
.sidebar .sidebar-nav a.active {
    position: relative;
    background: var(--blue-700);
    color: #fff;
    font-weight: 700;
}

.sidebar nav a.active::before,
.sidebar .sidebar-nav a.active::before {
    content: "";
    position: absolute;
    left: -9px;
    top: 7px;
    bottom: 7px;
    width: 3px;
    border-radius: 5px;
    background: var(--orange-500);
}

.sidebar .nav-section,
.sidebar .sidebar-section-title {
    padding: 15px 18px 6px;
    color: #93c5fd;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .09em;
}

/* Browser scrollbar */
.sidebar nav::-webkit-scrollbar,
.sidebar .sidebar-nav::-webkit-scrollbar {
    width: 8px;
}

.sidebar nav::-webkit-scrollbar-track,
.sidebar .sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255,255,255,.05);
}

.sidebar nav::-webkit-scrollbar-thumb,
.sidebar .sidebar-nav::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--blue-600), var(--orange-500));
    border: 2px solid var(--blue-900);
    border-radius: 999px;
}

.sidebar nav::-webkit-scrollbar-thumb:hover,
.sidebar .sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--orange-500);
}

/* Optional Up/Down controls inserted by sidebar-scroll.js */
.sidebar-scroll-controls {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    padding: 9px 12px 11px;
    background: rgba(5, 20, 40, .44);
    border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-scroll-btn {
    min-height: 33px;
    margin: 0;
    padding: 6px 8px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 7px;
    background: rgba(255,255,255,.07);
    color: #dbeafe;
    font-size: 11px;
    font-weight: 800;
}

.sidebar-scroll-btn:hover {
    background: var(--orange-500);
}

.sidebar-scroll-btn:disabled {
    opacity: .35;
    cursor: default;
}

/* Topbar */
.topbar,
header.topbar {
    min-height: 64px;
    padding: 13px 24px;
    background: #fff;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(15, 42, 82, .03);
}

.topbar a,
header.topbar a {
    color: var(--blue-700);
}

/* Generic header should not force auth/public pages dark if inside main-area */
.main-area > header {
    background: #fff;
    color: var(--text);
}

/* Cards */
.card,
.pos-products,
.pos-cart,
.billing-summary-grid .summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.dashboard-grid {
    gap: 16px;
}

.dashboard-grid .card {
    position: relative;
    overflow: hidden;
}

.dashboard-grid .card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--blue-700);
}

.dashboard-grid .card:nth-child(even)::before {
    background: var(--orange-500);
}

.card h3 {
    color: var(--muted);
}

/* Buttons */
button,
.btn,
.quick-actions a {
    background: var(--blue-700);
    color: #fff;
    border-radius: 7px;
    transition: background .15s ease, transform .1s ease;
}

button:hover,
.btn:hover,
.quick-actions a:hover {
    background: var(--blue-800);
}

button:active,
.btn:active,
.quick-actions a:active {
    transform: translateY(1px);
}

.btn-orange,
.btn-accent,
.pos-complete-sale {
    background: var(--orange-500) !important;
}

.btn-orange:hover,
.btn-accent:hover,
.pos-complete-sale:hover {
    background: var(--orange-600) !important;
}

/* Forms */
form {
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

input,
textarea,
select {
    border-color: #cbd5e1;
    background: #fff;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .11);
}

/* Tables */
table {
    border-radius: 9px;
    overflow: hidden;
}

th {
    background: #f1f5f9;
    color: #334155;
}

tbody tr:hover {
    background: var(--blue-50);
}

/* Alerts */
.success {
    border-left: 4px solid #16a34a;
}

.error {
    border-left: 4px solid #dc2626;
}

.alert.warning,
.warning {
    background: var(--orange-50);
    border-left: 4px solid var(--orange-500);
}

/* POS */
.pos-wrapper {
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
    align-items: start;
}

.pos-products {
    border-top: 3px solid var(--blue-700);
}

.pos-cart {
    position: sticky;
    top: 82px;
    border-top: 3px solid var(--orange-500);
}

.product-item {
    border-color: var(--border);
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}

.product-item:hover {
    background: var(--blue-50);
    border-color: #93c5fd;
    box-shadow: 0 5px 16px rgba(37,99,235,.09);
    transform: translateY(-1px);
}

.cart-summary {
    background: #f8fafc;
    border-left: 4px solid var(--orange-500);
}

/* Locked feature - moved OUTSIDE print media block */
.locked-feature {
    opacity: .65;
}

.locked-feature small {
    float: right;
    font-size: 10px;
    text-transform: uppercase;
    color: var(--orange-500);
}

/* Billing */
.billing-summary-grid {
    gap: 16px;
}

.summary-card {
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--blue-700);
}

.summary-card:nth-child(even)::before {
    background: var(--orange-500);
}

.summary-card progress {
    accent-color: var(--blue-700);
}

/* Footer */
.footer {
    background: #fff;
    border-top: 1px solid var(--border);
    color: var(--muted);
    padding: 14px 24px;
}

/* Responsive */
@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pos-wrapper {
        grid-template-columns: 1fr;
    }

    .pos-cart {
        position: static;
    }
}

@media (max-width: 760px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100dvh;
        max-height: 100dvh;
        transform: translateX(-100%);
        transition: transform .22s ease;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .content {
        padding: 16px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .product-list {
        grid-template-columns: 1fr;
    }
}

/* Consolidated print handling */
@media print {
    .sidebar,
    .topbar,
    .footer,
    header,
    nav,
    button,
    .btn,
    .receipt-buttons,
    .no-print,
    .sidebar-scroll-controls {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .content,
    main {
        padding: 0;
    }

    .receipt {
        width: 100%;
        box-shadow: none;
        border: none;
    }
}


/* =========================================================
   Inventory SaaS v1.0 — Final Sidebar Freeze
   ========================================================= */

.sidebar .nav-section {
    margin-top: 7px;
    padding: 13px 18px 6px;
    color: #93c5fd;
    font-size: 9px;
    line-height: 1.2;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .11em;
    user-select: none;
}

.sidebar .nav-section:first-child {
    margin-top: 0;
}

.sidebar-footer {
    flex: 0 0 auto;
    padding: 10px 12px 12px;
    background: rgba(5, 20, 40, .58);
    border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-logout-form {
    margin: 0;
    padding: 0;
    max-width: none;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.sidebar-logout-btn {
    width: 100%;
    min-height: 38px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid rgba(249,115,22,.52);
    border-radius: 8px;
    background: rgba(249,115,22,.10);
    color: #fed7aa;
    font-size: 12px;
    font-weight: 800;
}

.sidebar-logout-btn:hover {
    background: #f97316;
    border-color: #f97316;
    color: #fff;
}

/* Keep upgrade links clearly different from active feature links. */
.sidebar a.locked-feature {
    color: #cbd5e1;
    background: rgba(255,255,255,.035);
}

.sidebar a.locked-feature:hover {
    background: rgba(249,115,22,.13);
    color: #fff;
}

.sidebar a.locked-feature small {
    float: right;
    margin-left: 8px;
    color: #fdba74;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .06em;
}

/*
 * The scroll controls inserted by sidebar-scroll.js sit between
 * the navigation and fixed logout footer.
 */
.sidebar-scroll-controls {
    order: 2;
}

.sidebar-footer {
    order: 3;
}

.sidebar nav,
.sidebar .sidebar-nav {
    order: 1;
}

/* Avoid blue active treatment on locked upgrade links. */
.sidebar a.locked-feature.active::before {
    background: #f97316;
}

@media print {
    .sidebar-footer {
        display: none !important;
    }
}
.report-filter-form {
    width: 100%;
    max-width: none;
}

.report-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.report-filter-actions {
    margin-top: 20px;
}

@media (max-width: 768px) {
    .report-filter-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Global Sidebar Show/Hide
   POS starts expanded workspace; user can restore navigation.
   ========================================================= */
.menu-toggle {
    width: 40px;
    height: 40px;
    margin: 0 12px 0 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    border-radius: 8px;
    background: var(--blue-700);
    color: #fff;
    font-size: 20px;
    line-height: 1;
}

.topbar-left {
    display: flex;
    align-items: center;
    min-width: 0;
}

body.sidebar-collapsed .sidebar {
    width: 0;
    flex-basis: 0;
    transform: translateX(-100%);
    pointer-events: none;
}

.sidebar {
    transition: width .22s ease, flex-basis .22s ease, transform .22s ease;
}

@media (max-width: 760px) {
    body.sidebar-open .sidebar {
        width: 270px;
        flex-basis: 270px;
        transform: translateX(0);
        pointer-events: auto;
    }

    body:not(.sidebar-open) .sidebar {
        transform: translateX(-100%);
        pointer-events: none;
    }
}

/* =========================================================
   POS quantity input visibility / keyboard entry
   Functional usability fix - Inventory SaaS v1.0
   ========================================================= */
.pos-cart #cartTable .pos-qty-input {
    display: block;
    width: 84px;
    min-width: 85px;
    height: 42px;
    margin: 0;
    padding: 8px 10px;
    border: 2px solid #cbd5e1;
    border-radius: 7px;
    background: #ffffff;
    color: #111827;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    opacity: 1;
    -webkit-text-fill-color: #111827;
    caret-color: #111827;
}

.pos-cart #cartTable .pos-qty-input:focus {
    border-color: var(--blue-700);
    background: #ffffff;
    color: #111827;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .11);
    outline: none;
}

.pos-cart #cartTable td:nth-child(2) {
    width: 105px;
    min-width: 105px;
}



/* =========================================================
   Sidebar Full-Width Workspace Fix
   When hidden, main-area/content immediately consume 100%
   of the viewport. When shown, normal 270px sidebar layout returns.
   ========================================================= */
.app-shell {
    width: 100%;
}

.main-area {
    width: auto;
    max-width: none;
    transition: width .22s ease, flex-basis .22s ease;
}

/* Current v2 toggle uses sidebar-hidden. */
body.sidebar-hidden .app-shell {
    width: 100%;
}

body.sidebar-hidden .sidebar {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    flex: 0 0 0 !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    transform: translateX(-100%) !important;
    overflow: hidden !important;
    pointer-events: none;
}

body.sidebar-hidden .main-area {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
}

body.sidebar-hidden .content,
body.sidebar-hidden main {
    width: 100%;
    max-width: none;
}

/* Backward compatibility if sidebar-collapsed still exists anywhere. */
body.sidebar-collapsed .main-area {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
}

/* When navigation is visible, restore the standard application shell. */
body:not(.sidebar-hidden) .sidebar {
    width: 270px;
    min-width: 270px;
    max-width: 270px;
    flex: 0 0 270px;
}

body:not(.sidebar-hidden) .main-area {
    width: auto;
    max-width: none;
    flex: 1 1 auto;
}

/* POS benefits from the extra width rather than retaining old column sizing. */
body.sidebar-hidden .pos-wrapper {
    width: 100%;
    grid-template-columns: minmax(0, 1.15fr) minmax(400px, .85fr);
}

/* On narrower screens preserve the existing one-column POS behavior. */
@media (max-width: 1100px) {
    body.sidebar-hidden .pos-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Mobile sidebar overlays the workspace instead of consuming its width. */
@media (max-width: 760px) {
    body:not(.sidebar-hidden) .sidebar {
        position: fixed;
        width: 270px;
        min-width: 270px;
        max-width: 270px;
        flex-basis: 270px;
    }

    body:not(.sidebar-hidden) .main-area,
    body.sidebar-hidden .main-area {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 100% !important;
    }
}
