/* ========================================
   BAND ON THE RUN - Blues Pub Aesthetic
   Warm ambers, dark wood, golden accents
   ======================================== */

/* Font di sistema — nessun import esterno necessario */

/* ---- CSS Variables ---- */
:root {
  --bg-deep:      #0d0a06;
  --bg-dark:      #13100a;
  --bg-panel:     #1c1509;
  --bg-card:      #231a0b;
  --bg-elevated:  #2e2210;
  --bg-hover:     #3a2c14;

  --amber-dim:    #6b4e1a;
  --amber-mid:    #a07030;
  --amber-warm:   #c8922a;
  --amber-gold:   #d4a017;
  --amber-bright: #e8b840;
  --amber-glow:   #f5d060;

  --text-muted:   #6a5530;
  --text-dim:     #8a7040;
  --text-soft:    #b89550;
  --text-warm:    #d4b060;
  --text-light:   #e8d090;
  --text-cream:   #f5e8c0;

  --accent-live:  #c84020;
  --accent-prova: #2870c0;
  --accent-link:  #d4a017;

  --border-dim:   rgba(180,130,40,0.15);
  --border-mid:   rgba(180,130,40,0.3);
  --border-warm:  rgba(180,130,40,0.5);

  --shadow-card:  0 4px 20px rgba(0,0,0,0.5), 0 0 0 1px rgba(180,130,40,0.1);
  --shadow-glow:  0 0 20px rgba(212,160,23,0.15);

  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    16px;

  --font-display: 'Verdana', 'Geneva', Tahoma, sans-serif;
  --font-body:    'Verdana', 'Geneva', Tahoma, sans-serif;
  --font-mono:    'Courier New', Courier, monospace;

  --nav-width:    260px;
  --topbar-h:     60px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-light);
  height: 100%;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.7;
}

/* Texture overlay — subtle grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(212,160,23,0.04) 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ---- Layout Shell ---- */
#app-shell {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* ---- Sidebar Navigation ---- */
#sidebar {
  width: var(--nav-width);
  background: var(--bg-panel);
  border-right: 1px solid var(--border-dim);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.sidebar-header {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border-dim);
}

.sidebar-logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--amber-gold);
  line-height: 1.1;
  letter-spacing: -0.3px;
}

.sidebar-logo span {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-style: italic;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.sidebar-band-name {
  font-size: 13px;
  color: var(--text-soft);
  padding: 12px 24px;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-dim);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-section {
  padding: 8px 0;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 24px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  color: var(--text-dim);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
  border-left: 3px solid transparent;
  font-size: 14.5px;
}

.nav-item:hover {
  color: var(--text-warm);
  background: var(--bg-card);
  border-left-color: var(--amber-dim);
}

.nav-item.active {
  color: var(--amber-bright);
  background: linear-gradient(90deg, rgba(212,160,23,0.12), transparent);
  border-left-color: var(--amber-gold);
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon { opacity: 1; }

.sidebar-footer {
  margin-top: auto;
  padding: 16px 24px;
  border-top: 1px solid var(--border-dim);
}

.user-info {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-left: 4px;
}

.user-badge.admin {
  background: rgba(212,160,23,0.2);
  color: var(--amber-gold);
  border: 1px solid var(--amber-dim);
}

.user-badge.user {
  background: rgba(100,100,100,0.2);
  color: var(--text-soft);
  border: 1px solid rgba(100,100,100,0.3);
}

/* ---- Main Content ---- */
#main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-deep);
  scrollbar-width: thin;
  scrollbar-color: var(--amber-dim) transparent;
}

#main-content::-webkit-scrollbar { width: 6px; }
#main-content::-webkit-scrollbar-track { background: transparent; }
#main-content::-webkit-scrollbar-thumb {
  background: var(--amber-dim);
  border-radius: 3px;
}

.page { display: none; padding: 36px 40px; animation: fadeIn 0.25s ease; }
.page.active { display: block; }

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

