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

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--color-primary, var(--color-primary-500));
  color: #fff;
  padding: 0.75rem 1.5rem;
  z-index: 10000;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  top: 0;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-image: url("../assets/background.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
}

header h1 {
  color: white;
  font-size: 2.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: 10px;
}

.sync-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: white;
  font-size: 14px;
  opacity: 0.9;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-indicator.online {
  background-color: var(--color-success-dark);
  box-shadow: 0 0 8px rgba(56, 161, 105, 0.6);
}

.status-indicator.offline {
  background-color: var(--color-error);
  box-shadow: 0 0 8px rgba(229, 62, 62, 0.6);
}

.status-indicator.syncing {
  background-color: var(--color-info);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.12),
    0 4px 16px rgba(102, 126, 234, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-brand-gradient-90);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
}

section:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.15),
    0 6px 20px rgba(102, 126, 234, 0.12);
}

section h2 {
  color: var(--color-gray-900);
  margin-bottom: 24px;
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--color-brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Input Section */
.input-form-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.input-form-left {
  display: flex;
  flex-direction: column;
}

.input-form-right {
  display: flex;
  justify-content: center;
  align-items: start;
  margin-top: -10px;
}

.input-form {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
}

.input-form input {
  padding: 14px 16px;
  border: 2px solid var(--color-gray-200);
  border-radius: 12px;
  font-size: 15px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 95px;
  flex: 0.6;
  background: var(--color-gray-50);
  font-weight: 500;
}

/* Campo data più largo per mostrare la data completa */
.input-form input[type="date"] {
  min-width: 125px;
  flex: 0.6;
  padding: 10px 12px;
}

.input-form input:hover {
  border-color: var(--color-gray-300);
  background: #fff;
}

.input-form input:focus {
  outline: none;
  border-color: var(--color-primary-500);
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(102, 126, 234, 0.1),
    0 4px 12px rgba(102, 126, 234, 0.15);
  transform: translateY(-1px);
}

/* Rimuovi le freccette dai campi numerici */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.input-form button {
  padding: 12px 20px;
  background: var(--color-brand-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
  position: relative;
  overflow: hidden;
}

.input-form button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.input-form button:hover::before {
  left: 100%;
}

.input-form button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.input-form button:active {
  transform: translateY(-1px);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.stat-card {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9),
    rgba(247, 250, 252, 0.9)
  );
  backdrop-filter: blur(10px);
  padding: 24px;
  border-radius: 16px;
  text-align: center;
  border: 2px solid rgba(226, 232, 240, 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: rgba(102, 126, 234, 0.3);
}

.stat-card h3 {
  font-size: 0.85rem;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: transparent;
  background: var(--color-brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card span {
  font-size: 2rem;
  font-weight: 800;
  display: block;
  background: var(--color-brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Mantieni i colori specifici per le variazioni */
.stat-card span.positive,
.stat-card span.negative,
.stat-card span.weight-increase,
.stat-card span.weight-decrease,
.stat-card span.weight-neutral,
.stat-card span.weight-change-good,
.stat-card span.weight-change-bad {
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  background-clip: unset;
}

.positive {
  color: var(--color-success-dark) !important;
}

/* Colori specifici per variazione peso basati su obiettivo */
.weight-increase {
  color: var(--color-error) !important;
  /* rosso per aumento peso */
}

.weight-decrease {
  color: var(--color-success-dark) !important;
  /* verde per diminuzione peso */
}

.weight-neutral {
  color: var(--color-gray-900) !important;
  /* nero per nessun cambiamento */
}

/* Colori dinamici basati su peso desiderato */
.weight-change-good {
  color: var(--color-success-dark) !important;
  /* verde per variazione positiva verso obiettivo */
}

.weight-change-bad {
  color: var(--color-error) !important;
  /* rosso per variazione negativa rispetto obiettivo */
}

/* Next Medicine Section - Stile Moderno */
.next-medicine-section {
  margin-bottom: 30px;
}

/* Animazione pulsazione per l'icona */
@keyframes pillPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

.next-medicine-box {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--color-brand-gradient);
  border-radius: 20px;
  color: white;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.next-medicine-box::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}

.next-medicine-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
}

.next-medicine-box:hover::before {
  opacity: 1;
}

.next-medicine-icon {
  font-size: 2.5rem;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: pillPulse 2s ease-in-out infinite;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.next-medicine-content {
  flex: 1;
}

.next-medicine-content h3 {
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.next-medicine-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.next-medicine-time {
  font-size: 1rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.next-medicine-time::before {
  content: "🕐";
  font-size: 1.1rem;
}

.next-medicine-action {
  flex-shrink: 0;
}

.next-medicine-btn {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 25px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.next-medicine-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.next-medicine-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Responsive per mobile */
@media (max-width: 768px) {
  .next-medicine-box {
    flex-direction: column;
    text-align: center;
    gap: 16px;
    padding: 20px;
  }

  .next-medicine-icon {
    align-self: center;
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }

  .next-medicine-content h3 {
    font-size: 0.85rem;
  }

  .next-medicine-name {
    font-size: 1.3rem;
  }

  .next-medicine-time {
    font-size: 0.9rem;
    justify-content: center;
  }

  .next-medicine-btn {
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* Chart Section */
.chart-section {
  margin-bottom: 30px;
  display: block;
  visibility: visible;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
  z-index: var(--z-above);
  width: 100%;
}

.chart-header h2 {
  margin: 0 0 20px 0;
  color: var(--color-gray-700);
  font-size: 1.5rem;
}

.chart-granularity-wrapper {
  position: relative;
}

.chart-granularity-bubble {
  background: linear-gradient(
    135deg,
    var(--color-success),
    var(--color-success-dark)
  );
  color: white;
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
  transition: all 0.3s ease;
}

.chart-granularity-bubble:hover {
  background: linear-gradient(135deg, var(--color-success-dark), var(--color-success-dark));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.dropdown-arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
}

.chart-granularity-bubble.open .dropdown-arrow {
  transform: rotate(180deg);
}

.chart-granularity-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: var(--z-overlay);
  margin-top: 4px;
  overflow: hidden;
}

.chart-granularity-dropdown.hidden {
  display: none;
}

.dropdown-option {
  padding: 12px 16px;
  color: #333;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.dropdown-option:hover {
  background: var(--color-gray-50);
}

.dropdown-option:active {
  background: var(--color-gray-200);
}

.chart-container {
  position: relative;
  height: 400px;
}

.chart-container canvas {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
}

/* Weight Calendar Section */
.weight-calendar-section {
  margin-bottom: 30px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 28px;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.12),
    0 4px 16px rgba(102, 126, 234, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

.weight-calendar-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-brand-gradient-90);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
  border-radius: 20px 20px 0 0;
}

.weight-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 15px;
  flex-wrap: wrap;
}

.weight-calendar-header h3 {
  margin: 0;
  color: var(--color-gray-900);
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--color-brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.weight-month-selector {
  padding: 12px 20px;
  border: 2px solid var(--color-gray-200);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-gray-900);
  background: linear-gradient(135deg, var(--color-gray-50), #fff);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 200px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.weight-month-selector:hover {
  border-color: var(--color-primary-500);
  background: linear-gradient(135deg, #fff, var(--color-gray-50));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.weight-month-selector:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow:
    0 0 0 4px rgba(102, 126, 234, 0.1),
    0 4px 12px rgba(102, 126, 234, 0.15);
}

.weight-calendar-container {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9),
    rgba(247, 250, 252, 0.9)
  );
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 20px;
  border: 2px solid rgba(226, 232, 240, 0.5);
  width: 320px;
  max-width: 320px;
  margin: 0 auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.weight-calendar-header-month {
  text-align: center;
  margin-bottom: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-gray-900);
  letter-spacing: 0.5px;
}

.weight-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 40px);
  gap: 4px;
  justify-content: center;
}

.weight-calendar-day-header {
  text-align: center;
  padding: 6px 2px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-primary-500);
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1),
    rgba(118, 75, 162, 0.1)
  );
  border-radius: 8px;
  width: 40px;
  height: 28px;
  min-width: 40px;
  min-height: 28px;
  max-width: 40px;
  max-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.weight-calendar-day {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
  border: 2px solid rgba(226, 232, 240, 0.5);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(5px);
  box-sizing: border-box;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* Giorni con dati (verde/rosso applicati via inline style dal JS) */
.weight-calendar-day:not(.future):not(.no-data):not(.today) {
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.weight-calendar-day.today {
  font-weight: 800;
  border: 3px solid var(--color-primary-500) !important;
  box-shadow:
    0 0 0 3px rgba(102, 126, 234, 0.2),
    0 4px 12px rgba(102, 126, 234, 0.3) !important;
  animation: todayPulse 2s ease-in-out infinite;
}

@keyframes todayPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(102, 126, 234, 0.2),
      0 4px 12px rgba(102, 126, 234, 0.3) !important;
  }
  50% {
    box-shadow:
      0 0 0 5px rgba(102, 126, 234, 0.3),
      0 6px 16px rgba(102, 126, 234, 0.4) !important;
  }
}

/* History Section */
.history-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

/* Custom scrollbar per la lista storico */
.history-list::-webkit-scrollbar {
  width: 8px;
}

.history-list::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.3);
  border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
  background: var(--color-brand-gradient);
  border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9),
    rgba(247, 250, 252, 0.9)
  );
  backdrop-filter: blur(10px);
  border: 2px solid rgba(226, 232, 240, 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

.history-item > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
}

.history-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--color-brand-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.history-item:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 1),
    rgba(247, 250, 252, 1)
  );
  transform: translateX(6px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
  border-color: rgba(102, 126, 234, 0.3);
}

.history-item:hover::before {
  opacity: 1;
}

.history-item:last-child {
  margin-bottom: 0;
}

.history-date {
  font-weight: 700;
  color: var(--color-gray-900);
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.history-change {
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  white-space: nowrap;
  display: inline-block;
  width: fit-content;
}

.history-weight {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-gray-900);
  white-space: nowrap;
  margin-right: 12px;
}

