/* =============================================
   BLOCCO 1 — FONDAMENTA
   Variabili · Reset · Utility · Scrollbar
   ============================================= */

/* =============================================
   IMPORT FONT
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* =============================================
   VARIABILI CSS — SISTEMA LIGHT PROFESSIONALE
   ============================================= */
:root {

  /* ── Backgrounds ── */
  --bg:              #f4f4ef;
  --surface:         #ffffff;
  --surface-soft:    #f8f8f5;
  --surface-raised:  #ffffff;
  --hover:           #efefe9;
  --focus:           #eef1ff;

  /* ── Borders ── */
  --border:          #e2e2dc;
  --border-strong:   #c8c8c2;
  --week-divider:    #a8a8a2;

  /* ── Text ── */
  --text-primary:    #0e0e0d;
  --text-secondary:  #484843;
  --text-muted:      #96968f;
  --text-inverse:    #ffffff;

  /* ── Accent principale ── */
  --accent:          #191919;
  --accent-hover:    #2e2e2e;
  --accent-soft:     #efefed;
  --accent-blue:     #3b5bff;
  --accent-blue-soft:#eef0ff;

  /* ── Calendar semantics ── */
  --today-bg:        #fffbeb;
  --today-border:    #f59e0b;
  --weekend-bg:      #fafaf7;

  /* ── Booking colors ── */
  --booking-small:   #3b5bff;
  --booking-medium:  #3b5bff;
  --booking-large:   #3b5bff;
  --booking-pending: #d97706;
  --booking-checkin: #3b5bff;

  /* ── Occupancy ── */
  --occ-low:         #d1fae5;
  --occ-low-text:    #065f46;
  --occ-medium:      #fef3c7;
  --occ-medium-text: #92400e;
  --occ-high:        #fee2e2;
  --occ-high-text:   #991b1b;

  /* ── Status badge ── */
  --badge-confirmed-bg:   #e0f2fe;
  --badge-confirmed-text: #0369a1;
  --badge-pending-bg:     #fef9c3;
  --badge-pending-text:   #854d0e;
  --badge-cancelled-bg:   #fee2e2;
  --badge-cancelled-text: #991b1b;

  /* ── Layout dimensioni fisse ── */
  --room-col:        160px;
  --day-col:         112px;
  --row-h:           62px;
  --header-h:        60px;
  --daily-w:         240px;

  /* ── Spacing scale ── */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* ── Border radius ── */
  --r-xs:   5px;
  --r-sm:   9px;
  --r-md:   13px;
  --r-lg:   18px;
  --r-xl:   24px;
  --r-2xl:  32px;
  --r-full: 9999px;

  /* ── Ombre ── */
  --sh-xs: 0 1px 2px rgba(0,0,0,0.04);
  --sh-sm: 0 2px 6px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.03);
  --sh:    0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --sh-md: 0 8px 24px rgba(0,0,0,0.09), 0 2px 6px rgba(0,0,0,0.04);
  --sh-lg: 0 16px 40px rgba(0,0,0,0.11), 0 4px 8px rgba(0,0,0,0.04);
  --sh-modal: 0 24px 64px rgba(0,0,0,0.14), 0 8px 16px rgba(0,0,0,0.06);

  /* ── Typography ── */
  --font: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --t-2xs: 10px;
  --t-xs:  11px;
  --t-sm:  13px;
  --t-md:  15px;
  --t-lg:  17px;
  --t-xl:  20px;
  --t-2xl: 24px;
  --t-3xl: 30px;

  /* ── Animazioni ── */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast:  100ms;
  --t-mid:   170ms;
  --t-slow:  250ms;
  --t-modal: 210ms;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: var(--t-md);
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.55;
  letter-spacing: -0.01em;
  overflow-x: hidden;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: opacity var(--t-fast);
}
a:hover { opacity: 0.72; }

ul, ol { list-style: none; }

img, svg {
  display: block;
  max-width: 100%;
}

input, textarea, select, button {
  font-family: var(--font);
  font-size: var(--t-md);
  outline: none;
  border: none;
  letter-spacing: inherit;
}

button { cursor: pointer; }

/* =============================================
   SCROLLBAR CUSTOM
   ============================================= */
::-webkit-scrollbar        { width: 4px; height: 4px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  {
  background: var(--border-strong);
  border-radius: var(--r-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

/* =============================================
   FOCUS RING ACCESSIBILE
   ============================================= */
:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* =============================================
   UTILITY GLOBALI
   ============================================= */
.truncate {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hidden {
  display: none !important;
}

.form-error {
  background: #fef2f2;
  border: 1px solid rgba(220,38,38,.22);
  color: #b91c1c;
  border-radius: var(--r-sm);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--t-sm);
  font-weight: 500;
  margin-top: var(--sp-3);
}

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

.redirect-msg {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font-size: var(--t-md);
  font-weight: 500;
}

.error-msg {
  color: var(--booking-large);
  font-size: var(--t-sm);
  font-weight: 500;
  min-height: 18px;
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
}

/* =============================================
   BLOCCO 2 — SISTEMA LAYOUT
   Dashboard · Header · Pagine secondarie
   ============================================= */

/* =============================================
   STRUTTURA PAGINA DASHBOARD
   Header sticky full-width + corpo a due colonne
   ============================================= */
.dashboard-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

/* Corpo sotto l'header: daily sidebar + calendario */
.dashboard-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* =============================================
   HEADER — full width, sticky
   ============================================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--sh-xs);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-5);
  gap: var(--sp-4);
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
  min-width: 0;
}

.header-logo {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: var(--sh-xs);
}

.header-title {
  font-size: var(--t-lg);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.header-right .btn-ghost {
  height: 36px;
}

/* =============================================
   DAILY DASHBOARD — colonna sinistra fissa
   ============================================= */
.daily-dashboard {
  width: var(--daily-w);
  min-width: var(--daily-w);
  flex-shrink: 0;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* =============================================
   COLONNA CALENDARIO — area destra
   ============================================= */
.calendar-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h));
  overflow: hidden;
}

/* Controlli navigazione calendario */
.calendar-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* Wrapper scroll orizzontale calendario */
.calendar-wrapper {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  padding: var(--sp-4);
  background: var(--bg);
}

/* =============================================
   PAGINE SECONDARIE
   housekeeping.html · clients.html
   Header + corpo scrollabile, NO sidebar
   ============================================= */
.secondary-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

.secondary-page .app-header {
  /* Eredita tutto dall'header base — nessuna override necessaria */
}

.secondary-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-5);
}

/* Contenitore centrato per pagine a singola colonna */
.page-container {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

/* =============================================
   STATS ROW — nella daily dashboard
   Stack verticale, card full-width
   ============================================= */
.stats-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  width: 100%;
}

.stat-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  transition:
    border-color var(--t-fast) var(--ease-out),
    box-shadow   var(--t-fast) var(--ease-out),
    transform    var(--t-fast) var(--ease-out);
}

.stat-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--sh-sm);
  transform: translateY(-1px);
}