/* ---- Page Header ---- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 20px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--amber-bright);
  line-height: 1.1;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
  font-style: italic;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--amber-gold), var(--amber-warm));
  color: var(--bg-deep);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--amber-bright), var(--amber-gold));
  box-shadow: 0 0 16px rgba(212,160,23,0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-warm);
  border: 1px solid var(--border-mid);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--amber-warm);
  color: var(--amber-bright);
}

.btn-danger {
  background: rgba(200,64,32,0.2);
  color: #e07060;
  border: 1px solid rgba(200,64,32,0.3);
}

.btn-danger:hover {
  background: rgba(200,64,32,0.35);
  color: #f08070;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-dim);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-icon:hover {
  border-color: var(--amber-warm);
  color: var(--amber-bright);
  background: var(--bg-card);
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--text-cream);
  font-weight: 600;
}

/* ---- Tables ---- */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-dim);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border-dim);
  transition: background 0.12s;
}

tbody tr:hover { background: rgba(180,130,40,0.05); }

tbody td {
  padding: 13px 16px;
  font-size: 14px;
  color: var(--text-warm);
  vertical-align: middle;
}

.td-actions {
  white-space: nowrap;
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-live {
  background: rgba(200,64,32,0.2);
  color: #e07060;
  border: 1px solid rgba(200,64,32,0.3);
}

.badge-prova {
  background: rgba(40,112,192,0.2);
  color: #6090d8;
  border: 1px solid rgba(40,112,192,0.3);
}

.badge-role {
  background: rgba(180,130,40,0.15);
  color: var(--amber-warm);
  border: 1px solid var(--border-dim);
  font-size: 11px;
  padding: 2px 8px;
}

/* ---- Forms ---- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width { grid-column: 1 / -1; }

label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
input[type="tel"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-dark);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--amber-warm);
  box-shadow: 0 0 0 3px rgba(212,160,23,0.1);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a7040' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

select option { background: var(--bg-dark); color: var(--text-light); }

textarea { resize: vertical; min-height: 80px; }

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-dark);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  color: var(--text-soft);
}

.checkbox-item:hover { border-color: var(--amber-warm); color: var(--text-warm); }

.checkbox-item input { display: none; }

.checkbox-item.checked {
  background: rgba(212,160,23,0.12);
  border-color: var(--amber-gold);
  color: var(--amber-bright);
}

/* ---- Modal ---- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5,3,1,0.85);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px var(--border-dim), var(--shadow-glow);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--amber-dim) transparent;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 22px 28px;
  border-bottom: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--amber-bright);
}

.modal-body { padding: 28px; }

.modal-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border-dim);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 20px;
  line-height: 1;
  transition: color 0.15s;
}

.btn-close:hover { color: var(--text-warm); }

/* ---- Login Screen ---- */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 100% 80% at 50% 100%, rgba(212,160,23,0.08) 0%, transparent 60%),
    var(--bg-deep);
  position: relative;
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 52px 48px;
  background: var(--bg-panel);
  border: 1px solid var(--border-mid);
  border-radius: 20px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6), var(--shadow-glow);
  text-align: center;
}

.login-logo {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--amber-gold);
  margin-bottom: 4px;
}

.login-tagline {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 36px;
  letter-spacing: 0.5px;
}

.login-step { display: none; }
.login-step.active { display: block; }

.login-label {
  display: block;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.login-input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-dark);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  color: var(--text-cream);
  font-family: var(--font-body);
  font-size: 16px;
  text-align: center;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  margin-bottom: 20px;
}

.login-input:focus {
  border-color: var(--amber-gold);
  box-shadow: 0 0 0 3px rgba(212,160,23,0.12);
}

.login-input.otp {
  font-family: var(--font-mono);
  font-size: 28px;
  letter-spacing: 12px;
}

