/* Nexware ERP v0.33.1 — Consolidated QA Stabilization & Data-entry UX */

/* Desktop header collision guard: intrinsic right actions get their real width; the left
   workspace label yields first. The center row moves below before controls can overlap. */
.topbar{
  grid-template-columns:minmax(190px,1fr) max-content max-content;
  column-gap:14px;
}
.topbar-left{overflow:hidden;max-width:100%}
.company-switch-link{min-width:0;max-width:min(340px,28vw);display:flex;align-items:center;gap:4px}
.company-switch-link strong{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.topbar-center,.top-actions{position:relative;z-index:1}
.top-actions{display:flex;align-items:center;gap:10px;min-width:max-content}

/* Medium desktop: compact labels before moving to two rows. */
@media(max-width:1540px) and (min-width:1251px){
  .topbar{padding-left:18px;padding-right:18px;column-gap:10px}
  .top-actions{gap:7px}
  .topbar-tool kbd{display:none}
  .company-switch-link{max-width:220px}
  .topbar-live{padding-left:9px;padding-right:9px;gap:6px}
  .topbar-live .live-clock-day{display:none}
}
@media(max-width:1360px) and (min-width:1251px){
  .topbar-live .live-clock-date,.topbar-live .live-clock-separator{display:none}
  .topbar-user{display:none}
}
/* Override the old symmetric-grid hotfix at the existing wrap breakpoint. */
@media(max-width:1250px){
  .topbar{grid-template-columns:minmax(0,1fr) max-content;grid-template-rows:auto auto;gap:7px 10px;height:auto;min-height:70px;padding-top:7px;padding-bottom:7px}
  .topbar-left{grid-column:1;grid-row:1}
  .top-actions{grid-column:2;grid-row:1;min-width:0}
  .topbar-center{grid-column:1/-1;grid-row:2;justify-self:stretch;justify-content:center;width:100%}
}

/* Price-list readability. */
.price-list-row>div{min-width:0;display:flex;flex-direction:column;gap:4px}
.price-list-row strong,.price-list-row small{display:block;line-height:1.25}
.price-list-row small{color:var(--muted)}
.price-item-form .price-item-grid{display:grid;grid-template-columns:minmax(260px,2fr) repeat(2,minmax(130px,.8fr)) repeat(2,minmax(150px,1fr));gap:12px;align-items:end}
.price-item-form .price-item-grid label{display:grid;gap:6px;min-width:0;font-size:12px;font-weight:600}
.price-item-form .price-item-grid input,.price-item-form .price-item-grid select{width:100%;min-width:0}
@media(max-width:1180px){.price-item-form .price-item-grid{grid-template-columns:repeat(2,minmax(180px,1fr))}.price-item-form .price-item-grid label:first-child{grid-column:1/-1}}
@media(max-width:680px){.price-item-form .price-item-grid{grid-template-columns:1fr}.price-item-form .price-item-grid label:first-child{grid-column:auto}}

/* Structured variant attributes: ordinary users never need to author/read JSON. */
.variant-attribute-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;grid-column:1/-1;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2)}
.variant-attribute-grid .variant-attribute-title{grid-column:1/-1;display:flex;justify-content:space-between;gap:12px;align-items:center}
.variant-attribute-grid .variant-attribute-title small{color:var(--muted);font-weight:400}
.variant-attribute-chips{display:flex;gap:5px;flex-wrap:wrap;margin-top:5px}
.variant-attribute-chip{display:inline-flex;padding:3px 7px;border-radius:999px;background:var(--accent-soft);color:var(--accent);font-size:10px;font-weight:700}
@media(max-width:680px){.variant-attribute-grid{grid-template-columns:1fr}}

/* Address text should render as content, not escaped formatting artifacts. */
.address-card p{white-space:normal;overflow-wrap:anywhere}

/* Small visual hint for CRM duplicate warnings. */
.alert.warning{background:var(--warning-soft);color:var(--warning);border:1px solid color-mix(in srgb,var(--warning) 25%,var(--line))}
