/* ============================================================
   CAMICERIA GEST – STYLESHEET
   Tema Elegante: Nero · Argento · Bronzo
   ============================================================ */

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Bronzo / Oro ── */
  --bronze:        #a07840;
  --bronze-light:  #c9a05a;
  --bronze-lighter:#dfc080;
  --bronze-dark:   #7a5a28;
  --bronze-bg:     #fdf6ec;
  --bronze-subtle: #f5ead8;

  /* ── Argento ── */
  --silver:        #9ca3af;
  --silver-light:  #e5e7eb;
  --silver-mid:    #d1d5db;
  --silver-dark:   #6b7280;

  /* ── Noir ── */
  --noir:          #0d0d0d;
  --noir-2:        #1a1a1a;
  --noir-3:        #242424;
  --noir-4:        #2e2e2e;

  /* ── Alias semantici ── */
  --primary:       var(--bronze);
  --primary-dark:  var(--bronze-dark);
  --primary-light: var(--bronze-subtle);
  --accent:        #8b7355;
  --success:       #2e7d52;
  --warning:       #b45309;
  --danger:        #c0392b;
  --dark:          var(--noir);

  /* ── Grigi ── */
  --gray-900: #111;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;
  --white:    #ffffff;

  /* ── Layout ── */
  --sidebar-w:  270px;
  --topbar-h:   64px;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 2px 16px rgba(0,0,0,.08);
  --shadow-md:  0 4px 24px rgba(0,0,0,.1);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.15);
  --transition: .2s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: #f2f0ed;
  color: var(--noir-2);
  min-height: 100vh;
  line-height: 1.5;
}
.hidden { display: none !important; }

/* ============================================================
   LOGIN PAGE — Sfondo con onde animate
   ============================================================ */
.login-page {
  background: var(--noir);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Canvas onde (posizionato absolute via JS) */
#waveCanvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  display: block;
  z-index: 0;
}

.login-container {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 100vh;
  padding: 24px;
  position: relative; z-index: 1;
}

.login-card {
  background: #fff;
  border-radius: 24px;
  padding: 48px 44px;
  width: 100%; max-width: 440px;
  box-shadow:
    0 40px 100px rgba(0,0,0,.5),
    0 0 0 1px rgba(160,120,64,.25),
    0 0 60px rgba(160,120,64,.08);
  position: relative;
  overflow: hidden;
}
/* Bordo bronzo superiore */
.login-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--bronze-dark), var(--bronze-light), var(--bronze-dark));
}

/* Logo nella login card */
.login-logo {
  text-align: center;
  margin-bottom: 38px;
  padding-top: 6px;
}
.logo-img-login {
  width: 160px;
  height: auto;
  margin: 0 auto 16px;
  display: block;
  filter: none;
  object-fit: contain;
}
.login-logo h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--noir-2);
  letter-spacing: -.3px;
  margin-bottom: 4px;
}
.login-logo p {
  color: var(--bronze);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

/* Input login */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: .8rem; font-weight: 700;
  color: var(--gray-600);
  margin-bottom: 7px;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.form-group label i { margin-right: 6px; color: var(--bronze); font-size: .85em; }

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: .95rem;
  color: var(--noir-2);
  background: var(--gray-50);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--bronze);
  box-shadow: 0 0 0 3px rgba(160,120,64,.15);
  background: #fff;
}
.form-group textarea { min-height: 90px; resize: vertical; }
.form-group select { cursor: pointer; }

.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 48px; }
.toggle-pwd {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--gray-400); font-size: 15px;
  transition: color var(--transition);
  padding: 4px;
}
.toggle-pwd:hover { color: var(--bronze); }

.login-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px; padding: 11px 14px;
  color: var(--danger); font-size: .875rem;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