.stat-number {
  font-size: var(--t-xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: var(--t-2xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: right;
}

/* =============================================
   DAILY LISTS — arrivi e partenze
   ============================================= */
.daily-lists {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  width: 100%;
}

.daily-list h3 {
  font-size: var(--t-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: var(--sp-2);
}

.daily-list ul {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.daily-list li {
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--text-primary);
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background var(--t-fast);
}

.daily-list li:hover {
  background: var(--hover);
}

/* Separatore visivo tra stats e liste */
.daily-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  flex-shrink: 0;
}

/* =============================================
   DRAWER TRIGGER — bottone mobile per daily
   Visibile solo su mobile
   ============================================= */
.drawer-trigger {
  display: none;
  height: 36px;
  padding: 0 var(--sp-3);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-full);
  color: var(--text-secondary);
  font-size: var(--t-sm);
  font-weight: 600;
  gap: var(--sp-2);
  align-items: center;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
  transition:
    background    var(--t-fast) var(--ease-out),
    border-color  var(--t-fast) var(--ease-out);
}

.drawer-trigger:hover {
  background: var(--hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

/* =============================================
   OVERLAY DRAWER — mobile
   ============================================= */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(14,14,13,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--t-modal) var(--ease-out);
}

.drawer-overlay.open {
  opacity: 1;
}

/* =============================================
   RESPONSIVE — TABLET (≤ 1024px)
   ============================================= */
@media (max-width: 1024px) {
  :root {
    --daily-w: 220px;
    --room-col: 140px;
    --day-col:  100px;
  }
}

/* =============================================
   RESPONSIVE — MOBILE (≤ 768px)
   Daily diventa drawer dal basso
   ============================================= */
@media (max-width: 768px) {
  :root {
    --header-h: 54px;
    --room-col: 90px;
    --day-col:  78px;
    --row-h:    54px;
  }

  .dashboard-body {
    flex-direction: column;
    overflow: visible;
  }

  /* La daily sidebar diventa drawer fixed */
  .daily-dashboard {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 160;
    width: 100%;
    min-width: unset;
    height: auto;
    max-height: 80vh;
    border-right: none;
    border-top: 1.5px solid var(--border);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    box-shadow: var(--sh-lg);
    padding: var(--sp-5) var(--sp-5) var(--sp-8);
    /* Di default chiuso: traslato fuori schermo */
    transform: translateY(100%);
    transition: transform var(--t-modal) var(--ease-out);
  }

  /* Handle visivo drawer */
  .daily-dashboard::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--border-strong);
    border-radius: var(--r-full);
    margin: 0 auto var(--sp-4);
    flex-shrink: 0;
  }

  .daily-dashboard.drawer-open {
    transform: translateY(0);
  }

  /* Overlay drawer visibile su mobile */
  .drawer-overlay {
    display: block;
    pointer-events: none;
  }

  .drawer-overlay.open {
    pointer-events: all;
  }

  /* Trigger bottone visibile */
  .drawer-trigger {
    display: flex;
  }

  /* La colonna calendario prende tutta l'altezza */
  .calendar-column {
    height: calc(100vh - var(--header-h));
    width: 100%;
  }

/* Stats row su mobile: una riga compatta */
  .stats-row {
    display: flex;
    flex-direction: row;
    gap: var(--sp-2);
  }

  .stat-card {
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: var(--sp-2) var(--sp-1);
  }

  .stat-label {
    text-align: center;
    font-size: 9px;
  }

  .stat-number {
    font-size: var(--t-lg);
  }

  /* Pagine secondarie */
  .secondary-body {
    padding: var(--sp-4);
  }
}

/* =============================================
   RESPONSIVE — MOBILE SMALL (≤ 480px)
   ============================================= */
@media (max-width: 480px) {
  :root {
    --header-h: 50px;
    --room-col: 76px;
    --day-col:  66px;
    --row-h:    50px;
  }

  .app-header {
    padding: 0 var(--sp-4);
  }

  .secondary-body {
    padding: var(--sp-3);
  }
}

/* =============================================
   BLOCCO 3 — NAVIGAZIONE E BOTTONI
   Header interni · Calendar controls · 
   Bottoni globali · FAB
   ============================================= */

/* =============================================
   BOTTONI GLOBALI — sistema unificato
   ============================================= */

/* ── Primario — azione principale ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  background: var(--accent);
  color: var(--text-inverse);
  font-size: var(--t-sm);
  font-weight: 600;
  padding: 10px var(--sp-5);
  border-radius: var(--r-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow: var(--sh-xs);
  transition:
    background  var(--t-fast) var(--ease-out),
    transform   var(--t-fast) var(--ease-out),
    box-shadow  var(--t-fast) var(--ease-out);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--sh-sm);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--sh-xs);
}

.btn-full {
  width: 100%;
}

/* ── Secondario — azione neutra ── */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  padding: 10px var(--sp-5);
  font-size: var(--t-sm);
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition:
    background    var(--t-fast) var(--ease-out),
    border-color  var(--t-fast) var(--ease-out),
    color         var(--t-fast) var(--ease-out),
    transform     var(--t-fast) var(--ease-out);
}

.btn-secondary:hover {
  background: var(--hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
  transform: translateY(-1px);
}

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

/* ── Danger — azione distruttiva ── */
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  background: transparent;
  border: 1.5px solid rgba(220,38,38,0.35);
  border-radius: var(--r-sm);
  color: var(--booking-large);
  padding: 10px var(--sp-5);
  font-size: var(--t-sm);
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition:
    background    var(--t-fast) var(--ease-out),
    border-color  var(--t-fast) var(--ease-out),
    box-shadow    var(--t-fast) var(--ease-out),
    transform     var(--t-fast) var(--ease-out);
}

.btn-danger:hover {
  background: rgba(220,38,38,0.06);
  border-color: var(--booking-large);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.07);
  transform: translateY(-1px);
}

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

/* ── Ghost — azione secondaria leggera ── */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  padding: 7px var(--sp-4);
  font-size: var(--t-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: -0.01em;
  transition:
    background    var(--t-fast) var(--ease-out),
    border-color  var(--t-fast) var(--ease-out),
    color         var(--t-fast) var(--ease-out);
}

.btn-ghost:hover {
  background: var(--hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* ── Icon — bottone quadrato solo icona ── */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  font-size: var(--t-lg);
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background    var(--t-fast) var(--ease-out),
    border-color  var(--t-fast) var(--ease-out),
    color         var(--t-fast) var(--ease-out),
    transform     var(--t-fast) var(--ease-out);
}

.btn-icon:hover {
  background: var(--hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
  transform: translateY(-1px);
}

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

/* =============================================
   NAVIGAZIONE CALENDARIO
   Frecce · Oggi · Periodo
   ============================================= */

/* Freccia navigazione */
.btn-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  font-size: var(--t-md);
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background    var(--t-fast) var(--ease-out),
    border-color  var(--t-fast) var(--ease-out),
    color         var(--t-fast) var(--ease-out),
    transform     var(--t-fast) var(--ease-out);
}

.btn-nav:hover {
  background: var(--hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
  transform: translateY(-1px);
}

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

/* Bottone "Oggi" */
.btn-today {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--r-full);
  padding: 6px var(--sp-4);
  font-size: var(--t-sm);
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition:
    background  var(--t-fast) var(--ease-out),
    transform   var(--t-fast) var(--ease-out);
}

.btn-today:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

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

/* Label periodo — es. "Mar 2025" */
.calendar-period {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
  margin-left: var(--sp-1);
  white-space: nowrap;
  user-select: none;
}

/* =============================================
   FAB — Bottone nuova prenotazione
   ============================================= */
.btn-add {
  position: fixed;
  bottom: var(--sp-8);
  right: var(--sp-6);
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: var(--r-full);
  background: var(--accent);
  color: var(--text-inverse);
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: var(--sh-lg);
  transition:
    transform    var(--t-fast) var(--ease-out),
    box-shadow   var(--t-fast) var(--ease-out),
    background   var(--t-fast) var(--ease-out);
}

.btn-add:hover {
  transform: scale(1.07) translateY(-2px);
  box-shadow: 0 20px 44px rgba(0,0,0,0.17);
  background: var(--accent-hover);
}

.btn-add:active {
  transform: scale(0.96);
  box-shadow: var(--sh-sm);
}

/* =============================================
   LOGIN PAGE — form di accesso
   ============================================= */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  padding: var(--sp-5);
}

.login-wrapper {
  width: 100%;
  max-width: 380px;
}

.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: var(--sp-10) var(--sp-8);
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  box-shadow: var(--sh-md);
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  text-align: center;
}

