.table-history-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.table-history-container {
  background: white;
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.table-history-header {
  padding: 20px 30px;
  border-bottom: 1px solid #e9ecef;
  position: relative;
  background: white;
}

.table-history-header h2 {
  margin: 0 0 5px 0;
  color: #333;
  font-size: 1.5rem;
  font-weight: 600;
}

.history-date {
  color: #666;
  font-size: 0.9rem;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: #f5f5f5;
  color: #333;
}

.table-history-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 30px;
}

.loading,
.no-history {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 16px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.history-entry {
  display: flex;
  flex-direction: column;
  gap: 15px;
  border-radius: 12px;
  overflow: hidden;
}

.history-status {
  color: white;
  padding: 12px 20px;
  font-weight: 600;
  text-transform: capitalize;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-details {
  background: #f8f9fa;
  padding: 20px;
}

.history-time {
  color: #666;
  font-size: 0.85rem;
  margin-bottom: 15px;
  font-weight: 500;
}

.guest-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lock-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #e9ecef;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row .label {
  color: #666;
  font-size: 0.85rem;
  font-weight: 500;
  flex: 0 0 auto;
  margin-right: 20px;
}

.detail-row .value {
  color: #333;
  font-size: 0.9rem;
  text-align: right;
  flex: 1;
  word-break: break-word;
}

@media (max-width: 600px) {
  .table-history-container {
    margin: 10px;
    max-height: 90vh;
  }
  
  .table-history-header,
  .table-history-content {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  
  .detail-row .label {
    margin-right: 0;
  }
  
  .detail-row .value {
    text-align: left;
  }
}
