:root {
  --navy: #112841;
  --navy-deep: #091b30;
  --teal: #00a79b;
  --teal-bright: #16c6b6;
  --cloud: #eef4f8;
  --cloud-soft: #f7fafc;
  --ink: #132235;
  --muted: #6d7c8c;
  --line: #dce7ee;
  --warning: #f59e0b;
  --danger: #dc2626;
  --radius: 8px;
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--cloud);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.inventory-preview { margin-top: 20px; }
.inventory-toolbar, .inventory-pagination { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.inventory-toolbar label { flex: 1; min-width: 180px; }
.inventory-table-wrap { max-width: 100%; overflow: auto; max-height: 620px; border: 1px solid var(--line); border-radius: 8px; }
.inventory-table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 13px; }
.inventory-table th, .inventory-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.inventory-table th { position: sticky; top: 0; background: #edf5f3; z-index: 1; }
.inventory-table td:nth-child(2) { min-width: 220px; }
.inventory-table td:nth-child(3) { min-width: 280px; }
.inventory-table small { display: block; margin-top: 6px; color: var(--muted); }
.inventory-table .inventory-issue { color: #9f2929; }
.inventory-table input { width: 100%; min-width: 0; font-size: 13px; }
.inventory-pagination { justify-content: flex-end; align-items: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.hidden {
  display: none !important;
}

.app-loading { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: var(--cloud); text-align: center; padding: 24px; }
.app-loading strong { display: block; margin-top: 18px; font-size: 20px; }
.app-loading p { color: var(--muted); }
.loading-spinner { display: inline-block; width: 42px; height: 42px; border: 4px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: loading-spin 0.8s linear infinite; }
@keyframes loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading-spinner { animation: none; } }

.material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(17, 40, 65, 0.92), rgba(0, 167, 155, 0.82)),
    url("https://images.unsplash.com/photo-1551190822-a9333d879b1f?auto=format&fit=crop&w=1600&q=80")
      center/cover;
}

.login-panel {
  width: min(460px, 100%);
  padding: 28px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 70px rgba(9, 27, 48, 0.28);
}

.login-panel h1 {
  margin: 26px 0 22px;
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-lockup strong,
.brand-lockup span {
  display: block;
}

.brand-lockup strong {
  font-weight: 800;
}

.brand-lockup span {
  color: var(--muted);
  font-size: 13px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: white !important;
  background: var(--teal);
  font-weight: 900;
}

.brand-logo { width: 42px; height: 42px; object-fit: contain; flex: 0 0 auto; }

.stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  color: var(--ink);
  background: white;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 167, 155, 0.12);
}

.primary-button,
.ghost-button,
.danger-button {
  border: 0;
  border-radius: var(--radius);
  min-height: 42px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
}

.primary-button {
  color: white;
  background: var(--teal);
}

.primary-button:hover {
  background: #008f85;
}

.ghost-button {
  color: var(--navy);
  background: white;
  border: 1px solid var(--line);
}

.danger-button {
  color: white;
  background: var(--danger);
}

.message {
  min-height: 20px;
  color: var(--danger);
}

.message.success {
  color: var(--teal);
}

.app-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  color: white;
  background: var(--navy-deep);
  overflow: hidden;
}

.sidebar > .brand-lockup,
.sidebar > .sidebar-account,
.sidebar > #logout-button { flex-shrink: 0; }

.sidebar > nav {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  align-content: start;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.sidebar .brand-lockup span {
  color: rgba(255, 255, 255, 0.68);
}

.sidebar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
}
.sidebar-account > div { min-width: 0; }
.sidebar-account strong { display: block; overflow-wrap: anywhere; font-size: 14px; }
.sidebar-account div > span { display: block; margin-top: 4px; color: rgba(255, 255, 255, 0.7); font-size: 12px; }

nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  text-align: left;
  font-weight: 800;
}

.nav-item.active,
.nav-item:hover {
  color: white;
  background: rgba(255, 255, 255, 0.11);
}

