:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #221f33;
  background: #f7f6fb;
  --ink: #221f33;
  --muted: #716d82;
  --line: #dedbed;
  --surface: #ffffff;
  --violet: #8580c5;
  --violet-strong: #6f68b7;
  --violet-soft: #efedf8;
  --green: #22785b;
  --amber: #9a6a18;
}

/* Final cascade: keep the approved theme after legacy responsive rules. */
body .sidebar {
  color: var(--ink);
  background: rgba(255, 253, 249, 0.97);
  border-right: 1px solid rgba(77, 54, 82, 0.12);
  box-shadow: 12px 0 40px rgba(69, 45, 58, 0.04);
}

body .brand span,
body .nav a,
body .sidebar-status {
  color: var(--muted);
}

body .nav a.active,
body .nav a:hover {
  color: var(--ink);
  background: #f2e9e6;
}

body .shop-workspace {
  background:
    radial-gradient(circle at 100% 0, rgba(207, 123, 121, 0.1), transparent 32rem),
    rgba(255, 253, 249, 0.96);
}

body .product-image img,
body .shop-cart-thumb img {
  mix-blend-mode: normal;
}

@media (max-width: 760px) {
  body .nav.mobile-open {
    border-color: rgba(77, 54, 82, 0.12);
    background: #fffdfa;
    box-shadow: 0 24px 70px rgba(69, 45, 58, 0.2);
  }

  body .mobile-tabbar {
    border-color: rgba(77, 54, 82, 0.12);
    background: rgba(255, 253, 249, 0.98);
  }

  body .mobile-tabbar a.active {
    color: #fff;
    background: var(--rose);
  }

  body .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 390px) {
  body .product-grid {
    grid-template-columns: 1fr;
  }
}

.shop-cart-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shop-cart-top-actions .secondary-action {
  white-space: nowrap;
}

.product-actions-with-quantity {
  align-items: center;
}

.product-quantity {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.product-quantity button {
  width: 38px;
  height: 38px;
  border: 0;
  background: var(--violet-soft);
  color: var(--ink);
  font-size: 1.25rem;
  cursor: pointer;
}

.product-quantity button:disabled {
  opacity: .4;
  cursor: default;
}

.product-quantity span {
  min-width: 34px;
  text-align: center;
  font-weight: 800;
}

@media (max-width: 620px) {
  .shop-cart-heading {
    align-items: flex-start;
  }

  .shop-cart-top-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .shop-cart-top-actions .secondary-action {
    flex: 1;
  }
}

/* ODR 2026 visual system — approved warm editorial direction */
:root {
  --ink: #2f2032;
  --muted: #716b66;
  --line: #d8d4c8;
  --surface: #fffdf9;
  --violet: #8e81aa;
  --violet-strong: #4d3652;
  --violet-soft: #f3eef3;
  --green: #58735c;
  --amber: #a88344;
  --rose: #cf7b79;
  --rose-strong: #bb6768;
  --ivory: #faf7f1;
  background: var(--ivory);
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(207, 123, 121, 0.08), transparent 27rem),
    var(--ivory);
}

h1,
h2,
h3,
h4,
.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.sidebar {
  color: var(--ink);
  background: rgba(255, 253, 249, 0.96);
  border-right: 1px solid rgba(77, 54, 82, 0.12);
  box-shadow: 12px 0 40px rgba(69, 45, 58, 0.04);
}

.brand span,
.nav a,
.sidebar-status {
  color: var(--muted);
}

.nav a.active,
.nav a:hover {
  color: var(--ink);
  background: #f2e9e6;
}

.sidebar-status {
  border-color: var(--line);
  background: var(--ivory);
}

.main {
  padding: clamp(18px, 2.5vw, 40px);
}

.topbar {
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(77, 54, 82, 0.1);
}

.account-strip,
.workspace,
.panel,
.metric,
.profile-grid div {
  border-color: rgba(77, 54, 82, 0.13);
  background: rgba(255, 253, 249, 0.94);
  box-shadow: 0 14px 45px rgba(69, 45, 58, 0.055);
}

