/* =====================
   ADMIN SHELL + DASHBOARD e UTENTI (fase 8a+8b)
   ===================== */
.admin-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
  background: var(--c-bg);
}
.admin-sidebar {
  width: 250px;
  background: var(--c-bg-secondary);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.admin-sidebar__header {
  padding: var(--sp-xl) var(--sp-lg) var(--sp-lg);
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
}
.admin-sidebar__logo {
  text-decoration: none;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}
.admin-sidebar__nav { padding: 0; margin: 0; list-style: none; }
.admin-sidebar__item {
  cursor: pointer;
  padding: var(--sp-md) var(--sp-lg);
  border: none;
  background: none;
  outline: none;
  color: var(--c-text);
  font-size: var(--text-base);
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  transition: background 0.1s;
}
.admin-sidebar__item.active, .admin-sidebar__item:focus {
  background: var(--c-bg-highlight);
  font-weight: var(--fw-semibold);
}
.admin-content {
  padding: var(--sp-xl);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2xl);
}
/* KPI grid layout */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-xl);
  margin-bottom: var(--sp-2xl);
}
.kpi-card {
  background: var(--c-bg-secondary);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-lg);
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
  min-height: 110px;
}
.kpi-card__icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-bg-highlight);
  border-radius: 50%;
}
.kpi-card__data {
  flex: 1;
}
.kpi-card__value {
  font-size: 2.4rem;
  font-weight: var(--fw-semibold);
  color: var(--c-text);
}
.kpi-card__label {
  font-size: var(--text-base);
  color: var(--c-text-secondary);
}
/* KPI color variants */
.kpi-card--success .kpi-card__icon { background: #c6f6d5; }
.kpi-card--warning .kpi-card__icon { background: #fff3cd; }
.kpi-card--info .kpi-card__icon { background: #d1e7fd; }

/* Utenti section */
.admin-table-container {
  overflow-x: auto;
  margin-bottom: var(--sp-lg);
}
.admin-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 900px;
  background: var(--c-bg);
}
.admin-table th,
.admin-table td {
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
  text-align: left;
}
.admin-table th {
  background: var(--c-bg-secondary);
  font-weight: var(--fw-semibold);
}
.admin-table tr:hover {
  background: var(--c-bg-highlight);
  transition: background 0.18s;
}
.admin-table .badge { margin-left: .5rem; }

.admin-pagination {
  display: flex; justify-content: center; gap: var(--sp-sm); margin: var(--sp-lg) 0;
}
.pagination-btn {
  padding: var(--sp-xs) var(--sp-sm);
  background: none;
  border: 1px solid var(--c-border);
  border-radius: var(--r-xs);
  font-size: var(--text-sm);
  color: var(--c-text);
  cursor: pointer;
  margin: 0 2px;
}
.pagination-btn.active { background: var(--c-bg-highlight); font-weight: var(--fw-semibold); }
.pagination-btn.disabled { background: #e9ecef; color: #b5b5b5; cursor: not-allowed; }

/* Ricerca + Filtri utenti */
.admin-search-filters {
  display: flex; gap: var(--sp-lg); align-items: center;
  margin-bottom: var(--sp-md);
}
.search-input { padding: var(--sp-xs) var(--sp-sm); border-radius: var(--r-sm); border: 1px solid var(--c-border); width: 220px; }
.filter-select { border-radius: var(--r-xs); border: 1px solid var(--c-border); padding: var(--sp-xs) var(--sp-sm); }

/* Pannello laterale dettaglio utente */
.admin-detail-panel {
  position: fixed;
  top: 0; right: -600px; width: 420px; height: 100%;
  background: var(--c-bg);
  border-left: 1px solid var(--c-border);
  box-shadow: -4px 0 16px rgba(0,0,0,0.07);
  transition: right .27s;
  z-index: 1001;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: var(--sp-xl) var(--sp-lg);
}
.admin-detail-panel.open {
  right: 0;
  box-shadow: -6px 0 36px 0 rgba(0,0,0,.07);
}
.detail-panel-close {
  border: none; background: none; position: absolute; top: 24px; right: 24px; cursor: pointer;
}
.user-detail-header { margin-bottom: var(--sp-md); }
.user-detail-header h3 { margin: 0; }
.user-detail-meta { color: var(--c-text-secondary); font-size: var(--text-sm); margin-top: var(--sp-lg); }

/* Badges */
.badge {
  display: inline-block;
  border-radius: 1em;
  padding: 0.2em 0.85em 0.2em 0.7em;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.5;
  background: #e9ecef;
  color: var(--c-text);
  vertical-align: middle;
}
.badge--active { background: #d4fbd8; color: #107025; }
.badge--inactive { background: #ededed; color: #595959; }
.badge--warning, .badge--admin { background: #212121; color: #fff; }
.badge--info, .badge--reseller { background: #1973c6; color: #fff; }
.badge--success { background: #d4fbd8; color: #107025; }

/* Altro */
.empty-state {
  text-align: center; color: var(--c-text-secondary); padding: var(--sp-2xl);
}

/* =====================
   BACKOFFICE ADMIN
   ===================== */

.admin-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - var(--navbar-h));
  margin-top: var(--navbar-h);
}

.admin-sidebar {
  background: var(--c-bg);
  border-right: 1px solid var(--c-border);
  padding: var(--sp-lg) 0;
  position: sticky;
  top: var(--navbar-h);
  height: calc(100vh - var(--navbar-h));
  overflow-y: auto;
  color: var(--c-text);
}

.admin-sidebar__title {
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text-secondary);
  padding: 0 var(--sp-lg) var(--sp-sm);
}

.admin-sidebar__item {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  font-size: var(--text-sm);
  cursor: pointer;
  color: var(--c-text);
  transition: background var(--t-fast);
  border-left: 3px solid transparent;
}
.admin-sidebar__item:hover { background: var(--c-bg-secondary); }
.admin-sidebar__item.active {
  font-weight: var(--fw-semibold);
  border-left-color: var(--c-text);
  background: var(--c-bg-secondary);
}

.admin-content {
  padding: var(--sp-xl);
  overflow-y: auto;
  color: var(--c-text);
}

.admin-content__title {
  font-size: var(--text-2xl);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--sp-xl);
}

/* KPI Dashboard */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-lg);
  margin-bottom: var(--sp-xl);
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}
.kpi-card__value {
  font-size: 2.5rem;
  font-weight: var(--fw-bold);
  line-height: 1;
  color: var(--c-text);
}
.kpi-card__label {
  font-size: var(--text-sm);
  color: var(--c-text-secondary);
}

/* Admin table */
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.admin-table th {
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 2px solid var(--c-border);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--c-text-secondary);
  white-space: nowrap;
}
.admin-table td {
  padding: var(--sp-md);
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
  vertical-align: middle;
}
.admin-table tr:hover td { background: var(--c-bg-secondary); cursor: pointer; }
.admin-table tr.selected td { background: var(--c-bg-secondary); }

/* Admin filters bar */
.admin-filters {
  display: flex;
  gap: var(--sp-md);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--sp-lg);
}
.admin-filters .input { max-width: 280px; }
.admin-filters select { min-width: 140px; }