.nav-counter {
  margin-left: auto;
  flex-shrink: 0;
  min-width: 25px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #ffdc8b;
  color: #172536;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.sidebar #logout-button {
  margin-top: auto;
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.topbar {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h2 {
  font-size: 28px;
}

h3 {
  font-size: 17px;
}

.view {
  display: none;
}

[hidden] { display: none !important; }
#commerce-view { min-width: 0; }
#commerce-view .panel { box-shadow: none; }
#commerce-view input, #commerce-view select, #commerce-view textarea { min-width: 0; max-width: 100%; }
#commerce-view .message:empty { display: none; }
#commerce-view dialog { width: min(640px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
#commerce-view dialog::backdrop { background: #0007; }
.material-symbols-outlined { width: 24px; min-width: 24px; max-width: 24px; overflow: hidden; }
.nav-item { min-width: 0; overflow-wrap: anywhere; }

.view.active {
  display: grid;
  gap: 18px;
}

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

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 14px 32px rgba(17, 40, 65, 0.06);
}

.metric {
  padding: 18px;
  display: grid;
  gap: 8px;
}

.metric .material-symbols-outlined {
  color: var(--teal);
}

.metric strong {
  font-size: 28px;
  line-height: 1;
}

.metric span:last-child {
  color: var(--muted);
  font-weight: 700;
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.panel {
  padding: 16px;
}

.panel-heading {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-layout {
  display: grid;
  gap: 16px;
}

.form-section {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cloud-soft);
  display: grid;
  gap: 14px;
}

.compact-section { grid-template-columns: minmax(0, 1fr) minmax(220px, .65fr); align-items: end; }

.section-intro {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.section-intro strong { color: var(--navy); font-size: 15px; }
.section-intro p, .field-help, .price-note { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.section-step {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.form-section legend { padding: 0 6px; color: var(--navy); font-weight: 900; }
.form-section > label { display: grid; gap: 7px; color: var(--ink); font-size: 13px; font-weight: 800; }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.price-note { align-self: end; padding: 10px 12px; border-left: 3px solid var(--teal); background: #e4f7f3; border-radius: 4px; }
.required-field > :first-child::after { content: ' *'; color: var(--danger); }

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-height: 48px;
}

.form-actions .message { margin: 0 auto 0 0; }
.sticky-actions { position: sticky; bottom: 12px; z-index: 2; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.96); box-shadow: 0 8px 22px rgba(17,40,65,.10); }
.toggle-card { min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.file-field { padding: 13px; border: 1px dashed #96b8c5; border-radius: 6px; background: white; }
.file-field small { color: var(--muted); font-weight: 600; }
.preview-card { min-height: 62px; padding: 12px; border: 1px solid #b9ddd7; border-radius: 6px; background: white; color: var(--ink); }
.preview-card:empty { display: none; }
.preview-card img { float: left; margin: 0 12px 0 0; border-radius: 6px; }
.preview-card p { margin: 0 0 4px; font-weight: 800; }
.preview-card small { color: var(--muted); }

.wide {
  grid-column: 1 / -1;
}

.toggle-row {
  align-content: end;
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--ink);
}

.toggle-row input {
  width: auto;
}

.permissions {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.permissions:not(.hidden) { margin: 0; }

.permissions label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
}

.permissions input { width: auto; }

@media (max-width: 760px) {
  .app-view { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid, .split-grid, .metrics-grid { grid-template-columns: 1fr; }
  .row-card { grid-template-columns: 1fr; }
}

.image-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.image-preview img {
  width: 82px;
  height: 82px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 1px solid var(--line);
}

.search-input {
  max-width: 280px;
}

.data-list,
.compact-list {
  display: grid;
  gap: 10px;
}

.row-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: var(--cloud-soft);
}

.row-card strong {
  display: block;
}

.row-card small {
  color: var(--muted);
  font-weight: 700;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--navy);
  background: #dff8f5;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.warn {
  background: #fef3c7;
}

.row-card.order-card { align-items: stretch; grid-template-columns: 5% minmax(0, 1fr); }
.order-number { min-width: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; border-right: 1px solid var(--line); padding-right: 8px; color: var(--navy); }
.order-number small { font-size: 10px; letter-spacing: 1px; }
.order-number strong { font-size: clamp(16px, 1.7vw, 28px); font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; text-align: center; }
.order-heading-right { display: grid; justify-items: end; gap: 7px; flex-shrink: 0; }
.order-heading-right time { color: var(--muted); font-size: 12px; font-weight: 700; }
.order-payment { color: var(--navy) !important; }
.order-card.representative-order { border: 2px solid #00a69c; background: #f0fbf9; }
.order-card.completed-order { opacity: .58; background: #eef2f4; }
.order-card.completed-order { position: relative; overflow: hidden; }
.completed-ribbon { position: absolute; bottom: 12px; right: -35px; z-index: 1; padding: 5px 38px; transform: rotate(-42deg); background: #667085; color: white; font-size: 11px; font-weight: 900; letter-spacing: 0; }
.order-content { min-width: 0; display: grid; gap: 9px; }
.order-heading { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.order-heading small { display: block; margin-top: 3px; }
.order-representative { color: #006e68; font-size: 13px; font-weight: 700; }
.order-representative strong { display: inline; }
.order-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.order-meta strong { color: var(--navy); }
.order-items { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; }
.order-items li { display: flex; flex-wrap: wrap; gap: 5px 8px; align-items: baseline; padding: 8px; border-top: 1px solid var(--line); background: white; font-size: 13px; }
.order-items li span { flex: 1 1 220px; }
.order-items .order-stock-code { display: inline; font-weight: 900; }
.order-items .order-item-number, .order-items .order-item-quantity { display: inline; }
.order-items li em { color: #007a73; font-style: normal; font-weight: 700; }
.order-items li b { width: 100%; color: #007a73; }
.disabled-actions { pointer-events: none; }
.disabled-actions button { opacity: .4; }

.document-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.document-link {
  padding: 9px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--navy);
  background: white;
  text-decoration: none;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: white;
  background: var(--navy);
  box-shadow: 0 18px 40px rgba(9, 27, 48, 0.24);
  font-weight: 800;
}

@media (max-width: 980px) {
  .app-view {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar > nav {
    flex: 0 1 auto;
    overflow: visible;
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics-grid,
  .split-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 16px;
  }
}

@media (max-width: 620px) {
  .topbar,
  .panel-heading,
  .row-card {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .row-actions {
    justify-content: stretch;
  }

  .row-actions button {
    flex: 1;
  }
}
/* Brand visibility controls share the product management surface. */
.brand-audiences { border: 1px solid #dce6ec; padding: 16px; margin: 0; min-width: 0; }
.brand-options { display: flex; gap: 16px; flex-wrap: wrap; }
.brand-options .toggle-row { display: flex; align-items: center; gap: 8px; }
.brand-options input { width: auto; }
.brand-list { margin-top: 20px; }
.banner-list-item { display: flex; align-items: center; gap: 12px; min-width: 0; }
.banner-list-item img { width: 88px; height: 52px; flex: 0 0 88px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; }
.banner-list-item p { margin: 4px 0 0; }

#products-view .panel:nth-child(2) { max-width: 1180px; }
#users-view #user-create-panel, #notifications-view .panel:has(.form-layout), #commerce-view .panel:has(.form-layout) { max-width: 1040px; }

.product-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 2px 2px 0;
}

.product-workspace-header h3 { font-size: 21px; }
.product-workspace-header .hint { margin: 5px 0 0; }

.rule-summary {
  max-width: 430px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #b9ddd7;
  border-radius: 8px;
  color: #006e68;
  background: #edf9f7;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.product-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.product-tab {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 9px 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.product-tab:hover { color: var(--navy); background: var(--cloud-soft); }
.order-status-tabs { margin-bottom: 14px; }
.commerce-tabs { margin-bottom: 16px; }
.order-tab-count { padding: 2px 6px; border-radius: 999px; background: var(--cloud-soft); font-size: 11px; }
.product-tab.active { border-color: #9bd9d2; color: #006e68; background: #e7f8f5; }
.product-tab:focus-visible { outline: 3px solid rgba(0, 167, 155, 0.28); outline-offset: 2px; }
.product-tab-panel { min-width: 0; }
.product-tab-panel.active { display: block; }

.settings-panel { max-width: 860px; }
.settings-heading { align-items: flex-start; }
.settings-rule-card { max-width: 720px; }
.settings-rule-card em { color: #006e68; font-style: normal; font-weight: 900; }

.user-activity-card {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid #cfe4e6;
  border-radius: 8px;
  background: white;
}

.user-activity-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.user-activity-heading > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.user-activity-heading .material-symbols-outlined { color: var(--teal); }
.user-activity-heading small { display: block; margin-top: 2px; }

.activity-stat-grid {
  margin: 13px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.activity-stat-grid span {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
  background: var(--cloud-soft);
  font-size: 11px;
  font-weight: 800;
}

.activity-stat-grid strong { margin-right: 5px; color: var(--navy); font-size: 15px; }
.user-activity-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.user-activity-group { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--cloud-soft); }
.user-activity-group-title { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; color: var(--navy); font-size: 12px; }
.user-activity-group-title .material-symbols-outlined { color: var(--teal); font-size: 18px; min-width: 18px; width: 18px; }
.user-activity-group-title span:last-child { min-width: 20px; padding: 2px 6px; border-radius: 999px; color: #006e68; background: #dff8f5; text-align: center; font-size: 11px; font-weight: 900; }
.user-activity-list { margin-top: 8px; display: grid; gap: 6px; }
.user-activity-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 7px; border-top: 1px solid var(--line); font-size: 12px; }
.user-activity-item > div { min-width: 0; }
.user-activity-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-activity-item > strong { white-space: nowrap; color: #006e68; font-size: 12px; }
.user-activity-group .hint { margin: 8px 0 0; font-size: 12px; }
.customer-activity-search { max-width: 640px; margin: 4px 0 12px; }
.customer-search-results { display: grid; gap: 7px; max-width: 760px; }
.customer-search-result, .user-activity-item { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 10px; background: white; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; }
.customer-search-result small { display: block; color: var(--muted); margin-top: 3px; }
.customer-activity-selected, .activity-detail { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.selected-customer-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.selected-customer-heading h3 { margin: 2px 0; }
.activity-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.activity-detail-grid > div, .detail-items > div { padding: 10px; border-radius: 7px; background: var(--cloud-soft); }
.activity-detail-grid small { display: block; color: var(--muted); }
.detail-items { display: grid; gap: 7px; margin-top: 12px; }
.detail-items > div { display: flex; justify-content: space-between; gap: 10px; }

@media (max-width: 980px) {
  .three-columns, .compact-section { grid-template-columns: 1fr; }
  .sticky-actions { position: static; }
  .user-activity-groups { grid-template-columns: 1fr; }
  .activity-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .form-section { padding: 14px; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .message { margin: 0; }
  .form-actions button { width: 100%; }
  .product-workspace-header, .user-activity-heading { align-items: stretch; flex-direction: column; }
  .product-tab { flex: 1 1 150px; justify-content: center; }
  .activity-stat-grid { grid-template-columns: 1fr; }
  .user-activity-heading .ghost-button { width: 100%; }
}

.staff-credentials-dialog { width: min(560px, calc(100vw - 32px)); max-height: 90vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.staff-credentials-dialog::backdrop { background: #0007; }
/* Shared feedback for pending saves and other asynchronous panel actions. */
.submission-pending { cursor: wait; opacity: .65; }
.submission-progress { position: relative; overflow: hidden; padding: 10px 0 7px; color: var(--muted, #667085); font-size: 13px; flex-basis: 100%; grid-column: 1 / -1; }
.submission-progress::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: #e2e8f0; }
.submission-progress::after { content: ''; position: absolute; top: 0; left: 0; width: 35%; height: 3px; background: var(--primary, #087f5b); animation: submission-loading 1.2s ease-in-out infinite; }
@keyframes submission-loading { from { transform: translateX(-100%); } to { transform: translateX(390%); } }
@media (prefers-reduced-motion: reduce) { .submission-progress::after { animation: none; width: 100%; } }
.order-print-actions { display: flex; justify-content: flex-end; margin: 10px 0; }

.enrichment-card { border: 1px solid var(--border, #dce3e9); border-radius: 16px; padding: 24px; margin: 20px 0; }
.enrichment-image { width: 180px; height: 160px; object-fit: contain; background: #fff; border-radius: 12px; display: block; margin: 12px 0; }
#enrichment-view .data-card { padding: 20px; border: 1px solid #dce3e9; border-radius: 12px; overflow-wrap: anywhere; }
#enrichment-view input[type="checkbox"] { width: auto; margin-right: 6px; }
#enrichment-status { padding: 12px 0; }
#enrichment-view .enrichment-field { display: grid; gap: 8px; align-content: start; }
#enrichment-view .enrichment-toggle { display: flex; align-items: center; gap: 8px; margin: 12px 0; font-size: 13px; font-weight: 600; }
#enrichment-view .enrichment-toggle input { flex: 0 0 auto; margin: 0; }
#enrichment-view .enrichment-field .enrichment-toggle { margin: 0; }

.product-current-image { display: flex; align-items: center; gap: 18px; margin: 0; padding: 16px; border: 1px solid var(--border, #dce3e9); border-radius: 14px; background: #fff; }
.product-current-image[hidden] { display: none; }
.product-current-image img { width: 150px; height: 150px; object-fit: contain; border-radius: 10px; background: #fff; }
.product-current-image figcaption { color: var(--muted, #657b88); font-size: 13px; font-weight: 600; }

.product-list-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.product-list-copy { min-width: 0; overflow-wrap: anywhere; }
.product-list-thumbnail { position: relative; display: grid; place-items: center; flex: 0 0 80px; width: 80px; height: 80px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; color: #a0b2bd; background: #fff; }
.product-list-thumbnail.is-empty { border-style: dashed; background: #edf2f5; }
.product-list-thumbnail > .material-symbols-outlined { font-size: 30px; }
.product-list-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 5px; object-fit: contain; background: #fff; }
@media (max-width: 620px) { .product-list-thumbnail { flex-basis: 64px; width: 64px; height: 64px; } .product-list-main { gap: 10px; } }

#enrichment-view .enrichment-image-preview { margin: 0; padding: 10px; display: grid; justify-items: center; gap: 6px; width: fit-content; max-width: 100%; border: 1px solid var(--line, #dce3e9); border-radius: 12px; background: #fff; }
#enrichment-view .enrichment-image-preview[hidden] { display: none; }
#enrichment-view .enrichment-image-preview img { display: block; width: 140px; height: 140px; object-fit: contain; }
#enrichment-view .enrichment-image-preview img[hidden] { display: none; }
#enrichment-view .enrichment-image-preview figcaption { font-size: 12px; color: var(--muted, #657b88); }
.order-live-notice { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 20px; padding: 16px; border: 1px solid #00a79d; border-radius: 14px; background: #e9faf6; color: #102c43; }
.order-live-notice > span:nth-child(2) { flex: 1 1 220px; }
.order-live-notice.hidden { display: none; }
.owner-dashboard { margin-bottom: 24px; border-top: 4px solid #00a79d; }
.owner-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.owner-metrics .metric { min-width: 0; }
.owner-metrics .metric strong { font-size: clamp(18px, 2vw, 28px); white-space: nowrap; }
.owner-metrics .metric small { line-height: 1.5; color: #526679; }
.owner-table { margin-top: 20px; }
.owner-table-scroll { overflow-x: auto; }
.owner-table table { width: 100%; border-collapse: collapse; text-align: left; }
.owner-table th, .owner-table td { padding: 12px; border-bottom: 1px solid #e1e8ed; }
.owner-table td small { display: block; color: #526679; margin-top: 4px; }
@media (max-width: 1100px) { .owner-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .owner-metrics { grid-template-columns: minmax(0, 1fr); } }