.primary-action,
.secondary-action,
.code-form button {
  color: #fff;
  background: var(--rose);
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.primary-action:hover,
.secondary-action:hover,
.code-form button:hover {
  background: var(--rose-strong);
  box-shadow: 0 8px 22px rgba(187, 103, 104, 0.22);
  transform: translateY(-1px);
}

.icon-button {
  color: var(--ink);
  background: #f3eceb;
}

.auth-screen {
  background:
    radial-gradient(circle at 15% 10%, rgba(207, 123, 121, 0.13), transparent 30rem),
    linear-gradient(145deg, #f5eee7, var(--ivory) 56%, #fff);
}

.auth-panel {
  border-color: rgba(77, 54, 82, 0.14);
  background: rgba(255, 253, 249, 0.91);
  box-shadow: 0 22px 80px rgba(69, 45, 58, 0.12);
}

.auth-tabs {
  background: #f3eceb;
}

.auth-tabs button.active {
  background: var(--rose);
}

.shop-workspace {
  overflow: visible;
  background:
    radial-gradient(circle at 100% 0, rgba(207, 123, 121, 0.1), transparent 32rem),
    rgba(255, 253, 249, 0.96);
}

.shop-workspace > .section-heading h2 {
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.05;
}

.shop-toolbar {
  flex-wrap: wrap;
  padding: 18px;
  border: 1px solid rgba(77, 54, 82, 0.12);
  border-radius: 18px;
  background: rgba(250, 247, 241, 0.72);
}

.shop-search {
  flex: 1 1 360px;
}

.shop-search input,
.shop-category-filter select {
  border-color: #bfc2ae;
  background: rgba(255, 253, 249, 0.96);
}

.shop-search input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(207, 123, 121, 0.12);
}

.shop-category-filter {
  min-width: min(100%, 250px);
}

.product-grid {
  gap: clamp(14px, 2vw, 24px);
}

.product-card {
  border-color: rgba(77, 54, 82, 0.11);
  border-radius: 16px;
  background: #fffdfa;
  box-shadow: 0 12px 30px rgba(69, 45, 58, 0.07);
}

.product-card:hover {
  box-shadow: 0 18px 42px rgba(69, 45, 58, 0.12);
}

.product-image {
  aspect-ratio: 1 / 1;
  margin: 8px;
  border-radius: 12px;
  background: #faf8f3;
}

.product-image img,
.shop-cart-thumb img {
  mix-blend-mode: normal;
}

.product-image > span {
  color: var(--ink);
  border: 1px solid rgba(77, 54, 82, 0.1);
  background: rgba(255, 253, 249, 0.9);
}

.product-copy {
  padding: 10px 14px 16px;
}

.product-copy h3 {
  color: var(--ink);
  font-family: inherit;
  font-weight: 650;
}

.product-price.on-sale strong,
#shop-discount-row strong {
  color: var(--rose-strong);
}

.product-actions a,
.product-actions button {
  border-radius: 8px;
  background: var(--rose);
}

.product-actions a:hover,
.product-actions button:hover {
  background: var(--rose-strong);
}

.shop-cart-button span {
  background: var(--rose-strong);
}

.shop-cart-panel,
.shop-coupon,
.shop-address,
.shop-cart-item {
  border-color: rgba(77, 54, 82, 0.12);
  background: #fffdfa;
}

.shop-cart-panel {
  box-shadow: 0 18px 48px rgba(69, 45, 58, 0.09);
}

.shop-cart-thumb,
.shop-cart-quantity button {
  background: #f3eceb;
}

@media (max-width: 760px) {
  .main {
    padding: 16px 14px 104px;
  }

  .topbar {
    padding-bottom: 14px;
  }

  .shop-workspace > .section-heading {
    align-items: flex-start;
  }

  .shop-workspace > .section-heading h2 {
    font-size: 36px;
  }

  .shop-toolbar {
    padding: 12px;
  }

  .shop-search,
  .shop-category-filter {
    flex-basis: 100%;
  }

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

  .product-image {
    margin: 5px;
  }

  .product-copy {
    padding: 8px 10px 12px;
  }

  .product-copy h3 {
    min-height: 40px;
    font-size: 14px;
    line-height: 1.35;
  }

  .product-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .product-actions a,
  .product-actions button {
    justify-content: center;
    width: 100%;
  }

  .mobile-tabbar {
    border-color: rgba(77, 54, 82, 0.12);
    background: rgba(255, 253, 249, 0.96);
    box-shadow: 0 -10px 30px rgba(69, 45, 58, 0.08);
  }

  .mobile-tabbar a.active {
    color: #fff;
    background: var(--rose);
  }
}

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

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  max-width: 100%;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.route-screen {
  display: none;
  min-height: calc(100svh - 120px);
  animation: route-in 180ms ease-out;
}

.route-screen.route-active:not(.module-denied) {
  display: grid;
}

.workspace.route-screen.route-active:not(.module-denied) {
  display: block;
}

@keyframes route-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-screen {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
  background:
    linear-gradient(90deg, rgba(238, 236, 250, 0.28), rgba(255, 255, 255, 0.08)),
    url('/auth-molecule-bg.webp') center / cover no-repeat;
}

.auth-visual {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 56px;
  color: var(--ink);
}

.auth-visual img {
  width: 112px;
  height: 112px;
  border-radius: 24px;
  margin-bottom: auto;
}

.auth-visual p {
  margin-bottom: 8px;
  color: var(--violet-strong);
  font-weight: 800;
}

.auth-visual h1 {
  font-size: 76px;
  margin-bottom: 12px;
}

.auth-visual span {
  max-width: 560px;
  color: #4c466a;
  font-size: 20px;
}