.history-change:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.history-change.positive {
  background: linear-gradient(135deg, var(--color-success-light), var(--color-success-light));
  color: var(--color-success-dark);
  border: 1px solid rgba(56, 161, 105, 0.3);
}

.history-change.negative {
  background: linear-gradient(135deg, var(--color-error-light), #fca5a5);
  color: var(--color-error-dark);
  border: 1px solid rgba(229, 62, 62, 0.3);
}

/* Colori dinamici per storico basati su peso desiderato */
.history-change.good {
  background: linear-gradient(135deg, var(--color-success-light), var(--color-success-light));
  color: var(--color-success-dark);
  border: 1px solid rgba(56, 161, 105, 0.3);
}

.history-change.bad {
  background: linear-gradient(135deg, var(--color-error-light), #fca5a5);
  color: var(--color-error-dark);
  border: 1px solid rgba(229, 62, 62, 0.3);
}

.history-change.neutral {
  background: linear-gradient(
    135deg,
    var(--color-gray-200),
    var(--color-gray-300)
  );
  color: var(--color-gray-700);
  border: 1px solid rgba(160, 174, 192, 0.3);
}

/* History Actions (Edit & Delete buttons) */
.history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.edit-btn,
.delete-btn {
  background: rgba(226, 232, 240, 0.5);
  border: 2px solid rgba(203, 213, 224, 0.5);
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.edit-btn:hover {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.15),
    rgba(37, 99, 235, 0.15)
  );
  border-color: #3b82f6;
  transform: scale(1.15) rotate(-5deg);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.delete-btn {
  color: var(--color-error);
}

.delete-btn:hover {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.15),
    rgba(220, 38, 38, 0.15)
  );
  border-color: var(--color-error);
  transform: scale(1.15) rotate(5deg);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.no-data {
  text-align: center;
  color: var(--color-gray-400);
  font-style: italic;
  padding: 40px;
}

/* Responsive */
@media (max-width: 768px) {
  .input-form {
    flex-direction: column;
  }

  .input-form input,
  .input-form button {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  header h1 {
    font-size: 2rem;
  }

  .chart-header {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .chart-header h2 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.5rem;
    color: var(--color-gray-700);
    display: block !important;
    visibility: visible !important;
  }

  .next-medicine-box {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .next-medicine-icon {
    align-self: center;
  }

  .chart-granularity-wrapper {
    align-self: center;
    width: fit-content;
  }

  .chart-granularity-bubble {
    min-width: 200px;
  }

  .weight-calendar-header {
    flex-direction: column;
    align-items: stretch;
  }

  .weight-month-selector {
    width: 100%;
  }

  .weight-calendar-container {
    width: 300px;
    max-width: 300px;
    padding: 16px;
  }

  .weight-calendar-grid {
    grid-template-columns: repeat(7, 38px);
    gap: 3px;
  }

  .weight-calendar-day {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    max-width: 38px;
    max-height: 38px;
    font-size: 0.75rem;
    border-radius: 8px;
  }

  .weight-calendar-day-header {
    width: 38px;
    height: 26px;
    min-width: 38px;
    min-height: 26px;
    max-width: 38px;
    max-height: 26px;
    font-size: 0.65rem;
    padding: 4px 1px;
    border-radius: 6px;
  }
}

/*
 Auth Styles */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 45px;
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.25),
    0 10px 30px rgba(102, 126, 234, 0.15);
  width: 100%;
  max-width: 420px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: slideUp 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-brand-gradient-90);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.auth-card h1 {
  color: var(--color-gray-900);
  margin-bottom: 12px;
  font-size: 2.2rem;
  font-weight: 700;
}

.auth-card h1 [data-translate] {
  background: var(--color-brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-card p {
  color: var(--color-gray-500);
  margin-bottom: 32px;
  font-size: 1rem;
  font-weight: 500;
}

.auth-tabs {
  display: flex;
  margin-bottom: 32px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-gray-50);
  padding: 4px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.auth-tab {
  flex: 1;
  padding: 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 8px;
  color: var(--color-gray-500);
  position: relative;
}

.auth-tab:hover:not(.active) {
  background: rgba(102, 126, 234, 0.08);
  color: var(--color-primary-500);
}

.auth-tab.active {
  background: var(--color-brand-gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  transform: scale(1.02);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-form input {
  padding: 16px 18px;
  border: 2px solid var(--color-gray-200);
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--color-gray-50);
  color: var(--color-gray-900);
  font-weight: 500;
}

.auth-form input::placeholder {
  color: var(--color-gray-400);
  font-weight: 400;
}

.auth-form input:hover {
  border-color: var(--color-gray-300);
  background: #fff;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--color-primary-500);
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(102, 126, 234, 0.1),
    0 4px 12px rgba(102, 126, 234, 0.15);
  transform: translateY(-1px);
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  flex: 1;
  padding-right: 52px;
}

.toggle-password {
  position: absolute;
  right: 14px;
  background: rgba(102, 126, 234, 0.08);
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.7;
  user-select: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
}

.toggle-password:hover {
  opacity: 1;
  background: rgba(102, 126, 234, 0.15);
  transform: scale(1.08);
}

.toggle-password:active {
  transform: scale(0.95);
}

.auth-form button[type="submit"] {
  padding: 16px;
  background: var(--color-brand-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
  position: relative;
  overflow: hidden;
  margin-top: 6px;
}

.auth-form button[type="submit"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.auth-form button[type="submit"]:hover::before {
  left: 100%;
}

.auth-form button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.auth-form button:active {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

.auth-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-error {
  margin-top: 18px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--color-error-light), #fecaca);
  color: var(--color-error-dark);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  display: none;
  border-left: 4px solid var(--color-error);
  box-shadow: 0 4px 12px rgba(229, 62, 62, 0.15);
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}

.auth-error.show {
  display: block;
}

.forgot-password-link {
  text-align: center;
  margin-top: 18px;
}

.forgot-password-link a {
  color: var(--color-primary-500);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
}

.forgot-password-link a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--color-primary-500),
    var(--color-primary-700)
  );
  transition: width 0.3s ease;
}

.forgot-password-link a:hover {
  color: var(--color-primary-700);
}

.forgot-password-link a:hover::after {
  width: 100%;
}

/* Reset Password Modal */
.reset-success {
  background: var(--color-success-light);
  color: var(--color-success-dark);
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  margin-top: 15px;
}

.reset-success.show {
  display: block;
}

/* Email Verification Warning */
.email-verification-warning {
  background: linear-gradient(135deg, #fef3c7, #fbbf24);
  border: 2px solid var(--color-accent-500);
  border-radius: 12px;
  margin: 20px 0;
  padding: 15px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.warning-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.warning-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.warning-text {
  flex: 1;
}

.warning-text strong {
  display: block;
  color: #92400e;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.verification-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.resend-verification-btn,
.refresh-verification-btn {
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
}

.resend-verification-btn {
  background: linear-gradient(135deg, var(--color-accent-500), #d97706);
  color: white;
}

.resend-verification-btn:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  transform: translateY(-1px);
}

.refresh-verification-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.refresh-verification-btn:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
}

.resend-verification-btn:disabled,
.refresh-verification-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Header with user info */
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  margin-bottom: 15px;
}

.header-main h1 {
  margin: 0;
  text-align: left;
  align-self: center;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
  color: white;
  font-size: 14px;
}

.user-profile-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-icon {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.profile-icon:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

#profile-icon-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.profile-icon-svg {
  width: 20px;
  height: 20px;
  transition: opacity 0.3s ease;
}

.profile-icon-svg.hidden {
  display: none;
}

.logout-btn {
  padding: 8px 15px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.3s;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* GitHub Banner */
.github-banner {
  background: var(--color-brand-gradient);
  color: white;
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.github-banner p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

.github-banner a {
  color: #ffd700;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-block;
}

.github-banner a:hover {
  color: #ffed4e;
  transform: scale(1.05);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Responsive auth */
@media (max-width: 768px) {
  .auth-card {
    padding: 35px 24px;
    margin: 10px;
    max-width: 95%;
  }

  .auth-card h1 {
    font-size: 1.9rem;
  }

  .auth-form input {
    padding: 14px 16px;
    font-size: 15px;
  }

  .auth-form button[type="submit"] {
    padding: 14px;
    font-size: 15px;
  }

  .header-content {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .header-content h1 {
    font-size: 1.8rem;
  }

  .github-banner {
    margin-top: 30px;
    padding: 15px;
  }

  .github-banner p {
    font-size: 0.9rem;
  }
}

/*
 Language Selector Styles */
.language-selector {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 5px;
}

.language-selector-main {
  display: flex;
  gap: 5px;
  margin-right: 15px;
}

.lang-btn,
.lang-btn-small {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
  color: white;
}

.lang-btn-small {
  padding: 6px 10px;
  font-size: 14px;
}

.lang-btn:hover,
.lang-btn-small:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.lang-btn.active,
.lang-btn-small.active {
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Auth card language selector */
.auth-card .language-selector {
  position: relative;
  top: 0;
  right: 0;
  justify-content: center;
  margin-bottom: 24px;
  gap: 8px;
}

.auth-card .lang-btn {
  background: var(--color-gray-50);
  color: var(--color-gray-700);
  border: 2px solid var(--color-gray-200);
  padding: 10px 16px;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 18px;
}

.auth-card .lang-btn:hover {
  background: var(--color-gray-100);
  border-color: var(--color-gray-300);
  transform: scale(1.08);
}

.auth-card .lang-btn.active {
  background: var(--color-brand-gradient);
  color: white;
  border-color: var(--color-primary-500);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  transform: scale(1.05);
}

/* Responsive language selector */
@media (max-width: 768px) {
  .language-selector {
    position: relative;
    top: 0;
    right: 0;
    justify-content: center;
    margin-bottom: 15px;
  }

  .language-selector-main {
    margin-right: 0;
    margin-bottom: 10px;
  }

  .header-main {
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
  }

  .header-main h1 {
    margin-bottom: 10px;
    text-align: center;
  }

  .header-right {
    align-items: center;
  }

  .user-info {
    flex-direction: row;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 13px;
  }

  .user-profile-section {
    gap: 8px;
  }

  .profile-icon {
    width: 32px;
    height: 32px;
  }

  .profile-icon svg {
    width: 18px;
    height: 18px;
  }

  .logout-btn {
    padding: 6px 12px;
    font-size: 11px;
  }

  .profile-modal {
    width: 95%;
    max-width: none;
    margin: 10px;
  }
}

/* Diet S
ection Styles */
.diet-section {
  margin-top: 20px;
}

.diet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* Header buttons container */
.header-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Export button styles */
.export-btn {
  background: linear-gradient(
    135deg,
    var(--color-success),
    var(--color-success-dark)
  );
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}

.export-btn:hover {
  background: linear-gradient(135deg, var(--color-success-dark), var(--color-success-dark));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.diet-toggle-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--color-primary-500), #5a67d8);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.diet-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.diet-date-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  align-items: center;
}

.diet-date-selector input {
  padding: 10px;
  border: 2px solid var(--color-gray-200);
  border-radius: 8px;
  font-size: 14px;
}

#diet-today-btn,
#food-diary-today-btn {
  padding: 10px 20px;
  background: linear-gradient(
    135deg,
    var(--color-success) 0%,
    var(--color-success-dark) 100%
  );
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}

#diet-today-btn:hover,
#food-diary-today-btn:hover {
  background: linear-gradient(
    135deg,
    var(--color-success-dark) 0%,
    var(--color-success-dark) 100%
  );
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.meals-section-title {
  color: var(--color-gray-700);
  font-size: 1.3rem;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 600;
  border-bottom: 2px solid var(--color-gray-200);
  padding-bottom: 10px;
}

.meals-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.meal-card {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(247, 250, 252, 0.95)
  );
  backdrop-filter: blur(10px);
  border: 2px solid rgba(226, 232, 240, 0.5);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.meal-card:hover {
  border-color: rgba(102, 126, 234, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

.meal-card h3 {
  color: var(--color-gray-700);
  margin-bottom: 15px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.meal-content {
  min-height: 60px;
  margin-bottom: 15px;
}

.no-meal {
  color: var(--color-gray-400);
  font-style: italic;
  text-align: center;
  padding: 20px;
}

.meal-item {
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  position: relative;
}

.meal-item h4 {
  color: var(--color-gray-900);
  margin-bottom: 5px;
  font-size: 0.95rem;
}

.meal-item p {
  color: var(--color-gray-500);
  font-size: 0.85rem;
  margin-bottom: 5px;
}

.meal-calories {
  color: var(--color-success-dark);
  font-weight: bold;
  font-size: 0.8rem;
}

.meal-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 5px;
}

.meal-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 12px;
  transition: background-color 0.2s;
}

.meal-action-btn:hover {
  background: var(--color-gray-50);
}

.edit-btn {
  color: var(--color-info);
}

.delete-btn-meal {
  color: var(--color-error);
}

.add-meal-btn {
  width: 100%;
  padding: 14px;
  background: var(--color-brand-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
  position: relative;
  overflow: hidden;
}

.add-meal-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.add-meal-btn:hover::before {
  left: 100%;
}

.add-meal-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.add-meal-btn:active {
  transform: translateY(-1px);
}

.daily-stats {
  display: flex;
  justify-content: space-around;
  background: var(--color-brand-gradient);
  color: white;
  padding: 20px;
  border-radius: 12px;
  margin-top: 20px;
}

.stat-item {
  text-align: center;
}

.stat-item span:first-child {
  display: block;
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 5px;
}

.stat-item span:last-child {
  font-size: 1.2rem;
  font-weight: bold;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-overlay);
  animation: fadeIn 0.3s ease-out;
}

.meal-modal {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.3),
    0 10px 30px rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.meal-modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-brand-gradient-90);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
  border-radius: 20px 20px 0 0;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 2px solid rgba(226, 232, 240, 0.5);
}

.modal-header h3 {
  color: var(--color-gray-900);
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
}

/* Preserva le emoji nei titoli modal */
.modal-header h3::first-letter {
  color: initial;
}

.close-modal {
  background: rgba(226, 232, 240, 0.3);
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--color-gray-500);
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.close-modal:hover {
  background: rgba(226, 232, 240, 0.5);
  color: var(--color-gray-900);
  transform: scale(1.1) rotate(90deg);
}

.modal-content {
  padding: 28px;
}

.modal-content input,
.modal-content textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--color-gray-200);
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 18px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--color-gray-50);
  font-weight: 500;
}

.modal-content input::placeholder,
.modal-content textarea::placeholder {
  color: var(--color-gray-400);
  font-weight: 400;
}

.modal-content input:hover,
.modal-content textarea:hover {
  border-color: var(--color-gray-300);
  background: #fff;
}

.modal-content input:focus,
.modal-content textarea:focus {
  outline: none;
  border-color: var(--color-primary-500);
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(102, 126, 234, 0.1),
    0 4px 12px rgba(102, 126, 234, 0.15);
  transform: translateY(-1px);
}

.modal-content textarea {
  resize: vertical;
  min-height: 90px;
}

.day-selector {
  margin-bottom: 15px;
}

.day-selector label {
  display: block;
  margin-bottom: 5px;
  color: var(--color-gray-700);
  font-weight: 500;
  font-size: 14px;
}

.day-selector select {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--color-gray-200);
  border-radius: 8px;
  font-size: 14px;
  background: white;
  transition: border-color 0.3s;
}

.day-selector select:focus {
  outline: none;
  border-color: var(--color-primary-500);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.cancel-btn {
  padding: 12px 24px;
  background: var(--color-gray-50);
  color: var(--color-gray-700);
  border: 2px solid var(--color-gray-200);
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cancel-btn:hover {
  background: var(--color-gray-100);
  border-color: var(--color-gray-300);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.save-btn {
  padding: 12px 24px;
  background: var(--color-brand-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
  position: relative;
  overflow: hidden;
}

.save-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.save-btn:hover::before {
  left: 100%;
}

.save-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.save-btn:active {
  transform: translateY(-1px);
}

/* Profile Modal Styles */
.profile-modal {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.3),
    0 10px 30px rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.profile-modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-brand-gradient-90);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
  border-radius: 20px 20px 0 0;
}

.profile-modal .form-group {
  margin-bottom: 20px;
}

.profile-modal .form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--color-gray-700);
  font-weight: 500;
  font-size: 14px;
}

.profile-modal .form-group input,
.profile-modal .form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--color-gray-200);
  border-radius: 12px;
  font-size: 14px;
  background: var(--color-gray-50);
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-modal .form-group input::placeholder {
  color: var(--color-gray-400);
  font-weight: 400;
}

.profile-modal .form-group input:hover,
.profile-modal .form-group select:hover {
  border-color: var(--color-gray-300);
  background: #fff;
}

.profile-modal .form-group input:focus,
.profile-modal .form-group select:focus {
  outline: none;
  border-color: var(--color-primary-500);
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(102, 126, 234, 0.1),
    0 4px 12px rgba(102, 126, 234, 0.15);
  transform: translateY(-1px);
}

/* Custom Dropdown per Condizioni Mediche */
.custom-dropdown {
  position: relative;
  width: 100%;
}

.dropdown-selected {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--color-gray-200);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.3s;
  user-select: none;
}