.btn-login {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--bronze-dark), var(--bronze), var(--bronze-light));
  color: white; border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 1rem; font-weight: 700;
  cursor: pointer; letter-spacing: .5px;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 18px rgba(122,90,40,.35);
}
.btn-login:hover {
  background: linear-gradient(135deg, #6a4c20, var(--bronze-dark), var(--bronze));
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(122,90,40,.45);
}
.btn-login:active { transform: translateY(0); }

.login-footer {
  text-align: center; margin-top: 28px;
  color: var(--gray-400); font-size: .75rem;
}

/* ============================================================
   LAYOUT APP
   ============================================================ */
#appWrapper { display: flex; min-height: 100vh; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--noir);
  color: white;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh;
  z-index: 200;
  transition: transform var(--transition);
  overflow-y: auto;
  border-right: 1px solid rgba(160,120,64,.2);
}

/* Striscia bronzo decorativa lato destro */
.sidebar::after {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, rgba(160,120,64,.5), transparent);
  pointer-events: none;
}

.sidebar-header {
  padding: 20px 20px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
/* Logo immagine nella sidebar */
.sidebar-logo-img {
  height: 34px; width: auto;
  filter: invert(1) brightness(1.5) saturate(0.3);
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar-logo span {
  font-size: .68rem; font-weight: 800;
  color: var(--bronze-light);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  line-height: 1.2;
}
.sidebar-close {
  display: none; background: none; border: none;
  color: rgba(255,255,255,.3); font-size: 17px; cursor: pointer;
  padding: 6px; border-radius: 6px;
  transition: color var(--transition);
}
.sidebar-close:hover { color: rgba(255,255,255,.8); }

.sidebar-user {
  padding: 16px 20px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
}
.user-avatar {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--bronze-dark), var(--bronze-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem; color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(122,90,40,.4);
}
.user-name { font-weight: 700; font-size: .875rem; color: white; }
.user-role {
  font-size: .7rem; color: var(--bronze-light);
  text-transform: capitalize; margin-top: 2px;
  letter-spacing: .5px; opacity: .85;
}

.sidebar-nav { flex: 1; padding: 14px 10px; }
.nav-section-title {
  font-size: .6rem; font-weight: 800;
  letter-spacing: 1.8px;
  color: rgba(255,255,255,.2);
  text-transform: uppercase;
  padding: 12px 14px 5px;
  margin-top: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px;
  color: rgba(255,255,255,.55); font-size: .875rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
  text-decoration: none; margin-bottom: 2px;
  border: 1px solid transparent;
}
.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.9);
  border-color: rgba(160,120,64,.15);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(122,90,40,.55), rgba(160,120,64,.35));
  color: var(--bronze-light);
  font-weight: 700;
  border-color: rgba(160,120,64,.3);
  border-left: 3px solid var(--bronze-light);
  padding-left: 11px;
}
.nav-item i {
  width: 22px; text-align: center;
  font-size: .95rem; color: var(--bronze); flex-shrink: 0;
}
.nav-item.active i { color: var(--bronze-light); }

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.btn-logout {
  width: 100%; padding: 11px;
  background: rgba(192,57,43,.1);
  border: 1px solid rgba(192,57,43,.2);
  color: #f87171; border-radius: 10px;
  font-family: inherit; font-size: .875rem; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all var(--transition);
}
.btn-logout:hover { background: rgba(192,57,43,.25); color: #fca5a5; }

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.65); z-index: 190;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column;
  min-height: 100vh;
  background: #f2f0ed;
}

.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 12px rgba(0,0,0,.06);
  position: relative;
}
.topbar::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--bronze-dark), var(--bronze-light), transparent);
  opacity: .6;
}
.hamburger {
  display: none; background: none; border: none;
  font-size: 1.25rem; cursor: pointer;
  color: var(--gray-600); padding: 6px; border-radius: 6px;
  transition: color var(--transition);
}
.hamburger:hover { color: var(--bronze); }
.topbar h2 { font-size: 1rem; font-weight: 700; color: var(--noir-2); }
.topbar-right { margin-left: auto; }
.topbar-user {
  font-size: .8rem; font-weight: 700;
  padding: 6px 14px;
  background: var(--bronze-subtle);
  border: 1px solid var(--bronze-light);
  border-radius: 20px; color: var(--bronze-dark);
  letter-spacing: .3px;
}

