:root {
  --bg: #0d0d0d;
  --surface: #141414;
  --surface-hover: #1a1a1a;
  --border: rgba(212, 175, 55, 0.22);
  --border-strong: rgba(212, 175, 55, 0.55);
  --gold: #d4af37;
  --gold-light: #f3c64f;
  --text: #f5f5f5;
  --muted: rgba(245, 245, 245, 0.68);
  --crimson: #e04f5f;
  --green: #4ade80;
  --blue: #60a5fa;
  --amber: #fbbf24;
  --radius-sm: 8px;
  --radius-md: 12px;
  --font-sans: "Plus Jakarta Sans", "Inter", "Cairo", system-ui, -apple-system, sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", "Cairo", system-ui, -apple-system, sans-serif;
}

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

html,
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.badge-gold {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn--sm {
  padding: 7px 13px;
  font-size: 0.82rem;
}

.btn--full {
  width: 100%;
}

.btn--gold {
  background: linear-gradient(135deg, #c69a28, #e8c766);
  color: #0d0d0d;
}

.btn--gold:hover {
  background: linear-gradient(135deg, #d4af37, #f0d47e);
}

.btn--gold:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn--outline-gold {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--gold-light);
}

.btn--outline-gold:hover {
  background: rgba(212, 175, 55, 0.12);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

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

.btn--danger-outline {
  background: transparent;
  border-color: rgba(224, 79, 95, 0.45);
  color: var(--crimson);
}

.btn--danger-outline:hover {
  background: rgba(224, 79, 95, 0.12);
}

.btn--whatsapp {
  background: rgba(37, 211, 102, 0.14);
  border-color: rgba(37, 211, 102, 0.45);
  color: #4ade80;
}

.btn--whatsapp:hover {
  background: rgba(37, 211, 102, 0.24);
}

/* Form Controls */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field__input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #0d0d0d;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 0.93rem;
}

.field__input:focus {
  outline: none;
  border-color: var(--gold);
}

.field__input--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84rem;
}

.fields-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

/* Login Screen */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-card__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-card__logo {
  height: 44px;
  width: auto;
  object-fit: contain;
}

.login-card__title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.login-card__sub {
  font-size: 0.9rem;
  color: var(--muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
}

.login-error {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--crimson);
  background: rgba(224, 79, 95, 0.1);
  border: 1px solid rgba(224, 79, 95, 0.3);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}

/* Shell Layout: Fixed Left Sidebar + Workspace */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 268px;
  flex: 0 0 268px;
  background: #101010;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__brand {
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar__logo {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.sidebar__title {
  font-weight: 800;
  font-size: 0.96rem;
  letter-spacing: 0.06em;
  color: var(--gold-light);
}

.sidebar__sub {
  font-size: 0.74rem;
  color: var(--muted);
}

.sidebar__close {
  display: none;
  margin-left: auto;
}

.sidebar__nav {
  flex: 1 1 auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.nav-link.is-active {
  background: rgba(212, 175, 55, 0.12);
  border-color: rgba(212, 175, 55, 0.35);
  color: var(--gold-light);
}

.nav-link__ar {
  margin-left: auto;
  font-size: 0.75rem;
  opacity: 0.75;
}

.nav-badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gold);
  color: #0d0d0d;
  font-size: 0.72rem;
  font-weight: 800;
}

.sidebar__footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Workspace */
.workspace {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  background: rgba(13, 13, 13, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  cursor: pointer;
}

.topbar__view-meta {
  display: flex;
  flex-direction: column;
}

.topbar__title {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #ffffff;
  line-height: 1.25;
}

.topbar__subtitle {
  font-size: 0.8rem;
  color: var(--muted);
}

.region-pills {
  display: flex;
  gap: 8px;
}

.region-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold-light);
}

.workspace-main {
  padding: 28px 32px 64px;
  max-width: 100%;
  width: 100%;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 22px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid rgba(212, 175, 55, 0.24);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kpi-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kpi-card__label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.kpi-card__val {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.15;
}

.kpi-card__val--gold {
  color: var(--gold-light);
}

.kpi-card__foot {
  font-size: 0.84rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.kpi-card__link {
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--gold-light);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.kpi-card__link:hover {
  text-decoration: underline;
}

/* Visual Charts Row (Full-Width 2fr / 1fr) */
.charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 22px;
}

.chart-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 290px;
}

.chart-wrap--doughnut {
  height: 210px;
}

.doughnut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.doughnut-center strong {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.05;
}

.doughnut-center span {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.chart-legend-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 0.76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #f5f5f5;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.region-split-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.region-split-chip {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: #0d0d0d;
  border: 1px solid rgba(212, 175, 55, 0.18);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.region-split-chip span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.region-split-chip strong {
  font-size: 0.9rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--gold-light);
}

/* Insights Grid (Row 2) */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 22px;
}

.insights-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.insight-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.insight-bar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
}

.insight-bar__name {
  font-weight: 700;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.insight-bar__meta {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-weight: 700;
  color: var(--gold-light);
  white-space: nowrap;
}

.insight-bar__track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.insight-bar__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #c69a28, #f3c64f);
}

.tier-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(245, 245, 245, 0.85);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Panel Cards */
.panel-card {
  background: var(--surface);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-card--inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-card__heading {
  display: block;
  font-size: 0.96rem;
  font-weight: 700;
  color: #ffffff;
}

.panel-card__desc {
  font-size: 0.84rem;
  color: var(--muted);
}

.panel-card__section-title {
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-light);
}