/* Pagination */
.admin-pagination {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  justify-content: flex-end;
  margin-top: var(--sp-lg);
  font-size: var(--text-sm);
}
.admin-pagination button {
  padding: var(--sp-xs) var(--sp-md);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  cursor: pointer;
  background: var(--c-bg);
  color: var(--c-text);
  transition: background var(--t-fast);
}
.admin-pagination button:hover:not(:disabled) { background: var(--c-bg-secondary); }
.admin-pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.admin-pagination__info { color: var(--c-text-secondary); }

/* User detail panel (slide from right) */
.admin-detail-panel {
  position: fixed;
  top: var(--navbar-h);
  right: 0;
  bottom: 0;
  width: 400px;
  background: var(--c-bg);
  color: var(--c-text);
  border-left: 1px solid var(--c-border);
  box-shadow: var(--shadow-lg);
  z-index: calc(var(--z-drawer) + 1);
  transform: translateX(100%);
  transition: transform var(--t-slow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.admin-detail-panel.open { transform: translateX(0); }

.admin-detail-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}
.admin-detail-panel__title {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
}
.admin-detail-panel__close {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--r-sm);
  cursor: pointer; color: var(--c-text);
  transition: background var(--t-fast);
}
.admin-detail-panel__close:hover { background: var(--c-bg-secondary); }

