/* frontend/styles.css */
/* Stile pulito ispirato ad Apple, con accento rosso LineaOro */

:root {
  --bg-main: #f5f5f7;
  --card-bg: #ffffff;
  --text-main: #1d1d1f;
  --text-muted: #6e6e73;
  --accent: #ff0033;
  --accent-soft: rgba(255, 0, 51, 0.06);
  --border-soft: #e5e5ea;
  --radius-xl: 18px;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    system-ui, sans-serif;
  background: radial-gradient(circle at top, #ffffff 0, var(--bg-main) 55%);
  color: var(--text-main);
}

/* Layout a due colonne (sidebar + contenuto) */
.layout {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

/* contenuto: prende tutto lo spazio che resta dopo la sidebar */
.dashboard-main {
  flex: 1;
  padding: 32px;
}

/* su mobile: sidebar sopra, contenuto sotto */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .dashboard-main {
    padding: 20px 16px 24px;
  }
}

/* Shell e card “generiche” (es. pagina login) */

.app-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #111, #ff0040);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.2);
}

.logo-text {
  font-weight: 600;
  letter-spacing: 0.03em;
  font-size: 18px;
}

.status-pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid var(--border-soft);
  background: #fff;
  color: var(--text-muted);
}

.status-pill.ok {
  border-color: rgba(52, 199, 89, 0.3);
  background: rgba(52, 199, 89, 0.06);
  color: #1a7f3b;
}

.status-pill.error {
  border-color: rgba(255, 59, 48, 0.3);
  background: rgba(255, 59, 48, 0.06);
  color: #b3261e;
}

.app-main {
  display: flex;
  justify-content: center;
}

/* CARD BASE */

.card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: 24px 24px 22px;
  max-width: 720px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
}

.dashboard-main .card {
  max-width: none; /* nelle pagine interne le card si allargano */
}

.card h1 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 26px;
}

.card p {
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.card ul {
  margin-top: 0;
  margin-bottom: 20px;
  padding-left: 20px;
  color: var(--text-muted);
}

/* BUTTONS – identità coerente in tutto il software */

.primary-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(255, 0, 51, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    background 0.12s ease;
}

.primary-btn-small {
  padding: 7px 16px;
  font-size: 13px;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(255, 0, 51, 0.4);
  background: #ff1947;
}

.primary-btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 16px rgba(255, 0, 51, 0.3);
}

/* bottone “secondario” (es. Salva / Duplica in bianco) */

.secondary-btn {
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 500;
  background: #ffffff;
  color: var(--accent);
  border: 1px solid #ffd5df;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.04);
  transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.secondary-btn:hover {
  background: #fff7f9;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.secondary-btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.04);
}

/* Per le azioni dentro le tabelle (Modifica / Duplica) */

.data-table .primary-btn-small {
  box-shadow: 0 8px 16px rgba(255, 0, 51, 0.35);
}

.data-table .secondary-btn {
  padding: 6px 14px;
  font-size: 12px;
}

/* OUTPUT BOX (se usato) */

.output-box {
  margin-top: 18px;
  padding: 12px 12px 14px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px dashed var(--border-soft);
  font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 12px;
  color: #111827;
  white-space: pre-wrap;
  max-height: 220px;
  overflow: auto;
}

/* TABELLE GENERICHE (catalogo, archivio, utenti, ecc.) */

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  font-size: 14px;
}

.data-table th {
  background: #f2f2f7;
  padding: 9px 10px;
  text-align: left;
  font-weight: 600;
}

.data-table td {
  padding: 8px 10px;
  border-top: 1px solid #e5e5ea;
}

/* leggero compattamento verticale per l’archivio */

.archivio-page .data-table th {
  padding-block: 8px;
}

.archivio-page .data-table td {
  padding-block: 7px;
}

/* SEARCH BOX */

.search-box {
  padding: 9px 13px;
  border-radius: 12px;
  border: 1px solid #d2d2d7;
  font-size: 15px;
  width: 260px;
}

@media (max-width: 600px) {
  .search-box {
    width: 100%;
  }
}

/* Miniatura immagine nella tabella prodotti */

.img-thumb-box {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid #e5e5ea;
  background: #f5f5f7;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-thumb-box img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

/* FORM ELEMENTS */

.form-group {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 13px;
  color: var(--text-muted);
}

.form-group input,
.form-group select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #d2d2d7;
  font-size: 14px;
}

.role-options {
  display: flex;
  gap: 16px;
  font-size: 14px;
}

.role-options label {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* =========
   LAYOUT SPECIFICI PAGINA
   ========= */

/* Catalogo prodotti – due card affiancate (CSV + immagini) se il markup usa questo wrapper */

.catalogo-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
}