.dropdown-selected:hover {
  border-color: var(--color-gray-300);
}

.dropdown-selected.active {
  border-color: var(--color-primary-500);
}

.selected-text {
  flex: 1;
  font-size: 14px;
  color: var(--color-gray-900);
}

.dropdown-arrow {
  font-size: 12px;
  color: var(--color-gray-500);
  transition: transform 0.3s;
}

.dropdown-selected.active .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: white;
  border: 2px solid var(--color-gray-200);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 250px;
  overflow-y: auto;
  z-index: var(--z-overlay);
  display: none;
}

.dropdown-options.show {
  display: block;
}

.dropdown-option {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  transition: background-color 0.2s;
  user-select: none;
}

.dropdown-option:hover {
  background-color: var(--color-gray-50);
}

.dropdown-option input[type="checkbox"] {
  margin-right: 10px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.dropdown-option span {
  font-size: 14px;
  color: var(--color-gray-900);
}

.dropdown-option input[type="checkbox"]:checked + span {
  font-weight: 600;
  color: var(--color-primary-500);
}

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-gray-500);
  font-style: italic;
}

.profile-success {
  background: var(--color-success-light);
  border: 1px solid var(--color-success-light);
  color: var(--color-success-dark);
  padding: 12px;
  border-radius: 8px;
  margin-top: 15px;
  text-align: center;
}

/* Autocomplete Styles */
.autocomplete-container {
  position: relative;
}

.autocomplete-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--color-gray-200);
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: var(--z-overlay);
  display: none;
}

.autocomplete-suggestions.show {
  display: block;
}

.autocomplete-suggestion {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-gray-50);
  transition: background-color 0.2s;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.highlighted {
  background-color: var(--color-gray-50);
}

.autocomplete-suggestion:last-child {
  border-bottom: none;
}

/* Target Weight Modal Styles */
.target-weight-modal {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  width: 90%;
  max-width: 470px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.3),
    0 10px 30px rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.target-weight-modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-brand-gradient-90);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
  border-radius: 20px 20px 0 0;
}

.target-weight-modal .form-group {
  margin-bottom: 20px;
}

.target-weight-modal .form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--color-gray-700);
  font-weight: 500;
  font-size: 14px;
}

.target-weight-modal .form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--color-gray-200);
  border-radius: 8px;
  font-size: 14px;
  background: white;
  transition: border-color 0.3s;
}

.target-weight-modal .form-group input:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.target-weight-modal .form-hint {
  display: block;
  margin-top: 5px;
  color: var(--color-gray-500);
  font-size: 12px;
}

.target-weight-success {
  background: var(--color-success-light);
  border: 1px solid var(--color-success-light);
  color: var(--color-success-dark);
  padding: 12px;
  border-radius: 8px;
  margin-top: 15px;
  text-align: center;
}

