:root {
    /* ---------- Brand palette: classic corporate navy + slate gray -------------------------
       Deliberately conventional "business software" coloring - a deep navy blue for primary
       actions/links/focus states and a muted blue-gray for secondary accents, the coloring
       language of traditional ERP suites (SAP, Dynamics) rather than a warmer SaaS palette.
       Every "-primary" Bootstrap utility actually used in this app (text-primary,
       bg-primary-subtle, text-bg-primary, plain links, focus rings) is retinted below via
       Bootstrap 5.3's own --bs-* custom properties; components that hardcode literals instead
       of chaining through --bs-primary (btn-outline-primary, pagination active state,
       form-check-input) get explicit overrides further down, matching this file's existing
       convention. ------------------------------------------------------------------------- */
    --erp-primary: #1f4e79;
    --erp-primary-dark: #163a5c;
    --erp-primary-rgb: 31, 78, 121;
    --erp-primary-subtle: #e8eef5;
    --erp-primary-border-subtle: #b7cbe0;
    --erp-primary-text-emphasis: #123049;
    --erp-accent: #5b7285;
    --erp-accent-dark: #45596a;
    --erp-accent-subtle: #eef1f3;
    --erp-sidebar-width: 260px;
    --erp-sidebar-bg: #1c2b3a;
    --erp-sidebar-bg-hover: #263c4f;
    --erp-success: #12b76a;
    --erp-danger: #f04438;
    --erp-warning: #f79009;
    --erp-info: #0dcaf0;
    --erp-text-muted: #667085;
    --erp-border: #e1e4e8;
    --erp-radius: 0.5rem;
    --erp-radius-sm: 0.35rem;
    --erp-shadow-sm: 0 1px 2px rgba(15, 23, 32, 0.06), 0 1px 3px rgba(15, 23, 32, 0.08);
    --erp-shadow: 0 4px 8px -2px rgba(15, 23, 32, 0.08), 0 2px 4px -2px rgba(15, 23, 32, 0.06);
    --bs-body-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* Backwards-compatible aliases - some inline view styles reference these shorter names. */
    --erp-primary-alias: var(--erp-primary);
    /* ---------- Retint Bootstrap 5.3's own variable-driven utilities ---------- */
    --bs-primary: var(--erp-primary);
    --bs-primary-rgb: var(--erp-primary-rgb);
    --bs-primary-bg-subtle: var(--erp-primary-subtle);
    --bs-primary-border-subtle: var(--erp-primary-border-subtle);
    --bs-primary-text-emphasis: var(--erp-primary-text-emphasis);
    --bs-link-color: var(--erp-primary);
    --bs-link-color-rgb: var(--erp-primary-rgb);
    --bs-link-hover-color: var(--erp-primary-dark);
    --bs-link-hover-color-rgb: 22, 58, 92;
    --bs-focus-ring-color: rgba(var(--erp-primary-rgb), 0.25);
}

/* ---------- Compact density pass (applies globally, every page) -----------------------------
   A deliberate, uniform ~1 notch size reduction across all interactive/text elements so the app
   reads as a dense, professional data-entry tool rather than a spacious marketing-site layout -
   smaller root font-size scales every rem-based Bootstrap measurement down proportionally, and
   the explicit overrides below match Bootstrap's own "-sm" component sizing (form-control-sm/
   form-select-sm/btn-sm) applied to the BASE classes, so every input, label, and button is
   compact everywhere without needing "-sm" added to every single tag across ~100 view files. */
html {
    font-size: 15px;
}

body {
    background-color: #f7f8f8;
    font-family: var(--bs-body-font-family);
    color: #1a2530;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 700;
    letter-spacing: -0.01em;
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ---------- Professional-polish overrides (applied globally, every page) ---------- */

.card {
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius);
    box-shadow: var(--erp-shadow-sm);
}

.card {
    --bs-card-spacer-y: 0.85rem;
    --bs-card-spacer-x: 1rem;
    --bs-card-title-spacer-y: 0.5rem;
}

.card-header {
    border-bottom: 1px solid var(--erp-border);
    font-weight: 600;
    letter-spacing: 0.01em;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

    .card-header.bg-white {
        border-top-left-radius: var(--erp-radius) !important;
        border-top-right-radius: var(--erp-radius) !important;
    }

.btn {
    border-radius: var(--erp-radius-sm);
    font-weight: 500;
}

/* Compact the DEFAULT-sized button only - :not() here keeps .btn-sm/.btn-lg exactly as Bootstrap
   defines them (site.css loads after bootstrap.min.css, so an unscoped .btn override here would
   otherwise win the cascade tie and make .btn-sm buttons bigger than intended, not smaller). */
.btn:not(.btn-sm):not(.btn-lg) {
    padding-top: 0.32rem;
    padding-bottom: 0.32rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--erp-primary);
    border-color: var(--erp-primary);
    box-shadow: 0 1px 2px rgba(var(--erp-primary-rgb), 0.25);
}

    .btn-primary:hover, .btn-primary:focus {
        background: var(--erp-primary-dark);
        border-color: var(--erp-primary-dark);
    }

