:root {
  --ink: #1A1612;
  --ink-2: #2C2520;
  --ink-3: #3D3530;
  --cream: #F5F0E8;
  --cream-2: #EDE7D6;
  --cream-3: #E5DEC8;
  --green: #1E6B47;
  --green-2: #2A8A5C;
  --green-pale: #D4EAE0;
  --green-xpale: #EAF5EF;
  --amber: #C8893A;
  --amber-2: #F0A84E;
  --amber-pale: #FDF0DC;
  --red: #C0392B;
  --red-pale: #FDECEB;
  --blue: #2563EB;
  --blue-pale: #EFF4FF;
  --muted: #8A7F74;
  --border: rgba(26, 22, 18, .1);
  --border-2: rgba(26, 22, 18, .06);
  --sidebar-w: 240px;
  --font-d: 'Cormorant Garamond', Georgia, serif;
  --font-b: 'DM Sans', sans-serif;
  --shadow-sm: 0 1px 4px rgba(26, 22, 18, .06);
  --shadow-md: 0 4px 16px rgba(26, 22, 18, .08);
  --shadow-lg: 0 12px 40px rgba(26, 22, 18, .12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

html,
body {
  height: 100%;
  font-family: var(--font-b);
  background: var(--cream);
  color: var(--ink);
  font-size: 14px;
  overflow: hidden
}

.dash-body a {
  color: inherit;
  text-decoration: none
}

.dash-body .icon {
  width: 18px;
  height: 18px
}

.app {
  display: flex;
  height: 100vh
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--ink-2);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  bottom: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30, 107, 71, .25), transparent 70%);
  pointer-events: none;
}

.sb-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sb-logo-image {
  display: block;
  width: auto;
  height: 34px;
}

.sb-logo-text {
  font-family: var(--font-d);
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.3px;
  line-height: 1;
}

.sb-logo-text span {
  color: var(--green-2);
}

.sb-store {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.sb-store-content {
  min-width: 0;
}

.sb-store-logo-wrap {
  flex-shrink: 0;
}

.sb-store-logo-frame {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .05)),
    rgba(255, 255, 255, .04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
}

.sb-store-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sb-store-logo-fallback {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sb-store-label {
  font-size: 10px;
  color: rgba(255, 255, 255, .35);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}

.sb-store-name {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sb-store-dot {
  width: 7px;
  height: 7px;
  background: #2ECC71;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(46, 204, 113, .5);
}

.sb-store-url {
  font-size: 11px;
  color: rgba(255, 255, 255, .35);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: rgb(255, 255, 255);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: all .18s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sb-item:hover {
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .85);
}

.sb-item.active {
  background: var(--green);
  color: #fff;
  font-weight: 500;
}

.sb-item .icon {
  opacity: .8;
}

.sb-item.active .icon {
  opacity: 1;
}

.sb-section-label {
  font-size: 10px;
  color: rgba(255, 255, 255, .2);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 12px 12px 4px;
  margin-top: 6px;
}

.sb-bottom {
  padding: 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.sb-plan {
  background: rgba(200, 137, 58, .12);
  border: 1px solid rgba(200, 137, 58, .2);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.sb-plan-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--amber-2);
  margin-bottom: 4px;
}

.sb-plan-text {
  font-size: 11px;
  color: rgba(255, 255, 255, .4);
  line-height: 1.5;
}

.sb-plan-btn {
  display: block;
  text-align: center;
  margin-top: 8px;
  padding: 6px;
  background: var(--amber);
  color: #fff;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s;
}

.sb-plan-btn:hover {
  background: var(--amber-2);
}

.sb-logout {
  color: rgb(255, 255, 255);
  border: 1px solid rgba(255, 255, 255, .08);
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.topbar-title {
  font-family: var(--font-d);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--ink);
  flex: 1;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--cream-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  width: 240px;
  transition: border-color .18s;
}

.topbar-search:focus-within {
  border-color: var(--green);
}

.topbar-search input {
  border: none;
  background: none;
  outline: none;
  font-family: var(--font-b);
  font-size: 13px;
  color: var(--ink);
  width: 100%;
}

.topbar-search input::placeholder {
  color: var(--muted);
}

.topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .18s;
  position: relative;
}

.topbar-btn:hover {
  background: var(--cream-2);
  border-color: var(--ink);
}

.topbar-logout-mobile {
  display: none;
  gap: 8px;
  width: auto;
  padding: 0 12px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-b);
  font-size: 13px;
  font-weight: 600;
}

.topbar-logout-mobile span {
  white-space: nowrap;
}

.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--amber);
  border-radius: 50%;
  border: 2px solid var(--cream);
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 24px;
}

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

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

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

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

.list-item {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(30, 107, 71, .1);
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 700;
}

.eyebrow {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
}

.price {
  font-size: 1.2rem;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.button,
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 0;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.button-secondary {
  background: rgba(26, 22, 18, .08);
  color: var(--ink);
}

.flash {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.flash-notice {
  color: var(--green);
}

.flash-alert {
  color: var(--red);
}

.field {
  display: grid;
  gap: 6px;
}

.field input,
.field textarea,
.field select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font: inherit;
}

/* Form system (used by modal + settings screens) */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}

.form-input {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  font-family: var(--font-b);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color .18s, background .18s;
  min-width: 80%;
}

.form-input:focus {
  border-color: var(--green);
  background: #fff;
}

.form-input::placeholder {
  color: var(--muted);
}

textarea.form-input {
  resize: vertical;
  min-height: 96px;
}

.site-sections {
  display: grid;
  gap: 16px;
}

