:root {
  --color-primary: #01696f;
  --color-bg: #f7f6f2;
  --color-surface: #f9f8f5;
  --color-text: #28251d;
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 80 / 0.08);
}

body {
  font-family: 'Satoshi', Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  margin: 0;
  min-height: 100vh;
}

* {
  box-sizing: border-box;
}

#app {
  min-height: 100vh;
}

.login-wrapper {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-8);
  background:
    radial-gradient(circle at top left, rgba(1, 105, 111, 0.16), transparent 30%),
    linear-gradient(135deg, #f7f6f2 0%, #efe7da 100%);
}

.login-form {
  width: min(100%, 420px);
  display: grid;
  gap: 1rem;
  padding: 2rem;
  border-radius: 1.25rem;
  background: rgba(249, 248, 245, 0.92);
  box-shadow: var(--shadow-md);
}

.login-form label {
  display: grid;
  gap: 0.5rem;
  font-size: var(--text-sm);
}

.form-support {
  margin: 0;
  color: #625e55;
  font-size: var(--text-sm);
  line-height: 1.5;
}

.form-message {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

.form-message-error {
  color: #8c1d18;
  background: #fdebea;
  border: 1px solid #efb8b6;
}

.form-message-success {
  color: #1c6b2d;
  background: #e9f7ec;
  border: 1px solid #b9e2c1;
}

.inline-banner {
  margin-bottom: 1rem;
}

.oauth-return-banner {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid transparent;
}

.oauth-return-banner__icon {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1rem;
}

.oauth-return-banner__title {
  display: block;
  font-size: var(--text-sm);
  margin-bottom: 0.35rem;
}

.oauth-return-banner__detail,
.oauth-return-banner__hint {
  margin: 0.25rem 0 0;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: #3d3a33;
}

.oauth-return-banner__hint {
  color: #625e55;
  margin-top: 0.5rem;
}

.oauth-return-banner__body {
  flex: 1;
  min-width: 0;
}

.oauth-return-banner__dismiss {
  margin-top: 0.75rem;
  align-self: flex-start;
}

.oauth-return-banner--success {
  background: linear-gradient(135deg, #e8f5f0 0%, #d8efe8 55%, #ecf8f4 100%);
  border-color: #9ccfc4;
}

.oauth-return-banner--success .oauth-return-banner__icon {
  background: var(--color-primary);
  color: #fff;
}

.oauth-return-banner--error {
  background: linear-gradient(135deg, #fdebea 0%, #fce8e6 100%);
  border-color: #efb8b6;
}

.oauth-return-banner--error .oauth-return-banner__icon {
  background: #b91c1c;
  color: #fff;
}

.change-password-wrapper {
  min-height: calc(100vh - 88px);
}

.login-form input,
.filters-bar input,
.filters-bar select {
  min-height: 44px;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(40, 37, 29, 0.2);
  background: #fff;
  font: inherit;
}

.login-form button,
.filters-bar button,
.pagination button,
.products-table td button,
.error-state button,
.empty-state button,
.sort-button {
  min-height: 44px;
}

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

/* Header, sidebar, layout base */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo { font-size: 2rem; }
.title { font-size: var(--text-xl); font-weight: 700; }
.user-menu { display: flex; align-items: center; gap: var(--space-4); }
.user-menu button { background: none; border: none; color: var(--color-primary); cursor: pointer; font-size: var(--text-base); }
.header-brand { display: inline-flex; align-items: center; gap: 0.7rem; }
.sidebar-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(40, 37, 29, 0.2);
  border-radius: 10px;
  background: #fff;
  color: var(--color-primary);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
}

.sidebar {
  position: fixed;
  left: 0; top: 64px; bottom: 0;
  width: 220px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4) 0;
}
.sidebar nav ul { list-style: none; padding: 0; margin: 0; }
.sidebar nav li { margin-bottom: var(--space-4); }
.sidebar nav a { color: var(--color-primary); text-decoration: none; font-size: var(--text-base); padding: 8px 24px; display: block; border-radius: var(--radius-md); }
.sidebar nav a:hover, .sidebar nav a.active { background: var(--color-bg); }

.content {
  margin-left: 240px;
  padding: var(--space-8);
  min-height: 100vh;
}

body.sidebar-collapsed .sidebar {
  transform: translateX(-110%);
  transition: transform 0.2s ease;
}
body.sidebar-collapsed .content {
  margin-left: 0;
}

/* Tabella prodotti */
.products-section { max-width: 1200px; margin: 0 auto; }
.authorizations-section {
  display: grid;
  gap: 1rem;
}
.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.auth-card {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid rgba(40, 37, 29, 0.12);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
  align-content: start;
}
.auth-card h4 {
  margin: 0.5rem 0 0.25rem;
  line-height: 1.3;
}
.auth-card-title {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
}
.brand-logo {
  width: 20px;
  height: 20px;
}
.brand-logo-amazon {
  filter: invert(56%) sepia(86%) saturate(950%) hue-rotate(354deg) brightness(102%) contrast(102%);
}
.brand-logo-shopify {
  filter: invert(42%) sepia(53%) saturate(547%) hue-rotate(88deg) brightness(96%) contrast(93%);
}
.auth-form {
  display: grid;
  gap: 0.7rem;
}
.auth-form label {
  display: grid;
  gap: 0.35rem;
  font-size: var(--text-sm);
}
.auth-protected-field {
  display: grid;
  gap: 0.35rem;
}
.auth-protected-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.auth-options-box {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid rgba(40, 37, 29, 0.12);
  border-radius: 0.7rem;
  background: rgba(255, 153, 0, 0.06);
}
.auth-options-box .form-support {
  margin: 0;
}
.auth-form .auth-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: var(--text-sm);
}
.auth-form .auth-checkbox-row input {
  min-height: auto;
  width: 18px;
  height: 18px;
  padding: 0;
}
.auth-edit-btn {
  white-space: nowrap;
}
.shopify-status-box {
  padding: 0.75rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(40, 37, 29, 0.12);
  background: rgba(1, 105, 111, 0.06);
  font-size: var(--text-sm);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.auth-form input {
  min-height: 44px;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(40, 37, 29, 0.2);
  background: #fff;
  font: inherit;
}
.auth-form .drawer-footer {
  position: static;
  padding-top: 0.5rem;
  background: transparent;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.auth-actions {
  gap: 0.6rem;
}
.sales-toolbar {
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  margin-bottom: 0.9rem;
}
.sales-toolbar input,
.sales-toolbar select {
  min-height: 38px;
  border-radius: 0.6rem;
  border: 1px solid rgba(40, 37, 29, 0.2);
  padding: 0.45rem 0.7rem;
  background: #fff;
}
.activity-log-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 1rem 0;
}
.activity-log-search input {
  flex: 1;
  min-width: 260px;
}
.activity-log-search input,
.activity-log-search select {
  min-height: 38px;
  border: 1px solid rgba(40, 37, 29, 0.2);
  border-radius: 0.6rem;
  padding: 0.55rem 0.75rem;
  background: #fff;
  color: var(--color-text);
}
.activity-log-list {
  display: grid;
  gap: 0.9rem;
}
.activity-log-card {
  border: 1px solid rgba(40, 37, 29, 0.12);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}
.activity-log-card__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.activity-log-card h3 {
  margin: 0.15rem 0 0;
  font-size: var(--text-lg);
}
.activity-log-date,
.activity-log-meta {
  color: #616161;
  font-size: var(--text-sm);
}
.activity-log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.55rem;
}
.activity-log-message {
  margin: 0.75rem 0 0;
}
.activity-log-essential {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin-top: 0.65rem;
  color: #3d3528;
  font-size: var(--text-sm);
}
.activity-log-explanation {
  margin: 0.5rem 0 0;
  color: #5b4b2f;
  font-size: var(--text-sm);
}
.activity-log-summary {
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-lg);
  background: rgba(34, 197, 94, 0.08);
  padding: 0.8rem 1rem;
  margin: 0.8rem 0 1rem;
  display: grid;
  gap: 0.25rem;
}
.activity-log-summary-error {
  border-color: rgba(220, 38, 38, 0.22);
  background: rgba(220, 38, 38, 0.08);
}
.activity-log-summary p {
  margin: 0;
}
.activity-log-status {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: var(--text-sm);
  font-weight: 700;
  background: rgba(92, 64, 51, 0.08);
  color: #616161;
}
.activity-log-status-ok {
  background: rgba(34, 197, 94, 0.14);
  color: #166534;
}
.activity-log-status-error {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
}
.activity-log-status-running {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}
.activity-log-status-done {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}
.activity-log-details {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(92, 64, 51, 0.06);
  font-size: var(--text-sm);
}
.activity-log-details summary {
  cursor: pointer;
  font-weight: 700;
}
.activity-log-detail-grid {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.activity-log-detail-row {
  display: grid;
  grid-template-columns: minmax(120px, 220px) 1fr;
  gap: 0.75rem;
  align-items: baseline;
}
.activity-log-detail-row span {
  overflow-wrap: anywhere;
}
.activity-log-details pre {
  margin: 0.75rem 0 0;
  overflow: auto;
  white-space: pre-wrap;
}
.products-section.sales-page {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}
.sales-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}
.sales-line-chart {
  border: 1px solid rgba(40, 37, 29, 0.12);
  border-radius: 0.8rem;
  background: #fff;
  padding: 0.85rem 1rem 0.65rem;
  margin: 0.85rem 0 1rem;
  overflow: hidden;
}
.sales-line-chart-head {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.sales-line-chart-controls {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.sales-chart-toggle--active {
  border-color: rgba(196, 85, 0, 0.55);
  background: rgba(196, 85, 0, 0.08);
  font-weight: 600;
}
.sales-line-svg-wrap {
  position: relative;
  width: 100%;
}
.sales-line-chart-head strong {
  font-size: 1rem;
}
.sales-line-chart-sub {
  font-size: 0.82rem;
  color: #616161;
}
.sales-line-svg {
  width: 100%;
  height: clamp(140px, 28vw, 220px);
  display: block;
}
.sales-line-path {
  stroke: #c45500;
  stroke-width: 1.35;
  vector-effect: non-scaling-stroke;
}
.sales-line-path--revenue {
  stroke: #c45500;
}
.sales-line-path--margin {
  stroke: #1565c0;
  stroke-dasharray: 4 3;
  stroke-width: 1.15;
}
.sales-line-dot {
  fill: #c45500;
  stroke: #fff;
  stroke-width: 0.35;
  vector-effect: non-scaling-stroke;
}
.sales-line-dot--rev {
  fill: #c45500;
}
.sales-line-dot--mar {
  fill: #1565c0;
}
.sales-line-labels {
  display: flex;
  justify-content: space-between;
  gap: 0.2rem;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  color: #616161;
  flex-wrap: nowrap;
}
.sales-line-x {
  flex: 1 1 0;
  text-align: center;
  min-width: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}
.sales-line-day {
  font-weight: 600;
  color: #3a3630;
}
.sales-line-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-size: 0.62rem;
}
.sales-line-stack-rev {
  color: #a34a00;
}
.sales-line-stack-mar {
  color: #1565c0;
}
.sales-listino-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sales-listino-badge--s {
  background: rgba(21, 101, 192, 0.12);
  color: #0d47a1;
  border: 1px solid rgba(13, 71, 161, 0.25);
}
.sales-listino-badge--m {
  background: rgba(97, 97, 97, 0.1);
  color: #424242;
  border: 1px solid rgba(66, 66, 66, 0.2);
}
.sales-order-id-link {
  color: #1565c0;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sales-order-id-link:hover {
  color: #0d47a1;
}
.sales-order-drawer .sales-order-summary-card {
  margin: 0 0 0.25rem;
}
.sales-order-meta-grid {
  margin-top: 0.5rem;
}
.sales-order-totals p {
  margin: 0.25rem 0;
}
.empty-state--compact {
  margin: 0.6rem 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.92rem;
}
.sales-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  border: 1px solid rgba(40, 37, 29, 0.12);
  border-radius: 0.8rem;
  background: #fff;
  min-height: 170px;
  padding: 0.8rem 0.7rem 0.5rem;
  margin: 0.8rem 0 1rem;
}
.sales-bar-wrap {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  min-width: 52px;
}
.sales-bar {
  width: 24px;
  border-radius: 0.45rem 0.45rem 0.1rem 0.1rem;
  background: linear-gradient(180deg, #ffb347 0%, #ff9900 100%);
}
.sales-bar-day {
  font-size: 0.75rem;
  color: #616161;
}
.order-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  padding: 0.22rem 0.52rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.order-status-shipped {
  background: #eafaf1;
  color: #1c7c48;
  border-color: #8dd8ae;
}
.order-status-unshipped {
  background: #fff7e8;
  color: #a15a07;
  border-color: #f1c27b;
}
.order-status-pending {
  background: #fff3e3;
  color: #9a5a00;
  border-color: #efc17b;
}
.order-status-partially-shipped {
  background: #eaf2ff;
  color: #2659b8;
  border-color: #9ab8f2;
}
.order-status-canceled {
  background: #ffecef;
  color: #b4233e;
  border-color: #f3a5b4;
}
.order-status-invoice-unconfirmed {
  background: #f6f0ff;
  color: #6d3bb7;
  border-color: #c8afe9;
}
.order-status-unknown {
  background: #f2f4f7;
  color: #556070;
  border-color: #d6dce5;
}
.sales-chat-fab {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid #d7dbe3;
  background: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
  z-index: 40;
}
.sales-chatbox {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  width: 360px;
  max-width: calc(100vw - 2.4rem);
  border: 1px solid rgba(40, 37, 29, 0.16);
  border-radius: 0.8rem;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.22);
  z-index: 40;
}
.sales-chatbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid rgba(40, 37, 29, 0.12);
}
.sales-chatbox-body {
  max-height: 280px;
  overflow: auto;
  padding: 0.65rem;
  display: grid;
  gap: 0.5rem;
}
.sales-chat-msg {
  padding: 0.5rem 0.6rem;
  border-radius: 0.6rem;
  font-size: 0.88rem;
  line-height: 1.35;
}
.sales-chat-msg-user {
  background: #eef2ff;
  color: #1f2a44;
}
.sales-chat-msg-assistant {
  background: #f7f7f9;
  color: #2b2f38;
}
.sales-chat-feedback {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
}
.sales-chatbox-input {
  display: flex;
  gap: 0.45rem;
  padding: 0.6rem;
  border-top: 1px solid rgba(40, 37, 29, 0.12);
}
.sales-chatbox-input input {
  flex: 1;
  min-height: 38px;
  border-radius: 0.55rem;
  border: 1px solid rgba(40, 37, 29, 0.2);
  padding: 0.45rem 0.6rem;
}
.sales-chatbox-input button {
  min-width: 70px;
}
.auth-btn {
  min-height: 38px;
  padding: 0.5rem 0.9rem;
  border-radius: 0.6rem;
  border: 1px solid transparent;
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: pointer;
  font-weight: 600;
}
.auth-btn-amazon {
  background: #ff9900;
  color: #111;
  border-color: #e07f00;
}
.auth-btn-amazon:hover {
  background: #f08f00;
}
.auth-btn-shopify {
  background: #95bf47;
  color: #113111;
  border-color: #7aa132;
}
.auth-btn-shopify:hover {
  background: #86ad3f;
}
.auth-btn-shopify-secondary {
  background: #eef6df;
  color: #2b4f19;
  border-color: #95bf47;
}
.auth-btn-shopify-secondary:hover {
  background: #e4f0cf;
}
.auth-btn-shopify-outline {
  background: transparent;
  color: #5c4033;
  border-color: rgba(92, 64, 51, 0.45);
}
.auth-btn-shopify-outline:hover {
  background: rgba(92, 64, 51, 0.06);
}
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  align-items: start;
}

