:root {
  --bg: #0f0f1a;
  --surface: #1a1a2e;
  --surface2: #222240;
  --accent: #7c3aed;
  --accent2: #a78bfa;
  --gold: #f59e0b;
  --green: #10b981;
  --blue: #3b82f6;
  --pink: #ec4899;
  --red: #ef4444;
  --cyan: #06b6d4;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --border: rgba(124, 58, 237, 0.2);
  --orange: #f97316
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh
}

.header {
  background: var(--header-gradient, linear-gradient(135deg, #1a1a2e 0%, #2d1b69 50%, #1a1a2e 100%));
  padding: 40px 32px 32px;
  border-bottom: 1px solid var(--border);
  text-align: center
}

.header-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  position: relative;
}

.header-home {
  justify-self: start;
}

.theme-container {
  justify-self: end;
  position: relative;
}

.header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  background: var(--title-gradient, linear-gradient(135deg, #a78bfa, #ec4899, #f59e0b));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px
}

.header p {
  color: var(--text2);
  font-size: 1rem
}

/* === THEME TOGGLE BUTTON & DROPDOWN === */
.theme-container {
  position: relative;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s;
  white-space: nowrap;
}

.theme-toggle-btn:hover {
  border-color: var(--accent2);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.2);
  transform: translateY(-1px);
}

.theme-toggle-icon {
  font-size: 1.1rem;
}

.theme-toggle-label {
  font-size: 0.78rem;
  color: var(--text2);
}

.theme-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  z-index: 999;
  padding: 8px;
  animation: themeDropdownIn 0.2s ease;
}

.theme-dropdown.open {
  display: block;
}

@keyframes themeDropdownIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

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

.theme-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.theme-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

.theme-option.active {
  background: rgba(124, 58, 237, 0.12);
  border-left: 3px solid var(--accent);
}

.theme-option-emoji {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.theme-option-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.theme-option-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.theme-option-desc {
  font-size: 0.72rem;
  color: var(--text2);
  line-height: 1.3;
}

.theme-option-check {
  color: var(--accent2);
  font-weight: 800;
  font-size: 1rem;
}

@media (max-width: 768px) {
  .header-top {
    flex-direction: column;
    gap: 10px;
  }

  .theme-dropdown {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .theme-dropdown.open {
    transform: translateX(-50%);
  }
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 16px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  justify-content: center
}

/* === NAVIGATION LAYOUT === */
.nav-home {
  padding: 12px 32px 0;
  background: var(--surface);
  border-bottom: none;
  text-align: center
}

.nav-home .nav-btn {
  font-size: .95rem;
  padding: 10px 22px
}

.nav-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 32px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border)
}

.nav-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center
}

.nav-years .nav-btn {
  min-width: 56px;
  text-align: center
}

.nav-weekends .nav-btn {
  border-color: rgba(16, 185, 129, .3)
}

.nav-weekends .nav-btn:hover {
  border-color: var(--green);
  color: var(--green)
}

.nav-weekends .nav-btn.active {
  background: var(--green);
  border-color: var(--green)
}

.nav-extras .nav-btn {
  border-color: rgba(167, 139, 250, .3)
}

.nav-extras .nav-btn:hover {
  border-color: var(--accent2);
  color: var(--accent2)
}

.nav-extras .nav-btn.active {
  background: var(--accent2);
  border-color: var(--accent2)
}

.nav-btn {
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: .82rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  transition: all .2s;
  font-family: inherit
}

.nav-btn:hover {
  border-color: var(--accent);
  color: var(--text)
}

.nav-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent)
}

/* Footer export */
.footer-export {
  text-align: center;
  padding: 40px 20px 30px;
  opacity: .5;
  transition: opacity .3s
}

.footer-export:hover {
  opacity: 1
}

.export-btn {
  padding: 10px 24px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-size: .82rem;
  font-family: inherit;
  transition: all .3s
}

.export-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  border-style: solid
}

.tab {
  padding: 10px 24px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  transition: all .3s
}

.tab:hover {
  border-color: var(--accent);
  color: var(--text)
}

.tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent)
}

.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px
}

.year-panel {
  display: none
}

.year-panel.active {
  display: block
}

.year-header {
  text-align: center;
  margin-bottom: 24px
}

.year-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent2)
}

.year-header .budget-total {
  font-size: 1.1rem;
  color: var(--gold);
  margin-top: 4px
}

.year-header .nations {
  font-size: .9rem;
  color: var(--text2);
  margin-top: 4px
}

.trip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  transition: transform .2s
}

.trip-card:hover {
  transform: translateY(-2px)
}

.trip-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px
}

.trip-dest {
  font-size: 1.3rem;
  font-weight: 700
}

.trip-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center
}

.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600
}

.badge-low {
  background: rgba(16, 185, 129, .15);
  color: var(--green)
}

.badge-medium {
  background: rgba(59, 130, 246, .15);
  color: var(--blue)
}

.badge-high {
  background: rgba(249, 115, 22, .15);
  color: var(--orange)
}

.badge-period {
  background: rgba(124, 58, 237, .15);
  color: var(--accent2)
}

.badge-tipo {
  background: rgba(236, 72, 153, .15);
  color: var(--pink)
}

.price-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px
}

.price-tag {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: .8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px
}

.price-tag .label {
  color: var(--text2);
  font-size: .7rem;
  text-transform: uppercase;
  margin-bottom: 2px
}

.price-tag .value {
  font-weight: 700;
  color: var(--gold)
}

.section-block {
  background: var(--surface2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  border-left: 3px solid var(--accent)
}

.section-block.safety {
  border-left-color: var(--red)
}

.section-block.diving {
  border-left-color: var(--cyan)
}

.section-block.motivation {
  border-left-color: var(--green)
}

.section-block h4 {
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px
}

.section-block p,
.section-block li {
  font-size: .82rem;
  color: var(--text2);
  line-height: 1.5
}

.section-block ul {
  list-style: none;
  padding: 0
}

.section-block li::before {
  content: "→ ";
  color: var(--accent2)
}

.section-block.safety li::before {
  content: "⚠️ "
}

.section-block.diving li::before {
  content: "🐠 "
}

.weekend-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-top: 32px
}

.weekend-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--pink);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px
}

.weekend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px
}

.weekend-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px
}

.weekend-card h4 {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 6px
}

.weekend-card p {
  font-size: .8rem;
  color: var(--text2);
  line-height: 1.4
}

.weekend-card .wk-budget {
  color: var(--gold);
  font-weight: 600;
  font-size: .8rem;
  margin-top: 8px
}

/* HOMEPAGE */
.nav-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap
}

.nav-btn {
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  transition: all .3s
}

.nav-btn:hover,
.nav-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(124, 58, 237, .3)
}

.nav-btn.home-btn {
  background: linear-gradient(135deg, var(--accent), var(--pink));
  color: #fff;
  border: none
}

.nav-btn.home-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(236, 72, 153, .4)
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  transition: transform .3s
}

.stat-card:hover {
  transform: translateY(-4px)
}

.stat-card .stat-icon {
  font-size: 2.2rem;
  margin-bottom: 6px
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent2), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent
}

.stat-card .stat-label {
  color: var(--text2);
  font-size: .75rem;
  margin-top: 4px
}

.progress-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px
}

.progress-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px
}

.progress-bar-wrap {
  margin: 12px 0
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  color: var(--text2);
  margin-bottom: 6px
}

.progress-track {
  height: 18px;
  background: var(--surface2);
  border-radius: 10px;
  overflow: hidden
}

.progress-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 1.5s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: .65rem;
  font-weight: 700;
  color: #fff
}

.pf-nations {
  background: linear-gradient(90deg, var(--accent), var(--pink))
}

.pf-continents {
  background: linear-gradient(90deg, var(--green), var(--cyan))
}

.pf-bucket {
  background: linear-gradient(90deg, var(--gold), var(--orange))
}

.pf-capitali {
  background: linear-gradient(90deg, var(--blue), var(--accent))
}

.summary-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 32px
}

.summary-table thead th {
  background: var(--surface2);
  padding: 12px 10px;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent2);
  text-align: left;
  border-bottom: 2px solid var(--accent)
}

.summary-table tbody td {
  padding: 10px;
  font-size: .82rem;
  border-bottom: 1px solid rgba(124, 58, 237, .08)
}

.summary-table tbody tr {
  cursor: pointer;
  transition: background .2s
}

.summary-table tbody tr:hover {
  background: rgba(124, 58, 237, .1)
}

.summary-table .yr {
  font-weight: 700;
  color: var(--accent2)
}

.badge-sm {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: .65rem;
  font-weight: 600
}

.badge-sm.low {
  background: rgba(16, 185, 129, .15);
  color: var(--green)
}

.badge-sm.medium {
  background: rgba(59, 130, 246, .15);
  color: var(--blue)
}

.badge-sm.high {
  background: rgba(249, 115, 22, .15);
  color: var(--orange)
}

.badge-sm.dive {
  background: rgba(6, 182, 212, .15);
  color: var(--cyan)
}

.milestones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 32px
}

.ms-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  transition: transform .3s
}

.ms-card:hover {
  transform: translateY(-3px)
}

.ms-card .ms-icon {
  font-size: 1.8rem;
  flex-shrink: 0
}

.ms-card .ms-year {
  font-size: .65rem;
  color: var(--accent2);
  font-weight: 600
}

.ms-card .ms-text {
  font-size: .82rem
}

.bucket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 10px;
  margin-bottom: 32px
}

.bucket-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition: all .3s;
  font-size: .82rem
}

.bucket-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px)
}