.auth-panel {
  align-self: center;
  margin: 24px;
  padding: 22px;
  border: 1px solid rgba(111, 104, 183, 0.22);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 22px 80px rgba(34, 31, 51, 0.16);
  backdrop-filter: blur(18px);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: var(--violet-soft);
}

.auth-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.auth-tabs button.active {
  color: white;
  background: var(--violet-strong);
}

.auth-form,
.auth-form label {
  display: grid;
  gap: 9px;
}

.auth-form {
  gap: 14px;
}

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

.auth-form input,
.auth-form select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.auth-form select {
  cursor: pointer;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 50px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--muted);
  border: 0;
  border-radius: 10px;
  background: transparent;
  transform: translateY(-50%);
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible,
.password-toggle[aria-pressed="true"] {
  color: var(--violet-strong);
  background: var(--violet-soft);
}

.password-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.auth-message.error {
  color: #9d2434;
  background: #fff0f2;
}

.auth-message.success {
  color: var(--green);
  background: #edf9f4;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.check-row {
  grid-template-columns: 20px 1fr;
  align-items: center;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.auth-message {
  margin-top: 14px;
  padding: 12px;
  color: var(--muted);
  border-radius: 14px;
  background: #fbfaff;
}

.full {
  justify-content: center;
  width: 100%;
}

.app-shell {
  width: 100%;
  min-width: 0;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  min-height: 100svh;
  padding: 22px 18px;
  color: white;
  background: linear-gradient(180deg, rgba(34, 31, 51, 0.95), rgba(83, 78, 132, 0.92)), #3f3a68;
  position: sticky;
  top: 0;
  align-self: start;
}

.mobile-tabbar {
  display: none;
}

.mobile-nav-backdrop {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.brand img {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
}

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

.brand strong {
  font-size: 25px;
  letter-spacing: 0;
}

.brand span {
  color: #dedcf0;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  color: #f6f4ff;
  text-decoration: none;
  border-radius: 8px;
}

.nav a.active,
.nav a:hover {
  background: rgba(255, 255, 255, 0.14);
}

.sidebar-status {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 12px;
  color: #f6f4ff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--amber);
}

.dot.ok {
  background: #46c28c;
}

.main {
  width: 100%;
  min-width: 0;
  padding: 24px;
}

.topbar,
.section-heading,
.account-strip,
.panel-title,
.toolbar,
.code-form,
.success-box,
.empty-box,
.secondary-action,
.primary-action {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 38px;
  line-height: 1;
  color: var(--ink);
}

h2 {
  margin-bottom: 6px;
  font-size: 20px;
}

.account-strip {
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.account-strip input,
.account-strip select,
.toolbar input,
.code-form input {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.account-strip input {
  width: 220px;
}

.icon-button,
.code-form button,
.primary-action,
.secondary-action {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.icon-button {
  min-width: 58px;
  height: 40px;
  color: var(--ink);
  background: var(--violet-soft);
}

.user-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.user-actions button {
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  white-space: nowrap;
  cursor: pointer;
}

#admin-users th:last-child,
#admin-users td:last-child {
  width: 1%;
  white-space: nowrap;
}

.user-actions .user-role-select {
  width: 170px;
  min-height: 34px;
  padding: 0 30px 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
}

.user-actions .role-change {
  color: white;
  background: var(--violet-strong);
}

.user-actions .delete {
  color: white;
  background: #a62d3d;
}

.user-actions .approve {
  color: white;
  background: var(--green);
}

.user-actions .reject {
  color: #9d2434;
  background: #fff0f2;
}

.agent-customer-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.agent-customer-search {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.agent-customer-search input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  outline: none;
}

.agent-customer-search input:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(142, 129, 170, 0.13);
}

#agent-customer-form {
  margin-top: 16px;
  padding: clamp(16px, 2.5vw, 26px);
  border: 1px solid rgba(77, 54, 82, 0.14);
  border-radius: 20px;
  background: linear-gradient(145deg, #fff, #faf7fb);
  box-shadow: 0 16px 42px rgba(69, 45, 58, 0.08);
}

.agent-customer-form-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.agent-customer-form-heading > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  color: #fff;
  background: var(--violet-strong);
  font-size: 25px;
}

.agent-customer-form-heading strong,
.agent-customer-form-heading small {
  display: block;
}

.agent-customer-form-heading strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.agent-customer-form-heading small {
  margin-top: 3px;
  color: var(--muted);
}

#agent-customer-form .form-grid {
  gap: 14px;
}

#agent-customer-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

#agent-customer-form input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 13px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  outline: none;
}

#agent-customer-form input:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(142, 129, 170, 0.13);
}

#agent-customer-form .agent-customer-wide {
  grid-column: 1 / -1;
}

#agent-customer-form .action-row {
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.customer-extra-toggle {
  width: 100%; margin: 18px 0 8px; padding: 14px 18px; border: 1px solid var(--line);
  border-radius: 16px; background: #f7f4fa; color: var(--ink); font: inherit; font-weight: 700;
  text-align: left; cursor: pointer;
}