.login-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo h1 {
  font-size: var(--t-2xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.input-group label {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.input-group input {
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  padding: 12px var(--sp-4);
  font-size: var(--t-md);
  width: 100%;
  transition:
    border-color  var(--t-fast) var(--ease-out),
    background    var(--t-fast) var(--ease-out),
    box-shadow    var(--t-fast) var(--ease-out);
}

.input-group input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.input-group input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(25,25,25,0.07);
}

/* =============================================
   RESPONSIVE NAVIGAZIONE
   ============================================= */
@media (max-width: 768px) {
  .calendar-controls {
    padding: var(--sp-2) var(--sp-4);
    gap: var(--sp-2);
  }

  .calendar-period {
    font-size: var(--t-xs);
  }

  .btn-add {
    bottom: var(--sp-5);
    right: var(--sp-4);
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  /* Su mobile il FAB è spostato a destra,
     il drawer trigger è a sinistra — non si sovrappongono */
  .btn-add {
    right: var(--sp-4);
  }

  /* ── Header mobile: icone più piccole, spazi ottimizzati ── */
  .header-right {
    gap: 5px;
  }

  .btn-icon {
    width: 30px;
    height: 30px;
  }

  .btn-icon-img {
    width: 18px;
    height: 18px;
  }

  /* Analytics e Esci: riduzione dimensione su mobile */
  .btn-ghost-iconable {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 480px) {
  .login-box {
    padding: var(--sp-8) var(--sp-5);
    border-radius: var(--r-xl);
    gap: var(--sp-6);
  }

  .login-logo h1 {
    font-size: var(--t-xl);
  }

  .btn-ghost span {
    display: none;
  }

  .calendar-period {
    display: none;
  }
}

/* ── Hover disabilitato su touch ── */
@media (hover: none) {
  .btn-primary:hover,
  .btn-secondary:hover,
  .btn-danger:hover,
  .btn-nav:hover,
  .btn-icon:hover,
  .btn-today:hover {
    transform: none;
  }

  .btn-add:hover {
    transform: none;
    box-shadow: var(--sh-lg);
  }
}
/* =============================================
   BLOCCO 4 — CALENDARIO
   Inner · Header giorni · Occupancy ·
   Righe stanze · Celle · Booking blocks
   ============================================= */

/* =============================================
   CALENDARIO INNER — contenitore griglia
   ============================================= */
.calendar-inner {
  display: flex;
  flex-direction: column;
  min-width: max-content;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--sh-sm);
}

/* =============================================
   HEADER GIORNI — riga sticky in cima
   ============================================= */
.calendar-header-row {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

/* Angolo in alto a sinistra — sopra le label stanze */
.calendar-corner {
  width: var(--room-col);
  min-width: var(--room-col);
  height: var(--header-h);
  background: var(--surface-soft);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 var(--sp-4);
  font-size: var(--t-2xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  user-select: none;
}

/* Singola colonna giorno — header */
.day-header {
  width: var(--day-col);
  min-width: var(--day-col);
  height: var(--header-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border);
  gap: 3px;
  flex-shrink: 0;
  position: relative;
  cursor: default;
  user-select: none;
  transition: background var(--t-fast);
}

.day-header:last-child {
  border-right: none;
}

.day-header.today {
  background: var(--today-bg);
  border-bottom: 2px solid var(--today-border);
}

.day-header.weekend {
  background: var(--weekend-bg);
}

.day-header.week-start {
  border-left: 2px solid var(--week-divider);
}

/* Nome giorno — LUN MAR MER... */
.day-name {
  font-size: var(--t-2xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  line-height: 1;
}

/* Numero del giorno */
.day-number {
  font-size: var(--t-md);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  line-height: 1;
}

/* Numero giorno "oggi" — cerchio ambra */
.day-header.today .day-number {
  color: var(--today-border);
  background: rgba(245,158,11,0.13);
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--t-sm);
}

.day-header.weekend .day-name,
.day-header.weekend .day-number {
  color: var(--text-muted);
}

/* =============================================
   RIGA OCCUPAZIONE — sotto l'header giorni
   ============================================= */
.occupancy-row {
  display: flex;
  border-bottom: 1.5px solid var(--border);
  background: var(--surface);
}

.occupancy-corner {
  width: var(--room-col);
  min-width: var(--room-col);
  height: 32px;
  background: var(--surface-soft);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-4);
  font-size: var(--t-2xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  flex-shrink: 0;
  user-select: none;
}

.occupancy-cell {
  width: var(--day-col);
  min-width: var(--day-col);
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border);
  font-size: var(--t-xs);
  font-weight: 700;
  color: var(--text-muted);
  gap: 2px;
  flex-shrink: 0;
  letter-spacing: -0.2px;
  user-select: none;
  transition: filter var(--t-fast);
}

.occupancy-cell:last-child {
  border-right: none;
}

.occupancy-cell.occ-low {
  background: var(--occ-low);
  color: var(--occ-low-text);
}

.occupancy-cell.occ-medium {
  background: var(--occ-medium);
  color: var(--occ-medium-text);
}

.occupancy-cell.occ-high {
  background: var(--occ-high);
  color: var(--occ-high-text);
}

.occupancy-cell.today {
  outline: 2px solid var(--today-border);
  outline-offset: -2px;
}

/* =============================================
   RIGHE STANZE
   ============================================= */
.room-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.room-row:last-child {
  border-bottom: none;
}

/* Hover sull'intera riga — sfuma le celle */
.room-row:hover > .day-cell {
  background: var(--hover);
}

.room-row:hover > .day-cell.today {
  background: #fff8e0;
}

.room-row:hover > .day-cell.weekend {
  background: #f2f2ef;
}

/* Label stanza — sticky a sinistra */
.room-label {
  width: var(--room-col);
  min-width: var(--room-col);
  height: var(--row-h);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--sp-4);
  gap: 3px;
  flex-shrink: 0;
  position: sticky;
  left: 0;
  z-index: 10;
  box-shadow: 3px 0 8px rgba(0,0,0,0.04);
  user-select: none;
}

.room-label-name {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.room-label-capacity {
  font-size: var(--t-2xs);
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 1px 7px;
  width: fit-content;
}

/* =============================================
   CELLE GIORNI
   ============================================= */
.day-cell {
  width: var(--day-col);
  min-width: var(--day-col);
  height: var(--row-h);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out);
}

.day-cell:last-child {
  border-right: none;
}

/* Indicatore + al hover sulla cella vuota */
.day-cell:not(:has(.booking-block)):hover::after {
  content: '+';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: var(--t-xl);
  font-weight: 300;
  color: var(--text-muted);
  pointer-events: none;
  line-height: 1;
}

.day-cell.today {
  background: var(--today-bg);
}

.day-cell.weekend {
  background: var(--weekend-bg);
}

.day-cell.week-start {
  border-left: 2px solid var(--week-divider);
}

/* Stato drag-over */
.day-cell.drag-over {
  background: var(--accent-blue-soft) !important;
  outline: 2px dashed var(--accent-blue);
  outline-offset: -3px;
}

/* =============================================
   BOOKING BLOCKS — prenotazioni sulla griglia
   ============================================= */
.booking-block {
  position: absolute;
  top: 7px;
  bottom: 7px;
  border-radius: var(--r-md);
  padding: 0 var(--sp-3);
  font-size: var(--t-sm);
  color: #ffffff;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  user-select: none;
  box-shadow: var(--sh-sm);
  transition:
    transform   var(--t-mid) var(--ease-out),
    box-shadow  var(--t-mid) var(--ease-out),
    filter      var(--t-mid) var(--ease-out);
}

.booking-block:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
  z-index: 6;
  filter: brightness(1.07);
}

.booking-block:active {
  cursor: grabbing;
  transform: translateY(0) scale(0.98);
  box-shadow: var(--sh-xs);
}

/* ── Colori per dimensione gruppo ── */
.booking-block.small-group {
  background: linear-gradient(
    135deg,
    var(--booking-small) 0%,
    #5e71ec 100%
  );
}

.booking-block.medium-group {
  background: linear-gradient(
    135deg,
    var(--booking-medium) 0%,
    #253ac4e7 100%
  );
}

.booking-block.large-group {
  background: linear-gradient(
    135deg,
    var(--booking-large) 0%,
    #0d1b71e7 100%
  );
}

.booking-block.status-pending {
  background: linear-gradient(
    135deg,
    var(--booking-pending) 0%,
    #d49022 100%
  );
  color: #ffffff;
}

.booking-block.status-checkin {
  background: linear-gradient(
    135deg,
    var(--booking-checkin) 0%,
    #10b981 100%
  );
}

/* ── Testo nome ospite ── */
.booking-name {
  font-size: var(--t-sm);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.18);
}

/* ── Blocchi overlap (stanza Meja) ── */
.booking-block.overlap-slot {
  padding: 0 var(--sp-2);
  border-radius: var(--r-sm);
  align-items: center;
}

.booking-block.overlap-slot .booking-flags {
  display: none;
}

.booking-block.overlap-slot .booking-name {
  font-size: var(--t-2xs);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* ── Icone esigenze ── */
.booking-flags {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.95;
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.75));
}

/* ── Continuità sinistra ── */
.booking-block.continues-left {
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding-left: var(--sp-2);
  margin-left: 0;
}

.booking-block.continues-left::before {
  content: '◀';
  font-size: var(--t-2xs);
  opacity: 0.65;
  flex-shrink: 0;
}

/* ── Continuità destra ── */
.booking-block.continues-right {
  border-radius: var(--r-md) 0 0 var(--r-md);
  padding-right: var(--sp-2);
}

.booking-block.continues-right::after {
  content: '▶';
  font-size: var(--t-2xs);
  opacity: 0.65;
  flex-shrink: 0;
}

/* ── Entrambi i lati ── */
.booking-block.continues-left.continues-right {
  border-radius: 0;
}

/* =============================================
   RESPONSIVE CALENDARIO
   ============================================= */
@media (max-width: 768px) {
  .calendar-inner {
    border-radius: var(--r-lg);
  }

  .calendar-corner,
  .occupancy-corner {
    padding: 0 var(--sp-2);
    font-size: 9px;
  }

  .room-label {
    padding: 0 var(--sp-2);
  }

  .room-label-capacity {
    display: none;
  }

  .booking-block {
    top: 5px;
    bottom: 5px;
    padding: 0 var(--sp-2);
    border-radius: var(--r-sm);
  }

  .booking-name {
    font-size: var(--t-xs);
  }

  .booking-flags {
    display: none;
  }

  .day-header.today .day-number {
    width: 24px;
    height: 24px;
    font-size: var(--t-xs);
  }
}