.autocomplete-loading {
  padding: 10px 12px;
  text-align: center;
  color: var(--color-gray-400);
  font-style: italic;
}

.autocomplete-loading::before {
  content: "🌍 ";
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Weight Day Details Modal — allineato al design system v2.0 */
.weight-day-modal {
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  width: 90%;
  max-width: 420px;
  overflow: hidden;
  box-shadow: var(--shadow-2xl);
  border: 1px solid var(--color-gray-200);
  animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.weight-day-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-gray-200);
}

.weight-day-modal .modal-header h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-gray-900);
  text-transform: capitalize;
}

.weight-day-modal .close-modal {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--color-gray-400);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s ease);
}

.weight-day-modal .close-modal:hover {
  background: var(--color-gray-100);
  color: var(--color-gray-700);
}

.weight-day-modal .close-modal:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

.weight-day-modal .modal-content {
  padding: var(--space-6);
}

.weight-day-info {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.weight-day-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-gray-200);
}

.weight-day-stat:last-child {
  border-bottom: none;
}

.weight-day-stat .stat-label {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-gray-600);
}

.weight-day-stat .stat-value {
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-gray-900);
}

.weight-day-stat .stat-value.negative {
  color: var(--color-weight-loss);
}

.weight-day-stat .stat-value.positive {
  color: var(--color-weight-gain);
}

/* Weather Insights Styles */
.weather-insights-section {
  margin: 20px 0;
  padding: 0;
}

.weather-insight-card {
  background: var(--color-brand-gradient);
  border-radius: 12px;
  padding: 16px 20px;
  color: white;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(10px);
}

.weather-insight-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.weather-insight-card.cached::after {
  content: "📱";
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 12px;
  opacity: 0.6;
}

.weather-insight-card {
  position: relative;
}

.weather-insight-icon {
  font-size: 32px;
  min-width: 40px;
  text-align: center;
}

.weather-insight-content {
  flex: 1;
}

.weather-insight-content h4 {
  margin: 0 0 5px 0;
  font-size: 16px;
  font-weight: 600;
  opacity: 0.9;
}

.weather-insight-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0.95;
}

.weather-insight-temp {
  font-size: 24px;
  font-weight: 700;
  min-width: 50px;
  text-align: center;
  opacity: 0.9;
}

/* Responsive weather insights */
@media (max-width: 768px) {
  .weather-insight-card {
    padding: 14px 16px;
    gap: 12px;
  }

  .weather-insight-icon {
    font-size: 28px;
    min-width: 35px;
  }

  .weather-insight-content h4 {
    font-size: 15px;
  }

  .weather-insight-content p {
    font-size: 13px;
  }

  .weather-insight-temp {
    font-size: 20px;
    min-width: 45px;
  }
}

/* Reset Password Modal Styles */
.reset-password-modal {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
}

.reset-success {
  background: var(--color-success-light);
  border: 1px solid var(--color-success-light);
  color: var(--color-success-dark);
  padding: 12px;
  border-radius: 8px;
  margin-top: 15px;
  text-align: center;
}

/* Responsive Diet Section */
@media (max-width: 768px) {
  .diet-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .diet-date-selector {
    flex-direction: column;
    align-items: stretch;
  }

  .diet-date-selector input,
  #diet-today-btn {
    width: 100%;
  }

  .meals-container {
    grid-template-columns: 1fr;
  }

  .daily-stats {
    flex-direction: column;
    gap: 15px;
  }

  .meal-modal {
    width: 95%;
    margin: 20px;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions button {
    width: 100%;
  }
}

/* Alternative Styles */
.selected-alternative {
  margin-bottom: 20px;
  padding: 15px;
  background: linear-gradient(135deg, var(--color-success-light), var(--color-success-light));
  border-radius: 12px;
  border: 2px solid var(--color-success-dark);
}

.selected-alternative h4 {
  color: var(--color-success-dark);
  margin-bottom: 10px;
  font-size: 0.9rem;
  text-align: center;
}

.meal-item.selected {
  background: white;
  border: 2px solid var(--color-success-dark);
  box-shadow: 0 4px 12px rgba(56, 161, 105, 0.2);
}

.alternatives-section h4 {
  color: var(--color-gray-700);
  margin-bottom: 15px;
  font-size: 0.9rem;
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-gray-200);
}

.alternatives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.alternative-item {
  background: var(--color-gray-50);
  border: 1px solid var(--color-gray-200);
  border-radius: 8px;
  padding: 12px;
  position: relative;
  transition: all 0.3s;
}

.alternative-item:hover {
  border-color: var(--color-gray-300);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.alternative-item.selected {
  background: #e6fffa;
  border-color: var(--color-success-dark);
}

.alternative-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
}

.alternative-item h5 {
  color: var(--color-gray-900);
  margin-bottom: 6px;
  font-size: 0.9rem;
  margin-right: 80px;
  /* Spazio per i pulsanti */
}

.alternative-item p {
  color: var(--color-gray-500);
  font-size: 0.8rem;
  margin-bottom: 6px;
  line-height: 1.3;
}

.select-btn {
  color: var(--color-success-dark);
  font-size: 16px;
}

.select-btn:hover {
  background: #e6fffa;
}

/* Responsive alternatives */
@media (max-width: 768px) {
  .alternatives-grid {
    grid-template-columns: 1fr;
  }

  .alternative-item h5 {
    margin-right: 60px;
    font-size: 0.85rem;
  }

  .alternative-actions {
    flex-direction: column;
    gap: 2px;
  }

  .meal-action-btn {
    font-size: 14px;
    padding: 2px;
  }
}

/*
 Food Groups Styles */
.box-selector {
  margin-bottom: 15px;
}

.box-selector label {
  display: block;
  margin-bottom: 5px;
  color: var(--color-gray-700);
  font-weight: 500;
  font-size: 14px;
}

.box-selector input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--color-gray-200);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s;
  margin-bottom: 5px;
}

.box-selector input:focus {
  outline: none;
  border-color: var(--color-primary-500);
}

.box-selector small {
  color: var(--color-gray-500);
  font-size: 12px;
  font-style: italic;
}

.box-section {
  margin-bottom: 25px;
  padding: 15px;
  background: var(--color-gray-50);
  border-radius: 12px;
  border: 1px solid var(--color-gray-200);
}

.box-section h4 {
  color: var(--color-gray-700);
  margin-bottom: 15px;
  font-size: 1rem;
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-gray-200);
}

.selected-alternatives {
  margin-bottom: 20px;
  padding: 15px;
  background: linear-gradient(135deg, var(--color-success-light), var(--color-success-light));
  border-radius: 12px;
  border: 2px solid var(--color-success-dark);
}

.selected-alternatives h4 {
  color: var(--color-success-dark);
  margin-bottom: 15px;
  font-size: 1rem;
  text-align: center;
}

.selected-group {
  margin-bottom: 15px;
}

.selected-group:last-child {
  margin-bottom: 0;
}

.selected-group h5 {
  color: var(--color-success-dark);
  font-size: 0.9rem;
  margin-bottom: 8px;
  font-weight: 600;
}

.selected-group .meal-item {
  background: white;
  border: 2px solid var(--color-success-dark);
  box-shadow: 0 2px 8px rgba(56, 161, 105, 0.2);
}

.selected-group h6 {
  color: var(--color-gray-900);
  margin-bottom: 5px;
  font-size: 0.9rem;
  margin-right: 60px;
}

.box-badge {
  display: inline-block;
  background: var(--color-brand-gradient);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
  margin-bottom: 5px;
}

/* Responsive boxes */
@media (max-width: 768px) {
  .box-section {
    padding: 12px;
  }

  .selected-alternatives {
    padding: 12px;
  }

  .selected-group h6 {
    margin-right: 50px;
    font-size: 0.85rem;
  }
}

/* Food Diary Message Modal */
.message-modal {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 48px;
  text-align: center;
  max-width: 440px;
  animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.3),
    0 10px 30px rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

.message-modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-brand-gradient-90);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
  border-radius: 24px 24px 0 0;
}

.message-modal-icon {
  font-size: 72px;
  margin-bottom: 24px;
  animation: bounce 0.6s ease-out;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.message-modal-text {
  font-size: 18px;
  color: var(--color-gray-900);
  margin-bottom: 32px;
  line-height: 1.6;
  font-weight: 500;
}

.message-modal-btn {
  background: var(--color-brand-gradient);
  color: white;
  border: none;
  padding: 14px 48px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
  position: relative;
  overflow: hidden;
}

.message-modal-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.message-modal-btn:hover::before {
  left: 100%;
}

.message-modal-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.message-modal-btn:active {
  transform: translateY(-1px);
}

/* Confirm Delete Modal */
.confirm-modal {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 48px;
  text-align: center;
  max-width: 480px;
  animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.3),
    0 10px 30px rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

.confirm-modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-brand-gradient-90);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
  border-radius: 24px 24px 0 0;
}

.confirm-modal-icon {
  font-size: 72px;
  margin-bottom: 24px;
  animation: shake 0.5s ease-in-out;
}

.confirm-modal-title {
  font-size: 26px;
  color: var(--color-gray-900);
  margin-bottom: 16px;
  font-weight: 700;
}

.confirm-modal-text {
  font-size: 16px;
  color: var(--color-gray-500);
  margin-bottom: 32px;
  line-height: 1.6;
  font-weight: 500;
}