.page-content {
  flex: 1; padding: 28px;
  max-width: 1240px; width: 100%;
}

/* ============================================================
   CARDS & STAT BOXES
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 18px;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid var(--gray-100);
  border-top: 3px solid transparent;
  cursor: default;
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--bronze-light), transparent);
  opacity: 0; transition: opacity var(--transition);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.stat-card:hover::after { opacity: 1; }
.stat-card.border-bronze { border-top-color: var(--bronze); }
.stat-card.border-silver { border-top-color: var(--silver); }

.stat-icon {
  width: 52px; height: 52px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.stat-icon.blue   { background: var(--bronze-subtle); color: var(--bronze-dark); }
.stat-icon.purple { background: #f0ebe0; color: #7a5a28; }
.stat-icon.green  { background: #ecf7f0; color: var(--success); }
.stat-icon.orange { background: #fdf0e0; color: var(--warning); }
.stat-label {
  font-size: .72rem; color: var(--silver-dark); font-weight: 700;
  margin-bottom: 4px; text-transform: uppercase; letter-spacing: .8px;
}
.stat-value { font-size: 1.9rem; font-weight: 900; color: var(--noir-2); line-height: 1; }

/* ============================================================
   CARD GENERICA
   ============================================================ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--gray-100);
  margin-bottom: 20px;
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  background: linear-gradient(to right, #fdfcfa, #fff);
  position: relative;
}
.card-header::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--bronze-dark), transparent);
  opacity: .3;
}
.card-header h3 { font-size: .95rem; font-weight: 800; color: var(--noir-2); }
.card-header h3 i { color: var(--bronze); margin-right: 8px; }
.card-body { padding: 24px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .875rem; font-weight: 600;
  cursor: pointer; border: none; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--bronze-dark), var(--bronze));
  color: white;
  box-shadow: 0 3px 12px rgba(122,90,40,.28);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #5a3c18, var(--bronze-dark));
  box-shadow: 0 6px 20px rgba(122,90,40,.4);
  transform: translateY(-1px);
}
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #256645; transform: translateY(-1px); }
.btn-danger  { background: var(--danger); color: white; }
.btn-danger:hover  { background: #a93226; transform: translateY(-1px); }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #9a4a07; transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--gray-600);
  border: 1.5px solid var(--gray-300);
}
.btn-outline:hover { border-color: var(--bronze); color: var(--bronze); background: var(--bronze-subtle); }
.btn-sm { padding: 7px 14px; font-size: .8rem; border-radius: 7px; }
.btn-icon {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
}
.btn-ghost {
  background: transparent; border: none; color: var(--gray-500);
  cursor: pointer; transition: color var(--transition);
}
.btn-ghost:hover { color: var(--bronze); }

/* ============================================================
   TABLE
   ============================================================ */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th {
  background: var(--noir-2); color: rgba(255,255,255,.8);
  padding: 12px 16px;
  text-align: left; font-weight: 700; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .8px;
  border-bottom: 2px solid var(--bronze-dark);
  white-space: nowrap;
}
thead th:first-child { border-left: 3px solid var(--bronze); }
tbody tr { border-bottom: 1px solid var(--gray-100); transition: background var(--transition); }
tbody tr:hover { background: var(--bronze-subtle); }
tbody tr:hover td { color: var(--noir-2); }
tbody td { padding: 12px 16px; color: var(--gray-600); vertical-align: middle; }