.btn-outline-primary {
    --bs-btn-color: var(--erp-primary);
    --bs-btn-border-color: var(--erp-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--erp-primary);
    --bs-btn-hover-border-color: var(--erp-primary);
    --bs-btn-focus-shadow-rgb: var(--erp-primary-rgb);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--erp-primary);
    --bs-btn-active-border-color: var(--erp-primary);
    --bs-btn-disabled-color: var(--erp-primary);
    --bs-btn-disabled-border-color: var(--erp-primary);
}

.form-control, .form-select {
    border-radius: var(--erp-radius-sm);
    border-color: #d0d5dd;
}

    .form-control:focus, .form-select:focus {
        border-color: var(--erp-primary);
        box-shadow: 0 0 0 0.2rem rgba(var(--erp-primary-rgb), 0.15);
    }

/* Compact the DEFAULT-sized control only, matching Bootstrap's own form-control-sm/form-select-sm
   padding+font-size exactly - :not() keeps any input already marked -sm/-lg exactly as Bootstrap
   defines it (site.css loads after bootstrap.min.css, so an unscoped override here would win the
   cascade tie and make "-sm" inputs bigger than intended, not smaller). form-select keeps its
   right padding untouched (only top/bottom/left set) so there's still room for its caret icon. */
.form-control:not(.form-control-sm):not(.form-control-lg),
.form-select:not(.form-select-sm):not(.form-select-lg) {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    padding-left: 0.65rem;
    font-size: 0.875rem;
}

.input-group-text {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    font-size: 0.875rem;
    border-radius: var(--erp-radius-sm);
}

.form-label {
    font-size: 0.83rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #344054;
}

.form-check-input:checked {
    background-color: var(--erp-primary);
    border-color: var(--erp-primary);
}

.form-check-input:focus {
    border-color: var(--erp-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--erp-primary-rgb), 0.25);
}

.badge {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.table {
    --bs-table-color: #344054;
    font-size: 0.875rem;
}

    .table thead th {
        text-transform: uppercase;
        font-size: 0.7rem;
        letter-spacing: 0.04em;
        font-weight: 600;
        color: var(--erp-text-muted);
        background-color: #f9fafb;
        border-bottom-width: 1px;
        white-space: nowrap;
    }

    .table > :not(caption) > * > * {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

/* Pagination active state - Bootstrap hardcodes these to its stock blue at the .pagination
   selector level rather than chaining through --bs-primary, so they need an explicit repaint
   (every list page in the app uses this control, so it's a highly visible surface). */
.pagination {
    --bs-pagination-active-bg: var(--erp-primary);
    --bs-pagination-active-border-color: var(--erp-primary);
    --bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(var(--erp-primary-rgb), 0.25);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

/* ---------- ERP admin shell ---------- */
.erp-shell {
    display: flex;
    min-height: 100vh;
}

.erp-sidebar {
    width: var(--erp-sidebar-width);
    flex-shrink: 0;
    background: var(--erp-sidebar-bg);
    color: #aebdc9;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1030;
    transition: transform 0.2s ease-in-out, width 0.2s ease-in-out;
}

.erp-sidebar-search {
    padding: 0.55rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

    .erp-sidebar-search .input-group-text {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.1);
        color: #8fa3b3;
    }

    .erp-sidebar-search .form-control {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.1);
        color: #eaf3f2;
    }

        .erp-sidebar-search .form-control::placeholder {
            color: #75899a;
        }

        .erp-sidebar-search .form-control:focus {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
            box-shadow: none;
        }

.erp-nav-empty {
    padding: 1rem 1.25rem;
    color: #75899a;
    font-size: 0.85rem;
    text-align: center;
}

.erp-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.25rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

    .erp-brand i {
        color: var(--erp-accent);
        font-size: 1.4rem;
        filter: drop-shadow(0 0 6px rgba(var(--erp-primary-rgb), 0.45));
    }

.erp-brand-logo {
    height: 1.6rem;
    max-width: 2.4rem;
    object-fit: contain;
    border-radius: 0.2rem;
    background: #fff;
    padding: 1px;
    flex-shrink: 0;
}

.erp-nav {
    padding: 0.75rem 0;
}

.erp-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .erp-nav-list li a {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.55rem 1.25rem;
        color: #aebdc9;
        text-decoration: none;
        font-size: 0.87rem;
        border-left: 3px solid transparent;
        transition: background-color 0.15s ease-in-out;
    }

        .erp-nav-list li a:hover {
            background-color: var(--erp-sidebar-bg-hover);
            color: #fff;
        }

    .erp-nav-list li.active a {
        background-color: var(--erp-sidebar-bg-hover);
        color: #fff;
        border-left-color: var(--erp-accent);
        font-weight: 600;
    }

    .erp-nav-list i {
        font-size: 1.05rem;
        width: 1.2rem;
        text-align: center;
    }

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

.erp-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: #fff;
    border-bottom: 1px solid var(--erp-border);
    box-shadow: 0 1px 2px rgba(15, 23, 32, 0.04);
    padding: 0.6rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.erp-topbar-title {
    font-weight: 600;
    font-size: 0.98rem;
    flex: 1;
}

.erp-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.erp-content {
    padding: 1.25rem;
    flex: 1;
}

.kpi-card {
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

    .kpi-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--erp-shadow) !important;
    }

.setup-tile {
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    color: inherit;
}

    .setup-tile:hover {
        transform: translateY(-3px);
        box-shadow: 0 0.5rem 1rem rgba(15, 23, 32, 0.1) !important;
    }

@media (max-width: 991.98px) {
    .erp-sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-100%);
    }

        .erp-sidebar.show {
            transform: translateX(0);
        }
}