.confirm-modal-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.confirm-modal-cancel {
  background: var(--color-gray-200);
  color: var(--color-gray-700);
  border: 2px solid var(--color-gray-300);
  padding: 14px 36px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-modal-cancel:hover {
  background: var(--color-gray-300);
  border-color: var(--color-gray-400);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.confirm-modal-cancel:active {
  transform: translateY(-1px);
}

.confirm-modal-confirm {
  background: linear-gradient(
    135deg,
    var(--color-error) 0%,
    var(--color-error) 100%
  );
  color: white;
  border: none;
  padding: 14px 36px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(245, 101, 101, 0.4);
  position: relative;
  overflow: hidden;
}

.confirm-modal-confirm::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.confirm-modal-confirm:hover::before {
  left: 100%;
}

.confirm-modal-confirm:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(245, 101, 101, 0.5);
}

.confirm-modal-confirm:active {
  transform: translateY(-1px);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Food Diary Styles */
.food-diary-section {
  margin-top: 20px;
}

.food-diary-entry {
  background: white;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--color-gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.food-diary-entry:hover {
  border-color: var(--color-gray-300);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.food-diary-entry-name {
  font-weight: 600;
  color: var(--color-gray-900);
  margin-bottom: 4px;
}

.food-diary-entry-details {
  font-size: 0.85rem;
  color: var(--color-gray-500);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.food-diary-entry-actions {
  display: flex;
  gap: 8px;
}

.food-diary-edit-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.food-diary-edit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.food-diary-delete-btn {
  background: linear-gradient(135deg, var(--color-error) 0%, #dc2626 100%);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.food-diary-delete-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Ingredients Table Styles */
.ingredients-section {
  margin-bottom: 20px;
}

.ingredients-section label {
  display: block;
  margin-bottom: 10px;
  color: var(--color-gray-700);
  font-weight: 500;
  font-size: 14px;
}

.ingredients-table {
  border: 2px solid var(--color-gray-200);
  border-radius: 8px;
  padding: 15px;
  background: var(--color-gray-50);
  margin-bottom: 10px;
}

.ingredient-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.ingredient-row:last-child {
  margin-bottom: 0;
}

.ingredient-name,
.ingredient-amount {
  padding: 8px 12px;
  border: 1px solid var(--color-gray-300);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.ingredient-name:focus,
.ingredient-amount:focus {
  outline: none;
  border-color: var(--color-primary-500);
}

.remove-ingredient {
  background: var(--color-error);
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.remove-ingredient:hover {
  background: var(--color-error-dark);
}

.add-ingredient-btn {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, var(--color-success-dark), var(--color-success-dark));
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.add-ingredient-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56, 161, 105, 0.3);
}

/* Ingredients Display in Alternatives */
.ingredients-list {
  margin: 10px 0;
  padding: 10px;
  background: #f0f4f8;
  border-radius: 6px;
  border-left: 3px solid var(--color-primary-500);
}

.ingredient-item {
  font-size: 0.85rem;
  color: var(--color-gray-700);
  margin-bottom: 3px;
  padding: 2px 0;
}

.ingredient-item:last-child {
  margin-bottom: 0;
}

/* Responsive ingredients */
@media (max-width: 768px) {
  .ingredient-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .remove-ingredient {
    justify-self: end;
    width: 25px;
    height: 25px;
    font-size: 14px;
  }

  .ingredients-table {
    padding: 10px;
  }
}

/* Medicine Section Styles */

.medicine-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.medicine-toggle-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--color-primary-500), #5a67d8);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.medicine-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.medicine-date-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  align-items: center;
}

.medicine-date-selector input {
  padding: 10px;
  border: 2px solid var(--color-gray-200);
  border-radius: 8px;
  font-size: 14px;
}

#medicine-today-btn {
  padding: 10px 15px;
  background: #8b5cf6;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

#medicine-today-btn:hover {
  background: #7c3aed;
  transform: translateY(-1px);
}

.medicines-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 25px;
}

.medicine-card {
  background: linear-gradient(135deg, #faf5ff, #f3e8ff);
  border: 2px solid #e9d5ff;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s;
}

.medicine-card:hover {
  border-color: #c4b5fd;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.medicine-card h3 {
  color: #6b46c1;
  margin-bottom: 15px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.medicine-content-area {
  min-height: 60px;
  margin-bottom: 15px;
}

.no-medicine {
  color: var(--color-gray-400);
  font-style: italic;
  text-align: center;
  padding: 20px;
}

.medicine-item {
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  position: relative;
  border-left: 4px solid #8b5cf6;
}

.medicine-item.scheduled {
  border-left-color: #10b981;
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
}

.medicine-item.notifications-enabled {
  border-left-color: var(--color-accent-500);
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.medicine-item.scheduled.notifications-enabled {
  border-left: 4px solid;
  border-image: linear-gradient(45deg, #10b981, var(--color-accent-500)) 1;
  background: linear-gradient(135deg, #f0fdf4, #fffbeb);
}

.scheduled-indicator,
.notification-indicator {
  display: inline-block;
  font-size: 0.9rem;
  margin-left: 8px;
  opacity: 0.8;
}

.medicine-item h4 {
  color: var(--color-gray-900);
  margin-bottom: 8px;
  font-size: 1rem;
  font-weight: 600;
}

.medicine-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.medicine-detail {
  font-size: 0.85rem;
  color: var(--color-gray-700);
}

.medicine-detail strong {
  color: var(--color-gray-900);
  font-weight: 600;
}

.medicine-time {
  color: #8b5cf6;
  font-weight: bold;
  font-size: 1rem;
}

.medicine-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 5px;
}

.medicine-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 14px;
  transition: background-color 0.2s;
}

.medicine-action-btn:hover {
  background: var(--color-gray-50);
}

.edit-medicine-btn {
  color: var(--color-info);
}

.delete-medicine-btn {
  color: var(--color-error);
}

.add-medicine-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
  font-weight: 500;
}

.add-medicine-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Medicine Modal */
.medicine-modal {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.3),
    0 10px 30px rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.medicine-modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-brand-gradient-90);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
  border-radius: 20px 20px 0 0;
}

.medicine-modal .modal-content input,
.medicine-modal .modal-content textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--color-gray-200);
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 15px;
  transition: border-color 0.3s;
}

.medicine-modal .modal-content input:focus,
.medicine-modal .modal-content textarea:focus,
.medicine-modal .modal-content select:focus {
  outline: none;
  border-color: #8b5cf6;
}

.schedule-section {
  margin-bottom: 15px;
}

.schedule-section label {
  display: block;
  margin-bottom: 5px;
  color: var(--color-gray-700);
  font-weight: 500;
  font-size: 14px;
}

.schedule-section select {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--color-gray-200);
  border-radius: 8px;
  font-size: 14px;
  background: white;
  transition: border-color 0.3s;
  margin-bottom: 10px;
}

.custom-days-input {
  margin-top: 10px;
}

.custom-days-input label {
  font-size: 13px;
  margin-bottom: 5px;
}

.custom-days-input input {
  width: 80px;
  padding: 8px;
  border: 2px solid var(--color-gray-200);
  border-radius: 6px;
  font-size: 14px;
}

/* Notification Section */
.notification-section {
  margin-bottom: 15px;
  padding: 15px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid var(--color-accent-500);
  border-radius: 8px;
}

.notification-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #92400e;
  margin-bottom: 8px;
}

.notification-checkbox input[type="checkbox"] {
  margin-right: 10px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.notification-hint {
  font-size: 12px;
  color: #b45309;
  margin: 0 0 10px 0;
  font-style: italic;
}

/* Responsive per mobile */
@media (max-width: 768px) {
  .notification-section {
    padding: 12px;
  }

  .notification-checkbox {
    font-size: 13px;
    margin-bottom: 10px;
  }

  .notification-hint {
    font-size: 11px;
    margin-bottom: 12px;
  }
}

/* Responsive Medicine Section */
@media (max-width: 768px) {
  .medicine-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .medicine-date-selector {
    flex-direction: column;
    align-items: stretch;
  }

  .medicine-date-selector input,
  #medicine-today-btn {
    width: 100%;
  }

  .medicine-details {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .medicine-actions {
    position: relative;
    top: 0;
    right: 0;
    justify-content: center;
    margin-top: 10px;
  }
}

/* Delete Scheduled Medicine Modal */
.delete-scheduled-modal {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  width: 90%;
  max-width: 470px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.3),
    0 10px 30px rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.delete-scheduled-modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-brand-gradient-90);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
  border-radius: 20px 20px 0 0;
}

.delete-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.delete-option-btn {
  padding: 18px 24px;
  border: 2px solid var(--color-gray-200);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.delete-option-btn:hover {
  border-color: var(--color-gray-300);
  background: rgba(247, 250, 252, 0.95);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.delete-single {
  border-color: var(--color-accent-500);
  color: #92400e;
}

.delete-single:hover {
  border-color: #d97706;
  background: #fef3c7;
}

.delete-all {
  border-color: var(--color-error);
  color: #991b1b;
}

.delete-all:hover {
  border-color: #dc2626;
  background: #fef2f2;
}

/* Responsive Delete Modal */
@media (max-width: 768px) {
  .delete-scheduled-modal {
    width: 95%;
    margin: 20px;
  }

  .delete-option-btn {
    padding: 12px 15px;
    font-size: 13px;
  }
}

/* Glucose Section Styles */
.glucose-section {
  margin-top: 20px;
}

.glucose-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
}

.glucose-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
}