.admin-detail-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}
.admin-detail-panel__footer {
  padding: var(--sp-md) var(--sp-lg);
  border-top: 1px solid var(--c-border);
  display: flex;
  gap: var(--sp-md);
  flex-shrink: 0;
}

.admin-info-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-info-row__label {
  font-size: var(--text-xs);
  color: var(--c-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: var(--fw-medium);
}
.admin-info-row__value {
  font-size: var(--text-sm);
  color: var(--c-text);
}

/* Stub sections */
.admin-stub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  gap: var(--sp-md);
  color: var(--c-text-secondary);
  text-align: center;
}
.admin-stub__icon svg { opacity: 0.3; }
.admin-stub__title { font-size: var(--text-lg); font-weight: var(--fw-semibold); color: var(--c-text); }
.admin-stub__desc  { font-size: var(--text-sm); max-width: 300px; }

/* =============================================
   CONFIGURA PAGE — Split Layout Figma-spec
   ============================================= */

/* ── Wrapper principale (occupa tutto l'spazio sotto navbar) ── */
#page-configura.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--navbar-h));
  overflow: hidden;
}

.configura-shell {
  display: grid;
  grid-template-columns: 1fr var(--panel-w);
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* ── Preview area (sinistra, fluid) ── */
.configura-preview {
  position: relative;
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.configura-preview__empty {
  text-align: center;
  color: var(--c-text-secondary);
  pointer-events: none;
  user-select: none;
}
.configura-preview__empty-icon {
  font-size: 64px;
  margin-bottom: var(--sp-md);
  opacity: 0.3;
}
.configura-preview__empty-text {
  font-size: var(--text-sm);
  opacity: 0.5;
}

.configura-preview__image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Toolbar preview (in basso al centro) */
.configura-preview__toolbar {
  position: absolute;
  bottom: var(--sp-lg);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  padding: var(--sp-xs) var(--sp-md);
  box-shadow: var(--shadow-md);
}
.configura-preview__toolbar .toolbar-btn {
  width: 36px; height: 36px;
  border: none; background: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--c-text);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast);
  font-size: 18px;
}
.configura-preview__toolbar .toolbar-btn:hover { background: var(--c-bg-secondary); }
.configura-preview__toolbar .toolbar-divider {
  width: 1px; height: 20px;
  background: var(--c-border);
  margin: 0 var(--sp-xs);
}
.configura-preview__toolbar .toolbar-btn--help {
  margin-left: var(--sp-sm);
  background: var(--c-bg-secondary);
}

/* Selected product chip nella preview */
.configura-preview__chip {
  position: absolute;
  top: var(--sp-lg);
  left: var(--sp-lg);
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-sm) var(--sp-md);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  box-shadow: var(--shadow-sm);
  font-size: var(--text-sm);
  display: none;
}
.configura-preview__chip.visible { display: flex; }
.configura-preview__chip__swatch {
  width: 24px; height: 24px;
  border-radius: 4px;
  border: 1px solid var(--c-border);
  flex-shrink: 0;
}
.configura-preview__chip__name { font-weight: var(--fw-medium); }
.configura-preview__chip__remove {
  background: none; border: none; cursor: pointer;
  color: var(--c-text-secondary); font-size: 16px;
  display: flex; align-items: center; padding: 0;
  margin-left: var(--sp-xs);
}

/* ── Panel destro (340px fisso) ── */
.configura-panel {
  width: var(--panel-w);
  background: var(--c-bg);
  border-left: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: var(--z-panel);
}

