:root {
  --primary: #5a0b0b;
  --primary-soft: #7a1414;
  --dark: #1f0707;
  --ink: #160707;
  --gold: #d4af37;
  --gold-bright: #f0d78c;
  --gold-deep: #b8860b;
  --cream: #fbf5ea;
  --cream-2: #fff8ee;
  --white: #fffdf8;
  --muted: #7a5a5a;
  --line: rgba(212, 175, 55, 0.28);
  --ok: #1e7a46;
  --danger: #8b1e1e;
  --shadow: 0 18px 40px rgba(53, 6, 6, 0.08);
  --shadow-soft: 0 10px 28px rgba(53, 6, 6, 0.05);
  --radius: 1.15rem;
  --side-w: 268px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Cinzel", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse at 0% 0%, rgba(212, 175, 55, 0.12), transparent 42%),
    radial-gradient(ellipse at 100% 0%, rgba(90, 11, 11, 0.08), transparent 40%),
    linear-gradient(180deg, #fff9ef 0%, var(--cream) 45%, #f7efe3 100%);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }

/* Shell */
.shell {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: 100vh;
}
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem 1.1rem;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(212, 175, 55, 0.22), transparent 50%),
    linear-gradient(185deg, #160505 0%, #1f0707 45%, #2c0a0a 100%);
  color: #f7e7c2;
  border-right: 1px solid rgba(212, 175, 55, 0.18);
  overflow: auto;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .35rem .45rem 1.15rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.16);
  margin-bottom: 1.1rem;
}
.side-brand img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(212, 175, 55, 0.25));
}
.side-brand strong {
  display: block;
  font-family: var(--display);
  font-size: .92rem;
  letter-spacing: .02em;
  color: var(--gold-bright);
  line-height: 1.25;
}
.side-brand span {
  display: block;
  margin-top: .2rem;
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(247, 220, 132, 0.55);
}
.nav-label {
  margin: .35rem .55rem .45rem;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(240, 215, 140, 0.45);
}
.nav { display: grid; gap: .28rem; }
.nav a {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .78rem .85rem;
  border-radius: .9rem;
  color: rgba(247, 231, 194, 0.78);
  border: 1px solid transparent;
  transition: .18s ease;
}
.nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav a:hover {
  background: rgba(212, 175, 55, 0.1);
  color: #fff8e8;
  border-color: rgba(212, 175, 55, 0.14);
}
.nav a.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.22), rgba(90, 11, 11, 0.45));
  color: #fff;
  border-color: rgba(212, 175, 55, 0.28);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.08);
}
.side-foot {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(212, 175, 55, 0.14);
}
.side-user {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem .4rem 1rem;
}
.side-user .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--gold-bright), var(--gold-deep));
  color: var(--dark);
  font-weight: 800;
  font-size: .85rem;
}
.side-user strong { display: block; font-size: .88rem; color: #fff; }
.side-user span { display: block; font-size: .72rem; color: rgba(247, 231, 194, 0.55); }

.main-wrap { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .95rem 1.5rem;
  background: rgba(255, 249, 239, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-title {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.topbar-title .eyebrow {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.topbar-title h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: .01em;
}
.topbar-actions { display: flex; align-items: center; gap: .65rem; }
.main {
  padding: 1.35rem 1.5rem 2.4rem;
}

/* Cards / surfaces */
.card {
  background: linear-gradient(180deg, #ffffff 0%, var(--white) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow-soft);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: 1rem;
}
.card-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--primary);
  font-weight: 600;
}
.card-head p {
  margin: .2rem 0 0;
  color: var(--muted);
  font-size: .82rem;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.top h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.7rem;
  color: var(--primary);
  font-weight: 600;
}
.top .sub {
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: .9rem;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .95rem;
  margin-bottom: 1.25rem;
}
.stat {
  position: relative;
  overflow: hidden;
  padding: 1.15rem 1.15rem 1.05rem;
}
.stat::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -24px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.18), transparent 70%);
}
.stat .icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: .85rem;
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.22), rgba(90, 11, 11, 0.08));
  color: var(--primary);
  border: 1px solid rgba(212, 175, 55, 0.28);
}
.stat .icon svg { width: 18px; height: 18px; }
.stat strong {
  display: block;
  font-family: var(--display);
  font-size: 1.55rem;
  color: var(--primary);
  letter-spacing: .01em;
}
.stat span {
  display: block;
  margin-top: .2rem;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 500;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
}