.glucose-toggle-btn {
  background: var(--color-primary-500);
  color: white;
  border: 1px solid var(--color-primary-500);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.glucose-toggle-btn:hover {
  background: var(--color-primary-600);
  border-color: var(--color-primary-600);
  transform: translateY(-1px);
}

.glucose-input-section {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.glucose-input-section h3 {
  color: var(--color-gray-900);
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.glucose-input-form {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.glucose-input-form input {
  padding: 12px;
  border: 2px solid var(--color-gray-200);
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.glucose-input-form input:focus {
  outline: none;
  border-color: var(--color-error);
}

.glucose-input-form input[type="date"] {
  min-width: 150px;
}

.glucose-input-form input[type="number"] {
  min-width: 180px;
}

#add-glucose-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--color-error), var(--color-error));
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s;
  white-space: nowrap;
}

#add-glucose-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3);
}

.glucose-insights {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.glucose-insights h3 {
  color: var(--color-gray-900);
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.glucose-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.glucose-stats-grid .stat-card {
  background: var(--color-gray-50);
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  border: 2px solid var(--color-gray-200);
}

.glucose-stats-grid .stat-card h4 {
  color: var(--color-gray-700);
  font-size: 14px;
  margin-bottom: 8px;
  font-weight: 600;
}

.glucose-stats-grid .stat-card span {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--color-gray-900);
  margin-bottom: 5px;
}

.glucose-category {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

.glucose-category.normal {
  background: var(--color-success-light);
  color: var(--color-success-dark);
}

.glucose-category.prediabetes {
  background: #fef5e7;
  color: #c05621;
}

.glucose-category.diabetes {
  background: var(--color-error-light);
  color: var(--color-error-dark);
}

.glucose-chart-section {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.glucose-chart-section h3 {
  color: var(--color-gray-900);
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.glucose-history-section {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.glucose-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.glucose-history-header h3 {
  color: var(--color-gray-900);
  font-size: 1.2rem;
}

.glucose-history-toggle-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--color-error), var(--color-error));
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
  font-weight: 600;
}

.glucose-history-toggle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(245, 101, 101, 0.3);
}

.glucose-history-list {
  max-height: 400px;
  overflow-y: auto;
}

.glucose-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--color-gray-200);
  transition: background-color 0.2s;
}

.glucose-entry:hover {
  background-color: var(--color-gray-50);
}

.glucose-entry:last-child {
  border-bottom: none;
}

.glucose-entry-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.glucose-entry-date {
  font-weight: 600;
  color: var(--color-gray-900);
}

.glucose-entry-value {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--color-error);
}

.glucose-entry-category {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  text-transform: uppercase;
}

.glucose-entry-actions {
  display: flex;
  gap: 8px;
}

.glucose-entry-actions button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
}

.delete-glucose-btn {
  background: var(--color-error-light);
  color: var(--color-error-dark);
}

.delete-glucose-btn:hover {
  background: #feb2b2;
}

/* Responsive Glucose Section */
@media (max-width: 768px) {
  .glucose-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .glucose-input-form {
    flex-direction: column;
    align-items: stretch;
  }

  .glucose-input-form input,
  #add-glucose-btn {
    width: 100%;
  }

  .glucose-stats-grid {
    grid-template-columns: 1fr;
  }

  .glucose-history-header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .glucose-entry {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .glucose-entry-actions {
    align-self: flex-end;
  }
}

/* Height
 Indicator Styles */

/* Health Indicators Container */
.health-indicators {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: stretch;
  width: 100%;
}

.height-indicator {
  background: linear-gradient(135deg, #f0f4f8, var(--color-gray-200));
  border: 2px solid var(--color-gray-300);
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 140px;
  flex: 1.3;
  position: relative;
}

.height-indicator:hover {
  background: linear-gradient(
    135deg,
    var(--color-gray-200),
    var(--color-gray-300)
  );
  border-color: var(--color-gray-400);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.height-label {
  font-size: 0.8rem;
  color: var(--color-gray-700);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.height-value {
  font-size: 1.7rem;
  font-weight: bold;
  color: var(--color-gray-900);
  margin-bottom: 4px;
}

.height-hint {
  font-size: 0.7rem;
  color: var(--color-gray-500);
  font-style: italic;
  opacity: 0.8;
}

.height-indicator:hover .height-hint {
  opacity: 1;
  color: var(--color-gray-700);
}

/* Height set indicator */
.height-indicator.has-height {
  background: linear-gradient(135deg, var(--color-success-light), var(--color-success-light));
  border-color: var(--color-success-dark);
}

.height-indicator.has-height .height-value {
  color: var(--color-success-dark);
}

.height-indicator.has-height .height-label {
  color: var(--color-success-dark);
}

/* BMI Indicator Styles */
.bmi-indicator {
  background: linear-gradient(135deg, #fef5e7, #fed7aa);
  border: 2px solid #f6ad55;
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  transition: all 0.3s ease;
  min-width: 120px;
  flex: 1.1;
  position: relative;
}

.bmi-label {
  font-size: 0.8rem;
  color: #c05621;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.bmi-value {
  font-size: 1.7rem;
  font-weight: bold;
  color: #9c4221;
  margin-bottom: 2px;
}

.bmi-category {
  font-size: 0.7rem;
  color: #c05621;
  font-weight: 500;
  font-style: italic;
}

/* BMI Category Colors */
.bmi-indicator.underweight {
  background: linear-gradient(135deg, #e6fffa, #b2f5ea);
  border-color: #38b2ac;
}

.bmi-indicator.underweight .bmi-label,
.bmi-indicator.underweight .bmi-category {
  color: #234e52;
}

.bmi-indicator.underweight .bmi-value {
  color: #285e61;
}

.bmi-indicator.normal {
  background: linear-gradient(
    135deg,
    var(--color-success-light),
    var(--color-success-light)
  );
  border-color: var(--color-success-dark);
}

.bmi-indicator.normal .bmi-label,
.bmi-indicator.normal .bmi-category {
  color: var(--color-success-dark);
}

.bmi-indicator.normal .bmi-value {
  color: var(--color-success-dark);
}

.bmi-indicator.overweight {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-color: var(--color-accent-500);
}

.bmi-indicator.overweight .bmi-label,
.bmi-indicator.overweight .bmi-category {
  color: #92400e;
}

.bmi-indicator.overweight .bmi-value {
  color: #b45309;
}

.bmi-indicator.obese {
  background: linear-gradient(135deg, #fef2f2, #fecaca);
  border-color: var(--color-error);
}

.bmi-indicator.obese .bmi-label,
.bmi-indicator.obese .bmi-category {
  color: #991b1b;
}

.bmi-indicator.obese .bmi-value {
  color: #dc2626;
}

/* Ideal Weight Indicator Styles */
.ideal-weight-indicator {
  background: linear-gradient(135deg, #e6fffa, #b2f5ea);
  border: 2px solid #38b2ac;
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  transition: all 0.3s ease;
  min-width: 180px;
  flex: 1.8;
  position: relative;
}

.ideal-weight-label {
  font-size: 0.8rem;
  color: #234e52;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.ideal-weight-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #285e61;
  margin-bottom: 2px;
  line-height: 1.2;
}

.ideal-weight-hint {
  font-size: 0.7rem;
  color: #234e52;
  font-weight: 500;
  font-style: italic;
}

/* Target Weight Indicator Styles */
.target-weight-indicator {
  background: linear-gradient(135deg, #fef2f2, #fecaca);
  border: 2px solid var(--color-error);
  border-radius: 12px;
  padding: 20px 18px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 170px;
  flex: 1.7;
  position: relative;
}

.target-weight-indicator:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--color-error-light), #feb2b2);
  border-color: var(--color-error);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.target-weight-label {
  font-size: 0.8rem;
  color: var(--color-error-dark);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.target-weight-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #9b2c2c;
  margin-bottom: 2px;
  line-height: 1.2;
}

.target-weight-hint {
  font-size: 0.7rem;
  color: var(--color-error-dark);
  font-weight: 500;
  font-style: italic;
}

/* Target weight set indicator */
.target-weight-indicator.has-target {
  background: linear-gradient(
    135deg,
    var(--color-success-light),
    var(--color-success-light)
  );
  border-color: var(--color-success-dark);
}

.target-weight-indicator.has-target .target-weight-label,
.target-weight-indicator.has-target .target-weight-hint {
  color: var(--color-success-dark);
}

.target-weight-indicator.has-target .target-weight-value {
  color: var(--color-success-dark);
}

/* Responsive health indicators */
@media (max-width: 768px) {
  .input-form-container {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .input-form-right {
    justify-content: stretch;
    margin-top: 0;
  }

  .health-indicators {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    justify-content: center;
    align-items: stretch;
    margin: 0 auto;
    max-width: 100%;
  }

  .height-indicator,
  .bmi-indicator,
  .ideal-weight-indicator,
  .target-weight-indicator {
    min-width: 0;
    padding: 14px 10px;
    border-radius: 10px;
    width: 100%;
  }

  .height-value,
  .bmi-value,
  .ideal-weight-value,
  .target-weight-value {
    font-size: 0.9rem;
    margin-bottom: 2px;
  }

  .height-label,
  .bmi-label,
  .ideal-weight-label,
  .target-weight-label {
    font-size: 0.6rem;
    margin-bottom: 3px;
    letter-spacing: 0.3px;
  }

  .height-hint,
  .bmi-category,
  .ideal-weight-hint,
  .target-weight-hint {
    font-size: 0.5rem;
    line-height: 1.2;
  }
}

/* === STILI PER LA SEZIONE GLICEMIA === */

.glucose-checker-section {
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.glucose-checker-form {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  align-items: center;
}

.glucose-checker-form input {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--color-gray-200);
  border-radius: 8px;
  font-size: 16px;
}

.glucose-checker-form button {
  padding: 12px 24px;
  background: var(--color-primary-500);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

.glucose-checker-form button:hover {
  background: #5a67d8;
}

.glucose-result {
  margin: 20px 0;
  padding: 20px;
  border-radius: 12px;
  border-left: 5px solid;
  animation: slideIn 0.3s ease-out;
}

.glucose-result.normal {
  background: var(--color-success-light);
  border-color: var(--color-success-dark);
  color: var(--color-gray-900);
}

.glucose-result.prediabetes {
  background: #fffbf0;
  border-color: var(--color-accent-500);
  color: var(--color-gray-900);
}

.glucose-result.diabetes {
  background: var(--color-error-light);
  border-color: var(--color-error);
  color: var(--color-gray-900);
}

.glucose-result.low {
  background: #ebf8ff;
  border-color: var(--color-info);
  color: var(--color-gray-900);
}

.glucose-result-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.glucose-result-header {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 24px;
  font-weight: bold;
}

.glucose-result-value {
  font-size: 32px;
}

.glucose-result-unit {
  font-size: 18px;
  opacity: 0.7;
}

.glucose-result-category {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 5px;
}

.glucose-result-description {
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.glucose-result-advice {
  font-size: 14px;
  font-style: italic;
  opacity: 0.8;
}

.glucose-ranges-info {
  margin-top: 30px;
  padding: 20px;
  background: var(--color-gray-50);
  border-radius: 8px;
}

.glucose-ranges-info h4 {
  margin: 0 0 15px 0;
  color: var(--color-gray-900);
  font-size: 18px;
}

.glucose-ranges {
  display: grid;
  gap: 10px;
  margin-bottom: 15px;
}

.glucose-range {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  border-radius: 8px;
  border-left: 4px solid;
}

.glucose-range.normal {
  background: var(--color-success-light);
  border-color: var(--color-success-dark);
}

.glucose-range.prediabetes {
  background: #fffbf0;
  border-color: var(--color-accent-500);
}

.glucose-range.diabetes {
  background: var(--color-error-light);
  border-color: var(--color-error);
}

.range-label {
  font-weight: 600;
  color: var(--color-gray-900);
}

.range-values {
  font-family: monospace;
  font-weight: bold;
  color: var(--color-gray-700);
}

.glucose-disclaimer {
  font-size: 12px;
  color: var(--color-gray-500);
  font-style: italic;
  margin: 0;
  text-align: center;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .glucose-checker-form {
    flex-direction: column;
  }

  .glucose-checker-form input,
  .glucose-checker-form button {
    width: 100%;
  }

  .glucose-result-header {
    font-size: 20px;
  }

  .glucose-result-value {
    font-size: 28px;
  }
}

/* Advanced Insights Section */
.advanced-insights-section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 32px;
  border-radius: 20px;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.12),
    0 4px 16px rgba(102, 126, 234, 0.08);
  margin-bottom: 30px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

.advanced-insights-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-brand-gradient-90);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
  border-radius: 20px 20px 0 0;
}

.advanced-insights-section h2 {
  color: var(--color-gray-900);
  margin-bottom: 24px;
  font-size: 1.6rem;
  font-weight: 700;
}

/* Preserva le emoji nei titoli */
.advanced-insights-section h2::first-letter {
  color: initial;
}

.advanced-insights-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.insight-card {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(247, 250, 252, 0.95)
  );
  backdrop-filter: blur(10px);
  padding: 24px;
  border-radius: 16px;
  border-left: 5px solid var(--color-primary-500);
  display: flex;
  align-items: flex-start;
  gap: 18px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
}

.insight-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: inherit;
  filter: brightness(1.2);
}

.insight-card:hover {
  transform: translateY(-4px) translateX(4px);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
  border-left-width: 6px;
}

.insight-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
  background: rgba(102, 126, 234, 0.1);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  transition: all 0.3s ease;
}

.insight-card:hover .insight-icon {
  transform: scale(1.1) rotate(5deg);
  background: rgba(102, 126, 234, 0.15);
}

.insight-content {
  flex: 1;
}

.insight-title {
  font-size: 0.75rem;
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 8px;
  font-weight: 700;
}

.insight-value {
  font-size: 1.15rem;
  color: var(--color-gray-900);
  font-weight: 600;
  line-height: 1.6;
}

.insight-card.weekly {
  border-left-color: #4299e1;
}

.insight-card.weekly .insight-icon {
  background: rgba(66, 153, 225, 0.1);
}

.insight-card.weekly:hover .insight-icon {
  background: rgba(66, 153, 225, 0.15);
}

.insight-card.pattern {
  border-left-color: #9f7aea;
}

.insight-card.pattern .insight-icon {
  background: rgba(159, 122, 234, 0.1);
}

.insight-card.pattern:hover .insight-icon {
  background: rgba(159, 122, 234, 0.15);
}

.insight-card.prediction {
  border-left-color: var(--color-success);
}

.insight-card.prediction .insight-icon {
  background: rgba(72, 187, 120, 0.1);
}

.insight-card.prediction:hover .insight-icon {
  background: rgba(72, 187, 120, 0.15);
}

.insight-card.alert {
  border-left-color: var(--color-accent-500);
}

.insight-card.alert .insight-icon {
  background: rgba(245, 158, 11, 0.1);
}

.insight-card.alert:hover .insight-icon {
  background: rgba(245, 158, 11, 0.15);
}

.insight-card.trend {
  border-left-color: #8b5cf6;
}

.insight-card.trend .insight-icon {
  background: rgba(139, 92, 246, 0.1);
}

.insight-card.trend:hover .insight-icon {
  background: rgba(139, 92, 246, 0.15);
}

.insight-card.volatility {
  border-left-color: #ec4899;
}

.insight-card.volatility .insight-icon {
  background: rgba(236, 72, 153, 0.1);
}

.insight-card.volatility:hover .insight-icon {
  background: rgba(236, 72, 153, 0.15);
}

/* ============================================
   TAB NAVIGATION STYLES
   ============================================ */

.app-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  background: white;
  border-radius: 15px;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
  flex-wrap: nowrap;
}

/* Navigazione tab in fondo */
.app-tabs-bottom {
  margin-top: 30px;
  margin-bottom: 0;
}

.app-tab {
  flex: 1;
  min-width: 120px;
  padding: 12px 20px;
  background: var(--color-gray-50);
  border: 2px solid var(--color-gray-200);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-gray-700);
  transition: all 0.3s ease;
  text-align: center;
  white-space: nowrap;
}

.app-tab:hover {
  background: var(--color-gray-100);
  border-color: var(--color-gray-300);
  transform: translateY(-2px);
}

.app-tab.active {
  background: var(--color-brand-gradient);
  color: white;
  border-color: var(--color-primary-500);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Responsive tabs */
@media (max-width: 768px) {
  .app-tabs {
    flex-wrap: wrap;
    gap: 8px;
  }

  .app-tab {
    flex: 1 1 calc(50% - 4px);
    min-width: auto;
    padding: 10px 15px;
    font-size: 13px;
  }
}

/* 
Modal per dettaglio passi settimanali */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: var(--z-overlay);
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--color-gray-200);
}

.modal-header h3 {
  margin: 0;
  color: var(--color-gray-900);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--color-gray-500);
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.modal-close:hover {
  background-color: var(--color-gray-50);
}

.modal-body {
  padding: 20px;
}

/* Stili per il dettaglio settimanale */
.weekly-summary {
  background: var(--color-gray-50);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.weekly-summary h4 {
  margin: 0 0 10px 0;
  color: var(--color-gray-900);
}

.weekly-summary p {
  margin: 5px 0;
  color: var(--color-gray-700);
}

.weekly-days-detail h4 {
  margin: 0 0 15px 0;
  color: var(--color-gray-900);
}

.day-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  border: 1px solid var(--color-gray-200);
  transition: background-color 0.2s;
}

.day-detail:hover {
  background-color: var(--color-gray-50);
}

.day-detail.today {
  border-color: #4299e1;
  background-color: #ebf8ff;
}

.day-detail.completed {
  border-color: var(--color-success);
  background-color: var(--color-success-light);
}

.day-detail.partial {
  border-color: var(--color-accent-500);
  background-color: #fffaf0;
}

.day-detail.no-data {
  border-color: var(--color-error);
  background-color: var(--color-error-light);
}

.day-detail.future {
  border-color: var(--color-gray-300);
  background-color: var(--color-gray-50);
  opacity: 0.7;
}

.day-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
}

