/* ==================================================================
   Platform design system — premium SaaS shell
   ================================================================== */
:root {
  --np-sidebar-bg: #0f172a;
  --np-sidebar-fg: #cbd5e1;
  --np-sidebar-active: #1e293b;
  --np-accent: #0d6efd;
  --np-accent-soft: #e7f1ff;
  --np-teal: #0ea5a4;
  --np-green: #16a34a;
  --np-amber: #d97706;
  --np-red: #dc2626;
  --np-bg: #f4f6fa;
  --np-card-border: #e7eaf0;
  --np-radius: 0.75rem;
  --nexa-navy: #081a33;
  --nexa-navy-2: #102a4c;
  --nexa-blue: #1f7aff;
  --nexa-blue-2: #49a3ff;
  --nexa-soft-bg: #f5f8fc;
  --nexa-card-bg: #ffffff;
  --nexa-border: #dfe7f1;
  --nexa-text: #102033;
  --nexa-muted: #66758a;
  --nexa-success: #149b61;
  --nexa-warning: #d88a10;
  --nexa-danger: #d93245;
  --nexa-shadow: 0 1px 2px rgba(8, 26, 51, .04), 0 12px 32px -24px rgba(8, 26, 51, .38);
  --nexa-shadow-hover: 0 8px 28px -18px rgba(8, 26, 51, .32);
  --nexa-ring: 0 0 0 .22rem rgba(31, 122, 255, .16);
}

html, body { height: 100%; }
body.app-body {
  background: var(--np-bg);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: .925rem;
}