.configura-panel__header {
  padding: var(--sp-lg) var(--sp-lg) 0;
  flex-shrink: 0;
}
.configura-panel__title {
  font-size: var(--text-xl);
  font-weight: var(--fw-semibold);
  margin: 0 0 var(--sp-xs) 0;
}
.configura-panel__subtitle {
  font-size: var(--text-sm);
  color: var(--c-text-secondary);
  margin: 0 0 var(--sp-md) 0;
}

/* ── Tab strip ── */
.configura-tabs {
  display: flex;
  gap: 0;
  padding: 0 var(--sp-lg);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.configura-tabs::-webkit-scrollbar { display: none; }

.configura-tab {
  padding: var(--sp-sm) var(--sp-md);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--c-text-secondary);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
  margin-bottom: -1px;
}
.configura-tab:hover { color: var(--c-text); }
.configura-tab.active {
  color: var(--c-text);
  border-bottom-color: var(--c-text);
}

/* ── Panel body (scrollabile) ── */
.configura-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-md) var(--sp-lg);
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
}
.configura-panel__body::-webkit-scrollbar { width: 4px; }
.configura-panel__body::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 4px; }

/* Panel footer sticky */
.configura-panel__footer {
  padding: var(--sp-md) var(--sp-lg);
  border-top: 1px solid var(--c-border);
  background: var(--c-bg);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

/* ── Lista prodotti nel panel ── */
.panel-product-list { list-style: none; margin: 0; padding: 0; }

.panel-product-item {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-sm) 0;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
  transition: background var(--t-fast);
  border-radius: var(--r-sm);
}
.panel-product-item:last-child { border-bottom: none; }
.panel-product-item:hover { background: var(--c-bg-secondary); padding-left: var(--sp-sm); margin-left: calc(-1 * var(--sp-sm)); margin-right: calc(-1 * var(--sp-sm)); }

.panel-product-item__thumb {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--c-bg-secondary);
  border: 1px solid var(--c-border);
  flex-shrink: 0;
}
.panel-product-item__swatch {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border);
  flex-shrink: 0;
}

.panel-product-item__info { flex: 1; min-width: 0; }
.panel-product-item__name {
  font-size: var(--text-base);
  font-weight: var(--fw-normal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.panel-product-item__meta {
  font-size: var(--text-xs);
  color: var(--c-text-secondary);
}

.panel-product-item__chevron {
  color: var(--c-text-secondary);
  flex-shrink: 0;
  font-size: 18px;
}

/* Colori: lista con swatch rettangolare più grande */
.panel-color-item .panel-product-item__swatch {
  width: 48px; height: 48px;
  border-radius: var(--r-md);
}

/* Decori: griglia 2 colonne */
.panel-decori-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}
.panel-decori-item {
  cursor: pointer;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color var(--t-fast);
  background: var(--c-bg-secondary);
}
.panel-decori-item:hover { border-color: var(--c-border); }
.panel-decori-item.selected { border-color: var(--c-text); }
.panel-decori-item__thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--c-bg-secondary);
  display: block;
}
.panel-decori-item__name {
  padding: var(--sp-xs) var(--sp-sm);
  font-size: var(--text-xs);
  text-align: center;
}

/* ── Filtro/ricerca nel panel ── */
.panel-search-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
}
.panel-search-bar .input { flex: 1; height: 40px; font-size: var(--text-sm); }
.panel-filter-btn {
  height: 40px;
  padding: 0 var(--sp-md);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-pill);
  background: none;
  font-size: var(--text-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  white-space: nowrap;
  color: var(--c-text);
  transition: background var(--t-fast);
}
.panel-filter-btn:hover { background: var(--c-bg-secondary); }

/* ── Immagini upload (tab Immagini) ── */
.panel-dropzone {
  border: 2px dashed var(--c-border-input);
  border-radius: var(--r-md);
  padding: var(--sp-xl) var(--sp-lg);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
  background: var(--c-bg-secondary);
  margin-bottom: var(--sp-md);
}
.panel-dropzone:hover, .panel-dropzone.drag-over {
  border-color: var(--c-text);
  background: #f0f0f0;
}
.panel-dropzone__icon { font-size: 36px; margin-bottom: var(--sp-sm); opacity: 0.4; }
.panel-dropzone__label { font-size: var(--text-sm); color: var(--c-text-secondary); }
.panel-dropzone__hint { font-size: var(--text-xs); color: var(--c-text-secondary); margin-top: var(--sp-xs); }

