/* Componentes fundamentais compartilhados pelo Marketplace CLOSETFY. */
body { color: var(--text-primary); background: var(--bg-primary); font-family: var(--font-ui); }

:where(.btn-primary, .btn-primary-sm) {
  color: var(--text-inverse);
  background: var(--brand-primary);
  border-radius: var(--radius-md);
  box-shadow: none;
}

:where(.btn-secondary, .btn-secondary-sm, .btn-ghost, .btn-ghost-sm) {
  color: var(--text-primary);
  background: transparent;
  border-color: var(--border-primary);
  border-radius: var(--radius-md);
}

:where(.btn-danger, .btn-danger-sm) { border-radius: var(--radius-md); }

:where(.input-field, .input-sm, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
  color: var(--text-primary);
  background: var(--surface-primary);
  border-color: var(--border-primary);
  border-radius: var(--radius-md);
}

:where(.input-field, .input-sm, input, select, textarea):focus {
  border-color: var(--brand-accent);
  box-shadow: var(--focus-ring);
}

:where(.pcard, .loja-card, .perfil-info-card, .config-panel, .adm-card,
  .orders-card, .chat-card, .modal-card, .rv-modal, .rv-confirm__card) {
  border-color: var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.pcard { background: var(--surface-primary); }
.pcard:hover { border-color: color-mix(in srgb, var(--brand-accent) 42%, var(--border-primary)); }

:where(.tag, .cfg-badge, .adm-badge, .badge-status, .tab-badge) {
  border-radius: var(--radius-pill);
}

:where(.modal-overlay, .rv-modal-overlay, .rv-confirm, .modal-loja-overlay, .adm-details) {
  background: var(--overlay);
}

:where(.nav-dropdown, .nav-dropdown__menu, .global-search-dropdown,
  .config-sidebar, .adm-dropdown, .select-dropdown) {
  color: var(--text-primary);
  background: var(--surface-elevated);
  border-color: var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

:where(table) { color: var(--text-primary); border-color: var(--border-primary); }
:where(th) { color: var(--text-secondary); background: var(--surface-secondary); font-weight: var(--weight-semibold); }
:where(td) { border-color: var(--border-secondary); }
:where(tbody tr:hover) { background: color-mix(in srgb, var(--brand-accent) 7%, transparent); }

:where(button, [role="button"], input, select, textarea):disabled {
  cursor: not-allowed;
  opacity: .5;
}

.navbar { background: var(--navbar-bg); border-color: var(--border-secondary); }
.navbar__logo-dot, .footer__accent, .rv-loading__dot { color: var(--brand-accent); background: var(--brand-accent); }

.merchant-dashboard-toolbar { display:flex; align-items:center; justify-content:flex-end; gap:.65rem; margin:1rem 0; color:var(--text-secondary); font-size:.78rem; }
.merchant-dashboard-toolbar select { min-height:40px; padding:.5rem 2.2rem .5rem .8rem; color:var(--text-primary); background:var(--surface-primary); border:1px solid var(--border-primary); border-radius:var(--radius-md); }
.merchant-kpis { grid-template-columns:repeat(6,minmax(0,1fr)); }
.merchant-dashboard-grid { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(280px,.55fr); gap:1rem; margin:1rem 0; }
.merchant-dashboard-card { margin:0 0 1rem; }
.merchant-sales-chart { min-height:220px; display:flex; align-items:flex-end; gap:.5rem; padding:1rem .25rem 0; overflow-x:auto; }
.merchant-sales-chart__bar { min-width:42px; height:var(--bar-height,8%); display:grid; align-content:end; justify-items:center; gap:.35rem; padding-top:.4rem; color:var(--text-secondary); background:linear-gradient(to top,var(--brand-accent),color-mix(in srgb,var(--brand-accent) 28%,transparent)); border-radius:7px 7px 2px 2px; font-size:.65rem; }
.merchant-sales-chart__bar strong { color:var(--text-primary); font-size:.7rem; }
.merchant-dashboard-list { display:grid; gap:.55rem; }
.merchant-dashboard-list article { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.25rem 1rem; padding:.7rem 0; border-bottom:1px solid var(--border-secondary); }
.merchant-dashboard-list small { color:var(--text-secondary); }
.merchant-orders-table { overflow-x:auto; }
.merchant-orders-table table { width:100%; min-width:650px; border-collapse:collapse; }
.merchant-orders-table th,.merchant-orders-table td { padding:.75rem; border-bottom:1px solid var(--border-secondary); text-align:left; font-size:.78rem; }
.inventory-source__product.is-selected { border-color:var(--brand-accent); box-shadow:0 0 0 2px color-mix(in srgb,var(--brand-accent) 16%,transparent); }

@media (max-width: 1024px) {
  .merchant-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .merchant-dashboard-grid { grid-template-columns:1fr; }
}

@media (max-width: 599px) {
  .merchant-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .merchant-dashboard-toolbar { justify-content:space-between; }
  :where(.modal-card, .rv-modal, .rv-confirm__card, .modal-loja-card, .adm-details__card) {
    border-radius: var(--radius-xl) var(--radius-xl) var(--radius-lg) var(--radius-lg);
  }
}