/* Tables */
.table-wrap { overflow: auto; border-radius: .9rem; }
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .9rem;
}
th, td {
  text-align: left;
  padding: .85rem .7rem;
  border-bottom: 1px solid #f0e4d0;
  vertical-align: middle;
}
th {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: linear-gradient(180deg, #fffaf1, #fff6e8);
}
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: rgba(255, 244, 220, 0.55); }
td a {
  color: var(--primary);
  font-weight: 650;
}
td a:hover { color: var(--gold-deep); text-decoration: underline; }
.empty {
  text-align: center;
  color: var(--muted);
  padding: 1.6rem .8rem !important;
}

/* Buttons / badges */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: 0;
  border-radius: 999px;
  padding: .62rem 1.05rem;
  font-weight: 700;
  cursor: pointer;
  font-size: .86rem;
  transition: .16s ease;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  background: linear-gradient(180deg, #6d1212, var(--primary));
  color: var(--gold-bright);
  box-shadow: 0 8px 18px rgba(90, 11, 11, 0.22);
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-gold {
  background: linear-gradient(180deg, #f0d78c, #c9a24e 55%, var(--gold-deep));
  color: var(--dark);
  box-shadow: 0 8px 18px rgba(184, 134, 11, 0.25);
}
.btn-gold:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-ghost {
  background: rgba(255, 253, 248, 0.7);
  border: 1px solid var(--line);
  color: var(--primary);
}
.btn-ghost:hover { background: #fff4dc; }
.btn-danger {
  background: linear-gradient(180deg, #a32626, var(--danger));
  color: #fff;
}
.btn-side {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #f7e7c2;
}
.btn-side:hover { background: rgba(212, 175, 55, 0.12); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .22rem .6rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .02em;
  text-transform: capitalize;
  background: #fff4dc;
  color: #8a6a08;
  border: 1px solid rgba(212, 175, 55, 0.28);
}
.badge.paid, .badge.delivered, .badge.completed, .badge.confirmed, .badge.Active, .badge.active {
  background: #e8f5ec;
  color: var(--ok);
  border-color: rgba(30, 122, 70, 0.2);
}
.badge.cancelled, .badge.failed, .badge.Hidden, .badge.no_show {
  background: #fde8e8;
  color: var(--danger);
  border-color: rgba(139, 30, 30, 0.18);
}
.badge.packed, .badge.shipped, .badge.read, .badge.replied {
  background: #eef3ff;
  color: #314f9c;
  border-color: rgba(49, 79, 156, 0.18);
}
.badge.new { background: #fff0d8; color: #9a5b00; }

.flash, .error {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .8rem 1rem;
  border-radius: .9rem;
  margin-bottom: 1rem;
  font-size: .9rem;
  font-weight: 550;
}
.flash {
  background: #e8f5ec;
  color: var(--ok);
  border: 1px solid #b7e0c3;
}
.error {
  background: #fde8e8;
  color: var(--danger);
  border: 1px solid #f3c1c1;
}

/* Settings */
.settings-status {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: 1rem;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
}
.status-pill .dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: #b7b0a3;
}
.status-pill.ok { background: #e8f5ec; border-color: #b7e0c3; color: var(--ok); }
.status-pill.ok .dot { background: var(--ok); }
.status-pill.warn { background: #fff4dc; border-color: rgba(212, 175, 55, 0.35); color: #8a6a08; }
.status-pill.warn .dot { background: #c9a227; }
.status-pill.muted { background: #f4f1ea; color: var(--muted); }
.status-pill.test { background: #eef3ff; border-color: rgba(49, 79, 156, 0.18); color: #314f9c; }
.status-pill.test .dot { background: #314f9c; }
.status-pill.live { background: #fde8e8; border-color: rgba(139, 30, 30, 0.18); color: var(--danger); }
.status-pill.live .dot { background: var(--danger); }
.form-hint {
  margin: .15rem 0 0;
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.45;
}
.field-static {
  display: flex;
  align-items: center;
  min-height: 2.7rem;
  padding: .72rem .9rem;
  border-radius: .85rem;
  border: 1px solid var(--line);
  background: #f7f3ea;
  font-size: .88rem;
  font-weight: 600;
}
.field-static.ok { background: #e8f5ec; border-color: #b7e0c3; color: var(--ok); }
.field-static.warn { background: #fff4dc; border-color: rgba(212, 175, 55, 0.35); color: #8a6a08; }

/* Forms */
.form-grid { display: grid; gap: .95rem; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
label {
  display: block;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .35rem;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: .85rem;
  padding: .72rem .9rem;
  background: #fffdf8;
  color: var(--ink);
  outline: none;
  transition: .15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(184, 134, 11, 0.65);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.14);
  background: #fff;
}
textarea { min-height: 118px; resize: vertical; }
.checks { display: flex; flex-wrap: wrap; gap: 1rem; }
.checks label {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
  color: var(--ink);
  font-size: .9rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}
.checks input { width: auto; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-bottom: 1rem;
  padding: .85rem;
  background: rgba(255, 253, 248, 0.75);
  border: 1px solid var(--line);
  border-radius: 1rem;
}
.toolbar input, .toolbar select { max-width: 260px; }
.pager { margin-top: 1rem; }
.pager nav { display: flex; flex-wrap: wrap; gap: .35rem; }
.pager a, .pager span {
  display: inline-flex;
  min-width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 .55rem;
  border-radius: .65rem;
  border: 1px solid var(--line);
  background: #fff;
  font-size: .82rem;
  font-weight: 600;
  color: var(--primary);
}
.pager span { opacity: .55; }

.detail-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1rem;
}
.meta-block {
  padding: .9rem 1rem;
  border-radius: .9rem;
  background: linear-gradient(180deg, #fffaf1, #fff6e8);
  border: 1px solid var(--line);
  line-height: 1.55;
  font-size: .92rem;
}
.meta-block strong { color: var(--primary); }

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(212, 175, 55, 0.28), transparent 40%),
    radial-gradient(ellipse at 90% 80%, rgba(139, 30, 30, 0.35), transparent 45%),
    linear-gradient(155deg, #120404 0%, #1f0707 40%, #5a0b0b 78%, #2a0808 100%);
}
.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(240, 215, 140, 0.08) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, #000, transparent 90%);
  pointer-events: none;
}
.login-card {
  position: relative;
  width: min(440px, 100%);
  padding: 1.8rem 1.55rem 1.45rem;
  border-radius: 1.5rem;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), #fff8ee);
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: 1.5rem 1.5rem 0 0;
  background: linear-gradient(90deg, #8b1e1e, var(--gold), #8b1e1e);
}
.login-brand {
  text-align: center;
  margin-bottom: 1.35rem;
}
.login-brand img {
  width: 92px;
  height: auto;
  margin: 0 auto .85rem;
  filter: drop-shadow(0 10px 20px rgba(90, 11, 11, 0.2));
}
.login-brand .eyebrow {
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.login-brand h1 {
  margin: .35rem 0 0;
  font-family: var(--display);
  font-size: 1.55rem;
  color: var(--primary);
}
.login-brand p {
  margin: .4rem 0 0;
  color: var(--muted);
  font-size: .9rem;
}
.remember {
  display: flex;
  gap: .45rem;
  align-items: center;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 550;
}
.remember input { width: auto; }
.login-note {
  margin: 1rem 0 0;
  text-align: center;
  font-size: .75rem;
  color: var(--muted);
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: 1.15rem;
}
.quick-links a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem .85rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--primary);
  font-size: .82rem;
  font-weight: 650;
  box-shadow: var(--shadow-soft);
}
.quick-links a:hover { background: #fff4dc; }

/* Product catalogue */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.product-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, var(--white) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform .16s ease, box-shadow .16s ease;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.product-card-media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background:
    radial-gradient(circle at 30% 20%, rgba(212, 175, 55, 0.18), transparent 55%),
    #f3e7d2;
  overflow: hidden;
}
.product-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-card-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
}
.product-card-media .badge {
  position: absolute;
  top: .7rem;
  left: .7rem;
}
.product-card-body {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: 1rem 1.05rem 1.1rem;
  flex: 1;
}
.product-card-meta {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.product-card-body h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.3;
}
.product-card-body h3 a:hover { color: var(--gold-deep); }
.product-card-price {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: .45rem;
}
.product-card-price strong {
  font-size: 1.05rem;
  color: var(--primary);
}
.product-card-price span {
  font-size: .82rem;
  color: var(--muted);
  text-decoration: line-through;
}
.product-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: auto;
  padding-top: .55rem;
}
.product-card-actions .btn { padding: .5rem .85rem; font-size: .8rem; }

.image-manager {
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fffaf1, #fff7ea);
}
.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: .75rem;
}
.image-preview-item {
  position: relative;
  display: block;
  margin: 0;
  aspect-ratio: 1;
  border-radius: .9rem;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: #efe2cb;
}
.image-preview-item input {
  position: absolute;
  top: .55rem;
  left: .55rem;
  z-index: 2;
  width: auto;
  accent-color: var(--primary);
}
.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .15s ease;
}
.image-preview-item:has(input:not(:checked)) {
  border-color: rgba(139, 30, 30, 0.35);
}
.image-preview-item:has(input:not(:checked)) img { opacity: .35; }
.image-preview-check,
.image-preview-primary {
  position: absolute;
  z-index: 2;
  font-size: .65rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .2rem .45rem;
  border-radius: 999px;
}
.image-preview-check {
  right: .5rem;
  bottom: .5rem;
  background: rgba(255, 253, 248, 0.92);
  color: var(--primary);
}
.image-preview-primary {
  left: .5rem;
  bottom: .5rem;
  background: linear-gradient(180deg, #f0d78c, #c9a24e);
  color: var(--dark);
}
.image-hint {
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .8rem;
}
.image-advanced {
  margin-top: .85rem;
  border-top: 1px dashed var(--line);
  padding-top: .75rem;
}
.image-advanced summary {
  cursor: pointer;
  font-size: .82rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: .55rem;
}
.image-manager input[type="file"] {
  padding: .65rem .8rem;
  background: #fff;
}

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .detail-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .image-preview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    max-height: none;
    padding: .85rem 1rem;
    border-right: 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.18);
  }
  .side-brand { margin-bottom: .75rem; padding-bottom: .75rem; }
  .nav-label { display: none; }
  .nav {
    display: flex;
    gap: .35rem;
    overflow-x: auto;
    padding-bottom: .15rem;
    -webkit-overflow-scrolling: touch;
  }
  .nav a {
    flex: 0 0 auto;
    padding: .55rem .75rem;
    font-size: .8rem;
    white-space: nowrap;
  }
  .side-foot {
    margin-top: .75rem;
    padding-top: .75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
  }
  .side-user { padding: 0; flex: 1; min-width: 0; }
  .side-user span { display: none; }
  .side-foot form { margin: 0; }
  .btn-side { width: auto; padding: .5rem .85rem; }
  .form-grid.two { grid-template-columns: 1fr; }
  .main, .topbar { padding-left: 1rem; padding-right: 1rem; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; }
  .topbar { flex-wrap: wrap; }
  .product-grid { grid-template-columns: 1fr; }
  .image-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