@media (max-width: 480px) {
  .calendar-corner,
  .occupancy-corner {
    padding: 0 var(--sp-1);
  }

  .room-label {
    padding: 0 var(--sp-1);
  }

  .room-label-name {
    font-size: var(--t-xs);
  }

  .occupancy-cell {
    font-size: 9px;
  }
}

/* ── Hover disabilitato su touch ── */
@media (hover: none) {
  .booking-block:hover {
    transform: none;
    box-shadow: var(--sh-sm);
    filter: none;
  }

  .room-row:hover > .day-cell {
    background: var(--surface);
  }

  .room-row:hover > .day-cell.today {
    background: var(--today-bg);
  }

  .room-row:hover > .day-cell.weekend {
    background: var(--weekend-bg);
  }
}
/* =============================================
   BLOCCO 5 — MODAL E FORM
   Overlay · Box · Header/Body/Footer ·
   Input · Select · Textarea · Flags ·
   Detail rows · Badge stato
   ============================================= */

/* =============================================
   MODAL OVERLAY
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(14,14,13,0.42);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
}

.modal-overlay.open {
  display: flex;
  animation: overlayIn var(--t-modal) var(--ease-out) forwards;
}

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

/* =============================================
   MODAL BOX
   ============================================= */
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh-modal);
  animation: modalIn var(--t-modal) var(--ease-out) forwards;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =============================================
   MODAL HEADER
   ============================================= */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6) var(--sp-4);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  flex-shrink: 0;
}

.modal-title {
  font-size: var(--t-xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  line-height: 1.2;
}

.modal-close {
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  border-radius: var(--r-full);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
  transition:
    background    var(--t-fast) var(--ease-out),
    color         var(--t-fast) var(--ease-out),
    border-color  var(--t-fast) var(--ease-out),
    transform     var(--t-fast) var(--ease-out);
}

.modal-close:hover {
  background: var(--hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
  transform: rotate(90deg);
}

/* =============================================
   MODAL BODY
   ============================================= */
.modal-body {
  padding: var(--sp-5) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  flex: 1;
}

/* =============================================
   MODAL FOOTER
   ============================================= */
.modal-footer {
  padding: var(--sp-4) var(--sp-6) var(--sp-5);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  justify-content: flex-end;
  border-radius: 0 0 var(--r-2xl) var(--r-2xl);
  flex-shrink: 0;
  background: var(--surface);
}

/* Pulsante danger spinto a sinistra — solo modal con 3 pulsanti */
#bookingModal .modal-footer .btn-danger,
#externalModal .modal-footer .btn-danger {
  margin-right: auto;
}

/* =============================================
   FORM — struttura
   ============================================= */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

/* Due colonne affiancate */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.form-label {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  line-height: 1;
}

/* =============================================
   FORM — input testo
   ============================================= */
.form-input {
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  padding: 10px var(--sp-4);
  font-size: var(--t-md);
  font-weight: 400;
  width: 100%;
  transition:
    border-color  var(--t-fast) var(--ease-out),
    background    var(--t-fast) var(--ease-out),
    box-shadow    var(--t-fast) var(--ease-out);
}

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

.form-input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(25,25,25,0.07);
}

.form-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =============================================
   FORM — select
   ============================================= */
.form-select {
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  padding: 10px var(--sp-10) 10px var(--sp-4);
  font-size: var(--t-md);
  font-weight: 400;
  width: 100%;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2396968f' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-4) center;
  transition:
    border-color  var(--t-fast) var(--ease-out),
    background    var(--t-fast) var(--ease-out),
    box-shadow    var(--t-fast) var(--ease-out);
}

.form-select:focus {
  border-color: var(--accent);
  background-color: var(--surface);
  box-shadow: 0 0 0 3px rgba(25,25,25,0.07);
}

/* =============================================
   FORM — textarea
   ============================================= */
.form-textarea {
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  padding: 10px var(--sp-4);
  font-size: var(--t-md);
  font-weight: 400;
  width: 100%;
  resize: vertical;
  min-height: 82px;
  line-height: 1.55;
  transition:
    border-color  var(--t-fast) var(--ease-out),
    background    var(--t-fast) var(--ease-out),
    box-shadow    var(--t-fast) var(--ease-out);
}

.form-textarea::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.form-textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(25,25,25,0.07);
}

/* =============================================
   FLAGS — checkbox esigenze ospite
   ============================================= */
.flags-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}

.flag-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
  cursor: pointer;
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--text-secondary);
  user-select: none;
  line-height: 1.3;
  transition:
    background    var(--t-fast) var(--ease-out),
    border-color  var(--t-fast) var(--ease-out),
    color         var(--t-fast) var(--ease-out);
}

.flag-item:hover {
  background: var(--hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.flag-item input[type="checkbox"] {
  display: none;
}

.flag-item.checked {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text-primary);
  font-weight: 600;
}

.flag-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.flag-img-block {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.75));
}
/* =============================================
   DETAIL ROWS — popup dettaglio prenotazione
   ============================================= */
.booking-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
  gap: var(--sp-4);
}

.booking-detail-row:first-child {
  padding-top: 0;
}

.booking-detail-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.booking-detail-label {
  font-size: var(--t-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.booking-detail-value {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  line-height: 1.4;
}

.booking-detail-value--flags {
  font-size: 20px;
  line-height: 1.2;
}

/* =============================================
   BADGE STATO PRENOTAZIONE
   ============================================= */
.booking-status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: var(--t-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1;
}

.badge-confirmed {
  background: var(--badge-confirmed-bg);
  color: var(--badge-confirmed-text);
}

.badge-pending {
  background: var(--badge-pending-bg);
  color: var(--badge-pending-text);
}

.badge-cancelled {
  background: var(--badge-cancelled-bg);
  color: var(--badge-cancelled-text);
}

/* =============================================
   RESPONSIVE MODAL E FORM — mobile
   ============================================= */
@media (max-width: 768px) {

  /* Sheet dal basso su mobile */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

.modal-box {
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    animation: modalInMobile var(--t-modal) var(--ease-out) forwards;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

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

  /* Handle bar */
  .modal-header {
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    padding: var(--sp-5) var(--sp-5) var(--sp-4);
    /* Spazio per la handle bar */
    padding-top: calc(var(--sp-5) + 14px);
  }

  .modal-header::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 34px;
    height: 4px;
    background: var(--border-strong);
    border-radius: var(--r-full);
  }

  .modal-body {
    padding: var(--sp-4) var(--sp-5);
  }

  .modal-footer {
    padding: var(--sp-3) var(--sp-5) var(--sp-6);
  }

  /* Form row a colonna singola su mobile */
.form-row {
    grid-template-columns: 1fr !important;
    gap: var(--sp-3);
  }

  input[type="date"].form-input {
    width: 100%;
    font-size: 16px;
    padding: 12px var(--sp-3);
  }

  /* Flags mantiene 2 colonne anche su mobile */
  .flags-grid {
    grid-template-columns: 1fr 1fr;
  }

  .modal-title {
    font-size: var(--t-lg);
  }
}

@media (max-width: 480px) {
  .modal-header {
    padding: calc(var(--sp-4) + 14px) var(--sp-4) var(--sp-3);
  }

  .modal-body {
    padding: var(--sp-3) var(--sp-4);
    gap: var(--sp-3);
  }

  .modal-footer {
    padding: var(--sp-3) var(--sp-4) var(--sp-5);
    flex-wrap: wrap;
  }

  /* Su schermi molto piccoli il danger
     torna in riga con gli altri bottoni — solo modal con 3 pulsanti */
  #bookingModal .modal-footer .btn-danger,
  #externalModal .modal-footer .btn-danger {
    margin-right: 0;
    order: 3;
    width: 100%;
    justify-content: center;
  }
}
/* =============================================
   BLOCCO 6 — PAGINE SECONDARIE · FEEDBACK
   Clienti · Housekeeping · Toast ·
   Empty state · Drawer mobile · Print
   ============================================= */

/* =============================================
   SEARCH BAR — pagina clienti
   ============================================= */
.search-bar {
  position: relative;
  width: 100%;
}

.search-bar::before {
  content: '🔍';
  position: absolute;
  left: var(--sp-4);
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  pointer-events: none;
  line-height: 1;
  z-index: 1;
}

.search-bar input {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-full);
  color: var(--text-primary);
  padding: 11px var(--sp-5) 11px 40px;
  font-size: var(--t-md);
  font-weight: 400;
  width: 100%;
  box-shadow: var(--sh-xs);
  transition:
    border-color  var(--t-fast) var(--ease-out),
    box-shadow    var(--t-fast) var(--ease-out),
    background    var(--t-fast) var(--ease-out);
}