.bucket-item.mapped {
  border-left: 3px solid var(--green)
}

.bucket-item.unmapped {
  border-left: 3px solid var(--text2);
  opacity: .65
}

.bucket-check {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px
}

.bucket-info {
  flex: 1
}

.bucket-info .b-name {
  font-weight: 600;
  margin-bottom: 3px
}

.bucket-info .b-trip {
  font-size: .72rem;
  color: var(--green);
  font-weight: 500
}

.bucket-info .b-no {
  font-size: .72rem;
  color: var(--text2);
  font-style: italic
}

.home-section {
  margin-bottom: 8px
}

.home-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px
}

.section-block.bucket-year {
  border-left-color: var(--gold)
}

.section-block.bucket-year li::before {
  content: "⭐ "
}

.trip-card.booked {
  border: 2px solid var(--green);
  box-shadow: 0 0 20px rgba(16, 185, 129, .2), inset 0 0 30px rgba(16, 185, 129, .03);
  position: relative;
  overflow: hidden
}

.trip-card.booked::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), #34d399, var(--cyan), #34d399, var(--green));
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite
}

@keyframes shimmer {
  0% {
    background-position: 200% 0
  }

  100% {
    background-position: -200% 0
  }
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 5px rgba(16, 185, 129, .4)
  }

  50% {
    box-shadow: 0 0 15px rgba(16, 185, 129, .7)
  }
}

.badge-booked {
  background: linear-gradient(135deg, #059669, #10b981, #34d399);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .5px;
  animation: pulse-glow 2s ease-in-out infinite;
  display: inline-flex;
  align-items: center;
  gap: 6px
}

.booked-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, .12), rgba(6, 182, 212, .08));
  border: 1px solid rgba(16, 185, 129, .3);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .88rem
}

.booked-banner .booked-icon {
  font-size: 1.6rem
}

.booked-banner .booked-text {
  color: var(--green);
  font-weight: 600
}

.booked-banner .booked-sub {
  color: var(--text2);
  font-size: .75rem;
  margin-top: 2px
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 16px;
  transition: all .3s
}

.back-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff
}

@media(max-width:768px) {
  .content {
    padding: 16px
  }

  .trip-card {
    padding: 16px
  }

  .price-tags {
    flex-direction: column
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr
  }

  .summary-table {
    font-size: .72rem
  }

  .summary-table thead th,
  .summary-table tbody td {
    padding: 8px 6px
  }

  .bucket-grid {
    grid-template-columns: 1fr
  }
}

/* === BUCKET NOTES MODAL === */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(600px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.modal-box h3 {
  color: var(--accent);
  margin: 0 0 6px 0;
  font-size: 1.15rem;
}

.modal-box .modal-trip {
  color: var(--text2);
  font-size: .82rem;
  margin-bottom: 18px;
}

.modal-box h4 {
  margin: 16px 0 6px 0;
  font-size: .9rem;
}

.modal-box h4.ai-label {
  color: #a78bfa;
}

.modal-box h4.user-label {
  color: #f472b6;
}

.modal-box .ai-text {
  background: rgba(167, 139, 250, .08);
  border: 1px solid rgba(167, 139, 250, .2);
  border-radius: 10px;
  padding: 12px;
  font-size: .82rem;
  color: var(--text2);
  line-height: 1.5;
}

.modal-box textarea {
  width: 100%;
  min-height: 100px;
  background: rgba(244, 114, 182, .06);
  border: 1px solid rgba(244, 114, 182, .25);
  border-radius: 10px;
  padding: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: .85rem;
  resize: vertical;
}

.modal-box textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-box textarea::placeholder {
  color: var(--text2);
  opacity: .6;
}

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

.modal-actions button {
  padding: 8px 20px;
  border-radius: 8px;
  border: none;
  font-size: .85rem;
  cursor: pointer;
  font-weight: 600;
}

.btn-save {
  background: var(--accent);
  color: #fff;
}

.btn-save:hover {
  filter: brightness(1.15);
}

.btn-close {
  background: var(--border);
  color: var(--text);
}

.btn-close:hover {
  background: var(--text2);
}

.bucket-item {
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}

.bucket-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, .3);
}

.note-indicator {
  font-size: .7rem;
  color: #f472b6;
  margin-left: 6px;
}

/* === TRIP BOOKING SYSTEM === */
.trip-card.booked {
  border: 2px solid #22c55e;
  box-shadow: 0 0 20px rgba(34, 197, 94, .15);
}

.trip-card .booked-badge {
  display: inline-block;
  background: #22c55e;
  color: #fff;
  font-size: .72rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 700;
  margin-left: 10px;
}

.trip-card .unbooked-badge {
  display: inline-block;
  background: var(--border);
  color: var(--text2);
  font-size: .72rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  margin-left: 10px;
}

.toggle-booked {
  padding: 8px 18px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  transition: all .2s;
  margin-top: 12px;
}

.toggle-booked:hover {
  border-color: #22c55e;
  color: #22c55e;
}

.toggle-booked.is-booked {
  border-color: #f97316;
  color: #f97316;
}

.toggle-booked.is-booked:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.actual-costs {
  margin-top: 14px;
}

.actual-costs h4 {
  color: #22c55e;
  margin: 0 0 8px;
  font-size: .85rem;
}

.cost-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.cost-field {
  flex: 1;
  min-width: 140px;
}

.cost-field label {
  display: block;
  font-size: .72rem;
  color: var(--text2);
  margin-bottom: 3px;
}

.cost-field input {
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: .85rem;
}

.cost-field input:focus {
  outline: none;
  border-color: #22c55e;
}

.trip-dates {
  margin-top: 14px;
}

.trip-dates h4 {
  color: #22c55e;
  margin: 0 0 8px;
  font-size: .85rem;
}

.date-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.date-field {
  flex: 1;
  min-width: 160px;
}

.date-field label {
  display: block;
  font-size: .72rem;
  color: var(--text2);
  margin-bottom: 3px;
}

.date-field input {
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: .85rem;
  color-scheme: dark;
}

.date-field input:focus {
  outline: none;
  border-color: #22c55e;
}

.trip-user-notes {
  margin-top: 14px;
}

.trip-user-notes h4 {
  color: #f472b6;
  margin: 0 0 6px;
  font-size: .85rem;
}

.trip-user-notes textarea {
  width: 100%;
  min-height: 70px;
  background: rgba(244, 114, 182, .06);
  border: 1px solid rgba(244, 114, 182, .25);
  border-radius: 10px;
  padding: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: .82rem;
  resize: vertical;
}

.trip-user-notes textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.trip-user-notes textarea::placeholder {
  color: var(--text2);
  opacity: .6;
}

.archive-btn {
  padding: 8px 18px;
  border-radius: 10px;
  border: 2px solid #f97316;
  background: transparent;
  color: #f97316;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  transition: all .2s;
  margin-top: 10px;
  margin-left: 10px;
}

.archive-btn:hover {
  background: #f97316;
  color: #fff;
}

.trip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Past trips */
.past-trip-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  opacity: .85;
  border-left: 4px solid #a78bfa;
}

.past-trip-card h3 {
  color: #a78bfa;
  margin: 0 0 6px;
  font-size: 1rem;
}

.past-trip-card .past-meta {
  color: var(--text2);
  font-size: .8rem;
  margin-bottom: 10px;
}

.past-trip-card .past-costs {
  font-size: .82rem;
  color: var(--text);
  margin-bottom: 8px;
}

.restore-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-size: .78rem;
}

.restore-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* === WEEKEND VAN SECTION === */
.van-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px
}

.van-filter {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  transition: all .2s;
  font-family: inherit
}

.van-filter:hover,
.van-filter.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent)
}

.van-filter.green.active {
  background: #059669;
  border-color: #059669
}

.van-filter.yellow.active {
  background: #d97706;
  border-color: #d97706
}

.van-filter.red.active {
  background: #dc2626;
  border-color: #dc2626
}

.circle-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 32px 0 16px;
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px solid var(--border)
}

.circle-header.green {
  background: rgba(5, 150, 105, .08);
  border-color: rgba(5, 150, 105, .3)
}

.circle-header.yellow {
  background: rgba(217, 119, 6, .08);
  border-color: rgba(217, 119, 6, .3)
}

.circle-header.red {
  background: rgba(220, 38, 38, .08);
  border-color: rgba(220, 38, 38, .3)
}

.circle-header .circle-icon {
  font-size: 2rem
}

.circle-header h3 {
  margin: 0;
  font-size: 1.1rem
}

.circle-header .circle-sub {
  font-size: .78rem;
  color: var(--text2);
  margin-top: 2px
}

.van-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 24px
}

.van-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: all .3s
}

.van-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(124, 58, 237, .15)
}

.van-card .vc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px
}

.van-card .vc-name {
  font-size: 1.1rem;
  font-weight: 700
}

.van-card .vc-flag {
  font-size: 1.4rem
}

.van-card .vc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px
}

.van-card .vc-tag {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: .7rem;
  font-weight: 600
}

.vc-tag.dist {
  background: rgba(124, 58, 237, .12);
  color: var(--accent2)
}

.vc-tag.budget {
  background: rgba(245, 158, 11, .12);
  color: var(--gold)
}

.vc-tag.emtb {
  background: rgba(16, 185, 129, .12);
  color: var(--green)
}

.vc-tag.nation {
  background: rgba(236, 72, 153, .15);
  color: var(--pink)
}

.van-card .vc-acts {
  font-size: .78rem;
  color: var(--text2);
  margin-bottom: 8px;
  line-height: 1.5
}

.van-card .vc-seasons {
  font-size: .72rem;
  color: var(--text2)
}

