:root {
  --sidebar-bg:     #1a5c2a;
  --sidebar-hover:  #256b36;
  --sidebar-active: #2e7d42;
  --sidebar-text:   rgba(255,255,255,.9);
  --accent:         #2e7d32;
  --accent-hover:   #1b5e20;
  --bg:             #f1f8f2;
  --card:           #ffffff;
  --text:           #1a1a1a;
  --text-muted:     #666;
  --border:         #e0e0e0;
  --danger:         #c62828;
  --danger-hover:   #b71c1c;
  --success-bg:     #e8f5e9;
  --danger-bg:      #ffebee;
  --warning-bg:     #fff3e0;
  --sidebar-w:      240px;
  --radius:         8px;
  --shadow:         0 1px 4px rgba(0,0,0,.10);
}

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

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); }

/* ─── LOGIN ─────────────────────────────────── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--sidebar-bg);
}
.login-box {
  background: var(--card);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,.28);
}
.login-logo {
  display: block;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 28px;
}

/* ─── SIDEBAR ────────────────────────────────── */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-logo {
  padding: 18px 20px;
  font-size: 17px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.12);
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sidebar-brand {
  color: inherit;
  text-decoration: none;
}
.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,.65);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.sidebar-close:hover { color: white; }
.sidebar nav { flex: 1; padding: 10px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  transition: background .15s;
}
.nav-item:hover  { background: var(--sidebar-hover); }
.nav-item.active { background: var(--sidebar-active); font-weight: 600; }

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  gap: 8px;
}
.btn-logout {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 4px;
  padding: 4px 10px;
  white-space: nowrap;
  transition: all .15s;
}
.btn-logout:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ─── ADMIN TOPBAR (mobile) ─────────────────── */
.admin-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--sidebar-bg);
  color: white;
  align-items: center;
  padding: 0 16px;
  z-index: 102;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  gap: 12px;
}
.admin-topbar-title { font-size: 16px; font-weight: 700; }
.admin-topbar-user  { font-size: 12px; opacity: .8; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }

.sidebar-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 26px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 100;
}
.sidebar-overlay.open { display: block; }

/* ─── USER BOTTOM NAV (mobile) ───────────────── */
.user-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: white;
  border-top: 1px solid var(--border);
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(0,0,0,.10);
}
.user-bottom-nav a,
.user-bottom-nav button {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 2px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px;
  gap: 2px;
  min-height: 54px;
  transition: color .15s;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
}
.user-bottom-nav a.active { color: var(--accent); }
.user-bottom-nav .bn-icon { font-size: 20px; line-height: 1.2; }
.user-bottom-nav a span:last-child,
.user-bottom-nav button span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── MAIN CONTENT ───────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  padding: 28px 32px;
  min-height: 100vh;
}

/* ─── PAGE HEADER ────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h1 { font-size: 22px; font-weight: 700; }

/* ─── STATS GRID ─────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: center;
}
.stat-number { font-size: 42px; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-label  { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

/* ─── CARD ───────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

/* ─── TABLE ──────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover   { background: #f6fcf6; }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.table th.sortable:hover { color: var(--primary); }
.table th.sortable::after  { content: '⇕'; margin-left: 6px; font-size: 11px; opacity: .35; }
.table th.sortable[data-dir="asc"]::after  { content: '▲'; opacity: 1; }
.table th.sortable[data-dir="desc"]::after { content: '▼'; opacity: 1; }

.col-toggle-wrap  { position: relative; display: inline-block; margin-bottom: 14px; }
.col-toggle-menu {
  position: absolute; top: 100%; left: 0; margin-top: 6px; z-index: 20;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 16px; min-width: 210px;
  display: flex; flex-direction: column; gap: 8px;
}
.col-toggle-menu[hidden] { display: none; }
.col-toggle-item { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.col-toggle-item input { margin: 0; cursor: pointer; }

/* ─── BUTTONS ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s;
  white-space: nowrap;
  line-height: 1;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

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

.btn-danger    { background: var(--danger);  color: #fff; }
.btn-danger:hover  { background: var(--danger-hover); }

.btn-secondary { background: #e8e8e8; color: var(--text); }
.btn-secondary:hover { background: #d8d8d8; }

.btn-sm    { padding: 6px 12px; font-size: 13px; min-height: 34px; }
.btn-ghost { background: rgba(255,255,255,.15); color: white; border: 1px solid rgba(255,255,255,.35); }
.btn-ghost:hover,
.btn-ghost[aria-current="page"] { background: rgba(255,255,255,.28); color: white; }
.btn-block { width: 100%; justify-content: center; }

/* ─── FORMS ──────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46,125,50,.12);
}
.form-row     { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }
.form-hint    { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: normal; }

/* ─── ALERTS ─────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
}
.alert-success { background: var(--success-bg); color: #1b5e20; border-left: 4px solid #43a047; }
.alert-danger  { background: var(--danger-bg);  color: #b71c1c; border-left: 4px solid #e53935; }
.alert-warning { background: var(--warning-bg); color: #e65100; border-left: 4px solid #fb8c00; }

/* ─── BADGES ─────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-danger  { background: #ffebee; color: #c62828; }
.badge-warning { background: #fff3e0; color: #e65100; }
.badge-neutral { background: #f5f5f5; color: #555; }

/* ─── FILTER BAR ─────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-bar .form-group { margin-bottom: 0; }

/* ─── EMPTY STATE ────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

/* ─── SLOT LIST ──────────────────────────────── */
.slot-day { margin-bottom: 32px; }