.filters-stack {
  display: grid;
  gap: 0.85rem;
  flex: 1 1 720px;
}

.filters-bar input[type="text"] {
  flex: 1;
  min-width: 320px;
}

.advanced-filters-panel {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid rgba(40, 37, 29, 0.12);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.82);
}

.advanced-filters-header {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
}

.advanced-filters-header strong {
  display: block;
  margin-bottom: 0.15rem;
}

.advanced-filters-header p {
  margin: 0;
  color: #6b675d;
  font-size: var(--text-sm);
}

.advanced-filters-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.advanced-filters-list {
  display: grid;
  gap: 0.75rem;
}

.advanced-filter-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(150px, 1fr) minmax(180px, 1.2fr) auto;
  gap: 0.75rem;
  align-items: center;
}
.filters-bar button {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-size: var(--text-base);
  cursor: pointer;
}
.filters-bar button[type="button"] {
  background: #eee;
  color: var(--color-text);
  border: 1px solid #ccc;
}

.results-count-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.results-toolbar-left,
.results-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.results-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(1, 105, 111, 0.12);
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: 600;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(40, 37, 29, 0.08);
  color: var(--color-text);
  font-size: var(--text-sm);
}

.removable-chip {
  border: 1px solid rgba(40, 37, 29, 0.1);
  cursor: pointer;
}