.van-detail {
  display: none;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
  animation: fadeIn .3s
}

.van-detail.open {
  display: block
}

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

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

.van-detail h4 {
  color: var(--accent2);
  margin: 16px 0 8px;
  font-size: .9rem
}

.van-detail h4:first-child {
  margin-top: 0
}

.van-detail p,
.van-detail li {
  font-size: .82rem;
  color: var(--text);
  line-height: 1.6
}

.van-detail ul {
  padding-left: 16px
}

.van-detail .vd-itin {
  background: var(--surface2);
  border-radius: 12px;
  padding: 14px;
  margin: 8px 0;
  font-size: .82rem;
  line-height: 1.6
}

.van-detail .vd-note {
  background: rgba(245, 158, 11, .06);
  border: 1px solid rgba(245, 158, 11, .2);
  border-radius: 10px;
  padding: 12px;
  font-size: .8rem;
  color: var(--gold)
}

.van-detail .close-detail {
  padding: 6px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-size: .8rem;
  margin-top: 12px;
  font-family: inherit
}

.van-detail .close-detail:hover {
  border-color: var(--accent);
  color: var(--accent)
}

.van-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px
}

.van-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  text-align: center
}

.van-stat .vs-val {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent
}

.van-stat .vs-lbl {
  font-size: .72rem;
  color: var(--text2);
  margin-top: 4px
}

/* === TRAIN WEEKEND STYLES === */
.train-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px
}

.train-filters button {
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-size: .82rem;
  font-family: inherit;
  transition: all .3s
}

.train-filters button.active,
.train-filters button:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent)
}

.cat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 14px;
  margin: 24px 0 16px;
  border: 1px solid
}

.cat-header.ag {
  background: rgba(16, 185, 129, .08);
  border-color: rgba(16, 185, 129, .3)
}

.cat-header.panoramic {
  background: rgba(59, 130, 246, .08);
  border-color: rgba(59, 130, 246, .3)
}

.cat-header.fip {
  background: rgba(249, 115, 22, .08);
  border-color: rgba(249, 115, 22, .3)
}

.cat-header .cat-icon {
  font-size: 2rem
}

.cat-header h3 {
  margin: 0;
  font-size: 1.1rem
}

.cat-header .cat-sub {
  font-size: .78rem;
  color: var(--text2);
  opacity: .8
}

.train-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
  transition: all .3s;
  position: relative;
  overflow: hidden
}

.train-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 58, 237, .15)
}

.train-card .tc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px
}

.train-card .tc-name {
  font-weight: 700;
  font-size: .95rem
}

.train-card .tc-flag {
  font-size: 1.4rem
}

.train-card .tc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px
}

.train-card .tc-tag {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: .72rem;
  font-weight: 600
}

.tc-tag.tempo {
  background: rgba(59, 130, 246, .15);
  color: #60a5fa
}

.tc-tag.gratis {
  background: rgba(16, 185, 129, .15);
  color: #34d399
}

.tc-tag.sconto {
  background: rgba(249, 115, 22, .15);
  color: #fb923c
}

.tc-tag.emtb {
  background: rgba(236, 72, 153, .15);
  color: #f472b6
}

.tc-tag.panoramic-tag {
  background: rgba(6, 182, 212, .15);
  color: #22d3ee
}

.train-card .tc-acts {
  font-size: .8rem;
  color: var(--text2);
  margin-bottom: 6px
}

.train-card .tc-seasons {
  font-size: .72rem;
  color: var(--text2);
  opacity: .7
}

.train-detail {
  display: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  margin-top: -4px;
  animation: slideDown .3s ease
}

.train-detail.open {
  display: block
}

.train-detail h4 {
  color: var(--accent2);
  margin: 16px 0 8px;
  font-size: .9rem
}

.train-detail h4:first-child {
  margin-top: 0
}

.train-detail p,
.train-detail li {
  font-size: .82rem;
  color: var(--text);
  line-height: 1.6
}

.train-detail ul {
  padding-left: 16px
}

.train-detail .td-itin {
  background: var(--surface);
  border-radius: 12px;
  padding: 14px;
  margin: 8px 0;
  font-size: .82rem;
  line-height: 1.6;
  color: var(--text)
}

.train-detail .td-note {
  background: rgba(245, 158, 11, .08);
  border-left: 3px solid var(--gold);
  padding: 10px 14px;
  border-radius: 0 10px 10px 0;
  margin-top: 12px;
  font-size: .82rem;
  color: var(--gold)
}

.train-detail .close-detail {
  padding: 6px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-size: .8rem;
  margin-top: 12px;
  font-family: inherit
}

.train-detail .close-detail:hover {
  border-color: var(--accent);
  color: var(--accent)
}

.train-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px
}

.train-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  text-align: center
}

.train-stat .ts-val {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent
}

.train-stat .ts-lbl {
  font-size: .72rem;
  color: var(--text2);
  margin-top: 4px
}

.fip-info-box {
  background: linear-gradient(135deg, rgba(249, 115, 22, .06), rgba(59, 130, 246, .06));
  border: 1px solid rgba(249, 115, 22, .2);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px
}

.fip-info-box h4 {
  color: var(--orange);
  margin-bottom: 10px;
  font-size: .95rem
}

.fip-info-box p,
.fip-info-box li {
  font-size: .8rem;
  color: var(--text);
  line-height: 1.6
}

.fip-info-box ul {
  padding-left: 16px;
  margin-top: 8px
}

/* === SCADENZIARIO STYLES === */
.scad-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px
}

.scad-filter-btn {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  transition: all .2s;
  font-family: inherit
}

.scad-filter-btn:hover,
.scad-filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent)
}

.scad-filter-btn.stat-card {
  background: var(--surface);
  backdrop-filter: var(--glass-blur, none);
  -webkit-backdrop-filter: var(--glass-blur, none);
  padding: 24px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06));
  transition: transform 0.3s cubic-bezier(.4, 0, .2, 1), box-shadow 0.3s cubic-bezier(.4, 0, .2, 1);
  text-align: center;
}

.scad-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  transition: transform .2s;
  border-left: 4px solid var(--border)
}

.scad-card:hover {
  transform: translateY(-2px)
}

.scad-card.urgenza-rosso {
  border-left-color: var(--red);
  box-shadow: 0 0 15px rgba(239, 68, 68, .1)
}

.scad-card.urgenza-giallo {
  border-left-color: var(--gold);
  box-shadow: 0 0 15px rgba(245, 158, 11, .1)
}

.scad-card.urgenza-verde {
  border-left-color: var(--green)
}

.scad-card.urgenza-completata {
  border-left-color: var(--text2);
  opacity: .6
}

.scad-card.urgenza-scaduta {
  border-left-color: var(--red);
  background: rgba(239, 68, 68, .05);
  box-shadow: 0 0 20px rgba(239, 68, 68, .15)
}

.scad-card.urgenza-neutro {
  border-left-color: var(--accent2)
}

.scad-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap
}

.scad-card-left {
  display: flex;
  gap: 12px;
  align-items: flex-start
}

.scad-cat-icon {
  font-size: 1.6rem;
  flex-shrink: 0
}

.scad-titolo {
  font-size: 1rem;
  font-weight: 700
}

.scad-titolo.barrato {
  text-decoration: line-through;
  opacity: .6
}

.scad-categoria {
  font-size: .72rem;
  color: var(--text2);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: .5px
}

.scad-urgenza-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap
}

.scad-urgenza-badge.urgenza-rosso {
  background: rgba(239, 68, 68, .15);
  color: var(--red)
}

.scad-urgenza-badge.urgenza-giallo {
  background: rgba(245, 158, 11, .15);
  color: var(--gold)
}

.scad-urgenza-badge.urgenza-verde {
  background: rgba(16, 185, 129, .15);
  color: var(--green)
}

.scad-urgenza-badge.urgenza-completata {
  background: rgba(148, 163, 184, .15);
  color: var(--text2)
}

.scad-urgenza-badge.urgenza-scaduta {
  background: rgba(239, 68, 68, .2);
  color: var(--red);
  animation: pulse-glow 2s ease-in-out infinite
}

.scad-urgenza-badge.urgenza-neutro {
  background: rgba(124, 58, 237, .15);
  color: var(--accent2)
}

.scad-card-body {
  font-size: .85rem
}

.scad-data {
  color: var(--text2);
  font-size: .82rem;
  margin-bottom: 6px
}

.scad-note {
  color: var(--text);
  font-size: .8rem;
  line-height: 1.5;
  margin-bottom: 6px;
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: 8px
}

.scad-viaggi {
  color: var(--accent2);
  font-size: .78rem;
  margin-top: 6px
}

.scad-card-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px
}

.scad-toggle-btn {
  padding: 6px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  transition: all .2s;
  font-family: inherit
}

.scad-toggle-btn.done:hover {
  border-color: var(--green);
  color: var(--green);
  background: rgba(16, 185, 129, .08)
}

.scad-toggle-btn.undo:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(124, 58, 237, .08)
}

.scad-edit-btn {
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid rgba(96, 165, 250, .3);
  background: rgba(59, 130, 246, .08);
  color: #60a5fa;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  transition: all .2s;
  font-family: inherit
}

.scad-edit-btn:hover {
  border-color: #60a5fa;
  background: rgba(59, 130, 246, .15);
  transform: translateY(-1px)
}

.scad-delete-btn {
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, .25);
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  transition: all .2s;
  font-family: inherit
}

.scad-delete-btn:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(239, 68, 68, .08);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }

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

/* ── Google Calendar Banner ── */
.gcal-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 20px;
  transition: border-color .3s, background .3s;
  flex-wrap: wrap
}