.customer-extra-toggle span { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 8px; border-radius: 50%; background: var(--violet-strong); color: #fff; }
.customer-extra { margin-top: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.customer-extra h3 { margin: 8px 0 14px; }
.customer-extra h3:not(:first-child) { margin-top: 24px; }
.customer-extra h3 small { font: inherit; font-size: .75em; color: var(--muted); }
.payment-terms { display: flex; flex-wrap: wrap; gap: 10px; }
.payment-terms label { display: flex !important; flex-direction: row !important; align-items: center; gap: 7px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: #faf8fc; }
.payment-terms input { width: auto !important; min-height: auto !important; }
.customer-notes { display: grid; gap: 7px; margin-top: 18px; font-weight: 700; }
.customer-notes textarea { resize: vertical; padding: 12px; border: 1px solid var(--line); border-radius: 16px; font: inherit; }

.installment-list { display: grid; gap: 8px; margin-top: 6px; }
.installment-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.installment-row.paid { background: #eef8f3; }
.payment-action { display: flex !important; align-items: center; gap: 8px; }
.payment-action input { min-height: 38px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; }
.payment-plus { min-height: 38px; padding: 7px 12px; white-space: nowrap; }

@media (max-width: 620px) {
  .customer-extra { padding: 14px; }
  .installment-row, .payment-action { align-items: stretch; flex-direction: column; }
  .payment-plus { width: 100%; }
}

.agent-customer-card,
.agent-selected-customer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.agent-customer-card.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(88, 115, 92, 0.12);
}

.agent-customer-info {
  min-width: 0;
}

.agent-customer-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.danger-action {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: #a62d3d;
  cursor: pointer;
}

.agent-customer-orders {
  display: grid;
  gap: 3px;
  margin-top: 10px;
}

.agent-customer-orders b {
  color: var(--ink);
  font-size: 12px;
}

.agent-customer-orders span {
  font-size: 12px;
}

.agent-customer-card strong,
.agent-customer-card span,
.agent-customer-card small,
.agent-selected-customer strong,
.agent-selected-customer span {
  display: block;
}

.agent-customer-card span,
.agent-customer-card small,
.agent-selected-customer span {
  margin-top: 4px;
  color: var(--muted);
}

.agent-selected-customer {
  margin-top: 16px;
  color: #174c39;
  background: #eaf8f1;
}

.agent-selected-customer button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #c6ead9;
  border-radius: 9px;
  color: var(--green);
  background: #fff;
  cursor: pointer;
}

@media (max-width: 620px) {
  #agent-customer-form .agent-customer-wide {
    grid-column: auto;
  }

  #agent-customer-form .action-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  #agent-customer-form .action-row button {
    justify-content: center;
    width: 100%;
  }

  .agent-customer-card,
  .agent-selected-customer {
    align-items: stretch;
    flex-direction: column;
  }

  .agent-customer-card .primary-action,
  .agent-customer-card .danger-action,
  .agent-selected-customer button {
    justify-content: center;
    width: 100%;
  }

  .agent-customer-actions {
    display: grid;
    width: 100%;
  }
}

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

.profile-grid div {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfaff;
}

.profile-grid span,
.profile-grid strong {
  display: block;
}

.profile-grid span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.profile-grid strong {
  overflow-wrap: anywhere;
}

.change-password-card { margin-top: 22px; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 12px 30px rgba(34, 31, 51, .06); }
.change-password-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.change-password-heading h3, .change-password-heading p { margin: 0; }
.change-password-heading p { margin-top: 4px; color: var(--muted); }
.change-password-icon { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%; color: #fff; background: var(--violet-strong); letter-spacing: 2px; }
.change-password-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.change-password-grid label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.change-password-grid input { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 14px; padding: 0 48px 0 14px; font: inherit; }
.change-password-actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.change-password-actions span { font-size: 14px; }

@media (max-width: 760px) {
  .change-password-grid { grid-template-columns: 1fr; }
  .change-password-actions { align-items: stretch; flex-direction: column; }
  .change-password-actions button { width: 100%; }
}

.shop-workspace {
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0, rgba(133, 128, 197, 0.18), transparent 32%),
    var(--surface);
}

.shop-toolbar,
.shop-search,
.shop-category-filter,
.product-actions,
.product-price {
  display: flex;
  align-items: center;
}

.shop-toolbar {
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 18px;
}