.search-bar input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(25,25,25,0.07), var(--sh-xs);
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

/* =============================================
   CLIENTI — lista e card
   ============================================= */
.client-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}

.client-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  box-shadow: var(--sh-xs);
  transition:
    background    var(--t-fast) var(--ease-out),
    border-color  var(--t-fast) var(--ease-out),
    box-shadow    var(--t-fast) var(--ease-out),
    transform     var(--t-fast) var(--ease-out);
}

.client-card:hover {
  background: var(--hover);
  border-color: var(--border-strong);
  box-shadow: var(--sh-sm);
  transform: translateY(-1px);
}

.client-card:active {
  transform: translateY(0);
  box-shadow: var(--sh-xs);
}

/* Avatar iniziali */
.client-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--t-sm);
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
  letter-spacing: -0.01em;
  user-select: none;
}

/* Info testo */
.client-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.client-name {
  font-size: var(--t-md);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-meta {
  font-size: var(--t-sm);
  color: var(--text-muted);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Contatore soggiorni */
.client-stays {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.client-stays-count {
  font-size: var(--t-xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
}

.client-stays-label {
  font-size: var(--t-2xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Stats bar clienti — sotto la search */
.clients-stats-bar {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
}

.clients-stats-bar .stat-card {
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3) var(--sp-2);
  gap: var(--sp-1);
  min-width: 0;
}

.clients-stats-bar .stat-number {
  font-size: var(--t-2xl);
}

.clients-stats-bar .stat-label {
  text-align: center;
}

/* =============================================
   HOUSEKEEPING — griglia camere
   ============================================= */
.housekeeping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.room-status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  padding-top: calc(var(--sp-5) + 6px);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  box-shadow: var(--sh-xs);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition:
    border-color  var(--t-fast) var(--ease-out),
    box-shadow    var(--t-fast) var(--ease-out),
    transform     var(--t-fast) var(--ease-out);
}

/* Banda cromatica in cima — colore semantico per stato */
.room-status-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--border-strong);
  transition: background var(--t-mid) var(--ease-out);
}

.room-status-card.status-clean::before    { background: linear-gradient(90deg, #ef4444, #f87171); }
.room-status-card.status-prepare::before  { background: linear-gradient(90deg, #d97706, #f59e0b); }
.room-status-card.status-occupied::before { background: linear-gradient(90deg, #059669, #34d399); }
.room-status-card.status-free::before     { background: var(--border-strong); }

.room-status-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--sh-sm);
  transform: translateY(-2px);
}

.room-status-card:active {
  transform: translateY(0);
}

.room-status-name {
  font-size: var(--t-md);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.room-status-capacity {
  font-size: var(--t-sm);
  color: var(--text-muted);
  font-weight: 400;
}

/* Badge stato camera */
.room-status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 5px var(--sp-3);
  border-radius: var(--r-full);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.2px;
  width: fit-content;
}

/* Dot indicatore colore */
.room-status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: currentColor;
  flex-shrink: 0;
}

/* ── Varianti stato camera ── */
.status-clean {
  background: var(--badge-cancelled-bg);
  color: var(--badge-cancelled-text);
  border: 1px solid rgba(220,38,38,0.12);
}

.status-prepare {
  background: var(--badge-pending-bg);
  color: var(--badge-pending-text);
  border: 1px solid rgba(217,119,6,0.12);
}

.status-occupied {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid rgba(5,150,105,0.12);
}

.status-free {
  background: var(--surface-soft);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Stats bar housekeeping */
.housekeeping-stats-bar {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-3) 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.housekeeping-stats-bar::-webkit-scrollbar {
  display: none;
}

.housekeeping-stats-bar .stat-card {
  flex: 1;
  min-width: 80px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3) var(--sp-2);
  gap: var(--sp-1);
}

.housekeeping-stats-bar .stat-number {
  font-size: var(--t-xl);
}

.housekeeping-stats-bar .stat-label {
  text-align: center;
}

/* =============================================
   TOAST — notifiche
   ============================================= */
.toast {
  position: fixed;
  bottom: var(--sp-8);
  right: var(--sp-6);
  z-index: 400;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-5);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--sh-md);
  display: none;
  align-items: center;
  gap: var(--sp-3);
  min-width: 220px;
  max-width: 320px;
  pointer-events: all;
  line-height: 1.4;
}

.toast.show {
  display: flex;
  animation: toastIn var(--t-modal) var(--ease-out) forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* ── Varianti toast ── */
.toast.toast-success {
  background: #f0fdf4;
  border-color: rgba(5,150,105,0.25);
  color: #065f46;
}

.toast.toast-error {
  background: #fef2f2;
  border-color: rgba(220,38,38,0.22);
  color: #991b1b;
}

.toast.toast-warning {
  background: #fffbeb;
  border-color: rgba(217,119,6,0.22);
  color: #92400e;
}

.toast.toast-info {
  background: var(--accent-blue-soft);
  border-color: rgba(59,91,255,0.18);
  color: #1e3a8a;
}

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-12) var(--sp-6);
  gap: var(--sp-3);
  width: 100%;
}

.empty-state-icon {
  font-size: 42px;
  line-height: 1;
  margin-bottom: var(--sp-1);
  opacity: 0.55;
}

.empty-state-title {
  font-size: var(--t-lg);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.empty-state-text {
  font-size: var(--t-sm);
  color: var(--text-muted);
  font-weight: 400;
  max-width: 260px;
  line-height: 1.6;
}

.empty-state .btn-primary {
  margin-top: var(--sp-2);
}

/* =============================================
   DRAWER MOBILE — daily dashboard
   Logica apertura/chiusura
   ============================================= */

/* Overlay scuro sotto il drawer */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(14,14,13,0.38);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity var(--t-modal) var(--ease-out);
  pointer-events: none;
}

/* Bottone trigger drawer — visibile solo su mobile */
.drawer-trigger {
  display: none;
}

/* =============================================
   RESPONSIVE — TABLET (≤ 1024px)
   ============================================= */
@media (max-width: 1024px) {
  .housekeeping-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* =============================================
   RESPONSIVE — MOBILE (≤ 768px)
   ============================================= */
@media (max-width: 768px) {

  /* Drawer trigger visibile */
  .drawer-trigger {
    display: flex;
  }

  /* Overlay visibile */
  .drawer-overlay {
    display: block;
  }

  .drawer-overlay.open {
    opacity: 1;
    pointer-events: all;
  }

  /* Toast su mobile — larghezza piena */
  .toast {
    bottom: 72px;
    right: var(--sp-4);
    left: var(--sp-4);
    max-width: 100%;
    min-width: unset;
    width: calc(100% - var(--sp-8));
  }

  /* Client card più compatta */
  .client-card {
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-md);
  }

  .client-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: var(--t-xs);
  }

  /* Housekeeping grid — 2 colonne fisse */
  .housekeeping-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--sp-2);
  }

  .room-status-card {
    padding: var(--sp-4);
    border-radius: var(--r-lg);
  }

  /* Stats bar scrollabile */
  .clients-stats-bar,
  .housekeeping-stats-bar {
    gap: var(--sp-2);
  }

  /* Empty state più compatto */
  .empty-state {
    padding: var(--sp-10) var(--sp-4);
  }
}

/* =============================================
   RESPONSIVE — MOBILE SMALL (≤ 480px)
   ============================================= */
@media (max-width: 480px) {

  /* Housekeeping — 2 colonne fisse */
  .housekeeping-grid {
    grid-template-columns: 1fr 1fr;
  }

  .room-status-card {
    padding: var(--sp-3);
  }

  .room-status-name {
    font-size: var(--t-sm);
  }

  /* Client card minimal */
  .client-card {
    padding: var(--sp-3);
    gap: var(--sp-3);
  }

  .client-stays-count {
    font-size: var(--t-lg);
  }

  /* Empty state minimal */
  .empty-state {
    padding: var(--sp-8) var(--sp-4);
  }

  .empty-state-icon {
    font-size: 34px;
  }

  /* Toast sopra FAB */
  .toast {
    bottom: 76px;
  }
}

/* =============================================
   HOVER DISABILITATO — touch devices
   ============================================= */
@media (hover: none) {
  .client-card:hover,
  .room-status-card:hover,
  .stat-card:hover {
    transform: none;
    box-shadow: var(--sh-xs);
    border-color: var(--border);
    background: var(--surface);
  }
}

/* =============================================
   PRINT
   ============================================= */