.gcal-banner.connected {
  border-color: rgba(34, 197, 94, .35);
  background: linear-gradient(135deg, rgba(34, 197, 94, .05), var(--surface))
}

.gcal-banner-left {
  display: flex;
  align-items: center;
  gap: 14px
}

.gcal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text2);
  flex-shrink: 0;
  transition: background .3s
}

.gcal-banner.connected .gcal-dot {
  background: var(--green, #22c55e);
  box-shadow: 0 0 8px rgba(34, 197, 94, .6);
  animation: pulse-dot 2s ease-in-out infinite
}

@keyframes pulse-dot {

  0%,
  100% {
    box-shadow: 0 0 6px rgba(34, 197, 94, .5);
  }

  50% {
    box-shadow: 0 0 14px rgba(34, 197, 94, .9);
  }
}

.gcal-banner-title {
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 2px
}

.gcal-banner-sub {
  font-size: .75rem;
  color: var(--text2)
}

.gcal-connect-btn {
  padding: 8px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  font-family: inherit;
  transition: all .2s;
  white-space: nowrap
}

.gcal-connect-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(124, 58, 237, .08)
}

.gcal-connect-btn.connected {
  border-color: rgba(34, 197, 94, .4);
  color: var(--green, #22c55e);
  background: rgba(34, 197, 94, .08)
}

.gcal-connect-btn.connected:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(239, 68, 68, .08)
}

.scad-gcal-btn {
  display: none
}

.scad-edit-form {
  margin-top: 16px;
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px
}

/* Add scadenza form */
.scad-add-section {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-top: 32px
}

.scad-add-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--accent2)
}

.scad-form {
  display: flex;
  flex-direction: column;
  gap: 12px
}

.scad-form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap
}

.scad-input {
  flex: 1;
  min-width: 180px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: .85rem;
  font-family: inherit;
  color-scheme: dark
}

.scad-input:focus {
  outline: none;
  border-color: var(--accent)
}

.scad-select {
  cursor: pointer
}

.scad-add-btn {
  padding: 10px 24px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .3s;
  font-family: inherit;
  align-self: flex-start
}

.scad-add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(124, 58, 237, .3)
}

/* === INFLAZIONE CALCULATOR === */
.inf-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap
}

.inf-label {
  font-size: .85rem;
  color: var(--text2);
  font-weight: 600
}

.inf-controls input[type="range"] {
  flex: 1;
  min-width: 150px;
  accent-color: var(--accent)
}

.inf-rate-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent2);
  min-width: 40px
}

.inf-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px
}

.inf-sum-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  text-align: center
}

.inf-sum-card.accent {
  border-color: rgba(124, 58, 237, .4);
  background: rgba(124, 58, 237, .05)
}

.inf-sum-card.warn {
  border-color: rgba(245, 158, 11, .4);
  background: rgba(245, 158, 11, .05)
}

.inf-sum-label {
  font-size: .75rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px
}

.inf-sum-val {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text)
}

.inf-sum-card.warn .inf-sum-val {
  color: var(--gold)
}

.inf-sum-sub {
  font-size: .72rem;
  color: var(--text2);
  margin-top: 4px;
  opacity: .7
}

.inf-year-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all .2s
}

.inf-year-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px)
}

.inf-year-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px
}

.inf-year-left {
  display: flex;
  align-items: baseline;
  gap: 10px
}

.inf-anno {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent2)
}

.inf-tema {
  font-size: .78rem;
  color: var(--text2);
  font-style: italic
}

.inf-year-right {
  display: flex;
  align-items: center;
  gap: 8px
}

.inf-nominale {
  font-size: .9rem;
  color: var(--text2)
}

.inf-freccia {
  color: var(--text2);
  font-size: .85rem
}

.inf-reale {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text)
}

.inf-reale.up {
  color: var(--gold)
}

.inf-diff-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  background: rgba(245, 158, 11, .15);
  color: var(--gold)
}

.inf-diff-badge.zero {
  background: rgba(16, 185, 129, .15);
  color: var(--green)
}

.inf-diff-badge.base {
  background: rgba(100, 116, 139, .2);
  color: #94a3b8;
  font-style: italic
}

.inf-diff-badge.up {
  background: rgba(245, 158, 11, .2);
  color: var(--gold)
}

.inf-extra-label {
  font-size: .72rem;
  color: var(--gold);
  font-weight: 600;
  opacity: .8
}

.inf-bar-container {
  height: 4px;
  background: var(--surface2);
  border-radius: 4px;
  margin-top: 10px;
  overflow: hidden
}

.inf-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--red));
  border-radius: 4px;
  transition: width .5s ease
}

.inf-details {
  display: none;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border)
}

.inf-details.open {
  display: block
}

.inf-viaggio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: .82rem;
  flex-wrap: wrap
}

.inf-v-dest {
  flex: 1;
  min-width: 180px;
  color: var(--text)
}

.inf-v-orig {
  color: var(--text2)
}

.inf-v-arrow {
  color: var(--text2);
  font-size: .75rem
}

.inf-v-real {
  font-weight: 600;
  color: var(--text)
}

.inf-v-real.up {
  color: var(--gold)
}

.inf-v-diff {
  font-size: .72rem;
  color: var(--red);
  font-weight: 600
}

.inf-note-box {
  margin-top: 24px;
  padding: 16px 20px;
  background: rgba(59, 130, 246, .06);
  border: 1px solid rgba(59, 130, 246, .2);
  border-radius: 12px;
  font-size: .82rem;
  color: var(--text);
  line-height: 1.6
}

.inf-note-box strong {
  color: var(--blue)
}

/* === CURRENCY CONVERTER === */
.val-loading {
  text-align: center;
  padding: 40px;
  color: var(--text2);
  font-size: .9rem
}

.val-converter {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px
}

.val-conv-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap
}

.val-conv-field {
  flex: 1;
  min-width: 140px
}

.val-conv-field label {
  display: block;
  font-size: .75rem;
  color: var(--text2);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .5px
}

.val-conv-arrow {
  font-size: 1.4rem;
  color: var(--accent2);
  padding-bottom: 8px;
  flex-shrink: 0
}

.val-result {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface2);
  border-radius: 12px;
  flex-wrap: wrap
}

.val-res-from {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text)
}

.val-res-eq {
  font-size: 1.3rem;
  color: var(--accent2);
  font-weight: 800
}

.val-res-to {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--green)
}

.val-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px
}

.val-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  transition: all .2s
}

.val-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px)
}

.val-card.base {
  border-color: rgba(16, 185, 129, .4);
  background: rgba(16, 185, 129, .05)
}

.val-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px
}

.val-flag {
  font-size: 1.4rem
}

.val-code {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent2)
}

.val-nome {
  font-size: .75rem;
  color: var(--text2);
  margin-bottom: 8px
}

.val-rate {
  font-size: .82rem;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px
}

.val-converted {
  font-size: .75rem;
  color: var(--text2)
}

/* === TESORETTO (ROLLOVER BUDGET) === */
.tes-year {
  margin-bottom: 16px
}

.tes-year-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all .2s;
  flex-wrap: wrap
}

.tes-year-header:hover {
  border-color: var(--accent)
}

.tes-year-budget {
  margin-left: auto;
  font-size: .82rem;
  color: var(--text2);
  font-weight: 600
}

.tes-year-trips {
  display: none;
  padding: 8px 0 0 16px
}

.tes-year-trips.open {
  display: block
}

.tes-trip {
  padding: 12px 16px;
  border-left: 3px solid var(--border);
  margin-bottom: 8px;
  border-radius: 0 10px 10px 0;
  background: var(--surface);
  transition: all .2s
}

.tes-trip.risparmio {
  border-left-color: var(--green);
  background: rgba(16, 185, 129, .04)
}

.tes-trip.sforato {
  border-left-color: var(--red);
  background: rgba(239, 68, 68, .04)
}

.tes-trip.pianificato {
  border-left-color: var(--text2);
  opacity: .7
}

.tes-trip-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px
}

.tes-trip-dest {
  font-size: .9rem;
  font-weight: 600
}

.tes-trip-stato {
  font-size: .78rem;
  font-weight: 600
}

.tes-trip.risparmio .tes-trip-stato {
  color: var(--green)
}

.tes-trip.sforato .tes-trip-stato {
  color: var(--red)
}

.tes-trip-nums {
  display: flex;
  gap: 16px;
  font-size: .78rem;
  color: var(--text2);
  flex-wrap: wrap
}

.tes-trip-saldo {
  font-weight: 700;
  color: var(--accent2)
}

/* === MAPPA VAN (LEAFLET) === */
.map-container {
  width: 100%;
  height: 550px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden
}

.map-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap
}

.map-home-icon {
  font-size: 24px;
  text-align: center;
  line-height: 30px
}

.map-dest-icon {
  background: none !important;
  border: none !important
}

/* Leaflet popup dark override */
.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-radius: 12px !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .4) !important
}

.leaflet-popup-tip {
  background: var(--surface) !important
}

.leaflet-popup-content {
  font-size: .82rem !important;
  line-height: 1.4 !important
}

.map-popup b {
  color: var(--accent2)
}

.map-popup hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, .1);
  margin: 6px 0
}

.leaflet-popup-close-button {
  color: var(--text2) !important
}

/* === SCRATCH MAP === */
.scratch-stats {
  margin-bottom: 14px
}

.scratch-stat-cards {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px
}

.scratch-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid;
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  min-width: 100px;
  flex: 1
}

.scratch-stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text)
}

.scratch-stat-label {
  font-size: .72rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .5px
}

