/* ============================================================
   TENNIS BOOKING — Custom styles su Bootstrap 5
   Palette: Bianco #FFFFFF | Blu #0d47a1 | Rosso #c62828
   Bootstrap 5 CDN va incluso nel <head> di ogni pagina
   ============================================================ */

/* ---------- VARIABILI ---------- */
:root {
  --blue:       #0d47a1;
  --blue-mid:   #1565c0;
  --blue-light: #e3f2fd;
  --red:        #c62828;
  --red-light:  #ffebee;
  --white:      #ffffff;
  --gray-bg:    #f4f6fb;
  --gray-light: #f8f9fa;
  --gray-mid:   #e0e6ef;
  --text:       #1a1a2e;
  --muted:      #6c757d;
  --shadow-sm:  0 2px 8px rgba(13,71,161,.08);
  --shadow-md:  0 4px 24px rgba(13,71,161,.13);
  --shadow-lg:  0 8px 40px rgba(13,71,161,.18);
  --radius:     14px;
  --radius-sm:  8px;
}

/* ---------- BASE ---------- */
body { background: var(--gray-bg); font-family: 'Segoe UI', system-ui, sans-serif; color: var(--text); }
a { color: var(--blue-mid); }
a:hover { color: var(--blue); }

/* ---------- NAVBAR ---------- */
.navbar-custom {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  box-shadow: 0 2px 16px rgba(13,71,161,.35);
  padding: .9rem 1.5rem;
  position: sticky; top: 0; z-index: 1000;
}
.navbar-custom .navbar-brand {
  color: #fff !important;
  font-size: 1.3rem; font-weight: 800;
  letter-spacing: -.3px;
  display: flex; align-items: center; gap: .5rem;
}
.navbar-custom .nav-link {
  color: rgba(255,255,255,.88) !important;
  font-weight: 500; border-radius: var(--radius-sm);
  padding: .4rem .85rem !important; transition: all .2s;
}
.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
  background: rgba(255,255,255,.18);
  color: #fff !important;
}
.navbar-custom .nav-link.btn-nav-red {
  background: var(--red); color: #fff !important;
  margin-left: .25rem;
}
.navbar-custom .nav-link.btn-nav-red:hover { background: #b71c1c; }
.navbar-toggler { border-color: rgba(255,255,255,.4); }
.navbar-toggler-icon { filter: brightness(10); }

/* ---------- HERO ---------- */
.hero-section {
  background: linear-gradient(135deg, var(--blue) 0%, #1a237e 60%, #283593 100%);
  color: #fff; padding: 5rem 1rem 4rem;
  text-align: center; position: relative; overflow: hidden;
}
.hero-section::before {
  content: '🎾';
  font-size: 18rem; opacity: .04;
  position: absolute; right: -3rem; top: -3rem;
  line-height: 1; pointer-events: none;
}
.hero-section h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 900; margin-bottom: 1rem; }
.hero-section p   { font-size: 1.15rem; opacity: .88; max-width: 540px; margin: 0 auto 2rem; }
.hero-badge {
  display: inline-block; background: var(--red); color: #fff;
  font-size: .8rem; font-weight: 700; letter-spacing: .08em;
  padding: .3rem .9rem; border-radius: 20px; text-transform: uppercase;
  margin-bottom: 1.2rem;
}

/* ---------- SECTION TITLES ---------- */
.section-title { font-size: 1.6rem; font-weight: 800; color: var(--blue); margin-bottom: .25rem; }
.section-divider {
  width: 52px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--red), var(--blue));
  margin-bottom: 1.5rem;
}