@media print {

  .btn-add,
  .drawer-trigger,
  .drawer-overlay,
  .toast,
  .modal-overlay,
  .app-nav,
  .calendar-controls,
  .header-right {
    display: none !important;
  }

  body {
    background: white;
    color: black;
    font-size: 12px;
  }

  .app-header {
    position: static;
    box-shadow: none;
    border-bottom: 1px solid #ccc;
  }

  .daily-dashboard {
    position: static;
    width: 100%;
    height: auto;
    border: none;
    box-shadow: none;
    transform: none !important;
    page-break-after: always;
  }

  .calendar-inner {
    box-shadow: none;
    border: 1px solid #ccc;
    border-radius: 0;
    min-width: unset;
    width: 100%;
  }

  .booking-block {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
    box-shadow: none;
  }

  .calendar-wrapper {
    overflow: visible;
    padding: 0;
  }
}

/* =============================================
   MINI CALENDARIO — sidebar
   ============================================= */

.mini-cal {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.mini-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1);
}

.mini-cal-title {
  font-size: var(--t-xs);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  flex: 1;
  user-select: none;
}

.mini-cal-nav {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--t-md);
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  transition:
    background   var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    color        var(--t-fast) var(--ease-out);
}

.mini-cal-nav:hover {
  background: var(--hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.mini-cal-dow {
  font-size: var(--t-2xs);
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 0;
  user-select: none;
}

.mini-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.mini-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--t-2xs);
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--r-xs);
  cursor: pointer;
  user-select: none;
  transition:
    background var(--t-fast) var(--ease-out),
    color      var(--t-fast) var(--ease-out);
}

.mini-cal-day:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.mini-cal-day.today {
  color: var(--today-border);
  font-weight: 700;
  background: rgba(245,158,11,0.10);
}

.mini-cal-day.selected {
  background: var(--accent);
  color: var(--text-inverse);
  font-weight: 700;
  border-radius: var(--r-xs);
}

.mini-cal-day.other-month {
  color: var(--text-muted);
  opacity: 0.45;
}

.mini-cal-day.empty {
  cursor: default;
  pointer-events: none;
}

.mini-cal-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  flex-shrink: 0;
}
.header-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: block;
}

.btn-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

/* Icona ghost-button: visibile quando il pulsante ha la classe iconable */
.btn-ghost-icon-img {
  display: none;
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Pulsanti icona quadrata (Analytics, Esci) — su tutti i breakpoint */
.btn-ghost-iconable {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--r-md);
  flex-shrink: 0;
}

.btn-ghost-iconable .btn-ghost-icon-img {
  display: block;
}

.btn-ghost-iconable .btn-ghost-label {
  display: none;
}

.btn-icon:hover .btn-icon-img {
  opacity: 1;
}

.login-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: block;
}

/* =============================================
   PERIODI ALTA AFFLUENZA
   ============================================= */

.btn-peak {
  position: fixed;
  bottom: calc(var(--sp-8) + 64px);
  right: var(--sp-6);
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--sh-md);
  transition:
    transform   var(--t-fast) var(--ease-out),
    box-shadow  var(--t-fast) var(--ease-out),
    background  var(--t-fast) var(--ease-out);
}

.btn-peak:hover {
  transform: scale(1.07) translateY(-2px);
  box-shadow: var(--sh-lg);
  background: var(--hover);
}

.btn-peak:active {
  transform: scale(0.96);
}

/* Celle calendario evidenziate come alta affluenza */
.day-cell.peak-period {
  background: #fce4ec !important;
}

.day-cell.peak-period.today {
  background: #f8d0dc !important;
}

.day-cell.peak-period.weekend {
  background: #fad4e2 !important;
}

/* Header giorni evidenziati */
.day-header.peak-period {
  background: #fce4ec;
}

.day-header.peak-period.today {
  background: #f8d0dc;
}

/* Riga occupazione evidenziata */
.occupancy-cell.peak-period {
  background: #fce4ec !important;
}

/* Lista periodi nel modal */
.peak-period-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-3);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-2);
  gap: var(--sp-3);
}

.peak-period-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.peak-period-label {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.peak-period-dates {
  font-size: var(--t-xs);
  color: var(--text-muted);
  font-weight: 400;
}

.peak-period-actions {
  display: flex;
  gap: var(--sp-1);
  flex-shrink: 0;
}

.peak-action-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition:
    background   var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    color        var(--t-fast) var(--ease-out);
}

.peak-action-btn:hover {
  background: var(--hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.peak-action-btn.delete:hover {
  background: rgba(220,38,38,0.06);
  border-color: var(--booking-large);
  color: var(--booking-large);
}

@media (max-width: 768px) {
  .btn-peak {
    bottom: calc(var(--sp-5) + 60px);
    right: var(--sp-4);
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

/* =============================================
   RIGA ESTERNI — Pranzo / Cena
   ============================================= */

/* Riga contenitore */
.externals-row {
  display: flex;
  border-top: 2px solid var(--border-strong);
}

/* Label sinistra — 4 sub-righe */
.externals-label {
  width: var(--room-col);
  min-width: var(--room-col);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  left: 0;
  z-index: 10;
  box-shadow: 3px 0 8px rgba(0,0,0,0.04);
}

/* Sub-riga per ogni turno */
.ext-lane-label {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0 var(--sp-2) 0 var(--sp-3);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  user-select: none;
  transition: background var(--t-fast) var(--ease-out);
}

.ext-lane-label:last-child {
  border-bottom: none;
}

.ext-lane-label:hover {
  background: var(--hover);
}

/* Separatore più spesso tra pranzo e cena */
.ext-lane-label.meal-divider {
  border-top: 2px solid var(--border-strong);
}

/* Pallino colorato accanto al nome turno */
.ext-lane-dot {
  width: 7px;
  height: 7px;
  min-width: 7px;
  border-radius: var(--r-full);
  flex-shrink: 0;
}

.ext-lane-name {
  font-size: var(--t-2xs);
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.1px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.ext-lane-cap {
  font-size: var(--t-2xs);
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Contenitore giorni */
.externals-days-container {
  position: relative;
  flex: 1;
}

/* Cella di sfondo per ogni giorno × turno */
.ext-bg-cell {
  position: absolute;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out);
  overflow: hidden;
}

.ext-bg-cell:hover {
  background: var(--hover) !important;
}

.ext-bg-cell.meal-divider {
  border-top: 2px solid var(--border-strong);
}

.ext-bg-cell.today {
  background: var(--today-bg);
}

.ext-bg-cell.weekend {
  background: var(--weekend-bg);
}

.ext-bg-cell.week-start {
  border-left: 2px solid var(--week-divider);
}

.ext-bg-cell.peak-period {
  background: #fce4ec !important;
}

/* Barra di capacità in fondo alla cella */
.ext-cap-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 var(--r-xs) 0 0;
  opacity: 0.7;
  transition: width var(--t-mid) var(--ease-out);
  pointer-events: none;
}

/* Contatore coperti nella cella */
.ext-cap-count {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: var(--t-2xs);
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
  pointer-events: none;
}

.ext-cap-count.cap-warning {
  color: #92400e;
}

.ext-cap-count.cap-full {
  color: #991b1b;
}

/* "+" nelle celle vuote */
.ext-empty-plus {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--t-xl);
  font-weight: 300;
  color: var(--border-strong);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease-out);
}

.ext-bg-cell:hover .ext-empty-plus {
  opacity: 1;
}

/* Blocco prenotazione esterna */
.booking-block-external {
  position: absolute;
  border-radius: var(--r-sm);
  color: #ffffff;
  font-size: var(--t-2xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  padding: 0 var(--sp-2);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  z-index: 5;
  box-shadow: var(--sh-xs);
  letter-spacing: 0.1px;
  transition:
    filter      var(--t-fast) var(--ease-out),
    transform   var(--t-fast) var(--ease-out),
    box-shadow  var(--t-fast) var(--ease-out);
  user-select: none;
}

.booking-block-external:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: var(--sh-sm);
  z-index: 6;
}

.btn-sm {
  font-size: var(--t-xs) !important;
  padding: var(--sp-1) var(--sp-3) !important;
  height: 30px !important;
  min-height: 30px !important;
  border-radius: var(--r-sm) !important;
}

/* EXT-LANE-CAP EDITABLE — indicatore interattivo */
.ext-lane-cap--editable {
  cursor: pointer;
  border-radius: var(--r-xs);
  padding: 1px 3px;
  transition: background var(--t-fast), color var(--t-fast);
}

.ext-lane-cap--editable:hover {
  background: var(--hover);
  color: var(--accent-blue);
}

/* LANE-CAP-POPUP — mini popup modifica capienza */
.lane-cap-popup {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  padding: var(--sp-3) var(--sp-4);
  z-index: 900;
  display: none;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 190px;
}

.lane-cap-popup.open { display: flex; }

.lane-cap-popup-label {
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.lane-cap-popup-input {
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--t-xl);
  font-weight: 700;
  color: var(--text-primary);
  background: var(--surface-soft);
  text-align: center;
  width: 100%;
}

.lane-cap-popup-input:focus {
  border-color: var(--accent-blue);
  background: var(--surface);
  outline: none;
}

.lane-cap-popup-btns {
  display: flex;
  gap: var(--sp-2);
}

.lane-cap-popup-btns .btn-primary,
.lane-cap-popup-btns .btn-secondary {
  flex: 1;
}

/* Stanza collegata a booking esterno */
.day-cell.external-room {
  background: #fce4ec !important;
}

.day-cell.external-room.today {
  background: #f8d0dc !important;
}

.day-cell.external-room.weekend {
  background: #fad4e2 !important;
}

/* =============================================
   PWA — SAFE AREA iOS
   ============================================= */
.app-header {
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(var(--sp-5), env(safe-area-inset-left));
  padding-right: max(var(--sp-5), env(safe-area-inset-right));
  box-sizing: border-box;
}

.btn-add,
.btn-peak {
  bottom: max(var(--sp-6), calc(env(safe-area-inset-bottom) + var(--sp-4)));
}

/* =============================================
   MOBILE REFINEMENTS — touch & layout
   ============================================= */

/* Input e select più alti su touch — evita zoom iOS */
@media (max-width: 768px) {
.form-input,
  .form-select,
  .form-textarea {
    font-size: 16px;
    padding: 12px var(--sp-3);
  }

input[type="date"].form-input {
    padding: 10px var(--sp-1);
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    font-size: 15px;
  }

  .form-row {
    gap: var(--sp-2);
  }

  /* Modal footer bottoni full width su mobile */
  .modal-footer {
    flex-direction: column-reverse;
    gap: var(--sp-2);
  }

  .modal-footer .btn-primary,
  .modal-footer .btn-secondary {
    width: 100%;
    justify-content: center;
    padding: 13px var(--sp-4);
  }

  .modal-footer .btn-danger {
    width: 100%;
    justify-content: center;
    margin-right: 0;
    order: 3;
    padding: 13px var(--sp-4);
  }

  /* Drawer trigger safe area */
  .drawer-trigger {
    bottom: max(var(--sp-8), calc(env(safe-area-inset-bottom) + var(--sp-5)));
  }

  /* FAB safe area */
  .btn-add {
    bottom: max(var(--sp-5), calc(env(safe-area-inset-bottom) + var(--sp-4)));
  }

  .btn-peak {
    bottom: max(calc(var(--sp-5) + 60px), calc(env(safe-area-inset-bottom) + 72px));
  }

  /* Textarea più corta su mobile */
  .form-textarea {
    min-height: 64px;
  }

  /* Modal box swipe — cursore grab sulla handle */
  .modal-header {
    cursor: grab;
  }

  .modal-header:active {
    cursor: grabbing;
  }
}

@media (max-width: 480px) {
  /* Titolo modal più compatto */
  .modal-title {
    font-size: var(--t-md);
  }

  /* Form label più piccolo */
  .form-label {
    font-size: var(--t-xs);
  }

  /* Flags grid una colonna su SE */
  .flags-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-1);
  }

  .flag-item {
    padding: var(--sp-2) var(--sp-2);
    font-size: var(--t-xs);
  }
  .form-row:has(input[type="date"]) {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-1);
  }

  input[type="date"].form-input {
    font-size: 14px;
    padding: 9px 4px;
    text-align: center;
  }
}
/* =============================================
   LOADING SKELETON — calendario
   ============================================= */