.panel-upload-fields { display: flex; flex-direction: column; gap: var(--sp-md); }
.panel-upload-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-sm); }

/* ── Drawer sovrapposto al panel ── */
.configura-drawer {
  position: absolute;
  top: 0; right: 0;
  width: 100%;
  height: 100%;
  background: var(--c-bg);
  transform: translateX(100%);
  transition: transform var(--t-normal);
  display: flex;
  flex-direction: column;
  z-index: var(--z-drawer);
  border-left: 1px solid var(--c-border);
}
.configura-drawer.open { transform: translateX(0); }

.configura-drawer__header {
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  flex-shrink: 0;
}
.configura-drawer__back {
  background: none; border: none; cursor: pointer;
  color: var(--c-text-secondary);
  display: flex; align-items: center; gap: var(--sp-xs);
  font-size: var(--text-sm);
  padding: 0;
  transition: color var(--t-fast);
}
.configura-drawer__back:hover { color: var(--c-text); }
.configura-drawer__title {
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  flex: 1;
}
.configura-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-lg);
}
.configura-drawer__footer {
  padding: var(--sp-md) var(--sp-lg);
  border-top: 1px solid var(--c-border);
  background: var(--c-bg);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

/* Drawer dettaglio colore */
.drawer-color-swatch-large {
  width: 100%;
  aspect-ratio: 3/2;
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  margin-bottom: var(--sp-lg);
}
.drawer-product-name {
  font-size: var(--text-xl);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--sp-xs);
}
.drawer-product-code {
  font-size: var(--text-sm);
  color: var(--c-text-secondary);
  margin-bottom: var(--sp-lg);
}
.drawer-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-sm) 0;
  border-bottom: 1px solid var(--c-border);
  font-size: var(--text-sm);
}
.drawer-detail-row:last-child { border-bottom: none; }
.drawer-detail-label { color: var(--c-text-secondary); }
.drawer-detail-value { font-weight: var(--fw-medium); }

/* Drawer dettaglio sfumatura */
.drawer-sfumatura-preview {
  width: 100%;
  aspect-ratio: 2/1;
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  margin-bottom: var(--sp-lg);
  background: linear-gradient(135deg, #e8d5c4, #2c5282);
  overflow: hidden;
}
.drawer-sfumatura-preview img {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Empty state panel */
.panel-empty {
  text-align: center;
  padding: var(--sp-2xl) var(--sp-md);
  color: var(--c-text-secondary);
}
.panel-empty__icon { font-size: 40px; opacity: 0.3; margin-bottom: var(--sp-sm); }
.panel-empty__text { font-size: var(--text-sm); }

/* Loader nel panel */
.panel-loader {
  display: flex;
  justify-content: center;
  padding: var(--sp-2xl);
}

/* ── Breadcrumb ── */
.panel-breadcrumb {
  font-size: var(--text-xs);
  color: var(--c-text-secondary);
  margin-bottom: var(--sp-md);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}


/*
 * =============================================
 * LAYOUT SPLIT FIGMA-COMPLIANT
 * =============================================
 * Preview (66%) | Panel (340px)
 */

/* === LAYOUT PRINCIPALE === */
.configura-split-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  height: calc(100vh - 60px);
  gap: 0;
  overflow: hidden;
  background: var(--c-bg);
}

/* === AREA PREVIEW (66%) === */
.preview-area {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--c-bg-secondary);
  border-right: 1px solid var(--c-border);
  min-width: 0;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: var(--c-bg);
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s ease;
  color: var(--c-text);
}

.toolbar-btn:hover {
  background: #f0f0f0;
  border-color: #bbb;
}

.toolbar-btn.active {
  background: var(--c-bg-highlight);
  color: var(--c-text);
  border-color: #000;
}

.toolbar-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--c-border);
  margin: 0 8px;
}

.toolbar-label {
  font-size: 13px;
  color: var(--c-text-secondary);
  margin-left: 12px;
  user-select: none;
}