.site-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 18px;
}

.site-section-title {
  font-family: var(--font-d);
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 4px;
}

.site-section-sub {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 16px;
}

.logo-upload-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--cream);
}

.logo-upload-preview-box {
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: #fff;
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
}

.logo-upload-preview {
  max-width: 100%;
  max-height: 84px;
  object-fit: contain;
  display: block;
}

.logo-upload-placeholder {
  color: var(--muted);
  font-size: 12px;
}

.logo-upload-meta {
  display: grid;
  gap: 8px;
  align-content: start;
}

.logo-remove-toggle {
  width: fit-content;
}

.banner-upload-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--cream);
}

.banner-upload-preview-box {
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: #fff;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
}

.banner-upload-preview {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.banner-upload-placeholder {
  color: var(--muted);
  font-size: 12px;
}

.banner-upload-meta {
  display: grid;
  gap: 8px;
  align-content: start;
}

.template-lock-card {
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--cream);
  padding: 14px;
}

.template-lock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.template-lock-head strong {
  color: var(--ink);
  font-size: 14px;
}

.template-lock-card p {
  color: var(--muted);
  font-size: 12px;
}

.template-lock-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  background: #fff;
}

.template-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.template-feature-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

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

.palette-option {
  cursor: pointer;
  display: block;
  position: relative;
}

.palette-option-input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.palette-option-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}

.palette-option:hover .palette-option-card {
  border-color: rgba(30, 107, 71, .35);
  transform: translateY(-1px);
}

.palette-option.selected .palette-option-card,
.palette-option-input:checked+.palette-option-card {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(30, 107, 71, .14);
}

.palette-option-header {
  display: grid;
  gap: 2px;
}

.palette-option-header strong {
  font-size: 13px;
  color: var(--ink);
}

.palette-option-header small {
  font-size: 11px;
  color: var(--muted);
}

.palette-option-swatches {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.palette-option-swatch {
  display: block;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, .08);
}

.toggle-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink-3);
  font-size: 13px;
}

.toggle-line input[type="checkbox"] {
  accent-color: var(--green);
}

.qr-share-panel {
  margin-top: 16px;
}

.qr-share-head {
  align-items: flex-start;
}

.qr-share-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.qr-share-copy {
  display: grid;
  gap: 16px;
}

.qr-share-copy-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff 0%, var(--cream) 100%);
}

.qr-share-copy-card h3 {
  font-family: var(--font-d);
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -.03em;
  color: var(--ink);
}

.qr-share-copy-card p,
.qr-share-preview-note {
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.7;
}

.qr-share-list {
  display: grid;
  gap: 10px;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.6;
}

.qr-share-actions .button {
  justify-content: center;
}

.qr-share-preview-wrap {
  display: grid;
  gap: 12px;
}

.qr-share-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at top right, rgba(74, 155, 104, .12), transparent 30%),
    linear-gradient(180deg, #fff 0%, var(--cream) 100%);
}

.qr-share-preview .qr-brand-svg {
  width: min(100%, 440px);
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 34px rgba(17, 16, 9, .08));
}

.qr-share-preview-note strong {
  color: var(--ink);
}

.share-next-panel {
  margin-top: 16px;
}

.share-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, .9fr);
  gap: 18px;
}

.share-hero-card,
.share-url-card,
.share-action-card,
.share-qr-copy-card,
.share-qr-preview {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, var(--cream) 100%);
}

.share-hero-card {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.share-hero-card h2 {
  font-family: var(--font-d);
  font-size: 34px;
  line-height: 1.04;
  letter-spacing: -.04em;
}

.share-hero-card p,
.share-action-card span,
.share-qr-copy-card p {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.7;
}

.share-primary-actions .button {
  justify-content: center;
}

.share-feedback {
  min-height: 20px;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
}

.share-url-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  align-content: start;
}

.share-url-box {
  overflow-wrap: anywhere;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px dashed color-mix(in srgb, var(--green) 34%, var(--border));
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

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

.share-action-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  text-align: left;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.share-action-card strong {
  font-size: 16px;
  color: var(--ink);
}

.share-qr-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.share-qr-copy {
  display: grid;
  gap: 16px;
}

.share-qr-copy-card {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.share-qr-copy-card h3 {
  font-family: var(--font-d);
  font-size: 26px;
  line-height: 1.05;
}

.share-qr-preview-wrap {
  display: grid;
  gap: 12px;
}

.share-qr-preview {
  display: flex;
  justify-content: center;
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(74, 155, 104, .12), transparent 30%),
    linear-gradient(180deg, #fff 0%, var(--cream) 100%);
}

.share-qr-preview .qr-simple-svg {
  width: min(100%, 360px);
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 34px rgba(17, 16, 9, .08));
}

.share-modal-actions {
  display: grid;
  gap: 10px;
}

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

.palette-color-cell {
  display: grid;
  gap: 6px;
}

.palette-color-input,
.color-input {
  width: 100%;
  min-height: 44px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

.color-input-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Button variants */
.btn-green {
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(30, 107, 71, .2);
}

.btn-green:hover {
  background: var(--green-2);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--cream-2);
}

.btn-amber {
  background: var(--amber);
  color: #fff;
}

.btn-amber:hover {
  background: var(--amber-2);
}

.btn-danger {
  background: var(--red-pale);
  color: var(--red);
}

.btn-danger:hover {
  background: var(--red);
  color: #fff;
}

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

.metric {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

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

.metric strong {
  font-size: 22px;
  font-family: var(--font-d);
}

/* Reusable cards */
.card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-pad {
  padding: 24px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-family: var(--font-d);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

/* --- DASHBOARD PANELS & CARDS --- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: transform .18s, box-shadow .18s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--green);
  opacity: 0;
  transition: opacity .18s;
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  width: 20px;
  height: 20px;
  margin-bottom: 10px;
  color: var(--green);
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}

.stat-value {
  font-family: var(--font-d);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-delta {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.delta-up {
  color: var(--green);
}

.delta-down {
  color: var(--red);
}

.delta-neutral {
  color: var(--muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid-3-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

/* Orders table */
.orders-table {
  width: 100%;
  border-collapse: collapse;
}

.orders-table th {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-2);
  background: var(--cream);
}

.orders-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-2);
  vertical-align: middle;
}