/* Archivio configurazioni */

.archivio-page h1 {
  margin-bottom: 6px;
}

/* Utenti – card “nuovo utente” + tabella affiancate se avvolte in .users-layout */

.users-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.4fr);
  gap: 22px;
  align-items: flex-start;
}

@media (max-width: 960px) {
  .users-layout {
    grid-template-columns: 1fr;
  }
}

/* Configuratore – la card dati generali e la slide usano già configuratore.css,
   qui ci limitiamo a mantenere coerenza dei padding */

.slide-config-page .card {
  width: 100%;
  max-width: none;
}

/* ============================
   LOGIN v3 — ultra clean (Apple-like)
   ============================ */

.login-body.v3 {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 520px at 30% 10%, rgba(255, 0, 51, 0.06), transparent 60%),
    radial-gradient(800px 500px at 80% 20%, rgba(0, 0, 0, 0.04), transparent 62%),
    #f5f5f7;
  color: var(--text-main);
}

.login-shell.v3 {
  width: 100%;
  padding: 40px 16px;
  display: grid;
  place-items: center;
}

.login-card.v3 {
  width: 100%;
  max-width: 460px;
  background: #ffffff;
  border-radius: 22px;
  border: 1px solid rgba(0,0,0,0.06);          /* hairline */
  box-shadow: 0 18px 50px rgba(0,0,0,0.08);    /* molto soft */
  padding: 28px 28px 16px;
}

/* logo: piccolo, centrato, “quiet luxury” */
.login-logo.v3 {
  display: flex;
  justify-content: center;
  margin-top: 2px;
  margin-bottom: 10px;
}

.login-logo.v3 img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
}

.login-header.v3 {
  text-align: center;
  margin-bottom: 18px;
}

.login-title.v3 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-subtitle.v3 {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* input: più Apple (pulito, focus ring soft rosso) */
.login-form.v3 .form-group {
  margin-bottom: 14px;
}

.login-form.v3 .form-group label {
  font-size: 12px;
  color: var(--text-muted);
}

.login-form.v3 .form-group input {
  height: 44px;
  border-radius: 14px;
  padding: 0 12px;
  border: 1px solid rgba(0,0,0,0.14);
  background: #fff;
  font-size: 14px;
  transition: border-color .14s ease, box-shadow .14s ease;
}

.login-form.v3 .form-group input:focus {
  outline: none;
  border-color: rgba(255, 0, 51, 0.38);
  box-shadow: 0 0 0 4px rgba(255, 0, 51, 0.10);
}

/* bottone: non enorme, non full width, Apple-like */
.login-actions.v3 {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.login-btn.v3 {
  height: 44px;
  width: min(130px, 100%);
  border-radius: 30px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(255, 0, 51, 0.22);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.login-btn.v3:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(255, 0, 51, 0.26);
  background: #ff1947;
}

.login-btn.v3:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(255, 0, 51, 0.20);
}

.login-btn.v3:disabled {
  opacity: .75;
  cursor: not-allowed;
  transform: none;
}

/* errore minimal (niente “boxone”) */
.login-error.v3 {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 12px;
  color: #b3261e;
  background: rgba(255, 59, 48, 0.08);
  border: 1px solid rgba(255, 59, 48, 0.18);
}

.login-footer.v3 {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(0,0,0,0.06);
  font-size: 12px;
  color: var(--text-muted);
}

.login-footer.v3 .dot {
  opacity: .55;
}

.login-footer.v3 .muted {
  color: var(--text-muted);
}

/* quando la sidebar cambia width, il main non deve “scattare” */
.layout > main {
  transition: padding 220ms cubic-bezier(.2,.8,.2,1), margin 220ms cubic-bezier(.2,.8,.2,1);
}

/* ==========================================
   SIDEBAR PRO — anti-flash + transizioni fluide
   Incolla in fondo a styles.css
   ========================================== */

/* Riserva SEMPRE lo spazio sidebar (evita collasso/flash) */
#sidebarContainer{
  flex: 0 0 auto;
  width: 280px;
  min-width: 280px;
  transition: width 220ms ease, min-width 220ms ease;
  will-change: width;
}

/* Se la sidebar è "collapsed" (impostato prima del render via dataset html) */
html[data-sidebar-state="collapsed"] #sidebarContainer{
  width: 92px;
  min-width: 92px;
}

/* Mobile: sidebar full-width sopra */
@media (max-width: 768px){
  #sidebarContainer{
    width: 100%;
    min-width: 100%;
    transition: none;
  }
}