.skeleton-row {
  display: flex;
  align-items: center;
  height: var(--row-h);
  border-bottom: 1px solid var(--border);
  gap: 0;
  animation: skeletonPulse 1.4s ease-in-out infinite;
}

.skeleton-label {
  width: var(--room-col);
  min-width: var(--room-col);
  height: 20px;
  background: var(--border);
  border-radius: var(--r-sm);
  margin: 0 var(--sp-3);
  flex-shrink: 0;
}

.skeleton-block {
  height: 36px;
  border-radius: var(--r-md);
  background: var(--border);
  flex-shrink: 0;
}

@keyframes skeletonPulse {
  0%, 100% { opacity: 1;    }
  50%       { opacity: 0.45; }
}

/* =============================================
   FLOATING ACTION BUTTON — Offerta Rifugi
   ============================================= */
.home-fab {
  position: fixed;
  bottom: 60px;
  left: 20px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #C07840;
  color: #ffffff;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(192,120,64,.20);
  text-decoration: none;
  letter-spacing: .01em;
  opacity: 0.72;
  transition: transform .22s ease, box-shadow .22s ease, opacity .22s ease;
  white-space: nowrap;
}
.home-fab:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(192,120,64,.36);
}
.home-fab svg {
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .home-fab span.fab-label { display: none; }
  .home-fab { padding: 11px; border-radius: 50%; bottom: 58px; }
}

.offerta-fab {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #2D6A4F;
  color: #ffffff;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(45,106,79,.20);
  text-decoration: none;
  letter-spacing: .01em;
  opacity: 0.72;
  transition: transform .22s ease, box-shadow .22s ease, opacity .22s ease;
  white-space: nowrap;
}
.offerta-fab:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(45,106,79,.36);
}
.offerta-fab svg {
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .offerta-fab span.fab-label { display: none; }
  .offerta-fab { padding: 11px; border-radius: 50%; }
}

/* ===== RICHIESTE DAL SITO PUBBLICO ===== */

.requests-badge {
  background: #F59E0B;
  color: white;
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}

/* Sezione inline nel dashboard */
#requests-section {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--surface, #f9fafb);
  overflow-y: auto;
  padding: var(--sp-4, 16px);
}

.requests-section-inner {
  max-width: 860px;
  margin: 0 auto;
}

.requests-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5, 20px);
  gap: 12px;
  flex-wrap: wrap;
}

.requests-section-title {
  font-size: var(--t-lg, 18px);
  font-weight: 700;
  color: var(--text-primary, #111827);
}

.request-card {
  background: var(--card-bg, white);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
  transition: box-shadow .15s ease;
}

.request-card:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
}

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

.request-guest-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary, #111827);
}

.request-contact {
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
  margin-top: 2px;
}

.request-dates {
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 6px;
  line-height: 1.5;
}

.request-meta {
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 6px;
}

.request-notes-preview {
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
  font-style: italic;
  margin-top: 6px;
  line-height: 1.4;
  white-space: pre-line;
}