.orders-table tr:last-child td {
  border-bottom: none;
}

.orders-table tr:hover td {
  background: var(--cream);
}

.order-id {
  font-weight: 600;
  color: var(--ink);
  font-size: 13px;
}

.order-customer {
  font-size: 13px;
  color: var(--ink-3);
}

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

.order-amount {
  font-family: var(--font-d);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.order-items-count {
  font-size: 11px;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}

.badge-new {
  background: var(--blue-pale);
  color: var(--blue);
}

.badge-confirmed {
  background: var(--green-xpale);
  color: var(--green);
}

.badge-pending {
  background: var(--amber-pale);
  color: var(--amber);
}

.badge-cancelled {
  background: var(--red-pale);
  color: var(--red);
}

/* Catalog */
.catalog-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.catalog-subnav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.catalog-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 300px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
}

.catalog-search input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  width: 100%;
  color: var(--ink);
}

.filter-btn {
  padding: 7px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: all .18s;
  text-decoration: none;
}

.filter-btn:hover {
  border-color: var(--ink);
}

.filter-btn.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.plan-limit {
  background: var(--amber-pale);
  border: 1px solid rgba(200, 137, 58, .2);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.plan-limit-text {
  flex: 1;
  font-size: 13px;
  color: var(--ink-3);
}

.plan-limit-text strong {
  color: var(--ink);
}

.plan-limit-bar-bg {
  height: 5px;
  background: rgba(200, 137, 58, .2);
  border-radius: 100px;
  margin-top: 5px;
  overflow: hidden;
}

.plan-limit-bar-fill {
  height: 100%;
  background: var(--amber);
  border-radius: 100px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.product-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform .18s, box-shadow .18s;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.product-img {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  position: relative;
}

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

.product-img .prod-status {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 100px;
}

.prod-published {
  background: var(--green-xpale);
  color: var(--green);
}

.prod-draft {
  background: var(--cream-2);
  color: var(--muted);
}

.product-body {
  padding: 12px 14px 14px;
}

.product-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
}

.product-cat {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-price {
  font-family: var(--font-d);
  font-size: 18px;
  font-weight: 700;
  color: var(--green);
}

.product-views {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Chart bars */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding-top: 8px;
}

.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.chart-bar {
  width: 100%;
  background: var(--green-pale);
  border-radius: 4px 4px 0 0;
  position: relative;
  transition: background .18s;
  cursor: pointer;
  min-height: 4px;
}

.chart-bar:hover {
  background: var(--green);
}

.chart-bar-label {
  font-size: 10px;
  color: var(--muted);
}

.chart-bar-val {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink);
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .18s;
}

.chart-bar:hover .chart-bar-val {
  opacity: 1;
}

.chart-bar.highlight {
  background: var(--green);
}

.empty-state {
  text-align: center;
  padding: 20px 12px;
  color: var(--muted);
}

.empty-text {
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--ink-3);
}

.empty-sub {
  font-size: 13px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 22, 18, .5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  width: 520px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  animation: fadeUp .25s ease both;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title {
  font-family: var(--font-d);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: none;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s;
}

.modal-close:hover {
  background: var(--cream-2);
}

.modal .settings-grid {
  margin-bottom: 0;
}

.product-image-dropzone {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding: 16px;
  border: 1px dashed color-mix(in srgb, var(--green) 45%, var(--border));
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--green) 6%, white), white 72%);
  cursor: default;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.product-image-dropzone:hover,
.product-image-dropzone.is-dragging {
  border-color: var(--green);
  background: linear-gradient(180deg, color-mix(in srgb, var(--green) 10%, white), white 68%);
  box-shadow: 0 10px 26px rgba(30, 122, 77, 0.08);
  transform: translateY(-1px);
}

.product-image-dropzone-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.product-image-dropzone-copy {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.product-image-mobile-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  position: relative;
  z-index: 1;
}

.product-image-action-btn {
  min-height: 42px;
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.product-image-action-btn.btn-ghost,
.product-image-cropper-actions .btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border);
}

.product-image-action-btn.btn-ghost:hover,
.product-image-cropper-actions .btn-ghost:hover {
  background: var(--cream-2);
}

.product-image-source-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}

.product-image-strip {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.product-image-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  width: 72px;
}