.removable-chip:hover {
  background: rgba(40, 37, 29, 0.14);
}

.results-meta,
.results-count {
  font-size: var(--text-sm);
  color: #6b675d;
}

.table-shell {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.products-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  min-width: 1100px;
}
.products-table th, .products-table td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid #ececec;
  vertical-align: top;
}
.products-table th {
  background: var(--color-bg);
  font-size: var(--text-sm);
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
}
.products-table th:last-child,
.products-table td:last-child {
  position: sticky;
  right: 0;
  background: var(--color-surface);
  box-shadow: -10px 0 16px rgba(249, 248, 245, 0.96);
}

.products-table th:last-child {
  background: var(--color-bg);
}
.stock-products-table th:first-child,
.stock-products-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--color-surface);
  box-shadow: 10px 0 16px rgba(249, 248, 245, 0.96);
}
.stock-products-table th:first-child {
  background: var(--color-bg);
  z-index: 3;
}
.stock-products-table th:last-child,
.stock-products-table td:last-child {
  position: static;
  right: auto;
  box-shadow: none;
}
.products-table tr:hover {
  background: #f0f6f7;
}
.products-table tr:hover td:last-child {
  background: #f0f6f7;
}
.products-table td button {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 4px 12px;
  cursor: pointer;
  font-size: var(--text-sm);
}
.ghost-button {
  min-height: 44px;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(40, 37, 29, 0.18);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  font: inherit;
}

