#topbar {
  justify-content: space-between;
}

#adminTitle {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#deniedOverlay {
  max-width: 420px;
  margin: 80px auto 0 auto;
  padding: 0 20px;
  text-align: center;
  color: #555;
}

#adminMain {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 60px 20px;
  overflow-y: auto;
  height: calc(100% - 48px);
  box-sizing: border-box;
}

.admin-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 20px;
  margin-bottom: 20px;
}

.admin-section h2 {
  margin: 0 0 14px 0;
  font-size: 16px;
  color: #1f6feb;
}

.admin-hint {
  margin: 0 0 14px 0;
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}

.users-list {
  list-style: none;
  margin: 0 0 16px 0;
  padding: 0;
  border-top: 1px solid #f0f0f0;
}

.users-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.user-name {
  font-weight: 600;
}

.user-badge {
  font-size: 11px;
  font-weight: 600;
  color: #1f6feb;
  background: #eaf1fe;
  border-radius: 4px;
  padding: 2px 6px;
}

.user-date {
  margin-left: auto;
  font-size: 12px;
  color: #888;
}

.delete-user-btn {
  flex: none;
  border: 1px solid #d64545;
  background: #d64545;
  color: white;
  font-size: 12px;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
}

.delete-user-btn:hover {
  background: #c23a3a;
  border-color: #c23a3a;
}

.delete-user-btn.confirming {
  background: #a82f2f;
  border-color: #a82f2f;
  font-weight: 600;
}

.delete-user-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.tour-groups {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tour-groups li.tours-empty {
  color: #888;
  font-size: 13px;
}

.tour-group {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}

.tour-group-row,
.collection-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tour-group-row input[type="text"],
.collection-row input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
}

.tour-group-row input[type="text"]:focus,
.collection-row input[type="text"]:focus {
  outline: none;
  border-color: #1f6feb;
}

.tour-group-row button,
.collection-row button {
  flex: none;
  height: 34px;
  border: 1px solid #1f6feb;
  background: white;
  color: #1f6feb;
  font-size: 12px;
  border-radius: 6px;
  padding: 0 12px;
  cursor: pointer;
}

.tour-group-row button:hover,
.collection-row button:hover {
  background: #eaf1fe;
}

.tour-group-row button:disabled,
.collection-row button:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Selettore piu' specifico di ".tour-group-row button" (che imposta lo stile blu di base per
   ogni pulsante della riga), altrimenti quella regola generica vince a parita' di specificita'
   e il rosso non si vede mai. */
.tour-group-row .delete-tour-btn {
  border-color: #d64545;
  background: #d64545;
  color: white;
}

.tour-group-row .delete-tour-btn:hover {
  background: #c23a3a;
  border-color: #c23a3a;
}

.tour-group-row .delete-tour-btn.confirming {
  background: #a82f2f;
  border-color: #a82f2f;
  font-weight: 600;
}

/* La lista raccolta collegata a un tour compare rientrata sotto la sua riga, con un bordo a
   sinistra che rende visibile a colpo d'occhio l'appartenenza al gruppo. */
.collection-sublist {
  list-style: none;
  margin: 10px 0 0 20px;
  padding: 10px 0 0 14px;
  border-left: 2px solid #eaf1fe;
}

.collection-sublist li {
  margin-bottom: 8px;
}

.collection-sublist li:last-child {
  margin-bottom: 0;
}

.group-header {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 16px 0 8px 0;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form input[type="file"] {
  height: 38px;
  padding: 0 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}

.admin-form input[type="file"] {
  padding: 7px 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
}

.admin-form button[type="submit"] {
  height: 38px;
  border: none;
  border-radius: 8px;
  background: #1f6feb;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.admin-form button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: default;
}

.form-error,
.form-success {
  margin: 0;
  font-size: 13px;
}

.form-error {
  color: #d64545;
}

.form-success {
  color: #2ecc71;
}

.import-results {
  list-style: none;
  margin: 14px 0 0 0;
  padding: 0;
}

.import-results li {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 4px;
  background: #f4f6fa;
}

.import-results li.import-imported {
  background: #eafbf0;
  color: #1a7a41;
}

.import-results li.import-already_imported {
  background: #f4f6fa;
  color: #777;
}

.import-results li.import-unrecognized,
.import-results li.import-error {
  background: #fdeaea;
  color: #b03030;
}