/* Micro-miglioria: evita “blink” su icone/testi durante repaint */
.sidebar, .sidebar *{
  -webkit-font-smoothing: antialiased;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* ==========================================
   DASHBOARD HEADER (logo + benvenuto centrato)
   ========================================== */

.dashboard-header{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;

  margin: 8px 0 24px;
}

.dashboard-logo{
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 44px; /* tieni il tuo spacing */
}

/* ✅ Logo: mai deformato, scala bene su desktop e mobile */
.dashboard-logo img{
  width: min(420px, 80vw); /* più “importante” ma responsive */
  height: auto;            /* ✅ mantiene proporzioni */
  max-height: 110px;       /* limite per non diventare enorme */
  object-fit: contain;
  display: block;
}

.dashboard-welcome{
  margin: 0;
  font-size: 42px;
  letter-spacing: -0.02em;
}

.dashboard-subtitle{
  margin: 10px 0 0;
  color: var(--text-muted);
  max-width: 780px;
  line-height: 1.45;
}

/* ==========================================
   DASHBOARD SHORTCUTS (CARDS PRO, icon TOP)
   ========================================== */

.dashboard-shortcuts{
  margin-top: 22px;
  margin-bottom: 28px;
}

/* 3 card in riga su desktop */
.shortcut-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 1100px){
  .shortcut-grid{ grid-template-columns: 1fr; }
}

/* CARD più grande e “piena” */
.shortcut-card{
  display: flex;
  flex-direction: column;      /* ✅ icon sopra */
  align-items: center;
  text-align: center;
  gap: 12px;

  padding: 26px 24px 22px;
  min-height: 210px;

  background: rgba(255, 255, 255, 0.88);
  border-radius: 22px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.75);

  text-decoration: none;
  color: var(--text-main);

  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.shortcut-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.10);
  background: #ffffff;
}

.shortcut-icon{
  width: 132px;                 /* ✅ molto più grande */
  height: 88px;
  border-radius: 24px;
  background: rgba(255, 0, 51, 0.08);

  display: flex;
  align-items: center;
  justify-content: center;
}

.shortcut-icon img{
  width: 132px;
  height: 132px;
  object-fit: contain;
  display: block;
}

.shortcut-title{
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.shortcut-desc{
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  max-width: 520px;
}

/* elenco puntato dentro card (più leggibile) */
.shortcut-bullets{
  margin: 8px 0 0;
  padding-left: 18px;
  text-align: left;            /* ✅ i bullet meglio left */
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
}

.shortcut-bullets li{
  margin: 4px 0;
}

/* micro-cta */
.shortcut-cta{
  margin-top: auto;            /* ✅ spinge “Apri” in basso */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #ff0033;
}

.shortcut-cta::after{
  content: "→";
  font-weight: 800;
}

/* Dashboard logo: elimina qualsiasi box di sfondo */
.dashboard-logo {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

/* sicurezza extra: anche l'immagine */
.dashboard-logo img {
  background: transparent;
  display: block;
}

/* =========================
   LO CONFIRM MODAL (stile LineaOro / Apple-ish)
   ========================= */

#loConfirmRoot .lo-confirm-overlay{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0,0,0,.22);
  backdrop-filter: blur(10px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}

#loConfirmRoot .lo-confirm-overlay[data-open="1"]{
  opacity: 1;
  pointer-events: auto;
}

#loConfirmRoot .lo-confirm-card{
  width: min(520px, 100%);
  background: rgba(255,255,255,.96);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: 20px 20px 16px;
}

#loConfirmRoot .lo-confirm-head{
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

#loConfirmRoot .lo-confirm-icon{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(255,0,51,.15);
}

#loConfirmRoot .lo-confirm-title{
  font-weight: 650;
  font-size: 16px;
  line-height: 1.2;
  margin-top: 1px;
}

#loConfirmRoot .lo-confirm-msg{
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
}

#loConfirmRoot .lo-confirm-actions{
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

/* usa i tuoi bottoni già esistenti: primary-btn / secondary-btn */
#loConfirmRoot .primary-btn,
#loConfirmRoot .secondary-btn{
  box-shadow: none;
}

#loConfirmRoot .primary-btn:hover{
  transform: translateY(-1px);
}

@media (max-width: 520px){
  #loConfirmRoot .lo-confirm-card{
    padding: 18px 16px 14px;
  }
}

/* Archivio: filtri ruolo (solo admin) */
.archivio-role-filters{
  display:flex;
  gap:10px;
  margin-bottom: 12px;
}

.archivio-filter-btn{
  appearance:none;
  border: 1px solid #d2d2d7;
  background: #ffffff;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.archivio-filter-btn:hover{
  transform: translateY(-1px);
}

.archivio-filter-btn.is-active{
  border-color: #0071e3;
  background: rgba(0,113,227,0.10);
  color: #0071e3;
}