/* BADGE */
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 20px;
  font-size: .7rem; font-weight: 700;
  white-space: nowrap; letter-spacing: .3px;
}
.badge-success { background: #d4f0e2; color: #145a30; border: 1px solid #a3d9bb; }
.badge-danger  { background: #fde8e6; color: #8b1a1a; border: 1px solid #f5c2bf; }
.badge-warning { background: #fef0d3; color: #78350f; border: 1px solid #f7c06e; }
.badge-info    { background: var(--bronze-subtle); color: var(--bronze-dark); border: 1px solid var(--bronze-light); }
.badge-purple  { background: #f0ebe0; color: var(--bronze-dark); border: 1px solid #dcc090; }
.badge-gray    { background: var(--gray-100); color: var(--gray-600); }
.badge-silver  { background: #f3f4f6; color: var(--silver-dark); border: 1px solid var(--silver-mid); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--white);
  border-radius: 18px;
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  transform: scale(.96) translateY(10px);
  transition: transform .25s ease;
  border-top: 3px solid var(--bronze);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 980px; }

.modal-header {
  padding: 20px 26px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to right, #fdfcfa, #fff);
  position: sticky; top: 0; z-index: 1; background: white;
}
.modal-header h3 {
  font-size: 1.05rem; font-weight: 800; color: var(--noir-2);
  display: flex; align-items: center; gap: 8px;
}
.modal-header h3 i { color: var(--bronze); }
.modal-close {
  background: var(--gray-100); border: none; border-radius: 8px;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; color: var(--gray-500);
  transition: all var(--transition); flex-shrink: 0;
}
.modal-close:hover { background: var(--gray-200); color: var(--dark); }

.modal-body { padding: 22px 26px; }
.modal-footer {
  padding: 14px 26px 20px;
  display: flex; justify-content: flex-end; gap: 12px;
  border-top: 1px solid var(--gray-100);
}

/* ============================================================
   WIZARD
   ============================================================ */
.wizard-steps {
  display: flex; justify-content: center; align-items: flex-start;
  gap: 0; margin-bottom: 36px;
  position: relative;
}
.wizard-steps::before {
  content: '';
  position: absolute; top: 21px; left: 10%; right: 10%;
  height: 2px;
  background: var(--gray-200); z-index: 0;
}
.wizard-step {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; flex: 1; position: relative; z-index: 1;
}
.wizard-step .step-circle {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--gray-200); color: var(--gray-500);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .95rem;
  border: 3px solid var(--gray-200);
  transition: all .35s ease;
}
.wizard-step.active .step-circle {
  background: linear-gradient(135deg, var(--bronze-dark), var(--bronze));
  border-color: var(--bronze-light);
  color: white;
  box-shadow: 0 0 0 6px rgba(160,120,64,.15);
}
.wizard-step.completed .step-circle {
  background: var(--success); border-color: var(--success); color: white;
}
.wizard-step .step-label {
  font-size: .7rem; font-weight: 600;
  color: var(--gray-500); text-align: center;
}
.wizard-step.active .step-label   { color: var(--bronze); font-weight: 700; }
.wizard-step.completed .step-label { color: var(--success); }

.step-panel { display: none; }
.step-panel.active { display: block; }
.step-panel h4 {
  font-size: 1.05rem; font-weight: 800; color: var(--noir-2); margin-bottom: 6px;
}
.step-panel .step-desc { color: var(--gray-500); font-size: .875rem; margin-bottom: 22px; }

/* TAGLIE */
.taglie-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 12px; margin-bottom: 16px;
}
.taglia-item {
  background: var(--gray-50); border: 1.5px solid var(--gray-200);
  border-radius: 10px; padding: 13px 8px;
  text-align: center; transition: all var(--transition);
}
.taglia-item:focus-within {
  border-color: var(--bronze);
  background: var(--bronze-subtle);
  box-shadow: 0 0 0 3px rgba(160,120,64,.1);
}
.taglia-label {
  font-weight: 800; font-size: 1.05rem; color: var(--noir-2);
  display: block; margin-bottom: 8px;
}
.taglia-item input {
  width: 100%; text-align: center;
  border: 1.5px solid var(--gray-300); border-radius: 7px;
  padding: 8px 4px; font-size: 1rem; font-weight: 700;
  background: white; outline: none;
  transition: border-color var(--transition);
}
.taglia-item input:focus { border-color: var(--bronze); }

.taglie-total {
  background: linear-gradient(135deg, var(--noir-2), var(--noir-3));
  border-radius: 10px; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid rgba(160,120,64,.2);
}
.taglie-total span { font-size: .9rem; font-weight: 600; color: var(--bronze-lighter); }
.taglie-total strong { font-size: 1.5rem; font-weight: 900; color: var(--bronze-light); }

.wizard-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 32px; padding-top: 22px;
  border-top: 1px solid var(--gray-200);
}

/* TOGGLE SWITCH */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0; border-bottom: 1px solid var(--gray-100);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-weight: 600; color: var(--gray-700); font-size: .875rem; }
.toggle-desc  { font-size: .78rem; color: var(--gray-500); margin-top: 2px; }

