.commercial-dashboard {
  display: grid;
  gap: 18px;
  margin: 0 0 24px;
}

.commercial-dashboard.is-hidden { display: none; }

.commercial-dashboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.commercial-dashboard-heading h2 {
  margin: 3px 0 0;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.commercial-dashboard-controls {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
}

.commercial-dashboard-controls label {
  display: grid;
  gap: 4px;
  min-width: min(290px, 42vw);
  color: var(--muted, #667085);
  font-size: .78rem;
  font-weight: 700;
}

.commercial-dashboard-controls select {
  width: 100%;
  min-height: 40px;
  padding: 8px 34px 8px 11px;
  border: 1px solid var(--border, #d8e0ea);
  border-radius: 10px;
  background: var(--surface, #fff);
  color: inherit;
}

.commercial-dashboard-warning {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #f4c37d;
  border-radius: 12px;
  background: #fff8e8;
  color: #7a4a08;
}

.commercial-dashboard-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border, #e3e8ef);
  border-radius: 15px;
  background: var(--surface, #fff);
}

.commercial-dashboard-search label {
  display: grid;
  gap: 5px;
  min-width: 0;
  margin: 0;
}
.commercial-dashboard-search label > span { color: var(--muted, #667085); font-size: .8rem; font-weight: 700; }
.commercial-dashboard-search input {
  width: 100%;
  height: 46px;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--border, #d8e0ea);
  border-radius: 10px;
  background: var(--surface, #fff);
  color: inherit;
}
.commercial-dashboard-search-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.commercial-dashboard-search-actions > button {
  height: 46px;
  min-height: 46px;
  margin: 0;
  justify-content: center;
  white-space: nowrap;
}

.commercial-dashboard-search-results {
  overflow: hidden;
  margin-top: -9px;
  border: 1px solid var(--border, #e3e8ef);
  border-radius: 15px;
  background: var(--surface, #fff);
  box-shadow: 0 12px 34px rgba(16, 24, 40, .08);
}
.commercial-dashboard-search-results.is-hidden { display: none; }
.commercial-dashboard-search-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; background: #f7f9fc; }
.commercial-dashboard-search-summary button { border: 0; background: transparent; color: #2059a8; cursor: pointer; font-weight: 700; }
.commercial-dashboard-search-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 0;
  border-top: 1px solid var(--border, #e3e8ef);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.commercial-dashboard-search-row:hover,
.commercial-dashboard-search-row:focus-visible { background: #f7f9fc; }
.commercial-dashboard-search-row > span:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.commercial-dashboard-search-row small { color: var(--muted, #667085); overflow-wrap: anywhere; }
.commercial-dashboard-search-row b { color: #2059a8; }
.commercial-dashboard-search-row em { color: #9b1c1c; font-size: .78rem; font-style: normal; font-weight: 700; }
.commercial-dashboard-search-type { padding: 5px 8px; border-radius: 999px; background: #eef5ff; color: #2059a8; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.commercial-dashboard-search-empty { display: grid; justify-items: center; gap: 12px; padding: 18px; color: var(--muted, #667085); text-align: center; }
.commercial-dashboard-search-empty.is-error { color: #9b1c1c; }

.commercial-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.commercial-dashboard-metric {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border, #e3e8ef);
  border-radius: 15px;
  background: var(--surface, #fff);
  box-shadow: 0 8px 26px rgba(16, 24, 40, .055);
}

.commercial-dashboard-metric small { color: var(--muted, #667085); }
.commercial-dashboard-metric strong { font-size: 1.75rem; line-height: 1; }
.commercial-dashboard-metric.is-alert { border-color: #f4a7a7; background: #fff5f5; color: #a51d1d; }

.commercial-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.commercial-dashboard-grid > section {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border, #e3e8ef);
  border-radius: 16px;
  background: var(--surface, #fff);
  box-shadow: 0 8px 26px rgba(16, 24, 40, .055);
}

.commercial-dashboard-grid > section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border, #e3e8ef);
}

.commercial-dashboard-grid h3 { margin: 0; font-size: 1rem; }
.commercial-dashboard-grid header > span {
  min-width: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef5ff;
  color: #2059a8;
  text-align: center;
  font-size: .78rem;
  font-weight: 700;
}

.commercial-dashboard-list { display: grid; }
.commercial-dashboard-team-card { display: grid; gap: 5px; padding: 14px 16px; border-bottom: 1px solid var(--border, #e3e8ef); }
.commercial-dashboard-team-card:last-child { border-bottom: 0; }
.commercial-dashboard-team-card span { color: var(--muted, #667085); font-size: .85rem; line-height: 1.55; }

.commercial-dashboard-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  border: 0;
  border-bottom: 1px solid var(--border, #e3e8ef);
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.commercial-dashboard-row:hover,
.commercial-dashboard-row:focus-visible { background: #f7f9fc; }
.commercial-dashboard-row i { width: 12px; height: 12px; border-radius: 50%; background: #f59e0b; font-style: normal; }
.commercial-dashboard-row i.is-red { background: #dc2626; }
.commercial-dashboard-row i.is-orange { background: #f59e0b; }
.commercial-dashboard-row.is-suggestion i { width: auto; height: auto; background: transparent; color: #8b5cf6; }
.commercial-dashboard-row span { min-width: 0; display: grid; gap: 3px; }
.commercial-dashboard-row strong,
.commercial-dashboard-row small { overflow-wrap: anywhere; }
.commercial-dashboard-row small { color: var(--muted, #667085); line-height: 1.4; }
.commercial-dashboard-row b { color: #376aa6; font-size: 1.15rem; }

.commercial-dashboard-empty { margin: 0; padding: 20px 16px; color: var(--muted, #667085); text-align: center; }
.commercial-dashboard-more { padding: 12px 15px; border: 0; background: #f7f9fc; color: #2059a8; font-weight: 700; cursor: pointer; }

.commercial-dashboard-loading,
.commercial-dashboard-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border, #e3e8ef);
  border-radius: 15px;
  background: var(--surface, #fff);
}
.commercial-dashboard-error { flex-wrap: wrap; }
.commercial-dashboard-error span { flex: 1 1 320px; color: var(--muted, #667085); }
.commercial-dashboard-loading span { width: 18px; height: 18px; border: 2px solid #ccd6e3; border-top-color: #2059a8; border-radius: 50%; animation: commercial-dashboard-spin .8s linear infinite; }
@keyframes commercial-dashboard-spin { to { transform: rotate(360deg); } }

@media (max-width: 1120px) {
  .commercial-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .commercial-dashboard-grid > section:last-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .commercial-dashboard-heading { align-items: flex-start; }
  .commercial-dashboard-controls { align-items: stretch; flex-direction: column; }
  .commercial-dashboard-controls label { min-width: min(58vw, 290px); }
  .commercial-dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .commercial-dashboard-grid { grid-template-columns: 1fr; }
  .commercial-dashboard-grid > section:last-child { grid-column: auto; }
}

@media (max-width: 480px) {
  .commercial-dashboard-heading { flex-direction: column; }
  .commercial-dashboard-controls { width: 100%; }
  .commercial-dashboard-controls label { min-width: 0; width: 100%; }
  .commercial-dashboard-search { grid-template-columns: 1fr; }
  .commercial-dashboard-search-actions { width: 100%; }
  .commercial-dashboard-search-actions > button { flex: 1; }
  .commercial-dashboard-search-row { grid-template-columns: 1fr auto; }
  .commercial-dashboard-search-type { grid-column: 1 / -1; justify-self: start; }
  .commercial-dashboard-heading .ghost-button { padding-inline: 10px; }
  .commercial-dashboard-metrics { grid-template-columns: 1fr; }
}

.commercial-quick-order .contract-modal { max-width: 680px; }
.commercial-quick-order-body { display: grid; gap: 14px; padding: 18px; }
.commercial-quick-order-body > p,
.commercial-quick-order-fiscal + p { margin: 0; color: var(--muted, #667085); }
.commercial-quick-order-search label,
.commercial-quick-order-search label > span { display: grid; gap: 7px; }
.commercial-quick-order-search label > span { grid-template-columns: 1fr auto; }
.commercial-quick-order-search input,
.commercial-quick-order-fiscal input { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--border, #d7dee8); border-radius: 10px; background: #fff; color: var(--ink, #17212f); }
.commercial-quick-order-status { margin: 0; color: var(--muted, #667085); font-size: .88rem; }
.commercial-quick-order-status.is-error { color: #b42318; }
.commercial-quick-order-results { display: grid; max-height: 45vh; overflow: auto; border: 1px solid var(--border, #e3e8ef); border-radius: 12px; }
.commercial-quick-order-results:empty { display: none; }
.commercial-quick-order-results button { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px; border: 0; border-bottom: 1px solid var(--border, #e3e8ef); background: #fff; color: inherit; text-align: left; cursor: pointer; }
.commercial-quick-order-results button:last-child { border-bottom: 0; }
.commercial-quick-order-results button:hover { background: #f7f9fc; }
.commercial-quick-order-results button > span:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.commercial-quick-order-results small { color: var(--muted, #667085); }
.commercial-quick-order-results b { color: #2059a8; }
.commercial-quick-order-fiscal { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px; }
.commercial-quick-order-fiscal label { display: grid; gap: 6px; font-weight: 700; }
.commercial-quick-order form > p { padding: 0 18px; }
.commercial-quick-order footer { display: flex; justify-content: flex-end; gap: 9px; padding: 18px; }
@media (max-width: 620px) {
  .commercial-quick-order-search label > span,
  .commercial-quick-order-fiscal { grid-template-columns: 1fr; }
  .commercial-quick-order-results button { grid-template-columns: 1fr auto; }
  .commercial-quick-order-results .commercial-dashboard-search-type { grid-column: 1 / -1; justify-self: start; }
}