/* ---------- Mobile-tightened spacing (tablets/phones) ------------------------------------
   The compact desktop pass above already shrinks every control via the smaller root font-size
   and explicit paddings; these two breakpoints trim the surrounding chrome (topbar/content
   gutters) further so a phone screen isn't spending most of its width on padding, and let the
   topbar wrap its action buttons onto a second line instead of squeezing/clipping them. */
@media (max-width: 767.98px) {
    .erp-content {
        padding: 1rem;
    }

    .erp-topbar {
        padding: 0.55rem 1rem;
        gap: 0.5rem;
    }

    .erp-topbar-title {
        font-size: 0.92rem;
    }
}

@media (max-width: 575.98px) {
    .erp-content {
        padding: 0.8rem;
    }

    .card {
        --bs-card-spacer-x: 0.8rem;
    }

    .erp-topbar {
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }

    .erp-topbar-actions {
        flex-wrap: wrap;
        gap: 0.4rem;
        justify-content: flex-end;
    }
}

/* ---------- Sidebar collapse (desktop icon rail) --------------------------------------
   Desktop-only (lg+) - on narrower screens the sidebar is already an overlay drawer (see the
   max-width block above), so a separate "collapsed" rail there would just be confusing. Group
   sub-menus are intentionally suppressed rather than turned into hover-flyouts while collapsed -
   simplest thing that still works: the group icon stays visible (with its name as a native
   tooltip via the title attribute added in SidebarMenu/Default.cshtml), its children are one
   click away again the moment the sidebar is expanded. ------------------------------------- */
@media (min-width: 992px) {
    body.dinv-sidebar-collapsed .erp-sidebar {
        width: 76px;
    }

    body.dinv-sidebar-collapsed .erp-sidebar-search,
    body.dinv-sidebar-collapsed .erp-brand span,
    body.dinv-sidebar-collapsed .erp-nav-list li a span,
    body.dinv-sidebar-collapsed .erp-nav-sublist li a span,
    body.dinv-sidebar-collapsed .erp-nav-group-toggle span,
    body.dinv-sidebar-collapsed .erp-nav-chevron {
        display: none;
    }

    body.dinv-sidebar-collapsed .erp-nav-group > .collapse {
        display: none !important;
    }

    body.dinv-sidebar-collapsed .erp-brand {
        justify-content: center;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    body.dinv-sidebar-collapsed .erp-nav-list li a,
    body.dinv-sidebar-collapsed .erp-nav-group-toggle {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }
}

/* ---------- Auth pages ---------- */
.auth-body {
    background: linear-gradient(160deg, var(--erp-sidebar-bg) 0%, var(--erp-primary-dark) 65%, var(--erp-primary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.auth-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    border: none;
    border-radius: 1rem;
}

/* "Or try a live demo" divider + quick-login cards on the Login page - one click fills the real
   form and submits a real sign-in (see Login.cshtml's inline script), it's not a mocked login. */
.dinv-demo-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--erp-text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

    .dinv-demo-divider::before,
    .dinv-demo-divider::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--erp-border);
    }

.dinv-demo-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.dinv-demo-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: #fff;
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius);
    text-align: left;
    cursor: pointer;
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

    .dinv-demo-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--erp-shadow);
        border-color: var(--erp-primary-border-subtle);
    }