/* === PIANO B IMPREVISTI === */
.pianob-year {
  margin-bottom: 24px
}

.pianob-year-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent2);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border)
}

.pianob-trip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  overflow: hidden
}

.pianob-trip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  transition: background .2s
}

.pianob-trip-header:hover {
  background: rgba(255, 255, 255, .03)
}

.pianob-trip-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1
}

.pianob-trip-periodo {
  font-size: .8rem;
  color: var(--text2);
  min-width: 90px
}

.pianob-trip-dest {
  font-weight: 600;
  color: var(--text);
  flex: 1
}

.pianob-trip-budget {
  font-size: .85rem;
  color: var(--accent2);
  font-weight: 600
}

.pianob-badge {
  font-size: .7rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border)
}

.pianob-expand {
  font-size: .7rem;
  color: var(--text2);
  transition: transform .2s
}

.pianob-alternatives {
  border-top: 1px solid var(--border);
  padding: 12px 16px
}

.pianob-alt {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .04)
}

.pianob-alt:last-child {
  border-bottom: none
}

.pianob-alt-match {
  font-size: 1.1rem;
  font-weight: 800;
  min-width: 48px;
  text-align: center
}

.pianob-alt-info {
  display: flex;
  flex-direction: column;
  gap: 2px
}

.pianob-alt-info b {
  color: var(--text);
  font-size: .9rem
}

.pianob-alt-info small {
  color: var(--text2);
  font-size: .78rem
}

.pianob-alt-motivo {
  color: var(--accent2) !important;
  font-style: italic
}

/* === RANKING NAZIONI === */
.rank-progress {
  height: 6px;
  background: var(--surface2);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 6px
}

.rank-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 6px;
  transition: width .3s ease
}

.rank-progress-label {
  text-align: center;
  font-size: .78rem;
  color: var(--text2);
  margin-bottom: 24px
}

.rank-match {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 20px 0
}

.rank-card {
  flex: 1;
  max-width: 280px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .25s ease
}

.rank-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3)
}

.rank-card:active {
  transform: scale(.97)
}

.rank-card-emoji {
  font-size: 2.5rem;
  margin-bottom: 12px
}

.rank-card-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px
}

.rank-card-cont {
  font-size: .8rem;
  color: var(--text2);
  margin-bottom: 8px
}

.rank-card-elo {
  font-size: .72rem;
  color: var(--accent2);
  opacity: .6
}

.rank-card-info {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin: 8px 0 6px
}

.rank-info-badge {
  font-size: .65rem;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .06);
  color: var(--text2)
}

.rank-info-badge.dive {
  background: rgba(56, 189, 248, .12);
  color: #38bdf8
}

.rank-info-badge.van {
  background: rgba(34, 197, 94, .12);
  color: #22c55e
}

.rank-info-tags {
  width: 100%;
  text-align: center;
  font-size: .85rem;
  letter-spacing: 2px;
  margin-top: 2px
}

/* Analytics */
.rank-analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px
}

@media (max-width: 700px) {
  .rank-analytics-grid {
    grid-template-columns: 1fr
  }
}

.rank-analytics-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px
}

.rank-analytics-title {
  font-weight: 700;
  font-size: .85rem;
  margin-bottom: 12px;
  color: var(--accent2)
}

.rank-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px
}

.rank-bar-label {
  font-size: .72rem;
  min-width: 120px;
  color: var(--text2)
}

.rank-bar-track {
  flex: 1;
  height: 20px;
  background: rgba(255, 255, 255, .04);
  border-radius: 6px;
  overflow: hidden
}

.rank-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #38bdf8);
  border-radius: 6px;
  font-size: .65rem;
  color: #fff;
  display: flex;
  align-items: center;
  padding-left: 6px;
  font-weight: 600;
  min-width: fit-content
}

.rank-profile-badge {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .04)
}

.rank-profile-badge:last-child {
  border-bottom: none
}

.rank-profile-icon {
  font-size: 1.4rem
}

.rank-profile-badge strong {
  font-size: .82rem;
  color: var(--text)
}

.rank-profile-sub {
  font-size: .72rem;
  color: var(--text2);
  margin-top: 2px
}

.rank-dream-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px
}

@media (max-width: 700px) {
  .rank-dream-grid {
    grid-template-columns: repeat(3, 1fr)
  }
}

.rank-dream-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, .12), rgba(56, 189, 248, .08));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
  transition: border-color .2s
}

.rank-dream-card:hover {
  border-color: var(--accent)
}

.rank-dream-pos {
  font-size: .7rem;
  color: var(--gold);
  font-weight: 700
}

.rank-dream-name {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  margin: 4px 0 2px
}

.rank-dream-cont {
  font-size: .65rem;
  color: var(--text2)
}

.rank-dream-elo {
  font-size: .65rem;
  color: var(--accent2);
  margin-top: 4px
}

.rank-vs {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text2);
  opacity: .4
}

/* Podium */
.rank-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  margin: 30px 0
}

.rank-podium-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 140px
}

.rank-podium-name {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 4px;
  text-align: center
}

.rank-podium-cont {
  font-size: .72rem;
  color: var(--text2);
  margin-bottom: 4px
}

.rank-podium-elo {
  font-size: .68rem;
  color: var(--accent2);
  margin-bottom: 8px;
  opacity: .6
}

.rank-podium-bar {
  width: 100%;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  font-size: 1.8rem;
  font-weight: 900;
  color: rgba(0, 0, 0, .5)
}

/* Results rows */
.rank-section {
  margin: 24px 0
}

.rank-section h3 {
  font-size: 1rem;
  color: var(--accent2);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border)
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background .2s
}

.rank-row:hover {
  background: rgba(255, 255, 255, .03)
}

.rank-row.top10 {
  background: rgba(245, 158, 11, .06);
  border-left: 3px solid var(--gold)
}

.rank-pos {
  font-weight: 800;
  color: var(--accent2);
  min-width: 36px;
  font-size: .9rem
}

.rank-name {
  flex: 1;
  font-weight: 600;
  color: var(--text)
}

.rank-cont {
  font-size: .78rem;
  color: var(--text2)
}

.rank-elo {
  font-size: .72rem;
  color: var(--accent2);
  opacity: .5;
  min-width: 60px;
  text-align: right
}

/* === ORACOLO METEO VAN === */
.meteo-months {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  justify-content: center
}

.meteo-month-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: .78rem;
  transition: all .2s
}

.meteo-month-btn:hover {
  border-color: var(--accent)
}

.meteo-month-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent)
}

.meteo-season {
  text-align: center;
  font-size: .85rem;
  color: var(--text2);
  margin-bottom: 16px;
  padding: 8px;
  background: var(--surface);
  border-radius: 8px
}

.meteo-stats {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 16px
}

.meteo-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px
}

.meteo-stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent)
}

.meteo-stat span:last-child {
  font-size: .72rem;
  color: var(--text2)
}

.meteo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color .2s
}

.meteo-card:hover {
  border-color: var(--accent)
}

.meteo-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, .02)
}

.meteo-card-ring {
  font-size: .65rem;
  padding: 3px 8px;
  border-radius: 6px;
  color: #000;
  font-weight: 700;
  white-space: nowrap
}

.meteo-card-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px
}

.meteo-card-flag {
  font-size: 1.2rem
}

.meteo-card-dist {
  font-size: .72rem;
  color: var(--text2)
}

.meteo-badge {
  font-size: .68rem;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600
}

.meteo-badge.emtb {
  background: rgba(34, 197, 94, .15);
  color: #22c55e
}

.meteo-card-body {
  padding: 10px 16px 14px;
  font-size: .8rem;
  color: var(--text2)
}

.meteo-activities {
  margin-bottom: 6px
}

.meteo-seasons {
  font-size: .72rem;
  opacity: .7;
  margin-bottom: 4px
}

.meteo-budget,
.meteo-parking {
  font-size: .72rem;
  margin-top: 3px
}

/* === GENERATORE VALIGIA === */
.valigia-selector {
  margin-bottom: 24px;
  position: relative;
}

.valigia-select {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(26, 26, 46, 0.8);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.valigia-select:hover,
.valigia-select:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.3);
  outline: none;
}

.valigia-selector::after {
  content: '▼';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent2);
  pointer-events: none;
  font-size: 0.8rem;
}

.valigia-header {
  margin-bottom: 24px;
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(34, 34, 64, 0.6) 0%, rgba(26, 26, 46, 0.2) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 8px 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.valigia-header h3 {
  margin: 0 0 10px;
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(to right, #fff, var(--text2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.valigia-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 12px;
  font-weight: 500;
}

.valigia-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.valigia-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.valigia-tag {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(245, 158, 11, 0.1);
  color: var(--gold);
  font-weight: 700;
  border: 1px solid rgba(245, 158, 11, 0.2);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.1);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.2s;
}

.valigia-tag:hover {
  transform: translateY(-2px);
}

.valigia-cat {
  margin-bottom: 24px;
  background: rgba(26, 26, 46, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 16px;
  transition: background 0.3s;
}

.valigia-cat:hover {
  background: rgba(26, 26, 46, 0.6);
  border-color: rgba(124, 58, 237, 0.15);
}

.valigia-cat-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent2);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.valigia-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 2px;
  position: relative;
  overflow: hidden;
}

.valigia-item:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(4px);
}

/* Custom Checkbox */
.valigia-item input[type=checkbox] {
  appearance: none;
  background-color: rgba(255, 255, 255, 0.05);
  margin: 0;
  font: inherit;
  color: currentColor;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 6px;
  display: grid;
  place-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  margin-top: 2px;
}