.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--gray-300); border-radius: 34px; transition: .3s;
}
.slider::before {
  content: ''; position: absolute;
  width: 20px; height: 20px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: .3s;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
input:checked + .slider { background: var(--bronze); }
input:checked + .slider::before { transform: translateX(22px); }

/* FORM GRIDS */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-full { grid-column: 1 / -1; }

/* SECTION DIVIDER */
.section-divider {
  margin: 22px 0; border: none;
  border-top: 1px dashed var(--gray-200);
}

/* RIEPILOGO */
.riepilogo-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 18px;
}
.riepilogo-item {
  background: var(--gray-50); border-radius: 10px; padding: 13px 16px;
  border: 1px solid var(--gray-200);
}
.riepilogo-item label {
  font-size: .68rem; font-weight: 700; letter-spacing: .6px;
  color: var(--gray-500); text-transform: uppercase;
  display: block; margin-bottom: 4px;
}
.riepilogo-item span { font-size: .95rem; font-weight: 600; color: var(--noir-2); }

.taglie-summary { background: var(--gray-50); border-radius: 10px; padding: 14px; margin-bottom: 18px; border: 1px solid var(--gray-200); }
.taglie-summary-title {
  font-size: .72rem; font-weight: 700; color: var(--gray-500);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px;
}
.taglie-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.taglia-chip {
  background: var(--bronze-subtle); color: var(--bronze-dark);
  border: 1px solid var(--bronze-light);
  border-radius: 7px; padding: 5px 12px;
  font-size: .8rem; font-weight: 700;
}

/* ============================================================
   ORDINE CARD
   ============================================================ */
.ordine-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 14px; padding: 0;
  margin-bottom: 14px;
  transition: all var(--transition);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ordine-card:hover {
  border-color: var(--bronze-light);
  box-shadow: 0 6px 24px rgba(160,120,64,.12);
}
.ordine-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px 12px;
  flex-wrap: wrap; gap: 8px; cursor: pointer;
  border-left: 3px solid transparent;
  transition: all var(--transition);
}
.ordine-card:hover .ordine-card-header {
  background: var(--bronze-subtle);
  border-left-color: var(--bronze);
}
.ordine-ref { font-weight: 800; font-size: 1rem; color: var(--noir-2); }
.ordine-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 5px; }
.ordine-meta span { font-size: .78rem; color: var(--gray-500); }
.ordine-meta i { margin-right: 4px; color: var(--bronze); }

/* BARRA AZIONI */
.ordine-actions {
  display: flex; align-items: center;
  padding: 8px 12px;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  gap: 4px; flex-wrap: wrap;
}
.oa-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 7px;
  border: 1.5px solid transparent;
  font-family: inherit; font-size: .77rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
  background: white; white-space: nowrap;
}
.oa-btn span { display: inline; }
.oa-btn:hover { transform: translateY(-1px); }