.dinv-demo-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.dinv-demo-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.dinv-demo-title {
    font-weight: 600;
    font-size: 0.92rem;
}

.dinv-demo-arrow {
    font-size: 1.4rem;
    color: var(--erp-text-muted);
}

/* ---------- Grouped / collapsible sidebar nav (Admin / Sales / Reports / Catalog) ---------- */
/* Explicit show/hide (doesn't lean on bootstrap.min.css's .collapse rules alone - the group toggle
   in site.js flips this "show" class itself with plain classList APIs, no Bootstrap JS involved). */
.erp-nav-sublist-wrap.collapse:not(.show),
.erp-nav-group > .collapse:not(.show) {
    display: none;
}

.erp-nav-group > .collapse.show {
    display: block;
}

.erp-nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1.25rem;
    color: #aebdc9;
    text-decoration: none;
    font-size: 0.87rem;
    font-weight: 600;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

    .erp-nav-group-toggle:hover {
        background-color: var(--erp-sidebar-bg-hover);
        color: #fff;
    }

.erp-nav-group.active > .erp-nav-group-toggle {
    color: #fff;
}

.erp-nav-group-toggle i.bi:first-child {
    font-size: 1.05rem;
    width: 1.2rem;
    text-align: center;
}

.erp-nav-chevron {
    font-size: 0.8rem;
    transition: transform 0.2s ease-in-out;
}

.erp-nav-group-toggle.collapsed .erp-nav-chevron {
    transform: rotate(-90deg);
}

.erp-nav-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: rgba(0, 0, 0, 0.18);
}

    .erp-nav-sublist li a {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.48rem 1.25rem 0.48rem 2.75rem;
        color: #8fa3b3;
        text-decoration: none;
        font-size: 0.83rem;
        border-left: 3px solid transparent;
        transition: background-color 0.15s ease-in-out;
    }

        .erp-nav-sublist li a:hover {
            background-color: var(--erp-sidebar-bg-hover);
            color: #fff;
        }

    .erp-nav-sublist li.active a {
        background-color: var(--erp-sidebar-bg-hover);
        color: #fff;
        border-left-color: var(--erp-accent);
        font-weight: 600;
    }

    .erp-nav-sublist i {
        font-size: 0.95rem;
        width: 1.1rem;
        text-align: center;
    }

/* ---------- Barcode label rendering (Barcode Generator page) ---------- */
/* The SVG's intrinsic width grows with the barcode's character count (CODE128), which can
   exceed the fixed-width label card. Scale it down to fit while keeping its aspect ratio
   (the viewBox makes this a clean proportional shrink, bars and text scale together). */
.print-label svg {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0.15rem auto 0;
}

/* Every line of text on a printed label reads bold and pure black - regardless of what Bootstrap
   utility classes (e.g. .text-muted/.small) are also present on the element - so the label stays
   legible on low-contrast/low-quality label printers. Kept !important since .text-muted itself
   is !important in Bootstrap 5.3 and would otherwise win. */
.print-label .barcode-business-unit,
.print-label .barcode-product-name,
.print-label .barcode-brand-name,
.print-label .barcode-price {
    color: #000 !important;
    font-weight: 700 !important;
}

/* Business unit name reads as a small, bold, uppercase eyebrow line above the product name. */
.print-label .barcode-business-unit {
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Product name prints a touch bigger than Bootstrap's "small" (0.875rem) so it reads clearly
   as the label's main line, while staying compact enough to avoid wrapping on the fixed-width card. */
.print-label .barcode-product-name {
    font-size: 0.95rem;
}

/* Price (incl. the Taka symbol from dinvMoney()) prints slightly larger and bold so it's the
   second thing a cashier's eye lands on after the barcode itself. Pulled up with a negative
   margin to eat into the barcode graphic's own baked-in bottom padding (the SVG reserves a
   little vertical room below the digits even with render margin:0), tightening the gap further. */
.print-label .barcode-price {
    font-size: 1.15rem;
    margin-top: -6px;
}

/* ---------- Sales Invoice (Sales/Details) print layout ---------------------------------------
   A standard letterhead-style invoice: logo + business name/address top-left, "INVOICE" title +
   invoice no./date/status top-right, a divider rule, a two-column "Billed To / Served By" strip,
   the existing line-item table (retinted here rather than restructured, to keep the Razor markup
   simple), and a right-aligned totals block. Used for both the on-screen card and the printed
   output (window.print() on Sales/Details prints this same markup - see the @media print block
   below for the print-only touch-ups). Logo is invoice-only by design - not shown on the POS
   receipt below (see printPosReceipt()/the #posReceipt markup, which never references a logo). */
.invoice-doc {
    font-family: var(--bs-body-font-family);
}

.invoice-logo {
    max-height: 56px;
    max-width: 150px;
    object-fit: contain;
}

.invoice-brand-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--erp-primary-dark);
    letter-spacing: 0.01em;
}