.product-image-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.product-image-remove {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.product-image-upload-preview:empty {
  display: none;
}

.product-image-item-upload {
  width: 84px;
}

.product-image-upload-name {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.2;
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image-remove-btn {
  width: fit-content;
  border: 0;
  background: none;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.product-image-error {
  margin-top: 8px;
  color: var(--red);
  font-size: 12px;
  line-height: 1.5;
}

.product-image-cropper {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, var(--cream) 100%);
}

.product-image-cropper-head strong {
  font-size: 14px;
  color: var(--ink);
}

.product-image-cropper-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.product-image-cropper-stage {
  display: flex;
  justify-content: center;
  align-items: center;
}

.product-image-cropper-frame {
  width: min(100%, 280px);
  aspect-ratio: 1;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(45deg, rgba(17, 16, 9, .04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(17, 16, 9, .04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(17, 16, 9, .04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(17, 16, 9, .04) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0px;
  box-shadow: inset 0 0 0 1px rgba(17, 16, 9, .08);
  touch-action: none;
}

.product-image-cropper-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, .92);
  border-radius: 20px;
  box-shadow: inset 0 0 0 1px rgba(17, 16, 9, .12);
  pointer-events: none;
}

.product-image-cropper-empty {
  position: absolute;
  inset: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.product-image-cropper-image {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  max-height: none;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
}

.product-image-cropper-image[hidden],
.product-image-cropper-empty[hidden] {
  display: none;
}

.product-image-cropper-zoom {
  display: grid;
  gap: 8px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.product-image-cropper-zoom input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

.product-image-cropper-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }

  .app {
    flex-direction: column;
  }

  .content {
    padding: 16px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

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

  .color-input-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .palette-options {
    grid-template-columns: 1fr;
  }

  .logo-upload-card {
    grid-template-columns: 1fr;
  }

  .banner-upload-preview-box {
    min-height: 140px;
  }
}

/* Dashboard Visual Refactor */
:root {
  --ink: #111009;
  --ink-2: #4A4740;
  --ink-3: #8A8680;
  --cream: #F8F6F1;
  --cream-2: #F2EFE8;
  --cream-3: #ECE7DD;
  --green: #2D6B45;
  --green-2: #4A9B68;
  --green-pale: #E8F2EC;
  --green-xpale: #F2F8F4;
  --amber: #F5C030;
  --amber-2: #E2AE1E;
  --amber-pale: #FEF6DC;
  --red: #D93B3B;
  --red-pale: #FEECEC;
  --blue: #3B6FE8;
  --blue-pale: #EEF3FD;
  --purple: #7B5EA7;
  --border: rgba(17, 16, 9, .08);
  --border-2: rgba(17, 16, 9, .04);
  --sidebar-w: 252px;
  --font-d: 'Syne', sans-serif;
  --font-b: 'Plus Jakarta Sans', sans-serif;
  --shadow-sm: 0 1px 3px rgba(17, 16, 9, .04), 0 4px 12px rgba(17, 16, 9, .05);
  --shadow-md: 0 4px 20px rgba(17, 16, 9, .08);
}

html,
body {
  background: var(--cream);
  color: var(--ink);
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--border);
}

.sidebar::before {
  display: none;
}

.sb-logo {
  border-bottom: 1px solid var(--border);
  padding: 18px 16px 14px;
}

.sb-logo-image {
  height: 32px;
}

.sb-logo-text {
  color: var(--ink);
  font-family: var(--font-d);
  font-size: 16px;
  font-weight: 800;
}

.sb-logo-text span {
  color: var(--green);
}

.sb-store {
  margin: 10px 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--cream);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.sb-store-content {
  min-width: 0;
}

.sb-store-logo-wrap {
  flex-shrink: 0;
}

.sb-store-logo-frame {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  border: 1px solid rgba(17, 16, 9, .08);
  background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(242, 239, 232, .95));
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
}

.sb-store-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sb-store-logo-fallback {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sb-store-label {
  color: var(--ink-3);
  margin-bottom: 4px;
}

.sb-store-name {
  color: var(--ink);
  font-weight: 700;
}

.sb-store-url {
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-nav {
  padding: 10px;
}

.sb-section-label {
  color: var(--ink-3);
  padding: 10px 8px 4px;
}

.sb-item {
  color: var(--ink-2);
  border-radius: 10px;
  font-weight: 500;
}

.sb-item:hover {
  background: var(--cream);
  color: var(--ink);
}

.sb-item.active {
  background: var(--green-pale);
  color: var(--green);
  font-weight: 700;
}

.sb-item .icon {
  opacity: .72;
}

.sb-icon {
  width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sb-item.active .icon {
  opacity: 1;
}

.sb-badge {
  margin-left: auto;
  min-width: 20px;
  text-align: center;
  background: var(--amber);
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.sb-item.active .sb-badge {
  background: var(--green);
  color: #fff;
}

.sb-bottom {
  border-top: 1px solid var(--border);
  padding: 10px;
}

.sb-plan {
  background: var(--green-pale);
  border: 1px solid rgba(45, 107, 69, .15);
  border-radius: 14px;
  margin-bottom: 8px;
}

.sb-plan-badge {
  color: var(--green);
}

.sb-plan-text {
  color: var(--ink-3);
}

.sb-plan-btn {
  border: 0;
  width: 100%;
  font-family: var(--font-b);
  background: var(--green);
  border-radius: 8px;
}

.sb-plan .button_to {
  margin-top: 8px;
}

.sb-plan-btn:hover {
  background: var(--green-2);
}

.sb-logout {
  border: 1px solid var(--border);
  color: var(--ink-2);
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  height: 60px;
  padding: 0 24px;
}

.topbar-title {
  font-family: var(--font-d);
  font-size: 19px;
  font-weight: 800;
}

.topbar-search {
  width: 210px;
  background: var(--cream);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.topbar-search:focus-within {
  border-color: var(--green);
  background: #fff;
}

.topbar-btn {
  background: #fff;
  border-radius: 10px;
}

.topbar-avatar {
  background: var(--green);
  color: #fff;
  border-radius: 10px;
  font-family: var(--font-d);
  font-weight: 700;
}

.topbar-extra-actions {
  margin-left: 2px;
}

.topbar-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
}

.topbar-cta:hover {
  background: var(--green-2);
}

.topbar-cta-secondary {
  background: #fff;
  color: var(--ink-2);
  border-color: var(--border);
}

.topbar-cta-secondary:hover {
  background: var(--cream);
}

.content {
  padding: 22px 24px;
}

.panel,
.card {
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
}

.card-pad {
  padding: 20px;
}

.card-pad-tight {
  padding-bottom: 8px;
}

.card-head {
  margin-bottom: 14px;
}

.card-title {
  font-family: var(--font-d);
  font-size: 14px;
  font-weight: 800;
}

.card-act-link {
  font-size: 12px;
  color: var(--green);
  font-weight: 700;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-head h1 {
  font-family: var(--font-d);
  font-size: 28px;
  letter-spacing: -.4px;
  margin-bottom: 4px;
}

.section-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.section-subtitle {
  color: var(--ink-3);
  font-size: 13px;
}

.dashboard-welcome {
  background: var(--green);
  border-radius: 24px;
  padding: 22px 28px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.dashboard-welcome h1 {
  font-family: var(--font-d);
  font-size: 24px;
  color: #fff;
  margin-bottom: 4px;
}

.dashboard-welcome p {
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
}

.dashboard-welcome p strong {
  color: #fff;
}

.dashboard-welcome-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, .6);
  margin-bottom: 5px;
}

.dashboard-welcome-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  padding: 0 18px;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--amber);
  color: var(--ink);
}

.btn-primary:hover {
  background: var(--amber-2);
}

.btn-ghost {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, .2);
}

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

.kpi-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px 20px;
}

.kpi-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.kpi-green {
  background: var(--green-pale);
}

.kpi-blue {
  background: var(--blue-pale);
}

.kpi-yellow {
  background: var(--amber-pale);
}

.kpi-amber {
  background: rgba(200, 137, 58, .18);
}

.kpi-purple {
  background: rgba(123, 94, 167, .15);
}

.kpi-label {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: .4px;
  margin-bottom: 4px;
}

.kpi-value {
  font-family: var(--font-d);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.kpi-meta {
  font-size: 11px;
  color: var(--ink-3);
}

.dashboard-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.dashboard-grid-main {
  grid-template-columns: 3fr 2fr;
}

.dashboard-side-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chart-bars.large {
  height: 130px;
}

.bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}

.bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  min-height: 6px;
}

.bar-green {
  background: var(--green-pale);
}

.bar-green:hover {
  background: var(--green);
}

.bar-value {
  font-size: 10px;
  color: var(--green);
  font-weight: 700;
  opacity: 0;
}

.bar-wrap:hover .bar-value {
  opacity: 1;
}

.bar-label {
  font-size: 10px;
  color: var(--ink-3);
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-2);
}

.activity-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--green-pale);
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-item p {
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 2px;
}