.login-msg {
  font-size: 13px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

.login-msg.info {
  background: rgba(40,112,192,0.15);
  color: #7ab0e8;
  border: 1px solid rgba(40,112,192,0.2);
}

.login-msg.error {
  background: rgba(200,64,32,0.15);
  color: #e07060;
  border: 1px solid rgba(200,64,32,0.2);
}

.login-msg.success {
  background: rgba(40,160,80,0.15);
  color: #70c890;
  border: 1px solid rgba(40,160,80,0.2);
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--amber-gold), var(--amber-warm));
  color: var(--bg-deep);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
}

.login-btn:hover {
  background: linear-gradient(135deg, var(--amber-bright), var(--amber-gold));
  box-shadow: 0 4px 20px rgba(212,160,23,0.3);
  transform: translateY(-1px);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ---- Repertorio - Drag & Drop ---- */
.brano-list {
  list-style: none;
}

.brano-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-dim);
  transition: all 0.15s;
  cursor: default;
  position: relative;
}

.brano-item:last-child { border-bottom: none; }
.brano-item:hover { background: rgba(180,130,40,0.05); }

.brano-item.dragging {
  opacity: 0.5;
  background: var(--bg-elevated);
}

.brano-item.drag-over {
  border-top: 2px solid var(--amber-gold);
}

.drag-handle {
  cursor: grab;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.15s;
}

.drag-handle:hover { opacity: 1; }
.drag-handle:active { cursor: grabbing; }

.drag-handle span {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.brano-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  width: 28px;
  flex-shrink: 0;
  text-align: center;
}

.brano-info { flex: 1; min-width: 0; }

.brano-titolo {
  font-size: 15px;
  color: var(--text-cream);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brano-performer {
  font-size: 13px;
  color: var(--text-soft);
  font-style: italic;
  margin-top: 2px;
}

.brano-link-icon {
  color: var(--amber-dim);
  text-decoration: none;
  font-size: 14px;
  padding: 4px;
  transition: color 0.15s;
}

.brano-link-icon:hover { color: var(--amber-gold); }

/* ---- Calendar ---- */
.calendario-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 24px;
}

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

.cal-month {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--amber-bright);
}

.cal-day-name {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 4px;
}

.cal-day {
  min-height: 80px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  padding: 8px;
  transition: background 0.12s;
}

.cal-day:hover { background: var(--bg-elevated); }

.cal-day.empty { background: transparent; border-color: transparent; }

.cal-day.today {
  border-color: var(--amber-dim);
  box-shadow: inset 0 0 0 1px var(--amber-dim);
}

.cal-day-num {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-family: var(--font-mono);
}

.cal-day.today .cal-day-num { color: var(--amber-gold); font-weight: 600; }

.cal-event {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.cal-event.live {
  background: rgba(200,64,32,0.25);
  color: #e07060;
  border-left: 2px solid var(--accent-live);
}

.cal-event.prova {
  background: rgba(40,112,192,0.2);
  color: #6090d8;
  border-left: 2px solid var(--accent-prova);
}

/* ---- Event list view ---- */
.event-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-dim);
}

.event-date-block {
  width: 52px;
  height: 52px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.event-date-day {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-cream);
  line-height: 1;
}

.event-date-month {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.event-info { flex: 1; }

.event-title {
  font-size: 15px;
  color: var(--text-cream);
  font-weight: 600;
}

.event-locale {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 3px;
  font-style: italic;
}


/* ---- Band page header ---- */
.band-page-header {
  margin-bottom: 36px;
}

.band-page-nome {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 400;
  color: var(--amber-gold);
  line-height: 1;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.band-page-stile {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  letter-spacing: 0.3px;
  margin-bottom: 16px;
}

.band-page-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 16px;
  border-top: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---- Member cards ---- */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.member-card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.18s;
  box-shadow: var(--shadow-card);
}

.member-card:hover {
  border-color: var(--amber-dim);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  transform: translateY(-2px);
}

.member-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber-dim), var(--amber-mid));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--bg-deep);
  font-weight: 700;
  margin-bottom: 16px;
}

.member-name {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--text-cream);
  margin-bottom: 6px;
}