.valigia-item input[type=checkbox]::before {
  content: "";
  width: 10px;
  height: 10px;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  transform: scale(0);
  background-color: white;
  transition: 0.2s transform cubic-bezier(0.4, 0, 0.2, 1);
}

.valigia-item input[type=checkbox]:checked {
  background: linear-gradient(135deg, var(--accent), var(--blue));
  border-color: transparent;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.5);
}

.valigia-item input[type=checkbox]:checked::before {
  transform: scale(1);
}

.valigia-item input[type=checkbox]:checked+span {
  color: var(--text2);
  text-decoration: line-through;
  opacity: 0.6;
}

.valigia-item span {
  transition: all 0.3s;
  line-height: 1.4;
}

.valigia-progress-wrap {
  margin-top: 32px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.8), rgba(15, 15, 26, 0.9));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.valigia-progress-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.valigia-progress-label span {
  font-size: 1.1rem;
  color: var(--accent2);
  font-weight: 800;
}

.valigia-progress-wrap .rank-progress {
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.4);
}

.valigia-progress-wrap .rank-progress-bar {
  background: linear-gradient(90deg, var(--pink), var(--accent), var(--cyan));
  background-size: 200% 200%;
  animation: shimmer 2.5s ease infinite;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.5);
}

@keyframes shimmer {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Van Sub-tabs */
.van-subtabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: none;
  padding-bottom: 0;
  overflow-x: auto;
  padding: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.van-subtab {
  background: transparent;
  border: none;
  color: var(--text2);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s;
  white-space: nowrap;
}

.van-subtab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.van-subtab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

/* Valigia Smart — Drone Banners */
.valigia-drone-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 16px;
  margin-bottom: 20px;
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-left: 4px solid transparent;
  animation: floatBanner 4s ease-in-out infinite alternate;
}

@keyframes floatBanner {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-3px);
  }
}

.valigia-drone-no {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(153, 27, 27, 0.2));
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-left-color: var(--red);
  color: #fca5a5;
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.15);
}

.valigia-drone-no strong {
  color: #f87171;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
}

.valigia-drone-ok {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(22, 101, 52, 0.2));
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-left-color: var(--green);
  color: #86efac;
  box-shadow: 0 8px 25px rgba(34, 197, 94, 0.1);
}

.valigia-drone-ok strong {
  color: #4ade80;
  font-size: 1.05rem;
}

.vdb-icon {
  font-size: 2rem;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.valigia-weather {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.valigia-tag.weather {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(96, 165, 250, 0.2));
  border: 1px solid rgba(124, 58, 237, 0.4);
  color: #e2e8f0;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.2);
}

/* ── Badge scadenze urgenti ── */
.scad-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 0 8px rgba(239, 68, 68, .6);
  animation: badge-pulse 2s infinite;
  pointer-events: none;
}

@keyframes badge-pulse {

  0%,
  100% {
    box-shadow: 0 0 6px rgba(239, 68, 68, .5);
  }

  50% {
    box-shadow: 0 0 14px rgba(239, 68, 68, .9);
  }
}

/* ── Meteo nella card viaggio ── */
.trip-meteo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(56, 189, 248, .08);
  border: 1px solid rgba(56, 189, 248, .2);
  border-radius: 8px;
  font-size: .8rem;
  color: var(--text2);
  margin: 6px 0 0;
}

.trip-meteo .meteo-temp {
  color: #38bdf8;
  font-weight: 700;
  font-size: .9rem;
}

/* ── Prossimo viaggio countdown ── */
.next-trip-card {
  background: linear-gradient(135deg, rgba(124, 58, 237, .15), rgba(16, 185, 129, .1));
  border: 1px solid rgba(124, 58, 237, .35);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.next-trip-countdown {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--accent2);
  line-height: 1;
  min-width: 70px;
  text-align: center;
}

.next-trip-label {
  font-size: .65rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.next-trip-info {
  flex: 1;
}

.next-trip-dest {
  font-size: 1rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 4px;
}

.next-trip-when {
  font-size: .8rem;
  color: var(--text2);
}

/* ── Costi reali: input + selettore valuta ── */
.cost-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.cost-input-row input {
  flex: 1;
  min-width: 0;
}

.cost-currency {
  background: var(--surface2);
  border: 1px solid rgba(124, 58, 237, .3);
  color: var(--text2);
  border-radius: 6px;
  padding: 5px 4px;
  font-size: .72rem;
  font-family: inherit;
  cursor: pointer;
  width: 54px;
  flex-shrink: 0;
}

.cost-currency:focus {
  outline: 1px solid var(--accent);
}

/* ── Riepilogo costi ── */
.cost-summary {
  margin-top: 14px;
  border-top: 1px solid rgba(124, 58, 237, .25);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
  padding: 3px 0;
}

.cs-label {
  color: var(--text2);
}

.cs-val {
  font-weight: 600;
  color: #e2e8f0;
}

.cs-row.total {
  border-top: 1px solid rgba(255, 255, 255, .08);
  margin-top: 4px;
  padding-top: 6px;
  font-size: .88rem;
}

.cs-row.total .cs-label {
  color: var(--accent2);
  font-weight: 600;
}

.cs-row.total .cs-val {
  color: var(--green);
  font-weight: 800;
  font-size: .95rem;
}

/* ── Anno corrente nella navbar ── */
.nav-btn.current-year {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  box-shadow: 0 0 10px rgba(34, 197, 94, .35);
  font-weight: 800;
  color: #86efac;
}

.nav-btn.current-year::after {
  content: ' ✦';
  font-size: .6em;
  vertical-align: super;
  color: #4ade80;
}

/* ══════════════════════════════════════
   🔍 RICERCA GLOBALE
══════════════════════════════════════ */
.search-toggle-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--text2);
  cursor: pointer;
  font-size: 1rem;
  transition: all .2s
}

.search-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(124, 58, 237, .08)
}

.global-search-box {
  display: none;
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg);
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}

.global-search-box.open {
  display: block
}

.global-search-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--accent);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}

.global-search-results {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 60vh;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: background .15s;
}

.search-result-item:hover {
  background: var(--surface2)
}

.sri-icon {
  font-size: 1.2rem;
  flex-shrink: 0
}

.sri-text {
  flex: 1;
  min-width: 0
}

.sri-title {
  font-weight: 600;
  font-size: .92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.sri-sub {
  font-size: .75rem;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.sri-type {
  font-size: .65rem;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text2);
  white-space: nowrap
}

.search-empty,
.search-more {
  text-align: center;
  padding: 12px;
  color: var(--text2);
  font-size: .85rem
}

/* ══════════════════════════════════════
   📊 BUDGET CHART
══════════════════════════════════════ */
.budget-chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  height: 360px;
  position: relative;
}

.budget-kpi-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.budget-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  flex: 1;
  min-width: 140px;
  text-align: center;
}

.bk-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent2);
}

.bk-lbl {
  font-size: .75rem;
  color: var(--text2);
  margin-top: 4px;
}

.budget-year-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.budget-year-row {
  display: grid;
  grid-template-columns: 60px 1fr 130px 130px 130px;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
  font-size: .85rem;
}

.budget-year-row:hover {
  background: var(--surface2)
}

.by-year {
  font-weight: 700;
  color: var(--accent2)
}

.by-tema {
  color: var(--text2);
  font-size: .8rem
}

.by-pian {
  text-align: right
}

.by-reale {
  text-align: right;
  color: var(--green)
}

.by-delta {
  text-align: right
}

/* ══════════════════════════════════════
   🌦️ METEO
══════════════════════════════════════ */
.meteo-trip-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.meteo-trip-card {
  display: grid;
  grid-template-columns: 110px 1fr auto 24px;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all .2s;
}

.meteo-trip-card:hover,
.meteo-trip-card.active {
  border-color: var(--accent);
  background: rgba(124, 58, 237, .06);
}

.meteo-trip-when {
  font-size: .8rem;
  color: var(--text2)
}

.meteo-trip-dest {
  font-weight: 700
}

.meteo-trip-tipo {
  font-size: .75rem;
  color: var(--text2)
}

.meteo-trip-arrow {
  color: var(--accent2);
  font-size: 1.2rem
}

.meteo-result {
  margin-top: 16px
}

.meteo-loading {
  text-align: center;
  padding: 32px;
  color: var(--text2)
}

.meteo-error {
  padding: 20px;
  background: rgba(239, 68, 68, .08);
  border: 1px solid rgba(239, 68, 68, .2);
  border-radius: 12px;
  color: var(--red);
  font-size: .9rem;
}

.meteo-header-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 12px;
}

.meteo-dest-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px
}

.meteo-dest-sub {
  font-size: .75rem;
  color: var(--text2)
}

.meteo-trip-badge {
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(124, 58, 237, .15);
  color: var(--accent2);
  font-size: .78rem;
  font-weight: 600;
  display: inline-block;
}

.meteo-note {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: .8rem;
  margin-bottom: 16px;
}

.meteo-note.near {
  background: rgba(34, 197, 94, .08);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, .2)
}

.meteo-note.far {
  background: rgba(245, 158, 11, .06);
  color: var(--gold);
  border: 1px solid rgba(245, 158, 11, .2)
}

.meteo-days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.meteo-day-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}

.meteo-day-card.today {
  border-color: var(--accent);
  background: rgba(124, 58, 237, .06)
}

.mdc-day {
  font-size: .72rem;
  color: var(--text2);
  font-weight: 600;
  text-transform: uppercase
}

.mdc-date {
  font-size: .75rem;
  color: var(--text2);
  margin-bottom: 6px
}

.mdc-icon {
  font-size: 1.8rem;
  margin-bottom: 4px
}