.shop-search {
  min-width: min(100%, 320px);
  align-items: stretch;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.shop-search input {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: white;
  outline: none;
}

.shop-category-filter {
  display: flex;
  flex: 0 1 300px;
  align-items: stretch;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.shop-category-filter select {
  height: 44px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: white;
  cursor: pointer;
  outline: none;
}

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

.product-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  box-shadow: 0 10px 30px rgba(34, 31, 51, 0.07);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(34, 31, 51, 0.12);
}

.product-image {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 0.82;
  overflow: hidden;
  background: linear-gradient(145deg, #f3f1fa, #fff);
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.product-image > span {
  position: absolute;
  left: 12px;
  top: 12px;
  max-width: calc(100% - 24px);
  overflow: hidden;
  padding: 6px 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
  border-radius: 999px;
  color: #554e8e;
  background: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 800;
}

.product-placeholder {
  color: var(--violet);
  font-size: 32px;
  font-weight: 900;
}

.product-copy {
  padding: 15px;
}

.product-copy small {
  display: block;
  min-height: 16px;
  overflow: hidden;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.product-copy h3 {
  min-height: 46px;
  margin: 7px 0 13px;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.4;
}

.product-price {
  gap: 8px;
  min-height: 28px;
}

.product-price strong {
  font-size: 20px;
}

.product-price del {
  color: var(--muted);
  font-size: 13px;
}

.product-price.on-sale strong {
  color: var(--green);
}

.product-actions {
  justify-content: space-between;
  gap: 8px;
  margin-top: 15px;
}

.product-actions a,
.product-actions button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: var(--ink);
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.product-actions button.added {
  background: var(--green);
}

.product-actions a.loading,
.product-actions button.loading,
#shop-cart-link.loading {
  pointer-events: none;
  opacity: 0.72;
}

.shop-cart-button {
  border: 0;
  cursor: pointer;
}

.shop-cart-button span {
  display: inline-grid;
  min-width: 25px;
  height: 25px;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: white;
  background: var(--violet-strong);
  font-size: 12px;
  font-weight: 900;
}

.shop-cart-panel {
  margin: 18px 0 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #faf9fd;
  box-shadow: 0 14px 38px rgba(34, 31, 51, 0.08);
}

.shop-cart-heading,
.shop-cart-footer,
.shop-cart-item,
.shop-cart-quantity {
  display: flex;
  align-items: center;
}

.shop-cart-heading,
.shop-cart-footer {
  justify-content: space-between;
  gap: 16px;
}

.shop-cart-heading h3 {
  margin: 2px 0 0;
  font-size: 24px;
}

.shop-cart-items {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.shop-coupon {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.shop-address {
  display: grid;
  gap: 16px;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.shop-address-heading,
.shop-delivery-summary p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.shop-address-heading h4 {
  margin: 2px 0 0;
  font-size: 19px;
}

.shop-address-heading > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.shop-address-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.shop-address-grid input,
.shop-address-grid select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: white;
}

.shop-delivery-summary {
  display: grid;
  gap: 7px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.shop-delivery-summary p {
  margin: 0;
  font-size: 13px;
}

.shop-delivery-summary span {
  color: var(--muted);
}

.shop-coupon > label {
  font-size: 13px;
  font-weight: 800;
}

.shop-coupon > div {
  display: flex;
  gap: 8px;
}

.shop-coupon input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-transform: uppercase;
}

.shop-coupon p,
.shop-cart-totals small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.shop-coupon .success-text {
  color: var(--green);
}

.shop-coupon .error-text {
  color: #9d2434;
}

.shop-cart-empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.shop-cart-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto auto;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.shop-cart-thumb {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: var(--violet-soft);
}

.shop-cart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.cart-thumb-placeholder {
  color: var(--violet-strong);
  font-weight: 900;
}

.shop-cart-copy {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
}

.shop-cart-copy small,
.shop-cart-copy span {
  color: var(--muted);
  font-size: 12px;
}

.shop-cart-copy strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.shop-cart-quantity {
  gap: 8px;
}

.shop-cart-quantity button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: var(--violet-soft);
  cursor: pointer;
  font-size: 18px;
}

.shop-cart-quantity span {
  min-width: 24px;
  text-align: center;
  font-weight: 800;
}

.shop-cart-remove {
  border: 0;
  color: #9d2434;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.shop-cart-footer {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.shop-cart-actions {
  display: grid;
  min-width: 235px;
  gap: 10px;
}

.shop-cart-actions button {
  width: 100%;
  justify-content: center;
}

.shop-cart-totals {
  display: grid;
  flex: 1;
  gap: 7px;
}

.shop-cart-totals p {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
}

.shop-cart-footer span {
  color: var(--muted);
  font-size: 12px;
}

.shop-cart-grand-total strong {
  font-size: 22px;
}

#shop-discount-row strong {
  color: var(--green);
}

.shop-cart-footer button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.stock {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stock.ok {
  color: var(--green);
}

.stock.off {
  color: #9d2434;
}

.permission-toggle {
  width: 18px;
  height: 18px;
  accent-color: var(--violet-strong);
}

.workspace,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.workspace {
  padding: 22px;
  margin-bottom: 18px;
}

.section-heading {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading p,
.setting-copy {
  margin-bottom: 0;
  color: var(--muted);
}

.primary-action,
.secondary-action {
  min-height: 42px;
  gap: 8px;
  white-space: nowrap;
  text-decoration: none;
  border-radius: 999px;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-action {
  padding: 0 16px;
  color: white;
  background: var(--violet-strong);
}

.secondary-action {
  padding: 0 14px;
  color: var(--violet-strong);
  background: var(--violet-soft);
  border: 1px solid #d9d4ee;
}

.secondary-action input {
  display: none;
}

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

.metric {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #fbfaff);
}

.metric span,
.metric small,
.list-row span,
.integration-line span {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 8px 0 5px;
  font-size: 26px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.split.route-screen:not(.route-active) {
  display: none;
}

.panel {
  min-width: 0;
  max-width: 100%;
  padding: 20px;
}

.panel-title {
  gap: 10px;
  margin-bottom: 16px;
}

.panel-title h2 {
  margin-bottom: 0;
}

.code-form {
  gap: 8px;
}

.code-form input {
  flex: 1;
}

.code-form button {
  min-height: 40px;
  padding: 0 16px;
  color: white;
  background: var(--violet-strong);
}

.success-box,
.empty-box {
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
}

.success-box {
  color: #174c39;
  background: #eaf8f1;
  border: 1px solid #c6ead9;
}

.success-box span,
.success-box a {
  display: block;
}

.success-box a {
  color: #174c39;
  font-weight: 700;
  margin-top: 6px;
}

.empty-box {
  color: var(--muted);
  background: #faf9fd;
  border: 1px dashed var(--line);
}

.code-list {
  display: grid;
  gap: 9px;
}

.code-manager {
  grid-column: 1 / -1;
}

.code-manager-title {
  align-items: flex-start;
  justify-content: space-between;
}

.code-manager-title p {
  margin: 5px 0 0;
  color: var(--muted);
}

.code-admin-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #faf9fd;
}

.code-admin-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.code-admin-form input,
.code-admin-form select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: white;
}

.code-admin-form .check-row,
.code-admin-form .action-row {
  align-self: end;
}

.code-admin-form .check-row {
  display: flex;
}

.code-admin-form .check-row input {
  width: 18px;
  min-height: 18px;
}

.code-history-title {
  margin-top: 24px;
}

.code-validation-history {
  display: grid;
  gap: 4px;
}

.code-validation-history .list-row > div:last-child {
  display: grid;
  justify-items: end;
  gap: 4px;
}

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

.promo-card {
  min-height: 178px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaff;
}

.promo-card span,
.promo-card p {
  color: var(--muted);
}

.promo-card h3 {
  margin: 6px 0 12px;
  font-size: 18px;
}

.promo-card strong {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: white;
  background: var(--violet-strong);
  border-radius: 8px;
}

#promotion-form {
  margin-bottom: 20px;
}

#promotion-form > label {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

#promotion-form textarea {
  width: 100%;
  min-height: 90px;
  resize: vertical;
}

.promotion-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 12px 0;
}

.promo-meta {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
}

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

.promo-actions button {
  min-height: 36px;
  padding: 0 14px;
  color: var(--violet-strong);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  font-weight: 800;
  cursor: pointer;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.report-summary div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, #fff, #faf8ff);
  box-shadow: 0 8px 24px rgba(69, 45, 58, 0.05);
}

.report-summary span,
.report-summary strong {
  display: block;
}

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

.report-summary strong {
  margin-top: 6px;
}

.report-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) minmax(170px, 1fr) minmax(180px, 1fr) minmax(130px, auto) minmax(130px, auto) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 16px;
}