.member-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.member-contact {
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.member-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-dim);
}

/* ---- Locale cards ---- */
.locale-card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.18s;
  box-shadow: var(--shadow-card);
}

.locale-card:hover {
  border-color: var(--amber-dim);
  transform: translateY(-2px);
}

.locale-card-header {
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border-dim);
}

.locale-tipo {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.locale-nome {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-cream);
}

.locale-card-body {
  padding: 16px 22px;
}

.locale-detail {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.locale-detail svg { flex-shrink: 0; margin-top: 2px; }

/* ---- Empty states ---- */
.empty-state {
  text-align: center;
  padding: 60px 40px;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.empty-state p { font-size: 14px; }

/* ---- Toast notifications ---- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: toastIn 0.25s ease, toastOut 0.25s ease 2.5s forwards;
  pointer-events: none;
  max-width: 360px;
}

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

@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); }
}

.toast-success {
  background: rgba(40,160,80,0.2);
  color: #70c890;
  border: 1px solid rgba(40,160,80,0.3);
}

.toast-error {
  background: rgba(200,64,32,0.2);
  color: #e07060;
  border: 1px solid rgba(200,64,32,0.3);
}

.toast-info {
  background: rgba(180,130,40,0.15);
  color: var(--amber-warm);
  border: 1px solid var(--border-mid);
}

/* ---- Loading ---- */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-dim);
  border-top-color: var(--amber-gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

/* ---- Decorative divider ---- */
.section-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-dim);
}

/* ---- Mobile hamburger ---- */
.menu-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 50;
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--amber-gold);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  :root { --nav-width: 240px; }

  .menu-toggle { display: flex; }

  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 40;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }

  #sidebar.open { transform: translateX(0); }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 30;
  }

  .sidebar-overlay.open { display: block; }

  #main-content { overflow-y: auto; }

  .page { padding: 20px 16px 20px 16px; padding-top: 64px; }

  .page-header { flex-direction: column; align-items: flex-start; }

  .page-title { font-size: 24px; }

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

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

  .login-card { padding: 36px 28px; }

  .calendario-grid { display: none; } /* Mobile: mostra lista eventi */

  .modal { margin: 0; border-radius: var(--radius-md) var(--radius-md) 0 0; }

  .modal-backdrop { align-items: flex-end; padding: 0; }
}

@media (min-width: 769px) {
  .sidebar-overlay { display: none !important; }
}

/* ---- Band Selector (sidebar) ---- */
.band-selector {
  padding: 10px 14px;
  margin: 0 12px 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.band-selector:hover {
  border-color: var(--amber-warm);
  background: var(--bg-hover);
}

.band-selector-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.band-selector-info {
  flex: 1;
  min-width: 0;
}

.band-selector-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 600;
}

.band-selector-nome {
  font-size: 13px;
  color: var(--amber-warm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
}

.band-selector-arrow {
  color: var(--text-muted);
  font-size: 10px;
  flex-shrink: 0;
}

/* ---- Band card (admin) ---- */
.band-card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.18s;
  box-shadow: var(--shadow-card);
}

.band-card:hover {
  border-color: var(--amber-dim);
  transform: translateY(-1px);
}

.band-card.active-band {
  border-color: var(--amber-gold);
  background: linear-gradient(135deg, rgba(212,160,23,0.08), var(--bg-card));
  box-shadow: var(--shadow-card), 0 0 0 1px var(--amber-dim), var(--shadow-glow);
}

.band-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--amber-dim), var(--amber-mid));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.band-card.active-band .band-card-icon {
  background: linear-gradient(135deg, var(--amber-warm), var(--amber-gold));
}

.band-card-info {
  flex: 1;
  min-width: 0;
}

.band-card-nome {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-cream);
  margin-bottom: 4px;
}

.band-card.active-band .band-card-nome {
  color: var(--amber-bright);
}

.band-card-stile {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 8px;
}

.band-card-stats {
  display: flex;
  gap: 16px;
}