.slot-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.slot-day-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0;
}

.slot-list { display: flex; flex-direction: column; gap: 8px; }

.slot-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  flex-wrap: wrap;
}
.slot-item.inactive { opacity: .5; }
.slot-item-info     { flex: 1; min-width: 140px; }
.slot-hours-preview {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: monospace;
  letter-spacing: .03em;
}

/* ─── DAYS GRID (slots form) ─────────────────── */
.days-quick {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.day-check-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  text-align: center;
  background: #fff;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.day-check-label:hover { border-color: var(--accent); background: #f6fcf6; }
.day-check-label input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}
.day-check-label:has(input:checked) {
  border-color: var(--accent);
  background: #e8f5e9;
  font-weight: 600;
}

@media (max-width: 640px) {
  .days-grid { grid-template-columns: repeat(4, 1fr); }
  .slot-item { flex-direction: column; align-items: flex-start; }
}

/* ─── RESPONSIVE ADMIN ───────────────────────── */
@media (max-width: 700px) {
  .admin-topbar  { display: flex; }
  .sidebar-close { display: block; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 101;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 16px; padding-top: 72px; }
  .form-row     { grid-template-columns: 1fr; }
  .stats-grid   { grid-template-columns: 1fr 1fr; }
  .filter-bar   { flex-direction: column; align-items: stretch; }
  .filter-bar .form-group { width: 100%; }
  .card         { overflow-x: auto; }
  .table-actions { flex-direction: column; gap: 6px; align-items: flex-start; }
  .slot-day-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 18px; }
}

/* ─── PUBLIC HEADER ──────────────────────────── */
.public-page  { background: var(--bg); }

.pub-header {
  background: var(--sidebar-bg);
  color: white;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.pub-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.pub-logo {
  font-size: 18px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
}
.pub-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.pub-greeting {
  font-size: 14px;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
}

/* ─── PUBLIC MAIN ────────────────────────────── */
.pub-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px;
}