.activity-item small {
  font-size: 11px;
  color: var(--ink-3);
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--ink-3);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-2);
  vertical-align: middle;
}

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

.data-table tr:hover td {
  background: #fdfcf9;
}

.data-table td small {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
}

.table-products {
  color: var(--ink-3);
  font-size: 12px;
}

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

.table-actions .button_to,
.data-table .button_to,
.status-actions .button_to {
  margin: 0;
}

.table-actions .button_to {
  display: inline-flex;
}

.table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink-2);
  padding: 0 11px;
  font-size: 11px;
  font-weight: 600;
}

.table-action:hover {
  background: var(--cream);
}

.table-action-confirm {
  background: #25D366;
  color: #fff;
  border-color: #25D366;
}

.table-action-confirm:hover {
  background: #1ba653;
  border-color: #1ba653;
}

.table-note {
  color: var(--ink-3);
  font-size: 11px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--ink-2);
  background: var(--cream);
}

.status-new {
  color: #9A6E00;
  background: var(--amber-pale);
  border-color: rgba(245, 192, 48, .4);
}

.status-confirmed {
  color: var(--green);
  background: var(--green-xpale);
  border-color: rgba(45, 107, 69, .24);
}

.status-pending {
  color: #9A6E00;
  background: var(--amber-pale);
  border-color: rgba(245, 192, 48, .3);
}

.status-pending_payment {
  color: #9A6E00;
  background: var(--amber-pale);
  border-color: rgba(245, 192, 48, .3);
}

.status-paid {
  color: var(--blue);
  background: var(--blue-pale);
  border-color: rgba(59, 111, 232, .28);
}

.status-approved {
  color: var(--green);
  background: var(--green-xpale);
  border-color: rgba(45, 107, 69, .24);
}

.status-rejected {
  color: var(--red);
  background: var(--red-pale);
  border-color: rgba(217, 59, 59, .24);
}

.status-cancelled {
  color: var(--red);
  background: var(--red-pale);
  border-color: rgba(217, 59, 59, .24);
}

.link-inline-box {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  border: 1px solid var(--border);
  background: var(--cream);
  padding: 10px 12px;
  border-radius: 10px;
}

.link-inline-box span {
  font-size: 13px;
  color: var(--green);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-small {
  min-height: 28px;
  font-size: 11px;
  padding: 0 10px;
}

.checklist {
  display: grid;
  gap: 5px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink-2);
  font-size: 12px;
}

.checklist-item.done {
  background: var(--green-pale);
  color: var(--green);
}