.band-stat {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

.band-stat strong {
  color: var(--text-soft);
  font-weight: 600;
}

.active-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(212,160,23,0.2);
  color: var(--amber-gold);
  border: 1px solid var(--amber-dim);
  white-space: nowrap;
}

/* ---- Ruoli table ---- */
.ruolo-row {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-dim);
  gap: 16px;
  transition: background 0.12s;
}

.ruolo-row:last-child { border-bottom: none; }
.ruolo-row:hover { background: rgba(180,130,40,0.04); }

.ruolo-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  width: 32px;
  flex-shrink: 0;
  text-align: center;
}

.ruolo-descr {
  flex: 1;
  font-size: 15px;
  color: var(--text-warm);
}

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

/* ---- Utenti ---- */
.utente-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-dim);
  transition: background 0.12s;
}

.utente-row:last-child { border-bottom: none; }
.utente-row:hover { background: rgba(180,130,40,0.04); }

.utente-row.inattivo { opacity: 0.5; }

.utente-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber-dim), var(--amber-mid));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--bg-deep);
  font-family: var(--font-display);
  flex-shrink: 0;
}

.utente-avatar.inattivo {
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.utente-info { flex: 1; min-width: 0; }

.utente-mail {
  font-size: 14.5px;
  color: var(--text-cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.utente-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.utente-band {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Toggle switch attivo/inattivo */
.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-mid);
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-switch input:checked + .toggle-track {
  background: rgba(212,160,23,0.25);
  border-color: var(--amber-warm);
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.2s;
  pointer-events: none;
}

.toggle-switch input:checked ~ .toggle-thumb {
  transform: translateX(18px);
  background: var(--amber-gold);
}

/* Group header in utenti list */
.utenti-group-header {
  padding: 10px 20px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}

.utenti-group-header span {
  font-size: 12px;
  color: var(--amber-dim);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  font-style: italic;
}

/* ---- PDF Export Modal ---- */
.pdf-layout-card {
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-dark);
}

.pdf-layout-card:hover {
  border-color: var(--amber-dim);
  background: var(--bg-card);
}

.pdf-layout-card.selected {
  border-color: var(--amber-gold);
  background: linear-gradient(135deg, rgba(212,160,23,0.08), var(--bg-card));
  box-shadow: 0 0 0 1px var(--amber-dim);
}

.pdf-layout-preview {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 64px;
  justify-content: center;
}

.prev-line {
  height: 3px;
  border-radius: 2px;
  background: var(--text-muted);
}

.prev-line.bold { height: 5px; background: var(--text-soft); }
.prev-line.wide { width: 90%; }
.prev-line.thin { width: 65%; opacity: 0.6; margin-left: 12px; }

.pdf-layout-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-warm);
}

.pdf-layout-card.selected .pdf-layout-label { color: var(--amber-bright); }

.pdf-layout-desc {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Brani nel modale PDF */
.pdf-brano-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-dim);
  cursor: pointer;
  transition: background 0.12s;
  user-select: none;
}

.pdf-brano-item:last-child { border-bottom: none; }
.pdf-brano-item:hover { background: rgba(180,130,40,0.05); }

.pdf-brano-item.excluded { opacity: 0.4; }

.pdf-brano-check {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-mid);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  background: var(--bg-dark);
}

.pdf-brano-item:not(.excluded) .pdf-brano-check {
  background: rgba(212,160,23,0.12);
  border-color: var(--amber-gold);
}

.pdf-brano-check::after {
  content: '';
  display: none;
  width: 5px;
  height: 9px;
  border: 2px solid var(--amber-gold);
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

.pdf-brano-item:not(.excluded) .pdf-brano-check::after { display: block; }

.pdf-brano-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  width: 24px;
  flex-shrink: 0;
}

.pdf-brano-info { flex: 1; min-width: 0; }

.pdf-brano-titolo {
  font-size: 14px;
  color: var(--text-cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-brano-artist {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}
