:root {
  --ink: #162033;
  --muted: #647087;
  --line: #e3e8ef;
  --panel: #ffffff;
  --bg: #f4f7fb;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --warn: #b45309;
}

/* Phase 169 invoice/purchase scanner and compact line editor */
.posScanStrip.scannerStrip{
  grid-template-columns:auto!important;
  justify-content:start;
}
.posScanStrip.scannerStrip #cameraScanBtn{
  width:auto;
}
.posItemStrip input.hidden,
.posItemStrip select.hidden,
.purchaseLineEditor input.hidden,
.purchaseLineEditor select.hidden{
  display:none!important;
}
.posItemStrip .discountPair,
.purchaseLineEditor .discountPair{
  min-width:150px;
}
.purchaseUnifiedSearch{
  grid-template-columns:minmax(220px,1fr) auto auto auto!important;
}
.purchaseUnifiedSearch .scannerFrame{
  grid-column:1/-1;
}
@media (max-width:900px){
  .posItemStrip,
  .purchaseLineEditor{
    grid-template-columns:1fr 74px 74px 86px minmax(138px,1fr) auto;
    overflow-x:auto;
  }
  .posItemPick{min-width:220px}
  .purchaseUnifiedSearch{grid-template-columns:1fr auto!important}
}

* { box-sizing: border-box; }
.hidden { display: none !important; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
}

body.loggedOut {
  display: block;
}
body.loggedOut .sidebar,
body.loggedOut main {
  display: none !important;
}

.loginScreen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(17, 24, 39, 0.86);
  padding: 20px;
}
.loginBox {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 22px;
  display: grid;
  gap: 14px;
}
.loginBox h1 { font-size: 24px; }
.loginBox p, .loginBox small { color: var(--muted); }
.signupBody {
  display: block;
  min-height: 100vh;
  background: #eef3f8;
}
.signupShell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-columns: minmax(260px, .7fr) minmax(520px, 1.3fr);
  gap: 18px;
}
.signupIntro,
.signupPanel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
}
.signupIntro {
  display: grid;
  align-content: start;
  gap: 14px;
}
.signupIntro h1 {
  font-size: 34px;
  line-height: 1.1;
}
.signupIntro p {
  color: var(--muted);
  line-height: 1.5;
}
.signupPlans {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.signupPlan {
  display: grid;
  gap: 5px;
  text-align: left;
  min-height: 132px;
  border-radius: 8px;
}
.signupPlan.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.16);
}
.signupPlan span {
  font-weight: 900;
}
.signupPlan strong {
  font-size: 22px;
  color: var(--brand-dark);
}
.signupPlan small,
.signupPlan em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}
.signupForm {
  display: grid;
  gap: 14px;
}
.signupPayBox {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid #b7d7d2;
  border-radius: 8px;
  background: #f0fdfa;
}
.signupPayBox span,
.signupPayBox small {
  color: var(--muted);
}
.signupPayBox strong {
  font-size: 28px;
  color: var(--brand-dark);
}
.signupResult {
  min-height: 22px;
  color: var(--brand-dark);
  font-weight: 800;
}

.sidebar {
  background: #111827;
  color: #fff;
  padding: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 800;
}