/* === BABYLONJS CANVAS === */
.babylonjs-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #e8e8e8;
  min-height: 0;
}

.babylon-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.preview-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--c-text-secondary);
  font-size: 14px;
  padding: 24px;
}

.preview-placeholder .placeholder-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.preview-placeholder .placeholder-text {
  font-size: 13px;
}

/* === CONFIGURATOR PANEL (340px) === */
.configurator-panel {
  width: 340px;
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--c-border);
  flex-shrink: 0;
  min-width: 340px;
}

.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
  background: #fafafa;
}

.panel-tab {
  flex: 1;
  padding: 14px 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--c-text-secondary);
  text-align: center;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}

.panel-tab:hover {
  background: #f0f0f0;
}

.panel-tab.active {
  color: var(--c-text);
  border-bottom-color: var(--c-text);
  background: var(--c-bg);
}

.panel-tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: block;
}

.panel-tab-content.hidden {
  display: none;
}

/* === COLOR SWATCHES === */
.color-swatches {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.color-swatch {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid #eee;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.color-swatch:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.color-swatch.active {
  border-color: var(--c-text);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

.color-swatch.selected {
  border-color: var(--c-text);
}

/* === GRADIENT CARDS === */
.gradient-card {
  padding: 12px;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 8px;
  border: 1px solid var(--c-border);
  transition: all 0.2s ease;
}

.gradient-card:hover {
  border-color: var(--c-text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* === MIXTURE CARDS === */
.mixture-card {
  padding: 12px;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.mixture-card:hover {
  border-color: var(--c-text);
  background: #f9f9f9;
}

/* === DECORATION CARDS === */
.decoration-card {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--c-border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.decoration-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* === UPLOAD DROPZONE === */
.upload-dropzone {
  border: 2px dashed var(--c-border);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-dropzone:hover {
  border-color: var(--c-text);
  background: #f9f9f9;
}

.upload-dropzone.dragover {
  border-color: var(--c-text);
  background: #e8f4ff;
}

/* === PRODUCT PREVIEW CARD === */
.product-preview-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #fafafa;
  border-radius: 8px;
  margin: 16px;
  border-top: 1px solid var(--c-border);
  flex-shrink: 0;
}

.preview-thumb {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--c-border);
  flex-shrink: 0;
}

.preview-thumb.hidden {
  display: none;
}

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

.product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.product-name {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.product-sku {
  font-size: 12px;
  color: var(--c-text-secondary);
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  height: 48px;
  border-radius: 40px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn--outline {
  background: var(--c-bg);
  color: var(--c-text);
  border-color: var(--c-text);
}

.btn--outline:hover {
  background: #f0f0f0;
}

.btn--ghost {
  background: transparent;
  color: var(--c-text-secondary);
}

.btn--ghost:hover {
  background: #f0f0f0;
  color: var(--c-text);
}

.btn--sm {
  height: 36px;
  font-size: 13px;
  padding: 0 12px;
}

.add-to-config {
  margin-top: auto;
  width: 100%;
}

/* === LOADING STATES === */
.loader-sm {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #ddd;
  border-top-color: var(--c-bg-highlight);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner--sm {
  width: 16px;
  height: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* === UTILITIES === */
.hidden {
  display: none !important;
}

.text-secondary {
  color: var(--c-text-secondary);
  font-size: 14px;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .configura-split-layout {
    grid-template-columns: 1fr;
  }
  
  .configurator-panel {
    display: none;
  }
}

@media (max-width: 768px) {
  .configura-sidebar {
    transform: translateX(-100%);
    z-index: 200;
  }
  
  .configura-sidebar.mobile-open {
    transform: translateX(0);
  }
  
  .sidebar-overlay {
    display: block;
  }
}

.sidebar-overlay {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 150;
}

.sidebar-overlay.hidden {
  display: none;
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 24px;
  color: var(--c-text-secondary);
}

.empty-state p {
  margin: 0;
  font-size: 14px;
}

/* === REALIZATION FORM === */
.realization-upload {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--c-text-secondary);
  margin-bottom: 4px;
}