.checklist-icon {
  width: 16px;
  text-align: center;
  font-weight: 700;
}

.product-top-list {
  display: grid;
  gap: 8px;
}

.product-top-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 9px 10px;
}

.product-top-item strong {
  font-size: 13px;
}

.product-top-item small {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 1px;
}

.product-top-item span {
  font-family: var(--font-d);
  font-size: 14px;
  font-weight: 800;
}

.filters-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink-2);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
}

.filter-chip small {
  color: var(--ink-3);
  font-size: 10px;
}

.filter-chip.active {
  background: var(--green-pale);
  color: var(--green);
  border-color: rgba(45, 107, 69, .3);
}

.orders-search-form {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 280px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
}

.orders-search-form input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--ink);
}

.analytics-filters-row {
  margin-bottom: 14px;
}

.analytics-filter-form {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.analytics-filter-select,
.analytics-filter-input {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--cream);
  color: var(--ink);
  font-size: 13px;
  font-family: var(--font-b);
  padding: 0 10px;
}

.analytics-filter-select {
  min-width: 190px;
}

.analytics-filter-input {
  min-width: 260px;
}

.analytics-events-table td {
  vertical-align: top;
}

.analytics-summary-cell {
  min-width: 320px;
  max-width: 560px;
}

.analytics-summary-main {
  font-size: 13px;
  color: var(--ink);
}

.analytics-summary-sub {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--ink-3);
}

.event-meta-disclosure {
  margin-top: 6px;
}

.event-meta-disclosure summary {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 8px;
  border: 1px dashed var(--border);
  background: var(--cream);
  color: var(--ink-2);
  padding: 0 9px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.event-meta-disclosure summary::-webkit-details-marker {
  display: none;
}

.event-meta-disclosure pre {
  margin-top: 8px;
  max-width: 620px;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #faf8f3;
  color: var(--ink-2);
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.order-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 10px 12px;
}

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

.order-item-row small {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
}

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

.status-action-btn {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  padding: 9px 12px;
}

.status-actions .button_to .status-action-btn {
  width: 100%;
}

.status-action-btn:hover {
  background: var(--cream);
}

.status-action-btn.active {
  background: var(--green-pale);
  color: var(--green);
  border-color: rgba(45, 107, 69, .3);
}

.quick-action-list {
  display: grid;
  gap: 8px;
}

.funnel-list {
  display: grid;
  gap: 10px;
}

.funnel-row {
  display: grid;
  gap: 6px;
}

.funnel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.funnel-track {
  height: 10px;
  border-radius: 999px;
  background: var(--cream);
  overflow: hidden;
}

.funnel-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--blue);
}

.funnel-fill-alt {
  background: var(--amber);
}

.funnel-fill-strong {
  background: var(--green);
}

.empty-inline {
  font-size: 13px;
  color: var(--ink-3);
  padding: 14px 0;
  text-align: center;
}

.flash {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 300;
  min-width: 260px;
  max-width: 380px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  background: #fff;
}

.flash-notice {
  border-color: rgba(45, 107, 69, .25);
  color: var(--green);
}

.flash-alert {
  border-color: rgba(217, 59, 59, .25);
  color: var(--red);
}

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

.plan-limit .button_to {
  margin-left: auto;
}

.plan-limit-upgrade-link {
  margin-left: auto;
}

.sb-plan-btn {
  display: block;
  text-align: center;
  text-decoration: none;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  max-width: 95%;
}

.plans-grid-upgrade {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plan-offer-card {
  border-radius: 16px;
  border: 2px solid rgba(245, 192, 48, .8);
  background: #f6f2e9;
  padding: 22px 24px;
  min-width: 100%;
}

.plan-offer-card-current {
  border-color: rgba(45, 107, 69, .24);
  background: #f4f7f4;
}

.plan-offer-card-target {
  border-color: rgba(245, 192, 48, .78);
}

.plan-offer-card.is-selected {
  box-shadow: 0 0 0 2px rgba(45, 107, 69, .25);
}

.plan-offer-head {
  margin-bottom: 8px;
}

.plan-offer-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #b67c15;
}

.plan-offer-kicker .icon {
  width: 18px;
  height: 18px;
  color: #e0ad17;
}

.plan-offer-head h2 {
  margin-top: 4px;
  font-family: var(--font-d);
  font-size: 34px;
  font-weight: 800;
  color: var(--ink);
}

.plan-offer-selected-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--green-pale);
  border: 1px solid rgba(45, 107, 69, .35);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.plan-offer-copy {
  margin: 10px 0 14px;
  color: var(--ink-2);
  line-height: 1.55;
}

.plan-offer-list {
  list-style: none;
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
}

.plan-offer-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
}

.plan-offer-list li::before {
  content: "✓";
  color: var(--green);
  font-weight: 800;
}

.plan-offer-action-wrap {
  margin-top: 18px;
}

.plan-offer-action-btn,
.plan-offer-action-disabled {
  width: 100%;
  min-height: 90px;
  border-radius: 12px;
  border: 0;
  background: #18120f;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px 16px;
}

.plan-offer-action-btn {
  cursor: pointer;
  transition: transform .16s ease, background .16s ease;
}

.plan-offer-action-btn:hover {
  background: #251b14;
  transform: translateY(-1px);
}

.plan-offer-action-btn strong,
.plan-offer-action-disabled strong {
  font-family: var(--font-d);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.plan-offer-action-btn strong span {
  font-family: var(--font-b);
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, .7);
}