/* ---------------- Sidebar ---------------- */
.np-sidebar {
  width: 248px;
  min-height: 100vh;
  background: var(--np-sidebar-bg);
  color: var(--np-sidebar-fg);
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease;
}
.np-sidebar .brand {
  padding: 1rem 1.25rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .3px;
  display: flex; align-items: center; gap: .6rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.np-sidebar .brand .logo-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--np-accent), var(--np-teal));
  box-shadow: 0 0 0 4px rgba(13,110,253,.25);
}
.np-sidebar .nav-section {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .12em;
  color: #64748b; padding: 1rem 1.25rem .35rem;
}
.np-sidebar .nav-link {
  color: var(--np-sidebar-fg);
  padding: .5rem 1.25rem;
  display: flex; align-items: center; gap: .65rem;
  font-size: .875rem;
  border-left: 3px solid transparent;
}
.np-sidebar .nav-link i { font-size: 1rem; width: 1.1rem; text-align: center; }
.np-sidebar .nav-link:hover { background: var(--np-sidebar-active); color: #fff; }
.np-sidebar .nav-link.active {
  background: var(--np-sidebar-active);
  color: #fff;
  border-left-color: var(--np-accent);
}
.np-sidebar .sidebar-scroll { overflow-y: auto; flex: 1; padding-bottom: 1rem; }
.np-sidebar .sidebar-scroll::-webkit-scrollbar { width: 6px; }
.np-sidebar .sidebar-scroll::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

/* ---------------- Main area ---------------- */
.np-main { margin-left: 248px; min-height: 100vh; display: flex; flex-direction: column; }
.np-topbar {
  background: #fff;
  border-bottom: 1px solid var(--np-card-border);
  padding: .55rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 1030;
}
.np-content { padding: 1.25rem; flex: 1; }

@media (max-width: 991.98px) {
  .np-sidebar { transform: translateX(-100%); }
  .np-sidebar.show { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .np-main { margin-left: 0; }
}

/* ---------------- Cards / KPI ---------------- */
.card { border: 1px solid var(--np-card-border); border-radius: var(--np-radius);
        box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: transparent; border-bottom: 1px solid var(--np-card-border);
               font-weight: 600; }
.kpi-card { transition: box-shadow .15s ease, transform .15s ease; }
.kpi-card:hover { box-shadow: 0 6px 18px rgba(16,24,40,.08); transform: translateY(-1px); }
.kpi-card .kpi-label { font-size: .75rem; color: #64748b; text-transform: uppercase;
                       letter-spacing: .06em; }
.kpi-card .kpi-value { font-size: 1.45rem; font-weight: 700; color: #0f172a; }
.kpi-card .kpi-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}

/* ---------------- Tables ---------------- */
.table thead th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .07em;
  color: #64748b; background: #f8fafc; border-bottom: 1px solid var(--np-card-border);
  white-space: nowrap;
}
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background: #f8fafd; }

/* ---------------- Badges ---------------- */
.badge-status { font-weight: 600; padding: .35em .7em; border-radius: 999px; }
.bs-completed, .bs-active, .bs-approved, .bs-received, .bs-paid, .bs-open
  { background: #dcfce7; color: #166534; }
.bs-draft, .bs-held, .bs-order, .bs-pending, .bs-submitted
  { background: #e2e8f0; color: #334155; }
.bs-credit, .bs-partially_paid, .bs-partially_received, .bs-grace, .bs-trial, .bs-review
  { background: #fef3c7; color: #92400e; }
.bs-voided, .bs-cancelled, .bs-rejected, .bs-suspended, .bs-expired, .bs-past_due
  { background: #fee2e2; color: #991b1b; }
.bs-partially_returned, .bs-fully_returned, .bs-dispatched, .bs-closed
  { background: #dbeafe; color: #1e40af; }
.bs-in_production { background: #e0e7ff; color: #3730a3; }
.bs-ready { background: #dcfce7; color: #166534; }
.bs-delivered { background: #d1fae5; color: #065f46; }

/* ---------------- POS ---------------- */
.pos-page {
  height: calc(100vh - 72px - 2.5rem);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pos-header-strip { flex-shrink: 0; }
.pos-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.pos-products-pane {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.pos-products {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: .25rem;
}
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
            gap: .6rem; }
.pos-product-card {
  background: #fff; border: 1px solid var(--np-card-border); border-radius: .6rem;
  padding: .6rem; cursor: pointer; text-align: center; user-select: none;
  transition: border-color .1s ease, box-shadow .1s ease;
}
.pos-product-card:hover { border-color: var(--np-accent); box-shadow: 0 2px 8px rgba(13,110,253,.15); }
.pos-product-card .pp-name { font-size: .8rem; font-weight: 600; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.4em; }
.pos-product-card .pp-price { color: var(--np-accent); font-weight: 700; font-size: .85rem; }
.pos-product-card .pp-stock { font-size: .7rem; color: #64748b; }
.pos-cart { background: #fff; border: 1px solid var(--np-card-border);
            border-radius: var(--np-radius); display: flex; flex-direction: column;
            min-height: 0; overflow: hidden; }
.pos-cart > .border-bottom { flex-shrink: 0; }
.pos-cart-items {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.pos-cart-items .cart-row { border-bottom: 1px solid #f1f5f9; padding: .5rem .75rem; }
.pos-totals {
  border-top: 2px solid var(--np-card-border);
  padding: .75rem;
  flex-shrink: 0;
  background: #fff;
  position: sticky;
  bottom: 0;
  z-index: 2;
}
.btn-pos-pay { font-size: 1.15rem; font-weight: 700; padding: .8rem; }
.pos-cat-pill { white-space: nowrap; }
@media (max-width: 991.98px) {
  .pos-page { height: calc(100vh - 72px - 2.5rem); }
  .pos-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(180px, .9fr) minmax(300px, 1.1fr);
  }
  .pos-cart { position: static; max-height: none; }
}
@media (max-width: 575.98px) {
  .pos-page { height: calc(100vh - 64px - 1.5rem); }
  .pos-shell {
    gap: .75rem;
    grid-template-rows: minmax(170px, .75fr) minmax(330px, 1.25fr);
  }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
}

/* ---------------- Misc ---------------- */
.page-title { font-size: 1.25rem; font-weight: 700; color: #0f172a; margin: 0; }
.empty-state { text-align: center; padding: 3rem 1rem; color: #64748b; }
.empty-state i { font-size: 2.6rem; opacity: .4; }
.avatar-sm {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--np-accent-soft); color: var(--np-accent);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.form-label { font-weight: 600; font-size: .82rem; color: #334155; }
.required-star::after { content: " *"; color: var(--np-red); }
a { text-decoration: none; }
.cursor-pointer { cursor: pointer; }
.w-1 { width: 1%; }
.notification-dot {
  position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px;
  background: var(--np-red); color: #fff; font-size: .65rem; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ---------------- Premium dashboard ---------------- */
.np-content.dash-bg {
  background:
    radial-gradient(1100px 380px at 8% -10%, rgba(13,110,253,.10), transparent 60%),
    radial-gradient(900px 320px at 95% -5%, rgba(14,165,164,.10), transparent 55%),
    var(--np-bg);
}
.kpi-pro {
  position: relative;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 1rem;
  background: linear-gradient(165deg, rgba(255,255,255,.92), rgba(255,255,255,.72));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 22px -12px rgba(16,24,40,.14);
  transition: transform .18s ease, box-shadow .18s ease;
  overflow: hidden;
}
.kpi-pro:hover { transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(16,24,40,.06), 0 18px 34px -14px rgba(16,24,40,.22); }
.kpi-pro::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--kpi-accent, linear-gradient(90deg, #0d6efd, #0ea5a4));
}
.kpi-pro .kpi-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
/* Chart.js with maintainAspectRatio:false REQUIRES a positioned,
   fixed-height container — a bare canvas grows unbounded. */
.kpi-pro .spark { position: relative; height: 38px; margin-top: .4rem; }
.kpi-pro .spark canvas { position: absolute; inset: 0;
                         width: 100% !important; height: 100% !important; }
.trend-badge {
  font-size: .72rem; font-weight: 700; border-radius: 999px;
  padding: .15em .55em; display: inline-flex; align-items: center; gap: .15rem;
}
.trend-up { background: #dcfce7; color: #15803d; }
.trend-down { background: #fee2e2; color: #b91c1c; }
.trend-flat { background: #e2e8f0; color: #475569; }
.widget-card { border-radius: 1rem; }
.widget-card .list-group-item { border-color: #f1f5f9; padding: .55rem 1rem; }
.widget-card .card-header { font-size: .8rem; text-transform: uppercase;
  letter-spacing: .06em; color: #64748b; border-bottom: 1px solid #eef2f7; }
.chart-card { border-radius: 1rem; }
.chart-card .card-header { border-bottom: 1px solid #eef2f7; }

/* ---------------- Subscription status badges (platform admin) ---------- */
.sub-badge {
  display: inline-block; font-weight: 700; font-size: .72rem;
  padding: .25em .7em; border-radius: 999px; white-space: nowrap;
  letter-spacing: .02em;
}
.sub-trial      { background: #fef9c3; color: #854d0e; }   /* yellow */
.sub-active     { background: #dcfce7; color: #166534; }   /* green */
.sub-expiring   { background: #ffedd5; color: #9a3412; }   /* orange */
.sub-expired    { background: #fee2e2; color: #b91c1c; }   /* red */
.sub-suspended  { background: #7f1d1d; color: #fff; }      /* dark red */
.sub-grace      { background: #e0e7ff; color: #3730a3; }

/* Support-mode banner */
.support-banner {
  background: linear-gradient(90deg, #b45309, #d97706);
  color: #fff; padding: .5rem 1rem; display: flex; align-items: center;
  gap: .75rem; font-weight: 600; position: sticky; top: 0; z-index: 1060;
}
.support-banner .btn { --bs-btn-padding-y: .15rem; }

/* Skeleton loaders */
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skeleton { position: relative; overflow: hidden; background: #e9eef5;
            border-radius: 6px; min-height: 1em; }
.skeleton::after { content: ""; position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  animation: shimmer 1.3s infinite; }

/* ---------------- Reports ---------------- */
.report-table { table-layout: auto; }
.report-table th {
  line-height: 1.15;
  padding: .55rem .6rem;
  white-space: normal;
  overflow-wrap: anywhere;
}
.report-table td {
  padding: .5rem .6rem;
  vertical-align: middle;
}
.report-table .report-num {
  font-variant-numeric: tabular-nums;
}
.report-table-wide {
  min-width: 1040px;
}
.report-table-sales_summary {
  min-width: 980px;
  table-layout: fixed;
}
.report-table-sales_summary .report-col-date { width: 110px; }
.report-table-sales_summary .report-col-invoice { width: 116px; }
.report-table-sales_summary .report-col-money { width: 112px; }
.report-table-sales_summary .report-col-money-sm { width: 92px; }
.report-table-sales_summary .report-col-receivable { width: 126px; }
.report-table-sales_summary th:nth-child(2),
.report-table-sales_summary td:nth-child(2) {
  white-space: nowrap;
}
.report-table-sales_summary th:nth-child(n+3),
.report-table-sales_summary td:nth-child(n+3),
.report-table-sales_summary tfoot td:nth-child(n+3) {
  text-align: right;
}
.report-table-sales_summary th:nth-child(7) {
  white-space: normal;
}

/* ==================================================================
   NexaPOS commercial SaaS polish
   Screen-only refinements for the app shell and Bootstrap primitives.
   ================================================================== */
@media screen {
  body.app-body {
    background:
      radial-gradient(880px 320px at 0% -14%, rgba(31, 122, 255, .10), transparent 62%),
      linear-gradient(180deg, #f8fbff 0%, var(--nexa-soft-bg) 45%, #f4f7fb 100%);
    color: var(--nexa-text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  .np-sidebar {
    background:
      linear-gradient(180deg, rgba(23, 49, 83, .86), transparent 28%),
      linear-gradient(180deg, var(--nexa-navy) 0%, #071426 100%);
    box-shadow: inset -1px 0 0 rgba(255,255,255,.06), 10px 0 34px -30px rgba(8, 26, 51, .9);
  }
  .np-sidebar .brand {
    padding: 1.05rem 1.2rem;
    border-bottom-color: rgba(255,255,255,.09);
  }
  .np-sidebar .brand .logo-dot {
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, var(--nexa-blue), #57d5ff);
    box-shadow: 0 0 0 4px rgba(31, 122, 255, .18), 0 0 24px rgba(73, 163, 255, .55);
  }
  .np-sidebar .nav-section {
    color: rgba(203, 213, 225, .62);
    font-weight: 700;
  }
  .np-sidebar .nav-link {
    margin: 1px .65rem;
    padding: .58rem .72rem;
    border-left: 0;
    border-radius: 10px;
    font-weight: 600;
    color: rgba(226, 232, 240, .82);
    transition: background .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
  }
  .np-sidebar .nav-link:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
    transform: translateX(2px);
  }
  .np-sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(31, 122, 255, .25), rgba(31, 122, 255, .08));
    color: #fff;
    box-shadow: inset 3px 0 0 var(--nexa-blue), 0 10px 24px -22px rgba(73, 163, 255, .95);
  }
  .np-sidebar .nav-link.active i { color: #8fc5ff; }

  .np-topbar {
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: rgba(208, 218, 231, .82);
    box-shadow: 0 10px 30px -28px rgba(8, 26, 51, .45);
  }
  .np-content { padding: 1.45rem; }
  .page-title {
    color: var(--nexa-navy);
    letter-spacing: -.01em;
  }

  .card {
    background: var(--nexa-card-bg);
    border-color: var(--nexa-border);
    border-radius: 14px;
    box-shadow: var(--nexa-shadow);
  }
  .card-header {
    padding: .88rem 1.05rem;
    color: var(--nexa-navy);
    border-bottom-color: #edf2f8;
    font-weight: 750;
  }
  .card-body { padding: 1.05rem; }
  .card .border,
  .border { border-color: var(--nexa-border) !important; }

  .btn {
    border-radius: 10px;
    font-weight: 650;
    letter-spacing: .005em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    box-shadow: none;
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease, color .14s ease;
  }
  .btn:not(.dropdown-toggle):not(.btn-link):hover { transform: translateY(-1px); }
  .btn-primary {
    --bs-btn-bg: var(--nexa-blue);
    --bs-btn-border-color: var(--nexa-blue);
    --bs-btn-hover-bg: #1769df;
    --bs-btn-hover-border-color: #1769df;
    --bs-btn-active-bg: #1159c2;
    --bs-btn-active-border-color: #1159c2;
    box-shadow: 0 8px 18px -12px rgba(31, 122, 255, .9);
  }
  .btn-primary:hover { box-shadow: 0 12px 24px -14px rgba(31, 122, 255, .95); }
  .btn-secondary {
    --bs-btn-bg: #42526a;
    --bs-btn-border-color: #42526a;
    --bs-btn-hover-bg: #334155;
    --bs-btn-hover-border-color: #334155;
  }
  .btn-success {
    --bs-btn-bg: var(--nexa-success);
    --bs-btn-border-color: var(--nexa-success);
    --bs-btn-hover-bg: #0f8751;
    --bs-btn-hover-border-color: #0f8751;
  }
  .btn-danger {
    --bs-btn-bg: var(--nexa-danger);
    --bs-btn-border-color: var(--nexa-danger);
    --bs-btn-hover-bg: #bf2839;
    --bs-btn-hover-border-color: #bf2839;
  }
  .btn-warning {
    --bs-btn-color: #3b2603;
    --bs-btn-bg: #f7b731;
    --bs-btn-border-color: #f7b731;
  }
  .btn-outline-secondary {
    --bs-btn-color: #526174;
    --bs-btn-border-color: #cad5e4;
    --bs-btn-hover-bg: #eef4fb;
    --bs-btn-hover-border-color: #b8c7da;
    --bs-btn-hover-color: var(--nexa-navy);
  }
  .btn-outline-primary {
    --bs-btn-color: #1769df;
    --bs-btn-border-color: #a8cbff;
    --bs-btn-hover-bg: #eaf3ff;
    --bs-btn-hover-border-color: #7db4ff;
    --bs-btn-hover-color: #0f57be;
  }
  .btn-light {
    --bs-btn-bg: #f8fbff;
    --bs-btn-border-color: #dfe7f1;
    --bs-btn-hover-bg: #edf4fc;
    --bs-btn-hover-border-color: #d0dceb;
  }
  .btn:disabled,
  .btn.disabled {
    transform: none !important;
    box-shadow: none !important;
    opacity: .62;
  }
  .btn-sm { border-radius: 9px; padding: .32rem .65rem; }
  .btn-lg { border-radius: 12px; padding: .72rem 1.05rem; }

  .form-control,
  .form-select {
    border-color: #cfdae8;
    border-radius: 10px;
    color: var(--nexa-text);
    background-color: #fff;
    box-shadow: inset 0 1px 1px rgba(8, 26, 51, .02);
  }
  .form-control:focus,
  .form-select:focus,
  .form-check-input:focus {
    border-color: #79b5ff;
    box-shadow: var(--nexa-ring);
  }
  .form-control::placeholder { color: #98a6b8; }
  .form-label {
    color: #2d4058;
    font-weight: 700;
  }
  .form-text,
  .helptext,
  .text-secondary,
  .text-muted { color: var(--nexa-muted) !important; }
  .input-group-text {
    border-color: #cfdae8;
    background: #f4f8fd;
    color: #526174;
    border-radius: 10px;
  }
  .form-check-input { border-color: #b8c7da; }
  .form-check-input:checked {
    background-color: var(--nexa-blue);
    border-color: var(--nexa-blue);
  }
  .invalid-feedback,
  .errorlist {
    color: var(--nexa-danger);
    font-weight: 600;
  }

  .table {
    --bs-table-color: var(--nexa-text);
    --bs-table-border-color: #edf2f8;
    margin-bottom: 0;
  }
  .table thead th {
    background: linear-gradient(180deg, #f8fbff, #eef4fb);
    color: #53657b;
    font-weight: 800;
    border-bottom-color: #dbe5f1;
    padding: .68rem .75rem;
  }
  .table tbody td,
  .table tbody th { padding: .68rem .75rem; }
  .table-sm tbody td,
  .table-sm tbody th,
  .table-sm thead th { padding: .5rem .62rem; }
  .table-hover tbody tr { transition: background .14s ease; }
  .table-hover tbody tr:hover { --bs-table-hover-bg: #f3f8ff; }
  .table tfoot td,
  .table tfoot th,
  tfoot.table-light td,
  tr.table-light td {
    background: #f3f7fc !important;
    color: var(--nexa-navy);
    border-top: 1px solid #dbe5f1;
  }
  .table-responsive { border-radius: 0 0 14px 14px; }
  .report-table .report-num,
  .text-end { font-variant-numeric: tabular-nums; }

  .badge {
    border-radius: 999px;
    font-weight: 750;
    letter-spacing: .01em;
  }
  .badge-status,
  .sub-badge {
    border: 1px solid transparent;
    padding: .36em .72em;
  }
  .bs-completed, .bs-active, .bs-approved, .bs-received, .bs-paid, .bs-open,
  .bs-finished, .bs-normal {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
  }
  .bs-draft, .bs-held, .bs-order, .bs-pending, .bs-submitted, .bs-booked {
    background: #edf2f7;
    color: #334155;
    border-color: #dbe5f1;
  }
  .bs-credit, .bs-partially_paid, .bs-partially_received, .bs-grace, .bs-trial,
  .bs-review, .bs-urgent, .bs-low_stock {
    background: #fff4d6;
    color: #8a5200;
    border-color: #ffe2a3;
  }
  .bs-voided, .bs-cancelled, .bs-rejected, .bs-suspended, .bs-expired,
  .bs-past_due, .bs-unpaid {
    background: #fee4e9;
    color: #a8182b;
    border-color: #ffc8d2;
  }
  .bs-partially_returned, .bs-fully_returned, .bs-returned, .bs-refunded,
  .bs-dispatched, .bs-closed, .bs-in_process {
    background: #e5f0ff;
    color: #1451a3;
    border-color: #c7dcff;
  }
  .bs-vip {
    background: #f0e7ff;
    color: #5b21b6;
    border-color: #dcc8ff;
  }

  .alert {
    border: 1px solid transparent;
    border-radius: 12px;
    box-shadow: 0 10px 26px -24px rgba(8, 26, 51, .35);
  }
  .alert-success { background: #ecfdf5; border-color: #b7efd4; color: #0f6b43; }
  .alert-danger { background: #fff0f3; border-color: #ffc9d3; color: #982338; }
  .alert-warning { background: #fff8e6; border-color: #ffe1a6; color: #744800; }
  .alert-info { background: #eef7ff; border-color: #c7e2ff; color: #1451a3; }
  .toast {
    border-radius: 12px;
    box-shadow: 0 18px 44px -26px rgba(8, 26, 51, .5);
  }

  .dropdown-menu {
    border-color: var(--nexa-border);
    border-radius: 12px;
    box-shadow: 0 18px 44px -28px rgba(8, 26, 51, .38);
    padding: .45rem;
  }
  .dropdown-item {
    border-radius: 9px;
    font-weight: 600;
  }
  .dropdown-item:hover,
  .dropdown-item:focus {
    background: #eef6ff;
    color: #0f57be;
  }

  .modal-content {
    border: 1px solid var(--nexa-border);
    border-radius: 16px;
    box-shadow: 0 24px 70px -35px rgba(8, 26, 51, .65);
  }
  .modal-header,
  .modal-footer {
    border-color: #edf2f8;
    background: #fbfdff;
  }
  .modal-header { border-radius: 16px 16px 0 0; }
  .modal-footer { border-radius: 0 0 16px 16px; }
  .modal-title {
    color: var(--nexa-navy);
    font-weight: 800;
  }

  .empty-state {
    color: var(--nexa-muted);
    background: linear-gradient(180deg, rgba(248, 251, 255, .85), rgba(255,255,255,.3));
    border-radius: 12px;
  }
  .empty-state i {
    color: var(--nexa-blue);
    opacity: .38;
  }

  .kpi-card,
  .kpi-pro { border-radius: 16px; }
  .kpi-pro {
    border-color: rgba(255,255,255,.78);
    box-shadow: var(--nexa-shadow);
  }
  .kpi-pro .kpi-label {
    color: #617187;
    font-weight: 800;
  }
  .kpi-pro .kpi-value {
    color: var(--nexa-navy);
    letter-spacing: -.025em;
  }
  .chart-card,
  .widget-card { border-radius: 16px; }

  .pos-page { height: calc(100vh - 78px - 2.9rem); }
  .pos-header-strip {
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(223, 231, 241, .9);
    border-radius: 14px;
    padding: .55rem .65rem;
    box-shadow: 0 10px 28px -26px rgba(8, 26, 51, .36);
  }
  .pos-products-pane .input-group,
  .pos-products-pane > .d-flex:first-child > .form-control {
    box-shadow: 0 10px 24px -24px rgba(8, 26, 51, .4);
  }
  .pos-product-card {
    border-color: var(--nexa-border);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(8, 26, 51, .04);
    transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
  }
  .pos-product-card:hover {
    transform: translateY(-2px);
    border-color: #8fc5ff;
    box-shadow: 0 14px 30px -24px rgba(31, 122, 255, .8);
  }
  .pos-product-card .pp-price { color: #0f67df; }
  .pos-cart {
    border-color: var(--nexa-border);
    border-radius: 16px;
    box-shadow: var(--nexa-shadow);
  }
  .pos-cart > .border-bottom {
    background: linear-gradient(180deg, #ffffff, #f8fbff);
  }
  .pos-cart-items .cart-row {
    border-bottom-color: #edf2f8;
    transition: background .14s ease;
  }
  .pos-cart-items .cart-row:hover { background: #f8fbff; }
  .pos-totals {
    border-top-color: #dbe5f1;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  }
  .btn-pos-pay {
    border-radius: 12px;
    background: linear-gradient(135deg, var(--nexa-blue), #1769df);
  }

  .report-card {
    border-radius: 16px;
    overflow: hidden;
  }
  .report-card > .card-body {
    border-top: 1px solid #edf2f8;
    background: #fbfdff;
  }
  .report-print-page > .card.mb-3.no-print {
    background: rgba(255,255,255,.92);
  }

  .support-banner {
    background: linear-gradient(90deg, #9a5b04, #d88a10);
    box-shadow: 0 8px 24px -20px rgba(8, 26, 51, .5);
  }

  .auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background:
      radial-gradient(520px 280px at 18% 4%, rgba(73, 163, 255, .32), transparent 60%),
      radial-gradient(520px 280px at 88% 92%, rgba(20, 155, 97, .20), transparent 62%),
      linear-gradient(135deg, #06152a 0%, #102a4c 52%, #071426 100%);
  }
  .auth-shell,
  .auth-card {
    max-width: 460px;
    width: 100%;
  }
  .auth-card {
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.14) !important;
    box-shadow: 0 28px 80px -42px rgba(0,0,0,.75) !important;
  }
  .auth-brand-mark {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--nexa-blue), #57d5ff);
    box-shadow: 0 0 0 5px rgba(31, 122, 255, .18), 0 0 28px rgba(73, 163, 255, .62);
  }

  @media (max-width: 575.98px) {
    .np-content { padding: 1rem; }
    .card-body { padding: .9rem; }
    .pos-page { height: calc(100vh - 66px - 2rem); }
    .pos-header-strip { padding: .45rem; }
    .btn { gap: .25rem; }
  }
}

/* POS commercial stabilization: bounded desktop workspace with one cart scroller. */
.np-main-pos {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.np-content-pos {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.pos-page {
  flex: 1;
  height: auto;
  max-height: none;
}
.pos-shell {
  grid-template-columns: minmax(0, 13fr) minmax(20rem, 7fr);
  grid-template-areas: "cart products";
  width: 100%;
}
.pos-shell > *,
.pos-cart { min-width: 0; }
.pos-products-pane { grid-area: products; }
.pos-cart { grid-area: cart; }
.pos-product-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .5rem;
  min-width: 0;
}
.pos-product-tools > * {
  width: 100%;
  max-width: none;
  min-width: 0;
}
.pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pos-cart-items { scrollbar-gutter: stable; }
.pos-cart-items .cart-row .fw-semibold { overflow-wrap: anywhere; }
.pos-line-pricing {
  flex-wrap: wrap;
  min-width: 0;
}
.pos-validation-message { overflow-wrap: anywhere; }
.garment-classification .btn {
  min-width: 72px;
  min-height: 34px;
}
.pos-priority-select { width: 142px; }
.pos-payment-modal { max-height: calc(100dvh - 2rem); }
.pos-payment-modal .modal-body { overflow-y: auto; }

@media (min-width: 992px) and (max-height: 820px) {
  .pos-header-strip { padding: .35rem .5rem; margin-bottom: .4rem !important; }
  .pos-grid { gap: .45rem; }
  .pos-product-card { padding: .45rem; }
  .pos-product-card img { height: 52px !important; }
  .pos-cart-items .cart-row { padding: .4rem .6rem; }
  .pos-totals { padding: .5rem .65rem; }
  .pos-totals .my-2 { margin-top: .35rem !important; margin-bottom: .35rem !important; }
  .btn-pos-pay { padding: .55rem; }
  .pos-payment-modal .modal-header { padding-top: .4rem; padding-bottom: .4rem; }
  .pos-payment-modal .modal-body { padding-top: .75rem; padding-bottom: .75rem; }
}

@media (max-width: 991.98px) {
  .pos-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "products"
      "cart";
  }
}

@media (max-width: 575.98px) {
  .pos-tailoring-fields > .col-6 { width: 100%; }
}

@media (max-width: 359.98px) {
  .pos-grid { grid-template-columns: minmax(0, 1fr); }
}

@page reportLandscape {
  size: A4 landscape;
  margin: 10mm;
}

/* Print */
@media print {
  .np-sidebar, .np-topbar, .no-print { display: none !important; }
  .np-main { margin: 0; }
  body.app-body { background: #fff; font-size: 10px; }
  .np-content { padding: 0; }
  .report-print-page { page: reportLandscape; }
  .report-card {
    border: 0;
    box-shadow: none;
  }
  .report-table-wrap {
    overflow: visible !important;
  }
  .report-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed;
    font-size: 9.5px;
  }
  .report-table th,
  .report-table td {
    padding: 3px 4px;
    overflow-wrap: anywhere;
  }
  .report-table tr {
    page-break-inside: avoid;
  }
  .report-table-wide {
    font-size: 8.5px;
  }
  .report-table-sales_summary .report-col-date { width: 12%; }
  .report-table-sales_summary .report-col-invoice { width: 11%; }
  .report-table-sales_summary .report-col-money { width: 11%; }
  .report-table-sales_summary .report-col-money-sm { width: 8.5%; }
  .report-table-sales_summary .report-col-receivable { width: 12%; }
  .report-table-sales_summary th:nth-child(2),
  .report-table-sales_summary td:nth-child(2) {
    overflow-wrap: normal;
    word-break: normal;
  }
}