.day-name {
  font-weight: 600;
  color: var(--color-gray-900);
  text-transform: capitalize;
}

.today-badge {
  background: #4299e1;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-top: 2px;
}

.day-steps {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.steps-count {
  font-weight: 600;
  color: var(--color-gray-900);
  font-size: 16px;
}

.steps-goal {
  color: var(--color-gray-500);
  font-size: 12px;
}

.day-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 80px;
}

.status-icon {
  font-size: 20px;
  margin-bottom: 2px;
}

.status-text {
  font-size: 12px;
  color: var(--color-gray-700);
  text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 10px;
  }

  .day-detail {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  .day-info,
  .day-steps,
  .day-status {
    flex: none;
  }
}

/* Cursor pointer per la sezione weekly progress */
.steps-weekly-progress-section {
  transition: background-color 0.2s;
}

.steps-weekly-progress-section:hover {
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
}
/* Stil
i per i gruppi di input data con pulsante "Oggi" */
.date-input-group {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.date-input-group input[type="date"] {
  flex: 1;
  min-width: 150px;
}

/* Stili per tutti i pulsanti "Oggi" */
.today-btn,
#weight-today-btn,
#sleep-today-btn,
#sleep-times-today-btn,
#steps-today-btn,
#calories-today-btn {
  padding: 10px 15px;
  background: var(--color-primary-500);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
  white-space: nowrap;
}

.today-btn:hover,
#weight-today-btn:hover,
#sleep-today-btn:hover,
#sleep-times-today-btn:hover,
#steps-today-btn:hover,
#calories-today-btn:hover {
  background: #5a67d8;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Responsive per i gruppi di input data */
@media (max-width: 768px) {
  .date-input-group {
    flex-direction: column;
    align-items: stretch;
  }

  .date-input-group input[type="date"],
  .today-btn {
    width: 100%;
  }
}

/* ==========================================
   PERSONALIZZA VISTA - SEZIONI PESO
   ========================================== */

/* Container del bottone personalizza vista */
.customize-view-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  position: relative;
  z-index: var(--z-sticky);
}

/* Bottone personalizza vista */
.customize-view-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--color-brand-gradient);
  position: relative;
  z-index: var(--z-sticky);
  -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
  touch-action: manipulation;
  min-height: 48px; /* Touch target minimo raccomandato */
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.customize-view-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.customize-view-btn:active {
  transform: translateY(0);
}

.customize-icon {
  font-size: 16px;
}

/* ===================================
   MODAL - Weight Sections Preferences
   =================================== */

/* MODAL OVERLAY */
.weight-sections-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-tooltip);
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(5px);
}

.weight-sections-modal-overlay.show {
  display: flex;
  opacity: 1;
}