.plan-offer-action-btn small,
.plan-offer-action-disabled span {
  margin-top: 4px;
  color: rgba(255, 255, 255, .86);
  font-size: 16px;
  font-weight: 500;
}

.plan-offer-action-disabled {
  background: #3a332d;
}

.plan-offer-action-disabled.is-requested {
  background: #6a5631;
}

.plan-offer-footnote {
  margin-top: 10px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-3);
}

.plan-coming-card {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #f4f2ee;
  overflow: hidden;
  min-height: 480px;
}

.plan-coming-label {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: rgba(17, 16, 9, .8);
  color: #fff;
}

.plan-coming-blur {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: 24px;
  filter: blur(2px);
  opacity: .8;
}

.plan-coming-title {
  font-family: var(--font-d);
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
}

.plan-coming-blur p {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.5;
}

.plan-coming-price {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 700;
  background: rgba(17, 16, 9, .09);
  color: var(--ink);
}

.upgrade-subscription-summary {
  border: 1px solid rgba(45, 107, 69, .25);
  background: #f4f8f5;
}

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

.upgrade-subscription-grid p {
  margin-top: 4px;
}

.upgrade-history-table .upgrade-history-row {
  cursor: pointer;
}

.upgrade-history-table .upgrade-history-row td {
  transition: background-color .14s ease;
}

.upgrade-history-table .upgrade-history-row:hover td,
.upgrade-history-table .upgrade-history-row.is-open td {
  background: rgba(37, 99, 235, .07);
}

.upgrade-history-table .upgrade-history-row:focus-visible {
  outline: 2px solid rgba(37, 99, 235, .42);
  outline-offset: -2px;
}

.upgrade-history-detail-row td {
  background: #f9f9fb;
  border-top: none;
}

.upgrade-history-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  padding: 8px 0;
}

.upgrade-history-detail-grid p {
  margin-top: 4px;
}

@media (max-width: 1360px) {
  .plans-grid-upgrade {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-coming-card {
    grid-column: 1 / -1;
    min-height: 220px;
  }
}

@media (max-width: 1120px) {
  .plans-grid-upgrade {
    grid-template-columns: 1fr;
  }

  .plan-coming-card {
    min-height: 240px;
    grid-column: auto;
  }

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

  .upgrade-history-detail-grid {
    grid-template-columns: 1fr;
  }
}

.sa-layout {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sa-topbar {
  height: 64px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  gap: 14px;
}

.sa-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.sa-brand strong {
  font-family: var(--font-d);
  font-size: 20px;
  letter-spacing: -.02em;
}

.sa-brand span {
  font-size: 12px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
}

.sa-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sa-nav-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  white-space: nowrap;
}

.sa-nav-link.active {
  color: var(--green);
  border-color: rgba(45, 107, 69, .35);
  background: var(--green-pale);
}

.sa-nav-link.logout {
  color: var(--red);
}

.sa-nav-btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  cursor: pointer;
}

.sa-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 22px 24px;
}

.sa-filter-grid {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(7, minmax(150px, 1fr)) auto auto;
  gap: 10px;
  align-items: center;
}

.sa-filter-grid .catalog-search {
  min-width: 0;
}

.sa-inline-form {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 8px;
  align-items: center;
}

.sa-inline-form-detail {
  margin-top: 12px;
  grid-template-columns: 180px 1fr auto;
}

.sa-upgrade-kpis {
  margin-bottom: 0;
}