/* Archivio: filtri ruolo sotto la ricerca (solo admin) */
.archivio-role-filters{
  display:flex;
  gap:8px;
  margin-top: 10px; /* sotto l’input */
}

/* Usa lo stile esistente secondary-btn, qui gestiamo solo lo stato attivo */
.archivio-filter-btn.is-active{
  background: var(--accent-soft);
  border-color: rgba(255, 0, 51, 0.35);
  color: var(--accent);
}

/* =========================
   SELECT (Apple-like) — usato in "Confluisci in"
   ========================= */

.lo-select{
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-color: #fff;
  border: 1px solid #d2d2d7;
  border-radius: 999px;

  font-size: 13px;
  color: var(--text-main);
  line-height: 1;

  padding: 9px 10px 9px 14px; /* spazio a dx per freccia */
  min-height: 34px;

  box-shadow: 0 6px 14px rgba(0,0,0,0.04);
  transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;

  /* freccia custom (2 linee) */
  background-image:
    linear-gradient(45deg, transparent 50%, #8e8e93 50%),
    linear-gradient(135deg, #8e8e93 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%,
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
}

.lo-select:hover{
  transform: translateY(-1px);
}

.lo-select:focus{
  outline: none;
  border-color: rgba(255, 0, 51, 0.38);
  box-shadow: 0 0 0 4px rgba(255, 0, 51, 0.10);
}

/* variante più compatta per tabelle */
.lo-select--compact{
  padding-top: 8px;
  padding-bottom: 8px;
  min-width: 100px;
}

/* fix per iOS/Safari: evita zoom e resa incoerente */
@supports (-webkit-touch-callout: none){
  .lo-select{ font-size: 14px; }
}

/* Icon buttons (es. cestino in Archivio) */
.icon-btn{
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #e5e5ea;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.icon-btn svg{
  width: 18px;
  height: 18px;
  display: block;
}

.icon-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
  background: #fafafa;
}

.icon-btn:active{
  transform: translateY(0);
  box-shadow: 0 6px 12px rgba(0,0,0,.05);
}

/* Variante danger (cestino) */
.icon-btn-danger{
  color: #ff3b30;
  border-color: #ffd0cd;
}

.icon-btn-danger:hover{
  background: #fff5f4;
  border-color: #ffb3ad;
}

/* allineamento azioni archivio */
td .primary-btn,
td .icon-btn{
  vertical-align: middle;
}

/* =====================================================
   IMAGE EDITOR MODAL — allineato allo stile LineaOro
   Incolla in fondo a styles.css
   ===================================================== */

#imgEditorOverlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.22);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}

/* Card principale modal */
#imgEditorModal{
  width: min(1180px, 96vw);
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.18);
  overflow: hidden;
}

/* Header */
.img-editor-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,.90);
}

.img-editor-title{
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

#imgEditorSub{
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Azioni header */
.img-editor-actions{
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Bottone chiudi “X” */
.img-editor-close-x{
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid #e5e5ea;
  background: #fff;
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  font-size: 18px;
  line-height: 1;
}

.img-editor-close-x:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
  background: #fafafa;
}

/* Corpo */
.img-editor-body{
  display: grid;
  grid-template-columns: 1fr 360px;
  min-height: 560px;
}

/* Colonna previews */
.img-editor-previews{
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.img-editor-panel{
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

.img-editor-panel-title{
  padding: 12px 14px 0;
  font-weight: 800;
  font-size: 12px;
  color: #2c2c2e;
  letter-spacing: .02em;
}

.img-editor-stage{
  padding: 12px 14px 14px;
  height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fbfbfc;
  border-top: 1px dashed rgba(0,0,0,0.08);
}

#imgEditorOrig{
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

#imgEditorCanvas{
  max-width: 100%;
  max-height: 100%;
  display: block;
  border-radius: 14px;
  background: #fff;
}

/* Colonna controls */
.img-editor-controls{
  border-left: 1px solid rgba(0,0,0,0.06);
  padding: 18px 16px;
}

.img-editor-controls h3{
  margin: 0 0 8px;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.img-editor-hint{
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 14px;
}

.img-editor-grid{
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

/* Slider: look Apple-ish */
.img-editor-grid input[type="range"]{
  width: 100%;
  accent-color: var(--accent);
}

/* Box meta */
#imgEditorMeta{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f2f2f7;
  border: 1px solid #e5e5ea;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  color: #111827;
}

.img-editor-tip{
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Responsive */
@media (max-width: 980px){
  .img-editor-body{
    grid-template-columns: 1fr;
  }
  .img-editor-controls{
    border-left: none;
    border-top: 1px solid rgba(0,0,0,0.06);
  }
  .img-editor-previews{
    grid-template-columns: 1fr;
  }
  .img-editor-stage{
    height: 360px;
  }
}
