:root {
  --ink: #0f172a;
  --muted: #667085;
  --panel: #ffffff;
  --line: #e4e7ec;
  --accent: #3f7cff;
  --accent-2: #00c6ae;
  --bg: linear-gradient(135deg, #f7f9ff 0%, #eef7ff 50%, #f7fffa 100%);
  --radius: 18px;
  --shadow: 0 16px 48px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.phone-control {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 8px;
}

.phone-control > select,
.phone-control > input {
  min-width: 0;
  width: 100%;
}

.field-hint {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

@media (max-width: 620px) {
  .phone-control { grid-template-columns: 1fr; }
}

body {
  margin: 0;
  font-family: "Space Grotesk","Segoe UI",system-ui,sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  padding: 12px;
}

.nav-toggle {
  position: static;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
  cursor: pointer;
  z-index: 1002;
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  background: #0f172a;
  border-radius: 999px;
  display: block;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle--inside {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: none;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1000;
  display: none;
}

.layout {
  max-width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: var(--nav-width, minmax(200px, 240px)) minmax(0, 1fr);
  gap: 12px;
}

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
}

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid #f4f5f7;
}

h1 {
  margin: 0 0 4px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: clamp(22px, 3vw, 32px);
}

.subtitle {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 10px;
}

.nav {
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid #eef2f7;
  box-shadow: var(--shadow);
  padding: 12px 10px;
  display: grid;
  gap: 8px;
  height: fit-content;
}

@media (max-width: 980px) {
  .nav-toggle--outside {
    display: inline-flex;
    position: fixed;
    top: 18px;
    left: 18px;
  }
  .nav-toggle--inside { display: none; }
  .nav-backdrop { display: block; backdrop-filter: blur(6px); }
  .nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100dvh;
    overflow-y: auto;
    z-index: 1001;
    display: grid;
    padding: calc(16px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 18%);
    opacity: 0;
    transform: translateY(6%);
    pointer-events: none;
    visibility: hidden;
    transition: transform 0.28s ease, opacity 0.2s ease;
    -webkit-overflow-scrolling: touch;
  }
  body.nav-open { overflow: hidden; }
body.nav-open .nav { opacity: 1; transform: translateY(0); pointer-events: auto; visibility: visible; }

.site-publication-photo-dialog {
  width: min(92vw, 560px);
  border: 0;
  border-radius: 16px;
  padding: 0;
  color: var(--text);
  background: var(--surface, #fff);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .3);
}
.site-publication-photo-dialog::backdrop { background: rgba(15, 23, 42, .58); }
.site-publication-photo-dialog__content { padding: 24px; }
.site-publication-photo-dialog__content h2 { margin: 0 0 10px; }
.site-publication-photo-dialog__content p { margin: 0; color: var(--muted); line-height: 1.55; }
.site-publication-photo-dialog__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
@media (max-width: 560px) {
  .site-publication-photo-dialog__actions > * { width: 100%; justify-content: center; }
}
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }

  .nav-flyout {
    position: static !important;
    top: auto;
    left: auto;
    min-width: 0;
    box-shadow: none;
    border: 1px solid #eef2f7;
    background: #ffffff;
    margin: 6px 0 0 0;
    padding: 8px 6px 8px 10px;
    border-radius: 12px;
    display: none;
    width: 100%;
  }

  .nav-node.is-open > .nav-link .nav-caret {
    transform: rotate(45deg);
  }

  .nav-node.is-open > .nav-flyout {
    display: grid;
    gap: 6px;
  }
}

@media (min-width: 981px) {
  .nav-toggle--inside { display: inline-flex; }
  .nav-toggle--outside { display: none; }
}

.nav-user {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.nav-user-meta { min-width: 0; }
.nav-user-name,
.nav-user-role { overflow-wrap: anywhere; }

.nav-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(63,124,255,0.25), rgba(0,198,174,0.35));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.nav-user-name { font-weight: 700; font-size: 13px; }
.nav-user-role { color: var(--muted); font-size: 11px; text-transform: capitalize; }
.nav-user-actions {
  display: grid;
  gap: 6px;
  justify-items: end;
}
.nav-logout { font-weight: 700; color: #ef4444; text-decoration: none; font-size: 11px; }
.nav-logout:hover { text-decoration: underline; }

.nav-title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.nav-node {
  display: grid;
  gap: 6px;
  position: relative;
}

.nav-node.nav-has-children::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -12px;
  width: 12px;
  height: calc(100% + 4px);
}

.nav-link {
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  background: #f8fafc;
  text-align: left;
  font: inherit;
}

.nav-icon {
  display: none;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #1e3a8a;
  background: linear-gradient(140deg, rgba(63,124,255,0.2), rgba(0,198,174,0.2));
  border: 1px solid rgba(63,124,255,0.22);
  flex-shrink: 0;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  display: block;
  color: inherit;
}

.nav-icon use {
  stroke: currentColor;
  fill: none;
}

.nav-link--toggle {
  cursor: pointer;
}

.nav-label {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  flex: 1;
}

.nav-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--muted);
}

.nav-active-dot {
  color: var(--accent);
}

.nav-caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.nav-link.active,
.nav-node.active > .nav-link {
  border-color: #dbeafe;
  background: linear-gradient(120deg, rgba(63,124,255,0.14), rgba(0,198,174,0.14));
  box-shadow: 0 10px 24px rgba(63,124,255,0.18);
}

.nav-link:hover {
  border-color: #e2e8f0;
  background: #f1f5f9;
}

.nav-flyout {
  position: absolute;
  top: 0;
  left: calc(100% + 12px);
  min-width: 220px;
  background: var(--panel);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 10px;
  display: none;
  z-index: 200;
  gap: 6px;
}

@media (hover: hover) {
  .nav-node.nav-has-children:hover > .nav-flyout {
    display: grid;
  }
}

.nav-node.is-open > .nav-flyout {
  display: grid;
}

.nav-collapsed .layout {
  grid-template-columns: var(--nav-collapsed-width, 64px) minmax(0, 1fr);
}

.nav-collapsed .nav {
  padding: 10px 8px;
  gap: 6px;
}

.nav-collapsed .nav-user {
  grid-template-columns: auto;
  justify-items: center;
  padding: 8px;
}

.nav-collapsed .nav-user-meta,
.nav-collapsed .nav-logout,
.nav-collapsed .nav-title {
  display: none;
}

.nav-collapsed .nav-user-actions {
  justify-items: center;
}

.nav-collapsed .nav-level-1 > .nav-link .nav-label,
.nav-collapsed .nav-level-1 > .nav-link .nav-meta {
  display: none;
}

.nav-collapsed .nav-level-1 > .nav-link .nav-icon {
  display: inline-flex;
}

.nav-collapsed .nav-level-1 > .nav-link {
  justify-content: center;
  padding: 8px;
}

.nav-collapsed .nav-level-2 .nav-icon,
.nav-collapsed .nav-level-3 .nav-icon {
  display: none;
}

.nav-collapsed .nav-node.nav-has-children::after {
  right: -14px;
  width: 14px;
}

.nav-collapsed .nav-flyout {
  left: calc(100% + 10px);
}

.nav-level-2 .nav-link {
  font-size: 13px;
  border-radius: 10px;
  padding: 7px 10px;
}