.sa-inline-form .form-input {
  height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.sa-inline-actions {
  display: flex;
  gap: 6px;
}

.sa-inline-actions .btn {
  padding: 7px 10px;
  font-size: 11px;
}

.sa-mfa-panel {
  max-width: 560px;
}

@media (max-width: 1024px) {
  .sa-topbar {
    height: auto;
    padding: 14px;
    flex-direction: column;
    align-items: flex-start;
  }

  .sa-nav {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .sa-nav::-webkit-scrollbar {
    display: none;
  }

  .sa-content {
    padding: 14px;
  }

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

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

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

  .sa-inline-actions {
    flex-wrap: wrap;
  }
}

.product-card {
  border-radius: 20px;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}

.product-card:hover {
  border-color: rgba(45, 107, 69, .4);
}

.product-body {
  padding: 14px;
}

.product-name {
  font-family: var(--font-d);
  font-size: 14px;
  font-weight: 800;
}

.product-price {
  font-family: var(--font-d);
  font-size: 16px;
  font-weight: 800;
}

.product-card-actions {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.product-card-actions .btn {
  justify-content: center;
  min-height: 34px;
  font-size: 12px;
  font-weight: 700;
}

.product-edit-btn {
  background: var(--green);
  color: #fff;
  border: 1px solid var(--green);
  box-shadow: 0 2px 8px rgba(45, 107, 69, .24);
}

.product-edit-btn:hover {
  background: var(--green-2);
  border-color: var(--green-2);
}

.product-view-btn {
  background: #fff;
  color: var(--ink-2);
  border: 1px solid var(--border);
}

.product-view-btn:hover {
  background: var(--cream);
}

@media (max-width: 1200px) {
  .dashboard-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 900px) {
  .dashboard-welcome {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-grid-main {
    grid-template-columns: 1fr;
  }

  .orders-search-form {
    min-width: 100%;
    margin-left: 0;
  }

  .analytics-filter-form {
    width: 100%;
    margin-left: 0;
  }

  .analytics-filter-select,
  .analytics-filter-input {
    min-width: 100%;
    width: 100%;
  }

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

  .flash {
    left: 16px;
    right: 16px;
    max-width: none;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .dashboard-stats-grid {
    grid-template-columns: 1fr;
  }

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

  .topbar-search {
    display: none;
  }
}

/* Dashboard mobile nav + flash UX hardening */
.flash-stack {
  display: grid;
  gap: 10px;
}

.flash {
  position: relative;
  inset: auto;
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
}

.flash-message {
  flex: 1;
}

.flash-close {
  width: 26px;
  height: 26px;
  min-height: 26px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink-3);
  font-size: 17px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.flash-close:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}

.flash.is-closing {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease;
}

.dash-overlay {
  display: none;
}

.topbar-menu-btn {
  display: none;
}

@media (max-width: 900px) {

  html,
  body {
    overflow: hidden;
  }

  .app {
    position: relative;
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

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

  .content {
    padding: 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .topbar {
    height: 56px;
    padding: 0 12px;
    gap: 8px;
  }

  .topbar-title {
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-extra-actions {
    display: none;
  }

  .topbar-btn,
  .topbar-avatar {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }

  .topbar-notifications {
    display: none;
  }

  .topbar-menu-btn {
    display: inline-flex;
  }

  .topbar-logout-mobile {
    display: inline-flex;
    height: 34px;
    padding: 0 10px;
  }

  .sidebar {
    display: flex;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(84vw, 320px);
    max-width: 320px;
    z-index: 1100;
    transform: translateX(-105%);
    transition: transform .24s ease;
    box-shadow: var(--shadow-lg);
  }

  .app.is-sidebar-open .sidebar {
    transform: translateX(0);
  }

  .dash-overlay {
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(17, 16, 9, .35);
    z-index: 1090;
    cursor: pointer;
    display: none;
  }

  .app.is-sidebar-open .dash-overlay {
    display: block;
  }

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

  .toolbar>* {
    width: 100%;
  }

  .filters-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  .filters-row::-webkit-scrollbar {
    display: none;
  }

  .orders-search-form,
  .analytics-filter-form,
  .catalog-search {
    min-width: 100%;
    width: 100%;
    margin-left: 0;
  }
}

/* Dashboard responsive hardening (final override block) */
.main,
.content,
.panel,
.card,
.toolbar,
.row,
.section-head,
.dashboard-welcome,
.dashboard-welcome-actions,
.catalog-toolbar,
.filters-row,
.site-sections,
.site-section,
.settings-grid,
.grid-2,
.dashboard-grid,
.dashboard-grid-main,
.dashboard-side-stack,
.link-inline-box,
.product-top-item,
.order-item-row,
.quick-action-list,
.status-actions {
  min-width: 0;
}

.link-inline-box span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 1024px) {
  .content {
    padding: 16px;
  }

  .dashboard-grid-main {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 900px) {

  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
  }

  .main {
    width: 100%;
    min-width: 0;
    overflow: visible;
  }

  .content {
    min-height: calc(100dvh - 56px);
    overflow: visible;
    padding: 14px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .section-head h1 {
    line-height: 1.08;
    font-size: clamp(24px, 7.2vw, 30px);
  }

  .dashboard-welcome {
    padding: 18px 16px;
    border-radius: 18px;
  }

  .dashboard-welcome h1 {
    font-size: clamp(24px, 8vw, 34px);
    line-height: 1.03;
  }

  .dashboard-welcome-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .dashboard-welcome-actions .btn,
  .dashboard-welcome-actions .button,
  .toolbar .btn,
  .toolbar .button,
  .row .btn,
  .row .button {
    width: 100%;
    justify-content: center;
  }

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

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

  .catalog-subnav {
    flex-wrap: wrap;
  }

  .filters-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .orders-search-form,
  .catalog-search,
  .analytics-filter-form {
    min-width: 0;
    width: 100%;
    max-width: none;
  }

  .analytics-filter-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .analytics-filter-select,
  .analytics-filter-input {
    min-width: 0;
    width: 100%;
  }

  .settings-grid,
  .dashboard-grid-main,
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .qr-share-layout {
    grid-template-columns: 1fr;
  }

  .share-hero,
  .share-qr-layout,
  .share-quick-grid {
    grid-template-columns: 1fr;
  }

  .qr-share-preview {
    padding: 12px;
  }

  .site-section {
    padding: 14px;
  }

  .logo-upload-card {
    grid-template-columns: 1fr;
  }

  .product-image-mobile-actions,
  .product-image-cropper-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .product-image-action-btn,
  .product-image-cropper-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .banner-upload-preview-box {
    min-height: 120px;
  }

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

  .table-wrap {
    margin: 0 -2px;
    padding-bottom: 2px;
  }

  .orders-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table,
  .orders-table {
    min-width: 560px;
  }

  .data-table th,
  .data-table td,
  .orders-table th,
  .orders-table td {
    white-space: nowrap;
  }

  .table-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

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

  .product-top-item,
  .order-item-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal {
    width: min(100vw - 20px, 560px);
    max-height: 88dvh;
    padding: 18px;
  }

  .modal .settings-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .plan-limit .button_to,
  .plan-limit-upgrade-link {
    width: 100%;
    margin-left: 0;
  }

  .plan-limit .button_to .btn,
  .plan-limit-upgrade-link .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .content {
    padding: 12px;
  }

  .topbar {
    height: 54px;
    padding: 0 10px;
  }

  .topbar-title {
    font-size: 15px;
  }

  .panel,
  .card {
    border-radius: 16px;
  }

  .card-pad {
    padding: 14px;
  }

  .kpi-value {
    font-size: 24px;
  }

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

  .data-table,
  .orders-table {
    min-width: 520px;
  }
}