.ghost-button:hover {
  background: rgba(1, 105, 111, 0.06);
}

.small-button {
  min-height: 36px;
  padding: 0.45rem 0.75rem;
  font-size: var(--text-sm);
}
.task-table select {
  min-height: 38px;
  border-radius: 0.5rem;
  border: 1px solid rgba(40, 37, 29, 0.2);
  padding: 0.35rem 0.55rem;
  background: #fff;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-switch input:not(:disabled) + .toggle-slider {
  cursor: pointer;
}
.toggle-slider {
  position: absolute;
  cursor: default;
  inset: 0;
  background: #c5c5c5;
  border-radius: 999px;
  transition: background 0.2s ease;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}
.toggle-switch input:checked + .toggle-slider {
  background: #0f8a5f;
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}
.products-table td button:hover {
  background: #01484b;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
}

.image-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 0.75rem;
  background: rgba(1, 105, 111, 0.08);
  overflow: hidden;
}

.image-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cell-empty {
  color: #9a9589;
}

.numeric-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.title-cell {
  display: inline-flex;
  align-items: start;
  gap: 0.5rem;
}

.variant-indicator {
  width: 0.7rem;
  height: 0.7rem;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: var(--variant-color, var(--color-primary));
  flex: 0 0 auto;
}

.clamped-text {
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 360px;
  line-height: 1.45;
}