.invoice-brand-address {
    font-size: 0.8rem;
    color: var(--erp-text-muted);
    max-width: 280px;
}

.invoice-doc-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #111827;
}

.invoice-meta {
    font-size: 0.82rem;
    color: var(--erp-text-muted);
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
}

    .invoice-meta strong {
        color: #111827;
        font-weight: 600;
    }

.invoice-divider {
    border: 0;
    border-top: 2px solid var(--erp-primary);
    opacity: 1;
    margin: 1rem 0;
}

.invoice-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--erp-text-muted);
    margin-bottom: 0.15rem;
}

.invoice-table thead th {
    background: var(--erp-primary-subtle);
    border-bottom: 2px solid var(--erp-primary) !important;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--erp-primary-text-emphasis);
    font-weight: 700;
}

.invoice-table td,
.invoice-table th {
    border-color: var(--erp-border);
    vertical-align: middle;
}

.invoice-table tfoot td {
    border: none;
}

.invoice-grand-total td {
    border-top: 2px solid var(--erp-primary) !important;
    font-size: 1.05rem;
}

.invoice-footer-note {
    text-align: center;
    color: var(--erp-text-muted);
    font-size: 0.8rem;
    margin-top: 1.75rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--erp-border);
}

/* ---------- POS receipt (thermal printer) rendering ---------- */
/* Width must match the POS_RECEIPT_WIDTH_MM constant in site.js - keep both in sync if you ever
   change your printer's paper size (58mm and 80mm are the two common thermal roll widths).
   box-sizing: border-box means the padding below is INSIDE this width, so the rendered content
   never exceeds the physical roll width even if the printer's real printable area is a hair
   narrower than the nominal paper size - see the comment on printPosReceipt() in site.js for why
   that matters (it's what was causing receipts to print clipped/tiny before). */
.pos-receipt {
    width: 80mm;
    box-sizing: border-box;
    padding: 0 3mm;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    margin: 0 auto;
}

    /* Applied by printPosReceipt('a4') - the fixed 80mm width above is correct for a thermal roll
   (where the page itself is 80mm), but on a standard A4 page it leaves the receipt stranded in a
   narrow strip in the middle of the sheet. This fills the full printable width instead. */
    .pos-receipt.pos-receipt-full-width {
        width: 100%;
        box-sizing: border-box;
        padding: 0;
        font-size: 14px;
    }

    /* A "label ... value" line (e.g. product name vs. its line total). The label truncates instead of
   wrapping/overflowing so a long product name can never push the price past the receipt's right
   edge - previously an overflowing line like this was the other half of the "prints half the
   receipt" symptom, independent of the paper-width mismatch. */
    .pos-receipt .pos-receipt-line {
        display: flex;
        justify-content: space-between;
        gap: 4px;
    }

        .pos-receipt .pos-receipt-line .pos-receipt-label {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .pos-receipt .pos-receipt-line .pos-receipt-value {
            flex-shrink: 0;
            white-space: nowrap;
        }

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

    .erp-main, .erp-content {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Each .print-label is printed as its own physical sticker at the exact width x height (inches)
       typed into the Width (in)/Height (in) inputs - fitLabelToBox()/printBarcodeLabels() in site.js
       lock every card's own inline width/height/transform to that box right before window.print(),
       and page-break-after (below) puts each one on its own page instead of tiling them, since a
       fixed height means these are individual die-cut labels rather than a running roll. No
       flex-wrap/gap needed here for that reason - the actual sizing lives entirely in the per-card
       inline styles site.js sets, not in this stylesheet.
       (If JS is somehow disabled, .print-label falls back to its normal on-screen size here - printing
       still works, it just won't be pinned to the requested sticker size.) */
    .print-label {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px dashed #999 !important;
        box-shadow: none !important;
    }

        .print-label:not(:last-of-type) {
            page-break-after: always;
        }

        .print-label .btn {
            display: none !important;
        }

    /* Sales invoice (Sales/Details, plain window.print()): drop the on-screen card chrome so the
       printed page reads as a flat document rather than a UI panel, and force color printing for the
       status badge and business unit logo - Chrome/Edge default to "Background graphics" off, which
       would otherwise silently drop the badge's background color and (in some engines) the <img>
       logo too. */
    .invoice-card {
        box-shadow: none !important;
        border: none !important;
    }

    .invoice-doc .badge,
    .invoice-logo {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        color-adjust: exact;
    }
}

/* ---------- Public marketing pages (Home/Index, Home/About) ------------------------------
   Shared building blocks so the landing/about pages read as one distinctive, cohesive brand
   rather than a stock Bootstrap template - eyebrow labels instead of pill badges, a subtle
   dot-grid texture instead of blurry gradient orbs, and a warm amber accent used sparingly for
   emphasis (numbers, underlines) against the deep teal brand color. ------------------------- */
.dinv-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

    .dinv-eyebrow .dinv-eyebrow-rule {
        display: inline-block;
        width: 28px;
        height: 2px;
        background: var(--erp-accent);
        border-radius: 2px;
    }

.dinv-dotgrid {
    background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1.5px, transparent 1.5px);
    background-size: 18px 18px;
}

.dinv-hero {
    background: linear-gradient(155deg, var(--erp-sidebar-bg) 0%, var(--erp-primary-dark) 55%, var(--erp-primary) 100%);
    color: #eaf3f2;
}

    .dinv-hero .text-muted-hero {
        color: rgba(234, 243, 242, 0.78) !important;
    }

.dinv-stat-strip {
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius);
    background: #fff;
}