.nav-level-3 .nav-link {
  font-size: 12px;
  border-radius: 9px;
  padding: 6px 9px;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid #e5e7eb; font-size: 14px; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
th[data-sort-key="id"],
th[data-sort-key="term_id"],
th.col-id,
td.col-id {
  width: 8ch;
  min-width: 8ch;
  max-width: 8ch;
  padding-left: 8px;
  padding-right: 8px;
  white-space: nowrap;
}
.col-person-name,
.col-email {
  width: 35ch;
  max-width: 35ch;
  min-width: 0;
}

.col-status-short {
  width: 18ch;
  max-width: 18ch;
  min-width: 0;
}

.cell-truncate {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-compact th,
.table-compact td {
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.2;
}

.table-compact th {
  font-size: 11px;
  letter-spacing: 0.03em;
}

.table-compact input[type="search"],
.table-compact input[type="number"],
.table-compact input[type="text"],
.table-compact select,
.table-compact textarea {
  padding: 4px 6px;
  font-size: 12px;
  line-height: 1.2;
}

.table-compact .filters-row input[type="search"],
.table-compact .filters-row select {
  padding: 4px 6px;
  font-size: 12px;
}

.table-compact .btn {
  padding: 4px 8px;
  font-size: 12px;
}

.table-compact .icon-btn {
  width: 30px;
  height: 30px;
}

.table-compact .pill {
  padding: 3px 8px;
  font-size: 11px;
}

.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.actions.stack {
  flex-direction: column;
  align-items: stretch;
}
.actions.stack > * {
  width: 100%;
}
.actions.stack .btn {
  width: 100%;
  text-align: center;
}

.col-actions {
  width: 1%;
  white-space: nowrap;
}

.icon-btn {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: #f8fafc;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.2s ease;
}

.icon-btn svg { width: 18px; height: 18px; pointer-events: none; }
.icon-btn:hover { background: #eef2ff; box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn:focus-visible { outline: 2px solid #c7d2fe; outline-offset: 2px; }
.icon-btn.danger { color: #b91c1c; background: #fff1f2; border-color: #fecdd3; }
.icon-btn.danger:hover { background: #ffe4e6; }
.icon-btn.success { color: #15803d; background: #ecfdf3; border-color: #bbf7d0; }
.icon-btn.neutral { color: #475569; }

.btn {
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; }
.btn.ghost { background: #f1f5f9; color: var(--ink); }

.alert {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid;
  margin: 8px 0;
  font-weight: 600;
}

.alert.success { background: #ecfdf3; border-color: #4ade80; color: #065f46; }
.alert.error { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 8px; }
[hidden] { display: none !important; }

img,
video,
canvas,
iframe {
  max-width: 100%;
}

form,
.panel,
.card,
.grid,
.field,
.table-tools,
.table-scroll,
.table-scroll-body,
.modal-card {
  min-width: 0;
}

.layout > *,
main,
main > *,
.panel > *,
.card > *,
.modal-card > * {
  min-width: 0;
  max-width: 100%;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  display: grid;
  gap: 12px;
}

.card > header,
.page-header,
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.card > header h2,
.page-header h1,
.panel-header h1 {
  margin-top: 0;
}

.card-grid,
.field-grid,
.details-grid,
.summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  min-width: 0;
}

.field-grid .full-width,
.card-grid .full-width,
.details-grid .full-width {
  grid-column: 1 / -1;
}

.panel-actions,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.container-fluid {
  width: 100%;
  min-width: 0;
}

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

.g-3 { gap: 12px; }
.col-md-1,
.col-md-2,
.col-md-3,
.col-md-4,
.col-md-5,
.col-md-6,
.col-md-7,
.col-md-8,
.col-md-9,
.col-md-10,
.col-md-11,
.col-md-12 {
  grid-column: span 12;
  min-width: 0;
}

@media (min-width: 768px) {
  .col-md-1 { grid-column: span 1; }
  .col-md-2 { grid-column: span 2; }
  .col-md-3 { grid-column: span 3; }
  .col-md-4 { grid-column: span 4; }
  .col-md-5 { grid-column: span 5; }
  .col-md-6 { grid-column: span 6; }
  .col-md-7 { grid-column: span 7; }
  .col-md-8 { grid-column: span 8; }
  .col-md-9 { grid-column: span 9; }
  .col-md-10 { grid-column: span 10; }
  .col-md-11 { grid-column: span 11; }
  .col-md-12 { grid-column: span 12; }
}

.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 12px !important; }
.mt-3 { margin-top: 12px !important; }
.ms-2 { margin-left: 8px !important; }
.p-3 { padding: 12px !important; }
.h3 { font-size: 20px; }
.w-100 { width: 100% !important; }
.text-white { color: #fff !important; }
.text-danger { color: #b91c1c !important; }
.text-success { color: #166534 !important; }
.text-muted { color: var(--muted) !important; }
.text-right { text-align: right !important; }
.bg-light { background: #f8fafc !important; }
.bg-primary { background: #2563eb !important; }
.bg-warning { background: #fef3c7 !important; color: #854d0e; }
.bg-danger { background: #dc2626 !important; }
.bg-success { background: #16a34a !important; }
.bg-success-subtle { background: #dcfce7 !important; }
.bg-danger-subtle { background: #fee2e2 !important; }
.border-primary { border-color: #2563eb !important; }

.card-header {
  margin: -14px -14px 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  border-radius: 14px 14px 0 0;
  font-weight: 800;
}

.card-body {
  min-width: 0;
}

.form-label {
  display: inline-flex;
  margin-bottom: 6px;
  font-weight: 700;
}

.form-control,
.form-select {
  width: 100%;
}

.badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  white-space: normal;
}

.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.btn-secondary { background: #f1f5f9; color: var(--ink); }
.btn-sm { min-height: 32px; padding: 6px 10px; font-size: 12px; }

.table-responsive {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.flow-step-label {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 720px) {
  .flow-step-label {
    display: none;
  }
}

.order-topbar {
  display: grid;
  gap: 10px;
}

.order-summary-card {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #f8fafc;
  display: grid;
  gap: 6px;
  align-content: start;
}

.order-summary-card--header {
  width: min(320px, 100%);
}

.order-summary-card--inline {
  width: 100%;
  margin-top: 10px;
}

.order-summary-title {
  font-weight: 700;
}

.order-summary-value {
  font-size: 20px;
}

.order-summary-meta,
.order-summary-note {
  font-size: 12px;
  color: var(--muted);
}

.order-layout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.order-layout-header--with-switch {
  align-items: flex-start;
}

.order-layout-header__main {
  display: grid;
  gap: 4px;
}

.order-layout-header__side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.order-layout-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.order-layout-meta {
  font-size: 12px;
  color: var(--muted);
}

.order-layout-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.order-layout-chip {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--ink);
  border: 1px solid var(--line);
}

.order-layout-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.order-layout-metrics {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.order-layout-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #f8fafc;
  display: grid;
  gap: 6px;
}

.order-layout-card--tight {
  padding: 8px 10px;
}

.order-layout-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.order-layout-value {
  font-size: 14px;
  font-weight: 700;
}

.order-layout-sub {
  font-size: 12px;
  color: var(--muted);
}

.order-layout-panel {
  display: grid;
  gap: 10px;
}

.order-mode-toggle {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.order-mode-toggle .btn {
  padding: 8px 14px;
}

.order-mode-note {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 8px;
}

.order-mode--hidden {
  display: none !important;
}

.order-mode-pdv-summary {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.order-mode-mobile {
  display: none;
  margin-top: 12px;
}

.order-mode-summary-label {
  color: var(--muted);
  font-size: 12px;
  display: block;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .order-mode-mobile {
    display: block;
  }
}

.order-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.order-hero__title {
  display: grid;
  gap: 4px;
}

.order-hero__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.order-layout-list {
  display: grid;
  gap: 6px;
}

.order-layout-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fff;
}

.order-layout-list-item span {
  font-size: 12px;
  color: var(--muted);
}

.order-layout-list-item strong {
  font-size: 13px;
}

@media (max-width: 720px) {
  .order-hero__actions,
  .order-layout-header__side {
    width: 100%;
    align-items: flex-start;
  }
}

@media (min-width: 960px) {
  .order-layout-panel {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }
}

@media (min-width: 1024px) {
  .order-top-grid {
    grid-template-columns: minmax(260px, 1.6fr) minmax(220px, 0.9fr);
    align-items: start;
  }
}

.address-section {
  border: 1px solid #eef2f7;
  border-radius: 16px;
  padding: 12px;
  background: #fbfdff;
  display: grid;
  gap: 10px;
}

.address-grid--single {
  grid-template-columns: 1fr;
}

.address-section--shipping-only .address-section__header {
  gap: 10px;
  align-items: flex-start;
}

@media (max-width: 720px) {
  .address-section--shipping-only {
    display: none;
  }
}

.address-section__title-group {
  display: grid;
  gap: 4px;
}

.address-section__eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.address-grid {
  display: grid;
  gap: 12px;
  align-items: stretch;
}

@media (min-width: 960px) {
  .address-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .address-section {
    height: 100%;
  }
}

.address-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.address-section__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.address-summary {
  display: grid;
  gap: 4px;
  font-size: 14px;
}

.address-summary__line {
  color: var(--ink);
}

.address-summary__name {
  font-weight: 600;
}

.address-summary__empty {
  color: var(--muted);
  font-size: 13px;
}

.address-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.address-toggle-group {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.address-toggle__label {
  color: var(--ink);
  font-weight: 600;
}

.address-toggle__hint {
  display: block;
  max-width: 320px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
  text-align: right;
}

.address-toggle--inline {
  margin: 0;
}

.address-section h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.icon-button {
  border: 1px solid var(--line);
  background: #fff;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.icon-button svg {
  width: 16px;
  height: 16px;
}

.icon-button:hover {
  background: #f1f5f9;
  border-color: #dbeafe;
}

.icon-button:active {
  transform: scale(0.98);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 1200;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1201;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal[hidden],
.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  border: 1px solid #eef2f7;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  max-height: 90vh;
  overflow: auto;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-body .grid {
  margin-top: 6px;
}

.modal-error {
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid #fca5a5;
  background: #fef2f2;
  color: #991b1b;
  font-weight: 600;
  font-size: 13px;
}

body.modal-open {
  overflow: hidden;
}

.customer-picker,
.autocomplete-picker {
  position: relative;
}

.mobile-datalist-picker--block {
  width: 100%;
  min-width: 0;
}

.mobile-datalist-picker--block > input {
  width: 100%;
}

.customer-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px auto;
  align-items: center;
  gap: 8px;
}

.customer-input-row input:not([type="hidden"]) {
  min-width: 0;
  width: 100%;
}

.customer-input-row > .icon-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
}

.customer-new-btn {
  grid-column: 3;
  white-space: nowrap;
}
.customer-suggestions,
.autocomplete-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
}

.customer-suggestions[hidden],
.autocomplete-suggestions[hidden] {
  display: none;
}
.customer-suggestion,
.autocomplete-suggestion {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  font-size: 13px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}
.customer-suggestion:hover,
.autocomplete-suggestion:hover {
  border-color: #dbeafe;
  background: #eff6ff;
}
.autocomplete-suggestion:focus-visible {
  border-color: #8fb2eb;
  background: #eff6ff;
  outline: 2px solid rgba(36, 91, 219, 0.22);
  outline-offset: 1px;
}
.product-form__supplier-picker .autocomplete-suggestion {
  display: grid;
  gap: 2px;
}
.product-form__supplier-picker .autocomplete-suggestion strong {
  color: var(--ink);
  font-size: 13px;
}
.product-form__supplier-picker .autocomplete-suggestion small {
  color: var(--muted);
  font-size: 10px;
}
.customer-suggestion--empty,
.autocomplete-suggestion--empty {
  background: #fff;
  color: var(--muted);
  cursor: default;
}

@media (max-width: 820px) {
  .customer-picker,
  .autocomplete-picker,
  .mobile-datalist-picker,
  .remote-datalist-picker {
    min-width: 0;
  }

  .customer-picker:focus-within,
  .autocomplete-picker:focus-within,
  .mobile-datalist-picker:focus-within,
  .remote-datalist-picker:focus-within {
    z-index: 1300;
  }

  .customer-suggestions,
  .autocomplete-suggestions {
    z-index: 1300;
    max-height: min(320px, 52dvh);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .panel:has(.customer-suggestions:not([hidden])),
  .panel:has(.autocomplete-suggestions:not([hidden])),
  .modal-card:has(.customer-suggestions:not([hidden])),
  .modal-card:has(.autocomplete-suggestions:not([hidden])),
  .order-layout-sidebar__panel:has(.customer-suggestions:not([hidden])),
  .order-layout-sidebar__panel:has(.autocomplete-suggestions:not([hidden])) {
    overflow: visible !important;
  }
}

.order-items { overflow-x: auto; padding-bottom: 4px; }
.order-item-row {
  grid-template-columns: minmax(110px, 0.7fr) minmax(280px, 2.4fr) minmax(140px, 1fr) minmax(90px, 0.6fr) minmax(140px, 0.9fr) minmax(180px, 1.1fr) minmax(140px, 0.9fr) minmax(140px, 0.9fr);
  align-items: end;
}
.order-item-row .field { min-width: 0; }

.order-item-picker {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #f8fafc;
  display: grid;
  gap: 10px;
}

.order-item-picker__grid {
  gap: 12px;
}

.order-item-picker__grid .field {
  min-width: 0;
}

.order-item-picker__grid .autocomplete-picker,
.order-item-picker__grid input,
.order-item-picker__grid select {
  width: 100%;
}

@media (min-width: 1024px) {
  .order-item-picker__grid {
    grid-template-columns:
      minmax(150px, 1.1fr)
      minmax(260px, 2.2fr)
      minmax(180px, 1.3fr)
      minmax(130px, 0.7fr)
      minmax(170px, 1fr);
    align-items: end;
  }
}

.order-item-picker__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.order-item-helper {
  font-size: 12px;
  color: var(--muted);
}

.order-item-helper--error {
  color: #b91c1c;
  font-weight: 600;
}

.order-items-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.order-items-empty {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.order-payment-discount {
  margin-bottom: 10px;
}

.order-payment-discount__fields {
  margin-top: 6px;
}

.order-payment-discount__results {
  margin-top: 4px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.order-payment-discount__metric {
  display: grid;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
}

.order-payment-discount__metric strong {
  color: var(--ink);
  font-size: 14px;
}

.order-payment-picker {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #f8fafc;
  display: grid;
  gap: 10px;
}

.order-payment-picker__grid {
  gap: 12px;
}

@media (min-width: 1024px) {
  .order-payment-picker__grid {
    grid-template-columns:
      minmax(200px, 1.4fr)
      minmax(140px, 0.8fr)
      minmax(140px, 0.8fr)
      minmax(220px, 1.2fr)
      minmax(220px, 1.2fr);
    align-items: end;
  }
}

.order-payment-picker__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.order-payment-helper {
  font-size: 12px;
  color: var(--muted);
}

.order-payment-helper--error {
  color: #b91c1c;
  font-weight: 600;
}

.order-payments-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.order-payments-empty {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

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

.order-payment-main {
  display: grid;
  gap: 4px;
}

.order-payment-title {
  font-weight: 600;
}

.order-payment-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.order-payment-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.order-payment-status--paid {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.order-payment-status--partial {
  background: #e0f2fe;
  color: #075985;
  border-color: #7dd3fc;
}

.order-payment-status--pending {
  background: #fef3c7;
  color: #854d0e;
  border-color: #fcd34d;
}

.order-payment-status--neutral {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

.order-payment-status--shipped {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}

.order-payment-status--delivered {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.order-payment-status--returned,
.order-payment-status--refunded {
  background: #f3e8ff;
  color: #6b21a8;
  border-color: #d8b4fe;
}

.order-payment-status--bag-open {
  background: #fef3c7;
  color: #854d0e;
  border-color: #fcd34d;
}

.order-unified-status {
  display: grid;
  gap: 8px;
}

.order-unified-status__line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

/* Keep the optional estimate fully readable in the order's delivery group. */
.orders-table .order-unified-status__line--pickup-estimate {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.orders-table .order-pickup-estimate-value {
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

.order-unified-status__line--paid {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.order-unified-status__line--partial {
  background: #f0f9ff;
  border-color: #bae6fd;
}

.order-unified-status__line--pending {
  background: #fffbeb;
  border-color: #fde68a;
}

.order-unified-status__line--neutral {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.order-unified-status__line--shipped {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.order-unified-status__line--delivered {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.order-unified-status__line--returned,
.order-unified-status__line--refunded {
  background: #faf5ff;
  border-color: #e9d5ff;
}

.order-unified-status__line--bag {
  background: #fff7ed;
  border-color: #fed7aa;
}

.order-unified-status__label {
  display: inline-flex;
  align-items: center;
  min-width: 82px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #475569;
}

.order-unified-status__line--payment .order-unified-status__label {
  color: #1d4ed8;
}

.order-unified-status__line--fulfillment .order-unified-status__label {
  color: #0f766e;
}

.order-unified-status__line--bag .order-unified-status__label {
  color: #92400e;
}

.order-unified-status__method {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  min-height: 20px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-unified-status__bag-link {
  text-decoration: none;
}

.order-unified-status__bag-link:hover {
  text-decoration: underline;
}

.order-status-badges {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.order-status-icons {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.order-status-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  position: relative;
}

.order-status-icon svg {
  width: 16px;
  height: 16px;
}

.order-status-icon--return-partial {
  width: auto;
  height: auto;
  min-height: 28px;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  box-sizing: border-box;
}

.order-status-icon--return-partial svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.order-status-icon__label {
  display: inline-block;
  font-size: inherit;
  line-height: inherit;
}

.order-status-icon--return-total {
  background: #ffe4e6;
  border-color: #fecdd3;
  color: #be123c;
}

.order-status-icon--refund-pending {
  background: #fef9c3;
  border-color: #fde68a;
  color: #a16207;
}

.order-status-icon--refund-done {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

.order-status-icon--bag {
  color: #0f172a;
}

.order-status-icon--bag-open {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.order-status-icon--bag-done {
  background: #ecfeff;
  border-color: #bae6fd;
  color: #0e7490;
}

.order-status-icon__check {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #22c55e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.order-status-icon__check svg {
  width: 10px;
  height: 10px;
}

.order-payment-meta {
  font-size: 12px;
  color: var(--muted);
}

.order-payment-amount {
  font-weight: 700;
  white-space: nowrap;
}

.order-payment-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.order-payment-action--paid {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.order-payment-action--pending {
  background: #fff7f7;
  border-color: #fecaca;
  color: #b91c1c;
}

.order-payment-panel {
  grid-column: 1 / -1;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  display: grid;
  gap: 10px;
}

.order-payment-panel__grid {
  display: grid;
  gap: 12px;
}

@media (min-width: 1024px) {
  .order-payment-panel__grid {
    grid-template-columns:
      minmax(140px, 1fr)
      minmax(140px, 1fr)
      minmax(200px, 1.2fr)
      minmax(200px, 1.2fr);
    align-items: end;
  }
}

.order-payment-panel__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.order-payment-summary {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px dashed var(--line);
  font-size: 13px;
  color: var(--muted);
}

.order-item-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 8px 12px;
  grid-template-columns: 60px minmax(0, 1fr) 96px;
  grid-template-rows: auto auto;
  align-items: start;
}

.order-item-thumb {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  overflow: hidden;
  background: #eef2f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
}

.order-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.order-item-table-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  background: #eef2f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  text-transform: uppercase;
  color: var(--muted);
}

.order-item-table-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-table-thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  background: #eef2f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  text-transform: uppercase;
  color: var(--muted);
}

.product-table-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.order-item-main {
  display: grid;
  gap: 4px;
}

.order-item-title {
  font-weight: 600;
}

.order-item-meta {
  font-size: 12px;
  color: var(--muted);
}

.order-item-main {
  grid-column: 2;
  grid-row: 1;
}

.order-item-total {
  grid-column: 2;
  grid-row: 2;
  font-weight: 700;
  white-space: nowrap;
}

.order-item-actions {
  grid-column: 3;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  height: 60px;
}

.order-item-action {
  border: 1px solid var(--line);
  background: #fff;
  width: 100%;
  flex: 1;
  min-height: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 8px;
}

.order-item-action svg {
  width: 16px;
  height: 16px;
}

.order-item-action:hover {
  background: #f1f5f9;
  border-color: #dbeafe;
}

.order-item-action:active {
  transform: scale(0.98);
}

@media (max-width: 900px) {
  .order-item-card {
    grid-template-columns: 65px minmax(0, 1fr) 36px;
    align-items: center;
  }

  .order-item-thumb {
    width: 65px;
    height: 65px;
  }

  .order-item-actions {
    height: 60px;
    gap: 4px;
  }

  .order-item-action {
    padding: 5px 4px;
    font-size: 11px;
  }

  .order-item-title,
  .order-item-total {
    font-size: 0.8em;
  }
}

.order-item-panel {
  grid-column: 1 / -1;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  display: grid;
  gap: 10px;
}

.order-item-panel__grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.order-item-panel__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  [data-order-picker-name],
  [data-order-picker-qty],
  [data-order-picker-price],
  #addOrderItem {
    display: none !important;
  }

  [data-order-picker-sku] {
    grid-column: 1 / -1;
  }
}

.order-layout-switcher {
  position: sticky;
  top: 8px;
  z-index: 45;
  margin: 0 0 10px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.order-layout-switcher label {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.order-layout-switcher select {
  width: 170px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
}

.order-create-layout.layout {
  display: block;
  grid-template-columns: none;
  gap: 0;
}

.order-create-shell {
  display: grid;
  gap: 14px;
  align-items: start;
}

.order-create-main {
  display: grid;
  gap: 12px;
}

.order-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.order-section__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid #eef2f7;
  padding-bottom: 8px;
}

.order-section__title {
  margin: 4px 0 0;
  font-size: 18px;
}

.order-section__header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.order-section__toggle {
  min-width: 92px;
}

.order-step-status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #dbe2eb;
  color: #64748b;
  background: #f8fafc;
}

.order-step-status.is-complete {
  background: #ecfdf3;
  color: #166534;
  border-color: #bbf7d0;
}

.order-step-status.is-partial {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fdba74;
}

.order-step-status.is-incomplete {
  background: #f8fafc;
  color: #64748b;
  border-color: #dbe2eb;
}

.order-section__body {
  display: grid;
  gap: 10px;
}

.order-bag-inline-summary {
  margin-top: -2px;
  padding: 7px 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

.open-bag-fee-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  font-weight: 700;
  color: var(--ink);
}

.open-bag-fee-line input[type="checkbox"] {
  margin: 0;
}

.open-bag-fee-line__hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

[data-open-bag-fee-pay-now-field].is-paid .open-bag-fee-line {
  color: #166534;
}

[data-open-bag-fee-pay-now-field].is-paid .open-bag-fee-line__hint {
  color: #166534;
  opacity: 0.78;
}

.order-section.is-collapsed .order-section__body {
  display: none;
}

.order-items-list.is-feedback,
.order-payments-list.is-feedback,
#orderTotalSummary.is-feedback {
  animation: orderFeedbackPulse 0.48s ease;
}

@keyframes orderFeedbackPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(59, 130, 246, 0); }
  45% { transform: scale(1.01); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(59, 130, 246, 0); }
}

.order-section[data-section-key="review"] .order-section__header {
  border-bottom: 0;
  padding-bottom: 0;
}

.order-section[data-section-key="review"] .order-section__toggle {
  display: none;
}

.order-mode-desktop {
  display: grid;
  gap: 6px;
}

.order-layout-sidebar {
  display: none;
}

.order-layout-sidebar__trigger {
  width: 100%;
}

.order-layout-sidebar__panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.order-layout-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.order-layout-sidebar__header h3 {
  margin: 0;
  font-size: 16px;
}

.order-layout-sidebar__list {
  display: grid;
  gap: 6px;
}

.order-layout-sidebar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  padding: 8px 10px;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 10px;
}

.order-layout-sidebar__row strong {
  font-size: 14px;
}

.order-layout-sidebar__row--alert strong,
.order-layout-sidebar__row--alert {
  color: #b91c1c;
}

.order-layout-sidebar__alerts {
  font-size: 12px;
  color: var(--muted);
}

#orderTotalSummary {
  position: sticky;
  bottom: 70px;
  z-index: 24;
  border-style: solid;
  border-width: 1px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

#orderTotalSummary.is-state-incomplete {
  border-color: #cbd5e1;
  background: #f8fafc;
}

#orderTotalSummary.is-state-partial {
  border-color: #fdba74;
  background: #fff7ed;
}

#orderTotalSummary.is-state-paid {
  border-color: #86efac;
  background: #ecfdf3;
}

#orderTotalRemaining.is-alert {
  color: #b91c1c;
  font-weight: 700;
}

#orderTotalRemaining.is-ok {
  color: #166534;
  font-weight: 700;
}

.order-submit-bar {
  position: sticky;
  bottom: 12px;
  z-index: 25;
  margin-top: 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.order-submit-bar__secondary {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-submit-bar .primary {
  min-width: 170px;
}

body[data-layout="layout-1"] .order-create-main {
  gap: 14px;
}

body[data-layout="layout-1"] .order-section[data-section-key="logistics"] {
  border-left: 4px solid #cbd5e1;
}

body[data-layout="layout-1"] .order-section[data-section-key="payments"] {
  border-left: 4px solid #bfdbfe;
}

body[data-layout="layout-1"] #orderTotalSummary .order-summary-value {
  font-size: 24px;
  font-weight: 800;
}

body[data-layout="layout-2"] .order-section {
  border-radius: 12px;
}

body[data-layout="layout-2"] .order-section__header {
  cursor: pointer;
}

body[data-layout="layout-2"] .order-section.is-complete {
  border-color: #86efac;
}

body[data-layout="layout-2"] .order-section.is-partial {
  border-color: #fdba74;
}

body[data-layout="layout-2"] .order-section.is-incomplete {
  border-color: #cbd5e1;
}

body[data-layout="layout-3"] .order-section {
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

body[data-layout="layout-3"] .order-section__header {
  border-bottom-style: dashed;
}

body[data-layout="layout-3"] .order-payment-card {
  border-left: 4px solid #dbeafe;
}

body[data-layout="layout-3"] .order-item-card {
  border-left: 4px solid #e2e8f0;
}

body[data-layout="layout-4"] .order-layout-sidebar {
  display: block;
}

body[data-layout="layout-4"] .order-layout-sidebar__trigger {
  display: none;
}

body[data-layout="layout-5"] .order-create-main {
  gap: 8px;
}

body[data-layout="layout-5"] .order-section {
  border-radius: 10px;
  padding: 9px 10px;
}

body[data-layout="layout-5"] .order-section__title {
  font-size: 16px;
}

body[data-layout="layout-5"] .order-item-picker,
body[data-layout="layout-5"] .order-payment-picker {
  padding: 8px;
  border-radius: 10px;
}

body[data-layout="layout-5"] .order-section[data-section-key="payments"] {
  order: 2;
}

body[data-layout="layout-5"] .order-section[data-section-key="items"] {
  order: 3;
}

body[data-layout="layout-5"] .order-section[data-section-key="logistics"] {
  order: 4;
}

body[data-layout="layout-5"] .order-section[data-section-key="review"] {
  order: 5;
}

@media (min-width: 1100px) {
  body[data-layout="layout-4"] .order-create-shell {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  body[data-layout="layout-4"] .order-layout-sidebar {
    position: sticky;
    top: 66px;
    max-height: calc(100vh - 84px);
    align-self: start;
  }

  body[data-layout="layout-4"] .order-layout-sidebar__panel {
    max-height: calc(100vh - 110px);
    overflow: auto;
  }
}

@media (max-width: 1099px) {
  body[data-layout="layout-4"] .order-layout-sidebar {
    display: block;
  }

  body[data-layout="layout-4"] .order-layout-sidebar__trigger {
    display: inline-flex;
  }

  body[data-layout="layout-4"] .order-layout-sidebar__panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 86px;
    top: auto;
    z-index: 40;
    display: none;
    max-height: calc(100vh - 130px);
    overflow: auto;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  }

  body[data-layout="layout-4"] .order-create-layout.is-sidebar-open .order-layout-sidebar__panel {
    display: grid;
  }
}

@media (max-width: 900px) {
  #orderTotalSummary {
    bottom: 82px;
  }
}

@media (max-width: 768px) {
  .order-create-layout {
    padding-bottom: 90px;
  }

  .order-mode-desktop {
    display: none;
  }

  .order-layout-switcher {
    justify-content: stretch;
  }

  .order-layout-switcher select {
    width: 100%;
  }

  .order-section__header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .order-submit-bar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 8px;
    margin-top: 0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
  }

  .order-submit-bar .primary {
    min-width: 132px;
  }

  body[data-layout="layout-4"] .order-layout-sidebar__panel {
    bottom: 90px;
  }
}

@media (max-width: 720px) {
  body[data-layout="layout-2"] .order-section:not(.is-open) .order-section__body {
    display: none;
  }

  body[data-layout="layout-5"] input,
  body[data-layout="layout-5"] select,
  body[data-layout="layout-5"] textarea {
    padding: 8px 9px;
    border-radius: 10px;
    font-size: 13px;
  }

  body[data-layout="layout-5"] label {
    font-size: 12px;
  }
}

body[data-layout] .order-submit-bar__secondary {
  opacity: 0.75;
}

body[data-layout="layout-2"] .order-submit-bar__secondary,
body[data-layout="layout-4"] .order-submit-bar__secondary,
body[data-layout="layout-5"] .order-submit-bar__secondary {
  opacity: 1;
}

body[data-layout="layout-2"] .order-section[data-section-key="review"] .order-section__header {
  border-bottom: 0;
}

body[data-layout="layout-3"] .order-section[data-section-key="review"] {
  border-color: #93c5fd;
}

body[data-layout="layout-5"] .order-section[data-section-key="logistics"].is-collapsed .order-section__body {
  display: none;
}

label { font-weight: 600; font-size: 14px; }

input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #f8fafc;
  color: var(--ink);
}

.field > input:not([type="checkbox"]):not([type="radio"]),
.field > select,
.field > textarea,
.field > .autocomplete-picker,
.field > .customer-picker,
.field > .mobile-datalist-picker,
.field > .remote-datalist-picker {
  width: 100%;
  min-width: 0;
}

.autocomplete-picker > .autocomplete-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  flex: 0 0 auto;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(63, 124, 255, 0.18);
}

textarea { min-height: 120px; resize: vertical; }

.footer {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.size-parameters { display: grid; gap: 18px; max-width: 1120px; margin: 0 auto; }
.size-parameters__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.size-parameters__header h1 { margin: 4px 0 6px; }
.size-parameters__header p,
.size-parameters__section-heading p { margin: 0; color: var(--muted); }
.size-parameters__eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.size-parameters__section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.size-parameters__section-heading h2 { margin: 0 0 4px; font-size: 20px; }
.size-parameters__filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: end; }
.size-parameters__filters .btn { grid-column: 1 / -1; justify-self: end; min-height: 44px; min-width: 220px; }
.size-parameters__editor textarea { min-height: 420px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.55; }
.size-parameters__actions { display: flex; justify-content: flex-end; margin-top: 16px; }
@media (max-width: 860px) {
  .size-parameters__filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .size-parameters__header { display: grid; }
  .size-parameters__filters { grid-template-columns: 1fr; }
  .size-parameters__filters .btn,
  .size-parameters__actions .btn { width: 100%; }
  .size-parameters__editor textarea { min-height: 360px; }
}

.ghost { background: #f1f5f9; color: var(--ink); }

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 12px 30px rgba(63, 124, 255, 0.25);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(63, 124, 255, 0.12);
  color: #1d4ed8;
  font-weight: 600;
  font-size: 13px;
}

.delivery-status-pill {
  --delivery-status-bg: #eff6ff;
  --delivery-status-border: #bfdbfe;
  --delivery-status-color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 260px;
  padding: 8px 11px;
  border: 1px solid var(--delivery-status-border);
  border-radius: 999px;
  background: var(--delivery-status-bg);
  color: var(--delivery-status-color);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.delivery-status-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.delivery-status-detail {
  max-width: 280px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.delivery-status--awaiting-payment,
.delivery-status--label-pending-release {
  --delivery-status-bg: #fff7ed;
  --delivery-status-border: #fed7aa;
  --delivery-status-color: #c2410c;
}

.delivery-status--ready-label,
.delivery-status--ready-shipment,
.delivery-status--ready-in-hand,
.delivery-status--ready-pickup,
.delivery-status--ready-bag,
.delivery-status--ready-courier {
  --delivery-status-bg: #ecfeff;
  --delivery-status-border: #a5f3fc;
  --delivery-status-color: #0e7490;
}

.delivery-status--generating-label,
.delivery-status--ready-to-post {
  --delivery-status-bg: #f5f3ff;
  --delivery-status-border: #ddd6fe;
  --delivery-status-color: #6d28d9;
}

.delivery-status--in-transit {
  --delivery-status-bg: #eff6ff;
  --delivery-status-border: #bfdbfe;
  --delivery-status-color: #1d4ed8;
}

.delivery-status--delivered {
  --delivery-status-bg: #ecfdf3;
  --delivery-status-border: #a7f3d0;
  --delivery-status-color: #047857;
}

.delivery-status--attention,
.delivery-status--cancelled,
.delivery-status--returned,
.delivery-status--payment-review {
  --delivery-status-bg: #fff1f2;
  --delivery-status-border: #fecdd3;
  --delivery-status-color: #be123c;
}

.delivery-status--not-required {
  --delivery-status-bg: #f8fafc;
  --delivery-status-border: #cbd5e1;
  --delivery-status-color: #475569;
}

.asaas-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 9px 14px;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  white-space: nowrap;
}

.asaas-status--success {
  background: #dcfce7;
  color: #166534;
}

.asaas-status--warning {
  background: #ffedd5;
  color: #9a3412;
}

.asaas-status--danger {
  background: #fee2e2;
  color: #991b1b;
}

.asaas-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.order-asaas-overview,
.order-payment-panel {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.98)),
    #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.order-asaas-overview__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.order-payment-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.order-payment-panel__count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 12px;
  font-weight: 800;
}

.order-payment-visual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.order-payment-card {
  display: grid;
  gap: 10px;
  min-height: 150px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-left: 5px solid #94a3b8;
  border-radius: 14px;
  background: #fff;
}

.order-payment-card--paid,
.order-payment-card--success {
  border-color: #bbf7d0;
  border-left-color: #16a34a;
  background: linear-gradient(135deg, #f0fdf4, #ffffff);
}

.order-payment-card--pending,
.order-payment-card--warning {
  border-color: #fde68a;
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb, #ffffff);
}

.order-payment-card--danger {
  border-color: #fecdd3;
  border-left-color: #e11d48;
  background: linear-gradient(135deg, #fff1f2, #ffffff);
}

.order-payment-card__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.order-payment-card__source {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.order-payment-card__status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: #f1f5f9;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.order-payment-card--paid .order-payment-card__status,
.order-payment-card--success .order-payment-card__status,
.order-payment-card__chip.order-payment-card__chip--paid,
.order-payment-card__chip.order-payment-card__chip--success {
  background: #dcfce7;
  color: #166534;
}

.order-payment-card--pending .order-payment-card__status,
.order-payment-card--warning .order-payment-card__status,
.order-payment-card__chip.order-payment-card__chip--pending,
.order-payment-card__chip.order-payment-card__chip--warning {
  background: #fef3c7;
  color: #92400e;
}

.order-payment-card--danger .order-payment-card__status,
.order-payment-card__chip.order-payment-card__chip--danger {
  background: #fee2e2;
  color: #991b1b;
}

.order-payment-card__amount {
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
}

.order-payment-card__details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.order-payment-card__chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.order-payment-card__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

/* Tabelas interativas */
.table-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.table-tools input[type="search"] {
  min-width: 220px;
  max-width: 360px;
}

.filters-row input[type="search"],
.filters-row select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  background: #f8fafc;
}

th[data-sort-key] {
  cursor: pointer;
  position: relative;
}

.table-header-content {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.table-header-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

th[data-sort-key] .table-header-label::after {
  content: '↕';
  font-size: 12px;
  color: #94a3b8;
}

th.sorted-asc .table-header-label::after { content: '↑'; color: var(--accent); }
th.sorted-desc .table-header-label::after { content: '↓'; color: var(--accent); }

.table-multiselect-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  padding: 2px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.table-multiselect-trigger svg {
  width: 14px;
  height: 14px;
}

.table-multiselect-trigger:hover {
  background: #e2e8f0;
}

.table-multiselect-trigger.is-active {
  border-color: var(--accent);
  background: rgba(63, 124, 255, 0.12);
  color: var(--accent);
}

.table-multiselect-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 240px;
  max-width: 340px;
  max-height: 360px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.18);
  z-index: 30;
  display: none;
}

.table-multiselect-panel[data-open="true"] {
  display: block;
}

.table-multiselect-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.table-multiselect-title {
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
}

.table-multiselect-close {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #0f172a;
}

.table-multiselect-close svg {
  width: 16px;
  height: 16px;
}

.table-multiselect-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.table-multiselect-actions button {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.table-multiselect-actions button:hover {
  background: #e2e8f0;
}

.table-multiselect-search {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 13px;
  margin-bottom: 8px;
}

.table-multiselect-options {
  max-height: 200px;
  overflow: auto;
  display: grid;
  gap: 6px;
  padding-right: 2px;
}

.table-multiselect-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #0f172a;
}

.table-multiselect-options small {
  color: var(--muted);
}

.table-multiselect-empty {
  font-size: 13px;
  color: var(--muted);
}

.table-multiselect-footer {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.no-results {
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

.table-scroll {
  width: 100%;
}

.table-scroll-top {
  overflow-x: scroll;
  overflow-y: hidden;
  height: 12px;
  margin-bottom: 8px;
  scrollbar-gutter: stable both-edges;
}

.table-scroll-top-inner {
  height: 1px;
}

.table-scroll-body {
  overflow-x: scroll;
  overflow-y: visible;
  scrollbar-gutter: stable both-edges;
}

table[data-table="interactive"] {
  min-width: 100%;
  width: max-content;
}

table[data-table="interactive"] th,
table[data-table="interactive"] td {
  white-space: nowrap;
}

table[data-table="interactive"] tbody tr[data-row-href],
table tbody tr[data-row-href] {
  cursor: pointer;
}

table[data-table="interactive"] tbody tr[data-row-href]:hover,
table tbody tr[data-row-href]:hover {
  background: #f8fafc;
}

table[data-table="interactive"] tbody tr[data-row-href]:focus,
table tbody tr[data-row-href]:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

@media (max-width: 820px) {
  .table-scroll {
    width: 100%;
  }

  .table-scroll-top {
    display: none;
  }

  .table-scroll-body {
    overflow-x: visible;
  }

  table[data-table="interactive"].is-mobile-ready {
    display: block;
    width: 100% !important;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  table[data-table="interactive"].is-mobile-ready colgroup {
    display: none;
  }

  table[data-table="interactive"].is-mobile-ready thead,
  table[data-table="interactive"].is-mobile-ready tbody {
    display: block;
    width: 100%;
  }

  table[data-table="interactive"].is-mobile-ready thead tr:not(.filters-row) {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 10px;
    margin-bottom: 10px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  table[data-table="interactive"].is-mobile-ready thead tr:not(.filters-row) th {
    flex: 0 0 auto;
    width: auto !important;
    min-width: 0 !important;
    max-width: min(72vw, 240px) !important;
    padding: 7px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    white-space: nowrap;
    text-transform: none;
    letter-spacing: 0;
  }

  table[data-table="interactive"].is-mobile-ready thead tr.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    padding: 10px;
    margin: 0 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
  }

  table[data-table="interactive"].is-mobile-ready thead tr.filters-row th {
    display: block;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0;
    border: 0;
    background: transparent;
    white-space: normal;
  }

  table[data-table="interactive"].is-mobile-ready tbody {
    display: grid;
    gap: 10px;
  }

  table[data-table="interactive"].is-mobile-ready tbody tr {
    display: grid;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
  }

  table[data-table="interactive"].is-mobile-ready tbody tr:hover {
    background: #fff;
  }

  table[data-table="interactive"].is-mobile-ready tbody td {
    display: grid;
    grid-template-columns: minmax(86px, 36%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 8px 0;
    border-bottom: 1px solid #eef2f7;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  table[data-table="interactive"].is-mobile-ready tbody td:last-child {
    border-bottom: 0;
  }

  table[data-table="interactive"].is-mobile-ready tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.25;
    text-transform: uppercase;
  }

  table[data-table="interactive"].is-mobile-ready tbody td[data-label=""],
  table[data-table="interactive"].is-mobile-ready tbody td:not([data-label]) {
    grid-template-columns: 1fr;
  }

  table[data-table="interactive"].is-mobile-ready tbody td[data-label=""]::before,
  table[data-table="interactive"].is-mobile-ready tbody td:not([data-label])::before {
    content: none;
  }

  table[data-table="interactive"].is-mobile-ready .cell-truncate {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  table[data-table="interactive"].is-mobile-ready .col-actions,
  table[data-table="interactive"].is-mobile-ready td.col-actions {
    width: auto;
    white-space: normal;
  }

  table[data-table="interactive"].is-mobile-ready .table-resize-handle {
    display: none;
  }

  .table-multiselect-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: calc(12px + env(safe-area-inset-bottom));
    min-width: 0;
    max-width: none;
    max-height: min(70vh, 420px);
    z-index: 1300;
  }

  table:not([data-table="interactive"]) {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.profiles-table {
  width: 100%;
  table-layout: fixed;
}

.profiles-table th,
.profiles-table td {
  white-space: normal;
  vertical-align: top;
}

.profiles-table .col-id { width: 70px; }
.profiles-table .col-name { width: 22%; }
.profiles-table .col-status { width: 120px; }
.profiles-table .col-actions { width: 160px; white-space: nowrap; }

.profiles-table .permissions-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.profiles-table .permissions-details {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px 10px;
  background: #f8fafc;
}

.profiles-table .permissions-details summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 600;
  color: #0f172a;
}

.profiles-table .permissions-details summary::-webkit-details-marker {
  display: none;
}

.profiles-table .permissions-details summary::marker {
  content: '';
}

.profiles-table .permissions-summary {
  font-size: 13px;
}

.profiles-table .permissions-summary-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.profiles-table .permissions-summary-count {
  background: #e2e8f0;
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 600;
  color: #0f172a;
}

.profiles-table .permissions-toggle {
  background: #e2e8f0;
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 600;
  color: #0f172a;
}

.profiles-table .permissions-details[open] .permissions-toggle--closed,
.profiles-table .permissions-details:not([open]) .permissions-toggle--open {
  display: none;
}

.profiles-table .permissions-details[open] .permissions-summary {
  color: #1e3a8a;
}

.profiles-table .permissions-details .permissions-list {
  margin-top: 8px;
}

.profiles-table .permissions-item {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.profiles-table .permissions-label {
  background: #f1f5f9;
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 600;
  font-size: 12px;
  color: #0f172a;
}

.profiles-table .permissions-actions {
  font-size: 13px;
  color: var(--muted);
  word-break: break-word;
}

.products-list-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.products-list-title h1 {
  margin: 0;
}

.products-list-filterbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}

.products-list-search {
  min-width: min(320px, 100%);
}

.products-list-supplier-picker {
  min-width: min(260px, 100%);
}

.products-list-supplier-picker .products-list-supplier-filter {
  width: 100%;
}

.products-list-summary-bar {
  display: none;
}

.products-thumb-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--surface, #f0f0f0);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11px;
}

.products-card-sku,
.products-card-supplier,
.products-card-badges,
.products-card-open {
  display: none;
}

.products-card-name {
  color: #0f172a;
  font-weight: 700;
}

.table-resizable {
  position: relative;
  padding-right: 18px;
}

.table-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.table-resize-handle::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 20%;
  width: 2px;
  height: 60%;
  background: rgba(148, 163, 184, 0.6);
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.table-resizable:hover .table-resize-handle::after,
.table-resizing .table-resize-handle::after {
  opacity: 1;
}

body.table-resizing {
  cursor: col-resize;
  user-select: none;
}

.products-table th.col-sku,
.products-table td.col-sku {
  width: 90px;
}

.products-table th.col-thumb,
.products-table td.col-thumb {
  width: 64px;
  min-width: 64px;
}

.products-table th.col-name,
.products-table td.col-name {
  width: 34%;
  min-width: 220px;
}

.products-table th.col-price,
.products-table td.col-price {
  min-width: 110px;
}

.products-table th.col-status,
.products-table td.col-status {
  min-width: 140px;
}

.products-table th.col-supplier,
.products-table td.col-supplier {
  min-width: 160px;
}

.products-table th.col-source,
.products-table td.col-source {
  min-width: 120px;
}

.products-table th.col-actions,
.products-table td.col-actions {
  min-width: 210px;
}

.products-card-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}

.products-card-badge--source {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.products-card-badge--status {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.products-card-badge--status-disponivel {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.products-card-badge--status-reservado {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.products-card-badge--status-esgotado,
.products-card-badge--status-baixado,
.products-card-badge--status-archived {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

.products-card-badge--visibility {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.products-card-badge--qty {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #e2e8f0;
}

@media (min-width: 821px) {
  .products-table {
    table-layout: fixed;
    width: 100%;
  }

  .products-table th,
  .products-table td {
    padding: 7px 8px;
    font-size: 13px;
    vertical-align: middle;
  }

  .products-table th.col-sku,
  .products-table td.col-sku,
  .products-table th.col-brand,
  .products-table td.col-brand,
  .products-table th.col-category,
  .products-table td.col-category,
  .products-table th.col-qty,
  .products-table td.col-qty,
  .products-table th.col-source,
  .products-table td.col-source,
  .products-table th.col-supplier,
  .products-table td.col-supplier,
  .products-table th.col-status,
  .products-table td.col-status,
  .products-table th.col-visibility,
  .products-table td.col-visibility {
    display: none;
  }

  .products-table th.col-thumb,
  .products-table td.col-thumb {
    width: 58px;
    min-width: 58px;
  }

  .products-table th.col-name,
  .products-table td.col-name {
    width: auto;
    min-width: 260px;
  }

  .products-table th.col-price,
  .products-table td.col-price {
    width: 118px;
    min-width: 118px;
  }

  .products-table th.col-actions,
  .products-table td.col-actions {
    width: 150px;
    min-width: 150px;
  }

  .products-table .products-cell-name {
    display: grid;
    gap: 3px;
  }

  .products-table .products-card-sku,
  .products-table .products-card-supplier,
  .products-table .products-card-badges {
    display: flex;
  }

  .products-table .products-card-sku,
  .products-table .products-card-supplier {
    color: #64748b;
    font-size: 11px;
    line-height: 1.15;
  }

  .products-table .products-card-name {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    font-size: 13px;
    line-height: 1.16;
  }

  .products-table .products-card-badges {
    flex-wrap: nowrap;
    gap: 3px;
    max-width: 100%;
    overflow: hidden;
  }

  .products-table .products-card-badge {
    min-height: 18px;
    padding: 1px 6px;
    font-size: 10px;
    line-height: 1.1;
  }

  .products-table .products-cell-price {
    color: #0f172a;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
  }

  .products-table .products-cell-actions > .actions {
    display: flex !important;
    flex-wrap: nowrap;
    gap: 5px;
    justify-content: flex-end;
  }
}

@media (max-width: 820px) {
  .products-list-page-header {
    align-items: center;
    flex-wrap: nowrap;
    margin-bottom: 14px;
  }

  .products-list-title h1 {
    font-size: 30px;
    line-height: 1.1;
  }

  .products-list-title .subtitle {
    display: none;
  }

  .products-list-create {
    width: 48px;
    height: 48px;
    min-height: 48px;
    padding: 0;
    border-radius: 999px;
    font-size: 0;
    flex: 0 0 auto;
  }

  .products-list-create::before {
    content: '+';
    font-size: 34px;
    font-weight: 400;
    line-height: 1;
  }

  .products-list-tools {
    gap: 10px;
    margin-bottom: 0;
  }

  .products-list-filterbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }

  .products-list-search {
    grid-column: 1 / -1;
    min-width: 0 !important;
    min-height: 50px;
    padding-left: 16px;
    border-radius: 13px;
    font-size: 16px;
  }

  .products-list-filterbar select {
    min-width: 0 !important;
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
  }

  .products-list-supplier-picker {
    grid-column: 1 / -1;
    min-width: 0 !important;
    width: 100%;
  }

  .products-list-supplier-picker .products-list-supplier-filter {
    min-height: 44px;
    border-radius: 12px;
  }

  .products-list-sort-hint {
    display: none;
  }

  .products-list-tools > form {
    display: grid !important;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .products-list-tools > form label,
  .products-list-tools > form > span {
    display: none;
  }

  .products-list-tools > form select {
    width: 100%;
    min-height: 44px;
  }

  .products-list-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px -12px 0;
    padding: 12px;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 15px;
  }

  .products-list-summary-bar strong {
    color: #334155;
  }

  .products-list-refresh {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #2563eb;
    font-weight: 800;
    text-decoration: none;
  }

  .products-list-refresh svg {
    width: 22px;
    height: 22px;
  }

  .products-table.is-mobile-ready {
    width: 100% !important;
  }

  .products-table.is-mobile-ready thead {
    display: none !important;
  }

  .products-table.is-mobile-ready tbody {
    gap: 0;
  }

  .products-table.is-mobile-ready tbody tr:not(.no-results) {
    position: relative;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) minmax(92px, auto);
    grid-template-areas:
      "thumb name price"
      "thumb name actions";
    gap: 6px 12px;
    min-height: 96px;
    padding: 12px 36px 12px 12px;
    border: 0;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }

  .products-table.is-mobile-ready tbody tr:not(.no-results):hover,
  .products-table.is-mobile-ready tbody tr:not(.no-results):active {
    background: #f8fafc;
  }

  .products-table.is-mobile-ready tbody tr:not(.no-results) > td {
    display: block;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0;
    border-bottom: 0;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  .products-table.is-mobile-ready tbody tr:not(.no-results) > td::before {
    content: none;
  }

  .products-table.is-mobile-ready .products-cell-thumb {
    grid-area: thumb;
    align-self: center;
  }

  .products-table.is-mobile-ready .thumb-rotate-wrap,
  .products-table.is-mobile-ready .products-thumb-placeholder {
    width: 68px;
    height: 68px;
    border-radius: 9px;
  }

  .products-table.is-mobile-ready .thumb-rotate-wrap img {
    width: 100%;
    height: 100%;
  }

  .products-table.is-mobile-ready .thumb-rotate-btn {
    width: 26px;
    height: 26px;
  }

  .products-table.is-mobile-ready .products-cell-name {
    grid-area: name;
    display: grid;
    align-content: center;
    gap: 4px;
  }

  .products-table.is-mobile-ready .products-card-sku,
  .products-table.is-mobile-ready .products-card-supplier,
  .products-table.is-mobile-ready .products-card-badges {
    display: flex;
  }

  .products-table.is-mobile-ready .products-card-sku {
    color: #64748b;
    font-size: 14px;
    line-height: 1.2;
  }

  .products-table.is-mobile-ready .products-card-name {
    display: -webkit-box;
    color: #0f172a;
    font-size: 15px;
    font-weight: 850;
    line-height: 1.2;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .products-table.is-mobile-ready .products-card-supplier {
    color: #64748b;
    font-size: 13px;
    line-height: 1.2;
  }

  .products-table.is-mobile-ready .products-card-badges {
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 2px;
  }

  .products-table.is-mobile-ready .products-card-badge {
    min-height: 23px;
    padding: 2px 8px;
    font-size: 12px;
  }

  .products-table.is-mobile-ready .products-cell-price {
    grid-area: price;
    justify-self: end;
    color: #0f172a;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.15;
    text-align: right;
    white-space: nowrap !important;
  }

  .products-table.is-mobile-ready .products-cell-actions {
    grid-area: actions;
    justify-self: end;
    align-self: end;
  }

  .products-table.is-mobile-ready .products-card-open {
    position: absolute;
    top: 50%;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 40px;
    color: #64748b;
    text-decoration: none;
    transform: translateY(-50%);
  }

  .products-table.is-mobile-ready .products-card-open svg {
    width: 24px;
    height: 24px;
  }

  .products-table.is-mobile-ready .products-cell-actions > .actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end;
    gap: 6px;
  }

  .products-table.is-mobile-ready .products-cell-actions > .actions > *,
  .products-table.is-mobile-ready .products-cell-actions > .actions form {
    width: auto !important;
  }

  .products-table.is-mobile-ready .products-cell-actions > .actions button,
  .products-table.is-mobile-ready .products-cell-actions > .actions .btn,
  .products-table.is-mobile-ready .products-cell-actions > .actions input[type="submit"] {
    width: 34px !important;
    min-width: 34px;
    min-height: 34px !important;
    padding: 0;
  }

  .products-table.is-mobile-ready .products-cell-sku,
  .products-table.is-mobile-ready .col-brand,
  .products-table.is-mobile-ready .col-category,
  .products-table.is-mobile-ready .col-qty,
  .products-table.is-mobile-ready .col-source,
  .products-table.is-mobile-ready .col-supplier,
  .products-table.is-mobile-ready .col-status,
  .products-table.is-mobile-ready .col-visibility {
    display: none !important;
  }
}

@media (max-width: 430px) {
  .products-table.is-mobile-ready tbody tr:not(.no-results) {
    grid-template-columns: 66px minmax(0, 1fr) minmax(82px, auto);
    gap: 5px 10px;
    padding: 11px 32px 11px 10px;
  }

  .products-table.is-mobile-ready .thumb-rotate-wrap,
  .products-table.is-mobile-ready .products-thumb-placeholder {
    width: 60px;
    height: 60px;
  }

  .products-table.is-mobile-ready .products-card-name {
    font-size: 14px;
  }

  .products-table.is-mobile-ready .products-cell-price {
    font-size: 16px;
  }

  .products-card-badge--source,
  .products-card-badge--visibility {
    max-width: 118px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.orders-list-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.orders-list-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.orders-list-title h1 {
  margin: 0;
}

.orders-list-title__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #eff6ff;
  color: #2563eb;
  flex: 0 0 auto;
}

.orders-list-title__icon svg {
  width: 24px;
  height: 24px;
}

.orders-list-page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.orders-status-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  margin: 12px 0 16px;
  padding: 3px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.orders-status-tabs::-webkit-scrollbar {
  display: none;
}

.orders-status-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 18px;
  border-radius: 999px;
  color: #1e293b;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.orders-status-tab:hover {
  background: #f8fafc;
}

.orders-status-tab.is-active {
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px #93c5fd;
}

.orders-status-tab__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  line-height: 1;
}

.orders-card-meta,
.orders-card-open {
  display: none;
}

.orders-card-order-number {
  font-weight: 900;
  color: #0f172a;
}

.orders-card-customer-name {
  display: inline-block;
  max-width: 100%;
  color: #1e293b;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.orders-card-pending {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.orders-card-pending__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid #fbbf24;
  background: #fffbeb;
  color: #b45309;
  flex: 0 0 auto;
}

.orders-card-pending__icon svg {
  width: 16px;
  height: 16px;
}

.orders-card-total-value {
  font-weight: 900;
  color: #0f172a;
}

.orders-table th.col-order,
.orders-table td.col-order {
  width: 90px;
  min-width: 90px;
}

.orders-table th.col-uf,
.orders-table td.col-uf {
  width: 60px;
  min-width: 60px;
}

.orders-table th.col-origin,
.orders-table td.col-origin {
  width: 120px;
  min-width: 120px;
}

.order-origin-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.order-origin-tag svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.order-origin-tag--site {
  border-color: #93c5fd;
  background: #dbeafe;
  color: #1d4ed8;
}

.orders-table th.col-status-flow,
.orders-table td.col-status-flow {
  width: 320px;
  min-width: 300px;
}

.orders-table th.col-total,
.orders-table td.col-total {
  width: 110px;
  min-width: 110px;
}

.orders-table th.col-balance,
.orders-table td.col-balance {
  width: 108px;
  min-width: 108px;
}

@media (min-width: 821px) {
  .orders-table {
    table-layout: fixed;
  }

  .orders-table th,
  .orders-table td {
    padding: 7px 8px;
    font-size: 13px;
    vertical-align: middle;
  }

  .orders-table th.col-order,
  .orders-table td.col-order {
    width: 72px;
    min-width: 72px;
  }

  .orders-table th.col-uf,
  .orders-table td.col-uf,
  .orders-table th.col-origin,
  .orders-table td.col-origin,
  .orders-table th.col-items,
  .orders-table td.col-items {
    display: none;
  }

  .orders-table th.col-status-flow,
  .orders-table td.col-status-flow {
    width: 270px;
    min-width: 270px;
  }

  .orders-table th.col-total,
  .orders-table td.col-total,
  .orders-table th.col-balance,
  .orders-table td.col-balance {
    width: 96px;
    min-width: 96px;
  }

  .orders-table th.col-actions,
  .orders-table td.col-actions {
    width: 132px;
    min-width: 132px;
  }

  .orders-card-customer-name {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }

  .orders-card-meta {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .orders-card-order-status-label,
  .orders-card-total-value {
    font-size: 13px;
    line-height: 1.12;
  }

  .orders-table .order-unified-status {
    gap: 5px;
  }

  .orders-table .order-unified-status__line {
    gap: 5px;
    min-height: 24px;
    padding: 3px 6px;
    border-radius: 7px;
  }

  .orders-table .order-payment-status {
    padding: 2px 7px;
    font-size: 10.5px;
    line-height: 1.1;
  }

  .orders-table .order-unified-status__method {
    max-width: 78px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.orders-table__status-filters {
  display: grid;
  gap: 8px;
}

.orders-table__status-filter-field {
  display: grid;
  gap: 4px;
}

.orders-table__status-filter-field > span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
}

.orders-table__status-filter-field > input {
  width: 100%;
}

.orders-table tbody tr {
  position: relative;
}

.order-items-preview {
  display: none;
  box-sizing: border-box;
  position: fixed;
  top: var(--order-items-preview-top, 0);
  left: var(--order-items-preview-left, 16px);
  width: min(820px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: var(--order-items-preview-max-height, calc(100vh - 32px));
  overflow-y: auto;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
  z-index: 5;
  white-space: normal;
}

.orders-table tbody tr:hover .order-items-preview,
.orders-table tbody tr:focus-within .order-items-preview,
.orders-table tbody tr.is-preview-open .order-items-preview {
  display: block;
}

.order-items-preview__title {
  font-weight: 700;
  margin-bottom: 8px;
  color: #0f172a;
}

.order-items-preview__list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.order-items-preview__item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(96px, auto);
  gap: 8px;
  align-items: start;
  padding: 8px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px dashed #e2e8f0;
}

.order-items-preview__item-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  white-space: normal;
}

.order-items-preview__item-name {
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
  word-break: break-word;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.order-items-preview__item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: normal;
}

.order-items-preview__chip {
  background: #e2e8f0;
  border-radius: 999px;
  padding: 4px 8px;
  color: #475569;
  font-weight: 600;
  font-size: 11px;
  white-space: nowrap;
}

.order-items-preview__item-price {
  text-align: right;
  display: grid;
  gap: 4px;
  white-space: nowrap;
  min-width: 96px;
  align-content: start;
}

.order-items-preview__item-unit {
  font-weight: 700;
}

.order-items-preview__item-total {
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .order-items-preview {
    width: min(560px, calc(100% - 16px));
    padding: 10px;
  }

  .order-items-preview__list {
    grid-template-columns: 1fr;
  }

  .order-items-preview__item {
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-areas:
      "thumb main"
      "price price";
    align-items: start;
    gap: 8px;
  }

  .order-items-preview__thumb {
    grid-area: thumb;
    width: 52px;
    height: 52px;
  }

  .order-items-preview__item-main {
    grid-area: main;
    gap: 6px;
  }

  .order-items-preview__item-price {
    grid-area: price;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    white-space: normal;
    border-top: 1px dashed #dbe3ee;
    padding-top: 6px;
  }
}

@media (max-width: 820px) {
  .orders-list-page-header {
    align-items: flex-start;
    gap: 10px;
  }

  .orders-list-title {
    gap: 10px;
  }

  .orders-list-title h1 {
    font-size: 24px;
    line-height: 1.15;
  }

  .orders-list-title .subtitle {
    display: none;
  }

  .orders-list-title__icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .orders-list-page-actions {
    margin-left: auto;
  }

  .orders-status-tabs {
    width: 100%;
    margin: 10px 0 14px;
    padding: 4px;
  }

  .orders-status-tab {
    flex: 1 0 auto;
    min-height: 42px;
    padding: 9px 12px;
    font-size: 14px;
  }

  .orders-status-tab__badge {
    min-width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .orders-table.is-mobile-ready {
    width: 100% !important;
  }

  .orders-table.is-mobile-ready thead {
    display: none !important;
  }

  .orders-table.is-mobile-ready tbody {
    gap: 12px;
  }

  .orders-table.is-mobile-ready tbody tr:not(.no-results) {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(104px, auto);
    grid-template-areas:
      "order date"
      "customer total"
      "pending pending"
      "flow flow"
      "actions actions";
    gap: 7px 12px;
    padding: 14px 46px 14px 14px;
    border-color: #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.06);
  }

  .orders-table.is-mobile-ready tbody tr:not(.no-results):active {
    background: #f8fafc;
  }

  .orders-table.is-mobile-ready tbody tr:not(.no-results) > td {
    display: block;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0;
    border-bottom: 0;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  .orders-table.is-mobile-ready tbody tr:not(.no-results) > td::before {
    content: none;
  }

  .orders-table.is-mobile-ready .orders-cell-order {
    grid-area: order;
    align-self: start;
    font-size: 20px;
    line-height: 1.1;
  }

  .orders-table.is-mobile-ready .orders-cell-customer {
    grid-area: customer;
    display: grid;
    gap: 4px;
  }

  .orders-table.is-mobile-ready .orders-card-customer-name {
    font-size: 15px;
    line-height: 1.25;
  }

  .orders-table.is-mobile-ready .orders-card-meta {
    display: block;
    color: #475569;
    font-size: 13px;
    line-height: 1.3;
  }

  .orders-table.is-mobile-ready .orders-cell-date {
    grid-area: date;
    color: #64748b;
    font-size: 14px;
    line-height: 1.25;
    text-align: right;
    white-space: nowrap !important;
  }

  .orders-table.is-mobile-ready .orders-cell-total {
    grid-area: total;
    align-self: start;
    text-align: right;
    font-size: 19px;
    line-height: 1.15;
    white-space: nowrap !important;
  }

  .orders-table.is-mobile-ready .orders-cell-order-status {
    grid-area: pending;
    min-height: 30px;
  }

  .orders-table.is-mobile-ready .orders-card-order-status-label {
    display: none;
  }

  .orders-table.is-mobile-ready .orders-card-pending {
    margin-top: 2px;
    color: #475569;
    font-size: 14px;
  }

  .orders-table.is-mobile-ready .order-status-icons {
    margin-top: 6px;
  }

  .orders-table.is-mobile-ready .orders-cell-flow {
    grid-area: flow;
    margin-top: 4px;
  }

  .orders-table.is-mobile-ready .order-unified-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .orders-table.is-mobile-ready .order-unified-status__line {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px 7px;
    align-items: center;
    min-width: min(148px, 100%);
    padding: 8px 10px;
    border-radius: 11px;
  }

  .orders-table.is-mobile-ready .order-unified-status__label {
    min-width: 0;
    font-size: 11px;
    line-height: 1.15;
    letter-spacing: 0;
    text-transform: none;
  }

  .orders-table.is-mobile-ready .order-payment-status {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
  }

  .orders-table.is-mobile-ready .order-inline-status-btn {
    min-height: 0;
    text-align: left;
    box-shadow: none;
  }

  .orders-table.is-mobile-ready .order-unified-status__method {
    display: none;
  }

  .orders-table.is-mobile-ready .col-uf,
  .orders-table.is-mobile-ready .col-origin,
  .orders-table.is-mobile-ready .orders-cell-balance,
  .orders-table.is-mobile-ready .orders-cell-items {
    display: none !important;
  }

  .orders-table.is-mobile-ready .orders-cell-actions {
    grid-area: actions;
    min-height: 0;
  }

  .orders-table.is-mobile-ready .orders-card-open {
    position: absolute;
    top: 50%;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 40px;
    color: #0f172a;
    text-decoration: none;
    transform: translateY(-50%);
  }

  .orders-table.is-mobile-ready .orders-card-open svg {
    width: 24px;
    height: 24px;
  }

  .orders-table.is-mobile-ready .orders-cell-actions > .actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 8px;
  }

  .orders-table.is-mobile-ready .orders-cell-actions > .actions:empty {
    display: none !important;
  }

  .orders-table.is-mobile-ready .orders-cell-actions > .actions > *,
  .orders-table.is-mobile-ready .orders-cell-actions > .actions form {
    width: auto !important;
  }

  .orders-table.is-mobile-ready .orders-cell-actions > .actions button,
  .orders-table.is-mobile-ready .orders-cell-actions > .actions .btn,
  .orders-table.is-mobile-ready .orders-cell-actions > .actions input[type="submit"] {
    width: 36px !important;
    min-width: 36px;
    min-height: 36px !important;
    padding: 0;
  }

  .orders-table.is-mobile-ready .order-items-preview {
    position: static;
    width: 100%;
    max-width: 100%;
    margin-top: 12px;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  }

  .orders-table.is-mobile-ready .order-items-preview__title {
    font-size: 13px;
  }

  .orders-table.is-mobile-ready .order-items-preview__list {
    grid-template-columns: 1fr;
  }

  .orders-table.is-mobile-ready .order-items-preview__item {
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-areas:
      "thumb main"
      "price price";
  }

  .orders-table.is-mobile-ready .order-items-preview__item-price {
    grid-area: price;
    display: flex;
    justify-content: space-between;
    text-align: left;
    white-space: normal;
  }
}

@media (max-width: 430px) {
  .orders-list-page-header {
    flex-wrap: nowrap;
  }

  .orders-list-page-actions .btn {
    min-height: 38px;
    padding: 9px 11px;
    font-size: 13px;
  }

  .orders-status-tab {
    padding: 8px 10px;
    font-size: 13px;
  }

  .orders-table.is-mobile-ready tbody tr:not(.no-results) {
    grid-template-columns: minmax(0, 1fr) minmax(90px, auto);
    padding: 13px 42px 13px 12px;
  }

  .orders-table.is-mobile-ready .orders-cell-order {
    font-size: 19px;
  }

  .orders-table.is-mobile-ready .orders-cell-total {
    font-size: 18px;
  }

  .orders-table.is-mobile-ready .order-unified-status__line {
    flex: 1 1 130px;
    min-width: 0;
  }
}

.alert.muted {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: var(--muted);
}

.product-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-form__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.product-form__title .subtitle {
  margin-bottom: 6px;
}

.product-form__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

.product-form__pill {
  font-size: 12px;
  opacity: 0.8;
}

.product-form__sku-retry-btn {
  white-space: nowrap;
}

.product-form__sku-retry-status {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--muted);
}

.product-form__sku-retry-status[data-state="loading"] {
  color: #1d4ed8;
}

.product-form__sku-retry-status[data-state="success"] {
  color: #166534;
}

.product-form__sku-retry-status[data-state="warning"] {
  color: #9a3412;
}

.product-form__sku-retry-status[data-state="error"] {
  color: #b91c1c;
}

.product-form__section--stacked {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-form__grid--sourcing {
  display: grid;
  grid-template-columns:
    minmax(150px, 0.8fr)
    minmax(220px, 1.2fr)
    minmax(290px, 1.55fr)
    minmax(250px, 1.25fr);
  gap: 16px;
  align-items: flex-start;
}

.product-form__grid--sourcing > .field {
  min-width: 0;
}

.product-form__entry-invoice {
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid #d7dee8;
  border-radius: 10px;
  background: #fff;
}

.product-form__entry-invoice-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.product-form__entry-invoice-value {
  display: block;
  margin-top: 4px;
  color: #9b2c2c;
  font-size: 16px;
  font-weight: 800;
}

.product-form__entry-invoice[data-entry-invoice-state="authorized"] {
  border-color: #a9d8bb;
  background: #f2fbf5;
}

.product-form__entry-invoice[data-entry-invoice-state="authorized"] .product-form__entry-invoice-value {
  color: #17603a;
}

.product-form__entry-invoice[data-entry-invoice-state="unavailable"] {
  border-color: #e8c979;
  background: #fff9e8;
}

.product-form__entry-invoice[data-entry-invoice-state="unavailable"] .product-form__entry-invoice-value {
  color: #7a5200;
  font-size: 14px;
}

.product-form__entry-invoice small {
  display: block;
  margin-top: 4px;
  line-height: 1.35;
}

.product-form__entry-invoice a {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .product-form__entry-invoice {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }
}

.product-form__section--summary {
  padding-bottom: 12px;
}

.product-form__section--summary .product-form__summary-card {
  margin-top: 0;
}

.field--compact {
  max-width: 280px;
}

.field--compact input,
.field--compact select,
.field--compact textarea {
  width: 100%;
}

/* Publicação em lote: filtros em formato de barra compacta. */
.bulk-filter-card {
  position: relative;
  z-index: 3;
  margin-top: 10px;
  padding: 9px 12px;
  overflow: visible;
}

.bulk-filter-heading,
.bulk-filter-heading-copy,
.bulk-filter-actions,
.bulk-filter-label-row,
.bulk-filter-state-presets {
  display: flex;
  align-items: center;
}

.bulk-filter-heading {
  justify-content: space-between;
  gap: 10px;
}

.bulk-filter-heading-copy {
  min-width: 0;
  gap: 8px;
}

.bulk-filter-heading h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

.bulk-filter-heading-copy .muted {
  font-size: 11.5px;
  line-height: 1.2;
}

.bulk-filter-shortcut {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11.5px;
}

.bulk-filter-grid {
  display: grid;
  grid-template-columns:
    minmax(130px, 0.9fr)
    minmax(130px, 0.9fr)
    minmax(180px, 1.15fr)
    minmax(135px, 0.85fr)
    minmax(180px, 1.15fr)
    auto;
  align-items: end;
  gap: 7px;
  margin-top: 7px;
}

.bulk-filter-field {
  position: relative;
  gap: 3px;
}

.bulk-filter-field > label,
.bulk-filter-label-row > label,
.bulk-filter-state-field > label {
  font-size: 11.5px;
  line-height: 1.15;
  white-space: nowrap;
}

.bulk-filter-label-row {
  gap: 2px;
}

.bulk-filter-field > input:not([type="checkbox"]),
.bulk-filter-field > select,
.bulk-filter-state-menu > summary {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafc;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
}

.bulk-filter-state-menu {
  position: relative;
  min-width: 0;
}

.bulk-filter-state-menu > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.bulk-filter-state-menu > summary::-webkit-details-marker {
  display: none;
}

.bulk-filter-state-menu > summary::after {
  content: "▾";
  flex: 0 0 auto;
  color: var(--muted);
}

.bulk-filter-state-menu[open] > summary::after {
  transform: rotate(180deg);
}

.bulk-filter-state-menu > summary:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(63, 124, 255, 0.18);
}

.bulk-filter-state-panel {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 40;
  width: min(620px, calc(100vw - 56px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
}

.bulk-filter-state-panel fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.bulk-filter-state-panel legend {
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 700;
}

.bulk-filter-status-options,
.bulk-filter-status-options label {
  display: flex;
  align-items: center;
}

.bulk-filter-status-options {
  flex-wrap: wrap;
  gap: 7px 14px;
}

.bulk-filter-status-options label {
  gap: 5px;
  margin: 0;
  font-size: 12px;
}

.bulk-filter-state-presets {
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.bulk-filter-state-presets .btn {
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11.5px;
}

.bulk-filter-state-panel small {
  display: block;
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.25;
}

.bulk-filter-help {
  width: 17px;
  height: 17px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
  line-height: 15px;
  vertical-align: middle;
}

.bulk-filter-actions {
  gap: 5px;
}

.bulk-filter-actions .btn,
.bulk-filter-actions button {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .bulk-filter-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .bulk-filter-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 640px) {
  .bulk-filter-card {
    padding: 9px;
  }

  .bulk-filter-heading,
  .bulk-filter-heading-copy {
    align-items: flex-start;
  }

  .bulk-filter-heading-copy {
    flex-direction: column;
    gap: 2px;
  }

  .bulk-filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .bulk-filter-state-panel {
    position: static;
    width: 100%;
    margin-top: 5px;
    box-shadow: none;
  }

  .bulk-filter-actions,
  .bulk-filter-actions .btn,
  .bulk-filter-actions button {
    width: 100%;
  }
}

.product-form__summary-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.product-form__summary-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.product-form__summary-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  color: var(--ink);
}

.product-form__summary-row strong {
  font-size: 15px;
  color: #111827;
}

.product-form__section {
  margin-bottom: 14px;
  padding: 14px 18px;
  border: 1px solid #eef2f7;
  border-radius: 16px;
  background: #fbfdff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-form__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.product-form__label-row label {
  align-items: center;
  min-width: 0;
}

.product-form__label-row .icon-button {
  flex: 0 0 auto;
}

.product-form__section-title {
  margin: 0 0 12px;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.product-form__section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.product-form__sale-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.product-form__sale-actions-label {
  font-size: 13px;
  color: var(--muted);
}

.product-form__sale-quantity {
  width: 80px;
  min-width: 64px;
  height: 34px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #fff;
  font-size: 14px;
  text-align: right;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.product-form__sale-quantity:focus-visible {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(63, 124, 255, 0.2);
}

.product-form__sale-actions button {
  white-space: nowrap;
}

.product-form__section--images {
  border-color: #dbe7f8;
  background: linear-gradient(180deg, #f8fbff 0%, #f4f8ff 100%);
}

.product-form__images-heading {
  display: grid;
  gap: 4px;
}

.product-form__section--images .product-form__section-title {
  margin-bottom: 0;
}

.product-form__images-subtitle {
  margin: 0;
  font-size: 12px;
  color: #475569;
}

.product-form__images {
  display: grid;
  gap: 14px;
}

.product-form__images-upload-card,
.product-form__images-manage {
  border: 1px solid #dbe7f8;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.product-form__images-upload-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-form__images-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dbe7f8;
  border-radius: 999px;
  padding: 4px 10px;
  background: #f8fbff;
  color: #42526a;
  font-size: 11px;
  font-weight: 700;
}

.product-form__images-manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.product-form__images-count {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.product-form__image-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px dashed #dbe4f1;
}

.product-form__image-toolbar .product-form__helper {
  margin: 0;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
}

.image-viewer.is-open {
  display: block;
}

.image-viewer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
}

.image-viewer__panel {
  position: relative;
  margin: 40px auto;
  width: min(980px, 92vw);
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 12px;
  max-height: calc(100vh - 80px);
  overflow: hidden;
}

.image-viewer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.image-viewer__title {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
}

.image-viewer__content {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  align-items: start;
  grid-auto-rows: min-content;
  min-height: 0;
  overflow: auto;
}

.image-viewer__preview {
  background: #0f172a;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  position: relative;
}

.image-viewer__preview canvas {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 12px;
  background: #0f172a;
}

.image-viewer__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e2e8f0;
  font-size: 13px;
}

.image-viewer__controls {
  display: grid;
  gap: 10px;
  font-size: 12px;
}

.image-viewer__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.image-viewer__btn {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #1e293b;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.image-viewer__btn:hover {
  background: #eef2f7;
}

.image-viewer__label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: var(--ink);
}

.image-viewer__label input[type="range"] {
  width: 160px;
}

.image-viewer__toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--ink);
}

.image-viewer__value {
  color: var(--muted);
  font-weight: 600;
}

.image-viewer__note {
  min-height: 18px;
  color: var(--muted);
  font-weight: 600;
}

body.image-viewer-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .image-viewer__content {
    grid-template-columns: 1fr;
  }
  .image-viewer__panel {
    margin: 20px auto;
    max-height: calc(100vh - 40px);
  }
}

.lot-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.lot-field select {
  min-width: 0;
}

.lot-actions {
  display: grid;
  grid-template-columns: repeat(3, 36px);
  gap: 6px;
  flex-shrink: 0;
}

.lot-action-btn {
  border: 1px solid #e3e9f1;
  background: #f6f9fd;
  color: #3c4456;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.lot-action-btn:hover {
  border-color: #cbd6e4;
  background: #eef3fb;
  transform: translateY(-1px);
}

.lot-action-btn--open {
  color: #1f7a4f;
}

.lot-action-btn--close {
  color: #8a2632;
}

.lot-action-btn--cycle {
  color: #8a5b0a;
}

.lot-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.lot-hint[data-status="aberto"] {
  color: #1f7a4f;
}

.lot-hint[data-status="fechado"] {
  color: #8a2632;
}

.product-form label.product-form__checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
}

.product-form label.product-form__checkbox input {
  margin-top: 0;
}

.product-form__images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.product-form__image-card {
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  padding: 12px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  display: grid;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
  min-width: 0;
}

.product-form__image-card:hover,
.product-form__image-card:focus-within {
  transform: translateY(-2px);
  border-color: #bfd3ee;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
}

.product-form__image-card.is-edited::after {
  content: "Editada";
  position: absolute;
  top: 10px;
  left: 10px;
  background: #ecfdf3;
  color: #065f46;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  font-size: 10px;
  padding: 2px 8px;
  font-weight: 700;
}

.product-form__image-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  margin: 0;
  cursor: zoom-in;
  position: relative;
  z-index: 1;
}

.product-form__image-preview-wrap {
  position: relative;
  margin: 0;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(160deg, #f8fafc 0%, #eaf2ff 100%);
  aspect-ratio: 1 / 1;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-form__image-preview-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(45deg, rgba(148, 163, 184, 0.1) 25%, transparent 25%, transparent 75%, rgba(148, 163, 184, 0.1) 75%, rgba(148, 163, 184, 0.1)),
    linear-gradient(45deg, rgba(148, 163, 184, 0.1) 25%, transparent 25%, transparent 75%, rgba(148, 163, 184, 0.1) 75%, rgba(148, 163, 184, 0.1));
  background-size: 18px 18px;
  background-position: 0 0, 9px 9px;
  pointer-events: none;
}

.product-form__image-preview-wrap img {
  transition: transform 0.2s ease, filter 0.15s ease;
}

.product-form__image-card.is-rotatable:hover .product-form__image-preview-wrap img,
.product-form__image-card.is-rotatable:focus-within .product-form__image-preview-wrap img {
  filter: brightness(0.8);
}

.product-form__image-rotate-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px);
  transition: opacity 0.15s ease, transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  backdrop-filter: blur(3px);
}

.product-form__image-rotate-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-form__image-card.is-rotatable:hover .product-form__image-rotate-btn,
.product-form__image-card.is-rotatable:focus-within .product-form__image-rotate-btn {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.product-form__image-card.is-saving .product-form__image-rotate-btn {
  opacity: 1;
  pointer-events: none;
  cursor: wait;
  background: rgba(15, 23, 42, 0.66);
}

.product-form__image-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.product-form__image-label {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  min-height: 30px;
}

.product-form__image-tip {
  font-size: 11px;
  color: #64748b;
}

.product-form__image-actions {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
  color: #334155;
  font-size: 12px;
}

.product-form__image-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  padding: 7px 8px;
  background: #f8fafc;
  font-weight: 700;
  cursor: pointer;
  min-width: 0;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.product-form__image-choice:hover {
  border-color: #c4d5ed;
  background: #f1f5f9;
}

.product-form__image-choice input {
  margin: 0;
}

.product-form__image-choice span {
  display: block;
  white-space: nowrap;
}

.product-form__image-choice:has(input[type="radio"]:checked) {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.product-form__image-choice--danger:has(input[type="checkbox"]:checked) {
  border-color: #fda4af;
  background: #fff1f2;
  color: #b91c1c;
}

@media (hover: none) {
  .product-form__image-rotate-btn {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .product-form__images-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }

  .product-form__image-preview-wrap {
    min-height: 190px;
  }
}

@media (max-width: 640px) {
  .product-form__images-manage-row,
  .product-form__image-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .product-form__images-grid {
    grid-template-columns: 1fr;
  }

  .product-form__image-actions {
    grid-template-columns: 1fr;
  }

  .product-form__image-preview-wrap {
    min-height: 220px;
  }
}

.retrato-toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  display: grid;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.retrato-toast {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  background: #fff;
  color: #1f2937;
  max-width: min(360px, calc(100vw - 32px));
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 1;
  transform: translateY(0);
}

.retrato-toast.success {
  background: #ecfdf3;
  border-color: #86efac;
  color: #166534;
}

.retrato-toast.error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.retrato-toast.info {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e3a8a;
}

.retrato-toast.is-hidden {
  opacity: 0;
  transform: translateY(-8px);
}

@media (max-width: 640px) {
  .retrato-toast-stack {
    left: 12px;
    right: 12px;
    top: 12px;
  }

  .retrato-toast {
    max-width: 100%;
  }
}

.product-table-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  cursor: zoom-in;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.product-table-thumb:hover {
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
  border: 1px solid #d7e2f2;
}

.product-form__inventory {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(120px, 0.8fr) minmax(150px, 1fr) minmax(200px, 1.4fr) minmax(150px, 1fr) minmax(150px, 1fr);
  gap: 10px;
  align-items: end;
}

.product-form__category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.product-form__category-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 6px 8px;
  border: 1px solid #e8eef6;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.product-form__category-item input {
  margin-top: 2px;
}

.product-form__category-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}

.product-form__category-item:has(input:checked) {
  border-color: rgba(63, 124, 255, 0.35);
  background: #f2f6ff;
  box-shadow: 0 10px 18px rgba(63, 124, 255, 0.12);
}

.product-form label {
  font-size: 13px;
  min-height: 28px;
  display: flex;
  align-items: flex-end;
}

.product-form input,
.product-form select,
.product-form textarea {
  background: #f9fbff;
}

.product-form__helper {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.product-form__label-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.product-form__label-row > label {
  min-height: 28px;
}

.product-form__info {
  position: relative;
  display: inline-flex;
  z-index: 5;
}

.product-form__info-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 1px solid #b8c6db;
  border-radius: 50%;
  background: #f7f9fc;
  color: #3b5f96;
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.product-form__info-button:hover,
.product-form__info-button:focus-visible {
  border-color: #7297d0;
  background: #edf3fc;
  outline: 3px solid rgba(36, 91, 219, 0.14);
  outline-offset: 1px;
}

.product-form__info-tooltip {
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  width: min(320px, calc(100vw - 48px));
  padding: 10px 12px;
  border: 1px solid #cbd6e6;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(22, 38, 63, 0.16);
  color: #40516a;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translate(-30%, 5px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.product-form__info:hover .product-form__info-tooltip,
.product-form__info:focus-within .product-form__info-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-30%, 0);
}

.product-form__supplier-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.product-form__supplier-hint[hidden] {
  display: none;
}

.product-orders__list {
  display: grid;
  gap: 12px;
}

.product-orders__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  flex-wrap: wrap;
}

.product-orders__main {
  flex: 1 1 320px;
  display: grid;
  gap: 6px;
}

.product-orders__title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.product-orders__link {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.product-orders__link:hover {
  text-decoration: underline;
}

.product-orders__date {
  font-size: 12px;
  color: var(--muted);
}

.product-orders__meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.product-orders__status {
  flex: 1 1 260px;
  display: grid;
  gap: 6px;
  justify-items: end;
}

.product-orders__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.product-orders__status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
}

.product-orders__status-pill--success {
  background: #dcfce7;
  color: #166534;
}

.product-orders__status-pill--warning {
  background: #fef9c3;
  color: #a16207;
}

.product-orders__status-pill--danger {
  background: #fee2e2;
  color: #b91c1c;
}

.product-orders__status-pill--info {
  background: #dbeafe;
  color: #1d4ed8;
}

.order-status-icon--cancelled {
  background: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
}

@media (max-width: 1200px) {
  .product-form__grid--sourcing {
    grid-template-columns:
      minmax(160px, 1fr)
      minmax(220px, 1.3fr)
      minmax(260px, 1.4fr)
      minmax(220px, 1.2fr);
  }

  .product-form__inventory {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
}

@media (max-width: 900px) {
  .product-form__grid--sourcing {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }

  .product-form__inventory {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

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

  .product-orders__status {
    justify-items: start;
  }

  .product-orders__badges {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .product-form__grid--sourcing {
    grid-template-columns: 1fr;
  }

  .product-form__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .product-form__section {
    padding: 12px;
  }

  .product-form__inventory {
    grid-template-columns: 1fr;
  }

  .product-form__category-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  :root {
    --radius: 24px;
    --shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  }

  body {
    padding: 0;
    min-height: 100dvh;
    background: linear-gradient(160deg, #0ea5e9 0%, #38bdf8 24%, #f8fafc 24%, #f8fafc 100%);
  }

  .layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0;
    min-height: 100dvh;
    padding: calc(64px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right))
      calc(20px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
  }

  .panel {
    border-radius: 26px;
    padding: 18px 16px 24px;
    border: 1px solid rgba(226, 232, 240, 0.7);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.14);
    min-height: calc(100dvh - 92px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  body.nav-collapsed .layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  h1 { font-size: clamp(22px, 7vw, 30px); }
  .subtitle { font-size: 14px; }

  .nav-toggle {
    top: calc(16px + env(safe-area-inset-top));
    left: calc(16px + env(safe-area-inset-left));
    width: 48px;
    height: 48px;
    border-radius: 16px;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.2);
    backdrop-filter: blur(10px);
  }

  body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .nav-user {
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(63, 124, 255, 0.12), rgba(0, 198, 174, 0.12));
  }

  .nav-title {
    font-size: 15px;
    margin-top: 4px;
  }

  .nav a,
  .nav-item--label {
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 15px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
  }

  .nav a:active { transform: scale(0.98); }

  .btn {
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 12px;
    transition: transform 0.12s ease, box-shadow 0.2s ease;
  }

  input, select, textarea {
    font-size: 15px;
    border-radius: 16px;
  }

  .table-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .table-tools input[type="search"] {
    max-width: none;
    min-width: 0;
    width: 100%;
  }

  .footer {
    flex-direction: column;
    align-items: stretch;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions > * { width: 100%; }

  .actions form,
  .footer form,
  .table-tools form,
  .panel-actions form,
  .form-actions form {
    width: 100%;
    min-width: 0;
  }

  .actions .btn,
  .actions button,
  .actions input[type="submit"],
  .footer .btn,
  .footer button,
  .footer input[type="submit"],
  .panel-actions .btn,
  .panel-actions button,
  .form-actions .btn,
  .form-actions button {
    width: 100%;
    min-height: 44px;
  }

  .actions[data-compact-actions] {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .actions[data-compact-actions] > *,
  .actions[data-compact-actions] .btn,
  .actions[data-compact-actions] button {
    width: auto;
    max-width: 100%;
  }

  .card-grid,
  .field-grid,
  .details-grid,
  .summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .row,
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .row > *,
  .grid > *,
  .card-grid > *,
  .field-grid > *,
  .details-grid > *,
  .summary-grid > * {
    min-width: 0;
    max-width: 100%;
    grid-column: 1 / -1;
  }

  .modal {
    align-items: flex-start;
    padding: calc(12px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right))
      calc(12px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
    overflow-y: auto;
  }

  .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: none;
    border-radius: 16px;
  }

  iframe {
    max-width: 100%;
  }

  pre,
  code,
  a,
  p,
  li,
  dd,
  dt {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 640px) {
  .layout {
    padding-left: calc(8px + env(safe-area-inset-left));
    padding-right: calc(8px + env(safe-area-inset-right));
  }

  .panel {
    padding: 14px 12px 22px;
    border-radius: 20px;
  }

  h1,
  h2,
  h3,
  .subtitle,
  .pill,
  code,
  pre {
    overflow-wrap: anywhere;
  }

  pre {
    white-space: pre-wrap;
  }

  .grid,
  .card-grid,
  .field-grid,
  .details-grid,
  .summary-grid,
  form[style*="grid-template-columns"],
  div[style*="grid-template-columns"],
  section[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  .field[style*="min-width"],
  div[style*="min-width"],
  section[style*="min-width"],
  form[style*="min-width"] {
    min-width: 0 !important;
  }

  .table-tools,
  .table-tools > form,
  .table-tools > div,
  .table-tools > label {
    width: 100%;
  }

  .table-tools select,
  .table-tools input:not([type="checkbox"]):not([type="radio"]),
  .table-tools .autocomplete-picker {
    width: 100%;
    min-width: 0 !important;
  }

  .d-flex {
    flex-wrap: wrap;
    gap: 8px;
  }

  .d-flex > * {
    min-width: 0;
  }

  div[style*="overflow:auto"],
  div[style*="overflow: auto"],
  section[style*="overflow:auto"],
  section[style*="overflow: auto"] {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .order-payment-card,
  .order-payment-card__top,
  .order-payment-card__actions,
  .order-payment-panel__head,
  .product-form__label-row,
  .product-form__sale-actions,
  .product-orders__row {
    flex-direction: column;
    align-items: stretch;
  }

  .product-form__label-row {
    flex-direction: row;
    align-items: center;
  }

  .customer-input-row { grid-template-columns: minmax(0, 1fr) 44px; }
  .customer-input-row > .customer-new-btn { grid-column: 1 / -1; justify-self: start; width: auto; }

  .order-payment-card__actions > *,
  .product-form__sale-actions > * {
    width: 100%;
  }

  .order-payment-card {
    grid-template-columns: 1fr;
  }

  .order-payment-amount,
  .order-payment-card__amount,
  .item-price {
    white-space: normal;
  }
}

@media (max-width: 900px) and (prefers-reduced-motion: no-preference) {
  .panel { animation: panel-enter 0.3s ease; }
}

@keyframes panel-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.writeoff-product-preview-card {
  margin-top: 12px;
}

.writeoff-product-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--divider);
  border-radius: 10px;
  background: var(--surface);
}

.writeoff-product-preview__thumb {
  width: 76px;
  height: 76px;
  border-radius: 9px;
  border: 1px solid var(--divider);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}

.writeoff-product-preview__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.writeoff-product-preview__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.writeoff-product-preview__name {
  font-weight: 600;
}

.writeoff-product-preview-empty {
  padding: 14px 12px;
  border: 1px dashed var(--divider);
  border-radius: 10px;
  margin-top: 12px;
  color: var(--muted);
}

.writeoff-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.writeoff-item-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.writeoff-item-row {
  border: 1px solid var(--divider);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--surface);
}

.writeoff-item-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  border: 1px solid var(--divider);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}

.writeoff-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.writeoff-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.writeoff-item-title {
  font-weight: 600;
}

.writeoff-item-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.writeoff-item-fields {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.writeoff-item-actions {
  display: flex;
  justify-content: flex-end;
}

.writeoff-term-links {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.writeoff-term-links li a {
  color: var(--primary);
  font-weight: 500;
}

.customer-engagement-widget {
  display: grid;
  gap: 18px;
}

.customer-engagement-widget .widget-header {
  padding-bottom: 0;
}

.customer-engagement-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.customer-engagement-summary__row {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 16px;
  background: #ffffff;
  cursor: pointer;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  text-align: left;
}

.customer-engagement-summary__row.is-active {
  border-color: #6366f1;
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.15);
  transform: translateY(-2px);
}

.customer-engagement-summary__row:hover {
  border-color: #cbd5f5;
}

.customer-engagement-summary__text {
  min-width: 0;
}

.customer-engagement-summary__text .stat-label {
  font-weight: 600;
}

.customer-engagement-summary__text .muted {
  font-size: 0.85rem;
}

.customer-engagement-list__panel + .customer-engagement-list__panel {
  margin-top: 12px;
}

.customer-engagement-list__panel .muted {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

/* Compactacao mobile transversal */
@media (max-width: 820px) {
  body {
    padding: 6px;
    background: #f8fafc;
  }

  .layout {
    gap: 6px;
    min-height: 100dvh;
    padding: calc(42px + env(safe-area-inset-top)) calc(6px + env(safe-area-inset-right))
      calc(10px + env(safe-area-inset-bottom)) calc(6px + env(safe-area-inset-left));
  }

  .nav-toggle--outside {
    top: calc(5px + env(safe-area-inset-top));
    left: calc(6px + env(safe-area-inset-left));
    width: 34px;
    height: 34px;
    border-radius: 10px;
    box-shadow: none;
  }

  .nav-toggle span {
    width: 16px;
  }

  .panel {
    padding: 10px 8px 16px;
    border-radius: 14px;
    border-color: #e5e7eb;
    box-shadow: none;
    min-height: auto;
  }

  h1 {
    margin-bottom: 2px;
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: 0;
  }

  h2 {
    font-size: 18px;
    line-height: 1.18;
  }

  h3 {
    font-size: 16px;
    line-height: 1.2;
  }

  .subtitle {
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.25;
  }

  .alert {
    margin: 6px 0;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
  }

  .btn,
  button,
  input[type="submit"] {
    min-height: 36px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
  }

  input,
  select,
  textarea {
    min-height: 36px;
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 14px;
  }

  .table-tools {
    gap: 6px;
    margin: 6px 0 8px;
  }

  .table-tools > form {
    gap: 6px !important;
  }

  .table-tools label,
  .table-tools > form > span {
    font-size: 12px !important;
  }

  table[data-table="interactive"].is-mobile-ready thead tr:not(.filters-row) {
    gap: 5px;
    padding: 0 0 6px;
    margin-bottom: 6px;
  }

  table[data-table="interactive"].is-mobile-ready thead tr:not(.filters-row) th {
    padding: 5px 8px;
    font-size: 12px;
  }

  table[data-table="interactive"].is-mobile-ready thead tr.filters-row {
    gap: 6px;
    padding: 7px;
    margin-bottom: 8px;
    border-radius: 10px;
  }

  table[data-table="interactive"].is-mobile-ready tbody {
    gap: 6px;
  }

  table[data-table="interactive"].is-mobile-ready tbody tr {
    padding: 8px 10px;
    border-radius: 10px;
    box-shadow: none;
  }

  table[data-table="interactive"].is-mobile-ready tbody td {
    grid-template-columns: minmax(72px, 34%) minmax(0, 1fr);
    gap: 6px;
    padding: 5px 0;
    font-size: 13px;
  }

  table[data-table="interactive"].is-mobile-ready tbody td::before {
    font-size: 10px;
    letter-spacing: 0.02em;
  }

  table[data-table="interactive"].is-mobile-ready tbody tr .actions {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
  }

  table[data-table="interactive"].is-mobile-ready tbody tr .actions > *,
  table[data-table="interactive"].is-mobile-ready tbody tr .actions form {
    width: auto !important;
  }

  table[data-table="interactive"].is-mobile-ready tbody tr .actions .btn,
  table[data-table="interactive"].is-mobile-ready tbody tr .actions button,
  table[data-table="interactive"].is-mobile-ready tbody tr .actions input[type="submit"] {
    width: 28px !important;
    min-width: 28px;
    min-height: 28px !important;
    padding: 0;
  }
}

@media (max-width: 640px) {
  body {
    padding: 4px;
  }

  .panel {
    padding: 9px 7px 14px;
    border-radius: 12px;
  }

  .grid,
  .card-grid,
  .field-grid,
  .details-grid,
  .summary-grid {
    gap: 8px;
  }
}

@media (max-width: 820px) {
  .products-list-page-header {
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 4px;
  }

  .products-list-title h1 {
    font-size: 22px;
    line-height: 1.08;
  }

  .products-list-title .subtitle {
    display: none;
  }

  .products-list-create {
    width: 34px;
    height: 34px;
    min-height: 34px;
  }

  .products-list-create::before {
    font-size: 24px;
  }

  .products-list-tools {
    gap: 6px;
    margin-bottom: 0;
  }

  .products-list-filterbar {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .products-list-search {
    min-height: 34px;
    padding-left: 10px;
    border-radius: 10px;
    font-size: 13.5px;
  }

  .products-list-filterbar select {
    min-height: 32px;
    border-radius: 10px;
    font-size: 12.5px;
  }

  .products-list-tools > form {
    display: none !important;
  }

  .products-list-summary-bar {
    margin: 4px -7px 0;
    padding: 5px 8px;
    font-size: 12px;
  }

  .products-list-refresh {
    gap: 5px;
    font-size: 12px;
  }

  .products-list-refresh svg {
    width: 15px;
    height: 15px;
  }

  .products-table.is-mobile-ready tbody {
    gap: 8px;
    padding: 4px 0;
    background: #f8fafc;
  }

  .products-table.is-mobile-ready tbody tr:not(.no-results) {
    grid-template-columns: 50px minmax(0, 1fr) minmax(66px, auto);
    grid-template-areas:
      "thumb name price"
      "thumb name actions";
    gap: 3px 8px;
    min-height: 72px;
    padding: 7px 22px 7px 7px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
  }

  .products-table.is-mobile-ready .thumb-rotate-wrap,
  .products-table.is-mobile-ready .products-thumb-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 7px;
  }

  .products-table.is-mobile-ready .thumb-rotate-btn {
    display: none !important;
  }

  .products-table.is-mobile-ready .products-cell-name {
    gap: 2px;
  }

  .products-table.is-mobile-ready .products-card-sku {
    font-size: 10.5px;
    line-height: 1.1;
  }

  .products-table.is-mobile-ready .products-card-name {
    font-size: 12.5px;
    line-height: 1.12;
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }

  .products-table.is-mobile-ready .products-card-supplier {
    font-size: 10.5px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .products-table.is-mobile-ready .products-card-badges {
    flex-wrap: nowrap;
    gap: 2px;
    max-height: 24px;
    overflow: visible;
    align-items: center;
  }

  .products-table.is-mobile-ready .products-card-badge {
    min-height: 16px;
    padding: 1px 5px;
    font-size: 9.5px;
    line-height: 1.1;
  }

  .products-table.is-mobile-ready .products-cell-price {
    font-size: 13px;
    line-height: 1.12;
  }

  .products-table.is-mobile-ready .products-card-open {
    right: 4px;
    width: 18px;
    height: 100%;
    color: #475569;
  }

  .products-table.is-mobile-ready .products-card-open svg {
    width: 18px;
    height: 18px;
  }

  .products-table.is-mobile-ready .products-cell-actions > .actions {
    display: flex !important;
  }

  .products-table.is-mobile-ready .products-cell-actions > .actions button,
  .products-table.is-mobile-ready .products-cell-actions > .actions .btn,
  .products-table.is-mobile-ready .products-cell-actions > .actions input[type="submit"] {
    width: 44px !important;
    min-width: 44px;
    min-height: 44px !important;
    opacity: 1;
  }
}

@media (max-width: 430px) {
  .products-table.is-mobile-ready tbody tr:not(.no-results) {
    grid-template-columns: 48px minmax(0, 1fr) minmax(62px, auto);
    min-height: 70px;
    padding: 7px 20px 7px 7px;
  }

  .products-table.is-mobile-ready .thumb-rotate-wrap,
  .products-table.is-mobile-ready .products-thumb-placeholder {
    width: 42px;
    height: 42px;
  }

  .products-table.is-mobile-ready .products-card-name {
    font-size: 12px;
  }

  .products-table.is-mobile-ready .products-cell-price {
    font-size: 12.5px;
  }
}

@media (max-width: 820px) {
  .orders-list-page-header {
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 6px;
  }

  .orders-list-title {
    gap: 7px;
  }

  .orders-list-title h1 {
    font-size: 22px;
    line-height: 1.08;
  }

  .orders-list-title .subtitle {
    display: none;
  }

  .orders-list-title__icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .orders-list-title__icon svg {
    width: 18px;
    height: 18px;
  }

  .orders-list-page-actions .btn {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 11px;
  }

  .orders-status-tabs {
    width: 100%;
    margin: 4px 0 6px;
    padding: 2px;
    gap: 2px;
  }

  .orders-status-tab {
    flex: 1 0 auto;
    min-height: 31px;
    padding: 5px 8px;
    gap: 5px;
    font-size: 12.5px;
  }

  .orders-status-tab__badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 10.5px;
  }

  .orders-list-tools {
    gap: 5px;
    margin: 4px 0 6px;
  }

  .orders-list-searchbar {
    width: 100%;
    gap: 0 !important;
  }

  .orders-list-search {
    min-height: 36px;
    border-radius: 10px;
    font-size: 13.5px;
  }

  .orders-list-sort-hint,
  .orders-list-per-page {
    display: none !important;
  }

  .orders-table.is-mobile-ready tbody {
    gap: 8px;
    padding: 4px 0;
    background: #f8fafc;
  }

  .orders-table.is-mobile-ready tbody tr:not(.no-results) {
    position: relative;
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr) minmax(76px, auto) 17px;
    grid-template-areas:
      "order customer total open"
      "date customer total open"
      "flow flow flow open"
      "preview preview preview preview";
    gap: 4px 8px;
    min-height: 88px;
    padding: 9px 22px 9px 9px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.06);
  }

  .orders-table.is-mobile-ready tbody tr:not(.no-results) > td {
    display: block;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0;
    border-bottom: 0;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  .orders-table.is-mobile-ready tbody tr:not(.no-results) > td::before {
    content: none;
  }

  .orders-table.is-mobile-ready .orders-cell-order {
    grid-area: order;
    align-self: end;
    font-size: 15.5px;
    line-height: 1.05;
  }

  .orders-table.is-mobile-ready .orders-cell-date {
    grid-area: date;
    align-self: start;
    color: #64748b;
    font-size: 10.5px;
    line-height: 1.1;
    text-align: left;
    white-space: normal !important;
  }

  .orders-table.is-mobile-ready .orders-cell-customer {
    grid-area: customer;
    display: grid;
    align-content: center;
    gap: 2px;
  }

  .orders-table.is-mobile-ready .orders-card-customer-name {
    display: -webkit-box;
    font-size: 13px;
    line-height: 1.14;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }

  .orders-table.is-mobile-ready .orders-card-meta {
    display: block;
    color: #64748b;
    font-size: 11px;
    line-height: 1.12;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .orders-table.is-mobile-ready .orders-cell-total {
    grid-area: total;
    align-self: center;
    text-align: right;
    font-size: 14.5px;
    line-height: 1.1;
    white-space: nowrap !important;
  }

  .orders-table.is-mobile-ready .orders-cell-order-status {
    display: none !important;
  }

  .orders-table.is-mobile-ready .orders-card-order-status-label,
  .orders-table.is-mobile-ready .order-status-icons,
  .orders-table.is-mobile-ready .orders-card-pending__icon {
    display: none !important;
  }

  .orders-table.is-mobile-ready .orders-card-pending {
    gap: 0;
    margin: 0;
    color: #475569;
    font-size: 11.5px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .orders-table.is-mobile-ready .orders-cell-flow {
    grid-area: flow;
    align-self: center;
    margin-top: 0;
    min-width: 0;
  }

  .orders-table.is-mobile-ready .order-unified-status {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
  }

  .orders-table.is-mobile-ready .order-unified-status__line {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-width: 34%;
    min-height: 20px;
    padding: 2px 5px;
    border-radius: 7px;
    overflow: hidden;
  }

  .orders-table.is-mobile-ready .order-unified-status__label {
    flex: 0 1 auto;
    min-width: 0;
    font-size: 9.5px;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .orders-table.is-mobile-ready .order-payment-status {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .orders-table.is-mobile-ready .order-inline-status-btn {
    min-height: 0;
    box-shadow: none;
    text-align: left;
  }

  .orders-table.is-mobile-ready .order-unified-status__method,
  .orders-table.is-mobile-ready .col-uf,
  .orders-table.is-mobile-ready .col-origin,
  .orders-table.is-mobile-ready .orders-cell-balance,
  .orders-table.is-mobile-ready .orders-cell-items {
    display: none !important;
  }

  .orders-table.is-mobile-ready .orders-cell-actions {
    grid-area: preview;
    min-height: 0;
  }

  .orders-table.is-mobile-ready .orders-card-open {
    position: absolute;
    top: 0;
    right: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 100%;
    color: #475569;
    text-decoration: none;
    transform: none;
  }

  .orders-table.is-mobile-ready .orders-card-open svg {
    width: 18px;
    height: 18px;
  }

  .orders-table.is-mobile-ready .orders-cell-actions > .actions {
    display: none !important;
  }

  .orders-table.is-mobile-ready .orders-cell-actions > .actions:empty {
    display: none !important;
  }

  .orders-table.is-mobile-ready .orders-cell-actions > .actions > *,
  .orders-table.is-mobile-ready .orders-cell-actions > .actions form {
    width: auto !important;
  }

  .orders-table.is-mobile-ready .orders-cell-actions > .actions button,
  .orders-table.is-mobile-ready .orders-cell-actions > .actions .btn,
  .orders-table.is-mobile-ready .orders-cell-actions > .actions input[type="submit"] {
    width: 20px !important;
    min-width: 20px;
    min-height: 20px !important;
    padding: 0;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }

  .orders-table.is-mobile-ready .orders-cell-actions > .actions svg {
    width: 12px;
    height: 12px;
  }

  .orders-table.is-mobile-ready .order-items-preview {
    position: static;
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    margin-top: 7px;
    padding: 9px;
    overflow: hidden;
    border-radius: 11px;
    background: #f8fafc;
    box-shadow: none;
    overflow-wrap: normal;
    word-break: normal;
  }

  .orders-table.is-mobile-ready .order-items-preview__title {
    margin-bottom: 5px;
    font-size: 12px;
  }

  .orders-table.is-mobile-ready .order-items-preview__list {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .orders-table.is-mobile-ready .order-items-preview__item {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 6px;
    padding: 6px;
    border-radius: 8px;
    min-width: 0;
    background: #fff;
  }

  .orders-table.is-mobile-ready .order-items-preview__thumb {
    width: 42px;
    height: 42px;
  }

  .orders-table.is-mobile-ready .order-items-preview__item-main,
  .orders-table.is-mobile-ready .order-items-preview__item-name,
  .orders-table.is-mobile-ready .order-items-preview__item-meta,
  .orders-table.is-mobile-ready .order-items-preview__item-price {
    min-width: 0;
  }

  .orders-table.is-mobile-ready .order-items-preview__item-name {
    overflow-wrap: break-word;
    word-break: normal;
  }

  .orders-table.is-mobile-ready .order-items-preview__item-price {
    gap: 8px;
  }
}

@media (max-width: 430px) {
  .orders-list-title h1 {
    font-size: 21px;
  }

  .orders-list-page-actions .btn {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 11.5px;
  }

  .orders-status-tab {
    padding: 5px 6px;
    font-size: 11.5px;
  }

  .orders-table.is-mobile-ready tbody tr:not(.no-results) {
    grid-template-columns: 62px minmax(0, 1fr) minmax(68px, auto) 16px;
    min-height: 84px;
    padding: 8px 20px 8px 8px;
  }

  .orders-table.is-mobile-ready .orders-cell-order {
    font-size: 14.5px;
  }

  .orders-table.is-mobile-ready .orders-cell-total {
    font-size: 13.5px;
  }

  .orders-table.is-mobile-ready .orders-card-customer-name {
    font-size: 12.5px;
  }

  .orders-table.is-mobile-ready .orders-card-meta,
  .orders-table.is-mobile-ready .orders-card-pending {
    font-size: 10.5px;
  }

  .orders-table.is-mobile-ready .order-unified-status__line {
    max-width: 33%;
    padding: 2px 4px;
  }

  .orders-table.is-mobile-ready .order-unified-status__label,
  .orders-table.is-mobile-ready .order-payment-status {
    font-size: 9.5px;
  }
}

/* Product workspace: HU-252 */
.product-form {
  --product-ink: #172033;
  --product-muted: #647084;
  --product-line: #dfe5ee;
  --product-soft: #f6f8fb;
  --product-warm: #f8f5ef;
  --product-accent: #245bdb;
  --product-accent-strong: #1744ad;
  --product-success: #167452;
  --product-danger: #b4233c;
  --product-radius: 14px;
  gap: 16px;
  color: var(--product-ink);
}

.product-form__header {
  position: sticky;
  top: 12px;
  z-index: 35;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(215, 222, 232, 0.92);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(29, 41, 57, 0.1);
}

.product-form__eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
  color: var(--product-muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.product-form__eyebrow strong {
  color: var(--product-accent);
}

.product-form__title h1 {
  margin: 0;
  color: var(--product-ink);
  font-size: clamp(22px, 2.3vw, 30px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.product-form__title .subtitle {
  display: inline-block;
  margin: 5px 10px 0 0;
  font-size: 12px;
}

.product-form__actions {
  align-items: center;
  justify-content: flex-end;
}

.product-form__actions .primary,
.product-summary-card__submit,
.product-form__footer .primary {
  min-height: 42px;
  border: 1px solid var(--product-accent);
  background: var(--product-accent);
  box-shadow: 0 8px 18px rgba(36, 91, 219, 0.22);
}

.product-form__actions .primary:hover,
.product-summary-card__submit:hover,
.product-form__footer .primary:hover {
  border-color: var(--product-accent-strong);
  background: var(--product-accent-strong);
}

.product-form__save-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--product-muted);
  font-size: 12px;
  font-weight: 650;
}

.product-form__save-state::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #98a2b3;
  content: "";
}

.product-form__save-state[data-state="dirty"] {
  color: #9a5b10;
}

.product-form__save-state[data-state="dirty"]::before {
  background: #e59b2f;
}

.product-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 18px;
  align-items: start;
}

.product-workspace__main {
  min-width: 0;
}

.product-workspace__summary {
  position: sticky;
  top: 116px;
  min-width: 0;
}

.product-form__section {
  margin: 0 0 16px;
  padding: 20px;
  border-color: var(--product-line);
  border-radius: var(--product-radius);
  background: #fff;
  box-shadow: 0 2px 5px rgba(29, 41, 57, 0.035);
}

.product-form__section--identity {
  border-top: 3px solid var(--product-accent);
}

.product-form__section--sourcing {
  border-top: 3px solid #8a6b3d;
  background: linear-gradient(180deg, #fff 0%, #fffdfa 100%);
}

.product-form__section--images {
  border-color: #d7e1ef;
  border-top: 3px solid #334f76;
  background: #fff;
}

.product-form__section--inventory {
  border-top: 3px solid var(--product-success);
}

.product-form__section-intro {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-bottom: 4px;
}

.product-form__section-intro--compact {
  margin-bottom: 2px;
}

.product-form__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid #ccd6e5;
  border-radius: 9px;
  background: var(--product-soft);
  color: #40526b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.product-form__section-title {
  margin: 0;
  color: var(--product-ink);
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: -0.018em;
}

.product-form__section-intro p,
.product-form__section-description {
  max-width: 68ch;
  margin: 3px 0 0;
  color: var(--product-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.product-form__grid--identity,
.product-form__grid--attributes,
.product-form__grid--brand,
.product-form__grid--editable-attributes,
.product-form__grid--pricing,
.product-form__grid--content {
  display: grid;
  gap: 14px;
  align-items: start;
}

.product-form__grid--identity {
  grid-template-columns: minmax(0, 1.8fr) minmax(220px, 1fr);
}

.product-form__grid--attributes,
.product-form__grid--pricing {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-form__grid--brand { grid-template-columns: minmax(220px, 1fr); }
.product-form__grid--editable-attributes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.product-form__segment { display: grid; gap: 10px; padding: 12px; border: 1px solid #dfd8cc; border-radius: 10px; background: #fbfaf7; }
.product-form__segment-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.product-form__segment-heading > div { display: grid; gap: 1px; }
.product-form__segment-heading span { color: var(--product-accent); font-size: 9px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.product-form__segment-heading strong { color: var(--product-ink); font-size: 13px; }
.product-form__segment-heading small { color: var(--product-muted); font-size: 10px; }
.product-form__segment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; padding-top: 11px; border-top: 1px solid #e4ded4; }
.product-form__segment-grid:first-child { padding-top: 0; border-top: 0; }
.product-form__category-selector { display: grid; gap: 9px; }
.product-form__category-title { color: var(--product-ink); font-size: 13px; }
.product-form__category-selector .product-form__section-description { margin-top: 2px; }
.product-form__choice-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.product-form__choice-group legend { min-height: 18px; margin-bottom: 4px; font-size: 11px; font-weight: 700; }
.product-form__choice-options { display: flex; flex-wrap: wrap; gap: 5px; }
.product-form__choice-options label { position: relative; min-height: 34px; cursor: pointer; }
.product-form__choice-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.product-form__choice-options span { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 9px; border: 1px solid #d8d3ca; border-radius: 8px; background: #fff; color: #526176; font-size: 10px; font-weight: 700; }
.product-form__choice-options input:checked + span { border-color: #7196d3; background: #edf3ff; color: #214d95; box-shadow: inset 0 0 0 1px #7196d3; }
.product-form__choice-options input:focus-visible + span { outline: 3px solid rgba(63, 124, 255, .22); outline-offset: 1px; }
.product-form__condition { min-width: 0; margin: 0; padding: 0; border: 0; }
.product-form__condition legend { margin-bottom: 6px; color: var(--product-ink); font-size: 11px; font-weight: 750; }
.product-form__condition-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; max-width: 720px; }
.product-form__condition-options label { position: relative; min-width: 0; cursor: pointer; }
.product-form__condition-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.product-form__condition-options span { display: grid; box-sizing: border-box; width: 100%; min-height: 52px; align-content: center; gap: 2px; padding: 7px 10px; border: 1px solid #d8d3ca; border-radius: 9px; background: #fff; color: #526176; }
.product-form__condition-options strong { color: var(--product-ink); font-size: 11px; line-height: 1.2; }
.product-form__condition-options small { overflow: hidden; color: var(--product-muted); font-size: 9.5px; line-height: 1.25; text-overflow: ellipsis; }
.product-form__condition-options input:checked + span { border-color: #7196d3; background: #edf3ff; box-shadow: inset 0 0 0 1px #7196d3; }
.product-form__condition-options input:checked + span strong { color: #214d95; }
.product-form__condition-options input:focus-visible + span { outline: 3px solid rgba(63, 124, 255, .22); outline-offset: 1px; }
.product-form__condition > .product-form__helper { display: block; margin-top: 5px; }
.product-form__collection-group { margin-top: 10px; padding-top: 11px; border-top: 1px solid #e4ded4; }
.product-form__collection-group .product-form__helper { display: block; margin-top: 5px; }
.product-form__editable-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: stretch; }
.product-form__editable-option > input,
.product-form__editable-option > .autocomplete-picker { min-width: 0; width: 100%; }
.product-form__new-option { min-height: 38px; padding: 6px 9px; border: 1px solid #c8d4e8; border-radius: 8px; background: #fff; color: #315d9f; cursor: pointer; font-size: 10px; font-weight: 780; white-space: nowrap; }
.product-form__new-option:hover,
.product-form__new-option:focus-visible { border-color: var(--product-accent); background: #f3f7ff; outline: none; box-shadow: 0 0 0 3px rgba(63, 124, 255, .14); }
.product-form__multi-value { display: grid; gap: 6px; }
.product-form__selected-chips--compact { min-height: 0; margin: 0; }
.product-form__selected-chips--compact:empty { display: none; }
.product-form__selected-chips--compact .product-form__selected-chip { min-height: 30px; padding: 4px 5px 4px 9px; font-size: 11px; }
.product-form__selected-chips--compact .product-form__selected-chip button { width: 24px; height: 24px; }

.product-form__grid--content {
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.4fr);
}

.product-form__grid--sourcing {
  grid-template-columns: minmax(150px, 0.72fr) minmax(190px, 1.1fr);
  gap: 14px;
}

.product-form__grid--sourcing > .field:nth-child(3),
.product-form__grid--sourcing > .field:nth-child(4) {
  grid-column: auto;
}

.product-form label {
  min-height: 25px;
  color: #344054;
  font-size: 12px;
  font-weight: 720;
}

.product-form input,
.product-form select,
.product-form textarea {
  border-color: #cfd7e4;
  border-radius: 10px;
  background: #fff;
}

.product-form input:focus,
.product-form select:focus,
.product-form textarea:focus {
  border-color: var(--product-accent);
  box-shadow: 0 0 0 3px rgba(36, 91, 219, 0.14);
  outline: none;
}

.product-form textarea {
  min-height: 98px;
  resize: vertical;
  line-height: 1.5;
}

.product-form__field--name input {
  font-size: 16px;
  font-weight: 650;
}

.product-form__field--slug input {
  color: #526071;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.product-form__brand-create {
  min-height: 30px;
  padding: 5px 8px;
  gap: 5px;
  font-size: 11px;
  white-space: nowrap;
}

.product-form__brand-create svg {
  width: 14px;
  height: 14px;
}

.lot-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  align-items: stretch;
}

.lot-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.lot-action-btn {
  width: auto;
  height: 42px;
  gap: 5px;
  padding: 0 7px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.lot-action-btn svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.product-form__dropzone {
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center !important;
  min-height: 112px !important;
  padding: 18px;
  border: 1.5px dashed #9eb0c7;
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.product-form__dropzone:hover,
.product-form__dropzone:focus-within,
.product-form__dropzone.is-dragging {
  border-color: var(--product-accent);
  background: #f1f5ff;
  transform: translateY(-1px);
}

.product-form__dropzone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #eaf0fb;
  color: #284d82;
}

.product-form__dropzone-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.product-form__dropzone-copy {
  display: grid;
  gap: 4px;
}

.product-form__dropzone-copy strong {
  color: var(--product-ink);
  font-size: 14px;
}

.product-form__dropzone-copy span {
  color: var(--product-muted);
  font-size: 11.5px;
  line-height: 1.35;
}

.product-form__dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.product-form__upload-status {
  color: var(--product-muted);
  font-size: 12px;
}

.product-form__new-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 9px;
}

.product-form__new-image-card {
  min-width: 0;
  padding: 7px;
  border: 1px solid #dbe3ed;
  border-radius: 10px;
  background: #fff;
}

.product-form__new-image-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 7px;
  object-fit: cover;
}

.product-form__new-image-card strong,
.product-form__new-image-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-form__new-image-card strong {
  margin-top: 5px;
  font-size: 11px;
}

.product-form__new-image-card span {
  margin-top: 2px;
  color: var(--product-success);
  font-size: 10px;
}

.product-form__images-upload-hints {
  gap: 14px;
  color: var(--product-muted);
  font-size: 11px;
}

.product-form__images-upload-hints span::before {
  margin-right: 5px;
  color: var(--product-success);
  content: "✓";
  font-weight: 800;
}

.product-form__publication-summary {
  padding: 10px 12px;
  border-left: 3px solid #98a2b3;
  border-radius: 6px;
  background: var(--product-soft);
  color: #475467;
  font-size: 12px;
  font-weight: 600;
}

.product-form__publication-summary[data-state="public"] {
  border-left-color: var(--product-success);
  background: #edf9f4;
  color: #116149;
}

.product-form__publication-summary-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 8px;
}

.product-form__publication-summary-heading > strong {
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.product-form__publication-summary[data-state="public"] .product-form__publication-summary-heading > strong {
  color: #116149;
}

.product-form__publication-summary-heading > span {
  color: #667085;
  font-size: 10px;
}

.product-form__publication-criteria {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.product-form__publication-criteria li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #dfe3e9;
  border-radius: 7px;
  background: rgba(255, 255, 255, .7);
}

.product-form__publication-criterion-icon {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: #fef3e7;
  color: #9a5900;
  font-size: 11px;
  font-weight: 850;
}

.product-form__publication-criteria li[data-state="ready"] .product-form__publication-criterion-icon {
  background: #def7ec;
  color: #087458;
}

.product-form__publication-criteria li > span:last-child {
  display: grid;
  gap: 1px;
}

.product-form__publication-criteria li strong {
  color: #344054;
  font-size: 10px;
  font-weight: 800;
}

.product-form__publication-criteria li small {
  color: #667085;
  font-size: 9px;
  line-height: 1.35;
}

.product-form__category-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.product-form__category-item {
  min-height: 38px;
  align-items: center;
  padding: 7px 9px;
  border-color: #e0e5ec;
  border-radius: 9px;
  box-shadow: none;
}

.product-form__category-item input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--product-accent);
}

.product-form__category-item:has(input:checked) {
  border-color: #7d9bd7;
  background: #edf3ff;
  box-shadow: inset 3px 0 0 var(--product-accent);
}

.product-form__section-heading--tags {
  align-items: flex-start;
}

.product-form__selection-count {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--product-soft);
  color: #475467;
  font-size: 11px;
  font-weight: 750;
}

.product-form__taxonomy-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.product-form__taxonomy-tools input {
  min-height: 40px;
}

.product-form__tag-grid .is-filtered-out {
  display: none;
}

.product-form__taxonomy-empty {
  padding: 14px;
  border: 1px dashed #cfd7e4;
  border-radius: 9px;
  color: var(--product-muted);
  font-size: 12px;
  text-align: center;
}

.product-summary-card {
  overflow: hidden;
  border: 1px solid #d8e0ea;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(29, 41, 57, 0.1);
}

.product-summary-card__header,
.product-summary-card__identity,
.product-summary-card__price,
.product-summary-card__facts,
.product-summary-card__readiness {
  margin-right: 14px;
  margin-left: 14px;
}

.product-summary-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  color: #475467;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.product-summary-card__status {
  color: #7a4d12;
}

.product-summary-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  background: var(--product-warm);
}

.product-summary-card__media > img {
  width: 100%;
  height: 220px;
  object-fit: contain;
}

.product-summary-card__placeholder {
  display: grid;
  justify-items: center;
  gap: 8px;
  max-width: 170px;
  padding: 20px;
  color: #778398;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.product-summary-card__placeholder svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
}

.product-summary-card__identity {
  display: grid;
  gap: 3px;
  padding-top: 14px;
}

.product-summary-card__identity strong {
  overflow: hidden;
  color: var(--product-ink);
  font-size: 16px;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.product-summary-card__identity span {
  color: var(--product-muted);
  font-size: 11px;
}

.product-summary-card__price {
  padding: 10px 0 13px;
  border-bottom: 1px solid #e4e8ef;
  color: var(--product-ink);
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.product-summary-card__facts {
  display: grid;
  gap: 7px;
  padding: 12px 0;
  border-bottom: 1px solid #e4e8ef;
}

.product-summary-card__facts div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}

.product-summary-card__facts dt {
  color: var(--product-muted);
}

.product-summary-card__facts dd {
  max-width: 60%;
  margin: 0;
  overflow: hidden;
  color: #344054;
  font-weight: 720;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-summary-card__readiness {
  padding: 12px 0 14px;
}

.product-summary-card__readiness-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #344054;
  font-size: 11px;
}

.product-summary-card__readiness ul {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.product-summary-card__readiness li {
  position: relative;
  padding-left: 20px;
  color: #667085;
  font-size: 11px;
}

.product-summary-card__readiness li::before {
  position: absolute;
  top: 1px;
  left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid #b9c2cf;
  border-radius: 999px;
  content: "";
}

.product-summary-card__readiness li.is-ready {
  color: #175f49;
}

.product-summary-card__readiness li.is-ready::before {
  border-color: var(--product-success);
  background: var(--product-success);
  color: #fff;
  content: "✓";
  font-size: 9px;
  font-weight: 900;
}

.product-summary-card__submit {
  width: calc(100% - 28px);
  margin: 0 14px 14px;
}

.product-form__footer {
  justify-content: flex-end;
  padding: 12px 0 0;
  border-top: 1px solid var(--product-line);
}

@media (max-width: 1360px) {
  .product-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-workspace__summary {
    position: static;
    order: -1;
  }

  .product-summary-card {
    display: grid;
    grid-template-columns: 140px minmax(180px, 1fr) minmax(250px, 1.3fr);
    align-items: center;
    min-height: 140px;
  }

  .product-summary-card__header,
  .product-summary-card__submit {
    display: none;
  }

  .product-summary-card__media {
    grid-row: 1 / span 3;
    min-height: 140px;
    height: 100%;
  }

  .product-summary-card__media > img {
    height: 140px;
  }

  .product-summary-card__identity,
  .product-summary-card__price,
  .product-summary-card__facts,
  .product-summary-card__readiness {
    margin-right: 16px;
    margin-left: 16px;
  }

  .product-summary-card__identity {
    align-self: end;
  }

  .product-summary-card__price {
    align-self: start;
    padding-top: 7px;
    border-bottom: 0;
  }

  .product-summary-card__facts {
    grid-row: 1 / span 2;
    grid-column: 3;
    border-bottom: 0;
  }

  .product-summary-card__readiness {
    grid-row: 3;
    grid-column: 3;
    padding-top: 0;
  }

  .product-summary-card__readiness ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .product-form__grid--identity,
  .product-form__grid--sourcing,
  .product-form__grid--content {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-form__grid--attributes,
  .product-form__grid--pricing,
  .product-form__inventory {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 720px) {
  .product-form {
    padding-bottom: 76px;
  }

  .product-form__header {
    position: static;
    padding: 12px;
    border-radius: 12px;
    box-shadow: none;
  }

  .product-form__actions {
    width: auto;
    margin-left: 0;
  }

  .product-form__actions > .primary,
  .product-form__actions > .product-form__save-state,
  .product-workspace__summary {
    display: none;
  }

  .product-form__pill {
    order: 1;
  }

  .product-form__section {
    margin-bottom: 12px;
    padding: 15px 13px;
    border-radius: 11px;
  }

  .product-form__section-intro {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
  }

  .product-form__step {
    width: 27px;
    height: 27px;
    border-radius: 8px;
  }

  .product-form__section-title {
    font-size: 15px;
  }

  .product-form__grid--attributes,
  .product-form__grid--pricing,
  .product-form__inventory,
  .product-form__category-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-form__dropzone {
    grid-template-columns: 38px minmax(0, 1fr);
    min-height: 104px !important;
    padding: 13px;
  }

  .product-form__dropzone > .btn {
    display: none;
  }

  .product-form__taxonomy-tools {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-form__taxonomy-tools .btn {
    width: 100%;
  }

  .product-form__footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    display: grid;
    grid-template-columns: minmax(0, 0.65fr) minmax(0, 1.35fr);
    gap: 9px;
    padding: 10px max(12px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    border-top: 1px solid #d8dee8;
    background: #fff;
    box-shadow: 0 -10px 28px rgba(29, 41, 57, 0.13);
  }

  .product-form__footer button {
    width: 100%;
    min-height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-form__info-tooltip,
  .product-form__dropzone,
  .product-form__image-card,
  .lot-action-btn {
    scroll-behavior: auto;
    transition: none;
  }
}

/* Focused product intake: HU-254 */
.product-focus-mode .content {
  max-width: none;
}

.product-form {
  --product-radius: 10px;
  max-width: 1180px;
  margin: 0 auto;
  gap: 10px;
}

.product-form__header {
  top: 8px;
  padding: 10px 14px;
  border-radius: 11px;
  box-shadow: 0 8px 24px rgba(29, 41, 57, 0.08);
}

.product-form__eyebrow {
  margin-bottom: 1px;
  font-size: 10px;
}

.product-form__eyebrow a {
  color: var(--product-muted);
  text-decoration: none;
}

.product-form__eyebrow a:hover,
.product-form__eyebrow a:focus-visible {
  color: var(--product-accent);
}

.product-form__title h1 {
  font-size: clamp(19px, 1.8vw, 24px);
}

.product-form__title .subtitle {
  margin-top: 2px;
  font-size: 10.5px;
}

.product-form__actions {
  gap: 8px;
}

.product-form__actions .primary {
  min-height: 38px;
  padding: 8px 16px;
  box-shadow: 0 5px 14px rgba(36, 91, 219, 0.18);
}

.product-form__readiness-popover {
  position: relative;
}

.product-form__readiness-popover > summary {
  display: flex;
  align-items: center;
  min-height: 36px;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid #dce2eb;
  border-radius: 8px;
  background: #f8fafc;
  color: #536176;
  cursor: pointer;
  font-size: 11px;
  list-style: none;
}

.product-form__readiness-popover > summary::-webkit-details-marker {
  display: none;
}

.product-form__readiness-popover > summary::after {
  color: #7a8799;
  content: "⌄";
  font-size: 12px;
}

.product-form__readiness-popover[open] > summary::after {
  transform: rotate(180deg);
}

.product-form__save-state {
  font-size: 11px;
}

.product-form__save-state::before {
  width: 6px;
  height: 6px;
}

.product-form__readiness-panel {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 50;
  width: 250px;
  padding: 13px;
  border: 1px solid #d8e0ea;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(29, 41, 57, 0.16);
}

.product-form__readiness-panel > strong {
  font-size: 12px;
}

.product-form__readiness-panel ul {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.product-form__readiness-panel li {
  position: relative;
  padding-left: 20px;
  color: #667085;
  font-size: 11px;
}

.product-form__readiness-panel li::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  border: 1px solid #b9c2cf;
  border-radius: 50%;
  content: "";
}

.product-form__readiness-panel li.is-ready {
  color: #175f49;
}

.product-form__readiness-panel li.is-ready::before {
  display: grid;
  place-items: center;
  border-color: var(--product-success);
  background: var(--product-success);
  color: #fff;
  content: "✓";
  font-size: 9px;
  font-weight: 900;
}

.product-workspace--focused {
  display: block;
}

.product-workspace--focused .product-workspace__main {
  overflow: hidden;
  padding: 0 22px;
  border: 1px solid var(--product-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(29, 41, 57, 0.035);
}

.product-workspace--focused .product-form__section {
  margin: 0;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid #e6eaf0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.product-workspace--focused .product-form__section:last-child {
  border-bottom: 0;
}

.product-workspace--focused .product-form__section-intro {
  display: block;
  margin-bottom: 11px;
}

.product-workspace--focused .product-form__section-title {
  font-size: 13px;
  font-weight: 820;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.product-form__essentials-layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.product-form__photo-lead {
  min-width: 0;
}

.product-form__photo-dropzone {
  display: block !important;
  min-height: 0 !important;
  padding: 0;
  overflow: hidden;
  border: 1px dashed #aeb9c8;
  border-radius: 10px;
  background: #f8f6f1;
}

.product-form__photo-dropzone:hover,
.product-form__photo-dropzone:focus-within,
.product-form__photo-dropzone.is-dragging {
  transform: none;
}

.product-form__photo-stage {
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 4.35;
  place-items: center;
  overflow: hidden;
  background: #f4f0e8;
}

.product-form__photo-stage > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-form__photo-placeholder {
  display: grid;
  gap: 8px;
  justify-items: center;
  color: #778398;
  font-size: 11px;
  text-transform: uppercase;
}

.product-form__photo-placeholder svg {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.3;
}

.product-form__photo-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-top: 1px solid #e1ddd4;
  background: #fff;
}

.product-form__photo-action strong {
  color: var(--product-accent);
  font-size: 11px;
}

.product-form__photo-action small {
  color: var(--product-muted);
  font-size: 9px;
}

.product-form__photo-lead .product-form__upload-status {
  margin-top: 5px;
  font-size: 10px;
}

.product-form__photo-lead .product-form__new-image-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 7px;
}

.product-form__essentials-fields {
  display: grid;
  gap: 11px;
}

.product-form__grid--identity {
  grid-template-columns: minmax(0, 2fr) minmax(145px, 0.72fr);
}

.product-form__grid--attributes {
  grid-template-columns: minmax(160px, 1.2fr) repeat(3, minmax(110px, 0.8fr));
}

.product-form__grid--sourcing {
  grid-template-columns: minmax(150px, 0.6fr) minmax(220px, 1fr) minmax(260px, 1.2fr);
  gap: 12px;
}

.product-form__grid--sourcing #costWrap {
  grid-column: 1;
  max-width: 260px;
}

.product-form__grid--sourcing #quantityWrap {
  max-width: 180px;
}

.product-form__grid--pricing {
  grid-template-columns: repeat(2, minmax(160px, 260px));
  gap: 12px;
}

.product-form .field {
  gap: 4px;
}

.product-form label {
  min-height: 18px;
  font-size: 11px;
}

.product-form input,
.product-form select {
  min-height: 38px;
  padding-top: 7px;
  padding-bottom: 7px;
  border-radius: 8px;
}

.product-form textarea {
  min-height: 64px;
  border-radius: 8px;
}

.product-form__brand-create {
  min-height: 22px;
  padding: 2px 5px;
}

.product-form__brand-create svg {
  width: 11px;
  height: 11px;
}

.product-form__advanced-field {
  margin-top: 2px;
}

.product-form__advanced-field > summary {
  width: max-content;
  color: var(--product-accent);
  cursor: pointer;
  font-size: 11px;
  font-weight: 720;
}

.product-form__advanced-field[open] > summary {
  margin-bottom: 7px;
}

.product-form__advanced-field .field {
  max-width: 720px;
}

.lot-actions {
  grid-template-columns: repeat(3, minmax(70px, 1fr));
}

.lot-action-btn {
  height: 32px;
}

.product-form__inventory {
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 12px;
}

.product-form__publication-summary {
  margin-top: 10px;
  padding: 8px 10px;
}

.product-form__section-heading--tags {
  margin-bottom: 9px;
}

.product-form__taxonomy-tools {
  max-width: 760px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.product-form__taxonomy-tools input {
  min-height: 38px;
}

.product-form__category-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 920px;
  gap: 6px;
  margin-top: 8px;
}

.product-form__category-item {
  min-height: 34px;
  padding: 5px 8px;
  border-radius: 7px;
}

.product-form__category-grid .is-filtered-out {
  display: none;
}

.product-form__selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.product-form__selected-chips[hidden] {
  display: none;
}

.product-form__selected-chip {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid #9db2dc;
  border-radius: 999px;
  background: #edf3ff;
  color: #244f9f;
  cursor: pointer;
  font-size: 11px;
  font-weight: 720;
}

.product-form__selected-chip:hover,
.product-form__selected-chip:focus-visible {
  border-color: var(--product-accent);
  background: #e2ecff;
  outline: none;
}

.product-form__selected-chips--characteristics .product-form__selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: default;
}

.product-form__selected-chip > button {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  margin: -2px -5px -2px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.product-form__selected-chip > button:hover,
.product-form__selected-chip > button:focus-visible {
  background: rgba(36, 79, 159, 0.12);
  outline: 2px solid rgba(36, 79, 159, 0.35);
}

.product-form__structured-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #ebe7df;
}

.product-form__structured-heading > div {
  display: grid;
  gap: 2px;
}

.product-form__structured-heading strong {
  color: #27364d;
  font-size: 12px;
}

.product-form__structured-heading span,
.product-form__enrichment-state {
  color: var(--product-muted);
  font-size: 11px;
}

.product-form__enrichment-state {
  max-width: 320px;
  text-align: right;
}

.product-form__grid--identity .product-form__enrichment-state {
  max-width: none;
  text-align: left;
}

.product-form__grid--structured {
  margin-top: 9px;
}

.product-form__smart-field {
  position: relative;
}

.product-form__smart-field.is-auto-filled select,
.field.is-auto-filled input {
  border-color: #79a68c;
  background: #f3faf6;
  box-shadow: inset 3px 0 0 #2f7a56;
}

.product-form__field-origin {
  display: block;
  margin-top: 4px;
  color: #2f6e50;
  font-size: 10px;
  font-weight: 650;
}

.product-form__field-origin[hidden] {
  display: none;
}

.product-form__characteristic-search {
  max-width: 760px;
}

.product-form__characteristic-search > label,
.product-form__suggestion-block > strong {
  display: block;
  margin-bottom: 6px;
  color: #344054;
  font-size: 11px;
  font-weight: 750;
}

.product-form__characteristic-results {
  display: grid;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 5px;
  padding: 5px;
  border: 1px solid #d7dde7;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(29, 41, 57, 0.12);
}

.product-form__characteristic-results[hidden] {
  display: none;
}

.product-form__characteristic-results button {
  min-height: 38px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #344054;
  cursor: pointer;
  text-align: left;
}

.product-form__characteristic-results button:hover,
.product-form__characteristic-results button:focus-visible {
  background: #f1f4f8;
  outline: 2px solid rgba(51, 92, 165, 0.3);
}

.product-form__suggestion-block {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 3px solid #b48b54;
  border-radius: 7px;
  background: #fbf7f0;
}

.product-form__suggestion-block[hidden] {
  display: none;
}

.product-form__suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-form__suggestion-chip {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid #d5c3a9;
  border-radius: 999px;
  background: #fff;
  color: #6e4a20;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.product-form__suggestion-chip:hover,
.product-form__suggestion-chip:focus-visible {
  border-color: #9f6f35;
  background: #fffaf1;
  outline: 2px solid rgba(159, 111, 53, 0.2);
}

.product-form__selection-count {
  padding: 3px 6px;
  background: transparent;
  font-size: 10px;
}

.product-form__footer {
  display: none;
}

.product-form__guided-classification,
.product-form__measurements {
  margin-top: 14px;
  padding: 15px;
  border: 1px solid #ded9d0;
  border-radius: 12px;
  background: linear-gradient(145deg, #fbfaf7 0%, #f6f3ed 100%);
}

.product-form__guided-subheading,
.product-form__measurements-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.product-form__guided-subheading > div,
.product-form__measurements-heading > div {
  display: grid;
  gap: 2px;
}

.product-form__guided-subheading span,
.product-form__measurements-heading > div > span {
  color: #9b3030;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.product-form__guided-subheading strong,
.product-form__measurements-heading strong {
  color: #26364c;
  font-size: 14px;
}

.product-form__guided-subheading small,
.product-form__measurements-heading p {
  max-width: 430px;
  margin: 0;
  color: var(--product-muted);
  font-size: 11px;
  line-height: 1.45;
}

.product-form__guided-subheading small {
  text-align: right;
}

.product-form__grid--classification-selects {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-form__grid--size-context {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(180px, .75fr);
  gap: 10px;
  align-items: start;
  margin-top: 10px;
}

.product-form__measurements {
  margin-top: 10px;
  padding: 12px;
  border-color: #d8d2c7;
  background: #fff;
}

.product-form__measurements-heading {
  align-items: center;
  margin-bottom: 9px;
}

.product-form__measurements-heading > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 8px;
}

.product-form__measurements-heading p {
  font-size: 10px;
}

.product-form__measurement-context {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f4e8e6;
  color: #7f2b2b;
  font-size: 10px;
  font-weight: 750;
}

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

.product-form__measurement-grid[hidden],
.product-form__measurement-empty[hidden],
.product-form__measurement-field[hidden] {
  display: none;
}

.product-form__measurement-field {
  min-width: 0;
  padding: 8px;
  border: 1px solid #e4e0d9;
  border-radius: 8px;
  background: #fcfbf9;
}

.product-form__measurement-field[data-measurement-type="text"] {
  grid-column: span 2;
}

.product-form__measurement-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
}

.product-form__measurement-label label {
  color: #344054;
  font-size: 11px;
  font-weight: 750;
}

.product-form__measurement-help {
  display: inline-grid;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  place-items: center;
  padding: 0;
  border: 1px solid #c9c3ba;
  border-radius: 50%;
  background: #fff;
  color: #6a5f52;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.product-form__measurement-help:hover,
.product-form__measurement-help:focus-visible {
  border-color: #9b3030;
  color: #9b3030;
  outline: 2px solid rgba(155, 48, 48, .18);
  outline-offset: 1px;
}

.product-form__measurement-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
}

.product-form__measurement-control:has(textarea) {
  grid-template-columns: minmax(0, 1fr);
}

.product-form__measurement-control > span {
  color: #756b60;
  font-size: 11px;
  font-weight: 700;
}

.product-form__measurement-help-text {
  margin: 7px 0 0;
  padding: 7px 8px;
  border-left: 2px solid #b48b54;
  background: #f8f2e9;
  color: #625747;
  font-size: 10px;
  line-height: 1.45;
}

.product-form__measurement-help-text[hidden] {
  display: none;
}

.product-form__measurement-empty {
  padding: 18px;
  border: 1px dashed #cec7bc;
  border-radius: 9px;
  color: #6f665c;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 1120px) {
  .product-form__essentials-layout {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 16px;
  }

  .product-form__grid--attributes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .product-form__segment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-form__grid--editable-attributes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-form__grid--editable-attributes > .field:last-child { grid-column: 1 / -1; }

  .product-form__grid--structured {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-form__measurement-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-form__grid--sourcing {
    grid-template-columns: minmax(150px, 0.65fr) minmax(220px, 1fr);
  }

  .product-form__grid--sourcing > .field:nth-child(3) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .product-form {
    gap: 8px;
  }

  .product-form__header {
    padding: 9px 10px;
  }

  .product-form__title h1 {
    font-size: 19px;
  }

  .product-form__title .subtitle,
  .product-form__actions > .product-form__pill {
    display: none;
  }

  .product-form__readiness-popover > summary {
    min-height: 34px;
    padding: 0 7px;
  }

  .product-form__readiness-panel {
    position: fixed;
    top: 68px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  .product-workspace--focused .product-workspace__main {
    padding: 0 12px;
    border-radius: 10px;
  }

  .product-workspace--focused .product-form__section {
    padding: 15px 0;
  }

  .product-form__essentials-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .product-form__photo-dropzone {
    display: grid !important;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: stretch !important;
  }

  .product-form__photo-stage {
    aspect-ratio: 1 / 1;
  }

  .product-form__photo-action {
    display: grid;
    align-content: center;
    border-top: 0;
    border-left: 1px solid #e1ddd4;
  }

  .product-form__photo-lead .product-form__new-image-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-form__grid--identity,
  .product-form__grid--attributes,
  .product-form__grid--brand,
  .product-form__grid--editable-attributes,
  .product-form__grid--sourcing,
  .product-form__grid--pricing,
  .product-form__inventory {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-form__grid--classification-selects {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-form__grid--size-context {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .product-form__guided-classification,
  .product-form__measurements {
    padding: 10px;
  }

  .product-form__guided-subheading,
  .product-form__measurements-heading {
    display: grid;
    gap: 4px;
  }

  .product-form__guided-subheading small {
    text-align: left;
  }

  .product-form__measurement-context {
    justify-self: start;
  }

  .product-form__publication-criteria {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .product-form__publication-criteria li {
    padding: 6px 7px;
  }

  .product-form__grid--attributes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .product-form__segment-heading { display: grid; gap: 4px; }
  .product-form__segment-grid { grid-template-columns: minmax(0, 1fr); }
  .product-form__grid--editable-attributes { grid-template-columns: minmax(0, 1fr); }
  .product-form__grid--editable-attributes > .field:last-child { grid-column: auto; }

  .product-form__grid--structured {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-form__grid--structured .product-form__smart-field:last-child {
    grid-column: 1 / -1;
  }

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

  .product-form__grid--sourcing > .field:nth-child(3) {
    grid-column: auto;
  }

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

  .product-form__taxonomy-tools {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .product-form__taxonomy-tools .btn {
    width: auto;
    padding-right: 10px;
    padding-left: 10px;
  }

  .product-form__structured-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .product-form__enrichment-state {
    max-width: none;
    text-align: left;
  }

  .product-form__footer {
    display: grid;
  }

  .product-form__footer button {
    min-height: 46px;
  }

  .product-form__footer [data-submit-button] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 340px) {
  .product-form__grid--attributes,
  .product-form__grid--editable-attributes,
  .product-form__grid--structured,
  .product-form__inventory {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-form__grid--structured .product-form__smart-field:last-child {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .product-form .product-form__footer button {
    min-height: 46px !important;
  }
}

/* Product autocomplete stays above fields, below the persistent mobile actions. */
@media (max-width: 720px) {
  .product-form .customer-picker:focus-within,
  .product-form .autocomplete-picker:focus-within,
  .product-form .mobile-datalist-picker:focus-within,
  .product-form .remote-datalist-picker:focus-within {
    z-index: 60;
  }
}
.marketing-recipient{display:flex;align-items:center;gap:10px;min-width:220px}.marketing-recipient__photo{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;overflow:hidden;border:1px solid var(--border,#dfe4ea);border-radius:50%;background:var(--surface-muted,#f4f6f8);color:var(--text-muted,#667085);font-size:9px;line-height:1;text-align:center}.marketing-recipient__photo img{display:block;width:44px;height:44px;object-fit:cover}.marketing-recipient__names{display:grid;gap:3px;min-width:0}.marketing-recipient__names strong,.marketing-recipient__names small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.marketing-recipient__names small{color:var(--text-muted,#667085);font-size:.78rem;font-weight:400}.marketing-recipient__names small span{font-weight:600}
.superfrete-bag-panel {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #9bd3ce;
  border: 1px solid color-mix(in srgb, var(--teal, #0f766e) 34%, var(--line));
  border-radius: 14px;
  background: linear-gradient(145deg, #f2fbfa 0%, #fff 72%);
  display: grid;
  gap: 12px;
}

.superfrete-bag-panel__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.superfrete-bag-panel__eyebrow {
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.superfrete-bag-panel__heading h3 {
  margin: 3px 0 2px;
  font-size: 18px;
}

.superfrete-bag-panel__heading p,
.superfrete-bag-panel__feedback,
.superfrete-bag-panel__option span,
.superfrete-bag-panel__label span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.superfrete-bag-panel__notice,
.superfrete-bag-panel__error {
  padding: 10px 12px;
  border: 1px solid #f0c36b;
  border-radius: 10px;
  background: #fff8e7;
  color: #8a4b08;
  font-size: 13px;
}

.superfrete-bag-panel__package {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.superfrete-bag-panel__field,
.superfrete-bag-panel__label,
.superfrete-bag-panel__option > div {
  display: grid;
  gap: 5px;
}

.superfrete-bag-panel__field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.superfrete-bag-panel__field input {
  width: 100%;
}

.superfrete-bag-panel__summary {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-left: 3px solid #0f766e;
  background: #fff;
}

.superfrete-bag-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.superfrete-bag-panel__options {
  display: grid;
  gap: 8px;
}

.superfrete-bag-panel__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.superfrete-bag-panel__option.is-unavailable {
  opacity: .68;
  background: #f8fafc;
}

@media (max-width: 720px) {
  .superfrete-bag-panel {
    padding: 14px;
  }

  .superfrete-bag-panel__heading,
  .superfrete-bag-panel__option {
    align-items: stretch;
    flex-direction: column;
  }

  .superfrete-bag-panel__status {
    align-self: flex-start;
  }

  .superfrete-bag-panel__package {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .superfrete-bag-panel__actions .btn,
  .superfrete-bag-panel__option .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Circular icon controls keep their own geometry when mobile touch defaults apply. */
body button[type="button"]:is(.product-form__info-button, .product-form__measurement-help, .bulk-filter-help),
body .product-form__selected-chip > button[type="button"] {
  --circle-size: 24px;
  position: relative;
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  flex: 0 0 var(--circle-size);
  width: var(--circle-size);
  min-width: var(--circle-size);
  max-width: var(--circle-size);
  height: var(--circle-size);
  min-height: var(--circle-size);
  max-height: var(--circle-size);
  padding: 0;
  border-radius: 50%;
  line-height: 1;
  vertical-align: middle;
}
body button.product-form__info-button { --circle-size: 28px; }
body .product-form__selected-chip > button[type="button"] { --circle-size: 22px; }
@media (max-width: 820px), (pointer: coarse) {
  body button[type="button"]:is(.product-form__info-button, .product-form__measurement-help, .bulk-filter-help)::after,
  body .product-form__selected-chip > button[type="button"]::after {
    content: '';
    position: absolute;
    width: 44px;
    height: 44px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
}

/* HU-563: image editor workspace, crop handles and grouped tools. */
.image-viewer__history { display: flex; flex-wrap: wrap; gap: 6px; }
.image-viewer__workspace { min-width: 0; }
.image-viewer__surface { position: relative; display: inline-block; flex: 0 0 auto; max-width: 100%; touch-action: none; line-height: 0; }
.image-viewer__surface canvas { display: block; border-radius: 0; background: repeating-conic-gradient(#e6e8eb 0% 25%, #fff 0% 50%) 0 0 / 16px 16px; }
.image-viewer__surface[data-mode="move"] { cursor: grab; }
.image-viewer__surface[data-mode="move"]:active { cursor: grabbing; }
.image-viewer__surface:is([data-mode="erase"], [data-mode="restore"], [data-mode="wand"]) { cursor: crosshair; }
.image-viewer__crop { position: absolute; box-sizing: border-box; border: 2px solid #fff; box-shadow: 0 0 0 999px rgba(15,23,42,.45); cursor: move; touch-action: none; }
.image-viewer__crop::before { content: ''; position: absolute; inset: 33.333% 0; border-block: 1px solid #ffffff80; pointer-events: none; }
.image-viewer__crop::after { content: ''; position: absolute; inset: 0 33.333%; border-inline: 1px solid #ffffff80; pointer-events: none; }
.image-viewer__preview { overflow: hidden; }
.image-viewer [hidden] { display: none !important; }
.image-viewer [data-handle] { position: absolute; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; border-radius: 0; transform: translate(-50%, -50%); z-index: 1; }
.image-viewer [data-handle]::after { content: ''; position: absolute; width: 12px; height: 12px; top: 16px; left: 16px; background: #fff; border: 2px solid #245dc4; border-radius: 3px; box-sizing: border-box; }
.image-viewer [data-handle="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.image-viewer [data-handle="n"] { left: 50%; top: 0; cursor: ns-resize; }
.image-viewer [data-handle="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.image-viewer [data-handle="e"] { left: 100%; top: 50%; cursor: ew-resize; }
.image-viewer [data-handle="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.image-viewer [data-handle="s"] { left: 50%; top: 100%; cursor: ns-resize; }
.image-viewer [data-handle="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.image-viewer [data-handle="w"] { left: 0; top: 50%; cursor: ew-resize; }
.image-viewer__hint { margin: 8px 0 0; color: #52606f; font-size: 12px; line-height: 1.4; }
.image-viewer__controls details { border-bottom: 1px solid #dde1e6; }
.image-viewer__controls summary { padding: 10px 0; font-size: 14px; font-weight: 700; cursor: pointer; }
.image-viewer__tool-body { display: grid; gap: 12px; padding: 4px 0 14px; }
.image-viewer__tool-body p, .image-viewer__export p { margin: 0; font-size: 12px; line-height: 1.5; color: #52606f; }
.image-viewer__range { display: flex; align-items: center; gap: 12px; }
.image-viewer__range input[type="range"] { flex: 1; width: 100%; min-width: 0; }
.image-viewer__range output { min-width: 44px; color: #52606f; text-align: right; font-variant-numeric: tabular-nums; }
.image-viewer__controls select { width: 100%; min-width: 0; box-sizing: border-box; min-height: 44px; padding: 8px; font-size: 16px; }
.image-viewer__btn { min-height: 44px; }
.image-viewer__btn[aria-pressed="true"] { border-color: #245dc4; background: #edf3ff; color: #174891; }
.image-viewer__btn:disabled { opacity: .45; cursor: default; }
.image-viewer__export { display: grid; gap: 10px; padding-top: 4px; }
.image-viewer :is(button, canvas, input, select, summary):focus-visible { outline: 3px solid #245dc4; outline-offset: 2px; }
@media (max-width: 900px) {
  .image-viewer__workspace { position: sticky; top: 0; z-index: 2; background: #fff; padding-bottom: 8px; }
  .image-viewer__preview { min-height: 0; }
  body .image-viewer__preview { min-height: 0; }
  .image-viewer__hint { font-size: 12px; }
  .image-viewer__panel { width: min(980px, 96vw); box-sizing: border-box; padding: 12px; }
}

.image-viewer__content { scrollbar-gutter: stable; }

.image-viewer__workspace { position: sticky; top: 0; align-self: start; }
.image-viewer__footer { padding-top: 10px; border-top: 1px solid #dde1e6; }
.image-viewer__note { margin: 0; min-height: 0; line-height: 1.4; }
.image-viewer__note:empty { display: none; }

.image-viewer__crop-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.image-viewer__crop-fields label { display: grid; gap: 4px; font-weight: 600; }
.image-viewer__crop-fields input { width: 100%; box-sizing: border-box; font-size: 16px; min-height: 44px; }
.image-viewer__cursor { position: absolute; width: 18px; height: 18px; border: 2px solid #245dc4; box-shadow: 0 0 0 2px white; border-radius: 50%; transform: translate(-50%,-50%); pointer-events: none; z-index: 2; }