/* MODAL CONTENT */
.weight-sections-modal {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

/* MODAL HEADER */
.weight-sections-modal-header {
  background: var(--color-brand-gradient);
  color: white;
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.weight-sections-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.weight-sections-close-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.weight-sections-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.weight-sections-close-btn svg {
  width: 18px;
  height: 18px;
}

/* MODAL BODY */
.weight-sections-modal-body {
  padding: 20px 25px;
  overflow-y: auto;
  flex: 1;
}

.weight-sections-drag-hint {
  margin: 0 0 15px 0;
  padding: 10px 15px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 8px;
  font-size: 13px;
  color: var(--color-primary-500);
  text-align: center;
  border-left: 3px solid var(--color-primary-500);
}

.weight-sections-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.weight-sections-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  cursor: grab;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: var(--color-gray-50);
  border: 2px solid transparent;
  user-select: none;
}

.weight-sections-option:hover {
  background: var(--color-gray-200);
  border-color: var(--color-primary-500);
}

.weight-sections-option:active {
  cursor: grabbing;
}

.weight-sections-option.dragging {
  opacity: 0.5;
  background: var(--color-gray-200);
  border: 2px dashed var(--color-primary-500);
}

.weight-sections-option.drag-over {
  border-color: var(--color-primary-500);
  background: rgba(102, 126, 234, 0.1);
  transform: scale(1.02);
}

.weight-sections-drag-handle {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  cursor: grab;
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.weight-sections-drag-handle:hover {
  opacity: 0.8;
}

.weight-sections-drag-handle span {
  display: block;
  width: 18px;
  height: 2px;
  background: #666;
  border-radius: 1px;
}

.weight-sections-option:active .weight-sections-drag-handle {
  cursor: grabbing;
}

.weight-sections-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--color-primary-500);
  flex-shrink: 0;
}

.weight-sections-option-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.weight-sections-option-name {
  flex: 1;
  font-size: 15px;
  color: #333;
  font-weight: 500;
}

/* MODAL FOOTER */
.weight-sections-modal-footer {
  padding: 20px 25px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  flex-shrink: 0;
}

.weight-sections-modal-btn {
  flex: 1;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.weight-sections-select-all-btn {
  background: white;
  color: var(--color-primary-500);
  border: 2px solid var(--color-primary-500);
}

.weight-sections-select-all-btn:hover {
  background: var(--color-primary-500);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.weight-sections-apply-btn {
  background: var(--color-brand-gradient);
  color: white;
}

.weight-sections-apply-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Hidden section */
/* Mobile responsive for weight sections modal */
@media (max-width: 768px) {
  .customize-view-btn {
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
    min-height: 52px;
  }

  .customize-view-container {
    padding: 0 16px;
  }

  .weight-sections-modal {
    max-width: 95%;
    max-height: 85vh;
  }

  .weight-sections-modal-header {
    padding: 18px 20px;
  }

  .weight-sections-modal-header h3 {
    font-size: 18px;
  }

  .weight-sections-modal-body {
    padding: 15px 20px;
  }

  .weight-sections-modal-footer {
    padding: 15px 20px;
    flex-direction: column;
    gap: 10px;
  }

  .weight-sections-modal-btn {
    width: 100%;
  }
}

/* ===================================
   GENERIC TAB SECTIONS MODAL
   (Usato per tutti i TAB)
   =================================== */

/* MODAL OVERLAY */
.tab-sections-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-tooltip);
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(5px);
}

.tab-sections-modal-overlay.show {
  display: flex;
  opacity: 1;
}

/* MODAL CONTENT */
.tab-sections-modal {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.tab-sections-modal-overlay.show .tab-sections-modal {
  transform: scale(1);
}

/* MODAL HEADER */
.tab-sections-modal-header {
  background: var(--color-brand-gradient);
  color: white;
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.tab-sections-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.tab-sections-close-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.tab-sections-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.tab-sections-close-btn svg {
  width: 18px;
  height: 18px;
}

/* MODAL BODY */
.tab-sections-modal-body {
  padding: 20px 25px;
  overflow-y: auto;
  flex: 1;
}

.tab-sections-drag-hint {
  margin: 0 0 15px 0;
  padding: 10px 15px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 8px;
  font-size: 13px;
  color: var(--color-primary-500);
  text-align: center;
  border-left: 3px solid var(--color-primary-500);
}

.tab-sections-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tab-sections-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  cursor: grab;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: var(--color-gray-50);
  border: 2px solid transparent;
  user-select: none;
}

.tab-sections-option:hover {
  background: var(--color-gray-200);
  border-color: var(--color-primary-500);
}

.tab-sections-option:active {
  cursor: grabbing;
}

.tab-sections-option.dragging {
  opacity: 0.5;
  background: var(--color-gray-200);
  border: 2px dashed var(--color-primary-500);
}

.tab-sections-option.drag-over {
  border-color: var(--color-primary-500);
  background: rgba(102, 126, 234, 0.1);
  transform: scale(1.02);
}

.tab-sections-drag-handle {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  cursor: grab;
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.tab-sections-drag-handle:hover {
  opacity: 0.8;
}

.tab-sections-drag-handle span {
  display: block;
  width: 18px;
  height: 2px;
  background: #666;
  border-radius: 1px;
}

.tab-sections-option:active .tab-sections-drag-handle {
  cursor: grabbing;
}

.tab-sections-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--color-primary-500);
  flex-shrink: 0;
}

.tab-sections-option-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.tab-sections-option-name {
  flex: 1;
  font-size: 15px;
  color: #333;
  font-weight: 500;
}

/* MODAL FOOTER */
.tab-sections-modal-footer {
  padding: 20px 25px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  flex-shrink: 0;
}

.tab-sections-modal-btn {
  flex: 1;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.tab-sections-select-all-btn {
  background: white;
  color: var(--color-primary-500);
  border: 2px solid var(--color-primary-500);
}

.tab-sections-select-all-btn:hover {
  background: var(--color-primary-500);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tab-sections-apply-btn {
  background: var(--color-brand-gradient);
  color: white;
}

.tab-sections-apply-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Hidden section generic */
/* Mobile responsive for tab sections modal */
@media (max-width: 768px) {
  .tab-sections-modal {
    max-width: 95%;
    max-height: 85vh;
  }

  .tab-sections-modal-header {
    padding: 18px 20px;
  }

  .tab-sections-modal-header h3 {
    font-size: 18px;
  }

  .tab-sections-modal-body {
    padding: 15px 20px;
  }

  .tab-sections-modal-footer {
    padding: 15px 20px;
    flex-direction: column;
    gap: 10px;
  }

  .tab-sections-modal-btn {
    width: 100%;
  }
}

/* ===================================================================
   Z-INDEX SCALE — variabili aggiuntive
   (--z-modal-backdrop, --z-modal, --z-toast già definiti in design-tokens.css)
   =================================================================== */
:root {
  --z-base: 0;
  --z-above: 1;
  --z-raised: 2;
  --z-dropdown: 10;
  --z-sticky: 100;
  --z-sticky-above: 101;
  --z-overlay: 1000;
  --z-tooltip: 10000;
}

/* ===================================================================
   COLOR OVERRIDES — CSS Variables
   =================================================================== */

.positive {
  color: var(--color-success) !important;
}

.negative {
  color: var(--color-error) !important;
}

.weight-increase {
  color: var(--color-weight-gain) !important;
}

.weight-decrease {
  color: var(--color-weight-loss) !important;
}

.weight-neutral {
  color: var(--color-weight-neutral) !important;
}

.weight-change-good {
  color: var(--color-weight-loss) !important;
}

.weight-change-bad {
  color: var(--color-weight-gain) !important;
}

/* ===================================================================
   DELETE BUTTON — unified version
   =================================================================== */

.delete-btn {
  background: rgba(226, 232, 240, 0.5);
  border: 2px solid rgba(203, 213, 224, 0.5);
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  color: var(--color-error);
}

.delete-btn:hover {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.15),
    rgba(220, 38, 38, 0.15)
  );
  border-color: var(--color-error);
  transform: scale(1.15) rotate(5deg);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ===================================================================
   BADGE DISPLAY
   =================================================================== */

.badge-display {
  background: rgba(255, 255, 255, 0.2) !important;
  padding: 6px 12px !important;
  border-radius: 15px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  backdrop-filter: blur(15px) !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15) !important;
  transition: all 0.3s ease !important;
}

.badge-display:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

/* ===================================================================
   CALENDAR OVERRIDES
   =================================================================== */

.weight-calendar-day:hover:not(.future) {
  transform: scale(1.15) translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2) !important;
  z-index: var(--z-dropdown);
}

.weight-calendar-day.future {
  background: rgba(255, 255, 255, 0.4) !important;
  color: var(--color-gray-300) !important;
  border: 2px solid rgba(226, 232, 240, 0.3) !important;
  cursor: default;
  font-style: italic;
}

.weight-calendar-day.no-data {
  background: rgba(255, 255, 255, 0.6) !important;
  color: var(--color-gray-400) !important;
  border: 2px solid rgba(226, 232, 240, 0.4) !important;
}

.weight-calendar-day.today {
  font-weight: 800;
  border: 3px solid var(--color-legacy-purple-light) !important;
  box-shadow:
    0 0 0 3px rgba(102, 126, 234, 0.2),
    0 4px 12px rgba(102, 126, 234, 0.3) !important;
  animation: todayPulse 2s ease-in-out infinite;
}

/* @keyframes todayPulse definito sopra (riga 828) - duplicato rimosso */

/* ===================================================================
   UTILITY CLASSES
   =================================================================== */

.hidden {
  display: none !important;
}

.weight-section-hidden {
  display: none !important;
}

.tab-section-hidden {
  display: none !important;
}

/* ===================================================================
   RESPONSIVE — Chart Header
   =================================================================== */

@media (max-width: 768px) {
  .chart-header h2 {
    display: block !important;
    visibility: visible !important;
  }
}

/* ===================================================================
   Inline <style> migrato da index-firebase-auth.html
   =================================================================== */

/* Stili per storico peso */
.history-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.history-weight {
  font-weight: bold;
  font-size: 1.1rem;
  margin-right: 0.5rem;
}

.edit-btn,
.delete-btn {
  background: var(--color-gray-50);
  border: 1px solid var(--color-gray-200);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  font-size: 1rem;
}

.edit-btn:hover {
  background: #e7f1ff;
  border-color: var(--color-primary-500);
  transform: scale(1.1);
}

.delete-btn:hover {
  background: #ffe5e5;
  border-color: #e74c3c;
  transform: scale(1.1);
}