@media (min-width: 768px) {
    .dinv-stat-strip .dinv-stat + .dinv-stat {
        border-left: 1px solid var(--erp-border);
    }
}

.dinv-stat {
    padding: 0.5rem 1rem;
}

.dinv-stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--erp-primary);
    letter-spacing: -0.02em;
}

.dinv-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.dinv-steps {
    border-top: 1px solid var(--erp-border);
    border-bottom: 1px solid var(--erp-border);
}

.dinv-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--erp-primary);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dinv-quote {
    border-left: 3px solid var(--erp-accent);
    padding-left: 1.5rem;
    text-align: left !important;
}

.dinv-cta {
    background: linear-gradient(155deg, var(--erp-sidebar-bg) 0%, var(--erp-primary-dark) 55%, var(--erp-primary) 100%);
    color: #eaf3f2;
}

.dinv-pillar-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin: 0 auto 0.75rem;
    background: var(--erp-primary-subtle);
    color: var(--erp-primary);
}

/* ---------- Public storefront product grid (Home/Products) -------------------------------
   Was plain stock Bootstrap cards with zero custom styling - now shares the same teal/amber
   brand language as the rest of the public site (dinv-eyebrow, dinv-pillar-icon empty state)
   plus its own small set of card/image treatments: a soft hover lift, a subtle image zoom, and
   a floating category pill so the grid reads as a real storefront, not an admin list. --------- */
.dinv-shop-toolbar {
    border-radius: var(--erp-radius);
}

.dinv-product-card {
    overflow: hidden;
    transition: transform 0.18s ease-in-out, box-shadow 0.18s ease-in-out, border-color 0.18s ease-in-out;
}

    .dinv-product-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--erp-shadow) !important;
        border-color: var(--erp-primary-border-subtle);
    }

.dinv-product-image {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f3f5f4;
}

    .dinv-product-image img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.4s ease-in-out;
    }

.dinv-product-card:hover .dinv-product-image img {
    transform: scale(1.06);
}

.dinv-product-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b6bdbc;
    font-size: 2.25rem;
}

.dinv-product-badge {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    background: rgba(255, 255, 255, 0.92);
    color: var(--erp-primary-text-emphasis);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    box-shadow: var(--erp-shadow-sm);
}

.dinv-product-brand {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--erp-accent-dark);
    margin-bottom: 0.15rem;
}

.dinv-product-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dinv-product-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dinv-product-price {
    border-top: 1px dashed var(--erp-border);
}

/* ---------- Our Clients (Home/Products) ---------------------------------------------------
   A short trust strip on the public storefront listing real shops running on DInventory - each
   logo sits on a plain card that lifts slightly on hover, sharing the same eyebrow label and
   teal/amber brand language as the rest of the public site. ---------------------------------- */
.dinv-clients-section {
    border-top: 1px solid var(--erp-border);
}