/* ─── LEGEND ─────────────────────────────────── */
.cal-legend {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.leg-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-muted);
}
.leg-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}
.leg-free  { background: #43a047; }
.leg-taken { background: #bdbdbd; }
.leg-mine  { background: #1565c0; }
.leg-hint  { font-size: 13px; color: var(--text-muted); font-style: italic; margin-left: auto; }

/* ─── CALENDAR ───────────────────────────────── */
.calendar-scroll { overflow-x: auto; padding-bottom: 8px; }

.calendar {
  display: grid;
  gap: 5px;
  min-width: 560px;
}

.cal-cell {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
  padding: 6px 4px;
  line-height: 1.3;
}

.cal-corner { background: transparent; }

.cal-day-header {
  background: var(--card);
  box-shadow: var(--shadow);
  flex-direction: column;
  gap: 2px;
  padding: 10px 4px;
}
.cal-day-header.today {
  background: var(--accent);
  color: white;
}
.cal-weekday { font-weight: 700; font-size: 14px; }
.cal-date    { font-size: 12px; opacity: .75; }

.cal-time-label {
  background: transparent;
  flex-direction: column;
  gap: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.cal-time-label small { font-size: 10px; font-weight: 400; }

.cal-slot {
  font-size: 12px;
  font-weight: 500;
  cursor: default;
}
.cal-slot.free  {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}
.cal-slot.taken {
  background: #f5f5f5;
  color: #9e9e9e;
  border: 1px solid #e0e0e0;
}
.cal-slot.mine  {
  background: #e3f2fd;
  color: #1565c0;
  border: 2px solid #90caf9;
  font-weight: 700;
}
.cal-slot.no-slot {
  background: transparent;
  border: none;
}

/* ─── CAL SLOT CLICCABILE ────────────────────── */
a.cal-slot.free {
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
a.cal-slot.free:hover {
  background: #c8e6c9;
  transform: scale(1.03);
}

@media (max-width: 600px) {
  .pub-greeting     { display: none; }
  .pub-logo-text    { display: none; }
  .pub-header-inner { padding: 0 12px; height: 50px; }
  .pub-nav          { gap: 6px; }
  .pub-nav .btn     { padding: 6px 11px; font-size: 12px; }
  .pub-main         { padding: 16px 10px; }
  .cal-cell         { min-height: 50px; font-size: 11px; padding: 4px 2px; }
  .cal-weekday      { font-size: 12px; }
  .cal-date         { font-size: 11px; }
  .cal-legend       { gap: 12px; }
}
@media (max-width: 400px) {
  .pub-logo         { font-size: 16px; }
  .pub-nav .btn     { padding: 5px 9px; font-size: 11px; }
}

/* ═══════════════════════════════════════════════
   SEZIONE UTENTE
   ═══════════════════════════════════════════════ */

/* ─── USER HEADER ────────────────────────────── */
.user-layout { background: var(--bg); }

.user-header {
  background: var(--sidebar-bg);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.user-header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.user-logo {
  font-size: 18px;
  font-weight: 700;
  color: white;
  text-decoration: none;
  white-space: nowrap;
}
.user-nav { display: flex; align-items: center; gap: 2px; }
.user-nav-name {
  color: rgba(255,255,255,.65);
  font-size: 13px;
  padding: 0 12px 0 6px;
  border-right: 1px solid rgba(255,255,255,.18);
  margin-right: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.user-nav-item {
  color: rgba(255,255,255,.8);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 11px;
  border-radius: 6px;
  transition: background .15s;
  white-space: nowrap;
}
.user-nav-item:hover  { background: rgba(255,255,255,.15); color: white; }
.user-nav-item.active { background: rgba(255,255,255,.2);  color: white; font-weight: 600; }

.user-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 20px;
}

/* ─── SECTION TITLE ──────────────────────────── */
.section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}

/* ─── INVITE CARDS ───────────────────────────── */
.invite-section  { margin-bottom: 28px; }
.invite-card {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: #fffde7;
  border: 1px solid #ffe082;
  border-left: 4px solid #f9a825;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 10px;
}
.invite-info   { flex: 1; min-width: 200px; }
.invite-title  { font-weight: 600; margin-bottom: 5px; font-size: 15px; }
.invite-meta   { font-size: 13px; color: var(--text-muted); }
.invite-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ─── RADIO GROUP ────────────────────────────── */
.radio-group  { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.radio-label  {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  font-size: 15px;
}
.radio-label:hover { border-color: var(--accent); background: #f6fcf6; }
.radio-label input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }
.radio-label input[type="radio"]:checked + span { font-weight: 600; }

/* ─── SLOT CHOICES ───────────────────────────── */
.slot-choices     { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.slot-choice-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  transition: border-color .15s, background .15s;
}
.slot-choice-item:hover { border-color: var(--accent); background: #f6fcf6; }
.slot-choice-item input[type="radio"] { accent-color: var(--accent); }
.slot-choice-item input[type="radio"]:checked ~ span { font-weight: 700; color: var(--accent); }

/* ─── COMPANION ROW ──────────────────────────── */
.companion-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.companion-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 20px;
}
.companion-select,
.companion-email-input {
  flex: 1;
  min-width: 180px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .15s;
}
.companion-select:focus,
.companion-email-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46,125,50,.12);
}

/* ─── TAB BAR ────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.tab {
  padding: 8px 20px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.tab:hover  { color: var(--accent); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }

/* ─── BOOKING CARD ───────────────────────────── */
.booking-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 22px;
  margin-bottom: 14px;
  transition: opacity .2s;
}
.booking-card.cancelled { opacity: .55; }
.booking-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.booking-date   { font-size: 15px; font-weight: 600; }
.booking-notes  { font-size: 13px; color: var(--text-muted); margin-top: 10px; }
.booking-participants {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.part-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.part-chip  {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 13px;
}

@media (max-width: 600px) {
  .user-nav        { display: none; }
  .user-bottom-nav { display: flex; }
  .user-main       { padding: 16px 12px 76px; }
  .invite-card     { flex-direction: column; align-items: flex-start; }
  .invite-actions  { width: 100%; }
  .booking-card-header { flex-direction: column; align-items: flex-start; }
  .form-actions    { flex-direction: column; }
  .form-actions .btn { width: 100%; justify-content: center; }
  .slot-choice-item  { width: calc(50% - 5px); }
  .companion-row   { flex-direction: column; align-items: stretch; }
  .companion-num   { align-self: flex-start; }
  .companion-select,
  .companion-email-input { width: 100%; min-width: unset; }
  .tab             { padding: 8px 14px; font-size: 13px; }
  .radio-label     { padding: 10px 12px; }
}
@media (max-width: 380px) {
  .user-header-inner { height: 48px; }
  .user-logo         { font-size: 15px; }
  .user-bottom-nav .bn-icon { font-size: 17px; }
}

/* Pulsante "Installa app" (aggiungi a schermata Home) */
.pwa-install-fab {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  border: none;
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.pwa-install-fab:hover  { background: var(--accent-hover); }
.pwa-install-fab[hidden] { display: none; }

.pwa-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.pwa-modal[hidden] { display: none; }
.pwa-modal-box {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px 24px;
  max-width: 360px;
  width: 100%;
}
.pwa-modal-box h3   { margin-bottom: 14px; font-size: 17px; }
.pwa-modal-box ol    { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.4; }
.pwa-modal-close {
  position: absolute;
  top: 10px; right: 10px;
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
}

@media (max-width: 600px) {
  .pwa-install-fab { bottom: 86px; font-size: 13px; padding: 11px 16px; }
}
