/* ===== v6.13 final overrides ===== */
.sidebar-brand-mark{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  overflow:hidden;
}
.sidebar-brand-mark img{
  width:42px !important;
  height:42px !important;
  border-radius:12px;
  object-fit:cover;
}
.user-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:36px;
  padding:0 10px;
  border-radius:10px;
  border:1px solid var(--border);
  background:var(--surface);
  color:var(--text);
  box-shadow:var(--button-shadow);
  font-weight:700;
}
.user-chip svg{ width:16px; height:16px; color:var(--brand-2); }
.user-chip small{
  padding:3px 6px;
  border-radius:999px;
  color:var(--muted);
  background:var(--surface-2);
  font-size:10px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.03em;
}
.home-user-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin-top:10px;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface-2);
  color:var(--text);
  font-size:12px;
  font-weight:650;
}
.home-user-chip span{
  padding:3px 7px;
  border-radius:999px;
  background:color-mix(in srgb, var(--brand-3) 14%, var(--surface));
  color:var(--brand-2);
  font-size:10px;
  font-weight:850;
  text-transform:uppercase;
}
.workspace-actions{ gap:10px; }
.quick-sale{
  gap:10px !important;
  line-height:1;
  white-space:nowrap;
}
.quick-sale svg{
  width:17px;
  height:17px;
  flex:0 0 auto;
}
.quick-sale .keycap,
.btn-primary .keycap{ margin-left:4px; }