.report-filters input,
.report-filters select {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 0 15px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  outline: none;
}

.report-filters input:focus,
.report-filters select:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(142, 129, 170, 0.13);
}

.report-filters label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

#refresh-report {
  min-height: 50px;
  padding-inline: 20px;
}

#reports .auth-message,
#reports .table-wrap {
  border-radius: 18px;
}

#reports .table-wrap {
  border: 1px solid var(--line);
  overflow: auto;
}

#reports .table-wrap table {
  border: 0;
}

#reports .orders-table {
  min-width: 1120px;
}

#reports .orders-table th:first-child,
#reports .orders-table td:first-child {
  width: 118px;
  min-width: 118px;
  white-space: nowrap;
}

#reports .orders-table th:nth-child(2),
#reports .orders-table td:nth-child(2) {
  width: 112px;
  min-width: 112px;
  white-space: nowrap;
}

@media (max-width: 1200px) and (min-width: 621px) {
  .report-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

.order-details {
  min-width: 150px;
}

.order-details summary {
  color: var(--violet-strong);
  font-weight: 800;
  cursor: pointer;
}

.order-details div {
  display: grid;
  gap: 5px;
  min-width: 240px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.order-details div strong:not(:first-child) {
  margin-top: 7px;
}

.order-details div span {
  color: var(--muted);
  font-size: 12px;
}

.permission {
  display: inline-flex;
  min-width: 46px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.permission.yes {
  color: var(--green);
  background: #eaf8f1;
}

.permission.no {
  color: var(--muted);
  background: #f0eef7;
}

.list-row,
.integration-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.list-row:last-child,
.integration-line:last-child {
  border-bottom: 0;
}

.state,
.config-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.state.ok,
.config-pill.ok {
  color: var(--green);
  background: #eaf8f1;
}

.state.off,
.config-pill.warn {
  color: var(--amber);
  background: #fff6e6;
}

.toolbar {
  gap: 10px;
  min-height: 48px;
  margin-bottom: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaff;
}

.toolbar input {
  flex: 1;
  min-width: 160px;
  border: 0;
  background: transparent;
}

.toolbar span {
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
}

#network-form {
  margin-bottom: 20px;
}

#network-admin-actions.hidden {
  display: none;
}

table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: #fbfaff;
}