.oa-detail { color: var(--bronze-dark);  border-color: #dcc090; }
.oa-detail:hover { background: var(--bronze-subtle); border-color: var(--bronze); }
.oa-edit   { color: #0e6b99; border-color: #b3ddf5; }
.oa-edit:hover   { background: #e0f4ff; border-color: #7ec8f0; }
.oa-delete { color: var(--danger); border-color: #fca5a5; }
.oa-delete:hover { background: #fef2f2; border-color: #f87171; }
.oa-email  { color: #1a6b3c; border-color: #a7f3d0; }
.oa-email:hover  { background: #ecfdf5; border-color: #6ee7b7; }
.oa-wa     { color: #15803d; border-color: #86efac; background: white; }
.oa-wa i   { color: #25D366; font-size: 1rem; }
.oa-wa:hover { background: #f0fdf4; border-color: #25D366; }
.oa-print  { color: var(--bronze-dark); border-color: #dcc090; }
.oa-print:hover  { background: var(--bronze-subtle); border-color: var(--bronze); }
.oa-pdf    { color: #8b1a1a; border-color: #fca5a5; }
.oa-pdf:hover    { background: #fff5f5; border-color: #f87171; }
.oa-sep { width: 1px; height: 26px; background: var(--gray-200); margin: 0 3px; flex-shrink: 0; }

/* SEARCH BAR */
.search-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.search-bar input,
.search-bar select {
  padding: 10px 16px;
  border: 1.5px solid var(--gray-200); border-radius: 10px;
  font-family: inherit; font-size: .875rem;
  background: white; outline: none; color: var(--gray-700);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-bar input { flex: 1; min-width: 200px; }
.search-bar input:focus,
.search-bar select:focus {
  border-color: var(--bronze);
  box-shadow: 0 0 0 3px rgba(160,120,64,.1);
}

/* EMPTY STATE */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state i { font-size: 3rem; color: var(--gray-300); margin-bottom: 16px; display: block; }
.empty-state h4 { font-size: 1rem; color: var(--gray-500); font-weight: 600; }
.empty-state p  { font-size: .875rem; color: var(--gray-400); margin-top: 6px; }

/* ALERT */
.alert {
  border-radius: 10px; padding: 13px 16px;
  font-size: .875rem; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid transparent;
}
.alert-success { background: #d4f0e2; color: #145a30; border-color: #a3d9bb; }
.alert-danger  { background: #fde8e6; color: #7b1c1c; border-color: #f5c2bf; }
.alert-info    { background: var(--bronze-subtle); color: var(--bronze-dark); border-color: var(--bronze-light); }
.alert i       { margin-top: 1px; flex-shrink: 0; }

/* ============================================================
   TOAST
   ============================================================ */
#toastContainer {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--noir); color: white;
  padding: 14px 20px; border-radius: 12px;
  font-size: .875rem; font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  display: flex; align-items: center; gap: 10px;
  min-width: 280px; max-width: 380px;
  animation: slideInRight .3s ease;
  border: 1px solid rgba(255,255,255,.06);
}
.toast.success { border-left: 4px solid #4ade80; }
.toast.error   { border-left: 4px solid #f87171; }
.toast.info    { border-left: 4px solid var(--bronze-light); }
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ============================================================
   MULTI-TESSUTO
   ============================================================ */
.tessuto-block {
  border: 1.5px solid var(--gray-200);
  border-radius: 14px; margin-bottom: 14px; overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.tessuto-block:focus-within {
  border-color: var(--bronze);
  box-shadow: 0 0 0 3px rgba(160,120,64,.08);
}
.tessuto-block-header {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  background: linear-gradient(to right, var(--noir-2), var(--noir-3));
  border-bottom: 1px solid rgba(160,120,64,.2);
}
.tessuto-num-badge {
  background: linear-gradient(135deg, var(--bronze-dark), var(--bronze-light));
  color: white; font-weight: 800; font-size: .72rem;
  padding: 3px 10px; border-radius: 20px; flex-shrink: 0;
}
.tessuto-block-title {
  font-weight: 700; font-size: .875rem;
  color: rgba(255,255,255,.8);
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tessuto-block-body { padding: 14px 16px; }

/* Taglie compatte */
.taglie-grid-sm {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px;
}
.taglia-item-sm {
  background: var(--gray-50); border: 1.5px solid var(--gray-200);
  border-radius: 7px; padding: 5px 2px; text-align: center;
  transition: all var(--transition);
}
.taglia-item-sm:focus-within {
  border-color: var(--bronze); background: var(--bronze-subtle);
}
.taglia-label-sm {
  display: block; font-weight: 800; font-size: .7rem;
  color: var(--noir-2); margin-bottom: 3px;
}
.taglia-inp-sm {
  width: 100%; text-align: center;
  border: 1.5px solid var(--gray-300); border-radius: 4px;
  padding: 4px 2px; font-size: .8rem; font-weight: 700;
  background: white; outline: none;
  transition: border-color var(--transition);
}
.taglia-inp-sm:focus { border-color: var(--bronze); }

.taglie-subtotal {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; margin-top: 6px; font-size: .8rem; color: var(--gray-500);
}
.taglie-subtotal strong { font-size: 1rem; font-weight: 800; color: var(--bronze-dark); }

/* Accordion specifiche */
.spec-accordion { margin-top: 10px; }
.spec-accordion-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 14px;
  background: var(--gray-50); border: 1.5px solid var(--gray-200);
  border-radius: 10px; font-family: inherit;
  font-size: .85rem; font-weight: 600; color: var(--gray-700);
  cursor: pointer; transition: all var(--transition); text-align: left;
}
.spec-accordion-btn:hover {
  background: var(--bronze-subtle);
  border-color: var(--bronze); color: var(--bronze-dark);
}
.spec-arrow { margin-left: auto; transition: transform .25s ease; font-size: .8rem; color: var(--bronze); }
.spec-accordion-body { display: none; padding: 14px 4px 4px; }
.spec-accordion-body.open { display: block; }

/* Pillole specifiche */
.spec-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--gray-100); color: var(--gray-700);
  border: 1px solid var(--gray-200);
  border-radius: 6px; padding: 3px 8px;
  font-size: .78rem; font-weight: 500;
}
.spec-pill b { color: var(--noir-2); font-weight: 700; }
.spec-pill.si { background: #d4f0e2; color: #145a30; border-color: #a3d9bb; font-weight: 700; }

/* Riepilogo tessuto */
.riepilogo-tessuto {
  border: 1.5px solid var(--gray-200);
  border-radius: 12px; padding: 14px; margin-bottom: 10px;
  background: var(--gray-50);
}
.riepilogo-tessuto-header {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 6px;
}

/* INFO VALUE */
.info-value { font-size: 13px; font-weight: 600; color: #111827; }
.info-value.big { font-size: 22px; font-weight: 900; color: var(--bronze-dark); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  :root { --sidebar-w: 260px; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .page-content { padding: 14px; }
  .taglie-grid { grid-template-columns: repeat(3, 1fr); }
  .taglie-grid-sm { grid-template-columns: repeat(5, 1fr); }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .riepilogo-grid { grid-template-columns: 1fr; }
  .wizard-step .step-label { font-size: .6rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .oa-btn span { display: none; }
  .oa-btn { padding: 8px 10px; }
}
@media (max-width: 480px) {
  .login-card { padding: 36px 20px; }
  .taglie-grid { grid-template-columns: repeat(2, 1fr); }
  .taglie-grid-sm { grid-template-columns: repeat(5, 1fr); }
  .stats-grid { grid-template-columns: 1fr; }
  .logo-img-login { width: 130px; }
}