.mdc-desc {
  font-size: .72rem;
  color: var(--text2);
  margin-bottom: 8px
}

.mdc-temps {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 4px
}

.mdc-max {
  font-weight: 700;
  font-size: .9rem
}

.mdc-min {
  color: var(--text2);
  font-size: .9rem
}

.mdc-rain,
.mdc-wind {
  font-size: .7rem;
  color: var(--text2)
}
/* ══════════════════════════════════════
   🌐 LIVE METEO WIDGET (trip card footer)
══════════════════════════════════════ */
.trip-clima-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}
.lm-widget { margin-top: 10px; }
.lm-loading { font-size: .78rem; color: var(--text2); }
.lm-header { font-size: .82rem; font-weight: 600; margin-bottom: 10px; color: var(--text); }
.lm-note { font-size: .72rem; color: var(--text2); font-weight: 400; }
.lm-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.lm-day {
  background: var(--surface2, rgba(255,255,255,.04));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
}
.lm-day.today { border-color: var(--accent); background: rgba(124,58,237,.08); }
.lm-day-label { font-size: .65rem; font-weight: 700; color: var(--text2); text-transform: uppercase; }
.lm-day-date { font-size: .62rem; color: var(--text2); margin-bottom: 5px; }
.lm-icon { font-size: 1.4rem; margin-bottom: 4px; }
.lm-temps { display: flex; justify-content: center; gap: 4px; margin-bottom: 3px; }
.lm-max { font-size: .82rem; font-weight: 700; }
.lm-min { font-size: .82rem; color: var(--text2); }
.lm-rain { font-size: .65rem; color: var(--text2); }

/* ══════════════════════════════════════
   📈 STATISTICHE AVANZATE
══════════════════════════════════════ */
.stats-section { margin-bottom: 32px }
.stats-section h3 { font-size: 1rem; font-weight: 700; margin-bottom: 14px; color: var(--accent2) }

.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.stats-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}
.sk-val { font-size: 1.6rem; font-weight: 800; color: var(--accent2) }
.sk-lbl { font-size: .72rem; color: var(--text2); margin-top: 4px }

.stats-records { display: flex; flex-direction: column; gap: 8px }
.stats-record-item {
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .87rem;
}

.stats-classe-grid { display: flex; flex-direction: column; gap: 10px }
.stats-classe-item { display: flex; align-items: center; gap: 12px }
.sci-label { width: 120px; font-size: .82rem; font-weight: 600; flex-shrink: 0 }
.sci-bar-wrap { flex: 1; background: rgba(255,255,255,.06); border-radius: 6px; height: 10px; overflow: hidden }
.sci-bar { height: 100%; border-radius: 6px; transition: width .4s }
.sci-val { font-size: .78rem; color: var(--text2); width: 120px; text-align: right; flex-shrink: 0 }

.stats-mesi-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
  align-items: flex-end;
}
.stats-mese-item { text-align: center }
.stats-mese-item.top .smi-bar { background: var(--accent2) }
.smi-nome { font-size: .65rem; color: var(--text2); margin-bottom: 4px }
.smi-bar-wrap { display: flex; justify-content: center; align-items: flex-end; height: 70px }
.smi-bar { width: 28px; background: rgba(124,58,237,.5); border-radius: 4px 4px 0 0; min-height: 4px }
.smi-count { font-size: .72rem; font-weight: 700; margin-top: 4px }

.stats-nazioni-list { display: flex; flex-direction: column; gap: 6px }
.stats-nazioni-row {
  display: grid;
  grid-template-columns: 60px 1fr 40px auto;
  gap: 10px;
  align-items: center;
  font-size: .82rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.stats-nazioni-row.total { border-bottom: none; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border) }
.snr-year { font-weight: 700; color: var(--text2) }
.snr-bar-wrap { background: rgba(255,255,255,.06); border-radius: 4px; height: 8px; overflow: hidden }
.snr-bar { height: 100%; background: rgba(124,58,237,.6); border-radius: 4px }
.snr-count { font-weight: 700; color: var(--accent2); text-align: right }
.snr-names { color: var(--text2); font-size: .75rem }