.dinv-client-card {
    background: #fff;
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius);
    padding: 1.5rem 1rem;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: transform 0.18s ease-in-out, box-shadow 0.18s ease-in-out, border-color 0.18s ease-in-out;
}

    .dinv-client-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--erp-shadow);
        border-color: var(--erp-primary-border-subtle);
    }

    .dinv-client-card img {
        max-width: 100%;
        height: 56px;
        object-fit: contain;
        border-radius: 0.5rem;
    }

.dinv-client-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--erp-primary-text-emphasis);
}

/* Bigger variant used on the Our Clients page (Home/Products) now that it's the whole point of
   the page rather than a strip underneath a product grid. */
.dinv-client-card-lg {
    padding: 2.75rem 1.5rem;
}

    .dinv-client-card-lg img {
        height: 88px;
    }

    .dinv-client-card-lg .dinv-client-name {
        font-size: 1rem;
    }

.dinv-quotes-section {
    border-top: 1px solid var(--erp-border);
}

/* ---------- Admin User Guide (Home/Guide) -------------------------------------------------
   Deliberately minimal: no hero banner, just a plain heading and a single vertical timeline of
   6 steps (Bangla content - the guide is written for the shop's own admin/staff, not as public
   marketing copy). ".dinv-guide-bn" nudges the font stack toward faces with solid Bengali glyph
   coverage before falling back to the app's normal system-font stack, since the default
   Bootstrap font list is Latin-only and would otherwise fall back to whatever generic font the
   OS happens to substitute. ------------------------------------------------------------------ */
.dinv-guide-bn {
    font-family: "Nirmala UI", "Vrinda", "Noto Sans Bengali", var(--bs-body-font-family);
}

.dinv-guide-timeline {
    position: relative;
    padding-left: 4.75rem;
}

    .dinv-guide-timeline::before {
        content: "";
        position: absolute;
        left: 1.75rem;
        top: 0.5rem;
        bottom: 0.5rem;
        width: 2px;
        background: var(--erp-border);
    }

.dinv-guide-timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

    .dinv-guide-timeline-item:last-child {
        padding-bottom: 0;
    }

.dinv-guide-timeline-number {
    position: absolute;
    left: -4.75rem;
    top: 0;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--erp-primary);
    color: #fff;
    font-weight: 700;
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 4px #fff;
}

/* Step 6's report list (Sales/Purchase History/Due Bill/Expense/etc.) - a compact numbered
   sub-list inside the timeline item, one notch smaller/quieter than the main timeline steps. */
.dinv-guide-sublist {
    padding-left: 1.25rem;
    font-size: 0.95rem;
}

    .dinv-guide-sublist li {
        margin-bottom: 0.35rem;
    }

        .dinv-guide-sublist li:last-child {
            margin-bottom: 0;
        }

/* ---- Number input spinner removal ---------------------------------------- */
/* Every <input type="number"> across the app (quantities, prices, discounts, label width/height in
   mm, etc.) keeps type="number" - so the numeric keyboard on mobile, paste/typed-character
   validation, and any min/max/step attributes on the element all keep working exactly as before -
   only the little up/down spinner arrow control is hidden. Users kept nudging that spinner by
   accident (e.g. a stray scroll or click) and silently changing a typed value without noticing;
   removing just the arrows (not the type itself) fixes that while changing nothing about validation.
   Chrome/Edge/Safari (WebKit/Blink) render the spinner as inner/outer pseudo-elements that need
   -webkit-appearance: none directly; Firefox instead keys off -moz-appearance: textfield on the
   input itself - both are required, neither alone covers every browser this app is used from. */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ---- Searchable <select> filter dropdowns (see site.js "dinv-searchable-select") ---------------- */
.dinv-searchable-select {
    position: relative;
}

.dinv-ss-menu {
    position: absolute;
    z-index: 1055;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 2px;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}

.dinv-ss-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: .375rem .75rem;
    border: 0;
    background: none;
    font-size: .8125rem;
}

    .dinv-ss-option:hover,
    .dinv-ss-option:focus {
        background: #f1f3f5;
    }

.dinv-ss-option-all {
    font-style: italic;
    color: #6c757d;
    border-bottom: 1px solid #eee;
}

.dinv-ss-empty {
    padding: .375rem .75rem;
    font-size: .8125rem;
    color: #6c757d;
}

/* ---------- Login page: two independent "Sign In" + "Try a Live Demo" cards ----------
   2026-07-27, explicit user request: the demo accounts used to just sit below the login form as an
   afterthought - now they're two fully separate, equally prominent cards side by side on wider
   screens, each with its own shadow/rounded corners rather than both living inside one shared
   "master" box (see _LoginLayout.cshtml's wideAuthCard branch - no wrapping auth-card at all here).
   A light "Sign In" card sits next to a dark brand-gradient "Try a Live Demo" card, mirroring
   auth-body's own page background so the whole screen reads as one deliberate design, and they
   stack cleanly full-width on phones instead of squeezing into a second column. */