.section-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* Tables & Status Badges */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.data-table th,
.data-table td {
  padding: 15px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  white-space: nowrap;
}

.data-table td strong {
  font-weight: 700;
  color: #ffffff;
}

.data-table thead th {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(245, 245, 245, 0.72);
  padding-top: 10px;
}

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

.data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.phone-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.phone-link {
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.phone-link:hover {
  color: var(--gold-light);
}

.badge-vip {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(243, 198, 79, 0.16);
  border: 1px solid rgba(243, 198, 79, 0.45);
  color: #f3c64f;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.order-status {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.order-status--new { background: rgba(243, 198, 79, 0.18); color: #f3c64f; border: 1px solid rgba(243, 198, 79, 0.35); }
.order-status--confirmed { background: rgba(96, 165, 250, 0.18); color: #93c5fd; border: 1px solid rgba(96, 165, 250, 0.35); }
.order-status--shipped { background: rgba(251, 191, 36, 0.18); color: #fcd34d; border: 1px solid rgba(251, 191, 36, 0.35); }
.order-status--delivered { background: rgba(74, 222, 128, 0.18); color: #86efac; border: 1px solid rgba(74, 222, 128, 0.35); }
.order-status--cancelled { background: rgba(224, 79, 95, 0.18); color: #fda4af; border: 1px solid rgba(224, 79, 95, 0.35); }

/* Orders Toolbar */
.orders-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-tab {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.filter-tab.is-active {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold);
  color: var(--gold-light);
}

.orders-search {
  max-width: 300px;
}

/* Products Grid */
.products-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.product-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.product-row:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.product-row.is-hidden {
  opacity: 0.58;
}

.product-row__thumb {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: var(--radius-sm);
  background: #0d0d0d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.product-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-row__info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-row__top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.product-row__title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-dot {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-dot--live { background: rgba(74, 222, 128, 0.12); color: var(--green); }
.status-dot--hidden { background: rgba(255, 255, 255, 0.08); color: var(--muted); }

.product-row__prices {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.84rem;
  color: var(--muted);
}

.product-row__prices strong {
  color: var(--gold-light);
}

/* Store Settings Grid */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.settings-span-2 {
  grid-column: 1 / -1;
}

.hero-preview {
  width: 160px;
  flex: 0 0 160px;
  height: 100px;
  padding: 0;
}

.hero-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Slide-Over Drawers */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 40;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(640px, 100vw);
  background: #101010;
  border-left: 1px solid var(--border);
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.drawer__header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #0d0d0d;
}

.drawer__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
  margin-top: 4px;
}

.icon-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #ffffff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer__footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: #0d0d0d;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.drawer__footer--split {
  justify-content: space-between;
  align-items: center;
}

.drawer__footer-right {
  display: flex;
  gap: 10px;
}

/* Order Details Drawer Cards */
.order-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  font-size: 0.88rem;
}

.order-meta-item span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
}

.order-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-item-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: #0d0d0d;
  font-size: 0.88rem;
}

.order-totals-box {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.88rem;
}

.order-totals-row {
  display: flex;
  justify-content: space-between;
}

.order-totals-row--grand {
  font-size: 1rem;
  font-weight: 800;
  color: var(--gold-light);
  padding-top: 6px;
}

/* Toggle Switch, Images, Tier Pricing */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch__track {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  position: relative;
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 180ms ease;
}

.switch input:checked + .switch__track { background: var(--gold); }
.switch input:checked + .switch__track::after { transform: translateX(20px); background: #0d0d0d; }
.switch__label { font-size: 0.84rem; font-weight: 700; min-width: 50px; }

.main-img-manager { display: flex; gap: 16px; align-items: center; }

.main-img-preview {
  width: 112px;
  height: 112px;
  flex: 0 0 112px;
  border-radius: var(--radius-sm);
  background: #0d0d0d;
  border: 1px solid var(--border);
  padding: 6px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.main-img-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.main-img-controls { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.upload-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.upload-hint { font-size: 0.78rem; color: var(--muted); }

.gallery-manager {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-manager__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }

.gallery-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.gallery-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }

.gallery-thumb__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(13, 13, 13, 0.9);
  color: #ffffff;
  font-size: 0.82rem;
  cursor: pointer;
}

.gallery-thumb__remove:hover { background: var(--crimson); }

.tier-grid { display: flex; flex-direction: column; gap: 8px; }
.tier-grid__head,
.tier-grid__row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; align-items: center; }
.tier-grid__head { font-size: 0.74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.tier-name { font-size: 0.88rem; font-weight: 600; color: #ffffff; }
.usd-toggle-wrap { padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; flex-direction: column; gap: 12px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; font-size: 0.85rem; color: var(--muted); cursor: pointer; }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--gold); }

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 80;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: #161616;
  border: 1px solid var(--gold);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
}

.toast.is-error { border-color: var(--crimson); color: #ffd0d5; }

/* Responsive */
@media (max-width: 1120px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .products-list, .settings-grid, .insights-grid, .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 35;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 220ms ease;
  }

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

  .sidebar__close,
  .mobile-menu-btn {
    display: inline-flex;
  }

  .topbar,
  .workspace-main {
    padding-inline: 16px;
  }
}

@media (max-width: 600px) {
  .kpi-grid,
  .fields-3,
  .order-meta-grid {
    grid-template-columns: 1fr;
  }

  .region-pills { display: none; }
  .main-img-manager { flex-direction: column; align-items: stretch; }
  .gallery-thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