@media (max-width:720px){
  .workspace-actions{
    width:100%;
    justify-content:space-between;
  }
  .user-chip{
    max-width:calc(100vw - 170px);
    overflow:hidden;
  }
  .user-chip span{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
}

/* ===== v6.14 home partner polish ===== */
.home-meta-row{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.home-meta-row .home-eyebrow,
.home-meta-row .home-user-chip{
  min-height:34px;
  margin:0;
  padding:0 10px;
  border-radius:999px;
}
.home-user-chip{
  white-space:nowrap;
}
.home-user-chip b{
  font-weight:850;
}
.home-user-label{
  color:var(--muted);
  font-weight:750;
}
.home-actions{
  align-items:center;
  gap:10px;
}
.home-actions .btn-primary,
.home-actions .btn-secondary{
  min-height:42px;
  padding:0 14px !important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  line-height:1;
  white-space:nowrap;
}
.home-actions .inline-icon{
  width:18px;
  height:18px;
  display:block;
  margin:0;
  vertical-align:0;
}
.home-actions .keycap{
  margin-left:2px !important;
  transform:translateY(0);
}
.home-default-location{
  margin-top:12px;
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.home-default-location label{
  margin:0;
  font-size:12px;
  font-weight:850;
  color:var(--muted);
}
.home-default-location select{
  width:auto;
  min-width:190px;
  height:36px;
  padding:0 10px;
}
.home-default-location button{
  min-height:36px;
  padding:0 12px !important;
}
.module-actions .btn-secondary{
  gap:8px;
  min-height:48px;
  padding:0 14px !important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1;
}
.module-actions .inline-icon{
  display:block;
  width:18px;
  height:18px;
  margin:0;
  vertical-align:0;
}
.purchase-module-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  align-items:center;
}
.purchase-module-actions .btn-secondary{
  width:100%;
}
.purchase-module-actions .products-shortcut{
  width:100%;
  min-width:0;
}

/* ===== v6.17 quick UI fixes ===== */
.product-status-badges{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:8px;
  line-height:1;
}
.product-status-badges .badge{
  margin:0 !important;
  display:inline-flex;
  align-items:center;
  min-height:24px;
}
.product-store-badge{
  background:#fff4e6;
  color:#8a3b0e;
  border:1px solid #f6b36d;
}
html[data-theme="dark"] .product-store-badge{
  background:rgba(251,146,60,.20);
  color:#ffd2a8;
  border-color:rgba(251,146,60,.62);
}

/* ===== v6.15 dark form safety net ===== */
html[data-theme="dark"]{
  color-scheme:dark;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] option,
html[data-theme="dark"] .form-grid input:not([type="checkbox"]):not([type="file"]),
html[data-theme="dark"] .form-grid select,
html[data-theme="dark"] .dataTables_wrapper input,
html[data-theme="dark"] .dataTables_wrapper select{
  background:var(--surface) !important;
  color:var(--text) !important;
  border-color:var(--border) !important;
}

html[data-theme="dark"] input[readonly],
html[data-theme="dark"] input:disabled,
html[data-theme="dark"] select:disabled,
html[data-theme="dark"] textarea:disabled,
html[data-theme="dark"] .locked,
html[data-theme="dark"] .locked-display,
html[data-theme="dark"] .auto-calc{
  background:var(--surface-2) !important;
  color:var(--muted) !important;
  border-color:var(--border) !important;
  opacity:1;
}

html[data-theme="dark"] .suggest-box,
html[data-theme="dark"] .suggestions,
html[data-theme="dark"] .suggest-item,
html[data-theme="dark"] .dataTables_wrapper .dataTables_filter input,
html[data-theme="dark"] .dataTables_wrapper .dataTables_length select{
  background:var(--surface) !important;
  color:var(--text) !important;
  border-color:var(--border) !important;
}

html[data-theme="dark"] .suggest-box a,
html[data-theme="dark"] .suggestions a,
html[data-theme="dark"] .suggest-item{
  color:var(--text) !important;
}

html[data-theme="dark"] .suggest-box a:hover,
html[data-theme="dark"] .suggest-item:hover,
html[data-theme="dark"] .suggest-item.active{
  background:var(--surface-2) !important;
  color:var(--text) !important;
}

html[data-theme="dark"] .suggest-thumb,
html[data-theme="dark"] [style*="background:#e2e8f0"],
html[data-theme="dark"] [style*="background: #e2e8f0"],
html[data-theme="dark"] [style*="background-color: rgb(226, 232, 240)"]{
  background:var(--surface-3) !important;
  border-color:var(--border) !important;
}

html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background-color:#fff"],
html[data-theme="dark"] [style*="background-color: #fff"],
html[data-theme="dark"] [style*="background-color: rgb(255, 255, 255)"],
html[data-theme="dark"] [style*="background:#f8fafc"],
html[data-theme="dark"] [style*="background: #f8fafc"],
html[data-theme="dark"] [style*="background-color:#f8fafc"],
html[data-theme="dark"] [style*="background-color: #f8fafc"],
html[data-theme="dark"] [style*="background-color: rgb(248, 250, 252)"],
html[data-theme="dark"] [style*="background:#f1f5f9"],
html[data-theme="dark"] [style*="background: #f1f5f9"],
html[data-theme="dark"] [style*="background-color: rgb(241, 245, 249)"]{
  background:var(--surface-2) !important;
}

html[data-theme="dark"] [style*="color:#334155"],
html[data-theme="dark"] [style*="color: #334155"],
html[data-theme="dark"] [style*="color:#475569"],
html[data-theme="dark"] [style*="color: #475569"],
html[data-theme="dark"] [style*="color:#64748b"],
html[data-theme="dark"] [style*="color: #64748b"],
html[data-theme="dark"] [style*="color: rgb(51, 65, 85)"],
html[data-theme="dark"] [style*="color: rgb(71, 85, 105)"],
html[data-theme="dark"] [style*="color: rgb(100, 116, 139)"],
html[data-theme="dark"] .form-grid label{
  color:var(--text) !important;
}

html[data-theme="dark"] .drop,
html[data-theme="dark"] #drop{
  background:var(--surface-2) !important;
  color:var(--muted) !important;
  border-color:var(--border) !important;
}

html[data-theme="dark"] .is-invalid,
html[data-theme="dark"] .qty-over{
  background:color-mix(in srgb, var(--danger) 14%, var(--surface)) !important;
  color:#fecaca !important;
  border-color:color-mix(in srgb, var(--danger) 60%, var(--border)) !important;
}

html[data-theme="dark"] [style*="#fffbfa"],
html[data-theme="dark"] [style*="#fff1f2"],
html[data-theme="dark"] [style*="background:#fffbfa"],
html[data-theme="dark"] [style*="background:#fff1f2"],
html[data-theme="dark"] [style*="background: #fffbfa"],
html[data-theme="dark"] [style*="background: #fff1f2"]{
  background:color-mix(in srgb, var(--danger) 14%, var(--surface)) !important;
  color:#fecaca !important;
  border-color:color-mix(in srgb, var(--danger) 60%, var(--border)) !important;
}

html[data-theme="dark"] .below-cost-row td,
html[data-theme="dark"] #belowCostWarn,
html[data-theme="dark"] [style*="#fff7ed"],
html[data-theme="dark"] [style*="background:#fff7ed"],
html[data-theme="dark"] [style*="background: #fff7ed"]{
  background:color-mix(in srgb, #f97316 16%, var(--surface)) !important;
}

html[data-theme="dark"] .payment-option{
  background:var(--surface) !important;
  color:var(--text) !important;
  border-color:var(--border) !important;
}

html[data-theme="dark"] .payment-option.active{
  background:color-mix(in srgb, var(--brand-3) 18%, var(--surface)) !important;
  color:#a5f3fc !important;
  border-color:var(--brand-3) !important;
}

html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] textarea:-webkit-autofill,
html[data-theme="dark"] select:-webkit-autofill{
  -webkit-text-fill-color:var(--text) !important;
  box-shadow:0 0 0 1000px var(--surface) inset !important;
  caret-color:var(--text) !important;
}

/* ===== v6.19 account and login polish ===== */
.account-btn{
  width:100%;
  height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  padding:0 12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface);
  color:var(--text);
  text-decoration:none;
  font-weight:620;
  box-shadow:var(--button-shadow);
  box-sizing:border-box;
}
.account-btn:hover{
  color:var(--text);
  background:var(--surface-2);
  transform:translateY(-1px);
}
.account-btn.active{
  color:#fff;
  border-color:color-mix(in srgb, var(--brand-2) 60%, var(--border));
  background:linear-gradient(135deg, var(--brand), var(--brand-2));
}
.account-btn.active svg{ color:#fff; }
.account-btn svg{ width:16px; height:16px; color:var(--brand-2); }
.module-icon.module-users{ color:#2563eb; background:rgba(37,99,235,.10); border-color:rgba(37,99,235,.18); }
.user-chip{ text-decoration:none; }
.user-chip:hover{
  color:var(--text);
  background:var(--surface-2);
  transform:translateY(-1px);
}
.account-card{
  display:flex;
  flex-direction:column;
  gap:18px;
}
.account-grid{ align-items:start; }
.account-grid .account-card{ align-self:start; }
.account-grid .account-card:first-child{ gap:12px; padding-bottom:18px; }
.account-summary{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.account-summary div{
  padding:12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface-2);
}
.account-summary span,
.account-form span{
  display:block;
  margin-bottom:6px;
  color:var(--muted);
  font-size:12px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.account-summary strong{
  display:block;
  color:var(--text);
}
.account-form{
  display:grid;
  gap:14px;
}
.account-form label{ margin:0; }
.account-form button{
  justify-content:center;
  min-height:42px;
}
@media (max-width:640px){
  .account-summary{ grid-template-columns:1fr; }
}
@media (min-width:901px){
  html[data-sidebar="collapsed"] .account-btn{
    width:44px !important;
    height:42px;
    padding:0 !important;
    justify-content:center !important;
    border-radius:12px;
  }
  html[data-sidebar="collapsed"] .account-label{ display:none; }
}