.actions-column {
  min-width: 68px;
  width: 68px;
}

.actions-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 68px;
  white-space: nowrap;
}
.row-action-btn {
  min-height: 28px !important;
  min-width: 28px;
  padding: 2px 6px !important;
  font-size: 0.85rem !important;
  border-radius: 8px !important;
  line-height: 1 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.row-action-edit {
  background: #0b6ac9 !important;
}
.row-action-specific {
  background: #0f8a5f !important;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(40, 37, 29, 0.28);
  z-index: 40;
}

.product-drawer {
  width: min(92vw, 960px);
  height: 100vh;
  overflow-y: auto;
  background: var(--color-surface);
  box-shadow: -8px 0 24px rgba(40, 37, 29, 0.12);
  padding: 1.5rem;
  display: grid;
  gap: 1rem;
}

.sales-order-drawer.product-drawer {
  width: min(98vw, 1180px);
}

.specific-panel {
  width: min(72vw, 980px);
  height: 100vh;
  overflow-y: auto;
  background: var(--color-surface);
  box-shadow: -8px 0 24px rgba(40, 37, 29, 0.12);
  padding: 1.5rem;
  display: grid;
  gap: 1rem;
}

.drawer-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.drawer-header h3 {
  margin: 0.2rem 0 0;
  font-size: 1.4rem;
}

.drawer-eyebrow {
  margin: 0;
  color: #6b675d;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.drawer-form {
  display: grid;
  gap: 1rem;
}

.drawer-section {
  display: grid;
  gap: 0.8rem;
  padding: 0.9rem;
  border: 1px solid rgba(40, 37, 29, 0.12);
  border-radius: 0.85rem;
  background: #fff;
}

.drawer-section--primary {
  gap: 1rem;
}

.drawer-title-field span {
  font-weight: 700;
}

.drawer-title-input {
  min-height: 52px !important;
  font-size: 1.08rem;
}

.drawer-inline-grid {
  display: grid;
  gap: 0.85rem;
}

.drawer-inline-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.drawer-inline-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.drawer-inline-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.drawer-section-header h4 {
  margin: 0.2rem 0 0;
  font-size: 1.15rem;
}

.drawer-section-note {
  margin: 0.35rem 0 0;
  color: #6b675d;
  font-size: var(--text-xs);
}

.drawer-images-block {
  display: grid;
  gap: 1rem;
}

.drawer-images-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.image-card {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(40, 37, 29, 0.12);
  background: #fff;
}

.image-card-preview-wrap {
  min-height: 140px;
  display: grid;
  place-items: center;
  border-radius: 0.85rem;
  overflow: hidden;
  background: rgba(1, 105, 111, 0.08);
}

.image-card-preview {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.image-card-placeholder {
  color: #6b675d;
  font-size: var(--text-sm);
}

.image-card-body {
  display: grid;
  gap: 0.75rem;
}

.image-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

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

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

.drawer-field {
  display: grid;
  gap: 0.45rem;
}

.drawer-field span {
  font-size: var(--text-sm);
  color: #4c483f;
}

.drawer-field input,
.drawer-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(40, 37, 29, 0.18);
  background: #fff;
  font: inherit;
}

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

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

.drawer-price-controls {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.drawer-price-field .drawer-price-input {
  width: auto;
  max-width: 9rem;
  min-height: 44px;
  flex: 0 1 9rem;
}

.drawer-apply-rule-btn {
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 44px;
}

.drawer-rule {
  border: 0;
  border-top: 1px solid rgba(40, 37, 29, 0.18);
  margin: 0.25rem 0;
}

.drawer-section--pricing .drawer-pricing-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.drawer-pricing-rule-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  justify-content: flex-end;
}

.drawer-pricing-rule-label {
  font-size: var(--text-sm);
  color: #4c483f;
}

@media (max-width: 640px) {
  .drawer-section--pricing .drawer-pricing-grid {
    grid-template-columns: 1fr;
  }
}

.drawer-richtext-wrap {
  display: grid;
  gap: 0.65rem;
}

.drawer-richtext-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.drawer-richtext-editor {
  min-height: 170px;
  border: 1px solid rgba(40, 37, 29, 0.18);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.9rem;
  background: #fff;
  line-height: 1.45;
}

.drawer-richtext-editor:focus {
  outline: 2px solid rgba(1, 105, 111, 0.24);
  border-color: rgba(1, 105, 111, 0.3);
}

.drawer-image-section {
  display: grid;
  place-items: center;
  min-height: 180px;
  border-radius: 1rem;
  background: rgba(1, 105, 111, 0.08);
  overflow: hidden;
}

.drawer-image-preview {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

.drawer-image-placeholder {
  color: #6b675d;
}

.specific-product-summary {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(1, 105, 111, 0.06);
}

.specific-product-summary h4,
.specific-product-summary p {
  margin: 0;
}

.specific-summary-image {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 1rem;
  background: rgba(1, 105, 111, 0.1);
}

.specific-summary-image.placeholder {
  display: grid;
  place-items: center;
  color: #6b675d;
  font-size: var(--text-sm);
}

.specific-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  align-items: start;
}

.specific-card {
  display: grid;
  gap: 0.75rem;
  min-height: 132px;
  padding: 0.85rem 0.9rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(40, 37, 29, 0.12);
  background: #fff;
  box-shadow: var(--shadow-sm);
  align-content: space-between;
}

.specific-card:hover {
  border-color: rgba(1, 105, 111, 0.2);
  box-shadow: var(--shadow-md);
}

.specific-card-actions,
.specific-actions-head,
.specific-editor-header,
.specific-editor-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.specific-card-body {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.specific-name-label {
  margin: 0;
  font-size: var(--text-xs);
  color: #6b675d;
  letter-spacing: 0.04em;
}

.specific-value-text {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.specific-card-actions {
  justify-content: flex-start;
  gap: 0.5rem;
  padding-top: 0.15rem;
  border-top: 1px solid rgba(40, 37, 29, 0.08);
}

.specific-card-actions .small-button {
  min-height: 32px;
  padding: 0.35rem 0.65rem;
}

.specific-card-editor {
  min-height: auto;
  padding: 0;
  overflow: hidden;
  border-color: rgba(1, 105, 111, 0.16);
  background: linear-gradient(180deg, rgba(1, 105, 111, 0.05), rgba(255, 255, 255, 0.95));
}

.specific-card-editor-new {
  grid-column: 1 / -1;
}

.specific-editor {
  display: grid;
  gap: 0.85rem;
  padding: 0.9rem;
}

.specific-editor h4 {
  margin: 0;
  font-size: 1rem;
}

.specific-editor .drawer-field span {
  font-size: var(--text-xs);
  color: #6b675d;
}

.specific-editor .drawer-field textarea {
  min-height: 90px;
}

.danger-button {
  color: #8c1d18;
  border-color: rgba(140, 29, 24, 0.2);
}

.danger-button:hover {
  background: rgba(140, 29, 24, 0.06);
}

.drawer-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  position: sticky;
  bottom: 0;
  padding-top: 1rem;
  background: linear-gradient(180deg, rgba(249, 248, 245, 0), rgba(249, 248, 245, 0.96) 28%);
}

.empty-state {
  padding: var(--space-8);
  text-align: center;
  color: #888;
  background: #fffbe6;
  border-radius: var(--radius-md);
  margin-top: var(--space-4);
}

.error-state {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  color: #8c1d18;
  background: #fdebea;
  border: 1px solid #efb8b6;
  border-radius: var(--radius-md);
}

.skeleton-table {
  display: grid;
  gap: 0.75rem;
}

.skeleton-row {
  height: 56px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(1, 105, 111, 0.08), rgba(1, 105, 111, 0.16), rgba(1, 105, 111, 0.08));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

.pagination {
  margin: var(--space-4) 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.pagination-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: #6b675d;
  font-size: var(--text-sm);
}

.pagination select {
  min-height: 42px;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(40, 37, 29, 0.18);
  background: #fff;
  font: inherit;
}

.pagination-status {
  color: #6b675d;
  font-size: var(--text-sm);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(1, 105, 111, 0.28);
  outline-offset: 2px;
}

@media (max-width: 1024px) {
  .sidebar {
    width: 88px;
  }

  .sidebar nav a {
    padding-inline: 1rem;
    text-align: center;
  }

  .content {
    margin-left: 104px;
  }
}

@media (max-width: 768px) {
  .header {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .sidebar {
    position: static;
    width: auto;
    padding: 0 var(--space-4) var(--space-4);
    box-shadow: none;
  }

  .content {
    margin-left: 0;
    padding: 1rem;
  }

  .sales-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .sales-toolbar .auth-btn {
    width: 100%;
    justify-content: center;
  }

  .sales-toolbar input[type="text"],
  .sales-toolbar input[type="date"],
  .sales-toolbar select {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }

  .products-table {
    min-width: 900px;
  }

  .sales-orders-table .products-table {
    min-width: 1040px;
  }

  .sales-orders-table .products-table th,
  .sales-orders-table .products-table td {
    padding: 10px 6px;
  }

  .advanced-filter-row {
    grid-template-columns: 1fr;
  }

  .product-drawer {
    width: 100vw;
  }

  .specific-panel {
    width: 100vw;
  }

  .drawer-grid {
    grid-template-columns: 1fr;
  }

  .drawer-inline-grid--two,
  .drawer-inline-grid--three,
  .drawer-inline-grid--four {
    grid-template-columns: 1fr;
  }

  .drawer-images-grid {
    grid-template-columns: 1fr;
  }

  .specific-product-summary {
    grid-template-columns: 1fr;
  }

  .specific-grid {
    grid-template-columns: 1fr;
  }
  .auth-grid {
    grid-template-columns: 1fr;
  }
}

/* === Sync canali (Shopify oggi) === */
.sidebar-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: middle;
}
.sync-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.sync-badge--synced { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.sync-badge--force { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.sync-badge--dirty { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.sync-badge--queued { background: #e0f2fe; color: #075985; border-color: #7dd3fc; }
.sync-badge--processing { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }
.sync-badge--error { background: #fee2e2; color: #991b1b; border-color: #fca5a5; cursor: help; }

.sync-quick-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  margin-bottom: 12px;
}
.sync-chip { font-weight: 500; }
.sync-chip--active {
  background: #2563eb !important;
  color: #fff !important;
  border-color: #2563eb !important;
}

.sync-column { width: 44px; padding-left: 6px; padding-right: 6px; text-align: center; vertical-align: middle; }
.shopify-sync-th,
.amazon-sync-th { padding-top: 10px; padding-bottom: 10px; }
.channel-column-icon,
.shopify-column-icon {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto;
}
.amazon-column-icon {
  overflow: visible;
}
.sync-cell {
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}
.sync-channel-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.sync-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}
.sync-dot--green { background: #22c55e; }
.sync-dot--red { background: #ef4444; }
.sync-dot--yellow { background: #eab308; }
.sync-lock {
  font-size: 0.72rem;
  line-height: 1;
}

.drawer-shopify-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
  font-size: 1rem;
}
.drawer-shopify-icon-wrap .channel-column-icon,
.drawer-shopify-icon-wrap .shopify-column-icon {
  width: 20px;
  height: 20px;
}
.drawer-sync-state-label {
  font-weight: 500;
  color: #334155;
  font-size: 0.9rem;
}

.drawer-input-readonly {
  background: #f1f5f9 !important;
  color: #475569 !important;
  cursor: not-allowed;
  border-style: dashed;
}
.drawer-brand-shid-row {
  margin-top: 4px;
}
.drawer-repricing-toggle {
  margin-top: 6px;
  margin-bottom: 4px;
}
.drawer-field-hint {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: #64748b;
}

.sync-queue-page .page-subtitle { color: #64748b; margin-top: -8px; margin-bottom: 14px; }
.sync-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.sync-summary-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sync-summary-num { font-size: 1.6rem; font-weight: 700; }
.sync-summary-label { font-size: 0.85rem; color: #64748b; }
.sync-summary-meta { font-size: 0.85rem; color: #334155; }
.sync-summary-card--dirty { border-color: #fcd34d; }
.sync-summary-card--force { border-color: #fcd34d; }
.sync-summary-card--queued { border-color: #7dd3fc; }
.sync-summary-card--processing { border-color: #c4b5fd; }
.sync-summary-card--error { border-color: #fca5a5; }
.sync-summary-card--synced { border-color: #a7f3d0; }
.sync-summary-card--last { background: #f8fafc; }

.sync-queue-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.sync-queue-toolbar input[type="text"] {
  flex: 1 1 240px;
  min-width: 200px;
  padding: 6px 10px;
}
.sync-queue-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1 1 100%;
}
.sync-error-cell {
  max-width: 280px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #b91c1c;
  font-size: 0.85rem;
}
.sync-actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.sync-reports-block { margin-top: 24px; }
.sync-report-details {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 6px;
  max-height: 320px;
  overflow: auto;
  font-size: 0.8rem;
}

.drawer-sync-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 24px 0;
}
.drawer-sync-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.drawer-sync-error {
  margin: 8px 0 0;
  padding: 8px 10px;
  background: #fee2e2;
  border-radius: 6px;
  color: #991b1b;
  font-size: 0.85rem;
  white-space: pre-wrap;
}
.drawer-sync-meta { margin: 4px 0 0; color: #475569; font-size: 0.8rem; }

@media (max-width: 700px) {
  .sync-actions-cell { flex-direction: column; }
  .sync-error-cell { max-width: 200px; }
}

/* Repricing rules */
.repricing-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
}
.repricing-draft-card {
  margin-top: 24px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  max-width: 920px;
}
.repricing-draft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px 16px;
  margin-top: 12px;
}
.repricing-draft-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; }
.repricing-draft-grid input, .repricing-draft-grid select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}
.repricing-check { flex-direction: row !important; align-items: center; gap: 8px !important; }
.repricing-draft-actions { margin-top: 14px; display: flex; gap: 10px; }
.repricing-actions { white-space: nowrap; }
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  z-index: 1200;
  padding: 16px;
}
.modal-dialog {
  background: #fff;
  border-radius: 12px;
  padding: 20px 22px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-md);
}
.modal-dialog h3 { margin: 0 0 8px; font-size: 1.1rem; }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; justify-content: flex-end; }
.fees-preview-msg { margin: 10px 0 0; font-size: 0.95rem; color: #0f766e; }
.repricing-table .ghost-button.danger { color: #b91c1c; }

.repricing-draft-active-first {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  margin-bottom: 14px;
}
.repricing-draft-inner--dim {
  opacity: 0.5;
  filter: grayscale(0.15);
}
.repricing-inactive-hint {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 0.88rem;
  color: #475569;
}
.repricing-nogest-flag {
  margin: 12px 0 8px;
  font-weight: 600;
}
.repricing-nogest-banner {
  margin: 0 0 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #f59e0b;
  border-radius: 10px;
  color: #78350f;
  font-size: 0.95rem;
  line-height: 1.45;
}
.repricing-draft--nogest .repricing-nogest-banner { display: block !important; }
.repricing-fields-dimmed {
  opacity: 0.45;
  pointer-events: none;
}
.repricing-help-hint {
  margin: -4px 0 12px;
  font-size: 0.82rem;
  color: #64748b;
}
.repricing-x-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.repricing-calc-btn {
  flex-shrink: 0;
  padding: 4px 8px;
  font-size: 1rem;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
}
.repricing-calc-btn:hover { background: #f8fafc; border-color: #94a3b8; }
.repricing-row-inactive td { color: #94a3b8; background: #f8fafc; }
.repricing-badge-warn {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 600;
  font-size: 0.85rem;
}

.categories-page-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.categories-page-logo {
  width: 28px;
  height: 28px;
}
.sidebar-nav-icon {
  width: 16px;
  height: 16px;
  vertical-align: -2px;
  margin-right: 0.35rem;
}
.categories-shopify-col-head {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.categories-keywords-cell {
  min-width: 220px;
  vertical-align: top;
}
.categories-keywords-input {
  width: 100%;
  min-width: 200px;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(40, 37, 29, 0.18);
  border-radius: var(--radius-md);
  font: inherit;
  background: #fff;
}
.categories-shopify-cell {
  min-width: 240px;
  vertical-align: top;
}
.categories-mapped-label {
  font-size: var(--text-sm);
  color: #1a5c2e;
  line-height: 1.35;
}
.categories-unmapped-badge {
  display: inline-block;
  font-size: var(--text-xs);
  padding: 0.15rem 0.45rem;
  border-radius: 0.35rem;
  background: #fef3c7;
  color: #92400e;
}
.categories-actions-cell {
  white-space: nowrap;
}
.categories-toolbar {
  margin: 0.75rem 0 1rem;
}