tr:last-child td {
  border-bottom: 0;
}

.flow {
  margin: 0;
  padding-left: 22px;
  color: var(--ink);
}

.flow li {
  margin: 0 0 12px;
}

.bottom-space {
  padding-bottom: 36px;
}

.config-pill {
  margin-top: 14px;
  color: var(--violet-strong);
  background: var(--violet-soft);
}

@media (max-width: 1040px) {
  .auth-screen {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: 34svh;
    padding: 34px 24px;
  }

  .auth-visual img {
    width: 86px;
    height: 86px;
    margin-bottom: 34px;
  }

  .auth-visual h1 {
    font-size: 52px;
  }

  .auth-panel {
    margin: -18px 18px 24px;
  }

  .app-shell {
    width: 100%;
    grid-template-columns: 1fr;
  }

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

  .sidebar-status {
    position: static;
    margin-top: 20px;
  }

  .mobile-tabbar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    min-height: 58px;
    padding: 6px;
    border: 1px solid rgba(111, 104, 183, 0.22);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 40px rgba(34, 31, 51, 0.18);
    backdrop-filter: blur(18px);
  }

  .mobile-tabbar a {
    display: grid;
    place-items: center;
    color: var(--violet-strong);
    text-decoration: none;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 800;
  }

  .mobile-tabbar a,
  .mobile-tabbar button {
    display: grid;
    min-width: 0;
    place-items: center;
    gap: 1px;
    padding: 4px 2px;
    color: #393451;
    border: 0;
    border-radius: 16px;
    background: transparent;
    text-decoration: none;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
  }

  .mobile-tabbar span {
    font-size: 19px;
    line-height: 1;
  }

  .mobile-tabbar a.active {
    color: white;
    background: #4c467f;
    box-shadow: 0 5px 14px rgba(52, 47, 91, 0.28);
  }

  .mobile-tabbar a:hover {
    background: var(--violet-soft);
  }

  .metrics,
  .split,
  .promo-grid,
  .report-summary,
  .profile-grid,
  .product-grid {
    grid-template-columns: 1fr;
  }

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

  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .account-strip {
    flex-wrap: wrap;
  }

  .account-strip input {
    width: min(100%, 260px);
  }
}