h1, h2, h3, p { margin: 0; }
.brand h1 { font-size: 18px; }
.brand p { color: #aeb8c8; font-size: 13px; margin-top: 2px; }

nav { display: grid; gap: 6px; }
nav button {
  border: 0;
  color: #dbe3ef;
  background: transparent;
  padding: 12px 10px;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
}
nav .navLink {
  display: block;
  color: #dbe3ef;
  background: transparent;
  padding: 12px 10px;
  text-align: left;
  border-radius: 8px;
  font-size: 15px;
  text-decoration: none;
}
nav button.active, nav button:hover { background: #223047; color: #fff; }
nav .navLink:hover { background: #223047; color: #fff; }
nav button.lockedNav {
  opacity: 0.62;
  position: relative;
}
nav button.lockedNav::after {
  content: "Upgrade";
  float: right;
  color: #f7d36f;
  font-size: 11px;
  font-weight: 800;
}

main { min-width: 0; }
.topbar {
  height: 82px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.eyebrow {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}
.actions { display: flex; gap: 10px; }
button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
}
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }

.view { display: none; padding: 22px; }
.view.active { display: block; }

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.metrics article, .panel, .tableWrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.metrics article { padding: 16px; }
.metrics span { display: block; color: var(--muted); font-size: 13px; }
.metrics strong { display: block; font-size: 28px; margin-top: 8px; }

.panel { padding: 16px; margin-bottom: 16px; }
.panel h3 { margin-bottom: 8px; }
.panel p { color: var(--muted); line-height: 1.5; }
.roadmap { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.roadmap span {
  background: #e6f5f3;
  color: var(--brand-dark);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.toolbar { margin-bottom: 12px; }
.toolbar.split {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.itemToolbar {
  grid-template-columns: minmax(260px, 1fr) auto auto auto auto auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.itemToolbar input {
  background: #f8fafc;
}
.itemToolbar .checkLine {
  margin: 0;
  height: 100%;
  padding: 0 8px;
  white-space: nowrap;
}
.itemToolbar button {
  min-width: 110px;
  height: 42px;
}
.fileAction {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.fileAction input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.bulkActionBar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.bulkActionBar span {
  color: var(--muted);
  font-weight: 800;
}
.dangerBtn {
  border-color: #fecaca;
  background: #fff1f2;
  color: #be123c;
  font-weight: 800;
}
.dangerBtn:hover {
  border-color: #fb7185;
  background: #ffe4e6;
}
.bulkEditPanel { margin-bottom: 12px; }
.bulkEditTools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.bulkSheetWrap {
  max-height: 520px;
  overflow: auto;
  border-radius: 8px;
}
.bulkSheet {
  min-width: 1380px;
}
.bulkSheet th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
}
.bulkSheet input,
.bulkSheet select {
  min-width: 96px;
  height: 34px;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 13px;
}
.bulkSheet td:first-child input { min-width: 170px; }
.bulkSheet td:nth-child(2) input { min-width: 220px; }
.bulkSheet input[type="checkbox"] {
  min-width: 16px;
  width: 16px;
  height: 16px;
  padding: 0;
}
.storagePanel {
  border-left: 4px solid var(--brand);
}
.storageGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.storageGrid article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.storageGrid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.storageGrid strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.storagePaths {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
}
.storagePaths input {
  font-size: 12px;
  background: #f8fafc;
  color: var(--ink);
}
.selectCol { width: 34px; }
.itemSelect {
  width: 16px;
  height: 16px;
}
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
}
select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  background: #fff;
  font-family: inherit;
}
textarea { min-height: 72px; resize: vertical; margin-top: 12px; }
label { color: var(--muted); font-size: 13px; display: grid; gap: 6px; }
.inlineForm { display: none; }
.inlineForm.open { display: block; }
.formGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}
.formGrid.twoCols { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
.checkLine {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.checkLine input { width: auto; }
.partyHero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.partyHero h2 {
  font-size: 25px;
  line-height: 1.2;
}
.partyStats {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.partyStats article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.partyStats span {
  color: var(--muted);
  font-size: 13px;
}
.partyStats strong {
  display: block;
  margin-top: 6px;
  font-size: 23px;
}
.partyToolbar {
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.partyEditor {
  padding: 18px;
  border-color: #cfd8e3;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}
.partyEditorGrid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, .9fr);
  gap: 18px;
}
.partyEditor h4 {
  margin: 0 0 12px;
  font-size: 15px;
}
.partyEditor textarea {
  margin-top: 0;
  min-height: 122px;
}
.partyTable table { min-width: 980px; }
.partyCell {
  display: grid;
  gap: 4px;
  max-width: 280px;
}
.partyCell strong {
  color: var(--ink);
  font-weight: 800;
}
.partyCell small {
  color: var(--muted);
  line-height: 1.35;
}
.partyType.retailer, .partyType.dealer { background: #e6f5f3; color: var(--brand-dark); }
.partyType.distributor { background: #eaf2ff; color: #1d4ed8; }
.partyType.supplier { background: #fff7ed; color: #b45309; }
.partyType.customer { background: #f1f5f9; color: #334155; }
.itemListThumb {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #f8fafc;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
}
.itemListThumb.empty {
  padding: 4px;
  text-align: center;
}

.tableWrap {
  overflow: auto;
}
.tableWrap.compact { margin-top: 12px; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
th, td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}
th {
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  position: sticky;
  top: 0;
}
td { font-size: 14px; }
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf2f7;
  color: #475569;
  font-size: 12px;
}
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: var(--warn); }
.linkBtn {
  display: inline-block;
  color: var(--brand-dark);
  font-weight: 700;
  text-decoration: none;
}
.rowActions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rowActions button {
  padding: 6px 9px;
  font-size: 12px;
}
.sectionGap { margin-top: 18px; }
.reportGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.storeBody {
  display: block;
  background: var(--bg);
  min-height: 100vh;
}
.storeHero {
  background: #111827;
  color: #fff;
  padding: 22px clamp(16px, 4vw, 42px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.storeHero h1 { font-size: 28px; }
.storeHero p { color: #cbd5e1; margin-top: 4px; }
.storeShell {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  padding: 20px clamp(16px, 4vw, 42px);
}
.productGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.productCard, .cartPanel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.productThumb {
  width: 100%;
  height: 120px;
  border-radius: 8px;
  background: #edf2f7;
  color: var(--muted);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  object-fit: cover;
}
.productCard h3 { font-size: 16px; min-height: 40px; }
.productCard p, .mutedText { color: var(--muted); font-size: 13px; line-height: 1.4; }
.productMeta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 0;
  color: var(--muted);
}
.productMeta strong { color: var(--ink); }
.cartPanel {
  position: sticky;
  top: 16px;
  align-self: start;
  display: grid;
  gap: 12px;
}
.cartLine {
  display: grid;
  grid-template-columns: 1fr 64px auto auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.cartLine input { padding: 8px; }
.featureMatrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.featureMatrix article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.featureMatrix h4 { margin: 0 0 6px; }
.featureMatrix strong { display: block; margin-bottom: 10px; color: var(--brand-dark); }
.featureMatrix div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.featureMatrix span {
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 5px 7px;
  border-radius: 999px;
  font-size: 12px;
}
.featureMatrix span.enabled {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

.alertGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.alertGrid h4 {
  margin: 0 0 8px;
}
.alertList {
  display: grid;
  gap: 8px;
}
.alertList article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}
.alertList strong,
.alertList span {
  display: block;
}
.alertList span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.permissionMatrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.permissionMatrix article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.permissionMatrix h4 {
  margin: 0 0 8px;
}
.subPanel {
  margin-top: 12px;
  padding: 12px;
}
.slabGrid {
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  gap: 10px;
}
.itemEditor {
  border-radius: 14px;
  padding: 16px;
  background: #f8fafc;
}
.itemEditorGrid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}
.itemEditorMain,
.itemEditorSide,
.sideStack {
  display: grid;
  gap: 12px;
}
.formSection {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.sectionHead {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.sectionHead h4 {
  margin: 0;
  color: var(--ink);
}
.sectionHead span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}
.span2 { grid-column: span 2; }
.checkTile {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
}
.checkTile input { width: auto; }
.proSlabs {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}
.proSlabs label {
  display: grid;
  gap: 5px;
}
.proSlabs label span {
  color: var(--muted);
  font-size: 12px;
}
.quickMaster {
  display: grid;
  gap: 8px;
}
.quickRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.quickRow.three {
  grid-template-columns: minmax(0, 1fr) 72px auto;
}
.quickMaster button {
  min-width: 62px;
  padding-left: 10px;
  padding-right: 10px;
}
.compactSide {
  gap: 8px;
}
.compactSide label {
  display: grid;
  gap: 5px;
}
.itemPhotoSection {
  background: #0f172a;
  color: #ffffff;
  border-color: #1e293b;
}
.itemPhotoSection .sectionHead h4,
.itemPhotoSection .sectionHead span {
  color: #ffffff;
}
.itemPhotoBox {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  background: #111827;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 10px;
}
.itemPhotoBox img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.itemPhotoBox span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}
.filePick {
  display: grid;
  place-items: center;
  min-height: 40px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  margin-bottom: 8px;
}
.filePick input {
  display: none;
}
.itemEditorFooter {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 14px -16px -16px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.cameraPreview {
  width: min(420px, 100%);
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  margin-top: 10px;
  background: #111827;
}
.paymentSplit {
  grid-column: span 3;
}
.paymentRow {
  display: grid;
  grid-template-columns: 120px 110px minmax(140px, 1fr) minmax(120px, 1fr) auto;
  gap: 8px;
  margin-bottom: 8px;
}

.salesHero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.salesHero h2 {
  font-size: 25px;
  line-height: 1.2;
}
#sales.invoiceMode .salesHero,
#sales.invoiceMode .salesStats,
#sales.invoiceMode .salesRegisterToolbar,
#sales.invoiceMode .salesRegisterTable {
  display: none;
}
#sales.invoiceMode {
  padding: 12px;
}
.salesStats {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.salesStats article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.salesStats span {
  color: var(--muted);
  font-size: 13px;
}
.salesStats strong {
  display: block;
  margin-top: 6px;
  font-size: 23px;
}
.invoicePanel { display: none; }
.invoicePanel.open { display: block; }
.salesInvoicePanel {
  padding: 18px;
  border-color: #cfd8e3;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}
.posInvoicePanel {
  padding: 0;
  overflow: hidden;
  background: #eef3f8;
  border-radius: 8px;
}
.posHeader {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}
.posHeader h3 {
  font-size: 18px;
  margin-bottom: 3px;
}
.panelHead {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.salesFormGrid {
  display: grid;
  grid-template-columns: minmax(360px, 1.4fr) minmax(280px, .8fr);
  gap: 14px;
}
.salesBlock {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}
.salesBlock h4, .salesBlockHead h4 {
  margin: 0 0 12px;
  font-size: 15px;
}
.salesBlockHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.salesBlockHead span {
  color: var(--brand-dark);
  font-weight: 800;
}
.invoiceGrid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
}
.scanBar {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 8px;
}
.lineEditor {
  display: grid;
  grid-template-columns: 2fr 120px 140px 140px auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}
.saleLineMain {
  grid-template-columns: minmax(260px, 2fr) 100px 100px 120px 120px auto;
}
.saleLineMeta {
  grid-template-columns: repeat(7, minmax(110px, 1fr));
}
.salesHintBar {
  margin: 10px 0 4px;
}
.salesLinesTable table { min-width: 900px; }
.posShell {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) 360px;
  min-height: 620px;
}
.posWorkArea {
  min-width: 0;
  padding: 14px;
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(260px, 1fr);
  gap: 10px;
}
.posTopStrip,
.posScanStrip,
.posItemStrip,
.posInfoStrip {
  display: grid;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}
.posTopStrip {
  grid-template-columns: minmax(280px, 2fr) minmax(130px, .8fr) minmax(130px, .8fr) minmax(130px, .8fr);
}
.posPartyPick {
  position: relative;
  min-width: 0;
}
.posItemPick {
  position: relative;
}
.searchResults {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  max-height: 320px;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.18);
}
.searchResults button {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  border-radius: 0;
  text-align: left;
}
.searchResults button:hover {
  background: #e6f5f3;
}
.searchResults strong {
  color: var(--ink);
}
.searchResults span,
.emptyResult {
  color: var(--muted);
  font-size: 12px;
}
.emptyResult {
  padding: 12px;
}
.pickWithAction {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
}
.quickPartyBox {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, .7fr) auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid #b7d7d2;
  border-radius: 8px;
  background: #f0fdfa;
}
.posScanStrip {
  grid-template-columns: minmax(260px, 1fr) auto auto;
}
.posScanStrip input {
  min-height: 46px;
  font-size: 16px;
  font-weight: 700;
}
.posItemStrip {
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(74px, .45fr)) minmax(150px, .8fr) repeat(auto-fit, minmax(96px, .55fr)) auto;
}
.posItemPick { min-width: 0; }
.posItemStrip input,
.posItemStrip select,
.posItemStrip button,
.posTopStrip input,
.posTopStrip select {
  min-height: 42px;
}
.posOptional {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
}
.posLineTools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.fieldMenu {
  position: relative;
  min-width: 160px;
}
.posOptional summary {
  padding: 10px 12px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}
.fieldMenu summary {
  list-style: none;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--ink);
}
.fieldMenu summary::-webkit-details-marker { display: none; }
.fieldMenu[open] .posFieldToggles {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  width: min(520px, 86vw);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .18);
}
.posOptional .saleLineMeta {
  margin: 0;
  padding: 0 10px 10px;
}
.posFieldToggles {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 8px;
  padding: 0 10px 10px;
}
.posFieldToggles label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #f8fafc;
}
.posFieldToggles input {
  width: auto;
}
.discountPair {
  display: grid;
  grid-template-columns: 58px minmax(82px, 1fr);
  gap: 6px;
}
.discountPair select,
.discountPair input {
  min-width: 0;
}
.scannerStrip {
  position: relative;
}
.scannerFrame {
  grid-column: 1 / -1;
  position: relative;
  overflow: hidden;
  min-height: 180px;
  border: 1px solid #dc2626;
  border-radius: 8px;
  background: #020617;
}
.scannerFrame.hidden { display: none; }
.cameraPreview {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  display: block;
}
.scannerLine {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 18%;
  height: 2px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 14px rgba(239, 68, 68, .95);
  animation: scanLineMove 1.25s linear infinite;
}
@keyframes scanLineMove {
  0% { transform: translateY(0); }
  50% { transform: translateY(128px); }
  100% { transform: translateY(0); }
}
.purchaseLineEditor {
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(78px, .5fr)) minmax(150px, .8fr) repeat(auto-fit, minmax(96px, .55fr)) auto;
}
.purchaseLineEditor #purchaseItem {
  display: none;
}
.purchaseUnifiedSearch {
  grid-template-columns: minmax(260px, 1fr) auto auto auto !important;
  align-items: end;
}
.purchaseUnifiedSearch button,
#purchaseQuickAddItemBtn {
  width: auto;
  min-width: 86px;
  padding-inline: 12px;
  white-space: nowrap;
}
.posInfoStrip {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}
.posInfoStrip .checkLine {
  margin: 0;
  white-space: nowrap;
}
.posBillTable {
  margin: 0;
  min-height: 260px;
  background: #ffffff;
}
.posBillTable table {
  min-width: 760px;
}
.posCheckout {
  min-width: 0;
  padding: 14px;
  border-left: 1px solid var(--line);
  background: #ffffff;
  display: grid;
  grid-template-rows: auto auto auto minmax(140px, 1fr) auto auto;
  gap: 12px;
}
.posCustomerCard,
.posLineTotal {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.posCustomerCard span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}
.posCustomerCard strong {
  display: block;
  line-height: 1.35;
}
.posLineTotal {
  color: var(--brand-dark);
  font-size: 18px;
  font-weight: 900;
}
.posTotals {
  padding: 14px;
}
.posTotals span {
  font-size: 14px;
}
.posTotals .grandTotal {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 18px;
  color: var(--ink);
}
.posTotals .grandTotal strong {
  font-size: 22px;
}
.posTotals .balanceDue {
  color: #b45309;
  font-weight: 800;
}
.posPayments {
  grid-column: auto;
}
.posPayments .panelHead {
  margin-bottom: 8px;
}
.posPayments .paymentRow {
  grid-template-columns: 1fr 1fr;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}
.posPayments .paymentRow input,
.posPayments .paymentRow select,
.posPayments .paymentRow button {
  min-width: 0;
}
.posPayments .paymentRow button {
  grid-column: 1 / -1;
}
.posCheckout textarea {
  margin-top: 0;
  min-height: 76px;
}
.posSaveBtn {
  min-height: 52px;
  font-size: 16px;
  font-weight: 900;
}
.invoiceFoot {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr)) 1.4fr;
  gap: 12px;
  margin-top: 14px;
  align-items: start;
}
.totals {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}
.totals span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}
.totals strong { color: var(--ink); }
.salesRegisterToolbar {
  grid-template-columns: minmax(260px, 1fr) minmax(140px, 170px) minmax(130px, 160px) minmax(130px, 160px) minmax(130px, 160px);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.salesRegisterTable table { min-width: 860px; }
.actions.right { justify-content: flex-end; margin-top: 12px; }

.printBody {
  display: block;
  background: #e5e7eb;
  min-height: 100vh;
}
.printPage {
  max-width: 900px;
  margin: 24px auto;
}
.printActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}
.bill {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}
.billHead {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 16px;
}
.billHead h1 { font-size: 24px; }
.smallText { font-size: 12px; color: var(--muted); margin-top: 4px; }
.billMeta, .billParty, .billTotals {
  display: grid;
  gap: 5px;
}
.billMeta { text-align: right; }
.billParty {
  margin: 18px 0;
  color: var(--muted);
}
.billParty strong { color: var(--ink); }
.billTable { min-width: 0; }
.billTotals {
  margin-left: auto;
  margin-top: 16px;
  width: min(320px, 100%);
}
.billTotals span {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 7px 0;
}
.billPayments {
  margin-left: auto;
  margin-top: 12px;
  width: min(360px, 100%);
  display: grid;
  gap: 5px;
  color: var(--muted);
}
.billPayments strong { color: var(--ink); }
.billQr {
  margin-left: auto;
  margin-top: 16px;
  width: min(360px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.billQr img {
  width: 112px;
  height: 112px;
}
.billQr div {
  display: grid;
  gap: 5px;
}
.billQr span {
  color: var(--muted);
  font-size: 12px;
}
.billFoot {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.billNotes {
  margin-top: 18px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.catalogPage {
  max-width: 1120px;
}
.catalogGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.catalogCard {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
  min-height: 170px;
}
.catalogThumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  display: grid;
  place-items: center;
  object-fit: cover;
  font-size: 12px;
}
.catalogCard strong {
  color: var(--ink);
}
.catalogCard span,
.catalogCard p,
.catalogMeta {
  color: var(--muted);
  font-size: 12px;
}
.catalogMeta,
.catalogSlabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.catalogMeta span,
.catalogSlabs span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: #f8fafc;
}
.catalogSlabs strong {
  color: var(--brand);
}

.catalogAppBody {
  display: block;
  min-height: 100vh;
  background: #eef2f7;
}
.catalogApp {
  min-height: 100vh;
  padding-bottom: 92px;
}
.catalogAppHeader {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  padding: 14px clamp(14px, 4vw, 28px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.catalogAppHeader h1 {
  font-size: 22px;
  margin: 2px 0 0;
}
.catalogBrandHead {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.catalogBrandHead h1,
.catalogBrandHead p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.catalogLogo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #0f766e;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0;
  flex: 0 0 auto;
}
.catalogEyebrow {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}
.catalogHero,
.catalogSearchBar,
.catalogMain,
.catalogSheet,
.catalogCartPanel {
  width: min(1180px, calc(100% - 24px));
  margin-left: auto;
  margin-right: auto;
}
.catalogHero {
  margin-top: 12px;
  background: linear-gradient(135deg, #0f766e, #1d4ed8);
  color: #ffffff;
  border-radius: 14px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}
.catalogHero span {
  display: block;
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  margin-top: 4px;
}
.catalogHeroActions {
  display: flex;
  gap: 8px;
}
.catalogHeroActions input {
  min-width: 180px;
}
.catalogActorBox {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 12px;
  background: rgba(255,255,255,.12);
}
.catalogActorBox.hidden {
  display: none;
}
.catalogMain {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.catalogSearchBar {
  position: sticky;
  top: 71px;
  z-index: 15;
  background: #eef2f7;
  padding: 10px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px) minmax(150px, 220px);
  gap: 10px;
}
.catalogProductGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.catalogAppCard {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.catalogCardBody {
  min-width: 0;
  display: grid;
  gap: 8px;
}
.catalogCardBody strong {
  color: var(--ink);
}
.catalogCardBody span,
.catalogCardBody p {
  color: var(--muted);
  font-size: 12px;
}
.catalogNotice,
.catalogOrdersPanel,
.catalogSheet,
.catalogCartPanel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.catalogNotice p{
  margin:0 0 8px;
}
.catalogNotice p:last-child{
  margin-bottom:0;
}
.lockedRate{
  color:#b45309!important;
  background:#fff7ed!important;
}
.catalogOrderList,
.catalogCartList {
  display: grid;
  gap: 8px;
}
.catalogOrderCard,
.catalogCartItem {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 6px;
}
.catalogOrderCard {
  grid-template-columns: 1fr auto;
}
.catalogOrderCard p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.catalogCartItem {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
}
.catalogCartItem span {
  color: var(--muted);
  font-size: 12px;
}
.cartQtyStepper {
  display: grid;
  grid-template-columns: 34px minmax(42px, auto) 34px;
  gap: 4px;
  align-items: center;
  justify-items: center;
}
.cartQtyStepper button {
  min-height: 32px;
  padding: 0;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 800;
}
.cartQtyStepper span {
  color: var(--ink);
  font-weight: 800;
}
.catalogSheet,
.catalogCartPanel {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translate(-50%, 120%);
  z-index: 50;
  max-height: min(76vh, 720px);
  overflow: auto;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
  transition: transform 180ms ease;
}
.catalogSheet.open,
.catalogCartPanel.open {
  transform: translate(-50%, 0);
}
.catalogForm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.catalogBottomBar {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 24px));
  z-index: 45;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.2);
}
.fullBtn {
  width: 100%;
}
.catalogOrderPanel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 12px;
}
.catalogOrderPanel h3 {
  margin: 0;
}
.catalogBuy {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto;
  gap: 8px;
  margin-top: auto;
}
.catalogBuy input {
  min-width: 0;
}

@media print {
  .printActions, .catalogOrderPanel, .catalogBuy { display: none; }
  .printBody { background: #fff; }
  .printPage { margin: 0; max-width: none; }
  .bill { border: 0; border-radius: 0; padding: 0; }
}

@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .invoiceGrid, .lineEditor, .invoiceFoot, .formGrid, .formGrid.twoCols, .toolbar.split, .reportGrid, .storeShell, .alertGrid, .slabGrid, .paymentRow, .salesFormGrid, .salesStats, .saleLineMain, .saleLineMeta, .scanBar, .posShell, .posTopStrip, .posScanStrip, .posItemStrip, .posInfoStrip, .quickPartyBox, .posFieldToggles, .signupShell, .signupPlans { grid-template-columns: 1fr; }
  .salesHero { align-items: flex-start; flex-direction: column; }
  .posShell { min-height: 0; }
  .posCheckout { border-left: 0; border-top: 1px solid var(--line); }
  .posWorkArea { grid-template-rows: auto; }
  .cartPanel { position: static; }
  .itemEditorGrid { grid-template-columns: 1fr; }
  .itemToolbar { grid-template-columns: 1fr; }
  .itemToolbar .checkLine { padding: 0; }
  .quickRow,
  .quickRow.three { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .sectionHead { display: grid; }
  .sectionHead span { text-align: left; }
  .itemEditorFooter { display: grid; }
  .catalogHero { grid-template-columns: 1fr; }
  .catalogActorBox { grid-template-columns: 1fr; }
  .catalogAppHeader h1 { font-size: 18px; }
  .catalogHeroActions { display: grid; grid-template-columns: 1fr auto; }
  .catalogHeroActions input { min-width: 0; }
  .catalogSearchBar { top: 64px; grid-template-columns: 1fr; }
  .catalogProductGrid { grid-template-columns: 1fr; }
  .catalogAppCard { grid-template-columns: 86px minmax(0, 1fr); }
  .catalogForm { grid-template-columns: 1fr; }
  .catalogOrderCard { grid-template-columns: 1fr; }
  .catalogCartItem { grid-template-columns: 1fr auto; }
  .catalogCartItem button { grid-column: 1 / -1; }
  .cartQtyStepper { grid-column: 1 / -1; grid-template-columns: 44px 1fr 44px; }
  .cartQtyStepper button { grid-column: auto; }
}

@media (max-width: 640px) {
  .catalogAppBody {
    background: #f3f6fb;
    overscroll-behavior-y: contain;
  }
  .catalogApp {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }
  .catalogAppHeader {
    padding: 10px 12px;
    border-bottom: 0;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
  }
  .catalogLogo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }
  .catalogBrandHead {
    gap: 9px;
  }
  .catalogBrandHead p {
    max-width: 58vw;
  }
  .catalogHero,
  .catalogSearchBar,
  .catalogMain,
  .catalogSheet,
  .catalogCartPanel {
    width: min(100% - 16px, 480px);
  }
  .catalogHero {
    margin-top: 8px;
    border-radius: 12px;
    padding: 12px;
    gap: 10px;
  }
  .catalogHeroActions {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .catalogHeroActions input,
  .catalogHeroActions button {
    min-height: 42px;
  }
  .catalogSearchBar {
    top: 61px;
    padding: 8px 0;
    gap: 8px;
  }
  .catalogProductGrid {
    gap: 9px;
  }
  .catalogAppCard {
    grid-template-columns: 78px minmax(0, 1fr);
    padding: 9px;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .05);
  }
  .catalogThumb {
    width: 78px;
    height: 78px;
    border-radius: 9px;
  }
  .catalogCardBody {
    gap: 6px;
  }
  .catalogMeta {
    gap: 5px;
  }
  .catalogMeta span {
    padding: 4px 6px;
  }
  .catalogBuy {
    grid-template-columns: minmax(72px, .8fr) minmax(78px, auto) 64px;
    align-items: center;
  }
  .catalogBuy input,
  .catalogBuy button {
    min-height: 38px;
  }
  .catalogSheet,
  .catalogCartPanel {
    left: 8px;
    right: 8px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    width: auto;
    max-height: min(78vh, 680px);
    transform: translateY(120%);
    border-radius: 18px 18px 12px 12px;
  }
  .catalogSheet.open,
  .catalogCartPanel.open {
    transform: translateY(0);
  }
  .catalogBottomBar {
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: calc(100% - 16px);
    border-radius: 18px;
    grid-template-columns: 104px 1fr;
    padding: 8px;
  }
  .catalogBottomBar button {
    min-height: 46px;
    font-weight: 800;
  }
}
/* Phase-40 Online Store Pro */
.storeProHero { align-items: center; }
.storeHeroRight { display: grid; gap: 6px; justify-items: end; }
.storeProShell { grid-template-columns: minmax(0,1fr) 380px; align-items: start; }
.storeSearchLine { position: sticky; top: 0; z-index: 2; background: var(--bg); padding-top: 8px; }
.storeProductCard .priceStack { display: grid; gap: 3px; margin: 8px 0; }
.priceStack strong { font-size: 20px; color: var(--brand-dark); }
.mrpCut { color: var(--muted); text-decoration: line-through; }
.priceStack em { color: #15803d; font-style: normal; font-weight: 800; font-size: 12px; }
.storeProCart { display: grid; gap: 14px; position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow: auto; }
.storeAuthPanel, .checkoutBox { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; display: grid; gap: 10px; }
.tabLine { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tabLine button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.storeAuthBox { display: grid; gap: 10px; }
.paymentChoice { display: flex; gap: 14px; flex-wrap: wrap; }
.upiBox { display: grid; gap: 8px; justify-items: center; }
.qrBox img { width: 180px; height: 180px; border: 1px solid var(--line); border-radius: 8px; }
.cartLine span small { display: block; color: #15803d; font-size: 11px; margin-top: 2px; }
.orderStatusList { display: grid; gap: 8px; }
.orderStatusCard { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 4px; }
.orderStatusCard span, .orderStatusCard small { color: var(--muted); }
@media (max-width: 900px) { .storeProShell { grid-template-columns: 1fr; } .storeProCart { position: static; max-height: none; } }

/* Phase 41: Mobile store app feel */
.storeMobileBody { padding-bottom: 86px; }
.storeMobileHero { position: sticky; top: 0; z-index: 8; padding: 14px 16px; }
.storeMobileHero h1 { font-size: 20px; }
.storeMobileHero p { font-size: 12px; }
.storeMobileShell { width: min(1180px, 100%); padding: 10px; }
.storeMobileSearch { position: sticky; top: 72px; z-index: 7; padding: 8px 0; background: var(--bg); }
.storeMobileSearch input { min-height: 46px; border-radius: 14px; }
.storeMobileGrid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.mobileProductCard { position: relative; display: grid; grid-template-columns: 76px 1fr; gap: 10px; padding: 10px; border-radius: 14px; }
.mobileProductCard .productThumb { width: 76px; height: 76px; border-radius: 12px; }
.mobileProductCard h3 { min-height: auto; font-size: 14px; padding-right: 74px; }
.mobileProductCard p { font-size: 12px; max-height: 34px; overflow: hidden; }
.mobileProductCard .priceStack { display: flex; flex-wrap: wrap; gap: 5px 8px; align-items: baseline; margin-top: 4px; }
.cardQtyControl { position: absolute; right: 10px; top: 10px; display: grid; grid-template-columns: 32px 42px 32px; align-items: center; border: 1px solid var(--brand); border-radius: 999px; overflow: hidden; background: #fff; }
.cardQtyControl span { text-align: center; font-size: 12px; font-weight: 800; color: var(--brand-dark); }
.cardQtyControl button { border: 0; border-radius: 0; padding: 7px 0; color: var(--brand-dark); background: #ecfdf5; font-weight: 900; }
.cardQtyControl:not(.active) { grid-template-columns: 0 58px 32px; }
.cardQtyControl:not(.active) button:first-child { display: none; }
.storeBottomBar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 16px 44px rgba(15,23,42,.22); }
.storeBottomBar div { display: grid; gap: 2px; }
.storeBottomBar span { font-weight: 900; color: var(--brand-dark); }
.storeBottomBar small { color: #15803d; }
.storeCheckoutPanel { display: grid; gap: 12px; }
.mobileCartLine { grid-template-columns: minmax(0,1fr) auto auto; gap: 8px; }
.miniQty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.miniQty button { border: 0; border-radius: 0; padding: 6px 10px; background: #f8fafc; font-weight: 900; }
.miniQty strong { min-width: 28px; text-align: center; }
.compactHead { align-items: center; }
.warnText { color: #b45309 !important; font-weight: 800; }
.checkoutOpen .storeBottomBar { display: none; }
@media (max-width: 900px) {
  .storeMobileShell { display: block; }
  .storeCheckoutPanel { position: fixed !important; inset: auto 0 0 0; z-index: 30; max-height: 92vh; overflow: auto; border-radius: 22px 22px 0 0; transform: translateY(110%); transition: transform .22s ease; box-shadow: 0 -16px 44px rgba(15,23,42,.25); }
  .storeCheckoutPanel.open { transform: translateY(0); }
  .storeMobileGrid { grid-template-columns: 1fr; }
  .storeMobileHero { border-radius: 0 0 16px 16px; }
}
@media (min-width: 901px) {
  .storeCheckoutPanel { position: sticky; top: 14px; transform: none !important; }
  #closeCheckoutBtn { display: none; }
}


/* Phase 42: professional mobile store cleanup */
.storeMobileHero p { color: var(--muted); }
.storeCheckoutPanel { display: none; }
.storeCheckoutPanel.open { display: grid; }
@media (min-width: 901px) {
  .storeProShell { grid-template-columns: 1fr; }
  .storeCheckoutPanel { position: fixed !important; inset: 0 0 0 auto; z-index: 30; width: min(430px, 100%); max-height: 100vh; overflow: auto; border-radius: 18px 0 0 18px; box-shadow: -18px 0 44px rgba(15,23,42,.20); transform: translateX(105%) !important; transition: transform .22s ease; }
  .storeCheckoutPanel.open { transform: translateX(0) !important; }
  #closeCheckoutBtn { display: inline-flex; }
}
.storeEmpty { grid-column: 1 / -1; display: grid; place-items: center; gap: 8px; min-height: 220px; padding: 22px; border: 1px dashed var(--line); border-radius: 18px; background: #fff; color: var(--muted); text-align: center; }
.storeEmpty strong { color: var(--ink); font-size: 18px; }
.locationOk { color: #15803d !important; }
.addressConfirmBox .warnText { color: #b45309 !important; }


/* Phase 46: professional mobile store card actions beside item name */
.mobileProductCard { position: relative; display: grid; grid-template-columns: 76px minmax(0,1fr); gap: 10px; align-items: start; }
.mobileProductTop { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.mobileProductTop h3 { flex: 1; padding-right: 0 !important; margin: 0; line-height: 1.25; }
.mobileProductTop .cardQtyControl { position: static; flex: 0 0 auto; display: grid; grid-template-columns: 30px 38px 30px; align-items: center; border: 1px solid var(--brand); border-radius: 999px; overflow: hidden; background: #fff; }
.mobileProductTop .cardQtyControl:not(.active) { grid-template-columns: 0 58px 30px; }
.mobileProductTop .cardQtyControl:not(.active) button:first-child { display: none; }
.mobileProductTop .cardQtyControl span { text-align: center; font-size: 12px; font-weight: 900; color: var(--brand-dark); }
.mobileProductTop .cardQtyControl button { border: 0; border-radius: 0; padding: 6px 0; color: var(--brand-dark); background: #ecfdf5; font-weight: 900; }

/* Phase 168 ERP item polish */
.itemToolbar{
  grid-template-columns:minmax(280px,1fr) auto auto auto auto auto!important;
  align-items:center;
}
.compactAction{
  width:auto!important;
  min-width:unset!important;
  min-height:36px!important;
  padding:8px 11px!important;
  border-radius:8px!important;
  white-space:nowrap;
  font-size:13px;
}
.fileAction.compactAction{
  display:inline-grid!important;
  place-items:center;
}
.audienceRateMatrix{
  display:grid;
  gap:10px;
}
.audienceRateCard{
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  padding:10px;
}
.audienceRateHead{
  display:grid;
  grid-template-columns:minmax(140px,1fr) minmax(160px,240px);
  gap:8px;
  align-items:center;
  margin-bottom:8px;
}
.audienceRateHead strong{font-size:14px}
.audienceSlabRows{
  display:grid;
  grid-template-columns:repeat(18,minmax(70px,1fr));
  gap:6px;
}
.audienceSlabRows label{
  gap:3px;
  font-size:11px;
}
.audienceSlabRows input,.audienceSlabRows select{
  min-height:34px;
  padding:7px 8px;
  border-radius:7px;
}
.bulkSheet input[data-bulk-field$="Slabs"]{min-width:190px}
.posScanStrip #scanCode{display:none}
.posScanStrip{grid-template-columns:auto!important;justify-content:start}
.compactDetails summary{
  display:inline-flex;
  align-items:center;
  width:auto;
  padding:8px 11px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
}
.compactDetails .posFieldToggles{margin-top:8px}
.purchaseUnifiedSearch{grid-template-columns:minmax(260px,1fr) auto auto!important}
#purchaseItem{display:none}
.posLineTools,
.purchaseUnifiedSearch,
.posItemStrip,
.purchaseLineEditor{
  border:1px solid var(--line);
  background:#fbfdff;
  border-radius:8px;
  padding:8px;
}
.posItemStrip,
.purchaseLineEditor{
  align-items:end;
}
.posBillTable,
#purchasePanel .tableWrap.compact{
  border-top-left-radius:0;
  border-top-right-radius:0;
  margin-top:-1px;
}
.posBillTable thead th,
#purchasePanel .tableWrap.compact thead th{
  background:#eef6f4;
  color:#1f2937;
  font-size:12px;
  text-transform:uppercase;
}
.orderCenterBody .rowActions,
#orderCenterBody .rowActions{display:flex;gap:6px;flex-wrap:wrap}
.reportCatalogGrid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(190px,1fr));
  gap:8px;
}
.reportCatalogGrid button{
  min-height:44px;
  text-align:left;
  border-radius:8px;
}

@media(max-width:900px){
  .itemToolbar{
    grid-template-columns:1fr auto auto!important;
    gap:7px;
  }
  .itemToolbar #itemSearch{grid-column:1/-1}
  .compactAction{
    min-height:38px!important;
    padding:8px 10px!important;
    font-size:12px;
  }
  .audienceRateHead{grid-template-columns:1fr}
  .audienceSlabRows{grid-template-columns:repeat(3,minmax(0,1fr));overflow-x:auto}
  .purchaseUnifiedSearch{grid-template-columns:1fr!important}
  .posShell{display:block}
  .posCheckout{
    border-left:0;
    border-top:1px solid var(--line);
    margin-top:12px;
    border-radius:14px;
  }
  .posTopStrip,
  .invoiceGrid{
    grid-template-columns:1fr!important;
  }
  .posLineTools,
  .purchaseUnifiedSearch,
  .posItemStrip,
  .purchaseLineEditor{
    border-radius:14px;
    padding:10px;
    background:#fff;
    box-shadow:0 8px 22px rgba(16,24,40,.05);
  }
  .posItemStrip,.purchaseLineEditor{
    grid-template-columns:minmax(220px,1.6fr) 72px 72px 90px minmax(146px,1fr) auto!important;
    overflow-x:auto;
    scroll-snap-type:x proximity;
  }
  .posItemStrip > *,
  .purchaseLineEditor > *{scroll-snap-align:start}
  .salesInvoicePanel,
  #purchasePanel{
    margin-left:-4px;
    margin-right:-4px;
    border-radius:16px;
  }
}

/* Main ERP professional device split */
.loginTenantNotice{
  display:grid;
  gap:4px;
  border:1px solid #fed7aa;
  background:#fff7ed;
  color:#9a3412;
  border-radius:8px;
  padding:10px 12px;
  line-height:1.35;
}
.loginTenantNotice span{font-size:13px;color:#9a3412}

@media (min-width: 1024px) {
  body:not(.loggedOut){
    grid-template-columns:280px minmax(0,1fr);
    background:#eef3f8;
  }
  .sidebar{
    position:sticky;
    top:0;
    height:100vh;
    overflow:auto;
    box-shadow:8px 0 28px rgba(15,23,42,.08);
  }
  main{
    min-width:0;
    padding:0 22px 22px;
  }
  .topbar{
    position:sticky;
    top:0;
    z-index:12;
    margin:0 -22px 18px;
    padding:14px 22px;
    background:#fff;
    box-shadow:0 8px 26px rgba(15,23,42,.05);
  }
  .panel,.tableWrap,.metrics article,.quickActionCard{
    border-radius:8px;
    box-shadow:none;
  }
  table th,table td{padding:10px 11px}
}

@media (max-width: 900px) {
  body:not(.loggedOut){
    display:block;
    background:#f2f6fb;
    padding-bottom:82px;
  }
  .sidebar{
    position:fixed!important;
    left:0;
    right:0;
    bottom:0;
    top:auto!important;
    z-index:50;
    height:auto;
    max-height:82px;
    overflow-x:auto;
    overflow-y:hidden;
    padding:8px 8px calc(8px + env(safe-area-inset-bottom));
    display:flex;
    align-items:center;
    gap:8px;
    background:#fff;
    color:var(--ink);
    border-top:1px solid var(--line);
    box-shadow:0 -10px 30px rgba(15,23,42,.12);
  }
  .sidebar .brand{display:none}
  .sidebar nav{display:flex;gap:6px;min-width:max-content}
  .sidebar nav button,.sidebar nav .navLink{
    width:74px;
    min-height:54px;
    padding:7px 6px;
    border:0;
    border-radius:14px;
    display:grid;
    place-items:center;
    text-align:center;
    color:var(--muted);
    background:transparent;
    font-size:11px;
    line-height:1.05;
  }
  .sidebar nav button.active,.sidebar nav button:hover,.sidebar nav .navLink:hover{
    background:#e8f7f3;
    color:var(--brand-dark);
  }
  main{padding:10px}
  .topbar{
    position:sticky;
    top:0;
    z-index:20;
    margin:-10px -10px 12px;
    padding:12px 10px;
    background:#fff;
    border-bottom:1px solid var(--line);
  }
  .metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
  .panel,.tableWrap,.metrics article{
    border-radius:14px;
    box-shadow:0 8px 22px rgba(16,24,40,.05);
  }
  .toolbar,.rowActions,.formGrid,.twoCol,.threeCol{
    grid-template-columns:1fr!important;
  }
  .tableWrap{overflow:auto}
  table{min-width:760px}
  button,input,select,textarea{min-height:42px}
}

/* Phase 169 final override */
.posScanStrip.scannerStrip{grid-template-columns:auto!important;justify-content:start}
.posScanStrip.scannerStrip #cameraScanBtn{width:auto}
.posItemStrip input.hidden,.posItemStrip select.hidden,.purchaseLineEditor input.hidden,.purchaseLineEditor select.hidden{display:none!important}
.posItemStrip .discountPair,.purchaseLineEditor .discountPair{min-width:150px}
.purchaseUnifiedSearch{grid-template-columns:minmax(260px,1fr) auto!important}
.purchaseUnifiedSearch .scannerFrame{grid-column:1/-1}
@media (max-width:900px){
  .posItemStrip,.purchaseLineEditor{grid-template-columns:1fr 74px 74px 86px minmax(138px,1fr) auto;overflow-x:auto}
  .posItemPick{min-width:220px}
  .purchaseUnifiedSearch{grid-template-columns:1fr auto!important}
}

/* Phase 170 scanner-in-input and report grouping polish */
.posItemPick,
.purchaseItemPick{
  position:relative;
}
.posItemPick input,
.purchaseItemPick input{
  padding-right:46px;
}
.scanInsideBtn{
  position:absolute;
  right:6px;
  top:50%;
  transform:translateY(-50%);
  width:34px!important;
  min-width:34px!important;
  height:34px!important;
  min-height:34px!important;
  padding:0!important;
  border-radius:8px!important;
  display:grid;
  place-items:center;
  background:#ecfdf5!important;
  border-color:#b7d7d2!important;
}
.scannerGlyph{
  width:18px;
  height:18px;
  position:relative;
  display:block;
  border:2px solid #0f766e;
  border-radius:4px;
}
.scannerGlyph::before{
  content:"";
  position:absolute;
  left:2px;
  right:2px;
  top:7px;
  height:2px;
  background:#dc2626;
  box-shadow:0 0 8px rgba(220,38,38,.45);
}
.scannerGlyph::after{
  content:"";
  position:absolute;
  left:4px;
  right:4px;
  bottom:3px;
  height:2px;
  background:#0f766e;
}
.posItemStrip,
.purchaseLineEditor{
  grid-template-columns:minmax(250px,2fr) repeat(3,74px) minmax(138px,.8fr) repeat(auto-fit,minmax(92px,.5fr)) 58px!important;
  gap:7px!important;
}
.posItemStrip button#addLineBtn,
.purchaseLineEditor button#addPurchaseLineBtn{
  width:58px!important;
  min-width:58px!important;
  padding-inline:8px!important;
}
#purchaseQuickAddItemBtn{
  width:auto!important;
  min-width:72px!important;
  padding-inline:10px!important;
}
.reportGroup{
  display:grid;
  gap:8px;
  margin-top:12px;
}
.reportGroup h4{
  margin:0;
  font-size:14px;
  color:var(--brand-dark);
}
.gstReportGroup{
  padding-top:12px;
  border-top:1px solid var(--line);
}
.billDiscountControl{
  display:grid!important;
  grid-template-columns:1fr 58px minmax(80px,1fr);
  gap:6px;
  align-items:center;
}
.billDiscountControl select,
.billDiscountControl input{
  min-height:34px;
  padding:6px 8px;
}
.reportResultTable{
  margin-top:12px;
}

/* Phase 199 ERP app/desktop polish final override */
.posLineTools,.purchaseUnifiedSearch,.posItemStrip,.purchaseLineEditor{border:1px solid var(--line);background:#fbfdff;border-radius:8px;padding:8px;align-items:end}
.posBillTable thead th,#purchasePanel .tableWrap.compact thead th{background:#eef6f4;color:#1f2937;font-size:12px;text-transform:uppercase}
#orderCenterBody button{padding:7px 10px;font-size:12px;margin-right:4px}
@media(max-width:900px){
  .posShell{display:block!important}.posCheckout{border-left:0;border-top:1px solid var(--line);margin-top:12px;border-radius:14px}.posTopStrip,.invoiceGrid{grid-template-columns:1fr!important}
  .posLineTools,.purchaseUnifiedSearch,.posItemStrip,.purchaseLineEditor{border-radius:14px;padding:10px;background:#fff;box-shadow:0 8px 22px rgba(16,24,40,.05)}
  .posItemStrip,.purchaseLineEditor{grid-template-columns:minmax(220px,1.6fr) 72px 72px 90px minmax(146px,1fr) auto!important;overflow-x:auto;scroll-snap-type:x proximity}
  .salesInvoicePanel,#purchasePanel{margin-left:-4px;margin-right:-4px;border-radius:16px}.posItemStrip>*,.purchaseLineEditor>*{scroll-snap-align:start}
}
/* Phase 226: party GST/role/delete professional controls */
.partyRoleSelect{min-width:130px;height:34px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;font-weight:800;color:#0f172a;padding:0 10px;}
.gstValue{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.02em;color:#0f766e;}
.partyActions{display:flex;gap:8px;align-items:center;white-space:nowrap;}
button.danger, .danger{border-color:#fecaca!important;color:#b91c1c!important;background:#fff5f5!important;}
button.danger:hover{background:#fee2e2!important;}
:root {
  --ink: #162033;
  --muted: #647087;
  --line: #e3e8ef;
  --panel: #ffffff;
  --bg: #f4f7fb;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --warn: #b45309;
}

* { box-sizing: border-box; }
.hidden { display: none !important; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
}

body.loggedOut {
  display: block;
}
body.loggedOut .sidebar,
body.loggedOut main {
  display: none !important;
}

.loginScreen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(17, 24, 39, 0.86);
  padding: 20px;
}
.loginBox {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 22px;
  display: grid;
  gap: 14px;
}
.loginBox h1 { font-size: 24px; }
.loginBox p, .loginBox small { color: var(--muted); }
.signupBody {
  display: block;
  min-height: 100vh;
  background: #eef3f8;
}
.signupShell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-columns: minmax(260px, .7fr) minmax(520px, 1.3fr);
  gap: 18px;
}
.signupIntro,
.signupPanel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
}
.signupIntro {
  display: grid;
  align-content: start;
  gap: 14px;
}
.signupIntro h1 {
  font-size: 34px;
  line-height: 1.1;
}
.signupIntro p {
  color: var(--muted);
  line-height: 1.5;
}
.signupPlans {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.signupPlan {
  display: grid;
  gap: 5px;
  text-align: left;
  min-height: 132px;
  border-radius: 8px;
}
.signupPlan.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.16);
}
.signupPlan span {
  font-weight: 900;
}
.signupPlan strong {
  font-size: 22px;
  color: var(--brand-dark);
}
.signupPlan small,
.signupPlan em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}
.signupForm {
  display: grid;
  gap: 14px;
}
.signupPayBox {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid #b7d7d2;
  border-radius: 8px;
  background: #f0fdfa;
}
.signupPayBox span,
.signupPayBox small {
  color: var(--muted);
}
.signupPayBox strong {
  font-size: 28px;
  color: var(--brand-dark);
}
.signupResult {
  min-height: 22px;
  color: var(--brand-dark);
  font-weight: 800;
}

.sidebar {
  background: #111827;
  color: #fff;
  padding: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 800;
}

h1, h2, h3, p { margin: 0; }
.brand h1 { font-size: 18px; }
.brand p { color: #aeb8c8; font-size: 13px; margin-top: 2px; }

nav { display: grid; gap: 6px; }
nav button {
  border: 0;
  color: #dbe3ef;
  background: transparent;
  padding: 12px 10px;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
}
nav .navLink {
  display: block;
  color: #dbe3ef;
  background: transparent;
  padding: 12px 10px;
  text-align: left;
  border-radius: 8px;
  font-size: 15px;
  text-decoration: none;
}
nav button.active, nav button:hover { background: #223047; color: #fff; }
nav .navLink:hover { background: #223047; color: #fff; }
nav button.lockedNav {
  opacity: 0.62;
  position: relative;
}
nav button.lockedNav::after {
  content: "Upgrade";
  float: right;
  color: #f7d36f;
  font-size: 11px;
  font-weight: 800;
}

main { min-width: 0; }
.topbar {
  height: 82px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.eyebrow {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}
.actions { display: flex; gap: 10px; }
button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
}
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }

.view { display: none; padding: 22px; }
.view.active { display: block; }

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.metrics article, .panel, .tableWrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.metrics article { padding: 16px; }
.metrics span { display: block; color: var(--muted); font-size: 13px; }
.metrics strong { display: block; font-size: 28px; margin-top: 8px; }

.panel { padding: 16px; margin-bottom: 16px; }
.panel h3 { margin-bottom: 8px; }
.panel p { color: var(--muted); line-height: 1.5; }
.roadmap { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.roadmap span {
  background: #e6f5f3;
  color: var(--brand-dark);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.toolbar { margin-bottom: 12px; }
.toolbar.split {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.itemToolbar {
  grid-template-columns: minmax(260px, 1fr) auto auto auto auto auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.itemToolbar input {
  background: #f8fafc;
}
.itemToolbar .checkLine {
  margin: 0;
  height: 100%;
  padding: 0 8px;
  white-space: nowrap;
}
.itemToolbar button {
  min-width: 110px;
  height: 42px;
}
.fileAction {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.fileAction input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.bulkActionBar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.bulkActionBar span {
  color: var(--muted);
  font-weight: 800;
}
.bulkEditPanel { margin-bottom: 12px; }
.bulkEditTools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.bulkSheetWrap {
  max-height: 520px;
  overflow: auto;
  border-radius: 8px;
}
.bulkSheet {
  min-width: 1380px;
}
.bulkSheet th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
}
.bulkSheet input,
.bulkSheet select {
  min-width: 96px;
  height: 34px;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 13px;
}
.bulkSheet td:first-child input { min-width: 170px; }
.bulkSheet td:nth-child(2) input { min-width: 220px; }
.bulkSheet input[type="checkbox"] {
  min-width: 16px;
  width: 16px;
  height: 16px;
  padding: 0;
}
.storagePanel {
  border-left: 4px solid var(--brand);
}
.storageGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.storageGrid article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.storageGrid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.storageGrid strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.storagePaths {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
}
.storagePaths input {
  font-size: 12px;
  background: #f8fafc;
  color: var(--ink);
}
.selectCol { width: 34px; }
.itemSelect {
  width: 16px;
  height: 16px;
}
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
}
select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  background: #fff;
  font-family: inherit;
}
textarea { min-height: 72px; resize: vertical; margin-top: 12px; }
label { color: var(--muted); font-size: 13px; display: grid; gap: 6px; }
.inlineForm { display: none; }
.inlineForm.open { display: block; }
.formGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}
.formGrid.twoCols { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
.checkLine {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.checkLine input { width: auto; }
.partyHero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.partyHero h2 {
  font-size: 25px;
  line-height: 1.2;
}
.partyStats {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.partyStats article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.partyStats span {
  color: var(--muted);
  font-size: 13px;
}
.partyStats strong {
  display: block;
  margin-top: 6px;
  font-size: 23px;
}
.partyToolbar {
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.partyEditor {
  padding: 18px;
  border-color: #cfd8e3;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}
.partyEditorGrid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, .9fr);
  gap: 18px;
}
.partyEditor h4 {
  margin: 0 0 12px;
  font-size: 15px;
}
.partyEditor textarea {
  margin-top: 0;
  min-height: 122px;
}
.partyTable table { min-width: 980px; }
.partyCell {
  display: grid;
  gap: 4px;
  max-width: 280px;
}
.partyCell strong {
  color: var(--ink);
  font-weight: 800;
}
.partyCell small {
  color: var(--muted);
  line-height: 1.35;
}
.partyType.retailer, .partyType.dealer { background: #e6f5f3; color: var(--brand-dark); }
.partyType.distributor { background: #eaf2ff; color: #1d4ed8; }
.partyType.supplier { background: #fff7ed; color: #b45309; }
.partyType.customer { background: #f1f5f9; color: #334155; }
.itemListThumb {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #f8fafc;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
}
.itemListThumb.empty {
  padding: 4px;
  text-align: center;
}

.tableWrap {
  overflow: auto;
}
.tableWrap.compact { margin-top: 12px; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
th, td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}
th {
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  position: sticky;
  top: 0;
}
td { font-size: 14px; }
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf2f7;
  color: #475569;
  font-size: 12px;
}
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: var(--warn); }
.linkBtn {
  display: inline-block;
  color: var(--brand-dark);
  font-weight: 700;
  text-decoration: none;
}
.rowActions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rowActions button {
  padding: 6px 9px;
  font-size: 12px;
}
.sectionGap { margin-top: 18px; }
.reportGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.storeBody {
  display: block;
  background: var(--bg);
  min-height: 100vh;
}
.storeHero {
  background: #111827;
  color: #fff;
  padding: 22px clamp(16px, 4vw, 42px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.storeHero h1 { font-size: 28px; }
.storeHero p { color: #cbd5e1; margin-top: 4px; }
.storeShell {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  padding: 20px clamp(16px, 4vw, 42px);
}
.productGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.productCard, .cartPanel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.productThumb {
  width: 100%;
  height: 120px;
  border-radius: 8px;
  background: #edf2f7;
  color: var(--muted);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  object-fit: cover;
}
.productCard h3 { font-size: 16px; min-height: 40px; }
.productCard p, .mutedText { color: var(--muted); font-size: 13px; line-height: 1.4; }
.productMeta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 0;
  color: var(--muted);
}
.productMeta strong { color: var(--ink); }
.cartPanel {
  position: sticky;
  top: 16px;
  align-self: start;
  display: grid;
  gap: 12px;
}
.cartLine {
  display: grid;
  grid-template-columns: 1fr 64px auto auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.cartLine input { padding: 8px; }
.featureMatrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.featureMatrix article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.featureMatrix h4 { margin: 0 0 6px; }
.featureMatrix strong { display: block; margin-bottom: 10px; color: var(--brand-dark); }
.featureMatrix div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.featureMatrix span {
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 5px 7px;
  border-radius: 999px;
  font-size: 12px;
}
.featureMatrix span.enabled {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

.alertGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.alertGrid h4 {
  margin: 0 0 8px;
}
.alertList {
  display: grid;
  gap: 8px;
}
.alertList article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}
.alertList strong,
.alertList span {
  display: block;
}
.alertList span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.permissionMatrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.permissionMatrix article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.permissionMatrix h4 {
  margin: 0 0 8px;
}
.subPanel {
  margin-top: 12px;
  padding: 12px;
}
.slabGrid {
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  gap: 10px;
}
.itemEditor {
  border-radius: 14px;
  padding: 16px;
  background: #f8fafc;
}
.itemEditorGrid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}
.itemEditorMain,
.itemEditorSide,
.sideStack {
  display: grid;
  gap: 12px;
}
.formSection {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.sectionHead {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.sectionHead h4 {
  margin: 0;
  color: var(--ink);
}
.sectionHead span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}
.span2 { grid-column: span 2; }
.checkTile {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
}
.checkTile input { width: auto; }
.proSlabs {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}
.proSlabs label {
  display: grid;
  gap: 5px;
}
.proSlabs label span {
  color: var(--muted);
  font-size: 12px;
}
.quickMaster {
  display: grid;
  gap: 8px;
}
.quickRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.quickRow.three {
  grid-template-columns: minmax(0, 1fr) 72px auto;
}
.quickMaster button {
  min-width: 62px;
  padding-left: 10px;
  padding-right: 10px;
}
.compactSide {
  gap: 8px;
}
.compactSide label {
  display: grid;
  gap: 5px;
}
.itemPhotoSection {
  background: #0f172a;
  color: #ffffff;
  border-color: #1e293b;
}
.itemPhotoSection .sectionHead h4,
.itemPhotoSection .sectionHead span {
  color: #ffffff;
}
.itemPhotoBox {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  background: #111827;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 10px;
}
.itemPhotoBox img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.itemPhotoBox span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}
.filePick {
  display: grid;
  place-items: center;
  min-height: 40px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  margin-bottom: 8px;
}
.filePick input {
  display: none;
}
.itemEditorFooter {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 14px -16px -16px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.cameraPreview {
  width: min(420px, 100%);
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  margin-top: 10px;
  background: #111827;
}
.paymentSplit {
  grid-column: span 3;
}
.paymentRow {
  display: grid;
  grid-template-columns: 120px 110px minmax(140px, 1fr) minmax(120px, 1fr) auto;
  gap: 8px;
  margin-bottom: 8px;
}

.salesHero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.salesHero h2 {
  font-size: 25px;
  line-height: 1.2;
}
#sales.invoiceMode .salesHero,
#sales.invoiceMode .salesStats,
#sales.invoiceMode .salesRegisterToolbar,
#sales.invoiceMode .salesRegisterTable {
  display: none;
}
#sales.invoiceMode {
  padding: 12px;
}
.salesStats {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.salesStats article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.salesStats span {
  color: var(--muted);
  font-size: 13px;
}
.salesStats strong {
  display: block;
  margin-top: 6px;
  font-size: 23px;
}
.invoicePanel { display: none; }
.invoicePanel.open { display: block; }
.salesInvoicePanel {
  padding: 18px;
  border-color: #cfd8e3;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}
.posInvoicePanel {
  padding: 0;
  overflow: hidden;
  background: #eef3f8;
  border-radius: 8px;
}
.posHeader {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}
.posHeader h3 {
  font-size: 18px;
  margin-bottom: 3px;
}
.panelHead {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.salesFormGrid {
  display: grid;
  grid-template-columns: minmax(360px, 1.4fr) minmax(280px, .8fr);
  gap: 14px;
}
.salesBlock {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}
.salesBlock h4, .salesBlockHead h4 {
  margin: 0 0 12px;
  font-size: 15px;
}
.salesBlockHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.salesBlockHead span {
  color: var(--brand-dark);
  font-weight: 800;
}
.invoiceGrid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
}
.scanBar {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 8px;
}
.lineEditor {
  display: grid;
  grid-template-columns: 2fr 120px 140px 140px auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}
.saleLineMain {
  grid-template-columns: minmax(260px, 2fr) 100px 100px 120px 120px auto;
}
.saleLineMeta {
  grid-template-columns: repeat(7, minmax(110px, 1fr));
}
.salesHintBar {
  margin: 10px 0 4px;
}
.salesLinesTable table { min-width: 900px; }
.posShell {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) 360px;
  min-height: 620px;
}
.posWorkArea {
  min-width: 0;
  padding: 14px;
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(260px, 1fr);
  gap: 10px;
}
.posTopStrip,
.posScanStrip,
.posItemStrip,
.posInfoStrip {
  display: grid;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}
.posTopStrip {
  grid-template-columns: minmax(280px, 2fr) minmax(130px, .8fr) minmax(130px, .8fr) minmax(130px, .8fr);
}
.posPartyPick {
  position: relative;
  min-width: 0;
}
.posItemPick {
  position: relative;
}
.searchResults {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  max-height: 320px;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.18);
}
.searchResults button {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  border-radius: 0;
  text-align: left;
}
.searchResults button:hover {
  background: #e6f5f3;
}
.searchResults strong {
  color: var(--ink);
}
.searchResults span,
.emptyResult {
  color: var(--muted);
  font-size: 12px;
}
.emptyResult {
  padding: 12px;
}
.pickWithAction {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
}
.quickPartyBox {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, .7fr) auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid #b7d7d2;
  border-radius: 8px;
  background: #f0fdfa;
}
.posScanStrip {
  grid-template-columns: minmax(260px, 1fr) auto auto;
}
.posScanStrip input {
  min-height: 46px;
  font-size: 16px;
  font-weight: 700;
}
.posItemStrip {
  grid-template-columns: minmax(320px, 2fr) 92px 92px 110px 100px auto;
}
.posItemPick { min-width: 0; }
.posItemStrip input,
.posItemStrip select,
.posItemStrip button,
.posTopStrip input,
.posTopStrip select {
  min-height: 42px;
}
.posOptional {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
}
.posOptional summary {
  padding: 10px 12px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}
.posOptional .saleLineMeta {
  margin: 0;
  padding: 0 10px 10px;
}
.posFieldToggles {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 8px;
  padding: 0 10px 10px;
}
.posFieldToggles label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #f8fafc;
}
.posFieldToggles input {
  width: auto;
}
.posInfoStrip {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}
.posInfoStrip .checkLine {
  margin: 0;
  white-space: nowrap;
}
.posBillTable {
  margin: 0;
  min-height: 260px;
  background: #ffffff;
}
.posBillTable table {
  min-width: 760px;
}
.posCheckout {
  min-width: 0;
  padding: 14px;
  border-left: 1px solid var(--line);
  background: #ffffff;
  display: grid;
  grid-template-rows: auto auto auto minmax(140px, 1fr) auto auto;
  gap: 12px;
}
.posCustomerCard,
.posLineTotal {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.posCustomerCard span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}
.posCustomerCard strong {
  display: block;
  line-height: 1.35;
}
.posLineTotal {
  color: var(--brand-dark);
  font-size: 18px;
  font-weight: 900;
}
.posTotals {
  padding: 14px;
}
.posTotals span {
  font-size: 14px;
}
.posTotals .grandTotal {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 18px;
  color: var(--ink);
}
.posTotals .grandTotal strong {
  font-size: 22px;
}
.posTotals .balanceDue {
  color: #b45309;
  font-weight: 800;
}
.posPayments {
  grid-column: auto;
}
.posPayments .panelHead {
  margin-bottom: 8px;
}
.posPayments .paymentRow {
  grid-template-columns: 1fr 1fr;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}
.posPayments .paymentRow input,
.posPayments .paymentRow select,
.posPayments .paymentRow button {
  min-width: 0;
}
.posPayments .paymentRow button {
  grid-column: 1 / -1;
}
.posCheckout textarea {
  margin-top: 0;
  min-height: 76px;
}
.posSaveBtn {
  min-height: 52px;
  font-size: 16px;
  font-weight: 900;
}
.invoiceFoot {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr)) 1.4fr;
  gap: 12px;
  margin-top: 14px;
  align-items: start;
}
.totals {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}
.totals span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}
.totals strong { color: var(--ink); }
.salesRegisterToolbar {
  grid-template-columns: minmax(260px, 1fr) minmax(140px, 170px) minmax(130px, 160px) minmax(130px, 160px) minmax(130px, 160px);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.salesRegisterTable table { min-width: 860px; }
.actions.right { justify-content: flex-end; margin-top: 12px; }

.printBody {
  display: block;
  background: #e5e7eb;
  min-height: 100vh;
}
.printPage {
  max-width: 900px;
  margin: 24px auto;
}
.printActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}
.bill {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}
.billHead {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 16px;
}
.billHead h1 { font-size: 24px; }
.smallText { font-size: 12px; color: var(--muted); margin-top: 4px; }
.billMeta, .billParty, .billTotals {
  display: grid;
  gap: 5px;
}
.billMeta { text-align: right; }
.billParty {
  margin: 18px 0;
  color: var(--muted);
}
.billParty strong { color: var(--ink); }
.billTable { min-width: 0; }
.billTotals {
  margin-left: auto;
  margin-top: 16px;
  width: min(320px, 100%);
}
.billTotals span {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 7px 0;
}
.billPayments {
  margin-left: auto;
  margin-top: 12px;
  width: min(360px, 100%);
  display: grid;
  gap: 5px;
  color: var(--muted);
}
.billPayments strong { color: var(--ink); }
.billQr {
  margin-left: auto;
  margin-top: 16px;
  width: min(360px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.billQr img {
  width: 112px;
  height: 112px;
}
.billQr div {
  display: grid;
  gap: 5px;
}
.billQr span {
  color: var(--muted);
  font-size: 12px;
}
.billFoot {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.billNotes {
  margin-top: 18px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.catalogPage {
  max-width: 1120px;
}
.catalogGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.catalogCard {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
  min-height: 170px;
}
.catalogThumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  display: grid;
  place-items: center;
  object-fit: cover;
  font-size: 12px;
}
.catalogCard strong {
  color: var(--ink);
}
.catalogCard span,
.catalogCard p,
.catalogMeta {
  color: var(--muted);
  font-size: 12px;
}
.catalogMeta,
.catalogSlabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.catalogMeta span,
.catalogSlabs span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: #f8fafc;
}
.catalogSlabs strong {
  color: var(--brand);
}

.catalogAppBody {
  display: block;
  min-height: 100vh;
  background: #eef2f7;
}
.catalogApp {
  min-height: 100vh;
  padding-bottom: 92px;
}
.catalogAppHeader {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  padding: 14px clamp(14px, 4vw, 28px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.catalogAppHeader h1 {
  font-size: 22px;
  margin: 2px 0 0;
}
.catalogBrandHead {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.catalogBrandHead h1,
.catalogBrandHead p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.catalogLogo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #0f766e;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0;
  flex: 0 0 auto;
}
.catalogEyebrow {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}
.catalogHero,
.catalogSearchBar,
.catalogMain,
.catalogSheet,
.catalogCartPanel {
  width: min(1180px, calc(100% - 24px));
  margin-left: auto;
  margin-right: auto;
}
.catalogHero {
  margin-top: 12px;
  background: linear-gradient(135deg, #0f766e, #1d4ed8);
  color: #ffffff;
  border-radius: 14px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}
.catalogHero span {
  display: block;
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  margin-top: 4px;
}
.catalogHeroActions {
  display: flex;
  gap: 8px;
}
.catalogHeroActions input {
  min-width: 180px;
}
.catalogMain {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.catalogSearchBar {
  position: sticky;
  top: 71px;
  z-index: 15;
  background: #eef2f7;
  padding: 10px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px) minmax(150px, 220px);
  gap: 10px;
}
.catalogProductGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.catalogAppCard {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.catalogCardBody {
  min-width: 0;
  display: grid;
  gap: 8px;
}
.catalogCardBody strong {
  color: var(--ink);
}
.catalogCardBody span,
.catalogCardBody p {
  color: var(--muted);
  font-size: 12px;
}
.catalogNotice,
.catalogOrdersPanel,
.catalogSheet,
.catalogCartPanel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.catalogOrderList,
.catalogCartList {
  display: grid;
  gap: 8px;
}
.catalogOrderCard,
.catalogCartItem {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 6px;
}
.catalogOrderCard {
  grid-template-columns: 1fr auto;
}
.catalogOrderCard p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.catalogCartItem {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}
.catalogCartItem span {
  color: var(--muted);
  font-size: 12px;
}
.catalogSheet,
.catalogCartPanel {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translate(-50%, 120%);
  z-index: 50;
  max-height: min(76vh, 720px);
  overflow: auto;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
  transition: transform 180ms ease;
}
.catalogSheet.open,
.catalogCartPanel.open {
  transform: translate(-50%, 0);
}
.catalogForm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.catalogBottomBar {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 24px));
  z-index: 45;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.2);
}
.fullBtn {
  width: 100%;
}
.catalogOrderPanel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 12px;
}
.catalogOrderPanel h3 {
  margin: 0;
}
.catalogBuy {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto;
  gap: 8px;
  margin-top: auto;
}
.catalogBuy input {
  min-width: 0;
}

@media print {
  .printActions, .catalogOrderPanel, .catalogBuy { display: none; }
  .printBody { background: #fff; }
  .printPage { margin: 0; max-width: none; }
  .bill { border: 0; border-radius: 0; padding: 0; }
}

@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .invoiceGrid, .lineEditor, .invoiceFoot, .formGrid, .formGrid.twoCols, .toolbar.split, .reportGrid, .storeShell, .alertGrid, .slabGrid, .paymentRow, .salesFormGrid, .salesStats, .saleLineMain, .saleLineMeta, .scanBar, .posShell, .posTopStrip, .posScanStrip, .posItemStrip, .posInfoStrip, .quickPartyBox, .posFieldToggles, .signupShell, .signupPlans { grid-template-columns: 1fr; }
  .salesHero { align-items: flex-start; flex-direction: column; }
  .posShell { min-height: 0; }
  .posCheckout { border-left: 0; border-top: 1px solid var(--line); }
  .posWorkArea { grid-template-rows: auto; }
  .cartPanel { position: static; }
  .itemEditorGrid { grid-template-columns: 1fr; }
  .itemToolbar { grid-template-columns: 1fr; }
  .itemToolbar .checkLine { padding: 0; }
  .quickRow,
  .quickRow.three { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .sectionHead { display: grid; }
  .sectionHead span { text-align: left; }
  .itemEditorFooter { display: grid; }
  .catalogHero { grid-template-columns: 1fr; }
  .catalogAppHeader h1 { font-size: 18px; }
  .catalogHeroActions { display: grid; grid-template-columns: 1fr auto; }
  .catalogHeroActions input { min-width: 0; }
  .catalogSearchBar { top: 64px; grid-template-columns: 1fr; }
  .catalogProductGrid { grid-template-columns: 1fr; }
  .catalogAppCard { grid-template-columns: 86px minmax(0, 1fr); }
  .catalogForm { grid-template-columns: 1fr; }
  .catalogOrderCard { grid-template-columns: 1fr; }
  .catalogCartItem { grid-template-columns: 1fr auto; }
  .catalogCartItem button { grid-column: 1 / -1; }
}
/* Phase-40 Online Store Pro */
.storeProHero { align-items: center; }
.storeHeroRight { display: grid; gap: 6px; justify-items: end; }
.storeProShell { grid-template-columns: minmax(0,1fr) 380px; align-items: start; }
.storeSearchLine { position: sticky; top: 0; z-index: 2; background: var(--bg); padding-top: 8px; }
.storeProductCard .priceStack { display: grid; gap: 3px; margin: 8px 0; }
.priceStack strong { font-size: 20px; color: var(--brand-dark); }
.mrpCut { color: var(--muted); text-decoration: line-through; }
.priceStack em { color: #15803d; font-style: normal; font-weight: 800; font-size: 12px; }
.storeProCart { display: grid; gap: 14px; position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow: auto; }
.storeAuthPanel, .checkoutBox { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; display: grid; gap: 10px; }
.tabLine { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tabLine button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.storeAuthBox { display: grid; gap: 10px; }
.paymentChoice { display: flex; gap: 14px; flex-wrap: wrap; }
.upiBox { display: grid; gap: 8px; justify-items: center; }
.qrBox img { width: 180px; height: 180px; border: 1px solid var(--line); border-radius: 8px; }
.cartLine span small { display: block; color: #15803d; font-size: 11px; margin-top: 2px; }
.orderStatusList { display: grid; gap: 8px; }
.orderStatusCard { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 4px; }
.orderStatusCard span, .orderStatusCard small { color: var(--muted); }
@media (max-width: 900px) { .storeProShell { grid-template-columns: 1fr; } .storeProCart { position: static; max-height: none; } }

/* Phase 41: Mobile store app feel */
.storeMobileBody { padding-bottom: 86px; }
.storeMobileHero { position: sticky; top: 0; z-index: 8; padding: 14px 16px; }
.storeMobileHero h1 { font-size: 20px; }
.storeMobileHero p { font-size: 12px; }
.storeMobileShell { width: min(1180px, 100%); padding: 10px; }
.storeMobileSearch { position: sticky; top: 72px; z-index: 7; padding: 8px 0; background: var(--bg); }
.storeMobileSearch input { min-height: 46px; border-radius: 14px; }
.storeMobileGrid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.mobileProductCard { position: relative; display: grid; grid-template-columns: 76px 1fr; gap: 10px; padding: 10px; border-radius: 14px; }
.mobileProductCard .productThumb { width: 76px; height: 76px; border-radius: 12px; }
.mobileProductCard h3 { min-height: auto; font-size: 14px; padding-right: 74px; }
.mobileProductCard p { font-size: 12px; max-height: 34px; overflow: hidden; }
.mobileProductCard .priceStack { display: flex; flex-wrap: wrap; gap: 5px 8px; align-items: baseline; margin-top: 4px; }
.cardQtyControl { position: absolute; right: 10px; top: 10px; display: grid; grid-template-columns: 32px 42px 32px; align-items: center; border: 1px solid var(--brand); border-radius: 999px; overflow: hidden; background: #fff; }
.cardQtyControl span { text-align: center; font-size: 12px; font-weight: 800; color: var(--brand-dark); }
.cardQtyControl button { border: 0; border-radius: 0; padding: 7px 0; color: var(--brand-dark); background: #ecfdf5; font-weight: 900; }
.cardQtyControl:not(.active) { grid-template-columns: 0 58px 32px; }
.cardQtyControl:not(.active) button:first-child { display: none; }
.storeBottomBar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 16px 44px rgba(15,23,42,.22); }
.storeBottomBar div { display: grid; gap: 2px; }
.storeBottomBar span { font-weight: 900; color: var(--brand-dark); }
.storeBottomBar small { color: #15803d; }
.storeCheckoutPanel { display: grid; gap: 12px; }
.mobileCartLine { grid-template-columns: minmax(0,1fr) auto auto; gap: 8px; }
.miniQty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.miniQty button { border: 0; border-radius: 0; padding: 6px 10px; background: #f8fafc; font-weight: 900; }
.miniQty strong { min-width: 28px; text-align: center; }
.compactHead { align-items: center; }
.warnText { color: #b45309 !important; font-weight: 800; }
.checkoutOpen .storeBottomBar { display: none; }
@media (max-width: 900px) {
  .storeMobileShell { display: block; }
  .storeCheckoutPanel { position: fixed !important; inset: auto 0 0 0; z-index: 30; max-height: 92vh; overflow: auto; border-radius: 22px 22px 0 0; transform: translateY(110%); transition: transform .22s ease; box-shadow: 0 -16px 44px rgba(15,23,42,.25); }
  .storeCheckoutPanel.open { transform: translateY(0); }
  .storeMobileGrid { grid-template-columns: 1fr; }
  .storeMobileHero { border-radius: 0 0 16px 16px; }
}
@media (min-width: 901px) {
  .storeCheckoutPanel { position: sticky; top: 14px; transform: none !important; }
  #closeCheckoutBtn { display: none; }
}


/* Phase 42: professional mobile store cleanup */
.storeMobileHero p { color: var(--muted); }
.storeCheckoutPanel { display: none; }
.storeCheckoutPanel.open { display: grid; }
@media (min-width: 901px) {
  .storeProShell { grid-template-columns: 1fr; }
  .storeCheckoutPanel { position: fixed !important; inset: 0 0 0 auto; z-index: 30; width: min(430px, 100%); max-height: 100vh; overflow: auto; border-radius: 18px 0 0 18px; box-shadow: -18px 0 44px rgba(15,23,42,.20); transform: translateX(105%) !important; transition: transform .22s ease; }
  .storeCheckoutPanel.open { transform: translateX(0) !important; }
  #closeCheckoutBtn { display: inline-flex; }
}
.storeEmpty { grid-column: 1 / -1; display: grid; place-items: center; gap: 8px; min-height: 220px; padding: 22px; border: 1px dashed var(--line); border-radius: 18px; background: #fff; color: var(--muted); text-align: center; }
.storeEmpty strong { color: var(--ink); font-size: 18px; }
.locationOk { color: #15803d !important; }
.addressConfirmBox .warnText { color: #b45309 !important; }


/* Phase 46: professional mobile store card actions beside item name */
.mobileProductCard { position: relative; display: grid; grid-template-columns: 76px minmax(0,1fr); gap: 10px; align-items: start; }
.mobileProductTop { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.mobileProductTop h3 { flex: 1; padding-right: 0 !important; margin: 0; line-height: 1.25; }
.mobileProductTop .cardQtyControl { position: static; flex: 0 0 auto; display: grid; grid-template-columns: 30px 38px 30px; align-items: center; border: 1px solid var(--brand); border-radius: 999px; overflow: hidden; background: #fff; }
.mobileProductTop .cardQtyControl:not(.active) { grid-template-columns: 0 58px 30px; }
.mobileProductTop .cardQtyControl:not(.active) button:first-child { display: none; }
.mobileProductTop .cardQtyControl span { text-align: center; font-size: 12px; font-weight: 900; color: var(--brand-dark); }
.mobileProductTop .cardQtyControl button { border: 0; border-radius: 0; padding: 6px 0; color: var(--brand-dark); background: #ecfdf5; font-weight: 900; }

/* Main ERP professional device split */
.loginTenantNotice{
  display:grid;
  gap:4px;
  border:1px solid #fed7aa;
  background:#fff7ed;
  color:#9a3412;
  border-radius:8px;
  padding:10px 12px;
  line-height:1.35;
}
.loginTenantNotice span{font-size:13px;color:#9a3412}

@media (min-width: 1024px) {
  body:not(.loggedOut){
    grid-template-columns:280px minmax(0,1fr);
    background:#eef3f8;
  }
  .sidebar{
    position:sticky;
    top:0;
    height:100vh;
    overflow:auto;
    box-shadow:8px 0 28px rgba(15,23,42,.08);
  }
  main{
    min-width:0;
    padding:0 22px 22px;
  }
  .topbar{
    position:sticky;
    top:0;
    z-index:12;
    margin:0 -22px 18px;
    padding:14px 22px;
    background:#fff;
    box-shadow:0 8px 26px rgba(15,23,42,.05);
  }
  .panel,.tableWrap,.metrics article,.quickActionCard{
    border-radius:8px;
    box-shadow:none;
  }
  table th,table td{padding:10px 11px}
}

@media (max-width: 900px) {
  body:not(.loggedOut){
    display:block;
    background:#f2f6fb;
    padding-bottom:82px;
  }
  .sidebar{
    position:fixed!important;
    left:0;
    right:0;
    bottom:0;
    top:auto!important;
    z-index:50;
    height:auto;
    max-height:82px;
    overflow-x:auto;
    overflow-y:hidden;
    padding:8px 8px calc(8px + env(safe-area-inset-bottom));
    display:flex;
    align-items:center;
    gap:8px;
    background:#fff;
    color:var(--ink);
    border-top:1px solid var(--line);
    box-shadow:0 -10px 30px rgba(15,23,42,.12);
  }
  .sidebar .brand{display:none}
  .sidebar nav{display:flex;gap:6px;min-width:max-content}
  .sidebar nav button,.sidebar nav .navLink{
    width:74px;
    min-height:54px;
    padding:7px 6px;
    border:0;
    border-radius:14px;
    display:grid;
    place-items:center;
    text-align:center;
    color:var(--muted);
    background:transparent;
    font-size:11px;
    line-height:1.05;
  }
  .sidebar nav button.active,.sidebar nav button:hover,.sidebar nav .navLink:hover{
    background:#e8f7f3;
    color:var(--brand-dark);
  }
  main{padding:10px}
  .topbar{
    position:sticky;
    top:0;
    z-index:20;
    margin:-10px -10px 12px;
    padding:12px 10px;
    background:#fff;
    border-bottom:1px solid var(--line);
  }
  .metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
  .panel,.tableWrap,.metrics article{
    border-radius:14px;
    box-shadow:0 8px 22px rgba(16,24,40,.05);
  }
  .toolbar,.rowActions,.formGrid,.twoCol,.threeCol{
    grid-template-columns:1fr!important;
  }
  .tableWrap{overflow:auto}
  table{min-width:760px}
  button,input,select,textarea{min-height:42px}
}
.okText{color:#15803d;font-weight:600}.dangerText{color:#b91c1c;font-weight:600}.bulkEditTools label{display:inline-flex;align-items:center;gap:6px}.bulkSheet td:nth-child(1) input{min-width:180px}.bulkSheet td:nth-child(2){min-width:130px;white-space:normal}

/* Phase 219 bulk editor clarity */
.bulkPhotoCell{display:flex;gap:6px;align-items:center;min-width:260px}.bulkPhotoCell input[data-bulk-field="imageData"]{min-width:160px}.miniFileBtn{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border,#d5d7db);border-radius:8px;padding:5px 8px;cursor:pointer;background:#fff;font-size:12px;white-space:nowrap}.miniFileBtn input{display:none}.bulkSheet th small{display:block;font-weight:500;opacity:.72;line-height:1.2}.okText{color:#047857}.dangerText{color:#b91c1c}

/* Phase 222: Excel style one-item-one-line bulk rate slab editor */
.bulkRateLineCell{
  width:820px;
  min-width:820px;
  max-width:820px;
  display:flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
  overflow:visible;
}
.bulkRateLineWrap{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:nowrap;
}
.bulkRateInlineSlab{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:5px 6px;
  border:1px solid rgba(148,163,184,.34);
  border-radius:9px;
  background:rgba(15,23,42,.025);
  white-space:nowrap;
}
.bulkSlabNo{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:20px;
  height:20px;
  border-radius:999px;
  background:rgba(15,23,42,.08);
  font-size:11px;
  font-weight:700;
  flex:0 0 auto;
}
.bulkRateInlineSlab input,.bulkRateInlineSlab select,.bulkRatePartyInline{
  min-height:30px;
  height:30px;
  padding:4px 5px;
  font-size:12px;
}
.bulkRateInlineSlab input[data-bulk-rate-qty]{width:58px;min-width:58px;}
.bulkRateInlineSlab select[data-bulk-rate-unit]{width:88px;min-width:88px;}
.bulkRateInlineSlab select[data-bulk-rate-mode]{width:54px;min-width:54px;}
.bulkRateInlineSlab input[data-bulk-rate-fixed]{width:72px;min-width:72px;}
.bulkRateInlineSlab select[data-bulk-rate-base]{width:118px;min-width:118px;}
.bulkRateInlineSlab input[data-bulk-rate-value]{width:56px;min-width:56px;}
.bulkRatePartyInline{width:130px;min-width:130px;}
.bulkSheet td:has(.bulkRateLineCell){vertical-align:middle;min-width:840px;max-width:860px;}
.bulkSheet th{z-index:4;}
.bulkSheet tbody tr:first-child td{padding-top:12px;}

/* Phase 224 dashboard professional UI */
.dashboardPro{display:flex;flex-direction:column;gap:16px}.dashHero{display:flex;justify-content:space-between;gap:16px;align-items:center;padding:18px;border:1px solid #e5e7eb;border-radius:22px;background:linear-gradient(135deg,#fff,#f8fafc);box-shadow:0 12px 32px rgba(15,23,42,.06)}.dashHero h2{margin:0;font-size:28px}.dashQuickActions{display:flex;gap:10px;flex-wrap:wrap}.proMetrics{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}.proMetrics article{border:1px solid #e5e7eb;border-radius:18px;background:#fff;box-shadow:0 10px 26px rgba(15,23,42,.06);padding:15px}.proMetrics article span{font-weight:700;color:#64748b}.proMetrics article strong{font-size:24px;color:#0f172a}.proMetrics article small{display:block;margin-top:5px;color:#64748b}.legacyMetric.hidden{display:none}.dashGridTwo{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(320px,.8fr);gap:16px}.miniChart{display:flex;flex-direction:column;gap:10px}.barRow{display:grid;grid-template-columns:70px 1fr 110px 60px;gap:10px;align-items:center;font-size:12px}.barTrack{height:12px;border-radius:999px;background:#e2e8f0;overflow:hidden}.barTrack i{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#0f766e,#22c55e)}.barRow b{text-align:right}.barRow small{color:#64748b}.healthList,.rankList,.txnMiniList{display:flex;flex-direction:column;gap:10px}.healthItem,.rankList article,.txnMiniList article{display:flex;justify-content:space-between;align-items:center;gap:12px;border:1px solid #e5e7eb;border-radius:14px;padding:11px 12px;background:#fff}.healthItem strong,.rankList strong,.txnMiniList strong{display:block;color:#0f172a}.healthItem span,.rankList small,.txnMiniList small{display:block;color:#64748b;font-size:12px}.healthItem b{font-size:16px}.healthItem.ok{border-left:4px solid #16a34a}.healthItem.warn,.healthItem.info{border-left:4px solid #f59e0b}.healthItem.danger{border-left:4px solid #ef4444}.rankNo{display:grid;place-items:center;min-width:28px;height:28px;border-radius:999px;background:#eef2ff;color:#3730a3;font-weight:800}.txnMiniList article>div:last-child{text-align:right}.dashboardPro .panel{border-radius:20px}.dashboardPro .alertGrid{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}@media(max-width:900px){.dashHero{align-items:flex-start;flex-direction:column}.dashGridTwo{grid-template-columns:1fr}.barRow{grid-template-columns:62px 1fr 92px}.barRow small{display:none}}

/* Phase 225: true professional dashboard + one-line bulk formula cells */
body{background:#eef3f8;color:#0f172a}.topbar{background:rgba(255,255,255,.92);backdrop-filter:blur(14px);border-bottom:1px solid #dbe4ef;box-shadow:0 8px 26px rgba(15,23,42,.06)}
.dashboardPro{padding:18px 20px 26px;background:linear-gradient(180deg,#edf4fb 0%,#f8fafc 55%,#ffffff 100%)}
.dashHero{border:0!important;border-radius:28px!important;padding:24px!important;background:linear-gradient(135deg,#0f766e 0%,#0f4c81 55%,#172554 100%)!important;color:#fff!important;box-shadow:0 22px 50px rgba(15,23,42,.22)!important;position:relative;overflow:hidden}.dashHero:after{content:"";position:absolute;right:-90px;top:-90px;width:240px;height:240px;border-radius:50%;background:rgba(255,255,255,.13)}.dashHero .eyebrow,.dashHero .smallText{color:rgba(255,255,255,.82)!important}.dashHero h2{font-size:32px!important;letter-spacing:-.03em}.dashQuickActions{position:relative;z-index:1}.dashQuickActions button,.compactAction{border-radius:14px!important;padding:10px 15px!important;font-weight:800!important;border:1px solid rgba(255,255,255,.28)!important;background:rgba(255,255,255,.96)!important;color:#0f172a!important}.dashQuickActions .primary{background:#14b8a6!important;color:#fff!important;border-color:#2dd4bf!important}
.proMetrics{display:grid!important;grid-template-columns:repeat(4,minmax(180px,1fr))!important;gap:14px!important}.proMetrics article{position:relative;overflow:hidden;border:1px solid #dbe4ef!important;border-radius:22px!important;background:#fff!important;box-shadow:0 15px 38px rgba(15,23,42,.08)!important;padding:18px!important}.proMetrics article:before{content:"";position:absolute;right:16px;top:16px;width:38px;height:38px;border-radius:14px;background:linear-gradient(135deg,#ccfbf1,#dbeafe)}.proMetrics article span{text-transform:uppercase;letter-spacing:.06em;font-size:11px!important;font-weight:900!important}.proMetrics article strong{font-size:30px!important;letter-spacing:-.04em;margin-top:10px!important}.proMetrics article small{font-size:12px!important;color:#64748b!important}
.dashboardPro .panel{border:1px solid #dbe4ef!important;border-radius:24px!important;background:#fff!important;box-shadow:0 15px 38px rgba(15,23,42,.07)!important;padding:18px!important}.panelHead{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}.panelHead h3{font-size:18px;margin:0 0 4px}.dashGridTwo{grid-template-columns:minmax(0,1.15fr) minmax(360px,.85fr)!important;gap:16px!important}.miniChart{gap:12px!important}.barRow{grid-template-columns:78px 1fr 110px 72px!important}.barTrack{height:15px!important;background:#e8eef6!important}.barTrack i{background:linear-gradient(90deg,#0f766e,#06b6d4,#22c55e)!important}.healthItem,.rankList article,.txnMiniList article{border:1px solid #e2e8f0!important;border-radius:16px!important;padding:13px 14px!important;background:#f8fafc!important}.healthItem b{font-size:18px!important}
@media(max-width:1200px){.proMetrics{grid-template-columns:repeat(2,minmax(0,1fr))!important}.dashGridTwo{grid-template-columns:1fr!important}}@media(max-width:640px){.proMetrics{grid-template-columns:1fr!important}.dashHero h2{font-size:25px!important}}

.bulkSheetWrap{overflow:auto!important;border:1px solid #dbe4ef;border-radius:16px;background:#fff}.bulkSheet{border-collapse:separate!important;border-spacing:0!important;table-layout:auto!important;min-width:2600px}.bulkSheet th{position:sticky;top:0;background:#f8fafc!important;z-index:6;box-shadow:0 1px 0 #dbe4ef;white-space:nowrap!important;vertical-align:bottom!important}.bulkSheet td{white-space:nowrap!important;vertical-align:middle!important}.bulkSheet input,.bulkSheet select{height:34px!important;border-radius:10px!important;border:1px solid #d8e0ea!important;background:#fff!important;box-sizing:border-box!important}.bulkRateLineCell{display:inline-flex!important;align-items:center!important;gap:8px!important;width:max-content!important;min-width:max-content!important;max-width:none!important;white-space:nowrap!important;overflow:visible!important}.bulkRateLineWrap{display:inline-flex!important;align-items:center!important;gap:8px!important;flex-wrap:nowrap!important;white-space:nowrap!important}.bulkRateInlineSlab{display:inline-flex!important;align-items:center!important;flex-wrap:nowrap!important;gap:3px!important;width:max-content!important;min-width:max-content!important;padding:4px 6px!important;border-radius:12px!important;background:#f8fafc!important;border:1px solid #dbe4ef!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.75)}.bulkRateInlineSlab input,.bulkRateInlineSlab select{height:28px!important;min-height:28px!important;font-size:11px!important;padding:3px 5px!important}.bulkSlabNo{width:18px!important;height:18px!important;font-size:10px!important;background:#0f766e!important;color:white!important}.bulkRateInlineSlab input[data-bulk-rate-qty]{width:46px!important;min-width:46px!important}.bulkRateInlineSlab select[data-bulk-rate-unit]{width:70px!important;min-width:70px!important}.bulkRateInlineSlab select[data-bulk-rate-mode]{width:48px!important;min-width:48px!important}.bulkRateInlineSlab input[data-bulk-rate-fixed]{width:58px!important;min-width:58px!important}.bulkRateInlineSlab select[data-bulk-rate-base]{width:96px!important;min-width:96px!important}.bulkRateInlineSlab input[data-bulk-rate-value]{width:46px!important;min-width:46px!important}.bulkRatePartyInline{width:116px!important;min-width:116px!important}.bulkSheet td:has(.bulkRateLineCell),.bulkSheet th:has(+ td .bulkRateLineCell){min-width:650px!important;max-width:none!important;width:auto!important}
/* Phase 226: party GST/role/delete professional controls */
.partyRoleSelect{min-width:130px;height:34px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;font-weight:800;color:#0f172a;padding:0 10px;}
.gstValue{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.02em;color:#0f766e;}
.partyActions{display:flex;gap:8px;align-items:center;white-space:nowrap;}
button.danger, .danger{border-color:#fecaca!important;color:#b91c1c!important;background:#fff5f5!important;}
button.danger:hover{background:#fee2e2!important;}


/* Phase229: safe parties + true one-line bulk slab editor */
.partyRoleBadge{display:inline-flex;align-items:center;padding:7px 10px;border-radius:999px;background:#eef6ff;color:#0f3760;font-weight:800;font-size:12px;white-space:nowrap;}
.bulkSheetWrap{overflow:auto!important;max-width:100%!important;}
.bulkSheet{table-layout:auto!important;min-width:3600px!important;border-collapse:separate!important;border-spacing:0!important;}
.bulkSheet th,.bulkSheet td{white-space:nowrap!important;vertical-align:middle!important;}
.bulkSheet td:has(.bulkRateLineCell){min-width:620px!important;width:620px!important;max-width:none!important;overflow:visible!important;}
.bulkRateLineCell,.bulkRateLineWrap,.bulkRateInlineSlab{display:inline-flex!important;flex-direction:row!important;align-items:center!important;flex-wrap:nowrap!important;white-space:nowrap!important;width:max-content!important;min-width:max-content!important;max-width:none!important;overflow:visible!important;}
.bulkRateLineWrap{gap:6px!important;}
.bulkRateInlineSlab{gap:3px!important;padding:4px 6px!important;border:1px solid #d9e3ee!important;border-radius:12px!important;background:#f8fafc!important;}
.bulkRateInlineSlab input,.bulkRateInlineSlab select,.bulkRatePartyInline{display:inline-block!important;height:28px!important;min-height:28px!important;font-size:11px!important;padding:2px 4px!important;margin:0!important;}
.bulkSlabNo{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:18px!important;height:18px!important;border-radius:999px!important;background:#0f766e!important;color:#fff!important;font-size:10px!important;font-weight:800!important;flex:0 0 18px!important;}


/* Phase 230 - Professional New Sale / POS UI */
#sales.invoiceMode {
  background: linear-gradient(180deg, #eef6f7 0%, #f8fafc 48%, #f8fafc 100%);
  padding: 18px;
}
.posInvoicePanel {
  border: 1px solid #d7e3ea;
  border-radius: 22px;
  overflow: hidden;
  background: #f3f7fa;
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.12);
}
.proSaleHeader {
  align-items: center;
  padding: 18px 20px;
  background: linear-gradient(135deg, #0f766e 0%, #0f172a 100%);
  color: #ffffff;
  border-bottom: 0;
}
.proSaleHeader .eyebrow {
  margin: 0 0 4px;
  color: #a7f3d0;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.proSaleHeader h3 {
  margin: 0;
  color: #ffffff;
  font-size: 24px;
  line-height: 1.15;
}
.proSaleHeader small {
  display: block;
  margin-top: 5px;
  color: #d9f99d;
  font-weight: 600;
}
.proSaleHeader .actions { align-items: center; }
.ghostBtn {
  background: rgba(255,255,255,.12) !important;
  border: 1px solid rgba(255,255,255,.28) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}
.ghostBtn:hover { background: rgba(255,255,255,.2) !important; }
.posShell {
  grid-template-columns: minmax(720px, 1fr) 390px;
  min-height: calc(100vh - 170px);
  background: #eef3f8;
}
.posWorkArea {
  padding: 18px;
  gap: 12px;
}
.proSaleSection,
.posLineTools,
.posInfoStrip,
.proBillTable {
  border: 1px solid #dbe7ef !important;
  border-radius: 16px !important;
  background: rgba(255,255,255,.96) !important;
  box-shadow: 0 8px 24px rgba(15,23,42,.045);
}
.posTopStrip {
  grid-template-columns: minmax(260px, 1.65fr) minmax(130px, .75fr) minmax(145px, .8fr) minmax(150px, .85fr) minmax(140px,.75fr) minmax(140px,.75fr);
  align-items: end;
}
.posTopStrip label,
.posItemStrip label {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}
.posTopStrip input,
.posTopStrip select,
.posItemStrip input,
.posItemStrip select,
.quickPartyBox input,
.posCheckout textarea {
  border: 1px solid #cfdbe7;
  border-radius: 12px;
  background: #ffffff;
  min-height: 42px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.posTopStrip input:focus,
.posTopStrip select:focus,
.posItemStrip input:focus,
.posItemStrip select:focus,
.quickPartyBox input:focus,
.posCheckout textarea:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15,118,110,.12);
  outline: none;
}
.pickWithAction { grid-template-columns: minmax(210px,1fr) 66px; }
.pickWithAction button,
#addLineBtn,
#saveQuickPartyBtn,
#fillInvoiceDueBtn,
#addInvoicePaymentBtn {
  border-radius: 12px;
  font-weight: 900;
}
.proItemEntry {
  grid-template-columns: minmax(330px, 2fr) 88px 82px 82px 102px 145px auto;
  padding: 12px;
}
.discountPair {
  display: grid;
  grid-template-columns: 56px minmax(82px,1fr);
  gap: 6px;
}
#addLineBtn {
  min-width: 86px;
  background: #0f766e;
}
.posInfoStrip {
  padding: 9px 12px;
  color: #64748b;
}
.proBillTable {
  overflow: auto;
  min-height: 300px;
}
.proBillTable table {
  border-collapse: separate;
  border-spacing: 0;
}
.proBillTable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.proBillTable td,
.proBillTable th {
  padding: 11px 12px;
  border-bottom: 1px solid #e8eef5;
}
.proCheckout {
  padding: 18px;
  border-left: 1px solid #dbe7ef;
  background: #ffffff;
  box-shadow: -10px 0 30px rgba(15,23,42,.04);
}
.posCustomerCard,
.posLineTotal,
.posTotals,
.posPayments,
.proCheckout textarea {
  border-radius: 16px !important;
  border: 1px solid #dbe7ef !important;
  box-shadow: 0 8px 22px rgba(15,23,42,.045);
}
.posCustomerCard {
  background: linear-gradient(135deg, #f0fdfa, #ffffff);
}
.posLineTotal {
  background: #ecfeff;
  color: #0f766e;
}
.posTotals {
  background: #f8fafc;
  padding: 16px;
}
.posTotals span {
  padding: 4px 0;
  font-size: 14px;
}
.posTotals .grandTotal {
  background: #0f172a;
  color: #ffffff;
  margin: 8px -6px 0;
  padding: 12px;
  border-radius: 14px;
  border-top: 0;
}
.posTotals .grandTotal strong { color: #ffffff; font-size: 26px; }
.posTotals .balanceDue { color: #b45309; }
.posPayments .panelHead h4 { margin: 0; }
.posPayments .paymentRow {
  border-radius: 14px;
  background: #f8fafc;
}
.posSaveBtn {
  min-height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0f766e, #115e59);
  box-shadow: 0 14px 32px rgba(15,118,110,.28);
  letter-spacing: .01em;
}
.searchResults {
  border-radius: 14px;
  border-color: #bfd3df;
}
.quickPartyBox {
  border-radius: 16px;
  background: #ecfdf5;
}
@media (max-width: 1180px) {
  .posShell { grid-template-columns: 1fr; }
  .proCheckout { border-left: 0; border-top: 1px solid #dbe7ef; }
}
@media (max-width: 860px) {
  #sales.invoiceMode { padding: 10px; }
  .proSaleHeader { flex-direction: column; align-items: flex-start; }
  .posTopStrip,
  .proItemEntry,
  .quickPartyBox,
  .posInfoStrip { grid-template-columns: 1fr; }
}

/* Phase 231 - Force visible Professional New Sale UI + Enter navigation polish */
#sales.invoiceMode .salesHero,
#sales.invoiceMode .salesStats,
#sales.invoiceMode .salesRegisterToolbar,
#sales.invoiceMode .salesRegisterTable { display:none!important; }
#sales.invoiceMode #invoicePanel.open { display:block!important; }
#invoicePanel.posInvoicePanel.open{
  margin:0!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  background:#eef4f8!important;
}
#invoicePanel .proSaleHeader{
  position:sticky!important;top:0!important;z-index:20!important;
  border-radius:0!important;padding:16px 22px!important;
  background:linear-gradient(135deg,#0f766e,#0f172a)!important;
}
#invoicePanel .posShell{display:grid!important;grid-template-columns:minmax(760px,1fr) 410px!important;gap:0!important;background:#eef4f8!important;}
#invoicePanel .posWorkArea{display:grid!important;gap:14px!important;padding:18px!important;}
#invoicePanel .posTopStrip{display:grid!important;grid-template-columns:1.8fr .8fr .95fr .95fr .8fr .8fr!important;gap:10px!important;padding:14px!important;}
#invoicePanel .proItemEntry{display:grid!important;grid-template-columns:minmax(360px,2fr) 88px 80px 80px 96px 140px 74px!important;gap:8px!important;align-items:end!important;padding:14px!important;}
#invoicePanel .proItemEntry > input[data-sale-meta],
#invoicePanel .proItemEntry > #lineBatchNo,
#invoicePanel .proItemEntry > #lineExpiryDate,
#invoicePanel .proItemEntry > #lineMfgDate,
#invoicePanel .proItemEntry > #lineSize,
#invoicePanel .proItemEntry > #lineModelNo,
#invoicePanel .proItemEntry > #lineSerialNo,
#invoicePanel .proItemEntry > #lineDescription{display:none!important;}
#invoicePanel input,#invoicePanel select,#invoicePanel textarea{font-size:14px!important;}
#invoicePanel .proBillTable{min-height:330px!important;background:#fff!important;}
#invoicePanel .proCheckout{background:#fff!important;padding:18px!important;}
#invoicePanel .posSaveBtn{width:100%!important;font-size:17px!important;}
#invoicePanel .posInfoStrip{display:flex!important;justify-content:space-between!important;gap:12px!important;align-items:center!important;padding:10px 14px!important;}
#invoicePanel #lineItemSearch:focus,#invoicePanel #lineQty:focus,#invoicePanel #lineRate:focus,#invoicePanel #lineDiscount:focus{outline:3px solid rgba(15,118,110,.18)!important;border-color:#0f766e!important;}
@media(max-width:1180px){#invoicePanel .posShell{grid-template-columns:1fr!important;}#invoicePanel .posTopStrip,#invoicePanel .proItemEntry{grid-template-columns:1fr!important;}.proCheckout{border-left:0!important;}}


/* Phase232: bulk edit full item name visible */
.bulkSheet th:nth-child(3),
.bulkSheet td.bulkNameTd{
  min-width:520px!important;
  width:520px!important;
  max-width:none!important;
}
.bulkSheet .bulkNameInput{
  width:500px!important;
  min-width:500px!important;
  max-width:none!important;
  font-weight:700!important;
  color:#0f172a!important;
}
.bulkSheet td.bulkNameTd{
  position:sticky;
  left:0;
  z-index:3;
  background:#fff;
  box-shadow:1px 0 0 #dbe4ef;
}
.bulkSheet th:nth-child(3){
  position:sticky;
  left:0;
  z-index:8;
  box-shadow:1px 0 0 #dbe4ef;
}


/* Phase233: force full item name visible in bulk edit - inline textarea style backup */
.bulkSheet th:nth-child(3),
.bulkSheet td.bulkNameTd{
  min-width:560px!important;
  width:560px!important;
  max-width:none!important;
  white-space:normal!important;
}
.bulkSheet .bulkNameInput,
.bulkSheet .bulkNameTextarea{
  display:block!important;
  width:540px!important;
  min-width:540px!important;
  max-width:none!important;
  height:44px!important;
  min-height:44px!important;
  line-height:1.25!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  font-weight:700!important;
  color:#0f172a!important;
  padding:8px 10px!important;
}
.bulkSheet .bulkNameTextarea{
  resize:vertical!important;
}

/* Phase234: Real professional POS sale screen - stronger overrides */
#sales.invoiceMode{
  padding:0!important;
  background:#eaf1f6!important;
  min-height:calc(100vh - 70px)!important;
}
#sales.invoiceMode #invoicePanel.posInvoicePanel.open{
  display:block!important;
  margin:0!important;
  border:0!important;
  border-radius:0!important;
  background:#eaf1f6!important;
  box-shadow:none!important;
}
#invoicePanel .modernPosHeader{
  display:grid!important;
  grid-template-columns:minmax(360px,1fr) auto auto!important;
  gap:18px!important;
  align-items:center!important;
  padding:18px 24px!important;
  background:linear-gradient(135deg,#071421 0%,#0f3f3a 48%,#0f766e 100%)!important;
  color:#fff!important;
  border:0!important;
  box-shadow:0 14px 38px rgba(7,20,33,.28)!important;
}
#invoicePanel .modernPosTitle h3{
  font-size:28px!important;
  letter-spacing:-.03em!important;
  margin:0!important;
  color:#fff!important;
}
#invoicePanel .modernPosTitle small{color:#c7fff0!important;font-weight:700!important;}
#invoicePanel .modernPosHeaderStats{
  display:grid!important;
  grid-template-columns:86px 86px 210px!important;
  gap:10px!important;
  align-items:stretch!important;
}
#invoicePanel .posHeaderStat,
#invoicePanel .posHeaderTotal{
  border:1px solid rgba(255,255,255,.18)!important;
  background:rgba(255,255,255,.10)!important;
  border-radius:18px!important;
  padding:10px 14px!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.10)!important;
}
#invoicePanel .posHeaderStat span,
#invoicePanel .posHeaderTotal span{display:block;color:#bff4e7!important;font-size:11px!important;font-weight:900!important;text-transform:uppercase;letter-spacing:.08em;}
#invoicePanel .posHeaderStat strong{display:block;color:#fff!important;font-size:24px!important;line-height:1.05!important;}
#invoicePanel .posHeaderTotal{background:#ffffff!important;color:#071421!important;}
#invoicePanel .posHeaderTotal span{color:#0f766e!important;}
#invoicePanel .posHeaderTotal strong{display:block;color:#071421!important;font-size:30px!important;line-height:1.02!important;letter-spacing:-.04em!important;}
#invoicePanel .modernPosActions{gap:8px!important;}
#invoicePanel .modernPosActions .ghostBtn{height:42px!important;border-radius:14px!important;padding:0 18px!important;}
#invoicePanel .posShell{
  display:grid!important;
  grid-template-columns:minmax(820px,1fr) 380px!important;
  gap:16px!important;
  padding:16px!important;
  min-height:calc(100vh - 126px)!important;
  background:#eaf1f6!important;
}
#invoicePanel .posWorkArea{
  display:grid!important;
  grid-template-rows:auto auto auto 1fr!important;
  gap:10px!important;
  padding:0!important;
  min-width:0!important;
}
#invoicePanel .posTopStrip{
  display:grid!important;
  grid-template-columns:2fr .9fr .9fr .9fr .75fr .75fr!important;
  gap:10px!important;
  align-items:end!important;
  padding:14px!important;
  border-radius:20px!important;
  background:#fff!important;
  border:1px solid #d8e3ec!important;
  box-shadow:0 12px 32px rgba(15,23,42,.06)!important;
}
#invoicePanel .posTopStrip label{font-size:11px!important;font-weight:900!important;color:#496176!important;text-transform:uppercase;letter-spacing:.04em!important;}
#invoicePanel .posTopStrip input,#invoicePanel .posTopStrip select,
#invoicePanel .quickPartyBox input{
  height:42px!important;
  min-height:42px!important;
  border-radius:13px!important;
  border:1px solid #d6e2ec!important;
  background:#f8fbfd!important;
  font-weight:800!important;
}
#invoicePanel .pickWithAction{display:grid!important;grid-template-columns:1fr 58px!important;gap:8px!important;}
#invoicePanel #quickAddPartyBtn{height:42px!important;border-radius:13px!important;background:#ecfdf5!important;color:#0f766e!important;border:1px solid #a7f3d0!important;font-weight:900!important;}
#invoicePanel .posLineTools{display:none!important;}
#invoicePanel .proItemEntry{
  display:grid!important;
  grid-template-columns:minmax(420px,2.4fr) 82px 78px 92px 150px 78px!important;
  gap:8px!important;
  align-items:center!important;
  padding:12px!important;
  border-radius:20px!important;
  background:#071421!important;
  border:0!important;
  box-shadow:0 16px 34px rgba(7,20,33,.22)!important;
}
#invoicePanel .posItemPick{position:relative!important;}
#invoicePanel #lineItemSearch{
  height:52px!important;
  border-radius:16px!important;
  border:2px solid transparent!important;
  background:#fff!important;
  font-size:17px!important;
  font-weight:900!important;
  padding-left:16px!important;
  padding-right:48px!important;
}
#invoicePanel .scanInsideBtn{height:38px!important;width:38px!important;right:7px!important;top:7px!important;border-radius:12px!important;background:#ecfdf5!important;border-color:#99f6e4!important;}
#invoicePanel .proItemEntry > input,
#invoicePanel .proItemEntry .discountPair select,
#invoicePanel .proItemEntry .discountPair input{
  height:52px!important;
  min-height:52px!important;
  border-radius:15px!important;
  border:0!important;
  background:#fff!important;
  font-weight:900!important;
  text-align:center!important;
  box-shadow:0 1px 0 rgba(255,255,255,.08)!important;
}
#invoicePanel .discountPair{display:grid!important;grid-template-columns:58px 1fr!important;gap:6px!important;}
#invoicePanel #addLineBtn{
  height:52px!important;
  min-width:78px!important;
  border-radius:16px!important;
  background:linear-gradient(135deg,#10b981,#0f766e)!important;
  color:#fff!important;
  font-weight:1000!important;
  box-shadow:0 12px 24px rgba(16,185,129,.28)!important;
}
#invoicePanel .proItemEntry > input[data-sale-meta],
#invoicePanel .proItemEntry > #lineBatchNo,
#invoicePanel .proItemEntry > #lineExpiryDate,
#invoicePanel .proItemEntry > #lineMfgDate,
#invoicePanel .proItemEntry > #lineSize,
#invoicePanel .proItemEntry > #lineModelNo,
#invoicePanel .proItemEntry > #lineSerialNo,
#invoicePanel .proItemEntry > #lineDescription{display:none!important;}
#invoicePanel .posInfoStrip{
  display:grid!important;
  grid-template-columns:1fr auto!important;
  gap:12px!important;
  align-items:center!important;
  padding:10px 14px!important;
  min-height:44px!important;
  border-radius:16px!important;
  background:#fff!important;
  border:1px solid #d8e3ec!important;
  color:#475569!important;
}
#invoicePanel .proBillTable{
  min-height:0!important;
  height:100%!important;
  border-radius:20px!important;
  background:#fff!important;
  border:1px solid #d8e3ec!important;
  box-shadow:0 12px 32px rgba(15,23,42,.06)!important;
  overflow:auto!important;
}
#invoicePanel .proBillTable table{width:100%!important;border-collapse:separate!important;border-spacing:0!important;}
#invoicePanel .proBillTable thead th{
  position:sticky!important;top:0!important;z-index:3!important;
  background:#0f172a!important;color:#fff!important;
  font-size:12px!important;font-weight:1000!important;text-transform:uppercase!important;letter-spacing:.05em!important;
  padding:13px 14px!important;
}
#invoicePanel .proBillTable tbody td{padding:13px 14px!important;border-bottom:1px solid #edf2f7!important;font-weight:800!important;color:#0f172a!important;}
#invoicePanel .proBillTable tbody tr:hover td{background:#f0fdfa!important;}
#invoicePanel .proCheckout{
  display:flex!important;
  flex-direction:column!important;
  gap:12px!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
#invoicePanel .posCustomerCard,
#invoicePanel .posLineTotal,
#invoicePanel .posTotals,
#invoicePanel .posPayments,
#invoicePanel .proCheckout textarea{
  border-radius:20px!important;
  border:1px solid #d8e3ec!important;
  background:#fff!important;
  box-shadow:0 12px 32px rgba(15,23,42,.07)!important;
}
#invoicePanel .posCustomerCard{padding:16px!important;background:linear-gradient(135deg,#ffffff,#eefdf8)!important;}
#invoicePanel .posCustomerCard span{font-size:11px!important;font-weight:1000!important;color:#64748b!important;text-transform:uppercase;letter-spacing:.08em!important;}
#invoicePanel .posCustomerCard strong{display:block;margin-top:6px;font-size:16px!important;color:#0f172a!important;line-height:1.35!important;}
#invoicePanel .posLineTotal{
  padding:18px!important;
  background:linear-gradient(135deg,#0f766e,#115e59)!important;
  color:#fff!important;
  font-size:24px!important;
  font-weight:1000!important;
  letter-spacing:-.03em!important;
}
#invoicePanel .posTotals{padding:16px!important;}
#invoicePanel .posTotals span{display:grid!important;grid-template-columns:1fr auto!important;align-items:center!important;padding:7px 0!important;color:#475569!important;font-weight:800!important;}
#invoicePanel .posTotals strong{color:#0f172a!important;font-weight:1000!important;}
#invoicePanel .billDiscountControl{grid-template-columns:1fr 60px 82px!important;gap:6px!important;}
#invoicePanel .billDiscountControl select,#invoicePanel .billDiscountControl input{height:36px!important;border-radius:10px!important;text-align:center!important;}
#invoicePanel .posTotals .grandTotal{
  margin:12px -6px 4px!important;
  padding:14px!important;
  border-radius:18px!important;
  background:#071421!important;
  color:#fff!important;
}
#invoicePanel .posTotals .grandTotal strong{font-size:32px!important;color:#fff!important;letter-spacing:-.04em!important;}
#invoicePanel .posTotals .balanceDue{color:#b45309!important;font-weight:1000!important;}
#invoicePanel .posPayments{padding:14px!important;}
#invoicePanel .posPayments .panelHead{display:flex!important;justify-content:space-between!important;align-items:center!important;margin-bottom:10px!important;}
#invoicePanel .posPayments .panelHead h4{font-size:16px!important;margin:0!important;color:#0f172a!important;}
#invoicePanel .paymentRow{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;background:#f8fbfd!important;border-radius:16px!important;padding:10px!important;margin-bottom:8px!important;}
#invoicePanel .paymentRow input,#invoicePanel .paymentRow select{height:42px!important;border-radius:12px!important;border:1px solid #d6e2ec!important;background:#fff!important;font-weight:800!important;}
#invoicePanel .paymentRow button{grid-column:1/-1!important;height:36px!important;border-radius:12px!important;background:#fee2e2!important;color:#991b1b!important;border:1px solid #fecaca!important;font-weight:900!important;}
#invoicePanel #invoiceNotes{min-height:78px!important;padding:12px!important;font-weight:700!important;}
#invoicePanel .posSaveBtn{
  height:60px!important;
  border-radius:20px!important;
  background:linear-gradient(135deg,#059669,#047857)!important;
  color:#fff!important;
  font-size:18px!important;
  font-weight:1000!important;
  box-shadow:0 18px 35px rgba(5,150,105,.30)!important;
}
#invoicePanel input:focus,#invoicePanel select:focus,#invoicePanel textarea:focus{
  outline:0!important;
  border-color:#0f766e!important;
  box-shadow:0 0 0 4px rgba(15,118,110,.16)!important;
}
@media(max-width:1220px){
  #invoicePanel .posShell{grid-template-columns:1fr!important;}
  #invoicePanel .modernPosHeader{grid-template-columns:1fr!important;}
  #invoicePanel .modernPosHeaderStats{grid-template-columns:1fr 1fr 2fr!important;}
}
@media(max-width:780px){
  #invoicePanel .posShell{padding:10px!important;}
  #invoicePanel .posTopStrip,#invoicePanel .proItemEntry{grid-template-columns:1fr!important;}
  #invoicePanel .modernPosHeaderStats{grid-template-columns:1fr!important;}
}

/* PHASE 236 — ALL SCREEN PROFESSIONAL UI + MOBILE APP FEEL + VIEW ISOLATION */
:root{
  --td-bg:#eef4f8;
  --td-card:#ffffff;
  --td-line:#dbe5ee;
  --td-text:#0f172a;
  --td-muted:#64748b;
  --td-primary:#0f766e;
  --td-primary-dark:#064e3b;
  --td-soft:#f8fbfd;
  --td-shadow:0 16px 45px rgba(15,23,42,.09);
  --td-radius:20px;
}
html,body{background:var(--td-bg)!important;color:var(--td-text)!important;-webkit-tap-highlight-color:transparent!important;}
body{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif!important;}
main{background:linear-gradient(180deg,#eef5f9 0%,#f7fafc 100%)!important;min-height:100vh!important;}
/* Hard fix: dashboard or any old section must never appear together with other screen */
main > section.view:not(.active){display:none!important;visibility:hidden!important;height:0!important;overflow:hidden!important;opacity:0!important;pointer-events:none!important;padding:0!important;margin:0!important;}
main > section.view.active{display:block!important;visibility:visible!important;height:auto!important;opacity:1!important;pointer-events:auto!important;}
.topbar{position:sticky!important;top:0!important;z-index:40!important;background:rgba(255,255,255,.92)!important;backdrop-filter:blur(16px)!important;border-bottom:1px solid var(--td-line)!important;box-shadow:0 10px 30px rgba(15,23,42,.05)!important;padding:14px 20px!important;}
.topbar h2{font-size:24px!important;font-weight:1000!important;letter-spacing:-.04em!important;margin:0!important;}
.topbar .actions{display:flex!important;gap:10px!important;align-items:center!important;}
button,.linkBtn,.fileAction{border-radius:13px!important;border:1px solid #dbe5ee!important;background:#fff!important;color:#0f172a!important;font-weight:850!important;box-shadow:0 1px 2px rgba(15,23,42,.04)!important;transition:.15s ease!important;}
button:hover,.linkBtn:hover,.fileAction:hover{transform:translateY(-1px)!important;box-shadow:0 12px 24px rgba(15,23,42,.10)!important;}
button.primary,.primary,#newInvoiceBtn,.compactAction.primary{background:linear-gradient(135deg,#0f766e,#047857)!important;color:#fff!important;border-color:#0f766e!important;box-shadow:0 12px 28px rgba(15,118,110,.22)!important;}
.dangerBtn{background:#fee2e2!important;color:#991b1b!important;border-color:#fecaca!important;}
.badge{border-radius:999px!important;background:#eaf1f6!important;color:#334155!important;padding:9px 12px!important;font-weight:900!important;}
.view.active{padding:18px 22px 28px!important;}
.panel,.tableWrap,.toolbar,.metrics article,.salesStats article,.dashHero,.salesHero,.bulkActionBar,.inlineForm{background:#fff!important;border:1px solid var(--td-line)!important;border-radius:var(--td-radius)!important;box-shadow:var(--td-shadow)!important;}
.panel{padding:18px!important;margin-bottom:16px!important;}
.panelHead{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;margin-bottom:14px!important;}
.panelHead h3,.panel h3{font-size:20px!important;font-weight:1000!important;letter-spacing:-.035em!important;margin:0!important;color:#0f172a!important;}
.smallText,.muted,.eyebrow{color:var(--td-muted)!important;}
.eyebrow{text-transform:uppercase!important;letter-spacing:.08em!important;font-size:11px!important;font-weight:1000!important;margin:0 0 4px!important;}
.metrics,.salesStats{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(180px,1fr))!important;gap:14px!important;margin:14px 0 16px!important;}
.metrics article,.salesStats article{padding:18px!important;min-height:104px!important;position:relative!important;overflow:hidden!important;}
.metrics article:before,.salesStats article:before{content:"";position:absolute;inset:0 0 auto;height:4px;background:linear-gradient(90deg,#0f766e,#22c55e)!important;}
.metrics article span,.salesStats article span{font-size:12px!important;font-weight:1000!important;text-transform:uppercase!important;letter-spacing:.06em!important;color:#64748b!important;}
.metrics article strong,.salesStats article strong{display:block!important;margin-top:7px!important;font-size:28px!important;line-height:1!important;font-weight:1000!important;letter-spacing:-.055em!important;color:#0f172a!important;}
.metrics article small{display:block!important;margin-top:8px!important;color:#64748b!important;font-weight:800!important;}
.toolbar{padding:12px!important;display:flex!important;gap:10px!important;align-items:center!important;margin-bottom:14px!important;}
.toolbar input,.toolbar select,.formGrid input,.formGrid select,.formGrid textarea,.panel input,.panel select,.panel textarea{border:1px solid #d6e2ec!important;border-radius:13px!important;background:#fff!important;padding:11px 12px!important;min-height:42px!important;font-weight:760!important;}
input:focus,select:focus,textarea:focus{outline:0!important;border-color:#0f766e!important;box-shadow:0 0 0 4px rgba(15,118,110,.13)!important;}
.tableWrap{overflow:auto!important;padding:0!important;margin-bottom:16px!important;}
table{width:100%!important;border-collapse:separate!important;border-spacing:0!important;background:#fff!important;}
thead th{position:sticky!important;top:0!important;z-index:5!important;background:#f1f7f7!important;color:#334155!important;font-size:12px!important;font-weight:1000!important;text-transform:uppercase!important;letter-spacing:.04em!important;padding:13px!important;border-bottom:1px solid #dbe5ee!important;white-space:nowrap!important;text-align:left!important;}
tbody td{padding:12px 13px!important;border-bottom:1px solid #edf2f7!important;vertical-align:middle!important;color:#0f172a!important;font-weight:760!important;}
tbody tr:hover td{background:#f8fffd!important;}
.formGrid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(210px,1fr))!important;gap:12px!important;}
.formGrid label,.panel label{font-size:12px!important;font-weight:900!important;color:#475569!important;}
.reportGrid,.dashGridTwo{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(360px,1fr))!important;gap:16px!important;}
/* Dashboard professional command center */
#dashboard.dashboardPro{background:transparent!important;}
#dashboard .dashHero{background:linear-gradient(135deg,#0f172a,#0f766e)!important;color:#fff!important;padding:24px!important;border:0!important;box-shadow:0 24px 55px rgba(15,23,42,.22)!important;display:flex!important;justify-content:space-between!important;gap:14px!important;align-items:center!important;}
#dashboard .dashHero .eyebrow,#dashboard .dashHero .smallText{color:#ccfbf1!important;}
#dashboard .dashHero h2{font-size:32px!important;margin:2px 0!important;letter-spacing:-.055em!important;}
#dashboard .dashQuickActions button{background:rgba(255,255,255,.14)!important;color:#fff!important;border-color:rgba(255,255,255,.24)!important;box-shadow:none!important;}
#dashboard .proMetrics article{border-radius:22px!important;}
#dashboard .panel{min-height:170px!important;}
.healthList > div,.rankList > div,.txnMiniList > div,.alertList > div{display:flex!important;justify-content:space-between!important;gap:12px!important;padding:12px!important;border:1px solid #e6eef5!important;border-radius:14px!important;background:#fbfdff!important;margin-bottom:8px!important;}
/* Sales / purchase / orders / reports full professional sections */
.salesHero{background:linear-gradient(135deg,#fff,#eefdf8)!important;padding:20px!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:14px!important;margin-bottom:14px!important;}
.salesHero h2{font-size:25px!important;letter-spacing:-.04em!important;margin:0!important;}
/* POS: remove blank and force app-like billing */
#invoicePanel{border-radius:26px!important;overflow:hidden!important;background:#eaf2f7!important;padding:0!important;}
#invoicePanel .modernPosHeader{background:linear-gradient(135deg,#071421,#0f766e)!important;color:#fff!important;border:0!important;border-radius:0!important;margin:0!important;padding:18px 20px!important;}
#invoicePanel .modernPosHeader .eyebrow,#invoicePanel .modernPosHeader small{color:#b9f8e9!important;}
#invoicePanel .modernPosHeader h3{color:#fff!important;font-size:24px!important;}
#invoicePanel .modernPosHeaderStats{margin-left:auto!important;}
#invoicePanel .posHeaderStat,#invoicePanel .posHeaderTotal{border-radius:18px!important;background:rgba(255,255,255,.12)!important;border:1px solid rgba(255,255,255,.18)!important;color:#fff!important;padding:12px 16px!important;}
#invoicePanel .posHeaderTotal strong{font-size:30px!important;color:#fff!important;}
#invoicePanel .posShell{padding:14px!important;gap:14px!important;align-items:stretch!important;}
#invoicePanel .posTopStrip{margin:0!important;grid-template-columns:2fr 1fr 1fr 1fr 1fr 1fr!important;}
#invoicePanel .posLineTools{display:none!important;}
#invoicePanel .proItemEntry{position:sticky!important;top:76px!important;z-index:20!important;margin:10px 0!important;grid-template-columns:minmax(320px,2fr) 80px 80px 90px 150px 74px!important;box-shadow:0 16px 35px rgba(15,23,42,.12)!important;}
#invoicePanel .proItemEntry #lineItemSearch{font-size:18px!important;font-weight:900!important;}
#invoicePanel .posInfoStrip{margin:0 0 10px!important;padding:10px 14px!important;border-radius:16px!important;background:#fff!important;}
#invoicePanel .proBillTable{height:calc(100vh - 420px)!important;min-height:330px!important;}
#invoicePanel .proCheckout{position:sticky!important;top:86px!important;align-self:start!important;}
#invoicePanel .posSaveBtn{position:sticky!important;bottom:10px!important;}
/* Purchase screen matching POS/pro form */
#purchases .panel:first-of-type,#payments .panel:first-of-type,#reports .panel:first-of-type,#orders .panel:first-of-type{background:linear-gradient(135deg,#fff,#f0fdfa)!important;}
#purchases .lineEntry,.purchaseLineEntry{background:#fff!important;border:1px solid var(--td-line)!important;border-radius:20px!important;padding:12px!important;box-shadow:var(--td-shadow)!important;}
#purchaseLinesBody td,#paymentsBody td,#orderCenterBody td,#salesRegisterBody td{font-size:14px!important;}
/* Mobile app feel */
@media(max-width:900px){
  body:not(.loggedOut){display:block!important;}
  .sidebar{position:fixed!important;left:0!important;right:0!important;bottom:0!important;top:auto!important;width:auto!important;height:72px!important;z-index:80!important;background:rgba(255,255,255,.96)!important;backdrop-filter:blur(18px)!important;border-top:1px solid #dbe5ee!important;border-right:0!important;box-shadow:0 -16px 40px rgba(15,23,42,.12)!important;overflow-x:auto!important;overflow-y:hidden!important;padding:6px 8px!important;}
  .sidebar .brand{display:none!important;}
  .sidebar nav{display:flex!important;gap:7px!important;white-space:nowrap!important;height:100%!important;align-items:center!important;}
  .sidebar nav button,.sidebar .navLink{min-width:74px!important;height:56px!important;border-radius:18px!important;font-size:11px!important;padding:6px 8px!important;display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;background:#f8fafc!important;color:#334155!important;border:1px solid #e2e8f0!important;}
  .sidebar nav button.active{background:linear-gradient(135deg,#0f766e,#047857)!important;color:#fff!important;box-shadow:0 10px 22px rgba(15,118,110,.22)!important;}
  main{margin-left:0!important;padding-bottom:86px!important;}
  .topbar{padding:12px!important;border-radius:0 0 22px 22px!important;}
  .topbar h2{font-size:20px!important;}
  .topbar .actions{gap:6px!important;overflow-x:auto!important;}
  .topbar .actions button,.topbar .badge{padding:9px 10px!important;font-size:12px!important;}
  .view.active{padding:12px!important;}
  .metrics,.salesStats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;}
  .metrics article,.salesStats article{min-height:90px!important;padding:14px!important;border-radius:18px!important;}
  .metrics article strong,.salesStats article strong{font-size:22px!important;}
  .reportGrid,.dashGridTwo{grid-template-columns:1fr!important;gap:12px!important;}
  .panel,.tableWrap,.toolbar{border-radius:18px!important;}
  .toolbar{overflow-x:auto!important;}
  .formGrid{grid-template-columns:1fr!important;}
  #dashboard .dashHero{border-radius:24px!important;display:block!important;padding:20px!important;}
  #dashboard .dashHero h2{font-size:26px!important;}
  #dashboard .dashQuickActions{display:flex!important;gap:8px!important;margin-top:14px!important;overflow-x:auto!important;}
  #invoicePanel .modernPosHeader{display:block!important;padding:16px!important;}
  #invoicePanel .modernPosHeaderStats{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;margin-top:12px!important;}
  #invoicePanel .posHeaderTotal{grid-column:1/-1!important;}
  #invoicePanel .posShell{grid-template-columns:1fr!important;padding:10px!important;}
  #invoicePanel .posTopStrip{grid-template-columns:1fr!important;gap:8px!important;}
  #invoicePanel .proItemEntry{position:sticky!important;top:72px!important;grid-template-columns:1fr 72px 72px!important;gap:8px!important;}
  #invoicePanel .proItemEntry .posItemPick{grid-column:1/-1!important;}
  #invoicePanel .proItemEntry .discountPair{grid-column:1/3!important;}
  #invoicePanel .proItemEntry #addLineBtn{height:48px!important;}
  #invoicePanel .proBillTable{height:45vh!important;min-height:300px!important;}
  #invoicePanel .proCheckout{position:static!important;}
}
@media(max-width:520px){
  .metrics,.salesStats{grid-template-columns:1fr 1fr!important;}
  .topbar{display:block!important;}
  .topbar .actions{margin-top:8px!important;}
  #invoicePanel .posTotals .grandTotal strong{font-size:28px!important;}
  table{font-size:13px!important;}
  thead th,tbody td{padding:10px!important;}
}

/* PHASE 237 — PRO MAX UNIQUE SCREEN SYSTEM: each module gets its own visual identity */
:root{
  --screen-accent:#0f766e;
  --screen-accent-2:#22c55e;
  --screen-dark:#0f172a;
  --screen-soft:#ecfdf5;
}
body:has(#dashboard.active){--screen-accent:#0f766e;--screen-accent-2:#22c55e;--screen-soft:#ecfdf5;--screen-dark:#0f172a;}
body:has(#items.active){--screen-accent:#2563eb;--screen-accent-2:#06b6d4;--screen-soft:#eff6ff;--screen-dark:#172554;}
body:has(#parties.active){--screen-accent:#7c3aed;--screen-accent-2:#ec4899;--screen-soft:#f5f3ff;--screen-dark:#2e1065;}
body:has(#sales.active){--screen-accent:#059669;--screen-accent-2:#14b8a6;--screen-soft:#ecfdf5;--screen-dark:#052e2b;}
body:has(#purchases.active){--screen-accent:#ea580c;--screen-accent-2:#f59e0b;--screen-soft:#fff7ed;--screen-dark:#431407;}
body:has(#orders.active){--screen-accent:#0891b2;--screen-accent-2:#22d3ee;--screen-soft:#ecfeff;--screen-dark:#083344;}
body:has(#payments.active){--screen-accent:#16a34a;--screen-accent-2:#84cc16;--screen-soft:#f0fdf4;--screen-dark:#14532d;}
body:has(#accounting.active){--screen-accent:#334155;--screen-accent-2:#94a3b8;--screen-soft:#f8fafc;--screen-dark:#020617;}
body:has(#gst.active){--screen-accent:#dc2626;--screen-accent-2:#f97316;--screen-soft:#fef2f2;--screen-dark:#450a0a;}
body:has(#reports.active){--screen-accent:#4f46e5;--screen-accent-2:#06b6d4;--screen-soft:#eef2ff;--screen-dark:#1e1b4b;}
body:has(#catalog.active){--screen-accent:#be123c;--screen-accent-2:#f59e0b;--screen-soft:#fff1f2;--screen-dark:#4c0519;}
body:has(#distribution.active){--screen-accent:#0e7490;--screen-accent-2:#10b981;--screen-soft:#ecfeff;--screen-dark:#083344;}
body:has(#users.active),body:has(#control.active){--screen-accent:#6d28d9;--screen-accent-2:#38bdf8;--screen-soft:#f5f3ff;--screen-dark:#2e1065;}

body:has(section.view.active) .topbar{
  background:linear-gradient(135deg,var(--screen-dark),var(--screen-accent))!important;
  color:#fff!important;border-bottom:0!important;box-shadow:0 18px 45px rgba(15,23,42,.20)!important;
}
body:has(section.view.active) .topbar h2{color:#fff!important;text-shadow:0 1px 0 rgba(0,0,0,.18)!important;}
body:has(section.view.active) .topbar .eyebrow{color:rgba(255,255,255,.72)!important;}
body:has(section.view.active) .topbar .badge{background:rgba(255,255,255,.14)!important;color:#fff!important;border:1px solid rgba(255,255,255,.22)!important;}
body:has(section.view.active) .topbar button:not(.primary){background:rgba(255,255,255,.12)!important;color:#fff!important;border-color:rgba(255,255,255,.22)!important;}
body:has(section.view.active) .topbar button.primary{background:#fff!important;color:var(--screen-dark)!important;border-color:#fff!important;}
.view.active{
  background:
    radial-gradient(circle at top right, color-mix(in srgb,var(--screen-accent) 18%,transparent), transparent 34%),
    linear-gradient(180deg,var(--screen-soft),#f8fafc 45%,#f8fafc)!important;
  border-radius:0!important;min-height:calc(100vh - 78px)!important;
}
.view.active > .toolbar:first-child,
.view.active > .panel:first-child,
.view.active > .metrics:first-child,
.view.active > .salesHero:first-child{
  margin-top:2px!important;
}
/* generic pro module hero injected through pseudo so every screen feels different without breaking JS */
#items.active:before,#parties.active:before,#purchases.active:before,#orders.active:before,#payments.active:before,#accounting.active:before,#gst.active:before,#reports.active:before,#catalog.active:before,#distribution.active:before,#users.active:before,#control.active:before,#store.active:before,#superadmin.active:before{
  display:block!important;margin:0 0 16px!important;padding:20px 22px!important;border-radius:26px!important;color:#fff!important;
  background:linear-gradient(135deg,var(--screen-dark),var(--screen-accent))!important;
  box-shadow:0 22px 55px color-mix(in srgb,var(--screen-accent) 24%,transparent)!important;
  font-size:28px!important;font-weight:1000!important;letter-spacing:-.05em!important;
}
#items.active:before{content:"🧾 Item Master · stock, rate, photo aur slabs";}
#parties.active:before{content:"👥 Parties CRM · retailer, dealer, supplier ledger";}
#purchases.active:before{content:"📦 Purchase Desk · supplier bill aur stock inward";}
#orders.active:before{content:"🚚 Order Command · online, B2B aur dispatch flow";}
#payments.active:before{content:"💳 Payment Center · cash, bank, UPI aur due control";}
#accounting.active:before{content:"📒 Accounting Office · bank, profit-loss aur entries";}
#gst.active:before{content:"🧮 GST Compliance · HSN, tax aur return summary";}
#reports.active:before{content:"📊 Report Studio · ledger, stock aur analytics export";}
#catalog.active:before{content:"🛍️ Catalog Builder · item visibility, rate slab aur public store";}
#distribution.active:before{content:"🌐 Distribution Network · dealer, distributor aur party control";}
#users.active:before{content:"🔐 User Access Control · roles, permissions aur security";}
#control.active:before{content:"⚙️ Admin Control Room · system settings aur operations";}
#store.active:before{content:"🏪 Online Store Setup · public storefront configuration";}
#superadmin.active:before{content:"👑 Superadmin Console · tenant, plan aur platform control";}

/* Section specific cards and tables */
.view.active .panel,.view.active .tableWrap,.view.active .toolbar,.view.active .inlineForm,.view.active .bulkActionBar{
  border-color:color-mix(in srgb,var(--screen-accent) 18%,#dbe5ee)!important;
  box-shadow:0 18px 45px rgba(15,23,42,.08)!important;
}
.view.active .panelHead h3,.view.active .panel h3{display:flex!important;gap:8px!important;align-items:center!important;}
#reports.active .panelHead h3:before,#reports.active .panel h3:before{content:"📈";}
#purchases.active .panelHead h3:before,#purchases.active .panel h3:before{content:"📦";}
#payments.active .panelHead h3:before,#payments.active .panel h3:before{content:"💰";}
#catalog.active .panelHead h3:before,#catalog.active .panel h3:before{content:"🛒";}
#distribution.active .panelHead h3:before,#distribution.active .panel h3:before{content:"🌐";}
#users.active .panelHead h3:before,#users.active .panel h3:before{content:"🔐";}
#items.active .panelHead h3:before,#items.active .panel h3:before{content:"🏷️";}
.view.active thead th{background:linear-gradient(135deg,var(--screen-dark),var(--screen-accent))!important;color:#fff!important;border-bottom:0!important;}
.view.active tbody tr:nth-child(even) td{background:color-mix(in srgb,var(--screen-soft) 55%,#fff)!important;}
.view.active button.primary,.view.active .primary{background:linear-gradient(135deg,var(--screen-accent),var(--screen-accent-2))!important;color:#fff!important;border-color:transparent!important;box-shadow:0 14px 32px color-mix(in srgb,var(--screen-accent) 28%,transparent)!important;}
.view.active input:focus,.view.active select:focus,.view.active textarea:focus{border-color:var(--screen-accent)!important;box-shadow:0 0 0 4px color-mix(in srgb,var(--screen-accent) 16%,transparent)!important;}

/* ITEMS: spreadsheet/product master feel */
#items.active .itemToolbar{display:grid!important;grid-template-columns:minmax(280px,1.5fr) auto auto auto auto auto!important;background:#fff!important;border-left:6px solid var(--screen-accent)!important;}
#items.active .bulkSheetWrap{border-radius:24px!important;box-shadow:0 22px 60px rgba(37,99,235,.10)!important;}
#items.active .bulkSheet input,#items.active .bulkSheet select,#items.active .bulkSheet textarea{background:#f8fbff!important;border-radius:10px!important;}
#items.active .bulkSheet th:nth-child(3),#items.active .bulkSheet td:nth-child(3){position:sticky!important;left:0!important;z-index:8!important;min-width:520px!important;background:#fff!important;box-shadow:12px 0 24px rgba(15,23,42,.06)!important;}
#items.active .bulkSheet td:nth-child(3) textarea,#items.active .bulkSheet td:nth-child(3) input{font-size:15px!important;font-weight:950!important;min-width:500px!important;}
#items.active .rateSlabCompact,.bulkSlabLine{display:flex!important;flex-direction:row!important;align-items:center!important;gap:5px!important;white-space:nowrap!important;min-width:520px!important;}
#items.active .rateSlabCompact input,#items.active .rateSlabCompact select,.bulkSlabLine input,.bulkSlabLine select{width:auto!important;min-width:58px!important;height:34px!important;padding:5px 7px!important;}

/* PURCHASE: supplier bill desk has a different structure */
#purchases.active #purchasePanel{display:grid!important;grid-template-columns:1fr 360px!important;gap:14px!important;background:#fff7ed!important;border:1px solid #fed7aa!important;}
#purchases.active #purchasePanel > .panelHead{grid-column:1/-1!important;background:linear-gradient(135deg,#431407,#ea580c)!important;color:#fff!important;border-radius:22px!important;padding:16px!important;margin:0!important;}
#purchases.active #purchasePanel > .panelHead h3{color:#fff!important;}
#purchases.active .invoiceGrid,#purchases.active .purchaseUnifiedSearch,#purchases.active .lineEditor,#purchases.active #purchasePanel .tableWrap{grid-column:1/2!important;}
#purchases.active #purchasePanel .formGrid:has(#purchasePaymentAmount),#purchases.active #purchasePanel textarea,#purchases.active #purchasePanel .actions.right{grid-column:2/3!important;align-self:start!important;}
#purchases.active .lineEditor{display:grid!important;grid-template-columns:minmax(220px,2fr) repeat(5,minmax(75px,1fr)) auto!important;background:#fff!important;border:1px solid #fed7aa!important;border-radius:20px!important;padding:12px!important;box-shadow:0 16px 35px rgba(234,88,12,.10)!important;}
#purchases.active .lineEditor button{background:#ea580c!important;color:#fff!important;}
#purchases.active .totals{background:linear-gradient(135deg,#fff,#ffedd5)!important;border-radius:22px!important;border:1px solid #fed7aa!important;padding:16px!important;}
#purchases.active .totals span{display:grid!important;grid-template-columns:1fr auto!important;border-bottom:1px dashed #fdba74!important;padding:8px 0!important;}

/* REPORTS: analytics studio */
#reports.active{background:radial-gradient(circle at top left,rgba(79,70,229,.22),transparent 36%),linear-gradient(180deg,#eef2ff,#f8fafc)!important;}
#reports.active .reportGrid{grid-template-columns:1fr 1fr!important;}
#reports.active .reportGroup{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(220px,1fr))!important;gap:12px!important;}
#reports.active .reportGroup h4{grid-column:1/-1!important;margin:8px 0 2px!important;color:#1e1b4b!important;font-size:18px!important;}
#reports.active .reportGroup button,#reports.active .reportGroup a{min-height:70px!important;border-radius:20px!important;background:linear-gradient(135deg,#fff,#eef2ff)!important;border:1px solid #c7d2fe!important;box-shadow:0 12px 30px rgba(79,70,229,.10)!important;text-align:left!important;padding:14px!important;font-weight:1000!important;}
#reports.active .reportGroup button:before,#reports.active .reportGroup a:before{content:"📄";display:inline-flex;margin-right:7px;}
#reports.active .toolbar{background:#1e1b4b!important;color:#fff!important;}
#reports.active .toolbar select,#reports.active .toolbar input{background:rgba(255,255,255,.12)!important;color:#fff!important;border-color:rgba(255,255,255,.20)!important;}

/* CATALOG: marketplace cards */
#catalog.active .catalogPreview,#catalog.active .storePreview,#catalog.active .publicCatalog,#catalog.active .catalogGrid{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(230px,1fr))!important;gap:14px!important;}
#catalog.active .panel{background:linear-gradient(135deg,#fff,#fff1f2)!important;}
#catalog.active .catalogItem,.catalogCard,.storeCard{border-radius:24px!important;border:1px solid #fecdd3!important;box-shadow:0 18px 42px rgba(190,18,60,.10)!important;overflow:hidden!important;background:#fff!important;}
#catalog.active .catalogItem img,.catalogCard img,.storeCard img{height:150px!important;object-fit:cover!important;background:#fff7ed!important;}

/* PAYMENTS: banking terminal */
#payments.active .panel:first-of-type{background:linear-gradient(135deg,#052e16,#16a34a)!important;color:#fff!important;border:0!important;}
#payments.active .panel:first-of-type h3,#payments.active .panel:first-of-type label{color:#fff!important;}
#payments.active .panel:first-of-type input,#payments.active .panel:first-of-type select,#payments.active .panel:first-of-type textarea{background:rgba(255,255,255,.12)!important;border-color:rgba(255,255,255,.22)!important;color:#fff!important;}
#payments.active .panel:first-of-type input::placeholder,#payments.active .panel:first-of-type textarea::placeholder{color:rgba(255,255,255,.70)!important;}
#payments.active #savePaymentBtn{background:#fff!important;color:#14532d!important;}
#payments.active .tableWrap{border-left:6px solid #16a34a!important;}

/* DISTRIBUTION: network map feel */
#distribution.active .metrics article,#distribution.active .panel{background:linear-gradient(135deg,#fff,#ecfeff)!important;}
#distribution.active .metrics article:after{content:"";position:absolute;right:-28px;bottom:-28px;width:92px;height:92px;border-radius:50%;border:18px solid rgba(14,116,144,.08)!important;}
#distribution.active .tableWrap{background:linear-gradient(135deg,#fff,#f0fdfa)!important;}

/* USERS / CONTROL: access dashboard */
#users.active .panel,#control.active .panel{background:linear-gradient(135deg,#fff,#f5f3ff)!important;border-color:#ddd6fe!important;}
#users.active table td:first-child:before{content:"👤 ";}
#users.active .badge,#control.active .badge{background:#ede9fe!important;color:#4c1d95!important;}

/* PARTIES: CRM cards feel */
#parties.active .panel,#parties.active .tableWrap{background:linear-gradient(135deg,#fff,#faf5ff)!important;}
#parties.active tbody td:nth-child(1){font-weight:1000!important;color:#581c87!important;}
#parties.active tbody td:nth-child(1):before{content:"👥 ";}

/* ACCOUNTING / GST distinct office style */
#accounting.active .metrics article{background:linear-gradient(135deg,#0f172a,#334155)!important;color:#fff!important;border:0!important;}
#accounting.active .metrics article span,#accounting.active .metrics article strong{color:#fff!important;}
#gst.active .panel:first-child{background:linear-gradient(135deg,#450a0a,#dc2626)!important;color:#fff!important;border:0!important;}
#gst.active .panel:first-child h3{color:#fff!important;}
#gst.active .linkBtn{background:#fff!important;color:#7f1d1d!important;}

/* Mobile pro max: each screen looks like app page with hero card + thumb-friendly controls */
@media(max-width:900px){
  #items.active:before,#parties.active:before,#purchases.active:before,#orders.active:before,#payments.active:before,#accounting.active:before,#gst.active:before,#reports.active:before,#catalog.active:before,#distribution.active:before,#users.active:before,#control.active:before,#store.active:before,#superadmin.active:before{font-size:20px!important;padding:16px!important;border-radius:22px!important;line-height:1.25!important;}
  .view.active .panel,.view.active .tableWrap,.view.active .toolbar{box-shadow:0 10px 28px rgba(15,23,42,.08)!important;}
  #purchases.active #purchasePanel{display:block!important;}
  #purchases.active .lineEditor{grid-template-columns:1fr 1fr!important;}
  #reports.active .reportGrid{grid-template-columns:1fr!important;}
  #reports.active .reportGroup{grid-template-columns:1fr 1fr!important;}
  #items.active .bulkSheet th:nth-child(3),#items.active .bulkSheet td:nth-child(3){min-width:320px!important;}
  #items.active .bulkSheet td:nth-child(3) textarea,#items.active .bulkSheet td:nth-child(3) input{min-width:300px!important;}
}
@media(max-width:520px){
  #reports.active .reportGroup{grid-template-columns:1fr!important;}
  .view.active{padding:10px!important;}
}


/* Phase 245: professional optional catalog banners + non-crop product photos */
.panelSoft { border:1px dashed var(--line); border-radius:12px; padding:12px; background:#f8fafc; }
.miniStack { display:grid; gap:10px; }
.catalogBannerRow { display:grid; grid-template-columns: repeat(3, minmax(120px,1fr)); gap:8px; padding:10px; border:1px solid var(--line); border-radius:10px; background:#fff; }
.catalogBannerRow .span2 { grid-column: span 2; }
.catalogBannerRow input[type=file] { display:none; }
.miniFileBtn { display:inline-grid; place-items:center; border:1px solid var(--line); border-radius:8px; padding:8px 10px; background:#fff; cursor:pointer; }
.catalogBannerZone { display:grid; gap:10px; margin:12px 0; }
.catalogBannerZone.hidden { display:none !important; }
.catalogBanner { width:100%; border:0; padding:0; overflow:hidden; border-radius:16px; background:#fff; box-shadow:0 10px 28px rgba(15,23,42,.08); position:relative; cursor:pointer; }
.catalogBanner img { width:100%; max-height:220px; object-fit:contain; display:block; background:#f8fafc; }
.catalogBanner span { position:absolute; left:12px; bottom:12px; background:rgba(15,23,42,.72); color:#fff; border-radius:999px; padding:6px 10px; font-weight:700; font-size:13px; }
.catalogPhotoBtn { border:1px solid var(--line); padding:0; background:#f8fafc; cursor:pointer; overflow:hidden; }
.catalogPhotoBtn img { width:100%; height:100%; object-fit:contain; display:block; }
.catalogImagePreview { position:fixed; inset:0; background:rgba(15,23,42,.82); z-index:9999; display:grid; place-items:center; padding:18px; }
.catalogImagePreview.hidden { display:none !important; }
.catalogImagePreview img { max-width:96vw; max-height:92vh; object-fit:contain; border-radius:14px; background:#fff; }
.catalogImagePreview button { position:fixed; right:18px; top:18px; width:42px; height:42px; border-radius:999px; border:0; font-size:26px; cursor:pointer; }
.pulseCard { outline:3px solid #2563eb; outline-offset:3px; }
.catalogThumb { object-fit:contain !important; }
@media (max-width: 760px) { .catalogBannerRow { grid-template-columns:1fr; } .catalogBannerRow .span2 { grid-column:auto; } .catalogBanner img { max-height:150px; } }

/* Phase 247: professional banner placement + no-crop image fit */
.catalogInlineBanner { grid-column: 1 / -1; width: 100%; }
.catalogBanner { display:block; text-align:left; }
.catalogBanner img { width:100%; height:auto; min-height:96px; max-height:260px; object-fit:contain !important; object-position:center; background:linear-gradient(135deg,#f8fafc,#eef2ff); }
.catalogBannerZone:not(.hidden):empty { display:none !important; margin:0 !important; }
.catalogInlineBanner:empty { display:none !important; }
.catalogThumb { display:flex; align-items:center; justify-content:center; overflow:hidden; }
.catalogThumb img { width:100%; height:100%; object-fit:contain !important; object-position:center; display:block; background:#f8fafc; }
@media (max-width: 760px) {
  .catalogBanner img { max-height:170px; min-height:74px; }
}

/* Phase 252: video banner support + no crop media */
.catalogBanner video, .catalogBanner img { width:100%; height:auto; min-height:96px; max-height:280px; object-fit:contain !important; object-position:center; display:block; background:linear-gradient(135deg,#f8fafc,#eef2ff); }
.catalogBannerMedia-video video { background:#020617; }
@media (max-width:760px){ .catalogBanner video, .catalogBanner img { max-height:180px; min-height:76px; } }


/* Phase 253: video banner speaker toggle overlay */
.catalogBanner { position:relative; overflow:hidden; }
.catalogBanner .bannerSpeaker {
  position:absolute;
  right:10px;
  top:10px;
  z-index:5;
  width:38px;
  height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:rgba(2,6,23,.72);
  color:#fff;
  font-size:18px;
  line-height:1;
  box-shadow:0 8px 24px rgba(15,23,42,.25);
  cursor:pointer;
  user-select:none;
  -webkit-tap-highlight-color:transparent;
}
.catalogBanner .bannerSpeaker:focus { outline:2px solid rgba(59,130,246,.8); outline-offset:2px; }
.catalogBanner .catalogBannerTitle { position:relative; z-index:2; }
@media (max-width:760px){ .catalogBanner .bannerSpeaker { width:34px; height:34px; right:8px; top:8px; font-size:16px; } }

/* Phase 256 fix: show 3 complete item rate slabs clearly */
.audienceSlabRows{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(260px,1fr))!important;
  gap:10px!important;
  overflow-x:auto!important;
  align-items:start!important;
}
.audienceSlabBlock{
  border:1px solid #dbe4ef;
  background:#f8fafc;
  border-radius:12px;
  padding:8px;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:6px;
  min-width:260px;
}
.audienceSlabTitle{
  grid-column:1/-1;
  font-weight:900;
  color:#0f172a;
  font-size:12px;
}
.audienceSlabBlock label{min-width:0!important;}
.audienceSlabBlock input,.audienceSlabBlock select{width:100%!important;min-width:0!important;}
.audienceSlabBlock label:has([data-slab-calc-base]),
.audienceSlabBlock label:has([data-slab-rounding]){grid-column:1/-1;}
@media(max-width:900px){.audienceSlabRows{grid-template-columns:repeat(3,minmax(240px,240px))!important;}.audienceSlabBlock{min-width:240px;}}

/* Phase 257: readable 3-slab bulk rate control */
.bulkRateSlabControl{border:1px solid #dbeafe;border-radius:16px;padding:10px;background:#fff;}
.bulkRateSlabHelp{font-size:12px;color:#475569;margin-bottom:8px;line-height:1.4;}
.bulkRateSlabCards{display:grid;grid-template-columns:repeat(3,minmax(190px,1fr));gap:10px;}
.bulkRateSlabCard{border:1px solid #d8e7f7;border-radius:14px;padding:10px;background:linear-gradient(180deg,#ffffff,#f8fbff);display:grid;grid-template-columns:1fr 1fr;gap:8px;}
.bulkRateSlabCard strong{grid-column:1/-1;color:#0f172a;}
.bulkRateSlabCard label{display:flex;flex-direction:column;gap:4px;font-size:11px;font-weight:800;color:#334155;}
.bulkRateSlabCard input,.bulkRateSlabCard select{width:100%;min-width:0;height:34px!important;border-radius:10px!important;}
.bulkRatePreview{grid-column:1/-1;border-radius:10px;background:#ecfeff;color:#155e75;font-weight:900;font-size:12px;padding:7px 8px;}
@media(max-width:900px){.bulkRateSlabCards{grid-template-columns:1fr}.bulkRateSlabCard{grid-template-columns:1fr}}

/* PHASE 277: Mobile ERP / PWA operator layout
   Desktop remains table-first. Mobile becomes app-like cards + bottom navigation. */
.tdMobileBottomNav,
.tdMobileQuickFab,
.tdMobileInstallHint{display:none}

@media (max-width: 780px){
  body:not(.loggedOut){
    display:block!important;
    min-height:100vh;
    padding-bottom:86px;
    background:#eef3f8!important;
    overflow-x:hidden;
  }
  main{
    width:100%!important;
    min-width:0!important;
    padding:10px!important;
  }
  .sidebar{
    display:none!important;
  }
  .topbar{
    position:sticky!important;
    top:0!important;
    z-index:50!important;
    padding:10px 10px!important;
    margin:-10px -10px 10px!important;
    border-radius:0 0 18px 18px!important;
    display:flex!important;
    align-items:flex-start!important;
    gap:10px!important;
    background:rgba(255,255,255,.96)!important;
    backdrop-filter:blur(12px)!important;
  }
  .topbar h2{font-size:18px!important;line-height:1.2!important;margin:0!important;max-width:48vw!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .topbar .eyebrow{font-size:10px!important;margin:0 0 2px!important}
  .topbar .actions{margin-left:auto!important;display:flex!important;gap:6px!important;align-items:center!important;overflow-x:auto!important;max-width:58vw!important;padding-bottom:2px!important}
  .topbar .actions button,.topbar .actions .badge{white-space:nowrap!important;font-size:11px!important;padding:8px 9px!important;border-radius:999px!important}
  #userBadge{display:none!important}

  .view.active{display:block!important;min-width:0!important}
  .panel,.tableWrap,.metrics article,.toolbar,.bulkActionBar,.inlineForm,.reportGrid,.formGrid,.dashHero,.quickActionCard{
    border-radius:16px!important;
    box-shadow:0 8px 22px rgba(15,23,42,.06)!important;
    max-width:100%!important;
  }
  .panel,.tableWrap{padding:12px!important;margin-bottom:12px!important;overflow:visible!important}
  .toolbar,.bulkActionBar,.actions,.right,.split{
    display:flex!important;
    flex-wrap:wrap!important;
    gap:8px!important;
    align-items:center!important;
  }
  .toolbar input,.toolbar select,.toolbar button,.toolbar label.fileAction,.toolbar .compactAction,
  .bulkActionBar button,.bulkActionBar input,.bulkActionBar select{
    min-height:40px!important;
    flex:1 1 138px!important;
    max-width:100%!important;
  }
  .formGrid,.formGrid.twoCols,.formGrid.threeCols,.reportGrid,.dashGridTwo,.alertGrid,.signupShell{
    grid-template-columns:1fr!important;
  }
  label{font-size:12px!important}
  input,select,textarea,button{max-width:100%!important}
  textarea{min-height:92px!important}
  .metrics,.proMetrics{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  .metrics article strong,.proMetrics article strong{font-size:19px!important}
  .dashHero{align-items:flex-start!important;gap:10px!important;padding:14px!important}
  .dashHero h2{font-size:22px!important}
  .dashQuickActions{width:100%!important;display:grid!important;grid-template-columns:repeat(3,1fr)!important;gap:8px!important}
  .dashQuickActions button{width:100%!important;min-height:42px!important;font-size:12px!important}

  /* Generic rendered tables become readable cards on mobile. */
  .tableWrap.tdMobileCardWrap{overflow:visible!important;background:transparent!important;border:0!important;padding:0!important;box-shadow:none!important}
  table.tdMobileCardTable{display:block!important;min-width:0!important;width:100%!important;border:0!important;background:transparent!important}
  table.tdMobileCardTable thead{display:none!important}
  table.tdMobileCardTable tbody{display:grid!important;gap:10px!important;width:100%!important}
  table.tdMobileCardTable tr{display:block!important;background:#fff!important;border:1px solid #dbe4ef!important;border-radius:16px!important;padding:10px!important;box-shadow:0 7px 18px rgba(15,23,42,.06)!important;margin:0!important}
  table.tdMobileCardTable td{display:grid!important;grid-template-columns:minmax(92px,.42fr) minmax(0,1fr)!important;gap:8px!important;align-items:center!important;border:0!important;border-bottom:1px dashed #e5e7eb!important;padding:7px 0!important;white-space:normal!important;min-width:0!important;word-break:break-word!important}
  table.tdMobileCardTable td:last-child{border-bottom:0!important}
  table.tdMobileCardTable td::before{content:attr(data-label);font-size:11px;font-weight:800;color:#64748b;text-transform:uppercase;letter-spacing:.02em}
  table.tdMobileCardTable td:empty{display:none!important}
  table.tdMobileCardTable td .actions,table.tdMobileCardTable td button{justify-content:flex-start!important}
  table.tdMobileCardTable input,table.tdMobileCardTable select{min-height:36px!important}

  /* Keep advanced spreadsheet/bulk editors horizontally scrollable instead of card conversion. */
  .bulkSheetWrap,.salesLinesTable,.posBillTable,#purchasePanel .tableWrap.compact{overflow-x:auto!important;-webkit-overflow-scrolling:touch!important}
  .bulkSheet,.salesLinesTable table,.posBillTable table,#purchasePanel .tableWrap.compact table{min-width:900px!important}

  .tdMobileBottomNav{
    position:fixed;left:8px;right:8px;bottom:8px;z-index:90;
    display:grid;grid-template-columns:repeat(5,1fr);gap:6px;
    padding:8px;border:1px solid #dbe4ef;border-radius:22px;
    background:rgba(255,255,255,.96);backdrop-filter:blur(14px);
    box-shadow:0 16px 38px rgba(15,23,42,.18);
  }
  .tdMobileBottomNav button{border:0;background:#f1f5f9;color:#334155;border-radius:16px;padding:8px 4px;font-size:11px;font-weight:900;display:grid;gap:2px;place-items:center;min-height:48px}
  .tdMobileBottomNav button span{font-size:17px;line-height:1}
  .tdMobileBottomNav button.active{background:#0f766e;color:#fff}
  .tdMobileQuickFab{display:flex;position:fixed;right:14px;bottom:82px;z-index:91;background:#0f766e;color:white;border:0;border-radius:999px;min-width:54px;height:54px;align-items:center;justify-content:center;font-size:24px;box-shadow:0 12px 28px rgba(15,118,110,.35)}
  .tdMobileInstallHint{display:block;margin:8px 0 12px;padding:10px 12px;border-radius:14px;background:#ecfdf5;border:1px solid #bbf7d0;color:#065f46;font-size:12px;font-weight:800}
}

@media (max-width:480px){
  .metrics,.proMetrics{grid-template-columns:1fr!important}
  .dashQuickActions{grid-template-columns:1fr!important}
  table.tdMobileCardTable td{grid-template-columns:1fr!important;gap:4px!important}
  table.tdMobileCardTable td::before{font-size:10px!important}
}

/* Phase278 temporary mobile catalog counter */
.catalogHeaderActions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.ownerCounterPanel{max-width:760px}
.ownerCounterGrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:12px 0}
.ownerCounterGrid article{border:1px solid var(--border,#dbe3ef);border-radius:14px;padding:12px;background:#fff;display:flex;flex-direction:column;gap:4px}
.ownerCounterGrid strong{font-size:18px}
.ownerCounterGrid span{font-size:12px;color:#64748b}
.ownerCounterActions{display:flex;gap:10px;flex-wrap:wrap;margin:10px 0 12px}
.ownerCounterActions button,.ownerCounterActions .linkBtn{min-height:40px;border-radius:12px}
.catalogOrderActions{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px!important}
.linkBtn.disabled{opacity:.45;pointer-events:none}
@media(max-width:760px){
  .catalogHeaderActions{width:100%;justify-content:space-between}
  .ownerCounterGrid{grid-template-columns:1fr}
  .ownerCounterActions{display:grid;grid-template-columns:1fr 1fr}
  .ownerCounterActions .primary,.ownerCounterActions .linkBtn{width:100%;text-align:center}
}

/* PHASE 280: Bill Settings */
.billSettingsPanel .formGrid input,.billSettingsPanel .formGrid select,.billSettingsPanel textarea{min-height:40px}.settingsCheckGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px}.settingsCheckGrid .checkTile{border:1px solid #e3e8ef;border-radius:14px;padding:11px 12px;background:#fff;display:flex;align-items:center;gap:8px;font-weight:700}.billThemePreview{--bill-accent:#0f766e;border:1px solid #e3e8ef;border-top:5px solid var(--bill-accent);border-radius:18px;padding:16px;margin:12px 0;background:#fff;display:grid;gap:8px;box-shadow:0 10px 25px rgba(15,118,110,.08)}.billThemePreview strong{font-size:20px}.billThemePreview span{color:#647087}.billThemePreview .fakeBillLine{height:14px;border-radius:99px;background:#e9eef5}.billThemePreview .fakeBillLine.small{width:62%}.billThemePreview.theme-compact{padding:10px;border-radius:10px}.billThemePreview.theme-modern{background:linear-gradient(135deg,#fff,#f1fffc);border-radius:24px}.billThemePreview.theme-thermal{max-width:330px;border-radius:0;border:1px dashed #777;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.billGstSummary{margin-top:14px;border:1px solid #e3e8ef;border-radius:14px;padding:12px}.billGstSummary table{width:100%;border-collapse:collapse;margin-top:8px}.billGstSummary th,.billGstSummary td{border-bottom:1px solid #e3e8ef;padding:7px;text-align:left}.bill.billTheme-modern{border-top:8px solid var(--bill-accent,#0f766e);border-radius:22px}.bill.billTheme-compact{font-size:12px}.bill.billTheme-compact .billHead,.bill.billTheme-compact .billParty,.bill.billTheme-compact .billTotals{margin-bottom:8px}.bill.billTheme-thermal{max-width:80mm;margin:auto;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;border:none;box-shadow:none}.bill.billTheme-thermal .billHead,.bill.billTheme-thermal .billParty{display:block}.bill.billTheme-thermal .billTable th,.bill.billTheme-thermal .billTable td{padding:4px 2px}@media(max-width:780px){.settingsCheckGrid{grid-template-columns:1fr}.billSettingsGrid{display:block}.billThemePreview{margin-bottom:16px}}

/* PHASE 282: Advanced bill settings/theme polish */
.previewInvoiceTitle,.invoiceTitleTop{text-align:center;font-weight:900;text-transform:uppercase;letter-spacing:.12em;color:var(--bill-accent,#0f766e);font-size:18px;margin-bottom:8px}.fakeBillTotals{display:flex;gap:8px;flex-wrap:wrap}.fakeBillTotals b{background:#f1f5f9;border-radius:10px;padding:6px 9px}.billThemePreview.theme-bordered{border:2px solid var(--bill-accent,#0f766e);border-radius:8px;box-shadow:none}.billThemePreview.theme-minimal{border:0;border-top:2px solid #111;border-radius:0;box-shadow:none}.billThemePreview.theme-gst-pro{border-left:8px solid var(--bill-accent,#0f766e);background:#f8fafc}.billThemePreview.theme-letterhead{background:linear-gradient(90deg,var(--bill-accent,#0f766e) 0 10px,#fff 10px);border-radius:4px}.bill.billTheme-bordered{border:2px solid var(--bill-accent,#0f766e);box-shadow:none}.bill.billTheme-minimal{border:0;box-shadow:none}.bill.billTheme-minimal .billHead{border-bottom:1px solid #111}.bill.billTheme-gst-pro{border-left:10px solid var(--bill-accent,#0f766e);background:#fbfdff}.bill.billTheme-gst-pro .billTable th{background:var(--bill-accent,#0f766e);color:#fff}.bill.billTheme-letterhead{border-top:16px solid var(--bill-accent,#0f766e);border-radius:3px}.bill.billTheme-letterhead .billHead h1{letter-spacing:.04em}.invoiceTitleTop{font-size:20px;border-bottom:2px solid var(--bill-accent,#0f766e);padding-bottom:8px;margin-bottom:12px}.numberHint{font-size:11px;color:#64748b}

/* PHASE 283: AI Data Doctor */
.aiDataDoctorHero{border:1px solid rgba(14,165,233,.22);background:linear-gradient(135deg,rgba(14,165,233,.08),rgba(16,185,129,.08));}
.doctorStats{display:grid;grid-template-columns:repeat(4,minmax(120px,1fr));gap:12px;margin:14px 0;}
.doctorStats>div{background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:14px;box-shadow:0 4px 18px rgba(15,23,42,.06);}
.doctorStats strong{display:block;font-size:24px;color:#0f172a;}
.doctorStats span{font-size:12px;color:#64748b;}
.doctorAnswer,.doctorFixPreview{border:1px dashed #cbd5e1;border-radius:12px;padding:12px;background:#f8fafc;min-height:54px;}
.doctorFixLine{padding:8px 0;border-bottom:1px solid #e5e7eb;}
.doctorFixLine:last-child{border-bottom:0;}
.actions.wrap{display:flex;flex-wrap:wrap;gap:8px;}
@media(max-width:760px){.doctorStats{grid-template-columns:repeat(2,minmax(0,1fr));}.aiDataDoctorHero .actions button{flex:1 1 45%;}}

/* PHASE 284: AI Business Copilot */
.aiCopilotPanel{border:1px solid rgba(124,58,237,.22);background:linear-gradient(135deg,rgba(124,58,237,.07),rgba(245,158,11,.07));}
.aiCopilotPanel textarea{width:100%;min-height:84px;border:1px solid #cbd5e1;border-radius:14px;padding:12px;background:#fff;}
#aiCopilotSummary{margin:10px 0;background:#fff7ed;border-color:#fed7aa;}
#aiCopilotPreviewBody .badge{white-space:nowrap;}
@media(max-width:760px){.aiCopilotPanel .actions button{flex:1 1 45%;}.aiCopilotPanel .tableWrap{overflow:auto;}}

/* Phase 285: Catalog family grouping + smart size sort */
.catalogFamilyControls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: -4px 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.catalogFamilyControls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}
.catalogFamilyHeader {
  grid-column: 1 / -1;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(16, 185, 129, 0.08));
  overflow: hidden;
}
.catalogFamilyHeader button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  color: #0f172a;
}
.catalogFamilyHeader strong {
  display: block;
  font-size: 15px;
  letter-spacing: .01em;
}
.catalogFamilyHeader span,
.catalogFamilyHeader small {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-top: 2px;
}
.catalogFamilyHeader b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
}
@media (max-width: 720px) {
  .catalogFamilyControls { position: sticky; top: 118px; z-index: 5; }
  .catalogFamilyHeader button { padding: 12px; }
}


/* PHASE 286.1: ERP Catalog Settings */
.catalogSettingsPanel .catalogSettingsPreview{margin-top:16px;padding:14px;border:1px dashed rgba(15,118,110,.28);border-radius:14px;background:rgba(240,253,250,.65)}
.variantPreviewList{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.variantPreviewList span{padding:7px 10px;border-radius:999px;background:#fff;border:1px solid rgba(15,118,110,.18);font-weight:800;font-size:12px;color:#0f172a}

/* PHASE 296: Dynamic B2B Catalog CMS + Festival Theme Engine */
.catalogDynamicHome{display:grid;gap:12px;margin:12px auto 16px;max-width:1020px}
.catalogDynamicHome.hidden,.catalogHeroSlider.hidden,.catalogOfferStrip.hidden,.catalogQuickActions.hidden,.catalogBrandShowcase.hidden,.catalogMessageCards.hidden,.catalogCategoryTiles.hidden{display:none!important}
.catalogHeroSlider{position:relative;min-height:210px;border-radius:24px;overflow:hidden;background:linear-gradient(135deg,#0f172a,#2563eb);box-shadow:0 22px 55px rgba(15,23,42,.18)}
.catalogHeroSlide{position:absolute;inset:0;width:100%;height:100%;border:0;background:transparent;color:#fff;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:24px;padding:24px 30px;text-align:left;opacity:0;transform:scale(1.02);transition:opacity .45s ease,transform .45s ease;cursor:pointer;overflow:hidden}.catalogHeroSlide.active{opacity:1;transform:scale(1)}
.catalogHeroSlide:before{content:"";position:absolute;inset:-20%;background:radial-gradient(circle at 15% 20%,rgba(255,255,255,.24),transparent 32%),radial-gradient(circle at 80% 15%,rgba(255,255,255,.18),transparent 28%);pointer-events:none}.catalogHeroSlide span{position:relative;z-index:1;max-width:560px}.catalogHeroSlide b{display:block;font-size:34px;line-height:1.05;font-weight:950;text-shadow:0 3px 14px rgba(0,0,0,.22)}.catalogHeroSlide small{display:block;margin-top:8px;font-size:16px;line-height:1.45;opacity:.95}.catalogHeroSlide img{position:relative;z-index:1;width:min(44vw,470px);height:170px;object-fit:cover;border-radius:20px;background:rgba(255,255,255,.9);box-shadow:0 20px 50px rgba(0,0,0,.25)}
.catalogOfferStrip{border-radius:18px;overflow:hidden;background:linear-gradient(135deg,#0f766e,#2563eb);box-shadow:0 18px 38px rgba(37,99,235,.16)}
.dynamicOfferInner{width:100%;border:0;background:transparent;color:#fff;display:flex;align-items:center;gap:14px;padding:16px 18px;text-align:left;cursor:pointer}
.dynamicOfferInner img{width:170px;max-height:86px;object-fit:cover;border-radius:14px;background:#fff}
.dynamicOfferInner b{display:block;font-size:21px;line-height:1.15}.dynamicOfferInner small{display:block;margin-top:4px;font-size:13px;opacity:.95}
.catalogQuickActions{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px}.catalogQuickActions button,.catalogCategoryTiles button{border:1px solid rgba(15,23,42,.08);background:#fff;border-radius:16px;padding:12px;display:flex;align-items:center;gap:9px;justify-content:center;font-weight:800;color:#0f172a;box-shadow:0 8px 22px rgba(15,23,42,.05);cursor:pointer}.catalogQuickActions b,.catalogCategoryTiles b{font-size:18px}.catalogQuickActions span,.catalogCategoryTiles span{font-size:13px}
.catalogBrandShowcase{background:rgba(255,255,255,.9);border:1px solid rgba(15,23,42,.08);border-radius:18px;padding:13px;box-shadow:0 8px 22px rgba(15,23,42,.05)}.catalogBrandShowcase h3{margin:0 0 10px}.catalogBrandShowcase>div{display:flex;gap:10px;overflow:auto;padding-bottom:4px}.catalogBrandShowcase button{min-width:118px;border:1px solid rgba(15,23,42,.08);background:#f8fafc;border-radius:15px;padding:10px;display:flex;flex-direction:column;align-items:center;gap:7px;font-weight:800;cursor:pointer}.catalogBrandShowcase img{width:64px;height:42px;object-fit:contain}.catalogBrandShowcase b{width:50px;height:50px;border-radius:16px;background:linear-gradient(135deg,#dbeafe,#ccfbf1);display:grid;place-items:center;color:#0f766e}
.catalogMessageCards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}.catalogMessageCards article{border:1px solid rgba(15,23,42,.08);background:#fff;border-radius:18px;padding:14px;display:flex;gap:12px;box-shadow:0 8px 22px rgba(15,23,42,.05)}.catalogMessageCards article>b{font-size:24px}.catalogMessageCards strong{display:block;color:#0f172a}.catalogMessageCards p{margin:4px 0 0;color:#475569;font-size:13px;line-height:1.45}
.catalogCategoryTiles{display:flex;gap:9px;overflow:auto;padding:2px 0 6px}.catalogCategoryTiles button{min-width:110px;flex:0 0 auto;background:linear-gradient(135deg,#fff,#f8fafc)}
.catalogTheme-diwali .catalogAppBody,.catalogTheme-diwali{background:linear-gradient(135deg,#fff7ed,#fffbeb)!important}.catalogTheme-diwali .catalogOfferStrip{background:linear-gradient(135deg,#b45309,#dc2626)}
.catalogTheme-navratri{background:linear-gradient(135deg,#fff1f2,#fef3c7)!important}.catalogTheme-navratri .catalogOfferStrip{background:linear-gradient(135deg,#be123c,#7c3aed)}
.catalogTheme-holi{background:linear-gradient(135deg,#fdf2f8,#ecfeff)!important}.catalogTheme-holi .catalogOfferStrip{background:linear-gradient(135deg,#db2777,#2563eb)}
.catalogTheme-independence{background:linear-gradient(135deg,#fff7ed,#f0fdf4)!important}.catalogTheme-independence .catalogOfferStrip{background:linear-gradient(135deg,#ea580c,#16a34a)}
.catalogTheme-new_year{background:linear-gradient(135deg,#eef2ff,#f8fafc)!important}.catalogTheme-new_year .catalogOfferStrip{background:linear-gradient(135deg,#1d4ed8,#7c3aed)}

.catalogTheme-diwali .catalogTop,.catalogTheme-diwali .catalogHeader{background:linear-gradient(135deg,#7c2d12,#f59e0b)!important;color:#fff}.catalogTheme-diwali .catalogHeroSlider{background:linear-gradient(135deg,#7c2d12,#dc2626,#f59e0b)}.catalogTheme-diwali .catalogQuickActions button,.catalogTheme-diwali .catalogMessageCards article,.catalogTheme-diwali .catalogBrandShowcase{border-color:rgba(245,158,11,.35);box-shadow:0 14px 34px rgba(180,83,9,.16)}
.catalogTheme-navratri .catalogTop,.catalogTheme-navratri .catalogHeader{background:linear-gradient(135deg,#831843,#7c3aed)!important;color:#fff}.catalogTheme-navratri .catalogHeroSlider{background:linear-gradient(135deg,#be123c,#7c3aed,#f59e0b)}.catalogTheme-navratri .catalogQuickActions button,.catalogTheme-navratri .catalogCategoryTiles button{background:linear-gradient(135deg,#fff1f2,#fef3c7)}
.catalogTheme-holi .catalogTop,.catalogTheme-holi .catalogHeader{background:linear-gradient(135deg,#db2777,#2563eb,#16a34a)!important;color:#fff}.catalogTheme-holi .catalogHeroSlider{background:linear-gradient(135deg,#ec4899,#3b82f6,#22c55e)}.catalogTheme-holi .catalogQuickActions button{background:linear-gradient(135deg,#fdf2f8,#ecfeff)}
.catalogTheme-independence .catalogTop,.catalogTheme-independence .catalogHeader{background:linear-gradient(90deg,#ea580c,#fff,#16a34a)!important}.catalogTheme-independence .catalogHeroSlider{background:linear-gradient(135deg,#ea580c,#f8fafc,#16a34a);color:#0f172a}.catalogTheme-independence .catalogHeroSlide{color:#0f172a}.catalogTheme-independence .catalogOfferStrip{background:linear-gradient(135deg,#ea580c,#16a34a)}
.catalogTheme-new_year .catalogTop,.catalogTheme-new_year .catalogHeader{background:linear-gradient(135deg,#0f172a,#7c3aed)!important;color:#fff}.catalogTheme-new_year .catalogHeroSlider{background:linear-gradient(135deg,#111827,#2563eb,#7c3aed)}
.catalogCmsTabBox{border:1px dashed rgba(37,99,235,.25);border-radius:16px;background:#fff;padding:12px;margin:8px 0}.catalogCmsTabBox h4{margin:0 0 4px}.catalogCmsUploadBlock input[type="hidden"]{display:none!important}
.catalogCmsBuilder{margin-top:14px;border:1px solid rgba(15,118,110,.12);border-radius:16px;background:#f8fffd;padding:14px}.catalogCmsBuilder h4{margin:0 0 4px}.catalogCmsBuilder textarea{width:100%;min-height:70px;border:1px solid #dbe3ef;border-radius:12px;padding:10px;background:#fff}.catalogCmsBuilder small{display:block;color:#64748b;margin:3px 0 5px;font-weight:600}.catalogCmsBuilder .span2{grid-column:1/-1}
@media(max-width:760px){.catalogDynamicHome{margin:10px 8px}.catalogHeroSlider{min-height:280px;border-radius:18px}.catalogHeroSlide{grid-template-columns:1fr;padding:18px}.catalogHeroSlide img{width:100%;height:130px;order:-1}.catalogHeroSlide b{font-size:24px}.catalogHeroSlide small{font-size:14px}.dynamicOfferInner{padding:12px;align-items:flex-start}.dynamicOfferInner img{width:105px;max-height:70px}.dynamicOfferInner b{font-size:17px}.catalogQuickActions{grid-template-columns:repeat(2,minmax(0,1fr))}.catalogMessageCards{grid-template-columns:1fr}}

/* Phase 297: Catalog CMS direct image upload */
.catalogCmsUploadBlock { display:grid; gap:8px; }
.catalogCmsUploadActions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.catalogCmsImagePreview { width:100%; max-width:420px; max-height:160px; object-fit:contain; border:1px solid var(--line,#dbeafe); border-radius:14px; background:#f8fafc; padding:6px; }
.catalogCmsImagePreview.hidden { display:none !important; }


/* Phase 299: hero slider image-only and per-slide target polish */
.catalogHeroSlide.imageOnly{display:block;padding:0;background:#fff;}
.catalogHeroSlide.imageOnly:before{display:none;}
.catalogHeroSlide.imageOnly img{width:100%;height:100%;max-width:none;border-radius:0;object-fit:cover;box-shadow:none;background:transparent;}
.catalogHeroSlide span:empty{display:none;}
.catalogCmsTabBox select{width:100%;}

/* Phase 300: Multi-slider location + no-crop fit controls */
.catalogHeroSlider{min-height:var(--slider-h,260px);height:var(--slider-h,260px)}
.catalogCmsExtraSlider{margin:14px 0}
.catalogHeroSlide.fit-contain img{object-fit:contain!important;background:#fff}
.catalogHeroSlide.fit-cover img{object-fit:cover!important}
.catalogHeroSlide.fit-auto img{object-fit:contain!important;background:#fff}
.catalogHeroSlide.imageOnly.fit-contain img,.catalogHeroSlide.imageOnly.fit-auto img{object-fit:contain!important;background:#fff}
.catalogHeroSlide.imageOnly.fit-cover img{object-fit:cover!important}
@media(max-width:760px){.catalogHeroSlider{min-height:var(--slider-mobile-h,190px);height:var(--slider-mobile-h,190px)}.catalogCmsExtraSlider{margin:10px 8px}}

/* Phase 301: Dynamic widget layout + optional image/text blocks */
.dynamicOfferInner.imageOnly span{display:none}
.dynamicOfferInner.imageOnly img{width:100%;height:100%;object-fit:contain;border-radius:18px}
.catalogMessageCards article{overflow:hidden}
.catalogMessageCards article img{max-width:100%;width:100%;height:auto;border-radius:14px;display:block}
.catalogMessageCards article.imageOnly{padding:0;background:transparent;box-shadow:none;border:0}
.catalogMessageCards article.imageOnly img{object-fit:contain}


/* 2026-06-15: Catalogue create/edit me banner aur text-message dono same rows se manage honge. */
.catalogBannerMedia-message { padding:14px 16px; background:linear-gradient(135deg,#fff7ed,#ecfccb); border:1px solid rgba(132,204,22,.25); box-shadow:0 10px 24px rgba(15,23,42,.08); }
.catalogBannerMedia-message .catalogBannerMessageText { position:static; display:block; background:transparent; color:#334155; border-radius:0; padding:0; font-size:15px; line-height:1.45; font-weight:800; }
@media (max-width:760px){ .catalogBannerMedia-message { padding:12px 13px; } .catalogBannerMedia-message .catalogBannerMessageText { font-size:14px; } }

/* Phase 324: Real professional catalogue redesign - fixes broken narrow/empty layout */
.catalogProView .metrics.catalogMetrics{grid-template-columns:repeat(4,minmax(140px,1fr));gap:16px;margin-bottom:14px;}
.catalogProHero{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:14px;background:linear-gradient(135deg,#fff,#fff7ed);border:1px solid rgba(249,115,22,.18);}
.catalogProHero h2{margin:0 0 4px;font-size:26px;line-height:1.1;color:#0f172a;}
.catalogProHero .eyebrow{margin:0 0 4px;text-transform:uppercase;letter-spacing:.08em;color:#be123c;font-weight:900;font-size:12px;}
.catalogProBadges{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;}
.catalogProBadges span{display:inline-flex;align-items:center;border:1px solid rgba(15,118,110,.22);background:#ecfdf5;color:#0f766e;border-radius:999px;padding:8px 11px;font-weight:900;font-size:12px;}
.catalogMainGrid{display:grid!important;grid-template-columns:1fr!important;gap:16px!important;align-items:start!important;}
.catalogDesignerShell{display:grid;grid-template-columns:minmax(520px,1.05fr) minmax(420px,.95fr);gap:16px;align-items:start;}
.catalogDesignerLeft{display:grid;gap:16px;min-width:0;}
.catalogDesignerRight{position:sticky;top:86px;max-height:calc(100vh - 110px);overflow:hidden;display:flex;flex-direction:column;min-width:0;}
.catalogDesignScroll{overflow:auto;padding-right:4px;display:grid;gap:12px;}
.catalogProDetails{border:1px solid #e2e8f0;border-radius:16px;background:#fff;box-shadow:0 8px 22px rgba(15,23,42,.04);overflow:hidden;}
.catalogProDetails summary{cursor:pointer;font-weight:950;color:#0f172a;padding:13px 14px;background:linear-gradient(180deg,#f8fafc,#fff);border-bottom:1px solid #edf2f7;}
.catalogProDetails[open] summary{border-bottom:1px solid #e2e8f0;}
.catalogProDetails>.formGrid,.catalogProDetails>.catalogCoverUploadBox,.catalogProDetails>.actions{margin:12px;}
.catalogCompactGrid{gap:12px;}
.catalogCompactGrid label,.rateControlGrid label{min-width:0;}
.catalogCompactGrid textarea,.catalogCompactGrid select,.catalogCompactGrid input,.rateControlGrid textarea,.rateControlGrid select,.rateControlGrid input{max-width:100%;}
.catalogRuleGrid{display:grid;grid-template-columns:1fr 1fr;gap:14px;}
.catalogVisibilityInline{border-left:0!important;background:linear-gradient(180deg,#ffffff,#f8fffd)!important;border-top:4px solid #0f766e;}
.catalogVisibilityInline h4::after{content:""!important;}
.catalogStickyActions{grid-column:1/-1;position:sticky;bottom:10px;z-index:8;background:rgba(255,255,255,.95);backdrop-filter:blur(8px);border:1px solid rgba(15,23,42,.08);box-shadow:0 18px 40px rgba(15,23,42,.12);}
.catalogStickyActions .actions{gap:10px;flex-wrap:wrap;}
.catalogLinksPanel{margin-top:16px;}
.catalogRulesTables{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:16px;}
.rateControlGrid{grid-template-columns:repeat(3,minmax(220px,1fr));gap:14px;}
.rateControlGrid .span2,.bulkRateSlabControl{grid-column:1/-1;}
.bulkRateControlPanel{max-width:none!important;margin:0!important;}
.bulkRateSlabCards{display:grid;grid-template-columns:repeat(3,minmax(220px,1fr));gap:14px;}
.bulkRateSlabCard{min-width:0;}
#catalog[data-active-catalog-tab="catalog"] .catalogTabPanel-rate{display:none!important;}
#catalog[data-active-catalog-tab="rate"] .catalogTabPanel-catalog{display:none!important;}
#catalog[data-active-catalog-tab="rate"] .catalogLinksPanel,#catalog[data-active-catalog-tab="rate"] .catalogRulesTables{display:none!important;}
#catalog[data-active-catalog-tab="catalog"] .catalogRateLegacy{display:none!important;}
#catalog .panel{max-width:100%;}
#catalog .span2{grid-column:1/-1;}
@media(max-width:1280px){.catalogDesignerShell{grid-template-columns:1fr}.catalogDesignerRight{position:relative;top:auto;max-height:none}.catalogRuleGrid,.catalogRulesTables{grid-template-columns:1fr}.rateControlGrid{grid-template-columns:1fr 1fr}.bulkRateSlabCards{grid-template-columns:1fr}}
@media(max-width:760px){.catalogProView .metrics.catalogMetrics{grid-template-columns:1fr 1fr}.catalogProHero{display:block}.catalogProBadges{justify-content:flex-start;margin-top:10px}.rateControlGrid{grid-template-columns:1fr}.catalogSectionTabs{position:sticky;top:0;z-index:20}.catalogStickyActions{position:static}.catalogStickyActions .actions{justify-content:stretch}.catalogStickyActions button{width:100%}}

/* Phase 326: Catalog designer hidden slider/offer fix - no compressed/dabbed sections */
#catalog .catalogDesignerShell{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:18px!important;overflow:visible!important;}
#catalog .catalogDesignerRight{overflow:visible!important;max-height:none!important;height:auto!important;padding-bottom:16px!important;}
#catalog .catalogDesignScroll{display:grid!important;grid-template-columns:repeat(2,minmax(320px,1fr))!important;gap:16px!important;overflow:visible!important;max-height:none!important;height:auto!important;align-items:start!important;}
#catalog .catalogDesignCard{display:block!important;overflow:visible!important;min-height:auto!important;align-self:start!important;}
#catalog .catalogDesignCard > .formGrid,#catalog .catalogDesignCard > .formGrid.twoCols{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important;padding:12px!important;margin:0!important;overflow:visible!important;}
#catalog .catalogDesignCard-slider{grid-column:1/-1!important;}
#catalog .catalogDesignCard-slider > .formGrid.twoCols{grid-template-columns:repeat(3,minmax(220px,1fr))!important;}
#catalog .catalogDesignCard-offer,#catalog .catalogDesignCard-message,#catalog .catalogDesignCard-widgets{grid-column:auto!important;}
#catalog .catalogDesignCard-offer{border-top:4px solid #f97316!important;}
#catalog .catalogDesignCard-message{border-top:4px solid #2563eb!important;}
#catalog .catalogDesignCard-widgets{border-top:4px solid #7c3aed!important;}
#catalog .catalogDesignCard textarea{min-height:92px!important;}
#catalog #catalogHeroSlides,#catalog #catalogWidgets{min-height:132px!important;}
#catalog #catalogOfferText,#catalog #catalogMessageCards{min-height:108px!important;}
#catalog .catalogCoverPreview,#catalog #catalogOfferImagePreview{display:flex!important;align-items:center!important;justify-content:center!important;min-height:88px!important;overflow:visible!important;white-space:normal!important;}
#catalog .catalogCmsUploadBlock,#catalog .catalogCmsUploadActions,#catalog .miniFileBtn{overflow:visible!important;white-space:normal!important;}
#catalog .catalogStickyActions{margin-top:0!important;}
@media(min-width:1500px){#catalog .catalogDesignerShell{grid-template-columns:minmax(520px,.82fr) minmax(820px,1.18fr)!important;}#catalog .catalogDesignScroll{grid-template-columns:repeat(2,minmax(360px,1fr))!important;}}
@media(max-width:1180px){#catalog .catalogDesignScroll,#catalog .catalogDesignCard-slider > .formGrid.twoCols{grid-template-columns:1fr!important;}#catalog .catalogDesignCard-offer,#catalog .catalogDesignCard-message,#catalog .catalogDesignCard-widgets{grid-column:1/-1!important;}}
@media(max-width:720px){#catalog .catalogDesignCard > .formGrid,#catalog .catalogDesignCard > .formGrid.twoCols{grid-template-columns:1fr!important;}}

/* Catalog content + scheme rules visibility fix 20260703 */
.catalogBannerRows{display:grid;gap:12px;margin:12px;}
.catalogBannerBuilderHelp{margin:12px 12px 0;padding:10px 12px;border-radius:12px;background:#f8fafc;border:1px solid #e2e8f0;}
#catalog .catalogDesignCard-banners{border-top:4px solid #0ea5e9!important;}
#catalog .catalogDesignCard-scheme{border-top:4px solid #16a34a!important;grid-column:1/-1!important;}
#catalog .catalogDesignCard-scheme code{background:#ecfdf5;color:#166534;border-radius:6px;padding:2px 5px;}
.catalogHeroSlide video{position:relative;z-index:1;width:min(44vw,470px);height:170px;object-fit:contain;border-radius:20px;background:#020617;box-shadow:0 20px 50px rgba(0,0,0,.25)}
.catalogHeroSlide.imageOnly video{width:100%;height:100%;max-width:none;border-radius:0;object-fit:contain;box-shadow:none;background:#020617;}
.catalogHeroSlide.fit-cover video{object-fit:cover!important}.catalogHeroSlide.fit-contain video,.catalogHeroSlide.fit-auto video{object-fit:contain!important}
@media(max-width:760px){.catalogHeroSlide video{width:100%;height:130px;order:-1}.catalogBannerRows{margin:10px 0}}


/* 2026-07-03 Catalog Designer full UI/runtime repair */
#catalog .catalogDesignCard-preview{grid-column:1/-1!important;border-top:4px solid #0f766e!important;}
.catalogDesignerPreview{display:grid;gap:14px;padding:14px;background:linear-gradient(180deg,#f8fafc,#fff);border:1px solid #dbeafe;border-radius:16px;}
.catalogDesignerPreview section{display:grid;gap:9px;}
.catalogDesignerPreview h4{margin:0;color:#0f172a;font-size:14px;}
.catalogDesignerPreviewSlider{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
.catalogDesignerPreviewSlider article,.catalogDesignerPreviewOffer,.catalogDesignerPreviewCards article{overflow:hidden;border:1px solid #e2e8f0;border-radius:14px;background:#fff;box-shadow:0 8px 20px rgba(15,23,42,.06);}
.catalogDesignerPreviewSlider article img,.catalogDesignerPreviewSlider article video,.catalogDesignerPreviewOffer img,.catalogDesignerPreviewOffer video,.catalogDesignerPreviewCards img,.catalogDesignerPreviewCards video{width:100%;height:120px;object-fit:contain;background:#f8fafc;display:block;}
.catalogDesignerPreviewSlider article>div,.catalogDesignerPreviewOffer>div,.catalogDesignerPreviewCards article>div{display:grid;gap:3px;padding:9px;}
.catalogDesignerPreviewSlider small,.catalogDesignerPreviewOffer small,.catalogDesignerPreviewCards small{color:#64748b;}
.catalogDesignerPreviewCards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
.catalogDesignerPreviewCards article> b{display:block;padding:10px;font-size:22px;}
.catalogDesignerPreviewCards p{margin:3px 0 0;color:#475569;font-size:12px;}
.catalogDesignerPreviewChips{display:flex;flex-wrap:wrap;gap:8px;}
.catalogDesignerPreviewChips span{display:inline-flex;align-items:center;gap:7px;padding:8px 10px;border:1px solid #dbeafe;border-radius:999px;background:#fff;font-weight:800;font-size:12px;}
.catalogDesignerPreviewChips img,.catalogDesignerPreviewChips video{width:28px;height:28px;object-fit:contain;border-radius:50%;}
.catalogOfferImagePreview img{width:100%;max-height:180px;object-fit:contain;border-radius:12px;background:#f8fafc;}
.catalogCategoryTiles button img{width:42px;height:42px;object-fit:contain;border-radius:12px;background:#fff;}
@media(max-width:900px){.catalogDesignerPreviewSlider,.catalogDesignerPreviewCards{grid-template-columns:1fr 1fr;}}
@media(max-width:600px){.catalogDesignerPreviewSlider,.catalogDesignerPreviewCards{grid-template-columns:1fr;}}

/* Catalog category icon fallback: never replace missing icons with name initials. */
.catalogCategoryTiles .categoryFallbackIcon{
  width:42px;height:42px;border-radius:12px;background:#fff;display:inline-flex;align-items:center;justify-content:center;
  font-size:24px;line-height:1;flex:0 0 42px;box-shadow:inset 0 0 0 1px rgba(15,23,42,.06);
}

/* Owner-friendly Promotion, Quantity Policy and Billing Override */
.policyGuideStrip{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0 18px}.policyGuideStrip span{background:#ecfdf5;border:1px solid #a7f3d0;border-radius:999px;padding:7px 11px;font-size:12px}.ownerFriendlyGrid select[multiple]{min-height:132px;padding:7px}.ownerFriendlyGrid .checkTile{align-self:end;min-height:54px}.friendlyResult{margin-top:12px;border:1px dashed #cbd5e1;border-radius:12px;padding:10px;min-height:20px;background:#f8fafc;white-space:normal;overflow:auto}.friendlyResult:empty{display:none}.sizeChoiceBox,.tierEditor{margin-top:14px;padding:12px;border:1px solid #dbeafe;border-radius:14px;background:#f8fbff}.sizeChoiceGrid{display:flex;gap:12px;flex-wrap:wrap;margin-top:9px}.sizeChoiceGrid label{display:flex;align-items:center;gap:5px;background:white;border:1px solid #dbeafe;border-radius:9px;padding:7px 9px}.promotionTierRow{display:grid;grid-template-columns:minmax(120px,1fr) minmax(130px,1fr) minmax(180px,2fr) auto;gap:8px;margin-top:8px}.promotionTierRow input{width:100%}.invoiceQtyOverrideBox{display:grid;gap:7px;padding:10px;border:1px solid #f59e0b;border-radius:12px;background:#fffbeb}.invoiceQtyOverrideBox small{color:#92400e}.qtyOverrideReason{max-width:220px}.overrideBadge{display:inline-block;margin-left:6px;padding:2px 7px;border-radius:999px;background:#fef3c7;color:#92400e;font-size:11px}.friendlyCards{display:grid;gap:8px}.friendlyCard{border:1px solid #dbeafe;border-radius:10px;padding:9px;background:white}.friendlyCard strong{display:block;margin-bottom:3px}@media(max-width:760px){.promotionTierRow{grid-template-columns:1fr}.ownerFriendlyGrid select[multiple]{min-height:110px}}
.selectSearch{width:100%;margin:5px 0 6px;padding:8px 10px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;font-size:12px}.selectSearch:focus{outline:2px solid rgba(15,118,110,.18);border-color:#0f766e}.ownerSelectHint{margin:-8px 0 16px;padding:8px 10px;border-left:3px solid #0f766e;background:#f0fdfa;border-radius:8px;color:#134e4a}.ownerFriendlyGrid select[multiple] option:checked{font-weight:800}

/* Central promotion live preview and reports */
.promotionSuggestionBox{display:grid;gap:8px;margin:10px 0;padding:11px 12px;border:1px solid #93c5fd;border-radius:13px;background:#eff6ff;color:#1e3a8a;white-space:normal}
.promotionSuggestionBox.hidden{display:none!important}
.promotionSuggestionItem{padding:8px 10px;border-radius:10px;background:#fff;border:1px solid #bfdbfe;font-size:13px;line-height:1.45}
.promotionSuggestionItem.applied{border-color:#86efac;background:#f0fdf4;color:#166534}
.promotionSuggestionItem.warn{border-color:#fcd34d;background:#fffbeb;color:#92400e}
.promotionSuggestionTotal{padding-top:4px;text-align:right;color:#0f172a}
.catalogPromotionSuggestions{display:grid;gap:8px;margin:10px 0;padding:10px;border:1px solid #a7f3d0;border-radius:13px;background:#ecfdf5;color:#166534}
.catalogPromotionSuggestions.hidden{display:none!important}
.catalogPromotionSuggestions .schemeNear{padding:8px 9px;border-radius:9px;background:#fff;border:1px solid #bbf7d0;font-size:13px;line-height:1.4}
.catalogPromotionSuggestions .schemeApplied{border-color:#86efac;font-weight:700}
.catalogPromotionSuggestions .schemeWarn{border-color:#fcd34d;background:#fffbeb;color:#92400e}

/* Party Master Foundation Phase 1 */
.partyRoleChooser{display:flex;flex-wrap:wrap;gap:8px 12px;margin-top:14px;padding:14px;border:1px solid #dbe4ef;border-radius:16px;background:#f8fafc;}
.partyRoleChooser>strong{flex:0 0 100%;color:#0f172a;font-size:13px;}
.partyRoleChooser .checkLine{display:inline-flex;align-items:center;gap:6px;margin:0;padding:7px 10px;border:1px solid #e2e8f0;border-radius:999px;background:#fff;font-size:12px;font-weight:700;}
.partyRoleChooser .checkLine input{width:auto;min-height:0;margin:0;}
.partyActions{flex-wrap:wrap;}
@media(max-width:720px){.partyRoleChooser{gap:7px}.partyRoleChooser .checkLine{padding:6px 8px}.partyTable{overflow:auto}.partyTable table{min-width:1100px}}

/* Item Master central brand filters - 2026-07-07 */
.storeSearchLine { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 220px); gap: 10px; }
@media (max-width: 700px) {
  .storeSearchLine, .catalogSearchBar { grid-template-columns: minmax(0, 1fr) !important; }
}

/* Order Center production workflow: view/edit/approve before invoice */
.orderCenterToolbar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;justify-content:flex-end}
.orderCenterToolbar input{min-width:230px}
.orderCenterToolbar select{min-width:150px}
#orderCenterBody .rowActions{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
#orderCenterBody .rowActions button.primaryAction{background:var(--brand);color:#fff;border-color:var(--brand)}
#orderCenterBody .rowActions button.warningAction{background:#fffbeb;border-color:#fcd34d;color:#92400e}
#orderCenterBody .rowActions button.dangerAction{background:#fff5f5;border-color:#fecaca;color:#b91c1c}
.orderDetailDialog{width:min(1120px,96vw);max-height:94vh;border:0;border-radius:18px;padding:0;box-shadow:0 28px 80px rgba(15,23,42,.28)}
.orderDetailDialog::backdrop{background:rgba(15,23,42,.55);backdrop-filter:blur(3px)}
.orderDialogShell{display:grid;gap:14px;padding:18px;background:#f8fafc;max-height:94vh;overflow:auto}
.orderDialogHead{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;padding-bottom:12px;border-bottom:1px solid var(--line)}
.orderDialogHead h3{margin:5px 0 2px;font-size:22px}.orderDialogHead p{margin:0}
.orderDialogHead .iconBtn{width:38px;height:38px;padding:0;border-radius:50%;font-size:24px;line-height:1}
.orderDetailMetrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.orderDetailMetrics article{background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px;display:grid;gap:4px}
.orderDetailMetrics article span{font-size:12px;color:var(--muted)}.orderDetailMetrics article strong{font-size:16px;color:var(--ink)}
.orderDetailGrid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr);gap:12px}
.orderDetailCard{background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px}
.orderDetailCard h4{margin:0 0 10px}.orderEditableFields .wide{grid-column:1/-1}
.orderDetailCard input:disabled,.orderDetailCard select:disabled,.orderDetailCard textarea:disabled{background:#f8fafc;color:#334155;opacity:1;border-color:#e2e8f0}
.orderTimeline{display:grid;gap:7px;margin-bottom:10px;max-height:170px;overflow:auto}
.orderTimelineItem{display:grid;grid-template-columns:auto 1fr;gap:8px;padding:8px;border:1px solid #e2e8f0;border-radius:10px;background:#f8fafc}
.orderTimelineItem time{font-size:11px;color:var(--muted);white-space:nowrap}.orderTimelineItem b{font-size:12px}.orderTimelineItem small{display:block;color:var(--muted);margin-top:2px}
.orderDialogActions{position:sticky;bottom:-18px;display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;padding:12px 4px;background:linear-gradient(180deg,rgba(248,250,252,.72),#f8fafc 35%);border-top:1px solid var(--line)}
.orderDialogActions button,.orderDialogActions a{min-height:38px}
.orderQtyInput{width:96px;min-width:76px}.orderLineStatus{min-width:112px}
.orderActionHint{margin-right:auto;color:var(--muted);font-size:12px;align-self:center}
@media(max-width:900px){
  .orderCenterToolbar{justify-content:stretch}.orderCenterToolbar input,.orderCenterToolbar select,.orderCenterToolbar a,.orderCenterToolbar button{width:100%;min-width:0}
  .orderDetailDialog{width:100vw;max-width:100vw;height:100vh;max-height:100vh;border-radius:0}
  .orderDialogShell{max-height:100vh;min-height:100vh;padding:12px}.orderDetailGrid{grid-template-columns:1fr}.orderDetailMetrics{grid-template-columns:repeat(2,minmax(0,1fr))}
  .orderDialogActions{bottom:-12px}.orderDetailCard{padding:10px}
}

/* Order Center functional UI repair - 2026-07-08 */
.orderWorkspace{display:grid;gap:16px}
.orderHero{display:flex;justify-content:space-between;gap:20px;align-items:center;padding:22px;border:1px solid #dbeafe;border-radius:20px;background:linear-gradient(135deg,#eff6ff 0%,#fff 52%,#f0fdf4 100%);box-shadow:0 12px 30px rgba(15,23,42,.06)}
.orderHero h2{margin:4px 0 6px;font-size:30px;color:#0f172a}.orderHero p{margin:0;max-width:760px;color:#475569;line-height:1.55}
.orderHeroActions{display:flex;gap:9px;flex-wrap:wrap;justify-content:flex-end}.orderHeroActions>*{white-space:nowrap}
.orderMetrics{grid-template-columns:repeat(4,minmax(0,1fr))}.orderMetrics article{position:relative;overflow:hidden;min-height:96px}.orderMetrics article:after{content:"";position:absolute;right:-20px;bottom:-28px;width:86px;height:86px;border-radius:50%;background:rgba(37,99,235,.07)}.orderMetrics small{display:block;margin-top:4px;color:#64748b;font-size:11px}
.orderFeedback{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border-radius:12px;border:1px solid #bfdbfe;background:#eff6ff;color:#1e3a8a}.orderFeedback b{white-space:nowrap}.orderFeedback span{line-height:1.45}.orderFeedback.warning{border-color:#fde68a;background:#fffbeb;color:#92400e}.orderFeedback.error{border-color:#fecaca;background:#fef2f2;color:#991b1b}.orderFeedback.hidden{display:none!important}
.orderListPanel{padding:0;overflow:hidden}.orderSourceTabs{display:flex;gap:4px;padding:12px 14px 0;overflow:auto;border-bottom:1px solid #e2e8f0;background:#f8fafc}.orderSourceTabs button{display:flex;align-items:center;gap:7px;min-height:40px;padding:8px 12px;border:0;border-bottom:3px solid transparent;border-radius:10px 10px 0 0;background:transparent;color:#475569;font-weight:700;white-space:nowrap}.orderSourceTabs button:hover{background:#fff}.orderSourceTabs button.active{background:#fff;color:#1d4ed8;border-bottom-color:#2563eb}.orderSourceTabs button span{min-width:22px;padding:2px 6px;border-radius:999px;background:#e2e8f0;font-size:11px;text-align:center}.orderSourceTabs button.active span{background:#dbeafe;color:#1d4ed8}
.orderFilterBar{display:grid;grid-template-columns:minmax(230px,1fr) minmax(150px,210px) minmax(150px,210px) auto;gap:10px;align-items:end;padding:14px;background:#fff}.orderFilterBar label{display:grid;gap:5px;margin:0}.orderFilterBar label>span{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:#64748b}.orderFilterBar input,.orderFilterBar select{width:100%;min-height:42px}.orderFilterBar button{min-height:42px}
.orderTableWrap{border-top:1px solid #e2e8f0}.orderCenterTable{min-width:980px}.orderCenterTable th{position:sticky;top:0;z-index:1;background:#f8fafc;color:#475569;font-size:11px;text-transform:uppercase;letter-spacing:.03em}.orderCenterTable td{vertical-align:middle}.orderCenterTable td small{display:block;margin-top:3px;color:#64748b}.orderCenterTable tbody tr:hover{background:#f8fbff}
.orderSourcePill,.orderStatusPill{display:inline-flex;align-items:center;justify-content:center;gap:5px;padding:5px 9px;border-radius:999px;font-size:11px;font-weight:800;line-height:1.2;white-space:nowrap}.orderSourcePill{background:#f1f5f9;color:#334155}.orderSourcePill.online{background:#dbeafe;color:#1d4ed8}.orderSourcePill.b2b{background:#ede9fe;color:#6d28d9}.orderSourcePill.sale{background:#dcfce7;color:#166534}.orderSourcePill.purchase{background:#fef3c7;color:#92400e}.orderStatusPill.neutral{background:#f1f5f9;color:#475569}.orderStatusPill.info{background:#dbeafe;color:#1d4ed8}.orderStatusPill.success{background:#dcfce7;color:#166534}.orderStatusPill.warning{background:#fef3c7;color:#92400e}.orderStatusPill.danger{background:#fee2e2;color:#b91c1c}
#orderCenterBody .rowActions,.orderMobileCard .rowActions{display:flex;gap:7px;flex-wrap:wrap;align-items:center}#orderCenterBody .rowActions button,.orderMobileCard .rowActions button{min-height:34px;padding:7px 10px}#orderCenterBody .rowActions .primaryAction,.orderMobileCard .rowActions .primaryAction{background:#2563eb;color:#fff;border-color:#2563eb}.linkBtn.compact{min-height:30px;padding:5px 8px;font-size:11px}.muted{color:#94a3b8;font-size:12px}
.orderLoadingCell{display:flex;gap:9px;align-items:center;padding:18px;color:#475569}.spinner{display:inline-block;width:18px;height:18px;border:2px solid #cbd5e1;border-top-color:#2563eb;border-radius:50%;animation:orderSpin .75s linear infinite}@keyframes orderSpin{to{transform:rotate(360deg)}}
.orderEmptyState{display:grid;place-items:center;gap:5px;min-height:180px;padding:24px;text-align:center;color:#64748b;border-top:1px solid #e2e8f0}.orderEmptyState strong{font-size:17px;color:#334155}.orderEmptyState.hidden{display:none!important}
.orderCenterCards{display:none;padding:12px;gap:10px}.orderMobileCard{display:grid;gap:12px;padding:14px;border:1px solid #dbe4ef;border-radius:15px;background:#fff;box-shadow:0 5px 15px rgba(15,23,42,.05)}.orderMobileCardHead{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.orderMobileCardHead h4{margin:7px 0 0;font-size:16px}.orderMobileCardParty{display:grid;gap:2px}.orderMobileCardParty span{color:#64748b;font-size:12px}.orderMobileCardMeta{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.orderMobileCardMeta>span{display:grid;gap:3px;padding:8px;border-radius:10px;background:#f8fafc;font-size:12px}.orderMobileCardMeta small{color:#64748b}.orderCardSkeleton{height:160px;border-radius:15px;background:linear-gradient(90deg,#f1f5f9 25%,#e2e8f0 37%,#f1f5f9 63%);background-size:400% 100%;animation:orderSkeleton 1.3s ease infinite}@keyframes orderSkeleton{0%{background-position:100% 0}100%{background-position:0 0}}
.orderDetailDialog{overflow:hidden}.orderDialogShell{padding:0;gap:0;background:#f8fafc}.orderDialogHead{position:sticky;top:0;z-index:4;padding:15px 18px;background:#fff;box-shadow:0 1px 0 #e2e8f0}.orderDialogIdentity{display:flex;align-items:flex-start;gap:12px}.orderDialogIdentity h3{margin:0 0 3px}.orderDialogHeadActions{display:flex;gap:8px;align-items:center}.orderDialogHeadActions #orderToggleEditBtn{min-height:38px}.orderDetailLoading{display:flex;gap:10px;align-items:center;margin:14px 18px;padding:14px;border:1px solid #bfdbfe;border-radius:12px;background:#eff6ff;color:#1e3a8a}.orderDetailLoading.error{display:grid;border-color:#fecaca;background:#fef2f2;color:#991b1b}.orderDetailLoading.hidden{display:none!important}
.orderStatusTrack{display:flex;align-items:flex-start;gap:0;margin:16px 18px 4px;overflow:auto;padding-bottom:7px}.orderStatusStep{position:relative;display:grid;justify-items:center;gap:5px;min-width:112px;color:#94a3b8;text-align:center}.orderStatusStep:not(:last-child):after{content:"";position:absolute;top:15px;left:calc(50% + 18px);width:calc(100% - 36px);height:3px;background:#e2e8f0}.orderStatusStep span{position:relative;z-index:1;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:#e2e8f0;color:#64748b;font-size:12px;font-weight:900}.orderStatusStep b{font-size:11px;white-space:nowrap}.orderStatusStep.complete{color:#166534}.orderStatusStep.complete span{background:#22c55e;color:#fff}.orderStatusStep.complete:not(:last-child):after{background:#86efac}.orderStatusStep.current span{box-shadow:0 0 0 4px rgba(37,99,235,.13)}.orderStatusTerminal{align-self:center;padding:7px 11px;border-radius:999px;font-weight:800;white-space:nowrap}.orderStatusTerminal.danger{background:#fee2e2;color:#b91c1c}
.orderDetailMetrics{margin:10px 18px}.orderDetailGrid,.orderItemsCard,.orderReturnPanel{margin:0 18px 14px}.orderDetailCard{box-shadow:0 4px 14px rgba(15,23,42,.035)}.orderDetailCard .panelHead{margin-bottom:10px}.orderDetailCard .panelHead h4{margin:0}.orderDetailCard .panelHead p{margin:3px 0 0}.orderEditableFields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.orderEditableFields label{display:grid;gap:5px}.orderEditReasonField{padding:9px;border-radius:10px;background:#fff7ed;border:1px solid #fed7aa}.orderEditReasonField input:disabled{background:#fff7ed}
.orderActivityTabs{display:flex;gap:5px;margin-bottom:10px;padding-bottom:8px;border-bottom:1px solid #e2e8f0}.orderActivityTabs button{padding:7px 10px;border:0;background:transparent;font-weight:800;color:#64748b}.orderActivityTabs button.active{border-radius:8px;background:#dbeafe;color:#1d4ed8}.orderTimelineItem a{margin-left:5px;font-size:11px}.orderItemsCard .tableWrap{max-height:330px}.orderItemsCard table{min-width:900px}.orderQtyInput{min-height:36px;padding:6px 7px}.orderReturnQtyInput{border-color:#fb923c;background:#fff7ed}.orderInvoiceQtyInput{border-color:#60a5fa;background:#eff6ff}
.orderReturnPanel{border-color:#fed7aa;background:#fffaf5}.orderReturnPanel .formGrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.orderReturnPanel .wide{grid-column:span 2}.orderReturnPanel.hidden{display:none!important}
.orderDialogActions{z-index:3;margin-top:0;padding:12px 18px;bottom:0;background:rgba(255,255,255,.96);backdrop-filter:blur(8px);box-shadow:0 -1px 0 #e2e8f0}.orderDialogActions .danger{background:#fff1f2;border-color:#fecdd3;color:#be123c}.orderDialogActions .primary{background:#2563eb;color:#fff;border-color:#2563eb}.orderActionHint{display:flex;align-items:center;gap:6px}
.orderActionDialog{width:min(480px,94vw);border:0;border-radius:18px;padding:0;box-shadow:0 28px 80px rgba(15,23,42,.28)}.orderActionDialog::backdrop{background:rgba(15,23,42,.55);backdrop-filter:blur(3px)}.orderActionDialog form{display:grid;gap:14px;padding:18px}.orderActionDialog .orderDialogHead{position:static;padding:0 0 12px;box-shadow:none}.orderActionDialog p{margin:0;color:#475569;line-height:1.55}.orderActionDialog label{display:grid;gap:6px}.orderActionDialog textarea{width:100%}.orderToast{position:fixed;right:20px;bottom:22px;z-index:9999;max-width:min(420px,calc(100vw - 30px));padding:12px 16px;border-radius:12px;background:#0f172a;color:#fff;font-weight:700;box-shadow:0 15px 40px rgba(15,23,42,.3);transform:translateY(0);opacity:1;transition:.2s}.orderToast.success{background:#166534}.orderToast.error{background:#b91c1c}.orderToast.hidden{display:block!important;opacity:0;transform:translateY(12px);pointer-events:none}
button:disabled{cursor:not-allowed;opacity:.62}
@media(max-width:900px){.orderHero{align-items:flex-start}.orderMetrics{grid-template-columns:repeat(2,minmax(0,1fr))}.orderFilterBar{grid-template-columns:1fr 1fr}.orderSearchField{grid-column:1/-1}.orderDetailMetrics{margin-left:12px;margin-right:12px}.orderDetailGrid,.orderItemsCard,.orderReturnPanel{margin-left:12px;margin-right:12px}.orderStatusTrack{margin-left:12px;margin-right:12px}.orderReturnPanel .formGrid{grid-template-columns:1fr 1fr}.orderReturnPanel .wide{grid-column:1/-1}}
@media(max-width:700px){.orderHero{display:grid;padding:16px}.orderHero h2{font-size:25px}.orderHeroActions{justify-content:stretch}.orderHeroActions>*{flex:1 1 auto;text-align:center}.orderMetrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.orderMetrics article{min-height:88px;padding:11px}.orderSourceTabs{padding-left:8px;padding-right:8px}.orderFilterBar{grid-template-columns:1fr;padding:11px}.orderSearchField{grid-column:auto}.orderTableWrap{display:none!important}.orderCenterCards{display:grid}.orderCenterCards.hidden{display:none!important}.orderMobileCardMeta{grid-template-columns:1fr 1fr}.orderMobileCardMeta>span:last-child{grid-column:1/-1}.orderMobileCard .rowActions button,.orderMobileCard .rowActions a{flex:1;text-align:center}.orderDialogHead{padding:12px}.orderDialogIdentity{gap:7px}.orderDialogHeadActions #orderToggleEditBtn{font-size:12px;padding:7px 9px}.orderStatusTrack{margin-top:12px}.orderStatusStep{min-width:92px}.orderStatusStep b{font-size:10px}.orderDetailMetrics{grid-template-columns:1fr 1fr;gap:7px}.orderDetailMetrics article{padding:9px}.orderEditableFields{grid-template-columns:1fr}.orderEditableFields .wide{grid-column:auto}.orderReturnPanel .formGrid{grid-template-columns:1fr}.orderReturnPanel .wide{grid-column:auto}.orderDialogActions{justify-content:stretch}.orderDialogActions .orderActionHint{flex:1 0 100%}.orderDialogActions button,.orderDialogActions a{flex:1 1 calc(50% - 8px);text-align:center}.orderToast{right:12px;bottom:12px}}
/* Final Order UI visual polish */
@media(min-width:901px){.orderHeroActions{display:grid;grid-template-columns:minmax(130px,1.35fr) minmax(82px,1fr) minmax(82px,1fr);min-width:340px}.orderHeroActions>*{display:inline-flex;align-items:center;justify-content:center}}
.orderEditReasonField{display:none!important}.orderEditReasonField.active{display:grid!important}
.orderDialogActions .linkBtn{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:8px 11px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;color:#0f172a;text-decoration:none;white-space:nowrap}
@media(max-width:700px){.orderMetrics{grid-template-columns:repeat(2,minmax(0,1fr))!important}.orderMetrics article{min-width:0!important}.orderHeroActions{display:grid;grid-template-columns:1fr 1fr}.orderHeroActions .primary{grid-column:1/-1}.orderHeroActions>*{width:100%!important}.orderDialogActions .linkBtn{white-space:normal}}

/* Payments, retry safety, and existing advance allocation workspace 20260721 */
#payments{display:none;gap:18px}
#payments.active{display:grid}
#payments .paymentMetrics{grid-template-columns:repeat(5,minmax(150px,1fr))}
.paymentWorkspaceGrid{display:grid;grid-template-columns:minmax(420px,.9fr) minmax(560px,1.1fr);gap:18px;align-items:start}
.paymentEntryPanel,.paymentOutstandingPanel,.paymentHistoryPanel{border:1px solid #dbe4ef;box-shadow:0 16px 40px rgba(15,23,42,.06)}
.paymentAllocationTotals{display:flex;justify-content:space-between;gap:12px;margin:14px 0;padding:12px 14px;border:1px solid #dbeafe;border-radius:14px;background:#eff6ff;color:#1e3a8a}
.paymentAllocationTotals span{display:flex;gap:8px;align-items:center;font-size:13px;font-weight:700}
.paymentOutstandingTable{max-height:430px;overflow:auto}
.paymentOutstandingTable table{min-width:850px}
.paymentOutstandingTable thead{position:sticky;top:0;z-index:2;background:#f8fafc}
.paymentOutstandingTable input[type="checkbox"]{width:18px;min-height:18px}
.paymentAllocationInput{min-width:110px;width:110px;padding:8px!important}
.paymentOverdueRow{background:#fff7ed}
.paymentOverdueTag{display:block;width:max-content;margin-top:4px;padding:2px 6px;border-radius:999px;background:#ffedd5;color:#9a3412;font-size:10px;font-weight:800}
.paymentAccountRequired{color:#1d4ed8;font-weight:700}
.paymentHistoryPanel .tableWrap table{min-width:1180px}
.tableActions{display:flex;gap:6px;flex-wrap:wrap}
.tableActions button{padding:6px 9px;font-size:11px}
.dangerBtn{border-color:#fecaca!important;color:#b91c1c!important;background:#fff1f2!important}
.paymentAllocationDialog{width:min(1080px,96vw);max-height:92vh;border:0;border-radius:18px;padding:0;box-shadow:0 28px 80px rgba(15,23,42,.28)}
.paymentAllocationDialog::backdrop{background:rgba(15,23,42,.55);backdrop-filter:blur(3px)}
.paymentAllocationShell{display:grid;gap:14px;background:#f8fafc;max-height:92vh;overflow:auto}
.paymentAllocationHead{position:sticky;top:0;z-index:4;display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:16px 18px;background:#fff;box-shadow:0 1px 0 #e2e8f0}
.paymentAllocationHead h3{margin:3px 0}.paymentAllocationHead p{margin:0}
.paymentAllocationDialogMetrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:0 18px}
.paymentAllocationDialogMetrics article{display:grid;gap:5px;padding:12px;border:1px solid #dbe4ef;border-radius:12px;background:#fff}
.paymentAllocationDialogMetrics span{font-size:11px;color:#64748b}.paymentAllocationDialogMetrics strong{font-size:17px;color:#0f172a}
.paymentReallocationControls{padding:0 18px}.paymentReallocationToolbar{justify-content:space-between;padding:0 18px}.paymentReallocationToolbar span{align-self:center}
.paymentReallocationTable{margin:0 18px;max-height:390px;border:1px solid #dbe4ef;border-radius:12px;background:#fff;overflow:auto}
.paymentReallocationTable table{min-width:850px}.paymentReallocationTable thead{position:sticky;top:0;z-index:2;background:#f8fafc}
.paymentAllocationDialogActions{position:sticky;bottom:0;display:flex;justify-content:flex-end;gap:10px;padding:13px 18px;background:rgba(255,255,255,.97);box-shadow:0 -1px 0 #e2e8f0}
@media(max-width:1250px){#payments .paymentMetrics{grid-template-columns:repeat(3,minmax(150px,1fr))}.paymentWorkspaceGrid{grid-template-columns:1fr}}
@media(max-width:720px){#payments .paymentMetrics{grid-template-columns:1fr 1fr}.paymentAllocationTotals{flex-direction:column}.paymentWorkspaceGrid{display:block}.paymentOutstandingPanel,.paymentHistoryPanel{margin-top:14px}.paymentAllocationDialog{width:100vw;max-width:100vw;height:100vh;max-height:100vh;border-radius:0}.paymentAllocationShell{max-height:100vh}.paymentAllocationDialogMetrics{grid-template-columns:1fr 1fr;padding:0 12px}.paymentReallocationControls,.paymentReallocationToolbar{padding-left:12px;padding-right:12px}.paymentReallocationTable{margin-left:12px;margin-right:12px}.paymentAllocationDialogActions button{flex:1}}

/* Item Photo V5: page-list footers must not cover panel Save actions. */
.itemEditorFooter{position:static;margin:14px 0 0;padding:12px 0 0}
.panel>.itemEditorFooter{position:sticky;bottom:0;z-index:6;margin:14px -16px -16px;padding:12px 16px}
