/* Villa Abbondanzi Inspired Design - Enhanced Professional Look */
:root {
  /* Color Palette inspired by Villa Abbondanzi - Refined */
  --primary-green: #2d5a3d;        /* Deep forest green */
  --accent-green: #4a7c59;         /* Medium green */
  --light-green: #e8f5e8;          /* Light mint */
  --earth-brown: #8b6f47;          /* Warm brown */
  --gold-accent: #d4af37;          /* Elegant gold */
  --accent-red: #e74c3c;           /* Red for delete/burn actions */
  --cream: #faf8f3;                /* Warm cream */
  --white: #ffffff;
  --text-dark: #1a252f;
  --text-medium: #4a5568;
  --text-light: #718096;
  --border-light: #e2e8f0;
  --border-medium: #cbd5e0;
  --shadow-xs: rgba(45, 90, 61, 0.04);
  --shadow-light: rgba(45, 90, 61, 0.08);
  --shadow-medium: rgba(45, 90, 61, 0.12);
  --shadow-large: rgba(45, 90, 61, 0.16);
  --shadow-xl: rgba(0, 0, 0, 0.10);
  --gradient-primary: linear-gradient(135deg, var(--primary-green) 0%, var(--accent-green) 100%);
  --gradient-gold: linear-gradient(135deg, var(--gold-accent) 0%, #f4d03f 100%);
  --surface-elevated: rgba(255, 255, 255, 0.8);
  --backdrop-blur: blur(20px);
  
  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Border Radius Scale */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  /* Transition Timing */
  --transition-fast: 150ms;
  --transition-base: 250ms;
  --transition-slow: 350ms;
  
  /* Z-index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-notification: 10000;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  margin: 0;
  background: var(--cream);
  color: var(--text-dark);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  position: relative;
}

/* Header Styles - Enhanced Typography */
h1 {
  color: var(--primary-green);
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-align: center;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

h2 {
  color: var(--primary-green);
  font-size: 1.875rem;
  font-weight: 600;
  margin: 2.5rem 0 1.25rem 0;
  border-bottom: 2px solid var(--light-green);
  padding-bottom: 0.75rem;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

h3 {
  color: var(--earth-brown);
  font-size: 1.375rem;
  font-weight: 600;
  margin: 1.75rem 0 1rem 0;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

/* Card Styles - Enhanced Depth & Refinement */
.card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 
    0 1px 3px var(--shadow-xs),
    0 4px 12px var(--shadow-light),
    0 8px 24px var(--shadow-medium);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 2rem;
  overflow-x: hidden;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
  opacity: 0.6;
  border-radius: 20px 20px 0 0;
}

.card:hover {
  box-shadow: 
    0 2px 6px var(--shadow-light),
    0 8px 24px var(--shadow-medium),
    0 16px 48px var(--shadow-large);
  border-color: var(--border-medium);
}

/* Form Styles */
form.card {
  display: grid;
  gap: 1.5rem;
  background: var(--white);
}

label {
  display: grid;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text-dark);
}

input, select, textarea {
  padding: 1rem 1.25rem;
  border: 2px solid var(--border-light);
  border-radius: 14px;
  font-size: 1rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--white);
  color: var(--text-dark);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-weight: 400;
  letter-spacing: -0.01em;
}

input:hover, select:hover, textarea:hover {
  border-color: var(--border-medium);
  box-shadow: 0 2px 8px var(--shadow-xs);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 
    0 0 0 4px rgba(74, 124, 89, 0.08),
    0 4px 12px rgba(74, 124, 89, 0.12);
  transform: translateY(-1px);
}

input::placeholder {
  color: var(--text-light);
  opacity: 0.7;
  font-weight: 400;
}

/* Button Styles - Enhanced with Smooth Animations */
button {
  padding: 1rem 2rem;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

button.primary {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: 
    0 2px 8px rgba(45, 90, 61, 0.2),
    0 4px 16px rgba(45, 90, 61, 0.15);
}

button.primary:hover {
  box-shadow: 
    0 4px 12px rgba(45, 90, 61, 0.25),
    0 8px 24px rgba(45, 90, 61, 0.2);
}

button.primary:active {
  box-shadow: 
    0 1px 4px rgba(45, 90, 61, 0.2),
    0 2px 8px rgba(45, 90, 61, 0.15);
}

button.secondary {
  background: var(--white);
  color: var(--primary-green);
  border: 2px solid var(--primary-green);
  box-shadow: 0 2px 8px var(--shadow-xs);
}

button.secondary:hover {
  background: var(--primary-green);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(45, 90, 61, 0.2);
}

button.secondary:active {
  /* No transform to prevent movement */
}

button.danger {
  background: #e74c3c;
  color: var(--white);
}

button.danger:hover {
  background: #c0392b;
}

button.small {
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
}

/* Table Styles - Refined Professional Look */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: 0 1px 2px var(--shadow-xs);
}

th {
  background: var(--primary-green);
  color: var(--white);
  padding: 0.75rem 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Remove heavy vertical separators in header */
th:not(:last-child)::after { content: none; }

td {
  padding: 0.75rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-dark);
}

tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

tr:last-child td {
  border-bottom: none;
}

/* Status Styles - Enhanced Badges */
.status-active {
  color: var(--accent-green);
  font-weight: 600;
  background: var(--light-green);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-block;
  box-shadow: 0 1px 3px var(--shadow-xs);
}

.status-redeemed {
  color: #e74c3c;
  font-weight: 600;
  background: #fdf2f2;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-block;
  box-shadow: 0 1px 3px rgba(231, 76, 60, 0.1);
}

/* Code Styles */
code {
  background: var(--light-green);
  color: var(--primary-green);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-weight: 600;
}

/* Error Styles */
.error {
  border-color: #e74c3c !important;
  background: #fdf2f2;
}

.error-message {
  color: #e74c3c;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Success Styles - Enhanced */
.success {
  color: var(--accent-green);
  background: linear-gradient(135deg, var(--light-green) 0%, rgba(232, 245, 232, 0.6) 100%);
  padding: 1.25rem 1.5rem;
  border-radius: 14px;
  border-left: 4px solid var(--accent-green);
  margin: 1rem 0;
  box-shadow: 0 2px 8px var(--shadow-xs);
  font-weight: 500;
}

/* Modal System - Enhanced with Backdrop Blur */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: 24px;
  padding: 0;
  max-width: 480px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 24px 64px rgba(0, 0, 0, 0.16);
  transform: scale(0.92) translateY(24px);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
}

/* Larger modal for desktop - especially for form links */
@media (min-width: 768px) {
  .modal {
    max-width: 30%;
    width: 30%;
    max-height: 90vh;
  }
  
  .modal.large-modal {
    max-width: 1200px;
    width: 95%;
  }

  /* Edit user modal needs wider layout for form & coupon list */
  .modal.wide-modal {
    max-width: 90vw;
    width: 90%;
  }
}

.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 2.5rem 1.5rem 2.5rem;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(135deg, rgba(248, 255, 254, 0.8) 0%, rgba(240, 248, 245, 0.8) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-title {
  color: var(--primary-green);
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 300;
}

.modal-close:hover {
  background: var(--light-green);
  color: var(--primary-green);
}

.modal-body {
  color: var(--text-dark);
  line-height: 1.7;
  padding: 2.5rem;
  font-weight: 400;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding: 1.5rem 2.5rem 2rem 2.5rem;
  background: linear-gradient(180deg, rgba(250, 251, 252, 0.6) 0%, rgba(248, 250, 252, 0.8) 100%);
  border-top: 1px solid var(--border-light);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.modal-btn-primary {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(45, 90, 61, 0.2);
}

.modal-btn-primary:hover {
  box-shadow: 0 4px 16px rgba(45, 90, 61, 0.3);
}

.modal-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(45, 90, 61, 0.2);
}

.modal-btn-secondary {
  background: var(--text-light);
  color: var(--white);
}

.modal-btn-secondary:hover {
  background: var(--text-medium);
}

.modal-success {
  border-left: 4px solid var(--accent-green);
}

.modal-error {
  border-left: 4px solid #e74c3c;
}

.modal-warning {
  border-left: 4px solid var(--gold-accent);
}

/* Modal icon styles removed - no longer using icons */


/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem 0.5rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .card {
    padding: 1.5rem;
    margin: 0 0.5rem 1.5rem 0.5rem;
  }
  
  table {
    font-size: 0.9rem;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
  }
  
  th, td {
    padding: 0.8rem 0.5rem;
  }
  
  .modal {
    padding: 1.5rem;
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }
  
  .modal-footer {
    flex-direction: column;
  }
  
  .modal-btn {
    width: 100%;
  }
  
  /* Form improvements for mobile */
  form.card {
    max-width: 100%;
    margin: 0 auto;
  }
  
  /* Button improvements */
  button {
    padding: 0.9rem 1.5rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0.5rem;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  .card {
    padding: 1rem;
    margin: 0 0 1rem 0;
    border-radius: 12px;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.2rem;
  }
  
  button {
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
  }
  
  input, select, textarea {
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
  }
  
  .modal {
    margin: 0.5rem;
    max-width: calc(100vw - 1rem);
    border-radius: 16px;
  }
  
  .modal-header {
    padding: 1rem 1.5rem 0.5rem 1.5rem;
  }
  
  .modal-body {
    padding: 1.5rem;
  }
  
  .modal-footer {
    padding: 0.5rem 1.5rem 1.5rem 1.5rem;
  }
}

/* Loading Animation */
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.loading {
  /* Animazioni rimosse per feedback sobrio */
  animation: none;
}

/* Utility Classes */
.btn, .refresh-btn, .modal-btn, .save-button, .save-btn, .clear-btn, .clear-all-btn,
.burn-btn, .activate-btn, .deactivate-btn, .delete-btn, .link-btn {
  text-decoration: none;
}

/* Stili specifici per bottoni di feedback */
.refresh-btn.loading:hover,
.refresh-btn.success:hover,
.refresh-btn.error:hover {
  transform: none !important;
  box-shadow: var(--shadow-light) !important;
}
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.hidden { display: none; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-1 { gap: 1rem; }
.gap-2 { gap: 2rem; }

/* Universal Button Styles - Enhanced Professional Look */
.refresh-btn,
.modal-btn,
.burn-btn,
.activate-btn,
.deactivate-btn,
.delete-btn,
.save-button,
.save-btn,
.clear-btn,
.clear-all-btn,
.link-btn,
.add-field-btn {
  padding: 0.9rem 1.5rem;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 
    0 1px 3px rgba(0,0,0,0.04),
    0 4px 12px rgba(0,0,0,0.06);
  background-clip: padding-box;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Primary/neutral defaults remain gradient; neutrals are overridden below */
.refresh-btn,
.modal-btn,
.save-button,
.save-btn,
.link-btn,
.add-field-btn {
  background: var(--gradient-primary);
  color: var(--white);
  border-color: rgba(45,90,61,0.18);
}

/* Neutral buttons */
.clear-btn,
.clear-all-btn {
  background: #ffffff;
  color: var(--text-dark);
  border-color: var(--border-light);
}

/* Hover/active/focus states - Enhanced */
.refresh-btn:hover,
.modal-btn:hover,
.save-button:hover,
.save-btn:hover,
.link-btn:hover,
.add-field-btn:hover {
  box-shadow: 
    0 2px 6px rgba(0,0,0,0.08),
    0 8px 20px rgba(0,0,0,0.12);
}

.clear-btn:hover,
.clear-all-btn:hover {
  background: #f7f9f8;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.refresh-btn:active,
.modal-btn:active,
.save-button:active,
.save-btn:active,
.clear-btn:active,
.clear-all-btn:active,
.link-btn:active,
.add-field-btn:active,
.burn-btn:active,
.activate-btn:active,
.deactivate-btn:active,
.delete-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 6px 12px rgba(0,0,0,0.08);
}

.refresh-btn:focus-visible,
.modal-btn:focus-visible,
.save-button:focus-visible,
.save-btn:focus-visible,
.clear-btn:focus-visible,
.clear-all-btn:focus-visible,
.link-btn:focus-visible,
.add-field-btn:focus-visible,
.burn-btn:focus-visible,
.activate-btn:focus-visible,
.deactivate-btn:focus-visible,
.delete-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(45, 90, 61, 0.12), 0 2px 6px rgba(0,0,0,0.06);
}

/* Bottoni di azione con colori specifici - tonalità più delicate */
.burn-btn {
  background: #ff6b6b;
  color: #fff;
  border-color: rgba(255, 107, 107, 0.2);
}

.burn-btn:hover {
  background: #ff5252;
  color: #fff;
  box-shadow: 0 2px 6px rgba(255,107,107,0.2), 0 12px 24px rgba(255,107,107,0.15);
}

.activate-btn {
  background: #51cf66;
  color: #fff;
  border-color: rgba(81, 207, 102, 0.2);
}

.activate-btn:hover {
  background: #40c057;
  color: #fff;
  box-shadow: 0 2px 6px rgba(81,207,102,0.2), 0 12px 24px rgba(81,207,102,0.15);
}

.deactivate-btn {
  background: #ffd43b;
  color: #2c3e50;
  border-color: rgba(255, 212, 59, 0.2);
}

.deactivate-btn:hover {
  background: #ffcc02;
  color: #2c3e50;
  box-shadow: 0 2px 6px rgba(255,212,59,0.2), 0 12px 24px rgba(255,212,59,0.15);
}

.delete-btn {
  background: #ff8787;
  color: #fff;
  border-color: rgba(255, 135, 135, 0.2);
}

.delete-btn:hover {
  background: #ff6b6b;
  color: #fff;
  box-shadow: 0 2px 6px rgba(255,135,135,0.2), 0 12px 24px rgba(255,135,135,0.15);
}

.refresh-btn .btn-text {
  transition: opacity 0.3s ease;
}

/* Button Loading State */
.refresh-btn.loading {
  pointer-events: none;
  opacity: 0.8;
  cursor: not-allowed;
}

.refresh-btn.loading::after { content: none; }

.refresh-btn.loading .btn-text { opacity: 1; }

/* Button Success State */
.refresh-btn.success { background: #27ae60 !important; }

.refresh-btn.success::after { content: none; }

.refresh-btn.success .btn-text { opacity: 1; }

/* Button Error State */
.refresh-btn.error { background: #e74c3c !important; }

.refresh-btn.error::after { content: none; }

.refresh-btn.error .btn-text { opacity: 1; }

/* Animations */
/* Animazioni rimosse */


/* Unified site footer - Enhanced */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-light);
  font-size: 0.875rem;
  border-top: 1px solid var(--border-light);
  margin-top: 4rem;
  background: linear-gradient(180deg, transparent 0%, rgba(250, 251, 252, 0.5) 100%);
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Unified pagination - Enhanced Professional Look */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1.5rem 0;
}

.pagination button {
  background: #f7faf7;
  border: 1px solid var(--border-light);
  color: var(--text-dark);
  padding: 0.625rem 1rem;
  min-width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px var(--shadow-xs);
}

.pagination button:hover { 
  background: #e8f3ea;
  box-shadow: 0 2px 8px var(--shadow-light);
}

.pagination button.active {
  background: var(--primary-green);
  color: #fff;
  border-color: var(--primary-green);
  box-shadow: 
    0 2px 8px rgba(45,90,61,.25),
    0 4px 12px rgba(45,90,61,.15);
  font-weight: 600;
}

.pagination button:disabled { 
  opacity: .4; 
  cursor: not-allowed;
  background: #f5f5f5;
}
.pagination button:disabled:hover { 
  background: #f5f5f5;
  transform: none;
  box-shadow: 0 1px 3px var(--shadow-xs);
}

.pagination-info { 
  color: var(--text-medium); 
  padding: 0 .5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ============================================
   UI/UX IMPROVEMENTS - Notification System
   ============================================ */
.notification-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 400px;
  width: calc(100% - 2rem);
  pointer-events: none;
}

.notification {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.15),
    0 8px 24px rgba(0, 0, 0, 0.1);
  border-left: 4px solid;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification-success {
  border-left-color: var(--accent-green);
  background: linear-gradient(135deg, var(--light-green) 0%, var(--white) 100%);
}

.notification-error {
  border-left-color: var(--accent-red);
  background: linear-gradient(135deg, #fdf2f2 0%, var(--white) 100%);
}

.notification-warning {
  border-left-color: var(--gold-accent);
  background: linear-gradient(135deg, #fffbf0 0%, var(--white) 100%);
}

.notification-info {
  border-left-color: #74c0fc;
  background: linear-gradient(135deg, #e7f5ff 0%, var(--white) 100%);
}

.notification-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.notification-success .notification-icon {
  color: var(--accent-green);
}

.notification-error .notification-icon {
  color: var(--accent-red);
}

.notification-warning .notification-icon {
  color: var(--gold-accent);
}

.notification-info .notification-icon {
  color: #74c0fc;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-message {
  margin: 0;
  color: var(--text-dark);
  font-size: 0.95rem;
  line-height: 1.5;
  font-weight: 500;
}

.notification-close {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--text-light);
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: -2px;
}

.notification-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-dark);
}

.notification-close:focus {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .notification-container {
    top: 0.5rem;
    right: 0.5rem;
    left: 0.5rem;
    max-width: none;
    width: auto;
  }
  
  .notification {
    padding: 0.875rem 1rem;
  }
  
  .notification-message {
    font-size: 0.9rem;
  }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Enhanced focus states for keyboard navigation */
*:focus-visible {
  outline: 3px solid var(--accent-green);
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent-green);
  outline-offset: 2px;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   MOBILE UX IMPROVEMENTS
   ============================================ */

/* Minimum touch target size (44x44px) */
button,
a,
input[type="checkbox"],
input[type="radio"],
.nav-link,
.sidebar-link {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Responsive table - convert to cards on mobile */
@media (max-width: 768px) {
  .responsive-table {
    display: block;
  }
  
  .responsive-table thead {
    display: none;
  }
  
  .responsive-table tbody {
    display: block;
  }
  
  .responsive-table tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1rem;
    background: var(--white);
    box-shadow: 0 2px 8px var(--shadow-xs);
  }
  
  .responsive-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border: none;
    border-bottom: 1px solid var(--border-light);
  }
  
  .responsive-table td:last-child {
    border-bottom: none;
  }
  
  .responsive-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-medium);
    margin-right: 1rem;
    flex-shrink: 0;
  }
  
  .responsive-table td:last-child::after {
    content: '';
  }
}

/* Form improvements for mobile */
@media (max-width: 768px) {
  input,
  select,
  textarea {
    font-size: 16px; /* Prevents zoom on iOS */
    min-height: 44px;
  }
  
  label {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }
}

/* ============================================
   DESIGN TOKENS - Spacing & Layout
   ============================================ */
/* Design tokens aggiunti a :root esistente sopra */

/* ============================================
   IMPROVED FORM VALIDATION STYLES
   ============================================ */
.form-group {
  position: relative;
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: var(--accent-red);
  background: #fdf2f2;
}

.form-group input.valid,
.form-group select.valid,
.form-group textarea.valid {
  border-color: var(--accent-green);
}

.form-group .error-message {
  display: block;
  color: var(--accent-red);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-group .success-message {
  display: block;
  color: var(--accent-green);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-group .error-message::before {
  content: '⚠';
  font-size: 1rem;
}

.form-group .success-message::before {
  content: '✓';
  font-size: 1rem;
}

/* Empty state styles */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-medium);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  opacity: 0.5;
}

.empty-state h3 {
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-medium);
  margin-bottom: 1.5rem;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--border-light) 0%,
    rgba(255, 255, 255, 0.5) 50%,
    var(--border-light) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-title {
  height: 1.5rem;
  width: 60%;
  margin-bottom: 1rem;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}