.stats-passati-grid { display: flex; flex-direction: column; gap: 8px }
.stats-passato-card {
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.spc-stars { font-size: 1.2rem; letter-spacing: 2px; margin-bottom: 6px }
.spc-highlight { font-size: .87rem; font-style: italic; margin-bottom: 4px }
.spc-date { font-size: .72rem; color: var(--text2) }

/* 🌟 NOTA DI RITORNO nei passati */
.trip-return-note {
  background: rgba(245,158,11,.06);
  border: 1px solid rgba(245,158,11,.2);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 12px;
}
.trip-return-note h4 { margin: 0 0 10px; font-size: .87rem }

.return-stars { display: flex; align-items: center; gap: 6px; margin-bottom: 10px }
.star {
  font-size: 1.6rem;
  cursor: pointer;
  color: rgba(255,255,255,.2);
  transition: color .15s, transform .15s;
  line-height: 1;
}
.star:hover, .star.on { color: var(--gold, #f59e0b) }
.star:hover { transform: scale(1.2) }
.star-label { font-size: .75rem; color: var(--text2); margin-left: 4px }

.return-highlight {
  width: 100%;
  min-height: 60px;
  background: transparent;
  border: 1px solid rgba(245,158,11,.2);
  border-radius: 8px;
  padding: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: .85rem;
  resize: vertical;
  box-sizing: border-box;
}
.return-highlight:focus { outline: none; border-color: var(--gold, #f59e0b) }

/* ══════════════════════════════════════
   🌍 PROFILO NAZIONE — Drawer Modal
══════════════════════════════════════ */
.np-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 9999;
  opacity: 0;
  transition: opacity .25s;
  display: flex;
  justify-content: flex-end;
}
.np-overlay.open { opacity: 1 }

.np-drawer {
  background: var(--surface, #1e293b);
  width: min(420px, 92vw);
  height: 100%;
  overflow-y: auto;
  padding: 28px 24px 40px;
  box-shadow: -12px 0 40px rgba(0,0,0,.5);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  position: relative;
  border-left: 1px solid var(--border);
}
.np-overlay.open .np-drawer { transform: translateX(0) }

.np-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,.08);
  border: none;
  color: var(--text);
  font-size: 1.1rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.np-close:hover { background: rgba(255,255,255,.18) }

.np-header { margin-bottom: 18px; padding-right: 40px }
.np-title { font-size: 1.4rem; font-weight: 800; line-height: 1.2; margin-bottom: 4px }
.np-subtitle { font-size: .82rem; color: var(--text2); margin-bottom: 10px }

.np-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.np-rank-badge {
  font-size: .8rem;
  color: #fbbf24;
  font-weight: 600;
  margin-top: 4px;
}

.np-info-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px }
.np-info-tag {
  font-size: .75rem;
  padding: 3px 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text2);
}

.np-section { margin-bottom: 20px }
.np-section-title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--text2);
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.np-trip-item {
  font-size: .83rem;
  padding: 6px 10px;
  background: rgba(124,58,237,.08);
  border: 1px solid rgba(124,58,237,.2);
  border-radius: 8px;
  margin-bottom: 4px;
}

.np-info-row {
  font-size: .83rem;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.np-feats { display: flex; flex-wrap: wrap; gap: 6px }
.np-feat {
  font-size: .75rem;
  padding: 3px 10px;
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.2);
  color: #86efac;
  border-radius: 14px;
}

.np-clima-grid {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 72px;
}
.np-clima-col { display: flex; flex-direction: column; align-items: center; flex: 1 }
.np-clima-bar { width: 100%; border-radius: 3px 3px 0 0; min-height: 4px; transition: height .3s }
.np-clima-label { font-size: .55rem; color: var(--text2); margin-top: 3px }
.np-clima-temp { font-size: .6rem; font-weight: 700 }

.np-hint { opacity: .45; font-size: .75rem; vertical-align: middle }

/* ══════════════════════════════════════
   🗺️ DESTINATION GUIDE — Inline Espandibile
══════════════════════════════════════ */

/* Bottone apertura guida nella trip-card */
.guide-open-btn {
  background: linear-gradient(135deg, rgba(99,102,241,.2), rgba(16,185,129,.15));
  border: 1px solid rgba(99,102,241,.35);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  transition: all .2s;
  margin-top: 4px;
}
.guide-open-btn:hover {
  background: linear-gradient(135deg, rgba(99,102,241,.35), rgba(16,185,129,.25));
  transform: translateY(-1px);
}

/* Sezione guida espandibile */
.trip-guide-section {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s cubic-bezier(.4,0,.2,1);
  background: var(--surface);
  border-radius: 0 0 16px 16px;
  border: 1px solid var(--border);
  border-top: none;
}
.trip-guide-section.open {
  max-height: 9000px;
  overflow: visible;
}
.trip-guide-section:empty { border: none; }

/* Inner container */
.guide-inner { padding: 0 0 24px; }

/* — TABS — */
.guide-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 16px 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.guide-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text2);
  padding: 8px 14px;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  border-radius: 8px 8px 0 0;
  transition: all .15s;
}
.guide-tab:hover { color: var(--text); background: rgba(255,255,255,.05); }
.guide-tab.active { color: var(--purple, #818cf8); border-bottom-color: var(--purple, #818cf8); }

/* — TAB CONTENT — */
.guide-tab-content { display: none; padding: 16px; }
.guide-tab-content.active { display: block; }

/* — MAP HEADER (day selector) — */
.guide-map-header { margin-bottom: 10px }
.guide-day-selector {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.gday-btn {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 600;
  transition: all .15s;
}
.gday-btn:hover { background: rgba(255,255,255,.12); color: var(--text); }
.gday-btn.active { background: var(--gday-col, #818cf8); color: #fff; border-color: transparent; }

/* — MAP CONTAINER — */
.guide-map-container { border-radius: 12px; overflow: hidden; margin-bottom: 14px; }

/* Pin marker sulla mappa */
.gmap-pin {
  width: 38px; height: 38px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 3px 10px rgba(0,0,0,.4);
  border: 2px solid rgba(255,255,255,.2);
}
.gmap-pin > span, .gmap-pin { line-height: 1 }
/* Popup mappa */
.gmap-popup { font-size: .82rem; max-width: 260px; color: #1e293b; }
.gmap-popup strong { display: block; margin-bottom: 4px; font-size: .9rem; }
.gmap-popup p { margin: 4px 0 0; }

/* — POI GRID — */
.guide-poi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.guide-poi-card {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-left: 3px solid;
  border-radius: 10px;
  padding: 12px;
}
.gpc-header { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 6px; }
.gpc-icon { font-size: 1.4rem; flex-shrink: 0; }
.gpc-name { font-weight: 700; font-size: .85rem; line-height: 1.2; }
.gpc-desc { font-size: .75rem; color: var(--text2); margin-top: 2px; }
.gpc-detail { font-size: .74rem; color: var(--text2); line-height: 1.5; white-space: pre-line; }

/* — SEZIONE GENERICA — */
.guide-section-title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.guide-list { padding-left: 20px; margin: 0; }
.guide-list li { font-size: .83rem; line-height: 1.7; color: var(--text); }
.guide-section-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 600px) { .guide-section-split { grid-template-columns: 1fr; } }

/* — INFO PRATICHE — */
.guide-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px;
}
.guide-info-item {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.gii-key { font-size: .72rem; font-weight: 700; color: var(--purple,#818cf8); margin-bottom: 4px; }
.gii-val { font-size: .8rem; line-height: 1.5; color: var(--text); }

/* — DIVING INFO — */
.guide-diving-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

/* — ITINERARIO GIORNI — */
.guide-day-block {
  border-left: 3px solid;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: rgba(255,255,255,.03);
  border-radius: 0 10px 10px 0;
}
.gdb-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.gdb-emoji { font-size: 1.2rem; }
.gdb-title { font-weight: 700; font-size: .9rem; }
.gdb-steps { padding-left: 20px; margin: 0; }
.gdb-steps li { font-size: .82rem; line-height: 1.7; color: var(--text2); }

/* — UNAVAILABLE STATE — */
.guide-unavailable {
  padding: 32px;
  text-align: center;
  color: var(--text2);
  font-size: .85rem;
  line-height: 1.7;
}

/* Fix popup Leaflet mappa guide — contrasto testo */
.guide-map-container .leaflet-popup-content-wrapper {
  background: #1e293b;
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 8px 24px rgba(0,0,0,.6);
  border-radius: 10px;
}
.guide-map-container .leaflet-popup-tip { background: #1e293b; }
.guide-map-container .leaflet-popup-close-button { color: #94a3b8 !important; }
.gmap-popup { font-size: .82rem; max-width: 260px; color: #f1f5f9; }
.gmap-popup strong { display: block; margin-bottom: 4px; font-size: .88rem; color: #e2e8f0; }
.gmap-popup p { margin: 4px 0 0; color: #cbd5e1; line-height: 1.5; }

/* Popup mappa guide — scrollabile con testo completo */
.guide-map-container .leaflet-popup-content {
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(129,140,248,.5) transparent;
}
.guide-map-container .leaflet-popup-content::-webkit-scrollbar { width: 4px; }
.guide-map-container .leaflet-popup-content::-webkit-scrollbar-thumb { background: rgba(129,140,248,.5); border-radius: 4px; }
.gmap-detail { font-size: .78rem; color: #cbd5e1; line-height: 1.6; margin-top: 6px; }

/* Bottone Leggi tutto / Mostra meno nelle POI card */
.gpc-more-btn {
  background: none;
  border: none;
  color: #818cf8;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 4px;
  text-decoration: underline;
  vertical-align: baseline;
}
.gpc-more-btn:hover { color: #a5b4fc; }

/* ─── Tooltip stat-card hover ─── */
.stat-card-tip { position: relative; }
.stat-tooltip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--card2, #1e293b); border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px; padding: 10px 14px; min-width: 220px; max-width: 320px;
  font-size: .78rem; line-height: 1.6; color: var(--text1, #e2e8f0);
  box-shadow: 0 8px 24px rgba(0,0,0,.5); z-index: 999; white-space: pre-wrap;
  pointer-events: none;
}
.stat-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--card2, #1e293b);
}

/* ─── Quiz Sogni button ─── */
.quiz-trigger-btn {
  background: linear-gradient(135deg, #a855f7, #ec4899); color: #fff;
  border: none; border-radius: 20px; padding: 4px 14px; font-size: .78rem;
  cursor: pointer; vertical-align: middle; margin-left: 8px;
  transition: opacity .2s; font-weight: 600;
}
.quiz-trigger-btn:hover { opacity: .85; }

/* ─── Stats: nazioni grid ─── */
.stats-nations-grid {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
}
.stats-nation-chip {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px; padding: 4px 12px; font-size: .82rem;
}

/* ─── Stats: continenti grid ─── */
.stats-continents-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px; margin-top: 10px;
}
.stats-continent-card {
  background: rgba(255,255,255,.05); border-radius: 10px;
  padding: 10px 14px; border-left: 3px solid #22c55e;
}

/* ─── Bucket Quiz Modal ─── */
.bucket-quiz-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
  animation: fadeIn .2s ease;
}
.bucket-quiz-panel {
  background: var(--card, #1e293b); border-radius: 20px;
  width: min(560px, 95vw); max-height: 90vh; overflow-y: auto;
  padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.7);
  border: 1px solid rgba(255,255,255,.1);
}
.quiz-question-text {
  font-size: 1.15rem; font-weight: 600; margin: 20px 0 24px; line-height: 1.5;
  text-align: center; color: var(--text1, #e2e8f0);
}
.quiz-question-emoji { font-size: 2.5rem; text-align: center; margin-bottom: 8px; }
.quiz-progress { font-size: .75rem; color: var(--text2, #94a3b8); text-align: center; margin-bottom: 16px; }
.quiz-btn-row { display: flex; flex-direction: column; gap: 10px; }
.quiz-btn {
  width: 100%; padding: 12px 18px; border-radius: 12px; border: 1px solid rgba(255,255,255,.15);
  font-size: .92rem; cursor: pointer; font-weight: 500; transition: all .2s;
}
.quiz-btn.yes  { background: linear-gradient(135deg,#22c55e,#16a34a); color:#fff; border:none; }
.quiz-btn.add  { background: linear-gradient(135deg,#a855f7,#6d28d9); color:#fff; border:none; }
.quiz-btn.skip { background: rgba(255,255,255,.06); color: var(--text2,#94a3b8); }
.quiz-btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.quiz-match-info {
  background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3);
  border-radius: 10px; padding: 10px 14px; font-size: .82rem; margin-top: 12px; display: none;
}
.quiz-no-match {
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3);
  border-radius: 10px; padding: 10px 14px; font-size: .82rem; margin-top: 12px; display: none;
  color: #f87171;
}
.quiz-done { text-align: center; padding: 30px; }
.quiz-done-emoji { font-size: 3rem; margin-bottom: 12px; }

/* ── Scrollbar personalizzata globale ── */
* { scrollbar-width: thin; scrollbar-color: rgba(129,140,248,.35) transparent; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(129,140,248,.35); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(129,140,248,.6); }
::-webkit-scrollbar-corner { background: transparent; }

/* Bucket list colonne: scrollbar ancora più sottile */
.bucket-col-scroll { scrollbar-width: thin; scrollbar-color: rgba(129,140,248,.2) transparent; }
.bucket-col-scroll::-webkit-scrollbar { width: 3px; }
.bucket-col-scroll::-webkit-scrollbar-thumb { background: rgba(129,140,248,.3); border-radius: 10px; }

/* ── Master-Detail Layout (Van & Treno) ── */
.van-master-detail {
  display: grid;
  grid-template-columns: 58% 40%;
  gap: 16px;
  align-items: start;
  margin-top: 4px;
}
.van-master { min-width: 0; }
.van-detail-panel {
  position: sticky;
  top: 96px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 20px;
  min-height: 200px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.van-detail-panel h4 {
  font-size: .82rem;
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 14px 0 6px;
}
.van-detail-panel ul { padding-left: 18px; margin: 0; }
.van-detail-panel p { font-size: .87rem; color: var(--text2); margin: 0; }
.vdp-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: var(--text2);
  font-size: .9rem;
  text-align: center;
  padding: 20px;
}
.vdp-header {
  padding-bottom: 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.vdp-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text1);
}
/* 2-column card grid */
.van-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
/* Card selected highlight */
.van-card.selected, .train-card.selected {
  border-color: var(--accent2) !important;
  background: rgba(129,140,248,.12) !important;
  box-shadow: 0 0 0 2px rgba(129,140,248,.25);
}
/* Bigger cards */
.van-card, .train-card {
  padding: 14px 16px;
}
.vc-name, .tc-name { font-size: 1rem; }
.vc-acts, .tc-acts { font-size: .82rem; margin-top: 8px; }
/* Mobile */
@media (max-width: 768px) {
  .van-master-detail { grid-template-columns: 1fr; }
  .van-detail-panel { position: static; max-height: none; }
  .van-grid-2col { grid-template-columns: 1fr; }
}