@media (max-width: 620px) {
  #promotions,
  #promotion-form,
  #promotion-form input,
  #promotion-form select,
  #promotion-form textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .promotion-checks,
  .promo-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .promo-actions button {
    width: 100%;
  }

  .report-filters {
    grid-template-columns: 1fr;
  }

  #reports {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  #reports .table-wrap {
    overflow: visible;
  }

  #reports table,
  #reports tbody,
  #reports tr,
  #reports td {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  #reports thead {
    display: none;
  }

  #reports tbody {
    display: grid;
    gap: 12px;
  }

  #reports tr {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
  }

  #reports td {
    display: grid;
    grid-template-columns: minmax(92px, 35%) 1fr;
    gap: 10px;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
  }

  #reports td:last-child {
    border-bottom: 0;
  }

  #reports td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  #reports .report-empty-row td {
    display: block;
  }

  #reports .report-empty-row td::before {
    content: none;
  }

  #network .table-wrap {
    overflow: visible;
  }

  #network table,
  #network tbody,
  #network tr,
  #network td {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  #network {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  #network thead {
    display: none;
  }

  #network tbody {
    display: grid;
    gap: 12px;
  }

  #network tr {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
  }

  #network td {
    display: grid;
    grid-template-columns: minmax(92px, 35%) 1fr;
    gap: 10px;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
  }

  #network td:last-child {
    border-bottom: 0;
  }

  #network td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  #network .user-actions {
    display: grid;
    grid-template-columns: 1fr;
    min-width: 0;
  }

  #network .user-actions button,
  #network-admin-actions,
  #network-admin-actions > * {
    width: 100%;
    min-width: 0;
  }

  #network-admin-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  #network-form input,
  #network-form select,
  #network-search {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .code-manager {
    width: 100%;
    overflow: hidden;
  }

  .code-manager .table-wrap {
    overflow: visible;
    border: 0;
  }

  .code-manager table,
  .code-manager tbody,
  .code-manager tr,
  .code-manager td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .code-manager thead {
    display: none;
  }

  .code-manager tbody {
    display: grid;
    gap: 12px;
  }

  .code-manager tr {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fbfaff;
  }

  .code-manager td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
  }

  .code-manager td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .code-manager td:last-child {
    border-bottom: 0;
  }

  .code-manager td .user-actions {
    min-width: 0;
  }

  .code-admin-form {
    grid-template-columns: 1fr;
  }

  .code-manager-title {
    align-items: stretch;
    flex-direction: column;
  }

  .shop-cart-panel {
    margin-inline: -10px;
    padding: 16px 12px;
  }

  .shop-cart-item {
    grid-template-columns: 52px minmax(0, 1fr) auto;
  }

  .shop-cart-thumb {
    width: 52px;
    height: 52px;
  }

  .shop-cart-quantity {
    grid-column: 2;
    justify-self: start;
  }

  .shop-cart-remove {
    grid-column: 3;
    grid-row: 2;
  }

  .shop-cart-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .shop-coupon > div {
    align-items: stretch;
    flex-direction: column;
  }

  .shop-address {
    padding: 14px 12px;
  }

  .shop-address-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .shop-address-grid .wide {
    grid-column: auto;
  }

  .shop-cart-actions,
  .shop-cart-footer .primary-action {
    width: 100%;
  }

  .main {
    padding: 16px;
  }

  .sidebar {
    padding: 18px 16px;
  }

  .nav {
    display: none;
  }

  .nav.mobile-open {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 82px;
    z-index: 42;
    display: grid;
    max-height: min(68svh, 520px);
    overflow-y: auto;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 22px;
    background: linear-gradient(180deg, #2d2945, #514b7d);
    box-shadow: 0 24px 70px rgba(20, 17, 35, 0.38);
  }

  .mobile-nav-backdrop:not(.hidden) {
    position: fixed;
    inset: 0;
    z-index: 41;
    display: block;
    border: 0;
    background: rgba(23, 20, 38, 0.36);
    backdrop-filter: blur(3px);
  }

  .nav a {
    font-size: 14px;
  }

  h1 {
    font-size: 32px;
  }

  .workspace,
  .panel {
    padding: 16px;
    border-radius: 20px;
  }

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

  .auth-panel {
    border-radius: 24px;
  }

  .auth-visual span {
    font-size: 16px;
  }

  .main {
    padding-bottom: 90px;
  }

  .code-form,
  .toolbar,
  .shop-toolbar {
    align-items: stretch;
    flex-direction: column;
    height: auto;
    padding: 12px;
  }

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

  .primary-action,
  .secondary-action {
    justify-content: center;
  }
}

/* Approved ODR theme: final responsive cascade. */
body .sidebar {
  color: var(--ink);
  background: rgba(255, 253, 249, 0.97);
  border-right: 1px solid rgba(77, 54, 82, 0.12);
  box-shadow: 12px 0 40px rgba(69, 45, 58, 0.04);
}

body .brand span,
body .nav a,
body .sidebar-status {
  color: var(--muted);
}

body .nav a.active,
body .nav a:hover {
  color: var(--ink);
  background: #f2e9e6;
}

body .shop-workspace {
  background:
    radial-gradient(circle at 100% 0, rgba(207, 123, 121, 0.1), transparent 32rem),
    rgba(255, 253, 249, 0.96);
}

body .product-image img,
body .shop-cart-thumb img {
  mix-blend-mode: normal;
}

@media (max-width: 760px) {
  .auth-screen {
    background-position: 62% center;
  }

  #admin-users .table-wrap {
    overflow: visible;
  }

  #admin-users table,
  #admin-users tbody,
  #admin-users tr,
  #admin-users td {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  #admin-users thead {
    display: none;
  }

  #admin-users tbody {
    display: grid;
    gap: 12px;
  }

  #admin-users tr {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
  }

  #admin-users td {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #admin-users td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  #admin-users td:last-child {
    width: 100%;
    max-width: 100%;
    white-space: normal;
    border-bottom: 0;
  }

  #admin-users td[data-label="Azioni"] {
    display: block;
  }

  #admin-users td[data-label="Azioni"]::before {
    display: block;
    margin-bottom: 8px;
  }

  #admin-users .user-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  #admin-users .user-role-select {
    grid-column: 1 / -1;
    width: 100%;
  }

  #admin-users .user-actions button {
    width: 100%;
    min-width: 0;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
  }

  #admin-users .user-actions .delete {
    grid-column: 1 / -1;
  }

  body .nav.mobile-open {
    border-color: rgba(77, 54, 82, 0.12);
    background: #fffdfa;
    box-shadow: 0 24px 70px rgba(69, 45, 58, 0.2);
  }

  body .mobile-tabbar {
    border-color: rgba(77, 54, 82, 0.12);
    background: rgba(255, 253, 249, 0.98);
  }

  body .mobile-tabbar a.active {
    color: #fff;
    background: var(--rose);
  }

  body .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 390px) {
  body .product-grid {
    grid-template-columns: 1fr;
  }
}