/* ---------- CARDS GENERICHE ---------- */
.card-custom {
  background: var(--white);
  border: none; border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s, transform .25s;
  overflow: hidden;
}
.card-custom:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-header-blue {
  background: linear-gradient(90deg, var(--blue), var(--blue-mid));
  color: #fff; padding: 1rem 1.4rem; font-weight: 700; font-size: 1rem;
}
.card-header-red {
  background: linear-gradient(90deg, var(--red), #e53935);
  color: #fff; padding: 1rem 1.4rem; font-weight: 700; font-size: 1rem;
}

/* ---------- COURT CARDS ---------- */
.court-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: box-shadow .25s, transform .25s;
}
.court-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.court-card-header {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  padding: 1.8rem 1.4rem; text-align: center; position: relative;
}
.court-card-header .court-icon { font-size: 3rem; display: block; margin-bottom: .5rem; }
.court-card-header h3 { color: #fff; font-weight: 800; margin: 0; font-size: 1.3rem; }
.court-card-body { padding: 1.4rem; }
.court-surface-badge {
  display: inline-block; padding: .25rem .75rem; border-radius: 20px;
  font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  background: var(--blue-light); color: var(--blue);
}
.court-price { font-size: 1.5rem; font-weight: 800; color: var(--red); }
.court-price small { font-size: .78rem; color: var(--muted); font-weight: 400; }

/* ---------- BUTTONS ---------- */
.btn-primary-custom {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: .65rem 1.6rem; font-weight: 700; font-size: .95rem;
  transition: all .2s; cursor: pointer; display: inline-block; text-decoration: none;
}
.btn-primary-custom:hover {
  background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
  color: #fff; box-shadow: 0 4px 16px rgba(13,71,161,.35);
  transform: translateY(-1px); text-decoration: none;
}
.btn-red-custom {
  background: linear-gradient(135deg, var(--red) 0%, #e53935 100%);
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: .65rem 1.6rem; font-weight: 700; font-size: .95rem;
  transition: all .2s; cursor: pointer; display: inline-block; text-decoration: none;
}
.btn-red-custom:hover {
  background: linear-gradient(135deg, #b71c1c 0%, #c62828 100%);
  color: #fff; box-shadow: 0 4px 16px rgba(198,40,40,.35);
  transform: translateY(-1px); text-decoration: none;
}
.btn-outline-blue {
  border: 2px solid var(--blue-mid); color: var(--blue-mid);
  background: transparent; border-radius: var(--radius-sm);
  padding: .6rem 1.6rem; font-weight: 700; font-size: .95rem;
  transition: all .2s; cursor: pointer; display: inline-block; text-decoration: none;
}
.btn-outline-blue:hover {
  background: var(--blue); color: #fff; border-color: var(--blue);
  text-decoration: none;
}
.btn-lg-custom { padding: .85rem 2.4rem; font-size: 1.05rem; border-radius: 10px; }

/* ---------- FORM CONTROLS ---------- */
.form-control-custom {
  border: 1.5px solid var(--gray-mid); border-radius: var(--radius-sm);
  padding: .65rem 1rem; font-size: .95rem; width: 100%;
  transition: border .2s, box-shadow .2s; background: #fff;
}
.form-control-custom:focus {
  outline: none; border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(21,101,192,.15);
}
.form-label-custom { font-size: .88rem; font-weight: 600; color: var(--text); margin-bottom: .35rem; display: block; }

/* ---------- AUTH BOX ---------- */
.auth-wrapper {
  min-height: calc(100vh - 70px);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem; background: var(--gray-bg);
}
.auth-box {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 440px; overflow: hidden;
}
.auth-box-header {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  padding: 2.2rem 2rem; text-align: center; color: #fff;
}
.auth-box-header .auth-icon { font-size: 2.5rem; display: block; margin-bottom: .5rem; }
.auth-box-header h1 { font-size: 1.5rem; font-weight: 800; margin: 0; }
.auth-box-header p  { opacity: .85; margin: .4rem 0 0; font-size: .9rem; }
.auth-box-body { padding: 2rem; }
.auth-divider { text-align: center; margin: 1.1rem 0; color: var(--muted); font-size: .85rem; }

/* ---------- SLOT GRID ---------- */
.slot-legend { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.legend-item { display: flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 600; }
.legend-dot { width: 14px; height: 14px; border-radius: 3px; }
.legend-dot.free     { background: #e3f2fd; border: 2px solid var(--blue-mid); }
.legend-dot.occupied { background: var(--red-light); border: 2px solid var(--red); }
.legend-dot.selected { background: var(--blue); }

.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: .45rem; margin-bottom: 1.5rem; }
.slot {
  padding: .55rem .2rem; border-radius: var(--radius-sm);
  text-align: center; font-size: .85rem; font-weight: 700;
  transition: all .15s; border: 2px solid transparent;
}
.slot.free {
  background: var(--blue-light); color: var(--blue);
  border-color: #90caf9; cursor: pointer;
}
.slot.free:hover { background: #bbdefb; border-color: var(--blue-mid); transform: scale(1.05); }
.slot.occupied { background: var(--red-light); color: var(--red); border-color: #ef9a9a; cursor: not-allowed; }
.slot.selected { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 2px 8px rgba(13,71,161,.3); }

/* ---------- BOOKING SUMMARY ---------- */
.booking-summary-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-md); overflow: hidden;
  border-top: 4px solid var(--blue);
}
.booking-summary-header {
  background: linear-gradient(90deg, var(--blue), var(--blue-mid));
  color: #fff; padding: 1rem 1.5rem; font-weight: 700; font-size: 1.05rem;
}
.booking-summary-body { padding: 1.5rem; }
.summary-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1.25rem; }
@media (max-width: 480px) { .summary-info-grid { grid-template-columns: 1fr; } }
.summary-info-item {
  background: var(--gray-bg); border-radius: var(--radius-sm);
  padding: .7rem 1rem; border-left: 3px solid var(--blue-mid);
}
.summary-info-item .label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.summary-info-item .value { font-size: 1rem; font-weight: 700; color: var(--text); margin-top: .1rem; }
.summary-info-item.highlight { border-left-color: var(--red); }
.summary-info-item.highlight .value { color: var(--red); font-size: 1.2rem; }

/* ---------- IBAN BOX ---------- */
.iban-box {
  background: linear-gradient(135deg, #fff9c4 0%, #fff8e1 100%);
  border: 2px solid #ffe082; border-radius: var(--radius);
  padding: 1.3rem 1.5rem; margin: 1.2rem 0;
  display: flex; gap: 1rem; align-items: flex-start;
}
.iban-box-icon { font-size: 2.2rem; line-height: 1; flex-shrink: 0; }
.iban-title { font-weight: 800; font-size: 1rem; color: #5d4037; margin-bottom: .3rem; }
.iban-desc  { font-size: .85rem; color: #795548; margin-bottom: .6rem; }
.iban-code  {
  font-family: 'Courier New', monospace; font-size: 1.1rem; font-weight: 800;
  color: var(--text); background: #fff; border: 2px dashed #ffc107;
  border-radius: var(--radius-sm); padding: .4rem .9rem; display: inline-block;
  letter-spacing: .07em; margin-bottom: .4rem;
}
.iban-intestatario { font-size: .85rem; color: #5d4037; margin-bottom: .3rem; }
.iban-note { font-size: .8rem; color: #8d6e63; }
.iban-note em { color: var(--text); font-style: normal; font-weight: 600; }

/* ---------- PAYMENT METHODS ---------- */
.payment-section-title { font-size: .9rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: .75rem; }
.pay-methods-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pay-option input[type="radio"] { display: none; }
.pay-badge {
  display: flex; align-items: center; gap: .45rem;
  padding: .5rem 1.1rem; border-radius: var(--radius-sm); font-size: .9rem;
  font-weight: 700; border: 2px solid var(--gray-mid); background: var(--white);
  cursor: pointer; transition: all .2s;
}
.pay-badge:hover { border-color: var(--blue-mid); background: var(--blue-light); }
.pay-option input:checked + .pay-badge { border-color: var(--blue); background: var(--blue-light); color: var(--blue); box-shadow: 0 0 0 3px rgba(21,101,192,.15); }

/* ---------- ALERTS ---------- */
.alert-custom { border-radius: var(--radius-sm); padding: .9rem 1.2rem; font-weight: 500; margin-bottom: 1rem; border: none; }
.alert-success-custom { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #43a047; }
.alert-error-custom   { background: var(--red-light); color: var(--red); border-left: 4px solid var(--red); }
.alert-info-custom    { background: var(--blue-light); color: var(--blue); border-left: 4px solid var(--blue-mid); }

/* ---------- KPI CARDS (admin) ---------- */
.kpi-card {
  border-radius: var(--radius); padding: 1.4rem 1.2rem;
  color: #fff; box-shadow: var(--shadow-md); position: relative; overflow: hidden;
}
.kpi-card::after {
  content: attr(data-icon); font-size: 4.5rem; opacity: .12;
  position: absolute; right: -.5rem; bottom: -.8rem; line-height: 1;
}
.kpi-card.blue   { background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%); }
.kpi-card.red    { background: linear-gradient(135deg, var(--red) 0%, #e53935 100%); }
.kpi-card.teal   { background: linear-gradient(135deg, #00695c 0%, #00897b 100%); }
.kpi-card.purple { background: linear-gradient(135deg, #6a1b9a 0%, #8e24aa 100%); }
.kpi-card.orange { background: linear-gradient(135deg, #e65100 0%, #f57c00 100%); }
.kpi-card.dark   { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); }
.kpi-val  { font-size: 1.9rem; font-weight: 900; line-height: 1; margin-bottom: .2rem; }
.kpi-lbl  { font-size: .8rem; opacity: .88; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- ADMIN LAYOUT ---------- */
.admin-body { background: #f0f2f8; }
.admin-topbar {
  background: linear-gradient(135deg, var(--blue) 0%, #1a237e 100%);
  color: #fff; padding: .85rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 12px rgba(13,71,161,.3);
  position: sticky; top: 0; z-index: 100;
}
.admin-topbar .brand { font-weight: 900; font-size: 1.1rem; letter-spacing: -.2px; display: flex; align-items: center; gap: .5rem; }
.admin-topbar .topbar-actions a { color: rgba(255,255,255,.85); font-size: .88rem; margin-left: 1.2rem; text-decoration: none; transition: color .2s; }
.admin-topbar .topbar-actions a:hover { color: #fff; }
.admin-wrapper { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 52px); }
.admin-sidebar {
  background: #fff; border-right: 1px solid var(--gray-mid);
  padding: 1.5rem 0;
}
.sidebar-section-label { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: .5rem 1.4rem .25rem; }
.admin-sidebar .nav-item a {
  display: flex; align-items: center; gap: .7rem;
  padding: .62rem 1.4rem; color: #444; font-size: .9rem; font-weight: 500;
  transition: all .18s; text-decoration: none; border-left: 3px solid transparent;
}
.admin-sidebar .nav-item a:hover { background: var(--blue-light); color: var(--blue); border-left-color: var(--blue-mid); }
.admin-sidebar .nav-item a.active { background: var(--blue-light); color: var(--blue); font-weight: 700; border-left-color: var(--blue); }
.admin-sidebar .nav-item a .nav-icon { font-size: 1rem; width: 1.2rem; text-align: center; }
.admin-content { padding: 1.75rem; overflow-x: auto; }
@media (max-width: 820px) {
  .admin-wrapper { grid-template-columns: 1fr; }
  .admin-sidebar { display: flex; overflow-x: auto; padding: .5rem 0; border-right: none; border-bottom: 1px solid var(--gray-mid); }
  .admin-sidebar .nav-item a { padding: .55rem 1rem; white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
  .admin-sidebar .nav-item a.active, .admin-sidebar .nav-item a:hover { border-bottom-color: var(--blue); border-left: none; }
  .sidebar-section-label { display: none; }
}

/* ---------- ADMIN TABLE ---------- */
.table-scroll { overflow-x: auto; border-radius: var(--radius-sm); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; background: #fff; }
.admin-table thead th {
  background: var(--blue); color: #fff;
  padding: .75rem 1rem; text-align: left; white-space: nowrap;
  font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em;
}
.admin-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.admin-table thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
.admin-table tbody td { padding: .7rem 1rem; border-bottom: 1px solid var(--gray-mid); vertical-align: middle; }
.admin-table tbody tr:hover td { background: var(--blue-light); }
.admin-table tbody tr.row-cancelled td { opacity: .55; }
.actions-cell { display: flex; gap: .3rem; flex-wrap: wrap; }

/* ---------- BONIFICO SWITCH ---------- */
.bonifico-switch-wrap {
  display: flex; align-items: center; gap: .5rem;
}
.bonifico-label {
  font-size: .78rem; font-weight: 700; white-space: nowrap;
}
.bonifico-label.unpaid { color: #e65100; }
.bonifico-label.paid   { color: #2e7d32; }

/* override badge per bonifico */
.badge-pay-unpaid { background: #fff3e0; color: #e65100; }
.badge-pay-paid   { background: #e8f5e9; color: #2e7d32; border: 1.5px solid #a5d6a7; }

/* Riga con bonifico ricevuto → contorno verde */
tr.bonifico-paid td {
  border-top: 1.5px solid #a5d6a7;
  border-bottom: 1.5px solid #a5d6a7;
}
tr.bonifico-paid td:first-child { border-left: 4px solid #2e7d32; }
tr.bonifico-paid td:last-child  { border-right: 1.5px solid #a5d6a7; }

/* ---------- BADGES ---------- */
.badge-status { display: inline-block; padding: .28rem .75rem; border-radius: 20px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.badge-confirmed  { background: #e8f5e9; color: #2e7d32; }
.badge-pending    { background: #fff8e1; color: #f57f17; }
.badge-cancelled  { background: var(--red-light); color: var(--red); }
.badge-pay-paid   { background: #e8f5e9; color: #2e7d32; }
.badge-pay-unpaid { background: #fff3e0; color: #e65100; }

/* ---------- ACTION BUTTONS (tabella) ---------- */
.btn-action { padding: .28rem .65rem; font-size: .8rem; border-radius: 5px; border: none; color: #fff; cursor: pointer; font-weight: 600; transition: all .15s; white-space: nowrap; }
.btn-action:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.btn-action.confirm  { background: #2e7d32; }
.btn-action.cancel   { background: var(--red); }
.btn-action.pay-mark { background: #00695c; }
.btn-action.edit     { background: var(--blue-mid); }

/* ---------- PAYMENT SETTINGS ---------- */
.payment-card {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); margin-bottom: 1rem;
  border: 2px solid var(--gray-mid); overflow: hidden;
  transition: border-color .3s;
}
.payment-card.is-active { border-color: var(--blue-mid); }
.payment-card-header { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.4rem; gap: 1rem; flex-wrap: wrap; }
.payment-card-title  { display: flex; align-items: center; gap: 1rem; }
.payment-icon-wrap {
  width: 46px; height: 46px; border-radius: var(--radius-sm);
  background: var(--blue-light); display: flex; align-items: center;
  justify-content: center; font-size: 1.4rem; flex-shrink: 0;
}
.payment-card-title strong { display: block; font-size: 1rem; color: var(--text); }
.payment-card-title small  { color: var(--muted); font-size: .82rem; }
.payment-card-body { padding: 0 1.4rem 1.4rem; border-top: 1px solid var(--gray-mid); margin-top: 0; }
.payment-card-body.collapsed { display: none; }
.payment-card-body-inner { padding-top: 1.1rem; }

/* ---------- TOGGLE SWITCH ---------- */
.switch-wrap { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.switch-track {
  position: relative; width: 54px; height: 30px;
  border-radius: 15px; background: #ccc; cursor: pointer;
  transition: background .3s; flex-shrink: 0;
}
.switch-track input { display: none; }
.switch-knob {
  position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 5px rgba(0,0,0,.25);
  transition: transform .3s;
}
.switch-track.on { background: var(--blue); }
.switch-track.on .switch-knob { transform: translateX(24px); }
.switch-track.locked { opacity: .6; cursor: not-allowed; }
.switch-label { font-size: .85rem; font-weight: 700; min-width: 65px; }
.switch-label.on  { color: var(--blue); }
.switch-label.off { color: var(--muted); }

/* ---------- MY BOOKINGS ---------- */
.booking-item {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 1.2rem 1.4rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
  border-left: 5px solid var(--blue); margin-bottom: .9rem;
  transition: box-shadow .2s;
}
.booking-item:hover { box-shadow: var(--shadow-md); }
.booking-item.status-cancelled { border-left-color: var(--red); opacity: .7; }
.booking-item.status-pending   { border-left-color: #f9a825; }
.booking-info { flex: 1; min-width: 200px; }
.booking-info .booking-title { font-size: 1rem; font-weight: 700; margin-bottom: .25rem; }
.booking-info .booking-meta  { font-size: .85rem; color: var(--muted); }

/* ---------- FILTER BAR ---------- */
.filter-bar {
  background: #fff; border-radius: var(--radius); padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm); display: flex; flex-wrap: wrap; gap: .75rem;
  align-items: flex-end; margin-bottom: 1.25rem;
}
.filter-bar label { display: flex; flex-direction: column; gap: .25rem; font-size: .83rem; font-weight: 600; color: var(--muted); }
.filter-bar select, .filter-bar input[type="date"] {
  padding: .42rem .75rem; border: 1.5px solid var(--gray-mid);
  border-radius: var(--radius-sm); font-size: .9rem; background: #fff;
  transition: border .2s;
}
.filter-bar select:focus, .filter-bar input[type="date"]:focus {
  outline: none; border-color: var(--blue-mid);
}

/* ---------- MAESTRO BOX ---------- */
.maestro-box {
  background: linear-gradient(135deg, #fff8e1 0%, #fffde7 100%);
  border: 2px solid #ffe082; border-radius: var(--radius);
  margin: 1rem 0; overflow: hidden;
  transition: border-color .3s;
}
.maestro-box.active { border-color: #f9a825; }
.maestro-box-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.1rem; gap: 1rem;
}
.maestro-box-title { display: flex; align-items: center; gap: .75rem; }
.maestro-icon { font-size: 1.6rem; line-height: 1; }
.maestro-box-title strong { display: block; font-size: .95rem; color: #5d4037; }
.maestro-box-title small  { color: #8d6e63; font-size: .82rem; }
.maestro-box-body { padding: 0 1.1rem 1rem; }
.maestro-unavail {
  background: #ffebee; color: var(--red); border-top: 1px solid #ffcdd2;
  padding: .65rem 1.1rem; font-size: .85rem; font-weight: 600;
}

/* Slot maestro occupato (ma campo libero) */
.slot.maestro-busy {
  background: #fff3e0; color: #e65100;
  border-color: #ffb74d; cursor: pointer;
  position: relative;
}
.slot.maestro-busy::after {
  content: '🎓'; font-size: .65rem;
  position: absolute; top: 1px; right: 2px; line-height: 1;
}

.participants-box {
  border: 1.5px solid #e0e7ef;
  border-radius: 10px;
  padding: .9rem;
  background: #f8fafc;
}

.participant-row {
  display: flex;
  align-items: flex-start;
  gap: .4rem;
  margin-bottom: .5rem;
}

.participant-inputs {
  display: flex;
  flex: 1;
  gap: .4rem;
  align-items: center;
  flex-wrap: wrap;
}

.participant-inputs input {
  flex: 1;
  min-width: 110px;
  padding: .35rem .6rem;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: .83rem;
  background: #fff;
  transition: border-color .2s;
}

.participant-inputs input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(13,71,161,.08);
}

.participant-inputs input[readonly] {
  background: #f0f4f8;
  color: var(--muted);
  cursor: not-allowed;
}

/* ── Autocomplete ── */
.autocomplete-wrap {
  position: relative;
  flex: 1;
  min-width: 110px;
}

.autocomplete-wrap input {
  width: 100%;
}

.ac-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid var(--blue);
  border-radius: 0 0 8px 8px;
  z-index: 1050;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  display: none;
  max-height: 210px;
  overflow-y: auto;
}

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

.ac-item {
  padding: .5rem .75rem;
  cursor: pointer;
  font-size: .83rem;
  border-bottom: 1px solid #f0f4f8;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  transition: background .15s;
}

.ac-item:last-child {
  border-bottom: none;
}

.ac-item:hover,
.ac-item.focused {
  background: var(--blue-light, #e3f2fd);
}

.ac-item .ac-name {
  font-weight: 600;
  color: var(--blue);
}

.ac-item .ac-email {
  color: var(--muted, #888);
  font-size: .77rem;
}

/* ── Icona utente registrato ── */
.ac-registered-icon {
  color: #2e7d32;
  font-size: .95rem;
  flex-shrink: 0;
}

/* ── Pulsante rimuovi ── */
.btn-remove {
  background: none;
  border: none;
  color: var(--red, #c62828);
  cursor: pointer;
  font-size: 1.15rem;
  padding: .2rem .25rem;
  flex-shrink: 0;
  line-height: 1;
  transition: opacity .15s;
}

.btn-remove:hover {
  opacity: .7;
}

/* ---------- FOOTER ---------- */
.footer-custom {
  background: linear-gradient(135deg, var(--blue) 0%, #1a237e 100%);
  color: rgba(255,255,255,.75); text-align: center;
  padding: 1.5rem; font-size: .85rem; margin-top: 3rem;
}
.footer-custom span { color: var(--red); }

/* ---------- MISC ---------- */
.page-header { margin-bottom: 1.75rem; }
.page-header h1 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 900; color: var(--blue); margin-bottom: .1rem; }
.page-header p  { color: var(--muted); font-size: .95rem; }
.hint { font-size: .82rem; color: var(--muted); line-height: 1.55; }
.toggle-check-label { display: flex; align-items: center; gap: .5rem; font-size: .88rem; cursor: pointer; margin-top: .5rem; font-weight: 500; }
.divider-text { position: relative; text-align: center; margin: 1rem 0; }
.divider-text::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--gray-mid); }
.divider-text span { position: relative; background: #fff; padding: 0 .75rem; color: var(--muted); font-size: .85rem; }

@media (max-width: 480px) {
  .btn-lg-custom { display: block; width: 100%; margin: .4rem 0; text-align: center; }
  .iban-box { flex-direction: column; }
}