.request-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.request-status-badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.status-pending   { background: #FEF3C7; color: #92400E; }
.status-confirmed { background: #D1FAE5; color: #065F46; }
.status-rejected  { background: #FEE2E2; color: #991B1B; }
.status-archived  { background: #F3F4F6; color: #6B7280; }

.requests-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.requests-tab {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border, #e5e7eb);
  background: transparent;
  color: var(--text-secondary, #6b7280);
  transition: all .15s ease;
}

.requests-tab:hover {
  border-color: var(--primary, #059669);
  color: var(--primary, #059669);
}

.requests-tab.active {
  background: var(--primary, #059669);
  color: white;
  border-color: transparent;
}

.requests-tab .tab-count {
  background: rgba(0,0,0,.12);
  border-radius: 20px;
  padding: 0 6px;
  font-size: 10px;
  margin-left: 4px;
}

.requests-tab.active .tab-count {
  background: rgba(255,255,255,.25);
}

.requests-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-secondary, #6b7280);
  font-size: var(--t-sm, 13px);
}

.requests-empty-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

@media (max-width: 480px) {
  .request-actions { gap: 6px; }
  .request-actions .btn-sm { font-size: 11px; padding: 5px 10px; }
}

/* =============================================
   NOTE GIORNALIERE
   ============================================= */
.day-note-dot {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background: var(--accent-blue);
  pointer-events: none;
  transition: transform var(--t-fast);
}

.day-header.has-note .day-note-dot {
  box-shadow: 0 0 0 2px rgba(59,91,255,0.18);
}

.day-header.has-note:hover .day-note-dot {
  transform: translateX(-50%) scale(1.25);
}

.modal-box--note {
  max-width: 400px;
}

.modal-box--note .modal-body {
  padding-top: var(--sp-4);
}

.form-textarea--tall {
  min-height: 140px;
  resize: vertical;
}

@media (max-width: 480px) {
  .day-note-dot { bottom: 3px; width: 4px; height: 4px; }
}

/* =============================================
   OFFLINE BANNER
   ============================================= */
.offline-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  font-size: var(--t-sm);
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.offline-banner.visible { display: flex; }
.offline-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
  box-shadow: 0 0 6px #f59e0b88;
  animation: offlinePulse 2s ease-in-out infinite;
}
@keyframes offlinePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
.booking-block.offline-pending {
  outline: 2px dashed #f59e0b;
  outline-offset: -2px;
}
.booking-block.offline-pending::after {
  content: '⏳';
  position: absolute;
  top: 2px; right: 4px;
  font-size: 10px;
  line-height: 1;
  opacity: 0.85;
}
/* DOCUMENTO IDENTITÀ — UPLOAD */
.doc-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  cursor: pointer;
  transition: border-color var(--t-mid), background var(--t-mid);
  text-align: center;
  background: var(--surface-soft);
}
.doc-upload-area:hover {
  border-color: var(--accent);
  background: var(--hover);
}
.doc-upload-area.has-image {
  border-style: solid;
  border-color: var(--border);
  padding: var(--sp-2);
  background: var(--surface);
}
.doc-upload-placeholder {
  color: var(--text-muted);
  font-size: var(--t-sm);
  line-height: 1.5;
  pointer-events: none;
}
.doc-upload-preview {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  border-radius: var(--r-sm);
}
.doc-upload-hint {
  font-size: var(--t-xs);
  color: var(--text-muted);
  margin-top: var(--sp-2);
  pointer-events: none;
}
.doc-detail-img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  cursor: zoom-in;
  display: block;
  margin-top: var(--sp-2);
}

/* ==========================================================================
   ANALYTICS
   ========================================================================== */

/* Titolo sezione — uppercase, muted, usato come h2.detail-label in analytics.html */
.detail-label {
  font-size: var(--t-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin: var(--sp-6) 0 var(--sp-3);
}

/* Riga prenotazione imminente — layout data-dense, senza avatar */
.upcoming-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-2);
  font-size: var(--t-sm);
  box-shadow: var(--sh-xs);
  cursor: default;
  transition:
    background   var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out);
}

.upcoming-row:hover {
  background: var(--hover);
  border-color: var(--border-strong);
}

.upcoming-name {
  font-weight: 600;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upcoming-room {
  color: var(--text-muted);
  white-space: nowrap;
}

.upcoming-dates {
  color: var(--text-muted);
  font-size: var(--t-xs);
  white-space: nowrap;
}

.upcoming-people {
  color: var(--text-secondary);
  font-size: var(--t-xs);
  white-space: nowrap;
}

/* Flag esigenze alimentari/speciali */
.flag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.flag-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 5px var(--sp-3);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--text-secondary);
  box-shadow: var(--sh-xs);
  transition:
    background   var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out);
}

.flag-chip:hover {
  background: var(--hover);
  border-color: var(--border-strong);
}

.flag-chip-count {
  font-weight: 700;
  color: var(--text-primary);
  background: var(--accent-soft);
  border-radius: var(--r-full);
  padding: 0 6px;
  font-size: var(--t-xs);
  line-height: 18px;
}

/* Riga ristorante */
.restaurant-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-2);
  font-size: var(--t-sm);
  box-shadow: var(--sh-xs);
  cursor: default;
  transition:
    background   var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out);
}

.restaurant-row:hover {
  background: var(--hover);
  border-color: var(--border-strong);
}

.restaurant-date {
  color: var(--text-muted);
  font-size: var(--t-xs);
  white-space: nowrap;
  min-width: 52px;
}

.restaurant-type {
  font-weight: 600;
  font-size: var(--t-sm);
  white-space: nowrap;
}

.restaurant-covers {
  color: var(--text-secondary);
  font-size: var(--t-sm);
  white-space: nowrap;
}

.restaurant-name {
  color: var(--text-muted);
  font-size: var(--t-sm);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsive — tablet */
@media (max-width: 768px) {
  .upcoming-row {
    flex-wrap: wrap;
    gap: var(--sp-2);
  }

  .upcoming-dates,
  .upcoming-room {
    font-size: var(--t-2xs);
  }
}

/* Responsive — mobile */
@media (max-width: 480px) {
  .flag-chips { gap: var(--sp-1); }

  .flag-chip {
    font-size: var(--t-2xs);
    padding: 3px var(--sp-2);
  }
}

/* =============================================
   MOBILE NAV — hamburger + menu a discesa
   Visibile solo su mobile (≤768px)
   ============================================= */

/* Bottone hamburger — nascosto su desktop */
.nav-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background   var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    color        var(--t-fast) var(--ease-out);
}

.nav-hamburger:hover {
  background: var(--hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* Icona 3 barre → X */
.nav-ham-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 16px;
  height: 11px;
  pointer-events: none;
}

.nav-ham-icon span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition:
    transform var(--t-mid) var(--ease-out),
    opacity   var(--t-mid) var(--ease-out);
  transform-origin: center;
}

.nav-hamburger[aria-expanded="true"] .nav-ham-icon span:nth-child(1) {
  transform: translateY(4.75px) rotate(45deg);
}

.nav-hamburger[aria-expanded="true"] .nav-ham-icon span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0.3);
}

.nav-hamburger[aria-expanded="true"] .nav-ham-icon span:nth-child(3) {
  transform: translateY(-4.75px) rotate(-45deg);
}

/* Backdrop clic-fuori — sfoca il contenuto sotto il menu */
.nav-mobile-backdrop {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 101;
  background: rgba(14, 14, 13, 0.38);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-mid) var(--ease-out);
}

.nav-mobile-backdrop.is-open {
  pointer-events: auto;
  opacity: 1;
}

/* Panel dropdown */
.nav-mobile-menu {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 102;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity   var(--t-mid) var(--ease-out),
    transform var(--t-mid) var(--ease-out);
}

.nav-mobile-menu.is-open {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

.nav-mobile-menu-inner {
  margin: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  overflow: hidden;
}

/* Voce menu */
.nav-mobile-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0 var(--sp-4);
  font-family: var(--font);
  font-size: var(--t-md);
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  letter-spacing: -0.01em;
  min-height: 52px;
  transition:
    background var(--t-fast) var(--ease-out),
    color      var(--t-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.nav-mobile-item:first-child {
  border-top: none;
}

.nav-mobile-item:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.nav-mobile-item:active {
  background: var(--accent-soft);
}

.nav-mobile-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  object-fit: contain;
  opacity: 0.72;
}

.nav-mobile-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.65;
}

.nav-mobile-item-label {
  flex: 1;
  text-align: left;
}

/* Variante pericolo — Esci / logout */
.nav-mobile-item--danger {
  color: #b91c1c;
}

.nav-mobile-item--danger:hover {
  background: #fef2f2;
  color: #991b1b;
}

.nav-mobile-item--danger .nav-mobile-item-icon {
  opacity: 0.85;
}

/* Badge richieste */
.nav-mobile-badge {
  background: var(--accent);
  color: var(--text-inverse);
  font-size: var(--t-2xs);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--r-full);
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .nav-mobile-menu,
  .nav-mobile-backdrop,
  .nav-ham-icon span {
    transition: none;
  }
}

@media (max-width: 768px) {
  .nav-hamburger {
    display: inline-flex;
    width: 30px;
    height: 30px;
  }

  /* Nasconde tutti i pulsanti dell'header tranne l'hamburger */
  .header-right > :not(.nav-hamburger) {
    display: none !important;
  }

  .nav-mobile-menu {
    display: block;
  }

  .nav-mobile-backdrop {
    display: block;
  }
}

/* =============================================
   #confirmModal — footer a due pulsanti
   Annulla + Elimina affiancati, allineati a
   destra su desktop e su mobile (nessun stack)
   ============================================= */

/* Su desktop: i due pulsanti sono già a destra
   grazie a .modal-footer { justify-content: flex-end }.
   Gap leggermente più ampio per respirare. */
#confirmModal .modal-footer {
  gap: var(--sp-3);
}

/* A 768px il blocco generico imposta flex-direction: column-reverse
   su tutti i .modal-footer — lo annulliamo per confirmModal */
@media (max-width: 768px) {
  #confirmModal .modal-footer {
    flex-direction: row;
    flex-wrap: nowrap;
  }

  #confirmModal .modal-footer .btn-secondary,
  #confirmModal .modal-footer .btn-danger {
    flex: 1;
    width: auto;
    justify-content: center;
    padding: 11px var(--sp-3);
    order: unset;
    margin-right: 0;
  }
}

/* A 480px il blocco generico aggiunge flex-wrap: wrap —
   forziamo i due pulsanti a restare sulla stessa riga */
@media (max-width: 480px) {
  #confirmModal .modal-footer {
    flex-wrap: nowrap;
    padding: var(--sp-3) var(--sp-4) var(--sp-5);
  }
}