/* The brand header and status alert sit directly on the page background (not inside a card) when
   split, so auth-body itself needs to stack them + the two-card row vertically and still center
   the whole group in the viewport, same as the single-card case did with align-items alone. */
.auth-body--split {
    flex-direction: column;
    justify-content: center;
    padding: 2rem 1rem;
}

.dinv-auth-header {
    margin-bottom: 1.5rem;
}

.dinv-auth-status {
    width: 100%;
    max-width: 980px;
    margin: 0 auto 1.25rem;
}

/* No shared wrapper card around the two panels - auth-wrapper itself (already used to center the
   single card on every other auth page) does double duty as the flex row for these two independent
   sibling divs when split, so Login.cshtml doesn't need an extra "master" div of its own. */
.auth-wrapper--split {
    max-width: 980px;
    padding: 0;
    gap: 1.75rem;
    flex-wrap: wrap;
    align-items: stretch;
}

.auth-wrapper--split > .dinv-auth-alert {
    flex: 1 1 100%;
    align-self: flex-start;
    margin: 0;
}

.dinv-login-panel {
    flex: 1 1 320px;
    min-width: 0;
    border-radius: 1rem;
    padding: 1.85rem;
}

.dinv-login-panel-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}

.dinv-login-panel-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.dinv-login-panel-subtitle {
    font-size: 0.85rem;
    color: var(--erp-text-muted);
    margin-bottom: 1.1rem;
}

/* Sign In panel: a plain, crisp white card - deliberately quiet so the form itself is what draws
   the eye, with the demo panel next to it doing the "notice me" work instead. */
.dinv-login-panel--primary {
    background: #fff;
    border: 1px solid var(--erp-border);
    box-shadow: var(--erp-shadow);
}

    .dinv-login-panel--primary .dinv-login-panel-icon {
        background: var(--erp-primary-subtle);
        color: var(--erp-primary);
    }

/* Demo panel: the same navy brand gradient as the page background behind the card (auth-body),
   so it reads as an intentional "spotlight" rather than a mismatched insert - plus two soft blurred
   circles for a touch of depth/texture without needing any image assets. Glassmorphism demo cards
   (semi-transparent + blurred) sit on top so they still read clearly against the gradient. */
.dinv-login-panel--demo {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(155deg, var(--erp-sidebar-bg) 0%, var(--erp-primary-dark) 55%, var(--erp-primary) 100%);
    color: #eaf3f2;
    box-shadow: var(--erp-shadow);
}

    .dinv-login-panel--demo::before,
    .dinv-login-panel--demo::after {
        content: "";
        position: absolute;
        z-index: -1;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.06);
    }

    .dinv-login-panel--demo::before {
        width: 200px;
        height: 200px;
        top: -70px;
        right: -70px;
    }

    .dinv-login-panel--demo::after {
        width: 150px;
        height: 150px;
        bottom: -60px;
        left: -50px;
        background: rgba(255, 255, 255, 0.05);
    }

    .dinv-login-panel--demo .dinv-login-panel-icon {
        background: rgba(255, 255, 255, 0.16);
        color: #fff;
    }

    .dinv-login-panel--demo .dinv-login-panel-subtitle {
        color: rgba(234, 243, 242, 0.78);
    }

    .dinv-login-panel--demo code {
        color: #fff;
        background: rgba(255, 255, 255, 0.16);
    }

    .dinv-login-panel--demo .dinv-demo-list {
        position: relative;
        z-index: 1;
    }

    .dinv-login-panel--demo .dinv-demo-card {
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.18);
        -webkit-backdrop-filter: blur(6px);
        backdrop-filter: blur(6px);
    }

        .dinv-login-panel--demo .dinv-demo-card:hover {
            background: rgba(255, 255, 255, 0.16);
            border-color: rgba(255, 255, 255, 0.32);
            box-shadow: 0 10px 22px rgba(6, 14, 23, 0.35);
        }

    .dinv-login-panel--demo .dinv-demo-icon {
        box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22);
    }

    .dinv-login-panel--demo .dinv-demo-title {
        color: #fff;
    }

    .dinv-login-panel--demo .dinv-demo-arrow {
        color: rgba(234, 243, 242, 0.6);
    }

@media (max-width: 767.98px) {
    .auth-wrapper--split {
        gap: 1.25rem;
    }

    .dinv-login-panel {
        padding: 1.5rem;
    }
}
